aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor@insightbb.com>2006-08-04 22:50:27 -0400
committerDmitry Torokhov <dtor@insightbb.com>2006-08-04 22:50:27 -0400
commitd932cb7e630cae3b6b5307b767d296ff1a597c5e (patch)
treef930d068a12a256fabef0864bcdf8e85f095369e
parent73b59a3b1c09e4bfc678400b77b96134dcfbf112 (diff)
parentf5d635f649607b09b0b4620d25d028fd2b1b7ea5 (diff)
Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into for-linus
-rw-r--r--.gitignore5
-rw-r--r--CREDITS10
-rw-r--r--Documentation/DMA-mapping.txt8
-rw-r--r--Documentation/DocBook/kernel-api.tmpl9
-rw-r--r--Documentation/RCU/whatisRCU.txt5
-rw-r--r--Documentation/SubmitChecklist76
-rw-r--r--Documentation/SubmittingPatches10
-rw-r--r--Documentation/accounting/delay-accounting.txt112
-rw-r--r--Documentation/accounting/getdelays.c396
-rw-r--r--Documentation/accounting/taskstats.txt181
-rw-r--r--Documentation/cpu-freq/user-guide.txt5
-rw-r--r--Documentation/cpu-hotplug.txt12
-rw-r--r--Documentation/devices.txt8
-rw-r--r--Documentation/drivers/edac/edac.txt152
-rw-r--r--Documentation/feature-removal-schedule.txt46
-rw-r--r--Documentation/filesystems/Locking4
-rw-r--r--Documentation/filesystems/vfs.txt4
-rw-r--r--Documentation/hwmon/abituguru32
-rw-r--r--Documentation/i2c/busses/i2c-sis96x4
-rw-r--r--Documentation/infiniband/ipoib.txt2
-rw-r--r--Documentation/initrd.txt16
-rw-r--r--Documentation/kbuild/makefiles.txt14
-rw-r--r--Documentation/kernel-parameters.txt2
-rw-r--r--Documentation/memory-barriers.txt5
-rw-r--r--Documentation/mips/time.README10
-rw-r--r--Documentation/nfsroot.txt275
-rw-r--r--Documentation/ramdisk.txt12
-rw-r--r--Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl4
-rw-r--r--Documentation/usb/proc_usb_info.txt2
-rw-r--r--Documentation/usb/usb-help.txt3
-rw-r--r--Documentation/usb/usb-serial.txt4
-rw-r--r--Documentation/x86_64/boot-options.txt7
-rw-r--r--MAINTAINERS81
-rw-r--r--Makefile9
-rw-r--r--arch/alpha/kernel/alpha_ksyms.c1
-rw-r--r--arch/alpha/kernel/err_ev7.c8
-rw-r--r--arch/alpha/kernel/osf_sys.c4
-rw-r--r--arch/alpha/kernel/process.c1
-rw-r--r--arch/alpha/kernel/setup.c52
-rw-r--r--arch/alpha/kernel/sys_ruffian.c8
-rw-r--r--arch/alpha/kernel/sys_sio.c2
-rw-r--r--arch/alpha/kernel/time.c2
-rw-r--r--arch/arm/common/gic.c3
-rw-r--r--arch/arm/common/locomo.c18
-rw-r--r--arch/arm/common/sa1111.c6
-rw-r--r--arch/arm/common/sharpsl_pm.c4
-rw-r--r--arch/arm/common/vic.c3
-rw-r--r--arch/arm/configs/ep93xx_defconfig75
-rw-r--r--arch/arm/configs/ixp2000_defconfig55
-rw-r--r--arch/arm/configs/ixp23xx_defconfig59
-rw-r--r--arch/arm/configs/lpd270_defconfig34
-rw-r--r--arch/arm/configs/onearm_defconfig36
-rw-r--r--arch/arm/kernel/bios32.c11
-rw-r--r--arch/arm/kernel/ecard.c3
-rw-r--r--arch/arm/kernel/head.S6
-rw-r--r--arch/arm/kernel/irq.c11
-rw-r--r--arch/arm/kernel/setup.c2
-rw-r--r--arch/arm/kernel/traps.c7
-rw-r--r--arch/arm/mach-at91rm9200/at91rm9200.c45
-rw-r--r--arch/arm/mach-at91rm9200/generic.h8
-rw-r--r--arch/arm/mach-at91rm9200/gpio.c3
-rw-r--r--arch/arm/mach-at91rm9200/irq.c71
-rw-r--r--arch/arm/mach-footbridge/cats-hw.c2
-rw-r--r--arch/arm/mach-imx/irq.c6
-rw-r--r--arch/arm/mach-integrator/integrator_ap.c3
-rw-r--r--arch/arm/mach-integrator/integrator_cp.c9
-rw-r--r--arch/arm/mach-iop3xx/iop321-irq.c3
-rw-r--r--arch/arm/mach-iop3xx/iop331-irq.c6
-rw-r--r--arch/arm/mach-lh7a40x/arch-kev7a400.c3
-rw-r--r--arch/arm/mach-lh7a40x/arch-lpd7a40x.c3
-rw-r--r--arch/arm/mach-lh7a40x/irq-kev7a400.c3
-rw-r--r--arch/arm/mach-lh7a40x/irq-lh7a400.c6
-rw-r--r--arch/arm/mach-lh7a40x/irq-lh7a404.c12
-rw-r--r--arch/arm/mach-lh7a40x/irq-lpd7a40x.c3
-rw-r--r--arch/arm/mach-omap1/fpga.c6
-rw-r--r--arch/arm/mach-omap1/irq.c3
-rw-r--r--arch/arm/mach-omap2/irq.c3
-rw-r--r--arch/arm/mach-pnx4008/core.c2
-rw-r--r--arch/arm/mach-pnx4008/dma.c1
-rw-r--r--arch/arm/mach-pnx4008/irq.c22
-rw-r--r--arch/arm/mach-pnx4008/time.c8
-rw-r--r--arch/arm/mach-pxa/irq.c12
-rw-r--r--arch/arm/mach-pxa/lpd270.c3
-rw-r--r--arch/arm/mach-pxa/lubbock.c3
-rw-r--r--arch/arm/mach-pxa/mainstone.c3
-rw-r--r--arch/arm/mach-s3c2410/mach-anubis.c49
-rw-r--r--arch/arm/mach-s3c2410/mach-osiris.c20
-rw-r--r--arch/arm/mach-sa1100/collie.c4
-rw-r--r--arch/arm/mach-sa1100/collie_pm.c69
-rw-r--r--arch/arm/mach-sa1100/irq.c9
-rw-r--r--arch/arm/mach-shark/irq.c3
-rw-r--r--arch/arm/mach-versatile/core.c14
-rw-r--r--arch/arm/mm/ioremap.c2
-rw-r--r--arch/arm/mm/proc-syms.c8
-rw-r--r--arch/arm/mm/proc-xscale.S30
-rw-r--r--arch/arm/nwfpe/softfloat.h2
-rw-r--r--arch/arm/plat-omap/gpio.c8
-rw-r--r--arch/arm26/kernel/setup.c2
-rw-r--r--arch/cris/arch-v10/drivers/eeprom.c4
-rw-r--r--arch/cris/arch-v10/drivers/gpio.c2
-rw-r--r--arch/cris/arch-v32/drivers/cryptocop.c2
-rw-r--r--arch/cris/arch-v32/drivers/gpio.c2
-rw-r--r--arch/cris/arch-v32/drivers/pcf8563.c2
-rw-r--r--arch/cris/arch-v32/drivers/sync_serial.c12
-rw-r--r--arch/cris/kernel/setup.c2
-rw-r--r--arch/frv/kernel/asm-offsets.c116
-rw-r--r--arch/frv/kernel/break.S34
-rw-r--r--arch/frv/kernel/debug-stub.c13
-rw-r--r--arch/frv/kernel/entry.S1
-rw-r--r--arch/frv/kernel/gdb-stub.c159
-rw-r--r--arch/frv/kernel/head.S1
-rw-r--r--arch/frv/kernel/local.h3
-rw-r--r--arch/frv/kernel/pm.c5
-rw-r--r--arch/frv/kernel/process.c15
-rw-r--r--arch/frv/kernel/switch_to.S3
-rw-r--r--arch/frv/kernel/traps.c25
-rw-r--r--arch/frv/mb93090-mb00/pci-vdk.c11
-rw-r--r--arch/i386/Kconfig2
-rw-r--r--arch/i386/defconfig2
-rw-r--r--arch/i386/kernel/Makefile3
-rw-r--r--arch/i386/kernel/cpu/cpufreq/Kconfig3
-rw-r--r--arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c3
-rw-r--r--arch/i386/kernel/cpu/cpufreq/longhaul.c221
-rw-r--r--arch/i386/kernel/cpu/intel_cacheinfo.c2
-rw-r--r--arch/i386/kernel/cpu/mcheck/mce.h2
-rw-r--r--arch/i386/kernel/crash.c2
-rw-r--r--arch/i386/kernel/entry.S2
-rw-r--r--arch/i386/kernel/ioport.c1
-rw-r--r--arch/i386/kernel/kprobes.c9
-rw-r--r--arch/i386/kernel/machine_kexec.c13
-rw-r--r--arch/i386/kernel/nmi.c1
-rw-r--r--arch/i386/kernel/process.c50
-rw-r--r--arch/i386/kernel/ptrace.c5
-rw-r--r--arch/i386/kernel/setup.c7
-rw-r--r--arch/i386/kernel/smpboot.c62
-rw-r--r--arch/i386/kernel/time.c7
-rw-r--r--arch/i386/kernel/traps.c73
-rw-r--r--arch/i386/kernel/vsyscall.lds.S1
-rw-r--r--arch/i386/lib/usercopy.c2
-rw-r--r--arch/i386/oprofile/nmi_int.c5
-rw-r--r--arch/i386/pci/common.c4
-rw-r--r--arch/i386/pci/pci.h2
-rw-r--r--arch/ia64/configs/sn2_defconfig2
-rw-r--r--arch/ia64/defconfig2
-rw-r--r--arch/ia64/dig/setup.c2
-rw-r--r--arch/ia64/hp/sim/simscsi.c4
-rw-r--r--arch/ia64/kernel/Makefile3
-rw-r--r--arch/ia64/kernel/efi.c8
-rw-r--r--arch/ia64/kernel/gate.lds.S1
-rw-r--r--arch/ia64/kernel/head.S2
-rw-r--r--arch/ia64/kernel/ia64_ksyms.c2
-rw-r--r--arch/ia64/kernel/kprobes.c9
-rw-r--r--arch/ia64/kernel/pal.S18
-rw-r--r--arch/ia64/kernel/palinfo.c47
-rw-r--r--arch/ia64/kernel/setup.c2
-rw-r--r--arch/ia64/kernel/topology.c2
-rw-r--r--arch/ia64/kernel/traps.c7
-rw-r--r--arch/ia64/kernel/uncached.c86
-rw-r--r--arch/ia64/lib/Makefile2
-rw-r--r--arch/ia64/mm/contig.c16
-rw-r--r--arch/ia64/mm/discontig.c68
-rw-r--r--arch/ia64/mm/init.c55
-rw-r--r--arch/ia64/mm/ioremap.c6
-rw-r--r--arch/ia64/pci/pci.c2
-rw-r--r--arch/ia64/sn/kernel/setup.c2
-rw-r--r--arch/ia64/sn/kernel/xpc_main.c2
-rw-r--r--arch/ia64/sn/pci/tioce_provider.c6
-rw-r--r--arch/m32r/kernel/setup.c2
-rw-r--r--arch/mips/Kconfig10
-rw-r--r--arch/mips/Kconfig.debug4
-rw-r--r--arch/mips/Makefile6
-rw-r--r--arch/mips/au1000/common/irq.c8
-rw-r--r--arch/mips/au1000/common/prom.c26
-rw-r--r--arch/mips/au1000/common/setup.c2
-rw-r--r--arch/mips/au1000/common/time.c2
-rw-r--r--arch/mips/au1000/csb250/Makefile8
-rw-r--r--arch/mips/au1000/csb250/board_setup.c238
-rw-r--r--arch/mips/au1000/csb250/init.c94
-rw-r--r--arch/mips/au1000/csb250/irqmap.c60
-rw-r--r--arch/mips/au1000/hydrogen3/Makefile9
-rw-r--r--arch/mips/au1000/hydrogen3/board_setup.c69
-rw-r--r--arch/mips/au1000/hydrogen3/init.c75
-rw-r--r--arch/mips/au1000/hydrogen3/irqmap.c56
-rw-r--r--arch/mips/au1000/pb1200/irqmap.c2
-rw-r--r--arch/mips/basler/excite/excite_dbg_io.c1
-rw-r--r--arch/mips/basler/excite/excite_device.c1
-rw-r--r--arch/mips/basler/excite/excite_iodev.c1
-rw-r--r--arch/mips/basler/excite/excite_procfs.c1
-rw-r--r--arch/mips/basler/excite/excite_prom.c1
-rw-r--r--arch/mips/basler/excite/excite_setup.c4
-rw-r--r--arch/mips/cobalt/setup.c4
-rw-r--r--arch/mips/configs/atlas_defconfig68
-rw-r--r--arch/mips/configs/bigsur_defconfig59
-rw-r--r--arch/mips/configs/capcella_defconfig49
-rw-r--r--arch/mips/configs/cobalt_defconfig46
-rw-r--r--arch/mips/configs/db1000_defconfig50
-rw-r--r--arch/mips/configs/db1100_defconfig52
-rw-r--r--arch/mips/configs/db1200_defconfig51
-rw-r--r--arch/mips/configs/db1500_defconfig66
-rw-r--r--arch/mips/configs/db1550_defconfig51
-rw-r--r--arch/mips/configs/ddb5477_defconfig46
-rw-r--r--arch/mips/configs/decstation_defconfig55
-rw-r--r--arch/mips/configs/e55_defconfig39
-rw-r--r--arch/mips/configs/emma2rh_defconfig44
-rw-r--r--arch/mips/configs/ev64120_defconfig45
-rw-r--r--arch/mips/configs/ev96100_defconfig44
-rw-r--r--arch/mips/configs/excite_defconfig135
-rw-r--r--arch/mips/configs/ip22_defconfig57
-rw-r--r--arch/mips/configs/ip27_defconfig65
-rw-r--r--arch/mips/configs/ip32_defconfig47
-rw-r--r--arch/mips/configs/it8172_defconfig45
-rw-r--r--arch/mips/configs/ivr_defconfig45
-rw-r--r--arch/mips/configs/jaguar-atx_defconfig48
-rw-r--r--arch/mips/configs/jmr3927_defconfig48
-rw-r--r--arch/mips/configs/lasat200_defconfig46
-rw-r--r--arch/mips/configs/malta_defconfig64
-rw-r--r--arch/mips/configs/mipssim_defconfig51
-rw-r--r--arch/mips/configs/mpc30x_defconfig48
-rw-r--r--arch/mips/configs/ocelot_3_defconfig55
-rw-r--r--arch/mips/configs/ocelot_c_defconfig46
-rw-r--r--arch/mips/configs/ocelot_defconfig45
-rw-r--r--arch/mips/configs/ocelot_g_defconfig46
-rw-r--r--arch/mips/configs/pb1100_defconfig48
-rw-r--r--arch/mips/configs/pb1500_defconfig50
-rw-r--r--arch/mips/configs/pb1550_defconfig50
-rw-r--r--arch/mips/configs/pnx8550-jbs_defconfig349
-rw-r--r--arch/mips/configs/pnx8550-v2pci_defconfig401
-rw-r--r--arch/mips/configs/qemu_defconfig44
-rw-r--r--arch/mips/configs/rbhma4500_defconfig64
-rw-r--r--arch/mips/configs/rm200_defconfig74
-rw-r--r--arch/mips/configs/sb1250-swarm_defconfig51
-rw-r--r--arch/mips/configs/sead_defconfig38
-rw-r--r--arch/mips/configs/tb0226_defconfig55
-rw-r--r--arch/mips/configs/tb0229_defconfig55
-rw-r--r--arch/mips/configs/tb0287_defconfig55
-rw-r--r--arch/mips/configs/workpad_defconfig44
-rw-r--r--arch/mips/configs/wrppmc_defconfig88
-rw-r--r--arch/mips/configs/yosemite_defconfig58
-rw-r--r--arch/mips/ddb5xxx/ddb5477/irq.c1
-rw-r--r--arch/mips/ddb5xxx/ddb5477/irq_5477.c2
-rw-r--r--arch/mips/ddb5xxx/ddb5477/setup.c6
-rw-r--r--arch/mips/dec/ioasic-irq.c4
-rw-r--r--arch/mips/dec/kn02-irq.c2
-rw-r--r--arch/mips/dec/setup.c2
-rw-r--r--arch/mips/dec/time.c2
-rw-r--r--arch/mips/defconfig57
-rw-r--r--arch/mips/emma2rh/common/irq.c1
-rw-r--r--arch/mips/emma2rh/common/irq_emma2rh.c2
-rw-r--r--arch/mips/emma2rh/common/prom.c1
-rw-r--r--arch/mips/emma2rh/markeins/irq.c1
-rw-r--r--arch/mips/emma2rh/markeins/irq_markeins.c4
-rw-r--r--arch/mips/emma2rh/markeins/platform.c1
-rw-r--r--arch/mips/emma2rh/markeins/setup.c4
-rw-r--r--arch/mips/gt64120/ev64120/irq.c4
-rw-r--r--arch/mips/gt64120/wrppmc/setup.c3
-rw-r--r--arch/mips/gt64120/wrppmc/time.c3
-rw-r--r--arch/mips/ite-boards/generic/irq.c4
-rw-r--r--arch/mips/ite-boards/generic/it8172_setup.c5
-rw-r--r--arch/mips/ite-boards/generic/time.c3
-rw-r--r--arch/mips/jazz/irq.c2
-rw-r--r--arch/mips/jazz/setup.c3
-rw-r--r--arch/mips/jmr3927/rbhma3100/irq.c2
-rw-r--r--arch/mips/jmr3927/rbhma3100/setup.c5
-rw-r--r--arch/mips/kernel/apm.c1
-rw-r--r--arch/mips/kernel/cpu-probe.c6
-rw-r--r--arch/mips/kernel/entry.S15
-rw-r--r--arch/mips/kernel/gdb-low.S2
-rw-r--r--arch/mips/kernel/genex.S8
-rw-r--r--arch/mips/kernel/head.S3
-rw-r--r--arch/mips/kernel/i8259.c2
-rw-r--r--arch/mips/kernel/irixelf.c2
-rw-r--r--arch/mips/kernel/irq-msc01.c4
-rw-r--r--arch/mips/kernel/irq-mv6434x.c2
-rw-r--r--arch/mips/kernel/irq-rm7000.c2
-rw-r--r--arch/mips/kernel/irq-rm9000.c4
-rw-r--r--arch/mips/kernel/irq.c2
-rw-r--r--arch/mips/kernel/irq_cpu.c4
-rw-r--r--arch/mips/kernel/mips-mt.c1
-rw-r--r--arch/mips/kernel/scall32-o32.S17
-rw-r--r--arch/mips/kernel/scall64-64.S4
-rw-r--r--arch/mips/kernel/scall64-n32.S4
-rw-r--r--arch/mips/kernel/scall64-o32.S4
-rw-r--r--arch/mips/kernel/setup.c2
-rw-r--r--arch/mips/kernel/smp.c35
-rw-r--r--arch/mips/kernel/smtc-asm.S1
-rw-r--r--arch/mips/kernel/smtc.c60
-rw-r--r--arch/mips/kernel/time.c5
-rw-r--r--arch/mips/kernel/traps.c24
-rw-r--r--arch/mips/kernel/vpe.c1
-rw-r--r--arch/mips/lasat/interrupt.c2
-rw-r--r--arch/mips/lasat/setup.c8
-rw-r--r--arch/mips/mips-boards/atlas/atlas_int.c2
-rw-r--r--arch/mips/mips-boards/atlas/atlas_setup.c2
-rw-r--r--arch/mips/mips-boards/generic/memory.c50
-rw-r--r--arch/mips/mips-boards/generic/time.c8
-rw-r--r--arch/mips/mips-boards/malta/malta_setup.c4
-rw-r--r--arch/mips/mips-boards/sead/sead_setup.c2
-rw-r--r--arch/mips/mips-boards/sim/Makefile3
-rw-r--r--arch/mips/mips-boards/sim/sim_IRQ.c147
-rw-r--r--arch/mips/mips-boards/sim/sim_irq.S100
-rw-r--r--arch/mips/mips-boards/sim/sim_setup.c2
-rw-r--r--arch/mips/mips-boards/sim/sim_time.c4
-rw-r--r--arch/mips/mm/c-r4k.c21
-rw-r--r--arch/mips/mm/init.c65
-rw-r--r--arch/mips/mm/pgtable.c2
-rw-r--r--arch/mips/mm/tlbex.c159
-rw-r--r--arch/mips/momentum/jaguar_atx/setup.c3
-rw-r--r--arch/mips/momentum/ocelot_3/setup.c3
-rw-r--r--arch/mips/momentum/ocelot_c/cpci-irq.c2
-rw-r--r--arch/mips/momentum/ocelot_c/setup.c3
-rw-r--r--arch/mips/momentum/ocelot_c/uart-irq.c2
-rw-r--r--arch/mips/oprofile/op_model_mipsxx.c2
-rw-r--r--arch/mips/pci/fixup-emma2rh.c1
-rw-r--r--arch/mips/pci/fixup-mpc30x.c1
-rw-r--r--arch/mips/pci/ops-emma2rh.c1
-rw-r--r--arch/mips/pci/pci-emma2rh.c1
-rw-r--r--arch/mips/philips/pnx8550/common/int.c2
-rw-r--r--arch/mips/philips/pnx8550/common/setup.c5
-rw-r--r--arch/mips/philips/pnx8550/common/time.c11
-rw-r--r--arch/mips/pmc-sierra/yosemite/setup.c3
-rw-r--r--arch/mips/qemu/q-reset.c1
-rw-r--r--arch/mips/qemu/q-setup.c4
-rw-r--r--arch/mips/sgi-ip22/ip22-eisa.c4
-rw-r--r--arch/mips/sgi-ip22/ip22-int.c10
-rw-r--r--arch/mips/sgi-ip22/ip22-time.c10
-rw-r--r--arch/mips/sgi-ip27/ip27-irq.c4
-rw-r--r--arch/mips/sgi-ip27/ip27-timer.c23
-rw-r--r--arch/mips/sgi-ip32/ip32-irq.c20
-rw-r--r--arch/mips/sgi-ip32/ip32-setup.c4
-rw-r--r--arch/mips/sibyte/bcm1480/irq.c17
-rw-r--r--arch/mips/sibyte/sb1250/irq.c18
-rw-r--r--arch/mips/sibyte/swarm/setup.c5
-rw-r--r--arch/mips/sni/irq.c2
-rw-r--r--arch/mips/sni/setup.c5
-rw-r--r--arch/mips/tx4927/common/tx4927_irq.c4
-rw-r--r--arch/mips/tx4927/common/tx4927_setup.c4
-rw-r--r--arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c4
-rw-r--r--arch/mips/tx4938/common/irq.c4
-rw-r--r--arch/mips/tx4938/common/setup.c5
-rw-r--r--arch/mips/tx4938/toshiba_rbtx4938/irq.c2
-rw-r--r--arch/mips/vr41xx/Kconfig6
-rw-r--r--arch/mips/vr41xx/casio-e55/setup.c15
-rw-r--r--arch/mips/vr41xx/common/Makefile3
-rw-r--r--arch/mips/vr41xx/common/icu.c45
-rw-r--r--arch/mips/vr41xx/common/init.c4
-rw-r--r--arch/mips/vr41xx/common/irq.c4
-rw-r--r--arch/mips/vr41xx/common/vrc4173.c581
-rw-r--r--arch/mips/vr41xx/ibm-workpad/setup.c15
-rw-r--r--arch/mips/vr41xx/nec-cmbvr4133/irq.c2
-rw-r--r--arch/parisc/kernel/pdc_cons.c2
-rw-r--r--arch/parisc/kernel/vmlinux.lds.S1
-rw-r--r--arch/powerpc/Kconfig2
-rw-r--r--arch/powerpc/configs/pmac32_defconfig112
-rw-r--r--arch/powerpc/kernel/head_64.S35
-rw-r--r--arch/powerpc/kernel/ibmebus.c2
-rw-r--r--arch/powerpc/kernel/irq.c47
-rw-r--r--arch/powerpc/kernel/legacy_serial.c13
-rw-r--r--arch/powerpc/kernel/misc_64.S2
-rw-r--r--arch/powerpc/kernel/pci_32.c36
-rw-r--r--arch/powerpc/kernel/pci_64.c36
-rw-r--r--arch/powerpc/kernel/ppc_ksyms.c2
-rw-r--r--arch/powerpc/kernel/prom_init.c36
-rw-r--r--arch/powerpc/kernel/prom_parse.c2
-rw-r--r--arch/powerpc/kernel/setup-common.c2
-rw-r--r--arch/powerpc/kernel/smp.c24
-rw-r--r--arch/powerpc/kernel/sysfs.c4
-rw-r--r--arch/powerpc/kernel/traps.c10
-rw-r--r--arch/powerpc/kernel/udbg_16550.c6
-rw-r--r--arch/powerpc/kernel/vdso32/Makefile3
-rw-r--r--arch/powerpc/kernel/vdso32/vdso32.lds.S1
-rw-r--r--arch/powerpc/kernel/vdso64/Makefile3
-rw-r--r--arch/powerpc/kernel/vdso64/vdso64.lds.S1
-rw-r--r--arch/powerpc/mm/lmb.c3
-rw-r--r--arch/powerpc/platforms/cell/interrupt.c4
-rw-r--r--arch/powerpc/platforms/cell/spider-pic.c70
-rw-r--r--arch/powerpc/platforms/cell/spu_base.c6
-rw-r--r--arch/powerpc/platforms/chrp/setup.c12
-rw-r--r--arch/powerpc/platforms/iseries/irq.c4
-rw-r--r--arch/powerpc/platforms/maple/setup.c17
-rw-r--r--arch/powerpc/platforms/powermac/backlight.c85
-rw-r--r--arch/powerpc/platforms/powermac/bootx_init.c35
-rw-r--r--arch/powerpc/platforms/powermac/cpufreq_64.c78
-rw-r--r--arch/powerpc/platforms/powermac/pci.c13
-rw-r--r--arch/powerpc/platforms/powermac/pic.c8
-rw-r--r--arch/powerpc/platforms/pseries/ras.c3
-rw-r--r--arch/powerpc/platforms/pseries/setup.c6
-rw-r--r--arch/powerpc/platforms/pseries/xics.c34
-rw-r--r--arch/powerpc/sysdev/i8259.c4
-rw-r--r--arch/powerpc/sysdev/mpic.c210
-rw-r--r--arch/ppc/kernel/ppc_ksyms.c2
-rw-r--r--arch/ppc/kernel/setup.c2
-rw-r--r--arch/ppc/kernel/vmlinux.lds.S1
-rw-r--r--arch/ppc/platforms/prep_setup.c2
-rw-r--r--arch/s390/Kconfig7
-rw-r--r--arch/s390/appldata/appldata_base.c10
-rw-r--r--arch/s390/defconfig44
-rw-r--r--arch/s390/hypfs/hypfs_diag.c2
-rw-r--r--arch/s390/kernel/Makefile4
-rw-r--r--arch/s390/kernel/compat_linux.c19
-rw-r--r--arch/s390/kernel/head31.S4
-rw-r--r--arch/s390/kernel/head64.S4
-rw-r--r--arch/s390/kernel/machine_kexec.c1
-rw-r--r--arch/s390/kernel/module.c2
-rw-r--r--arch/s390/kernel/process.c2
-rw-r--r--arch/s390/kernel/profile.c2
-rw-r--r--arch/s390/kernel/s390_ext.c2
-rw-r--r--arch/s390/kernel/setup.c46
-rw-r--r--arch/s390/kernel/time.c2
-rw-r--r--arch/s390/kernel/traps.c18
-rw-r--r--arch/s390/lib/string.c4
-rw-r--r--arch/s390/mm/cmm.c2
-rw-r--r--arch/s390/mm/fault.c2
-rw-r--r--arch/sh/kernel/setup.c2
-rw-r--r--arch/sh64/kernel/setup.c2
-rw-r--r--arch/sh64/kernel/sh_ksyms.c2
-rw-r--r--arch/sparc/kernel/devices.c25
-rw-r--r--arch/sparc/kernel/irq.c2
-rw-r--r--arch/sparc/kernel/of_device.c207
-rw-r--r--arch/sparc/kernel/prom.c9
-rw-r--r--arch/sparc/kernel/setup.c2
-rw-r--r--arch/sparc/kernel/smp.c96
-rw-r--r--arch/sparc/kernel/sparc_ksyms.c1
-rw-r--r--arch/sparc/kernel/sun4d_smp.c103
-rw-r--r--arch/sparc/kernel/sys_sparc.c18
-rw-r--r--arch/sparc/kernel/time.c74
-rw-r--r--arch/sparc/mm/io-unit.c1
-rw-r--r--arch/sparc/prom/tree.c18
-rw-r--r--arch/sparc64/Kconfig2
-rw-r--r--arch/sparc64/defconfig41
-rw-r--r--arch/sparc64/kernel/devices.c3
-rw-r--r--arch/sparc64/kernel/head.S13
-rw-r--r--arch/sparc64/kernel/of_device.c348
-rw-r--r--arch/sparc64/kernel/pci_psycho.c6
-rw-r--r--arch/sparc64/kernel/prom.c65
-rw-r--r--arch/sparc64/kernel/setup.c2
-rw-r--r--arch/sparc64/kernel/sparc64_ksyms.c11
-rw-r--r--arch/sparc64/kernel/sys_sparc.c18
-rw-r--r--arch/sparc64/kernel/time.c7
-rw-r--r--arch/sparc64/mm/fault.c3
-rw-r--r--arch/sparc64/prom/tree.c85
-rw-r--r--arch/um/Kconfig.debug9
-rw-r--r--arch/um/Makefile-x86_641
-rw-r--r--arch/um/defconfig1
-rw-r--r--arch/um/drivers/mconsole_user.c7
-rw-r--r--arch/um/drivers/net_user.c80
-rw-r--r--arch/um/drivers/tty.c31
-rw-r--r--arch/um/drivers/ubd_kern.c1
-rw-r--r--arch/um/include/irq_user.h9
-rw-r--r--arch/um/include/kern_util.h2
-rw-r--r--arch/um/include/longjmp.h4
-rw-r--r--arch/um/include/os.h74
-rw-r--r--arch/um/include/skas/mode_kern_skas.h3
-rw-r--r--arch/um/include/tt/mode_kern_tt.h3
-rw-r--r--arch/um/kernel/Makefile10
-rw-r--r--arch/um/kernel/dyn.lds.S1
-rw-r--r--arch/um/kernel/exec.c (renamed from arch/um/kernel/exec_kern.c)13
-rw-r--r--arch/um/kernel/irq.c62
-rw-r--r--arch/um/kernel/ksyms.c6
-rw-r--r--arch/um/kernel/mem.c11
-rw-r--r--arch/um/kernel/physmem.c2
-rw-r--r--arch/um/kernel/sigio.c (renamed from arch/um/kernel/sigio_kern.c)16
-rw-r--r--arch/um/kernel/signal.c (renamed from arch/um/kernel/signal_kern.c)10
-rw-r--r--arch/um/kernel/skas/mem.c24
-rw-r--r--arch/um/kernel/skas/process_kern.c2
-rw-r--r--arch/um/kernel/skas/syscall.c7
-rw-r--r--arch/um/kernel/syscall.c174
-rw-r--r--arch/um/kernel/syscall_kern.c166
-rw-r--r--arch/um/kernel/time.c (renamed from arch/um/kernel/time_kern.c)84
-rw-r--r--arch/um/kernel/trap.c (renamed from arch/um/kernel/trap_kern.c)18
-rw-r--r--arch/um/kernel/tt/exec_kern.c2
-rw-r--r--arch/um/kernel/tt/mem.c21
-rw-r--r--arch/um/kernel/tt/process_kern.c2
-rw-r--r--arch/um/kernel/tt/syscall_kern.c12
-rw-r--r--arch/um/kernel/tt/tracer.c22
-rw-r--r--arch/um/kernel/um_arch.c9
-rw-r--r--arch/um/kernel/uml.lds.S13
-rw-r--r--arch/um/kernel/vmlinux.lds.S2
-rw-r--r--arch/um/os-Linux/file.c143
-rw-r--r--arch/um/os-Linux/irq.c16
-rw-r--r--arch/um/os-Linux/process.c27
-rw-r--r--arch/um/os-Linux/sigio.c33
-rw-r--r--arch/um/os-Linux/signal.c23
-rw-r--r--arch/um/os-Linux/skas/process.c18
-rw-r--r--arch/um/os-Linux/time.c23
-rw-r--r--arch/um/os-Linux/uaccess.c3
-rw-r--r--arch/v850/kernel/setup.c6
-rw-r--r--arch/v850/kernel/v850_ksyms.c16
-rw-r--r--arch/x86_64/defconfig39
-rw-r--r--arch/x86_64/ia32/Makefile1
-rw-r--r--arch/x86_64/ia32/ia32_binfmt.c2
-rw-r--r--arch/x86_64/ia32/ia32entry.S2
-rw-r--r--arch/x86_64/ia32/ptrace32.c13
-rw-r--r--arch/x86_64/ia32/vsyscall.lds1
-rw-r--r--arch/x86_64/kernel/e820.c1
-rw-r--r--arch/x86_64/kernel/early_printk.c2
-rw-r--r--arch/x86_64/kernel/entry.S18
-rw-r--r--arch/x86_64/kernel/machine_kexec.c13
-rw-r--r--arch/x86_64/kernel/mce.c12
-rw-r--r--arch/x86_64/kernel/mce_amd.c21
-rw-r--r--arch/x86_64/kernel/pci-calgary.c83
-rw-r--r--arch/x86_64/kernel/pci-nommu.c2
-rw-r--r--arch/x86_64/kernel/pci-swiotlb.c5
-rw-r--r--arch/x86_64/kernel/setup.c2
-rw-r--r--arch/x86_64/kernel/smpboot.c4
-rw-r--r--arch/x86_64/kernel/tce.c10
-rw-r--r--arch/x86_64/kernel/time.c18
-rw-r--r--arch/x86_64/kernel/traps.c28
-rw-r--r--arch/x86_64/pci/k8-bus.c10
-rw-r--r--arch/xtensa/kernel/setup.c2
-rw-r--r--arch/xtensa/kernel/traps.c8
-rw-r--r--block/blktrace.c5
-rw-r--r--block/cfq-iosched.c2
-rw-r--r--block/ioctl.c4
-rw-r--r--block/ll_rw_blk.c4
-rw-r--r--drivers/acpi/Kconfig6
-rw-r--r--drivers/acpi/ac.c2
-rw-r--r--drivers/acpi/battery.c6
-rw-r--r--drivers/acpi/bus.c4
-rw-r--r--drivers/acpi/button.c4
-rw-r--r--drivers/acpi/cm_sbs.c46
-rw-r--r--drivers/acpi/dispatcher/dsinit.c10
-rw-r--r--drivers/acpi/dispatcher/dsmethod.c23
-rw-r--r--drivers/acpi/dispatcher/dswexec.c4
-rw-r--r--drivers/acpi/dock.c14
-rw-r--r--drivers/acpi/ec.c2
-rw-r--r--drivers/acpi/event.c2
-rw-r--r--drivers/acpi/events/evregion.c44
-rw-r--r--drivers/acpi/events/evxface.c44
-rw-r--r--drivers/acpi/events/evxfregn.c13
-rw-r--r--drivers/acpi/executer/exconfig.c1
-rw-r--r--drivers/acpi/executer/exconvrt.c3
-rw-r--r--drivers/acpi/executer/exmutex.c4
-rw-r--r--drivers/acpi/executer/exsystem.c8
-rw-r--r--drivers/acpi/fan.c2
-rw-r--r--drivers/acpi/hotkey.c10
-rw-r--r--drivers/acpi/namespace/nsalloc.c13
-rw-r--r--drivers/acpi/osl.c90
-rw-r--r--drivers/acpi/parser/psutils.c2
-rw-r--r--drivers/acpi/pci_link.c7
-rw-r--r--drivers/acpi/power.c2
-rw-r--r--drivers/acpi/processor_core.c2
-rw-r--r--drivers/acpi/processor_idle.c2
-rw-r--r--drivers/acpi/sleep/proc.c6
-rw-r--r--drivers/acpi/system.c6
-rw-r--r--drivers/acpi/tables/tbget.c12
-rw-r--r--drivers/acpi/tables/tbinstal.c21
-rw-r--r--drivers/acpi/tables/tbrsdt.c27
-rw-r--r--drivers/acpi/tables/tbxface.c32
-rw-r--r--drivers/acpi/thermal.c27
-rw-r--r--drivers/acpi/utilities/utalloc.c2
-rw-r--r--drivers/acpi/utilities/utdebug.c4
-rw-r--r--drivers/acpi/utilities/utdelete.c13
-rw-r--r--drivers/acpi/utilities/utmisc.c25
-rw-r--r--drivers/acpi/utilities/utmutex.c8
-rw-r--r--drivers/acpi/utilities/utstate.c7
-rw-r--r--drivers/atm/Kconfig2
-rw-r--r--drivers/base/Kconfig2
-rw-r--r--drivers/base/bus.c5
-rw-r--r--drivers/base/core.c30
-rw-r--r--drivers/base/topology.c2
-rw-r--r--drivers/block/Kconfig10
-rw-r--r--drivers/block/aoe/aoechr.c2
-rw-r--r--drivers/block/cciss.c86
-rw-r--r--drivers/block/cpqarray.c2
-rw-r--r--drivers/block/nbd.c19
-rw-r--r--drivers/block/pktcdvd.c6
-rw-r--r--drivers/block/rd.c2
-rw-r--r--drivers/bluetooth/bcm203x.c1
-rw-r--r--drivers/bluetooth/hci_ldisc.c4
-rw-r--r--drivers/bluetooth/hci_usb.c25
-rw-r--r--drivers/cdrom/cdrom.c2
-rw-r--r--drivers/char/hvsi.c2
-rw-r--r--drivers/char/hw_random/geode-rng.c6
-rw-r--r--drivers/char/hw_random/intel-rng.c2
-rw-r--r--drivers/char/ip2/ip2main.c7
-rw-r--r--drivers/char/mem.c4
-rw-r--r--drivers/char/nsc_gpio.c6
-rw-r--r--drivers/char/pc8736x_gpio.c58
-rw-r--r--drivers/char/pcmcia/synclink_cs.c14
-rw-r--r--drivers/char/rtc.c47
-rw-r--r--drivers/char/scx200_gpio.c72
-rw-r--r--drivers/char/snsc.c7
-rw-r--r--drivers/char/snsc_event.c15
-rw-r--r--drivers/char/specialix.c6
-rw-r--r--drivers/char/synclink.c14
-rw-r--r--drivers/char/synclink_gt.c14
-rw-r--r--drivers/char/synclinkmp.c14
-rw-r--r--drivers/char/tpm/tpm.c1
-rw-r--r--drivers/char/tpm/tpm_tis.c77
-rw-r--r--drivers/char/vr41xx_giu.c1
-rw-r--r--drivers/connector/cn_proc.c20
-rw-r--r--drivers/cpufreq/cpufreq.c119
-rw-r--r--drivers/cpufreq/cpufreq_conservative.c2
-rw-r--r--drivers/cpufreq/cpufreq_ondemand.c20
-rw-r--r--drivers/cpufreq/cpufreq_userspace.c3
-rw-r--r--drivers/crypto/padlock-aes.c9
-rw-r--r--drivers/dma/ioatdma.c2
-rw-r--r--drivers/edac/edac_mc.c687
-rw-r--r--drivers/fc4/fc.c4
-rw-r--r--drivers/hwmon/abituguru.c21
-rw-r--r--drivers/i2c/algos/i2c-algo-bit.c4
-rw-r--r--drivers/i2c/algos/i2c-algo-ite.c4
-rw-r--r--drivers/i2c/algos/i2c-algo-pca.c6
-rw-r--r--drivers/i2c/algos/i2c-algo-pcf.c8
-rw-r--r--drivers/i2c/algos/i2c-algo-sibyte.c4
-rw-r--r--drivers/i2c/busses/i2c-iop3xx.c17
-rw-r--r--drivers/i2c/busses/i2c-iop3xx.h2
-rw-r--r--drivers/i2c/busses/i2c-powermac.c4
-rw-r--r--drivers/i2c/busses/scx200_acb.c20
-rw-r--r--drivers/i2c/chips/pca9539.c12
-rw-r--r--drivers/i2c/i2c-core.c4
-rw-r--r--drivers/ide/Kconfig15
-rw-r--r--drivers/ide/ide-disk.c2
-rw-r--r--drivers/ide/ide-dma.c2
-rw-r--r--drivers/ide/ide-iops.c2
-rw-r--r--drivers/ide/ide.c5
-rw-r--r--drivers/ide/legacy/ide-cs.c81
-rw-r--r--drivers/ide/pci/generic.c8
-rw-r--r--drivers/ide/pci/it821x.c11
-rw-r--r--drivers/infiniband/core/addr.c30
-rw-r--r--drivers/infiniband/core/cm.c25
-rw-r--r--drivers/infiniband/core/cma.c22
-rw-r--r--drivers/infiniband/core/fmr_pool.c8
-rw-r--r--drivers/infiniband/core/mad.c22
-rw-r--r--drivers/infiniband/core/sa_query.c10
-rw-r--r--drivers/infiniband/core/user_mad.c87
-rw-r--r--drivers/infiniband/core/uverbs.h2
-rw-r--r--drivers/infiniband/core/uverbs_cmd.c42
-rw-r--r--drivers/infiniband/core/uverbs_main.c8
-rw-r--r--drivers/infiniband/hw/ipath/ipath_driver.c76
-rw-r--r--drivers/infiniband/hw/ipath/ipath_keys.c15
-rw-r--r--drivers/infiniband/hw/ipath/ipath_verbs.c5
-rw-r--r--drivers/infiniband/hw/mthca/mthca_allocator.c15
-rw-r--r--drivers/infiniband/hw/mthca/mthca_av.c5
-rw-r--r--drivers/infiniband/hw/mthca/mthca_cmd.c5
-rw-r--r--drivers/infiniband/hw/mthca/mthca_qp.c13
-rw-r--r--drivers/infiniband/hw/mthca/mthca_srq.c3
-rw-r--r--drivers/infiniband/ulp/ipoib/Kconfig3
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib.h1
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_main.c23
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_multicast.c8
-rw-r--r--drivers/infiniband/ulp/iser/iser_verbs.c2
-rw-r--r--drivers/infiniband/ulp/srp/ib_srp.c22
-rw-r--r--drivers/isdn/hisax/asuscom.c6
-rw-r--r--drivers/isdn/hisax/avm_a1.c2
-rw-r--r--drivers/isdn/hisax/avm_pci.c8
-rw-r--r--drivers/isdn/hisax/bkm_a4t.c4
-rw-r--r--drivers/isdn/hisax/bkm_a8.c16
-rw-r--r--drivers/isdn/hisax/config.c2
-rw-r--r--drivers/isdn/hisax/diva.c14
-rw-r--r--drivers/isdn/hisax/enternow_pci.c4
-rw-r--r--drivers/isdn/hisax/gazel.c8
-rw-r--r--drivers/isdn/hisax/hfc4s8s_l1.c2
-rw-r--r--drivers/isdn/hisax/hfc_2bds0.c4
-rw-r--r--drivers/isdn/hisax/hfc_2bs0.c4
-rw-r--r--drivers/isdn/hisax/hfc_pci.c6
-rw-r--r--drivers/isdn/hisax/hfcscard.c6
-rw-r--r--drivers/isdn/hisax/icc.c8
-rw-r--r--drivers/isdn/hisax/icc.h2
-rw-r--r--drivers/isdn/hisax/ipacx.c18
-rw-r--r--drivers/isdn/hisax/isurf.c4
-rw-r--r--drivers/isdn/hisax/ix1_micro.c6
-rw-r--r--drivers/isdn/hisax/jade.c6
-rw-r--r--drivers/isdn/hisax/mic.c2
-rw-r--r--drivers/isdn/hisax/netjet.c2
-rw-r--r--drivers/isdn/hisax/niccy.c4
-rw-r--r--drivers/isdn/hisax/nj_s.c4
-rw-r--r--drivers/isdn/hisax/nj_u.c4
-rw-r--r--drivers/isdn/hisax/s0box.c2
-rw-r--r--drivers/isdn/hisax/saphir.c2
-rw-r--r--drivers/isdn/hisax/sportster.c4
-rw-r--r--drivers/isdn/hisax/teleint.c2
-rw-r--r--drivers/isdn/hisax/teles0.c2
-rw-r--r--drivers/isdn/hisax/telespci.c4
-rw-r--r--drivers/isdn/hisax/w6692.c10
-rw-r--r--drivers/isdn/i4l/isdn_common.c12
-rw-r--r--drivers/isdn/i4l/isdn_ppp.c2
-rw-r--r--drivers/leds/Kconfig7
-rw-r--r--drivers/leds/Makefile1
-rw-r--r--drivers/leds/leds-net48xx.c116
-rw-r--r--drivers/macintosh/Kconfig14
-rw-r--r--drivers/macintosh/adbhid.c14
-rw-r--r--drivers/macintosh/macio_asic.c2
-rw-r--r--drivers/macintosh/smu.c53
-rw-r--r--drivers/macintosh/therm_pm72.c218
-rw-r--r--drivers/macintosh/therm_pm72.h33
-rw-r--r--drivers/macintosh/via-pmu-backlight.c68
-rw-r--r--drivers/macintosh/via-pmu-led.c2
-rw-r--r--drivers/macintosh/via-pmu.c39
-rw-r--r--drivers/md/md.c86
-rw-r--r--drivers/md/raid1.c5
-rw-r--r--drivers/md/raid10.c4
-rw-r--r--drivers/md/raid5.c84
-rw-r--r--drivers/media/dvb/dvb-core/dvb_frontend.c15
-rw-r--r--drivers/media/dvb/frontends/dvb-pll.c24
-rw-r--r--drivers/media/dvb/frontends/nxt200x.c4
-rw-r--r--drivers/media/dvb/frontends/or51211.c2
-rw-r--r--drivers/media/dvb/frontends/sp8870.c2
-rw-r--r--drivers/media/dvb/frontends/sp887x.c2
-rw-r--r--drivers/media/dvb/ttpci/av7110.c4
-rw-r--r--drivers/media/dvb/ttpci/av7110_v4l.c12
-rw-r--r--drivers/media/dvb/ttpci/budget-av.c3
-rw-r--r--drivers/media/dvb/ttpci/budget-ci.c2
-rw-r--r--drivers/media/dvb/ttpci/budget-core.c57
-rw-r--r--drivers/media/dvb/ttpci/budget-patch.c2
-rw-r--r--drivers/media/dvb/ttpci/budget.c5
-rw-r--r--drivers/media/dvb/ttpci/budget.h7
-rw-r--r--drivers/media/video/Kconfig4
-rw-r--r--drivers/media/video/bt8xx/Kconfig2
-rw-r--r--drivers/media/video/bt8xx/bttv-driver.c15
-rw-r--r--drivers/media/video/bt8xx/bttv-vbi.c15
-rw-r--r--drivers/media/video/compat_ioctl32.c24
-rw-r--r--drivers/media/video/cpia2/Kconfig2
-rw-r--r--drivers/media/video/cx88/cx88-blackbird.c3
-rw-r--r--drivers/media/video/cx88/cx88-input.c2
-rw-r--r--drivers/media/video/cx88/cx88-video.c5
-rw-r--r--drivers/media/video/msp3400-driver.c10
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw.c8
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-io.c9
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-io.h2
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-ioread.c5
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-sysfs.c85
-rw-r--r--drivers/media/video/saa7134/saa7134-alsa.c10
-rw-r--r--drivers/media/video/saa7134/saa7134-core.c16
-rw-r--r--drivers/media/video/saa7134/saa7134-oss.c10
-rw-r--r--drivers/media/video/saa7134/saa7134-video.c6
-rw-r--r--drivers/media/video/saa7134/saa7134.h4
-rw-r--r--drivers/media/video/stradis.c1
-rw-r--r--drivers/media/video/tuner-core.c31
-rw-r--r--drivers/media/video/tuner-simple.c19
-rw-r--r--drivers/media/video/usbvideo/Kconfig8
-rw-r--r--drivers/media/video/v4l2-common.c24
-rw-r--r--drivers/media/video/videodev.c29
-rw-r--r--drivers/media/video/vivi.c4
-rw-r--r--drivers/message/fusion/Kconfig2
-rw-r--r--drivers/message/fusion/Makefile1
-rw-r--r--drivers/message/fusion/mptbase.c99
-rw-r--r--drivers/message/fusion/mptbase.h13
-rw-r--r--drivers/message/fusion/mptctl.c4
-rw-r--r--drivers/message/fusion/mptctl.h5
-rw-r--r--drivers/message/fusion/mptfc.c14
-rw-r--r--drivers/message/fusion/mptsas.c109
-rw-r--r--drivers/message/fusion/mptscsih.c118
-rw-r--r--drivers/message/fusion/mptspi.c10
-rw-r--r--drivers/message/i2o/core.h3
-rw-r--r--drivers/message/i2o/i2o_config.c4
-rw-r--r--drivers/mfd/ucb1x00-core.c2
-rw-r--r--drivers/mfd/ucb1x00.h1
-rw-r--r--drivers/mmc/sdhci.c6
-rw-r--r--drivers/net/3c59x.c166
-rw-r--r--drivers/net/8139cp.c35
-rw-r--r--drivers/net/8139too.c39
-rw-r--r--drivers/net/appletalk/Kconfig2
-rw-r--r--drivers/net/b44.c27
-rw-r--r--drivers/net/bnx2.c32
-rw-r--r--drivers/net/cassini.c25
-rw-r--r--drivers/net/chelsio/sge.c2
-rw-r--r--drivers/net/declance.c7
-rw-r--r--drivers/net/dl2k.c43
-rw-r--r--drivers/net/dummy.c1
-rw-r--r--drivers/net/e1000/e1000.h13
-rw-r--r--drivers/net/e1000/e1000_ethtool.c141
-rw-r--r--drivers/net/e1000/e1000_hw.c1772
-rw-r--r--drivers/net/e1000/e1000_hw.h398
-rw-r--r--drivers/net/e1000/e1000_main.c446
-rw-r--r--drivers/net/e1000/e1000_osdep.h13
-rw-r--r--drivers/net/e1000/e1000_param.c199
-rw-r--r--drivers/net/eepro100.c6
-rw-r--r--drivers/net/epic100.c93
-rw-r--r--drivers/net/fealnx.c36
-rw-r--r--drivers/net/forcedeth.c51
-rw-r--r--drivers/net/gt96100eth.c3
-rw-r--r--drivers/net/gt96100eth.h2
-rw-r--r--drivers/net/hamachi.c16
-rw-r--r--drivers/net/hamradio/bpqether.c7
-rw-r--r--drivers/net/ifb.c1
-rw-r--r--drivers/net/irda/ali-ircc.c3
-rw-r--r--drivers/net/irda/smsc-ircc2.c2
-rw-r--r--drivers/net/ixgb/ixgb_main.c6
-rw-r--r--drivers/net/loopback.c2
-rw-r--r--drivers/net/myri10ge/myri10ge.c58
-rw-r--r--drivers/net/natsemi.c117
-rw-r--r--drivers/net/ne2k-pci.c9
-rw-r--r--drivers/net/ni5010.c52
-rw-r--r--drivers/net/ns83820.c41
-rw-r--r--drivers/net/pci-skeleton.c19
-rw-r--r--drivers/net/pcnet32.c520
-rw-r--r--drivers/net/phy/cicada.c42
-rw-r--r--drivers/net/phy/phy.c8
-rw-r--r--drivers/net/r8169.c40
-rw-r--r--drivers/net/s2io.c671
-rw-r--r--drivers/net/s2io.h15
-rw-r--r--drivers/net/sk98lin/h/xmac_ii.h2
-rw-r--r--drivers/net/skge.c5
-rw-r--r--drivers/net/skge.h4
-rw-r--r--drivers/net/sky2.c52
-rw-r--r--drivers/net/sky2.h2
-rw-r--r--drivers/net/smc91x.h18
-rw-r--r--drivers/net/spider_net.c580
-rw-r--r--drivers/net/spider_net.h73
-rw-r--r--drivers/net/starfire.c123
-rw-r--r--drivers/net/sundance.c106
-rw-r--r--drivers/net/sunhme.c9
-rw-r--r--drivers/net/sunlance.c8
-rw-r--r--drivers/net/tg3.c124
-rw-r--r--drivers/net/tulip/winbond-840.c29
-rw-r--r--drivers/net/tulip/xircom_tulip_cb.c27
-rw-r--r--drivers/net/typhoon.c4
-rw-r--r--drivers/net/via-rhine.c121
-rw-r--r--drivers/net/via-velocity.c119
-rw-r--r--drivers/net/via-velocity.h4
-rw-r--r--drivers/net/wan/Kconfig12
-rw-r--r--drivers/net/wan/Makefile1
-rw-r--r--drivers/net/wan/c101.c30
-rw-r--r--drivers/net/wan/hd6457x.c26
-rw-r--r--drivers/net/wan/hdlc_cisco.c14
-rw-r--r--drivers/net/wan/hdlc_fr.c14
-rw-r--r--drivers/net/wan/hdlc_generic.c65
-rw-r--r--drivers/net/wan/hdlc_ppp.c1
-rw-r--r--drivers/net/wan/hdlc_raw.c1
-rw-r--r--drivers/net/wan/hdlc_raw_eth.c1
-rw-r--r--drivers/net/wan/hdlc_x25.c1
-rw-r--r--drivers/net/wan/n2.c3
-rw-r--r--drivers/net/wan/wanxl.c5
-rw-r--r--drivers/net/wireless/Kconfig2
-rw-r--r--drivers/net/wireless/Makefile1
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_main.c33
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_main.h24
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_radio.c7
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_wx.c2
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_xmit.c5
-rw-r--r--drivers/net/wireless/hostap/hostap_plx.c2
-rw-r--r--drivers/net/wireless/orinoco.c4
-rw-r--r--drivers/net/wireless/spectrum_cs.c37
-rw-r--r--drivers/net/wireless/zd1201.c2
-rw-r--r--drivers/net/wireless/zd1211rw/Kconfig19
-rw-r--r--drivers/net/wireless/zd1211rw/Makefile11
-rw-r--r--drivers/net/wireless/zd1211rw/zd_chip.c1615
-rw-r--r--drivers/net/wireless/zd1211rw/zd_chip.h827
-rw-r--r--drivers/net/wireless/zd1211rw/zd_def.h48
-rw-r--r--drivers/net/wireless/zd1211rw/zd_ieee80211.c191
-rw-r--r--drivers/net/wireless/zd1211rw/zd_ieee80211.h85
-rw-r--r--drivers/net/wireless/zd1211rw/zd_mac.c1057
-rw-r--r--drivers/net/wireless/zd1211rw/zd_mac.h190
-rw-r--r--drivers/net/wireless/zd1211rw/zd_netdev.c267
-rw-r--r--drivers/net/wireless/zd1211rw/zd_netdev.h45
-rw-r--r--drivers/net/wireless/zd1211rw/zd_rf.c151
-rw-r--r--drivers/net/wireless/zd1211rw/zd_rf.h82
-rw-r--r--drivers/net/wireless/zd1211rw/zd_rf_al2230.c308
-rw-r--r--drivers/net/wireless/zd1211rw/zd_rf_rf2959.c279
-rw-r--r--drivers/net/wireless/zd1211rw/zd_types.h71
-rw-r--r--drivers/net/wireless/zd1211rw/zd_usb.c1309
-rw-r--r--drivers/net/wireless/zd1211rw/zd_usb.h240
-rw-r--r--drivers/net/wireless/zd1211rw/zd_util.c82
-rw-r--r--drivers/net/wireless/zd1211rw/zd_util.h (renamed from drivers/w1/w1_io.h)27
-rw-r--r--drivers/net/yellowfin.c39
-rw-r--r--drivers/pci/hotplug/Kconfig5
-rw-r--r--drivers/pci/hotplug/acpiphp_core.c3
-rw-r--r--drivers/pci/hotplug/acpiphp_glue.c2
-rw-r--r--drivers/pci/msi.c4
-rw-r--r--drivers/pci/pci.c11
-rw-r--r--drivers/pci/pci.h10
-rw-r--r--drivers/pci/pcie/portdrv_pci.c38
-rw-r--r--drivers/pci/probe.c1
-rw-r--r--drivers/pci/quirks.c115
-rw-r--r--drivers/pci/search.c48
-rw-r--r--drivers/pcmcia/Kconfig2
-rw-r--r--drivers/pcmcia/pcmcia_ioctl.c16
-rw-r--r--drivers/pcmcia/pcmcia_resource.c15
-rw-r--r--drivers/pnp/interface.c12
-rw-r--r--drivers/pnp/pnpbios/core.c2
-rw-r--r--drivers/rtc/Kconfig10
-rw-r--r--drivers/rtc/Makefile1
-rw-r--r--drivers/rtc/rtc-isl1208.c591
-rw-r--r--drivers/rtc/rtc-vr41xx.c2
-rw-r--r--drivers/s390/block/dasd_devmap.c8
-rw-r--r--drivers/s390/block/dasd_eckd.c20
-rw-r--r--drivers/s390/block/dasd_fba.c4
-rw-r--r--drivers/s390/block/dasd_genhd.c8
-rw-r--r--drivers/s390/block/dasd_ioctl.c2
-rw-r--r--drivers/s390/block/xpram.c74
-rw-r--r--drivers/s390/char/con3215.c2
-rw-r--r--drivers/s390/char/ctrlchar.c2
-rw-r--r--drivers/s390/char/defkeymap.c6
-rw-r--r--drivers/s390/char/fs3270.c12
-rw-r--r--drivers/s390/char/keyboard.c6
-rw-r--r--drivers/s390/char/raw3270.c86
-rw-r--r--drivers/s390/char/raw3270.h2
-rw-r--r--drivers/s390/char/tape_34xx.c6
-rw-r--r--drivers/s390/char/tape_class.c10
-rw-r--r--drivers/s390/char/tape_core.c18
-rw-r--r--drivers/s390/char/tty3270.c24
-rw-r--r--drivers/s390/char/vmlogrdr.c6
-rw-r--r--drivers/s390/char/vmwatchdog.c2
-rw-r--r--drivers/s390/cio/ccwgroup.c12
-rw-r--r--drivers/s390/cio/chsc.c34
-rw-r--r--drivers/s390/cio/cio.c4
-rw-r--r--drivers/s390/cio/cio.h3
-rw-r--r--drivers/s390/cio/cmf.c5
-rw-r--r--drivers/s390/cio/css.c36
-rw-r--r--drivers/s390/cio/css.h4
-rw-r--r--drivers/s390/cio/device.c14
-rw-r--r--drivers/s390/cio/device_fsm.c88
-rw-r--r--drivers/s390/cio/device_pgid.c122
-rw-r--r--drivers/s390/cio/device_status.c7
-rw-r--r--drivers/s390/cio/qdio.c2
-rw-r--r--drivers/s390/net/claw.c2
-rw-r--r--drivers/s390/net/ctcmain.c21
-rw-r--r--drivers/s390/net/iucv.c2
-rw-r--r--drivers/s390/net/netiucv.c2
-rw-r--r--drivers/s390/net/qeth_main.c27
-rw-r--r--drivers/s390/net/qeth_sys.c4
-rw-r--r--drivers/s390/net/smsgiucv.c14
-rw-r--r--drivers/s390/s390mach.c10
-rw-r--r--drivers/s390/scsi/zfcp_fsf.c2
-rw-r--r--drivers/s390/scsi/zfcp_scsi.c47
-rw-r--r--drivers/sbus/sbus.c2
-rw-r--r--drivers/scsi/53c7xx.c8
-rw-r--r--drivers/scsi/NCR53C9x.c18
-rw-r--r--drivers/scsi/NCR_D700.c14
-rw-r--r--drivers/scsi/aha152x.c43
-rw-r--r--drivers/scsi/ahci.c27
-rw-r--r--drivers/scsi/aic7xxx/aic79xx_core.c2
-rw-r--r--drivers/scsi/aic7xxx/aic79xx_osm.c21
-rw-r--r--drivers/scsi/aic7xxx/aic79xx_osm.h1
-rw-r--r--drivers/scsi/aic7xxx/aic7xxx_osm.c1
-rw-r--r--drivers/scsi/aic7xxx/aicasm/Makefile2
-rw-r--r--drivers/scsi/arm/fas216.c2
-rw-r--r--drivers/scsi/ata_piix.c165
-rw-r--r--drivers/scsi/atari_NCR5380.c2
-rw-r--r--drivers/scsi/constants.c126
-rw-r--r--drivers/scsi/esp.c16
-rw-r--r--drivers/scsi/ibmvscsi/iseries_vscsi.c2
-rw-r--r--drivers/scsi/ibmvscsi/rpa_vscsi.c1
-rw-r--r--drivers/scsi/jazz_esp.c2
-rw-r--r--drivers/scsi/libata-core.c289
-rw-r--r--drivers/scsi/libata-eh.c464
-rw-r--r--drivers/scsi/libata-scsi.c124
-rw-r--r--drivers/scsi/lpfc/lpfc.h9
-rw-r--r--drivers/scsi/lpfc/lpfc_attr.c89
-rw-r--r--drivers/scsi/lpfc/lpfc_crtn.h1
-rw-r--r--drivers/scsi/lpfc/lpfc_els.c65
-rw-r--r--drivers/scsi/lpfc/lpfc_hbadisc.c4
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c59
-rw-r--r--drivers/scsi/lpfc/lpfc_mem.c5
-rw-r--r--drivers/scsi/lpfc/lpfc_nportdisc.c11
-rw-r--r--drivers/scsi/lpfc/lpfc_scsi.c64
-rw-r--r--drivers/scsi/lpfc/lpfc_sli.c55
-rw-r--r--drivers/scsi/lpfc/lpfc_sli.h2
-rw-r--r--drivers/scsi/lpfc/lpfc_version.h2
-rw-r--r--drivers/scsi/mac53c94.c2
-rw-r--r--drivers/scsi/mesh.c2
-rw-r--r--drivers/scsi/pluto.c2
-rw-r--r--drivers/scsi/qlogicpti.c4
-rw-r--r--drivers/scsi/sata_promise.c7
-rw-r--r--drivers/scsi/sata_sil.c105
-rw-r--r--drivers/scsi/sata_sil24.c134
-rw-r--r--drivers/scsi/sata_vsc.c2
-rw-r--r--drivers/scsi/scsi.c11
-rw-r--r--drivers/scsi/scsi_debug.c72
-rw-r--r--drivers/scsi/scsi_error.c210
-rw-r--r--drivers/scsi/scsi_ioctl.c5
-rw-r--r--drivers/scsi/scsi_lib.c88
-rw-r--r--drivers/scsi/scsi_priv.h1
-rw-r--r--drivers/scsi/scsi_transport_sas.c64
-rw-r--r--drivers/scsi/sd.c3
-rw-r--r--drivers/scsi/seagate.c2
-rw-r--r--drivers/scsi/sr.c5
-rw-r--r--drivers/scsi/st.c7
-rw-r--r--drivers/scsi/sun3_NCR5380.c2
-rw-r--r--drivers/scsi/sun3x_esp.c2
-rw-r--r--drivers/scsi/wd33c93.c2
-rw-r--r--drivers/serial/8250.c25
-rw-r--r--drivers/serial/at91_serial.c5
-rw-r--r--drivers/serial/dz.c2
-rw-r--r--drivers/serial/ip22zilog.c3
-rw-r--r--drivers/serial/serial_core.c1
-rw-r--r--drivers/serial/sunsab.c7
-rw-r--r--drivers/serial/sunsu.c40
-rw-r--r--drivers/serial/sunzilog.c125
-rw-r--r--drivers/serial/vr41xx_siu.c1
-rw-r--r--drivers/usb/Kconfig3
-rw-r--r--drivers/usb/Makefile2
-rw-r--r--drivers/usb/class/cdc-acm.c49
-rw-r--r--drivers/usb/core/Kconfig3
-rw-r--r--drivers/usb/core/devio.c20
-rw-r--r--drivers/usb/core/file.c13
-rw-r--r--drivers/usb/core/hub.c10
-rw-r--r--drivers/usb/core/inode.c2
-rw-r--r--drivers/usb/gadget/Kconfig2
-rw-r--r--drivers/usb/gadget/at91_udc.c176
-rw-r--r--drivers/usb/gadget/at91_udc.h1
-rw-r--r--drivers/usb/gadget/dummy_hcd.c6
-rw-r--r--drivers/usb/gadget/epautoconf.c16
-rw-r--r--drivers/usb/gadget/ether.c8
-rw-r--r--drivers/usb/gadget/file_storage.c2
-rw-r--r--drivers/usb/gadget/rndis.c2
-rw-r--r--drivers/usb/gadget/rndis.h2
-rw-r--r--drivers/usb/gadget/serial.c2
-rw-r--r--drivers/usb/gadget/zero.c2
-rw-r--r--drivers/usb/host/ehci-au1xxx.c23
-rw-r--r--drivers/usb/host/ehci-hcd.c9
-rw-r--r--drivers/usb/host/ohci-at91.c88
-rw-r--r--drivers/usb/host/ohci-au1xxx.c7
-rw-r--r--drivers/usb/host/ohci-ep93xx.c225
-rw-r--r--drivers/usb/host/ohci-hcd.c8
-rw-r--r--drivers/usb/host/ohci-hub.c4
-rw-r--r--drivers/usb/host/pci-quirks.c8
-rw-r--r--drivers/usb/host/uhci-q.c4
-rw-r--r--drivers/usb/input/ati_remote.c5
-rw-r--r--drivers/usb/input/hid-core.c4
-rw-r--r--drivers/usb/misc/Kconfig10
-rw-r--r--drivers/usb/misc/Makefile2
-rw-r--r--drivers/usb/misc/cy7c63.c244
-rw-r--r--drivers/usb/misc/cypress_cy7c63.c284
-rw-r--r--drivers/usb/misc/usblcd.c6
-rw-r--r--drivers/usb/mon/mon_text.c7
-rw-r--r--drivers/usb/net/rtl8150.c86
-rw-r--r--drivers/usb/serial/Kconfig35
-rw-r--r--drivers/usb/serial/Makefile2
-rw-r--r--drivers/usb/serial/airprime.c2
-rw-r--r--drivers/usb/serial/anydata.c123
-rw-r--r--drivers/usb/serial/ark3116.c2
-rw-r--r--drivers/usb/serial/belkin_sa.c2
-rw-r--r--drivers/usb/serial/bus.c2
-rw-r--r--drivers/usb/serial/console.c3
-rw-r--r--drivers/usb/serial/cp2101.c2
-rw-r--r--drivers/usb/serial/cyberjack.c2
-rw-r--r--drivers/usb/serial/cypress_m8.c2
-rw-r--r--drivers/usb/serial/digi_acceleport.c2
-rw-r--r--drivers/usb/serial/empeg.c2
-rw-r--r--drivers/usb/serial/ezusb.c2
-rw-r--r--drivers/usb/serial/ftdi_sio.c109
-rw-r--r--drivers/usb/serial/ftdi_sio.h19
-rw-r--r--drivers/usb/serial/funsoft.c2
-rw-r--r--drivers/usb/serial/garmin_gps.c3
-rw-r--r--drivers/usb/serial/generic.c3
-rw-r--r--drivers/usb/serial/hp4x.c2
-rw-r--r--drivers/usb/serial/io_edgeport.c2
-rw-r--r--drivers/usb/serial/io_ti.c2
-rw-r--r--drivers/usb/serial/ipaq.c26
-rw-r--r--drivers/usb/serial/ipw.c4
-rw-r--r--drivers/usb/serial/ir-usb.c2
-rw-r--r--drivers/usb/serial/keyspan.c2
-rw-r--r--drivers/usb/serial/keyspan_pda.c3
-rw-r--r--drivers/usb/serial/kl5kusb105.c2
-rw-r--r--drivers/usb/serial/kobil_sct.c2
-rw-r--r--drivers/usb/serial/mct_u232.c2
-rw-r--r--drivers/usb/serial/navman.c2
-rw-r--r--drivers/usb/serial/omninet.c2
-rw-r--r--drivers/usb/serial/option.c82
-rw-r--r--drivers/usb/serial/pl2303.c5
-rw-r--r--drivers/usb/serial/pl2303.h9
-rw-r--r--drivers/usb/serial/safe_serial.c2
-rw-r--r--drivers/usb/serial/sierra.c75
-rw-r--r--drivers/usb/serial/ti_usb_3410_5052.c2
-rw-r--r--drivers/usb/serial/usb-serial.c25
-rw-r--r--drivers/usb/serial/visor.c39
-rw-r--r--drivers/usb/serial/whiteheat.c2
-rw-r--r--drivers/usb/storage/scsiglue.c12
-rw-r--r--drivers/usb/storage/transport.c2
-rw-r--r--drivers/usb/storage/unusual_devs.h89
-rw-r--r--drivers/usb/storage/usb.c42
-rw-r--r--drivers/usb/storage/usb.h4
-rw-r--r--drivers/video/68328fb.c1
-rw-r--r--drivers/video/Kconfig58
-rw-r--r--drivers/video/Makefile2
-rw-r--r--drivers/video/S3triofb.c1
-rw-r--r--drivers/video/amifb.c1
-rw-r--r--drivers/video/arcfb.c1
-rw-r--r--drivers/video/asiliantfb.c1
-rw-r--r--drivers/video/atafb.c1
-rw-r--r--drivers/video/aty/aty128fb.c70
-rw-r--r--drivers/video/aty/atyfb_base.c57
-rw-r--r--drivers/video/aty/radeon_base.c19
-rw-r--r--drivers/video/aty/radeon_pm.c146
-rw-r--r--drivers/video/aty/radeonfb.h6
-rw-r--r--drivers/video/backlight/Kconfig4
-rw-r--r--drivers/video/chipsfb.c4
-rw-r--r--drivers/video/cirrusfb.c1
-rw-r--r--drivers/video/console/dummycon.c2
-rw-r--r--drivers/video/console/fbcon.c1
-rw-r--r--drivers/video/console/mdacon.c5
-rw-r--r--drivers/video/console/newport_con.c1
-rw-r--r--drivers/video/console/promcon.c1
-rw-r--r--drivers/video/console/softcursor.c1
-rw-r--r--drivers/video/console/sticon.c1
-rw-r--r--drivers/video/console/vgacon.c2
-rw-r--r--drivers/video/controlfb.c1
-rw-r--r--drivers/video/cyber2000fb.c1
-rw-r--r--drivers/video/cyberfb.c1
-rw-r--r--drivers/video/dnfb.c1
-rw-r--r--drivers/video/epson1355fb.c1
-rw-r--r--drivers/video/fb_notify.c46
-rw-r--r--drivers/video/fbcmap.c1
-rw-r--r--drivers/video/fbmem.c56
-rw-r--r--drivers/video/fbmon.c1
-rw-r--r--drivers/video/g364fb.c1
-rw-r--r--drivers/video/geode/gx1fb_core.c1
-rw-r--r--drivers/video/geode/gxfb_core.c1
-rw-r--r--drivers/video/hgafb.c1
-rw-r--r--drivers/video/hitfb.c1
-rw-r--r--drivers/video/hpfb.c1
-rw-r--r--drivers/video/i810/i810_main.c1
-rw-r--r--drivers/video/igafb.c1
-rw-r--r--drivers/video/imacfb.c2
-rw-r--r--drivers/video/imsttfb.c1
-rw-r--r--drivers/video/intelfb/intelfbdrv.c2
-rw-r--r--drivers/video/intelfb/intelfbhw.c1
-rw-r--r--drivers/video/kyro/fbdev.c1
-rw-r--r--drivers/video/macfb.c1
-rw-r--r--drivers/video/matrox/matroxfb_base.h1
-rw-r--r--drivers/video/maxinefb.c1
-rw-r--r--drivers/video/mbx/Makefile4
-rw-r--r--drivers/video/mbx/mbxdebugfs.c188
-rw-r--r--drivers/video/mbx/mbxfb.c683
-rw-r--r--drivers/video/mbx/reg_bits.h418
-rw-r--r--drivers/video/mbx/regs.h195
-rw-r--r--drivers/video/modedb.c1
-rw-r--r--drivers/video/neofb.c1
-rw-r--r--drivers/video/nvidia/nv_backlight.c32
-rw-r--r--drivers/video/nvidia/nv_proto.h2
-rw-r--r--drivers/video/nvidia/nvidia.c21
-rw-r--r--drivers/video/offb.c308
-rw-r--r--drivers/video/platinumfb.c1
-rw-r--r--drivers/video/pm2fb.c1
-rw-r--r--drivers/video/pm3fb.c1
-rw-r--r--drivers/video/pmag-aa-fb.c1
-rw-r--r--drivers/video/pvr2fb.c1
-rw-r--r--drivers/video/q40fb.c1
-rw-r--r--drivers/video/retz3fb.c1
-rw-r--r--drivers/video/riva/fbdev.c52
-rw-r--r--drivers/video/s3c2410fb.c1
-rw-r--r--drivers/video/savage/savagefb_driver.c1
-rw-r--r--drivers/video/sis/sis_main.c6
-rw-r--r--drivers/video/skeletonfb.c1
-rw-r--r--drivers/video/sun3fb.c1
-rw-r--r--drivers/video/tdfxfb.c1
-rw-r--r--drivers/video/tgafb.c1
-rw-r--r--drivers/video/tx3912fb.c1
-rw-r--r--drivers/video/valkyriefb.c1
-rw-r--r--drivers/video/vesafb.c2
-rw-r--r--drivers/video/vfb.c1
-rw-r--r--drivers/video/vga16fb.c2
-rw-r--r--drivers/video/virgefb.c1
-rw-r--r--drivers/w1/masters/ds2482.c2
-rw-r--r--fs/9p/conv.c6
-rw-r--r--fs/9p/vfs_inode.c6
-rw-r--r--fs/Kconfig1
-rw-r--r--fs/binfmt_elf.c2
-rw-r--r--fs/binfmt_elf_fdpic.c980
-rw-r--r--fs/buffer.c7
-rw-r--r--fs/char_dev.c22
-rw-r--r--fs/coda/file.c4
-rw-r--r--fs/efs/symlink.c3
-rw-r--r--fs/ext3/acl.h3
-rw-r--r--fs/ext3/inode.c19
-rw-r--r--fs/ext3/namei.c15
-rw-r--r--fs/file.c14
-rw-r--r--fs/freevxfs/vxfs_lookup.c2
-rw-r--r--fs/fuse/control.c4
-rw-r--r--fs/fuse/dir.c47
-rw-r--r--fs/fuse/fuse_i.h2
-rw-r--r--fs/fuse/inode.c2
-rw-r--r--fs/hugetlbfs/inode.c4
-rw-r--r--fs/inotify_user.c2
-rw-r--r--fs/jfs/jfs_txnmgr.c2
-rw-r--r--fs/jfs/namei.c33
-rw-r--r--fs/lockd/clntproc.c26
-rw-r--r--fs/lockd/svclock.c12
-rw-r--r--fs/locks.c23
-rw-r--r--fs/namei.c16
-rw-r--r--fs/nfs/dir.c4
-rw-r--r--fs/nfs/direct.c435
-rw-r--r--fs/nfs/namespace.c4
-rw-r--r--fs/nfs/nfs4proc.c74
-rw-r--r--fs/nfs/read.c2
-rw-r--r--fs/nfs/write.c22
-rw-r--r--fs/nfsd/nfs4proc.c8
-rw-r--r--fs/nfsd/nfsfh.c20
-rw-r--r--fs/nfsd/stats.c10
-rw-r--r--fs/partitions/Kconfig2
-rw-r--r--fs/partitions/check.c1
-rw-r--r--fs/proc/array.c6
-rw-r--r--fs/proc/base.c33
-rw-r--r--fs/proc/inode.c2
-rw-r--r--fs/proc/kcore.c4
-rw-r--r--fs/ramfs/file-nommu.c4
-rw-r--r--fs/read_write.c2
-rw-r--r--fs/reiserfs/file.c6
-rw-r--r--fs/reiserfs/procfs.c25
-rw-r--r--fs/splice.c238
-rw-r--r--fs/sysfs/inode.c12
-rw-r--r--fs/ufs/namei.c3
-rw-r--r--fs/xfs/linux-2.6/xfs_buf.h4
-rw-r--r--fs/xfs/linux-2.6/xfs_linux.h1
-rw-r--r--fs/xfs/linux-2.6/xfs_super.c7
-rw-r--r--fs/xfs/quota/xfs_qm_bhv.c19
-rw-r--r--fs/xfs/xfs_inode.c17
-rw-r--r--fs/xfs/xfs_log.c12
-rw-r--r--fs/xfs/xfs_vfsops.c2
-rw-r--r--include/acpi/acconfig.h2
-rw-r--r--include/acpi/acinterp.h10
-rw-r--r--include/acpi/aclocal.h4
-rw-r--r--include/acpi/acmacros.h8
-rw-r--r--include/acpi/acresrc.h8
-rw-r--r--include/acpi/platform/aclinux.h27
-rw-r--r--include/asm-alpha/barrier.h3
-rw-r--r--include/asm-arm/arch-at91rm9200/irqs.h8
-rw-r--r--include/asm-arm/arch-iop3xx/iop331-irqs.h4
-rw-r--r--include/asm-arm/arch-omap/clock.h2
-rw-r--r--include/asm-arm/arch-versatile/platform.h2
-rw-r--r--include/asm-arm/system.h1
-rw-r--r--include/asm-arm26/system.h1
-rw-r--r--include/asm-cris/system.h1
-rw-r--r--include/asm-frv/elf.h6
-rw-r--r--include/asm-frv/gdb-stub.h22
-rw-r--r--include/asm-frv/processor.h3
-rw-r--r--include/asm-frv/ptrace.h12
-rw-r--r--include/asm-frv/registers.h97
-rw-r--r--include/asm-frv/system.h1
-rw-r--r--include/asm-frv/thread_info.h24
-rw-r--r--include/asm-generic/Kbuild.asm5
-rw-r--r--include/asm-h8300/page.h1
-rw-r--r--include/asm-h8300/processor.h3
-rw-r--r--include/asm-h8300/system.h1
-rw-r--r--include/asm-i386/atomic.h30
-rw-r--r--include/asm-i386/futex.h10
-rw-r--r--include/asm-i386/kprobes.h1
-rw-r--r--include/asm-i386/local.h14
-rw-r--r--include/asm-i386/posix_types.h4
-rw-r--r--include/asm-i386/rwlock.h4
-rw-r--r--include/asm-i386/rwsem.h35
-rw-r--r--include/asm-i386/semaphore.h8
-rw-r--r--include/asm-i386/spinlock.h14
-rw-r--r--include/asm-i386/system.h23
-rw-r--r--include/asm-i386/thread_info.h7
-rw-r--r--include/asm-ia64/io.h2
-rw-r--r--include/asm-ia64/kprobes.h1
-rw-r--r--include/asm-ia64/meminit.h7
-rw-r--r--include/asm-ia64/pal.h7
-rw-r--r--include/asm-ia64/sn/xpc.h4
-rw-r--r--include/asm-ia64/system.h5
-rw-r--r--include/asm-m32r/system.h1
-rw-r--r--include/asm-m68k/oplib.h5
-rw-r--r--include/asm-m68k/system.h1
-rw-r--r--include/asm-m68knommu/processor.h3
-rw-r--r--include/asm-m68knommu/system.h1
-rw-r--r--include/asm-m68knommu/uaccess.h12
-rw-r--r--include/asm-mips/apm.h1
-rw-r--r--include/asm-mips/atomic.h2
-rw-r--r--include/asm-mips/bitops.h2
-rw-r--r--include/asm-mips/cpu-features.h10
-rw-r--r--include/asm-mips/cpu.h2
-rw-r--r--include/asm-mips/inst.h2
-rw-r--r--include/asm-mips/irqflags.h (renamed from include/asm-mips/interrupt.h)70
-rw-r--r--include/asm-mips/mach-cobalt/cpu-feature-overrides.h2
-rw-r--r--include/asm-mips/mach-dec/mc146818rtc.h2
-rw-r--r--include/asm-mips/mach-excite/cpu-feature-overrides.h2
-rw-r--r--include/asm-mips/mach-excite/excite.h1
-rw-r--r--include/asm-mips/mach-ip27/cpu-feature-overrides.h2
-rw-r--r--include/asm-mips/mach-ja/cpu-feature-overrides.h2
-rw-r--r--include/asm-mips/mach-mips/cpu-feature-overrides.h4
-rw-r--r--include/asm-mips/mach-ocelot3/cpu-feature-overrides.h2
-rw-r--r--include/asm-mips/mach-sibyte/cpu-feature-overrides.h2
-rw-r--r--include/asm-mips/mach-sim/cpu-feature-overrides.h4
-rw-r--r--include/asm-mips/mach-yosemite/cpu-feature-overrides.h2
-rw-r--r--include/asm-mips/mipsregs.h4
-rw-r--r--include/asm-mips/page.h12
-rw-r--r--include/asm-mips/system.h5
-rw-r--r--include/asm-mips/time.h4
-rw-r--r--include/asm-mips/unistd.h18
-rw-r--r--include/asm-mips/vr41xx/capcella.h2
-rw-r--r--include/asm-mips/vr41xx/cmbvr4133.h6
-rw-r--r--include/asm-mips/vr41xx/e55.h43
-rw-r--r--include/asm-mips/vr41xx/irq.h101
-rw-r--r--include/asm-mips/vr41xx/mpc30x.h2
-rw-r--r--include/asm-mips/vr41xx/tb0219.h2
-rw-r--r--include/asm-mips/vr41xx/tb0226.h2
-rw-r--r--include/asm-mips/vr41xx/tb0287.h2
-rw-r--r--include/asm-mips/vr41xx/vr41xx.h53
-rw-r--r--include/asm-mips/vr41xx/vrc4173.h221
-rw-r--r--include/asm-mips/vr41xx/workpad.h43
-rw-r--r--include/asm-parisc/system.h2
-rw-r--r--include/asm-powerpc/atomic.h32
-rw-r--r--include/asm-powerpc/backlight.h16
-rw-r--r--include/asm-powerpc/bitops.h16
-rw-r--r--include/asm-powerpc/irq.h38
-rw-r--r--include/asm-powerpc/kprobes.h1
-rw-r--r--include/asm-powerpc/system.h17
-rw-r--r--include/asm-ppc/system.h1
-rw-r--r--include/asm-s390/bug.h11
-rw-r--r--include/asm-s390/ccwdev.h2
-rw-r--r--include/asm-s390/cio.h2
-rw-r--r--include/asm-s390/futex.h5
-rw-r--r--include/asm-s390/irqflags.h18
-rw-r--r--include/asm-s390/pgalloc.h2
-rw-r--r--include/asm-s390/processor.h16
-rw-r--r--include/asm-s390/setup.h3
-rw-r--r--include/asm-s390/system.h10
-rw-r--r--include/asm-s390/timex.h4
-rw-r--r--include/asm-sh/processor.h3
-rw-r--r--include/asm-sh/system.h1
-rw-r--r--include/asm-sh64/processor.h3
-rw-r--r--include/asm-sh64/system.h1
-rw-r--r--include/asm-sparc/oplib.h5
-rw-r--r--include/asm-sparc/signal.h2
-rw-r--r--include/asm-sparc/system.h1
-rw-r--r--include/asm-sparc64/Kbuild2
-rw-r--r--include/asm-sparc64/dma-mapping.h14
-rw-r--r--include/asm-sparc64/kprobes.h1
-rw-r--r--include/asm-sparc64/openprom.h2
-rw-r--r--include/asm-sparc64/oplib.h5
-rw-r--r--include/asm-sparc64/pgtable.h2
-rw-r--r--include/asm-sparc64/sfp-machine.h2
-rw-r--r--include/asm-sparc64/system.h2
-rw-r--r--include/asm-v850/processor.h3
-rw-r--r--include/asm-v850/system.h1
-rw-r--r--include/asm-x86_64/calgary.h11
-rw-r--r--include/asm-x86_64/kprobes.h1
-rw-r--r--include/asm-x86_64/page.h2
-rw-r--r--include/asm-x86_64/swiotlb.h2
-rw-r--r--include/asm-x86_64/system.h1
-rw-r--r--include/asm-x86_64/tce.h8
-rw-r--r--include/asm-xtensa/processor.h3
-rw-r--r--include/asm-xtensa/system.h1
-rw-r--r--include/linux/audit.h43
-rw-r--r--include/linux/blktrace_api.h5
-rw-r--r--include/linux/bootmem.h2
-rw-r--r--include/linux/cn_proc.h3
-rw-r--r--include/linux/completion.h5
-rw-r--r--include/linux/console_struct.h1
-rw-r--r--include/linux/cpu.h6
-rw-r--r--include/linux/cpufreq.h3
-rw-r--r--include/linux/delayacct.h117
-rw-r--r--include/linux/elfcore.h10
-rw-r--r--include/linux/ext3_fs.h9
-rw-r--r--include/linux/fb.h3
-rw-r--r--include/linux/fs.h5
-rw-r--r--include/linux/fsnotify.h6
-rw-r--r--include/linux/futex.h3
-rw-r--r--include/linux/hdlc.h2
-rw-r--r--include/linux/i2c-id.h1
-rw-r--r--include/linux/i2c.h2
-rw-r--r--include/linux/ide.h1
-rw-r--r--include/linux/if_vlan.h5
-rw-r--r--include/linux/ioport.h2
-rw-r--r--include/linux/irq.h5
-rw-r--r--include/linux/jiffies.h4
-rw-r--r--include/linux/kernel.h1
-rw-r--r--include/linux/kobject.h2
-rw-r--r--include/linux/kthread.h1
-rw-r--r--include/linux/libata.h87
-rw-r--r--include/linux/list.h11
-rw-r--r--include/linux/lockd/lockd.h1
-rw-r--r--include/linux/lockdep.h2
-rw-r--r--include/linux/mc146818rtc.h7
-rw-r--r--include/linux/module.h10
-rw-r--r--include/linux/namei.h2
-rw-r--r--include/linux/netdevice.h14
-rw-r--r--include/linux/netfilter_bridge.h3
-rw-r--r--include/linux/nfs4.h6
-rw-r--r--include/linux/nfs_fs.h6
-rw-r--r--include/linux/nfs_xdr.h2
-rw-r--r--include/linux/nfsd/stats.h6
-rw-r--r--include/linux/nsc_gpio.h2
-rw-r--r--include/linux/pci.h1
-rw-r--r--include/linux/pci_ids.h8
-rw-r--r--include/linux/pci_regs.h16
-rw-r--r--include/linux/pm_legacy.h7
-rw-r--r--include/linux/pmu.h3
-rw-r--r--include/linux/raid/md_k.h3
-rw-r--r--include/linux/root_dev.h2
-rw-r--r--include/linux/rwsem.h17
-rw-r--r--include/linux/sched.h56
-rw-r--r--include/linux/security.h40
-rw-r--r--include/linux/serial_core.h1
-rw-r--r--include/linux/skbuff.h46
-rw-r--r--include/linux/sunrpc/xprt.h2
-rw-r--r--include/linux/taskstats.h137
-rw-r--r--include/linux/taskstats_kern.h89
-rw-r--r--include/linux/time.h12
-rw-r--r--include/linux/tty.h12
-rw-r--r--include/linux/usb.h9
-rw-r--r--include/linux/usb/serial.h (renamed from drivers/usb/serial/usb-serial.h)6
-rw-r--r--include/linux/usb_ch9.h7
-rw-r--r--include/linux/usb_gadget.h4
-rw-r--r--include/linux/usb_usual.h4
-rw-r--r--include/linux/videodev.h7
-rw-r--r--include/linux/videodev2.h2
-rw-r--r--include/linux/vmalloc.h1
-rw-r--r--include/linux/vmstat.h11
-rw-r--r--include/linux/vt.h10
-rw-r--r--include/linux/vt_kern.h1
-rw-r--r--include/linux/wait.h12
-rw-r--r--include/media/v4l2-dev.h7
-rw-r--r--include/net/af_unix.h6
-rw-r--r--include/net/genetlink.h20
-rw-r--r--include/net/ieee80211softmac.h1
-rw-r--r--include/net/ip6_route.h12
-rw-r--r--include/net/ipv6.h3
-rw-r--r--include/net/netdma.h4
-rw-r--r--include/net/netevent.h33
-rw-r--r--include/net/pkt_sched.h18
-rw-r--r--include/net/protocol.h2
-rw-r--r--include/net/scm.h29
-rw-r--r--include/net/sctp/structs.h11
-rw-r--r--include/net/sctp/user.h9
-rw-r--r--include/net/tcp.h4
-rw-r--r--include/rdma/ib_addr.h10
-rw-r--r--include/rdma/ib_fmr_pool.h2
-rw-r--r--include/rdma/ib_mad.h7
-rw-r--r--include/scsi/scsi_cmnd.h9
-rw-r--r--include/scsi/scsi_transport_sas.h7
-rw-r--r--include/sound/core.h2
-rw-r--r--include/sound/cs46xx.h1
-rw-r--r--include/video/mbxfb.h28
-rw-r--r--init/Kconfig24
-rw-r--r--init/main.c4
-rw-r--r--ipc/msg.c389
-rw-r--r--kernel/Makefile2
-rw-r--r--kernel/acct.c4
-rw-r--r--kernel/audit.c4
-rw-r--r--kernel/auditfilter.c26
-rw-r--r--kernel/auditsc.c117
-rw-r--r--kernel/cpu.c75
-rw-r--r--kernel/cpuset.c24
-rw-r--r--kernel/delayacct.c178
-rw-r--r--kernel/exit.c10
-rw-r--r--kernel/fork.c10
-rw-r--r--kernel/futex.c127
-rw-r--r--kernel/futex_compat.c34
-rw-r--r--kernel/hrtimer.c4
-rw-r--r--kernel/irq/manage.c28
-rw-r--r--kernel/kallsyms.c4
-rw-r--r--kernel/kprobes.c1
-rw-r--r--kernel/kthread.c24
-rw-r--r--kernel/lockdep.c136
-rw-r--r--kernel/module.c11
-rw-r--r--kernel/panic.c2
-rw-r--r--kernel/power/pm.c37
-rw-r--r--kernel/power/snapshot.c10
-rw-r--r--kernel/power/swap.c26
-rw-r--r--kernel/printk.c4
-rw-r--r--kernel/rcupdate.c4
-rw-r--r--kernel/resource.c2
-rw-r--r--kernel/rtmutex-tester.c1
-rw-r--r--kernel/rtmutex.c2
-rw-r--r--kernel/sched.c125
-rw-r--r--kernel/signal.c25
-rw-r--r--kernel/softirq.c24
-rw-r--r--kernel/softlockup.c4
-rw-r--r--kernel/sys.c2
-rw-r--r--kernel/taskstats.c564
-rw-r--r--kernel/timer.c113
-rw-r--r--kernel/wait.c8
-rw-r--r--kernel/workqueue.c58
-rw-r--r--lib/Kconfig.debug10
-rw-r--r--lib/idr.c16
-rw-r--r--lib/kobject_uevent.c4
-rw-r--r--lib/zlib_inflate/inflate.c5
-rw-r--r--mm/bootmem.c4
-rw-r--r--mm/fadvise.c12
-rw-r--r--mm/filemap.c2
-rw-r--r--mm/memory.c8
-rw-r--r--mm/mmzone.c6
-rw-r--r--mm/nommu.c2
-rw-r--r--mm/slab.c78
-rw-r--r--mm/vmalloc.c7
-rw-r--r--mm/vmstat.c1
-rw-r--r--net/8021q/vlan.c11
-rw-r--r--net/appletalk/ddp.c6
-rw-r--r--net/atm/br2684.c3
-rw-r--r--net/atm/clip.c16
-rw-r--r--net/atm/ipcommon.c17
-rw-r--r--net/atm/lec.c3
-rw-r--r--net/atm/mpc.c3
-rw-r--r--net/atm/pppoatm.c3
-rw-r--r--net/atm/resources.c3
-rw-r--r--net/ax25/af_ax25.c17
-rw-r--r--net/ax25/ax25_dev.c4
-rw-r--r--net/ax25/ax25_ds_subr.c8
-rw-r--r--net/ax25/ax25_ds_timer.c4
-rw-r--r--net/ax25/ax25_iface.c18
-rw-r--r--net/ax25/ax25_in.c2
-rw-r--r--net/ax25/sysctl_net_ax25.c4
-rw-r--r--net/bluetooth/cmtp/capi.c4
-rw-r--r--net/bluetooth/cmtp/core.c3
-rw-r--r--net/bluetooth/hci_core.c7
-rw-r--r--net/bluetooth/hidp/Kconfig3
-rw-r--r--net/bluetooth/hidp/core.c3
-rw-r--r--net/bluetooth/l2cap.c18
-rw-r--r--net/bluetooth/rfcomm/core.c28
-rw-r--r--net/bluetooth/rfcomm/tty.c3
-rw-r--r--net/bluetooth/sco.c12
-rw-r--r--net/bridge/br_forward.c2
-rw-r--r--net/bridge/br_ioctl.c7
-rw-r--r--net/bridge/br_netfilter.c7
-rw-r--r--net/core/Makefile2
-rw-r--r--net/core/dev.c41
-rw-r--r--net/core/ethtool.c2
-rw-r--r--net/core/neighbour.c14
-rw-r--r--net/core/netevent.c69
-rw-r--r--net/core/skbuff.c130
-rw-r--r--net/core/stream.c16
-rw-r--r--net/core/user_dma.c1
-rw-r--r--net/dccp/feat.h2
-rw-r--r--net/dccp/ipv4.c3
-rw-r--r--net/dccp/ipv6.c8
-rw-r--r--net/dccp/options.c2
-rw-r--r--net/dccp/proto.c4
-rw-r--r--net/decnet/dn_dev.c9
-rw-r--r--net/decnet/dn_fib.c3
-rw-r--r--net/decnet/dn_neigh.c3
-rw-r--r--net/decnet/dn_route.c9
-rw-r--r--net/decnet/dn_rules.c6
-rw-r--r--net/decnet/dn_table.c11
-rw-r--r--net/econet/af_econet.c3
-rw-r--r--net/ieee80211/Kconfig1
-rw-r--r--net/ieee80211/ieee80211_crypt.c3
-rw-r--r--net/ieee80211/ieee80211_crypt_ccmp.c3
-rw-r--r--net/ieee80211/ieee80211_crypt_wep.c3
-rw-r--r--net/ieee80211/ieee80211_rx.c4
-rw-r--r--net/ieee80211/ieee80211_tx.c15
-rw-r--r--net/ieee80211/ieee80211_wx.c7
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_assoc.c31
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_auth.c32
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_io.c6
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_wx.c36
-rw-r--r--net/ipv4/Kconfig10
-rw-r--r--net/ipv4/Makefile1
-rw-r--r--net/ipv4/af_inet.c36
-rw-r--r--net/ipv4/ah4.c4
-rw-r--r--net/ipv4/arp.c3
-rw-r--r--net/ipv4/devinet.c6
-rw-r--r--net/ipv4/esp4.c4
-rw-r--r--net/ipv4/fib_hash.c6
-rw-r--r--net/ipv4/fib_rules.c7
-rw-r--r--net/ipv4/fib_semantics.c15
-rw-r--r--net/ipv4/fib_trie.c2
-rw-r--r--net/ipv4/igmp.c12
-rw-r--r--net/ipv4/inet_diag.c3
-rw-r--r--net/ipv4/inetpeer.c2
-rw-r--r--net/ipv4/ip_gre.c1
-rw-r--r--net/ipv4/ip_input.c3
-rw-r--r--net/ipv4/ip_options.c1
-rw-r--r--net/ipv4/ip_output.c11
-rw-r--r--net/ipv4/ip_sockglue.c9
-rw-r--r--net/ipv4/ipcomp.c6
-rw-r--r--net/ipv4/ipip.c1
-rw-r--r--net/ipv4/ipmr.c21
-rw-r--r--net/ipv4/ipvs/ip_vs_ctl.c10
-rw-r--r--net/ipv4/ipvs/ip_vs_est.c3
-rw-r--r--net/ipv4/netfilter/ip_conntrack_helper_h323.c2
-rw-r--r--net/ipv4/netfilter/ip_conntrack_sip.c2
-rw-r--r--net/ipv4/netfilter/ip_conntrack_standalone.c4
-rw-r--r--net/ipv4/netfilter/ip_nat_snmp_basic.c4
-rw-r--r--net/ipv4/netfilter/ipt_CLUSTERIP.c3
-rw-r--r--net/ipv4/netfilter/ipt_hashlimit.c3
-rw-r--r--net/ipv4/raw.c1
-rw-r--r--net/ipv4/route.c8
-rw-r--r--net/ipv4/tcp.c5
-rw-r--r--net/ipv4/tcp_compound.c448
-rw-r--r--net/ipv4/tcp_highspeed.c13
-rw-r--r--net/ipv4/tcp_ipv4.c23
-rw-r--r--net/ipv4/tcp_minisocks.c4
-rw-r--r--net/ipv4/tcp_probe.c2
-rw-r--r--net/ipv4/udp.c3
-rw-r--r--net/ipv4/xfrm4_mode_tunnel.c1
-rw-r--r--net/ipv4/xfrm4_output.c2
-rw-r--r--net/ipv6/addrconf.c199
-rw-r--r--net/ipv6/af_inet6.c2
-rw-r--r--net/ipv6/inet6_connection_sock.c2
-rw-r--r--net/ipv6/ip6_input.c2
-rw-r--r--net/ipv6/ip6_output.c133
-rw-r--r--net/ipv6/ip6_tunnel.c3
-rw-r--r--net/ipv6/ipcomp6.c3
-rw-r--r--net/ipv6/ipv6_sockglue.c89
-rw-r--r--net/ipv6/raw.c1
-rw-r--r--net/ipv6/route.c7
-rw-r--r--net/ipv6/sit.c1
-rw-r--r--net/ipv6/tcp_ipv6.c25
-rw-r--r--net/ipv6/udp.c2
-rw-r--r--net/ipv6/xfrm6_output.c4
-rw-r--r--net/ipv6/xfrm6_tunnel.c140
-rw-r--r--net/irda/af_irda.c2
-rw-r--r--net/irda/ircomm/ircomm_core.c4
-rw-r--r--net/irda/ircomm/ircomm_lmp.c4
-rw-r--r--net/irda/ircomm/ircomm_param.c2
-rw-r--r--net/irda/ircomm/ircomm_tty.c8
-rw-r--r--net/irda/irda_device.c4
-rw-r--r--net/irda/iriap.c9
-rw-r--r--net/irda/iriap_event.c2
-rw-r--r--net/irda/irias_object.c24
-rw-r--r--net/irda/irlan/irlan_common.c16
-rw-r--r--net/irda/irlan/irlan_provider.c2
-rw-r--r--net/irda/irlap.c8
-rw-r--r--net/irda/irlap_frame.c19
-rw-r--r--net/irda/irlmp.c11
-rw-r--r--net/irda/irnet/irnet_ppp.c3
-rw-r--r--net/irda/irttp.c20
-rw-r--r--net/lapb/lapb_iface.c4
-rw-r--r--net/llc/llc_core.c3
-rw-r--r--net/netfilter/Kconfig4
-rw-r--r--net/netfilter/nf_conntrack_standalone.c4
-rw-r--r--net/netfilter/nf_queue.c9
-rw-r--r--net/netfilter/xt_SECMARK.c2
-rw-r--r--net/netfilter/xt_physdev.c15
-rw-r--r--net/netfilter/xt_pkttype.c12
-rw-r--r--net/netfilter/xt_string.c5
-rw-r--r--net/netlink/af_netlink.c13
-rw-r--r--net/netrom/af_netrom.c25
-rw-r--r--net/netrom/nr_timer.c2
-rw-r--r--net/rose/af_rose.c12
-rw-r--r--net/rxrpc/connection.c6
-rw-r--r--net/rxrpc/peer.c3
-rw-r--r--net/rxrpc/transport.c6
-rw-r--r--net/sched/act_api.c31
-rw-r--r--net/sched/act_pedit.c3
-rw-r--r--net/sched/act_police.c6
-rw-r--r--net/sched/cls_basic.c6
-rw-r--r--net/sched/cls_fw.c6
-rw-r--r--net/sched/cls_route.c9
-rw-r--r--net/sched/cls_rsvp.h9
-rw-r--r--net/sched/cls_tcindex.c12
-rw-r--r--net/sched/cls_u32.c15
-rw-r--r--net/sched/em_meta.c3
-rw-r--r--net/sched/ematch.c3
-rw-r--r--net/sched/estimator.c3
-rw-r--r--net/sched/sch_cbq.c3
-rw-r--r--net/sched/sch_generic.c3
-rw-r--r--net/sched/sch_gred.c3
-rw-r--r--net/sched/sch_hfsc.c3
-rw-r--r--net/sched/sch_htb.c7
-rw-r--r--net/sched/sch_netem.c4
-rw-r--r--net/sctp/associola.c27
-rw-r--r--net/sctp/bind_addr.c8
-rw-r--r--net/sctp/endpointola.c11
-rw-r--r--net/sctp/ipv6.c3
-rw-r--r--net/sctp/outqueue.c9
-rw-r--r--net/sctp/protocol.c7
-rw-r--r--net/sctp/sm_make_chunk.c14
-rw-r--r--net/sctp/sm_sideeffect.c12
-rw-r--r--net/sctp/sm_statefuns.c8
-rw-r--r--net/sctp/socket.c74
-rw-r--r--net/sctp/transport.c9
-rw-r--r--net/sunrpc/auth_gss/auth_gss.c9
-rw-r--r--net/sunrpc/auth_gss/gss_krb5_mech.c3
-rw-r--r--net/sunrpc/auth_gss/gss_mech_switch.c3
-rw-r--r--net/sunrpc/auth_gss/gss_spkm3_mech.c3
-rw-r--r--net/sunrpc/auth_gss/gss_spkm3_token.c3
-rw-r--r--net/sunrpc/clnt.c55
-rw-r--r--net/sunrpc/rpc_pipe.c6
-rw-r--r--net/sunrpc/stats.c7
-rw-r--r--net/sunrpc/svc.c6
-rw-r--r--net/sunrpc/svcsock.c3
-rw-r--r--net/sunrpc/xdr.c3
-rw-r--r--net/sunrpc/xprt.c24
-rw-r--r--net/sunrpc/xprtsock.c35
-rw-r--r--net/tipc/bearer.c6
-rw-r--r--net/tipc/cluster.c8
-rw-r--r--net/tipc/discover.c2
-rw-r--r--net/tipc/link.c3
-rw-r--r--net/tipc/name_table.c16
-rw-r--r--net/tipc/net.c5
-rw-r--r--net/tipc/port.c5
-rw-r--r--net/tipc/ref.c2
-rw-r--r--net/tipc/subscr.c3
-rw-r--r--net/tipc/user_reg.c3
-rw-r--r--net/tipc/zone.c3
-rw-r--r--net/unix/af_unix.c20
-rw-r--r--net/wanrouter/af_wanpipe.c9
-rw-r--r--net/wanrouter/wanmain.c9
-rw-r--r--net/xfrm/xfrm_policy.c3
-rw-r--r--net/xfrm/xfrm_state.c3
-rw-r--r--scripts/Kbuild.include10
-rw-r--r--scripts/Makefile.modpost2
-rw-r--r--scripts/kconfig/confdata.c2
-rwxr-xr-xscripts/kernel-doc1
-rw-r--r--scripts/mod/file2alias.c62
-rw-r--r--security/dummy.c14
-rw-r--r--security/selinux/hooks.c173
-rw-r--r--security/selinux/include/objsec.h3
-rw-r--r--security/selinux/ss/policydb.c12
-rw-r--r--security/selinux/ss/services.c4
-rw-r--r--sound/aoa/Makefile4
-rw-r--r--sound/aoa/codecs/snd-aoa-codec-tas-basstreble.h134
-rw-r--r--sound/aoa/codecs/snd-aoa-codec-tas.c331
-rw-r--r--sound/aoa/codecs/snd-aoa-codec-tas.h8
-rw-r--r--sound/aoa/core/snd-aoa-gpio-pmf.c14
-rw-r--r--sound/aoa/fabrics/snd-aoa-fabric-layout.c26
-rw-r--r--sound/aoa/soundbus/core.c22
-rw-r--r--sound/aoa/soundbus/i2sbus/i2sbus-control.c79
-rw-r--r--sound/aoa/soundbus/i2sbus/i2sbus-control.h37
-rw-r--r--sound/aoa/soundbus/i2sbus/i2sbus-core.c129
-rw-r--r--sound/aoa/soundbus/i2sbus/i2sbus.h18
-rw-r--r--sound/core/sound.c3
-rw-r--r--sound/core/timer.c5
-rw-r--r--sound/i2c/cs8427.c116
-rw-r--r--sound/isa/cs423x/Makefile1
-rw-r--r--sound/isa/gus/gusextreme.c2
-rw-r--r--sound/isa/wavefront/wavefront_fx.c36
-rw-r--r--sound/isa/wavefront/wavefront_midi.c2
-rw-r--r--sound/isa/wavefront/wavefront_synth.c14
-rw-r--r--sound/pci/Kconfig14
-rw-r--r--sound/pci/ad1889.c8
-rw-r--r--sound/pci/ali5451/ali5451.c2
-rw-r--r--sound/pci/als300.c2
-rw-r--r--sound/pci/als4000.c2
-rw-r--r--sound/pci/atiixp.c2
-rw-r--r--sound/pci/atiixp_modem.c2
-rw-r--r--sound/pci/au88x0/au8810.c2
-rw-r--r--sound/pci/au88x0/au8820.c2
-rw-r--r--sound/pci/au88x0/au8830.c2
-rw-r--r--sound/pci/au88x0/au88x0.h3
-rw-r--r--sound/pci/au88x0/au88x0_a3d.c29
-rw-r--r--sound/pci/au88x0/au88x0_core.c4
-rw-r--r--sound/pci/azt3328.c2
-rw-r--r--sound/pci/bt87x.c2
-rw-r--r--sound/pci/ca0106/ca0106_main.c2
-rw-r--r--sound/pci/cmipci.c2
-rw-r--r--sound/pci/cs4281.c2
-rw-r--r--sound/pci/cs46xx/cs46xx.c2
-rw-r--r--sound/pci/cs46xx/cs46xx_lib.c7
-rw-r--r--sound/pci/cs5535audio/cs5535audio.c2
-rw-r--r--sound/pci/emu10k1/emu10k1.c2
-rw-r--r--sound/pci/emu10k1/emu10k1_main.c10
-rw-r--r--sound/pci/emu10k1/emu10k1x.c37
-rw-r--r--sound/pci/emu10k1/emumpu401.c35
-rw-r--r--sound/pci/ens1370.c2
-rw-r--r--sound/pci/es1938.c2
-rw-r--r--sound/pci/es1968.c2
-rw-r--r--sound/pci/fm801.c4
-rw-r--r--sound/pci/hda/hda_intel.c2
-rw-r--r--sound/pci/hda/patch_analog.c19
-rw-r--r--sound/pci/hda/patch_sigmatel.c1
-rw-r--r--sound/pci/ice1712/aureon.c2
-rw-r--r--sound/pci/ice1712/ice1712.c2
-rw-r--r--sound/pci/ice1712/ice1724.c2
-rw-r--r--sound/pci/intel8x0.c8
-rw-r--r--sound/pci/intel8x0m.c2
-rw-r--r--sound/pci/korg1212/korg1212.c2
-rw-r--r--sound/pci/maestro3.c10
-rw-r--r--sound/pci/mixart/mixart.c2
-rw-r--r--sound/pci/nm256/nm256.c2
-rw-r--r--sound/pci/pcxhr/pcxhr.c2
-rw-r--r--sound/pci/riptide/riptide.c2
-rw-r--r--sound/pci/rme32.c2
-rw-r--r--sound/pci/rme96.c2
-rw-r--r--sound/pci/rme9652/hdsp.c4
-rw-r--r--sound/pci/rme9652/rme9652.c2
-rw-r--r--sound/pci/sonicvibes.c2
-rw-r--r--sound/pci/trident/trident.c2
-rw-r--r--sound/pci/via82xx.c2
-rw-r--r--sound/pci/via82xx_modem.c2
-rw-r--r--sound/pci/vx222/vx222.c2
-rw-r--r--sound/pci/ymfpci/ymfpci.c2
-rw-r--r--sound/pcmcia/pdaudiocf/pdaudiocf.c4
1758 files changed, 34975 insertions, 16901 deletions
diff --git a/.gitignore b/.gitignore
index 27fd37621255..b1f5b9df2ae1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -30,6 +30,11 @@ include/config
30include/linux/autoconf.h 30include/linux/autoconf.h
31include/linux/compile.h 31include/linux/compile.h
32include/linux/version.h 32include/linux/version.h
33include/linux/utsrelease.h
33 34
34# stgit generated dirs 35# stgit generated dirs
35patches-* 36patches-*
37
38# quilt's files
39patches
40series
diff --git a/CREDITS b/CREDITS
index 66b9e7a9abff..29be6d1fdf49 100644
--- a/CREDITS
+++ b/CREDITS
@@ -528,11 +528,11 @@ S: Oxford
528S: United Kingdom 528S: United Kingdom
529 529
530N: Luiz Fernando N. Capitulino 530N: Luiz Fernando N. Capitulino
531E: lcapitulino@terra.com.br 531E: lcapitulino@mandriva.com.br
532E: lcapitulino@prefeitura.sp.gov.br 532E: lcapitulino@gmail.com
533W: http://www.telecentros.sp.gov.br 533W: http://www.cpu.eti.br
534D: Little fixes and a lot of janitorial work 534D: misc kernel hacking
535S: E-GOV Telecentros SP 535S: Mandriva
536S: Brazil 536S: Brazil
537 537
538N: Remy Card 538N: Remy Card
diff --git a/Documentation/DMA-mapping.txt b/Documentation/DMA-mapping.txt
index 7c717699032c..63392c9132b4 100644
--- a/Documentation/DMA-mapping.txt
+++ b/Documentation/DMA-mapping.txt
@@ -698,12 +698,12 @@ these interfaces. Remember that, as defined, consistent mappings are
698always going to be SAC addressable. 698always going to be SAC addressable.
699 699
700The first thing your driver needs to do is query the PCI platform 700The first thing your driver needs to do is query the PCI platform
701layer with your devices DAC addressing capabilities: 701layer if it is capable of handling your devices DAC addressing
702capabilities:
702 703
703 int pci_dac_set_dma_mask(struct pci_dev *pdev, u64 mask); 704 int pci_dac_dma_supported(struct pci_dev *hwdev, u64 mask);
704 705
705This routine behaves identically to pci_set_dma_mask. You may not 706You may not use the following interfaces if this routine fails.
706use the following interfaces if this routine fails.
707 707
708Next, DMA addresses using this API are kept track of using the 708Next, DMA addresses using this API are kept track of using the
709dma64_addr_t type. It is guaranteed to be big enough to hold any 709dma64_addr_t type. It is guaranteed to be big enough to hold any
diff --git a/Documentation/DocBook/kernel-api.tmpl b/Documentation/DocBook/kernel-api.tmpl
index 1ae4dc0fd856..f8fe882e33dc 100644
--- a/Documentation/DocBook/kernel-api.tmpl
+++ b/Documentation/DocBook/kernel-api.tmpl
@@ -59,6 +59,9 @@
59!Iinclude/linux/hrtimer.h 59!Iinclude/linux/hrtimer.h
60!Ekernel/hrtimer.c 60!Ekernel/hrtimer.c
61 </sect1> 61 </sect1>
62 <sect1><title>Workqueues and Kevents</title>
63!Ekernel/workqueue.c
64 </sect1>
62 <sect1><title>Internal Functions</title> 65 <sect1><title>Internal Functions</title>
63!Ikernel/exit.c 66!Ikernel/exit.c
64!Ikernel/signal.c 67!Ikernel/signal.c
@@ -300,7 +303,7 @@ X!Ekernel/module.c
300 </sect1> 303 </sect1>
301 304
302 <sect1><title>Resources Management</title> 305 <sect1><title>Resources Management</title>
303!Ekernel/resource.c 306!Ikernel/resource.c
304 </sect1> 307 </sect1>
305 308
306 <sect1><title>MTRR Handling</title> 309 <sect1><title>MTRR Handling</title>
@@ -312,9 +315,7 @@ X!Ekernel/module.c
312!Edrivers/pci/pci-driver.c 315!Edrivers/pci/pci-driver.c
313!Edrivers/pci/remove.c 316!Edrivers/pci/remove.c
314!Edrivers/pci/pci-acpi.c 317!Edrivers/pci/pci-acpi.c
315<!-- kerneldoc does not understand __devinit 318!Edrivers/pci/search.c
316X!Edrivers/pci/search.c
317 -->
318!Edrivers/pci/msi.c 319!Edrivers/pci/msi.c
319!Edrivers/pci/bus.c 320!Edrivers/pci/bus.c
320<!-- FIXME: Removed for now since no structured comments in source 321<!-- FIXME: Removed for now since no structured comments in source
diff --git a/Documentation/RCU/whatisRCU.txt b/Documentation/RCU/whatisRCU.txt
index 4f41a60e5111..318df44259b3 100644
--- a/Documentation/RCU/whatisRCU.txt
+++ b/Documentation/RCU/whatisRCU.txt
@@ -687,8 +687,9 @@ diff shows how closely related RCU and reader-writer locking can be.
687 + spin_lock(&listmutex); 687 + spin_lock(&listmutex);
688 list_for_each_entry(p, head, lp) { 688 list_for_each_entry(p, head, lp) {
689 if (p->key == key) { 689 if (p->key == key) {
690 list_del(&p->list); 690 - list_del(&p->list);
691 - write_unlock(&listmutex); 691 - write_unlock(&listmutex);
692 + list_del_rcu(&p->list);
692 + spin_unlock(&listmutex); 693 + spin_unlock(&listmutex);
693 + synchronize_rcu(); 694 + synchronize_rcu();
694 kfree(p); 695 kfree(p);
@@ -736,7 +737,7 @@ Or, for those who prefer a side-by-side listing:
736 5 write_lock(&listmutex); 5 spin_lock(&listmutex); 737 5 write_lock(&listmutex); 5 spin_lock(&listmutex);
737 6 list_for_each_entry(p, head, lp) { 6 list_for_each_entry(p, head, lp) { 738 6 list_for_each_entry(p, head, lp) { 6 list_for_each_entry(p, head, lp) {
738 7 if (p->key == key) { 7 if (p->key == key) { 739 7 if (p->key == key) { 7 if (p->key == key) {
739 8 list_del(&p->list); 8 list_del(&p->list); 740 8 list_del(&p->list); 8 list_del_rcu(&p->list);
740 9 write_unlock(&listmutex); 9 spin_unlock(&listmutex); 741 9 write_unlock(&listmutex); 9 spin_unlock(&listmutex);
741 10 synchronize_rcu(); 742 10 synchronize_rcu();
74210 kfree(p); 11 kfree(p); 74310 kfree(p); 11 kfree(p);
diff --git a/Documentation/SubmitChecklist b/Documentation/SubmitChecklist
index 8230098da529..a10bfb6ecd9f 100644
--- a/Documentation/SubmitChecklist
+++ b/Documentation/SubmitChecklist
@@ -1,57 +1,63 @@
1Linux Kernel patch sumbittal checklist 1Linux Kernel patch sumbittal checklist
2~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 3
4Here are some basic things that developers should do if they 4Here are some basic things that developers should do if they want to see their
5want to see their kernel patch submittals accepted quicker. 5kernel patch submissions accepted more quickly.
6 6
7These are all above and beyond the documentation that is provided 7These are all above and beyond the documentation that is provided in
8in Documentation/SubmittingPatches and elsewhere about submitting 8Documentation/SubmittingPatches and elsewhere regarding submitting Linux
9Linux kernel patches. 9kernel patches.
10 10
11 11
12 12
13- Builds cleanly with applicable or modified CONFIG options =y, =m, and =n. 131: Builds cleanly with applicable or modified CONFIG options =y, =m, and
14 No gcc warnings/errors, no linker warnings/errors. 14 =n. No gcc warnings/errors, no linker warnings/errors.
15 15
16- Passes allnoconfig, allmodconfig 162: Passes allnoconfig, allmodconfig
17 17
18- Builds on multiple CPU arch-es by using local cross-compile tools 183: Builds on multiple CPU architectures by using local cross-compile tools
19 or something like PLM at OSDL. 19 or something like PLM at OSDL.
20 20
21- ppc64 is a good architecture for cross-compilation checking because it 214: ppc64 is a good architecture for cross-compilation checking because it
22 tends to use `unsigned long' for 64-bit quantities. 22 tends to use `unsigned long' for 64-bit quantities.
23 23
24- Matches kernel coding style(!) 245: Matches kernel coding style(!)
25 25
26- Any new or modified CONFIG options don't muck up the config menu. 266: Any new or modified CONFIG options don't muck up the config menu.
27 27
28- All new Kconfig options have help text. 287: All new Kconfig options have help text.
29 29
30- Has been carefully reviewed with respect to relevant Kconfig 308: Has been carefully reviewed with respect to relevant Kconfig
31 combinations. This is very hard to get right with testing -- 31 combinations. This is very hard to get right with testing -- brainpower
32 brainpower pays off here. 32 pays off here.
33 33
34- Check cleanly with sparse. 349: Check cleanly with sparse.
35 35
36- Use 'make checkstack' and 'make namespacecheck' and fix any 3610: Use 'make checkstack' and 'make namespacecheck' and fix any problems
37 problems that they find. Note: checkstack does not point out 37 that they find. Note: checkstack does not point out problems explicitly,
38 problems explicitly, but any one function that uses more than 38 but any one function that uses more than 512 bytes on the stack is a
39 512 bytes on the stack is a candidate for change. 39 candidate for change.
40 40
41- Include kernel-doc to document global kernel APIs. (Not required 4111: Include kernel-doc to document global kernel APIs. (Not required for
42 for static functions, but OK there also.) Use 'make htmldocs' 42 static functions, but OK there also.) Use 'make htmldocs' or 'make
43 or 'make mandocs' to check the kernel-doc and fix any issues. 43 mandocs' to check the kernel-doc and fix any issues.
44 44
45- Has been tested with CONFIG_PREEMPT, CONFIG_DEBUG_PREEMPT, 4512: Has been tested with CONFIG_PREEMPT, CONFIG_DEBUG_PREEMPT,
46 CONFIG_DEBUG_SLAB, CONFIG_DEBUG_PAGEALLOC, CONFIG_DEBUG_MUTEXES, 46 CONFIG_DEBUG_SLAB, CONFIG_DEBUG_PAGEALLOC, CONFIG_DEBUG_MUTEXES,
47 CONFIG_DEBUG_SPINLOCK, CONFIG_DEBUG_SPINLOCK_SLEEP all simultaneously 47 CONFIG_DEBUG_SPINLOCK, CONFIG_DEBUG_SPINLOCK_SLEEP all simultaneously
48 enabled. 48 enabled.
49 49
50- Has been build- and runtime tested with and without CONFIG_SMP and 5013: Has been build- and runtime tested with and without CONFIG_SMP and
51 CONFIG_PREEMPT. 51 CONFIG_PREEMPT.
52 52
53- If the patch affects IO/Disk, etc: has been tested with and without 5314: If the patch affects IO/Disk, etc: has been tested with and without
54 CONFIG_LBD. 54 CONFIG_LBD.
55 55
5615: All codepaths have been exercised with all lockdep features enabled.
56 57
572006-APR-27 5816: All new /proc entries are documented under Documentation/
59
6017: All new kernel boot parameters are documented in
61 Documentation/kernel-parameters.txt.
62
6318: All new module parameters are documented with MODULE_PARM_DESC()
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index c2c85bcb3d43..2cd7f02ffd0b 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -10,7 +10,9 @@ kernel, the process can sometimes be daunting if you're not familiar
10with "the system." This text is a collection of suggestions which 10with "the system." This text is a collection of suggestions which
11can greatly increase the chances of your change being accepted. 11can greatly increase the chances of your change being accepted.
12 12
13If you are submitting a driver, also read Documentation/SubmittingDrivers. 13Read Documentation/SubmitChecklist for a list of items to check
14before submitting code. If you are submitting a driver, also read
15Documentation/SubmittingDrivers.
14 16
15 17
16 18
@@ -74,9 +76,6 @@ There are a number of scripts which can aid in this:
74Quilt: 76Quilt:
75http://savannah.nongnu.org/projects/quilt 77http://savannah.nongnu.org/projects/quilt
76 78
77Randy Dunlap's patch scripts:
78http://www.xenotime.net/linux/scripts/patching-scripts-002.tar.gz
79
80Andrew Morton's patch scripts: 79Andrew Morton's patch scripts:
81http://www.zip.com.au/~akpm/linux/patches/ 80http://www.zip.com.au/~akpm/linux/patches/
82Instead of these scripts, quilt is the recommended patch management 81Instead of these scripts, quilt is the recommended patch management
@@ -484,7 +483,7 @@ Greg Kroah-Hartman "How to piss off a kernel subsystem maintainer".
484 <http://www.kroah.com/log/2005/10/19/> 483 <http://www.kroah.com/log/2005/10/19/>
485 <http://www.kroah.com/log/2006/01/11/> 484 <http://www.kroah.com/log/2006/01/11/>
486 485
487NO!!!! No more huge patch bombs to linux-kernel@vger.kernel.org people!. 486NO!!!! No more huge patch bombs to linux-kernel@vger.kernel.org people!
488 <http://marc.theaimsgroup.com/?l=linux-kernel&m=112112749912944&w=2> 487 <http://marc.theaimsgroup.com/?l=linux-kernel&m=112112749912944&w=2>
489 488
490Kernel Documentation/CodingStyle 489Kernel Documentation/CodingStyle
@@ -493,4 +492,3 @@ Kernel Documentation/CodingStyle
493Linus Torvald's mail on the canonical patch format: 492Linus Torvald's mail on the canonical patch format:
494 <http://lkml.org/lkml/2005/4/7/183> 493 <http://lkml.org/lkml/2005/4/7/183>
495-- 494--
496Last updated on 17 Nov 2005.
diff --git a/Documentation/accounting/delay-accounting.txt b/Documentation/accounting/delay-accounting.txt
new file mode 100644
index 000000000000..1443cd71d263
--- /dev/null
+++ b/Documentation/accounting/delay-accounting.txt
@@ -0,0 +1,112 @@
1Delay accounting
2----------------
3
4Tasks encounter delays in execution when they wait
5for some kernel resource to become available e.g. a
6runnable task may wait for a free CPU to run on.
7
8The per-task delay accounting functionality measures
9the delays experienced by a task while
10
11a) waiting for a CPU (while being runnable)
12b) completion of synchronous block I/O initiated by the task
13c) swapping in pages
14
15and makes these statistics available to userspace through
16the taskstats interface.
17
18Such delays provide feedback for setting a task's cpu priority,
19io priority and rss limit values appropriately. Long delays for
20important tasks could be a trigger for raising its corresponding priority.
21
22The functionality, through its use of the taskstats interface, also provides
23delay statistics aggregated for all tasks (or threads) belonging to a
24thread group (corresponding to a traditional Unix process). This is a commonly
25needed aggregation that is more efficiently done by the kernel.
26
27Userspace utilities, particularly resource management applications, can also
28aggregate delay statistics into arbitrary groups. To enable this, delay
29statistics of a task are available both during its lifetime as well as on its
30exit, ensuring continuous and complete monitoring can be done.
31
32
33Interface
34---------
35
36Delay accounting uses the taskstats interface which is described
37in detail in a separate document in this directory. Taskstats returns a
38generic data structure to userspace corresponding to per-pid and per-tgid
39statistics. The delay accounting functionality populates specific fields of
40this structure. See
41 include/linux/taskstats.h
42for a description of the fields pertaining to delay accounting.
43It will generally be in the form of counters returning the cumulative
44delay seen for cpu, sync block I/O, swapin etc.
45
46Taking the difference of two successive readings of a given
47counter (say cpu_delay_total) for a task will give the delay
48experienced by the task waiting for the corresponding resource
49in that interval.
50
51When a task exits, records containing the per-task statistics
52are sent to userspace without requiring a command. If it is the last exiting
53task of a thread group, the per-tgid statistics are also sent. More details
54are given in the taskstats interface description.
55
56The getdelays.c userspace utility in this directory allows simple commands to
57be run and the corresponding delay statistics to be displayed. It also serves
58as an example of using the taskstats interface.
59
60Usage
61-----
62
63Compile the kernel with
64 CONFIG_TASK_DELAY_ACCT=y
65 CONFIG_TASKSTATS=y
66
67Delay accounting is enabled by default at boot up.
68To disable, add
69 nodelayacct
70to the kernel boot options. The rest of the instructions
71below assume this has not been done.
72
73After the system has booted up, use a utility
74similar to getdelays.c to access the delays
75seen by a given task or a task group (tgid).
76The utility also allows a given command to be
77executed and the corresponding delays to be
78seen.
79
80General format of the getdelays command
81
82getdelays [-t tgid] [-p pid] [-c cmd...]
83
84
85Get delays, since system boot, for pid 10
86# ./getdelays -p 10
87(output similar to next case)
88
89Get sum of delays, since system boot, for all pids with tgid 5
90# ./getdelays -t 5
91
92
93CPU count real total virtual total delay total
94 7876 92005750 100000000 24001500
95IO count delay total
96 0 0
97MEM count delay total
98 0 0
99
100Get delays seen in executing a given simple command
101# ./getdelays -c ls /
102
103bin data1 data3 data5 dev home media opt root srv sys usr
104boot data2 data4 data6 etc lib mnt proc sbin subdomain tmp var
105
106
107CPU count real total virtual total delay total
108 6 4000250 4000000 0
109IO count delay total
110 0 0
111MEM count delay total
112 0 0
diff --git a/Documentation/accounting/getdelays.c b/Documentation/accounting/getdelays.c
new file mode 100644
index 000000000000..795ca3911cc5
--- /dev/null
+++ b/Documentation/accounting/getdelays.c
@@ -0,0 +1,396 @@
1/* getdelays.c
2 *
3 * Utility to get per-pid and per-tgid delay accounting statistics
4 * Also illustrates usage of the taskstats interface
5 *
6 * Copyright (C) Shailabh Nagar, IBM Corp. 2005
7 * Copyright (C) Balbir Singh, IBM Corp. 2006
8 * Copyright (c) Jay Lan, SGI. 2006
9 *
10 */
11
12#include <stdio.h>
13#include <stdlib.h>
14#include <errno.h>
15#include <unistd.h>
16#include <poll.h>
17#include <string.h>
18#include <fcntl.h>
19#include <sys/types.h>
20#include <sys/stat.h>
21#include <sys/socket.h>
22#include <sys/types.h>
23#include <signal.h>
24
25#include <linux/genetlink.h>
26#include <linux/taskstats.h>
27
28/*
29 * Generic macros for dealing with netlink sockets. Might be duplicated
30 * elsewhere. It is recommended that commercial grade applications use
31 * libnl or libnetlink and use the interfaces provided by the library
32 */
33#define GENLMSG_DATA(glh) ((void *)(NLMSG_DATA(glh) + GENL_HDRLEN))
34#define GENLMSG_PAYLOAD(glh) (NLMSG_PAYLOAD(glh, 0) - GENL_HDRLEN)
35#define NLA_DATA(na) ((void *)((char*)(na) + NLA_HDRLEN))
36#define NLA_PAYLOAD(len) (len - NLA_HDRLEN)
37
38#define err(code, fmt, arg...) do { printf(fmt, ##arg); exit(code); } while (0)
39int done = 0;
40int rcvbufsz=0;
41
42 char name[100];
43int dbg=0, print_delays=0;
44__u64 stime, utime;
45#define PRINTF(fmt, arg...) { \
46 if (dbg) { \
47 printf(fmt, ##arg); \
48 } \
49 }
50
51/* Maximum size of response requested or message sent */
52#define MAX_MSG_SIZE 256
53/* Maximum number of cpus expected to be specified in a cpumask */
54#define MAX_CPUS 32
55/* Maximum length of pathname to log file */
56#define MAX_FILENAME 256
57
58struct msgtemplate {
59 struct nlmsghdr n;
60 struct genlmsghdr g;
61 char buf[MAX_MSG_SIZE];
62};
63
64char cpumask[100+6*MAX_CPUS];
65
66/*
67 * Create a raw netlink socket and bind
68 */
69static int create_nl_socket(int protocol)
70{
71 int fd;
72 struct sockaddr_nl local;
73
74 fd = socket(AF_NETLINK, SOCK_RAW, protocol);
75 if (fd < 0)
76 return -1;
77
78 if (rcvbufsz)
79 if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF,
80 &rcvbufsz, sizeof(rcvbufsz)) < 0) {
81 printf("Unable to set socket rcv buf size to %d\n",
82 rcvbufsz);
83 return -1;
84 }
85
86 memset(&local, 0, sizeof(local));
87 local.nl_family = AF_NETLINK;
88
89 if (bind(fd, (struct sockaddr *) &local, sizeof(local)) < 0)
90 goto error;
91
92 return fd;
93error:
94 close(fd);
95 return -1;
96}
97
98
99int send_cmd(int sd, __u16 nlmsg_type, __u32 nlmsg_pid,
100 __u8 genl_cmd, __u16 nla_type,
101 void *nla_data, int nla_len)
102{
103 struct nlattr *na;
104 struct sockaddr_nl nladdr;
105 int r, buflen;
106 char *buf;
107
108 struct msgtemplate msg;
109
110 msg.n.nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN);
111 msg.n.nlmsg_type = nlmsg_type;
112 msg.n.nlmsg_flags = NLM_F_REQUEST;
113 msg.n.nlmsg_seq = 0;
114 msg.n.nlmsg_pid = nlmsg_pid;
115 msg.g.cmd = genl_cmd;
116 msg.g.version = 0x1;
117 na = (struct nlattr *) GENLMSG_DATA(&msg);
118 na->nla_type = nla_type;
119 na->nla_len = nla_len + 1 + NLA_HDRLEN;
120 memcpy(NLA_DATA(na), nla_data, nla_len);
121 msg.n.nlmsg_len += NLMSG_ALIGN(na->nla_len);
122
123 buf = (char *) &msg;
124 buflen = msg.n.nlmsg_len ;
125 memset(&nladdr, 0, sizeof(nladdr));
126 nladdr.nl_family = AF_NETLINK;
127 while ((r = sendto(sd, buf, buflen, 0, (struct sockaddr *) &nladdr,
128 sizeof(nladdr))) < buflen) {
129 if (r > 0) {
130 buf += r;
131 buflen -= r;
132 } else if (errno != EAGAIN)
133 return -1;
134 }
135 return 0;
136}
137
138
139/*
140 * Probe the controller in genetlink to find the family id
141 * for the TASKSTATS family
142 */
143int get_family_id(int sd)
144{
145 struct {
146 struct nlmsghdr n;
147 struct genlmsghdr g;
148 char buf[256];
149 } ans;
150
151 int id, rc;
152 struct nlattr *na;
153 int rep_len;
154
155 strcpy(name, TASKSTATS_GENL_NAME);
156 rc = send_cmd(sd, GENL_ID_CTRL, getpid(), CTRL_CMD_GETFAMILY,
157 CTRL_ATTR_FAMILY_NAME, (void *)name,
158 strlen(TASKSTATS_GENL_NAME)+1);
159
160 rep_len = recv(sd, &ans, sizeof(ans), 0);
161 if (ans.n.nlmsg_type == NLMSG_ERROR ||
162 (rep_len < 0) || !NLMSG_OK((&ans.n), rep_len))
163 return 0;
164
165 na = (struct nlattr *) GENLMSG_DATA(&ans);
166 na = (struct nlattr *) ((char *) na + NLA_ALIGN(na->nla_len));
167 if (na->nla_type == CTRL_ATTR_FAMILY_ID) {
168 id = *(__u16 *) NLA_DATA(na);
169 }
170 return id;
171}
172
173void print_delayacct(struct taskstats *t)
174{
175 printf("\n\nCPU %15s%15s%15s%15s\n"
176 " %15llu%15llu%15llu%15llu\n"
177 "IO %15s%15s\n"
178 " %15llu%15llu\n"
179 "MEM %15s%15s\n"
180 " %15llu%15llu\n\n",
181 "count", "real total", "virtual total", "delay total",
182 t->cpu_count, t->cpu_run_real_total, t->cpu_run_virtual_total,
183 t->cpu_delay_total,
184 "count", "delay total",
185 t->blkio_count, t->blkio_delay_total,
186 "count", "delay total", t->swapin_count, t->swapin_delay_total);
187}
188
189int main(int argc, char *argv[])
190{
191 int c, rc, rep_len, aggr_len, len2, cmd_type;
192 __u16 id;
193 __u32 mypid;
194
195 struct nlattr *na;
196 int nl_sd = -1;
197 int len = 0;
198 pid_t tid = 0;
199 pid_t rtid = 0;
200
201 int fd = 0;
202 int count = 0;
203 int write_file = 0;
204 int maskset = 0;
205 char logfile[128];
206 int loop = 0;
207
208 struct msgtemplate msg;
209
210 while (1) {
211 c = getopt(argc, argv, "dw:r:m:t:p:v:l");
212 if (c < 0)
213 break;
214
215 switch (c) {
216 case 'd':
217 printf("print delayacct stats ON\n");
218 print_delays = 1;
219 break;
220 case 'w':
221 strncpy(logfile, optarg, MAX_FILENAME);
222 printf("write to file %s\n", logfile);
223 write_file = 1;
224 break;
225 case 'r':
226 rcvbufsz = atoi(optarg);
227 printf("receive buf size %d\n", rcvbufsz);
228 if (rcvbufsz < 0)
229 err(1, "Invalid rcv buf size\n");
230 break;
231 case 'm':
232 strncpy(cpumask, optarg, sizeof(cpumask));
233 maskset = 1;
234 printf("cpumask %s maskset %d\n", cpumask, maskset);
235 break;
236 case 't':
237 tid = atoi(optarg);
238 if (!tid)
239 err(1, "Invalid tgid\n");
240 cmd_type = TASKSTATS_CMD_ATTR_TGID;
241 print_delays = 1;
242 break;
243 case 'p':
244 tid = atoi(optarg);
245 if (!tid)
246 err(1, "Invalid pid\n");
247 cmd_type = TASKSTATS_CMD_ATTR_PID;
248 print_delays = 1;
249 break;
250 case 'v':
251 printf("debug on\n");
252 dbg = 1;
253 break;
254 case 'l':
255 printf("listen forever\n");
256 loop = 1;
257 break;
258 default:
259 printf("Unknown option %d\n", c);
260 exit(-1);
261 }
262 }
263
264 if (write_file) {
265 fd = open(logfile, O_WRONLY | O_CREAT | O_TRUNC,
266 S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
267 if (fd == -1) {
268 perror("Cannot open output file\n");
269 exit(1);
270 }
271 }
272
273 if ((nl_sd = create_nl_socket(NETLINK_GENERIC)) < 0)
274 err(1, "error creating Netlink socket\n");
275
276
277 mypid = getpid();
278 id = get_family_id(nl_sd);
279 if (!id) {
280 printf("Error getting family id, errno %d", errno);
281 goto err;
282 }
283 PRINTF("family id %d\n", id);
284
285 if (maskset) {
286 rc = send_cmd(nl_sd, id, mypid, TASKSTATS_CMD_GET,
287 TASKSTATS_CMD_ATTR_REGISTER_CPUMASK,
288 &cpumask, sizeof(cpumask));
289 PRINTF("Sent register cpumask, retval %d\n", rc);
290 if (rc < 0) {
291 printf("error sending register cpumask\n");
292 goto err;
293 }
294 }
295
296 if (tid) {
297 rc = send_cmd(nl_sd, id, mypid, TASKSTATS_CMD_GET,
298 cmd_type, &tid, sizeof(__u32));
299 PRINTF("Sent pid/tgid, retval %d\n", rc);
300 if (rc < 0) {
301 printf("error sending tid/tgid cmd\n");
302 goto done;
303 }
304 }
305
306 do {
307 int i;
308
309 rep_len = recv(nl_sd, &msg, sizeof(msg), 0);
310 PRINTF("received %d bytes\n", rep_len);
311
312 if (rep_len < 0) {
313 printf("nonfatal reply error: errno %d\n", errno);
314 continue;
315 }
316 if (msg.n.nlmsg_type == NLMSG_ERROR ||
317 !NLMSG_OK((&msg.n), rep_len)) {
318 printf("fatal reply error, errno %d\n", errno);
319 goto done;
320 }
321
322 PRINTF("nlmsghdr size=%d, nlmsg_len=%d, rep_len=%d\n",
323 sizeof(struct nlmsghdr), msg.n.nlmsg_len, rep_len);
324
325
326 rep_len = GENLMSG_PAYLOAD(&msg.n);
327
328 na = (struct nlattr *) GENLMSG_DATA(&msg);
329 len = 0;
330 i = 0;
331 while (len < rep_len) {
332 len += NLA_ALIGN(na->nla_len);
333 switch (na->nla_type) {
334 case TASKSTATS_TYPE_AGGR_TGID:
335 /* Fall through */
336 case TASKSTATS_TYPE_AGGR_PID:
337 aggr_len = NLA_PAYLOAD(na->nla_len);
338 len2 = 0;
339 /* For nested attributes, na follows */
340 na = (struct nlattr *) NLA_DATA(na);
341 done = 0;
342 while (len2 < aggr_len) {
343 switch (na->nla_type) {
344 case TASKSTATS_TYPE_PID:
345 rtid = *(int *) NLA_DATA(na);
346 if (print_delays)
347 printf("PID\t%d\n", rtid);
348 break;
349 case TASKSTATS_TYPE_TGID:
350 rtid = *(int *) NLA_DATA(na);
351 if (print_delays)
352 printf("TGID\t%d\n", rtid);
353 break;
354 case TASKSTATS_TYPE_STATS:
355 count++;
356 if (print_delays)
357 print_delayacct((struct taskstats *) NLA_DATA(na));
358 if (fd) {
359 if (write(fd, NLA_DATA(na), na->nla_len) < 0) {
360 err(1,"write error\n");
361 }
362 }
363 if (!loop)
364 goto done;
365 break;
366 default:
367 printf("Unknown nested nla_type %d\n", na->nla_type);
368 break;
369 }
370 len2 += NLA_ALIGN(na->nla_len);
371 na = (struct nlattr *) ((char *) na + len2);
372 }
373 break;
374
375 default:
376 printf("Unknown nla_type %d\n", na->nla_type);
377 break;
378 }
379 na = (struct nlattr *) (GENLMSG_DATA(&msg) + len);
380 }
381 } while (loop);
382done:
383 if (maskset) {
384 rc = send_cmd(nl_sd, id, mypid, TASKSTATS_CMD_GET,
385 TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK,
386 &cpumask, sizeof(cpumask));
387 printf("Sent deregister mask, retval %d\n", rc);
388 if (rc < 0)
389 err(rc, "error sending deregister cpumask\n");
390 }
391err:
392 close(nl_sd);
393 if (fd)
394 close(fd);
395 return 0;
396}
diff --git a/Documentation/accounting/taskstats.txt b/Documentation/accounting/taskstats.txt
new file mode 100644
index 000000000000..92ebf29e9041
--- /dev/null
+++ b/Documentation/accounting/taskstats.txt
@@ -0,0 +1,181 @@
1Per-task statistics interface
2-----------------------------
3
4
5Taskstats is a netlink-based interface for sending per-task and
6per-process statistics from the kernel to userspace.
7
8Taskstats was designed for the following benefits:
9
10- efficiently provide statistics during lifetime of a task and on its exit
11- unified interface for multiple accounting subsystems
12- extensibility for use by future accounting patches
13
14Terminology
15-----------
16
17"pid", "tid" and "task" are used interchangeably and refer to the standard
18Linux task defined by struct task_struct. per-pid stats are the same as
19per-task stats.
20
21"tgid", "process" and "thread group" are used interchangeably and refer to the
22tasks that share an mm_struct i.e. the traditional Unix process. Despite the
23use of tgid, there is no special treatment for the task that is thread group
24leader - a process is deemed alive as long as it has any task belonging to it.
25
26Usage
27-----
28
29To get statistics during a task's lifetime, userspace opens a unicast netlink
30socket (NETLINK_GENERIC family) and sends commands specifying a pid or a tgid.
31The response contains statistics for a task (if pid is specified) or the sum of
32statistics for all tasks of the process (if tgid is specified).
33
34To obtain statistics for tasks which are exiting, the userspace listener
35sends a register command and specifies a cpumask. Whenever a task exits on
36one of the cpus in the cpumask, its per-pid statistics are sent to the
37registered listener. Using cpumasks allows the data received by one listener
38to be limited and assists in flow control over the netlink interface and is
39explained in more detail below.
40
41If the exiting task is the last thread exiting its thread group,
42an additional record containing the per-tgid stats is also sent to userspace.
43The latter contains the sum of per-pid stats for all threads in the thread
44group, both past and present.
45
46getdelays.c is a simple utility demonstrating usage of the taskstats interface
47for reporting delay accounting statistics. Users can register cpumasks,
48send commands and process responses, listen for per-tid/tgid exit data,
49write the data received to a file and do basic flow control by increasing
50receive buffer sizes.
51
52Interface
53---------
54
55The user-kernel interface is encapsulated in include/linux/taskstats.h
56
57To avoid this documentation becoming obsolete as the interface evolves, only
58an outline of the current version is given. taskstats.h always overrides the
59description here.
60
61struct taskstats is the common accounting structure for both per-pid and
62per-tgid data. It is versioned and can be extended by each accounting subsystem
63that is added to the kernel. The fields and their semantics are defined in the
64taskstats.h file.
65
66The data exchanged between user and kernel space is a netlink message belonging
67to the NETLINK_GENERIC family and using the netlink attributes interface.
68The messages are in the format
69
70 +----------+- - -+-------------+-------------------+
71 | nlmsghdr | Pad | genlmsghdr | taskstats payload |
72 +----------+- - -+-------------+-------------------+
73
74
75The taskstats payload is one of the following three kinds:
76
771. Commands: Sent from user to kernel. Commands to get data on
78a pid/tgid consist of one attribute, of type TASKSTATS_CMD_ATTR_PID/TGID,
79containing a u32 pid or tgid in the attribute payload. The pid/tgid denotes
80the task/process for which userspace wants statistics.
81
82Commands to register/deregister interest in exit data from a set of cpus
83consist of one attribute, of type
84TASKSTATS_CMD_ATTR_REGISTER/DEREGISTER_CPUMASK and contain a cpumask in the
85attribute payload. The cpumask is specified as an ascii string of
86comma-separated cpu ranges e.g. to listen to exit data from cpus 1,2,3,5,7,8
87the cpumask would be "1-3,5,7-8". If userspace forgets to deregister interest
88in cpus before closing the listening socket, the kernel cleans up its interest
89set over time. However, for the sake of efficiency, an explicit deregistration
90is advisable.
91
922. Response for a command: sent from the kernel in response to a userspace
93command. The payload is a series of three attributes of type:
94
95a) TASKSTATS_TYPE_AGGR_PID/TGID : attribute containing no payload but indicates
96a pid/tgid will be followed by some stats.
97
98b) TASKSTATS_TYPE_PID/TGID: attribute whose payload is the pid/tgid whose stats
99is being returned.
100
101c) TASKSTATS_TYPE_STATS: attribute with a struct taskstsats as payload. The
102same structure is used for both per-pid and per-tgid stats.
103
1043. New message sent by kernel whenever a task exits. The payload consists of a
105 series of attributes of the following type:
106
107a) TASKSTATS_TYPE_AGGR_PID: indicates next two attributes will be pid+stats
108b) TASKSTATS_TYPE_PID: contains exiting task's pid
109c) TASKSTATS_TYPE_STATS: contains the exiting task's per-pid stats
110d) TASKSTATS_TYPE_AGGR_TGID: indicates next two attributes will be tgid+stats
111e) TASKSTATS_TYPE_TGID: contains tgid of process to which task belongs
112f) TASKSTATS_TYPE_STATS: contains the per-tgid stats for exiting task's process
113
114
115per-tgid stats
116--------------
117
118Taskstats provides per-process stats, in addition to per-task stats, since
119resource management is often done at a process granularity and aggregating task
120stats in userspace alone is inefficient and potentially inaccurate (due to lack
121of atomicity).
122
123However, maintaining per-process, in addition to per-task stats, within the
124kernel has space and time overheads. To address this, the taskstats code
125accumalates each exiting task's statistics into a process-wide data structure.
126When the last task of a process exits, the process level data accumalated also
127gets sent to userspace (along with the per-task data).
128
129When a user queries to get per-tgid data, the sum of all other live threads in
130the group is added up and added to the accumalated total for previously exited
131threads of the same thread group.
132
133Extending taskstats
134-------------------
135
136There are two ways to extend the taskstats interface to export more
137per-task/process stats as patches to collect them get added to the kernel
138in future:
139
1401. Adding more fields to the end of the existing struct taskstats. Backward
141 compatibility is ensured by the version number within the
142 structure. Userspace will use only the fields of the struct that correspond
143 to the version its using.
144
1452. Defining separate statistic structs and using the netlink attributes
146 interface to return them. Since userspace processes each netlink attribute
147 independently, it can always ignore attributes whose type it does not
148 understand (because it is using an older version of the interface).
149
150
151Choosing between 1. and 2. is a matter of trading off flexibility and
152overhead. If only a few fields need to be added, then 1. is the preferable
153path since the kernel and userspace don't need to incur the overhead of
154processing new netlink attributes. But if the new fields expand the existing
155struct too much, requiring disparate userspace accounting utilities to
156unnecessarily receive large structures whose fields are of no interest, then
157extending the attributes structure would be worthwhile.
158
159Flow control for taskstats
160--------------------------
161
162When the rate of task exits becomes large, a listener may not be able to keep
163up with the kernel's rate of sending per-tid/tgid exit data leading to data
164loss. This possibility gets compounded when the taskstats structure gets
165extended and the number of cpus grows large.
166
167To avoid losing statistics, userspace should do one or more of the following:
168
169- increase the receive buffer sizes for the netlink sockets opened by
170listeners to receive exit data.
171
172- create more listeners and reduce the number of cpus being listened to by
173each listener. In the extreme case, there could be one listener for each cpu.
174Users may also consider setting the cpu affinity of the listener to the subset
175of cpus to which it listens, especially if they are listening to just one cpu.
176
177Despite these measures, if the userspace receives ENOBUFS error messages
178indicated overflow of receive buffers, it should take measures to handle the
179loss of data.
180
181----
diff --git a/Documentation/cpu-freq/user-guide.txt b/Documentation/cpu-freq/user-guide.txt
index 7fedc00c3d30..555c8cf3650a 100644
--- a/Documentation/cpu-freq/user-guide.txt
+++ b/Documentation/cpu-freq/user-guide.txt
@@ -153,10 +153,13 @@ scaling_governor, and by "echoing" the name of another
153 that some governors won't load - they only 153 that some governors won't load - they only
154 work on some specific architectures or 154 work on some specific architectures or
155 processors. 155 processors.
156scaling_min_freq and 156scaling_min_freq and
157scaling_max_freq show the current "policy limits" (in 157scaling_max_freq show the current "policy limits" (in
158 kHz). By echoing new values into these 158 kHz). By echoing new values into these
159 files, you can change these limits. 159 files, you can change these limits.
160 NOTE: when setting a policy you need to
161 first set scaling_max_freq, then
162 scaling_min_freq.
160 163
161 164
162If you have selected the "userspace" governor which allows you to 165If you have selected the "userspace" governor which allows you to
diff --git a/Documentation/cpu-hotplug.txt b/Documentation/cpu-hotplug.txt
index 1bcf69996c9d..bc107cb157a8 100644
--- a/Documentation/cpu-hotplug.txt
+++ b/Documentation/cpu-hotplug.txt
@@ -251,16 +251,24 @@ A: This is what you would need in your kernel code to receive notifications.
251 return NOTIFY_OK; 251 return NOTIFY_OK;
252 } 252 }
253 253
254 static struct notifier_block foobar_cpu_notifer = 254 static struct notifier_block __cpuinitdata foobar_cpu_notifer =
255 { 255 {
256 .notifier_call = foobar_cpu_callback, 256 .notifier_call = foobar_cpu_callback,
257 }; 257 };
258 258
259You need to call register_cpu_notifier() from your init function.
260Init functions could be of two types:
2611. early init (init function called when only the boot processor is online).
2622. late init (init function called _after_ all the CPUs are online).
259 263
260In your init function, 264For the first case, you should add the following to your init function
261 265
262 register_cpu_notifier(&foobar_cpu_notifier); 266 register_cpu_notifier(&foobar_cpu_notifier);
263 267
268For the second case, you should add the following to your init function
269
270 register_hotcpu_notifier(&foobar_cpu_notifier);
271
264You can fail PREPARE notifiers if something doesn't work to prepare resources. 272You can fail PREPARE notifiers if something doesn't work to prepare resources.
265This will stop the activity and send a following CANCELED event back. 273This will stop the activity and send a following CANCELED event back.
266 274
diff --git a/Documentation/devices.txt b/Documentation/devices.txt
index 4aaf68fafebe..66c725f530f3 100644
--- a/Documentation/devices.txt
+++ b/Documentation/devices.txt
@@ -2565,10 +2565,10 @@ Your cooperation is appreciated.
2565 243 = /dev/usb/dabusb3 Fourth dabusb device 2565 243 = /dev/usb/dabusb3 Fourth dabusb device
2566 2566
2567180 block USB block devices 2567180 block USB block devices
2568 0 = /dev/uba First USB block device 2568 0 = /dev/uba First USB block device
2569 8 = /dev/ubb Second USB block device 2569 8 = /dev/ubb Second USB block device
2570 16 = /dev/ubc Thrid USB block device 2570 16 = /dev/ubc Third USB block device
2571 ... 2571 ...
2572 2572
2573181 char Conrad Electronic parallel port radio clocks 2573181 char Conrad Electronic parallel port radio clocks
2574 0 = /dev/pcfclock0 First Conrad radio clock 2574 0 = /dev/pcfclock0 First Conrad radio clock
diff --git a/Documentation/drivers/edac/edac.txt b/Documentation/drivers/edac/edac.txt
index 70d96a62e5e1..7b3d969d2964 100644
--- a/Documentation/drivers/edac/edac.txt
+++ b/Documentation/drivers/edac/edac.txt
@@ -35,15 +35,14 @@ the vendor should tie the parity status bits to 0 if they do not intend
35to generate parity. Some vendors do not do this, and thus the parity bit 35to generate parity. Some vendors do not do this, and thus the parity bit
36can "float" giving false positives. 36can "float" giving false positives.
37 37
38The PCI Parity EDAC device has the ability to "skip" known flaky 38[There are patches in the kernel queue which will allow for storage of
39cards during the parity scan. These are set by the parity "blacklist" 39quirks of PCI devices reporting false parity positives. The 2.6.18
40interface in the sysfs for PCI Parity. (See the PCI section in the sysfs 40kernel should have those patches included. When that becomes available,
41section below.) There is also a parity "whitelist" which is used as 41then EDAC will be patched to utilize that information to "skip" such
42an explicit list of devices to scan, while the blacklist is a list 42devices.]
43of devices to skip.
44 43
45EDAC will have future error detectors that will be added or integrated 44EDAC will have future error detectors that will be integrated with
46into EDAC in the following list: 45EDAC or added to it, in the following list:
47 46
48 MCE Machine Check Exception 47 MCE Machine Check Exception
49 MCA Machine Check Architecture 48 MCA Machine Check Architecture
@@ -93,22 +92,24 @@ EDAC lives in the /sys/devices/system/edac directory. Within this directory
93there currently reside 2 'edac' components: 92there currently reside 2 'edac' components:
94 93
95 mc memory controller(s) system 94 mc memory controller(s) system
96 pci PCI status system 95 pci PCI control and status system
97 96
98 97
99============================================================================ 98============================================================================
100Memory Controller (mc) Model 99Memory Controller (mc) Model
101 100
102First a background on the memory controller's model abstracted in EDAC. 101First a background on the memory controller's model abstracted in EDAC.
103Each mc device controls a set of DIMM memory modules. These modules are 102Each 'mc' device controls a set of DIMM memory modules. These modules are
104laid out in a Chip-Select Row (csrowX) and Channel table (chX). There can 103laid out in a Chip-Select Row (csrowX) and Channel table (chX). There can
105be multiple csrows and two channels. 104be multiple csrows and multiple channels.
106 105
107Memory controllers allow for several csrows, with 8 csrows being a typical value. 106Memory controllers allow for several csrows, with 8 csrows being a typical value.
108Yet, the actual number of csrows depends on the electrical "loading" 107Yet, the actual number of csrows depends on the electrical "loading"
109of a given motherboard, memory controller and DIMM characteristics. 108of a given motherboard, memory controller and DIMM characteristics.
110 109
111Dual channels allows for 128 bit data transfers to the CPU from memory. 110Dual channels allows for 128 bit data transfers to the CPU from memory.
111Some newer chipsets allow for more than 2 channels, like Fully Buffered DIMMs
112(FB-DIMMs). The following example will assume 2 channels:
112 113
113 114
114 Channel 0 Channel 1 115 Channel 0 Channel 1
@@ -234,23 +235,15 @@ Polling period control file:
234 The time period, in milliseconds, for polling for error information. 235 The time period, in milliseconds, for polling for error information.
235 Too small a value wastes resources. Too large a value might delay 236 Too small a value wastes resources. Too large a value might delay
236 necessary handling of errors and might loose valuable information for 237 necessary handling of errors and might loose valuable information for
237 locating the error. 1000 milliseconds (once each second) is about 238 locating the error. 1000 milliseconds (once each second) is the current
238 right for most uses. 239 default. Systems which require all the bandwidth they can get, may
240 increase this.
239 241
240 LOAD TIME: module/kernel parameter: poll_msec=[0|1] 242 LOAD TIME: module/kernel parameter: poll_msec=[0|1]
241 243
242 RUN TIME: echo "1000" >/sys/devices/system/edac/mc/poll_msec 244 RUN TIME: echo "1000" >/sys/devices/system/edac/mc/poll_msec
243 245
244 246
245Module Version read-only attribute file:
246
247 'mc_version'
248
249 The EDAC CORE module's version and compile date are shown here to
250 indicate what EDAC is running.
251
252
253
254============================================================================ 247============================================================================
255'mcX' DIRECTORIES 248'mcX' DIRECTORIES
256 249
@@ -284,35 +277,6 @@ Seconds since last counter reset control file:
284 277
285 278
286 279
287DIMM capability attribute file:
288
289 'edac_capability'
290
291 The EDAC (Error Detection and Correction) capabilities/modes of
292 the memory controller hardware.
293
294
295DIMM Current Capability attribute file:
296
297 'edac_current_capability'
298
299 The EDAC capabilities available with the hardware
300 configuration. This may not be the same as "EDAC capability"
301 if the correct memory is not used. If a memory controller is
302 capable of EDAC, but DIMMs without check bits are in use, then
303 Parity, SECDED, S4ECD4ED capabilities will not be available
304 even though the memory controller might be capable of those
305 modes with the proper memory loaded.
306
307
308Memory Type supported on this controller attribute file:
309
310 'supported_mem_type'
311
312 This attribute file displays the memory type, usually
313 buffered and unbuffered DIMMs.
314
315
316Memory Controller name attribute file: 280Memory Controller name attribute file:
317 281
318 'mc_name' 282 'mc_name'
@@ -321,16 +285,6 @@ Memory Controller name attribute file:
321 that is being utilized. 285 that is being utilized.
322 286
323 287
324Memory Controller Module name attribute file:
325
326 'module_name'
327
328 This attribute file displays the memory controller module name,
329 version and date built. The name of the memory controller
330 hardware - some drivers work with multiple controllers and
331 this field shows which hardware is present.
332
333
334Total memory managed by this memory controller attribute file: 288Total memory managed by this memory controller attribute file:
335 289
336 'size_mb' 290 'size_mb'
@@ -432,6 +386,9 @@ Memory Type attribute file:
432 386
433 This attribute file will display what type of memory is currently 387 This attribute file will display what type of memory is currently
434 on this csrow. Normally, either buffered or unbuffered memory. 388 on this csrow. Normally, either buffered or unbuffered memory.
389 Examples:
390 Registered-DDR
391 Unbuffered-DDR
435 392
436 393
437EDAC Mode of operation attribute file: 394EDAC Mode of operation attribute file:
@@ -446,8 +403,13 @@ Device type attribute file:
446 403
447 'dev_type' 404 'dev_type'
448 405
449 This attribute file will display what type of DIMM device is 406 This attribute file will display what type of DRAM device is
450 being utilized. Example: x4 407 being utilized on this DIMM.
408 Examples:
409 x1
410 x2
411 x4
412 x8
451 413
452 414
453Channel 0 CE Count attribute file: 415Channel 0 CE Count attribute file:
@@ -522,10 +484,10 @@ SYSTEM LOGGING
522If logging for UEs and CEs are enabled then system logs will have 484If logging for UEs and CEs are enabled then system logs will have
523error notices indicating errors that have been detected: 485error notices indicating errors that have been detected:
524 486
525MC0: CE page 0x283, offset 0xce0, grain 8, syndrome 0x6ec3, row 0, 487EDAC MC0: CE page 0x283, offset 0xce0, grain 8, syndrome 0x6ec3, row 0,
526channel 1 "DIMM_B1": amd76x_edac 488channel 1 "DIMM_B1": amd76x_edac
527 489
528MC0: CE page 0x1e5, offset 0xfb0, grain 8, syndrome 0xb741, row 0, 490EDAC MC0: CE page 0x1e5, offset 0xfb0, grain 8, syndrome 0xb741, row 0,
529channel 1 "DIMM_B1": amd76x_edac 491channel 1 "DIMM_B1": amd76x_edac
530 492
531 493
@@ -610,64 +572,4 @@ Parity Count:
610 572
611 573
612 574
613PCI Device Whitelist:
614
615 'pci_parity_whitelist'
616
617 This control file allows for an explicit list of PCI devices to be
618 scanned for parity errors. Only devices found on this list will
619 be examined. The list is a line of hexadecimal VENDOR and DEVICE
620 ID tuples:
621
622 1022:7450,1434:16a6
623
624 One or more can be inserted, separated by a comma.
625
626 To write the above list doing the following as one command line:
627
628 echo "1022:7450,1434:16a6"
629 > /sys/devices/system/edac/pci/pci_parity_whitelist
630
631
632
633 To display what the whitelist is, simply 'cat' the same file.
634
635
636PCI Device Blacklist:
637
638 'pci_parity_blacklist'
639
640 This control file allows for a list of PCI devices to be
641 skipped for scanning.
642 The list is a line of hexadecimal VENDOR and DEVICE ID tuples:
643
644 1022:7450,1434:16a6
645
646 One or more can be inserted, separated by a comma.
647
648 To write the above list doing the following as one command line:
649
650 echo "1022:7450,1434:16a6"
651 > /sys/devices/system/edac/pci/pci_parity_blacklist
652
653
654 To display what the whitelist currently contains,
655 simply 'cat' the same file.
656
657======================================================================= 575=======================================================================
658
659PCI Vendor and Devices IDs can be obtained with the lspci command. Using
660the -n option lspci will display the vendor and device IDs. The system
661administrator will have to determine which devices should be scanned or
662skipped.
663
664
665
666The two lists (white and black) are prioritized. blacklist is the lower
667priority and will NOT be utilized when a whitelist has been set.
668Turn OFF a whitelist by an empty echo command:
669
670 echo > /sys/devices/system/edac/pci/pci_parity_whitelist
671
672and any previous blacklist will be utilized.
673
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
index 99f219a01e0e..87851efb0228 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -55,14 +55,6 @@ Who: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
55 55
56--------------------------- 56---------------------------
57 57
58What: remove EXPORT_SYMBOL(insert_resource)
59When: April 2006
60Files: kernel/resource.c
61Why: No modular usage in the kernel.
62Who: Adrian Bunk <bunk@stusta.de>
63
64---------------------------
65
66What: PCMCIA control ioctl (needed for pcmcia-cs [cardmgr, cardctl]) 58What: PCMCIA control ioctl (needed for pcmcia-cs [cardmgr, cardctl])
67When: November 2005 59When: November 2005
68Files: drivers/pcmcia/: pcmcia_ioctl.c 60Files: drivers/pcmcia/: pcmcia_ioctl.c
@@ -166,17 +158,6 @@ Who: Arjan van de Ven <arjan@linux.intel.com>
166 158
167--------------------------- 159---------------------------
168 160
169What: remove EXPORT_SYMBOL(tasklist_lock)
170When: August 2006
171Files: kernel/fork.c
172Why: tasklist_lock protects the kernel internal task list. Modules have
173 no business looking at it, and all instances in drivers have been due
174 to use of too-lowlevel APIs. Having this symbol exported prevents
175 moving to more scalable locking schemes for the task list.
176Who: Christoph Hellwig <hch@lst.de>
177
178---------------------------
179
180What: mount/umount uevents 161What: mount/umount uevents
181When: February 2007 162When: February 2007
182Why: These events are not correct, and do not properly let userspace know 163Why: These events are not correct, and do not properly let userspace know
@@ -266,3 +247,30 @@ Why: The interrupt related SA_* flags are replaced by IRQF_* to move them
266Who: Thomas Gleixner <tglx@linutronix.de> 247Who: Thomas Gleixner <tglx@linutronix.de>
267 248
268--------------------------- 249---------------------------
250
251What: i2c-ite and i2c-algo-ite drivers
252When: September 2006
253Why: These drivers never compiled since they were added to the kernel
254 tree 5 years ago. This feature removal can be reevaluated if
255 someone shows interest in the drivers, fixes them and takes over
256 maintenance.
257 http://marc.theaimsgroup.com/?l=linux-mips&m=115040510817448
258Who: Jean Delvare <khali@linux-fr.org>
259
260---------------------------
261
262What: Bridge netfilter deferred IPv4/IPv6 output hook calling
263When: January 2007
264Why: The deferred output hooks are a layering violation causing unusual
265 and broken behaviour on bridge devices. Examples of things they
266 break include QoS classifation using the MARK or CLASSIFY targets,
267 the IPsec policy match and connection tracking with VLANs on a
268 bridge. Their only use is to enable bridge output port filtering
269 within iptables with the physdev match, which can also be done by
270 combining iptables and ebtables using netfilter marks. Until it
271 will get removed the hook deferral is disabled by default and is
272 only enabled when needed.
273
274Who: Patrick McHardy <kaber@trash.net>
275
276---------------------------
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking
index d31efbbdfe50..247d7f619aa2 100644
--- a/Documentation/filesystems/Locking
+++ b/Documentation/filesystems/Locking
@@ -142,8 +142,8 @@ see also dquot_operations section.
142 142
143--------------------------- file_system_type --------------------------- 143--------------------------- file_system_type ---------------------------
144prototypes: 144prototypes:
145 struct int (*get_sb) (struct file_system_type *, int, 145 int (*get_sb) (struct file_system_type *, int,
146 const char *, void *, struct vfsmount *); 146 const char *, void *, struct vfsmount *);
147 void (*kill_sb) (struct super_block *); 147 void (*kill_sb) (struct super_block *);
148locking rules: 148locking rules:
149 may block BKL 149 may block BKL
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt
index 9d3aed628bc1..1cb7e8be927a 100644
--- a/Documentation/filesystems/vfs.txt
+++ b/Documentation/filesystems/vfs.txt
@@ -113,8 +113,8 @@ members are defined:
113struct file_system_type { 113struct file_system_type {
114 const char *name; 114 const char *name;
115 int fs_flags; 115 int fs_flags;
116 struct int (*get_sb) (struct file_system_type *, int, 116 int (*get_sb) (struct file_system_type *, int,
117 const char *, void *, struct vfsmount *); 117 const char *, void *, struct vfsmount *);
118 void (*kill_sb) (struct super_block *); 118 void (*kill_sb) (struct super_block *);
119 struct module *owner; 119 struct module *owner;
120 struct file_system_type * next; 120 struct file_system_type * next;
diff --git a/Documentation/hwmon/abituguru b/Documentation/hwmon/abituguru
index 69cdb527d58f..b2c0d61b39a2 100644
--- a/Documentation/hwmon/abituguru
+++ b/Documentation/hwmon/abituguru
@@ -2,13 +2,36 @@ Kernel driver abituguru
2======================= 2=======================
3 3
4Supported chips: 4Supported chips:
5 * Abit uGuru (Hardware Monitor part only) 5 * Abit uGuru revision 1-3 (Hardware Monitor part only)
6 Prefix: 'abituguru' 6 Prefix: 'abituguru'
7 Addresses scanned: ISA 0x0E0 7 Addresses scanned: ISA 0x0E0
8 Datasheet: Not available, this driver is based on reverse engineering. 8 Datasheet: Not available, this driver is based on reverse engineering.
9 A "Datasheet" has been written based on the reverse engineering it 9 A "Datasheet" has been written based on the reverse engineering it
10 should be available in the same dir as this file under the name 10 should be available in the same dir as this file under the name
11 abituguru-datasheet. 11 abituguru-datasheet.
12 Note:
13 The uGuru is a microcontroller with onboard firmware which programs
14 it to behave as a hwmon IC. There are many different revisions of the
15 firmware and thus effectivly many different revisions of the uGuru.
16 Below is an incomplete list with which revisions are used for which
17 Motherboards:
18 uGuru 1.00 ~ 1.24 (AI7, KV8-MAX3, AN7) (1)
19 uGuru 2.0.0.0 ~ 2.0.4.2 (KV8-PRO)
20 uGuru 2.1.0.0 ~ 2.1.2.8 (AS8, AV8, AA8, AG8, AA8XE, AX8)
21 uGuru 2.2.0.0 ~ 2.2.0.6 (AA8 Fatal1ty)
22 uGuru 2.3.0.0 ~ 2.3.0.9 (AN8)
23 uGuru 3.0.0.0 ~ 3.0.1.2 (AW8, AL8, NI8)
24 uGuru 4.xxxxx? (AT8 32X) (2)
25 1) For revisions 2 and 3 uGuru's the driver can autodetect the
26 sensortype (Volt or Temp) for bank1 sensors, for revision 1 uGuru's
27 this doesnot always work. For these uGuru's the autodection can
28 be overriden with the bank1_types module param. For all 3 known
29 revison 1 motherboards the correct use of this param is:
30 bank1_types=1,1,0,0,0,0,0,2,0,0,0,0,2,0,0,1
31 You may also need to specify the fan_sensors option for these boards
32 fan_sensors=5
33 2) The current version of the abituguru driver is known to NOT work
34 on these Motherboards
12 35
13Authors: 36Authors:
14 Hans de Goede <j.w.r.degoede@hhs.nl>, 37 Hans de Goede <j.w.r.degoede@hhs.nl>,
@@ -22,6 +45,11 @@ Module Parameters
22* force: bool Force detection. Note this parameter only causes the 45* force: bool Force detection. Note this parameter only causes the
23 detection to be skipped, if the uGuru can't be read 46 detection to be skipped, if the uGuru can't be read
24 the module initialization (insmod) will still fail. 47 the module initialization (insmod) will still fail.
48* bank1_types: int[] Bank1 sensortype autodetection override:
49 -1 autodetect (default)
50 0 volt sensor
51 1 temp sensor
52 2 not connected
25* fan_sensors: int Tell the driver how many fan speed sensors there are 53* fan_sensors: int Tell the driver how many fan speed sensors there are
26 on your motherboard. Default: 0 (autodetect). 54 on your motherboard. Default: 0 (autodetect).
27* pwms: int Tell the driver how many fan speed controls (fan 55* pwms: int Tell the driver how many fan speed controls (fan
@@ -29,7 +57,7 @@ Module Parameters
29* verbose: int How verbose should the driver be? (0-3): 57* verbose: int How verbose should the driver be? (0-3):
30 0 normal output 58 0 normal output
31 1 + verbose error reporting 59 1 + verbose error reporting
32 2 + sensors type probing info\n" 60 2 + sensors type probing info (default)
33 3 + retryable error reporting 61 3 + retryable error reporting
34 Default: 2 (the driver is still in the testing phase) 62 Default: 2 (the driver is still in the testing phase)
35 63
diff --git a/Documentation/i2c/busses/i2c-sis96x b/Documentation/i2c/busses/i2c-sis96x
index 00a009b977e9..08d7b2dac69a 100644
--- a/Documentation/i2c/busses/i2c-sis96x
+++ b/Documentation/i2c/busses/i2c-sis96x
@@ -42,8 +42,8 @@ I suspect that this driver could be made to work for the following SiS
42chipsets as well: 635, and 635T. If anyone owns a board with those chips 42chipsets as well: 635, and 635T. If anyone owns a board with those chips
43AND is willing to risk crashing & burning an otherwise well-behaved kernel 43AND is willing to risk crashing & burning an otherwise well-behaved kernel
44in the name of progress... please contact me at <mhoffman@lightlink.com> or 44in the name of progress... please contact me at <mhoffman@lightlink.com> or
45via the project's mailing list: <lm-sensors@lm-sensors.org>. Please 45via the project's mailing list: <i2c@lm-sensors.org>. Please send bug
46send bug reports and/or success stories as well. 46reports and/or success stories as well.
47 47
48 48
49TO DOs 49TO DOs
diff --git a/Documentation/infiniband/ipoib.txt b/Documentation/infiniband/ipoib.txt
index 187035560d7f..864ff3283780 100644
--- a/Documentation/infiniband/ipoib.txt
+++ b/Documentation/infiniband/ipoib.txt
@@ -51,8 +51,6 @@ Debugging Information
51 51
52References 52References
53 53
54 IETF IP over InfiniBand (ipoib) Working Group
55 http://ietf.org/html.charters/ipoib-charter.html
56 Transmission of IP over InfiniBand (IPoIB) (RFC 4391) 54 Transmission of IP over InfiniBand (IPoIB) (RFC 4391)
57 http://ietf.org/rfc/rfc4391.txt 55 http://ietf.org/rfc/rfc4391.txt
58 IP over InfiniBand (IPoIB) Architecture (RFC 4392) 56 IP over InfiniBand (IPoIB) Architecture (RFC 4392)
diff --git a/Documentation/initrd.txt b/Documentation/initrd.txt
index b1b6440237a6..15f1b35deb34 100644
--- a/Documentation/initrd.txt
+++ b/Documentation/initrd.txt
@@ -72,6 +72,22 @@ initrd adds the following new options:
72 initrd is mounted as root, and the normal boot procedure is followed, 72 initrd is mounted as root, and the normal boot procedure is followed,
73 with the RAM disk still mounted as root. 73 with the RAM disk still mounted as root.
74 74
75Compressed cpio images
76----------------------
77
78Recent kernels have support for populating a ramdisk from a compressed cpio
79archive, on such systems, the creation of a ramdisk image doesn't need to
80involve special block devices or loopbacks, you merely create a directory on
81disk with the desired initrd content, cd to that directory, and run (as an
82example):
83
84find . | cpio --quiet -c -o | gzip -9 -n > /boot/imagefile.img
85
86Examining the contents of an existing image file is just as simple:
87
88mkdir /tmp/imagefile
89cd /tmp/imagefile
90gzip -cd /boot/imagefile.img | cpio -imd --quiet
75 91
76Installation 92Installation
77------------ 93------------
diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt
index 14ef3868a328..0706699c9da9 100644
--- a/Documentation/kbuild/makefiles.txt
+++ b/Documentation/kbuild/makefiles.txt
@@ -407,6 +407,20 @@ more details, with real examples.
407 The second argument is optional, and if supplied will be used 407 The second argument is optional, and if supplied will be used
408 if first argument is not supported. 408 if first argument is not supported.
409 409
410 ld-option
411 ld-option is used to check if $(CC) when used to link object files
412 supports the given option. An optional second option may be
413 specified if first option are not supported.
414
415 Example:
416 #arch/i386/kernel/Makefile
417 vsyscall-flags += $(call ld-option, -Wl$(comma)--hash-style=sysv)
418
419 In the above example vsyscall-flags will be assigned the option
420 -Wl$(comma)--hash-style=sysv if it is supported by $(CC).
421 The second argument is optional, and if supplied will be used
422 if first argument is not supported.
423
410 cc-option 424 cc-option
411 cc-option is used to check if $(CC) support a given option, and not 425 cc-option is used to check if $(CC) support a given option, and not
412 supported to use an optional second option. 426 supported to use an optional second option.
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 149f62ba14a5..b50595a0550f 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1029,6 +1029,8 @@ running once the system is up.
1029 1029
1030 nocache [ARM] 1030 nocache [ARM]
1031 1031
1032 nodelayacct [KNL] Disable per-task delay accounting
1033
1032 nodisconnect [HW,SCSI,M68K] Disables SCSI disconnects. 1034 nodisconnect [HW,SCSI,M68K] Disables SCSI disconnects.
1033 1035
1034 noexec [IA-64] 1036 noexec [IA-64]
diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt
index 28d1bc3edb1c..46b9b389df35 100644
--- a/Documentation/memory-barriers.txt
+++ b/Documentation/memory-barriers.txt
@@ -1015,10 +1015,9 @@ CPU from reordering them.
1015There are some more advanced barrier functions: 1015There are some more advanced barrier functions:
1016 1016
1017 (*) set_mb(var, value) 1017 (*) set_mb(var, value)
1018 (*) set_wmb(var, value)
1019 1018
1020 These assign the value to the variable and then insert at least a write 1019 This assigns the value to the variable and then inserts at least a write
1021 barrier after it, depending on the function. They aren't guaranteed to 1020 barrier after it, depending on the function. It isn't guaranteed to
1022 insert anything more than a compiler barrier in a UP compilation. 1021 insert anything more than a compiler barrier in a UP compilation.
1023 1022
1024 1023
diff --git a/Documentation/mips/time.README b/Documentation/mips/time.README
index 70bc0dd43d6d..69ddc5c14b79 100644
--- a/Documentation/mips/time.README
+++ b/Documentation/mips/time.README
@@ -65,7 +65,7 @@ the following functions or values:
65 1. (optional) set up RTC routines 65 1. (optional) set up RTC routines
66 2. (optional) calibrate and set the mips_counter_frequency 66 2. (optional) calibrate and set the mips_counter_frequency
67 67
68 b) board_timer_setup - a function pointer. Invoked at the end of time_init() 68 b) plat_timer_setup - a function pointer. Invoked at the end of time_init()
69 1. (optional) over-ride any decisions made in time_init() 69 1. (optional) over-ride any decisions made in time_init()
70 2. set up the irqaction for timer interrupt. 70 2. set up the irqaction for timer interrupt.
71 3. enable the timer interrupt 71 3. enable the timer interrupt
@@ -116,19 +116,17 @@ Step 2: the machine setup() function
116 116
117 If you supply board_time_init(), set the function poointer. 117 If you supply board_time_init(), set the function poointer.
118 118
119 Set the function pointer board_timer_setup() (mandatory)
120 119
121 120Step 3: implement rtc routines, board_time_init() and plat_timer_setup()
122Step 3: implement rtc routines, board_time_init() and board_timer_setup()
123 if needed. 121 if needed.
124 122
125 board_time_init() - 123 board_time_init() -
126 a) (optional) set up RTC routines, 124 a) (optional) set up RTC routines,
127 b) (optional) calibrate and set the mips_counter_frequency 125 b) (optional) calibrate and set the mips_counter_frequency
128 (only needed if you intended to use fixed_rate_gettimeoffset 126 (only needed if you intended to use fixed_rate_gettimeoffset
129 or use cpu counter as timer interrupt source) 127 or use cpu counter as timer interrupt source)
130 128
131 board_timer_setup() - 129 plat_timer_setup() -
132 a) (optional) over-write any choices made above by time_init(). 130 a) (optional) over-write any choices made above by time_init().
133 b) machine specific code should setup the timer irqaction. 131 b) machine specific code should setup the timer irqaction.
134 c) enable the timer interrupt 132 c) enable the timer interrupt
diff --git a/Documentation/nfsroot.txt b/Documentation/nfsroot.txt
index d56dc71d9430..3cc953cb288f 100644
--- a/Documentation/nfsroot.txt
+++ b/Documentation/nfsroot.txt
@@ -4,15 +4,16 @@ Mounting the root filesystem via NFS (nfsroot)
4Written 1996 by Gero Kuhlmann <gero@gkminix.han.de> 4Written 1996 by Gero Kuhlmann <gero@gkminix.han.de>
5Updated 1997 by Martin Mares <mj@atrey.karlin.mff.cuni.cz> 5Updated 1997 by Martin Mares <mj@atrey.karlin.mff.cuni.cz>
6Updated 2006 by Nico Schottelius <nico-kernel-nfsroot@schottelius.org> 6Updated 2006 by Nico Schottelius <nico-kernel-nfsroot@schottelius.org>
7Updated 2006 by Horms <horms@verge.net.au>
7 8
8 9
9 10
10If you want to use a diskless system, as an X-terminal or printer 11In order to use a diskless system, such as an X-terminal or printer server
11server for example, you have to put your root filesystem onto a 12for example, it is necessary for the root filesystem to be present on a
12non-disk device. This can either be a ramdisk (see initrd.txt in 13non-disk device. This may be an initramfs (see Documentation/filesystems/
13this directory for further information) or a filesystem mounted 14ramfs-rootfs-initramfs.txt), a ramdisk (see Documenation/initrd.txt) or a
14via NFS. The following text describes on how to use NFS for the 15filesystem mounted via NFS. The following text describes on how to use NFS
15root filesystem. For the rest of this text 'client' means the 16for the root filesystem. For the rest of this text 'client' means the
16diskless system, and 'server' means the NFS server. 17diskless system, and 'server' means the NFS server.
17 18
18 19
@@ -21,11 +22,13 @@ diskless system, and 'server' means the NFS server.
211.) Enabling nfsroot capabilities 221.) Enabling nfsroot capabilities
22 ----------------------------- 23 -----------------------------
23 24
24In order to use nfsroot you have to select support for NFS during 25In order to use nfsroot, NFS client support needs to be selected as
25kernel configuration. Note that NFS cannot be loaded as a module 26built-in during configuration. Once this has been selected, the nfsroot
26in this case. The configuration script will then ask you whether 27option will become available, which should also be selected.
27you want to use nfsroot, and if yes what kind of auto configuration 28
28system you want to use. Selecting both BOOTP and RARP is safe. 29In the networking options, kernel level autoconfiguration can be selected,
30along with the types of autoconfiguration to support. Selecting all of
31DHCP, BOOTP and RARP is safe.
29 32
30 33
31 34
@@ -33,11 +36,10 @@ system you want to use. Selecting both BOOTP and RARP is safe.
332.) Kernel command line 362.) Kernel command line
34 ------------------- 37 -------------------
35 38
36When the kernel has been loaded by a boot loader (either by loadlin, 39When the kernel has been loaded by a boot loader (see below) it needs to be
37LILO or a network boot program) it has to be told what root fs device 40told what root fs device to use. And in the case of nfsroot, where to find
38to use, and where to find the server and the name of the directory 41both the server and the name of the directory on the server to mount as root.
39on the server to mount as root. This can be established by a couple 42This can be established using the following kernel command line parameters:
40of kernel command line parameters:
41 43
42 44
43root=/dev/nfs 45root=/dev/nfs
@@ -49,23 +51,21 @@ root=/dev/nfs
49 51
50nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>] 52nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>]
51 53
52 If the `nfsroot' parameter is NOT given on the command line, the default 54 If the `nfsroot' parameter is NOT given on the command line,
53 "/tftpboot/%s" will be used. 55 the default "/tftpboot/%s" will be used.
54 56
55 <server-ip> Specifies the IP address of the NFS server. If this field 57 <server-ip> Specifies the IP address of the NFS server.
56 is not given, the default address as determined by the 58 The default address is determined by the `ip' parameter
57 `ip' variable (see below) is used. One use of this 59 (see below). This parameter allows the use of different
58 parameter is for example to allow using different servers 60 servers for IP autoconfiguration and NFS.
59 for RARP and NFS. Usually you can leave this blank.
60 61
61 <root-dir> Name of the directory on the server to mount as root. If 62 <root-dir> Name of the directory on the server to mount as root.
62 there is a "%s" token in the string, the token will be 63 If there is a "%s" token in the string, it will be
63 replaced by the ASCII-representation of the client's IP 64 replaced by the ASCII-representation of the client's
64 address. 65 IP address.
65 66
66 <nfs-options> Standard NFS options. All options are separated by commas. 67 <nfs-options> Standard NFS options. All options are separated by commas.
67 If the options field is not given, the following defaults 68 The following defaults are used:
68 will be used:
69 port = as given by server portmap daemon 69 port = as given by server portmap daemon
70 rsize = 1024 70 rsize = 1024
71 wsize = 1024 71 wsize = 1024
@@ -81,129 +81,174 @@ nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>]
81ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf> 81ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>
82 82
83 This parameter tells the kernel how to configure IP addresses of devices 83 This parameter tells the kernel how to configure IP addresses of devices
84 and also how to set up the IP routing table. It was originally called `nfsaddrs', 84 and also how to set up the IP routing table. It was originally called
85 but now the boot-time IP configuration works independently of NFS, so it 85 `nfsaddrs', but now the boot-time IP configuration works independently of
86 was renamed to `ip' and the old name remained as an alias for compatibility 86 NFS, so it was renamed to `ip' and the old name remained as an alias for
87 reasons. 87 compatibility reasons.
88 88
89 If this parameter is missing from the kernel command line, all fields are 89 If this parameter is missing from the kernel command line, all fields are
90 assumed to be empty, and the defaults mentioned below apply. In general 90 assumed to be empty, and the defaults mentioned below apply. In general
91 this means that the kernel tries to configure everything using both 91 this means that the kernel tries to configure everything using
92 RARP and BOOTP (depending on what has been enabled during kernel confi- 92 autoconfiguration.
93 guration, and if both what protocol answer got in first). 93
94 The <autoconf> parameter can appear alone as the value to the `ip'
95 parameter (without all the ':' characters before) in which case auto-
96 configuration is used.
97
98 <client-ip> IP address of the client.
94 99
95 <client-ip> IP address of the client. If empty, the address will either 100 Default: Determined using autoconfiguration.
96 be determined by RARP or BOOTP. What protocol is used de-
97 pends on what has been enabled during kernel configuration
98 and on the <autoconf> parameter. If this parameter is not
99 empty, neither RARP nor BOOTP will be used.
100 101
101 <server-ip> IP address of the NFS server. If RARP is used to determine 102 <server-ip> IP address of the NFS server. If RARP is used to determine
102 the client address and this parameter is NOT empty only 103 the client address and this parameter is NOT empty only
103 replies from the specified server are accepted. To use 104 replies from the specified server are accepted.
104 different RARP and NFS server, specify your RARP server 105
105 here (or leave it blank), and specify your NFS server in 106 Only required for for NFS root. That is autoconfiguration
106 the `nfsroot' parameter (see above). If this entry is blank 107 will not be triggered if it is missing and NFS root is not
107 the address of the server is used which answered the RARP 108 in operation.
108 or BOOTP request. 109
109 110 Default: Determined using autoconfiguration.
110 <gw-ip> IP address of a gateway if the server is on a different 111 The address of the autoconfiguration server is used.
111 subnet. If this entry is empty no gateway is used and the 112
112 server is assumed to be on the local network, unless a 113 <gw-ip> IP address of a gateway if the server is on a different subnet.
113 value has been received by BOOTP. 114
114 115 Default: Determined using autoconfiguration.
115 <netmask> Netmask for local network interface. If this is empty, 116
117 <netmask> Netmask for local network interface. If unspecified
116 the netmask is derived from the client IP address assuming 118 the netmask is derived from the client IP address assuming
117 classful addressing, unless overridden in BOOTP reply. 119 classful addressing.
118 120
119 <hostname> Name of the client. If empty, the client IP address is 121 Default: Determined using autoconfiguration.
120 used in ASCII notation, or the value received by BOOTP.
121 122
122 <device> Name of network device to use. If this is empty, all 123 <hostname> Name of the client. May be supplied by autoconfiguration,
123 devices are used for RARP and BOOTP requests, and the 124 but its absence will not trigger autoconfiguration.
124 first one we receive a reply on is configured. If you have
125 only one device, you can safely leave this blank.
126 125
127 <autoconf> Method to use for autoconfiguration. If this is either 126 Default: Client IP address is used in ASCII notation.
128 'rarp' or 'bootp', the specified protocol is used.
129 If the value is 'both' or empty, both protocols are used
130 so far as they have been enabled during kernel configura-
131 tion. 'off' means no autoconfiguration.
132 127
133 The <autoconf> parameter can appear alone as the value to the `ip' 128 <device> Name of network device to use.
134 parameter (without all the ':' characters before) in which case auto- 129
135 configuration is used. 130 Default: If the host only has one device, it is used.
131 Otherwise the device is determined using
132 autoconfiguration. This is done by sending
133 autoconfiguration requests out of all devices,
134 and using the device that received the first reply.
136 135
136 <autoconf> Method to use for autoconfiguration. In the case of options
137 which specify multiple autoconfiguration protocols,
138 requests are sent using all protocols, and the first one
139 to reply is used.
137 140
141 Only autoconfiguration protocols that have been compiled
142 into the kernel will be used, regardless of the value of
143 this option.
138 144
145 off or none: don't use autoconfiguration (default)
146 on or any: use any protocol available in the kernel
147 dhcp: use DHCP
148 bootp: use BOOTP
149 rarp: use RARP
150 both: use both BOOTP and RARP but not DHCP
151 (old option kept for backwards compatibility)
139 152
1403.) Kernel loader 153 Default: any
141 -------------
142 154
143To get the kernel into memory different approaches can be used. They
144depend on what facilities are available:
145 155
146 156
1473.1) Writing the kernel onto a floppy using dd:
148 As always you can just write the kernel onto a floppy using dd,
149 but then it's not possible to use kernel command lines at all.
150 To substitute the 'root=' parameter, create a dummy device on any
151 linux system with major number 0 and minor number 255 using mknod:
152 157
153 mknod /dev/boot255 c 0 255 1583.) Boot Loader
159 ----------
154 160
155 Then copy the kernel zImage file onto a floppy using dd: 161To get the kernel into memory different approaches can be used.
162They depend on various facilities being available:
156 163
157 dd if=/usr/src/linux/arch/i386/boot/zImage of=/dev/fd0
158 164
159 And finally use rdev to set the root device: 1653.1) Booting from a floppy using syslinux
160 166
161 rdev /dev/fd0 /dev/boot255 167 When building kernels, an easy way to create a boot floppy that uses
168 syslinux is to use the zdisk or bzdisk make targets which use
169 and bzimage images respectively. Both targets accept the
170 FDARGS parameter which can be used to set the kernel command line.
162 171
163 You can then remove the dummy device /dev/boot255 again. There 172 e.g.
164 is no real device available for it. 173 make bzdisk FDARGS="root=/dev/nfs"
165 The other two kernel command line parameters cannot be substi- 174
166 tuted with rdev. Therefore, using this method the kernel will 175 Note that the user running this command will need to have
167 by default use RARP and/or BOOTP, and if it gets an answer via 176 access to the floppy drive device, /dev/fd0
168 RARP will mount the directory /tftpboot/<client-ip>/ as its 177
169 root. If it got a BOOTP answer the directory name in that answer 178 For more information on syslinux, including how to create bootdisks
170 is used. 179 for prebuilt kernels, see http://syslinux.zytor.com/
180
181 N.B: Previously it was possible to write a kernel directly to
182 a floppy using dd, configure the boot device using rdev, and
183 boot using the resulting floppy. Linux no longer supports this
184 method of booting.
185
1863.2) Booting from a cdrom using isolinux
187
188 When building kernels, an easy way to create a bootable cdrom that
189 uses isolinux is to use the isoimage target which uses a bzimage
190 image. Like zdisk and bzdisk, this target accepts the FDARGS
191 parameter which can be used to set the kernel command line.
192
193 e.g.
194 make isoimage FDARGS="root=/dev/nfs"
195
196 The resulting iso image will be arch/<ARCH>/boot/image.iso
197 This can be written to a cdrom using a variety of tools including
198 cdrecord.
199
200 e.g.
201 cdrecord dev=ATAPI:1,0,0 arch/i386/boot/image.iso
202
203 For more information on isolinux, including how to create bootdisks
204 for prebuilt kernels, see http://syslinux.zytor.com/
171 205
1723.2) Using LILO 2063.2) Using LILO
173 When using LILO you can specify all necessary command line 207 When using LILO all the necessary command line parameters may be
174 parameters with the 'append=' command in the LILO configuration 208 specified using the 'append=' directive in the LILO configuration
175 file. However, to use the 'root=' command you also need to 209 file.
176 set up a dummy device as described in 3.1 above. For how to use 210
177 LILO and its 'append=' command please refer to the LILO 211 However, to use the 'root=' directive you also need to create
178 documentation. 212 a dummy root device, which may be removed after LILO is run.
213
214 mknod /dev/boot255 c 0 255
215
216 For information on configuring LILO, please refer to its documentation.
179 217
1803.3) Using GRUB 2183.3) Using GRUB
181 When you use GRUB, you simply append the parameters after the kernel 219 When using GRUB, kernel parameter are simply appended after the kernel
182 specification: "kernel <kernel> <parameters>" (without the quotes). 220 specification: kernel <kernel> <parameters>
183 221
1843.4) Using loadlin 2223.4) Using loadlin
185 When you want to boot Linux from a DOS command prompt without 223 loadlin may be used to boot Linux from a DOS command prompt without
186 having a local hard disk to mount as root, you can use loadlin. 224 requiring a local hard disk to mount as root. This has not been
187 I was told that it works, but haven't used it myself yet. In 225 thoroughly tested by the authors of this document, but in general
188 general you should be able to create a kernel command line simi- 226 it should be possible configure the kernel command line similarly
189 lar to how LILO is doing it. Please refer to the loadlin docu- 227 to the configuration of LILO.
190 mentation for further information. 228
229 Please refer to the loadlin documentation for further information.
191 230
1923.5) Using a boot ROM 2313.5) Using a boot ROM
193 This is probably the most elegant way of booting a diskless 232 This is probably the most elegant way of booting a diskless client.
194 client. With a boot ROM the kernel gets loaded using the TFTP 233 With a boot ROM the kernel is loaded using the TFTP protocol. The
195 protocol. As far as I know, no commercial boot ROMs yet 234 authors of this document are not aware of any no commercial boot
196 support booting Linux over the network, but there are two 235 ROMs that support booting Linux over the network. However, there
197 free implementations of a boot ROM available on sunsite.unc.edu 236 are two free implementations of a boot ROM, netboot-nfs and
198 and its mirrors. They are called 'netboot-nfs' and 'etherboot'. 237 etherboot, both of which are available on sunsite.unc.edu, and both
199 Both contain everything you need to boot a diskless Linux client. 238 of which contain everything you need to boot a diskless Linux client.
200 239
2013.6) Using pxelinux 2403.6) Using pxelinux
202 Using pxelinux you specify the kernel you built with 241 Pxelinux may be used to boot linux using the PXE boot loader
242 which is present on many modern network cards.
243
244 When using pxelinux, the kernel image is specified using
203 "kernel <relative-path-below /tftpboot>". The nfsroot parameters 245 "kernel <relative-path-below /tftpboot>". The nfsroot parameters
204 are passed to the kernel by adding them to the "append" line. 246 are passed to the kernel by adding them to the "append" line.
205 You may perhaps also want to fine tune the console output, 247 It is common to use serial console in conjunction with pxeliunx,
206 see Documentation/serial-console.txt for serial console help. 248 see Documentation/serial-console.txt for more information.
249
250 For more information on isolinux, including how to create bootdisks
251 for prebuilt kernels, see http://syslinux.zytor.com/
207 252
208 253
209 254
diff --git a/Documentation/ramdisk.txt b/Documentation/ramdisk.txt
index 7c25584e082c..52f75b7d51c2 100644
--- a/Documentation/ramdisk.txt
+++ b/Documentation/ramdisk.txt
@@ -6,7 +6,7 @@ Contents:
6 1) Overview 6 1) Overview
7 2) Kernel Command Line Parameters 7 2) Kernel Command Line Parameters
8 3) Using "rdev -r" 8 3) Using "rdev -r"
9 4) An Example of Creating a Compressed RAM Disk 9 4) An Example of Creating a Compressed RAM Disk
10 10
11 11
121) Overview 121) Overview
@@ -34,7 +34,7 @@ make it clearer. The original "ramdisk=<ram_size>" has been kept around for
34compatibility reasons, but it may be removed in the future. 34compatibility reasons, but it may be removed in the future.
35 35
36The new RAM disk also has the ability to load compressed RAM disk images, 36The new RAM disk also has the ability to load compressed RAM disk images,
37allowing one to squeeze more programs onto an average installation or 37allowing one to squeeze more programs onto an average installation or
38rescue floppy disk. 38rescue floppy disk.
39 39
40 40
@@ -51,7 +51,7 @@ default is 4096 (4 MB) (8192 (8 MB) on S390).
51 =================== 51 ===================
52 52
53This parameter tells the RAM disk driver how many bytes to use per block. The 53This parameter tells the RAM disk driver how many bytes to use per block. The
54default is 512. 54default is 1024 (BLOCK_SIZE).
55 55
56 56
573) Using "rdev -r" 573) Using "rdev -r"
@@ -70,7 +70,7 @@ These numbers are no magical secrets, as seen below:
70./arch/i386/kernel/setup.c:#define RAMDISK_PROMPT_FLAG 0x8000 70./arch/i386/kernel/setup.c:#define RAMDISK_PROMPT_FLAG 0x8000
71./arch/i386/kernel/setup.c:#define RAMDISK_LOAD_FLAG 0x4000 71./arch/i386/kernel/setup.c:#define RAMDISK_LOAD_FLAG 0x4000
72 72
73Consider a typical two floppy disk setup, where you will have the 73Consider a typical two floppy disk setup, where you will have the
74kernel on disk one, and have already put a RAM disk image onto disk #2. 74kernel on disk one, and have already put a RAM disk image onto disk #2.
75 75
76Hence you want to set bits 0 to 13 as 0, meaning that your RAM disk 76Hence you want to set bits 0 to 13 as 0, meaning that your RAM disk
@@ -97,12 +97,12 @@ Since the default start = 0 and the default prompt = 1, you could use:
97 append = "load_ramdisk=1" 97 append = "load_ramdisk=1"
98 98
99 99
1004) An Example of Creating a Compressed RAM Disk 1004) An Example of Creating a Compressed RAM Disk
101---------------------------------------------- 101----------------------------------------------
102 102
103To create a RAM disk image, you will need a spare block device to 103To create a RAM disk image, you will need a spare block device to
104construct it on. This can be the RAM disk device itself, or an 104construct it on. This can be the RAM disk device itself, or an
105unused disk partition (such as an unmounted swap partition). For this 105unused disk partition (such as an unmounted swap partition). For this
106example, we will use the RAM disk device, "/dev/ram0". 106example, we will use the RAM disk device, "/dev/ram0".
107 107
108Note: This technique should not be done on a machine with less than 8 MB 108Note: This technique should not be done on a machine with less than 8 MB
diff --git a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
index 69866d5997a4..b8dc51ca776c 100644
--- a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
+++ b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
@@ -1172,7 +1172,7 @@
1172 } 1172 }
1173 1173
1174 /* PCI IDs */ 1174 /* PCI IDs */
1175 static struct pci_device_id snd_mychip_ids[] __devinitdata = { 1175 static struct pci_device_id snd_mychip_ids[] = {
1176 { PCI_VENDOR_ID_FOO, PCI_DEVICE_ID_BAR, 1176 { PCI_VENDOR_ID_FOO, PCI_DEVICE_ID_BAR,
1177 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, 1177 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },
1178 .... 1178 ....
@@ -1565,7 +1565,7 @@
1565 <informalexample> 1565 <informalexample>
1566 <programlisting> 1566 <programlisting>
1567<![CDATA[ 1567<![CDATA[
1568 static struct pci_device_id snd_mychip_ids[] __devinitdata = { 1568 static struct pci_device_id snd_mychip_ids[] = {
1569 { PCI_VENDOR_ID_FOO, PCI_DEVICE_ID_BAR, 1569 { PCI_VENDOR_ID_FOO, PCI_DEVICE_ID_BAR,
1570 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, 1570 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },
1571 .... 1571 ....
diff --git a/Documentation/usb/proc_usb_info.txt b/Documentation/usb/proc_usb_info.txt
index f86550fe38ee..22c5331260ca 100644
--- a/Documentation/usb/proc_usb_info.txt
+++ b/Documentation/usb/proc_usb_info.txt
@@ -59,7 +59,7 @@ bind to an interface (or perhaps several) using an ioctl call. You
59would issue more ioctls to the device to communicate to it using 59would issue more ioctls to the device to communicate to it using
60control, bulk, or other kinds of USB transfers. The IOCTLs are 60control, bulk, or other kinds of USB transfers. The IOCTLs are
61listed in the <linux/usbdevice_fs.h> file, and at this writing the 61listed in the <linux/usbdevice_fs.h> file, and at this writing the
62source code (linux/drivers/usb/devio.c) is the primary reference 62source code (linux/drivers/usb/core/devio.c) is the primary reference
63for how to access devices through those files. 63for how to access devices through those files.
64 64
65Note that since by default these BBB/DDD files are writable only by 65Note that since by default these BBB/DDD files are writable only by
diff --git a/Documentation/usb/usb-help.txt b/Documentation/usb/usb-help.txt
index b7c324973695..a7408593829f 100644
--- a/Documentation/usb/usb-help.txt
+++ b/Documentation/usb/usb-help.txt
@@ -5,8 +5,7 @@ For USB help other than the readme files that are located in
5Documentation/usb/*, see the following: 5Documentation/usb/*, see the following:
6 6
7Linux-USB project: http://www.linux-usb.org 7Linux-USB project: http://www.linux-usb.org
8 mirrors at http://www.suse.cz/development/linux-usb/ 8 mirrors at http://usb.in.tum.de/linux-usb/
9 and http://usb.in.tum.de/linux-usb/
10 and http://it.linux-usb.org 9 and http://it.linux-usb.org
11Linux USB Guide: http://linux-usb.sourceforge.net 10Linux USB Guide: http://linux-usb.sourceforge.net
12Linux-USB device overview (working devices and drivers): 11Linux-USB device overview (working devices and drivers):
diff --git a/Documentation/usb/usb-serial.txt b/Documentation/usb/usb-serial.txt
index f001cd93b79b..02b0f7beb6d1 100644
--- a/Documentation/usb/usb-serial.txt
+++ b/Documentation/usb/usb-serial.txt
@@ -399,10 +399,10 @@ REINER SCT cyberJack pinpad/e-com USB chipcard reader
399 399
400Prolific PL2303 Driver 400Prolific PL2303 Driver
401 401
402 This driver support any device that has the PL2303 chip from Prolific 402 This driver supports any device that has the PL2303 chip from Prolific
403 in it. This includes a number of single port USB to serial 403 in it. This includes a number of single port USB to serial
404 converters and USB GPS devices. Devices from Aten (the UC-232) and 404 converters and USB GPS devices. Devices from Aten (the UC-232) and
405 IO-Data work with this driver. 405 IO-Data work with this driver, as does the DCU-11 mobile-phone cable.
406 406
407 For any questions or problems with this driver, please contact Greg 407 For any questions or problems with this driver, please contact Greg
408 Kroah-Hartman at greg@kroah.com 408 Kroah-Hartman at greg@kroah.com
diff --git a/Documentation/x86_64/boot-options.txt b/Documentation/x86_64/boot-options.txt
index 6887d44d2661..6da24e7a56cb 100644
--- a/Documentation/x86_64/boot-options.txt
+++ b/Documentation/x86_64/boot-options.txt
@@ -238,6 +238,13 @@ Debugging
238 pagefaulttrace Dump all page faults. Only useful for extreme debugging 238 pagefaulttrace Dump all page faults. Only useful for extreme debugging
239 and will create a lot of output. 239 and will create a lot of output.
240 240
241 call_trace=[old|both|newfallback|new]
242 old: use old inexact backtracer
243 new: use new exact dwarf2 unwinder
244 both: print entries from both
245 newfallback: use new unwinder but fall back to old if it gets
246 stuck (default)
247
241Misc 248Misc
242 249
243 noreplacement Don't replace instructions with more appropriate ones 250 noreplacement Don't replace instructions with more appropriate ones
diff --git a/MAINTAINERS b/MAINTAINERS
index 5f76a4f5cd4b..bac3f706f75e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -214,6 +214,12 @@ W: http://acpi.sourceforge.net/
214T: git kernel.org:/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6.git 214T: git kernel.org:/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6.git
215S: Maintained 215S: Maintained
216 216
217ACPI PCI HOTPLUG DRIVER
218P: Kristen Carlson Accardi
219M: kristen.c.accardi@intel.com
220L: pcihpd-discuss@lists.sourceforge.net
221S: Maintained
222
217AD1816 SOUND DRIVER 223AD1816 SOUND DRIVER
218P: Thorsten Knabe 224P: Thorsten Knabe
219M: Thorsten Knabe <linux@thorsten-knabe.de> 225M: Thorsten Knabe <linux@thorsten-knabe.de>
@@ -274,7 +280,7 @@ S: Maintained
274ALI1563 I2C DRIVER 280ALI1563 I2C DRIVER
275P: Rudolf Marek 281P: Rudolf Marek
276M: r.marek@sh.cvut.cz 282M: r.marek@sh.cvut.cz
277L: lm-sensors@lm-sensors.org 283L: i2c@lm-sensors.org
278S: Maintained 284S: Maintained
279 285
280ALPHA PORT 286ALPHA PORT
@@ -601,6 +607,15 @@ W: http://linuxtv.org
601T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git 607T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git
602S: Maintained 608S: Maintained
603 609
610CALGARY x86-64 IOMMU
611P: Muli Ben-Yehuda
612M: muli@il.ibm.com
613P: Jon D. Mason
614M: jdmason@us.ibm.com
615L: linux-kernel@vger.kernel.org
616L: discuss@x86-64.org
617S: Maintained
618
604COMMON INTERNET FILE SYSTEM (CIFS) 619COMMON INTERNET FILE SYSTEM (CIFS)
605P: Steve French 620P: Steve French
606M: sfrench@samba.org 621M: sfrench@samba.org
@@ -762,6 +777,7 @@ M: aliakc@web.de
762P: Jamie Lenehan 777P: Jamie Lenehan
763M: lenehan@twibble.org 778M: lenehan@twibble.org
764W: http://twibble.org/dist/dc395x/ 779W: http://twibble.org/dist/dc395x/
780L: dc395x@twibble.org
765L: http://lists.twibble.org/mailman/listinfo/dc395x/ 781L: http://lists.twibble.org/mailman/listinfo/dc395x/
766S: Maintained 782S: Maintained
767 783
@@ -958,6 +974,10 @@ P: Andrey V. Savochkin
958M: saw@saw.sw.com.sg 974M: saw@saw.sw.com.sg
959S: Maintained 975S: Maintained
960 976
977EFS FILESYSTEM
978W: http://aeschi.ch.eu.org/efs/
979S: Orphan
980
961EMU10K1 SOUND DRIVER 981EMU10K1 SOUND DRIVER
962P: James Courtier-Dutton 982P: James Courtier-Dutton
963M: James@superbug.demon.co.uk 983M: James@superbug.demon.co.uk
@@ -1240,7 +1260,7 @@ S: Maintained
1240I2C SUBSYSTEM 1260I2C SUBSYSTEM
1241P: Jean Delvare 1261P: Jean Delvare
1242M: khali@linux-fr.org 1262M: khali@linux-fr.org
1243L: lm-sensors@lm-sensors.org 1263L: i2c@lm-sensors.org
1244W: http://www.lm-sensors.nu/ 1264W: http://www.lm-sensors.nu/
1245T: quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ 1265T: quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/
1246S: Maintained 1266S: Maintained
@@ -1492,6 +1512,7 @@ P: Yi Zhu
1492M: yi.zhu@intel.com 1512M: yi.zhu@intel.com
1493P: James Ketrenos 1513P: James Ketrenos
1494M: jketreno@linux.intel.com 1514M: jketreno@linux.intel.com
1515L: ipw2100-devel@lists.sourceforge.net
1495L: http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel 1516L: http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel
1496W: http://ipw2100.sourceforge.net 1517W: http://ipw2100.sourceforge.net
1497S: Supported 1518S: Supported
@@ -1501,6 +1522,7 @@ P: Yi Zhu
1501M: yi.zhu@intel.com 1522M: yi.zhu@intel.com
1502P: James Ketrenos 1523P: James Ketrenos
1503M: jketreno@linux.intel.com 1524M: jketreno@linux.intel.com
1525L: ipw2100-devel@lists.sourceforge.net
1504L: http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel 1526L: http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel
1505W: http://ipw2200.sourceforge.net 1527W: http://ipw2200.sourceforge.net
1506S: Supported 1528S: Supported
@@ -1586,7 +1608,7 @@ W: http://jfs.sourceforge.net/
1586T: git kernel.org:/pub/scm/linux/kernel/git/shaggy/jfs-2.6.git 1608T: git kernel.org:/pub/scm/linux/kernel/git/shaggy/jfs-2.6.git
1587S: Supported 1609S: Supported
1588 1610
1589JOURNALLING LAYER FOR BLOCK DEVICS (JBD) 1611JOURNALLING LAYER FOR BLOCK DEVICES (JBD)
1590P: Stephen Tweedie, Andrew Morton 1612P: Stephen Tweedie, Andrew Morton
1591M: sct@redhat.com, akpm@osdl.org 1613M: sct@redhat.com, akpm@osdl.org
1592L: ext2-devel@lists.sourceforge.net 1614L: ext2-devel@lists.sourceforge.net
@@ -1630,9 +1652,8 @@ S: Maintained
1630 1652
1631KERNEL JANITORS 1653KERNEL JANITORS
1632P: Several 1654P: Several
1633L: kernel-janitors@osdl.org 1655L: kernel-janitors@lists.osdl.org
1634W: http://www.kerneljanitors.org/ 1656W: http://www.kerneljanitors.org/
1635W: http://sf.net/projects/kernel-janitor/
1636S: Maintained 1657S: Maintained
1637 1658
1638KERNEL NFSD 1659KERNEL NFSD
@@ -1664,10 +1685,8 @@ L: linux-kernel@vger.kernel.org
1664S: Maintained 1685S: Maintained
1665 1686
1666LAPB module 1687LAPB module
1667P: Henner Eisen
1668M: eis@baty.hanse.de
1669L: linux-x25@vger.kernel.org 1688L: linux-x25@vger.kernel.org
1670S: Maintained 1689S: Orphan
1671 1690
1672LASI 53c700 driver for PARISC 1691LASI 53c700 driver for PARISC
1673P: James E.J. Bottomley 1692P: James E.J. Bottomley
@@ -1872,6 +1891,12 @@ S: linux-scsi@vger.kernel.org
1872W: http://megaraid.lsilogic.com 1891W: http://megaraid.lsilogic.com
1873S: Maintained 1892S: Maintained
1874 1893
1894MEMORY MANAGEMENT
1895L: linux-mm@kvack.org
1896L: linux-kernel@vger.kernel.org
1897W: http://www.linux-mm.org
1898S: Maintained
1899
1875MEMORY TECHNOLOGY DEVICES (MTD) 1900MEMORY TECHNOLOGY DEVICES (MTD)
1876P: David Woodhouse 1901P: David Woodhouse
1877M: dwmw2@infradead.org 1902M: dwmw2@infradead.org
@@ -2039,9 +2064,10 @@ L: linux-kernel@vger.kernel.org
2039S: Maintained 2064S: Maintained
2040 2065
2041NI5010 NETWORK DRIVER 2066NI5010 NETWORK DRIVER
2042P: Jan-Pascal van Best and Andreas Mohr 2067P: Jan-Pascal van Best
2043M: Jan-Pascal van Best <jvbest@qv3pluto.leidenuniv.nl> 2068M: janpascal@vanbest.org
2044M: Andreas Mohr <100.30936@germany.net> 2069P: Andreas Mohr
2070M: andi@lisas.de
2045L: netdev@vger.kernel.org 2071L: netdev@vger.kernel.org
2046S: Maintained 2072S: Maintained
2047 2073
@@ -2083,7 +2109,7 @@ S: Maintained
2083OPENCORES I2C BUS DRIVER 2109OPENCORES I2C BUS DRIVER
2084P: Peter Korsgaard 2110P: Peter Korsgaard
2085M: jacmet@sunsite.dk 2111M: jacmet@sunsite.dk
2086L: lm-sensors@lm-sensors.org 2112L: i2c@lm-sensors.org
2087S: Maintained 2113S: Maintained
2088 2114
2089ORACLE CLUSTER FILESYSTEM 2 (OCFS2) 2115ORACLE CLUSTER FILESYSTEM 2 (OCFS2)
@@ -2216,6 +2242,7 @@ S: Maintained
2216 2242
2217PCMCIA SUBSYSTEM 2243PCMCIA SUBSYSTEM
2218P: Linux PCMCIA Team 2244P: Linux PCMCIA Team
2245L: linux-pcmcia@lists.infradead.org
2219L: http://lists.infradead.org/mailman/listinfo/linux-pcmcia 2246L: http://lists.infradead.org/mailman/listinfo/linux-pcmcia
2220T: git kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git 2247T: git kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git
2221S: Maintained 2248S: Maintained
@@ -2226,6 +2253,12 @@ M: tsbogend@alpha.franken.de
2226L: netdev@vger.kernel.org 2253L: netdev@vger.kernel.org
2227S: Maintained 2254S: Maintained
2228 2255
2256PER-TASK DELAY ACCOUNTING
2257P: Shailabh Nagar
2258M: nagar@watson.ibm.com
2259L: linux-kernel@vger.kernel.org
2260S: Maintained
2261
2229PERSONALITY HANDLING 2262PERSONALITY HANDLING
2230P: Christoph Hellwig 2263P: Christoph Hellwig
2231M: hch@infradead.org 2264M: hch@infradead.org
@@ -2665,6 +2698,11 @@ M: shemminger@osdl.org
2665L: netdev@vger.kernel.org 2698L: netdev@vger.kernel.org
2666S: Maintained 2699S: Maintained
2667 2700
2701SOEKRIS NET48XX LED SUPPORT
2702P: Chris Boot
2703M: bootc@bootc.net
2704S: Maintained
2705
2668SPARC (sparc32): 2706SPARC (sparc32):
2669P: William L. Irwin 2707P: William L. Irwin
2670M: wli@holomorphy.com 2708M: wli@holomorphy.com
@@ -2737,11 +2775,23 @@ P: Christoph Hellwig
2737M: hch@infradead.org 2775M: hch@infradead.org
2738S: Maintained 2776S: Maintained
2739 2777
2778TC CLASSIFIER
2779P: Jamal Hadi Salim
2780M: hadi@cyberus.ca
2781L: netdev@vger.kernel.org
2782S: Maintained
2783
2740TI OMAP RANDOM NUMBER GENERATOR SUPPORT 2784TI OMAP RANDOM NUMBER GENERATOR SUPPORT
2741P: Deepak Saxena 2785P: Deepak Saxena
2742M: dsaxena@plexity.net 2786M: dsaxena@plexity.net
2743S: Maintained 2787S: Maintained
2744 2788
2789TASKSTATS STATISTICS INTERFACE
2790P: Shailabh Nagar
2791M: nagar@watson.ibm.com
2792L: linux-kernel@vger.kernel.org
2793S: Maintained
2794
2745TI PARALLEL LINK CABLE DRIVER 2795TI PARALLEL LINK CABLE DRIVER
2746P: Romain Lievin 2796P: Romain Lievin
2747M: roms@lpg.ticalc.org 2797M: roms@lpg.ticalc.org
@@ -3117,7 +3167,7 @@ S: Maintained
3117VIAPRO SMBUS DRIVER 3167VIAPRO SMBUS DRIVER
3118P: Jean Delvare 3168P: Jean Delvare
3119M: khali@linux-fr.org 3169M: khali@linux-fr.org
3120L: lm-sensors@lm-sensors.org 3170L: i2c@lm-sensors.org
3121S: Maintained 3171S: Maintained
3122 3172
3123UCLINUX (AND M68KNOMMU) 3173UCLINUX (AND M68KNOMMU)
@@ -3165,6 +3215,11 @@ S: Maintained
3165W1 DALLAS'S 1-WIRE BUS 3215W1 DALLAS'S 1-WIRE BUS
3166P: Evgeniy Polyakov 3216P: Evgeniy Polyakov
3167M: johnpol@2ka.mipt.ru 3217M: johnpol@2ka.mipt.ru
3218S: Maintained
3219
3220W83791D HARDWARE MONITORING DRIVER
3221P: Charles Spirakis
3222M: bezaur@gmail.com
3168L: lm-sensors@lm-sensors.org 3223L: lm-sensors@lm-sensors.org
3169S: Maintained 3224S: Maintained
3170 3225
diff --git a/Makefile b/Makefile
index 82f76a96cfe6..110db856e966 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
1VERSION = 2 1VERSION = 2
2PATCHLEVEL = 6 2PATCHLEVEL = 6
3SUBLEVEL = 17 3SUBLEVEL = 18
4EXTRAVERSION = 4EXTRAVERSION = -rc3
5NAME=Crazed Snow-Weasel 5NAME=Crazed Snow-Weasel
6 6
7# *DOCUMENTATION* 7# *DOCUMENTATION*
@@ -310,8 +310,8 @@ CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE)
310CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ 310CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
311 -fno-strict-aliasing -fno-common 311 -fno-strict-aliasing -fno-common
312# Force gcc to behave correct even for buggy distributions 312# Force gcc to behave correct even for buggy distributions
313CFLAGS += $(call cc-option, -fno-stack-protector-all \ 313CFLAGS += $(call cc-option, -fno-stack-protector)
314 -fno-stack-protector) 314
315AFLAGS := -D__ASSEMBLY__ 315AFLAGS := -D__ASSEMBLY__
316 316
317# Read KERNELRELEASE from include/config/kernel.release (if it exists) 317# Read KERNELRELEASE from include/config/kernel.release (if it exists)
@@ -368,6 +368,7 @@ endif
368 368
369no-dot-config-targets := clean mrproper distclean \ 369no-dot-config-targets := clean mrproper distclean \
370 cscope TAGS tags help %docs check% \ 370 cscope TAGS tags help %docs check% \
371 include/linux/version.h headers_% \
371 kernelrelease kernelversion 372 kernelrelease kernelversion
372 373
373config-targets := 0 374config-targets := 0
diff --git a/arch/alpha/kernel/alpha_ksyms.c b/arch/alpha/kernel/alpha_ksyms.c
index 425643762bf5..f042cc42b00f 100644
--- a/arch/alpha/kernel/alpha_ksyms.c
+++ b/arch/alpha/kernel/alpha_ksyms.c
@@ -14,6 +14,7 @@
14#include <linux/in.h> 14#include <linux/in.h>
15#include <linux/in6.h> 15#include <linux/in6.h>
16#include <linux/pci.h> 16#include <linux/pci.h>
17#include <linux/screen_info.h>
17#include <linux/tty.h> 18#include <linux/tty.h>
18#include <linux/mm.h> 19#include <linux/mm.h>
19#include <linux/delay.h> 20#include <linux/delay.h>
diff --git a/arch/alpha/kernel/err_ev7.c b/arch/alpha/kernel/err_ev7.c
index bf52ba691957..fed6b3d1b803 100644
--- a/arch/alpha/kernel/err_ev7.c
+++ b/arch/alpha/kernel/err_ev7.c
@@ -274,16 +274,14 @@ ev7_process_pal_subpacket(struct el_subpacket *header)
274struct el_subpacket_handler ev7_pal_subpacket_handler = 274struct el_subpacket_handler ev7_pal_subpacket_handler =
275 SUBPACKET_HANDLER_INIT(EL_CLASS__PAL, ev7_process_pal_subpacket); 275 SUBPACKET_HANDLER_INIT(EL_CLASS__PAL, ev7_process_pal_subpacket);
276 276
277void 277void
278ev7_register_error_handlers(void) 278ev7_register_error_handlers(void)
279{ 279{
280 int i; 280 int i;
281 281
282 for(i = 0; 282 for (i = 0; i < ARRAY_SIZE(el_ev7_pal_annotations); i++)
283 i<sizeof(el_ev7_pal_annotations)/sizeof(el_ev7_pal_annotations[1]);
284 i++) {
285 cdl_register_subpacket_annotation(&el_ev7_pal_annotations[i]); 283 cdl_register_subpacket_annotation(&el_ev7_pal_annotations[i]);
286 } 284
287 cdl_register_subpacket_handler(&ev7_pal_subpacket_handler); 285 cdl_register_subpacket_handler(&ev7_pal_subpacket_handler);
288} 286}
289 287
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
index e15dcf4f3dcd..73c7622b5297 100644
--- a/arch/alpha/kernel/osf_sys.c
+++ b/arch/alpha/kernel/osf_sys.c
@@ -623,12 +623,12 @@ osf_sysinfo(int command, char __user *buf, long count)
623 long len, err = -EINVAL; 623 long len, err = -EINVAL;
624 624
625 offset = command-1; 625 offset = command-1;
626 if (offset >= sizeof(sysinfo_table)/sizeof(char *)) { 626 if (offset >= ARRAY_SIZE(sysinfo_table)) {
627 /* Digital UNIX has a few unpublished interfaces here */ 627 /* Digital UNIX has a few unpublished interfaces here */
628 printk("sysinfo(%d)", command); 628 printk("sysinfo(%d)", command);
629 goto out; 629 goto out;
630 } 630 }
631 631
632 down_read(&uts_sem); 632 down_read(&uts_sem);
633 res = sysinfo_table[offset]; 633 res = sysinfo_table[offset];
634 len = strlen(res)+1; 634 len = strlen(res)+1;
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c
index 41ebf51a107a..b3a8a2980365 100644
--- a/arch/alpha/kernel/process.c
+++ b/arch/alpha/kernel/process.c
@@ -25,6 +25,7 @@
25#include <linux/time.h> 25#include <linux/time.h>
26#include <linux/major.h> 26#include <linux/major.h>
27#include <linux/stat.h> 27#include <linux/stat.h>
28#include <linux/vt.h>
28#include <linux/mman.h> 29#include <linux/mman.h>
29#include <linux/elfcore.h> 30#include <linux/elfcore.h>
30#include <linux/reboot.h> 31#include <linux/reboot.h>
diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c
index 254c507a608c..fd4a8fa0c93d 100644
--- a/arch/alpha/kernel/setup.c
+++ b/arch/alpha/kernel/setup.c
@@ -19,7 +19,7 @@
19#include <linux/slab.h> 19#include <linux/slab.h>
20#include <linux/user.h> 20#include <linux/user.h>
21#include <linux/a.out.h> 21#include <linux/a.out.h>
22#include <linux/tty.h> 22#include <linux/screen_info.h>
23#include <linux/delay.h> 23#include <linux/delay.h>
24#include <linux/config.h> /* CONFIG_ALPHA_LCA etc */ 24#include <linux/config.h> /* CONFIG_ALPHA_LCA etc */
25#include <linux/mc146818rtc.h> 25#include <linux/mc146818rtc.h>
@@ -114,8 +114,6 @@ struct alpha_machine_vector alpha_mv;
114int alpha_using_srm; 114int alpha_using_srm;
115#endif 115#endif
116 116
117#define N(a) (sizeof(a)/sizeof(a[0]))
118
119static struct alpha_machine_vector *get_sysvec(unsigned long, unsigned long, 117static struct alpha_machine_vector *get_sysvec(unsigned long, unsigned long,
120 unsigned long); 118 unsigned long);
121static struct alpha_machine_vector *get_sysvec_byname(const char *); 119static struct alpha_machine_vector *get_sysvec_byname(const char *);
@@ -240,7 +238,7 @@ reserve_std_resources(void)
240 standard_io_resources[0].start = RTC_PORT(0); 238 standard_io_resources[0].start = RTC_PORT(0);
241 standard_io_resources[0].end = RTC_PORT(0) + 0x10; 239 standard_io_resources[0].end = RTC_PORT(0) + 0x10;
242 240
243 for (i = 0; i < N(standard_io_resources); ++i) 241 for (i = 0; i < ARRAY_SIZE(standard_io_resources); ++i)
244 request_resource(io, standard_io_resources+i); 242 request_resource(io, standard_io_resources+i);
245} 243}
246 244
@@ -918,13 +916,13 @@ get_sysvec(unsigned long type, unsigned long variation, unsigned long cpu)
918 916
919 /* Search the system tables first... */ 917 /* Search the system tables first... */
920 vec = NULL; 918 vec = NULL;
921 if (type < N(systype_vecs)) { 919 if (type < ARRAY_SIZE(systype_vecs)) {
922 vec = systype_vecs[type]; 920 vec = systype_vecs[type];
923 } else if ((type > ST_API_BIAS) && 921 } else if ((type > ST_API_BIAS) &&
924 (type - ST_API_BIAS) < N(api_vecs)) { 922 (type - ST_API_BIAS) < ARRAY_SIZE(api_vecs)) {
925 vec = api_vecs[type - ST_API_BIAS]; 923 vec = api_vecs[type - ST_API_BIAS];
926 } else if ((type > ST_UNOFFICIAL_BIAS) && 924 } else if ((type > ST_UNOFFICIAL_BIAS) &&
927 (type - ST_UNOFFICIAL_BIAS) < N(unofficial_vecs)) { 925 (type - ST_UNOFFICIAL_BIAS) < ARRAY_SIZE(unofficial_vecs)) {
928 vec = unofficial_vecs[type - ST_UNOFFICIAL_BIAS]; 926 vec = unofficial_vecs[type - ST_UNOFFICIAL_BIAS];
929 } 927 }
930 928
@@ -938,11 +936,11 @@ get_sysvec(unsigned long type, unsigned long variation, unsigned long cpu)
938 936
939 switch (type) { 937 switch (type) {
940 case ST_DEC_ALCOR: 938 case ST_DEC_ALCOR:
941 if (member < N(alcor_indices)) 939 if (member < ARRAY_SIZE(alcor_indices))
942 vec = alcor_vecs[alcor_indices[member]]; 940 vec = alcor_vecs[alcor_indices[member]];
943 break; 941 break;
944 case ST_DEC_EB164: 942 case ST_DEC_EB164:
945 if (member < N(eb164_indices)) 943 if (member < ARRAY_SIZE(eb164_indices))
946 vec = eb164_vecs[eb164_indices[member]]; 944 vec = eb164_vecs[eb164_indices[member]];
947 /* PC164 may show as EB164 variation with EV56 CPU, 945 /* PC164 may show as EB164 variation with EV56 CPU,
948 but, since no true EB164 had anything but EV5... */ 946 but, since no true EB164 had anything but EV5... */
@@ -950,24 +948,24 @@ get_sysvec(unsigned long type, unsigned long variation, unsigned long cpu)
950 vec = &pc164_mv; 948 vec = &pc164_mv;
951 break; 949 break;
952 case ST_DEC_EB64P: 950 case ST_DEC_EB64P:
953 if (member < N(eb64p_indices)) 951 if (member < ARRAY_SIZE(eb64p_indices))
954 vec = eb64p_vecs[eb64p_indices[member]]; 952 vec = eb64p_vecs[eb64p_indices[member]];
955 break; 953 break;
956 case ST_DEC_EB66: 954 case ST_DEC_EB66:
957 if (member < N(eb66_indices)) 955 if (member < ARRAY_SIZE(eb66_indices))
958 vec = eb66_vecs[eb66_indices[member]]; 956 vec = eb66_vecs[eb66_indices[member]];
959 break; 957 break;
960 case ST_DEC_MARVEL: 958 case ST_DEC_MARVEL:
961 if (member < N(marvel_indices)) 959 if (member < ARRAY_SIZE(marvel_indices))
962 vec = marvel_vecs[marvel_indices[member]]; 960 vec = marvel_vecs[marvel_indices[member]];
963 break; 961 break;
964 case ST_DEC_TITAN: 962 case ST_DEC_TITAN:
965 vec = titan_vecs[0]; /* default */ 963 vec = titan_vecs[0]; /* default */
966 if (member < N(titan_indices)) 964 if (member < ARRAY_SIZE(titan_indices))
967 vec = titan_vecs[titan_indices[member]]; 965 vec = titan_vecs[titan_indices[member]];
968 break; 966 break;
969 case ST_DEC_TSUNAMI: 967 case ST_DEC_TSUNAMI:
970 if (member < N(tsunami_indices)) 968 if (member < ARRAY_SIZE(tsunami_indices))
971 vec = tsunami_vecs[tsunami_indices[member]]; 969 vec = tsunami_vecs[tsunami_indices[member]];
972 break; 970 break;
973 case ST_DEC_1000: 971 case ST_DEC_1000:
@@ -1039,7 +1037,7 @@ get_sysvec_byname(const char *name)
1039 1037
1040 size_t i; 1038 size_t i;
1041 1039
1042 for (i = 0; i < N(all_vecs); ++i) { 1040 for (i = 0; i < ARRAY_SIZE(all_vecs); ++i) {
1043 struct alpha_machine_vector *mv = all_vecs[i]; 1041 struct alpha_machine_vector *mv = all_vecs[i];
1044 if (strcasecmp(mv->vector_name, name) == 0) 1042 if (strcasecmp(mv->vector_name, name) == 0)
1045 return mv; 1043 return mv;
@@ -1055,13 +1053,13 @@ get_sysnames(unsigned long type, unsigned long variation, unsigned long cpu,
1055 1053
1056 /* If not in the tables, make it UNKNOWN, 1054 /* If not in the tables, make it UNKNOWN,
1057 else set type name to family */ 1055 else set type name to family */
1058 if (type < N(systype_names)) { 1056 if (type < ARRAY_SIZE(systype_names)) {
1059 *type_name = systype_names[type]; 1057 *type_name = systype_names[type];
1060 } else if ((type > ST_API_BIAS) && 1058 } else if ((type > ST_API_BIAS) &&
1061 (type - ST_API_BIAS) < N(api_names)) { 1059 (type - ST_API_BIAS) < ARRAY_SIZE(api_names)) {
1062 *type_name = api_names[type - ST_API_BIAS]; 1060 *type_name = api_names[type - ST_API_BIAS];
1063 } else if ((type > ST_UNOFFICIAL_BIAS) && 1061 } else if ((type > ST_UNOFFICIAL_BIAS) &&
1064 (type - ST_UNOFFICIAL_BIAS) < N(unofficial_names)) { 1062 (type - ST_UNOFFICIAL_BIAS) < ARRAY_SIZE(unofficial_names)) {
1065 *type_name = unofficial_names[type - ST_UNOFFICIAL_BIAS]; 1063 *type_name = unofficial_names[type - ST_UNOFFICIAL_BIAS];
1066 } else { 1064 } else {
1067 *type_name = sys_unknown; 1065 *type_name = sys_unknown;
@@ -1083,7 +1081,7 @@ get_sysnames(unsigned long type, unsigned long variation, unsigned long cpu,
1083 default: /* default to variation "0" for now */ 1081 default: /* default to variation "0" for now */
1084 break; 1082 break;
1085 case ST_DEC_EB164: 1083 case ST_DEC_EB164:
1086 if (member < N(eb164_indices)) 1084 if (member < ARRAY_SIZE(eb164_indices))
1087 *variation_name = eb164_names[eb164_indices[member]]; 1085 *variation_name = eb164_names[eb164_indices[member]];
1088 /* PC164 may show as EB164 variation, but with EV56 CPU, 1086 /* PC164 may show as EB164 variation, but with EV56 CPU,
1089 so, since no true EB164 had anything but EV5... */ 1087 so, since no true EB164 had anything but EV5... */
@@ -1091,32 +1089,32 @@ get_sysnames(unsigned long type, unsigned long variation, unsigned long cpu,
1091 *variation_name = eb164_names[1]; /* make it PC164 */ 1089 *variation_name = eb164_names[1]; /* make it PC164 */
1092 break; 1090 break;
1093 case ST_DEC_ALCOR: 1091 case ST_DEC_ALCOR:
1094 if (member < N(alcor_indices)) 1092 if (member < ARRAY_SIZE(alcor_indices))
1095 *variation_name = alcor_names[alcor_indices[member]]; 1093 *variation_name = alcor_names[alcor_indices[member]];
1096 break; 1094 break;
1097 case ST_DEC_EB64P: 1095 case ST_DEC_EB64P:
1098 if (member < N(eb64p_indices)) 1096 if (member < ARRAY_SIZE(eb64p_indices))
1099 *variation_name = eb64p_names[eb64p_indices[member]]; 1097 *variation_name = eb64p_names[eb64p_indices[member]];
1100 break; 1098 break;
1101 case ST_DEC_EB66: 1099 case ST_DEC_EB66:
1102 if (member < N(eb66_indices)) 1100 if (member < ARRAY_SIZE(eb66_indices))
1103 *variation_name = eb66_names[eb66_indices[member]]; 1101 *variation_name = eb66_names[eb66_indices[member]];
1104 break; 1102 break;
1105 case ST_DEC_MARVEL: 1103 case ST_DEC_MARVEL:
1106 if (member < N(marvel_indices)) 1104 if (member < ARRAY_SIZE(marvel_indices))
1107 *variation_name = marvel_names[marvel_indices[member]]; 1105 *variation_name = marvel_names[marvel_indices[member]];
1108 break; 1106 break;
1109 case ST_DEC_RAWHIDE: 1107 case ST_DEC_RAWHIDE:
1110 if (member < N(rawhide_indices)) 1108 if (member < ARRAY_SIZE(rawhide_indices))
1111 *variation_name = rawhide_names[rawhide_indices[member]]; 1109 *variation_name = rawhide_names[rawhide_indices[member]];
1112 break; 1110 break;
1113 case ST_DEC_TITAN: 1111 case ST_DEC_TITAN:
1114 *variation_name = titan_names[0]; /* default */ 1112 *variation_name = titan_names[0]; /* default */
1115 if (member < N(titan_indices)) 1113 if (member < ARRAY_SIZE(titan_indices))
1116 *variation_name = titan_names[titan_indices[member]]; 1114 *variation_name = titan_names[titan_indices[member]];
1117 break; 1115 break;
1118 case ST_DEC_TSUNAMI: 1116 case ST_DEC_TSUNAMI:
1119 if (member < N(tsunami_indices)) 1117 if (member < ARRAY_SIZE(tsunami_indices))
1120 *variation_name = tsunami_names[tsunami_indices[member]]; 1118 *variation_name = tsunami_names[tsunami_indices[member]];
1121 break; 1119 break;
1122 } 1120 }
@@ -1211,7 +1209,7 @@ show_cpuinfo(struct seq_file *f, void *slot)
1211 1209
1212 cpu_index = (unsigned) (cpu->type - 1); 1210 cpu_index = (unsigned) (cpu->type - 1);
1213 cpu_name = "Unknown"; 1211 cpu_name = "Unknown";
1214 if (cpu_index < N(cpu_names)) 1212 if (cpu_index < ARRAY_SIZE(cpu_names))
1215 cpu_name = cpu_names[cpu_index]; 1213 cpu_name = cpu_names[cpu_index];
1216 1214
1217 get_sysnames(hwrpb->sys_type, hwrpb->sys_variation, 1215 get_sysnames(hwrpb->sys_type, hwrpb->sys_variation,
diff --git a/arch/alpha/kernel/sys_ruffian.c b/arch/alpha/kernel/sys_ruffian.c
index 78c30decf3ff..5b99cf3cd69c 100644
--- a/arch/alpha/kernel/sys_ruffian.c
+++ b/arch/alpha/kernel/sys_ruffian.c
@@ -182,16 +182,16 @@ static unsigned long __init
182ruffian_get_bank_size(unsigned long offset) 182ruffian_get_bank_size(unsigned long offset)
183{ 183{
184 unsigned long bank_addr, bank, ret = 0; 184 unsigned long bank_addr, bank, ret = 0;
185 185
186 /* Valid offsets are: 0x800, 0x840 and 0x880 186 /* Valid offsets are: 0x800, 0x840 and 0x880
187 since Ruffian only uses three banks. */ 187 since Ruffian only uses three banks. */
188 bank_addr = (unsigned long)PYXIS_MCR + offset; 188 bank_addr = (unsigned long)PYXIS_MCR + offset;
189 bank = *(vulp)bank_addr; 189 bank = *(vulp)bank_addr;
190 190
191 /* Check BANK_ENABLE */ 191 /* Check BANK_ENABLE */
192 if (bank & 0x01) { 192 if (bank & 0x01) {
193 static unsigned long size[] __initdata = { 193 static unsigned long size[] __initdata = {
194 0x40000000UL, /* 0x00, 1G */ 194 0x40000000UL, /* 0x00, 1G */
195 0x20000000UL, /* 0x02, 512M */ 195 0x20000000UL, /* 0x02, 512M */
196 0x10000000UL, /* 0x04, 256M */ 196 0x10000000UL, /* 0x04, 256M */
197 0x08000000UL, /* 0x06, 128M */ 197 0x08000000UL, /* 0x06, 128M */
@@ -203,7 +203,7 @@ ruffian_get_bank_size(unsigned long offset)
203 }; 203 };
204 204
205 bank = (bank & 0x1e) >> 1; 205 bank = (bank & 0x1e) >> 1;
206 if (bank < sizeof(size)/sizeof(*size)) 206 if (bank < ARRAY_SIZE(size))
207 ret = size[bank]; 207 ret = size[bank];
208 } 208 }
209 209
diff --git a/arch/alpha/kernel/sys_sio.c b/arch/alpha/kernel/sys_sio.c
index cd85ef725e0e..a654014d202a 100644
--- a/arch/alpha/kernel/sys_sio.c
+++ b/arch/alpha/kernel/sys_sio.c
@@ -16,7 +16,7 @@
16#include <linux/sched.h> 16#include <linux/sched.h>
17#include <linux/pci.h> 17#include <linux/pci.h>
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/tty.h> 19#include <linux/screen_info.h>
20 20
21#include <asm/compiler.h> 21#include <asm/compiler.h>
22#include <asm/ptrace.h> 22#include <asm/ptrace.h>
diff --git a/arch/alpha/kernel/time.c b/arch/alpha/kernel/time.c
index 50eccde2dcd8..b191cc759737 100644
--- a/arch/alpha/kernel/time.c
+++ b/arch/alpha/kernel/time.c
@@ -233,7 +233,7 @@ validate_cc_value(unsigned long cc)
233 index = cpu->type & 0xffffffff; 233 index = cpu->type & 0xffffffff;
234 234
235 /* If index out of bounds, no way to validate. */ 235 /* If index out of bounds, no way to validate. */
236 if (index >= sizeof(cpu_hz)/sizeof(cpu_hz[0])) 236 if (index >= ARRAY_SIZE(cpu_hz))
237 return cc; 237 return cc;
238 238
239 /* If index contains no data, no way to validate. */ 239 /* If index contains no data, no way to validate. */
diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
index f3c1ebfdd0aa..f3e020f2227f 100644
--- a/arch/arm/common/gic.c
+++ b/arch/arm/common/gic.c
@@ -95,7 +95,8 @@ static void gic_set_cpu(unsigned int irq, cpumask_t mask_val)
95} 95}
96#endif 96#endif
97 97
98static struct irqchip gic_chip = { 98static struct irq_chip gic_chip = {
99 .name = "GIC",
99 .ack = gic_ack_irq, 100 .ack = gic_ack_irq,
100 .mask = gic_mask_irq, 101 .mask = gic_mask_irq,
101 .unmask = gic_unmask_irq, 102 .unmask = gic_unmask_irq,
diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c
index fbc3ab0e1011..4e0dcaef6eb2 100644
--- a/arch/arm/common/locomo.c
+++ b/arch/arm/common/locomo.c
@@ -204,7 +204,8 @@ static void locomo_unmask_irq(unsigned int irq)
204 locomo_writel(r, mapbase + LOCOMO_ICR); 204 locomo_writel(r, mapbase + LOCOMO_ICR);
205} 205}
206 206
207static struct irqchip locomo_chip = { 207static struct irq_chip locomo_chip = {
208 .name = "LOCOMO",
208 .ack = locomo_ack_irq, 209 .ack = locomo_ack_irq,
209 .mask = locomo_mask_irq, 210 .mask = locomo_mask_irq,
210 .unmask = locomo_unmask_irq, 211 .unmask = locomo_unmask_irq,
@@ -249,7 +250,8 @@ static void locomo_key_unmask_irq(unsigned int irq)
249 locomo_writel(r, mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC); 250 locomo_writel(r, mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC);
250} 251}
251 252
252static struct irqchip locomo_key_chip = { 253static struct irq_chip locomo_key_chip = {
254 .name = "LOCOMO-key",
253 .ack = locomo_key_ack_irq, 255 .ack = locomo_key_ack_irq,
254 .mask = locomo_key_mask_irq, 256 .mask = locomo_key_mask_irq,
255 .unmask = locomo_key_unmask_irq, 257 .unmask = locomo_key_unmask_irq,
@@ -312,7 +314,8 @@ static void locomo_gpio_unmask_irq(unsigned int irq)
312 locomo_writel(r, mapbase + LOCOMO_GIE); 314 locomo_writel(r, mapbase + LOCOMO_GIE);
313} 315}
314 316
315static struct irqchip locomo_gpio_chip = { 317static struct irq_chip locomo_gpio_chip = {
318 .name = "LOCOMO-gpio",
316 .ack = locomo_gpio_ack_irq, 319 .ack = locomo_gpio_ack_irq,
317 .mask = locomo_gpio_mask_irq, 320 .mask = locomo_gpio_mask_irq,
318 .unmask = locomo_gpio_unmask_irq, 321 .unmask = locomo_gpio_unmask_irq,
@@ -357,7 +360,8 @@ static void locomo_lt_unmask_irq(unsigned int irq)
357 locomo_writel(r, mapbase + LOCOMO_LTINT); 360 locomo_writel(r, mapbase + LOCOMO_LTINT);
358} 361}
359 362
360static struct irqchip locomo_lt_chip = { 363static struct irq_chip locomo_lt_chip = {
364 .name = "LOCOMO-lt",
361 .ack = locomo_lt_ack_irq, 365 .ack = locomo_lt_ack_irq,
362 .mask = locomo_lt_mask_irq, 366 .mask = locomo_lt_mask_irq,
363 .unmask = locomo_lt_unmask_irq, 367 .unmask = locomo_lt_unmask_irq,
@@ -418,7 +422,8 @@ static void locomo_spi_unmask_irq(unsigned int irq)
418 locomo_writel(r, mapbase + LOCOMO_SPIIE); 422 locomo_writel(r, mapbase + LOCOMO_SPIIE);
419} 423}
420 424
421static struct irqchip locomo_spi_chip = { 425static struct irq_chip locomo_spi_chip = {
426 .name = "LOCOMO-spi",
422 .ack = locomo_spi_ack_irq, 427 .ack = locomo_spi_ack_irq,
423 .mask = locomo_spi_mask_irq, 428 .mask = locomo_spi_mask_irq,
424 .unmask = locomo_spi_unmask_irq, 429 .unmask = locomo_spi_unmask_irq,
@@ -506,7 +511,7 @@ locomo_init_one_child(struct locomo *lchip, struct locomo_dev_info *info)
506 goto out; 511 goto out;
507 } 512 }
508 513
509 strncpy(dev->dev.bus_id,info->name,sizeof(dev->dev.bus_id)); 514 strncpy(dev->dev.bus_id, info->name, sizeof(dev->dev.bus_id));
510 /* 515 /*
511 * If the parent device has a DMA mask associated with it, 516 * If the parent device has a DMA mask associated with it,
512 * propagate it down to the children. 517 * propagate it down to the children.
@@ -729,7 +734,6 @@ __locomo_probe(struct device *me, struct resource *mem, int irq)
729 734
730 for (i = 0; i < ARRAY_SIZE(locomo_devices); i++) 735 for (i = 0; i < ARRAY_SIZE(locomo_devices); i++)
731 locomo_init_one_child(lchip, &locomo_devices[i]); 736 locomo_init_one_child(lchip, &locomo_devices[i]);
732
733 return 0; 737 return 0;
734 738
735 out: 739 out:
diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
index 1cdb26a47e1f..a331c12cead9 100644
--- a/arch/arm/common/sa1111.c
+++ b/arch/arm/common/sa1111.c
@@ -272,7 +272,8 @@ static int sa1111_wake_lowirq(unsigned int irq, unsigned int on)
272 return 0; 272 return 0;
273} 273}
274 274
275static struct irqchip sa1111_low_chip = { 275static struct irq_chip sa1111_low_chip = {
276 .name = "SA1111-l",
276 .ack = sa1111_ack_irq, 277 .ack = sa1111_ack_irq,
277 .mask = sa1111_mask_lowirq, 278 .mask = sa1111_mask_lowirq,
278 .unmask = sa1111_unmask_lowirq, 279 .unmask = sa1111_unmask_lowirq,
@@ -368,7 +369,8 @@ static int sa1111_wake_highirq(unsigned int irq, unsigned int on)
368 return 0; 369 return 0;
369} 370}
370 371
371static struct irqchip sa1111_high_chip = { 372static struct irq_chip sa1111_high_chip = {
373 .name = "SA1111-h",
372 .ack = sa1111_ack_irq, 374 .ack = sa1111_ack_irq,
373 .mask = sa1111_mask_highirq, 375 .mask = sa1111_mask_highirq,
374 .unmask = sa1111_unmask_highirq, 376 .unmask = sa1111_unmask_highirq,
diff --git a/arch/arm/common/sharpsl_pm.c b/arch/arm/common/sharpsl_pm.c
index 045e37e07330..59b5ddec480f 100644
--- a/arch/arm/common/sharpsl_pm.c
+++ b/arch/arm/common/sharpsl_pm.c
@@ -412,8 +412,10 @@ static int sharpsl_check_battery_temp(void)
412 val = get_select_val(buff); 412 val = get_select_val(buff);
413 413
414 dev_dbg(sharpsl_pm.dev, "Temperature: %d\n", val); 414 dev_dbg(sharpsl_pm.dev, "Temperature: %d\n", val);
415 if (val > sharpsl_pm.machinfo->charge_on_temp) 415 if (val > sharpsl_pm.machinfo->charge_on_temp) {
416 printk(KERN_WARNING "Not charging: temperature out of limits.\n");
416 return -1; 417 return -1;
418 }
417 419
418 return 0; 420 return 0;
419} 421}
diff --git a/arch/arm/common/vic.c b/arch/arm/common/vic.c
index a19bc4a6196d..43d278134521 100644
--- a/arch/arm/common/vic.c
+++ b/arch/arm/common/vic.c
@@ -39,7 +39,8 @@ static void vic_unmask_irq(unsigned int irq)
39 writel(1 << irq, base + VIC_INT_ENABLE); 39 writel(1 << irq, base + VIC_INT_ENABLE);
40} 40}
41 41
42static struct irqchip vic_chip = { 42static struct irq_chip vic_chip = {
43 .name = "VIC",
43 .ack = vic_mask_irq, 44 .ack = vic_mask_irq,
44 .mask = vic_mask_irq, 45 .mask = vic_mask_irq,
45 .unmask = vic_unmask_irq, 46 .unmask = vic_unmask_irq,
diff --git a/arch/arm/configs/ep93xx_defconfig b/arch/arm/configs/ep93xx_defconfig
index b69e88bbc909..2948b4589a8b 100644
--- a/arch/arm/configs/ep93xx_defconfig
+++ b/arch/arm/configs/ep93xx_defconfig
@@ -1,14 +1,18 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1-git9
4# Wed Apr 19 21:21:01 2006 4# Sat Jul 15 15:08:10 2006
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_MMU=y 7CONFIG_MMU=y
8CONFIG_GENERIC_HARDIRQS=y
9CONFIG_HARDIRQS_SW_RESEND=y
10CONFIG_GENERIC_IRQ_PROBE=y
8CONFIG_RWSEM_GENERIC_SPINLOCK=y 11CONFIG_RWSEM_GENERIC_SPINLOCK=y
9CONFIG_GENERIC_HWEIGHT=y 12CONFIG_GENERIC_HWEIGHT=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y 13CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_VECTORS_BASE=0xffff0000 14CONFIG_VECTORS_BASE=0xffff0000
15CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
12 16
13# 17#
14# Code maturity level options 18# Code maturity level options
@@ -26,6 +30,7 @@ CONFIG_SWAP=y
26CONFIG_SYSVIPC=y 30CONFIG_SYSVIPC=y
27# CONFIG_POSIX_MQUEUE is not set 31# CONFIG_POSIX_MQUEUE is not set
28# CONFIG_BSD_PROCESS_ACCT is not set 32# CONFIG_BSD_PROCESS_ACCT is not set
33# CONFIG_TASKSTATS is not set
29CONFIG_SYSCTL=y 34CONFIG_SYSCTL=y
30# CONFIG_AUDIT is not set 35# CONFIG_AUDIT is not set
31CONFIG_IKCONFIG=y 36CONFIG_IKCONFIG=y
@@ -43,14 +48,15 @@ CONFIG_PRINTK=y
43CONFIG_BUG=y 48CONFIG_BUG=y
44CONFIG_ELF_CORE=y 49CONFIG_ELF_CORE=y
45CONFIG_BASE_FULL=y 50CONFIG_BASE_FULL=y
51CONFIG_RT_MUTEXES=y
46CONFIG_FUTEX=y 52CONFIG_FUTEX=y
47CONFIG_EPOLL=y 53CONFIG_EPOLL=y
48CONFIG_SHMEM=y 54CONFIG_SHMEM=y
49CONFIG_SLAB=y 55CONFIG_SLAB=y
56CONFIG_VM_EVENT_COUNTERS=y
50# CONFIG_TINY_SHMEM is not set 57# CONFIG_TINY_SHMEM is not set
51CONFIG_BASE_SMALL=0 58CONFIG_BASE_SMALL=0
52# CONFIG_SLOB is not set 59# CONFIG_SLOB is not set
53CONFIG_OBSOLETE_INTERMODULE=y
54 60
55# 61#
56# Loadable module support 62# Loadable module support
@@ -83,18 +89,26 @@ CONFIG_DEFAULT_IOSCHED="deadline"
83# 89#
84# System Type 90# System Type
85# 91#
92# CONFIG_ARCH_AAEC2000 is not set
93# CONFIG_ARCH_INTEGRATOR is not set
94# CONFIG_ARCH_REALVIEW is not set
95# CONFIG_ARCH_VERSATILE is not set
96# CONFIG_ARCH_AT91 is not set
86# CONFIG_ARCH_CLPS7500 is not set 97# CONFIG_ARCH_CLPS7500 is not set
87# CONFIG_ARCH_CLPS711X is not set 98# CONFIG_ARCH_CLPS711X is not set
88# CONFIG_ARCH_CO285 is not set 99# CONFIG_ARCH_CO285 is not set
89# CONFIG_ARCH_EBSA110 is not set 100# CONFIG_ARCH_EBSA110 is not set
90CONFIG_ARCH_EP93XX=y 101CONFIG_ARCH_EP93XX=y
91# CONFIG_ARCH_FOOTBRIDGE is not set 102# CONFIG_ARCH_FOOTBRIDGE is not set
92# CONFIG_ARCH_INTEGRATOR is not set 103# CONFIG_ARCH_NETX is not set
104# CONFIG_ARCH_H720X is not set
105# CONFIG_ARCH_IMX is not set
93# CONFIG_ARCH_IOP3XX is not set 106# CONFIG_ARCH_IOP3XX is not set
94# CONFIG_ARCH_IXP4XX is not set 107# CONFIG_ARCH_IXP4XX is not set
95# CONFIG_ARCH_IXP2000 is not set 108# CONFIG_ARCH_IXP2000 is not set
96# CONFIG_ARCH_IXP23XX is not set 109# CONFIG_ARCH_IXP23XX is not set
97# CONFIG_ARCH_L7200 is not set 110# CONFIG_ARCH_L7200 is not set
111# CONFIG_ARCH_PNX4008 is not set
98# CONFIG_ARCH_PXA is not set 112# CONFIG_ARCH_PXA is not set
99# CONFIG_ARCH_RPC is not set 113# CONFIG_ARCH_RPC is not set
100# CONFIG_ARCH_SA1100 is not set 114# CONFIG_ARCH_SA1100 is not set
@@ -102,20 +116,18 @@ CONFIG_ARCH_EP93XX=y
102# CONFIG_ARCH_SHARK is not set 116# CONFIG_ARCH_SHARK is not set
103# CONFIG_ARCH_LH7A40X is not set 117# CONFIG_ARCH_LH7A40X is not set
104# CONFIG_ARCH_OMAP is not set 118# CONFIG_ARCH_OMAP is not set
105# CONFIG_ARCH_VERSATILE is not set
106# CONFIG_ARCH_REALVIEW is not set
107# CONFIG_ARCH_IMX is not set
108# CONFIG_ARCH_H720X is not set
109# CONFIG_ARCH_AAEC2000 is not set
110# CONFIG_ARCH_AT91RM9200 is not set
111 119
112# 120#
113# Cirrus EP93xx Implementation Options 121# Cirrus EP93xx Implementation Options
114# 122#
123CONFIG_CRUNCH=y
115 124
116# 125#
117# EP93xx Platforms 126# EP93xx Platforms
118# 127#
128CONFIG_MACH_EDB9302=y
129CONFIG_MACH_EDB9315=y
130CONFIG_MACH_EDB9315A=y
119CONFIG_MACH_GESBC9312=y 131CONFIG_MACH_GESBC9312=y
120CONFIG_MACH_TS72XX=y 132CONFIG_MACH_TS72XX=y
121 133
@@ -166,6 +178,7 @@ CONFIG_FLATMEM=y
166CONFIG_FLAT_NODE_MEM_MAP=y 178CONFIG_FLAT_NODE_MEM_MAP=y
167# CONFIG_SPARSEMEM_STATIC is not set 179# CONFIG_SPARSEMEM_STATIC is not set
168CONFIG_SPLIT_PTLOCK_CPUS=4096 180CONFIG_SPLIT_PTLOCK_CPUS=4096
181# CONFIG_RESOURCES_64BIT is not set
169CONFIG_ALIGNMENT_TRAP=y 182CONFIG_ALIGNMENT_TRAP=y
170 183
171# 184#
@@ -233,6 +246,8 @@ CONFIG_SYN_COOKIES=y
233# CONFIG_INET_IPCOMP is not set 246# CONFIG_INET_IPCOMP is not set
234# CONFIG_INET_XFRM_TUNNEL is not set 247# CONFIG_INET_XFRM_TUNNEL is not set
235# CONFIG_INET_TUNNEL is not set 248# CONFIG_INET_TUNNEL is not set
249CONFIG_INET_XFRM_MODE_TRANSPORT=y
250CONFIG_INET_XFRM_MODE_TUNNEL=y
236CONFIG_INET_DIAG=y 251CONFIG_INET_DIAG=y
237CONFIG_INET_TCP_DIAG=y 252CONFIG_INET_TCP_DIAG=y
238# CONFIG_TCP_CONG_ADVANCED is not set 253# CONFIG_TCP_CONG_ADVANCED is not set
@@ -240,6 +255,7 @@ CONFIG_TCP_CONG_BIC=y
240# CONFIG_IPV6 is not set 255# CONFIG_IPV6 is not set
241# CONFIG_INET6_XFRM_TUNNEL is not set 256# CONFIG_INET6_XFRM_TUNNEL is not set
242# CONFIG_INET6_TUNNEL is not set 257# CONFIG_INET6_TUNNEL is not set
258# CONFIG_NETWORK_SECMARK is not set
243# CONFIG_NETFILTER is not set 259# CONFIG_NETFILTER is not set
244 260
245# 261#
@@ -294,6 +310,7 @@ CONFIG_STANDALONE=y
294CONFIG_PREVENT_FIRMWARE_BUILD=y 310CONFIG_PREVENT_FIRMWARE_BUILD=y
295# CONFIG_FW_LOADER is not set 311# CONFIG_FW_LOADER is not set
296# CONFIG_DEBUG_DRIVER is not set 312# CONFIG_DEBUG_DRIVER is not set
313# CONFIG_SYS_HYPERVISOR is not set
297 314
298# 315#
299# Connector - unified userspace <-> kernelspace linker 316# Connector - unified userspace <-> kernelspace linker
@@ -386,6 +403,8 @@ CONFIG_MTD_PHYSMAP_BANKWIDTH=1
386# 403#
387CONFIG_MTD_NAND=y 404CONFIG_MTD_NAND=y
388CONFIG_MTD_NAND_VERIFY_WRITE=y 405CONFIG_MTD_NAND_VERIFY_WRITE=y
406# CONFIG_MTD_NAND_ECC_SMC is not set
407CONFIG_MTD_NAND_TS7250=y
389CONFIG_MTD_NAND_IDS=y 408CONFIG_MTD_NAND_IDS=y
390# CONFIG_MTD_NAND_DISKONCHIP is not set 409# CONFIG_MTD_NAND_DISKONCHIP is not set
391# CONFIG_MTD_NAND_NANDSIM is not set 410# CONFIG_MTD_NAND_NANDSIM is not set
@@ -582,6 +601,7 @@ CONFIG_EP93XX_WATCHDOG=y
582# USB-based Watchdog Cards 601# USB-based Watchdog Cards
583# 602#
584# CONFIG_USBPCWATCHDOG is not set 603# CONFIG_USBPCWATCHDOG is not set
604# CONFIG_HW_RANDOM is not set
585# CONFIG_NVRAM is not set 605# CONFIG_NVRAM is not set
586# CONFIG_DTLK is not set 606# CONFIG_DTLK is not set
587# CONFIG_R3964 is not set 607# CONFIG_R3964 is not set
@@ -613,6 +633,7 @@ CONFIG_I2C_ALGOBIT=y
613# 633#
614# I2C Hardware Bus support 634# I2C Hardware Bus support
615# 635#
636# CONFIG_I2C_OCORES is not set
616# CONFIG_I2C_PARPORT_LIGHT is not set 637# CONFIG_I2C_PARPORT_LIGHT is not set
617# CONFIG_I2C_STUB is not set 638# CONFIG_I2C_STUB is not set
618# CONFIG_I2C_PCA_ISA is not set 639# CONFIG_I2C_PCA_ISA is not set
@@ -641,13 +662,13 @@ CONFIG_I2C_DEBUG_CHIP=y
641# 662#
642# Dallas's 1-wire bus 663# Dallas's 1-wire bus
643# 664#
644# CONFIG_W1 is not set
645 665
646# 666#
647# Hardware Monitoring support 667# Hardware Monitoring support
648# 668#
649CONFIG_HWMON=y 669CONFIG_HWMON=y
650# CONFIG_HWMON_VID is not set 670# CONFIG_HWMON_VID is not set
671# CONFIG_SENSORS_ABITUGURU is not set
651# CONFIG_SENSORS_ADM1021 is not set 672# CONFIG_SENSORS_ADM1021 is not set
652# CONFIG_SENSORS_ADM1025 is not set 673# CONFIG_SENSORS_ADM1025 is not set
653# CONFIG_SENSORS_ADM1026 is not set 674# CONFIG_SENSORS_ADM1026 is not set
@@ -675,8 +696,10 @@ CONFIG_HWMON=y
675# CONFIG_SENSORS_MAX1619 is not set 696# CONFIG_SENSORS_MAX1619 is not set
676# CONFIG_SENSORS_PC87360 is not set 697# CONFIG_SENSORS_PC87360 is not set
677# CONFIG_SENSORS_SMSC47M1 is not set 698# CONFIG_SENSORS_SMSC47M1 is not set
699# CONFIG_SENSORS_SMSC47M192 is not set
678# CONFIG_SENSORS_SMSC47B397 is not set 700# CONFIG_SENSORS_SMSC47B397 is not set
679# CONFIG_SENSORS_W83781D is not set 701# CONFIG_SENSORS_W83781D is not set
702# CONFIG_SENSORS_W83791D is not set
680# CONFIG_SENSORS_W83792D is not set 703# CONFIG_SENSORS_W83792D is not set
681# CONFIG_SENSORS_W83L785TS is not set 704# CONFIG_SENSORS_W83L785TS is not set
682# CONFIG_SENSORS_W83627HF is not set 705# CONFIG_SENSORS_W83627HF is not set
@@ -704,6 +727,7 @@ CONFIG_HWMON=y
704# Multimedia devices 727# Multimedia devices
705# 728#
706# CONFIG_VIDEO_DEV is not set 729# CONFIG_VIDEO_DEV is not set
730CONFIG_VIDEO_V4L2=y
707 731
708# 732#
709# Digital Video Broadcasting Devices 733# Digital Video Broadcasting Devices
@@ -714,6 +738,7 @@ CONFIG_HWMON=y
714# 738#
715# Graphics support 739# Graphics support
716# 740#
741# CONFIG_FIRMWARE_EDID is not set
717# CONFIG_FB is not set 742# CONFIG_FB is not set
718 743
719# 744#
@@ -725,7 +750,7 @@ CONFIG_HWMON=y
725# USB support 750# USB support
726# 751#
727CONFIG_USB_ARCH_HAS_HCD=y 752CONFIG_USB_ARCH_HAS_HCD=y
728# CONFIG_USB_ARCH_HAS_OHCI is not set 753CONFIG_USB_ARCH_HAS_OHCI=y
729# CONFIG_USB_ARCH_HAS_EHCI is not set 754# CONFIG_USB_ARCH_HAS_EHCI is not set
730CONFIG_USB=y 755CONFIG_USB=y
731CONFIG_USB_DEBUG=y 756CONFIG_USB_DEBUG=y
@@ -742,6 +767,9 @@ CONFIG_USB_DYNAMIC_MINORS=y
742# USB Host Controller Drivers 767# USB Host Controller Drivers
743# 768#
744# CONFIG_USB_ISP116X_HCD is not set 769# CONFIG_USB_ISP116X_HCD is not set
770CONFIG_USB_OHCI_HCD=y
771# CONFIG_USB_OHCI_BIG_ENDIAN is not set
772CONFIG_USB_OHCI_LITTLE_ENDIAN=y
745# CONFIG_USB_SL811_HCD is not set 773# CONFIG_USB_SL811_HCD is not set
746 774
747# 775#
@@ -806,6 +834,7 @@ CONFIG_USB_SERIAL_CONSOLE=y
806# CONFIG_USB_SERIAL_GENERIC is not set 834# CONFIG_USB_SERIAL_GENERIC is not set
807# CONFIG_USB_SERIAL_AIRPRIME is not set 835# CONFIG_USB_SERIAL_AIRPRIME is not set
808# CONFIG_USB_SERIAL_ANYDATA is not set 836# CONFIG_USB_SERIAL_ANYDATA is not set
837# CONFIG_USB_SERIAL_ARK3116 is not set
809# CONFIG_USB_SERIAL_BELKIN is not set 838# CONFIG_USB_SERIAL_BELKIN is not set
810# CONFIG_USB_SERIAL_WHITEHEAT is not set 839# CONFIG_USB_SERIAL_WHITEHEAT is not set
811# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set 840# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
@@ -830,9 +859,11 @@ CONFIG_USB_SERIAL_CONSOLE=y
830CONFIG_USB_SERIAL_PL2303=y 859CONFIG_USB_SERIAL_PL2303=y
831# CONFIG_USB_SERIAL_HP4X is not set 860# CONFIG_USB_SERIAL_HP4X is not set
832# CONFIG_USB_SERIAL_SAFE is not set 861# CONFIG_USB_SERIAL_SAFE is not set
862# CONFIG_USB_SERIAL_SIERRAWIRELESS is not set
833# CONFIG_USB_SERIAL_TI is not set 863# CONFIG_USB_SERIAL_TI is not set
834# CONFIG_USB_SERIAL_CYBERJACK is not set 864# CONFIG_USB_SERIAL_CYBERJACK is not set
835# CONFIG_USB_SERIAL_XIRCOM is not set 865# CONFIG_USB_SERIAL_XIRCOM is not set
866# CONFIG_USB_SERIAL_OPTION is not set
836# CONFIG_USB_SERIAL_OMNINET is not set 867# CONFIG_USB_SERIAL_OMNINET is not set
837 868
838# 869#
@@ -845,10 +876,12 @@ CONFIG_USB_SERIAL_PL2303=y
845# CONFIG_USB_LEGOTOWER is not set 876# CONFIG_USB_LEGOTOWER is not set
846# CONFIG_USB_LCD is not set 877# CONFIG_USB_LCD is not set
847# CONFIG_USB_LED is not set 878# CONFIG_USB_LED is not set
879# CONFIG_USB_CYPRESS_CY7C63 is not set
848# CONFIG_USB_CYTHERM is not set 880# CONFIG_USB_CYTHERM is not set
849# CONFIG_USB_PHIDGETKIT is not set 881# CONFIG_USB_PHIDGETKIT is not set
850# CONFIG_USB_PHIDGETSERVO is not set 882# CONFIG_USB_PHIDGETSERVO is not set
851# CONFIG_USB_IDMOUSE is not set 883# CONFIG_USB_IDMOUSE is not set
884# CONFIG_USB_APPLEDISPLAY is not set
852# CONFIG_USB_LD is not set 885# CONFIG_USB_LD is not set
853# CONFIG_USB_TEST is not set 886# CONFIG_USB_TEST is not set
854 887
@@ -880,17 +913,25 @@ CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
880CONFIG_RTC_INTF_SYSFS=y 913CONFIG_RTC_INTF_SYSFS=y
881CONFIG_RTC_INTF_PROC=y 914CONFIG_RTC_INTF_PROC=y
882CONFIG_RTC_INTF_DEV=y 915CONFIG_RTC_INTF_DEV=y
916# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
883 917
884# 918#
885# RTC drivers 919# RTC drivers
886# 920#
887# CONFIG_RTC_DRV_X1205 is not set 921# CONFIG_RTC_DRV_X1205 is not set
922# CONFIG_RTC_DRV_DS1307 is not set
923# CONFIG_RTC_DRV_DS1553 is not set
924# CONFIG_RTC_DRV_ISL1208 is not set
888# CONFIG_RTC_DRV_DS1672 is not set 925# CONFIG_RTC_DRV_DS1672 is not set
926# CONFIG_RTC_DRV_DS1742 is not set
889# CONFIG_RTC_DRV_PCF8563 is not set 927# CONFIG_RTC_DRV_PCF8563 is not set
928# CONFIG_RTC_DRV_PCF8583 is not set
890# CONFIG_RTC_DRV_RS5C372 is not set 929# CONFIG_RTC_DRV_RS5C372 is not set
891CONFIG_RTC_DRV_M48T86=y 930CONFIG_RTC_DRV_M48T86=y
892CONFIG_RTC_DRV_EP93XX=y 931CONFIG_RTC_DRV_EP93XX=y
932# CONFIG_RTC_DRV_PL031 is not set
893# CONFIG_RTC_DRV_TEST is not set 933# CONFIG_RTC_DRV_TEST is not set
934# CONFIG_RTC_DRV_V3020 is not set
894 935
895# 936#
896# File systems 937# File systems
@@ -910,6 +951,7 @@ CONFIG_JBD=y
910# CONFIG_MINIX_FS is not set 951# CONFIG_MINIX_FS is not set
911# CONFIG_ROMFS_FS is not set 952# CONFIG_ROMFS_FS is not set
912CONFIG_INOTIFY=y 953CONFIG_INOTIFY=y
954CONFIG_INOTIFY_USER=y
913# CONFIG_QUOTA is not set 955# CONFIG_QUOTA is not set
914CONFIG_DNOTIFY=y 956CONFIG_DNOTIFY=y
915# CONFIG_AUTOFS_FS is not set 957# CONFIG_AUTOFS_FS is not set
@@ -957,6 +999,7 @@ CONFIG_JFFS2_FS=y
957CONFIG_JFFS2_FS_DEBUG=0 999CONFIG_JFFS2_FS_DEBUG=0
958CONFIG_JFFS2_FS_WRITEBUFFER=y 1000CONFIG_JFFS2_FS_WRITEBUFFER=y
959# CONFIG_JFFS2_SUMMARY is not set 1001# CONFIG_JFFS2_SUMMARY is not set
1002# CONFIG_JFFS2_FS_XATTR is not set
960# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set 1003# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
961CONFIG_JFFS2_ZLIB=y 1004CONFIG_JFFS2_ZLIB=y
962CONFIG_JFFS2_RTIME=y 1005CONFIG_JFFS2_RTIME=y
@@ -1066,15 +1109,20 @@ CONFIG_NLS_ISO8859_1=y
1066# 1109#
1067# CONFIG_PRINTK_TIME is not set 1110# CONFIG_PRINTK_TIME is not set
1068CONFIG_MAGIC_SYSRQ=y 1111CONFIG_MAGIC_SYSRQ=y
1112# CONFIG_UNUSED_SYMBOLS is not set
1069CONFIG_DEBUG_KERNEL=y 1113CONFIG_DEBUG_KERNEL=y
1070CONFIG_LOG_BUF_SHIFT=14 1114CONFIG_LOG_BUF_SHIFT=14
1071CONFIG_DETECT_SOFTLOCKUP=y 1115CONFIG_DETECT_SOFTLOCKUP=y
1072# CONFIG_SCHEDSTATS is not set 1116# CONFIG_SCHEDSTATS is not set
1073CONFIG_DEBUG_SLAB=y 1117CONFIG_DEBUG_SLAB=y
1074# CONFIG_DEBUG_SLAB_LEAK is not set 1118# CONFIG_DEBUG_SLAB_LEAK is not set
1075CONFIG_DEBUG_MUTEXES=y 1119# CONFIG_DEBUG_RT_MUTEXES is not set
1120# CONFIG_RT_MUTEX_TESTER is not set
1076CONFIG_DEBUG_SPINLOCK=y 1121CONFIG_DEBUG_SPINLOCK=y
1122CONFIG_DEBUG_MUTEXES=y
1123# CONFIG_DEBUG_RWSEMS is not set
1077# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1124# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1125# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1078# CONFIG_DEBUG_KOBJECT is not set 1126# CONFIG_DEBUG_KOBJECT is not set
1079CONFIG_DEBUG_BUGVERBOSE=y 1127CONFIG_DEBUG_BUGVERBOSE=y
1080# CONFIG_DEBUG_INFO is not set 1128# CONFIG_DEBUG_INFO is not set
@@ -1114,3 +1162,4 @@ CONFIG_CRC32=y
1114CONFIG_LIBCRC32C=y 1162CONFIG_LIBCRC32C=y
1115CONFIG_ZLIB_INFLATE=y 1163CONFIG_ZLIB_INFLATE=y
1116CONFIG_ZLIB_DEFLATE=y 1164CONFIG_ZLIB_DEFLATE=y
1165CONFIG_PLIST=y
diff --git a/arch/arm/configs/ixp2000_defconfig b/arch/arm/configs/ixp2000_defconfig
index e6f3e4873d6c..27b3e31a8ad8 100644
--- a/arch/arm/configs/ixp2000_defconfig
+++ b/arch/arm/configs/ixp2000_defconfig
@@ -1,14 +1,18 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Wed Apr 19 21:12:49 2006 4# Sun Jul 9 15:28:50 2006
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_MMU=y 7CONFIG_MMU=y
8CONFIG_GENERIC_HARDIRQS=y
9CONFIG_HARDIRQS_SW_RESEND=y
10CONFIG_GENERIC_IRQ_PROBE=y
8CONFIG_RWSEM_GENERIC_SPINLOCK=y 11CONFIG_RWSEM_GENERIC_SPINLOCK=y
9CONFIG_GENERIC_HWEIGHT=y 12CONFIG_GENERIC_HWEIGHT=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y 13CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_VECTORS_BASE=0xffff0000 14CONFIG_VECTORS_BASE=0xffff0000
15CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
12 16
13# 17#
14# Code maturity level options 18# Code maturity level options
@@ -43,14 +47,15 @@ CONFIG_PRINTK=y
43CONFIG_BUG=y 47CONFIG_BUG=y
44CONFIG_ELF_CORE=y 48CONFIG_ELF_CORE=y
45CONFIG_BASE_FULL=y 49CONFIG_BASE_FULL=y
50CONFIG_RT_MUTEXES=y
46CONFIG_FUTEX=y 51CONFIG_FUTEX=y
47CONFIG_EPOLL=y 52CONFIG_EPOLL=y
48CONFIG_SHMEM=y 53CONFIG_SHMEM=y
49CONFIG_SLAB=y 54CONFIG_SLAB=y
55CONFIG_VM_EVENT_COUNTERS=y
50# CONFIG_TINY_SHMEM is not set 56# CONFIG_TINY_SHMEM is not set
51CONFIG_BASE_SMALL=0 57CONFIG_BASE_SMALL=0
52# CONFIG_SLOB is not set 58# CONFIG_SLOB is not set
53CONFIG_OBSOLETE_INTERMODULE=y
54 59
55# 60#
56# Loadable module support 61# Loadable module support
@@ -83,18 +88,26 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
83# 88#
84# System Type 89# System Type
85# 90#
91# CONFIG_ARCH_AAEC2000 is not set
92# CONFIG_ARCH_INTEGRATOR is not set
93# CONFIG_ARCH_REALVIEW is not set
94# CONFIG_ARCH_VERSATILE is not set
95# CONFIG_ARCH_AT91 is not set
86# CONFIG_ARCH_CLPS7500 is not set 96# CONFIG_ARCH_CLPS7500 is not set
87# CONFIG_ARCH_CLPS711X is not set 97# CONFIG_ARCH_CLPS711X is not set
88# CONFIG_ARCH_CO285 is not set 98# CONFIG_ARCH_CO285 is not set
89# CONFIG_ARCH_EBSA110 is not set 99# CONFIG_ARCH_EBSA110 is not set
90# CONFIG_ARCH_EP93XX is not set 100# CONFIG_ARCH_EP93XX is not set
91# CONFIG_ARCH_FOOTBRIDGE is not set 101# CONFIG_ARCH_FOOTBRIDGE is not set
92# CONFIG_ARCH_INTEGRATOR is not set 102# CONFIG_ARCH_NETX is not set
103# CONFIG_ARCH_H720X is not set
104# CONFIG_ARCH_IMX is not set
93# CONFIG_ARCH_IOP3XX is not set 105# CONFIG_ARCH_IOP3XX is not set
94# CONFIG_ARCH_IXP4XX is not set 106# CONFIG_ARCH_IXP4XX is not set
95CONFIG_ARCH_IXP2000=y 107CONFIG_ARCH_IXP2000=y
96# CONFIG_ARCH_IXP23XX is not set 108# CONFIG_ARCH_IXP23XX is not set
97# CONFIG_ARCH_L7200 is not set 109# CONFIG_ARCH_L7200 is not set
110# CONFIG_ARCH_PNX4008 is not set
98# CONFIG_ARCH_PXA is not set 111# CONFIG_ARCH_PXA is not set
99# CONFIG_ARCH_RPC is not set 112# CONFIG_ARCH_RPC is not set
100# CONFIG_ARCH_SA1100 is not set 113# CONFIG_ARCH_SA1100 is not set
@@ -102,12 +115,6 @@ CONFIG_ARCH_IXP2000=y
102# CONFIG_ARCH_SHARK is not set 115# CONFIG_ARCH_SHARK is not set
103# CONFIG_ARCH_LH7A40X is not set 116# CONFIG_ARCH_LH7A40X is not set
104# CONFIG_ARCH_OMAP is not set 117# CONFIG_ARCH_OMAP is not set
105# CONFIG_ARCH_VERSATILE is not set
106# CONFIG_ARCH_REALVIEW is not set
107# CONFIG_ARCH_IMX is not set
108# CONFIG_ARCH_H720X is not set
109# CONFIG_ARCH_AAEC2000 is not set
110# CONFIG_ARCH_AT91RM9200 is not set
111CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y 118CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y
112 119
113# 120#
@@ -171,6 +178,7 @@ CONFIG_FLATMEM=y
171CONFIG_FLAT_NODE_MEM_MAP=y 178CONFIG_FLAT_NODE_MEM_MAP=y
172# CONFIG_SPARSEMEM_STATIC is not set 179# CONFIG_SPARSEMEM_STATIC is not set
173CONFIG_SPLIT_PTLOCK_CPUS=4096 180CONFIG_SPLIT_PTLOCK_CPUS=4096
181# CONFIG_RESOURCES_64BIT is not set
174CONFIG_ALIGNMENT_TRAP=y 182CONFIG_ALIGNMENT_TRAP=y
175 183
176# 184#
@@ -218,6 +226,8 @@ CONFIG_NET=y
218CONFIG_PACKET=y 226CONFIG_PACKET=y
219CONFIG_PACKET_MMAP=y 227CONFIG_PACKET_MMAP=y
220CONFIG_UNIX=y 228CONFIG_UNIX=y
229CONFIG_XFRM=y
230# CONFIG_XFRM_USER is not set
221# CONFIG_NET_KEY is not set 231# CONFIG_NET_KEY is not set
222CONFIG_INET=y 232CONFIG_INET=y
223# CONFIG_IP_MULTICAST is not set 233# CONFIG_IP_MULTICAST is not set
@@ -236,6 +246,8 @@ CONFIG_SYN_COOKIES=y
236# CONFIG_INET_IPCOMP is not set 246# CONFIG_INET_IPCOMP is not set
237# CONFIG_INET_XFRM_TUNNEL is not set 247# CONFIG_INET_XFRM_TUNNEL is not set
238# CONFIG_INET_TUNNEL is not set 248# CONFIG_INET_TUNNEL is not set
249CONFIG_INET_XFRM_MODE_TRANSPORT=y
250CONFIG_INET_XFRM_MODE_TUNNEL=y
239CONFIG_INET_DIAG=y 251CONFIG_INET_DIAG=y
240CONFIG_INET_TCP_DIAG=y 252CONFIG_INET_TCP_DIAG=y
241# CONFIG_TCP_CONG_ADVANCED is not set 253# CONFIG_TCP_CONG_ADVANCED is not set
@@ -243,6 +255,7 @@ CONFIG_TCP_CONG_BIC=y
243# CONFIG_IPV6 is not set 255# CONFIG_IPV6 is not set
244# CONFIG_INET6_XFRM_TUNNEL is not set 256# CONFIG_INET6_XFRM_TUNNEL is not set
245# CONFIG_INET6_TUNNEL is not set 257# CONFIG_INET6_TUNNEL is not set
258# CONFIG_NETWORK_SECMARK is not set
246# CONFIG_NETFILTER is not set 259# CONFIG_NETFILTER is not set
247 260
248# 261#
@@ -297,6 +310,7 @@ CONFIG_STANDALONE=y
297# CONFIG_PREVENT_FIRMWARE_BUILD is not set 310# CONFIG_PREVENT_FIRMWARE_BUILD is not set
298# CONFIG_FW_LOADER is not set 311# CONFIG_FW_LOADER is not set
299# CONFIG_DEBUG_DRIVER is not set 312# CONFIG_DEBUG_DRIVER is not set
313# CONFIG_SYS_HYPERVISOR is not set
300 314
301# 315#
302# Connector - unified userspace <-> kernelspace linker 316# Connector - unified userspace <-> kernelspace linker
@@ -525,6 +539,7 @@ CONFIG_ENP2611_MSF_NET=y
525# CONFIG_CHELSIO_T1 is not set 539# CONFIG_CHELSIO_T1 is not set
526# CONFIG_IXGB is not set 540# CONFIG_IXGB is not set
527# CONFIG_S2IO is not set 541# CONFIG_S2IO is not set
542# CONFIG_MYRI10GE is not set
528 543
529# 544#
530# Token Ring devices 545# Token Ring devices
@@ -542,7 +557,6 @@ CONFIG_ENP2611_MSF_NET=y
542CONFIG_WAN=y 557CONFIG_WAN=y
543# CONFIG_DSCC4 is not set 558# CONFIG_DSCC4 is not set
544# CONFIG_LANMEDIA is not set 559# CONFIG_LANMEDIA is not set
545# CONFIG_SYNCLINK_SYNCPPP is not set
546CONFIG_HDLC=y 560CONFIG_HDLC=y
547CONFIG_HDLC_RAW=y 561CONFIG_HDLC_RAW=y
548# CONFIG_HDLC_RAW_ETH is not set 562# CONFIG_HDLC_RAW_ETH is not set
@@ -654,6 +668,7 @@ CONFIG_IXP2000_WATCHDOG=y
654# 668#
655# CONFIG_PCIPCWATCHDOG is not set 669# CONFIG_PCIPCWATCHDOG is not set
656# CONFIG_WDTPCI is not set 670# CONFIG_WDTPCI is not set
671# CONFIG_HW_RANDOM is not set
657# CONFIG_NVRAM is not set 672# CONFIG_NVRAM is not set
658# CONFIG_DTLK is not set 673# CONFIG_DTLK is not set
659# CONFIG_R3964 is not set 674# CONFIG_R3964 is not set
@@ -697,6 +712,7 @@ CONFIG_I2C_ALGOBIT=y
697# CONFIG_I2C_PIIX4 is not set 712# CONFIG_I2C_PIIX4 is not set
698CONFIG_I2C_IXP2000=y 713CONFIG_I2C_IXP2000=y
699# CONFIG_I2C_NFORCE2 is not set 714# CONFIG_I2C_NFORCE2 is not set
715# CONFIG_I2C_OCORES is not set
700# CONFIG_I2C_PARPORT_LIGHT is not set 716# CONFIG_I2C_PARPORT_LIGHT is not set
701# CONFIG_I2C_PROSAVAGE is not set 717# CONFIG_I2C_PROSAVAGE is not set
702# CONFIG_I2C_SAVAGE4 is not set 718# CONFIG_I2C_SAVAGE4 is not set
@@ -733,13 +749,13 @@ CONFIG_SENSORS_EEPROM=y
733# 749#
734# Dallas's 1-wire bus 750# Dallas's 1-wire bus
735# 751#
736# CONFIG_W1 is not set
737 752
738# 753#
739# Hardware Monitoring support 754# Hardware Monitoring support
740# 755#
741CONFIG_HWMON=y 756CONFIG_HWMON=y
742# CONFIG_HWMON_VID is not set 757# CONFIG_HWMON_VID is not set
758# CONFIG_SENSORS_ABITUGURU is not set
743# CONFIG_SENSORS_ADM1021 is not set 759# CONFIG_SENSORS_ADM1021 is not set
744# CONFIG_SENSORS_ADM1025 is not set 760# CONFIG_SENSORS_ADM1025 is not set
745# CONFIG_SENSORS_ADM1026 is not set 761# CONFIG_SENSORS_ADM1026 is not set
@@ -768,10 +784,12 @@ CONFIG_HWMON=y
768# CONFIG_SENSORS_PC87360 is not set 784# CONFIG_SENSORS_PC87360 is not set
769# CONFIG_SENSORS_SIS5595 is not set 785# CONFIG_SENSORS_SIS5595 is not set
770# CONFIG_SENSORS_SMSC47M1 is not set 786# CONFIG_SENSORS_SMSC47M1 is not set
787# CONFIG_SENSORS_SMSC47M192 is not set
771# CONFIG_SENSORS_SMSC47B397 is not set 788# CONFIG_SENSORS_SMSC47B397 is not set
772# CONFIG_SENSORS_VIA686A is not set 789# CONFIG_SENSORS_VIA686A is not set
773# CONFIG_SENSORS_VT8231 is not set 790# CONFIG_SENSORS_VT8231 is not set
774# CONFIG_SENSORS_W83781D is not set 791# CONFIG_SENSORS_W83781D is not set
792# CONFIG_SENSORS_W83791D is not set
775# CONFIG_SENSORS_W83792D is not set 793# CONFIG_SENSORS_W83792D is not set
776# CONFIG_SENSORS_W83L785TS is not set 794# CONFIG_SENSORS_W83L785TS is not set
777# CONFIG_SENSORS_W83627HF is not set 795# CONFIG_SENSORS_W83627HF is not set
@@ -799,6 +817,7 @@ CONFIG_HWMON=y
799# Multimedia devices 817# Multimedia devices
800# 818#
801# CONFIG_VIDEO_DEV is not set 819# CONFIG_VIDEO_DEV is not set
820CONFIG_VIDEO_V4L2=y
802 821
803# 822#
804# Digital Video Broadcasting Devices 823# Digital Video Broadcasting Devices
@@ -808,6 +827,7 @@ CONFIG_HWMON=y
808# 827#
809# Graphics support 828# Graphics support
810# 829#
830# CONFIG_FIRMWARE_EDID is not set
811# CONFIG_FB is not set 831# CONFIG_FB is not set
812 832
813# 833#
@@ -866,6 +886,7 @@ CONFIG_FS_POSIX_ACL=y
866# CONFIG_MINIX_FS is not set 886# CONFIG_MINIX_FS is not set
867# CONFIG_ROMFS_FS is not set 887# CONFIG_ROMFS_FS is not set
868CONFIG_INOTIFY=y 888CONFIG_INOTIFY=y
889CONFIG_INOTIFY_USER=y
869# CONFIG_QUOTA is not set 890# CONFIG_QUOTA is not set
870CONFIG_DNOTIFY=y 891CONFIG_DNOTIFY=y
871# CONFIG_AUTOFS_FS is not set 892# CONFIG_AUTOFS_FS is not set
@@ -910,6 +931,7 @@ CONFIG_JFFS2_FS=y
910CONFIG_JFFS2_FS_DEBUG=0 931CONFIG_JFFS2_FS_DEBUG=0
911CONFIG_JFFS2_FS_WRITEBUFFER=y 932CONFIG_JFFS2_FS_WRITEBUFFER=y
912# CONFIG_JFFS2_SUMMARY is not set 933# CONFIG_JFFS2_SUMMARY is not set
934# CONFIG_JFFS2_FS_XATTR is not set
913# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set 935# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
914CONFIG_JFFS2_ZLIB=y 936CONFIG_JFFS2_ZLIB=y
915CONFIG_JFFS2_RTIME=y 937CONFIG_JFFS2_RTIME=y
@@ -939,6 +961,7 @@ CONFIG_SUNRPC=y
939# CONFIG_RPCSEC_GSS_SPKM3 is not set 961# CONFIG_RPCSEC_GSS_SPKM3 is not set
940# CONFIG_SMB_FS is not set 962# CONFIG_SMB_FS is not set
941# CONFIG_CIFS is not set 963# CONFIG_CIFS is not set
964# CONFIG_CIFS_DEBUG2 is not set
942# CONFIG_NCP_FS is not set 965# CONFIG_NCP_FS is not set
943# CONFIG_CODA_FS is not set 966# CONFIG_CODA_FS is not set
944# CONFIG_AFS_FS is not set 967# CONFIG_AFS_FS is not set
@@ -980,14 +1003,19 @@ CONFIG_MSDOS_PARTITION=y
980# 1003#
981# CONFIG_PRINTK_TIME is not set 1004# CONFIG_PRINTK_TIME is not set
982CONFIG_MAGIC_SYSRQ=y 1005CONFIG_MAGIC_SYSRQ=y
1006# CONFIG_UNUSED_SYMBOLS is not set
983CONFIG_DEBUG_KERNEL=y 1007CONFIG_DEBUG_KERNEL=y
984CONFIG_LOG_BUF_SHIFT=14 1008CONFIG_LOG_BUF_SHIFT=14
985CONFIG_DETECT_SOFTLOCKUP=y 1009CONFIG_DETECT_SOFTLOCKUP=y
986# CONFIG_SCHEDSTATS is not set 1010# CONFIG_SCHEDSTATS is not set
987# CONFIG_DEBUG_SLAB is not set 1011# CONFIG_DEBUG_SLAB is not set
988CONFIG_DEBUG_MUTEXES=y 1012# CONFIG_DEBUG_RT_MUTEXES is not set
1013# CONFIG_RT_MUTEX_TESTER is not set
989# CONFIG_DEBUG_SPINLOCK is not set 1014# CONFIG_DEBUG_SPINLOCK is not set
1015CONFIG_DEBUG_MUTEXES=y
1016# CONFIG_DEBUG_RWSEMS is not set
990# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1017# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1018# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
991# CONFIG_DEBUG_KOBJECT is not set 1019# CONFIG_DEBUG_KOBJECT is not set
992CONFIG_DEBUG_BUGVERBOSE=y 1020CONFIG_DEBUG_BUGVERBOSE=y
993# CONFIG_DEBUG_INFO is not set 1021# CONFIG_DEBUG_INFO is not set
@@ -1027,3 +1055,4 @@ CONFIG_CRC32=y
1027# CONFIG_LIBCRC32C is not set 1055# CONFIG_LIBCRC32C is not set
1028CONFIG_ZLIB_INFLATE=y 1056CONFIG_ZLIB_INFLATE=y
1029CONFIG_ZLIB_DEFLATE=y 1057CONFIG_ZLIB_DEFLATE=y
1058CONFIG_PLIST=y
diff --git a/arch/arm/configs/ixp23xx_defconfig b/arch/arm/configs/ixp23xx_defconfig
index 9ce898a6cf87..7b18997083ce 100644
--- a/arch/arm/configs/ixp23xx_defconfig
+++ b/arch/arm/configs/ixp23xx_defconfig
@@ -1,14 +1,18 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Wed Apr 19 21:13:50 2006 4# Sun Jul 9 14:13:35 2006
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_MMU=y 7CONFIG_MMU=y
8CONFIG_GENERIC_HARDIRQS=y
9CONFIG_HARDIRQS_SW_RESEND=y
10CONFIG_GENERIC_IRQ_PROBE=y
8CONFIG_RWSEM_GENERIC_SPINLOCK=y 11CONFIG_RWSEM_GENERIC_SPINLOCK=y
9CONFIG_GENERIC_HWEIGHT=y 12CONFIG_GENERIC_HWEIGHT=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y 13CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_VECTORS_BASE=0xffff0000 14CONFIG_VECTORS_BASE=0xffff0000
15CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
12 16
13# 17#
14# Code maturity level options 18# Code maturity level options
@@ -43,14 +47,15 @@ CONFIG_PRINTK=y
43CONFIG_BUG=y 47CONFIG_BUG=y
44CONFIG_ELF_CORE=y 48CONFIG_ELF_CORE=y
45CONFIG_BASE_FULL=y 49CONFIG_BASE_FULL=y
50CONFIG_RT_MUTEXES=y
46CONFIG_FUTEX=y 51CONFIG_FUTEX=y
47CONFIG_EPOLL=y 52CONFIG_EPOLL=y
48CONFIG_SHMEM=y 53CONFIG_SHMEM=y
49CONFIG_SLAB=y 54CONFIG_SLAB=y
55CONFIG_VM_EVENT_COUNTERS=y
50# CONFIG_TINY_SHMEM is not set 56# CONFIG_TINY_SHMEM is not set
51CONFIG_BASE_SMALL=0 57CONFIG_BASE_SMALL=0
52# CONFIG_SLOB is not set 58# CONFIG_SLOB is not set
53CONFIG_OBSOLETE_INTERMODULE=y
54 59
55# 60#
56# Loadable module support 61# Loadable module support
@@ -83,18 +88,26 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
83# 88#
84# System Type 89# System Type
85# 90#
91# CONFIG_ARCH_AAEC2000 is not set
92# CONFIG_ARCH_INTEGRATOR is not set
93# CONFIG_ARCH_REALVIEW is not set
94# CONFIG_ARCH_VERSATILE is not set
95# CONFIG_ARCH_AT91 is not set
86# CONFIG_ARCH_CLPS7500 is not set 96# CONFIG_ARCH_CLPS7500 is not set
87# CONFIG_ARCH_CLPS711X is not set 97# CONFIG_ARCH_CLPS711X is not set
88# CONFIG_ARCH_CO285 is not set 98# CONFIG_ARCH_CO285 is not set
89# CONFIG_ARCH_EBSA110 is not set 99# CONFIG_ARCH_EBSA110 is not set
90# CONFIG_ARCH_EP93XX is not set 100# CONFIG_ARCH_EP93XX is not set
91# CONFIG_ARCH_FOOTBRIDGE is not set 101# CONFIG_ARCH_FOOTBRIDGE is not set
92# CONFIG_ARCH_INTEGRATOR is not set 102# CONFIG_ARCH_NETX is not set
103# CONFIG_ARCH_H720X is not set
104# CONFIG_ARCH_IMX is not set
93# CONFIG_ARCH_IOP3XX is not set 105# CONFIG_ARCH_IOP3XX is not set
94# CONFIG_ARCH_IXP4XX is not set 106# CONFIG_ARCH_IXP4XX is not set
95# CONFIG_ARCH_IXP2000 is not set 107# CONFIG_ARCH_IXP2000 is not set
96CONFIG_ARCH_IXP23XX=y 108CONFIG_ARCH_IXP23XX=y
97# CONFIG_ARCH_L7200 is not set 109# CONFIG_ARCH_L7200 is not set
110# CONFIG_ARCH_PNX4008 is not set
98# CONFIG_ARCH_PXA is not set 111# CONFIG_ARCH_PXA is not set
99# CONFIG_ARCH_RPC is not set 112# CONFIG_ARCH_RPC is not set
100# CONFIG_ARCH_SA1100 is not set 113# CONFIG_ARCH_SA1100 is not set
@@ -102,12 +115,6 @@ CONFIG_ARCH_IXP23XX=y
102# CONFIG_ARCH_SHARK is not set 115# CONFIG_ARCH_SHARK is not set
103# CONFIG_ARCH_LH7A40X is not set 116# CONFIG_ARCH_LH7A40X is not set
104# CONFIG_ARCH_OMAP is not set 117# CONFIG_ARCH_OMAP is not set
105# CONFIG_ARCH_VERSATILE is not set
106# CONFIG_ARCH_REALVIEW is not set
107# CONFIG_ARCH_IMX is not set
108# CONFIG_ARCH_H720X is not set
109# CONFIG_ARCH_AAEC2000 is not set
110# CONFIG_ARCH_AT91RM9200 is not set
111CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y 118CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y
112 119
113# 120#
@@ -165,6 +172,7 @@ CONFIG_FLATMEM=y
165CONFIG_FLAT_NODE_MEM_MAP=y 172CONFIG_FLAT_NODE_MEM_MAP=y
166# CONFIG_SPARSEMEM_STATIC is not set 173# CONFIG_SPARSEMEM_STATIC is not set
167CONFIG_SPLIT_PTLOCK_CPUS=4096 174CONFIG_SPLIT_PTLOCK_CPUS=4096
175CONFIG_RESOURCES_64BIT=y
168CONFIG_ALIGNMENT_TRAP=y 176CONFIG_ALIGNMENT_TRAP=y
169 177
170# 178#
@@ -212,6 +220,8 @@ CONFIG_NET=y
212CONFIG_PACKET=y 220CONFIG_PACKET=y
213CONFIG_PACKET_MMAP=y 221CONFIG_PACKET_MMAP=y
214CONFIG_UNIX=y 222CONFIG_UNIX=y
223CONFIG_XFRM=y
224# CONFIG_XFRM_USER is not set
215# CONFIG_NET_KEY is not set 225# CONFIG_NET_KEY is not set
216CONFIG_INET=y 226CONFIG_INET=y
217# CONFIG_IP_MULTICAST is not set 227# CONFIG_IP_MULTICAST is not set
@@ -230,6 +240,8 @@ CONFIG_SYN_COOKIES=y
230# CONFIG_INET_IPCOMP is not set 240# CONFIG_INET_IPCOMP is not set
231# CONFIG_INET_XFRM_TUNNEL is not set 241# CONFIG_INET_XFRM_TUNNEL is not set
232# CONFIG_INET_TUNNEL is not set 242# CONFIG_INET_TUNNEL is not set
243CONFIG_INET_XFRM_MODE_TRANSPORT=y
244CONFIG_INET_XFRM_MODE_TUNNEL=y
233CONFIG_INET_DIAG=y 245CONFIG_INET_DIAG=y
234CONFIG_INET_TCP_DIAG=y 246CONFIG_INET_TCP_DIAG=y
235# CONFIG_TCP_CONG_ADVANCED is not set 247# CONFIG_TCP_CONG_ADVANCED is not set
@@ -237,6 +249,7 @@ CONFIG_TCP_CONG_BIC=y
237# CONFIG_IPV6 is not set 249# CONFIG_IPV6 is not set
238# CONFIG_INET6_XFRM_TUNNEL is not set 250# CONFIG_INET6_XFRM_TUNNEL is not set
239# CONFIG_INET6_TUNNEL is not set 251# CONFIG_INET6_TUNNEL is not set
252# CONFIG_NETWORK_SECMARK is not set
240# CONFIG_NETFILTER is not set 253# CONFIG_NETFILTER is not set
241 254
242# 255#
@@ -291,6 +304,7 @@ CONFIG_STANDALONE=y
291# CONFIG_PREVENT_FIRMWARE_BUILD is not set 304# CONFIG_PREVENT_FIRMWARE_BUILD is not set
292# CONFIG_FW_LOADER is not set 305# CONFIG_FW_LOADER is not set
293# CONFIG_DEBUG_DRIVER is not set 306# CONFIG_DEBUG_DRIVER is not set
307# CONFIG_SYS_HYPERVISOR is not set
294 308
295# 309#
296# Connector - unified userspace <-> kernelspace linker 310# Connector - unified userspace <-> kernelspace linker
@@ -520,6 +534,7 @@ CONFIG_BLK_DEV_SD=y
520# CONFIG_MEGARAID_LEGACY is not set 534# CONFIG_MEGARAID_LEGACY is not set
521# CONFIG_MEGARAID_SAS is not set 535# CONFIG_MEGARAID_SAS is not set
522# CONFIG_SCSI_SATA is not set 536# CONFIG_SCSI_SATA is not set
537# CONFIG_SCSI_HPTIOP is not set
523# CONFIG_SCSI_DMX3191D is not set 538# CONFIG_SCSI_DMX3191D is not set
524# CONFIG_SCSI_FUTURE_DOMAIN is not set 539# CONFIG_SCSI_FUTURE_DOMAIN is not set
525# CONFIG_SCSI_IPS is not set 540# CONFIG_SCSI_IPS is not set
@@ -641,6 +656,7 @@ CONFIG_E1000_NAPI=y
641# CONFIG_CHELSIO_T1 is not set 656# CONFIG_CHELSIO_T1 is not set
642# CONFIG_IXGB is not set 657# CONFIG_IXGB is not set
643# CONFIG_S2IO is not set 658# CONFIG_S2IO is not set
659# CONFIG_MYRI10GE is not set
644 660
645# 661#
646# Token Ring devices 662# Token Ring devices
@@ -658,7 +674,6 @@ CONFIG_E1000_NAPI=y
658CONFIG_WAN=y 674CONFIG_WAN=y
659# CONFIG_DSCC4 is not set 675# CONFIG_DSCC4 is not set
660# CONFIG_LANMEDIA is not set 676# CONFIG_LANMEDIA is not set
661# CONFIG_SYNCLINK_SYNCPPP is not set
662CONFIG_HDLC=y 677CONFIG_HDLC=y
663CONFIG_HDLC_RAW=y 678CONFIG_HDLC_RAW=y
664# CONFIG_HDLC_RAW_ETH is not set 679# CONFIG_HDLC_RAW_ETH is not set
@@ -775,6 +790,7 @@ CONFIG_WATCHDOG=y
775# USB-based Watchdog Cards 790# USB-based Watchdog Cards
776# 791#
777# CONFIG_USBPCWATCHDOG is not set 792# CONFIG_USBPCWATCHDOG is not set
793# CONFIG_HW_RANDOM is not set
778# CONFIG_NVRAM is not set 794# CONFIG_NVRAM is not set
779# CONFIG_DTLK is not set 795# CONFIG_DTLK is not set
780# CONFIG_R3964 is not set 796# CONFIG_R3964 is not set
@@ -817,6 +833,7 @@ CONFIG_I2C_ALGOBIT=y
817# CONFIG_I2C_I810 is not set 833# CONFIG_I2C_I810 is not set
818# CONFIG_I2C_PIIX4 is not set 834# CONFIG_I2C_PIIX4 is not set
819# CONFIG_I2C_NFORCE2 is not set 835# CONFIG_I2C_NFORCE2 is not set
836# CONFIG_I2C_OCORES is not set
820# CONFIG_I2C_PARPORT_LIGHT is not set 837# CONFIG_I2C_PARPORT_LIGHT is not set
821# CONFIG_I2C_PROSAVAGE is not set 838# CONFIG_I2C_PROSAVAGE is not set
822# CONFIG_I2C_SAVAGE4 is not set 839# CONFIG_I2C_SAVAGE4 is not set
@@ -853,13 +870,13 @@ CONFIG_SENSORS_EEPROM=y
853# 870#
854# Dallas's 1-wire bus 871# Dallas's 1-wire bus
855# 872#
856# CONFIG_W1 is not set
857 873
858# 874#
859# Hardware Monitoring support 875# Hardware Monitoring support
860# 876#
861CONFIG_HWMON=y 877CONFIG_HWMON=y
862# CONFIG_HWMON_VID is not set 878# CONFIG_HWMON_VID is not set
879# CONFIG_SENSORS_ABITUGURU is not set
863# CONFIG_SENSORS_ADM1021 is not set 880# CONFIG_SENSORS_ADM1021 is not set
864# CONFIG_SENSORS_ADM1025 is not set 881# CONFIG_SENSORS_ADM1025 is not set
865# CONFIG_SENSORS_ADM1026 is not set 882# CONFIG_SENSORS_ADM1026 is not set
@@ -888,10 +905,12 @@ CONFIG_HWMON=y
888# CONFIG_SENSORS_PC87360 is not set 905# CONFIG_SENSORS_PC87360 is not set
889# CONFIG_SENSORS_SIS5595 is not set 906# CONFIG_SENSORS_SIS5595 is not set
890# CONFIG_SENSORS_SMSC47M1 is not set 907# CONFIG_SENSORS_SMSC47M1 is not set
908# CONFIG_SENSORS_SMSC47M192 is not set
891# CONFIG_SENSORS_SMSC47B397 is not set 909# CONFIG_SENSORS_SMSC47B397 is not set
892# CONFIG_SENSORS_VIA686A is not set 910# CONFIG_SENSORS_VIA686A is not set
893# CONFIG_SENSORS_VT8231 is not set 911# CONFIG_SENSORS_VT8231 is not set
894# CONFIG_SENSORS_W83781D is not set 912# CONFIG_SENSORS_W83781D is not set
913# CONFIG_SENSORS_W83791D is not set
895# CONFIG_SENSORS_W83792D is not set 914# CONFIG_SENSORS_W83792D is not set
896# CONFIG_SENSORS_W83L785TS is not set 915# CONFIG_SENSORS_W83L785TS is not set
897# CONFIG_SENSORS_W83627HF is not set 916# CONFIG_SENSORS_W83627HF is not set
@@ -919,6 +938,7 @@ CONFIG_HWMON=y
919# Multimedia devices 938# Multimedia devices
920# 939#
921# CONFIG_VIDEO_DEV is not set 940# CONFIG_VIDEO_DEV is not set
941CONFIG_VIDEO_V4L2=y
922 942
923# 943#
924# Digital Video Broadcasting Devices 944# Digital Video Broadcasting Devices
@@ -929,6 +949,7 @@ CONFIG_HWMON=y
929# 949#
930# Graphics support 950# Graphics support
931# 951#
952# CONFIG_FIRMWARE_EDID is not set
932# CONFIG_FB is not set 953# CONFIG_FB is not set
933 954
934# 955#
@@ -959,6 +980,7 @@ CONFIG_USB=y
959CONFIG_USB_EHCI_HCD=y 980CONFIG_USB_EHCI_HCD=y
960# CONFIG_USB_EHCI_SPLIT_ISO is not set 981# CONFIG_USB_EHCI_SPLIT_ISO is not set
961# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 982# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
983# CONFIG_USB_EHCI_TT_NEWSCHED is not set
962# CONFIG_USB_ISP116X_HCD is not set 984# CONFIG_USB_ISP116X_HCD is not set
963CONFIG_USB_OHCI_HCD=y 985CONFIG_USB_OHCI_HCD=y
964# CONFIG_USB_OHCI_BIG_ENDIAN is not set 986# CONFIG_USB_OHCI_BIG_ENDIAN is not set
@@ -1050,10 +1072,12 @@ CONFIG_USB_MON=y
1050# CONFIG_USB_LEGOTOWER is not set 1072# CONFIG_USB_LEGOTOWER is not set
1051# CONFIG_USB_LCD is not set 1073# CONFIG_USB_LCD is not set
1052# CONFIG_USB_LED is not set 1074# CONFIG_USB_LED is not set
1075# CONFIG_USB_CY7C63 is not set
1053# CONFIG_USB_CYTHERM is not set 1076# CONFIG_USB_CYTHERM is not set
1054# CONFIG_USB_PHIDGETKIT is not set 1077# CONFIG_USB_PHIDGETKIT is not set
1055# CONFIG_USB_PHIDGETSERVO is not set 1078# CONFIG_USB_PHIDGETSERVO is not set
1056# CONFIG_USB_IDMOUSE is not set 1079# CONFIG_USB_IDMOUSE is not set
1080# CONFIG_USB_APPLEDISPLAY is not set
1057# CONFIG_USB_SISUSBVGA is not set 1081# CONFIG_USB_SISUSBVGA is not set
1058# CONFIG_USB_LD is not set 1082# CONFIG_USB_LD is not set
1059 1083
@@ -1100,6 +1124,7 @@ CONFIG_FS_POSIX_ACL=y
1100# CONFIG_MINIX_FS is not set 1124# CONFIG_MINIX_FS is not set
1101# CONFIG_ROMFS_FS is not set 1125# CONFIG_ROMFS_FS is not set
1102CONFIG_INOTIFY=y 1126CONFIG_INOTIFY=y
1127CONFIG_INOTIFY_USER=y
1103# CONFIG_QUOTA is not set 1128# CONFIG_QUOTA is not set
1104CONFIG_DNOTIFY=y 1129CONFIG_DNOTIFY=y
1105# CONFIG_AUTOFS_FS is not set 1130# CONFIG_AUTOFS_FS is not set
@@ -1146,6 +1171,7 @@ CONFIG_JFFS2_FS=y
1146CONFIG_JFFS2_FS_DEBUG=0 1171CONFIG_JFFS2_FS_DEBUG=0
1147CONFIG_JFFS2_FS_WRITEBUFFER=y 1172CONFIG_JFFS2_FS_WRITEBUFFER=y
1148# CONFIG_JFFS2_SUMMARY is not set 1173# CONFIG_JFFS2_SUMMARY is not set
1174# CONFIG_JFFS2_FS_XATTR is not set
1149# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set 1175# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
1150CONFIG_JFFS2_ZLIB=y 1176CONFIG_JFFS2_ZLIB=y
1151CONFIG_JFFS2_RTIME=y 1177CONFIG_JFFS2_RTIME=y
@@ -1175,6 +1201,7 @@ CONFIG_SUNRPC=y
1175# CONFIG_RPCSEC_GSS_SPKM3 is not set 1201# CONFIG_RPCSEC_GSS_SPKM3 is not set
1176# CONFIG_SMB_FS is not set 1202# CONFIG_SMB_FS is not set
1177# CONFIG_CIFS is not set 1203# CONFIG_CIFS is not set
1204# CONFIG_CIFS_DEBUG2 is not set
1178# CONFIG_NCP_FS is not set 1205# CONFIG_NCP_FS is not set
1179# CONFIG_CODA_FS is not set 1206# CONFIG_CODA_FS is not set
1180# CONFIG_AFS_FS is not set 1207# CONFIG_AFS_FS is not set
@@ -1255,14 +1282,19 @@ CONFIG_NLS_CODEPAGE_437=y
1255# 1282#
1256# CONFIG_PRINTK_TIME is not set 1283# CONFIG_PRINTK_TIME is not set
1257CONFIG_MAGIC_SYSRQ=y 1284CONFIG_MAGIC_SYSRQ=y
1285# CONFIG_UNUSED_SYMBOLS is not set
1258CONFIG_DEBUG_KERNEL=y 1286CONFIG_DEBUG_KERNEL=y
1259CONFIG_LOG_BUF_SHIFT=14 1287CONFIG_LOG_BUF_SHIFT=14
1260CONFIG_DETECT_SOFTLOCKUP=y 1288CONFIG_DETECT_SOFTLOCKUP=y
1261# CONFIG_SCHEDSTATS is not set 1289# CONFIG_SCHEDSTATS is not set
1262# CONFIG_DEBUG_SLAB is not set 1290# CONFIG_DEBUG_SLAB is not set
1263CONFIG_DEBUG_MUTEXES=y 1291# CONFIG_DEBUG_RT_MUTEXES is not set
1292# CONFIG_RT_MUTEX_TESTER is not set
1264# CONFIG_DEBUG_SPINLOCK is not set 1293# CONFIG_DEBUG_SPINLOCK is not set
1294CONFIG_DEBUG_MUTEXES=y
1295# CONFIG_DEBUG_RWSEMS is not set
1265# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1296# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1297# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1266# CONFIG_DEBUG_KOBJECT is not set 1298# CONFIG_DEBUG_KOBJECT is not set
1267CONFIG_DEBUG_BUGVERBOSE=y 1299CONFIG_DEBUG_BUGVERBOSE=y
1268# CONFIG_DEBUG_INFO is not set 1300# CONFIG_DEBUG_INFO is not set
@@ -1302,3 +1334,4 @@ CONFIG_CRC32=y
1302# CONFIG_LIBCRC32C is not set 1334# CONFIG_LIBCRC32C is not set
1303CONFIG_ZLIB_INFLATE=y 1335CONFIG_ZLIB_INFLATE=y
1304CONFIG_ZLIB_DEFLATE=y 1336CONFIG_ZLIB_DEFLATE=y
1337CONFIG_PLIST=y
diff --git a/arch/arm/configs/lpd270_defconfig b/arch/arm/configs/lpd270_defconfig
index d08bbe59483a..4b29e099640d 100644
--- a/arch/arm/configs/lpd270_defconfig
+++ b/arch/arm/configs/lpd270_defconfig
@@ -1,15 +1,19 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-git2 3# Linux kernel version: 2.6.18-rc1
4# Wed Jun 21 22:20:18 2006 4# Sun Jul 9 14:15:23 2006
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_MMU=y 7CONFIG_MMU=y
8CONFIG_GENERIC_HARDIRQS=y
9CONFIG_HARDIRQS_SW_RESEND=y
10CONFIG_GENERIC_IRQ_PROBE=y
8CONFIG_RWSEM_GENERIC_SPINLOCK=y 11CONFIG_RWSEM_GENERIC_SPINLOCK=y
9CONFIG_GENERIC_HWEIGHT=y 12CONFIG_GENERIC_HWEIGHT=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y 13CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_ARCH_MTD_XIP=y 14CONFIG_ARCH_MTD_XIP=y
12CONFIG_VECTORS_BASE=0xffff0000 15CONFIG_VECTORS_BASE=0xffff0000
16CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
13 17
14# 18#
15# Code maturity level options 19# Code maturity level options
@@ -43,10 +47,12 @@ CONFIG_PRINTK=y
43CONFIG_BUG=y 47CONFIG_BUG=y
44CONFIG_ELF_CORE=y 48CONFIG_ELF_CORE=y
45CONFIG_BASE_FULL=y 49CONFIG_BASE_FULL=y
50CONFIG_RT_MUTEXES=y
46CONFIG_FUTEX=y 51CONFIG_FUTEX=y
47CONFIG_EPOLL=y 52CONFIG_EPOLL=y
48CONFIG_SHMEM=y 53CONFIG_SHMEM=y
49CONFIG_SLAB=y 54CONFIG_SLAB=y
55CONFIG_VM_EVENT_COUNTERS=y
50# CONFIG_TINY_SHMEM is not set 56# CONFIG_TINY_SHMEM is not set
51CONFIG_BASE_SMALL=0 57CONFIG_BASE_SMALL=0
52# CONFIG_SLOB is not set 58# CONFIG_SLOB is not set
@@ -85,7 +91,7 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
85# CONFIG_ARCH_INTEGRATOR is not set 91# CONFIG_ARCH_INTEGRATOR is not set
86# CONFIG_ARCH_REALVIEW is not set 92# CONFIG_ARCH_REALVIEW is not set
87# CONFIG_ARCH_VERSATILE is not set 93# CONFIG_ARCH_VERSATILE is not set
88# CONFIG_ARCH_AT91RM9200 is not set 94# CONFIG_ARCH_AT91 is not set
89# CONFIG_ARCH_CLPS7500 is not set 95# CONFIG_ARCH_CLPS7500 is not set
90# CONFIG_ARCH_CLPS711X is not set 96# CONFIG_ARCH_CLPS711X is not set
91# CONFIG_ARCH_CO285 is not set 97# CONFIG_ARCH_CO285 is not set
@@ -117,6 +123,7 @@ CONFIG_MACH_LOGICPD_PXA270=y
117# CONFIG_MACH_MAINSTONE is not set 123# CONFIG_MACH_MAINSTONE is not set
118# CONFIG_ARCH_PXA_IDP is not set 124# CONFIG_ARCH_PXA_IDP is not set
119# CONFIG_PXA_SHARPSL is not set 125# CONFIG_PXA_SHARPSL is not set
126# CONFIG_MACH_TRIZEPS4 is not set
120CONFIG_PXA27x=y 127CONFIG_PXA27x=y
121CONFIG_IWMMXT=y 128CONFIG_IWMMXT=y
122 129
@@ -161,6 +168,7 @@ CONFIG_FLATMEM=y
161CONFIG_FLAT_NODE_MEM_MAP=y 168CONFIG_FLAT_NODE_MEM_MAP=y
162# CONFIG_SPARSEMEM_STATIC is not set 169# CONFIG_SPARSEMEM_STATIC is not set
163CONFIG_SPLIT_PTLOCK_CPUS=4096 170CONFIG_SPLIT_PTLOCK_CPUS=4096
171# CONFIG_RESOURCES_64BIT is not set
164CONFIG_ALIGNMENT_TRAP=y 172CONFIG_ALIGNMENT_TRAP=y
165 173
166# 174#
@@ -194,8 +202,6 @@ CONFIG_BINFMT_ELF=y
194# Power management options 202# Power management options
195# 203#
196# CONFIG_PM is not set 204# CONFIG_PM is not set
197# CONFIG_PM_LEGACY is not set
198# CONFIG_PM_DEBUG is not set
199# CONFIG_APM is not set 205# CONFIG_APM is not set
200 206
201# 207#
@@ -293,6 +299,7 @@ CONFIG_STANDALONE=y
293CONFIG_PREVENT_FIRMWARE_BUILD=y 299CONFIG_PREVENT_FIRMWARE_BUILD=y
294# CONFIG_FW_LOADER is not set 300# CONFIG_FW_LOADER is not set
295# CONFIG_DEBUG_DRIVER is not set 301# CONFIG_DEBUG_DRIVER is not set
302# CONFIG_SYS_HYPERVISOR is not set
296 303
297# 304#
298# Connector - unified userspace <-> kernelspace linker 305# Connector - unified userspace <-> kernelspace linker
@@ -561,6 +568,7 @@ CONFIG_SERIO_LIBPS2=y
561CONFIG_VT=y 568CONFIG_VT=y
562CONFIG_VT_CONSOLE=y 569CONFIG_VT_CONSOLE=y
563CONFIG_HW_CONSOLE=y 570CONFIG_HW_CONSOLE=y
571# CONFIG_VT_HW_CONSOLE_BINDING is not set
564# CONFIG_SERIAL_NONSTANDARD is not set 572# CONFIG_SERIAL_NONSTANDARD is not set
565 573
566# 574#
@@ -588,6 +596,7 @@ CONFIG_LEGACY_PTY_COUNT=256
588# Watchdog Cards 596# Watchdog Cards
589# 597#
590# CONFIG_WATCHDOG is not set 598# CONFIG_WATCHDOG is not set
599# CONFIG_HW_RANDOM is not set
591# CONFIG_NVRAM is not set 600# CONFIG_NVRAM is not set
592# CONFIG_DTLK is not set 601# CONFIG_DTLK is not set
593# CONFIG_R3964 is not set 602# CONFIG_R3964 is not set
@@ -617,13 +626,13 @@ CONFIG_LEGACY_PTY_COUNT=256
617# 626#
618# Dallas's 1-wire bus 627# Dallas's 1-wire bus
619# 628#
620# CONFIG_W1 is not set
621 629
622# 630#
623# Hardware Monitoring support 631# Hardware Monitoring support
624# 632#
625CONFIG_HWMON=y 633CONFIG_HWMON=y
626# CONFIG_HWMON_VID is not set 634# CONFIG_HWMON_VID is not set
635# CONFIG_SENSORS_ABITUGURU is not set
627# CONFIG_SENSORS_F71805F is not set 636# CONFIG_SENSORS_F71805F is not set
628# CONFIG_HWMON_DEBUG_CHIP is not set 637# CONFIG_HWMON_DEBUG_CHIP is not set
629 638
@@ -658,12 +667,13 @@ CONFIG_VIDEO_V4L2=y
658# 667#
659# Graphics support 668# Graphics support
660# 669#
670# CONFIG_FIRMWARE_EDID is not set
661CONFIG_FB=y 671CONFIG_FB=y
662CONFIG_FB_CFB_FILLRECT=y 672CONFIG_FB_CFB_FILLRECT=y
663CONFIG_FB_CFB_COPYAREA=y 673CONFIG_FB_CFB_COPYAREA=y
664CONFIG_FB_CFB_IMAGEBLIT=y 674CONFIG_FB_CFB_IMAGEBLIT=y
665# CONFIG_FB_MACMODES is not set 675# CONFIG_FB_MACMODES is not set
666CONFIG_FB_FIRMWARE_EDID=y 676# CONFIG_FB_BACKLIGHT is not set
667# CONFIG_FB_MODE_HELPERS is not set 677# CONFIG_FB_MODE_HELPERS is not set
668# CONFIG_FB_TILEBLITTING is not set 678# CONFIG_FB_TILEBLITTING is not set
669# CONFIG_FB_S1D13XXX is not set 679# CONFIG_FB_S1D13XXX is not set
@@ -822,6 +832,7 @@ CONFIG_JFFS2_FS=y
822CONFIG_JFFS2_FS_DEBUG=0 832CONFIG_JFFS2_FS_DEBUG=0
823CONFIG_JFFS2_FS_WRITEBUFFER=y 833CONFIG_JFFS2_FS_WRITEBUFFER=y
824# CONFIG_JFFS2_SUMMARY is not set 834# CONFIG_JFFS2_SUMMARY is not set
835# CONFIG_JFFS2_FS_XATTR is not set
825# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set 836# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
826CONFIG_JFFS2_ZLIB=y 837CONFIG_JFFS2_ZLIB=y
827CONFIG_JFFS2_RTIME=y 838CONFIG_JFFS2_RTIME=y
@@ -849,6 +860,7 @@ CONFIG_SUNRPC=y
849# CONFIG_RPCSEC_GSS_SPKM3 is not set 860# CONFIG_RPCSEC_GSS_SPKM3 is not set
850# CONFIG_SMB_FS is not set 861# CONFIG_SMB_FS is not set
851# CONFIG_CIFS is not set 862# CONFIG_CIFS is not set
863# CONFIG_CIFS_DEBUG2 is not set
852# CONFIG_NCP_FS is not set 864# CONFIG_NCP_FS is not set
853# CONFIG_CODA_FS is not set 865# CONFIG_CODA_FS is not set
854# CONFIG_AFS_FS is not set 866# CONFIG_AFS_FS is not set
@@ -914,14 +926,19 @@ CONFIG_NLS_ISO8859_1=y
914# 926#
915# CONFIG_PRINTK_TIME is not set 927# CONFIG_PRINTK_TIME is not set
916CONFIG_MAGIC_SYSRQ=y 928CONFIG_MAGIC_SYSRQ=y
929# CONFIG_UNUSED_SYMBOLS is not set
917CONFIG_DEBUG_KERNEL=y 930CONFIG_DEBUG_KERNEL=y
918CONFIG_LOG_BUF_SHIFT=14 931CONFIG_LOG_BUF_SHIFT=14
919CONFIG_DETECT_SOFTLOCKUP=y 932CONFIG_DETECT_SOFTLOCKUP=y
920# CONFIG_SCHEDSTATS is not set 933# CONFIG_SCHEDSTATS is not set
921# CONFIG_DEBUG_SLAB is not set 934# CONFIG_DEBUG_SLAB is not set
922# CONFIG_DEBUG_MUTEXES is not set 935# CONFIG_DEBUG_RT_MUTEXES is not set
936# CONFIG_RT_MUTEX_TESTER is not set
923# CONFIG_DEBUG_SPINLOCK is not set 937# CONFIG_DEBUG_SPINLOCK is not set
938# CONFIG_DEBUG_MUTEXES is not set
939# CONFIG_DEBUG_RWSEMS is not set
924# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 940# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
941# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
925# CONFIG_DEBUG_KOBJECT is not set 942# CONFIG_DEBUG_KOBJECT is not set
926CONFIG_DEBUG_BUGVERBOSE=y 943CONFIG_DEBUG_BUGVERBOSE=y
927CONFIG_DEBUG_INFO=y 944CONFIG_DEBUG_INFO=y
@@ -961,3 +978,4 @@ CONFIG_CRC32=y
961# CONFIG_LIBCRC32C is not set 978# CONFIG_LIBCRC32C is not set
962CONFIG_ZLIB_INFLATE=y 979CONFIG_ZLIB_INFLATE=y
963CONFIG_ZLIB_DEFLATE=y 980CONFIG_ZLIB_DEFLATE=y
981CONFIG_PLIST=y
diff --git a/arch/arm/configs/onearm_defconfig b/arch/arm/configs/onearm_defconfig
index 2b4a63be03f7..6a93e3aae106 100644
--- a/arch/arm/configs/onearm_defconfig
+++ b/arch/arm/configs/onearm_defconfig
@@ -1,14 +1,18 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-git10 3# Linux kernel version: 2.6.18-rc1
4# Mon Jun 26 13:45:44 2006 4# Sun Jul 9 14:16:20 2006
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_MMU=y 7CONFIG_MMU=y
8CONFIG_GENERIC_HARDIRQS=y
9CONFIG_HARDIRQS_SW_RESEND=y
10CONFIG_GENERIC_IRQ_PROBE=y
8CONFIG_RWSEM_GENERIC_SPINLOCK=y 11CONFIG_RWSEM_GENERIC_SPINLOCK=y
9CONFIG_GENERIC_HWEIGHT=y 12CONFIG_GENERIC_HWEIGHT=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y 13CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_VECTORS_BASE=0xffff0000 14CONFIG_VECTORS_BASE=0xffff0000
15CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
12 16
13# 17#
14# Code maturity level options 18# Code maturity level options
@@ -42,10 +46,12 @@ CONFIG_PRINTK=y
42CONFIG_BUG=y 46CONFIG_BUG=y
43CONFIG_ELF_CORE=y 47CONFIG_ELF_CORE=y
44CONFIG_BASE_FULL=y 48CONFIG_BASE_FULL=y
49CONFIG_RT_MUTEXES=y
45CONFIG_FUTEX=y 50CONFIG_FUTEX=y
46CONFIG_EPOLL=y 51CONFIG_EPOLL=y
47CONFIG_SHMEM=y 52CONFIG_SHMEM=y
48CONFIG_SLAB=y 53CONFIG_SLAB=y
54CONFIG_VM_EVENT_COUNTERS=y
49# CONFIG_TINY_SHMEM is not set 55# CONFIG_TINY_SHMEM is not set
50CONFIG_BASE_SMALL=0 56CONFIG_BASE_SMALL=0
51# CONFIG_SLOB is not set 57# CONFIG_SLOB is not set
@@ -86,7 +92,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
86# CONFIG_ARCH_REALVIEW is not set 92# CONFIG_ARCH_REALVIEW is not set
87# CONFIG_ARCH_VERSATILE is not set 93# CONFIG_ARCH_VERSATILE is not set
88CONFIG_ARCH_AT91=y 94CONFIG_ARCH_AT91=y
89CONFIG_ARCH_AT91RM9200=y
90# CONFIG_ARCH_CLPS7500 is not set 95# CONFIG_ARCH_CLPS7500 is not set
91# CONFIG_ARCH_CLPS711X is not set 96# CONFIG_ARCH_CLPS711X is not set
92# CONFIG_ARCH_CO285 is not set 97# CONFIG_ARCH_CO285 is not set
@@ -111,8 +116,15 @@ CONFIG_ARCH_AT91RM9200=y
111# CONFIG_ARCH_OMAP is not set 116# CONFIG_ARCH_OMAP is not set
112 117
113# 118#
114# AT91RM9200 Implementations 119# Atmel AT91 System-on-Chip
120#
121
115# 122#
123# Atmel AT91 Processors
124#
125CONFIG_ARCH_AT91RM9200=y
126# CONFIG_ARCH_AT91SAM9260 is not set
127# CONFIG_ARCH_AT91SAM9261 is not set
116 128
117# 129#
118# AT91RM9200 Board Type 130# AT91RM9200 Board Type
@@ -123,12 +135,12 @@ CONFIG_MACH_ONEARM=y
123# CONFIG_MACH_CSB337 is not set 135# CONFIG_MACH_CSB337 is not set
124# CONFIG_MACH_CSB637 is not set 136# CONFIG_MACH_CSB637 is not set
125# CONFIG_MACH_CARMEVA is not set 137# CONFIG_MACH_CARMEVA is not set
126# CONFIG_MACH_KB9200 is not set
127# CONFIG_MACH_ATEB9200 is not set 138# CONFIG_MACH_ATEB9200 is not set
139# CONFIG_MACH_KB9200 is not set
128# CONFIG_MACH_KAFA is not set 140# CONFIG_MACH_KAFA is not set
129 141
130# 142#
131# AT91RM9200 Feature Selections 143# AT91 Feature Selections
132# 144#
133CONFIG_AT91_PROGRAMMABLE_CLOCKS=y 145CONFIG_AT91_PROGRAMMABLE_CLOCKS=y
134 146
@@ -186,6 +198,7 @@ CONFIG_FLATMEM=y
186CONFIG_FLAT_NODE_MEM_MAP=y 198CONFIG_FLAT_NODE_MEM_MAP=y
187# CONFIG_SPARSEMEM_STATIC is not set 199# CONFIG_SPARSEMEM_STATIC is not set
188CONFIG_SPLIT_PTLOCK_CPUS=4096 200CONFIG_SPLIT_PTLOCK_CPUS=4096
201# CONFIG_RESOURCES_64BIT is not set
189CONFIG_LEDS=y 202CONFIG_LEDS=y
190CONFIG_LEDS_TIMER=y 203CONFIG_LEDS_TIMER=y
191# CONFIG_LEDS_CPU is not set 204# CONFIG_LEDS_CPU is not set
@@ -600,6 +613,7 @@ CONFIG_AT91_WATCHDOG=y
600# USB-based Watchdog Cards 613# USB-based Watchdog Cards
601# 614#
602# CONFIG_USBPCWATCHDOG is not set 615# CONFIG_USBPCWATCHDOG is not set
616# CONFIG_HW_RANDOM is not set
603# CONFIG_NVRAM is not set 617# CONFIG_NVRAM is not set
604# CONFIG_DTLK is not set 618# CONFIG_DTLK is not set
605# CONFIG_R3964 is not set 619# CONFIG_R3964 is not set
@@ -743,6 +757,7 @@ CONFIG_VIDEO_V4L2=y
743# 757#
744# Graphics support 758# Graphics support
745# 759#
760# CONFIG_FIRMWARE_EDID is not set
746# CONFIG_FB is not set 761# CONFIG_FB is not set
747 762
748# 763#
@@ -980,6 +995,7 @@ CONFIG_SUNRPC=y
980# CONFIG_RPCSEC_GSS_SPKM3 is not set 995# CONFIG_RPCSEC_GSS_SPKM3 is not set
981# CONFIG_SMB_FS is not set 996# CONFIG_SMB_FS is not set
982# CONFIG_CIFS is not set 997# CONFIG_CIFS is not set
998# CONFIG_CIFS_DEBUG2 is not set
983# CONFIG_NCP_FS is not set 999# CONFIG_NCP_FS is not set
984# CONFIG_CODA_FS is not set 1000# CONFIG_CODA_FS is not set
985# CONFIG_AFS_FS is not set 1001# CONFIG_AFS_FS is not set
@@ -1006,14 +1022,19 @@ CONFIG_MSDOS_PARTITION=y
1006# 1022#
1007# CONFIG_PRINTK_TIME is not set 1023# CONFIG_PRINTK_TIME is not set
1008# CONFIG_MAGIC_SYSRQ is not set 1024# CONFIG_MAGIC_SYSRQ is not set
1025# CONFIG_UNUSED_SYMBOLS is not set
1009CONFIG_DEBUG_KERNEL=y 1026CONFIG_DEBUG_KERNEL=y
1010CONFIG_LOG_BUF_SHIFT=14 1027CONFIG_LOG_BUF_SHIFT=14
1011CONFIG_DETECT_SOFTLOCKUP=y 1028CONFIG_DETECT_SOFTLOCKUP=y
1012# CONFIG_SCHEDSTATS is not set 1029# CONFIG_SCHEDSTATS is not set
1013# CONFIG_DEBUG_SLAB is not set 1030# CONFIG_DEBUG_SLAB is not set
1014# CONFIG_DEBUG_MUTEXES is not set 1031# CONFIG_DEBUG_RT_MUTEXES is not set
1032# CONFIG_RT_MUTEX_TESTER is not set
1015# CONFIG_DEBUG_SPINLOCK is not set 1033# CONFIG_DEBUG_SPINLOCK is not set
1034# CONFIG_DEBUG_MUTEXES is not set
1035# CONFIG_DEBUG_RWSEMS is not set
1016# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1036# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1037# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1017# CONFIG_DEBUG_KOBJECT is not set 1038# CONFIG_DEBUG_KOBJECT is not set
1018CONFIG_DEBUG_BUGVERBOSE=y 1039CONFIG_DEBUG_BUGVERBOSE=y
1019# CONFIG_DEBUG_INFO is not set 1040# CONFIG_DEBUG_INFO is not set
@@ -1052,3 +1073,4 @@ CONFIG_DEBUG_LL=y
1052CONFIG_CRC32=y 1073CONFIG_CRC32=y
1053# CONFIG_LIBCRC32C is not set 1074# CONFIG_LIBCRC32C is not set
1054CONFIG_ZLIB_INFLATE=y 1075CONFIG_ZLIB_INFLATE=y
1076CONFIG_PLIST=y
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index 964faac104fb..240c448ec31c 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -370,17 +370,6 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus)
370 features &= ~(PCI_COMMAND_SERR | PCI_COMMAND_PARITY); 370 features &= ~(PCI_COMMAND_SERR | PCI_COMMAND_PARITY);
371 371
372 switch (dev->class >> 8) { 372 switch (dev->class >> 8) {
373#if defined(CONFIG_ISA) || defined(CONFIG_EISA)
374 case PCI_CLASS_BRIDGE_ISA:
375 case PCI_CLASS_BRIDGE_EISA:
376 /*
377 * If this device is an ISA bridge, set isa_bridge
378 * to point at this device. We will then go looking
379 * for things like keyboard, etc.
380 */
381 isa_bridge = dev;
382 break;
383#endif
384 case PCI_CLASS_BRIDGE_PCI: 373 case PCI_CLASS_BRIDGE_PCI:
385 pci_read_config_word(dev, PCI_BRIDGE_CONTROL, &status); 374 pci_read_config_word(dev, PCI_BRIDGE_CONTROL, &status);
386 status |= PCI_BRIDGE_CTL_PARITY|PCI_BRIDGE_CTL_MASTER_ABORT; 375 status |= PCI_BRIDGE_CTL_PARITY|PCI_BRIDGE_CTL_MASTER_ABORT;
diff --git a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c
index b9a74a741d00..eca248d9eba4 100644
--- a/arch/arm/kernel/ecard.c
+++ b/arch/arm/kernel/ecard.c
@@ -470,7 +470,8 @@ static void ecard_irq_mask(unsigned int irqnr)
470 } 470 }
471} 471}
472 472
473static struct irqchip ecard_chip = { 473static struct irq_chip ecard_chip = {
474 .name = "ECARD",
474 .ack = ecard_irq_mask, 475 .ack = ecard_irq_mask,
475 .mask = ecard_irq_mask, 476 .mask = ecard_irq_mask,
476 .unmask = ecard_irq_unmask, 477 .unmask = ecard_irq_unmask,
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 2242f5f7cb7d..4fe386eea4b4 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -114,9 +114,9 @@ ENTRY(secondary_startup)
114 * Use the page tables supplied from __cpu_up. 114 * Use the page tables supplied from __cpu_up.
115 */ 115 */
116 adr r4, __secondary_data 116 adr r4, __secondary_data
117 ldmia r4, {r5, r6, r13} @ address to jump to after 117 ldmia r4, {r5, r7, r13} @ address to jump to after
118 sub r4, r4, r5 @ mmu has been enabled 118 sub r4, r4, r5 @ mmu has been enabled
119 ldr r4, [r6, r4] @ get secondary_data.pgdir 119 ldr r4, [r7, r4] @ get secondary_data.pgdir
120 adr lr, __enable_mmu @ return address 120 adr lr, __enable_mmu @ return address
121 add pc, r10, #12 @ initialise processor 121 add pc, r10, #12 @ initialise processor
122 @ (return control reg) 122 @ (return control reg)
@@ -125,7 +125,7 @@ ENTRY(secondary_startup)
125 * r6 = &secondary_data 125 * r6 = &secondary_data
126 */ 126 */
127ENTRY(__secondary_switched) 127ENTRY(__secondary_switched)
128 ldr sp, [r6, #4] @ get secondary_data.stack 128 ldr sp, [r7, #4] @ get secondary_data.stack
129 mov fp, #0 129 mov fp, #0
130 b secondary_start_kernel 130 b secondary_start_kernel
131 131
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index c3d4e94ef5bf..2e1bf830fe11 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -77,6 +77,7 @@ int show_interrupts(struct seq_file *p, void *v)
77 seq_printf(p, "%3d: ", i); 77 seq_printf(p, "%3d: ", i);
78 for_each_present_cpu(cpu) 78 for_each_present_cpu(cpu)
79 seq_printf(p, "%10u ", kstat_cpu(cpu).irqs[i]); 79 seq_printf(p, "%10u ", kstat_cpu(cpu).irqs[i]);
80 seq_printf(p, " %10s", irq_desc[i].chip->name ? : "-");
80 seq_printf(p, " %s", action->name); 81 seq_printf(p, " %s", action->name);
81 for (action = action->next; action; action = action->next) 82 for (action = action->next; action; action = action->next)
82 seq_printf(p, ", %s", action->name); 83 seq_printf(p, ", %s", action->name);
@@ -167,6 +168,16 @@ void __init init_IRQ(void)
167} 168}
168 169
169#ifdef CONFIG_HOTPLUG_CPU 170#ifdef CONFIG_HOTPLUG_CPU
171
172static void route_irq(struct irqdesc *desc, unsigned int irq, unsigned int cpu)
173{
174 pr_debug("IRQ%u: moving from cpu%u to cpu%u\n", irq, desc->cpu, cpu);
175
176 spin_lock_irq(&desc->lock);
177 desc->chip->set_affinity(irq, cpumask_of_cpu(cpu));
178 spin_unlock_irq(&desc->lock);
179}
180
170/* 181/*
171 * The CPU has been marked offline. Migrate IRQs off this CPU. If 182 * The CPU has been marked offline. Migrate IRQs off this CPU. If
172 * the affinity settings do not allow other CPUs, force them onto any 183 * the affinity settings do not allow other CPUs, force them onto any
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index ed1c4d62d999..0a722e77c143 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -17,7 +17,7 @@
17#include <linux/console.h> 17#include <linux/console.h>
18#include <linux/bootmem.h> 18#include <linux/bootmem.h>
19#include <linux/seq_file.h> 19#include <linux/seq_file.h>
20#include <linux/tty.h> 20#include <linux/screen_info.h>
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/root_dev.h> 22#include <linux/root_dev.h>
23#include <linux/cpu.h> 23#include <linux/cpu.h>
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 35a052fc177a..4e29dd03e582 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -232,11 +232,8 @@ NORET_TYPE void die(const char *str, struct pt_regs *regs, int err)
232 bust_spinlocks(0); 232 bust_spinlocks(0);
233 spin_unlock_irq(&die_lock); 233 spin_unlock_irq(&die_lock);
234 234
235 if (panic_on_oops) { 235 if (panic_on_oops)
236 printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n"); 236 panic("Fatal exception: panic_on_oops");
237 ssleep(5);
238 panic("Fatal exception");
239 }
240 237
241 do_exit(SIGSEGV); 238 do_exit(SIGSEGV);
242} 239}
diff --git a/arch/arm/mach-at91rm9200/at91rm9200.c b/arch/arm/mach-at91rm9200/at91rm9200.c
index 7e1d072bdd80..0985b1c42c7c 100644
--- a/arch/arm/mach-at91rm9200/at91rm9200.c
+++ b/arch/arm/mach-at91rm9200/at91rm9200.c
@@ -107,3 +107,48 @@ void __init at91rm9200_map_io(void)
107 iotable_init(at91rm9200_io_desc, ARRAY_SIZE(at91rm9200_io_desc)); 107 iotable_init(at91rm9200_io_desc, ARRAY_SIZE(at91rm9200_io_desc));
108} 108}
109 109
110/*
111 * The default interrupt priority levels (0 = lowest, 7 = highest).
112 */
113static unsigned int at91rm9200_default_irq_priority[NR_AIC_IRQS] __initdata = {
114 7, /* Advanced Interrupt Controller (FIQ) */
115 7, /* System Peripherals */
116 0, /* Parallel IO Controller A */
117 0, /* Parallel IO Controller B */
118 0, /* Parallel IO Controller C */
119 0, /* Parallel IO Controller D */
120 6, /* USART 0 */
121 6, /* USART 1 */
122 6, /* USART 2 */
123 6, /* USART 3 */
124 0, /* Multimedia Card Interface */
125 4, /* USB Device Port */
126 0, /* Two-Wire Interface */
127 6, /* Serial Peripheral Interface */
128 5, /* Serial Synchronous Controller 0 */
129 5, /* Serial Synchronous Controller 1 */
130 5, /* Serial Synchronous Controller 2 */
131 0, /* Timer Counter 0 */
132 0, /* Timer Counter 1 */
133 0, /* Timer Counter 2 */
134 0, /* Timer Counter 3 */
135 0, /* Timer Counter 4 */
136 0, /* Timer Counter 5 */
137 3, /* USB Host port */
138 3, /* Ethernet MAC */
139 0, /* Advanced Interrupt Controller (IRQ0) */
140 0, /* Advanced Interrupt Controller (IRQ1) */
141 0, /* Advanced Interrupt Controller (IRQ2) */
142 0, /* Advanced Interrupt Controller (IRQ3) */
143 0, /* Advanced Interrupt Controller (IRQ4) */
144 0, /* Advanced Interrupt Controller (IRQ5) */
145 0 /* Advanced Interrupt Controller (IRQ6) */
146};
147
148void __init at91rm9200_init_irq(unsigned int priority[NR_AIC_IRQS])
149{
150 if (!priority)
151 priority = at91rm9200_default_irq_priority;
152
153 at91_aic_init(priority);
154}
diff --git a/arch/arm/mach-at91rm9200/generic.h b/arch/arm/mach-at91rm9200/generic.h
index f0d969d7d874..7979d8ab7e07 100644
--- a/arch/arm/mach-at91rm9200/generic.h
+++ b/arch/arm/mach-at91rm9200/generic.h
@@ -8,13 +8,19 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10 10
11void at91_gpio_irq_setup(unsigned banks); 11 /* Interrupts */
12extern void __init at91rm9200_init_irq(unsigned int priority[]);
13extern void __init at91_aic_init(unsigned int priority[]);
14extern void __init at91_gpio_irq_setup(unsigned banks);
12 15
16 /* Timer */
13struct sys_timer; 17struct sys_timer;
14extern struct sys_timer at91rm9200_timer; 18extern struct sys_timer at91rm9200_timer;
15 19
20 /* Memory Map */
16extern void __init at91rm9200_map_io(void); 21extern void __init at91rm9200_map_io(void);
17 22
23 /* Clocks */
18extern int __init at91_clock_init(unsigned long main_clock); 24extern int __init at91_clock_init(unsigned long main_clock);
19struct device; 25struct device;
20extern void __init at91_clock_associate(const char *id, struct device *dev, const char *func); 26extern void __init at91_clock_associate(const char *id, struct device *dev, const char *func);
diff --git a/arch/arm/mach-at91rm9200/gpio.c b/arch/arm/mach-at91rm9200/gpio.c
index 5783c282ae7b..cec199fd6721 100644
--- a/arch/arm/mach-at91rm9200/gpio.c
+++ b/arch/arm/mach-at91rm9200/gpio.c
@@ -327,7 +327,8 @@ static int gpio_irq_type(unsigned pin, unsigned type)
327 return (type == IRQT_BOTHEDGE) ? 0 : -EINVAL; 327 return (type == IRQT_BOTHEDGE) ? 0 : -EINVAL;
328} 328}
329 329
330static struct irqchip gpio_irqchip = { 330static struct irq_chip gpio_irqchip = {
331 .name = "GPIO",
331 .mask = gpio_irq_mask, 332 .mask = gpio_irq_mask,
332 .unmask = gpio_irq_unmask, 333 .unmask = gpio_irq_unmask,
333 .set_type = gpio_irq_type, 334 .set_type = gpio_irq_type,
diff --git a/arch/arm/mach-at91rm9200/irq.c b/arch/arm/mach-at91rm9200/irq.c
index dcd560dbcfb7..c3a5e777f9f8 100644
--- a/arch/arm/mach-at91rm9200/irq.c
+++ b/arch/arm/mach-at91rm9200/irq.c
@@ -36,58 +36,20 @@
36 36
37#include "generic.h" 37#include "generic.h"
38 38
39/*
40 * The default interrupt priority levels (0 = lowest, 7 = highest).
41 */
42static unsigned int at91rm9200_default_irq_priority[NR_AIC_IRQS] __initdata = {
43 7, /* Advanced Interrupt Controller */
44 7, /* System Peripheral */
45 0, /* Parallel IO Controller A */
46 0, /* Parallel IO Controller B */
47 0, /* Parallel IO Controller C */
48 0, /* Parallel IO Controller D */
49 6, /* USART 0 */
50 6, /* USART 1 */
51 6, /* USART 2 */
52 6, /* USART 3 */
53 0, /* Multimedia Card Interface */
54 4, /* USB Device Port */
55 0, /* Two-Wire Interface */
56 6, /* Serial Peripheral Interface */
57 5, /* Serial Synchronous Controller */
58 5, /* Serial Synchronous Controller */
59 5, /* Serial Synchronous Controller */
60 0, /* Timer Counter 0 */
61 0, /* Timer Counter 1 */
62 0, /* Timer Counter 2 */
63 0, /* Timer Counter 3 */
64 0, /* Timer Counter 4 */
65 0, /* Timer Counter 5 */
66 3, /* USB Host port */
67 3, /* Ethernet MAC */
68 0, /* Advanced Interrupt Controller */
69 0, /* Advanced Interrupt Controller */
70 0, /* Advanced Interrupt Controller */
71 0, /* Advanced Interrupt Controller */
72 0, /* Advanced Interrupt Controller */
73 0, /* Advanced Interrupt Controller */
74 0 /* Advanced Interrupt Controller */
75};
76 39
77 40static void at91_aic_mask_irq(unsigned int irq)
78static void at91rm9200_mask_irq(unsigned int irq)
79{ 41{
80 /* Disable interrupt on AIC */ 42 /* Disable interrupt on AIC */
81 at91_sys_write(AT91_AIC_IDCR, 1 << irq); 43 at91_sys_write(AT91_AIC_IDCR, 1 << irq);
82} 44}
83 45
84static void at91rm9200_unmask_irq(unsigned int irq) 46static void at91_aic_unmask_irq(unsigned int irq)
85{ 47{
86 /* Enable interrupt on AIC */ 48 /* Enable interrupt on AIC */
87 at91_sys_write(AT91_AIC_IECR, 1 << irq); 49 at91_sys_write(AT91_AIC_IECR, 1 << irq);
88} 50}
89 51
90static int at91rm9200_irq_type(unsigned irq, unsigned type) 52static int at91_aic_set_type(unsigned irq, unsigned type)
91{ 53{
92 unsigned int smr, srctype; 54 unsigned int smr, srctype;
93 55
@@ -122,7 +84,7 @@ static int at91rm9200_irq_type(unsigned irq, unsigned type)
122static u32 wakeups; 84static u32 wakeups;
123static u32 backups; 85static u32 backups;
124 86
125static int at91rm9200_irq_set_wake(unsigned irq, unsigned value) 87static int at91_aic_set_wake(unsigned irq, unsigned value)
126{ 88{
127 if (unlikely(irq >= 32)) 89 if (unlikely(irq >= 32))
128 return -EINVAL; 90 return -EINVAL;
@@ -149,28 +111,25 @@ void at91_irq_resume(void)
149} 111}
150 112
151#else 113#else
152#define at91rm9200_irq_set_wake NULL 114#define at91_aic_set_wake NULL
153#endif 115#endif
154 116
155static struct irqchip at91rm9200_irq_chip = { 117static struct irq_chip at91_aic_chip = {
156 .ack = at91rm9200_mask_irq, 118 .name = "AIC",
157 .mask = at91rm9200_mask_irq, 119 .ack = at91_aic_mask_irq,
158 .unmask = at91rm9200_unmask_irq, 120 .mask = at91_aic_mask_irq,
159 .set_type = at91rm9200_irq_type, 121 .unmask = at91_aic_unmask_irq,
160 .set_wake = at91rm9200_irq_set_wake, 122 .set_type = at91_aic_set_type,
123 .set_wake = at91_aic_set_wake,
161}; 124};
162 125
163/* 126/*
164 * Initialize the AIC interrupt controller. 127 * Initialize the AIC interrupt controller.
165 */ 128 */
166void __init at91rm9200_init_irq(unsigned int priority[NR_AIC_IRQS]) 129void __init at91_aic_init(unsigned int priority[NR_AIC_IRQS])
167{ 130{
168 unsigned int i; 131 unsigned int i;
169 132
170 /* No priority list specified for this board -> use defaults */
171 if (priority == NULL)
172 priority = at91rm9200_default_irq_priority;
173
174 /* 133 /*
175 * The IVR is used by macro get_irqnr_and_base to read and verify. 134 * The IVR is used by macro get_irqnr_and_base to read and verify.
176 * The irq number is NR_AIC_IRQS when a spurious interrupt has occurred. 135 * The irq number is NR_AIC_IRQS when a spurious interrupt has occurred.
@@ -178,10 +137,10 @@ void __init at91rm9200_init_irq(unsigned int priority[NR_AIC_IRQS])
178 for (i = 0; i < NR_AIC_IRQS; i++) { 137 for (i = 0; i < NR_AIC_IRQS; i++) {
179 /* Put irq number in Source Vector Register: */ 138 /* Put irq number in Source Vector Register: */
180 at91_sys_write(AT91_AIC_SVR(i), i); 139 at91_sys_write(AT91_AIC_SVR(i), i);
181 /* Store the Source Mode Register as defined in table above */ 140 /* Active Low interrupt, with the specified priority */
182 at91_sys_write(AT91_AIC_SMR(i), AT91_AIC_SRCTYPE_LOW | priority[i]); 141 at91_sys_write(AT91_AIC_SMR(i), AT91_AIC_SRCTYPE_LOW | priority[i]);
183 142
184 set_irq_chip(i, &at91rm9200_irq_chip); 143 set_irq_chip(i, &at91_aic_chip);
185 set_irq_handler(i, do_level_IRQ); 144 set_irq_handler(i, do_level_IRQ);
186 set_irq_flags(i, IRQF_VALID | IRQF_PROBE); 145 set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
187 146
diff --git a/arch/arm/mach-footbridge/cats-hw.c b/arch/arm/mach-footbridge/cats-hw.c
index 5b64d5c5b967..ef6ccc8993e9 100644
--- a/arch/arm/mach-footbridge/cats-hw.c
+++ b/arch/arm/mach-footbridge/cats-hw.c
@@ -8,7 +8,7 @@
8#include <linux/ioport.h> 8#include <linux/ioport.h>
9#include <linux/kernel.h> 9#include <linux/kernel.h>
10#include <linux/init.h> 10#include <linux/init.h>
11#include <linux/tty.h> 11#include <linux/screen_info.h>
12 12
13#include <asm/hardware/dec21285.h> 13#include <asm/hardware/dec21285.h>
14#include <asm/io.h> 14#include <asm/io.h>
diff --git a/arch/arm/mach-imx/irq.c b/arch/arm/mach-imx/irq.c
index a5de5f1da9f2..2688bd82c2a2 100644
--- a/arch/arm/mach-imx/irq.c
+++ b/arch/arm/mach-imx/irq.c
@@ -204,13 +204,15 @@ imx_gpiod_demux_handler(unsigned int irq_unused, struct irqdesc *desc,
204 imx_gpio_handler(mask, irq, desc, regs); 204 imx_gpio_handler(mask, irq, desc, regs);
205} 205}
206 206
207static struct irqchip imx_internal_chip = { 207static struct irq_chip imx_internal_chip = {
208 .name = "MPU",
208 .ack = imx_mask_irq, 209 .ack = imx_mask_irq,
209 .mask = imx_mask_irq, 210 .mask = imx_mask_irq,
210 .unmask = imx_unmask_irq, 211 .unmask = imx_unmask_irq,
211}; 212};
212 213
213static struct irqchip imx_gpio_chip = { 214static struct irq_chip imx_gpio_chip = {
215 .name = "GPIO",
214 .ack = imx_gpio_ack_irq, 216 .ack = imx_gpio_ack_irq,
215 .mask = imx_gpio_mask_irq, 217 .mask = imx_gpio_mask_irq,
216 .unmask = imx_gpio_unmask_irq, 218 .unmask = imx_gpio_unmask_irq,
diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c
index 6d65c96ebfd2..191c57a3b997 100644
--- a/arch/arm/mach-integrator/integrator_ap.c
+++ b/arch/arm/mach-integrator/integrator_ap.c
@@ -161,7 +161,8 @@ static void sc_unmask_irq(unsigned int irq)
161 writel(1 << irq, VA_IC_BASE + IRQ_ENABLE_SET); 161 writel(1 << irq, VA_IC_BASE + IRQ_ENABLE_SET);
162} 162}
163 163
164static struct irqchip sc_chip = { 164static struct irq_chip sc_chip = {
165 .name = "SC",
165 .ack = sc_mask_irq, 166 .ack = sc_mask_irq,
166 .mask = sc_mask_irq, 167 .mask = sc_mask_irq,
167 .unmask = sc_unmask_irq, 168 .unmask = sc_unmask_irq,
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index 9f55f5ae1044..678b6ba2b463 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -156,7 +156,8 @@ static void cic_unmask_irq(unsigned int irq)
156 cic_writel(1 << irq, INTCP_VA_CIC_BASE + IRQ_ENABLE_SET); 156 cic_writel(1 << irq, INTCP_VA_CIC_BASE + IRQ_ENABLE_SET);
157} 157}
158 158
159static struct irqchip cic_chip = { 159static struct irq_chip cic_chip = {
160 .name = "CIC",
160 .ack = cic_mask_irq, 161 .ack = cic_mask_irq,
161 .mask = cic_mask_irq, 162 .mask = cic_mask_irq,
162 .unmask = cic_unmask_irq, 163 .unmask = cic_unmask_irq,
@@ -174,7 +175,8 @@ static void pic_unmask_irq(unsigned int irq)
174 pic_writel(1 << irq, INTCP_VA_PIC_BASE + IRQ_ENABLE_SET); 175 pic_writel(1 << irq, INTCP_VA_PIC_BASE + IRQ_ENABLE_SET);
175} 176}
176 177
177static struct irqchip pic_chip = { 178static struct irq_chip pic_chip = {
179 .name = "PIC",
178 .ack = pic_mask_irq, 180 .ack = pic_mask_irq,
179 .mask = pic_mask_irq, 181 .mask = pic_mask_irq,
180 .unmask = pic_unmask_irq, 182 .unmask = pic_unmask_irq,
@@ -192,7 +194,8 @@ static void sic_unmask_irq(unsigned int irq)
192 sic_writel(1 << irq, INTCP_VA_SIC_BASE + IRQ_ENABLE_SET); 194 sic_writel(1 << irq, INTCP_VA_SIC_BASE + IRQ_ENABLE_SET);
193} 195}
194 196
195static struct irqchip sic_chip = { 197static struct irq_chip sic_chip = {
198 .name = "SIC",
196 .ack = sic_mask_irq, 199 .ack = sic_mask_irq,
197 .mask = sic_mask_irq, 200 .mask = sic_mask_irq,
198 .unmask = sic_unmask_irq, 201 .unmask = sic_unmask_irq,
diff --git a/arch/arm/mach-iop3xx/iop321-irq.c b/arch/arm/mach-iop3xx/iop321-irq.c
index d42aae6aef03..88ac333472c8 100644
--- a/arch/arm/mach-iop3xx/iop321-irq.c
+++ b/arch/arm/mach-iop3xx/iop321-irq.c
@@ -52,7 +52,8 @@ iop321_irq_unmask (unsigned int irq)
52 intctl_write(iop321_mask); 52 intctl_write(iop321_mask);
53} 53}
54 54
55struct irqchip ext_chip = { 55struct irq_chip ext_chip = {
56 .name = "IOP",
56 .ack = iop321_irq_mask, 57 .ack = iop321_irq_mask,
57 .mask = iop321_irq_mask, 58 .mask = iop321_irq_mask,
58 .unmask = iop321_irq_unmask, 59 .unmask = iop321_irq_unmask,
diff --git a/arch/arm/mach-iop3xx/iop331-irq.c b/arch/arm/mach-iop3xx/iop331-irq.c
index f4d4321737a4..cab11722ced2 100644
--- a/arch/arm/mach-iop3xx/iop331-irq.c
+++ b/arch/arm/mach-iop3xx/iop331-irq.c
@@ -77,13 +77,15 @@ iop331_irq_unmask2(unsigned int irq)
77 intctl_write1(iop331_mask1); 77 intctl_write1(iop331_mask1);
78} 78}
79 79
80struct irqchip iop331_irqchip1 = { 80struct irq_chip iop331_irqchip1 = {
81 .name = "IOP-1",
81 .ack = iop331_irq_mask1, 82 .ack = iop331_irq_mask1,
82 .mask = iop331_irq_mask1, 83 .mask = iop331_irq_mask1,
83 .unmask = iop331_irq_unmask1, 84 .unmask = iop331_irq_unmask1,
84}; 85};
85 86
86struct irqchip iop331_irqchip2 = { 87struct irq_chip iop331_irqchip2 = {
88 .name = "IOP-2",
87 .ack = iop331_irq_mask2, 89 .ack = iop331_irq_mask2,
88 .mask = iop331_irq_mask2, 90 .mask = iop331_irq_mask2,
89 .unmask = iop331_irq_unmask2, 91 .unmask = iop331_irq_unmask2,
diff --git a/arch/arm/mach-lh7a40x/arch-kev7a400.c b/arch/arm/mach-lh7a40x/arch-kev7a400.c
index 2cccc27c62e4..4f2ab48800a5 100644
--- a/arch/arm/mach-lh7a40x/arch-kev7a400.c
+++ b/arch/arm/mach-lh7a40x/arch-kev7a400.c
@@ -63,7 +63,8 @@ static void kev7a400_unmask_cpld_irq (u32 irq)
63 CPLD_WR_PB_INT_MASK = CPLD_IRQ_mask; 63 CPLD_WR_PB_INT_MASK = CPLD_IRQ_mask;
64} 64}
65 65
66static struct irqchip kev7a400_cpld_chip = { 66static struct irq_chip kev7a400_cpld_chip = {
67 .name = "CPLD",
67 .ack = kev7a400_ack_cpld_irq, 68 .ack = kev7a400_ack_cpld_irq,
68 .mask = kev7a400_mask_cpld_irq, 69 .mask = kev7a400_mask_cpld_irq,
69 .unmask = kev7a400_unmask_cpld_irq, 70 .unmask = kev7a400_unmask_cpld_irq,
diff --git a/arch/arm/mach-lh7a40x/arch-lpd7a40x.c b/arch/arm/mach-lh7a40x/arch-lpd7a40x.c
index 35c3606a2079..a6910114b24c 100644
--- a/arch/arm/mach-lh7a40x/arch-lpd7a40x.c
+++ b/arch/arm/mach-lh7a40x/arch-lpd7a40x.c
@@ -200,7 +200,8 @@ static void lh7a40x_unmask_cpld_irq (u32 irq)
200 } 200 }
201} 201}
202 202
203static struct irqchip lpd7a40x_cpld_chip = { 203static struct irq_chip lpd7a40x_cpld_chip = {
204 .name = "CPLD",
204 .ack = lh7a40x_ack_cpld_irq, 205 .ack = lh7a40x_ack_cpld_irq,
205 .mask = lh7a40x_mask_cpld_irq, 206 .mask = lh7a40x_mask_cpld_irq,
206 .unmask = lh7a40x_unmask_cpld_irq, 207 .unmask = lh7a40x_unmask_cpld_irq,
diff --git a/arch/arm/mach-lh7a40x/irq-kev7a400.c b/arch/arm/mach-lh7a40x/irq-kev7a400.c
index 8535764d89ca..f9b3fe9174a5 100644
--- a/arch/arm/mach-lh7a40x/irq-kev7a400.c
+++ b/arch/arm/mach-lh7a40x/irq-kev7a400.c
@@ -43,7 +43,8 @@ lh7a400_unmask_cpld_irq (u32 irq)
43} 43}
44 44
45static struct 45static struct
46irqchip lh7a400_cpld_chip = { 46irq_chip lh7a400_cpld_chip = {
47 .name = "CPLD",
47 .ack = lh7a400_ack_cpld_irq, 48 .ack = lh7a400_ack_cpld_irq,
48 .mask = lh7a400_mask_cpld_irq, 49 .mask = lh7a400_mask_cpld_irq,
49 .unmask = lh7a400_unmask_cpld_irq, 50 .unmask = lh7a400_unmask_cpld_irq,
diff --git a/arch/arm/mach-lh7a40x/irq-lh7a400.c b/arch/arm/mach-lh7a40x/irq-lh7a400.c
index f9fdefef6d6f..091b2dc58d25 100644
--- a/arch/arm/mach-lh7a40x/irq-lh7a400.c
+++ b/arch/arm/mach-lh7a40x/irq-lh7a400.c
@@ -38,13 +38,15 @@ static void lh7a400_ack_gpio_irq (u32 irq)
38 INTC_INTENC = (1 << irq); 38 INTC_INTENC = (1 << irq);
39} 39}
40 40
41static struct irqchip lh7a400_internal_chip = { 41static struct irq_chip lh7a400_internal_chip = {
42 .name = "MPU",
42 .ack = lh7a400_mask_irq, /* Level triggering -> mask is ack */ 43 .ack = lh7a400_mask_irq, /* Level triggering -> mask is ack */
43 .mask = lh7a400_mask_irq, 44 .mask = lh7a400_mask_irq,
44 .unmask = lh7a400_unmask_irq, 45 .unmask = lh7a400_unmask_irq,
45}; 46};
46 47
47static struct irqchip lh7a400_gpio_chip = { 48static struct irq_chip lh7a400_gpio_chip = {
49 .name = "GPIO",
48 .ack = lh7a400_ack_gpio_irq, 50 .ack = lh7a400_ack_gpio_irq,
49 .mask = lh7a400_mask_irq, 51 .mask = lh7a400_mask_irq,
50 .unmask = lh7a400_unmask_irq, 52 .unmask = lh7a400_unmask_irq,
diff --git a/arch/arm/mach-lh7a40x/irq-lh7a404.c b/arch/arm/mach-lh7a40x/irq-lh7a404.c
index 2685a81454d2..7059b983724f 100644
--- a/arch/arm/mach-lh7a40x/irq-lh7a404.c
+++ b/arch/arm/mach-lh7a40x/irq-lh7a404.c
@@ -76,25 +76,29 @@ static void lh7a404_vic2_ack_gpio_irq (u32 irq)
76 VIC2_INTENCLR = (1 << irq); 76 VIC2_INTENCLR = (1 << irq);
77} 77}
78 78
79static struct irqchip lh7a404_vic1_chip = { 79static struct irq_chip lh7a404_vic1_chip = {
80 .name = "VIC1",
80 .ack = lh7a404_vic1_mask_irq, /* Because level-triggered */ 81 .ack = lh7a404_vic1_mask_irq, /* Because level-triggered */
81 .mask = lh7a404_vic1_mask_irq, 82 .mask = lh7a404_vic1_mask_irq,
82 .unmask = lh7a404_vic1_unmask_irq, 83 .unmask = lh7a404_vic1_unmask_irq,
83}; 84};
84 85
85static struct irqchip lh7a404_vic2_chip = { 86static struct irq_chip lh7a404_vic2_chip = {
87 .name = "VIC2",
86 .ack = lh7a404_vic2_mask_irq, /* Because level-triggered */ 88 .ack = lh7a404_vic2_mask_irq, /* Because level-triggered */
87 .mask = lh7a404_vic2_mask_irq, 89 .mask = lh7a404_vic2_mask_irq,
88 .unmask = lh7a404_vic2_unmask_irq, 90 .unmask = lh7a404_vic2_unmask_irq,
89}; 91};
90 92
91static struct irqchip lh7a404_gpio_vic1_chip = { 93static struct irq_chip lh7a404_gpio_vic1_chip = {
94 .name = "GPIO-VIC1",
92 .ack = lh7a404_vic1_ack_gpio_irq, 95 .ack = lh7a404_vic1_ack_gpio_irq,
93 .mask = lh7a404_vic1_mask_irq, 96 .mask = lh7a404_vic1_mask_irq,
94 .unmask = lh7a404_vic1_unmask_irq, 97 .unmask = lh7a404_vic1_unmask_irq,
95}; 98};
96 99
97static struct irqchip lh7a404_gpio_vic2_chip = { 100static struct irq_chip lh7a404_gpio_vic2_chip = {
101 .name = "GPIO-VIC2",
98 .ack = lh7a404_vic2_ack_gpio_irq, 102 .ack = lh7a404_vic2_ack_gpio_irq,
99 .mask = lh7a404_vic2_mask_irq, 103 .mask = lh7a404_vic2_mask_irq,
100 .unmask = lh7a404_vic2_unmask_irq, 104 .unmask = lh7a404_vic2_unmask_irq,
diff --git a/arch/arm/mach-lh7a40x/irq-lpd7a40x.c b/arch/arm/mach-lh7a40x/irq-lpd7a40x.c
index dcb4e17b9419..d6055dde6468 100644
--- a/arch/arm/mach-lh7a40x/irq-lpd7a40x.c
+++ b/arch/arm/mach-lh7a40x/irq-lpd7a40x.c
@@ -50,7 +50,8 @@ static void lh7a40x_unmask_cpld_irq (u32 irq)
50 } 50 }
51} 51}
52 52
53static struct irqchip lh7a40x_cpld_chip = { 53static struct irq_chip lh7a40x_cpld_chip = {
54 .name = "CPLD",
54 .ack = lh7a40x_ack_cpld_irq, 55 .ack = lh7a40x_ack_cpld_irq,
55 .mask = lh7a40x_mask_cpld_irq, 56 .mask = lh7a40x_mask_cpld_irq,
56 .unmask = lh7a40x_unmask_cpld_irq, 57 .unmask = lh7a40x_unmask_cpld_irq,
diff --git a/arch/arm/mach-omap1/fpga.c b/arch/arm/mach-omap1/fpga.c
index 34eb79ee6e61..efe9bfc6e55f 100644
--- a/arch/arm/mach-omap1/fpga.c
+++ b/arch/arm/mach-omap1/fpga.c
@@ -106,14 +106,16 @@ void innovator_fpga_IRQ_demux(unsigned int irq, struct irqdesc *desc,
106 } 106 }
107} 107}
108 108
109static struct irqchip omap_fpga_irq_ack = { 109static struct irq_chip omap_fpga_irq_ack = {
110 .name = "FPGA-ack",
110 .ack = fpga_mask_ack_irq, 111 .ack = fpga_mask_ack_irq,
111 .mask = fpga_mask_irq, 112 .mask = fpga_mask_irq,
112 .unmask = fpga_unmask_irq, 113 .unmask = fpga_unmask_irq,
113}; 114};
114 115
115 116
116static struct irqchip omap_fpga_irq = { 117static struct irq_chip omap_fpga_irq = {
118 .name = "FPGA",
117 .ack = fpga_ack_irq, 119 .ack = fpga_ack_irq,
118 .mask = fpga_mask_irq, 120 .mask = fpga_mask_irq,
119 .unmask = fpga_unmask_irq, 121 .unmask = fpga_unmask_irq,
diff --git a/arch/arm/mach-omap1/irq.c b/arch/arm/mach-omap1/irq.c
index 9e039845b50e..3ea140bb9eba 100644
--- a/arch/arm/mach-omap1/irq.c
+++ b/arch/arm/mach-omap1/irq.c
@@ -168,7 +168,8 @@ static struct omap_irq_bank omap1610_irq_banks[] = {
168}; 168};
169#endif 169#endif
170 170
171static struct irqchip omap_irq_chip = { 171static struct irq_chip omap_irq_chip = {
172 .name = "MPU",
172 .ack = omap_mask_ack_irq, 173 .ack = omap_mask_ack_irq,
173 .mask = omap_mask_irq, 174 .mask = omap_mask_irq,
174 .unmask = omap_unmask_irq, 175 .unmask = omap_unmask_irq,
diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c
index 3eed6a737bf8..dfc3b35cc1ff 100644
--- a/arch/arm/mach-omap2/irq.c
+++ b/arch/arm/mach-omap2/irq.c
@@ -94,7 +94,8 @@ static void omap_mask_ack_irq(unsigned int irq)
94 omap_ack_irq(irq); 94 omap_ack_irq(irq);
95} 95}
96 96
97static struct irqchip omap_irq_chip = { 97static struct irq_chip omap_irq_chip = {
98 .name = "INTC",
98 .ack = omap_mask_ack_irq, 99 .ack = omap_mask_ack_irq,
99 .mask = omap_mask_irq, 100 .mask = omap_mask_irq,
100 .unmask = omap_unmask_irq, 101 .unmask = omap_unmask_irq,
diff --git a/arch/arm/mach-pnx4008/core.c b/arch/arm/mach-pnx4008/core.c
index ba91daad64fb..3d73c1e93752 100644
--- a/arch/arm/mach-pnx4008/core.c
+++ b/arch/arm/mach-pnx4008/core.c
@@ -27,7 +27,6 @@
27#include <linux/spi/spi.h> 27#include <linux/spi/spi.h>
28 28
29#include <asm/hardware.h> 29#include <asm/hardware.h>
30#include <asm/irq.h>
31#include <asm/io.h> 30#include <asm/io.h>
32#include <asm/setup.h> 31#include <asm/setup.h>
33#include <asm/mach-types.h> 32#include <asm/mach-types.h>
@@ -36,7 +35,6 @@
36#include <asm/system.h> 35#include <asm/system.h>
37 36
38#include <asm/mach/arch.h> 37#include <asm/mach/arch.h>
39#include <asm/mach/irq.h>
40#include <asm/mach/map.h> 38#include <asm/mach/map.h>
41#include <asm/mach/time.h> 39#include <asm/mach/time.h>
42 40
diff --git a/arch/arm/mach-pnx4008/dma.c b/arch/arm/mach-pnx4008/dma.c
index 981aa9dcdede..ec01574f88ac 100644
--- a/arch/arm/mach-pnx4008/dma.c
+++ b/arch/arm/mach-pnx4008/dma.c
@@ -23,7 +23,6 @@
23#include <linux/clk.h> 23#include <linux/clk.h>
24 24
25#include <asm/system.h> 25#include <asm/system.h>
26#include <asm/irq.h>
27#include <asm/hardware.h> 26#include <asm/hardware.h>
28#include <asm/dma.h> 27#include <asm/dma.h>
29#include <asm/dma-mapping.h> 28#include <asm/dma-mapping.h>
diff --git a/arch/arm/mach-pnx4008/irq.c b/arch/arm/mach-pnx4008/irq.c
index 9b0a8e084e99..3a4bcf3d91fa 100644
--- a/arch/arm/mach-pnx4008/irq.c
+++ b/arch/arm/mach-pnx4008/irq.c
@@ -22,8 +22,8 @@
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/ioport.h> 23#include <linux/ioport.h>
24#include <linux/device.h> 24#include <linux/device.h>
25#include <linux/irq.h>
25#include <asm/hardware.h> 26#include <asm/hardware.h>
26#include <asm/irq.h>
27#include <asm/io.h> 27#include <asm/io.h>
28#include <asm/setup.h> 28#include <asm/setup.h>
29#include <asm/mach-types.h> 29#include <asm/mach-types.h>
@@ -96,26 +96,24 @@ void __init pnx4008_init_irq(void)
96{ 96{
97 unsigned int i; 97 unsigned int i;
98 98
99 /* configure and enable IRQ 0,1,30,31 (cascade interrupts) mask all others */ 99 /* configure IRQ's */
100 for (i = 0; i < NR_IRQS; i++) {
101 set_irq_flags(i, IRQF_VALID);
102 set_irq_chip(i, &pnx4008_irq_chip);
103 pnx4008_set_irq_type(i, pnx4008_irq_type[i]);
104 }
105
106 /* configure and enable IRQ 0,1,30,31 (cascade interrupts) */
100 pnx4008_set_irq_type(SUB1_IRQ_N, pnx4008_irq_type[SUB1_IRQ_N]); 107 pnx4008_set_irq_type(SUB1_IRQ_N, pnx4008_irq_type[SUB1_IRQ_N]);
101 pnx4008_set_irq_type(SUB2_IRQ_N, pnx4008_irq_type[SUB2_IRQ_N]); 108 pnx4008_set_irq_type(SUB2_IRQ_N, pnx4008_irq_type[SUB2_IRQ_N]);
102 pnx4008_set_irq_type(SUB1_FIQ_N, pnx4008_irq_type[SUB1_FIQ_N]); 109 pnx4008_set_irq_type(SUB1_FIQ_N, pnx4008_irq_type[SUB1_FIQ_N]);
103 pnx4008_set_irq_type(SUB2_FIQ_N, pnx4008_irq_type[SUB2_FIQ_N]); 110 pnx4008_set_irq_type(SUB2_FIQ_N, pnx4008_irq_type[SUB2_FIQ_N]);
104 111
112 /* mask all others */
105 __raw_writel((1 << SUB2_FIQ_N) | (1 << SUB1_FIQ_N) | 113 __raw_writel((1 << SUB2_FIQ_N) | (1 << SUB1_FIQ_N) |
106 (1 << SUB2_IRQ_N) | (1 << SUB1_IRQ_N), 114 (1 << SUB2_IRQ_N) | (1 << SUB1_IRQ_N),
107 INTC_ER(MAIN_BASE_INT)); 115 INTC_ER(MAIN_BASE_INT));
108 __raw_writel(0, INTC_ER(SIC1_BASE_INT)); 116 __raw_writel(0, INTC_ER(SIC1_BASE_INT));
109 __raw_writel(0, INTC_ER(SIC2_BASE_INT)); 117 __raw_writel(0, INTC_ER(SIC2_BASE_INT));
110
111 /* configure all other IRQ's */
112 for (i = 0; i < NR_IRQS; i++) {
113 if (i == SUB2_FIQ_N || i == SUB1_FIQ_N ||
114 i == SUB2_IRQ_N || i == SUB1_IRQ_N)
115 continue;
116 set_irq_flags(i, IRQF_VALID);
117 set_irq_chip(i, &pnx4008_irq_chip);
118 pnx4008_set_irq_type(i, pnx4008_irq_type[i]);
119 }
120} 118}
121 119
diff --git a/arch/arm/mach-pnx4008/time.c b/arch/arm/mach-pnx4008/time.c
index 888bf6cfba8a..756228ddd035 100644
--- a/arch/arm/mach-pnx4008/time.c
+++ b/arch/arm/mach-pnx4008/time.c
@@ -20,17 +20,15 @@
20#include <linux/spinlock.h> 20#include <linux/spinlock.h>
21#include <linux/module.h> 21#include <linux/module.h>
22#include <linux/kallsyms.h> 22#include <linux/kallsyms.h>
23#include <linux/time.h>
24#include <linux/timex.h>
25#include <linux/irq.h>
23 26
24#include <asm/system.h> 27#include <asm/system.h>
25#include <asm/hardware.h> 28#include <asm/hardware.h>
26#include <asm/io.h> 29#include <asm/io.h>
27#include <asm/leds.h> 30#include <asm/leds.h>
28#include <asm/irq.h>
29#include <asm/mach/irq.h>
30#include <asm/mach/time.h> 31#include <asm/mach/time.h>
31
32#include <linux/time.h>
33#include <linux/timex.h>
34#include <asm/errno.h> 32#include <asm/errno.h>
35 33
36/*! Note: all timers are UPCOUNTING */ 34/*! Note: all timers are UPCOUNTING */
diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c
index d9635ff4b10c..12141e2a50cc 100644
--- a/arch/arm/mach-pxa/irq.c
+++ b/arch/arm/mach-pxa/irq.c
@@ -39,7 +39,8 @@ static void pxa_unmask_low_irq(unsigned int irq)
39 ICMR |= (1 << (irq + PXA_IRQ_SKIP)); 39 ICMR |= (1 << (irq + PXA_IRQ_SKIP));
40} 40}
41 41
42static struct irqchip pxa_internal_chip_low = { 42static struct irq_chip pxa_internal_chip_low = {
43 .name = "SC",
43 .ack = pxa_mask_low_irq, 44 .ack = pxa_mask_low_irq,
44 .mask = pxa_mask_low_irq, 45 .mask = pxa_mask_low_irq,
45 .unmask = pxa_unmask_low_irq, 46 .unmask = pxa_unmask_low_irq,
@@ -61,7 +62,8 @@ static void pxa_unmask_high_irq(unsigned int irq)
61 ICMR2 |= (1 << (irq - 32 + PXA_IRQ_SKIP)); 62 ICMR2 |= (1 << (irq - 32 + PXA_IRQ_SKIP));
62} 63}
63 64
64static struct irqchip pxa_internal_chip_high = { 65static struct irq_chip pxa_internal_chip_high = {
66 .name = "SC-hi",
65 .ack = pxa_mask_high_irq, 67 .ack = pxa_mask_high_irq,
66 .mask = pxa_mask_high_irq, 68 .mask = pxa_mask_high_irq,
67 .unmask = pxa_unmask_high_irq, 69 .unmask = pxa_unmask_high_irq,
@@ -129,7 +131,8 @@ static void pxa_ack_low_gpio(unsigned int irq)
129 GEDR0 = (1 << (irq - IRQ_GPIO0)); 131 GEDR0 = (1 << (irq - IRQ_GPIO0));
130} 132}
131 133
132static struct irqchip pxa_low_gpio_chip = { 134static struct irq_chip pxa_low_gpio_chip = {
135 .name = "GPIO-l",
133 .ack = pxa_ack_low_gpio, 136 .ack = pxa_ack_low_gpio,
134 .mask = pxa_mask_low_irq, 137 .mask = pxa_mask_low_irq,
135 .unmask = pxa_unmask_low_irq, 138 .unmask = pxa_unmask_low_irq,
@@ -237,7 +240,8 @@ static void pxa_unmask_muxed_gpio(unsigned int irq)
237 GFER(gpio) = GPIO_IRQ_falling_edge[idx] & GPIO_IRQ_mask[idx]; 240 GFER(gpio) = GPIO_IRQ_falling_edge[idx] & GPIO_IRQ_mask[idx];
238} 241}
239 242
240static struct irqchip pxa_muxed_gpio_chip = { 243static struct irq_chip pxa_muxed_gpio_chip = {
244 .name = "GPIO",
241 .ack = pxa_ack_muxed_gpio, 245 .ack = pxa_ack_muxed_gpio,
242 .mask = pxa_mask_muxed_gpio, 246 .mask = pxa_mask_muxed_gpio,
243 .unmask = pxa_unmask_muxed_gpio, 247 .unmask = pxa_unmask_muxed_gpio,
diff --git a/arch/arm/mach-pxa/lpd270.c b/arch/arm/mach-pxa/lpd270.c
index 1a5f5c21481e..12479ae26db2 100644
--- a/arch/arm/mach-pxa/lpd270.c
+++ b/arch/arm/mach-pxa/lpd270.c
@@ -68,7 +68,8 @@ static void lpd270_unmask_irq(unsigned int irq)
68 __raw_writew(lpd270_irq_enabled, LPD270_INT_MASK); 68 __raw_writew(lpd270_irq_enabled, LPD270_INT_MASK);
69} 69}
70 70
71static struct irqchip lpd270_irq_chip = { 71static struct irq_chip lpd270_irq_chip = {
72 .name = "CPLD",
72 .ack = lpd270_mask_irq, 73 .ack = lpd270_mask_irq,
73 .mask = lpd270_mask_irq, 74 .mask = lpd270_mask_irq,
74 .unmask = lpd270_unmask_irq, 75 .unmask = lpd270_unmask_irq,
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c
index 6a9a669d60de..83ff5cee64d9 100644
--- a/arch/arm/mach-pxa/lubbock.c
+++ b/arch/arm/mach-pxa/lubbock.c
@@ -78,7 +78,8 @@ static void lubbock_unmask_irq(unsigned int irq)
78 LUB_IRQ_MASK_EN = (lubbock_irq_enabled |= (1 << lubbock_irq)); 78 LUB_IRQ_MASK_EN = (lubbock_irq_enabled |= (1 << lubbock_irq));
79} 79}
80 80
81static struct irqchip lubbock_irq_chip = { 81static struct irq_chip lubbock_irq_chip = {
82 .name = "FPGA",
82 .ack = lubbock_mask_irq, 83 .ack = lubbock_mask_irq,
83 .mask = lubbock_mask_irq, 84 .mask = lubbock_mask_irq,
84 .unmask = lubbock_unmask_irq, 85 .unmask = lubbock_unmask_irq,
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c
index 21ddf3de2f6e..a7e9b96f258a 100644
--- a/arch/arm/mach-pxa/mainstone.c
+++ b/arch/arm/mach-pxa/mainstone.c
@@ -64,7 +64,8 @@ static void mainstone_unmask_irq(unsigned int irq)
64 MST_INTMSKENA = (mainstone_irq_enabled |= (1 << mainstone_irq)); 64 MST_INTMSKENA = (mainstone_irq_enabled |= (1 << mainstone_irq));
65} 65}
66 66
67static struct irqchip mainstone_irq_chip = { 67static struct irq_chip mainstone_irq_chip = {
68 .name = "FPGA",
68 .ack = mainstone_mask_irq, 69 .ack = mainstone_mask_irq,
69 .mask = mainstone_mask_irq, 70 .mask = mainstone_mask_irq,
70 .unmask = mainstone_unmask_irq, 71 .unmask = mainstone_unmask_irq,
diff --git a/arch/arm/mach-s3c2410/mach-anubis.c b/arch/arm/mach-s3c2410/mach-anubis.c
index 4a92d6f92d6b..60641d452db3 100644
--- a/arch/arm/mach-s3c2410/mach-anubis.c
+++ b/arch/arm/mach-s3c2410/mach-anubis.c
@@ -60,11 +60,12 @@ static struct map_desc anubis_iodesc[] __initdata = {
60 .virtual = (u32)S3C24XX_VA_ISA_BYTE, 60 .virtual = (u32)S3C24XX_VA_ISA_BYTE,
61 .pfn = __phys_to_pfn(0x0), 61 .pfn = __phys_to_pfn(0x0),
62 .length = SZ_4M, 62 .length = SZ_4M,
63 .type = MT_DEVICE 63 .type = MT_DEVICE,
64 }, { 64 }, {
65 .virtual = (u32)S3C24XX_VA_ISA_WORD, 65 .virtual = (u32)S3C24XX_VA_ISA_WORD,
66 .pfn = __phys_to_pfn(0x0), 66 .pfn = __phys_to_pfn(0x0),
67 .length = SZ_4M, MT_DEVICE 67 .length = SZ_4M,
68 .type = MT_DEVICE,
68 }, 69 },
69 70
70 /* we could possibly compress the next set down into a set of smaller tables 71 /* we could possibly compress the next set down into a set of smaller tables
@@ -78,36 +79,12 @@ static struct map_desc anubis_iodesc[] __initdata = {
78 .virtual = (u32)ANUBIS_VA_CTRL1, 79 .virtual = (u32)ANUBIS_VA_CTRL1,
79 .pfn = __phys_to_pfn(ANUBIS_PA_CTRL1), 80 .pfn = __phys_to_pfn(ANUBIS_PA_CTRL1),
80 .length = SZ_4K, 81 .length = SZ_4K,
81 .type = MT_DEVICE 82 .type = MT_DEVICE,
82 }, { 83 }, {
83 .virtual = (u32)ANUBIS_VA_CTRL2, 84 .virtual = (u32)ANUBIS_VA_CTRL2,
84 .pfn = __phys_to_pfn(ANUBIS_PA_CTRL2), 85 .pfn = __phys_to_pfn(ANUBIS_PA_CTRL2),
85 .length = SZ_4K, 86 .length = SZ_4K,
86 .type =MT_DEVICE 87 .type = MT_DEVICE,
87 },
88
89 /* IDE drives */
90
91 {
92 .virtual = (u32)ANUBIS_IDEPRI,
93 .pfn = __phys_to_pfn(S3C2410_CS3),
94 .length = SZ_1M,
95 .type = MT_DEVICE
96 }, {
97 .virtual = (u32)ANUBIS_IDEPRIAUX,
98 .pfn = __phys_to_pfn(S3C2410_CS3+(1<<26)),
99 .length = SZ_1M,
100 .type = MT_DEVICE
101 }, {
102 .virtual = (u32)ANUBIS_IDESEC,
103 .pfn = __phys_to_pfn(S3C2410_CS4),
104 .length = SZ_1M,
105 .type = MT_DEVICE
106 }, {
107 .virtual = (u32)ANUBIS_IDESECAUX,
108 .pfn = __phys_to_pfn(S3C2410_CS4+(1<<26)),
109 .length = SZ_1M,
110 .type = MT_DEVICE
111 }, 88 },
112}; 89};
113 90
@@ -126,7 +103,7 @@ static struct s3c24xx_uart_clksrc anubis_serial_clocks[] = {
126 .name = "pclk", 103 .name = "pclk",
127 .divisor = 1, 104 .divisor = 1,
128 .min_baud = 0, 105 .min_baud = 0,
129 .max_baud = 0. 106 .max_baud = 0,
130 } 107 }
131}; 108};
132 109
@@ -139,7 +116,7 @@ static struct s3c2410_uartcfg anubis_uartcfgs[] __initdata = {
139 .ulcon = ULCON, 116 .ulcon = ULCON,
140 .ufcon = UFCON, 117 .ufcon = UFCON,
141 .clocks = anubis_serial_clocks, 118 .clocks = anubis_serial_clocks,
142 .clocks_size = ARRAY_SIZE(anubis_serial_clocks) 119 .clocks_size = ARRAY_SIZE(anubis_serial_clocks),
143 }, 120 },
144 [1] = { 121 [1] = {
145 .hwport = 2, 122 .hwport = 2,
@@ -148,7 +125,7 @@ static struct s3c2410_uartcfg anubis_uartcfgs[] __initdata = {
148 .ulcon = ULCON, 125 .ulcon = ULCON,
149 .ufcon = UFCON, 126 .ufcon = UFCON,
150 .clocks = anubis_serial_clocks, 127 .clocks = anubis_serial_clocks,
151 .clocks_size = ARRAY_SIZE(anubis_serial_clocks) 128 .clocks_size = ARRAY_SIZE(anubis_serial_clocks),
152 }, 129 },
153}; 130};
154 131
@@ -162,7 +139,7 @@ static struct mtd_partition anubis_default_nand_part[] = {
162 [0] = { 139 [0] = {
163 .name = "Boot Agent", 140 .name = "Boot Agent",
164 .size = SZ_16K, 141 .size = SZ_16K,
165 .offset = 0 142 .offset = 0,
166 }, 143 },
167 [1] = { 144 [1] = {
168 .name = "/boot", 145 .name = "/boot",
@@ -194,21 +171,21 @@ static struct s3c2410_nand_set anubis_nand_sets[] = {
194 .nr_chips = 1, 171 .nr_chips = 1,
195 .nr_map = external_map, 172 .nr_map = external_map,
196 .nr_partitions = ARRAY_SIZE(anubis_default_nand_part), 173 .nr_partitions = ARRAY_SIZE(anubis_default_nand_part),
197 .partitions = anubis_default_nand_part 174 .partitions = anubis_default_nand_part,
198 }, 175 },
199 [0] = { 176 [0] = {
200 .name = "chip0", 177 .name = "chip0",
201 .nr_chips = 1, 178 .nr_chips = 1,
202 .nr_map = chip0_map, 179 .nr_map = chip0_map,
203 .nr_partitions = ARRAY_SIZE(anubis_default_nand_part), 180 .nr_partitions = ARRAY_SIZE(anubis_default_nand_part),
204 .partitions = anubis_default_nand_part 181 .partitions = anubis_default_nand_part,
205 }, 182 },
206 [2] = { 183 [2] = {
207 .name = "chip1", 184 .name = "chip1",
208 .nr_chips = 1, 185 .nr_chips = 1,
209 .nr_map = chip1_map, 186 .nr_map = chip1_map,
210 .nr_partitions = ARRAY_SIZE(anubis_default_nand_part), 187 .nr_partitions = ARRAY_SIZE(anubis_default_nand_part),
211 .partitions = anubis_default_nand_part 188 .partitions = anubis_default_nand_part,
212 }, 189 },
213}; 190};
214 191
@@ -313,7 +290,7 @@ static struct s3c24xx_board anubis_board __initdata = {
313 .devices = anubis_devices, 290 .devices = anubis_devices,
314 .devices_count = ARRAY_SIZE(anubis_devices), 291 .devices_count = ARRAY_SIZE(anubis_devices),
315 .clocks = anubis_clocks, 292 .clocks = anubis_clocks,
316 .clocks_count = ARRAY_SIZE(anubis_clocks) 293 .clocks_count = ARRAY_SIZE(anubis_clocks),
317}; 294};
318 295
319static void __init anubis_map_io(void) 296static void __init anubis_map_io(void)
diff --git a/arch/arm/mach-s3c2410/mach-osiris.c b/arch/arm/mach-s3c2410/mach-osiris.c
index 858fd03c6bc5..e193ba69e652 100644
--- a/arch/arm/mach-s3c2410/mach-osiris.c
+++ b/arch/arm/mach-s3c2410/mach-osiris.c
@@ -67,12 +67,12 @@ static struct map_desc osiris_iodesc[] __initdata = {
67 .virtual = (u32)OSIRIS_VA_CTRL1, 67 .virtual = (u32)OSIRIS_VA_CTRL1,
68 .pfn = __phys_to_pfn(OSIRIS_PA_CTRL1), 68 .pfn = __phys_to_pfn(OSIRIS_PA_CTRL1),
69 .length = SZ_16K, 69 .length = SZ_16K,
70 .type = MT_DEVICE 70 .type = MT_DEVICE,
71 }, { 71 }, {
72 .virtual = (u32)OSIRIS_VA_CTRL2, 72 .virtual = (u32)OSIRIS_VA_CTRL2,
73 .pfn = __phys_to_pfn(OSIRIS_PA_CTRL2), 73 .pfn = __phys_to_pfn(OSIRIS_PA_CTRL2),
74 .length = SZ_16K, 74 .length = SZ_16K,
75 .type = MT_DEVICE 75 .type = MT_DEVICE,
76 }, 76 },
77}; 77};
78 78
@@ -91,7 +91,7 @@ static struct s3c24xx_uart_clksrc osiris_serial_clocks[] = {
91 .name = "pclk", 91 .name = "pclk",
92 .divisor = 1, 92 .divisor = 1,
93 .min_baud = 0, 93 .min_baud = 0,
94 .max_baud = 0. 94 .max_baud = 0,
95 } 95 }
96}; 96};
97 97
@@ -103,7 +103,7 @@ static struct s3c2410_uartcfg osiris_uartcfgs[] __initdata = {
103 .ulcon = ULCON, 103 .ulcon = ULCON,
104 .ufcon = UFCON, 104 .ufcon = UFCON,
105 .clocks = osiris_serial_clocks, 105 .clocks = osiris_serial_clocks,
106 .clocks_size = ARRAY_SIZE(osiris_serial_clocks) 106 .clocks_size = ARRAY_SIZE(osiris_serial_clocks),
107 }, 107 },
108 [1] = { 108 [1] = {
109 .hwport = 1, 109 .hwport = 1,
@@ -112,7 +112,7 @@ static struct s3c2410_uartcfg osiris_uartcfgs[] __initdata = {
112 .ulcon = ULCON, 112 .ulcon = ULCON,
113 .ufcon = UFCON, 113 .ufcon = UFCON,
114 .clocks = osiris_serial_clocks, 114 .clocks = osiris_serial_clocks,
115 .clocks_size = ARRAY_SIZE(osiris_serial_clocks) 115 .clocks_size = ARRAY_SIZE(osiris_serial_clocks),
116 }, 116 },
117}; 117};
118 118
@@ -126,7 +126,7 @@ static struct mtd_partition osiris_default_nand_part[] = {
126 [0] = { 126 [0] = {
127 .name = "Boot Agent", 127 .name = "Boot Agent",
128 .size = SZ_16K, 128 .size = SZ_16K,
129 .offset = 0 129 .offset = 0,
130 }, 130 },
131 [1] = { 131 [1] = {
132 .name = "/boot", 132 .name = "/boot",
@@ -158,21 +158,21 @@ static struct s3c2410_nand_set osiris_nand_sets[] = {
158 .nr_chips = 1, 158 .nr_chips = 1,
159 .nr_map = external_map, 159 .nr_map = external_map,
160 .nr_partitions = ARRAY_SIZE(osiris_default_nand_part), 160 .nr_partitions = ARRAY_SIZE(osiris_default_nand_part),
161 .partitions = osiris_default_nand_part 161 .partitions = osiris_default_nand_part,
162 }, 162 },
163 [0] = { 163 [0] = {
164 .name = "chip0", 164 .name = "chip0",
165 .nr_chips = 1, 165 .nr_chips = 1,
166 .nr_map = chip0_map, 166 .nr_map = chip0_map,
167 .nr_partitions = ARRAY_SIZE(osiris_default_nand_part), 167 .nr_partitions = ARRAY_SIZE(osiris_default_nand_part),
168 .partitions = osiris_default_nand_part 168 .partitions = osiris_default_nand_part,
169 }, 169 },
170 [2] = { 170 [2] = {
171 .name = "chip1", 171 .name = "chip1",
172 .nr_chips = 1, 172 .nr_chips = 1,
173 .nr_map = chip1_map, 173 .nr_map = chip1_map,
174 .nr_partitions = ARRAY_SIZE(osiris_default_nand_part), 174 .nr_partitions = ARRAY_SIZE(osiris_default_nand_part),
175 .partitions = osiris_default_nand_part 175 .partitions = osiris_default_nand_part,
176 }, 176 },
177}; 177};
178 178
@@ -245,7 +245,7 @@ static struct s3c24xx_board osiris_board __initdata = {
245 .devices = osiris_devices, 245 .devices = osiris_devices,
246 .devices_count = ARRAY_SIZE(osiris_devices), 246 .devices_count = ARRAY_SIZE(osiris_devices),
247 .clocks = osiris_clocks, 247 .clocks = osiris_clocks,
248 .clocks_count = ARRAY_SIZE(osiris_clocks) 248 .clocks_count = ARRAY_SIZE(osiris_clocks),
249}; 249};
250 250
251static void __init osiris_map_io(void) 251static void __init osiris_map_io(void)
diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c
index a6bab50dab61..a0dfa390e34b 100644
--- a/arch/arm/mach-sa1100/collie.c
+++ b/arch/arm/mach-sa1100/collie.c
@@ -83,8 +83,8 @@ static struct scoop_pcmcia_config collie_pcmcia_config = {
83 83
84 84
85static struct mcp_plat_data collie_mcp_data = { 85static struct mcp_plat_data collie_mcp_data = {
86 .mccr0 = MCCR0_ADM, 86 .mccr0 = MCCR0_ADM | MCCR0_ExtClk,
87 .sclk_rate = 11981000, 87 .sclk_rate = 9216000,
88}; 88};
89 89
90#ifdef CONFIG_SHARP_LOCOMO 90#ifdef CONFIG_SHARP_LOCOMO
diff --git a/arch/arm/mach-sa1100/collie_pm.c b/arch/arm/mach-sa1100/collie_pm.c
index 45b1e71f111d..1e25b1d19fce 100644
--- a/arch/arm/mach-sa1100/collie_pm.c
+++ b/arch/arm/mach-sa1100/collie_pm.c
@@ -9,6 +9,9 @@
9 * Li-ion batteries are angry beasts, and they like to explode. This driver is not finished, 9 * Li-ion batteries are angry beasts, and they like to explode. This driver is not finished,
10 * and sometimes charges them when it should not. If it makes angry lithium to come your way... 10 * and sometimes charges them when it should not. If it makes angry lithium to come your way...
11 * ...well, you have been warned. 11 * ...well, you have been warned.
12 *
13 * Actually, this should be quite safe, it seems sharp leaves charger enabled by default,
14 * and my collie did not explode (yet).
12 */ 15 */
13 16
14#include <linux/module.h> 17#include <linux/module.h>
@@ -40,9 +43,8 @@ static void collie_charger_init(void)
40{ 43{
41 int err; 44 int err;
42 45
43 if (sharpsl_param.adadj != -1) { 46 if (sharpsl_param.adadj != -1)
44 ad_revise = sharpsl_param.adadj; 47 ad_revise = sharpsl_param.adadj;
45 }
46 48
47 /* Register interrupt handler. */ 49 /* Register interrupt handler. */
48 if ((err = request_irq(COLLIE_IRQ_GPIO_AC_IN, sharpsl_ac_isr, IRQF_DISABLED, 50 if ((err = request_irq(COLLIE_IRQ_GPIO_AC_IN, sharpsl_ac_isr, IRQF_DISABLED,
@@ -72,27 +74,17 @@ static void collie_measure_temp(int on)
72 74
73static void collie_charge(int on) 75static void collie_charge(int on)
74{ 76{
75 if (on) { 77 extern struct platform_device colliescoop_device;
76 printk("Should start charger\n");
77 } else {
78 printk("Should stop charger\n");
79 }
80#ifdef I_AM_SURE
81 78
82 /* Zaurus seems to contain LTC1731 ; it should know when to 79 /* Zaurus seems to contain LTC1731; it should know when to
83 * stop charging itself, so setting charge on should be 80 * stop charging itself, so setting charge on should be
84 * relatively harmless (as long as it is not done too often). 81 * relatively harmless (as long as it is not done too often).
85 */ 82 */
86#define CF_BUF_CTRL_BASE 0xF0800000
87#define SCOOP_REG(adr) (*(volatile unsigned short*)(CF_BUF_CTRL_BASE+(adr)))
88#define SCOOP_REG_GPWR SCOOP_REG(SCOOP_GPWR)
89
90 if (on) { 83 if (on) {
91 set_scoop_gpio(&colliescoop_device.dev, COLLIE_SCP_CHARGE_ON); 84 set_scoop_gpio(&colliescoop_device.dev, COLLIE_SCP_CHARGE_ON);
92 } else { 85 } else {
93 reset_scoop_gpio(&colliescoop_device.dev, COLLIE_SCP_CHARGE_ON); 86 reset_scoop_gpio(&colliescoop_device.dev, COLLIE_SCP_CHARGE_ON);
94 } 87 }
95#endif
96} 88}
97 89
98static void collie_discharge(int on) 90static void collie_discharge(int on)
@@ -127,7 +119,6 @@ int collie_read_backup_battery(void)
127 119
128 ucb1x00_adc_enable(ucb); 120 ucb1x00_adc_enable(ucb);
129 121
130 /* Gives 75..130 */
131 ucb1x00_io_write(ucb, COLLIE_TC35143_GPIO_BBAT_ON, 0); 122 ucb1x00_io_write(ucb, COLLIE_TC35143_GPIO_BBAT_ON, 0);
132 voltage = ucb1x00_adc_read(ucb, UCB_ADC_INP_AD1, UCB_SYNC); 123 voltage = ucb1x00_adc_read(ucb, UCB_ADC_INP_AD1, UCB_SYNC);
133 124
@@ -146,9 +137,8 @@ int collie_read_main_battery(void)
146 ucb1x00_adc_enable(ucb); 137 ucb1x00_adc_enable(ucb);
147 ucb1x00_io_write(ucb, 0, COLLIE_TC35143_GPIO_BBAT_ON); 138 ucb1x00_io_write(ucb, 0, COLLIE_TC35143_GPIO_BBAT_ON);
148 ucb1x00_io_write(ucb, COLLIE_TC35143_GPIO_MBAT_ON, 0); 139 ucb1x00_io_write(ucb, COLLIE_TC35143_GPIO_MBAT_ON, 0);
149 /* gives values 160..255 with battery removed... and 140
150 145..255 with battery inserted. (on AC), goes as low as 141 mdelay(1);
151 80 on DC. */
152 voltage = ucb1x00_adc_read(ucb, UCB_ADC_INP_AD1, UCB_SYNC); 142 voltage = ucb1x00_adc_read(ucb, UCB_ADC_INP_AD1, UCB_SYNC);
153 143
154 ucb1x00_io_write(ucb, 0, COLLIE_TC35143_GPIO_MBAT_ON); 144 ucb1x00_io_write(ucb, 0, COLLIE_TC35143_GPIO_MBAT_ON);
@@ -192,7 +182,7 @@ static unsigned long read_devdata(int which)
192 case SHARPSL_BATT_TEMP: 182 case SHARPSL_BATT_TEMP:
193 return collie_read_temp(); 183 return collie_read_temp();
194 case SHARPSL_ACIN_VOLT: 184 case SHARPSL_ACIN_VOLT:
195 return 0x1; 185 return 500;
196 case SHARPSL_STATUS_ACIN: { 186 case SHARPSL_STATUS_ACIN: {
197 int ret = GPLR & COLLIE_GPIO_AC_IN; 187 int ret = GPLR & COLLIE_GPIO_AC_IN;
198 printk("AC status = %d\n", ret); 188 printk("AC status = %d\n", ret);
@@ -208,10 +198,33 @@ static unsigned long read_devdata(int which)
208 } 198 }
209} 199}
210 200
201struct battery_thresh collie_battery_levels_acin[] = {
202 { 420, 100},
203 { 417, 95},
204 { 415, 90},
205 { 413, 80},
206 { 411, 75},
207 { 408, 70},
208 { 406, 60},
209 { 403, 50},
210 { 398, 40},
211 { 391, 25},
212 { 10, 5},
213 { 0, 0},
214};
215
211struct battery_thresh collie_battery_levels[] = { 216struct battery_thresh collie_battery_levels[] = {
212 { 368, 100}, 217 { 394, 100},
213 { 358, 25}, 218 { 390, 95},
214 { 356, 5}, 219 { 380, 90},
220 { 370, 80},
221 { 368, 75}, /* From sharp code: battery high with frontlight */
222 { 366, 70}, /* 60..90 -- fake values invented by me for testing */
223 { 364, 60},
224 { 362, 50},
225 { 360, 40},
226 { 358, 25}, /* From sharp code: battery low with frontlight */
227 { 356, 5}, /* From sharp code: battery verylow with frontlight */
215 { 0, 0}, 228 { 0, 0},
216}; 229};
217 230
@@ -226,13 +239,21 @@ struct sharpsl_charger_machinfo collie_pm_machinfo = {
226 .postsuspend = collie_postsuspend, 239 .postsuspend = collie_postsuspend,
227 .charger_wakeup = collie_charger_wakeup, 240 .charger_wakeup = collie_charger_wakeup,
228 .should_wakeup = collie_should_wakeup, 241 .should_wakeup = collie_should_wakeup,
229 .bat_levels = 3, 242 .bat_levels = 12,
230 .bat_levels_noac = collie_battery_levels, 243 .bat_levels_noac = collie_battery_levels,
231 .bat_levels_acin = collie_battery_levels, 244 .bat_levels_acin = collie_battery_levels_acin,
232 .status_high_acin = 368, 245 .status_high_acin = 368,
233 .status_low_acin = 358, 246 .status_low_acin = 358,
234 .status_high_noac = 368, 247 .status_high_noac = 368,
235 .status_low_noac = 358, 248 .status_low_noac = 358,
249 .charge_on_volt = 350, /* spitz uses 2.90V, but lets play it safe. */
250 .charge_on_temp = 550,
251 .charge_acin_high = 550, /* collie does not seem to have sensor for this, anyway */
252 .charge_acin_low = 450, /* ignored, too */
253 .fatal_acin_volt = 356,
254 .fatal_noacin_volt = 356,
255
256 .batfull_irq = 1, /* We do not want periodical charge restarts */
236}; 257};
237 258
238static int __init collie_pm_ucb_add(struct ucb1x00_dev *pdev) 259static int __init collie_pm_ucb_add(struct ucb1x00_dev *pdev)
diff --git a/arch/arm/mach-sa1100/irq.c b/arch/arm/mach-sa1100/irq.c
index 2891b8ca86dd..b55b90a2e8fe 100644
--- a/arch/arm/mach-sa1100/irq.c
+++ b/arch/arm/mach-sa1100/irq.c
@@ -95,7 +95,8 @@ static int sa1100_low_gpio_wake(unsigned int irq, unsigned int on)
95 return 0; 95 return 0;
96} 96}
97 97
98static struct irqchip sa1100_low_gpio_chip = { 98static struct irq_chip sa1100_low_gpio_chip = {
99 .name = "GPIO-l",
99 .ack = sa1100_low_gpio_ack, 100 .ack = sa1100_low_gpio_ack,
100 .mask = sa1100_low_gpio_mask, 101 .mask = sa1100_low_gpio_mask,
101 .unmask = sa1100_low_gpio_unmask, 102 .unmask = sa1100_low_gpio_unmask,
@@ -178,7 +179,8 @@ static int sa1100_high_gpio_wake(unsigned int irq, unsigned int on)
178 return 0; 179 return 0;
179} 180}
180 181
181static struct irqchip sa1100_high_gpio_chip = { 182static struct irq_chip sa1100_high_gpio_chip = {
183 .name = "GPIO-h",
182 .ack = sa1100_high_gpio_ack, 184 .ack = sa1100_high_gpio_ack,
183 .mask = sa1100_high_gpio_mask, 185 .mask = sa1100_high_gpio_mask,
184 .unmask = sa1100_high_gpio_unmask, 186 .unmask = sa1100_high_gpio_unmask,
@@ -215,7 +217,8 @@ static int sa1100_set_wake(unsigned int irq, unsigned int on)
215 return -EINVAL; 217 return -EINVAL;
216} 218}
217 219
218static struct irqchip sa1100_normal_chip = { 220static struct irq_chip sa1100_normal_chip = {
221 .name = "SC",
219 .ack = sa1100_mask_irq, 222 .ack = sa1100_mask_irq,
220 .mask = sa1100_mask_irq, 223 .mask = sa1100_mask_irq,
221 .unmask = sa1100_unmask_irq, 224 .unmask = sa1100_unmask_irq,
diff --git a/arch/arm/mach-shark/irq.c b/arch/arm/mach-shark/irq.c
index 6cb67bd3dfd3..b227052296cf 100644
--- a/arch/arm/mach-shark/irq.c
+++ b/arch/arm/mach-shark/irq.c
@@ -69,7 +69,8 @@ static irqreturn_t bogus_int(int irq, void *dev_id, struct pt_regs *regs)
69 69
70static struct irqaction cascade; 70static struct irqaction cascade;
71 71
72static struct irqchip fb_chip = { 72static struct irq_chip fb_chip = {
73 .name = "XT-PIC",
73 .ack = shark_ack_8259A_irq, 74 .ack = shark_ack_8259A_irq,
74 .mask = shark_disable_8259A_irq, 75 .mask = shark_disable_8259A_irq,
75 .unmask = shark_enable_8259A_irq, 76 .unmask = shark_enable_8259A_irq,
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index a432539cc1bd..c4e3f8c68479 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -35,6 +35,7 @@
35#include <asm/hardware/arm_timer.h> 35#include <asm/hardware/arm_timer.h>
36#include <asm/hardware/icst307.h> 36#include <asm/hardware/icst307.h>
37#include <asm/hardware/vic.h> 37#include <asm/hardware/vic.h>
38#include <asm/mach-types.h>
38 39
39#include <asm/mach/arch.h> 40#include <asm/mach/arch.h>
40#include <asm/mach/flash.h> 41#include <asm/mach/flash.h>
@@ -68,7 +69,8 @@ static void sic_unmask_irq(unsigned int irq)
68 writel(1 << irq, VA_SIC_BASE + SIC_IRQ_ENABLE_SET); 69 writel(1 << irq, VA_SIC_BASE + SIC_IRQ_ENABLE_SET);
69} 70}
70 71
71static struct irqchip sic_chip = { 72static struct irq_chip sic_chip = {
73 .name = "SIC",
72 .ack = sic_mask_irq, 74 .ack = sic_mask_irq,
73 .mask = sic_mask_irq, 75 .mask = sic_mask_irq,
74 .unmask = sic_unmask_irq, 76 .unmask = sic_unmask_irq,
@@ -352,11 +354,7 @@ static const struct icst307_params versatile_oscvco_params = {
352static void versatile_oscvco_set(struct clk *clk, struct icst307_vco vco) 354static void versatile_oscvco_set(struct clk *clk, struct icst307_vco vco)
353{ 355{
354 void __iomem *sys_lock = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_LOCK_OFFSET; 356 void __iomem *sys_lock = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_LOCK_OFFSET;
355#if defined(CONFIG_ARCH_VERSATILE_PB) 357 void __iomem *sys_osc = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_OSCCLCD_OFFSET;
356 void __iomem *sys_osc = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_OSC4_OFFSET;
357#elif defined(CONFIG_MACH_VERSATILE_AB)
358 void __iomem *sys_osc = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_OSC1_OFFSET;
359#endif
360 u32 val; 358 u32 val;
361 359
362 val = readl(sys_osc) & ~0x7ffff; 360 val = readl(sys_osc) & ~0x7ffff;
@@ -529,7 +527,7 @@ static void versatile_clcd_disable(struct clcd_fb *fb)
529 /* 527 /*
530 * If the LCD is Sanyo 2x5 in on the IB2 board, turn the back-light off 528 * If the LCD is Sanyo 2x5 in on the IB2 board, turn the back-light off
531 */ 529 */
532 if (fb->panel == &sanyo_2_5_in) { 530 if (machine_is_versatile_ab() && fb->panel == &sanyo_2_5_in) {
533 void __iomem *versatile_ib2_ctrl = __io_address(VERSATILE_IB2_CTRL); 531 void __iomem *versatile_ib2_ctrl = __io_address(VERSATILE_IB2_CTRL);
534 unsigned long ctrl; 532 unsigned long ctrl;
535 533
@@ -578,7 +576,7 @@ static void versatile_clcd_enable(struct clcd_fb *fb)
578 /* 576 /*
579 * If the LCD is Sanyo 2x5 in on the IB2 board, turn the back-light on 577 * If the LCD is Sanyo 2x5 in on the IB2 board, turn the back-light on
580 */ 578 */
581 if (fb->panel == &sanyo_2_5_in) { 579 if (machine_is_versatile_ab() && fb->panel == &sanyo_2_5_in) {
582 void __iomem *versatile_ib2_ctrl = __io_address(VERSATILE_IB2_CTRL); 580 void __iomem *versatile_ib2_ctrl = __io_address(VERSATILE_IB2_CTRL);
583 unsigned long ctrl; 581 unsigned long ctrl;
584 582
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index dba7dddfe57d..88a999df0ab3 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -363,7 +363,9 @@ EXPORT_SYMBOL(__ioremap);
363 363
364void __iounmap(void __iomem *addr) 364void __iounmap(void __iomem *addr)
365{ 365{
366#ifndef CONFIG_SMP
366 struct vm_struct **p, *tmp; 367 struct vm_struct **p, *tmp;
368#endif
367 unsigned int section_mapping = 0; 369 unsigned int section_mapping = 0;
368 370
369 addr = (void __iomem *)(PAGE_MASK & (unsigned long)addr); 371 addr = (void __iomem *)(PAGE_MASK & (unsigned long)addr);
diff --git a/arch/arm/mm/proc-syms.c b/arch/arm/mm/proc-syms.c
index 6c5f0fe578a5..ab143557e688 100644
--- a/arch/arm/mm/proc-syms.c
+++ b/arch/arm/mm/proc-syms.c
@@ -13,6 +13,7 @@
13#include <asm/cacheflush.h> 13#include <asm/cacheflush.h>
14#include <asm/proc-fns.h> 14#include <asm/proc-fns.h>
15#include <asm/tlbflush.h> 15#include <asm/tlbflush.h>
16#include <asm/page.h>
16 17
17#ifndef MULTI_CPU 18#ifndef MULTI_CPU
18EXPORT_SYMBOL(cpu_dcache_clean_area); 19EXPORT_SYMBOL(cpu_dcache_clean_area);
@@ -30,6 +31,13 @@ EXPORT_SYMBOL(__cpuc_coherent_kern_range);
30EXPORT_SYMBOL(cpu_cache); 31EXPORT_SYMBOL(cpu_cache);
31#endif 32#endif
32 33
34#ifndef MULTI_USER
35EXPORT_SYMBOL(__cpu_clear_user_page);
36EXPORT_SYMBOL(__cpu_copy_user_page);
37#else
38EXPORT_SYMBOL(cpu_user);
39#endif
40
33/* 41/*
34 * No module should need to touch the TLB (and currently 42 * No module should need to touch the TLB (and currently
35 * no modules do. We export this for "loadkernel" support 43 * no modules do. We export this for "loadkernel" support
diff --git a/arch/arm/mm/proc-xscale.S b/arch/arm/mm/proc-xscale.S
index 521538671f4c..561bff73a036 100644
--- a/arch/arm/mm/proc-xscale.S
+++ b/arch/arm/mm/proc-xscale.S
@@ -536,6 +536,11 @@ cpu_80200_name:
536 .asciz "XScale-80200" 536 .asciz "XScale-80200"
537 .size cpu_80200_name, . - cpu_80200_name 537 .size cpu_80200_name, . - cpu_80200_name
538 538
539 .type cpu_80219_name, #object
540cpu_80219_name:
541 .asciz "XScale-80219"
542 .size cpu_80219_name, . - cpu_80219_name
543
539 .type cpu_8032x_name, #object 544 .type cpu_8032x_name, #object
540cpu_8032x_name: 545cpu_8032x_name:
541 .asciz "XScale-IOP8032x Family" 546 .asciz "XScale-IOP8032x Family"
@@ -613,10 +618,33 @@ __80200_proc_info:
613 .long xscale_cache_fns 618 .long xscale_cache_fns
614 .size __80200_proc_info, . - __80200_proc_info 619 .size __80200_proc_info, . - __80200_proc_info
615 620
621 .type __80219_proc_info,#object
622__80219_proc_info:
623 .long 0x69052e20
624 .long 0xffffffe0
625 .long PMD_TYPE_SECT | \
626 PMD_SECT_BUFFERABLE | \
627 PMD_SECT_CACHEABLE | \
628 PMD_SECT_AP_WRITE | \
629 PMD_SECT_AP_READ
630 .long PMD_TYPE_SECT | \
631 PMD_SECT_AP_WRITE | \
632 PMD_SECT_AP_READ
633 b __xscale_setup
634 .long cpu_arch_name
635 .long cpu_elf_name
636 .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP
637 .long cpu_80219_name
638 .long xscale_processor_functions
639 .long v4wbi_tlb_fns
640 .long xscale_mc_user_fns
641 .long xscale_cache_fns
642 .size __80219_proc_info, . - __80219_proc_info
643
616 .type __8032x_proc_info,#object 644 .type __8032x_proc_info,#object
617__8032x_proc_info: 645__8032x_proc_info:
618 .long 0x69052420 646 .long 0x69052420
619 .long 0xfffff5e0 @ mask should accomodate IOP80219 also 647 .long 0xffffffe0
620 .long PMD_TYPE_SECT | \ 648 .long PMD_TYPE_SECT | \
621 PMD_SECT_BUFFERABLE | \ 649 PMD_SECT_BUFFERABLE | \
622 PMD_SECT_CACHEABLE | \ 650 PMD_SECT_CACHEABLE | \
diff --git a/arch/arm/nwfpe/softfloat.h b/arch/arm/nwfpe/softfloat.h
index e1125bc39ee4..0a3067452cd2 100644
--- a/arch/arm/nwfpe/softfloat.h
+++ b/arch/arm/nwfpe/softfloat.h
@@ -61,7 +61,7 @@ typedef struct {
61 u16 __padding; 61 u16 __padding;
62#endif 62#endif
63 u64 low; 63 u64 low;
64} floatx80; 64} __attribute__ ((packed,aligned(4))) floatx80;
65 65
66/* 66/*
67------------------------------------------------------------------------------- 67-------------------------------------------------------------------------------
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index fec7970e564d..cd7f973fb286 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -944,7 +944,8 @@ static void mpuio_unmask_irq(unsigned int irq)
944 _set_gpio_irqenable(bank, gpio, 1); 944 _set_gpio_irqenable(bank, gpio, 1);
945} 945}
946 946
947static struct irqchip gpio_irq_chip = { 947static struct irq_chip gpio_irq_chip = {
948 .name = "GPIO",
948 .ack = gpio_ack_irq, 949 .ack = gpio_ack_irq,
949 .mask = gpio_mask_irq, 950 .mask = gpio_mask_irq,
950 .unmask = gpio_unmask_irq, 951 .unmask = gpio_unmask_irq,
@@ -952,10 +953,11 @@ static struct irqchip gpio_irq_chip = {
952 .set_wake = gpio_wake_enable, 953 .set_wake = gpio_wake_enable,
953}; 954};
954 955
955static struct irqchip mpuio_irq_chip = { 956static struct irq_chip mpuio_irq_chip = {
957 .name = "MPUIO",
956 .ack = mpuio_ack_irq, 958 .ack = mpuio_ack_irq,
957 .mask = mpuio_mask_irq, 959 .mask = mpuio_mask_irq,
958 .unmask = mpuio_unmask_irq 960 .unmask = mpuio_unmask_irq
959}; 961};
960 962
961static int initialized; 963static int initialized;
diff --git a/arch/arm26/kernel/setup.c b/arch/arm26/kernel/setup.c
index 843c29fe9af5..e7eb070f794f 100644
--- a/arch/arm26/kernel/setup.c
+++ b/arch/arm26/kernel/setup.c
@@ -17,7 +17,7 @@
17#include <linux/console.h> 17#include <linux/console.h>
18#include <linux/bootmem.h> 18#include <linux/bootmem.h>
19#include <linux/seq_file.h> 19#include <linux/seq_file.h>
20#include <linux/tty.h> 20#include <linux/screen_info.h>
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/root_dev.h> 22#include <linux/root_dev.h>
23 23
diff --git a/arch/cris/arch-v10/drivers/eeprom.c b/arch/cris/arch-v10/drivers/eeprom.c
index 037582028560..6e1f191a71e3 100644
--- a/arch/cris/arch-v10/drivers/eeprom.c
+++ b/arch/cris/arch-v10/drivers/eeprom.c
@@ -450,9 +450,9 @@ int __init eeprom_init(void)
450static int eeprom_open(struct inode * inode, struct file * file) 450static int eeprom_open(struct inode * inode, struct file * file)
451{ 451{
452 452
453 if(MINOR(inode->i_rdev) != EEPROM_MINOR_NR) 453 if(iminor(inode) != EEPROM_MINOR_NR)
454 return -ENXIO; 454 return -ENXIO;
455 if(MAJOR(inode->i_rdev) != EEPROM_MAJOR_NR) 455 if(imajor(inode) != EEPROM_MAJOR_NR)
456 return -ENXIO; 456 return -ENXIO;
457 457
458 if( eeprom.size > 0 ) 458 if( eeprom.size > 0 )
diff --git a/arch/cris/arch-v10/drivers/gpio.c b/arch/cris/arch-v10/drivers/gpio.c
index 48fd801792d1..fcba6632ed7b 100644
--- a/arch/cris/arch-v10/drivers/gpio.c
+++ b/arch/cris/arch-v10/drivers/gpio.c
@@ -435,7 +435,7 @@ static int
435gpio_open(struct inode *inode, struct file *filp) 435gpio_open(struct inode *inode, struct file *filp)
436{ 436{
437 struct gpio_private *priv; 437 struct gpio_private *priv;
438 int p = MINOR(inode->i_rdev); 438 int p = iminor(inode);
439 439
440 if (p > GPIO_MINOR_LAST) 440 if (p > GPIO_MINOR_LAST)
441 return -EINVAL; 441 return -EINVAL;
diff --git a/arch/cris/arch-v32/drivers/cryptocop.c b/arch/cris/arch-v32/drivers/cryptocop.c
index c59ee28a35f4..ba096ebb0b15 100644
--- a/arch/cris/arch-v32/drivers/cryptocop.c
+++ b/arch/cris/arch-v32/drivers/cryptocop.c
@@ -2302,7 +2302,7 @@ static int cryptocop_job_setup(struct cryptocop_prio_job **pj, struct cryptocop_
2302 2302
2303static int cryptocop_open(struct inode *inode, struct file *filp) 2303static int cryptocop_open(struct inode *inode, struct file *filp)
2304{ 2304{
2305 int p = MINOR(inode->i_rdev); 2305 int p = iminor(inode);
2306 2306
2307 if (p != CRYPTOCOP_MINOR) return -EINVAL; 2307 if (p != CRYPTOCOP_MINOR) return -EINVAL;
2308 2308
diff --git a/arch/cris/arch-v32/drivers/gpio.c b/arch/cris/arch-v32/drivers/gpio.c
index 00e9167de530..c3f876b4da6b 100644
--- a/arch/cris/arch-v32/drivers/gpio.c
+++ b/arch/cris/arch-v32/drivers/gpio.c
@@ -418,7 +418,7 @@ static int
418gpio_open(struct inode *inode, struct file *filp) 418gpio_open(struct inode *inode, struct file *filp)
419{ 419{
420 struct gpio_private *priv; 420 struct gpio_private *priv;
421 int p = MINOR(inode->i_rdev); 421 int p = iminor(inode);
422 422
423 if (p > GPIO_MINOR_LAST) 423 if (p > GPIO_MINOR_LAST)
424 return -EINVAL; 424 return -EINVAL;
diff --git a/arch/cris/arch-v32/drivers/pcf8563.c b/arch/cris/arch-v32/drivers/pcf8563.c
index ffc6d2572f2b..2fc7d75a35de 100644
--- a/arch/cris/arch-v32/drivers/pcf8563.c
+++ b/arch/cris/arch-v32/drivers/pcf8563.c
@@ -324,14 +324,12 @@ pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned
324int 324int
325pcf8563_open(struct inode *inode, struct file *filp) 325pcf8563_open(struct inode *inode, struct file *filp)
326{ 326{
327 MOD_INC_USE_COUNT;
328 return 0; 327 return 0;
329} 328}
330 329
331int 330int
332pcf8563_release(struct inode *inode, struct file *filp) 331pcf8563_release(struct inode *inode, struct file *filp)
333{ 332{
334 MOD_DEC_USE_COUNT;
335 return 0; 333 return 0;
336} 334}
337 335
diff --git a/arch/cris/arch-v32/drivers/sync_serial.c b/arch/cris/arch-v32/drivers/sync_serial.c
index 7c29957f5f02..e067806b2208 100644
--- a/arch/cris/arch-v32/drivers/sync_serial.c
+++ b/arch/cris/arch-v32/drivers/sync_serial.c
@@ -340,7 +340,7 @@ static inline int sync_data_avail_to_end(struct sync_port *port)
340 340
341static int sync_serial_open(struct inode *inode, struct file *file) 341static int sync_serial_open(struct inode *inode, struct file *file)
342{ 342{
343 int dev = MINOR(inode->i_rdev); 343 int dev = iminor(inode);
344 sync_port* port; 344 sync_port* port;
345 reg_dma_rw_cfg cfg = {.en = regk_dma_yes}; 345 reg_dma_rw_cfg cfg = {.en = regk_dma_yes};
346 reg_dma_rw_intr_mask intr_mask = {.data = regk_dma_yes}; 346 reg_dma_rw_intr_mask intr_mask = {.data = regk_dma_yes};
@@ -486,7 +486,7 @@ static int sync_serial_open(struct inode *inode, struct file *file)
486 486
487static int sync_serial_release(struct inode *inode, struct file *file) 487static int sync_serial_release(struct inode *inode, struct file *file)
488{ 488{
489 int dev = MINOR(inode->i_rdev); 489 int dev = iminor(inode);
490 sync_port* port; 490 sync_port* port;
491 491
492 if (dev < 0 || dev >= NUMBER_OF_PORTS || !ports[dev].enabled) 492 if (dev < 0 || dev >= NUMBER_OF_PORTS || !ports[dev].enabled)
@@ -504,7 +504,7 @@ static int sync_serial_release(struct inode *inode, struct file *file)
504 504
505static unsigned int sync_serial_poll(struct file *file, poll_table *wait) 505static unsigned int sync_serial_poll(struct file *file, poll_table *wait)
506{ 506{
507 int dev = MINOR(file->f_dentry->d_inode->i_rdev); 507 int dev = iminor(file->f_dentry->d_inode);
508 unsigned int mask = 0; 508 unsigned int mask = 0;
509 sync_port* port; 509 sync_port* port;
510 DEBUGPOLL( static unsigned int prev_mask = 0; ); 510 DEBUGPOLL( static unsigned int prev_mask = 0; );
@@ -531,7 +531,7 @@ static int sync_serial_ioctl(struct inode *inode, struct file *file,
531 unsigned int cmd, unsigned long arg) 531 unsigned int cmd, unsigned long arg)
532{ 532{
533 int return_val = 0; 533 int return_val = 0;
534 int dev = MINOR(file->f_dentry->d_inode->i_rdev); 534 int dev = iminor(file->f_dentry->d_inode);
535 sync_port* port; 535 sync_port* port;
536 reg_sser_rw_tr_cfg tr_cfg; 536 reg_sser_rw_tr_cfg tr_cfg;
537 reg_sser_rw_rec_cfg rec_cfg; 537 reg_sser_rw_rec_cfg rec_cfg;
@@ -789,7 +789,7 @@ static int sync_serial_ioctl(struct inode *inode, struct file *file,
789static ssize_t sync_serial_write(struct file * file, const char * buf, 789static ssize_t sync_serial_write(struct file * file, const char * buf,
790 size_t count, loff_t *ppos) 790 size_t count, loff_t *ppos)
791{ 791{
792 int dev = MINOR(file->f_dentry->d_inode->i_rdev); 792 int dev = iminor(file->f_dentry->d_inode);
793 DECLARE_WAITQUEUE(wait, current); 793 DECLARE_WAITQUEUE(wait, current);
794 sync_port *port; 794 sync_port *port;
795 unsigned long c, c1; 795 unsigned long c, c1;
@@ -919,7 +919,7 @@ static ssize_t sync_serial_write(struct file * file, const char * buf,
919static ssize_t sync_serial_read(struct file * file, char * buf, 919static ssize_t sync_serial_read(struct file * file, char * buf,
920 size_t count, loff_t *ppos) 920 size_t count, loff_t *ppos)
921{ 921{
922 int dev = MINOR(file->f_dentry->d_inode->i_rdev); 922 int dev = iminor(file->f_dentry->d_inode);
923 int avail; 923 int avail;
924 sync_port *port; 924 sync_port *port;
925 unsigned char* start; 925 unsigned char* start;
diff --git a/arch/cris/kernel/setup.c b/arch/cris/kernel/setup.c
index 6d941fb9f379..7af3d5d43e43 100644
--- a/arch/cris/kernel/setup.c
+++ b/arch/cris/kernel/setup.c
@@ -15,7 +15,7 @@
15#include <linux/bootmem.h> 15#include <linux/bootmem.h>
16#include <asm/pgtable.h> 16#include <asm/pgtable.h>
17#include <linux/seq_file.h> 17#include <linux/seq_file.h>
18#include <linux/tty.h> 18#include <linux/screen_info.h>
19#include <linux/utsname.h> 19#include <linux/utsname.h>
20#include <linux/pfn.h> 20#include <linux/pfn.h>
21 21
diff --git a/arch/frv/kernel/asm-offsets.c b/arch/frv/kernel/asm-offsets.c
index 9e263112a6e2..fbb19fc1af40 100644
--- a/arch/frv/kernel/asm-offsets.c
+++ b/arch/frv/kernel/asm-offsets.c
@@ -1 +1,115 @@
1/* Dummy asm-offsets.c file. Required by kbuild and ready to be used - hint! */ 1/*
2 * Generate definitions needed by assembly language modules.
3 * This code generates raw asm output which is post-processed
4 * to extract and format the required data.
5 */
6
7#include <linux/sched.h>
8#include <linux/signal.h>
9#include <linux/personality.h>
10#include <asm/registers.h>
11#include <asm/ucontext.h>
12#include <asm/processor.h>
13#include <asm/thread_info.h>
14#include <asm/gdb-stub.h>
15
16#define DEFINE(sym, val) \
17 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
18
19#define DEF_PTREG(sym, reg) \
20 asm volatile("\n->" #sym " %0 offsetof(struct pt_regs, " #reg ")" \
21 : : "i" (offsetof(struct pt_regs, reg)))
22
23#define DEF_IREG(sym, reg) \
24 asm volatile("\n->" #sym " %0 offsetof(struct user_context, " #reg ")" \
25 : : "i" (offsetof(struct user_context, reg)))
26
27#define DEF_FREG(sym, reg) \
28 asm volatile("\n->" #sym " %0 offsetof(struct user_context, " #reg ")" \
29 : : "i" (offsetof(struct user_context, reg)))
30
31#define DEF_0REG(sym, reg) \
32 asm volatile("\n->" #sym " %0 offsetof(struct frv_frame0, " #reg ")" \
33 : : "i" (offsetof(struct frv_frame0, reg)))
34
35#define BLANK() asm volatile("\n->" : : )
36
37#define OFFSET(sym, str, mem) \
38 DEFINE(sym, offsetof(struct str, mem));
39
40void foo(void)
41{
42 /* offsets into the thread_info structure */
43 OFFSET(TI_TASK, thread_info, task);
44 OFFSET(TI_EXEC_DOMAIN, thread_info, exec_domain);
45 OFFSET(TI_FLAGS, thread_info, flags);
46 OFFSET(TI_STATUS, thread_info, status);
47 OFFSET(TI_CPU, thread_info, cpu);
48 OFFSET(TI_PREEMPT_COUNT, thread_info, preempt_count);
49 OFFSET(TI_ADDR_LIMIT, thread_info, addr_limit);
50 OFFSET(TI_RESTART_BLOCK, thread_info, restart_block);
51 BLANK();
52
53 /* offsets into register file storage */
54 DEF_PTREG(REG_PSR, psr);
55 DEF_PTREG(REG_ISR, isr);
56 DEF_PTREG(REG_CCR, ccr);
57 DEF_PTREG(REG_CCCR, cccr);
58 DEF_PTREG(REG_LR, lr);
59 DEF_PTREG(REG_LCR, lcr);
60 DEF_PTREG(REG_PC, pc);
61 DEF_PTREG(REG__STATUS, __status);
62 DEF_PTREG(REG_SYSCALLNO, syscallno);
63 DEF_PTREG(REG_ORIG_GR8, orig_gr8);
64 DEF_PTREG(REG_GNER0, gner0);
65 DEF_PTREG(REG_GNER1, gner1);
66 DEF_PTREG(REG_IACC0, iacc0);
67 DEF_PTREG(REG_TBR, tbr);
68 DEF_PTREG(REG_GR0, tbr);
69 DEFINE(REG__END, sizeof(struct pt_regs));
70 BLANK();
71
72 DEF_0REG(REG_DCR, debug.dcr);
73 DEF_0REG(REG_IBAR0, debug.ibar[0]);
74 DEF_0REG(REG_DBAR0, debug.dbar[0]);
75 DEF_0REG(REG_DBDR00, debug.dbdr[0][0]);
76 DEF_0REG(REG_DBMR00, debug.dbmr[0][0]);
77 BLANK();
78
79 DEF_IREG(__INT_GR0, i.gr[0]);
80 DEF_FREG(__USER_FPMEDIA, f);
81 DEF_FREG(__FPMEDIA_FR0, f.fr[0]);
82 DEF_FREG(__FPMEDIA_FNER0, f.fner[0]);
83 DEF_FREG(__FPMEDIA_MSR0, f.msr[0]);
84 DEF_FREG(__FPMEDIA_ACC0, f.acc[0]);
85 DEF_FREG(__FPMEDIA_ACCG0, f.accg[0]);
86 DEF_FREG(__FPMEDIA_FSR0, f.fsr[0]);
87 BLANK();
88
89 DEFINE(NR_PT_REGS, sizeof(struct pt_regs) / 4);
90 DEFINE(NR_USER_INT_REGS, sizeof(struct user_int_regs) / 4);
91 DEFINE(NR_USER_FPMEDIA_REGS, sizeof(struct user_fpmedia_regs) / 4);
92 DEFINE(NR_USER_CONTEXT, sizeof(struct user_context) / 4);
93 DEFINE(FRV_FRAME0_SIZE, sizeof(struct frv_frame0));
94 BLANK();
95
96 /* offsets into thread_struct */
97 OFFSET(__THREAD_FRAME, thread_struct, frame);
98 OFFSET(__THREAD_CURR, thread_struct, curr);
99 OFFSET(__THREAD_SP, thread_struct, sp);
100 OFFSET(__THREAD_FP, thread_struct, fp);
101 OFFSET(__THREAD_LR, thread_struct, lr);
102 OFFSET(__THREAD_PC, thread_struct, pc);
103 OFFSET(__THREAD_GR16, thread_struct, gr[0]);
104 OFFSET(__THREAD_SCHED_LR, thread_struct, sched_lr);
105 OFFSET(__THREAD_FRAME0, thread_struct, frame0);
106 OFFSET(__THREAD_USER, thread_struct, user);
107 BLANK();
108
109 /* offsets into frv_debug_status */
110 OFFSET(DEBUG_BPSR, frv_debug_status, bpsr);
111 OFFSET(DEBUG_DCR, frv_debug_status, dcr);
112 OFFSET(DEBUG_BRR, frv_debug_status, brr);
113 OFFSET(DEBUG_NMAR, frv_debug_status, nmar);
114 BLANK();
115}
diff --git a/arch/frv/kernel/break.S b/arch/frv/kernel/break.S
index ea161f0ca427..dac4a5f68c2e 100644
--- a/arch/frv/kernel/break.S
+++ b/arch/frv/kernel/break.S
@@ -9,11 +9,11 @@
9 * 2 of the License, or (at your option) any later version. 9 * 2 of the License, or (at your option) any later version.
10 */ 10 */
11 11
12#include <linux/sys.h>
13#include <linux/linkage.h> 12#include <linux/linkage.h>
14#include <asm/setup.h> 13#include <asm/setup.h>
15#include <asm/segment.h> 14#include <asm/segment.h>
16#include <asm/ptrace.h> 15#include <asm/ptrace.h>
16#include <asm/thread_info.h>
17#include <asm/spr-regs.h> 17#include <asm/spr-regs.h>
18 18
19#include <asm/errno.h> 19#include <asm/errno.h>
@@ -23,13 +23,11 @@
23# 23#
24 .section .bss.stack 24 .section .bss.stack
25 .globl __break_user_context 25 .globl __break_user_context
26 .balign 8192 26 .balign THREAD_SIZE
27__break_stack: 27__break_stack:
28 .space (8192 - (USER_CONTEXT_SIZE + REG__DEBUG_XTRA)) & ~7 28 .space THREAD_SIZE - FRV_FRAME0_SIZE
29__break_stack_tos: 29__break_frame_0:
30 .space REG__DEBUG_XTRA 30 .space FRV_FRAME0_SIZE
31__break_user_context:
32 .space USER_CONTEXT_SIZE
33 31
34# 32#
35# miscellaneous variables 33# miscellaneous variables
@@ -74,8 +72,8 @@ __entry_break:
74#endif 72#endif
75 LEDS 0x1001,gr31 73 LEDS 0x1001,gr31
76 74
77 sethi.p %hi(__break_user_context),gr31 75 sethi.p %hi(__break_frame_0),gr31
78 setlo %lo(__break_user_context),gr31 76 setlo %lo(__break_frame_0),gr31
79 77
80 stdi gr2,@(gr31,#REG_GR(2)) 78 stdi gr2,@(gr31,#REG_GR(2))
81 movsg ccr,gr3 79 movsg ccr,gr3
@@ -585,8 +583,8 @@ __break_continue:
585 # set up the kernel stack pointer 583 # set up the kernel stack pointer
586 sti sp,@(gr31,#REG_SP) 584 sti sp,@(gr31,#REG_SP)
587 585
588 sethi.p %hi(__break_stack_tos),sp 586 sethi.p %hi(__break_frame_0),sp
589 setlo %lo(__break_stack_tos),sp 587 setlo %lo(__break_frame_0),sp
590 588
591 # finish building the exception frame 589 # finish building the exception frame
592 stdi gr4 ,@(gr31,#REG_GR(4)) 590 stdi gr4 ,@(gr31,#REG_GR(4))
@@ -651,9 +649,12 @@ __break_continue:
651 movsg nmar,gr5 649 movsg nmar,gr5
652 movsg dcr,gr6 650 movsg dcr,gr6
653 651
654 stdi gr4 ,@(gr31,#REG_BRR) 652 sethi.p %hi(__debug_status),gr7
655 sti gr19,@(gr31,#REG_BPSR) 653 setlo %lo(__debug_status),gr7
656 sti.p gr6 ,@(gr31,#REG_DCR) 654
655 stdi gr4 ,@(gr7,#DEBUG_BRR)
656 sti gr19,@(gr7,#DEBUG_BPSR)
657 sti.p gr6 ,@(gr7,#DEBUG_DCR)
657 658
658 # trap exceptions during break handling and disable h/w breakpoints/watchpoints 659 # trap exceptions during break handling and disable h/w breakpoints/watchpoints
659 sethi %hi(DCR_EBE),gr5 660 sethi %hi(DCR_EBE),gr5
@@ -698,7 +699,10 @@ __break_continue:
698 lddi @(gr31,#REG_PSR) ,gr22 699 lddi @(gr31,#REG_PSR) ,gr22
699 ldi @(gr31,#REG_PC) ,gr21 700 ldi @(gr31,#REG_PC) ,gr21
700 ldi @(gr31,#REG_TBR) ,gr20 701 ldi @(gr31,#REG_TBR) ,gr20
701 ldi.p @(gr31,#REG_DCR) ,gr6 702
703 sethi.p %hi(__debug_status),gr6
704 setlo %lo(__debug_status),gr6
705 ldi.p @(gr6,#DEBUG_DCR) ,gr6
702 706
703 andi gr22,#PSR_S,gr19 /* rebuild BPSR */ 707 andi gr22,#PSR_S,gr19 /* rebuild BPSR */
704 andi.p gr22,#PSR_ET,gr5 708 andi.p gr22,#PSR_ET,gr5
diff --git a/arch/frv/kernel/debug-stub.c b/arch/frv/kernel/debug-stub.c
index 4761cc4b4a90..2f6c60c921e0 100644
--- a/arch/frv/kernel/debug-stub.c
+++ b/arch/frv/kernel/debug-stub.c
@@ -39,10 +39,9 @@ do { \
39 gdbstub_do_rx(); \ 39 gdbstub_do_rx(); \
40} while(!FLOWCTL_QUERY(LINE)) 40} while(!FLOWCTL_QUERY(LINE))
41 41
42static void __init debug_stub_init(void); 42struct frv_debug_status __debug_status;
43 43
44extern asmlinkage void __break_hijack_kernel_event(void); 44static void __init debug_stub_init(void);
45extern asmlinkage void __break_hijack_kernel_event_breaks_here(void);
46 45
47/*****************************************************************************/ 46/*****************************************************************************/
48/* 47/*
@@ -67,7 +66,7 @@ asmlinkage void debug_stub(void)
67 __set_HSR(0, hsr0 & ~HSR0_ETMD); 66 __set_HSR(0, hsr0 & ~HSR0_ETMD);
68 67
69 /* disable single stepping */ 68 /* disable single stepping */
70 __debug_regs->dcr &= ~DCR_SE; 69 __debug_status.dcr &= ~DCR_SE;
71 70
72 /* kernel mode can propose an exception be handled in debug mode by jumping to a special 71 /* kernel mode can propose an exception be handled in debug mode by jumping to a special
73 * location */ 72 * location */
@@ -76,8 +75,8 @@ asmlinkage void debug_stub(void)
76 * the top kernel context */ 75 * the top kernel context */
77 *__debug_frame = *__frame; 76 *__debug_frame = *__frame;
78 __frame = __debug_frame->next_frame; 77 __frame = __debug_frame->next_frame;
79 __debug_regs->brr = (__debug_frame->tbr & TBR_TT) << 12; 78 __debug_status.brr = (__debug_frame->tbr & TBR_TT) << 12;
80 __debug_regs->brr |= BRR_EB; 79 __debug_status.brr |= BRR_EB;
81 } 80 }
82 81
83 if (__debug_frame->pc == (unsigned long) __debug_bug_trap + 4) { 82 if (__debug_frame->pc == (unsigned long) __debug_bug_trap + 4) {
@@ -124,7 +123,7 @@ static void __init debug_stub_init(void)
124 __debug_frame->pc = (unsigned long) start_kernel; 123 __debug_frame->pc = (unsigned long) start_kernel;
125 124
126 /* enable the debug events we want to trap */ 125 /* enable the debug events we want to trap */
127 __debug_regs->dcr = DCR_EBE; 126 __debug_status.dcr = DCR_EBE;
128 127
129#ifdef CONFIG_GDBSTUB 128#ifdef CONFIG_GDBSTUB
130 gdbstub_init(); 129 gdbstub_init();
diff --git a/arch/frv/kernel/entry.S b/arch/frv/kernel/entry.S
index 2a1ff1ff8692..940ac306e9a0 100644
--- a/arch/frv/kernel/entry.S
+++ b/arch/frv/kernel/entry.S
@@ -27,7 +27,6 @@
27 * 27 *
28 */ 28 */
29 29
30#include <linux/sys.h>
31#include <linux/linkage.h> 30#include <linux/linkage.h>
32#include <asm/thread_info.h> 31#include <asm/thread_info.h>
33#include <asm/setup.h> 32#include <asm/setup.h>
diff --git a/arch/frv/kernel/gdb-stub.c b/arch/frv/kernel/gdb-stub.c
index 508601fad079..9550f37fb62c 100644
--- a/arch/frv/kernel/gdb-stub.c
+++ b/arch/frv/kernel/gdb-stub.c
@@ -124,6 +124,7 @@
124#include <linux/slab.h> 124#include <linux/slab.h>
125#include <linux/nmi.h> 125#include <linux/nmi.h>
126 126
127#include <asm/asm-offsets.h>
127#include <asm/pgtable.h> 128#include <asm/pgtable.h>
128#include <asm/system.h> 129#include <asm/system.h>
129#include <asm/gdb-stub.h> 130#include <asm/gdb-stub.h>
@@ -136,7 +137,6 @@ extern void debug_to_serial(const char *p, int n);
136extern void gdbstub_console_write(struct console *co, const char *p, unsigned n); 137extern void gdbstub_console_write(struct console *co, const char *p, unsigned n);
137 138
138extern volatile uint32_t __break_error_detect[3]; /* ESFR1, ESR15, EAR15 */ 139extern volatile uint32_t __break_error_detect[3]; /* ESFR1, ESR15, EAR15 */
139extern struct user_context __break_user_context;
140 140
141struct __debug_amr { 141struct __debug_amr {
142 unsigned long L, P; 142 unsigned long L, P;
@@ -926,6 +926,7 @@ static int gdbstub_set_breakpoint(unsigned long type, unsigned long addr, unsign
926 if (!(__debug_regs->dcr & DCR_IBE0)) { 926 if (!(__debug_regs->dcr & DCR_IBE0)) {
927 //gdbstub_printk("set h/w break 0: %08lx\n", addr); 927 //gdbstub_printk("set h/w break 0: %08lx\n", addr);
928 __debug_regs->dcr |= DCR_IBE0; 928 __debug_regs->dcr |= DCR_IBE0;
929 __debug_regs->ibar[0] = addr;
929 asm volatile("movgs %0,ibar0" : : "r"(addr)); 930 asm volatile("movgs %0,ibar0" : : "r"(addr));
930 return 0; 931 return 0;
931 } 932 }
@@ -933,6 +934,7 @@ static int gdbstub_set_breakpoint(unsigned long type, unsigned long addr, unsign
933 if (!(__debug_regs->dcr & DCR_IBE1)) { 934 if (!(__debug_regs->dcr & DCR_IBE1)) {
934 //gdbstub_printk("set h/w break 1: %08lx\n", addr); 935 //gdbstub_printk("set h/w break 1: %08lx\n", addr);
935 __debug_regs->dcr |= DCR_IBE1; 936 __debug_regs->dcr |= DCR_IBE1;
937 __debug_regs->ibar[1] = addr;
936 asm volatile("movgs %0,ibar1" : : "r"(addr)); 938 asm volatile("movgs %0,ibar1" : : "r"(addr));
937 return 0; 939 return 0;
938 } 940 }
@@ -940,6 +942,7 @@ static int gdbstub_set_breakpoint(unsigned long type, unsigned long addr, unsign
940 if (!(__debug_regs->dcr & DCR_IBE2)) { 942 if (!(__debug_regs->dcr & DCR_IBE2)) {
941 //gdbstub_printk("set h/w break 2: %08lx\n", addr); 943 //gdbstub_printk("set h/w break 2: %08lx\n", addr);
942 __debug_regs->dcr |= DCR_IBE2; 944 __debug_regs->dcr |= DCR_IBE2;
945 __debug_regs->ibar[2] = addr;
943 asm volatile("movgs %0,ibar2" : : "r"(addr)); 946 asm volatile("movgs %0,ibar2" : : "r"(addr));
944 return 0; 947 return 0;
945 } 948 }
@@ -947,6 +950,7 @@ static int gdbstub_set_breakpoint(unsigned long type, unsigned long addr, unsign
947 if (!(__debug_regs->dcr & DCR_IBE3)) { 950 if (!(__debug_regs->dcr & DCR_IBE3)) {
948 //gdbstub_printk("set h/w break 3: %08lx\n", addr); 951 //gdbstub_printk("set h/w break 3: %08lx\n", addr);
949 __debug_regs->dcr |= DCR_IBE3; 952 __debug_regs->dcr |= DCR_IBE3;
953 __debug_regs->ibar[3] = addr;
950 asm volatile("movgs %0,ibar3" : : "r"(addr)); 954 asm volatile("movgs %0,ibar3" : : "r"(addr));
951 return 0; 955 return 0;
952 } 956 }
@@ -971,7 +975,14 @@ static int gdbstub_set_breakpoint(unsigned long type, unsigned long addr, unsign
971 if (!(__debug_regs->dcr & (DCR_DRBE0|DCR_DWBE0))) { 975 if (!(__debug_regs->dcr & (DCR_DRBE0|DCR_DWBE0))) {
972 //gdbstub_printk("set h/w watchpoint 0 type %ld: %08lx\n", type, addr); 976 //gdbstub_printk("set h/w watchpoint 0 type %ld: %08lx\n", type, addr);
973 tmp = type==2 ? DCR_DWBE0 : type==3 ? DCR_DRBE0 : DCR_DRBE0|DCR_DWBE0; 977 tmp = type==2 ? DCR_DWBE0 : type==3 ? DCR_DRBE0 : DCR_DRBE0|DCR_DWBE0;
978
974 __debug_regs->dcr |= tmp; 979 __debug_regs->dcr |= tmp;
980 __debug_regs->dbar[0] = addr;
981 __debug_regs->dbmr[0][0] = dbmr.mask0;
982 __debug_regs->dbmr[0][1] = dbmr.mask1;
983 __debug_regs->dbdr[0][0] = 0;
984 __debug_regs->dbdr[0][1] = 0;
985
975 asm volatile(" movgs %0,dbar0 \n" 986 asm volatile(" movgs %0,dbar0 \n"
976 " movgs %1,dbmr00 \n" 987 " movgs %1,dbmr00 \n"
977 " movgs %2,dbmr01 \n" 988 " movgs %2,dbmr01 \n"
@@ -984,7 +995,14 @@ static int gdbstub_set_breakpoint(unsigned long type, unsigned long addr, unsign
984 if (!(__debug_regs->dcr & (DCR_DRBE1|DCR_DWBE1))) { 995 if (!(__debug_regs->dcr & (DCR_DRBE1|DCR_DWBE1))) {
985 //gdbstub_printk("set h/w watchpoint 1 type %ld: %08lx\n", type, addr); 996 //gdbstub_printk("set h/w watchpoint 1 type %ld: %08lx\n", type, addr);
986 tmp = type==2 ? DCR_DWBE1 : type==3 ? DCR_DRBE1 : DCR_DRBE1|DCR_DWBE1; 997 tmp = type==2 ? DCR_DWBE1 : type==3 ? DCR_DRBE1 : DCR_DRBE1|DCR_DWBE1;
998
987 __debug_regs->dcr |= tmp; 999 __debug_regs->dcr |= tmp;
1000 __debug_regs->dbar[1] = addr;
1001 __debug_regs->dbmr[1][0] = dbmr.mask0;
1002 __debug_regs->dbmr[1][1] = dbmr.mask1;
1003 __debug_regs->dbdr[1][0] = 0;
1004 __debug_regs->dbdr[1][1] = 0;
1005
988 asm volatile(" movgs %0,dbar1 \n" 1006 asm volatile(" movgs %0,dbar1 \n"
989 " movgs %1,dbmr10 \n" 1007 " movgs %1,dbmr10 \n"
990 " movgs %2,dbmr11 \n" 1008 " movgs %2,dbmr11 \n"
@@ -1047,6 +1065,7 @@ int gdbstub_clear_breakpoint(unsigned long type, unsigned long addr, unsigned lo
1047 if (__debug_regs->dcr & DCR_IBE0 && __get_ibar(0) == addr) { 1065 if (__debug_regs->dcr & DCR_IBE0 && __get_ibar(0) == addr) {
1048 //gdbstub_printk("clear h/w break 0: %08lx\n", addr); 1066 //gdbstub_printk("clear h/w break 0: %08lx\n", addr);
1049 __debug_regs->dcr &= ~DCR_IBE0; 1067 __debug_regs->dcr &= ~DCR_IBE0;
1068 __debug_regs->ibar[0] = 0;
1050 asm volatile("movgs gr0,ibar0"); 1069 asm volatile("movgs gr0,ibar0");
1051 return 0; 1070 return 0;
1052 } 1071 }
@@ -1054,6 +1073,7 @@ int gdbstub_clear_breakpoint(unsigned long type, unsigned long addr, unsigned lo
1054 if (__debug_regs->dcr & DCR_IBE1 && __get_ibar(1) == addr) { 1073 if (__debug_regs->dcr & DCR_IBE1 && __get_ibar(1) == addr) {
1055 //gdbstub_printk("clear h/w break 1: %08lx\n", addr); 1074 //gdbstub_printk("clear h/w break 1: %08lx\n", addr);
1056 __debug_regs->dcr &= ~DCR_IBE1; 1075 __debug_regs->dcr &= ~DCR_IBE1;
1076 __debug_regs->ibar[1] = 0;
1057 asm volatile("movgs gr0,ibar1"); 1077 asm volatile("movgs gr0,ibar1");
1058 return 0; 1078 return 0;
1059 } 1079 }
@@ -1061,6 +1081,7 @@ int gdbstub_clear_breakpoint(unsigned long type, unsigned long addr, unsigned lo
1061 if (__debug_regs->dcr & DCR_IBE2 && __get_ibar(2) == addr) { 1081 if (__debug_regs->dcr & DCR_IBE2 && __get_ibar(2) == addr) {
1062 //gdbstub_printk("clear h/w break 2: %08lx\n", addr); 1082 //gdbstub_printk("clear h/w break 2: %08lx\n", addr);
1063 __debug_regs->dcr &= ~DCR_IBE2; 1083 __debug_regs->dcr &= ~DCR_IBE2;
1084 __debug_regs->ibar[2] = 0;
1064 asm volatile("movgs gr0,ibar2"); 1085 asm volatile("movgs gr0,ibar2");
1065 return 0; 1086 return 0;
1066 } 1087 }
@@ -1068,6 +1089,7 @@ int gdbstub_clear_breakpoint(unsigned long type, unsigned long addr, unsigned lo
1068 if (__debug_regs->dcr & DCR_IBE3 && __get_ibar(3) == addr) { 1089 if (__debug_regs->dcr & DCR_IBE3 && __get_ibar(3) == addr) {
1069 //gdbstub_printk("clear h/w break 3: %08lx\n", addr); 1090 //gdbstub_printk("clear h/w break 3: %08lx\n", addr);
1070 __debug_regs->dcr &= ~DCR_IBE3; 1091 __debug_regs->dcr &= ~DCR_IBE3;
1092 __debug_regs->ibar[3] = 0;
1071 asm volatile("movgs gr0,ibar3"); 1093 asm volatile("movgs gr0,ibar3");
1072 return 0; 1094 return 0;
1073 } 1095 }
@@ -1104,6 +1126,12 @@ int gdbstub_clear_breakpoint(unsigned long type, unsigned long addr, unsigned lo
1104 1126
1105 //gdbstub_printk("clear h/w watchpoint 0 type %ld: %08lx\n", type, addr); 1127 //gdbstub_printk("clear h/w watchpoint 0 type %ld: %08lx\n", type, addr);
1106 __debug_regs->dcr &= ~(DCR_DRBE0|DCR_DWBE0); 1128 __debug_regs->dcr &= ~(DCR_DRBE0|DCR_DWBE0);
1129 __debug_regs->dbar[0] = 0;
1130 __debug_regs->dbmr[0][0] = 0;
1131 __debug_regs->dbmr[0][1] = 0;
1132 __debug_regs->dbdr[0][0] = 0;
1133 __debug_regs->dbdr[0][1] = 0;
1134
1107 asm volatile(" movgs gr0,dbar0 \n" 1135 asm volatile(" movgs gr0,dbar0 \n"
1108 " movgs gr0,dbmr00 \n" 1136 " movgs gr0,dbmr00 \n"
1109 " movgs gr0,dbmr01 \n" 1137 " movgs gr0,dbmr01 \n"
@@ -1123,6 +1151,12 @@ int gdbstub_clear_breakpoint(unsigned long type, unsigned long addr, unsigned lo
1123 1151
1124 //gdbstub_printk("clear h/w watchpoint 1 type %ld: %08lx\n", type, addr); 1152 //gdbstub_printk("clear h/w watchpoint 1 type %ld: %08lx\n", type, addr);
1125 __debug_regs->dcr &= ~(DCR_DRBE1|DCR_DWBE1); 1153 __debug_regs->dcr &= ~(DCR_DRBE1|DCR_DWBE1);
1154 __debug_regs->dbar[1] = 0;
1155 __debug_regs->dbmr[1][0] = 0;
1156 __debug_regs->dbmr[1][1] = 0;
1157 __debug_regs->dbdr[1][0] = 0;
1158 __debug_regs->dbdr[1][1] = 0;
1159
1126 asm volatile(" movgs gr0,dbar1 \n" 1160 asm volatile(" movgs gr0,dbar1 \n"
1127 " movgs gr0,dbmr10 \n" 1161 " movgs gr0,dbmr10 \n"
1128 " movgs gr0,dbmr11 \n" 1162 " movgs gr0,dbmr11 \n"
@@ -1163,7 +1197,7 @@ static void gdbstub_check_breakpoint(void)
1163 */ 1197 */
1164static void __attribute__((unused)) gdbstub_show_regs(void) 1198static void __attribute__((unused)) gdbstub_show_regs(void)
1165{ 1199{
1166 uint32_t *reg; 1200 unsigned long *reg;
1167 int loop; 1201 int loop;
1168 1202
1169 gdbstub_printk("\n"); 1203 gdbstub_printk("\n");
@@ -1172,11 +1206,11 @@ static void __attribute__((unused)) gdbstub_show_regs(void)
1172 __debug_frame, 1206 __debug_frame,
1173 __debug_frame->psr & PSR_S ? "kernel" : "user"); 1207 __debug_frame->psr & PSR_S ? "kernel" : "user");
1174 1208
1175 reg = (uint32_t *) __debug_frame; 1209 reg = (unsigned long *) __debug_frame;
1176 for (loop = 0; loop < REG__END; loop++) { 1210 for (loop = 0; loop < NR_PT_REGS; loop++) {
1177 printk("%s %08x", regnames[loop + 0], reg[loop + 0]); 1211 printk("%s %08lx", regnames[loop + 0], reg[loop + 0]);
1178 1212
1179 if (loop == REG__END - 1 || loop % 5 == 4) 1213 if (loop == NR_PT_REGS - 1 || loop % 5 == 4)
1180 printk("\n"); 1214 printk("\n");
1181 else 1215 else
1182 printk(" | "); 1216 printk(" | ");
@@ -1191,13 +1225,8 @@ static void __attribute__((unused)) gdbstub_show_regs(void)
1191 */ 1225 */
1192static void __attribute__((unused)) gdbstub_dump_debugregs(void) 1226static void __attribute__((unused)) gdbstub_dump_debugregs(void)
1193{ 1227{
1194 unsigned long x; 1228 gdbstub_printk("DCR %08lx ", __debug_status.dcr);
1195 1229 gdbstub_printk("BRR %08lx\n", __debug_status.brr);
1196 x = __debug_regs->dcr;
1197 gdbstub_printk("DCR %08lx ", x);
1198
1199 x = __debug_regs->brr;
1200 gdbstub_printk("BRR %08lx\n", x);
1201 1230
1202 gdbstub_printk("IBAR0 %08lx ", __get_ibar(0)); 1231 gdbstub_printk("IBAR0 %08lx ", __get_ibar(0));
1203 gdbstub_printk("IBAR1 %08lx ", __get_ibar(1)); 1232 gdbstub_printk("IBAR1 %08lx ", __get_ibar(1));
@@ -1360,7 +1389,7 @@ void gdbstub(int sigval)
1360#endif 1389#endif
1361 } 1390 }
1362 1391
1363 save_user_regs(&__break_user_context); 1392 save_user_regs(&__debug_frame0->uc);
1364 1393
1365#if 0 1394#if 0
1366 gdbstub_printk("--> gdbstub() %08x %p %08x %08x\n", 1395 gdbstub_printk("--> gdbstub() %08x %p %08x %08x\n",
@@ -1389,8 +1418,8 @@ void gdbstub(int sigval)
1389 __debug_frame->psr &= ~PSR_S; 1418 __debug_frame->psr &= ~PSR_S;
1390 if (__debug_frame->psr & PSR_PS) 1419 if (__debug_frame->psr & PSR_PS)
1391 __debug_frame->psr |= PSR_S; 1420 __debug_frame->psr |= PSR_S;
1392 __debug_regs->brr = (__debug_frame->tbr & TBR_TT) << 12; 1421 __debug_status.brr = (__debug_frame->tbr & TBR_TT) << 12;
1393 __debug_regs->brr |= BRR_EB; 1422 __debug_status.brr |= BRR_EB;
1394 sigval = SIGINT; 1423 sigval = SIGINT;
1395 } 1424 }
1396 1425
@@ -1404,15 +1433,15 @@ void gdbstub(int sigval)
1404 __debug_frame->psr &= ~PSR_S; 1433 __debug_frame->psr &= ~PSR_S;
1405 if (__debug_frame->psr & PSR_PS) 1434 if (__debug_frame->psr & PSR_PS)
1406 __debug_frame->psr |= PSR_S; 1435 __debug_frame->psr |= PSR_S;
1407 __debug_regs->brr = (__debug_frame->tbr & TBR_TT) << 12; 1436 __debug_status.brr = (__debug_frame->tbr & TBR_TT) << 12;
1408 __debug_regs->brr |= BRR_EB; 1437 __debug_status.brr |= BRR_EB;
1409 sigval = SIGXCPU; 1438 sigval = SIGXCPU;
1410 } 1439 }
1411 1440
1412 LEDS(0x5002); 1441 LEDS(0x5002);
1413 1442
1414 /* after a BREAK insn, the PC lands on the far side of it */ 1443 /* after a BREAK insn, the PC lands on the far side of it */
1415 if (__debug_regs->brr & BRR_SB) 1444 if (__debug_status.brr & BRR_SB)
1416 gdbstub_check_breakpoint(); 1445 gdbstub_check_breakpoint();
1417 1446
1418 LEDS(0x5003); 1447 LEDS(0x5003);
@@ -1431,7 +1460,7 @@ void gdbstub(int sigval)
1431 } 1460 }
1432 1461
1433 if (!sigval) 1462 if (!sigval)
1434 sigval = gdbstub_compute_signal(__debug_regs->brr); 1463 sigval = gdbstub_compute_signal(__debug_status.brr);
1435 1464
1436 LEDS(0x5004); 1465 LEDS(0x5004);
1437 1466
@@ -1441,7 +1470,7 @@ void gdbstub(int sigval)
1441 if (sigval != SIGINT && sigval != SIGTRAP && sigval != SIGILL) { 1470 if (sigval != SIGINT && sigval != SIGTRAP && sigval != SIGILL) {
1442 static const char title[] = "Break "; 1471 static const char title[] = "Break ";
1443 static const char crlf[] = "\r\n"; 1472 static const char crlf[] = "\r\n";
1444 unsigned long brr = __debug_regs->brr; 1473 unsigned long brr = __debug_status.brr;
1445 char hx; 1474 char hx;
1446 1475
1447 ptr = output_buffer; 1476 ptr = output_buffer;
@@ -1565,28 +1594,24 @@ void gdbstub(int sigval)
1565 ptr = mem2hex(&zero, ptr, 4, 0); 1594 ptr = mem2hex(&zero, ptr, 4, 0);
1566 1595
1567 for (loop = 1; loop <= 27; loop++) 1596 for (loop = 1; loop <= 27; loop++)
1568 ptr = mem2hex((unsigned long *)__debug_frame + REG_GR(loop), 1597 ptr = mem2hex(&__debug_user_context->i.gr[loop], ptr, 4, 0);
1569 ptr, 4, 0);
1570 temp = (unsigned long) __frame; 1598 temp = (unsigned long) __frame;
1571 ptr = mem2hex(&temp, ptr, 4, 0); 1599 ptr = mem2hex(&temp, ptr, 4, 0);
1572 ptr = mem2hex((unsigned long *)__debug_frame + REG_GR(29), ptr, 4, 0); 1600 ptr = mem2hex(&__debug_user_context->i.gr[29], ptr, 4, 0);
1573 ptr = mem2hex((unsigned long *)__debug_frame + REG_GR(30), ptr, 4, 0); 1601 ptr = mem2hex(&__debug_user_context->i.gr[30], ptr, 4, 0);
1574#ifdef CONFIG_MMU 1602#ifdef CONFIG_MMU
1575 ptr = mem2hex((unsigned long *)__debug_frame + REG_GR(31), ptr, 4, 0); 1603 ptr = mem2hex(&__debug_user_context->i.gr[31], ptr, 4, 0);
1576#else 1604#else
1577 temp = (unsigned long) __debug_frame; 1605 temp = (unsigned long) __debug_frame;
1578 ptr = mem2hex(&temp, ptr, 4, 0); 1606 ptr = mem2hex(&temp, ptr, 4, 0);
1579#endif 1607#endif
1580 1608
1581 for (loop = 32; loop <= 63; loop++) 1609 for (loop = 32; loop <= 63; loop++)
1582 ptr = mem2hex((unsigned long *)__debug_frame + REG_GR(loop), 1610 ptr = mem2hex(&__debug_user_context->i.gr[loop], ptr, 4, 0);
1583 ptr, 4, 0);
1584 1611
1585 /* deal with FR0-FR63 */ 1612 /* deal with FR0-FR63 */
1586 for (loop = 0; loop <= 63; loop++) 1613 for (loop = 0; loop <= 63; loop++)
1587 ptr = mem2hex((unsigned long *)&__break_user_context + 1614 ptr = mem2hex(&__debug_user_context->f.fr[loop], ptr, 4, 0);
1588 __FPMEDIA_FR(loop),
1589 ptr, 4, 0);
1590 1615
1591 /* deal with special registers */ 1616 /* deal with special registers */
1592 ptr = mem2hex(&__debug_frame->pc, ptr, 4, 0); 1617 ptr = mem2hex(&__debug_frame->pc, ptr, 4, 0);
@@ -1597,7 +1622,7 @@ void gdbstub(int sigval)
1597 ptr = mem2hex(&zero, ptr, 4, 0); 1622 ptr = mem2hex(&zero, ptr, 4, 0);
1598 ptr = mem2hex(&zero, ptr, 4, 0); 1623 ptr = mem2hex(&zero, ptr, 4, 0);
1599 ptr = mem2hex(&__debug_frame->tbr, ptr, 4, 0); 1624 ptr = mem2hex(&__debug_frame->tbr, ptr, 4, 0);
1600 ptr = mem2hex(&__debug_regs->brr , ptr, 4, 0); 1625 ptr = mem2hex(&__debug_status.brr , ptr, 4, 0);
1601 1626
1602 asm volatile("movsg dbar0,%0" : "=r"(dbar)); 1627 asm volatile("movsg dbar0,%0" : "=r"(dbar));
1603 ptr = mem2hex(&dbar, ptr, 4, 0); 1628 ptr = mem2hex(&dbar, ptr, 4, 0);
@@ -1622,21 +1647,21 @@ void gdbstub(int sigval)
1622 1647
1623 ptr = mem2hex(&__debug_frame->iacc0, ptr, 8, 0); 1648 ptr = mem2hex(&__debug_frame->iacc0, ptr, 8, 0);
1624 1649
1625 ptr = mem2hex(&__break_user_context.f.fsr[0], ptr, 4, 0); 1650 ptr = mem2hex(&__debug_user_context->f.fsr[0], ptr, 4, 0);
1626 1651
1627 for (loop = 0; loop <= 7; loop++) 1652 for (loop = 0; loop <= 7; loop++)
1628 ptr = mem2hex(&__break_user_context.f.acc[loop], ptr, 4, 0); 1653 ptr = mem2hex(&__debug_user_context->f.acc[loop], ptr, 4, 0);
1629 1654
1630 ptr = mem2hex(&__break_user_context.f.accg, ptr, 8, 0); 1655 ptr = mem2hex(&__debug_user_context->f.accg, ptr, 8, 0);
1631 1656
1632 for (loop = 0; loop <= 1; loop++) 1657 for (loop = 0; loop <= 1; loop++)
1633 ptr = mem2hex(&__break_user_context.f.msr[loop], ptr, 4, 0); 1658 ptr = mem2hex(&__debug_user_context->f.msr[loop], ptr, 4, 0);
1634 1659
1635 ptr = mem2hex(&__debug_frame->gner0, ptr, 4, 0); 1660 ptr = mem2hex(&__debug_frame->gner0, ptr, 4, 0);
1636 ptr = mem2hex(&__debug_frame->gner1, ptr, 4, 0); 1661 ptr = mem2hex(&__debug_frame->gner1, ptr, 4, 0);
1637 1662
1638 ptr = mem2hex(&__break_user_context.f.fner[0], ptr, 4, 0); 1663 ptr = mem2hex(&__debug_user_context->f.fner[0], ptr, 4, 0);
1639 ptr = mem2hex(&__break_user_context.f.fner[1], ptr, 4, 0); 1664 ptr = mem2hex(&__debug_user_context->f.fner[1], ptr, 4, 0);
1640 1665
1641 break; 1666 break;
1642 1667
@@ -1648,8 +1673,7 @@ void gdbstub(int sigval)
1648 ptr = hex2mem(ptr, &temp, 4); 1673 ptr = hex2mem(ptr, &temp, 4);
1649 1674
1650 for (loop = 1; loop <= 27; loop++) 1675 for (loop = 1; loop <= 27; loop++)
1651 ptr = hex2mem(ptr, (unsigned long *)__debug_frame + REG_GR(loop), 1676 ptr = hex2mem(ptr, &__debug_user_context->i.gr[loop], 4);
1652 4);
1653 1677
1654 ptr = hex2mem(ptr, &temp, 4); 1678 ptr = hex2mem(ptr, &temp, 4);
1655 __frame = (struct pt_regs *) temp; 1679 __frame = (struct pt_regs *) temp;
@@ -1662,14 +1686,11 @@ void gdbstub(int sigval)
1662#endif 1686#endif
1663 1687
1664 for (loop = 32; loop <= 63; loop++) 1688 for (loop = 32; loop <= 63; loop++)
1665 ptr = hex2mem(ptr, (unsigned long *)__debug_frame + REG_GR(loop), 1689 ptr = hex2mem(ptr, &__debug_user_context->i.gr[loop], 4);
1666 4);
1667 1690
1668 /* deal with FR0-FR63 */ 1691 /* deal with FR0-FR63 */
1669 for (loop = 0; loop <= 63; loop++) 1692 for (loop = 0; loop <= 63; loop++)
1670 ptr = mem2hex((unsigned long *)&__break_user_context + 1693 ptr = mem2hex(&__debug_user_context->f.fr[loop], ptr, 4, 0);
1671 __FPMEDIA_FR(loop),
1672 ptr, 4, 0);
1673 1694
1674 /* deal with special registers */ 1695 /* deal with special registers */
1675 ptr = hex2mem(ptr, &__debug_frame->pc, 4); 1696 ptr = hex2mem(ptr, &__debug_frame->pc, 4);
@@ -1694,21 +1715,21 @@ void gdbstub(int sigval)
1694 1715
1695 ptr = hex2mem(ptr, &__debug_frame->iacc0, 8); 1716 ptr = hex2mem(ptr, &__debug_frame->iacc0, 8);
1696 1717
1697 ptr = hex2mem(ptr, &__break_user_context.f.fsr[0], 4); 1718 ptr = hex2mem(ptr, &__debug_user_context->f.fsr[0], 4);
1698 1719
1699 for (loop = 0; loop <= 7; loop++) 1720 for (loop = 0; loop <= 7; loop++)
1700 ptr = hex2mem(ptr, &__break_user_context.f.acc[loop], 4); 1721 ptr = hex2mem(ptr, &__debug_user_context->f.acc[loop], 4);
1701 1722
1702 ptr = hex2mem(ptr, &__break_user_context.f.accg, 8); 1723 ptr = hex2mem(ptr, &__debug_user_context->f.accg, 8);
1703 1724
1704 for (loop = 0; loop <= 1; loop++) 1725 for (loop = 0; loop <= 1; loop++)
1705 ptr = hex2mem(ptr, &__break_user_context.f.msr[loop], 4); 1726 ptr = hex2mem(ptr, &__debug_user_context->f.msr[loop], 4);
1706 1727
1707 ptr = hex2mem(ptr, &__debug_frame->gner0, 4); 1728 ptr = hex2mem(ptr, &__debug_frame->gner0, 4);
1708 ptr = hex2mem(ptr, &__debug_frame->gner1, 4); 1729 ptr = hex2mem(ptr, &__debug_frame->gner1, 4);
1709 1730
1710 ptr = hex2mem(ptr, &__break_user_context.f.fner[0], 4); 1731 ptr = hex2mem(ptr, &__debug_user_context->f.fner[0], 4);
1711 ptr = hex2mem(ptr, &__break_user_context.f.fner[1], 4); 1732 ptr = hex2mem(ptr, &__debug_user_context->f.fner[1], 4);
1712 1733
1713 gdbstub_strcpy(output_buffer,"OK"); 1734 gdbstub_strcpy(output_buffer,"OK");
1714 break; 1735 break;
@@ -1769,52 +1790,52 @@ void gdbstub(int sigval)
1769 case GDB_REG_GR(0): 1790 case GDB_REG_GR(0):
1770 break; 1791 break;
1771 case GDB_REG_GR(1) ... GDB_REG_GR(63): 1792 case GDB_REG_GR(1) ... GDB_REG_GR(63):
1772 __break_user_context.i.gr[addr - GDB_REG_GR(0)] = temp; 1793 __debug_user_context->i.gr[addr - GDB_REG_GR(0)] = temp;
1773 break; 1794 break;
1774 case GDB_REG_FR(0) ... GDB_REG_FR(63): 1795 case GDB_REG_FR(0) ... GDB_REG_FR(63):
1775 __break_user_context.f.fr[addr - GDB_REG_FR(0)] = temp; 1796 __debug_user_context->f.fr[addr - GDB_REG_FR(0)] = temp;
1776 break; 1797 break;
1777 case GDB_REG_PC: 1798 case GDB_REG_PC:
1778 __break_user_context.i.pc = temp; 1799 __debug_user_context->i.pc = temp;
1779 break; 1800 break;
1780 case GDB_REG_PSR: 1801 case GDB_REG_PSR:
1781 __break_user_context.i.psr = temp; 1802 __debug_user_context->i.psr = temp;
1782 break; 1803 break;
1783 case GDB_REG_CCR: 1804 case GDB_REG_CCR:
1784 __break_user_context.i.ccr = temp; 1805 __debug_user_context->i.ccr = temp;
1785 break; 1806 break;
1786 case GDB_REG_CCCR: 1807 case GDB_REG_CCCR:
1787 __break_user_context.i.cccr = temp; 1808 __debug_user_context->i.cccr = temp;
1788 break; 1809 break;
1789 case GDB_REG_BRR: 1810 case GDB_REG_BRR:
1790 __debug_regs->brr = temp; 1811 __debug_status.brr = temp;
1791 break; 1812 break;
1792 case GDB_REG_LR: 1813 case GDB_REG_LR:
1793 __break_user_context.i.lr = temp; 1814 __debug_user_context->i.lr = temp;
1794 break; 1815 break;
1795 case GDB_REG_LCR: 1816 case GDB_REG_LCR:
1796 __break_user_context.i.lcr = temp; 1817 __debug_user_context->i.lcr = temp;
1797 break; 1818 break;
1798 case GDB_REG_FSR0: 1819 case GDB_REG_FSR0:
1799 __break_user_context.f.fsr[0] = temp; 1820 __debug_user_context->f.fsr[0] = temp;
1800 break; 1821 break;
1801 case GDB_REG_ACC(0) ... GDB_REG_ACC(7): 1822 case GDB_REG_ACC(0) ... GDB_REG_ACC(7):
1802 __break_user_context.f.acc[addr - GDB_REG_ACC(0)] = temp; 1823 __debug_user_context->f.acc[addr - GDB_REG_ACC(0)] = temp;
1803 break; 1824 break;
1804 case GDB_REG_ACCG(0): 1825 case GDB_REG_ACCG(0):
1805 *(uint32_t *) &__break_user_context.f.accg[0] = temp; 1826 *(uint32_t *) &__debug_user_context->f.accg[0] = temp;
1806 break; 1827 break;
1807 case GDB_REG_ACCG(4): 1828 case GDB_REG_ACCG(4):
1808 *(uint32_t *) &__break_user_context.f.accg[4] = temp; 1829 *(uint32_t *) &__debug_user_context->f.accg[4] = temp;
1809 break; 1830 break;
1810 case GDB_REG_MSR(0) ... GDB_REG_MSR(1): 1831 case GDB_REG_MSR(0) ... GDB_REG_MSR(1):
1811 __break_user_context.f.msr[addr - GDB_REG_MSR(0)] = temp; 1832 __debug_user_context->f.msr[addr - GDB_REG_MSR(0)] = temp;
1812 break; 1833 break;
1813 case GDB_REG_GNER(0) ... GDB_REG_GNER(1): 1834 case GDB_REG_GNER(0) ... GDB_REG_GNER(1):
1814 __break_user_context.i.gner[addr - GDB_REG_GNER(0)] = temp; 1835 __debug_user_context->i.gner[addr - GDB_REG_GNER(0)] = temp;
1815 break; 1836 break;
1816 case GDB_REG_FNER(0) ... GDB_REG_FNER(1): 1837 case GDB_REG_FNER(0) ... GDB_REG_FNER(1):
1817 __break_user_context.f.fner[addr - GDB_REG_FNER(0)] = temp; 1838 __debug_user_context->f.fner[addr - GDB_REG_FNER(0)] = temp;
1818 break; 1839 break;
1819 default: 1840 default:
1820 temp2 = 0; 1841 temp2 = 0;
@@ -1850,6 +1871,7 @@ void gdbstub(int sigval)
1850 /* step to next instruction */ 1871 /* step to next instruction */
1851 case 's': 1872 case 's':
1852 __debug_regs->dcr |= DCR_SE; 1873 __debug_regs->dcr |= DCR_SE;
1874 __debug_status.dcr |= DCR_SE;
1853 goto done; 1875 goto done;
1854 1876
1855 /* set baud rate (bBB) */ 1877 /* set baud rate (bBB) */
@@ -1934,7 +1956,7 @@ void gdbstub(int sigval)
1934 } 1956 }
1935 1957
1936 done: 1958 done:
1937 restore_user_regs(&__break_user_context); 1959 restore_user_regs(&__debug_frame0->uc);
1938 1960
1939 //gdbstub_dump_debugregs(); 1961 //gdbstub_dump_debugregs();
1940 //gdbstub_printk("<-- gdbstub() %08x\n", __debug_frame->pc); 1962 //gdbstub_printk("<-- gdbstub() %08x\n", __debug_frame->pc);
@@ -1966,7 +1988,6 @@ void __init gdbstub_init(void)
1966#endif 1988#endif
1967 1989
1968 gdbstub_printk("%s", gdbstub_banner); 1990 gdbstub_printk("%s", gdbstub_banner);
1969 gdbstub_printk("DCR: %x\n", __debug_regs->dcr);
1970 1991
1971 gdbstub_io_init(); 1992 gdbstub_io_init();
1972 1993
diff --git a/arch/frv/kernel/head.S b/arch/frv/kernel/head.S
index 47c990af2e06..fecf751c5cae 100644
--- a/arch/frv/kernel/head.S
+++ b/arch/frv/kernel/head.S
@@ -11,6 +11,7 @@
11 11
12#include <linux/threads.h> 12#include <linux/threads.h>
13#include <linux/linkage.h> 13#include <linux/linkage.h>
14#include <asm/thread_info.h>
14#include <asm/ptrace.h> 15#include <asm/ptrace.h>
15#include <asm/page.h> 16#include <asm/page.h>
16#include <asm/spr-regs.h> 17#include <asm/spr-regs.h>
diff --git a/arch/frv/kernel/local.h b/arch/frv/kernel/local.h
index e9471761d78b..76606d13b1aa 100644
--- a/arch/frv/kernel/local.h
+++ b/arch/frv/kernel/local.h
@@ -51,6 +51,9 @@ extern void (*__power_switch_wake_cleanup)(void);
51/* time.c */ 51/* time.c */
52extern void time_divisor_init(void); 52extern void time_divisor_init(void);
53 53
54/* cmode.S */
55extern asmlinkage void frv_change_cmode(int);
56
54 57
55#endif /* __ASSEMBLY__ */ 58#endif /* __ASSEMBLY__ */
56#endif /* _FRV_LOCAL_H */ 59#endif /* _FRV_LOCAL_H */
diff --git a/arch/frv/kernel/pm.c b/arch/frv/kernel/pm.c
index e65a9f1c0c26..c1d9fc8f1a85 100644
--- a/arch/frv/kernel/pm.c
+++ b/arch/frv/kernel/pm.c
@@ -26,11 +26,6 @@
26 26
27#include "local.h" 27#include "local.h"
28 28
29void (*pm_power_off)(void);
30EXPORT_SYMBOL(pm_power_off);
31
32extern void frv_change_cmode(int);
33
34/* 29/*
35 * Debug macros 30 * Debug macros
36 */ 31 */
diff --git a/arch/frv/kernel/process.c b/arch/frv/kernel/process.c
index eeeb1e2641d5..515a5cea5469 100644
--- a/arch/frv/kernel/process.c
+++ b/arch/frv/kernel/process.c
@@ -10,6 +10,7 @@
10 * 2 of the License, or (at your option) any later version. 10 * 2 of the License, or (at your option) any later version.
11 */ 11 */
12 12
13#include <linux/module.h>
13#include <linux/errno.h> 14#include <linux/errno.h>
14#include <linux/sched.h> 15#include <linux/sched.h>
15#include <linux/kernel.h> 16#include <linux/kernel.h>
@@ -25,6 +26,7 @@
25#include <linux/reboot.h> 26#include <linux/reboot.h>
26#include <linux/interrupt.h> 27#include <linux/interrupt.h>
27 28
29#include <asm/asm-offsets.h>
28#include <asm/uaccess.h> 30#include <asm/uaccess.h>
29#include <asm/system.h> 31#include <asm/system.h>
30#include <asm/setup.h> 32#include <asm/setup.h>
@@ -38,6 +40,9 @@ asmlinkage void ret_from_fork(void);
38 40
39#include <asm/pgalloc.h> 41#include <asm/pgalloc.h>
40 42
43void (*pm_power_off)(void);
44EXPORT_SYMBOL(pm_power_off);
45
41struct task_struct *alloc_task_struct(void) 46struct task_struct *alloc_task_struct(void)
42{ 47{
43 struct task_struct *p = kmalloc(THREAD_SIZE, GFP_KERNEL); 48 struct task_struct *p = kmalloc(THREAD_SIZE, GFP_KERNEL);
@@ -203,7 +208,7 @@ int copy_thread(int nr, unsigned long clone_flags,
203 208
204 regs0 = __kernel_frame0_ptr; 209 regs0 = __kernel_frame0_ptr;
205 childregs0 = (struct pt_regs *) 210 childregs0 = (struct pt_regs *)
206 (task_stack_page(p) + THREAD_SIZE - USER_CONTEXT_SIZE); 211 (task_stack_page(p) + THREAD_SIZE - FRV_FRAME0_SIZE);
207 childregs = childregs0; 212 childregs = childregs0;
208 213
209 /* set up the userspace frame (the only place that the USP is stored) */ 214 /* set up the userspace frame (the only place that the USP is stored) */
@@ -367,3 +372,11 @@ int elf_check_arch(const struct elf32_hdr *hdr)
367 372
368 return 1; 373 return 1;
369} 374}
375
376int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpregs)
377{
378 memcpy(fpregs,
379 &current->thread.user->f,
380 sizeof(current->thread.user->f));
381 return 1;
382}
diff --git a/arch/frv/kernel/switch_to.S b/arch/frv/kernel/switch_to.S
index 9e5a583991a3..b5275fa9cd0d 100644
--- a/arch/frv/kernel/switch_to.S
+++ b/arch/frv/kernel/switch_to.S
@@ -11,6 +11,7 @@
11# 2 of the License, or (at your option) any later version. 11# 2 of the License, or (at your option) any later version.
12# 12#
13############################################################################### 13###############################################################################
14
14#include <linux/linkage.h> 15#include <linux/linkage.h>
15#include <asm/thread_info.h> 16#include <asm/thread_info.h>
16#include <asm/processor.h> 17#include <asm/processor.h>
@@ -30,7 +31,7 @@
30 # address of frame 0 (userspace) on current kernel stack 31 # address of frame 0 (userspace) on current kernel stack
31 .globl __kernel_frame0_ptr 32 .globl __kernel_frame0_ptr
32__kernel_frame0_ptr: 33__kernel_frame0_ptr:
33 .long init_thread_union + THREAD_SIZE - USER_CONTEXT_SIZE 34 .long init_thread_union + THREAD_SIZE - FRV_FRAME0_SIZE
34 35
35 # address of current task 36 # address of current task
36 .globl __kernel_current_task 37 .globl __kernel_current_task
diff --git a/arch/frv/kernel/traps.c b/arch/frv/kernel/traps.c
index 98ce3628ebde..2e6098c85578 100644
--- a/arch/frv/kernel/traps.c
+++ b/arch/frv/kernel/traps.c
@@ -20,6 +20,7 @@
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/module.h> 21#include <linux/module.h>
22 22
23#include <asm/asm-offsets.h>
23#include <asm/setup.h> 24#include <asm/setup.h>
24#include <asm/fpu.h> 25#include <asm/fpu.h>
25#include <asm/system.h> 26#include <asm/system.h>
@@ -279,20 +280,20 @@ static const char *regnames[] = {
279 280
280void show_regs(struct pt_regs *regs) 281void show_regs(struct pt_regs *regs)
281{ 282{
282 uint32_t *reg; 283 unsigned long *reg;
283 int loop; 284 int loop;
284 285
285 printk("\n"); 286 printk("\n");
286 287
287 printk("Frame: @%08x [%s]\n", 288 printk("Frame: @%08lx [%s]\n",
288 (uint32_t) regs, 289 (unsigned long) regs,
289 regs->psr & PSR_S ? "kernel" : "user"); 290 regs->psr & PSR_S ? "kernel" : "user");
290 291
291 reg = (uint32_t *) regs; 292 reg = (unsigned long *) regs;
292 for (loop = 0; loop < REG__END; loop++) { 293 for (loop = 0; loop < NR_PT_REGS; loop++) {
293 printk("%s %08x", regnames[loop + 0], reg[loop + 0]); 294 printk("%s %08lx", regnames[loop + 0], reg[loop + 0]);
294 295
295 if (loop == REG__END - 1 || loop % 5 == 4) 296 if (loop == NR_PT_REGS - 1 || loop % 5 == 4)
296 printk("\n"); 297 printk("\n");
297 else 298 else
298 printk(" | "); 299 printk(" | ");
@@ -328,7 +329,7 @@ void die_if_kernel(const char *str, ...)
328 */ 329 */
329static void show_backtrace_regs(struct pt_regs *frame) 330static void show_backtrace_regs(struct pt_regs *frame)
330{ 331{
331 uint32_t *reg; 332 unsigned long *reg;
332 int loop; 333 int loop;
333 334
334 /* print the registers for this frame */ 335 /* print the registers for this frame */
@@ -336,11 +337,11 @@ static void show_backtrace_regs(struct pt_regs *frame)
336 frame->psr & PSR_S ? "Kernel Mode" : "User Mode", 337 frame->psr & PSR_S ? "Kernel Mode" : "User Mode",
337 frame); 338 frame);
338 339
339 reg = (uint32_t *) frame; 340 reg = (unsigned long *) frame;
340 for (loop = 0; loop < REG__END; loop++) { 341 for (loop = 0; loop < NR_PT_REGS; loop++) {
341 printk("%s %08x", regnames[loop + 0], reg[loop + 0]); 342 printk("%s %08lx", regnames[loop + 0], reg[loop + 0]);
342 343
343 if (loop == REG__END - 1 || loop % 5 == 4) 344 if (loop == NR_PT_REGS - 1 || loop % 5 == 4)
344 printk("\n"); 345 printk("\n");
345 else 346 else
346 printk(" | "); 347 printk(" | ");
diff --git a/arch/frv/mb93090-mb00/pci-vdk.c b/arch/frv/mb93090-mb00/pci-vdk.c
index fb98e90c5794..f7279d78995a 100644
--- a/arch/frv/mb93090-mb00/pci-vdk.c
+++ b/arch/frv/mb93090-mb00/pci-vdk.c
@@ -406,7 +406,9 @@ int __init pcibios_init(void)
406 ioport_resource.end = (__reg_MB86943_sl_pci_io_range << 9) | 0x3ff; 406 ioport_resource.end = (__reg_MB86943_sl_pci_io_range << 9) | 0x3ff;
407 ioport_resource.end += ioport_resource.start; 407 ioport_resource.end += ioport_resource.start;
408 408
409 printk("PCI IO window: %08lx-%08lx\n", ioport_resource.start, ioport_resource.end); 409 printk("PCI IO window: %08llx-%08llx\n",
410 (unsigned long long) ioport_resource.start,
411 (unsigned long long) ioport_resource.end);
410 412
411 iomem_resource.start = (__reg_MB86943_sl_pci_mem_base << 9) & 0xfffffc00; 413 iomem_resource.start = (__reg_MB86943_sl_pci_mem_base << 9) & 0xfffffc00;
412 414
@@ -416,8 +418,11 @@ int __init pcibios_init(void)
416 iomem_resource.end = (__reg_MB86943_sl_pci_mem_range << 9) | 0x3ff; 418 iomem_resource.end = (__reg_MB86943_sl_pci_mem_range << 9) | 0x3ff;
417 iomem_resource.end += iomem_resource.start; 419 iomem_resource.end += iomem_resource.start;
418 420
419 printk("PCI MEM window: %08lx-%08lx\n", iomem_resource.start, iomem_resource.end); 421 printk("PCI MEM window: %08llx-%08llx\n",
420 printk("PCI DMA memory: %08lx-%08lx\n", dma_coherent_mem_start, dma_coherent_mem_end); 422 (unsigned long long) iomem_resource.start,
423 (unsigned long long) iomem_resource.end);
424 printk("PCI DMA memory: %08lx-%08lx\n",
425 dma_coherent_mem_start, dma_coherent_mem_end);
421 426
422 if (!pci_probe) 427 if (!pci_probe)
423 return -ENXIO; 428 return -ENXIO;
diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig
index daa75ce4b777..f71fb4a029cb 100644
--- a/arch/i386/Kconfig
+++ b/arch/i386/Kconfig
@@ -672,7 +672,7 @@ config MTRR
672 See <file:Documentation/mtrr.txt> for more information. 672 See <file:Documentation/mtrr.txt> for more information.
673 673
674config EFI 674config EFI
675 bool "Boot from EFI support (EXPERIMENTAL)" 675 bool "Boot from EFI support"
676 depends on ACPI 676 depends on ACPI
677 default n 677 default n
678 ---help--- 678 ---help---
diff --git a/arch/i386/defconfig b/arch/i386/defconfig
index 1629c3ac9bee..89ebb7a316ab 100644
--- a/arch/i386/defconfig
+++ b/arch/i386/defconfig
@@ -197,7 +197,7 @@ CONFIG_PM=y
197# CONFIG_PM_LEGACY is not set 197# CONFIG_PM_LEGACY is not set
198# CONFIG_PM_DEBUG is not set 198# CONFIG_PM_DEBUG is not set
199CONFIG_SOFTWARE_SUSPEND=y 199CONFIG_SOFTWARE_SUSPEND=y
200CONFIG_PM_STD_PARTITION="/dev/hda2" 200CONFIG_PM_STD_PARTITION=""
201 201
202# 202#
203# ACPI (Advanced Configuration and Power Interface) Support 203# ACPI (Advanced Configuration and Power Interface) Support
diff --git a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile
index 1b452a1665c4..ab98fc21a541 100644
--- a/arch/i386/kernel/Makefile
+++ b/arch/i386/kernel/Makefile
@@ -59,7 +59,8 @@ quiet_cmd_syscall = SYSCALL $@
59 59
60export CPPFLAGS_vsyscall.lds += -P -C -U$(ARCH) 60export CPPFLAGS_vsyscall.lds += -P -C -U$(ARCH)
61 61
62vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1 62vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1 \
63 $(call ld-option, -Wl$(comma)--hash-style=sysv)
63SYSCFLAGS_vsyscall-sysenter.so = $(vsyscall-flags) 64SYSCFLAGS_vsyscall-sysenter.so = $(vsyscall-flags)
64SYSCFLAGS_vsyscall-int80.so = $(vsyscall-flags) 65SYSCFLAGS_vsyscall-int80.so = $(vsyscall-flags)
65 66
diff --git a/arch/i386/kernel/cpu/cpufreq/Kconfig b/arch/i386/kernel/cpu/cpufreq/Kconfig
index e44a4c6a4fe5..ccc1edff5c97 100644
--- a/arch/i386/kernel/cpu/cpufreq/Kconfig
+++ b/arch/i386/kernel/cpu/cpufreq/Kconfig
@@ -96,6 +96,7 @@ config X86_POWERNOW_K8_ACPI
96 96
97config X86_GX_SUSPMOD 97config X86_GX_SUSPMOD
98 tristate "Cyrix MediaGX/NatSemi Geode Suspend Modulation" 98 tristate "Cyrix MediaGX/NatSemi Geode Suspend Modulation"
99 depends on PCI
99 help 100 help
100 This add the CPUFreq driver for NatSemi Geode processors which 101 This add the CPUFreq driver for NatSemi Geode processors which
101 support suspend modulation. 102 support suspend modulation.
@@ -202,7 +203,7 @@ config X86_LONGRUN
202config X86_LONGHAUL 203config X86_LONGHAUL
203 tristate "VIA Cyrix III Longhaul" 204 tristate "VIA Cyrix III Longhaul"
204 select CPU_FREQ_TABLE 205 select CPU_FREQ_TABLE
205 depends on BROKEN 206 depends on ACPI_PROCESSOR
206 help 207 help
207 This adds the CPUFreq driver for VIA Samuel/CyrixIII, 208 This adds the CPUFreq driver for VIA Samuel/CyrixIII,
208 VIA Cyrix Samuel/C3, VIA Cyrix Ezra and VIA Cyrix Ezra-T 209 VIA Cyrix Samuel/C3, VIA Cyrix Ezra and VIA Cyrix Ezra-T
diff --git a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
index 567b39bea07e..efb41e81351c 100644
--- a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
+++ b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
@@ -384,8 +384,7 @@ static int acpi_cpufreq_early_init_acpi(void)
384 } 384 }
385 385
386 /* Do initialization in ACPI core */ 386 /* Do initialization in ACPI core */
387 acpi_processor_preregister_performance(acpi_perf_data); 387 return acpi_processor_preregister_performance(acpi_perf_data);
388 return 0;
389} 388}
390 389
391static int 390static int
diff --git a/arch/i386/kernel/cpu/cpufreq/longhaul.c b/arch/i386/kernel/cpu/cpufreq/longhaul.c
index 146f607e9c44..4f2c3aeef724 100644
--- a/arch/i386/kernel/cpu/cpufreq/longhaul.c
+++ b/arch/i386/kernel/cpu/cpufreq/longhaul.c
@@ -29,11 +29,13 @@
29#include <linux/cpufreq.h> 29#include <linux/cpufreq.h>
30#include <linux/slab.h> 30#include <linux/slab.h>
31#include <linux/string.h> 31#include <linux/string.h>
32#include <linux/pci.h>
33 32
34#include <asm/msr.h> 33#include <asm/msr.h>
35#include <asm/timex.h> 34#include <asm/timex.h>
36#include <asm/io.h> 35#include <asm/io.h>
36#include <asm/acpi.h>
37#include <linux/acpi.h>
38#include <acpi/processor.h>
37 39
38#include "longhaul.h" 40#include "longhaul.h"
39 41
@@ -56,6 +58,8 @@ static int minvid, maxvid;
56static unsigned int minmult, maxmult; 58static unsigned int minmult, maxmult;
57static int can_scale_voltage; 59static int can_scale_voltage;
58static int vrmrev; 60static int vrmrev;
61static struct acpi_processor *pr = NULL;
62static struct acpi_processor_cx *cx = NULL;
59 63
60/* Module parameters */ 64/* Module parameters */
61static int dont_scale_voltage; 65static int dont_scale_voltage;
@@ -118,84 +122,65 @@ static int longhaul_get_cpu_mult(void)
118 return eblcr_table[invalue]; 122 return eblcr_table[invalue];
119} 123}
120 124
125/* For processor with BCR2 MSR */
121 126
122static void do_powersaver(union msr_longhaul *longhaul, 127static void do_longhaul1(int cx_address, unsigned int clock_ratio_index)
123 unsigned int clock_ratio_index)
124{ 128{
125 struct pci_dev *dev; 129 union msr_bcr2 bcr2;
126 unsigned long flags; 130 u32 t;
127 unsigned int tmp_mask;
128 int version;
129 int i;
130 u16 pci_cmd;
131 u16 cmd_state[64];
132 131
133 switch (cpu_model) { 132 rdmsrl(MSR_VIA_BCR2, bcr2.val);
134 case CPU_EZRA_T: 133 /* Enable software clock multiplier */
135 version = 3; 134 bcr2.bits.ESOFTBF = 1;
136 break; 135 bcr2.bits.CLOCKMUL = clock_ratio_index;
137 case CPU_NEHEMIAH:
138 version = 0xf;
139 break;
140 default:
141 return;
142 }
143 136
144 rdmsrl(MSR_VIA_LONGHAUL, longhaul->val); 137 /* Sync to timer tick */
145 longhaul->bits.SoftBusRatio = clock_ratio_index & 0xf; 138 safe_halt();
146 longhaul->bits.SoftBusRatio4 = (clock_ratio_index & 0x10) >> 4; 139 ACPI_FLUSH_CPU_CACHE();
147 longhaul->bits.EnableSoftBusRatio = 1; 140 /* Change frequency on next halt or sleep */
148 longhaul->bits.RevisionKey = 0; 141 wrmsrl(MSR_VIA_BCR2, bcr2.val);
142 /* Invoke C3 */
143 inb(cx_address);
144 /* Dummy op - must do something useless after P_LVL3 read */
145 t = inl(acpi_fadt.xpm_tmr_blk.address);
146
147 /* Disable software clock multiplier */
148 local_irq_disable();
149 rdmsrl(MSR_VIA_BCR2, bcr2.val);
150 bcr2.bits.ESOFTBF = 0;
151 wrmsrl(MSR_VIA_BCR2, bcr2.val);
152}
149 153
150 preempt_disable(); 154/* For processor with Longhaul MSR */
151 local_irq_save(flags);
152 155
153 /* 156static void do_powersaver(int cx_address, unsigned int clock_ratio_index)
154 * get current pci bus master state for all devices 157{
155 * and clear bus master bit 158 union msr_longhaul longhaul;
156 */ 159 u32 t;
157 dev = NULL;
158 i = 0;
159 do {
160 dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev);
161 if (dev != NULL) {
162 pci_read_config_word(dev, PCI_COMMAND, &pci_cmd);
163 cmd_state[i++] = pci_cmd;
164 pci_cmd &= ~PCI_COMMAND_MASTER;
165 pci_write_config_word(dev, PCI_COMMAND, pci_cmd);
166 }
167 } while (dev != NULL);
168 160
169 tmp_mask=inb(0x21); /* works on C3. save mask. */ 161 rdmsrl(MSR_VIA_LONGHAUL, longhaul.val);
170 outb(0xFE,0x21); /* TMR0 only */ 162 longhaul.bits.RevisionKey = longhaul.bits.RevisionID;
171 outb(0xFF,0x80); /* delay */ 163 longhaul.bits.SoftBusRatio = clock_ratio_index & 0xf;
164 longhaul.bits.SoftBusRatio4 = (clock_ratio_index & 0x10) >> 4;
165 longhaul.bits.EnableSoftBusRatio = 1;
172 166
167 /* Sync to timer tick */
173 safe_halt(); 168 safe_halt();
174 wrmsrl(MSR_VIA_LONGHAUL, longhaul->val); 169 ACPI_FLUSH_CPU_CACHE();
175 halt(); 170 /* Change frequency on next halt or sleep */
176 171 wrmsrl(MSR_VIA_LONGHAUL, longhaul.val);
172 /* Invoke C3 */
173 inb(cx_address);
174 /* Dummy op - must do something useless after P_LVL3 read */
175 t = inl(acpi_fadt.xpm_tmr_blk.address);
176
177 /* Disable bus ratio bit */
177 local_irq_disable(); 178 local_irq_disable();
178 179 longhaul.bits.RevisionKey = longhaul.bits.RevisionID;
179 outb(tmp_mask,0x21); /* restore mask */ 180 longhaul.bits.EnableSoftBusRatio = 0;
180 181 longhaul.bits.EnableSoftBSEL = 0;
181 /* restore pci bus master state for all devices */ 182 longhaul.bits.EnableSoftVID = 0;
182 dev = NULL; 183 wrmsrl(MSR_VIA_LONGHAUL, longhaul.val);
183 i = 0;
184 do {
185 dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev);
186 if (dev != NULL) {
187 pci_cmd = cmd_state[i++];
188 pci_write_config_byte(dev, PCI_COMMAND, pci_cmd);
189 }
190 } while (dev != NULL);
191 local_irq_restore(flags);
192 preempt_enable();
193
194 /* disable bus ratio bit */
195 rdmsrl(MSR_VIA_LONGHAUL, longhaul->val);
196 longhaul->bits.EnableSoftBusRatio = 0;
197 longhaul->bits.RevisionKey = version;
198 wrmsrl(MSR_VIA_LONGHAUL, longhaul->val);
199} 184}
200 185
201/** 186/**
@@ -209,9 +194,9 @@ static void longhaul_setstate(unsigned int clock_ratio_index)
209{ 194{
210 int speed, mult; 195 int speed, mult;
211 struct cpufreq_freqs freqs; 196 struct cpufreq_freqs freqs;
212 union msr_longhaul longhaul;
213 union msr_bcr2 bcr2;
214 static unsigned int old_ratio=-1; 197 static unsigned int old_ratio=-1;
198 unsigned long flags;
199 unsigned int pic1_mask, pic2_mask;
215 200
216 if (old_ratio == clock_ratio_index) 201 if (old_ratio == clock_ratio_index)
217 return; 202 return;
@@ -234,6 +219,20 @@ static void longhaul_setstate(unsigned int clock_ratio_index)
234 dprintk ("Setting to FSB:%dMHz Mult:%d.%dx (%s)\n", 219 dprintk ("Setting to FSB:%dMHz Mult:%d.%dx (%s)\n",
235 fsb, mult/10, mult%10, print_speed(speed/1000)); 220 fsb, mult/10, mult%10, print_speed(speed/1000));
236 221
222 preempt_disable();
223 local_irq_save(flags);
224
225 pic2_mask = inb(0xA1);
226 pic1_mask = inb(0x21); /* works on C3. save mask. */
227 outb(0xFF,0xA1); /* Overkill */
228 outb(0xFE,0x21); /* TMR0 only */
229
230 /* Disable bus master arbitration */
231 if (pr->flags.bm_check) {
232 acpi_set_register(ACPI_BITREG_ARB_DISABLE, 1,
233 ACPI_MTX_DO_NOT_LOCK);
234 }
235
237 switch (longhaul_version) { 236 switch (longhaul_version) {
238 237
239 /* 238 /*
@@ -245,20 +244,7 @@ static void longhaul_setstate(unsigned int clock_ratio_index)
245 */ 244 */
246 case TYPE_LONGHAUL_V1: 245 case TYPE_LONGHAUL_V1:
247 case TYPE_LONGHAUL_V2: 246 case TYPE_LONGHAUL_V2:
248 rdmsrl (MSR_VIA_BCR2, bcr2.val); 247 do_longhaul1(cx->address, clock_ratio_index);
249 /* Enable software clock multiplier */
250 bcr2.bits.ESOFTBF = 1;
251 bcr2.bits.CLOCKMUL = clock_ratio_index;
252 local_irq_disable();
253 wrmsrl (MSR_VIA_BCR2, bcr2.val);
254 safe_halt();
255
256 /* Disable software clock multiplier */
257 rdmsrl (MSR_VIA_BCR2, bcr2.val);
258 bcr2.bits.ESOFTBF = 0;
259 local_irq_disable();
260 wrmsrl (MSR_VIA_BCR2, bcr2.val);
261 local_irq_enable();
262 break; 248 break;
263 249
264 /* 250 /*
@@ -273,10 +259,22 @@ static void longhaul_setstate(unsigned int clock_ratio_index)
273 * to work in practice. 259 * to work in practice.
274 */ 260 */
275 case TYPE_POWERSAVER: 261 case TYPE_POWERSAVER:
276 do_powersaver(&longhaul, clock_ratio_index); 262 do_powersaver(cx->address, clock_ratio_index);
277 break; 263 break;
278 } 264 }
279 265
266 /* Enable bus master arbitration */
267 if (pr->flags.bm_check) {
268 acpi_set_register(ACPI_BITREG_ARB_DISABLE, 0,
269 ACPI_MTX_DO_NOT_LOCK);
270 }
271
272 outb(pic2_mask,0xA1); /* restore mask */
273 outb(pic1_mask,0x21);
274
275 local_irq_restore(flags);
276 preempt_enable();
277
280 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 278 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
281} 279}
282 280
@@ -324,9 +322,11 @@ static int guess_fsb(void)
324static int __init longhaul_get_ranges(void) 322static int __init longhaul_get_ranges(void)
325{ 323{
326 unsigned long invalue; 324 unsigned long invalue;
327 unsigned int multipliers[32]= { 325 unsigned int ezra_t_multipliers[32]= {
328 50,30,40,100,55,35,45,95,90,70,80,60,120,75,85,65, 326 90, 30, 40, 100, 55, 35, 45, 95,
329 -1,110,120,-1,135,115,125,105,130,150,160,140,-1,155,-1,145 }; 327 50, 70, 80, 60, 120, 75, 85, 65,
328 -1, 110, 120, -1, 135, 115, 125, 105,
329 130, 150, 160, 140, -1, 155, -1, 145 };
330 unsigned int j, k = 0; 330 unsigned int j, k = 0;
331 union msr_longhaul longhaul; 331 union msr_longhaul longhaul;
332 unsigned long lo, hi; 332 unsigned long lo, hi;
@@ -355,13 +355,13 @@ static int __init longhaul_get_ranges(void)
355 invalue = longhaul.bits.MaxMHzBR; 355 invalue = longhaul.bits.MaxMHzBR;
356 if (longhaul.bits.MaxMHzBR4) 356 if (longhaul.bits.MaxMHzBR4)
357 invalue += 16; 357 invalue += 16;
358 maxmult=multipliers[invalue]; 358 maxmult=ezra_t_multipliers[invalue];
359 359
360 invalue = longhaul.bits.MinMHzBR; 360 invalue = longhaul.bits.MinMHzBR;
361 if (longhaul.bits.MinMHzBR4 == 1) 361 if (longhaul.bits.MinMHzBR4 == 1)
362 minmult = 30; 362 minmult = 30;
363 else 363 else
364 minmult = multipliers[invalue]; 364 minmult = ezra_t_multipliers[invalue];
365 fsb = eblcr_fsb_table_v2[longhaul.bits.MaxMHzFSB]; 365 fsb = eblcr_fsb_table_v2[longhaul.bits.MaxMHzFSB];
366 break; 366 break;
367 } 367 }
@@ -527,6 +527,18 @@ static unsigned int longhaul_get(unsigned int cpu)
527 return calc_speed(longhaul_get_cpu_mult()); 527 return calc_speed(longhaul_get_cpu_mult());
528} 528}
529 529
530static acpi_status longhaul_walk_callback(acpi_handle obj_handle,
531 u32 nesting_level,
532 void *context, void **return_value)
533{
534 struct acpi_device *d;
535
536 if ( acpi_bus_get_device(obj_handle, &d) ) {
537 return 0;
538 }
539 *return_value = (void *)acpi_driver_data(d);
540 return 1;
541}
530 542
531static int __init longhaul_cpu_init(struct cpufreq_policy *policy) 543static int __init longhaul_cpu_init(struct cpufreq_policy *policy)
532{ 544{
@@ -534,6 +546,15 @@ static int __init longhaul_cpu_init(struct cpufreq_policy *policy)
534 char *cpuname=NULL; 546 char *cpuname=NULL;
535 int ret; 547 int ret;
536 548
549 /* Check ACPI support for C3 state */
550 acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
551 &longhaul_walk_callback, NULL, (void *)&pr);
552 if (pr == NULL) goto err_acpi;
553
554 cx = &pr->power.states[ACPI_STATE_C3];
555 if (cx->address == 0 || cx->latency > 1000) goto err_acpi;
556
557 /* Now check what we have on this motherboard */
537 switch (c->x86_model) { 558 switch (c->x86_model) {
538 case 6: 559 case 6:
539 cpu_model = CPU_SAMUEL; 560 cpu_model = CPU_SAMUEL;
@@ -634,6 +655,10 @@ static int __init longhaul_cpu_init(struct cpufreq_policy *policy)
634 cpufreq_frequency_table_get_attr(longhaul_table, policy->cpu); 655 cpufreq_frequency_table_get_attr(longhaul_table, policy->cpu);
635 656
636 return 0; 657 return 0;
658
659err_acpi:
660 printk(KERN_ERR PFX "No ACPI support for CPU frequency changes.\n");
661 return -ENODEV;
637} 662}
638 663
639static int __devexit longhaul_cpu_exit(struct cpufreq_policy *policy) 664static int __devexit longhaul_cpu_exit(struct cpufreq_policy *policy)
@@ -666,6 +691,18 @@ static int __init longhaul_init(void)
666 if (c->x86_vendor != X86_VENDOR_CENTAUR || c->x86 != 6) 691 if (c->x86_vendor != X86_VENDOR_CENTAUR || c->x86 != 6)
667 return -ENODEV; 692 return -ENODEV;
668 693
694#ifdef CONFIG_SMP
695 if (num_online_cpus() > 1) {
696 return -ENODEV;
697 printk(KERN_ERR PFX "More than 1 CPU detected, longhaul disabled.\n");
698 }
699#endif
700#ifdef CONFIG_X86_IO_APIC
701 if (cpu_has_apic) {
702 printk(KERN_ERR PFX "APIC detected. Longhaul is currently broken in this configuration.\n");
703 return -ENODEV;
704 }
705#endif
669 switch (c->x86_model) { 706 switch (c->x86_model) {
670 case 6 ... 9: 707 case 6 ... 9:
671 return cpufreq_register_driver(&longhaul_driver); 708 return cpufreq_register_driver(&longhaul_driver);
@@ -699,6 +736,6 @@ MODULE_AUTHOR ("Dave Jones <davej@codemonkey.org.uk>");
699MODULE_DESCRIPTION ("Longhaul driver for VIA Cyrix processors."); 736MODULE_DESCRIPTION ("Longhaul driver for VIA Cyrix processors.");
700MODULE_LICENSE ("GPL"); 737MODULE_LICENSE ("GPL");
701 738
702module_init(longhaul_init); 739late_initcall(longhaul_init);
703module_exit(longhaul_exit); 740module_exit(longhaul_exit);
704 741
diff --git a/arch/i386/kernel/cpu/intel_cacheinfo.c b/arch/i386/kernel/cpu/intel_cacheinfo.c
index e9f0b928b0a9..5c43be47587f 100644
--- a/arch/i386/kernel/cpu/intel_cacheinfo.c
+++ b/arch/i386/kernel/cpu/intel_cacheinfo.c
@@ -759,7 +759,7 @@ static int __cpuinit cache_sysfs_init(void)
759 if (num_cache_leaves == 0) 759 if (num_cache_leaves == 0)
760 return 0; 760 return 0;
761 761
762 register_cpu_notifier(&cacheinfo_cpu_notifier); 762 register_hotcpu_notifier(&cacheinfo_cpu_notifier);
763 763
764 for_each_online_cpu(i) { 764 for_each_online_cpu(i) {
765 cacheinfo_cpu_callback(&cacheinfo_cpu_notifier, CPU_ONLINE, 765 cacheinfo_cpu_callback(&cacheinfo_cpu_notifier, CPU_ONLINE,
diff --git a/arch/i386/kernel/cpu/mcheck/mce.h b/arch/i386/kernel/cpu/mcheck/mce.h
index dc2416dfef15..84fd4cf7d0fb 100644
--- a/arch/i386/kernel/cpu/mcheck/mce.h
+++ b/arch/i386/kernel/cpu/mcheck/mce.h
@@ -9,6 +9,6 @@ void winchip_mcheck_init(struct cpuinfo_x86 *c);
9/* Call the installed machine check handler for this CPU setup. */ 9/* Call the installed machine check handler for this CPU setup. */
10extern fastcall void (*machine_check_vector)(struct pt_regs *, long error_code); 10extern fastcall void (*machine_check_vector)(struct pt_regs *, long error_code);
11 11
12extern int mce_disabled __initdata; 12extern int mce_disabled;
13extern int nr_mce_banks; 13extern int nr_mce_banks;
14 14
diff --git a/arch/i386/kernel/crash.c b/arch/i386/kernel/crash.c
index 48f0f62f781c..5b96f038367f 100644
--- a/arch/i386/kernel/crash.c
+++ b/arch/i386/kernel/crash.c
@@ -90,7 +90,7 @@ static void crash_save_self(struct pt_regs *regs)
90 crash_save_this_cpu(regs, cpu); 90 crash_save_this_cpu(regs, cpu);
91} 91}
92 92
93#ifdef CONFIG_SMP 93#if defined(CONFIG_SMP) && defined(CONFIG_X86_LOCAL_APIC)
94static atomic_t waiting_for_crash_ipi; 94static atomic_t waiting_for_crash_ipi;
95 95
96static int crash_nmi_callback(struct pt_regs *regs, int cpu) 96static int crash_nmi_callback(struct pt_regs *regs, int cpu)
diff --git a/arch/i386/kernel/entry.S b/arch/i386/kernel/entry.S
index d9a260f2efb4..37a7d2eaf4a0 100644
--- a/arch/i386/kernel/entry.S
+++ b/arch/i386/kernel/entry.S
@@ -204,7 +204,7 @@ VM_MASK = 0x00020000
204ENTRY(ret_from_fork) 204ENTRY(ret_from_fork)
205 CFI_STARTPROC 205 CFI_STARTPROC
206 pushl %eax 206 pushl %eax
207 CFI_ADJUST_CFA_OFFSET -4 207 CFI_ADJUST_CFA_OFFSET 4
208 call schedule_tail 208 call schedule_tail
209 GET_THREAD_INFO(%ebp) 209 GET_THREAD_INFO(%ebp)
210 popl %eax 210 popl %eax
diff --git a/arch/i386/kernel/ioport.c b/arch/i386/kernel/ioport.c
index 79026f026b85..498e8bc197d5 100644
--- a/arch/i386/kernel/ioport.c
+++ b/arch/i386/kernel/ioport.c
@@ -79,6 +79,7 @@ asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on)
79 79
80 memset(bitmap, 0xff, IO_BITMAP_BYTES); 80 memset(bitmap, 0xff, IO_BITMAP_BYTES);
81 t->io_bitmap_ptr = bitmap; 81 t->io_bitmap_ptr = bitmap;
82 set_thread_flag(TIF_IO_BITMAP);
82 } 83 }
83 84
84 /* 85 /*
diff --git a/arch/i386/kernel/kprobes.c b/arch/i386/kernel/kprobes.c
index de2e16e561c0..afe6505ca0b3 100644
--- a/arch/i386/kernel/kprobes.c
+++ b/arch/i386/kernel/kprobes.c
@@ -256,11 +256,6 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
256 int ret = 0; 256 int ret = 0;
257 kprobe_opcode_t *addr; 257 kprobe_opcode_t *addr;
258 struct kprobe_ctlblk *kcb; 258 struct kprobe_ctlblk *kcb;
259#ifdef CONFIG_PREEMPT
260 unsigned pre_preempt_count = preempt_count();
261#else
262 unsigned pre_preempt_count = 1;
263#endif
264 259
265 addr = (kprobe_opcode_t *)(regs->eip - sizeof(kprobe_opcode_t)); 260 addr = (kprobe_opcode_t *)(regs->eip - sizeof(kprobe_opcode_t));
266 261
@@ -338,13 +333,15 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
338 return 1; 333 return 1;
339 334
340ss_probe: 335ss_probe:
341 if (pre_preempt_count && p->ainsn.boostable == 1 && !p->post_handler){ 336#ifndef CONFIG_PREEMPT
337 if (p->ainsn.boostable == 1 && !p->post_handler){
342 /* Boost up -- we can execute copied instructions directly */ 338 /* Boost up -- we can execute copied instructions directly */
343 reset_current_kprobe(); 339 reset_current_kprobe();
344 regs->eip = (unsigned long)p->ainsn.insn; 340 regs->eip = (unsigned long)p->ainsn.insn;
345 preempt_enable_no_resched(); 341 preempt_enable_no_resched();
346 return 1; 342 return 1;
347 } 343 }
344#endif
348 prepare_singlestep(p, regs); 345 prepare_singlestep(p, regs);
349 kcb->kprobe_status = KPROBE_HIT_SS; 346 kcb->kprobe_status = KPROBE_HIT_SS;
350 return 1; 347 return 1;
diff --git a/arch/i386/kernel/machine_kexec.c b/arch/i386/kernel/machine_kexec.c
index 511abe52a94e..6b1ae6ba76f0 100644
--- a/arch/i386/kernel/machine_kexec.c
+++ b/arch/i386/kernel/machine_kexec.c
@@ -189,14 +189,11 @@ NORET_TYPE void machine_kexec(struct kimage *image)
189 memcpy((void *)reboot_code_buffer, relocate_new_kernel, 189 memcpy((void *)reboot_code_buffer, relocate_new_kernel,
190 relocate_new_kernel_size); 190 relocate_new_kernel_size);
191 191
192 /* The segment registers are funny things, they are 192 /* The segment registers are funny things, they have both a
193 * automatically loaded from a table, in memory wherever you 193 * visible and an invisible part. Whenever the visible part is
194 * set them to a specific selector, but this table is never 194 * set to a specific selector, the invisible part is loaded
195 * accessed again you set the segment to a different selector. 195 * with from a table in memory. At no other time is the
196 * 196 * descriptor table in memory accessed.
197 * The more common model is are caches where the behide
198 * the scenes work is done, but is also dropped at arbitrary
199 * times.
200 * 197 *
201 * I take advantage of this here by force loading the 198 * I take advantage of this here by force loading the
202 * segments, before I zap the gdt with an invalid value. 199 * segments, before I zap the gdt with an invalid value.
diff --git a/arch/i386/kernel/nmi.c b/arch/i386/kernel/nmi.c
index 2dd928a84645..acb351478e42 100644
--- a/arch/i386/kernel/nmi.c
+++ b/arch/i386/kernel/nmi.c
@@ -575,6 +575,7 @@ void touch_nmi_watchdog (void)
575 */ 575 */
576 touch_softlockup_watchdog(); 576 touch_softlockup_watchdog();
577} 577}
578EXPORT_SYMBOL(touch_nmi_watchdog);
578 579
579extern void die_nmi(struct pt_regs *, const char *msg); 580extern void die_nmi(struct pt_regs *, const char *msg);
580 581
diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c
index 94e2c87edeaa..8657c739656a 100644
--- a/arch/i386/kernel/process.c
+++ b/arch/i386/kernel/process.c
@@ -359,16 +359,16 @@ EXPORT_SYMBOL(kernel_thread);
359 */ 359 */
360void exit_thread(void) 360void exit_thread(void)
361{ 361{
362 struct task_struct *tsk = current;
363 struct thread_struct *t = &tsk->thread;
364
365 /* The process may have allocated an io port bitmap... nuke it. */ 362 /* The process may have allocated an io port bitmap... nuke it. */
366 if (unlikely(NULL != t->io_bitmap_ptr)) { 363 if (unlikely(test_thread_flag(TIF_IO_BITMAP))) {
364 struct task_struct *tsk = current;
365 struct thread_struct *t = &tsk->thread;
367 int cpu = get_cpu(); 366 int cpu = get_cpu();
368 struct tss_struct *tss = &per_cpu(init_tss, cpu); 367 struct tss_struct *tss = &per_cpu(init_tss, cpu);
369 368
370 kfree(t->io_bitmap_ptr); 369 kfree(t->io_bitmap_ptr);
371 t->io_bitmap_ptr = NULL; 370 t->io_bitmap_ptr = NULL;
371 clear_thread_flag(TIF_IO_BITMAP);
372 /* 372 /*
373 * Careful, clear this in the TSS too: 373 * Careful, clear this in the TSS too:
374 */ 374 */
@@ -387,6 +387,7 @@ void flush_thread(void)
387 387
388 memset(tsk->thread.debugreg, 0, sizeof(unsigned long)*8); 388 memset(tsk->thread.debugreg, 0, sizeof(unsigned long)*8);
389 memset(tsk->thread.tls_array, 0, sizeof(tsk->thread.tls_array)); 389 memset(tsk->thread.tls_array, 0, sizeof(tsk->thread.tls_array));
390 clear_tsk_thread_flag(tsk, TIF_DEBUG);
390 /* 391 /*
391 * Forget coprocessor state.. 392 * Forget coprocessor state..
392 */ 393 */
@@ -431,7 +432,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long esp,
431 savesegment(gs,p->thread.gs); 432 savesegment(gs,p->thread.gs);
432 433
433 tsk = current; 434 tsk = current;
434 if (unlikely(NULL != tsk->thread.io_bitmap_ptr)) { 435 if (unlikely(test_tsk_thread_flag(tsk, TIF_IO_BITMAP))) {
435 p->thread.io_bitmap_ptr = kmalloc(IO_BITMAP_BYTES, GFP_KERNEL); 436 p->thread.io_bitmap_ptr = kmalloc(IO_BITMAP_BYTES, GFP_KERNEL);
436 if (!p->thread.io_bitmap_ptr) { 437 if (!p->thread.io_bitmap_ptr) {
437 p->thread.io_bitmap_max = 0; 438 p->thread.io_bitmap_max = 0;
@@ -439,6 +440,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long esp,
439 } 440 }
440 memcpy(p->thread.io_bitmap_ptr, tsk->thread.io_bitmap_ptr, 441 memcpy(p->thread.io_bitmap_ptr, tsk->thread.io_bitmap_ptr,
441 IO_BITMAP_BYTES); 442 IO_BITMAP_BYTES);
443 set_tsk_thread_flag(p, TIF_IO_BITMAP);
442 } 444 }
443 445
444 /* 446 /*
@@ -533,10 +535,24 @@ int dump_task_regs(struct task_struct *tsk, elf_gregset_t *regs)
533 return 1; 535 return 1;
534} 536}
535 537
536static inline void 538static noinline void __switch_to_xtra(struct task_struct *next_p,
537handle_io_bitmap(struct thread_struct *next, struct tss_struct *tss) 539 struct tss_struct *tss)
538{ 540{
539 if (!next->io_bitmap_ptr) { 541 struct thread_struct *next;
542
543 next = &next_p->thread;
544
545 if (test_tsk_thread_flag(next_p, TIF_DEBUG)) {
546 set_debugreg(next->debugreg[0], 0);
547 set_debugreg(next->debugreg[1], 1);
548 set_debugreg(next->debugreg[2], 2);
549 set_debugreg(next->debugreg[3], 3);
550 /* no 4 and 5 */
551 set_debugreg(next->debugreg[6], 6);
552 set_debugreg(next->debugreg[7], 7);
553 }
554
555 if (!test_tsk_thread_flag(next_p, TIF_IO_BITMAP)) {
540 /* 556 /*
541 * Disable the bitmap via an invalid offset. We still cache 557 * Disable the bitmap via an invalid offset. We still cache
542 * the previous bitmap owner and the IO bitmap contents: 558 * the previous bitmap owner and the IO bitmap contents:
@@ -544,6 +560,7 @@ handle_io_bitmap(struct thread_struct *next, struct tss_struct *tss)
544 tss->io_bitmap_base = INVALID_IO_BITMAP_OFFSET; 560 tss->io_bitmap_base = INVALID_IO_BITMAP_OFFSET;
545 return; 561 return;
546 } 562 }
563
547 if (likely(next == tss->io_bitmap_owner)) { 564 if (likely(next == tss->io_bitmap_owner)) {
548 /* 565 /*
549 * Previous owner of the bitmap (hence the bitmap content) 566 * Previous owner of the bitmap (hence the bitmap content)
@@ -671,20 +688,11 @@ struct task_struct fastcall * __switch_to(struct task_struct *prev_p, struct tas
671 set_iopl_mask(next->iopl); 688 set_iopl_mask(next->iopl);
672 689
673 /* 690 /*
674 * Now maybe reload the debug registers 691 * Now maybe handle debug registers and/or IO bitmaps
675 */ 692 */
676 if (unlikely(next->debugreg[7])) { 693 if (unlikely((task_thread_info(next_p)->flags & _TIF_WORK_CTXSW)
677 set_debugreg(next->debugreg[0], 0); 694 || test_tsk_thread_flag(prev_p, TIF_IO_BITMAP)))
678 set_debugreg(next->debugreg[1], 1); 695 __switch_to_xtra(next_p, tss);
679 set_debugreg(next->debugreg[2], 2);
680 set_debugreg(next->debugreg[3], 3);
681 /* no 4 and 5 */
682 set_debugreg(next->debugreg[6], 6);
683 set_debugreg(next->debugreg[7], 7);
684 }
685
686 if (unlikely(prev->io_bitmap_ptr || next->io_bitmap_ptr))
687 handle_io_bitmap(next, tss);
688 696
689 disable_tsc(prev_p, next_p); 697 disable_tsc(prev_p, next_p);
690 698
diff --git a/arch/i386/kernel/ptrace.c b/arch/i386/kernel/ptrace.c
index fd7eaf7866e0..d3db03f4085d 100644
--- a/arch/i386/kernel/ptrace.c
+++ b/arch/i386/kernel/ptrace.c
@@ -468,8 +468,11 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
468 for(i=0; i<4; i++) 468 for(i=0; i<4; i++)
469 if ((0x5f54 >> ((data >> (16 + 4*i)) & 0xf)) & 1) 469 if ((0x5f54 >> ((data >> (16 + 4*i)) & 0xf)) & 1)
470 goto out_tsk; 470 goto out_tsk;
471 if (data)
472 set_tsk_thread_flag(child, TIF_DEBUG);
473 else
474 clear_tsk_thread_flag(child, TIF_DEBUG);
471 } 475 }
472
473 addr -= (long) &dummy->u_debugreg; 476 addr -= (long) &dummy->u_debugreg;
474 addr = addr >> 2; 477 addr = addr >> 2;
475 child->thread.debugreg[addr] = data; 478 child->thread.debugreg[addr] = data;
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index 08c00d20f162..f1682206d304 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -26,7 +26,7 @@
26#include <linux/sched.h> 26#include <linux/sched.h>
27#include <linux/mm.h> 27#include <linux/mm.h>
28#include <linux/mmzone.h> 28#include <linux/mmzone.h>
29#include <linux/tty.h> 29#include <linux/screen_info.h>
30#include <linux/ioport.h> 30#include <linux/ioport.h>
31#include <linux/acpi.h> 31#include <linux/acpi.h>
32#include <linux/apm_bios.h> 32#include <linux/apm_bios.h>
@@ -1327,7 +1327,10 @@ legacy_init_iomem_resources(struct resource *code_resource, struct resource *dat
1327 res->start = e820.map[i].addr; 1327 res->start = e820.map[i].addr;
1328 res->end = res->start + e820.map[i].size - 1; 1328 res->end = res->start + e820.map[i].size - 1;
1329 res->flags = IORESOURCE_MEM | IORESOURCE_BUSY; 1329 res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
1330 request_resource(&iomem_resource, res); 1330 if (request_resource(&iomem_resource, res)) {
1331 kfree(res);
1332 continue;
1333 }
1331 if (e820.map[i].type == E820_RAM) { 1334 if (e820.map[i].type == E820_RAM) {
1332 /* 1335 /*
1333 * We don't know which RAM region contains kernel data, 1336 * We don't know which RAM region contains kernel data,
diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c
index 6f5fea05f1d7..f948419c888a 100644
--- a/arch/i386/kernel/smpboot.c
+++ b/arch/i386/kernel/smpboot.c
@@ -212,14 +212,20 @@ valid_k7:
212 * then we print a warning if not, and always resync. 212 * then we print a warning if not, and always resync.
213 */ 213 */
214 214
215static atomic_t tsc_start_flag = ATOMIC_INIT(0); 215static struct {
216static atomic_t tsc_count_start = ATOMIC_INIT(0); 216 atomic_t start_flag;
217static atomic_t tsc_count_stop = ATOMIC_INIT(0); 217 atomic_t count_start;
218static unsigned long long tsc_values[NR_CPUS]; 218 atomic_t count_stop;
219 unsigned long long values[NR_CPUS];
220} tsc __initdata = {
221 .start_flag = ATOMIC_INIT(0),
222 .count_start = ATOMIC_INIT(0),
223 .count_stop = ATOMIC_INIT(0),
224};
219 225
220#define NR_LOOPS 5 226#define NR_LOOPS 5
221 227
222static void __init synchronize_tsc_bp (void) 228static void __init synchronize_tsc_bp(void)
223{ 229{
224 int i; 230 int i;
225 unsigned long long t0; 231 unsigned long long t0;
@@ -233,7 +239,7 @@ static void __init synchronize_tsc_bp (void)
233 /* convert from kcyc/sec to cyc/usec */ 239 /* convert from kcyc/sec to cyc/usec */
234 one_usec = cpu_khz / 1000; 240 one_usec = cpu_khz / 1000;
235 241
236 atomic_set(&tsc_start_flag, 1); 242 atomic_set(&tsc.start_flag, 1);
237 wmb(); 243 wmb();
238 244
239 /* 245 /*
@@ -250,16 +256,16 @@ static void __init synchronize_tsc_bp (void)
250 /* 256 /*
251 * all APs synchronize but they loop on '== num_cpus' 257 * all APs synchronize but they loop on '== num_cpus'
252 */ 258 */
253 while (atomic_read(&tsc_count_start) != num_booting_cpus()-1) 259 while (atomic_read(&tsc.count_start) != num_booting_cpus()-1)
254 cpu_relax(); 260 cpu_relax();
255 atomic_set(&tsc_count_stop, 0); 261 atomic_set(&tsc.count_stop, 0);
256 wmb(); 262 wmb();
257 /* 263 /*
258 * this lets the APs save their current TSC: 264 * this lets the APs save their current TSC:
259 */ 265 */
260 atomic_inc(&tsc_count_start); 266 atomic_inc(&tsc.count_start);
261 267
262 rdtscll(tsc_values[smp_processor_id()]); 268 rdtscll(tsc.values[smp_processor_id()]);
263 /* 269 /*
264 * We clear the TSC in the last loop: 270 * We clear the TSC in the last loop:
265 */ 271 */
@@ -269,56 +275,54 @@ static void __init synchronize_tsc_bp (void)
269 /* 275 /*
270 * Wait for all APs to leave the synchronization point: 276 * Wait for all APs to leave the synchronization point:
271 */ 277 */
272 while (atomic_read(&tsc_count_stop) != num_booting_cpus()-1) 278 while (atomic_read(&tsc.count_stop) != num_booting_cpus()-1)
273 cpu_relax(); 279 cpu_relax();
274 atomic_set(&tsc_count_start, 0); 280 atomic_set(&tsc.count_start, 0);
275 wmb(); 281 wmb();
276 atomic_inc(&tsc_count_stop); 282 atomic_inc(&tsc.count_stop);
277 } 283 }
278 284
279 sum = 0; 285 sum = 0;
280 for (i = 0; i < NR_CPUS; i++) { 286 for (i = 0; i < NR_CPUS; i++) {
281 if (cpu_isset(i, cpu_callout_map)) { 287 if (cpu_isset(i, cpu_callout_map)) {
282 t0 = tsc_values[i]; 288 t0 = tsc.values[i];
283 sum += t0; 289 sum += t0;
284 } 290 }
285 } 291 }
286 avg = sum; 292 avg = sum;
287 do_div(avg, num_booting_cpus()); 293 do_div(avg, num_booting_cpus());
288 294
289 sum = 0;
290 for (i = 0; i < NR_CPUS; i++) { 295 for (i = 0; i < NR_CPUS; i++) {
291 if (!cpu_isset(i, cpu_callout_map)) 296 if (!cpu_isset(i, cpu_callout_map))
292 continue; 297 continue;
293 delta = tsc_values[i] - avg; 298 delta = tsc.values[i] - avg;
294 if (delta < 0) 299 if (delta < 0)
295 delta = -delta; 300 delta = -delta;
296 /* 301 /*
297 * We report bigger than 2 microseconds clock differences. 302 * We report bigger than 2 microseconds clock differences.
298 */ 303 */
299 if (delta > 2*one_usec) { 304 if (delta > 2*one_usec) {
300 long realdelta; 305 long long realdelta;
306
301 if (!buggy) { 307 if (!buggy) {
302 buggy = 1; 308 buggy = 1;
303 printk("\n"); 309 printk("\n");
304 } 310 }
305 realdelta = delta; 311 realdelta = delta;
306 do_div(realdelta, one_usec); 312 do_div(realdelta, one_usec);
307 if (tsc_values[i] < avg) 313 if (tsc.values[i] < avg)
308 realdelta = -realdelta; 314 realdelta = -realdelta;
309 315
310 if (realdelta > 0) 316 if (realdelta)
311 printk(KERN_INFO "CPU#%d had %ld usecs TSC " 317 printk(KERN_INFO "CPU#%d had %Ld usecs TSC "
312 "skew, fixed it up.\n", i, realdelta); 318 "skew, fixed it up.\n", i, realdelta);
313 } 319 }
314
315 sum += delta;
316 } 320 }
317 if (!buggy) 321 if (!buggy)
318 printk("passed.\n"); 322 printk("passed.\n");
319} 323}
320 324
321static void __init synchronize_tsc_ap (void) 325static void __init synchronize_tsc_ap(void)
322{ 326{
323 int i; 327 int i;
324 328
@@ -327,20 +331,20 @@ static void __init synchronize_tsc_ap (void)
327 * this gets called, so we first wait for the BP to 331 * this gets called, so we first wait for the BP to
328 * finish SMP initialization: 332 * finish SMP initialization:
329 */ 333 */
330 while (!atomic_read(&tsc_start_flag)) 334 while (!atomic_read(&tsc.start_flag))
331 cpu_relax(); 335 cpu_relax();
332 336
333 for (i = 0; i < NR_LOOPS; i++) { 337 for (i = 0; i < NR_LOOPS; i++) {
334 atomic_inc(&tsc_count_start); 338 atomic_inc(&tsc.count_start);
335 while (atomic_read(&tsc_count_start) != num_booting_cpus()) 339 while (atomic_read(&tsc.count_start) != num_booting_cpus())
336 cpu_relax(); 340 cpu_relax();
337 341
338 rdtscll(tsc_values[smp_processor_id()]); 342 rdtscll(tsc.values[smp_processor_id()]);
339 if (i == NR_LOOPS-1) 343 if (i == NR_LOOPS-1)
340 write_tsc(0, 0); 344 write_tsc(0, 0);
341 345
342 atomic_inc(&tsc_count_stop); 346 atomic_inc(&tsc.count_stop);
343 while (atomic_read(&tsc_count_stop) != num_booting_cpus()) 347 while (atomic_read(&tsc.count_stop) != num_booting_cpus())
344 cpu_relax(); 348 cpu_relax();
345 } 349 }
346} 350}
diff --git a/arch/i386/kernel/time.c b/arch/i386/kernel/time.c
index 316421a7f56f..edd00f6cee37 100644
--- a/arch/i386/kernel/time.c
+++ b/arch/i386/kernel/time.c
@@ -135,7 +135,7 @@ unsigned long profile_pc(struct pt_regs *regs)
135{ 135{
136 unsigned long pc = instruction_pointer(regs); 136 unsigned long pc = instruction_pointer(regs);
137 137
138 if (in_lock_functions(pc)) 138 if (!user_mode_vm(regs) && in_lock_functions(pc))
139 return *(unsigned long *)(regs->ebp + 4); 139 return *(unsigned long *)(regs->ebp + 4);
140 140
141 return pc; 141 return pc;
@@ -206,15 +206,16 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
206unsigned long get_cmos_time(void) 206unsigned long get_cmos_time(void)
207{ 207{
208 unsigned long retval; 208 unsigned long retval;
209 unsigned long flags;
209 210
210 spin_lock(&rtc_lock); 211 spin_lock_irqsave(&rtc_lock, flags);
211 212
212 if (efi_enabled) 213 if (efi_enabled)
213 retval = efi_get_time(); 214 retval = efi_get_time();
214 else 215 else
215 retval = mach_get_cmos_time(); 216 retval = mach_get_cmos_time();
216 217
217 spin_unlock(&rtc_lock); 218 spin_unlock_irqrestore(&rtc_lock, flags);
218 219
219 return retval; 220 return retval;
220} 221}
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c
index 2bf8b55b91f8..0d4005dc06c5 100644
--- a/arch/i386/kernel/traps.c
+++ b/arch/i386/kernel/traps.c
@@ -100,13 +100,13 @@ int register_die_notifier(struct notifier_block *nb)
100 vmalloc_sync_all(); 100 vmalloc_sync_all();
101 return atomic_notifier_chain_register(&i386die_chain, nb); 101 return atomic_notifier_chain_register(&i386die_chain, nb);
102} 102}
103EXPORT_SYMBOL(register_die_notifier); 103EXPORT_SYMBOL(register_die_notifier); /* used modular by kdb */
104 104
105int unregister_die_notifier(struct notifier_block *nb) 105int unregister_die_notifier(struct notifier_block *nb)
106{ 106{
107 return atomic_notifier_chain_unregister(&i386die_chain, nb); 107 return atomic_notifier_chain_unregister(&i386die_chain, nb);
108} 108}
109EXPORT_SYMBOL(unregister_die_notifier); 109EXPORT_SYMBOL(unregister_die_notifier); /* used modular by kdb */
110 110
111static inline int valid_stack_ptr(struct thread_info *tinfo, void *p) 111static inline int valid_stack_ptr(struct thread_info *tinfo, void *p)
112{ 112{
@@ -187,10 +187,21 @@ static void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,
187 if (unwind_init_blocked(&info, task) == 0) 187 if (unwind_init_blocked(&info, task) == 0)
188 unw_ret = show_trace_unwind(&info, log_lvl); 188 unw_ret = show_trace_unwind(&info, log_lvl);
189 } 189 }
190 if (unw_ret > 0) { 190 if (unw_ret > 0 && !arch_unw_user_mode(&info)) {
191 if (call_trace > 0) 191#ifdef CONFIG_STACK_UNWIND
192 print_symbol("DWARF2 unwinder stuck at %s\n",
193 UNW_PC(&info));
194 if (call_trace == 1) {
195 printk("Leftover inexact backtrace:\n");
196 if (UNW_SP(&info))
197 stack = (void *)UNW_SP(&info);
198 } else if (call_trace > 1)
192 return; 199 return;
193 printk("%sLegacy call trace:\n", log_lvl); 200 else
201 printk("Full inexact backtrace again:\n");
202#else
203 printk("Inexact backtrace:\n");
204#endif
194 } 205 }
195 } 206 }
196 207
@@ -324,35 +335,35 @@ void show_registers(struct pt_regs *regs)
324 335
325static void handle_BUG(struct pt_regs *regs) 336static void handle_BUG(struct pt_regs *regs)
326{ 337{
338 unsigned long eip = regs->eip;
327 unsigned short ud2; 339 unsigned short ud2;
328 unsigned short line;
329 char *file;
330 char c;
331 unsigned long eip;
332
333 eip = regs->eip;
334 340
335 if (eip < PAGE_OFFSET) 341 if (eip < PAGE_OFFSET)
336 goto no_bug; 342 return;
337 if (__get_user(ud2, (unsigned short __user *)eip)) 343 if (__get_user(ud2, (unsigned short __user *)eip))
338 goto no_bug; 344 return;
339 if (ud2 != 0x0b0f) 345 if (ud2 != 0x0b0f)
340 goto no_bug; 346 return;
341 if (__get_user(line, (unsigned short __user *)(eip + 2)))
342 goto bug;
343 if (__get_user(file, (char * __user *)(eip + 4)) ||
344 (unsigned long)file < PAGE_OFFSET || __get_user(c, file))
345 file = "<bad filename>";
346 347
347 printk(KERN_EMERG "------------[ cut here ]------------\n"); 348 printk(KERN_EMERG "------------[ cut here ]------------\n");
348 printk(KERN_EMERG "kernel BUG at %s:%d!\n", file, line);
349 349
350no_bug: 350#ifdef CONFIG_DEBUG_BUGVERBOSE
351 return; 351 do {
352 unsigned short line;
353 char *file;
354 char c;
355
356 if (__get_user(line, (unsigned short __user *)(eip + 2)))
357 break;
358 if (__get_user(file, (char * __user *)(eip + 4)) ||
359 (unsigned long)file < PAGE_OFFSET || __get_user(c, file))
360 file = "<bad filename>";
352 361
353 /* Here we know it was a BUG but file-n-line is unavailable */ 362 printk(KERN_EMERG "kernel BUG at %s:%d!\n", file, line);
354bug: 363 return;
355 printk(KERN_EMERG "Kernel BUG\n"); 364 } while (0);
365#endif
366 printk(KERN_EMERG "Kernel BUG at [verbose debug info unavailable]\n");
356} 367}
357 368
358/* This is gone through when something in the kernel 369/* This is gone through when something in the kernel
@@ -442,11 +453,9 @@ void die(const char * str, struct pt_regs * regs, long err)
442 if (in_interrupt()) 453 if (in_interrupt())
443 panic("Fatal exception in interrupt"); 454 panic("Fatal exception in interrupt");
444 455
445 if (panic_on_oops) { 456 if (panic_on_oops)
446 printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n"); 457 panic("Fatal exception: panic_on_oops");
447 ssleep(5); 458
448 panic("Fatal exception");
449 }
450 oops_exit(); 459 oops_exit();
451 do_exit(SIGSEGV); 460 do_exit(SIGSEGV);
452} 461}
@@ -1238,8 +1247,10 @@ static int __init call_trace_setup(char *s)
1238 call_trace = -1; 1247 call_trace = -1;
1239 else if (strcmp(s, "both") == 0) 1248 else if (strcmp(s, "both") == 0)
1240 call_trace = 0; 1249 call_trace = 0;
1241 else if (strcmp(s, "new") == 0) 1250 else if (strcmp(s, "newfallback") == 0)
1242 call_trace = 1; 1251 call_trace = 1;
1252 else if (strcmp(s, "new") == 2)
1253 call_trace = 2;
1243 return 1; 1254 return 1;
1244} 1255}
1245__setup("call_trace=", call_trace_setup); 1256__setup("call_trace=", call_trace_setup);
diff --git a/arch/i386/kernel/vsyscall.lds.S b/arch/i386/kernel/vsyscall.lds.S
index e26975fc68b6..f66cd11adb72 100644
--- a/arch/i386/kernel/vsyscall.lds.S
+++ b/arch/i386/kernel/vsyscall.lds.S
@@ -10,6 +10,7 @@ SECTIONS
10 . = VDSO_PRELINK + SIZEOF_HEADERS; 10 . = VDSO_PRELINK + SIZEOF_HEADERS;
11 11
12 .hash : { *(.hash) } :text 12 .hash : { *(.hash) } :text
13 .gnu.hash : { *(.gnu.hash) }
13 .dynsym : { *(.dynsym) } 14 .dynsym : { *(.dynsym) }
14 .dynstr : { *(.dynstr) } 15 .dynstr : { *(.dynstr) }
15 .gnu.version : { *(.gnu.version) } 16 .gnu.version : { *(.gnu.version) }
diff --git a/arch/i386/lib/usercopy.c b/arch/i386/lib/usercopy.c
index 4b75212ab6dd..efc7e7d5f4d0 100644
--- a/arch/i386/lib/usercopy.c
+++ b/arch/i386/lib/usercopy.c
@@ -843,7 +843,6 @@ unsigned long __copy_from_user_ll_nocache_nozero(void *to, const void __user *fr
843unsigned long 843unsigned long
844copy_to_user(void __user *to, const void *from, unsigned long n) 844copy_to_user(void __user *to, const void *from, unsigned long n)
845{ 845{
846 might_sleep();
847 BUG_ON((long) n < 0); 846 BUG_ON((long) n < 0);
848 if (access_ok(VERIFY_WRITE, to, n)) 847 if (access_ok(VERIFY_WRITE, to, n))
849 n = __copy_to_user(to, from, n); 848 n = __copy_to_user(to, from, n);
@@ -870,7 +869,6 @@ EXPORT_SYMBOL(copy_to_user);
870unsigned long 869unsigned long
871copy_from_user(void *to, const void __user *from, unsigned long n) 870copy_from_user(void *to, const void __user *from, unsigned long n)
872{ 871{
873 might_sleep();
874 BUG_ON((long) n < 0); 872 BUG_ON((long) n < 0);
875 if (access_ok(VERIFY_READ, from, n)) 873 if (access_ok(VERIFY_READ, from, n))
876 n = __copy_from_user(to, from, n); 874 n = __copy_from_user(to, from, n);
diff --git a/arch/i386/oprofile/nmi_int.c b/arch/i386/oprofile/nmi_int.c
index fa8a37bcb391..c8c1df8ff2b4 100644
--- a/arch/i386/oprofile/nmi_int.c
+++ b/arch/i386/oprofile/nmi_int.c
@@ -13,6 +13,7 @@
13#include <linux/oprofile.h> 13#include <linux/oprofile.h>
14#include <linux/sysdev.h> 14#include <linux/sysdev.h>
15#include <linux/slab.h> 15#include <linux/slab.h>
16#include <linux/moduleparam.h>
16#include <asm/nmi.h> 17#include <asm/nmi.h>
17#include <asm/msr.h> 18#include <asm/msr.h>
18#include <asm/apic.h> 19#include <asm/apic.h>
@@ -296,12 +297,14 @@ static int nmi_create_files(struct super_block * sb, struct dentry * root)
296 return 0; 297 return 0;
297} 298}
298 299
300static int p4force;
301module_param(p4force, int, 0);
299 302
300static int __init p4_init(char ** cpu_type) 303static int __init p4_init(char ** cpu_type)
301{ 304{
302 __u8 cpu_model = boot_cpu_data.x86_model; 305 __u8 cpu_model = boot_cpu_data.x86_model;
303 306
304 if (cpu_model > 4) 307 if (!p4force && (cpu_model > 6 || cpu_model == 5))
305 return 0; 308 return 0;
306 309
307#ifndef CONFIG_SMP 310#ifndef CONFIG_SMP
diff --git a/arch/i386/pci/common.c b/arch/i386/pci/common.c
index c624b61e1104..0a362e3aeac5 100644
--- a/arch/i386/pci/common.c
+++ b/arch/i386/pci/common.c
@@ -17,10 +17,6 @@
17 17
18#include "pci.h" 18#include "pci.h"
19 19
20#ifdef CONFIG_PCI_BIOS
21extern void pcibios_sort(void);
22#endif
23
24unsigned int pci_probe = PCI_PROBE_BIOS | PCI_PROBE_CONF1 | PCI_PROBE_CONF2 | 20unsigned int pci_probe = PCI_PROBE_BIOS | PCI_PROBE_CONF1 | PCI_PROBE_CONF2 |
25 PCI_PROBE_MMCONF; 21 PCI_PROBE_MMCONF;
26 22
diff --git a/arch/i386/pci/pci.h b/arch/i386/pci/pci.h
index 12bf3d8dda29..bf4e79335388 100644
--- a/arch/i386/pci/pci.h
+++ b/arch/i386/pci/pci.h
@@ -84,4 +84,4 @@ extern int pci_conf1_read(unsigned int seg, unsigned int bus,
84extern void pci_direct_init(void); 84extern void pci_direct_init(void);
85extern void pci_pcbios_init(void); 85extern void pci_pcbios_init(void);
86extern void pci_mmcfg_init(void); 86extern void pci_mmcfg_init(void);
87 87extern void pcibios_sort(void);
diff --git a/arch/ia64/configs/sn2_defconfig b/arch/ia64/configs/sn2_defconfig
index 9ea35398e10d..0f14a82b856e 100644
--- a/arch/ia64/configs/sn2_defconfig
+++ b/arch/ia64/configs/sn2_defconfig
@@ -363,7 +363,7 @@ CONFIG_BLK_DEV_IDECD=y
363# 363#
364CONFIG_IDE_GENERIC=y 364CONFIG_IDE_GENERIC=y
365CONFIG_BLK_DEV_IDEPCI=y 365CONFIG_BLK_DEV_IDEPCI=y
366# CONFIG_IDEPCI_SHARE_IRQ is not set 366CONFIG_IDEPCI_SHARE_IRQ=y
367# CONFIG_BLK_DEV_OFFBOARD is not set 367# CONFIG_BLK_DEV_OFFBOARD is not set
368# CONFIG_BLK_DEV_GENERIC is not set 368# CONFIG_BLK_DEV_GENERIC is not set
369# CONFIG_BLK_DEV_OPTI621 is not set 369# CONFIG_BLK_DEV_OPTI621 is not set
diff --git a/arch/ia64/defconfig b/arch/ia64/defconfig
index 6cba55da572a..9001b3fbaa32 100644
--- a/arch/ia64/defconfig
+++ b/arch/ia64/defconfig
@@ -366,7 +366,7 @@ CONFIG_BLK_DEV_IDESCSI=m
366# CONFIG_IDE_GENERIC is not set 366# CONFIG_IDE_GENERIC is not set
367# CONFIG_BLK_DEV_IDEPNP is not set 367# CONFIG_BLK_DEV_IDEPNP is not set
368CONFIG_BLK_DEV_IDEPCI=y 368CONFIG_BLK_DEV_IDEPCI=y
369# CONFIG_IDEPCI_SHARE_IRQ is not set 369CONFIG_IDEPCI_SHARE_IRQ=y
370# CONFIG_BLK_DEV_OFFBOARD is not set 370# CONFIG_BLK_DEV_OFFBOARD is not set
371CONFIG_BLK_DEV_GENERIC=y 371CONFIG_BLK_DEV_GENERIC=y
372# CONFIG_BLK_DEV_OPTI621 is not set 372# CONFIG_BLK_DEV_OPTI621 is not set
diff --git a/arch/ia64/dig/setup.c b/arch/ia64/dig/setup.c
index 5ab12b8351d0..9196b330ff7f 100644
--- a/arch/ia64/dig/setup.c
+++ b/arch/ia64/dig/setup.c
@@ -14,7 +14,7 @@
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/kdev_t.h> 15#include <linux/kdev_t.h>
16#include <linux/string.h> 16#include <linux/string.h>
17#include <linux/tty.h> 17#include <linux/screen_info.h>
18#include <linux/console.h> 18#include <linux/console.h>
19#include <linux/timex.h> 19#include <linux/timex.h>
20#include <linux/sched.h> 20#include <linux/sched.h>
diff --git a/arch/ia64/hp/sim/simscsi.c b/arch/ia64/hp/sim/simscsi.c
index a3fe97531134..8a4f0d0d17a3 100644
--- a/arch/ia64/hp/sim/simscsi.c
+++ b/arch/ia64/hp/sim/simscsi.c
@@ -151,7 +151,7 @@ static void
151simscsi_sg_readwrite (struct scsi_cmnd *sc, int mode, unsigned long offset) 151simscsi_sg_readwrite (struct scsi_cmnd *sc, int mode, unsigned long offset)
152{ 152{
153 int list_len = sc->use_sg; 153 int list_len = sc->use_sg;
154 struct scatterlist *sl = (struct scatterlist *)sc->buffer; 154 struct scatterlist *sl = (struct scatterlist *)sc->request_buffer;
155 struct disk_stat stat; 155 struct disk_stat stat;
156 struct disk_req req; 156 struct disk_req req;
157 157
@@ -244,7 +244,7 @@ static void simscsi_fillresult(struct scsi_cmnd *sc, char *buf, unsigned len)
244 244
245 if (scatterlen == 0) 245 if (scatterlen == 0)
246 memcpy(sc->request_buffer, buf, len); 246 memcpy(sc->request_buffer, buf, len);
247 else for (slp = (struct scatterlist *)sc->buffer; scatterlen-- > 0 && len > 0; slp++) { 247 else for (slp = (struct scatterlist *)sc->request_buffer; scatterlen-- > 0 && len > 0; slp++) {
248 unsigned thislen = min(len, slp->length); 248 unsigned thislen = min(len, slp->length);
249 249
250 memcpy(page_address(slp->page) + slp->offset, buf, thislen); 250 memcpy(page_address(slp->page) + slp->offset, buf, thislen);
diff --git a/arch/ia64/kernel/Makefile b/arch/ia64/kernel/Makefile
index 0e4553f320bf..ad8215a3c586 100644
--- a/arch/ia64/kernel/Makefile
+++ b/arch/ia64/kernel/Makefile
@@ -45,7 +45,8 @@ CPPFLAGS_gate.lds := -P -C -U$(ARCH)
45quiet_cmd_gate = GATE $@ 45quiet_cmd_gate = GATE $@
46 cmd_gate = $(CC) -nostdlib $(GATECFLAGS_$(@F)) -Wl,-T,$(filter-out FORCE,$^) -o $@ 46 cmd_gate = $(CC) -nostdlib $(GATECFLAGS_$(@F)) -Wl,-T,$(filter-out FORCE,$^) -o $@
47 47
48GATECFLAGS_gate.so = -shared -s -Wl,-soname=linux-gate.so.1 48GATECFLAGS_gate.so = -shared -s -Wl,-soname=linux-gate.so.1 \
49 $(call ld-option, -Wl$(comma)--hash-style=sysv)
49$(obj)/gate.so: $(obj)/gate.lds $(obj)/gate.o FORCE 50$(obj)/gate.so: $(obj)/gate.lds $(obj)/gate.o FORCE
50 $(call if_changed,gate) 51 $(call if_changed,gate)
51 52
diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c
index b13c0555c3ba..bb8770a177b5 100644
--- a/arch/ia64/kernel/efi.c
+++ b/arch/ia64/kernel/efi.c
@@ -632,7 +632,7 @@ kern_memory_descriptor (unsigned long phys_addr)
632 if (phys_addr - md->start < (md->num_pages << EFI_PAGE_SHIFT)) 632 if (phys_addr - md->start < (md->num_pages << EFI_PAGE_SHIFT))
633 return md; 633 return md;
634 } 634 }
635 return 0; 635 return NULL;
636} 636}
637 637
638static efi_memory_desc_t * 638static efi_memory_desc_t *
@@ -652,7 +652,7 @@ efi_memory_descriptor (unsigned long phys_addr)
652 if (phys_addr - md->phys_addr < (md->num_pages << EFI_PAGE_SHIFT)) 652 if (phys_addr - md->phys_addr < (md->num_pages << EFI_PAGE_SHIFT))
653 return md; 653 return md;
654 } 654 }
655 return 0; 655 return NULL;
656} 656}
657 657
658u32 658u32
@@ -759,7 +759,7 @@ valid_phys_addr_range (unsigned long phys_addr, unsigned long size)
759} 759}
760 760
761int 761int
762valid_mmap_phys_addr_range (unsigned long phys_addr, unsigned long size) 762valid_mmap_phys_addr_range (unsigned long pfn, unsigned long size)
763{ 763{
764 /* 764 /*
765 * MMIO regions are often missing from the EFI memory map. 765 * MMIO regions are often missing from the EFI memory map.
@@ -923,7 +923,7 @@ find_memmap_space (void)
923void 923void
924efi_memmap_init(unsigned long *s, unsigned long *e) 924efi_memmap_init(unsigned long *s, unsigned long *e)
925{ 925{
926 struct kern_memdesc *k, *prev = 0; 926 struct kern_memdesc *k, *prev = NULL;
927 u64 contig_low=0, contig_high=0; 927 u64 contig_low=0, contig_high=0;
928 u64 as, ae, lim; 928 u64 as, ae, lim;
929 void *efi_map_start, *efi_map_end, *p, *q; 929 void *efi_map_start, *efi_map_end, *p, *q;
diff --git a/arch/ia64/kernel/gate.lds.S b/arch/ia64/kernel/gate.lds.S
index cc35cddfd4cf..6d198339bf85 100644
--- a/arch/ia64/kernel/gate.lds.S
+++ b/arch/ia64/kernel/gate.lds.S
@@ -12,6 +12,7 @@ SECTIONS
12 . = GATE_ADDR + SIZEOF_HEADERS; 12 . = GATE_ADDR + SIZEOF_HEADERS;
13 13
14 .hash : { *(.hash) } :readable 14 .hash : { *(.hash) } :readable
15 .gnu.hash : { *(.gnu.hash) }
15 .dynsym : { *(.dynsym) } 16 .dynsym : { *(.dynsym) }
16 .dynstr : { *(.dynstr) } 17 .dynstr : { *(.dynstr) }
17 .gnu.version : { *(.gnu.version) } 18 .gnu.version : { *(.gnu.version) }
diff --git a/arch/ia64/kernel/head.S b/arch/ia64/kernel/head.S
index 561b8f1d3bc7..29236f0c62b5 100644
--- a/arch/ia64/kernel/head.S
+++ b/arch/ia64/kernel/head.S
@@ -853,7 +853,6 @@ END(__ia64_init_fpu)
853 */ 853 */
854GLOBAL_ENTRY(ia64_switch_mode_phys) 854GLOBAL_ENTRY(ia64_switch_mode_phys)
855 { 855 {
856 alloc r2=ar.pfs,0,0,0,0
857 rsm psr.i | psr.ic // disable interrupts and interrupt collection 856 rsm psr.i | psr.ic // disable interrupts and interrupt collection
858 mov r15=ip 857 mov r15=ip
859 } 858 }
@@ -902,7 +901,6 @@ END(ia64_switch_mode_phys)
902 */ 901 */
903GLOBAL_ENTRY(ia64_switch_mode_virt) 902GLOBAL_ENTRY(ia64_switch_mode_virt)
904 { 903 {
905 alloc r2=ar.pfs,0,0,0,0
906 rsm psr.i | psr.ic // disable interrupts and interrupt collection 904 rsm psr.i | psr.ic // disable interrupts and interrupt collection
907 mov r15=ip 905 mov r15=ip
908 } 906 }
diff --git a/arch/ia64/kernel/ia64_ksyms.c b/arch/ia64/kernel/ia64_ksyms.c
index b7cf651ceb14..3ead20fb6f4b 100644
--- a/arch/ia64/kernel/ia64_ksyms.c
+++ b/arch/ia64/kernel/ia64_ksyms.c
@@ -62,7 +62,7 @@ EXPORT_SYMBOL(__udivdi3);
62EXPORT_SYMBOL(__moddi3); 62EXPORT_SYMBOL(__moddi3);
63EXPORT_SYMBOL(__umoddi3); 63EXPORT_SYMBOL(__umoddi3);
64 64
65#if defined(CONFIG_MD_RAID5) || defined(CONFIG_MD_RAID5_MODULE) 65#if defined(CONFIG_MD_RAID456) || defined(CONFIG_MD_RAID456_MODULE)
66extern void xor_ia64_2(void); 66extern void xor_ia64_2(void);
67extern void xor_ia64_3(void); 67extern void xor_ia64_3(void);
68extern void xor_ia64_4(void); 68extern void xor_ia64_4(void);
diff --git a/arch/ia64/kernel/kprobes.c b/arch/ia64/kernel/kprobes.c
index 00d9c83b8020..781960f80b6f 100644
--- a/arch/ia64/kernel/kprobes.c
+++ b/arch/ia64/kernel/kprobes.c
@@ -448,11 +448,20 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
448 return 0; 448 return 0;
449} 449}
450 450
451void __kprobes flush_insn_slot(struct kprobe *p)
452{
453 unsigned long arm_addr;
454
455 arm_addr = ((unsigned long)&p->opcode.bundle) & ~0xFULL;
456 flush_icache_range(arm_addr, arm_addr + sizeof(bundle_t));
457}
458
451void __kprobes arch_arm_kprobe(struct kprobe *p) 459void __kprobes arch_arm_kprobe(struct kprobe *p)
452{ 460{
453 unsigned long addr = (unsigned long)p->addr; 461 unsigned long addr = (unsigned long)p->addr;
454 unsigned long arm_addr = addr & ~0xFULL; 462 unsigned long arm_addr = addr & ~0xFULL;
455 463
464 flush_insn_slot(p);
456 memcpy((char *)arm_addr, &p->ainsn.insn.bundle, sizeof(bundle_t)); 465 memcpy((char *)arm_addr, &p->ainsn.insn.bundle, sizeof(bundle_t));
457 flush_icache_range(arm_addr, arm_addr + sizeof(bundle_t)); 466 flush_icache_range(arm_addr, arm_addr + sizeof(bundle_t));
458} 467}
diff --git a/arch/ia64/kernel/pal.S b/arch/ia64/kernel/pal.S
index 5018c7f2e7a8..ebaf1e685f5e 100644
--- a/arch/ia64/kernel/pal.S
+++ b/arch/ia64/kernel/pal.S
@@ -217,12 +217,7 @@ GLOBAL_ENTRY(ia64_pal_call_phys_stacked)
217 .body 217 .body
218 ;; 218 ;;
219 ld8 loc2 = [loc2] // loc2 <- entry point 219 ld8 loc2 = [loc2] // loc2 <- entry point
220 mov out0 = in0 // first argument 220 mov loc3 = psr // save psr
221 mov out1 = in1 // copy arg2
222 mov out2 = in2 // copy arg3
223 mov out3 = in3 // copy arg3
224 ;;
225 mov loc3 = psr // save psr
226 ;; 221 ;;
227 mov loc4=ar.rsc // save RSE configuration 222 mov loc4=ar.rsc // save RSE configuration
228 dep.z loc2=loc2,0,61 // convert pal entry point to physical 223 dep.z loc2=loc2,0,61 // convert pal entry point to physical
@@ -236,18 +231,23 @@ GLOBAL_ENTRY(ia64_pal_call_phys_stacked)
236 ;; 231 ;;
237 andcm r16=loc3,r16 // removes bits to clear from psr 232 andcm r16=loc3,r16 // removes bits to clear from psr
238 br.call.sptk.many rp=ia64_switch_mode_phys 233 br.call.sptk.many rp=ia64_switch_mode_phys
239.ret6: 234
235 mov out0 = in0 // first argument
236 mov out1 = in1 // copy arg2
237 mov out2 = in2 // copy arg3
238 mov out3 = in3 // copy arg3
240 mov loc5 = r19 239 mov loc5 = r19
241 mov loc6 = r20 240 mov loc6 = r20
241
242 br.call.sptk.many rp=b7 // now make the call 242 br.call.sptk.many rp=b7 // now make the call
243.ret7: 243
244 mov ar.rsc=0 // put RSE in enforced lazy, LE mode 244 mov ar.rsc=0 // put RSE in enforced lazy, LE mode
245 mov r16=loc3 // r16= original psr 245 mov r16=loc3 // r16= original psr
246 mov r19=loc5 246 mov r19=loc5
247 mov r20=loc6 247 mov r20=loc6
248 br.call.sptk.many rp=ia64_switch_mode_virt // return to virtual mode 248 br.call.sptk.many rp=ia64_switch_mode_virt // return to virtual mode
249 249
250.ret8: mov psr.l = loc3 // restore init PSR 250 mov psr.l = loc3 // restore init PSR
251 mov ar.pfs = loc1 251 mov ar.pfs = loc1
252 mov rp = loc0 252 mov rp = loc0
253 ;; 253 ;;
diff --git a/arch/ia64/kernel/palinfo.c b/arch/ia64/kernel/palinfo.c
index 3f5bac59209a..0b546e2b36ac 100644
--- a/arch/ia64/kernel/palinfo.c
+++ b/arch/ia64/kernel/palinfo.c
@@ -566,29 +566,23 @@ version_info(char *page)
566 pal_version_u_t min_ver, cur_ver; 566 pal_version_u_t min_ver, cur_ver;
567 char *p = page; 567 char *p = page;
568 568
569 /* The PAL_VERSION call is advertised as being able to support 569 if (ia64_pal_version(&min_ver, &cur_ver) != 0)
570 * both physical and virtual mode calls. This seems to be a documentation 570 return 0;
571 * bug rather than firmware bug. In fact, it does only support physical mode.
572 * So now the code reflects this fact and the pal_version() has been updated
573 * accordingly.
574 */
575 if (ia64_pal_version(&min_ver, &cur_ver) != 0) return 0;
576 571
577 p += sprintf(p, 572 p += sprintf(p,
578 "PAL_vendor : 0x%02x (min=0x%02x)\n" 573 "PAL_vendor : 0x%02x (min=0x%02x)\n"
579 "PAL_A : %x.%x.%x (min=%x.%x.%x)\n" 574 "PAL_A : %02x.%02x (min=%02x.%02x)\n"
580 "PAL_B : %x.%x.%x (min=%x.%x.%x)\n", 575 "PAL_B : %02x.%02x (min=%02x.%02x)\n",
581 cur_ver.pal_version_s.pv_pal_vendor, min_ver.pal_version_s.pv_pal_vendor, 576 cur_ver.pal_version_s.pv_pal_vendor,
582 577 min_ver.pal_version_s.pv_pal_vendor,
583 cur_ver.pal_version_s.pv_pal_a_model>>4, 578 cur_ver.pal_version_s.pv_pal_a_model,
584 cur_ver.pal_version_s.pv_pal_a_model&0xf, cur_ver.pal_version_s.pv_pal_a_rev, 579 cur_ver.pal_version_s.pv_pal_a_rev,
585 min_ver.pal_version_s.pv_pal_a_model>>4, 580 min_ver.pal_version_s.pv_pal_a_model,
586 min_ver.pal_version_s.pv_pal_a_model&0xf, min_ver.pal_version_s.pv_pal_a_rev, 581 min_ver.pal_version_s.pv_pal_a_rev,
587 582 cur_ver.pal_version_s.pv_pal_b_model,
588 cur_ver.pal_version_s.pv_pal_b_model>>4, 583 cur_ver.pal_version_s.pv_pal_b_rev,
589 cur_ver.pal_version_s.pv_pal_b_model&0xf, cur_ver.pal_version_s.pv_pal_b_rev, 584 min_ver.pal_version_s.pv_pal_b_model,
590 min_ver.pal_version_s.pv_pal_b_model>>4, 585 min_ver.pal_version_s.pv_pal_b_rev);
591 min_ver.pal_version_s.pv_pal_b_model&0xf, min_ver.pal_version_s.pv_pal_b_rev);
592 return p - page; 586 return p - page;
593} 587}
594 588
@@ -958,9 +952,9 @@ remove_palinfo_proc_entries(unsigned int hcpu)
958 } 952 }
959} 953}
960 954
961static int __cpuinit palinfo_cpu_callback(struct notifier_block *nfb, 955#ifdef CONFIG_HOTPLUG_CPU
962 unsigned long action, 956static int palinfo_cpu_callback(struct notifier_block *nfb,
963 void *hcpu) 957 unsigned long action, void *hcpu)
964{ 958{
965 unsigned int hotcpu = (unsigned long)hcpu; 959 unsigned int hotcpu = (unsigned long)hcpu;
966 960
@@ -968,20 +962,19 @@ static int __cpuinit palinfo_cpu_callback(struct notifier_block *nfb,
968 case CPU_ONLINE: 962 case CPU_ONLINE:
969 create_palinfo_proc_entries(hotcpu); 963 create_palinfo_proc_entries(hotcpu);
970 break; 964 break;
971#ifdef CONFIG_HOTPLUG_CPU
972 case CPU_DEAD: 965 case CPU_DEAD:
973 remove_palinfo_proc_entries(hotcpu); 966 remove_palinfo_proc_entries(hotcpu);
974 break; 967 break;
975#endif
976 } 968 }
977 return NOTIFY_OK; 969 return NOTIFY_OK;
978} 970}
979 971
980static struct notifier_block __cpuinitdata palinfo_cpu_notifier = 972static struct notifier_block palinfo_cpu_notifier =
981{ 973{
982 .notifier_call = palinfo_cpu_callback, 974 .notifier_call = palinfo_cpu_callback,
983 .priority = 0, 975 .priority = 0,
984}; 976};
977#endif
985 978
986static int __init 979static int __init
987palinfo_init(void) 980palinfo_init(void)
@@ -1020,7 +1013,7 @@ palinfo_exit(void)
1020 /* 1013 /*
1021 * Unregister from cpu notifier callbacks 1014 * Unregister from cpu notifier callbacks
1022 */ 1015 */
1023 unregister_cpu_notifier(&palinfo_cpu_notifier); 1016 unregister_hotcpu_notifier(&palinfo_cpu_notifier);
1024} 1017}
1025 1018
1026module_init(palinfo_init); 1019module_init(palinfo_init);
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index 6a33f414de58..7ad0d9cc6db6 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -35,7 +35,7 @@
35#include <linux/seq_file.h> 35#include <linux/seq_file.h>
36#include <linux/string.h> 36#include <linux/string.h>
37#include <linux/threads.h> 37#include <linux/threads.h>
38#include <linux/tty.h> 38#include <linux/screen_info.h>
39#include <linux/dmi.h> 39#include <linux/dmi.h>
40#include <linux/serial.h> 40#include <linux/serial.h>
41#include <linux/serial_core.h> 41#include <linux/serial_core.h>
diff --git a/arch/ia64/kernel/topology.c b/arch/ia64/kernel/topology.c
index b146f1cfad31..d24fa393b182 100644
--- a/arch/ia64/kernel/topology.c
+++ b/arch/ia64/kernel/topology.c
@@ -435,7 +435,7 @@ static int __cpuinit cache_sysfs_init(void)
435 (void *)(long)i); 435 (void *)(long)i);
436 } 436 }
437 437
438 register_cpu_notifier(&cache_cpu_notifier); 438 register_hotcpu_notifier(&cache_cpu_notifier);
439 439
440 return 0; 440 return 0;
441} 441}
diff --git a/arch/ia64/kernel/traps.c b/arch/ia64/kernel/traps.c
index e7bbb0f40aa2..5a0420464c6c 100644
--- a/arch/ia64/kernel/traps.c
+++ b/arch/ia64/kernel/traps.c
@@ -117,11 +117,8 @@ die (const char *str, struct pt_regs *regs, long err)
117 die.lock_owner = -1; 117 die.lock_owner = -1;
118 spin_unlock_irq(&die.lock); 118 spin_unlock_irq(&die.lock);
119 119
120 if (panic_on_oops) { 120 if (panic_on_oops)
121 printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n"); 121 panic("Fatal exception: panic_on_oops");
122 ssleep(5);
123 panic("Fatal exception");
124 }
125 122
126 do_exit(SIGSEGV); 123 do_exit(SIGSEGV);
127} 124}
diff --git a/arch/ia64/kernel/uncached.c b/arch/ia64/kernel/uncached.c
index 5f03b9e524dd..4c73a6763669 100644
--- a/arch/ia64/kernel/uncached.c
+++ b/arch/ia64/kernel/uncached.c
@@ -32,32 +32,38 @@
32 32
33extern void __init efi_memmap_walk_uc(efi_freemem_callback_t, void *); 33extern void __init efi_memmap_walk_uc(efi_freemem_callback_t, void *);
34 34
35#define MAX_UNCACHED_GRANULES 5 35struct uncached_pool {
36static int allocated_granules; 36 struct gen_pool *pool;
37 struct mutex add_chunk_mutex; /* serialize adding a converted chunk */
38 int nchunks_added; /* #of converted chunks added to pool */
39 atomic_t status; /* smp called function's return status*/
40};
41
42#define MAX_CONVERTED_CHUNKS_PER_NODE 2
37 43
38struct gen_pool *uncached_pool[MAX_NUMNODES]; 44struct uncached_pool uncached_pools[MAX_NUMNODES];
39 45
40 46
41static void uncached_ipi_visibility(void *data) 47static void uncached_ipi_visibility(void *data)
42{ 48{
43 int status; 49 int status;
50 struct uncached_pool *uc_pool = (struct uncached_pool *)data;
44 51
45 status = ia64_pal_prefetch_visibility(PAL_VISIBILITY_PHYSICAL); 52 status = ia64_pal_prefetch_visibility(PAL_VISIBILITY_PHYSICAL);
46 if ((status != PAL_VISIBILITY_OK) && 53 if ((status != PAL_VISIBILITY_OK) &&
47 (status != PAL_VISIBILITY_OK_REMOTE_NEEDED)) 54 (status != PAL_VISIBILITY_OK_REMOTE_NEEDED))
48 printk(KERN_DEBUG "pal_prefetch_visibility() returns %i on " 55 atomic_inc(&uc_pool->status);
49 "CPU %i\n", status, raw_smp_processor_id());
50} 56}
51 57
52 58
53static void uncached_ipi_mc_drain(void *data) 59static void uncached_ipi_mc_drain(void *data)
54{ 60{
55 int status; 61 int status;
62 struct uncached_pool *uc_pool = (struct uncached_pool *)data;
56 63
57 status = ia64_pal_mc_drain(); 64 status = ia64_pal_mc_drain();
58 if (status) 65 if (status != PAL_STATUS_SUCCESS)
59 printk(KERN_WARNING "ia64_pal_mc_drain() failed with %i on " 66 atomic_inc(&uc_pool->status);
60 "CPU %i\n", status, raw_smp_processor_id());
61} 67}
62 68
63 69
@@ -70,21 +76,34 @@ static void uncached_ipi_mc_drain(void *data)
70 * This is accomplished by first allocating a granule of cached memory pages 76 * This is accomplished by first allocating a granule of cached memory pages
71 * and then converting them to uncached memory pages. 77 * and then converting them to uncached memory pages.
72 */ 78 */
73static int uncached_add_chunk(struct gen_pool *pool, int nid) 79static int uncached_add_chunk(struct uncached_pool *uc_pool, int nid)
74{ 80{
75 struct page *page; 81 struct page *page;
76 int status, i; 82 int status, i, nchunks_added = uc_pool->nchunks_added;
77 unsigned long c_addr, uc_addr; 83 unsigned long c_addr, uc_addr;
78 84
79 if (allocated_granules >= MAX_UNCACHED_GRANULES) 85 if (mutex_lock_interruptible(&uc_pool->add_chunk_mutex) != 0)
86 return -1; /* interrupted by a signal */
87
88 if (uc_pool->nchunks_added > nchunks_added) {
89 /* someone added a new chunk while we were waiting */
90 mutex_unlock(&uc_pool->add_chunk_mutex);
91 return 0;
92 }
93
94 if (uc_pool->nchunks_added >= MAX_CONVERTED_CHUNKS_PER_NODE) {
95 mutex_unlock(&uc_pool->add_chunk_mutex);
80 return -1; 96 return -1;
97 }
81 98
82 /* attempt to allocate a granule's worth of cached memory pages */ 99 /* attempt to allocate a granule's worth of cached memory pages */
83 100
84 page = alloc_pages_node(nid, GFP_KERNEL | __GFP_ZERO, 101 page = alloc_pages_node(nid, GFP_KERNEL | __GFP_ZERO,
85 IA64_GRANULE_SHIFT-PAGE_SHIFT); 102 IA64_GRANULE_SHIFT-PAGE_SHIFT);
86 if (!page) 103 if (!page) {
104 mutex_unlock(&uc_pool->add_chunk_mutex);
87 return -1; 105 return -1;
106 }
88 107
89 /* convert the memory pages from cached to uncached */ 108 /* convert the memory pages from cached to uncached */
90 109
@@ -102,11 +121,14 @@ static int uncached_add_chunk(struct gen_pool *pool, int nid)
102 flush_tlb_kernel_range(uc_addr, uc_adddr + IA64_GRANULE_SIZE); 121 flush_tlb_kernel_range(uc_addr, uc_adddr + IA64_GRANULE_SIZE);
103 122
104 status = ia64_pal_prefetch_visibility(PAL_VISIBILITY_PHYSICAL); 123 status = ia64_pal_prefetch_visibility(PAL_VISIBILITY_PHYSICAL);
105 if (!status) { 124 if (status == PAL_VISIBILITY_OK_REMOTE_NEEDED) {
106 status = smp_call_function(uncached_ipi_visibility, NULL, 0, 1); 125 atomic_set(&uc_pool->status, 0);
107 if (status) 126 status = smp_call_function(uncached_ipi_visibility, uc_pool,
127 0, 1);
128 if (status || atomic_read(&uc_pool->status))
108 goto failed; 129 goto failed;
109 } 130 } else if (status != PAL_VISIBILITY_OK)
131 goto failed;
110 132
111 preempt_disable(); 133 preempt_disable();
112 134
@@ -120,20 +142,24 @@ static int uncached_add_chunk(struct gen_pool *pool, int nid)
120 142
121 preempt_enable(); 143 preempt_enable();
122 144
123 ia64_pal_mc_drain(); 145 status = ia64_pal_mc_drain();
124 status = smp_call_function(uncached_ipi_mc_drain, NULL, 0, 1); 146 if (status != PAL_STATUS_SUCCESS)
125 if (status) 147 goto failed;
148 atomic_set(&uc_pool->status, 0);
149 status = smp_call_function(uncached_ipi_mc_drain, uc_pool, 0, 1);
150 if (status || atomic_read(&uc_pool->status))
126 goto failed; 151 goto failed;
127 152
128 /* 153 /*
129 * The chunk of memory pages has been converted to uncached so now we 154 * The chunk of memory pages has been converted to uncached so now we
130 * can add it to the pool. 155 * can add it to the pool.
131 */ 156 */
132 status = gen_pool_add(pool, uc_addr, IA64_GRANULE_SIZE, nid); 157 status = gen_pool_add(uc_pool->pool, uc_addr, IA64_GRANULE_SIZE, nid);
133 if (status) 158 if (status)
134 goto failed; 159 goto failed;
135 160
136 allocated_granules++; 161 uc_pool->nchunks_added++;
162 mutex_unlock(&uc_pool->add_chunk_mutex);
137 return 0; 163 return 0;
138 164
139 /* failed to convert or add the chunk so give it back to the kernel */ 165 /* failed to convert or add the chunk so give it back to the kernel */
@@ -142,6 +168,7 @@ failed:
142 ClearPageUncached(&page[i]); 168 ClearPageUncached(&page[i]);
143 169
144 free_pages(c_addr, IA64_GRANULE_SHIFT-PAGE_SHIFT); 170 free_pages(c_addr, IA64_GRANULE_SHIFT-PAGE_SHIFT);
171 mutex_unlock(&uc_pool->add_chunk_mutex);
145 return -1; 172 return -1;
146} 173}
147 174
@@ -158,7 +185,7 @@ failed:
158unsigned long uncached_alloc_page(int starting_nid) 185unsigned long uncached_alloc_page(int starting_nid)
159{ 186{
160 unsigned long uc_addr; 187 unsigned long uc_addr;
161 struct gen_pool *pool; 188 struct uncached_pool *uc_pool;
162 int nid; 189 int nid;
163 190
164 if (unlikely(starting_nid >= MAX_NUMNODES)) 191 if (unlikely(starting_nid >= MAX_NUMNODES))
@@ -171,14 +198,14 @@ unsigned long uncached_alloc_page(int starting_nid)
171 do { 198 do {
172 if (!node_online(nid)) 199 if (!node_online(nid))
173 continue; 200 continue;
174 pool = uncached_pool[nid]; 201 uc_pool = &uncached_pools[nid];
175 if (pool == NULL) 202 if (uc_pool->pool == NULL)
176 continue; 203 continue;
177 do { 204 do {
178 uc_addr = gen_pool_alloc(pool, PAGE_SIZE); 205 uc_addr = gen_pool_alloc(uc_pool->pool, PAGE_SIZE);
179 if (uc_addr != 0) 206 if (uc_addr != 0)
180 return uc_addr; 207 return uc_addr;
181 } while (uncached_add_chunk(pool, nid) == 0); 208 } while (uncached_add_chunk(uc_pool, nid) == 0);
182 209
183 } while ((nid = (nid + 1) % MAX_NUMNODES) != starting_nid); 210 } while ((nid = (nid + 1) % MAX_NUMNODES) != starting_nid);
184 211
@@ -197,7 +224,7 @@ EXPORT_SYMBOL(uncached_alloc_page);
197void uncached_free_page(unsigned long uc_addr) 224void uncached_free_page(unsigned long uc_addr)
198{ 225{
199 int nid = paddr_to_nid(uc_addr - __IA64_UNCACHED_OFFSET); 226 int nid = paddr_to_nid(uc_addr - __IA64_UNCACHED_OFFSET);
200 struct gen_pool *pool = uncached_pool[nid]; 227 struct gen_pool *pool = uncached_pools[nid].pool;
201 228
202 if (unlikely(pool == NULL)) 229 if (unlikely(pool == NULL))
203 return; 230 return;
@@ -224,7 +251,7 @@ static int __init uncached_build_memmap(unsigned long uc_start,
224 unsigned long uc_end, void *arg) 251 unsigned long uc_end, void *arg)
225{ 252{
226 int nid = paddr_to_nid(uc_start - __IA64_UNCACHED_OFFSET); 253 int nid = paddr_to_nid(uc_start - __IA64_UNCACHED_OFFSET);
227 struct gen_pool *pool = uncached_pool[nid]; 254 struct gen_pool *pool = uncached_pools[nid].pool;
228 size_t size = uc_end - uc_start; 255 size_t size = uc_end - uc_start;
229 256
230 touch_softlockup_watchdog(); 257 touch_softlockup_watchdog();
@@ -242,7 +269,8 @@ static int __init uncached_init(void)
242 int nid; 269 int nid;
243 270
244 for_each_online_node(nid) { 271 for_each_online_node(nid) {
245 uncached_pool[nid] = gen_pool_create(PAGE_SHIFT, nid); 272 uncached_pools[nid].pool = gen_pool_create(PAGE_SHIFT, nid);
273 mutex_init(&uncached_pools[nid].add_chunk_mutex);
246 } 274 }
247 275
248 efi_memmap_walk_uc(uncached_build_memmap, NULL); 276 efi_memmap_walk_uc(uncached_build_memmap, NULL);
diff --git a/arch/ia64/lib/Makefile b/arch/ia64/lib/Makefile
index d8536a2c22a9..38fa6e49e791 100644
--- a/arch/ia64/lib/Makefile
+++ b/arch/ia64/lib/Makefile
@@ -14,7 +14,7 @@ lib-y := __divsi3.o __udivsi3.o __modsi3.o __umodsi3.o \
14lib-$(CONFIG_ITANIUM) += copy_page.o copy_user.o memcpy.o 14lib-$(CONFIG_ITANIUM) += copy_page.o copy_user.o memcpy.o
15lib-$(CONFIG_MCKINLEY) += copy_page_mck.o memcpy_mck.o 15lib-$(CONFIG_MCKINLEY) += copy_page_mck.o memcpy_mck.o
16lib-$(CONFIG_PERFMON) += carta_random.o 16lib-$(CONFIG_PERFMON) += carta_random.o
17lib-$(CONFIG_MD_RAID5) += xor.o 17lib-$(CONFIG_MD_RAID456) += xor.o
18 18
19AFLAGS___divdi3.o = 19AFLAGS___divdi3.o =
20AFLAGS___udivdi3.o = -DUNSIGNED 20AFLAGS___udivdi3.o = -DUNSIGNED
diff --git a/arch/ia64/mm/contig.c b/arch/ia64/mm/contig.c
index 2a88cdd6d924..e004143ba86b 100644
--- a/arch/ia64/mm/contig.c
+++ b/arch/ia64/mm/contig.c
@@ -27,6 +27,7 @@
27 27
28#ifdef CONFIG_VIRTUAL_MEM_MAP 28#ifdef CONFIG_VIRTUAL_MEM_MAP
29static unsigned long num_dma_physpages; 29static unsigned long num_dma_physpages;
30static unsigned long max_gap;
30#endif 31#endif
31 32
32/** 33/**
@@ -45,9 +46,15 @@ show_mem (void)
45 46
46 printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); 47 printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
47 i = max_mapnr; 48 i = max_mapnr;
48 while (i-- > 0) { 49 for (i = 0; i < max_mapnr; i++) {
49 if (!pfn_valid(i)) 50 if (!pfn_valid(i)) {
51#ifdef CONFIG_VIRTUAL_MEM_MAP
52 if (max_gap < LARGE_GAP)
53 continue;
54 i = vmemmap_find_next_valid_pfn(0, i) - 1;
55#endif
50 continue; 56 continue;
57 }
51 total++; 58 total++;
52 if (PageReserved(mem_map+i)) 59 if (PageReserved(mem_map+i))
53 reserved++; 60 reserved++;
@@ -234,7 +241,6 @@ paging_init (void)
234 unsigned long zones_size[MAX_NR_ZONES]; 241 unsigned long zones_size[MAX_NR_ZONES];
235#ifdef CONFIG_VIRTUAL_MEM_MAP 242#ifdef CONFIG_VIRTUAL_MEM_MAP
236 unsigned long zholes_size[MAX_NR_ZONES]; 243 unsigned long zholes_size[MAX_NR_ZONES];
237 unsigned long max_gap;
238#endif 244#endif
239 245
240 /* initialize mem_map[] */ 246 /* initialize mem_map[] */
@@ -266,7 +272,6 @@ paging_init (void)
266 } 272 }
267 } 273 }
268 274
269 max_gap = 0;
270 efi_memmap_walk(find_largest_hole, (u64 *)&max_gap); 275 efi_memmap_walk(find_largest_hole, (u64 *)&max_gap);
271 if (max_gap < LARGE_GAP) { 276 if (max_gap < LARGE_GAP) {
272 vmem_map = (struct page *) 0; 277 vmem_map = (struct page *) 0;
@@ -277,7 +282,8 @@ paging_init (void)
277 282
278 /* allocate virtual_mem_map */ 283 /* allocate virtual_mem_map */
279 284
280 map_size = PAGE_ALIGN(max_low_pfn * sizeof(struct page)); 285 map_size = PAGE_ALIGN(ALIGN(max_low_pfn, MAX_ORDER_NR_PAGES) *
286 sizeof(struct page));
281 vmalloc_end -= map_size; 287 vmalloc_end -= map_size;
282 vmem_map = (struct page *) vmalloc_end; 288 vmem_map = (struct page *) vmalloc_end;
283 efi_memmap_walk(create_mem_map_page_table, NULL); 289 efi_memmap_walk(create_mem_map_page_table, NULL);
diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c
index 99bd9e30db96..d260bffa01ab 100644
--- a/arch/ia64/mm/discontig.c
+++ b/arch/ia64/mm/discontig.c
@@ -534,68 +534,6 @@ void __cpuinit *per_cpu_init(void)
534} 534}
535#endif /* CONFIG_SMP */ 535#endif /* CONFIG_SMP */
536 536
537#ifdef CONFIG_VIRTUAL_MEM_MAP
538static inline int find_next_valid_pfn_for_pgdat(pg_data_t *pgdat, int i)
539{
540 unsigned long end_address, hole_next_pfn;
541 unsigned long stop_address;
542
543 end_address = (unsigned long) &vmem_map[pgdat->node_start_pfn + i];
544 end_address = PAGE_ALIGN(end_address);
545
546 stop_address = (unsigned long) &vmem_map[
547 pgdat->node_start_pfn + pgdat->node_spanned_pages];
548
549 do {
550 pgd_t *pgd;
551 pud_t *pud;
552 pmd_t *pmd;
553 pte_t *pte;
554
555 pgd = pgd_offset_k(end_address);
556 if (pgd_none(*pgd)) {
557 end_address += PGDIR_SIZE;
558 continue;
559 }
560
561 pud = pud_offset(pgd, end_address);
562 if (pud_none(*pud)) {
563 end_address += PUD_SIZE;
564 continue;
565 }
566
567 pmd = pmd_offset(pud, end_address);
568 if (pmd_none(*pmd)) {
569 end_address += PMD_SIZE;
570 continue;
571 }
572
573 pte = pte_offset_kernel(pmd, end_address);
574retry_pte:
575 if (pte_none(*pte)) {
576 end_address += PAGE_SIZE;
577 pte++;
578 if ((end_address < stop_address) &&
579 (end_address != ALIGN(end_address, 1UL << PMD_SHIFT)))
580 goto retry_pte;
581 continue;
582 }
583 /* Found next valid vmem_map page */
584 break;
585 } while (end_address < stop_address);
586
587 end_address = min(end_address, stop_address);
588 end_address = end_address - (unsigned long) vmem_map + sizeof(struct page) - 1;
589 hole_next_pfn = end_address / sizeof(struct page);
590 return hole_next_pfn - pgdat->node_start_pfn;
591}
592#else
593static inline int find_next_valid_pfn_for_pgdat(pg_data_t *pgdat, int i)
594{
595 return i + 1;
596}
597#endif
598
599/** 537/**
600 * show_mem - give short summary of memory stats 538 * show_mem - give short summary of memory stats
601 * 539 *
@@ -625,7 +563,8 @@ void show_mem(void)
625 if (pfn_valid(pgdat->node_start_pfn + i)) 563 if (pfn_valid(pgdat->node_start_pfn + i))
626 page = pfn_to_page(pgdat->node_start_pfn + i); 564 page = pfn_to_page(pgdat->node_start_pfn + i);
627 else { 565 else {
628 i = find_next_valid_pfn_for_pgdat(pgdat, i) - 1; 566 i = vmemmap_find_next_valid_pfn(pgdat->node_id,
567 i) - 1;
629 continue; 568 continue;
630 } 569 }
631 if (PageReserved(page)) 570 if (PageReserved(page))
@@ -751,7 +690,8 @@ void __init paging_init(void)
751 efi_memmap_walk(filter_rsvd_memory, count_node_pages); 690 efi_memmap_walk(filter_rsvd_memory, count_node_pages);
752 691
753#ifdef CONFIG_VIRTUAL_MEM_MAP 692#ifdef CONFIG_VIRTUAL_MEM_MAP
754 vmalloc_end -= PAGE_ALIGN(max_low_pfn * sizeof(struct page)); 693 vmalloc_end -= PAGE_ALIGN(ALIGN(max_low_pfn, MAX_ORDER_NR_PAGES) *
694 sizeof(struct page));
755 vmem_map = (struct page *) vmalloc_end; 695 vmem_map = (struct page *) vmalloc_end;
756 efi_memmap_walk(create_mem_map_page_table, NULL); 696 efi_memmap_walk(create_mem_map_page_table, NULL);
757 printk("Virtual mem_map starts at 0x%p\n", vmem_map); 697 printk("Virtual mem_map starts at 0x%p\n", vmem_map);
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
index 2f50c064513c..30617ccb4f7e 100644
--- a/arch/ia64/mm/init.c
+++ b/arch/ia64/mm/init.c
@@ -415,6 +415,61 @@ ia64_mmu_init (void *my_cpu_data)
415} 415}
416 416
417#ifdef CONFIG_VIRTUAL_MEM_MAP 417#ifdef CONFIG_VIRTUAL_MEM_MAP
418int vmemmap_find_next_valid_pfn(int node, int i)
419{
420 unsigned long end_address, hole_next_pfn;
421 unsigned long stop_address;
422 pg_data_t *pgdat = NODE_DATA(node);
423
424 end_address = (unsigned long) &vmem_map[pgdat->node_start_pfn + i];
425 end_address = PAGE_ALIGN(end_address);
426
427 stop_address = (unsigned long) &vmem_map[
428 pgdat->node_start_pfn + pgdat->node_spanned_pages];
429
430 do {
431 pgd_t *pgd;
432 pud_t *pud;
433 pmd_t *pmd;
434 pte_t *pte;
435
436 pgd = pgd_offset_k(end_address);
437 if (pgd_none(*pgd)) {
438 end_address += PGDIR_SIZE;
439 continue;
440 }
441
442 pud = pud_offset(pgd, end_address);
443 if (pud_none(*pud)) {
444 end_address += PUD_SIZE;
445 continue;
446 }
447
448 pmd = pmd_offset(pud, end_address);
449 if (pmd_none(*pmd)) {
450 end_address += PMD_SIZE;
451 continue;
452 }
453
454 pte = pte_offset_kernel(pmd, end_address);
455retry_pte:
456 if (pte_none(*pte)) {
457 end_address += PAGE_SIZE;
458 pte++;
459 if ((end_address < stop_address) &&
460 (end_address != ALIGN(end_address, 1UL << PMD_SHIFT)))
461 goto retry_pte;
462 continue;
463 }
464 /* Found next valid vmem_map page */
465 break;
466 } while (end_address < stop_address);
467
468 end_address = min(end_address, stop_address);
469 end_address = end_address - (unsigned long) vmem_map + sizeof(struct page) - 1;
470 hole_next_pfn = end_address / sizeof(struct page);
471 return hole_next_pfn - pgdat->node_start_pfn;
472}
418 473
419int __init 474int __init
420create_mem_map_page_table (u64 start, u64 end, void *arg) 475create_mem_map_page_table (u64 start, u64 end, void *arg)
diff --git a/arch/ia64/mm/ioremap.c b/arch/ia64/mm/ioremap.c
index 07bd02b6c372..4280c074d64e 100644
--- a/arch/ia64/mm/ioremap.c
+++ b/arch/ia64/mm/ioremap.c
@@ -32,7 +32,7 @@ ioremap (unsigned long offset, unsigned long size)
32 */ 32 */
33 attr = kern_mem_attribute(offset, size); 33 attr = kern_mem_attribute(offset, size);
34 if (attr & EFI_MEMORY_WB) 34 if (attr & EFI_MEMORY_WB)
35 return phys_to_virt(offset); 35 return (void __iomem *) phys_to_virt(offset);
36 else if (attr & EFI_MEMORY_UC) 36 else if (attr & EFI_MEMORY_UC)
37 return __ioremap(offset, size); 37 return __ioremap(offset, size);
38 38
@@ -43,7 +43,7 @@ ioremap (unsigned long offset, unsigned long size)
43 gran_base = GRANULEROUNDDOWN(offset); 43 gran_base = GRANULEROUNDDOWN(offset);
44 gran_size = GRANULEROUNDUP(offset + size) - gran_base; 44 gran_size = GRANULEROUNDUP(offset + size) - gran_base;
45 if (efi_mem_attribute(gran_base, gran_size) & EFI_MEMORY_WB) 45 if (efi_mem_attribute(gran_base, gran_size) & EFI_MEMORY_WB)
46 return phys_to_virt(offset); 46 return (void __iomem *) phys_to_virt(offset);
47 47
48 return __ioremap(offset, size); 48 return __ioremap(offset, size);
49} 49}
@@ -53,7 +53,7 @@ void __iomem *
53ioremap_nocache (unsigned long offset, unsigned long size) 53ioremap_nocache (unsigned long offset, unsigned long size)
54{ 54{
55 if (kern_mem_attribute(offset, size) & EFI_MEMORY_WB) 55 if (kern_mem_attribute(offset, size) & EFI_MEMORY_WB)
56 return 0; 56 return NULL;
57 57
58 return __ioremap(offset, size); 58 return __ioremap(offset, size);
59} 59}
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
index 276512fd8922..60b45e79f080 100644
--- a/arch/ia64/pci/pci.c
+++ b/arch/ia64/pci/pci.c
@@ -650,7 +650,7 @@ pci_mmap_legacy_page_range(struct pci_bus *bus, struct vm_area_struct *vma)
650 * Avoid attribute aliasing. See Documentation/ia64/aliasing.txt 650 * Avoid attribute aliasing. See Documentation/ia64/aliasing.txt
651 * for more details. 651 * for more details.
652 */ 652 */
653 if (!valid_mmap_phys_addr_range(vma->vm_pgoff << PAGE_SHIFT, size)) 653 if (!valid_mmap_phys_addr_range(vma->vm_pgoff, size))
654 return -EINVAL; 654 return -EINVAL;
655 prot = phys_mem_access_prot(NULL, vma->vm_pgoff, size, 655 prot = phys_mem_access_prot(NULL, vma->vm_pgoff, size,
656 vma->vm_page_prot); 656 vma->vm_page_prot);
diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c
index dd6bcf4d58bf..c119e8b620de 100644
--- a/arch/ia64/sn/kernel/setup.c
+++ b/arch/ia64/sn/kernel/setup.c
@@ -12,7 +12,7 @@
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/kdev_t.h> 13#include <linux/kdev_t.h>
14#include <linux/string.h> 14#include <linux/string.h>
15#include <linux/tty.h> 15#include <linux/screen_info.h>
16#include <linux/console.h> 16#include <linux/console.h>
17#include <linux/timex.h> 17#include <linux/timex.h>
18#include <linux/sched.h> 18#include <linux/sched.h>
diff --git a/arch/ia64/sn/kernel/xpc_main.c b/arch/ia64/sn/kernel/xpc_main.c
index 99b123a6421a..5e8e59efb347 100644
--- a/arch/ia64/sn/kernel/xpc_main.c
+++ b/arch/ia64/sn/kernel/xpc_main.c
@@ -480,7 +480,7 @@ xpc_activating(void *__partid)
480 partid_t partid = (u64) __partid; 480 partid_t partid = (u64) __partid;
481 struct xpc_partition *part = &xpc_partitions[partid]; 481 struct xpc_partition *part = &xpc_partitions[partid];
482 unsigned long irq_flags; 482 unsigned long irq_flags;
483 struct sched_param param = { sched_priority: MAX_RT_PRIO - 1 }; 483 struct sched_param param = { .sched_priority = MAX_RT_PRIO - 1 };
484 int ret; 484 int ret;
485 485
486 486
diff --git a/arch/ia64/sn/pci/tioce_provider.c b/arch/ia64/sn/pci/tioce_provider.c
index 17cd34284886..af7171adcd2c 100644
--- a/arch/ia64/sn/pci/tioce_provider.c
+++ b/arch/ia64/sn/pci/tioce_provider.c
@@ -74,7 +74,7 @@ tioce_mmr_war_pre(struct tioce_kernel *kern, void *mmr_addr)
74 else 74 else
75 mmr_war_offset = 0x158; 75 mmr_war_offset = 0x158;
76 76
77 readq_relaxed((void *)(mmr_base + mmr_war_offset)); 77 readq_relaxed((void __iomem *)(mmr_base + mmr_war_offset));
78 } 78 }
79} 79}
80 80
@@ -92,8 +92,8 @@ tioce_mmr_war_post(struct tioce_kernel *kern, void *mmr_addr)
92 92
93 if (mmr_offset < 0x45000) { 93 if (mmr_offset < 0x45000) {
94 if (mmr_offset == 0x100) 94 if (mmr_offset == 0x100)
95 readq_relaxed((void *)(mmr_base + 0x38)); 95 readq_relaxed((void __iomem *)(mmr_base + 0x38));
96 readq_relaxed((void *)(mmr_base + 0xb050)); 96 readq_relaxed((void __iomem *)(mmr_base + 0xb050));
97 } 97 }
98} 98}
99 99
diff --git a/arch/m32r/kernel/setup.c b/arch/m32r/kernel/setup.c
index 0a6c6e677afe..3f35ab3d2dc2 100644
--- a/arch/m32r/kernel/setup.c
+++ b/arch/m32r/kernel/setup.c
@@ -21,7 +21,7 @@
21#include <linux/root_dev.h> 21#include <linux/root_dev.h>
22#include <linux/seq_file.h> 22#include <linux/seq_file.h>
23#include <linux/timex.h> 23#include <linux/timex.h>
24#include <linux/tty.h> 24#include <linux/screen_info.h>
25#include <linux/cpu.h> 25#include <linux/cpu.h>
26#include <linux/nodemask.h> 26#include <linux/nodemask.h>
27#include <linux/pfn.h> 27#include <linux/pfn.h>
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 747a9c1228f2..330f6abc7703 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -480,6 +480,7 @@ config MOMENCO_OCELOT_G
480 select SYS_SUPPORTS_32BIT_KERNEL 480 select SYS_SUPPORTS_32BIT_KERNEL
481 select SYS_SUPPORTS_64BIT_KERNEL 481 select SYS_SUPPORTS_64BIT_KERNEL
482 select SYS_SUPPORTS_BIG_ENDIAN 482 select SYS_SUPPORTS_BIG_ENDIAN
483 select ARCH_SPARSEMEM_ENABLE
483 help 484 help
484 The Ocelot is a MIPS-based Single Board Computer (SBC) made by 485 The Ocelot is a MIPS-based Single Board Computer (SBC) made by
485 Momentum Computer <http://www.momenco.com/>. 486 Momentum Computer <http://www.momenco.com/>.
@@ -556,6 +557,7 @@ config QEMU
556 select SYS_HAS_CPU_MIPS32_R1 557 select SYS_HAS_CPU_MIPS32_R1
557 select SYS_SUPPORTS_32BIT_KERNEL 558 select SYS_SUPPORTS_32BIT_KERNEL
558 select SYS_SUPPORTS_BIG_ENDIAN 559 select SYS_SUPPORTS_BIG_ENDIAN
560 select ARCH_SPARSEMEM_ENABLE
559 help 561 help
560 Qemu is a software emulator which among other architectures also 562 Qemu is a software emulator which among other architectures also
561 can simulate a MIPS32 4Kc system. This patch adds support for the 563 can simulate a MIPS32 4Kc system. This patch adds support for the
@@ -594,7 +596,6 @@ config SGI_IP22
594 select SYS_SUPPORTS_32BIT_KERNEL 596 select SYS_SUPPORTS_32BIT_KERNEL
595 select SYS_SUPPORTS_64BIT_KERNEL 597 select SYS_SUPPORTS_64BIT_KERNEL
596 select SYS_SUPPORTS_BIG_ENDIAN 598 select SYS_SUPPORTS_BIG_ENDIAN
597 select SYS_SUPPORTS_SMP
598 help 599 help
599 This are the SGI Indy, Challenge S and Indigo2, as well as certain 600 This are the SGI Indy, Challenge S and Indigo2, as well as certain
600 OEM variants like the Tandem CMN B006S. To compile a Linux kernel 601 OEM variants like the Tandem CMN B006S. To compile a Linux kernel
@@ -1688,6 +1689,13 @@ config ARCH_DISCONTIGMEM_ENABLE
1688 or have huge holes in the physical address space for other reasons. 1689 or have huge holes in the physical address space for other reasons.
1689 See <file:Documentation/vm/numa> for more. 1690 See <file:Documentation/vm/numa> for more.
1690 1691
1692config ARCH_SPARSEMEM_ENABLE
1693 bool
1694
1695config ARCH_SPARSEMEM_ENABLE
1696 bool
1697 select SPARSEMEM_STATIC
1698
1691config NUMA 1699config NUMA
1692 bool "NUMA Support" 1700 bool "NUMA Support"
1693 depends on SYS_SUPPORTS_NUMA 1701 depends on SYS_SUPPORTS_NUMA
diff --git a/arch/mips/Kconfig.debug b/arch/mips/Kconfig.debug
index 515f9e611307..5d6afb52d904 100644
--- a/arch/mips/Kconfig.debug
+++ b/arch/mips/Kconfig.debug
@@ -1,5 +1,9 @@
1menu "Kernel hacking" 1menu "Kernel hacking"
2 2
3config TRACE_IRQFLAGS_SUPPORT
4 bool
5 default y
6
3source "lib/Kconfig.debug" 7source "lib/Kconfig.debug"
4 8
5config CROSSCOMPILE 9config CROSSCOMPILE
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index ebbb9adc0e2f..d333ce4ba26b 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -712,16 +712,14 @@ endif
712vmlinux.bin: $(vmlinux-32) 712vmlinux.bin: $(vmlinux-32)
713 +@$(call makeboot,$@) 713 +@$(call makeboot,$@)
714 714
715vmlinux.ecoff vmlinux.rm200: $(vmlinux-32) 715vmlinux.ecoff: $(vmlinux-32)
716 +@$(call makeboot,$@) 716 +@$(call makeboot,$@)
717 717
718vmlinux.srec: $(vmlinux-32) 718vmlinux.srec: $(vmlinux-32)
719 +@$(call makeboot,$@) 719 +@$(call makeboot,$@)
720 720
721CLEAN_FILES += vmlinux.ecoff \ 721CLEAN_FILES += vmlinux.ecoff \
722 vmlinux.srec \ 722 vmlinux.srec
723 vmlinux.rm200.tmp \
724 vmlinux.rm200
725 723
726archclean: 724archclean:
727 @$(MAKE) $(clean)=arch/mips/boot 725 @$(MAKE) $(clean)=arch/mips/boot
diff --git a/arch/mips/au1000/common/irq.c b/arch/mips/au1000/common/irq.c
index 29d6f8178bad..316722ee8cf5 100644
--- a/arch/mips/au1000/common/irq.c
+++ b/arch/mips/au1000/common/irq.c
@@ -251,7 +251,7 @@ void restore_local_and_enable(int controller, unsigned long mask)
251} 251}
252 252
253 253
254static struct hw_interrupt_type rise_edge_irq_type = { 254static struct irq_chip rise_edge_irq_type = {
255 .typename = "Au1000 Rise Edge", 255 .typename = "Au1000 Rise Edge",
256 .startup = startup_irq, 256 .startup = startup_irq,
257 .shutdown = shutdown_irq, 257 .shutdown = shutdown_irq,
@@ -261,7 +261,7 @@ static struct hw_interrupt_type rise_edge_irq_type = {
261 .end = end_irq, 261 .end = end_irq,
262}; 262};
263 263
264static struct hw_interrupt_type fall_edge_irq_type = { 264static struct irq_chip fall_edge_irq_type = {
265 .typename = "Au1000 Fall Edge", 265 .typename = "Au1000 Fall Edge",
266 .startup = startup_irq, 266 .startup = startup_irq,
267 .shutdown = shutdown_irq, 267 .shutdown = shutdown_irq,
@@ -271,7 +271,7 @@ static struct hw_interrupt_type fall_edge_irq_type = {
271 .end = end_irq, 271 .end = end_irq,
272}; 272};
273 273
274static struct hw_interrupt_type either_edge_irq_type = { 274static struct irq_chip either_edge_irq_type = {
275 .typename = "Au1000 Rise or Fall Edge", 275 .typename = "Au1000 Rise or Fall Edge",
276 .startup = startup_irq, 276 .startup = startup_irq,
277 .shutdown = shutdown_irq, 277 .shutdown = shutdown_irq,
@@ -281,7 +281,7 @@ static struct hw_interrupt_type either_edge_irq_type = {
281 .end = end_irq, 281 .end = end_irq,
282}; 282};
283 283
284static struct hw_interrupt_type level_irq_type = { 284static struct irq_chip level_irq_type = {
285 .typename = "Au1000 Level", 285 .typename = "Au1000 Level",
286 .startup = startup_irq, 286 .startup = startup_irq,
287 .shutdown = shutdown_irq, 287 .shutdown = shutdown_irq,
diff --git a/arch/mips/au1000/common/prom.c b/arch/mips/au1000/common/prom.c
index ae7d8c57bf3f..b4b010a2fe36 100644
--- a/arch/mips/au1000/common/prom.c
+++ b/arch/mips/au1000/common/prom.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * 2 *
3 * BRIEF MODULE DESCRIPTION 3 * BRIEF MODULE DESCRIPTION
4 * PROM library initialisation code, assuming YAMON is the boot loader. 4 * PROM library initialisation code, supports YAMON and U-Boot.
5 * 5 *
6 * Copyright 2000, 2001, 2006 MontaVista Software Inc. 6 * Copyright 2000, 2001, 2006 MontaVista Software Inc.
7 * Author: MontaVista Software, Inc. 7 * Author: MontaVista Software, Inc.
@@ -46,12 +46,6 @@
46extern int prom_argc; 46extern int prom_argc;
47extern char **prom_argv, **prom_envp; 47extern char **prom_argv, **prom_envp;
48 48
49typedef struct
50{
51 char *name;
52 char *val;
53} t_env_var;
54
55 49
56char * prom_getcmdline(void) 50char * prom_getcmdline(void)
57{ 51{
@@ -84,13 +78,21 @@ char *prom_getenv(char *envname)
84{ 78{
85 /* 79 /*
86 * Return a pointer to the given environment variable. 80 * Return a pointer to the given environment variable.
81 * YAMON uses "name", "value" pairs, while U-Boot uses "name=value".
87 */ 82 */
88 83
89 t_env_var *env = (t_env_var *)prom_envp; 84 char **env = prom_envp;
90 85 int i = strlen(envname);
91 while (env->name) { 86 int yamon = (*env && strchr(*env, '=') == NULL);
92 if (strcmp(envname, env->name) == 0) 87
93 return env->val; 88 while (*env) {
89 if (yamon) {
90 if (strcmp(envname, *env++) == 0)
91 return *env;
92 } else {
93 if (strncmp(envname, *env, i) == 0 && (*env)[i] == '=')
94 return *env + i + 1;
95 }
94 env++; 96 env++;
95 } 97 }
96 return NULL; 98 return NULL;
diff --git a/arch/mips/au1000/common/setup.c b/arch/mips/au1000/common/setup.c
index cc5138ce9c95..377ae0d8ff00 100644
--- a/arch/mips/au1000/common/setup.c
+++ b/arch/mips/au1000/common/setup.c
@@ -51,7 +51,6 @@ extern void au1000_power_off(void);
51extern void au1x_time_init(void); 51extern void au1x_time_init(void);
52extern void au1x_timer_setup(struct irqaction *irq); 52extern void au1x_timer_setup(struct irqaction *irq);
53extern void au1xxx_time_init(void); 53extern void au1xxx_time_init(void);
54extern void au1xxx_timer_setup(struct irqaction *irq);
55extern void set_cpuspec(void); 54extern void set_cpuspec(void);
56 55
57void __init plat_mem_setup(void) 56void __init plat_mem_setup(void)
@@ -123,7 +122,6 @@ void __init plat_mem_setup(void)
123 _machine_halt = au1000_halt; 122 _machine_halt = au1000_halt;
124 pm_power_off = au1000_power_off; 123 pm_power_off = au1000_power_off;
125 board_time_init = au1xxx_time_init; 124 board_time_init = au1xxx_time_init;
126 board_timer_setup = au1xxx_timer_setup;
127 125
128 /* IO/MEM resources. */ 126 /* IO/MEM resources. */
129 set_io_port_base(0); 127 set_io_port_base(0);
diff --git a/arch/mips/au1000/common/time.c b/arch/mips/au1000/common/time.c
index 7e988b0b0130..7fbea1bf7b48 100644
--- a/arch/mips/au1000/common/time.c
+++ b/arch/mips/au1000/common/time.c
@@ -383,7 +383,7 @@ static unsigned long do_fast_pm_gettimeoffset(void)
383} 383}
384#endif 384#endif
385 385
386void __init au1xxx_timer_setup(struct irqaction *irq) 386void __init plat_timer_setup(struct irqaction *irq)
387{ 387{
388 unsigned int est_freq; 388 unsigned int est_freq;
389 389
diff --git a/arch/mips/au1000/csb250/Makefile b/arch/mips/au1000/csb250/Makefile
deleted file mode 100644
index c0c4dcdccae8..000000000000
--- a/arch/mips/au1000/csb250/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
1#
2# Copyright 2002 Cogent Computer Systems
3# dan@embeddededge.com
4#
5# Makefile for the Cogent CSB250 Au1500 board. Copied from Pb1500.
6#
7
8obj-y := init.o board_setup.o irqmap.o
diff --git a/arch/mips/au1000/csb250/board_setup.c b/arch/mips/au1000/csb250/board_setup.c
deleted file mode 100644
index 348c3024d3d1..000000000000
--- a/arch/mips/au1000/csb250/board_setup.c
+++ /dev/null
@@ -1,238 +0,0 @@
1/*
2 *
3 * BRIEF MODULE DESCRIPTION
4 * Cogent CSB250 board setup.
5 *
6 * Copyright 2002 Cogent Computer Systems, Inc.
7 * dan@embeddededge.com
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 *
14 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
17 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
20 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
21 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 *
25 * You should have received a copy of the GNU General Public License along
26 * with this program; if not, write to the Free Software Foundation, Inc.,
27 * 675 Mass Ave, Cambridge, MA 02139, USA.
28 */
29#include <linux/init.h>
30#include <linux/sched.h>
31#include <linux/ioport.h>
32#include <linux/mm.h>
33#include <linux/console.h>
34#include <linux/mc146818rtc.h>
35#include <linux/delay.h>
36
37#include <asm/cpu.h>
38#include <asm/bootinfo.h>
39#include <asm/irq.h>
40#include <asm/keyboard.h>
41#include <asm/mipsregs.h>
42#include <asm/reboot.h>
43#include <asm/pgtable.h>
44#include <asm/au1000.h>
45#include <asm/csb250.h>
46
47extern int (*board_pci_idsel)(unsigned int devsel, int assert);
48int csb250_pci_idsel(unsigned int devsel, int assert);
49
50void __init board_setup(void)
51{
52 u32 pin_func, pin_val;
53 u32 sys_freqctrl, sys_clksrc;
54
55
56 // set AUX clock to 12MHz * 8 = 96 MHz
57 au_writel(8, SYS_AUXPLL);
58 au_writel(0, SYS_PINSTATERD);
59 udelay(100);
60
61#if defined (CONFIG_USB_OHCI) || defined (CONFIG_AU1X00_USB_DEVICE)
62
63 /* GPIO201 is input for PCMCIA card detect */
64 /* GPIO203 is input for PCMCIA interrupt request */
65 au_writel(au_readl(GPIO2_DIR) & (u32)(~((1<<1)|(1<<3))), GPIO2_DIR);
66
67 /* zero and disable FREQ2 */
68 sys_freqctrl = au_readl(SYS_FREQCTRL0);
69 sys_freqctrl &= ~0xFFF00000;
70 au_writel(sys_freqctrl, SYS_FREQCTRL0);
71
72 /* zero and disable USBH/USBD clocks */
73 sys_clksrc = au_readl(SYS_CLKSRC);
74 sys_clksrc &= ~0x00007FE0;
75 au_writel(sys_clksrc, SYS_CLKSRC);
76
77 sys_freqctrl = au_readl(SYS_FREQCTRL0);
78 sys_freqctrl &= ~0xFFF00000;
79
80 sys_clksrc = au_readl(SYS_CLKSRC);
81 sys_clksrc &= ~0x00007FE0;
82
83 // FREQ2 = aux/2 = 48 MHz
84 sys_freqctrl |= ((0<<22) | (1<<21) | (1<<20));
85 au_writel(sys_freqctrl, SYS_FREQCTRL0);
86
87 /*
88 * Route 48MHz FREQ2 into USB Host and/or Device
89 */
90#ifdef CONFIG_USB_OHCI
91 sys_clksrc |= ((4<<12) | (0<<11) | (0<<10));
92#endif
93#ifdef CONFIG_AU1X00_USB_DEVICE
94 sys_clksrc |= ((4<<7) | (0<<6) | (0<<5));
95#endif
96 au_writel(sys_clksrc, SYS_CLKSRC);
97
98
99 pin_func = au_readl(SYS_PINFUNC) & (u32)(~0x8000);
100#ifndef CONFIG_AU1X00_USB_DEVICE
101 // 2nd USB port is USB host
102 pin_func |= 0x8000;
103#endif
104 au_writel(pin_func, SYS_PINFUNC);
105#endif // defined (CONFIG_USB_OHCI) || defined (CONFIG_AU1X00_USB_DEVICE)
106
107 /* Configure GPIO2....it's used by PCI among other things.
108 */
109
110 /* Make everything but GP200 (PCI RST) an input until we get
111 * the pins set correctly.
112 */
113 au_writel(0x00000001, GPIO2_DIR);
114
115 /* Set the pins used for output.
116 * A zero bit will leave PCI reset, LEDs off, power up USB,
117 * IDSEL disabled.
118 */
119 pin_val = ((3 << 30) | (7 << 19) | (1 << 17) | (1 << 16));
120 au_writel(pin_val, GPIO2_OUTPUT);
121
122 /* Set the output direction.
123 */
124 pin_val = ((3 << 14) | (7 << 3) | (1 << 1) | (1 << 0));
125 au_writel(pin_val, GPIO2_DIR);
126
127#ifdef CONFIG_PCI
128 /* Use FREQ1 for the PCI output clock. We use the
129 * CPU clock of 384 MHz divided by 12 to get 32 MHz PCI.
130 * If Michael changes the CPU speed, we need to adjust
131 * that here as well :-).
132 */
133
134 /* zero and disable FREQ1
135 */
136 sys_freqctrl = au_readl(SYS_FREQCTRL0);
137 sys_freqctrl &= ~0x000ffc00;
138 au_writel(sys_freqctrl, SYS_FREQCTRL0);
139
140 /* zero and disable PCI clock
141 */
142 sys_clksrc = au_readl(SYS_CLKSRC);
143 sys_clksrc &= ~0x000f8000;
144 au_writel(sys_clksrc, SYS_CLKSRC);
145
146 /* Get current values (which really should match above).
147 */
148 sys_freqctrl = au_readl(SYS_FREQCTRL0);
149 sys_freqctrl &= ~0x000ffc00;
150
151 sys_clksrc = au_readl(SYS_CLKSRC);
152 sys_clksrc &= ~0x000f8000;
153
154 /* FREQ1 = cpu/12 = 32 MHz
155 */
156 sys_freqctrl |= ((5<<12) | (1<<11) | (0<<10));
157 au_writel(sys_freqctrl, SYS_FREQCTRL0);
158
159 /* Just connect the clock without further dividing.
160 */
161 sys_clksrc |= ((3<<17) | (0<<16) | (0<<15));
162 au_writel(sys_clksrc, SYS_CLKSRC);
163
164 udelay(1);
165
166 /* Now that clocks should be running, take PCI out of reset.
167 */
168 pin_val = au_readl(GPIO2_OUTPUT);
169 pin_val |= ((1 << 16) | 1);
170 au_writel(pin_val, GPIO2_OUTPUT);
171
172 // Setup PCI bus controller
173 au_writel(0, Au1500_PCI_CMEM);
174 au_writel(0x00003fff, Au1500_CFG_BASE);
175
176 /* We run big endian without any of the software byte swapping,
177 * so configure the PCI bridge to help us out.
178 */
179 au_writel(0xf | (2<<6) | (1<<5) | (1<<4), Au1500_PCI_CFG);
180
181 au_writel(0xf0000000, Au1500_PCI_MWMASK_DEV);
182 au_writel(0, Au1500_PCI_MWBASE_REV_CCL);
183 au_writel(0x02a00356, Au1500_PCI_STATCMD);
184 au_writel(0x00003c04, Au1500_PCI_HDRTYPE);
185 au_writel(0x00000008, Au1500_PCI_MBAR);
186 au_sync();
187
188 board_pci_idsel = csb250_pci_idsel;
189#endif
190
191 /* Enable sys bus clock divider when IDLE state or no bus activity. */
192 au_writel(au_readl(SYS_POWERCTRL) | (0x3 << 5), SYS_POWERCTRL);
193
194#ifdef CONFIG_RTC
195 // Enable the RTC if not already enabled
196 if (!(au_readl(0xac000028) & 0x20)) {
197 printk("enabling clock ...\n");
198 au_writel((au_readl(0xac000028) | 0x20), 0xac000028);
199 }
200 // Put the clock in BCD mode
201 if (readl(0xac00002C) & 0x4) { /* reg B */
202 au_writel(au_readl(0xac00002c) & ~0x4, 0xac00002c);
203 au_sync();
204 }
205#endif
206}
207
208/* The IDSEL is selected in the GPIO2 register. We will make device
209 * 12 appear in slot 0 and device 13 appear in slot 1.
210 */
211int
212csb250_pci_idsel(unsigned int devsel, int assert)
213{
214 int retval;
215 unsigned int gpio2_pins;
216
217 retval = 1;
218
219 /* First, disable both selects, then assert the one requested.
220 */
221 au_writel(0xc000c000, GPIO2_OUTPUT);
222 au_sync();
223
224 if (assert) {
225 if (devsel == 12)
226 gpio2_pins = 0x40000000;
227 else if (devsel == 13)
228 gpio2_pins = 0x80000000;
229 else {
230 gpio2_pins = 0xc000c000;
231 retval = 0;
232 }
233 au_writel(gpio2_pins, GPIO2_OUTPUT);
234 }
235 au_sync();
236
237 return retval;
238}
diff --git a/arch/mips/au1000/csb250/init.c b/arch/mips/au1000/csb250/init.c
deleted file mode 100644
index 83f1b31a0b8e..000000000000
--- a/arch/mips/au1000/csb250/init.c
+++ /dev/null
@@ -1,94 +0,0 @@
1/*
2 *
3 * BRIEF MODULE DESCRIPTION
4 * Cogent CSB250 board setup
5 *
6 * Copyright 2002 Cogent Computer Systems, Inc.
7 * dan@embeddededge.com
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 *
14 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
17 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
20 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
21 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 *
25 * You should have received a copy of the GNU General Public License along
26 * with this program; if not, write to the Free Software Foundation, Inc.,
27 * 675 Mass Ave, Cambridge, MA 02139, USA.
28 */
29
30#include <linux/init.h>
31#include <linux/mm.h>
32#include <linux/sched.h>
33#include <linux/bootmem.h>
34#include <asm/addrspace.h>
35#include <asm/bootinfo.h>
36#include <linux/string.h>
37#include <linux/kernel.h>
38
39int prom_argc;
40char **prom_argv, **prom_envp;
41extern void __init prom_init_cmdline(void);
42extern char *prom_getenv(char *envname);
43
44/* When we get initrd working someday.........
45*/
46int my_initrd_start, my_initrd_size;
47
48/* Start arguments and environment.
49*/
50static char *csb_env[2];
51static char *csb_arg[4];
52static char *arg1 = "console=ttyS3,38400";
53static char *arg2 = "root=/dev/nfs rw ip=any";
54static char *env1 = "ethaddr=00:30:23:50:00:00";
55
56const char *get_system_type(void)
57{
58 return "Cogent CSB250";
59}
60
61int __init prom_init(int argc, char **argv, char **envp, int *prom_vec)
62{
63 unsigned char *memsize_str;
64 unsigned long memsize;
65
66 /* We use a0 and a1 to pass initrd start and size.
67 */
68 if (((unsigned int) argc > 0) && ((uint)argv > 0)) {
69 my_initrd_start = (unsigned int)argc;
70 my_initrd_size = (unsigned int)argv;
71 }
72
73 /* First argv is ignored.
74 */
75 prom_argc = 3;
76 prom_argv = csb_arg;
77 prom_envp = csb_env;
78 csb_arg[1] = arg1;
79 csb_arg[2] = arg2;
80 csb_env[0] = env1;
81
82 mips_machgroup = MACH_GROUP_ALCHEMY;
83 mips_machtype = MACH_CSB250;
84
85 prom_init_cmdline();
86 memsize_str = prom_getenv("memsize");
87 if (!memsize_str) {
88 memsize = 0x02000000;
89 } else {
90 memsize = simple_strtol(memsize_str, NULL, 0);
91 }
92 add_memory_region(0, memsize, BOOT_MEM_RAM);
93 return 0;
94}
diff --git a/arch/mips/au1000/csb250/irqmap.c b/arch/mips/au1000/csb250/irqmap.c
deleted file mode 100644
index 57d60401905e..000000000000
--- a/arch/mips/au1000/csb250/irqmap.c
+++ /dev/null
@@ -1,60 +0,0 @@
1/*
2 * BRIEF MODULE DESCRIPTION
3 * Au1xxx irq map table
4 *
5 * Copyright 2003 Embedded Edge, LLC
6 * dan@embeddededge.com
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 *
13 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
14 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
15 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
16 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
19 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, write to the Free Software Foundation, Inc.,
26 * 675 Mass Ave, Cambridge, MA 02139, USA.
27 */
28#include <linux/errno.h>
29#include <linux/init.h>
30#include <linux/irq.h>
31#include <linux/kernel_stat.h>
32#include <linux/module.h>
33#include <linux/signal.h>
34#include <linux/sched.h>
35#include <linux/types.h>
36#include <linux/interrupt.h>
37#include <linux/ioport.h>
38#include <linux/timex.h>
39#include <linux/slab.h>
40#include <linux/random.h>
41#include <linux/delay.h>
42#include <linux/bitops.h>
43
44#include <asm/bootinfo.h>
45#include <asm/io.h>
46#include <asm/mipsregs.h>
47#include <asm/system.h>
48#include <asm/au1000.h>
49
50au1xxx_irq_map_t __initdata au1xxx_irq_map[] = {
51
52 { AU1500_GPIO_204, INTC_INT_HIGH_LEVEL, 0},
53 { AU1500_GPIO_201, INTC_INT_LOW_LEVEL, 0 },
54 { AU1500_GPIO_202, INTC_INT_LOW_LEVEL, 0 },
55 { AU1500_GPIO_203, INTC_INT_LOW_LEVEL, 0 },
56 { AU1500_GPIO_205, INTC_INT_LOW_LEVEL, 0 },
57 { AU1500_GPIO_207, INTC_INT_LOW_LEVEL, 0 },
58};
59
60int __initdata au1xxx_nr_irqs = ARRAY_SIZE(au1xxx_irq_map);
diff --git a/arch/mips/au1000/hydrogen3/Makefile b/arch/mips/au1000/hydrogen3/Makefile
deleted file mode 100644
index 974f79256bb3..000000000000
--- a/arch/mips/au1000/hydrogen3/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
1#
2# Copyright 2000 MontaVista Software Inc.
3# Author: MontaVista Software, Inc.
4# ppopov@mvista.com or source@mvista.com
5#
6# Makefile for the Alchemy Semiconductor PB1000 board.
7#
8
9obj-y := init.o board_setup.o irqmap.o
diff --git a/arch/mips/au1000/hydrogen3/board_setup.c b/arch/mips/au1000/hydrogen3/board_setup.c
deleted file mode 100644
index d081640e2e00..000000000000
--- a/arch/mips/au1000/hydrogen3/board_setup.c
+++ /dev/null
@@ -1,69 +0,0 @@
1/*
2 *
3 * BRIEF MODULE DESCRIPTION
4 * Alchemy Db1x00 board setup.
5 *
6 * Copyright 2000 MontaVista Software Inc.
7 * Author: MontaVista Software, Inc.
8 * ppopov@mvista.com or source@mvista.com
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 *
15 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
16 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
17 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
18 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
21 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
22 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 * You should have received a copy of the GNU General Public License along
27 * with this program; if not, write to the Free Software Foundation, Inc.,
28 * 675 Mass Ave, Cambridge, MA 02139, USA.
29 */
30#include <linux/init.h>
31#include <linux/sched.h>
32#include <linux/ioport.h>
33#include <linux/mm.h>
34#include <linux/console.h>
35#include <linux/mc146818rtc.h>
36#include <linux/delay.h>
37
38#include <asm/cpu.h>
39#include <asm/bootinfo.h>
40#include <asm/irq.h>
41#include <asm/keyboard.h>
42#include <asm/mipsregs.h>
43#include <asm/reboot.h>
44#include <asm/pgtable.h>
45#include <asm/au1000.h>
46
47void board_reset (void)
48{
49}
50
51void __init board_setup(void)
52{
53 u32 pin_func;
54
55#ifdef CONFIG_AU1X00_USB_DEVICE
56 // 2nd USB port is USB device
57 pin_func = au_readl(SYS_PINFUNC) & (u32)(~0x8000);
58 au_writel(pin_func, SYS_PINFUNC);
59#endif
60
61#if defined(CONFIG_IRDA) && (defined(CONFIG_SOC_AU1000) || defined(CONFIG_SOC_AU1100))
62 /* set IRFIRSEL instead of GPIO15 */
63 pin_func = au_readl(SYS_PINFUNC) | (u32)((1<<8));
64 au_writel(pin_func, SYS_PINFUNC);
65 au_sync();
66#endif
67
68 printk("AMD Alchemy Hydrogen3 Board\n");
69}
diff --git a/arch/mips/au1000/hydrogen3/init.c b/arch/mips/au1000/hydrogen3/init.c
deleted file mode 100644
index 8f02bb80a55a..000000000000
--- a/arch/mips/au1000/hydrogen3/init.c
+++ /dev/null
@@ -1,75 +0,0 @@
1/*
2 *
3 * BRIEF MODULE DESCRIPTION
4 * PB1000 board setup
5 *
6 * Copyright 2001 MontaVista Software Inc.
7 * Author: MontaVista Software, Inc.
8 * ppopov@mvista.com or source@mvista.com
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 *
15 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
16 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
17 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
18 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
21 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
22 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 * You should have received a copy of the GNU General Public License along
27 * with this program; if not, write to the Free Software Foundation, Inc.,
28 * 675 Mass Ave, Cambridge, MA 02139, USA.
29 */
30
31#include <linux/init.h>
32#include <linux/mm.h>
33#include <linux/sched.h>
34#include <linux/bootmem.h>
35#include <asm/addrspace.h>
36#include <asm/bootinfo.h>
37#include <linux/string.h>
38#include <linux/kernel.h>
39
40int prom_argc;
41char **prom_argv, **prom_envp;
42extern void __init prom_init_cmdline(void);
43extern char *prom_getenv(char *envname);
44
45const char *get_system_type(void)
46{
47#ifdef CONFIG_MIPS_BOSPORUS
48 return "Alchemy Bosporus Gateway Reference";
49#else
50 return "Alchemy Db1x00";
51#endif
52}
53
54int __init prom_init(int argc, char **argv, char **envp, int *prom_vec)
55{
56 unsigned char *memsize_str;
57 unsigned long memsize;
58
59 prom_argc = argc;
60 prom_argv = argv;
61 prom_envp = envp;
62
63 mips_machgroup = MACH_GROUP_ALCHEMY;
64 mips_machtype = MACH_DB1000; /* set the platform # */
65 prom_init_cmdline();
66
67 memsize_str = prom_getenv("memsize");
68 if (!memsize_str) {
69 memsize = 0x04000000;
70 } else {
71 memsize = simple_strtol(memsize_str, NULL, 0);
72 }
73 add_memory_region(0, memsize, BOOT_MEM_RAM);
74 return 0;
75}
diff --git a/arch/mips/au1000/hydrogen3/irqmap.c b/arch/mips/au1000/hydrogen3/irqmap.c
deleted file mode 100644
index 14e1ed37cf6b..000000000000
--- a/arch/mips/au1000/hydrogen3/irqmap.c
+++ /dev/null
@@ -1,56 +0,0 @@
1/*
2 * BRIEF MODULE DESCRIPTION
3 * Au1xxx irq map table
4 *
5 * Copyright 2003 Embedded Edge, LLC
6 * dan@embeddededge.com
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 *
13 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
14 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
15 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
16 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
19 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, write to the Free Software Foundation, Inc.,
26 * 675 Mass Ave, Cambridge, MA 02139, USA.
27 */
28#include <linux/errno.h>
29#include <linux/init.h>
30#include <linux/irq.h>
31#include <linux/kernel_stat.h>
32#include <linux/module.h>
33#include <linux/signal.h>
34#include <linux/sched.h>
35#include <linux/types.h>
36#include <linux/interrupt.h>
37#include <linux/ioport.h>
38#include <linux/timex.h>
39#include <linux/slab.h>
40#include <linux/random.h>
41#include <linux/delay.h>
42#include <linux/bitops.h>
43
44#include <asm/bootinfo.h>
45#include <asm/io.h>
46#include <asm/mipsregs.h>
47#include <asm/system.h>
48#include <asm/au1000.h>
49
50au1xxx_irq_map_t __initdata au1xxx_irq_map[] = {
51
52 /* { AU1500_GPIO_205, INTC_INT_LOW_LEVEL, 0 }, */
53 { AU1000_GPIO_21, INTC_INT_LOW_LEVEL, 0 },
54};
55
56int __initdata au1xxx_nr_irqs = ARRAY_SIZE(au1xxx_irq_map);
diff --git a/arch/mips/au1000/pb1200/irqmap.c b/arch/mips/au1000/pb1200/irqmap.c
index 2d49f32f4622..f66779f0d4cd 100644
--- a/arch/mips/au1000/pb1200/irqmap.c
+++ b/arch/mips/au1000/pb1200/irqmap.c
@@ -148,7 +148,7 @@ static void pb1200_end_irq(unsigned int irq_nr)
148 } 148 }
149} 149}
150 150
151static struct hw_interrupt_type external_irq_type = 151static struct irq_chip external_irq_type =
152{ 152{
153#ifdef CONFIG_MIPS_PB1200 153#ifdef CONFIG_MIPS_PB1200
154 "Pb1200 Ext", 154 "Pb1200 Ext",
diff --git a/arch/mips/basler/excite/excite_dbg_io.c b/arch/mips/basler/excite/excite_dbg_io.c
index 83f6bddf578b..c04505afa47f 100644
--- a/arch/mips/basler/excite/excite_dbg_io.c
+++ b/arch/mips/basler/excite/excite_dbg_io.c
@@ -17,7 +17,6 @@
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */ 18 */
19 19
20#include <linux/config.h>
21#include <linux/linkage.h> 20#include <linux/linkage.h>
22#include <linux/init.h> 21#include <linux/init.h>
23#include <linux/kernel.h> 22#include <linux/kernel.h>
diff --git a/arch/mips/basler/excite/excite_device.c b/arch/mips/basler/excite/excite_device.c
index 34ec76716fa0..bbb4ea43da88 100644
--- a/arch/mips/basler/excite/excite_device.c
+++ b/arch/mips/basler/excite/excite_device.c
@@ -17,7 +17,6 @@
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */ 18 */
19 19
20#include <linux/config.h>
21#include <linux/kernel.h> 20#include <linux/kernel.h>
22#include <linux/init.h> 21#include <linux/init.h>
23#include <linux/platform_device.h> 22#include <linux/platform_device.h>
diff --git a/arch/mips/basler/excite/excite_iodev.c b/arch/mips/basler/excite/excite_iodev.c
index b288151b532e..10bbb8cfb964 100644
--- a/arch/mips/basler/excite/excite_iodev.c
+++ b/arch/mips/basler/excite/excite_iodev.c
@@ -17,7 +17,6 @@
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */ 18 */
19 19
20#include <linux/config.h>
21#include <linux/compiler.h> 20#include <linux/compiler.h>
22#include <linux/init.h> 21#include <linux/init.h>
23#include <linux/module.h> 22#include <linux/module.h>
diff --git a/arch/mips/basler/excite/excite_procfs.c b/arch/mips/basler/excite/excite_procfs.c
index c62be0341fb8..9ee67a95f6b9 100644
--- a/arch/mips/basler/excite/excite_procfs.c
+++ b/arch/mips/basler/excite/excite_procfs.c
@@ -19,7 +19,6 @@
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */ 20 */
21 21
22#include <linux/config.h>
23#include <linux/proc_fs.h> 22#include <linux/proc_fs.h>
24#include <linux/stat.h> 23#include <linux/stat.h>
25#include <asm/page.h> 24#include <asm/page.h>
diff --git a/arch/mips/basler/excite/excite_prom.c b/arch/mips/basler/excite/excite_prom.c
index 84724b270753..6ecd512b999d 100644
--- a/arch/mips/basler/excite/excite_prom.c
+++ b/arch/mips/basler/excite/excite_prom.c
@@ -18,7 +18,6 @@
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 19 */
20 20
21#include <linux/config.h>
22#include <linux/init.h> 21#include <linux/init.h>
23#include <linux/sched.h> 22#include <linux/sched.h>
24#include <linux/mm.h> 23#include <linux/mm.h>
diff --git a/arch/mips/basler/excite/excite_setup.c b/arch/mips/basler/excite/excite_setup.c
index 3d7670edd5cd..a1ce4580058d 100644
--- a/arch/mips/basler/excite/excite_setup.c
+++ b/arch/mips/basler/excite/excite_setup.c
@@ -19,7 +19,6 @@
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */ 20 */
21 21
22#include <linux/config.h>
23#include <linux/types.h> 22#include <linux/types.h>
24#include <linux/kernel.h> 23#include <linux/kernel.h>
25#include <linux/module.h> 24#include <linux/module.h>
@@ -79,7 +78,7 @@ static void excite_timer_init(void)
79 mips_hpt_frequency = EXCITE_CPU_EXT_CLOCK * mult / div / 2; 78 mips_hpt_frequency = EXCITE_CPU_EXT_CLOCK * mult / div / 2;
80} 79}
81 80
82static void excite_timer_setup(struct irqaction *irq) 81void __init plat_timer_setup(struct irqaction *irq)
83{ 82{
84 /* The eXcite platform uses the alternate timer interrupt */ 83 /* The eXcite platform uses the alternate timer interrupt */
85 set_c0_intcontrol(0x80); 84 set_c0_intcontrol(0x80);
@@ -263,7 +262,6 @@ void __init plat_mem_setup(void)
263 262
264 /* Set up timer initialization hooks */ 263 /* Set up timer initialization hooks */
265 board_time_init = excite_timer_init; 264 board_time_init = excite_timer_init;
266 board_timer_setup = excite_timer_setup;
267 265
268 /* Set up the peripheral address map */ 266 /* Set up the peripheral address map */
269 *(boot_ocd_base + (LKB9 / sizeof (u32))) = 0; 267 *(boot_ocd_base + (LKB9 / sizeof (u32))) = 0;
diff --git a/arch/mips/cobalt/setup.c b/arch/mips/cobalt/setup.c
index c99714587ce8..c01a0170e590 100644
--- a/arch/mips/cobalt/setup.c
+++ b/arch/mips/cobalt/setup.c
@@ -49,7 +49,7 @@ const char *get_system_type(void)
49 return "MIPS Cobalt"; 49 return "MIPS Cobalt";
50} 50}
51 51
52static void __init cobalt_timer_setup(struct irqaction *irq) 52void __init plat_timer_setup(struct irqaction *irq)
53{ 53{
54 /* Load timer value for 1KHz (TCLK is 50MHz) */ 54 /* Load timer value for 1KHz (TCLK is 50MHz) */
55 GALILEO_OUTL(50*1000*1000 / 1000, GT_TC0_OFS); 55 GALILEO_OUTL(50*1000*1000 / 1000, GT_TC0_OFS);
@@ -129,8 +129,6 @@ void __init plat_mem_setup(void)
129 _machine_halt = cobalt_machine_halt; 129 _machine_halt = cobalt_machine_halt;
130 pm_power_off = cobalt_machine_power_off; 130 pm_power_off = cobalt_machine_power_off;
131 131
132 board_timer_setup = cobalt_timer_setup;
133
134 set_io_port_base(CKSEG1ADDR(GT64111_IO_BASE)); 132 set_io_port_base(CKSEG1ADDR(GT64111_IO_BASE));
135 133
136 /* I/O port resource must include UART and LCD/buttons */ 134 /* I/O port resource must include UART and LCD/buttons */
diff --git a/arch/mips/configs/atlas_defconfig b/arch/mips/configs/atlas_defconfig
index 0cc1b3c51959..54274065e9a5 100644
--- a/arch/mips/configs/atlas_defconfig
+++ b/arch/mips/configs/atlas_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:50:55 2006 4# Thu Jul 6 09:59:39 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS=y
32CONFIG_MIPS_ATLAS=y 33CONFIG_MIPS_ATLAS=y
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MIPS_ATLAS=y
45# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -65,6 +68,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
65CONFIG_GENERIC_FIND_NEXT_BIT=y 68CONFIG_GENERIC_FIND_NEXT_BIT=y
66CONFIG_GENERIC_HWEIGHT=y 69CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 70CONFIG_GENERIC_CALIBRATE_DELAY=y
71CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
68CONFIG_DMA_NONCOHERENT=y 72CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 73CONFIG_DMA_NEED_PCI_MAP_STATE=y
70CONFIG_MIPS_BONITO64=y 74CONFIG_MIPS_BONITO64=y
@@ -125,7 +129,11 @@ CONFIG_PAGE_SIZE_4KB=y
125CONFIG_BOARD_SCACHE=y 129CONFIG_BOARD_SCACHE=y
126CONFIG_RM7000_CPU_SCACHE=y 130CONFIG_RM7000_CPU_SCACHE=y
127CONFIG_CPU_HAS_PREFETCH=y 131CONFIG_CPU_HAS_PREFETCH=y
128# CONFIG_MIPS_MT is not set 132CONFIG_MIPS_MT_DISABLED=y
133# CONFIG_MIPS_MT_SMTC is not set
134# CONFIG_MIPS_MT_SMP is not set
135# CONFIG_MIPS_VPE_LOADER is not set
136CONFIG_SYS_SUPPORTS_MULTITHREADING=y
129# CONFIG_64BIT_PHYS_ADDR is not set 137# CONFIG_64BIT_PHYS_ADDR is not set
130CONFIG_CPU_HAS_LLSC=y 138CONFIG_CPU_HAS_LLSC=y
131CONFIG_CPU_HAS_SYNC=y 139CONFIG_CPU_HAS_SYNC=y
@@ -141,6 +149,7 @@ CONFIG_FLATMEM=y
141CONFIG_FLAT_NODE_MEM_MAP=y 149CONFIG_FLAT_NODE_MEM_MAP=y
142# CONFIG_SPARSEMEM_STATIC is not set 150# CONFIG_SPARSEMEM_STATIC is not set
143CONFIG_SPLIT_PTLOCK_CPUS=4 151CONFIG_SPLIT_PTLOCK_CPUS=4
152# CONFIG_RESOURCES_64BIT is not set
144# CONFIG_HZ_48 is not set 153# CONFIG_HZ_48 is not set
145CONFIG_HZ_100=y 154CONFIG_HZ_100=y
146# CONFIG_HZ_128 is not set 155# CONFIG_HZ_128 is not set
@@ -153,6 +162,7 @@ CONFIG_HZ=100
153CONFIG_PREEMPT_NONE=y 162CONFIG_PREEMPT_NONE=y
154# CONFIG_PREEMPT_VOLUNTARY is not set 163# CONFIG_PREEMPT_VOLUNTARY is not set
155# CONFIG_PREEMPT is not set 164# CONFIG_PREEMPT is not set
165CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
156 166
157# 167#
158# Code maturity level options 168# Code maturity level options
@@ -184,10 +194,12 @@ CONFIG_PRINTK=y
184CONFIG_BUG=y 194CONFIG_BUG=y
185CONFIG_ELF_CORE=y 195CONFIG_ELF_CORE=y
186CONFIG_BASE_FULL=y 196CONFIG_BASE_FULL=y
197CONFIG_RT_MUTEXES=y
187CONFIG_FUTEX=y 198CONFIG_FUTEX=y
188CONFIG_EPOLL=y 199CONFIG_EPOLL=y
189CONFIG_SHMEM=y 200CONFIG_SHMEM=y
190CONFIG_SLAB=y 201CONFIG_SLAB=y
202CONFIG_VM_EVENT_COUNTERS=y
191# CONFIG_TINY_SHMEM is not set 203# CONFIG_TINY_SHMEM is not set
192CONFIG_BASE_SMALL=0 204CONFIG_BASE_SMALL=0
193# CONFIG_SLOB is not set 205# CONFIG_SLOB is not set
@@ -289,6 +301,8 @@ CONFIG_INET_ESP=m
289CONFIG_INET_IPCOMP=m 301CONFIG_INET_IPCOMP=m
290CONFIG_INET_XFRM_TUNNEL=m 302CONFIG_INET_XFRM_TUNNEL=m
291CONFIG_INET_TUNNEL=m 303CONFIG_INET_TUNNEL=m
304CONFIG_INET_XFRM_MODE_TRANSPORT=m
305CONFIG_INET_XFRM_MODE_TUNNEL=m
292CONFIG_INET_DIAG=y 306CONFIG_INET_DIAG=y
293CONFIG_INET_TCP_DIAG=y 307CONFIG_INET_TCP_DIAG=y
294# CONFIG_TCP_CONG_ADVANCED is not set 308# CONFIG_TCP_CONG_ADVANCED is not set
@@ -336,7 +350,10 @@ CONFIG_INET6_ESP=m
336CONFIG_INET6_IPCOMP=m 350CONFIG_INET6_IPCOMP=m
337CONFIG_INET6_XFRM_TUNNEL=m 351CONFIG_INET6_XFRM_TUNNEL=m
338CONFIG_INET6_TUNNEL=m 352CONFIG_INET6_TUNNEL=m
353CONFIG_INET6_XFRM_MODE_TRANSPORT=m
354CONFIG_INET6_XFRM_MODE_TUNNEL=m
339CONFIG_IPV6_TUNNEL=m 355CONFIG_IPV6_TUNNEL=m
356CONFIG_NETWORK_SECMARK=y
340CONFIG_NETFILTER=y 357CONFIG_NETFILTER=y
341# CONFIG_NETFILTER_DEBUG is not set 358# CONFIG_NETFILTER_DEBUG is not set
342CONFIG_BRIDGE_NETFILTER=y 359CONFIG_BRIDGE_NETFILTER=y
@@ -353,6 +370,8 @@ CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
353CONFIG_NETFILTER_XT_TARGET_MARK=m 370CONFIG_NETFILTER_XT_TARGET_MARK=m
354CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m 371CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
355CONFIG_NETFILTER_XT_TARGET_NOTRACK=m 372CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
373CONFIG_NETFILTER_XT_TARGET_SECMARK=m
374CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m
356CONFIG_NETFILTER_XT_MATCH_COMMENT=m 375CONFIG_NETFILTER_XT_MATCH_COMMENT=m
357CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m 376CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
358CONFIG_NETFILTER_XT_MATCH_CONNMARK=m 377CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
@@ -368,9 +387,11 @@ CONFIG_NETFILTER_XT_MATCH_POLICY=m
368CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m 387CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
369CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m 388CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m
370CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 389CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
390CONFIG_NETFILTER_XT_MATCH_QUOTA=m
371CONFIG_NETFILTER_XT_MATCH_REALM=m 391CONFIG_NETFILTER_XT_MATCH_REALM=m
372CONFIG_NETFILTER_XT_MATCH_SCTP=m 392CONFIG_NETFILTER_XT_MATCH_SCTP=m
373CONFIG_NETFILTER_XT_MATCH_STATE=m 393CONFIG_NETFILTER_XT_MATCH_STATE=m
394CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
374CONFIG_NETFILTER_XT_MATCH_STRING=m 395CONFIG_NETFILTER_XT_MATCH_STRING=m
375CONFIG_NETFILTER_XT_MATCH_TCPMSS=m 396CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
376 397
@@ -380,6 +401,7 @@ CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
380CONFIG_IP_NF_CONNTRACK=m 401CONFIG_IP_NF_CONNTRACK=m
381CONFIG_IP_NF_CT_ACCT=y 402CONFIG_IP_NF_CT_ACCT=y
382CONFIG_IP_NF_CONNTRACK_MARK=y 403CONFIG_IP_NF_CONNTRACK_MARK=y
404CONFIG_IP_NF_CONNTRACK_SECMARK=y
383CONFIG_IP_NF_CONNTRACK_EVENTS=y 405CONFIG_IP_NF_CONNTRACK_EVENTS=y
384CONFIG_IP_NF_CONNTRACK_NETLINK=m 406CONFIG_IP_NF_CONNTRACK_NETLINK=m
385CONFIG_IP_NF_CT_PROTO_SCTP=m 407CONFIG_IP_NF_CT_PROTO_SCTP=m
@@ -390,6 +412,7 @@ CONFIG_IP_NF_TFTP=m
390CONFIG_IP_NF_AMANDA=m 412CONFIG_IP_NF_AMANDA=m
391CONFIG_IP_NF_PPTP=m 413CONFIG_IP_NF_PPTP=m
392CONFIG_IP_NF_H323=m 414CONFIG_IP_NF_H323=m
415CONFIG_IP_NF_SIP=m
393CONFIG_IP_NF_QUEUE=m 416CONFIG_IP_NF_QUEUE=m
394CONFIG_IP_NF_IPTABLES=m 417CONFIG_IP_NF_IPTABLES=m
395CONFIG_IP_NF_MATCH_IPRANGE=m 418CONFIG_IP_NF_MATCH_IPRANGE=m
@@ -420,6 +443,7 @@ CONFIG_IP_NF_NAT_TFTP=m
420CONFIG_IP_NF_NAT_AMANDA=m 443CONFIG_IP_NF_NAT_AMANDA=m
421CONFIG_IP_NF_NAT_PPTP=m 444CONFIG_IP_NF_NAT_PPTP=m
422CONFIG_IP_NF_NAT_H323=m 445CONFIG_IP_NF_NAT_H323=m
446CONFIG_IP_NF_NAT_SIP=m
423CONFIG_IP_NF_MANGLE=m 447CONFIG_IP_NF_MANGLE=m
424CONFIG_IP_NF_TARGET_TOS=m 448CONFIG_IP_NF_TARGET_TOS=m
425CONFIG_IP_NF_TARGET_ECN=m 449CONFIG_IP_NF_TARGET_ECN=m
@@ -581,6 +605,7 @@ CONFIG_WIRELESS_EXT=y
581CONFIG_STANDALONE=y 605CONFIG_STANDALONE=y
582CONFIG_PREVENT_FIRMWARE_BUILD=y 606CONFIG_PREVENT_FIRMWARE_BUILD=y
583CONFIG_FW_LOADER=y 607CONFIG_FW_LOADER=y
608# CONFIG_SYS_HYPERVISOR is not set
584 609
585# 610#
586# Connector - unified userspace <-> kernelspace linker 611# Connector - unified userspace <-> kernelspace linker
@@ -699,6 +724,7 @@ CONFIG_ISCSI_TCP=m
699# CONFIG_MEGARAID_LEGACY is not set 724# CONFIG_MEGARAID_LEGACY is not set
700# CONFIG_MEGARAID_SAS is not set 725# CONFIG_MEGARAID_SAS is not set
701# CONFIG_SCSI_SATA is not set 726# CONFIG_SCSI_SATA is not set
727# CONFIG_SCSI_HPTIOP is not set
702# CONFIG_SCSI_DMX3191D is not set 728# CONFIG_SCSI_DMX3191D is not set
703# CONFIG_SCSI_FUTURE_DOMAIN is not set 729# CONFIG_SCSI_FUTURE_DOMAIN is not set
704# CONFIG_SCSI_IPS is not set 730# CONFIG_SCSI_IPS is not set
@@ -727,9 +753,8 @@ CONFIG_MD_LINEAR=m
727CONFIG_MD_RAID0=m 753CONFIG_MD_RAID0=m
728CONFIG_MD_RAID1=m 754CONFIG_MD_RAID1=m
729CONFIG_MD_RAID10=m 755CONFIG_MD_RAID10=m
730CONFIG_MD_RAID5=m 756CONFIG_MD_RAID456=m
731CONFIG_MD_RAID5_RESHAPE=y 757CONFIG_MD_RAID5_RESHAPE=y
732CONFIG_MD_RAID6=m
733CONFIG_MD_MULTIPATH=m 758CONFIG_MD_MULTIPATH=m
734CONFIG_MD_FAULTY=m 759CONFIG_MD_FAULTY=m
735CONFIG_BLK_DEV_DM=m 760CONFIG_BLK_DEV_DM=m
@@ -785,6 +810,8 @@ CONFIG_DAVICOM_PHY=m
785CONFIG_QSEMI_PHY=m 810CONFIG_QSEMI_PHY=m
786CONFIG_LXT_PHY=m 811CONFIG_LXT_PHY=m
787CONFIG_CICADA_PHY=m 812CONFIG_CICADA_PHY=m
813CONFIG_VITESSE_PHY=m
814CONFIG_SMSC_PHY=m
788 815
789# 816#
790# Ethernet (10 or 100Mbit) 817# Ethernet (10 or 100Mbit)
@@ -847,6 +874,7 @@ CONFIG_LAN_SAA9730=y
847# CONFIG_CHELSIO_T1 is not set 874# CONFIG_CHELSIO_T1 is not set
848# CONFIG_IXGB is not set 875# CONFIG_IXGB is not set
849# CONFIG_S2IO is not set 876# CONFIG_S2IO is not set
877# CONFIG_MYRI10GE is not set
850 878
851# 879#
852# Token Ring devices 880# Token Ring devices
@@ -928,6 +956,7 @@ CONFIG_SERIO_RAW=y
928CONFIG_VT=y 956CONFIG_VT=y
929CONFIG_VT_CONSOLE=y 957CONFIG_VT_CONSOLE=y
930CONFIG_HW_CONSOLE=y 958CONFIG_HW_CONSOLE=y
959CONFIG_VT_HW_CONSOLE_BINDING=y
931# CONFIG_SERIAL_NONSTANDARD is not set 960# CONFIG_SERIAL_NONSTANDARD is not set
932 961
933# 962#
@@ -959,6 +988,7 @@ CONFIG_LEGACY_PTY_COUNT=256
959# Watchdog Cards 988# Watchdog Cards
960# 989#
961# CONFIG_WATCHDOG is not set 990# CONFIG_WATCHDOG is not set
991# CONFIG_HW_RANDOM is not set
962# CONFIG_RTC is not set 992# CONFIG_RTC is not set
963# CONFIG_GEN_RTC is not set 993# CONFIG_GEN_RTC is not set
964# CONFIG_DTLK is not set 994# CONFIG_DTLK is not set
@@ -1007,6 +1037,7 @@ CONFIG_LEGACY_PTY_COUNT=256
1007# Multimedia devices 1037# Multimedia devices
1008# 1038#
1009# CONFIG_VIDEO_DEV is not set 1039# CONFIG_VIDEO_DEV is not set
1040CONFIG_VIDEO_V4L2=y
1010 1041
1011# 1042#
1012# Digital Video Broadcasting Devices 1043# Digital Video Broadcasting Devices
@@ -1016,6 +1047,7 @@ CONFIG_LEGACY_PTY_COUNT=256
1016# 1047#
1017# Graphics support 1048# Graphics support
1018# 1049#
1050# CONFIG_FIRMWARE_EDID is not set
1019# CONFIG_FB is not set 1051# CONFIG_FB is not set
1020 1052
1021# 1053#
@@ -1079,6 +1111,19 @@ CONFIG_USB_ARCH_HAS_EHCI=y
1079# CONFIG_RTC_CLASS is not set 1111# CONFIG_RTC_CLASS is not set
1080 1112
1081# 1113#
1114# DMA Engine support
1115#
1116# CONFIG_DMA_ENGINE is not set
1117
1118#
1119# DMA Clients
1120#
1121
1122#
1123# DMA Devices
1124#
1125
1126#
1082# File systems 1127# File systems
1083# 1128#
1084CONFIG_EXT2_FS=y 1129CONFIG_EXT2_FS=y
@@ -1104,7 +1149,6 @@ CONFIG_JFS_SECURITY=y
1104# CONFIG_JFS_STATISTICS is not set 1149# CONFIG_JFS_STATISTICS is not set
1105CONFIG_FS_POSIX_ACL=y 1150CONFIG_FS_POSIX_ACL=y
1106CONFIG_XFS_FS=m 1151CONFIG_XFS_FS=m
1107CONFIG_XFS_EXPORT=y
1108CONFIG_XFS_QUOTA=y 1152CONFIG_XFS_QUOTA=y
1109CONFIG_XFS_SECURITY=y 1153CONFIG_XFS_SECURITY=y
1110CONFIG_XFS_POSIX_ACL=y 1154CONFIG_XFS_POSIX_ACL=y
@@ -1113,6 +1157,7 @@ CONFIG_XFS_POSIX_ACL=y
1113CONFIG_MINIX_FS=m 1157CONFIG_MINIX_FS=m
1114CONFIG_ROMFS_FS=m 1158CONFIG_ROMFS_FS=m
1115CONFIG_INOTIFY=y 1159CONFIG_INOTIFY=y
1160CONFIG_INOTIFY_USER=y
1116CONFIG_QUOTA=y 1161CONFIG_QUOTA=y
1117# CONFIG_QFMT_V1 is not set 1162# CONFIG_QFMT_V1 is not set
1118CONFIG_QFMT_V2=y 1163CONFIG_QFMT_V2=y
@@ -1170,6 +1215,8 @@ CONFIG_VXFS_FS=m
1170# CONFIG_QNX4FS_FS is not set 1215# CONFIG_QNX4FS_FS is not set
1171CONFIG_SYSV_FS=m 1216CONFIG_SYSV_FS=m
1172CONFIG_UFS_FS=m 1217CONFIG_UFS_FS=m
1218# CONFIG_UFS_FS_WRITE is not set
1219# CONFIG_UFS_DEBUG is not set
1173 1220
1174# 1221#
1175# Network File Systems 1222# Network File Systems
@@ -1194,6 +1241,7 @@ CONFIG_SUNRPC=y
1194# CONFIG_RPCSEC_GSS_SPKM3 is not set 1241# CONFIG_RPCSEC_GSS_SPKM3 is not set
1195# CONFIG_SMB_FS is not set 1242# CONFIG_SMB_FS is not set
1196# CONFIG_CIFS is not set 1243# CONFIG_CIFS is not set
1244# CONFIG_CIFS_DEBUG2 is not set
1197# CONFIG_NCP_FS is not set 1245# CONFIG_NCP_FS is not set
1198# CONFIG_CODA_FS is not set 1246# CONFIG_CODA_FS is not set
1199# CONFIG_AFS_FS is not set 1247# CONFIG_AFS_FS is not set
@@ -1259,6 +1307,7 @@ CONFIG_NLS_UTF8=m
1259# 1307#
1260# CONFIG_PRINTK_TIME is not set 1308# CONFIG_PRINTK_TIME is not set
1261# CONFIG_MAGIC_SYSRQ is not set 1309# CONFIG_MAGIC_SYSRQ is not set
1310# CONFIG_UNUSED_SYMBOLS is not set
1262# CONFIG_DEBUG_KERNEL is not set 1311# CONFIG_DEBUG_KERNEL is not set
1263CONFIG_LOG_BUF_SHIFT=14 1312CONFIG_LOG_BUF_SHIFT=14
1264# CONFIG_DEBUG_FS is not set 1313# CONFIG_DEBUG_FS is not set
@@ -1317,3 +1366,10 @@ CONFIG_TEXTSEARCH=y
1317CONFIG_TEXTSEARCH_KMP=m 1366CONFIG_TEXTSEARCH_KMP=m
1318CONFIG_TEXTSEARCH_BM=m 1367CONFIG_TEXTSEARCH_BM=m
1319CONFIG_TEXTSEARCH_FSM=m 1368CONFIG_TEXTSEARCH_FSM=m
1369CONFIG_PLIST=y
1370CONFIG_RIO=n
1371CONFIG_I2C_OCORES=n
1372CONFIG_DEBUG_RT_MUTEXES=n
1373CONFIG_RT_MUTEX_TESTER=n
1374CONFIG_DEBUG_RWSEMS=n
1375CONFIG_DEBUG_LOCKING_API_SELFTESTS=n
diff --git a/arch/mips/configs/bigsur_defconfig b/arch/mips/configs/bigsur_defconfig
index dabf90a94b21..887fd959482a 100644
--- a/arch/mips/configs/bigsur_defconfig
+++ b/arch/mips/configs/bigsur_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:50:55 2006 4# Thu Jul 6 10:02:58 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MIPS=y
45# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -81,6 +84,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
81CONFIG_GENERIC_FIND_NEXT_BIT=y 84CONFIG_GENERIC_FIND_NEXT_BIT=y
82CONFIG_GENERIC_HWEIGHT=y 85CONFIG_GENERIC_HWEIGHT=y
83CONFIG_GENERIC_CALIBRATE_DELAY=y 86CONFIG_GENERIC_CALIBRATE_DELAY=y
87CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
84CONFIG_DMA_COHERENT=y 88CONFIG_DMA_COHERENT=y
85CONFIG_CPU_BIG_ENDIAN=y 89CONFIG_CPU_BIG_ENDIAN=y
86# CONFIG_CPU_LITTLE_ENDIAN is not set 90# CONFIG_CPU_LITTLE_ENDIAN is not set
@@ -128,11 +132,15 @@ CONFIG_PAGE_SIZE_4KB=y
128# CONFIG_PAGE_SIZE_16KB is not set 132# CONFIG_PAGE_SIZE_16KB is not set
129# CONFIG_PAGE_SIZE_64KB is not set 133# CONFIG_PAGE_SIZE_64KB is not set
130# CONFIG_SIBYTE_DMA_PAGEOPS is not set 134# CONFIG_SIBYTE_DMA_PAGEOPS is not set
131# CONFIG_MIPS_MT is not set 135CONFIG_MIPS_MT_DISABLED=y
136# CONFIG_MIPS_MT_SMTC is not set
137# CONFIG_MIPS_MT_SMP is not set
138# CONFIG_MIPS_VPE_LOADER is not set
132CONFIG_CPU_HAS_LLSC=y 139CONFIG_CPU_HAS_LLSC=y
133CONFIG_CPU_HAS_SYNC=y 140CONFIG_CPU_HAS_SYNC=y
134CONFIG_GENERIC_HARDIRQS=y 141CONFIG_GENERIC_HARDIRQS=y
135CONFIG_GENERIC_IRQ_PROBE=y 142CONFIG_GENERIC_IRQ_PROBE=y
143CONFIG_IRQ_PER_CPU=y
136CONFIG_CPU_SUPPORTS_HIGHMEM=y 144CONFIG_CPU_SUPPORTS_HIGHMEM=y
137CONFIG_ARCH_FLATMEM_ENABLE=y 145CONFIG_ARCH_FLATMEM_ENABLE=y
138CONFIG_SELECT_MEMORY_MODEL=y 146CONFIG_SELECT_MEMORY_MODEL=y
@@ -143,6 +151,10 @@ CONFIG_FLATMEM=y
143CONFIG_FLAT_NODE_MEM_MAP=y 151CONFIG_FLAT_NODE_MEM_MAP=y
144# CONFIG_SPARSEMEM_STATIC is not set 152# CONFIG_SPARSEMEM_STATIC is not set
145CONFIG_SPLIT_PTLOCK_CPUS=4 153CONFIG_SPLIT_PTLOCK_CPUS=4
154CONFIG_RESOURCES_64BIT=y
155CONFIG_SMP=y
156CONFIG_SYS_SUPPORTS_SMP=y
157CONFIG_NR_CPUS=4
146# CONFIG_HZ_48 is not set 158# CONFIG_HZ_48 is not set
147# CONFIG_HZ_100 is not set 159# CONFIG_HZ_100 is not set
148# CONFIG_HZ_128 is not set 160# CONFIG_HZ_128 is not set
@@ -152,12 +164,11 @@ CONFIG_HZ_1000=y
152# CONFIG_HZ_1024 is not set 164# CONFIG_HZ_1024 is not set
153CONFIG_SYS_SUPPORTS_ARBIT_HZ=y 165CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
154CONFIG_HZ=1000 166CONFIG_HZ=1000
155CONFIG_SMP=y
156CONFIG_NR_CPUS=4
157CONFIG_PREEMPT_NONE=y 167CONFIG_PREEMPT_NONE=y
158# CONFIG_PREEMPT_VOLUNTARY is not set 168# CONFIG_PREEMPT_VOLUNTARY is not set
159# CONFIG_PREEMPT is not set 169# CONFIG_PREEMPT is not set
160# CONFIG_PREEMPT_BKL is not set 170# CONFIG_PREEMPT_BKL is not set
171CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
161 172
162# 173#
163# Code maturity level options 174# Code maturity level options
@@ -192,10 +203,12 @@ CONFIG_PRINTK=y
192CONFIG_BUG=y 203CONFIG_BUG=y
193CONFIG_ELF_CORE=y 204CONFIG_ELF_CORE=y
194CONFIG_BASE_FULL=y 205CONFIG_BASE_FULL=y
206CONFIG_RT_MUTEXES=y
195CONFIG_FUTEX=y 207CONFIG_FUTEX=y
196CONFIG_EPOLL=y 208CONFIG_EPOLL=y
197CONFIG_SHMEM=y 209CONFIG_SHMEM=y
198CONFIG_SLAB=y 210CONFIG_SLAB=y
211CONFIG_VM_EVENT_COUNTERS=y
199# CONFIG_TINY_SHMEM is not set 212# CONFIG_TINY_SHMEM is not set
200CONFIG_BASE_SMALL=0 213CONFIG_BASE_SMALL=0
201# CONFIG_SLOB is not set 214# CONFIG_SLOB is not set
@@ -253,7 +266,7 @@ CONFIG_MMU=y
253# 266#
254CONFIG_BINFMT_ELF=y 267CONFIG_BINFMT_ELF=y
255# CONFIG_BINFMT_MISC is not set 268# CONFIG_BINFMT_MISC is not set
256CONFIG_BUILD_ELF64=y 269# CONFIG_BUILD_ELF64 is not set
257CONFIG_MIPS32_COMPAT=y 270CONFIG_MIPS32_COMPAT=y
258CONFIG_COMPAT=y 271CONFIG_COMPAT=y
259CONFIG_MIPS32_O32=y 272CONFIG_MIPS32_O32=y
@@ -292,6 +305,8 @@ CONFIG_IP_PNP_BOOTP=y
292# CONFIG_INET_IPCOMP is not set 305# CONFIG_INET_IPCOMP is not set
293# CONFIG_INET_XFRM_TUNNEL is not set 306# CONFIG_INET_XFRM_TUNNEL is not set
294# CONFIG_INET_TUNNEL is not set 307# CONFIG_INET_TUNNEL is not set
308CONFIG_INET_XFRM_MODE_TRANSPORT=m
309CONFIG_INET_XFRM_MODE_TUNNEL=m
295CONFIG_INET_DIAG=y 310CONFIG_INET_DIAG=y
296CONFIG_INET_TCP_DIAG=y 311CONFIG_INET_TCP_DIAG=y
297# CONFIG_TCP_CONG_ADVANCED is not set 312# CONFIG_TCP_CONG_ADVANCED is not set
@@ -299,6 +314,7 @@ CONFIG_TCP_CONG_BIC=y
299# CONFIG_IPV6 is not set 314# CONFIG_IPV6 is not set
300# CONFIG_INET6_XFRM_TUNNEL is not set 315# CONFIG_INET6_XFRM_TUNNEL is not set
301# CONFIG_INET6_TUNNEL is not set 316# CONFIG_INET6_TUNNEL is not set
317CONFIG_NETWORK_SECMARK=y
302# CONFIG_NETFILTER is not set 318# CONFIG_NETFILTER is not set
303 319
304# 320#
@@ -353,6 +369,7 @@ CONFIG_STANDALONE=y
353CONFIG_PREVENT_FIRMWARE_BUILD=y 369CONFIG_PREVENT_FIRMWARE_BUILD=y
354# CONFIG_FW_LOADER is not set 370# CONFIG_FW_LOADER is not set
355# CONFIG_DEBUG_DRIVER is not set 371# CONFIG_DEBUG_DRIVER is not set
372# CONFIG_SYS_HYPERVISOR is not set
356 373
357# 374#
358# Connector - unified userspace <-> kernelspace linker 375# Connector - unified userspace <-> kernelspace linker
@@ -505,6 +522,7 @@ CONFIG_NET_SB1250_MAC=y
505# CONFIG_CHELSIO_T1 is not set 522# CONFIG_CHELSIO_T1 is not set
506# CONFIG_IXGB is not set 523# CONFIG_IXGB is not set
507# CONFIG_S2IO is not set 524# CONFIG_S2IO is not set
525# CONFIG_MYRI10GE is not set
508 526
509# 527#
510# Token Ring devices 528# Token Ring devices
@@ -572,6 +590,7 @@ CONFIG_SERIAL_NONSTANDARD=y
572# CONFIG_N_HDLC is not set 590# CONFIG_N_HDLC is not set
573# CONFIG_SPECIALIX is not set 591# CONFIG_SPECIALIX is not set
574# CONFIG_SX is not set 592# CONFIG_SX is not set
593# CONFIG_RIO is not set
575# CONFIG_STALDRV is not set 594# CONFIG_STALDRV is not set
576CONFIG_SIBYTE_SB1250_DUART=y 595CONFIG_SIBYTE_SB1250_DUART=y
577CONFIG_SIBYTE_SB1250_DUART_CONSOLE=y 596CONFIG_SIBYTE_SB1250_DUART_CONSOLE=y
@@ -598,6 +617,7 @@ CONFIG_LEGACY_PTY_COUNT=256
598# Watchdog Cards 617# Watchdog Cards
599# 618#
600# CONFIG_WATCHDOG is not set 619# CONFIG_WATCHDOG is not set
620# CONFIG_HW_RANDOM is not set
601# CONFIG_RTC is not set 621# CONFIG_RTC is not set
602CONFIG_GEN_RTC=y 622CONFIG_GEN_RTC=y
603# CONFIG_GEN_RTC_X is not set 623# CONFIG_GEN_RTC_X is not set
@@ -643,6 +663,7 @@ CONFIG_I2C_ALGO_SIBYTE=y
643# CONFIG_I2C_I810 is not set 663# CONFIG_I2C_I810 is not set
644# CONFIG_I2C_PIIX4 is not set 664# CONFIG_I2C_PIIX4 is not set
645# CONFIG_I2C_NFORCE2 is not set 665# CONFIG_I2C_NFORCE2 is not set
666# CONFIG_I2C_OCORES is not set
646# CONFIG_I2C_PARPORT_LIGHT is not set 667# CONFIG_I2C_PARPORT_LIGHT is not set
647# CONFIG_I2C_PROSAVAGE is not set 668# CONFIG_I2C_PROSAVAGE is not set
648# CONFIG_I2C_SAVAGE4 is not set 669# CONFIG_I2C_SAVAGE4 is not set
@@ -680,7 +701,6 @@ CONFIG_I2C_DEBUG_CHIP=y
680# 701#
681# Dallas's 1-wire bus 702# Dallas's 1-wire bus
682# 703#
683# CONFIG_W1 is not set
684 704
685# 705#
686# Hardware Monitoring support 706# Hardware Monitoring support
@@ -696,6 +716,7 @@ CONFIG_I2C_DEBUG_CHIP=y
696# Multimedia devices 716# Multimedia devices
697# 717#
698# CONFIG_VIDEO_DEV is not set 718# CONFIG_VIDEO_DEV is not set
719CONFIG_VIDEO_V4L2=y
699 720
700# 721#
701# Digital Video Broadcasting Devices 722# Digital Video Broadcasting Devices
@@ -705,6 +726,7 @@ CONFIG_I2C_DEBUG_CHIP=y
705# 726#
706# Graphics support 727# Graphics support
707# 728#
729# CONFIG_FIRMWARE_EDID is not set
708# CONFIG_FB is not set 730# CONFIG_FB is not set
709 731
710# 732#
@@ -762,6 +784,19 @@ CONFIG_USB_ARCH_HAS_EHCI=y
762# CONFIG_RTC_CLASS is not set 784# CONFIG_RTC_CLASS is not set
763 785
764# 786#
787# DMA Engine support
788#
789# CONFIG_DMA_ENGINE is not set
790
791#
792# DMA Clients
793#
794
795#
796# DMA Devices
797#
798
799#
765# File systems 800# File systems
766# 801#
767CONFIG_EXT2_FS=y 802CONFIG_EXT2_FS=y
@@ -779,6 +814,7 @@ CONFIG_FS_POSIX_ACL=y
779# CONFIG_MINIX_FS is not set 814# CONFIG_MINIX_FS is not set
780# CONFIG_ROMFS_FS is not set 815# CONFIG_ROMFS_FS is not set
781CONFIG_INOTIFY=y 816CONFIG_INOTIFY=y
817CONFIG_INOTIFY_USER=y
782# CONFIG_QUOTA is not set 818# CONFIG_QUOTA is not set
783CONFIG_DNOTIFY=y 819CONFIG_DNOTIFY=y
784# CONFIG_AUTOFS_FS is not set 820# CONFIG_AUTOFS_FS is not set
@@ -844,6 +880,7 @@ CONFIG_SUNRPC=y
844# CONFIG_RPCSEC_GSS_SPKM3 is not set 880# CONFIG_RPCSEC_GSS_SPKM3 is not set
845# CONFIG_SMB_FS is not set 881# CONFIG_SMB_FS is not set
846# CONFIG_CIFS is not set 882# CONFIG_CIFS is not set
883# CONFIG_CIFS_DEBUG2 is not set
847# CONFIG_NCP_FS is not set 884# CONFIG_NCP_FS is not set
848# CONFIG_CODA_FS is not set 885# CONFIG_CODA_FS is not set
849# CONFIG_AFS_FS is not set 886# CONFIG_AFS_FS is not set
@@ -870,14 +907,19 @@ CONFIG_MSDOS_PARTITION=y
870# 907#
871CONFIG_PRINTK_TIME=y 908CONFIG_PRINTK_TIME=y
872CONFIG_MAGIC_SYSRQ=y 909CONFIG_MAGIC_SYSRQ=y
910# CONFIG_UNUSED_SYMBOLS is not set
873CONFIG_DEBUG_KERNEL=y 911CONFIG_DEBUG_KERNEL=y
874CONFIG_LOG_BUF_SHIFT=16 912CONFIG_LOG_BUF_SHIFT=16
875CONFIG_DETECT_SOFTLOCKUP=y 913CONFIG_DETECT_SOFTLOCKUP=y
876# CONFIG_SCHEDSTATS is not set 914# CONFIG_SCHEDSTATS is not set
877# CONFIG_DEBUG_SLAB is not set 915# CONFIG_DEBUG_SLAB is not set
878CONFIG_DEBUG_MUTEXES=y 916# CONFIG_DEBUG_RT_MUTEXES is not set
917# CONFIG_RT_MUTEX_TESTER is not set
879# CONFIG_DEBUG_SPINLOCK is not set 918# CONFIG_DEBUG_SPINLOCK is not set
919CONFIG_DEBUG_MUTEXES=y
920# CONFIG_DEBUG_RWSEMS is not set
880# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 921# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
922# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
881# CONFIG_DEBUG_KOBJECT is not set 923# CONFIG_DEBUG_KOBJECT is not set
882# CONFIG_DEBUG_INFO is not set 924# CONFIG_DEBUG_INFO is not set
883# CONFIG_DEBUG_FS is not set 925# CONFIG_DEBUG_FS is not set
@@ -940,3 +982,4 @@ CONFIG_CRC32=y
940# CONFIG_LIBCRC32C is not set 982# CONFIG_LIBCRC32C is not set
941CONFIG_ZLIB_INFLATE=y 983CONFIG_ZLIB_INFLATE=y
942CONFIG_ZLIB_DEFLATE=y 984CONFIG_ZLIB_DEFLATE=y
985CONFIG_PLIST=y
diff --git a/arch/mips/configs/capcella_defconfig b/arch/mips/configs/capcella_defconfig
index aeb7be804799..a01344f3a4c2 100644
--- a/arch/mips/configs/capcella_defconfig
+++ b/arch/mips/configs/capcella_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Tue Apr 25 00:08:06 2006 4# Thu Jul 6 10:03:24 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MIPS=y
45CONFIG_MACH_VR41XX=y 47CONFIG_MACH_VR41XX=y
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -73,6 +76,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
73CONFIG_GENERIC_FIND_NEXT_BIT=y 76CONFIG_GENERIC_FIND_NEXT_BIT=y
74CONFIG_GENERIC_HWEIGHT=y 77CONFIG_GENERIC_HWEIGHT=y
75CONFIG_GENERIC_CALIBRATE_DELAY=y 78CONFIG_GENERIC_CALIBRATE_DELAY=y
79CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
76CONFIG_DMA_NONCOHERENT=y 80CONFIG_DMA_NONCOHERENT=y
77CONFIG_DMA_NEED_PCI_MAP_STATE=y 81CONFIG_DMA_NEED_PCI_MAP_STATE=y
78# CONFIG_CPU_BIG_ENDIAN is not set 82# CONFIG_CPU_BIG_ENDIAN is not set
@@ -117,7 +121,10 @@ CONFIG_PAGE_SIZE_4KB=y
117# CONFIG_PAGE_SIZE_8KB is not set 121# CONFIG_PAGE_SIZE_8KB is not set
118# CONFIG_PAGE_SIZE_16KB is not set 122# CONFIG_PAGE_SIZE_16KB is not set
119# CONFIG_PAGE_SIZE_64KB is not set 123# CONFIG_PAGE_SIZE_64KB is not set
120# CONFIG_MIPS_MT is not set 124CONFIG_MIPS_MT_DISABLED=y
125# CONFIG_MIPS_MT_SMTC is not set
126# CONFIG_MIPS_MT_SMP is not set
127# CONFIG_MIPS_VPE_LOADER is not set
121CONFIG_CPU_HAS_SYNC=y 128CONFIG_CPU_HAS_SYNC=y
122CONFIG_GENERIC_HARDIRQS=y 129CONFIG_GENERIC_HARDIRQS=y
123CONFIG_GENERIC_IRQ_PROBE=y 130CONFIG_GENERIC_IRQ_PROBE=y
@@ -130,6 +137,7 @@ CONFIG_FLATMEM=y
130CONFIG_FLAT_NODE_MEM_MAP=y 137CONFIG_FLAT_NODE_MEM_MAP=y
131# CONFIG_SPARSEMEM_STATIC is not set 138# CONFIG_SPARSEMEM_STATIC is not set
132CONFIG_SPLIT_PTLOCK_CPUS=4 139CONFIG_SPLIT_PTLOCK_CPUS=4
140# CONFIG_RESOURCES_64BIT is not set
133# CONFIG_HZ_48 is not set 141# CONFIG_HZ_48 is not set
134# CONFIG_HZ_100 is not set 142# CONFIG_HZ_100 is not set
135# CONFIG_HZ_128 is not set 143# CONFIG_HZ_128 is not set
@@ -142,6 +150,7 @@ CONFIG_HZ=1000
142CONFIG_PREEMPT_NONE=y 150CONFIG_PREEMPT_NONE=y
143# CONFIG_PREEMPT_VOLUNTARY is not set 151# CONFIG_PREEMPT_VOLUNTARY is not set
144# CONFIG_PREEMPT is not set 152# CONFIG_PREEMPT is not set
153CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
145 154
146# 155#
147# Code maturity level options 156# Code maturity level options
@@ -173,10 +182,12 @@ CONFIG_PRINTK=y
173CONFIG_BUG=y 182CONFIG_BUG=y
174CONFIG_ELF_CORE=y 183CONFIG_ELF_CORE=y
175CONFIG_BASE_FULL=y 184CONFIG_BASE_FULL=y
185CONFIG_RT_MUTEXES=y
176CONFIG_FUTEX=y 186CONFIG_FUTEX=y
177CONFIG_EPOLL=y 187CONFIG_EPOLL=y
178CONFIG_SHMEM=y 188CONFIG_SHMEM=y
179CONFIG_SLAB=y 189CONFIG_SLAB=y
190CONFIG_VM_EVENT_COUNTERS=y
180# CONFIG_TINY_SHMEM is not set 191# CONFIG_TINY_SHMEM is not set
181CONFIG_BASE_SMALL=0 192CONFIG_BASE_SMALL=0
182# CONFIG_SLOB is not set 193# CONFIG_SLOB is not set
@@ -268,6 +279,8 @@ CONFIG_IP_PNP_BOOTP=y
268# CONFIG_INET_IPCOMP is not set 279# CONFIG_INET_IPCOMP is not set
269# CONFIG_INET_XFRM_TUNNEL is not set 280# CONFIG_INET_XFRM_TUNNEL is not set
270# CONFIG_INET_TUNNEL is not set 281# CONFIG_INET_TUNNEL is not set
282CONFIG_INET_XFRM_MODE_TRANSPORT=m
283CONFIG_INET_XFRM_MODE_TUNNEL=m
271CONFIG_INET_DIAG=y 284CONFIG_INET_DIAG=y
272CONFIG_INET_TCP_DIAG=y 285CONFIG_INET_TCP_DIAG=y
273# CONFIG_TCP_CONG_ADVANCED is not set 286# CONFIG_TCP_CONG_ADVANCED is not set
@@ -275,6 +288,7 @@ CONFIG_TCP_CONG_BIC=y
275# CONFIG_IPV6 is not set 288# CONFIG_IPV6 is not set
276# CONFIG_INET6_XFRM_TUNNEL is not set 289# CONFIG_INET6_XFRM_TUNNEL is not set
277# CONFIG_INET6_TUNNEL is not set 290# CONFIG_INET6_TUNNEL is not set
291CONFIG_NETWORK_SECMARK=y
278# CONFIG_NETFILTER is not set 292# CONFIG_NETFILTER is not set
279 293
280# 294#
@@ -328,6 +342,7 @@ CONFIG_TCP_CONG_BIC=y
328CONFIG_STANDALONE=y 342CONFIG_STANDALONE=y
329CONFIG_PREVENT_FIRMWARE_BUILD=y 343CONFIG_PREVENT_FIRMWARE_BUILD=y
330CONFIG_FW_LOADER=m 344CONFIG_FW_LOADER=m
345# CONFIG_SYS_HYPERVISOR is not set
331 346
332# 347#
333# Connector - unified userspace <-> kernelspace linker 348# Connector - unified userspace <-> kernelspace linker
@@ -446,6 +461,8 @@ CONFIG_DAVICOM_PHY=m
446CONFIG_QSEMI_PHY=m 461CONFIG_QSEMI_PHY=m
447CONFIG_LXT_PHY=m 462CONFIG_LXT_PHY=m
448CONFIG_CICADA_PHY=m 463CONFIG_CICADA_PHY=m
464CONFIG_VITESSE_PHY=m
465CONFIG_SMSC_PHY=m
449 466
450# 467#
451# Ethernet (10 or 100Mbit) 468# Ethernet (10 or 100Mbit)
@@ -512,6 +529,7 @@ CONFIG_8139TOO_PIO=y
512# CONFIG_CHELSIO_T1 is not set 529# CONFIG_CHELSIO_T1 is not set
513# CONFIG_IXGB is not set 530# CONFIG_IXGB is not set
514# CONFIG_S2IO is not set 531# CONFIG_S2IO is not set
532# CONFIG_MYRI10GE is not set
515 533
516# 534#
517# Token Ring devices 535# Token Ring devices
@@ -581,6 +599,7 @@ CONFIG_INPUT=y
581CONFIG_VT=y 599CONFIG_VT=y
582CONFIG_VT_CONSOLE=y 600CONFIG_VT_CONSOLE=y
583CONFIG_HW_CONSOLE=y 601CONFIG_HW_CONSOLE=y
602CONFIG_VT_HW_CONSOLE_BINDING=y
584# CONFIG_SERIAL_NONSTANDARD is not set 603# CONFIG_SERIAL_NONSTANDARD is not set
585 604
586# 605#
@@ -609,6 +628,7 @@ CONFIG_LEGACY_PTY_COUNT=256
609# Watchdog Cards 628# Watchdog Cards
610# 629#
611# CONFIG_WATCHDOG is not set 630# CONFIG_WATCHDOG is not set
631# CONFIG_HW_RANDOM is not set
612# CONFIG_RTC is not set 632# CONFIG_RTC is not set
613# CONFIG_GEN_RTC is not set 633# CONFIG_GEN_RTC is not set
614# CONFIG_DTLK is not set 634# CONFIG_DTLK is not set
@@ -658,6 +678,7 @@ CONFIG_GPIO_VR41XX=y
658# Multimedia devices 678# Multimedia devices
659# 679#
660# CONFIG_VIDEO_DEV is not set 680# CONFIG_VIDEO_DEV is not set
681CONFIG_VIDEO_V4L2=y
661 682
662# 683#
663# Digital Video Broadcasting Devices 684# Digital Video Broadcasting Devices
@@ -667,6 +688,7 @@ CONFIG_GPIO_VR41XX=y
667# 688#
668# Graphics support 689# Graphics support
669# 690#
691# CONFIG_FIRMWARE_EDID is not set
670# CONFIG_FB is not set 692# CONFIG_FB is not set
671 693
672# 694#
@@ -738,13 +760,30 @@ CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
738CONFIG_RTC_INTF_SYSFS=y 760CONFIG_RTC_INTF_SYSFS=y
739CONFIG_RTC_INTF_PROC=y 761CONFIG_RTC_INTF_PROC=y
740CONFIG_RTC_INTF_DEV=y 762CONFIG_RTC_INTF_DEV=y
763# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
741 764
742# 765#
743# RTC drivers 766# RTC drivers
744# 767#
768# CONFIG_RTC_DRV_DS1553 is not set
769# CONFIG_RTC_DRV_DS1742 is not set
745# CONFIG_RTC_DRV_M48T86 is not set 770# CONFIG_RTC_DRV_M48T86 is not set
746CONFIG_RTC_DRV_VR41XX=y 771CONFIG_RTC_DRV_VR41XX=y
747# CONFIG_RTC_DRV_TEST is not set 772# CONFIG_RTC_DRV_TEST is not set
773# CONFIG_RTC_DRV_V3020 is not set
774
775#
776# DMA Engine support
777#
778# CONFIG_DMA_ENGINE is not set
779
780#
781# DMA Clients
782#
783
784#
785# DMA Devices
786#
748 787
749# 788#
750# File systems 789# File systems
@@ -761,6 +800,7 @@ CONFIG_EXT2_FS=y
761# CONFIG_MINIX_FS is not set 800# CONFIG_MINIX_FS is not set
762# CONFIG_ROMFS_FS is not set 801# CONFIG_ROMFS_FS is not set
763CONFIG_INOTIFY=y 802CONFIG_INOTIFY=y
803CONFIG_INOTIFY_USER=y
764# CONFIG_QUOTA is not set 804# CONFIG_QUOTA is not set
765CONFIG_DNOTIFY=y 805CONFIG_DNOTIFY=y
766# CONFIG_AUTOFS_FS is not set 806# CONFIG_AUTOFS_FS is not set
@@ -827,6 +867,7 @@ CONFIG_SUNRPC=y
827# CONFIG_RPCSEC_GSS_SPKM3 is not set 867# CONFIG_RPCSEC_GSS_SPKM3 is not set
828# CONFIG_SMB_FS is not set 868# CONFIG_SMB_FS is not set
829# CONFIG_CIFS is not set 869# CONFIG_CIFS is not set
870# CONFIG_CIFS_DEBUG2 is not set
830# CONFIG_NCP_FS is not set 871# CONFIG_NCP_FS is not set
831# CONFIG_CODA_FS is not set 872# CONFIG_CODA_FS is not set
832# CONFIG_AFS_FS is not set 873# CONFIG_AFS_FS is not set
@@ -853,6 +894,7 @@ CONFIG_MSDOS_PARTITION=y
853# 894#
854# CONFIG_PRINTK_TIME is not set 895# CONFIG_PRINTK_TIME is not set
855# CONFIG_MAGIC_SYSRQ is not set 896# CONFIG_MAGIC_SYSRQ is not set
897# CONFIG_UNUSED_SYMBOLS is not set
856# CONFIG_DEBUG_KERNEL is not set 898# CONFIG_DEBUG_KERNEL is not set
857CONFIG_LOG_BUF_SHIFT=14 899CONFIG_LOG_BUF_SHIFT=14
858# CONFIG_DEBUG_FS is not set 900# CONFIG_DEBUG_FS is not set
@@ -881,3 +923,4 @@ CONFIG_CMDLINE="mem=32M console=ttyVR0,38400"
881# CONFIG_CRC16 is not set 923# CONFIG_CRC16 is not set
882CONFIG_CRC32=y 924CONFIG_CRC32=y
883# CONFIG_LIBCRC32C is not set 925# CONFIG_LIBCRC32C is not set
926CONFIG_PLIST=y
diff --git a/arch/mips/configs/cobalt_defconfig b/arch/mips/configs/cobalt_defconfig
index d680d3e17112..c95682445a28 100644
--- a/arch/mips/configs/cobalt_defconfig
+++ b/arch/mips/configs/cobalt_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:50:57 2006 4# Thu Jul 6 10:03:25 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24CONFIG_MIPS_COBALT=y 25CONFIG_MIPS_COBALT=y
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS_COBALT=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MIPS_COBALT=y
45# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -66,6 +69,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
66CONFIG_GENERIC_FIND_NEXT_BIT=y 69CONFIG_GENERIC_FIND_NEXT_BIT=y
67CONFIG_GENERIC_HWEIGHT=y 70CONFIG_GENERIC_HWEIGHT=y
68CONFIG_GENERIC_CALIBRATE_DELAY=y 71CONFIG_GENERIC_CALIBRATE_DELAY=y
72CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
69CONFIG_DMA_NONCOHERENT=y 73CONFIG_DMA_NONCOHERENT=y
70CONFIG_DMA_NEED_PCI_MAP_STATE=y 74CONFIG_DMA_NEED_PCI_MAP_STATE=y
71CONFIG_I8259=y 75CONFIG_I8259=y
@@ -113,7 +117,10 @@ CONFIG_PAGE_SIZE_4KB=y
113# CONFIG_PAGE_SIZE_8KB is not set 117# CONFIG_PAGE_SIZE_8KB is not set
114# CONFIG_PAGE_SIZE_16KB is not set 118# CONFIG_PAGE_SIZE_16KB is not set
115# CONFIG_PAGE_SIZE_64KB is not set 119# CONFIG_PAGE_SIZE_64KB is not set
116# CONFIG_MIPS_MT is not set 120CONFIG_MIPS_MT_DISABLED=y
121# CONFIG_MIPS_MT_SMTC is not set
122# CONFIG_MIPS_MT_SMP is not set
123# CONFIG_MIPS_VPE_LOADER is not set
117CONFIG_CPU_HAS_LLSC=y 124CONFIG_CPU_HAS_LLSC=y
118CONFIG_CPU_HAS_SYNC=y 125CONFIG_CPU_HAS_SYNC=y
119CONFIG_GENERIC_HARDIRQS=y 126CONFIG_GENERIC_HARDIRQS=y
@@ -127,6 +134,7 @@ CONFIG_FLATMEM=y
127CONFIG_FLAT_NODE_MEM_MAP=y 134CONFIG_FLAT_NODE_MEM_MAP=y
128# CONFIG_SPARSEMEM_STATIC is not set 135# CONFIG_SPARSEMEM_STATIC is not set
129CONFIG_SPLIT_PTLOCK_CPUS=4 136CONFIG_SPLIT_PTLOCK_CPUS=4
137# CONFIG_RESOURCES_64BIT is not set
130# CONFIG_HZ_48 is not set 138# CONFIG_HZ_48 is not set
131# CONFIG_HZ_100 is not set 139# CONFIG_HZ_100 is not set
132# CONFIG_HZ_128 is not set 140# CONFIG_HZ_128 is not set
@@ -139,6 +147,7 @@ CONFIG_HZ=1000
139CONFIG_PREEMPT_NONE=y 147CONFIG_PREEMPT_NONE=y
140# CONFIG_PREEMPT_VOLUNTARY is not set 148# CONFIG_PREEMPT_VOLUNTARY is not set
141# CONFIG_PREEMPT is not set 149# CONFIG_PREEMPT is not set
150CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
142 151
143# 152#
144# Code maturity level options 153# Code maturity level options
@@ -170,10 +179,12 @@ CONFIG_PRINTK=y
170CONFIG_BUG=y 179CONFIG_BUG=y
171CONFIG_ELF_CORE=y 180CONFIG_ELF_CORE=y
172CONFIG_BASE_FULL=y 181CONFIG_BASE_FULL=y
182CONFIG_RT_MUTEXES=y
173CONFIG_FUTEX=y 183CONFIG_FUTEX=y
174CONFIG_EPOLL=y 184CONFIG_EPOLL=y
175CONFIG_SHMEM=y 185CONFIG_SHMEM=y
176CONFIG_SLAB=y 186CONFIG_SLAB=y
187CONFIG_VM_EVENT_COUNTERS=y
177# CONFIG_TINY_SHMEM is not set 188# CONFIG_TINY_SHMEM is not set
178CONFIG_BASE_SMALL=0 189CONFIG_BASE_SMALL=0
179# CONFIG_SLOB is not set 190# CONFIG_SLOB is not set
@@ -256,6 +267,8 @@ CONFIG_IP_FIB_HASH=y
256# CONFIG_INET_IPCOMP is not set 267# CONFIG_INET_IPCOMP is not set
257# CONFIG_INET_XFRM_TUNNEL is not set 268# CONFIG_INET_XFRM_TUNNEL is not set
258# CONFIG_INET_TUNNEL is not set 269# CONFIG_INET_TUNNEL is not set
270CONFIG_INET_XFRM_MODE_TRANSPORT=y
271CONFIG_INET_XFRM_MODE_TUNNEL=y
259CONFIG_INET_DIAG=y 272CONFIG_INET_DIAG=y
260CONFIG_INET_TCP_DIAG=y 273CONFIG_INET_TCP_DIAG=y
261# CONFIG_TCP_CONG_ADVANCED is not set 274# CONFIG_TCP_CONG_ADVANCED is not set
@@ -263,6 +276,7 @@ CONFIG_TCP_CONG_BIC=y
263# CONFIG_IPV6 is not set 276# CONFIG_IPV6 is not set
264# CONFIG_INET6_XFRM_TUNNEL is not set 277# CONFIG_INET6_XFRM_TUNNEL is not set
265# CONFIG_INET6_TUNNEL is not set 278# CONFIG_INET6_TUNNEL is not set
279CONFIG_NETWORK_SECMARK=y
266# CONFIG_NETFILTER is not set 280# CONFIG_NETFILTER is not set
267 281
268# 282#
@@ -322,6 +336,7 @@ CONFIG_WIRELESS_EXT=y
322CONFIG_STANDALONE=y 336CONFIG_STANDALONE=y
323CONFIG_PREVENT_FIRMWARE_BUILD=y 337CONFIG_PREVENT_FIRMWARE_BUILD=y
324CONFIG_FW_LOADER=y 338CONFIG_FW_LOADER=y
339# CONFIG_SYS_HYPERVISOR is not set
325 340
326# 341#
327# Connector - unified userspace <-> kernelspace linker 342# Connector - unified userspace <-> kernelspace linker
@@ -471,6 +486,8 @@ CONFIG_DAVICOM_PHY=y
471CONFIG_QSEMI_PHY=y 486CONFIG_QSEMI_PHY=y
472CONFIG_LXT_PHY=y 487CONFIG_LXT_PHY=y
473CONFIG_CICADA_PHY=y 488CONFIG_CICADA_PHY=y
489CONFIG_VITESSE_PHY=y
490CONFIG_SMSC_PHY=y
474 491
475# 492#
476# Ethernet (10 or 100Mbit) 493# Ethernet (10 or 100Mbit)
@@ -522,6 +539,7 @@ CONFIG_TULIP=y
522# CONFIG_CHELSIO_T1 is not set 539# CONFIG_CHELSIO_T1 is not set
523# CONFIG_IXGB is not set 540# CONFIG_IXGB is not set
524# CONFIG_S2IO is not set 541# CONFIG_S2IO is not set
542# CONFIG_MYRI10GE is not set
525 543
526# 544#
527# Token Ring devices 545# Token Ring devices
@@ -599,6 +617,7 @@ CONFIG_SERIO_RAW=y
599CONFIG_VT=y 617CONFIG_VT=y
600CONFIG_VT_CONSOLE=y 618CONFIG_VT_CONSOLE=y
601CONFIG_HW_CONSOLE=y 619CONFIG_HW_CONSOLE=y
620CONFIG_VT_HW_CONSOLE_BINDING=y
602# CONFIG_SERIAL_NONSTANDARD is not set 621# CONFIG_SERIAL_NONSTANDARD is not set
603 622
604# 623#
@@ -630,6 +649,7 @@ CONFIG_LEGACY_PTY_COUNT=256
630# Watchdog Cards 649# Watchdog Cards
631# 650#
632# CONFIG_WATCHDOG is not set 651# CONFIG_WATCHDOG is not set
652# CONFIG_HW_RANDOM is not set
633CONFIG_RTC=y 653CONFIG_RTC=y
634CONFIG_COBALT_LCD=y 654CONFIG_COBALT_LCD=y
635# CONFIG_DTLK is not set 655# CONFIG_DTLK is not set
@@ -678,6 +698,7 @@ CONFIG_COBALT_LCD=y
678# Multimedia devices 698# Multimedia devices
679# 699#
680# CONFIG_VIDEO_DEV is not set 700# CONFIG_VIDEO_DEV is not set
701CONFIG_VIDEO_V4L2=y
681 702
682# 703#
683# Digital Video Broadcasting Devices 704# Digital Video Broadcasting Devices
@@ -687,6 +708,7 @@ CONFIG_COBALT_LCD=y
687# 708#
688# Graphics support 709# Graphics support
689# 710#
711# CONFIG_FIRMWARE_EDID is not set
690# CONFIG_FB is not set 712# CONFIG_FB is not set
691 713
692# 714#
@@ -750,6 +772,19 @@ CONFIG_USB_ARCH_HAS_EHCI=y
750# CONFIG_RTC_CLASS is not set 772# CONFIG_RTC_CLASS is not set
751 773
752# 774#
775# DMA Engine support
776#
777# CONFIG_DMA_ENGINE is not set
778
779#
780# DMA Clients
781#
782
783#
784# DMA Devices
785#
786
787#
753# File systems 788# File systems
754# 789#
755CONFIG_EXT2_FS=y 790CONFIG_EXT2_FS=y
@@ -767,6 +802,7 @@ CONFIG_FS_POSIX_ACL=y
767# CONFIG_MINIX_FS is not set 802# CONFIG_MINIX_FS is not set
768# CONFIG_ROMFS_FS is not set 803# CONFIG_ROMFS_FS is not set
769CONFIG_INOTIFY=y 804CONFIG_INOTIFY=y
805CONFIG_INOTIFY_USER=y
770# CONFIG_QUOTA is not set 806# CONFIG_QUOTA is not set
771CONFIG_DNOTIFY=y 807CONFIG_DNOTIFY=y
772# CONFIG_AUTOFS_FS is not set 808# CONFIG_AUTOFS_FS is not set
@@ -829,6 +865,7 @@ CONFIG_SUNRPC=y
829# CONFIG_RPCSEC_GSS_SPKM3 is not set 865# CONFIG_RPCSEC_GSS_SPKM3 is not set
830# CONFIG_SMB_FS is not set 866# CONFIG_SMB_FS is not set
831# CONFIG_CIFS is not set 867# CONFIG_CIFS is not set
868# CONFIG_CIFS_DEBUG2 is not set
832# CONFIG_NCP_FS is not set 869# CONFIG_NCP_FS is not set
833# CONFIG_CODA_FS is not set 870# CONFIG_CODA_FS is not set
834# CONFIG_AFS_FS is not set 871# CONFIG_AFS_FS is not set
@@ -855,6 +892,7 @@ CONFIG_MSDOS_PARTITION=y
855# 892#
856# CONFIG_PRINTK_TIME is not set 893# CONFIG_PRINTK_TIME is not set
857# CONFIG_MAGIC_SYSRQ is not set 894# CONFIG_MAGIC_SYSRQ is not set
895# CONFIG_UNUSED_SYMBOLS is not set
858# CONFIG_DEBUG_KERNEL is not set 896# CONFIG_DEBUG_KERNEL is not set
859CONFIG_LOG_BUF_SHIFT=14 897CONFIG_LOG_BUF_SHIFT=14
860# CONFIG_DEBUG_FS is not set 898# CONFIG_DEBUG_FS is not set
@@ -896,7 +934,6 @@ CONFIG_CRYPTO_ANUBIS=y
896CONFIG_CRYPTO_DEFLATE=y 934CONFIG_CRYPTO_DEFLATE=y
897CONFIG_CRYPTO_MICHAEL_MIC=y 935CONFIG_CRYPTO_MICHAEL_MIC=y
898CONFIG_CRYPTO_CRC32C=y 936CONFIG_CRYPTO_CRC32C=y
899# CONFIG_CRYPTO_TEST is not set
900 937
901# 938#
902# Hardware crypto devices 939# Hardware crypto devices
@@ -911,3 +948,4 @@ CONFIG_CRC32=y
911CONFIG_LIBCRC32C=y 948CONFIG_LIBCRC32C=y
912CONFIG_ZLIB_INFLATE=y 949CONFIG_ZLIB_INFLATE=y
913CONFIG_ZLIB_DEFLATE=y 950CONFIG_ZLIB_DEFLATE=y
951CONFIG_PLIST=y
diff --git a/arch/mips/configs/db1000_defconfig b/arch/mips/configs/db1000_defconfig
index 6a7aa401462f..c2f33d3af62c 100644
--- a/arch/mips/configs/db1000_defconfig
+++ b/arch/mips/configs/db1000_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:50:57 2006 4# Thu Jul 6 10:03:33 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS_DB1000=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS_DB1000=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MIPS_DB1000=y
45# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -65,6 +68,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
65CONFIG_GENERIC_FIND_NEXT_BIT=y 68CONFIG_GENERIC_FIND_NEXT_BIT=y
66CONFIG_GENERIC_HWEIGHT=y 69CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 70CONFIG_GENERIC_CALIBRATE_DELAY=y
71CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
68CONFIG_DMA_NONCOHERENT=y 72CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 73CONFIG_DMA_NEED_PCI_MAP_STATE=y
70# CONFIG_CPU_BIG_ENDIAN is not set 74# CONFIG_CPU_BIG_ENDIAN is not set
@@ -112,7 +116,10 @@ CONFIG_PAGE_SIZE_4KB=y
112# CONFIG_PAGE_SIZE_16KB is not set 116# CONFIG_PAGE_SIZE_16KB is not set
113# CONFIG_PAGE_SIZE_64KB is not set 117# CONFIG_PAGE_SIZE_64KB is not set
114CONFIG_CPU_HAS_PREFETCH=y 118CONFIG_CPU_HAS_PREFETCH=y
115# CONFIG_MIPS_MT is not set 119CONFIG_MIPS_MT_DISABLED=y
120# CONFIG_MIPS_MT_SMTC is not set
121# CONFIG_MIPS_MT_SMP is not set
122# CONFIG_MIPS_VPE_LOADER is not set
116CONFIG_64BIT_PHYS_ADDR=y 123CONFIG_64BIT_PHYS_ADDR=y
117CONFIG_CPU_HAS_LLSC=y 124CONFIG_CPU_HAS_LLSC=y
118CONFIG_CPU_HAS_SYNC=y 125CONFIG_CPU_HAS_SYNC=y
@@ -128,6 +135,7 @@ CONFIG_FLATMEM=y
128CONFIG_FLAT_NODE_MEM_MAP=y 135CONFIG_FLAT_NODE_MEM_MAP=y
129# CONFIG_SPARSEMEM_STATIC is not set 136# CONFIG_SPARSEMEM_STATIC is not set
130CONFIG_SPLIT_PTLOCK_CPUS=4 137CONFIG_SPLIT_PTLOCK_CPUS=4
138# CONFIG_RESOURCES_64BIT is not set
131# CONFIG_HZ_48 is not set 139# CONFIG_HZ_48 is not set
132# CONFIG_HZ_100 is not set 140# CONFIG_HZ_100 is not set
133# CONFIG_HZ_128 is not set 141# CONFIG_HZ_128 is not set
@@ -140,6 +148,7 @@ CONFIG_HZ=1000
140CONFIG_PREEMPT_NONE=y 148CONFIG_PREEMPT_NONE=y
141# CONFIG_PREEMPT_VOLUNTARY is not set 149# CONFIG_PREEMPT_VOLUNTARY is not set
142# CONFIG_PREEMPT is not set 150# CONFIG_PREEMPT is not set
151CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
143 152
144# 153#
145# Code maturity level options 154# Code maturity level options
@@ -171,14 +180,15 @@ CONFIG_PRINTK=y
171CONFIG_BUG=y 180CONFIG_BUG=y
172CONFIG_ELF_CORE=y 181CONFIG_ELF_CORE=y
173CONFIG_BASE_FULL=y 182CONFIG_BASE_FULL=y
183CONFIG_RT_MUTEXES=y
174CONFIG_FUTEX=y 184CONFIG_FUTEX=y
175CONFIG_EPOLL=y 185CONFIG_EPOLL=y
176CONFIG_SHMEM=y 186CONFIG_SHMEM=y
177CONFIG_SLAB=y 187CONFIG_SLAB=y
188CONFIG_VM_EVENT_COUNTERS=y
178# CONFIG_TINY_SHMEM is not set 189# CONFIG_TINY_SHMEM is not set
179CONFIG_BASE_SMALL=0 190CONFIG_BASE_SMALL=0
180# CONFIG_SLOB is not set 191# CONFIG_SLOB is not set
181CONFIG_OBSOLETE_INTERMODULE=y
182 192
183# 193#
184# Loadable module support 194# Loadable module support
@@ -276,6 +286,8 @@ CONFIG_IP_PNP_BOOTP=y
276# CONFIG_INET_IPCOMP is not set 286# CONFIG_INET_IPCOMP is not set
277# CONFIG_INET_XFRM_TUNNEL is not set 287# CONFIG_INET_XFRM_TUNNEL is not set
278# CONFIG_INET_TUNNEL is not set 288# CONFIG_INET_TUNNEL is not set
289CONFIG_INET_XFRM_MODE_TRANSPORT=m
290CONFIG_INET_XFRM_MODE_TUNNEL=m
279CONFIG_INET_DIAG=y 291CONFIG_INET_DIAG=y
280CONFIG_INET_TCP_DIAG=y 292CONFIG_INET_TCP_DIAG=y
281# CONFIG_TCP_CONG_ADVANCED is not set 293# CONFIG_TCP_CONG_ADVANCED is not set
@@ -288,6 +300,7 @@ CONFIG_TCP_CONG_BIC=y
288# CONFIG_IPV6 is not set 300# CONFIG_IPV6 is not set
289# CONFIG_INET6_XFRM_TUNNEL is not set 301# CONFIG_INET6_XFRM_TUNNEL is not set
290# CONFIG_INET6_TUNNEL is not set 302# CONFIG_INET6_TUNNEL is not set
303CONFIG_NETWORK_SECMARK=y
291CONFIG_NETFILTER=y 304CONFIG_NETFILTER=y
292# CONFIG_NETFILTER_DEBUG is not set 305# CONFIG_NETFILTER_DEBUG is not set
293 306
@@ -302,6 +315,7 @@ CONFIG_NETFILTER_XTABLES=m
302CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m 315CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
303CONFIG_NETFILTER_XT_TARGET_MARK=m 316CONFIG_NETFILTER_XT_TARGET_MARK=m
304CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m 317CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
318CONFIG_NETFILTER_XT_TARGET_SECMARK=m
305CONFIG_NETFILTER_XT_MATCH_COMMENT=m 319CONFIG_NETFILTER_XT_MATCH_COMMENT=m
306CONFIG_NETFILTER_XT_MATCH_DCCP=m 320CONFIG_NETFILTER_XT_MATCH_DCCP=m
307CONFIG_NETFILTER_XT_MATCH_ESP=m 321CONFIG_NETFILTER_XT_MATCH_ESP=m
@@ -312,8 +326,10 @@ CONFIG_NETFILTER_XT_MATCH_MARK=m
312CONFIG_NETFILTER_XT_MATCH_POLICY=m 326CONFIG_NETFILTER_XT_MATCH_POLICY=m
313CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m 327CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
314CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 328CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
329CONFIG_NETFILTER_XT_MATCH_QUOTA=m
315CONFIG_NETFILTER_XT_MATCH_REALM=m 330CONFIG_NETFILTER_XT_MATCH_REALM=m
316CONFIG_NETFILTER_XT_MATCH_SCTP=m 331CONFIG_NETFILTER_XT_MATCH_SCTP=m
332CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
317CONFIG_NETFILTER_XT_MATCH_STRING=m 333CONFIG_NETFILTER_XT_MATCH_STRING=m
318CONFIG_NETFILTER_XT_MATCH_TCPMSS=m 334CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
319 335
@@ -383,6 +399,7 @@ CONFIG_WIRELESS_EXT=y
383CONFIG_STANDALONE=y 399CONFIG_STANDALONE=y
384CONFIG_PREVENT_FIRMWARE_BUILD=y 400CONFIG_PREVENT_FIRMWARE_BUILD=y
385CONFIG_FW_LOADER=m 401CONFIG_FW_LOADER=m
402# CONFIG_SYS_HYPERVISOR is not set
386 403
387# 404#
388# Connector - unified userspace <-> kernelspace linker 405# Connector - unified userspace <-> kernelspace linker
@@ -532,7 +549,7 @@ CONFIG_NETDEVICES=y
532# 549#
533# PHY device support 550# PHY device support
534# 551#
535CONFIG_PHYLIB=m 552CONFIG_PHYLIB=y
536 553
537# 554#
538# MII PHY device drivers 555# MII PHY device drivers
@@ -542,6 +559,8 @@ CONFIG_DAVICOM_PHY=m
542CONFIG_QSEMI_PHY=m 559CONFIG_QSEMI_PHY=m
543CONFIG_LXT_PHY=m 560CONFIG_LXT_PHY=m
544CONFIG_CICADA_PHY=m 561CONFIG_CICADA_PHY=m
562CONFIG_VITESSE_PHY=m
563CONFIG_SMSC_PHY=m
545 564
546# 565#
547# Ethernet (10 or 100Mbit) 566# Ethernet (10 or 100Mbit)
@@ -653,6 +672,7 @@ CONFIG_SERIO_RAW=m
653CONFIG_VT=y 672CONFIG_VT=y
654CONFIG_VT_CONSOLE=y 673CONFIG_VT_CONSOLE=y
655CONFIG_HW_CONSOLE=y 674CONFIG_HW_CONSOLE=y
675CONFIG_VT_HW_CONSOLE_BINDING=y
656# CONFIG_SERIAL_NONSTANDARD is not set 676# CONFIG_SERIAL_NONSTANDARD is not set
657# CONFIG_AU1X00_GPIO is not set 677# CONFIG_AU1X00_GPIO is not set
658# CONFIG_TS_AU1X00_ADS7846 is not set 678# CONFIG_TS_AU1X00_ADS7846 is not set
@@ -686,6 +706,7 @@ CONFIG_LEGACY_PTY_COUNT=256
686# Watchdog Cards 706# Watchdog Cards
687# 707#
688# CONFIG_WATCHDOG is not set 708# CONFIG_WATCHDOG is not set
709# CONFIG_HW_RANDOM is not set
689# CONFIG_RTC is not set 710# CONFIG_RTC is not set
690# CONFIG_GEN_RTC is not set 711# CONFIG_GEN_RTC is not set
691# CONFIG_DTLK is not set 712# CONFIG_DTLK is not set
@@ -739,6 +760,7 @@ CONFIG_SYNCLINK_CS=m
739# Multimedia devices 760# Multimedia devices
740# 761#
741# CONFIG_VIDEO_DEV is not set 762# CONFIG_VIDEO_DEV is not set
763CONFIG_VIDEO_V4L2=y
742 764
743# 765#
744# Digital Video Broadcasting Devices 766# Digital Video Broadcasting Devices
@@ -748,6 +770,7 @@ CONFIG_SYNCLINK_CS=m
748# 770#
749# Graphics support 771# Graphics support
750# 772#
773# CONFIG_FIRMWARE_EDID is not set
751# CONFIG_FB is not set 774# CONFIG_FB is not set
752 775
753# 776#
@@ -810,6 +833,19 @@ CONFIG_USB_ARCH_HAS_OHCI=y
810# CONFIG_RTC_CLASS is not set 833# CONFIG_RTC_CLASS is not set
811 834
812# 835#
836# DMA Engine support
837#
838# CONFIG_DMA_ENGINE is not set
839
840#
841# DMA Clients
842#
843
844#
845# DMA Devices
846#
847
848#
813# File systems 849# File systems
814# 850#
815CONFIG_EXT2_FS=y 851CONFIG_EXT2_FS=y
@@ -837,6 +873,7 @@ CONFIG_FS_POSIX_ACL=y
837# CONFIG_MINIX_FS is not set 873# CONFIG_MINIX_FS is not set
838# CONFIG_ROMFS_FS is not set 874# CONFIG_ROMFS_FS is not set
839CONFIG_INOTIFY=y 875CONFIG_INOTIFY=y
876CONFIG_INOTIFY_USER=y
840# CONFIG_QUOTA is not set 877# CONFIG_QUOTA is not set
841CONFIG_DNOTIFY=y 878CONFIG_DNOTIFY=y
842CONFIG_AUTOFS_FS=m 879CONFIG_AUTOFS_FS=m
@@ -906,6 +943,7 @@ CONFIG_SUNRPC=y
906CONFIG_SMB_FS=m 943CONFIG_SMB_FS=m
907# CONFIG_SMB_NLS_DEFAULT is not set 944# CONFIG_SMB_NLS_DEFAULT is not set
908# CONFIG_CIFS is not set 945# CONFIG_CIFS is not set
946# CONFIG_CIFS_DEBUG2 is not set
909# CONFIG_NCP_FS is not set 947# CONFIG_NCP_FS is not set
910# CONFIG_CODA_FS is not set 948# CONFIG_CODA_FS is not set
911# CONFIG_AFS_FS is not set 949# CONFIG_AFS_FS is not set
@@ -971,6 +1009,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
971# 1009#
972# CONFIG_PRINTK_TIME is not set 1010# CONFIG_PRINTK_TIME is not set
973# CONFIG_MAGIC_SYSRQ is not set 1011# CONFIG_MAGIC_SYSRQ is not set
1012# CONFIG_UNUSED_SYMBOLS is not set
974# CONFIG_DEBUG_KERNEL is not set 1013# CONFIG_DEBUG_KERNEL is not set
975CONFIG_LOG_BUF_SHIFT=14 1014CONFIG_LOG_BUF_SHIFT=14
976# CONFIG_DEBUG_FS is not set 1015# CONFIG_DEBUG_FS is not set
@@ -1030,3 +1069,4 @@ CONFIG_TEXTSEARCH=y
1030CONFIG_TEXTSEARCH_KMP=m 1069CONFIG_TEXTSEARCH_KMP=m
1031CONFIG_TEXTSEARCH_BM=m 1070CONFIG_TEXTSEARCH_BM=m
1032CONFIG_TEXTSEARCH_FSM=m 1071CONFIG_TEXTSEARCH_FSM=m
1072CONFIG_PLIST=y
diff --git a/arch/mips/configs/db1100_defconfig b/arch/mips/configs/db1100_defconfig
index 5c2da563e528..8c44d16ae9a2 100644
--- a/arch/mips/configs/db1100_defconfig
+++ b/arch/mips/configs/db1100_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:50:58 2006 4# Thu Jul 6 10:03:34 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS_DB1100=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS_DB1100=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MIPS_DB1100=y
45# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -65,6 +68,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
65CONFIG_GENERIC_FIND_NEXT_BIT=y 68CONFIG_GENERIC_FIND_NEXT_BIT=y
66CONFIG_GENERIC_HWEIGHT=y 69CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 70CONFIG_GENERIC_CALIBRATE_DELAY=y
71CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
68CONFIG_DMA_NONCOHERENT=y 72CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 73CONFIG_DMA_NEED_PCI_MAP_STATE=y
70# CONFIG_CPU_BIG_ENDIAN is not set 74# CONFIG_CPU_BIG_ENDIAN is not set
@@ -112,7 +116,10 @@ CONFIG_PAGE_SIZE_4KB=y
112# CONFIG_PAGE_SIZE_16KB is not set 116# CONFIG_PAGE_SIZE_16KB is not set
113# CONFIG_PAGE_SIZE_64KB is not set 117# CONFIG_PAGE_SIZE_64KB is not set
114CONFIG_CPU_HAS_PREFETCH=y 118CONFIG_CPU_HAS_PREFETCH=y
115# CONFIG_MIPS_MT is not set 119CONFIG_MIPS_MT_DISABLED=y
120# CONFIG_MIPS_MT_SMTC is not set
121# CONFIG_MIPS_MT_SMP is not set
122# CONFIG_MIPS_VPE_LOADER is not set
116CONFIG_64BIT_PHYS_ADDR=y 123CONFIG_64BIT_PHYS_ADDR=y
117CONFIG_CPU_HAS_LLSC=y 124CONFIG_CPU_HAS_LLSC=y
118CONFIG_CPU_HAS_SYNC=y 125CONFIG_CPU_HAS_SYNC=y
@@ -128,6 +135,7 @@ CONFIG_FLATMEM=y
128CONFIG_FLAT_NODE_MEM_MAP=y 135CONFIG_FLAT_NODE_MEM_MAP=y
129# CONFIG_SPARSEMEM_STATIC is not set 136# CONFIG_SPARSEMEM_STATIC is not set
130CONFIG_SPLIT_PTLOCK_CPUS=4 137CONFIG_SPLIT_PTLOCK_CPUS=4
138# CONFIG_RESOURCES_64BIT is not set
131# CONFIG_HZ_48 is not set 139# CONFIG_HZ_48 is not set
132# CONFIG_HZ_100 is not set 140# CONFIG_HZ_100 is not set
133# CONFIG_HZ_128 is not set 141# CONFIG_HZ_128 is not set
@@ -140,6 +148,7 @@ CONFIG_HZ=1000
140CONFIG_PREEMPT_NONE=y 148CONFIG_PREEMPT_NONE=y
141# CONFIG_PREEMPT_VOLUNTARY is not set 149# CONFIG_PREEMPT_VOLUNTARY is not set
142# CONFIG_PREEMPT is not set 150# CONFIG_PREEMPT is not set
151CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
143 152
144# 153#
145# Code maturity level options 154# Code maturity level options
@@ -171,14 +180,15 @@ CONFIG_PRINTK=y
171CONFIG_BUG=y 180CONFIG_BUG=y
172CONFIG_ELF_CORE=y 181CONFIG_ELF_CORE=y
173CONFIG_BASE_FULL=y 182CONFIG_BASE_FULL=y
183CONFIG_RT_MUTEXES=y
174CONFIG_FUTEX=y 184CONFIG_FUTEX=y
175CONFIG_EPOLL=y 185CONFIG_EPOLL=y
176CONFIG_SHMEM=y 186CONFIG_SHMEM=y
177CONFIG_SLAB=y 187CONFIG_SLAB=y
188CONFIG_VM_EVENT_COUNTERS=y
178# CONFIG_TINY_SHMEM is not set 189# CONFIG_TINY_SHMEM is not set
179CONFIG_BASE_SMALL=0 190CONFIG_BASE_SMALL=0
180# CONFIG_SLOB is not set 191# CONFIG_SLOB is not set
181CONFIG_OBSOLETE_INTERMODULE=y
182 192
183# 193#
184# Loadable module support 194# Loadable module support
@@ -265,6 +275,8 @@ CONFIG_IP_PNP_BOOTP=y
265# CONFIG_INET_IPCOMP is not set 275# CONFIG_INET_IPCOMP is not set
266# CONFIG_INET_XFRM_TUNNEL is not set 276# CONFIG_INET_XFRM_TUNNEL is not set
267# CONFIG_INET_TUNNEL is not set 277# CONFIG_INET_TUNNEL is not set
278CONFIG_INET_XFRM_MODE_TRANSPORT=m
279CONFIG_INET_XFRM_MODE_TUNNEL=m
268CONFIG_INET_DIAG=y 280CONFIG_INET_DIAG=y
269CONFIG_INET_TCP_DIAG=y 281CONFIG_INET_TCP_DIAG=y
270# CONFIG_TCP_CONG_ADVANCED is not set 282# CONFIG_TCP_CONG_ADVANCED is not set
@@ -277,6 +289,7 @@ CONFIG_TCP_CONG_BIC=y
277# CONFIG_IPV6 is not set 289# CONFIG_IPV6 is not set
278# CONFIG_INET6_XFRM_TUNNEL is not set 290# CONFIG_INET6_XFRM_TUNNEL is not set
279# CONFIG_INET6_TUNNEL is not set 291# CONFIG_INET6_TUNNEL is not set
292CONFIG_NETWORK_SECMARK=y
280CONFIG_NETFILTER=y 293CONFIG_NETFILTER=y
281# CONFIG_NETFILTER_DEBUG is not set 294# CONFIG_NETFILTER_DEBUG is not set
282 295
@@ -291,6 +304,7 @@ CONFIG_NETFILTER_XTABLES=m
291CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m 304CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
292CONFIG_NETFILTER_XT_TARGET_MARK=m 305CONFIG_NETFILTER_XT_TARGET_MARK=m
293CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m 306CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
307CONFIG_NETFILTER_XT_TARGET_SECMARK=m
294CONFIG_NETFILTER_XT_MATCH_COMMENT=m 308CONFIG_NETFILTER_XT_MATCH_COMMENT=m
295CONFIG_NETFILTER_XT_MATCH_DCCP=m 309CONFIG_NETFILTER_XT_MATCH_DCCP=m
296CONFIG_NETFILTER_XT_MATCH_ESP=m 310CONFIG_NETFILTER_XT_MATCH_ESP=m
@@ -301,8 +315,10 @@ CONFIG_NETFILTER_XT_MATCH_MARK=m
301CONFIG_NETFILTER_XT_MATCH_POLICY=m 315CONFIG_NETFILTER_XT_MATCH_POLICY=m
302CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m 316CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
303CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 317CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
318CONFIG_NETFILTER_XT_MATCH_QUOTA=m
304CONFIG_NETFILTER_XT_MATCH_REALM=m 319CONFIG_NETFILTER_XT_MATCH_REALM=m
305CONFIG_NETFILTER_XT_MATCH_SCTP=m 320CONFIG_NETFILTER_XT_MATCH_SCTP=m
321CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
306CONFIG_NETFILTER_XT_MATCH_STRING=m 322CONFIG_NETFILTER_XT_MATCH_STRING=m
307CONFIG_NETFILTER_XT_MATCH_TCPMSS=m 323CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
308 324
@@ -372,6 +388,7 @@ CONFIG_WIRELESS_EXT=y
372CONFIG_STANDALONE=y 388CONFIG_STANDALONE=y
373CONFIG_PREVENT_FIRMWARE_BUILD=y 389CONFIG_PREVENT_FIRMWARE_BUILD=y
374# CONFIG_FW_LOADER is not set 390# CONFIG_FW_LOADER is not set
391# CONFIG_SYS_HYPERVISOR is not set
375 392
376# 393#
377# Connector - unified userspace <-> kernelspace linker 394# Connector - unified userspace <-> kernelspace linker
@@ -521,7 +538,7 @@ CONFIG_NETDEVICES=y
521# 538#
522# PHY device support 539# PHY device support
523# 540#
524CONFIG_PHYLIB=m 541CONFIG_PHYLIB=y
525 542
526# 543#
527# MII PHY device drivers 544# MII PHY device drivers
@@ -531,6 +548,8 @@ CONFIG_DAVICOM_PHY=m
531CONFIG_QSEMI_PHY=m 548CONFIG_QSEMI_PHY=m
532CONFIG_LXT_PHY=m 549CONFIG_LXT_PHY=m
533CONFIG_CICADA_PHY=m 550CONFIG_CICADA_PHY=m
551CONFIG_VITESSE_PHY=m
552CONFIG_SMSC_PHY=m
534 553
535# 554#
536# Ethernet (10 or 100Mbit) 555# Ethernet (10 or 100Mbit)
@@ -629,6 +648,7 @@ CONFIG_SERIO_RAW=m
629CONFIG_VT=y 648CONFIG_VT=y
630CONFIG_VT_CONSOLE=y 649CONFIG_VT_CONSOLE=y
631CONFIG_HW_CONSOLE=y 650CONFIG_HW_CONSOLE=y
651CONFIG_VT_HW_CONSOLE_BINDING=y
632# CONFIG_SERIAL_NONSTANDARD is not set 652# CONFIG_SERIAL_NONSTANDARD is not set
633# CONFIG_AU1X00_GPIO is not set 653# CONFIG_AU1X00_GPIO is not set
634# CONFIG_TS_AU1X00_ADS7846 is not set 654# CONFIG_TS_AU1X00_ADS7846 is not set
@@ -661,6 +681,7 @@ CONFIG_LEGACY_PTY_COUNT=256
661# Watchdog Cards 681# Watchdog Cards
662# 682#
663# CONFIG_WATCHDOG is not set 683# CONFIG_WATCHDOG is not set
684# CONFIG_HW_RANDOM is not set
664# CONFIG_RTC is not set 685# CONFIG_RTC is not set
665# CONFIG_GEN_RTC is not set 686# CONFIG_GEN_RTC is not set
666# CONFIG_DTLK is not set 687# CONFIG_DTLK is not set
@@ -707,6 +728,7 @@ CONFIG_LEGACY_PTY_COUNT=256
707# Multimedia devices 728# Multimedia devices
708# 729#
709# CONFIG_VIDEO_DEV is not set 730# CONFIG_VIDEO_DEV is not set
731CONFIG_VIDEO_V4L2=y
710 732
711# 733#
712# Digital Video Broadcasting Devices 734# Digital Video Broadcasting Devices
@@ -716,12 +738,13 @@ CONFIG_LEGACY_PTY_COUNT=256
716# 738#
717# Graphics support 739# Graphics support
718# 740#
741# CONFIG_FIRMWARE_EDID is not set
719CONFIG_FB=y 742CONFIG_FB=y
720CONFIG_FB_CFB_FILLRECT=y 743CONFIG_FB_CFB_FILLRECT=y
721CONFIG_FB_CFB_COPYAREA=y 744CONFIG_FB_CFB_COPYAREA=y
722CONFIG_FB_CFB_IMAGEBLIT=y 745CONFIG_FB_CFB_IMAGEBLIT=y
723# CONFIG_FB_MACMODES is not set 746# CONFIG_FB_MACMODES is not set
724CONFIG_FB_FIRMWARE_EDID=y 747# CONFIG_FB_BACKLIGHT is not set
725# CONFIG_FB_MODE_HELPERS is not set 748# CONFIG_FB_MODE_HELPERS is not set
726# CONFIG_FB_TILEBLITTING is not set 749# CONFIG_FB_TILEBLITTING is not set
727# CONFIG_FB_S1D13XXX is not set 750# CONFIG_FB_S1D13XXX is not set
@@ -810,6 +833,19 @@ CONFIG_USB_ARCH_HAS_OHCI=y
810# CONFIG_RTC_CLASS is not set 833# CONFIG_RTC_CLASS is not set
811 834
812# 835#
836# DMA Engine support
837#
838# CONFIG_DMA_ENGINE is not set
839
840#
841# DMA Clients
842#
843
844#
845# DMA Devices
846#
847
848#
813# File systems 849# File systems
814# 850#
815CONFIG_EXT2_FS=y 851CONFIG_EXT2_FS=y
@@ -837,6 +873,7 @@ CONFIG_FS_POSIX_ACL=y
837# CONFIG_MINIX_FS is not set 873# CONFIG_MINIX_FS is not set
838# CONFIG_ROMFS_FS is not set 874# CONFIG_ROMFS_FS is not set
839CONFIG_INOTIFY=y 875CONFIG_INOTIFY=y
876CONFIG_INOTIFY_USER=y
840# CONFIG_QUOTA is not set 877# CONFIG_QUOTA is not set
841CONFIG_DNOTIFY=y 878CONFIG_DNOTIFY=y
842CONFIG_AUTOFS_FS=m 879CONFIG_AUTOFS_FS=m
@@ -906,6 +943,7 @@ CONFIG_SUNRPC=y
906CONFIG_SMB_FS=m 943CONFIG_SMB_FS=m
907# CONFIG_SMB_NLS_DEFAULT is not set 944# CONFIG_SMB_NLS_DEFAULT is not set
908# CONFIG_CIFS is not set 945# CONFIG_CIFS is not set
946# CONFIG_CIFS_DEBUG2 is not set
909# CONFIG_NCP_FS is not set 947# CONFIG_NCP_FS is not set
910# CONFIG_CODA_FS is not set 948# CONFIG_CODA_FS is not set
911# CONFIG_AFS_FS is not set 949# CONFIG_AFS_FS is not set
@@ -971,6 +1009,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
971# 1009#
972# CONFIG_PRINTK_TIME is not set 1010# CONFIG_PRINTK_TIME is not set
973# CONFIG_MAGIC_SYSRQ is not set 1011# CONFIG_MAGIC_SYSRQ is not set
1012# CONFIG_UNUSED_SYMBOLS is not set
974# CONFIG_DEBUG_KERNEL is not set 1013# CONFIG_DEBUG_KERNEL is not set
975CONFIG_LOG_BUF_SHIFT=14 1014CONFIG_LOG_BUF_SHIFT=14
976# CONFIG_DEBUG_FS is not set 1015# CONFIG_DEBUG_FS is not set
@@ -1030,3 +1069,4 @@ CONFIG_TEXTSEARCH=y
1030CONFIG_TEXTSEARCH_KMP=m 1069CONFIG_TEXTSEARCH_KMP=m
1031CONFIG_TEXTSEARCH_BM=m 1070CONFIG_TEXTSEARCH_BM=m
1032CONFIG_TEXTSEARCH_FSM=m 1071CONFIG_TEXTSEARCH_FSM=m
1072CONFIG_PLIST=y
diff --git a/arch/mips/configs/db1200_defconfig b/arch/mips/configs/db1200_defconfig
index 85ef90ce0944..c13768e75ac5 100644
--- a/arch/mips/configs/db1200_defconfig
+++ b/arch/mips/configs/db1200_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:50:58 2006 4# Thu Jul 6 10:03:43 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22CONFIG_MIPS_DB1200=y 22CONFIG_MIPS_DB1200=y
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS_DB1200=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MIPS_DB1200=y
45# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -65,6 +68,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
65CONFIG_GENERIC_FIND_NEXT_BIT=y 68CONFIG_GENERIC_FIND_NEXT_BIT=y
66CONFIG_GENERIC_HWEIGHT=y 69CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 70CONFIG_GENERIC_CALIBRATE_DELAY=y
71CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
68CONFIG_DMA_COHERENT=y 72CONFIG_DMA_COHERENT=y
69CONFIG_MIPS_DISABLE_OBSOLETE_IDE=y 73CONFIG_MIPS_DISABLE_OBSOLETE_IDE=y
70# CONFIG_CPU_BIG_ENDIAN is not set 74# CONFIG_CPU_BIG_ENDIAN is not set
@@ -112,7 +116,10 @@ CONFIG_PAGE_SIZE_4KB=y
112# CONFIG_PAGE_SIZE_16KB is not set 116# CONFIG_PAGE_SIZE_16KB is not set
113# CONFIG_PAGE_SIZE_64KB is not set 117# CONFIG_PAGE_SIZE_64KB is not set
114CONFIG_CPU_HAS_PREFETCH=y 118CONFIG_CPU_HAS_PREFETCH=y
115# CONFIG_MIPS_MT is not set 119CONFIG_MIPS_MT_DISABLED=y
120# CONFIG_MIPS_MT_SMTC is not set
121# CONFIG_MIPS_MT_SMP is not set
122# CONFIG_MIPS_VPE_LOADER is not set
116CONFIG_64BIT_PHYS_ADDR=y 123CONFIG_64BIT_PHYS_ADDR=y
117CONFIG_CPU_HAS_LLSC=y 124CONFIG_CPU_HAS_LLSC=y
118CONFIG_CPU_HAS_SYNC=y 125CONFIG_CPU_HAS_SYNC=y
@@ -128,6 +135,7 @@ CONFIG_FLATMEM=y
128CONFIG_FLAT_NODE_MEM_MAP=y 135CONFIG_FLAT_NODE_MEM_MAP=y
129# CONFIG_SPARSEMEM_STATIC is not set 136# CONFIG_SPARSEMEM_STATIC is not set
130CONFIG_SPLIT_PTLOCK_CPUS=4 137CONFIG_SPLIT_PTLOCK_CPUS=4
138# CONFIG_RESOURCES_64BIT is not set
131# CONFIG_HZ_48 is not set 139# CONFIG_HZ_48 is not set
132# CONFIG_HZ_100 is not set 140# CONFIG_HZ_100 is not set
133# CONFIG_HZ_128 is not set 141# CONFIG_HZ_128 is not set
@@ -140,6 +148,7 @@ CONFIG_HZ=1000
140CONFIG_PREEMPT_NONE=y 148CONFIG_PREEMPT_NONE=y
141# CONFIG_PREEMPT_VOLUNTARY is not set 149# CONFIG_PREEMPT_VOLUNTARY is not set
142# CONFIG_PREEMPT is not set 150# CONFIG_PREEMPT is not set
151CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
143 152
144# 153#
145# Code maturity level options 154# Code maturity level options
@@ -172,14 +181,15 @@ CONFIG_PRINTK=y
172CONFIG_BUG=y 181CONFIG_BUG=y
173CONFIG_ELF_CORE=y 182CONFIG_ELF_CORE=y
174CONFIG_BASE_FULL=y 183CONFIG_BASE_FULL=y
184CONFIG_RT_MUTEXES=y
175CONFIG_FUTEX=y 185CONFIG_FUTEX=y
176CONFIG_EPOLL=y 186CONFIG_EPOLL=y
177CONFIG_SHMEM=y 187CONFIG_SHMEM=y
178CONFIG_SLAB=y 188CONFIG_SLAB=y
189CONFIG_VM_EVENT_COUNTERS=y
179# CONFIG_TINY_SHMEM is not set 190# CONFIG_TINY_SHMEM is not set
180CONFIG_BASE_SMALL=0 191CONFIG_BASE_SMALL=0
181# CONFIG_SLOB is not set 192# CONFIG_SLOB is not set
182CONFIG_OBSOLETE_INTERMODULE=y
183 193
184# 194#
185# Loadable module support 195# Loadable module support
@@ -272,6 +282,8 @@ CONFIG_IP_FIB_HASH=y
272# CONFIG_INET_IPCOMP is not set 282# CONFIG_INET_IPCOMP is not set
273# CONFIG_INET_XFRM_TUNNEL is not set 283# CONFIG_INET_XFRM_TUNNEL is not set
274# CONFIG_INET_TUNNEL is not set 284# CONFIG_INET_TUNNEL is not set
285CONFIG_INET_XFRM_MODE_TRANSPORT=m
286CONFIG_INET_XFRM_MODE_TUNNEL=m
275CONFIG_INET_DIAG=y 287CONFIG_INET_DIAG=y
276CONFIG_INET_TCP_DIAG=y 288CONFIG_INET_TCP_DIAG=y
277# CONFIG_TCP_CONG_ADVANCED is not set 289# CONFIG_TCP_CONG_ADVANCED is not set
@@ -284,6 +296,7 @@ CONFIG_TCP_CONG_BIC=y
284# CONFIG_IPV6 is not set 296# CONFIG_IPV6 is not set
285# CONFIG_INET6_XFRM_TUNNEL is not set 297# CONFIG_INET6_XFRM_TUNNEL is not set
286# CONFIG_INET6_TUNNEL is not set 298# CONFIG_INET6_TUNNEL is not set
299CONFIG_NETWORK_SECMARK=y
287CONFIG_NETFILTER=y 300CONFIG_NETFILTER=y
288# CONFIG_NETFILTER_DEBUG is not set 301# CONFIG_NETFILTER_DEBUG is not set
289 302
@@ -296,6 +309,7 @@ CONFIG_NETFILTER_XTABLES=m
296CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m 309CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
297CONFIG_NETFILTER_XT_TARGET_MARK=m 310CONFIG_NETFILTER_XT_TARGET_MARK=m
298CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m 311CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
312CONFIG_NETFILTER_XT_TARGET_SECMARK=m
299CONFIG_NETFILTER_XT_MATCH_COMMENT=m 313CONFIG_NETFILTER_XT_MATCH_COMMENT=m
300CONFIG_NETFILTER_XT_MATCH_DCCP=m 314CONFIG_NETFILTER_XT_MATCH_DCCP=m
301CONFIG_NETFILTER_XT_MATCH_ESP=m 315CONFIG_NETFILTER_XT_MATCH_ESP=m
@@ -306,8 +320,10 @@ CONFIG_NETFILTER_XT_MATCH_MARK=m
306CONFIG_NETFILTER_XT_MATCH_POLICY=m 320CONFIG_NETFILTER_XT_MATCH_POLICY=m
307CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m 321CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
308CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 322CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
323CONFIG_NETFILTER_XT_MATCH_QUOTA=m
309CONFIG_NETFILTER_XT_MATCH_REALM=m 324CONFIG_NETFILTER_XT_MATCH_REALM=m
310CONFIG_NETFILTER_XT_MATCH_SCTP=m 325CONFIG_NETFILTER_XT_MATCH_SCTP=m
326CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
311CONFIG_NETFILTER_XT_MATCH_STRING=m 327CONFIG_NETFILTER_XT_MATCH_STRING=m
312CONFIG_NETFILTER_XT_MATCH_TCPMSS=m 328CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
313 329
@@ -371,6 +387,7 @@ CONFIG_NET_CLS_ROUTE=y
371CONFIG_STANDALONE=y 387CONFIG_STANDALONE=y
372CONFIG_PREVENT_FIRMWARE_BUILD=y 388CONFIG_PREVENT_FIRMWARE_BUILD=y
373CONFIG_FW_LOADER=y 389CONFIG_FW_LOADER=y
390# CONFIG_SYS_HYPERVISOR is not set
374 391
375# 392#
376# Connector - unified userspace <-> kernelspace linker 393# Connector - unified userspace <-> kernelspace linker
@@ -451,6 +468,7 @@ CONFIG_MTD_ALCHEMY=y
451# 468#
452CONFIG_MTD_NAND=y 469CONFIG_MTD_NAND=y
453# CONFIG_MTD_NAND_VERIFY_WRITE is not set 470# CONFIG_MTD_NAND_VERIFY_WRITE is not set
471# CONFIG_MTD_NAND_ECC_SMC is not set
454CONFIG_MTD_NAND_IDS=y 472CONFIG_MTD_NAND_IDS=y
455# CONFIG_MTD_NAND_AU1550 is not set 473# CONFIG_MTD_NAND_AU1550 is not set
456# CONFIG_MTD_NAND_DISKONCHIP is not set 474# CONFIG_MTD_NAND_DISKONCHIP is not set
@@ -691,6 +709,7 @@ CONFIG_SERIO_RAW=y
691CONFIG_VT=y 709CONFIG_VT=y
692CONFIG_VT_CONSOLE=y 710CONFIG_VT_CONSOLE=y
693CONFIG_HW_CONSOLE=y 711CONFIG_HW_CONSOLE=y
712CONFIG_VT_HW_CONSOLE_BINDING=y
694# CONFIG_SERIAL_NONSTANDARD is not set 713# CONFIG_SERIAL_NONSTANDARD is not set
695# CONFIG_AU1X00_GPIO is not set 714# CONFIG_AU1X00_GPIO is not set
696# CONFIG_TS_AU1X00_ADS7846 is not set 715# CONFIG_TS_AU1X00_ADS7846 is not set
@@ -724,6 +743,7 @@ CONFIG_LEGACY_PTY_COUNT=256
724# Watchdog Cards 743# Watchdog Cards
725# 744#
726# CONFIG_WATCHDOG is not set 745# CONFIG_WATCHDOG is not set
746# CONFIG_HW_RANDOM is not set
727# CONFIG_RTC is not set 747# CONFIG_RTC is not set
728# CONFIG_GEN_RTC is not set 748# CONFIG_GEN_RTC is not set
729# CONFIG_DTLK is not set 749# CONFIG_DTLK is not set
@@ -761,7 +781,6 @@ CONFIG_LEGACY_PTY_COUNT=256
761# 781#
762# Dallas's 1-wire bus 782# Dallas's 1-wire bus
763# 783#
764# CONFIG_W1 is not set
765 784
766# 785#
767# Hardware Monitoring support 786# Hardware Monitoring support
@@ -777,6 +796,7 @@ CONFIG_LEGACY_PTY_COUNT=256
777# Multimedia devices 796# Multimedia devices
778# 797#
779# CONFIG_VIDEO_DEV is not set 798# CONFIG_VIDEO_DEV is not set
799CONFIG_VIDEO_V4L2=y
780 800
781# 801#
782# Digital Video Broadcasting Devices 802# Digital Video Broadcasting Devices
@@ -786,12 +806,13 @@ CONFIG_LEGACY_PTY_COUNT=256
786# 806#
787# Graphics support 807# Graphics support
788# 808#
809# CONFIG_FIRMWARE_EDID is not set
789CONFIG_FB=y 810CONFIG_FB=y
790CONFIG_FB_CFB_FILLRECT=y 811CONFIG_FB_CFB_FILLRECT=y
791CONFIG_FB_CFB_COPYAREA=y 812CONFIG_FB_CFB_COPYAREA=y
792CONFIG_FB_CFB_IMAGEBLIT=y 813CONFIG_FB_CFB_IMAGEBLIT=y
793# CONFIG_FB_MACMODES is not set 814# CONFIG_FB_MACMODES is not set
794CONFIG_FB_FIRMWARE_EDID=y 815# CONFIG_FB_BACKLIGHT is not set
795# CONFIG_FB_MODE_HELPERS is not set 816# CONFIG_FB_MODE_HELPERS is not set
796# CONFIG_FB_TILEBLITTING is not set 817# CONFIG_FB_TILEBLITTING is not set
797# CONFIG_FB_S1D13XXX is not set 818# CONFIG_FB_S1D13XXX is not set
@@ -881,6 +902,19 @@ CONFIG_MMC_AU1X=y
881# CONFIG_RTC_CLASS is not set 902# CONFIG_RTC_CLASS is not set
882 903
883# 904#
905# DMA Engine support
906#
907# CONFIG_DMA_ENGINE is not set
908
909#
910# DMA Clients
911#
912
913#
914# DMA Devices
915#
916
917#
884# File systems 918# File systems
885# 919#
886CONFIG_EXT2_FS=y 920CONFIG_EXT2_FS=y
@@ -907,6 +941,7 @@ CONFIG_FS_POSIX_ACL=y
907# CONFIG_MINIX_FS is not set 941# CONFIG_MINIX_FS is not set
908# CONFIG_ROMFS_FS is not set 942# CONFIG_ROMFS_FS is not set
909CONFIG_INOTIFY=y 943CONFIG_INOTIFY=y
944CONFIG_INOTIFY_USER=y
910# CONFIG_QUOTA is not set 945# CONFIG_QUOTA is not set
911CONFIG_DNOTIFY=y 946CONFIG_DNOTIFY=y
912# CONFIG_AUTOFS_FS is not set 947# CONFIG_AUTOFS_FS is not set
@@ -959,6 +994,7 @@ CONFIG_JFFS2_FS=y
959CONFIG_JFFS2_FS_DEBUG=0 994CONFIG_JFFS2_FS_DEBUG=0
960CONFIG_JFFS2_FS_WRITEBUFFER=y 995CONFIG_JFFS2_FS_WRITEBUFFER=y
961# CONFIG_JFFS2_SUMMARY is not set 996# CONFIG_JFFS2_SUMMARY is not set
997# CONFIG_JFFS2_FS_XATTR is not set
962# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set 998# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
963CONFIG_JFFS2_ZLIB=y 999CONFIG_JFFS2_ZLIB=y
964CONFIG_JFFS2_RTIME=y 1000CONFIG_JFFS2_RTIME=y
@@ -988,6 +1024,7 @@ CONFIG_SUNRPC=y
988CONFIG_SMB_FS=y 1024CONFIG_SMB_FS=y
989# CONFIG_SMB_NLS_DEFAULT is not set 1025# CONFIG_SMB_NLS_DEFAULT is not set
990# CONFIG_CIFS is not set 1026# CONFIG_CIFS is not set
1027# CONFIG_CIFS_DEBUG2 is not set
991# CONFIG_NCP_FS is not set 1028# CONFIG_NCP_FS is not set
992# CONFIG_CODA_FS is not set 1029# CONFIG_CODA_FS is not set
993# CONFIG_AFS_FS is not set 1030# CONFIG_AFS_FS is not set
@@ -1053,6 +1090,7 @@ CONFIG_NLS_UTF8=m
1053# 1090#
1054# CONFIG_PRINTK_TIME is not set 1091# CONFIG_PRINTK_TIME is not set
1055# CONFIG_MAGIC_SYSRQ is not set 1092# CONFIG_MAGIC_SYSRQ is not set
1093# CONFIG_UNUSED_SYMBOLS is not set
1056# CONFIG_DEBUG_KERNEL is not set 1094# CONFIG_DEBUG_KERNEL is not set
1057CONFIG_LOG_BUF_SHIFT=14 1095CONFIG_LOG_BUF_SHIFT=14
1058# CONFIG_DEBUG_FS is not set 1096# CONFIG_DEBUG_FS is not set
@@ -1088,3 +1126,4 @@ CONFIG_TEXTSEARCH=y
1088CONFIG_TEXTSEARCH_KMP=m 1126CONFIG_TEXTSEARCH_KMP=m
1089CONFIG_TEXTSEARCH_BM=m 1127CONFIG_TEXTSEARCH_BM=m
1090CONFIG_TEXTSEARCH_FSM=m 1128CONFIG_TEXTSEARCH_FSM=m
1129CONFIG_PLIST=y
diff --git a/arch/mips/configs/db1500_defconfig b/arch/mips/configs/db1500_defconfig
index 6f757d8a5a6c..8aea73fae7fb 100644
--- a/arch/mips/configs/db1500_defconfig
+++ b/arch/mips/configs/db1500_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:50:59 2006 4# Thu Jul 6 10:03:56 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS_DB1500=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS_DB1500=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MIPS_DB1500=y
45# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -65,6 +68,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
65CONFIG_GENERIC_FIND_NEXT_BIT=y 68CONFIG_GENERIC_FIND_NEXT_BIT=y
66CONFIG_GENERIC_HWEIGHT=y 69CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 70CONFIG_GENERIC_CALIBRATE_DELAY=y
71CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
68CONFIG_DMA_NONCOHERENT=y 72CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 73CONFIG_DMA_NEED_PCI_MAP_STATE=y
70CONFIG_MIPS_DISABLE_OBSOLETE_IDE=y 74CONFIG_MIPS_DISABLE_OBSOLETE_IDE=y
@@ -114,7 +118,10 @@ CONFIG_PAGE_SIZE_4KB=y
114# CONFIG_PAGE_SIZE_16KB is not set 118# CONFIG_PAGE_SIZE_16KB is not set
115# CONFIG_PAGE_SIZE_64KB is not set 119# CONFIG_PAGE_SIZE_64KB is not set
116CONFIG_CPU_HAS_PREFETCH=y 120CONFIG_CPU_HAS_PREFETCH=y
117# CONFIG_MIPS_MT is not set 121CONFIG_MIPS_MT_DISABLED=y
122# CONFIG_MIPS_MT_SMTC is not set
123# CONFIG_MIPS_MT_SMP is not set
124# CONFIG_MIPS_VPE_LOADER is not set
118CONFIG_64BIT_PHYS_ADDR=y 125CONFIG_64BIT_PHYS_ADDR=y
119CONFIG_CPU_HAS_LLSC=y 126CONFIG_CPU_HAS_LLSC=y
120CONFIG_CPU_HAS_SYNC=y 127CONFIG_CPU_HAS_SYNC=y
@@ -130,6 +137,7 @@ CONFIG_FLATMEM=y
130CONFIG_FLAT_NODE_MEM_MAP=y 137CONFIG_FLAT_NODE_MEM_MAP=y
131# CONFIG_SPARSEMEM_STATIC is not set 138# CONFIG_SPARSEMEM_STATIC is not set
132CONFIG_SPLIT_PTLOCK_CPUS=4 139CONFIG_SPLIT_PTLOCK_CPUS=4
140# CONFIG_RESOURCES_64BIT is not set
133# CONFIG_HZ_48 is not set 141# CONFIG_HZ_48 is not set
134# CONFIG_HZ_100 is not set 142# CONFIG_HZ_100 is not set
135# CONFIG_HZ_128 is not set 143# CONFIG_HZ_128 is not set
@@ -142,6 +150,7 @@ CONFIG_HZ=1000
142CONFIG_PREEMPT_NONE=y 150CONFIG_PREEMPT_NONE=y
143# CONFIG_PREEMPT_VOLUNTARY is not set 151# CONFIG_PREEMPT_VOLUNTARY is not set
144# CONFIG_PREEMPT is not set 152# CONFIG_PREEMPT is not set
153CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
145 154
146# 155#
147# Code maturity level options 156# Code maturity level options
@@ -173,14 +182,15 @@ CONFIG_PRINTK=y
173CONFIG_BUG=y 182CONFIG_BUG=y
174CONFIG_ELF_CORE=y 183CONFIG_ELF_CORE=y
175CONFIG_BASE_FULL=y 184CONFIG_BASE_FULL=y
185CONFIG_RT_MUTEXES=y
176CONFIG_FUTEX=y 186CONFIG_FUTEX=y
177CONFIG_EPOLL=y 187CONFIG_EPOLL=y
178CONFIG_SHMEM=y 188CONFIG_SHMEM=y
179CONFIG_SLAB=y 189CONFIG_SLAB=y
190CONFIG_VM_EVENT_COUNTERS=y
180# CONFIG_TINY_SHMEM is not set 191# CONFIG_TINY_SHMEM is not set
181CONFIG_BASE_SMALL=0 192CONFIG_BASE_SMALL=0
182# CONFIG_SLOB is not set 193# CONFIG_SLOB is not set
183CONFIG_OBSOLETE_INTERMODULE=y
184 194
185# 195#
186# Loadable module support 196# Loadable module support
@@ -283,6 +293,8 @@ CONFIG_IP_PNP_BOOTP=y
283# CONFIG_INET_IPCOMP is not set 293# CONFIG_INET_IPCOMP is not set
284# CONFIG_INET_XFRM_TUNNEL is not set 294# CONFIG_INET_XFRM_TUNNEL is not set
285# CONFIG_INET_TUNNEL is not set 295# CONFIG_INET_TUNNEL is not set
296CONFIG_INET_XFRM_MODE_TRANSPORT=m
297CONFIG_INET_XFRM_MODE_TUNNEL=m
286CONFIG_INET_DIAG=y 298CONFIG_INET_DIAG=y
287CONFIG_INET_TCP_DIAG=y 299CONFIG_INET_TCP_DIAG=y
288# CONFIG_TCP_CONG_ADVANCED is not set 300# CONFIG_TCP_CONG_ADVANCED is not set
@@ -295,6 +307,7 @@ CONFIG_TCP_CONG_BIC=y
295# CONFIG_IPV6 is not set 307# CONFIG_IPV6 is not set
296# CONFIG_INET6_XFRM_TUNNEL is not set 308# CONFIG_INET6_XFRM_TUNNEL is not set
297# CONFIG_INET6_TUNNEL is not set 309# CONFIG_INET6_TUNNEL is not set
310CONFIG_NETWORK_SECMARK=y
298CONFIG_NETFILTER=y 311CONFIG_NETFILTER=y
299# CONFIG_NETFILTER_DEBUG is not set 312# CONFIG_NETFILTER_DEBUG is not set
300 313
@@ -309,6 +322,7 @@ CONFIG_NETFILTER_XTABLES=m
309CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m 322CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
310CONFIG_NETFILTER_XT_TARGET_MARK=m 323CONFIG_NETFILTER_XT_TARGET_MARK=m
311CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m 324CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
325CONFIG_NETFILTER_XT_TARGET_SECMARK=m
312CONFIG_NETFILTER_XT_MATCH_COMMENT=m 326CONFIG_NETFILTER_XT_MATCH_COMMENT=m
313CONFIG_NETFILTER_XT_MATCH_DCCP=m 327CONFIG_NETFILTER_XT_MATCH_DCCP=m
314CONFIG_NETFILTER_XT_MATCH_ESP=m 328CONFIG_NETFILTER_XT_MATCH_ESP=m
@@ -319,8 +333,10 @@ CONFIG_NETFILTER_XT_MATCH_MARK=m
319CONFIG_NETFILTER_XT_MATCH_POLICY=m 333CONFIG_NETFILTER_XT_MATCH_POLICY=m
320CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m 334CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
321CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 335CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
336CONFIG_NETFILTER_XT_MATCH_QUOTA=m
322CONFIG_NETFILTER_XT_MATCH_REALM=m 337CONFIG_NETFILTER_XT_MATCH_REALM=m
323CONFIG_NETFILTER_XT_MATCH_SCTP=m 338CONFIG_NETFILTER_XT_MATCH_SCTP=m
339CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
324CONFIG_NETFILTER_XT_MATCH_STRING=m 340CONFIG_NETFILTER_XT_MATCH_STRING=m
325CONFIG_NETFILTER_XT_MATCH_TCPMSS=m 341CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
326 342
@@ -390,6 +406,7 @@ CONFIG_WIRELESS_EXT=y
390CONFIG_STANDALONE=y 406CONFIG_STANDALONE=y
391CONFIG_PREVENT_FIRMWARE_BUILD=y 407CONFIG_PREVENT_FIRMWARE_BUILD=y
392CONFIG_FW_LOADER=m 408CONFIG_FW_LOADER=m
409# CONFIG_SYS_HYPERVISOR is not set
393 410
394# 411#
395# Connector - unified userspace <-> kernelspace linker 412# Connector - unified userspace <-> kernelspace linker
@@ -576,7 +593,7 @@ CONFIG_NETDEVICES=y
576# 593#
577# PHY device support 594# PHY device support
578# 595#
579CONFIG_PHYLIB=m 596CONFIG_PHYLIB=y
580 597
581# 598#
582# MII PHY device drivers 599# MII PHY device drivers
@@ -586,6 +603,8 @@ CONFIG_DAVICOM_PHY=m
586CONFIG_QSEMI_PHY=m 603CONFIG_QSEMI_PHY=m
587CONFIG_LXT_PHY=m 604CONFIG_LXT_PHY=m
588CONFIG_CICADA_PHY=m 605CONFIG_CICADA_PHY=m
606CONFIG_VITESSE_PHY=m
607CONFIG_SMSC_PHY=m
589 608
590# 609#
591# Ethernet (10 or 100Mbit) 610# Ethernet (10 or 100Mbit)
@@ -630,6 +649,7 @@ CONFIG_MIPS_AU1X00_ENET=y
630# CONFIG_CHELSIO_T1 is not set 649# CONFIG_CHELSIO_T1 is not set
631# CONFIG_IXGB is not set 650# CONFIG_IXGB is not set
632# CONFIG_S2IO is not set 651# CONFIG_S2IO is not set
652# CONFIG_MYRI10GE is not set
633 653
634# 654#
635# Token Ring devices 655# Token Ring devices
@@ -753,6 +773,7 @@ CONFIG_LEGACY_PTY_COUNT=256
753# Watchdog Cards 773# Watchdog Cards
754# 774#
755# CONFIG_WATCHDOG is not set 775# CONFIG_WATCHDOG is not set
776# CONFIG_HW_RANDOM is not set
756# CONFIG_RTC is not set 777# CONFIG_RTC is not set
757# CONFIG_GEN_RTC is not set 778# CONFIG_GEN_RTC is not set
758# CONFIG_DTLK is not set 779# CONFIG_DTLK is not set
@@ -808,6 +829,7 @@ CONFIG_SYNCLINK_CS=m
808# Multimedia devices 829# Multimedia devices
809# 830#
810# CONFIG_VIDEO_DEV is not set 831# CONFIG_VIDEO_DEV is not set
832CONFIG_VIDEO_V4L2=y
811 833
812# 834#
813# Digital Video Broadcasting Devices 835# Digital Video Broadcasting Devices
@@ -818,6 +840,7 @@ CONFIG_SYNCLINK_CS=m
818# 840#
819# Graphics support 841# Graphics support
820# 842#
843# CONFIG_FIRMWARE_EDID is not set
821# CONFIG_FB is not set 844# CONFIG_FB is not set
822 845
823# 846#
@@ -873,6 +896,18 @@ CONFIG_SND_MTPAV=m
873# CONFIG_SND_CMIPCI is not set 896# CONFIG_SND_CMIPCI is not set
874# CONFIG_SND_CS4281 is not set 897# CONFIG_SND_CS4281 is not set
875# CONFIG_SND_CS46XX is not set 898# CONFIG_SND_CS46XX is not set
899# CONFIG_SND_DARLA20 is not set
900# CONFIG_SND_GINA20 is not set
901# CONFIG_SND_LAYLA20 is not set
902# CONFIG_SND_DARLA24 is not set
903# CONFIG_SND_GINA24 is not set
904# CONFIG_SND_LAYLA24 is not set
905# CONFIG_SND_MONA is not set
906# CONFIG_SND_MIA is not set
907# CONFIG_SND_ECHO3G is not set
908# CONFIG_SND_INDIGO is not set
909# CONFIG_SND_INDIGOIO is not set
910# CONFIG_SND_INDIGODJ is not set
876# CONFIG_SND_EMU10K1 is not set 911# CONFIG_SND_EMU10K1 is not set
877# CONFIG_SND_EMU10K1X is not set 912# CONFIG_SND_EMU10K1X is not set
878# CONFIG_SND_ENS1370 is not set 913# CONFIG_SND_ENS1370 is not set
@@ -916,6 +951,8 @@ CONFIG_SND_AU1X00=m
916# 951#
917# PCMCIA devices 952# PCMCIA devices
918# 953#
954# CONFIG_SND_VXPOCKET is not set
955# CONFIG_SND_PDAUDIOCF is not set
919 956
920# 957#
921# Open Sound System 958# Open Sound System
@@ -1030,10 +1067,12 @@ CONFIG_USB_MON=y
1030# CONFIG_USB_LEGOTOWER is not set 1067# CONFIG_USB_LEGOTOWER is not set
1031# CONFIG_USB_LCD is not set 1068# CONFIG_USB_LCD is not set
1032# CONFIG_USB_LED is not set 1069# CONFIG_USB_LED is not set
1070# CONFIG_USB_CY7C63 is not set
1033# CONFIG_USB_CYTHERM is not set 1071# CONFIG_USB_CYTHERM is not set
1034# CONFIG_USB_PHIDGETKIT is not set 1072# CONFIG_USB_PHIDGETKIT is not set
1035# CONFIG_USB_PHIDGETSERVO is not set 1073# CONFIG_USB_PHIDGETSERVO is not set
1036# CONFIG_USB_IDMOUSE is not set 1074# CONFIG_USB_IDMOUSE is not set
1075# CONFIG_USB_APPLEDISPLAY is not set
1037CONFIG_USB_LD=m 1076CONFIG_USB_LD=m
1038 1077
1039# 1078#
@@ -1078,6 +1117,19 @@ CONFIG_USB_LD=m
1078# CONFIG_RTC_CLASS is not set 1117# CONFIG_RTC_CLASS is not set
1079 1118
1080# 1119#
1120# DMA Engine support
1121#
1122# CONFIG_DMA_ENGINE is not set
1123
1124#
1125# DMA Clients
1126#
1127
1128#
1129# DMA Devices
1130#
1131
1132#
1081# File systems 1133# File systems
1082# 1134#
1083CONFIG_EXT2_FS=y 1135CONFIG_EXT2_FS=y
@@ -1105,6 +1157,7 @@ CONFIG_FS_POSIX_ACL=y
1105# CONFIG_MINIX_FS is not set 1157# CONFIG_MINIX_FS is not set
1106# CONFIG_ROMFS_FS is not set 1158# CONFIG_ROMFS_FS is not set
1107CONFIG_INOTIFY=y 1159CONFIG_INOTIFY=y
1160CONFIG_INOTIFY_USER=y
1108# CONFIG_QUOTA is not set 1161# CONFIG_QUOTA is not set
1109CONFIG_DNOTIFY=y 1162CONFIG_DNOTIFY=y
1110CONFIG_AUTOFS_FS=m 1163CONFIG_AUTOFS_FS=m
@@ -1174,6 +1227,7 @@ CONFIG_SUNRPC=y
1174CONFIG_SMB_FS=m 1227CONFIG_SMB_FS=m
1175# CONFIG_SMB_NLS_DEFAULT is not set 1228# CONFIG_SMB_NLS_DEFAULT is not set
1176# CONFIG_CIFS is not set 1229# CONFIG_CIFS is not set
1230# CONFIG_CIFS_DEBUG2 is not set
1177# CONFIG_NCP_FS is not set 1231# CONFIG_NCP_FS is not set
1178# CONFIG_CODA_FS is not set 1232# CONFIG_CODA_FS is not set
1179# CONFIG_AFS_FS is not set 1233# CONFIG_AFS_FS is not set
@@ -1239,6 +1293,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1239# 1293#
1240# CONFIG_PRINTK_TIME is not set 1294# CONFIG_PRINTK_TIME is not set
1241# CONFIG_MAGIC_SYSRQ is not set 1295# CONFIG_MAGIC_SYSRQ is not set
1296# CONFIG_UNUSED_SYMBOLS is not set
1242# CONFIG_DEBUG_KERNEL is not set 1297# CONFIG_DEBUG_KERNEL is not set
1243CONFIG_LOG_BUF_SHIFT=14 1298CONFIG_LOG_BUF_SHIFT=14
1244# CONFIG_DEBUG_FS is not set 1299# CONFIG_DEBUG_FS is not set
@@ -1298,3 +1353,4 @@ CONFIG_TEXTSEARCH=y
1298CONFIG_TEXTSEARCH_KMP=m 1353CONFIG_TEXTSEARCH_KMP=m
1299CONFIG_TEXTSEARCH_BM=m 1354CONFIG_TEXTSEARCH_BM=m
1300CONFIG_TEXTSEARCH_FSM=m 1355CONFIG_TEXTSEARCH_FSM=m
1356CONFIG_PLIST=y
diff --git a/arch/mips/configs/db1550_defconfig b/arch/mips/configs/db1550_defconfig
index da4c7e811bef..90ccb7359630 100644
--- a/arch/mips/configs/db1550_defconfig
+++ b/arch/mips/configs/db1550_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:51:00 2006 4# Thu Jul 6 10:03:59 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21CONFIG_MIPS_DB1550=y 21CONFIG_MIPS_DB1550=y
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS_DB1550=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MIPS_DB1550=y
45# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -65,6 +68,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
65CONFIG_GENERIC_FIND_NEXT_BIT=y 68CONFIG_GENERIC_FIND_NEXT_BIT=y
66CONFIG_GENERIC_HWEIGHT=y 69CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 70CONFIG_GENERIC_CALIBRATE_DELAY=y
71CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
68CONFIG_DMA_NONCOHERENT=y 72CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 73CONFIG_DMA_NEED_PCI_MAP_STATE=y
70CONFIG_MIPS_DISABLE_OBSOLETE_IDE=y 74CONFIG_MIPS_DISABLE_OBSOLETE_IDE=y
@@ -113,7 +117,10 @@ CONFIG_PAGE_SIZE_4KB=y
113# CONFIG_PAGE_SIZE_16KB is not set 117# CONFIG_PAGE_SIZE_16KB is not set
114# CONFIG_PAGE_SIZE_64KB is not set 118# CONFIG_PAGE_SIZE_64KB is not set
115CONFIG_CPU_HAS_PREFETCH=y 119CONFIG_CPU_HAS_PREFETCH=y
116# CONFIG_MIPS_MT is not set 120CONFIG_MIPS_MT_DISABLED=y
121# CONFIG_MIPS_MT_SMTC is not set
122# CONFIG_MIPS_MT_SMP is not set
123# CONFIG_MIPS_VPE_LOADER is not set
117CONFIG_64BIT_PHYS_ADDR=y 124CONFIG_64BIT_PHYS_ADDR=y
118CONFIG_CPU_HAS_LLSC=y 125CONFIG_CPU_HAS_LLSC=y
119CONFIG_CPU_HAS_SYNC=y 126CONFIG_CPU_HAS_SYNC=y
@@ -129,6 +136,7 @@ CONFIG_FLATMEM=y
129CONFIG_FLAT_NODE_MEM_MAP=y 136CONFIG_FLAT_NODE_MEM_MAP=y
130# CONFIG_SPARSEMEM_STATIC is not set 137# CONFIG_SPARSEMEM_STATIC is not set
131CONFIG_SPLIT_PTLOCK_CPUS=4 138CONFIG_SPLIT_PTLOCK_CPUS=4
139# CONFIG_RESOURCES_64BIT is not set
132# CONFIG_HZ_48 is not set 140# CONFIG_HZ_48 is not set
133# CONFIG_HZ_100 is not set 141# CONFIG_HZ_100 is not set
134# CONFIG_HZ_128 is not set 142# CONFIG_HZ_128 is not set
@@ -141,6 +149,7 @@ CONFIG_HZ=1000
141CONFIG_PREEMPT_NONE=y 149CONFIG_PREEMPT_NONE=y
142# CONFIG_PREEMPT_VOLUNTARY is not set 150# CONFIG_PREEMPT_VOLUNTARY is not set
143# CONFIG_PREEMPT is not set 151# CONFIG_PREEMPT is not set
152CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
144 153
145# 154#
146# Code maturity level options 155# Code maturity level options
@@ -172,14 +181,15 @@ CONFIG_PRINTK=y
172CONFIG_BUG=y 181CONFIG_BUG=y
173CONFIG_ELF_CORE=y 182CONFIG_ELF_CORE=y
174CONFIG_BASE_FULL=y 183CONFIG_BASE_FULL=y
184CONFIG_RT_MUTEXES=y
175CONFIG_FUTEX=y 185CONFIG_FUTEX=y
176CONFIG_EPOLL=y 186CONFIG_EPOLL=y
177CONFIG_SHMEM=y 187CONFIG_SHMEM=y
178CONFIG_SLAB=y 188CONFIG_SLAB=y
189CONFIG_VM_EVENT_COUNTERS=y
179# CONFIG_TINY_SHMEM is not set 190# CONFIG_TINY_SHMEM is not set
180CONFIG_BASE_SMALL=0 191CONFIG_BASE_SMALL=0
181# CONFIG_SLOB is not set 192# CONFIG_SLOB is not set
182CONFIG_OBSOLETE_INTERMODULE=y
183 193
184# 194#
185# Loadable module support 195# Loadable module support
@@ -282,6 +292,8 @@ CONFIG_IP_PNP_BOOTP=y
282# CONFIG_INET_IPCOMP is not set 292# CONFIG_INET_IPCOMP is not set
283# CONFIG_INET_XFRM_TUNNEL is not set 293# CONFIG_INET_XFRM_TUNNEL is not set
284# CONFIG_INET_TUNNEL is not set 294# CONFIG_INET_TUNNEL is not set
295CONFIG_INET_XFRM_MODE_TRANSPORT=m
296CONFIG_INET_XFRM_MODE_TUNNEL=m
285CONFIG_INET_DIAG=y 297CONFIG_INET_DIAG=y
286CONFIG_INET_TCP_DIAG=y 298CONFIG_INET_TCP_DIAG=y
287# CONFIG_TCP_CONG_ADVANCED is not set 299# CONFIG_TCP_CONG_ADVANCED is not set
@@ -294,6 +306,7 @@ CONFIG_TCP_CONG_BIC=y
294# CONFIG_IPV6 is not set 306# CONFIG_IPV6 is not set
295# CONFIG_INET6_XFRM_TUNNEL is not set 307# CONFIG_INET6_XFRM_TUNNEL is not set
296# CONFIG_INET6_TUNNEL is not set 308# CONFIG_INET6_TUNNEL is not set
309CONFIG_NETWORK_SECMARK=y
297CONFIG_NETFILTER=y 310CONFIG_NETFILTER=y
298# CONFIG_NETFILTER_DEBUG is not set 311# CONFIG_NETFILTER_DEBUG is not set
299 312
@@ -308,6 +321,7 @@ CONFIG_NETFILTER_XTABLES=m
308CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m 321CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
309CONFIG_NETFILTER_XT_TARGET_MARK=m 322CONFIG_NETFILTER_XT_TARGET_MARK=m
310CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m 323CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
324CONFIG_NETFILTER_XT_TARGET_SECMARK=m
311CONFIG_NETFILTER_XT_MATCH_COMMENT=m 325CONFIG_NETFILTER_XT_MATCH_COMMENT=m
312CONFIG_NETFILTER_XT_MATCH_DCCP=m 326CONFIG_NETFILTER_XT_MATCH_DCCP=m
313CONFIG_NETFILTER_XT_MATCH_ESP=m 327CONFIG_NETFILTER_XT_MATCH_ESP=m
@@ -318,8 +332,10 @@ CONFIG_NETFILTER_XT_MATCH_MARK=m
318CONFIG_NETFILTER_XT_MATCH_POLICY=m 332CONFIG_NETFILTER_XT_MATCH_POLICY=m
319CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m 333CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
320CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 334CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
335CONFIG_NETFILTER_XT_MATCH_QUOTA=m
321CONFIG_NETFILTER_XT_MATCH_REALM=m 336CONFIG_NETFILTER_XT_MATCH_REALM=m
322CONFIG_NETFILTER_XT_MATCH_SCTP=m 337CONFIG_NETFILTER_XT_MATCH_SCTP=m
338CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
323CONFIG_NETFILTER_XT_MATCH_STRING=m 339CONFIG_NETFILTER_XT_MATCH_STRING=m
324CONFIG_NETFILTER_XT_MATCH_TCPMSS=m 340CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
325 341
@@ -389,6 +405,7 @@ CONFIG_WIRELESS_EXT=y
389CONFIG_STANDALONE=y 405CONFIG_STANDALONE=y
390CONFIG_PREVENT_FIRMWARE_BUILD=y 406CONFIG_PREVENT_FIRMWARE_BUILD=y
391CONFIG_FW_LOADER=m 407CONFIG_FW_LOADER=m
408# CONFIG_SYS_HYPERVISOR is not set
392 409
393# 410#
394# Connector - unified userspace <-> kernelspace linker 411# Connector - unified userspace <-> kernelspace linker
@@ -470,6 +487,7 @@ CONFIG_MTD_ALCHEMY=y
470# 487#
471CONFIG_MTD_NAND=m 488CONFIG_MTD_NAND=m
472# CONFIG_MTD_NAND_VERIFY_WRITE is not set 489# CONFIG_MTD_NAND_VERIFY_WRITE is not set
490# CONFIG_MTD_NAND_ECC_SMC is not set
473CONFIG_MTD_NAND_IDS=m 491CONFIG_MTD_NAND_IDS=m
474CONFIG_MTD_NAND_AU1550=m 492CONFIG_MTD_NAND_AU1550=m
475# CONFIG_MTD_NAND_DISKONCHIP is not set 493# CONFIG_MTD_NAND_DISKONCHIP is not set
@@ -608,7 +626,7 @@ CONFIG_NETDEVICES=y
608# 626#
609# PHY device support 627# PHY device support
610# 628#
611CONFIG_PHYLIB=m 629CONFIG_PHYLIB=y
612 630
613# 631#
614# MII PHY device drivers 632# MII PHY device drivers
@@ -618,6 +636,8 @@ CONFIG_DAVICOM_PHY=m
618CONFIG_QSEMI_PHY=m 636CONFIG_QSEMI_PHY=m
619CONFIG_LXT_PHY=m 637CONFIG_LXT_PHY=m
620CONFIG_CICADA_PHY=m 638CONFIG_CICADA_PHY=m
639CONFIG_VITESSE_PHY=m
640CONFIG_SMSC_PHY=m
621 641
622# 642#
623# Ethernet (10 or 100Mbit) 643# Ethernet (10 or 100Mbit)
@@ -662,6 +682,7 @@ CONFIG_MIPS_AU1X00_ENET=y
662# CONFIG_CHELSIO_T1 is not set 682# CONFIG_CHELSIO_T1 is not set
663# CONFIG_IXGB is not set 683# CONFIG_IXGB is not set
664# CONFIG_S2IO is not set 684# CONFIG_S2IO is not set
685# CONFIG_MYRI10GE is not set
665 686
666# 687#
667# Token Ring devices 688# Token Ring devices
@@ -793,6 +814,7 @@ CONFIG_LEGACY_PTY_COUNT=256
793# Watchdog Cards 814# Watchdog Cards
794# 815#
795# CONFIG_WATCHDOG is not set 816# CONFIG_WATCHDOG is not set
817# CONFIG_HW_RANDOM is not set
796# CONFIG_RTC is not set 818# CONFIG_RTC is not set
797# CONFIG_GEN_RTC is not set 819# CONFIG_GEN_RTC is not set
798# CONFIG_DTLK is not set 820# CONFIG_DTLK is not set
@@ -848,6 +870,7 @@ CONFIG_SYNCLINK_CS=m
848# Multimedia devices 870# Multimedia devices
849# 871#
850# CONFIG_VIDEO_DEV is not set 872# CONFIG_VIDEO_DEV is not set
873CONFIG_VIDEO_V4L2=y
851 874
852# 875#
853# Digital Video Broadcasting Devices 876# Digital Video Broadcasting Devices
@@ -857,6 +880,7 @@ CONFIG_SYNCLINK_CS=m
857# 880#
858# Graphics support 881# Graphics support
859# 882#
883# CONFIG_FIRMWARE_EDID is not set
860# CONFIG_FB is not set 884# CONFIG_FB is not set
861 885
862# 886#
@@ -914,6 +938,19 @@ CONFIG_USB_ARCH_HAS_EHCI=y
914# CONFIG_RTC_CLASS is not set 938# CONFIG_RTC_CLASS is not set
915 939
916# 940#
941# DMA Engine support
942#
943# CONFIG_DMA_ENGINE is not set
944
945#
946# DMA Clients
947#
948
949#
950# DMA Devices
951#
952
953#
917# File systems 954# File systems
918# 955#
919CONFIG_EXT2_FS=y 956CONFIG_EXT2_FS=y
@@ -941,6 +978,7 @@ CONFIG_FS_POSIX_ACL=y
941# CONFIG_MINIX_FS is not set 978# CONFIG_MINIX_FS is not set
942# CONFIG_ROMFS_FS is not set 979# CONFIG_ROMFS_FS is not set
943CONFIG_INOTIFY=y 980CONFIG_INOTIFY=y
981CONFIG_INOTIFY_USER=y
944# CONFIG_QUOTA is not set 982# CONFIG_QUOTA is not set
945CONFIG_DNOTIFY=y 983CONFIG_DNOTIFY=y
946CONFIG_AUTOFS_FS=m 984CONFIG_AUTOFS_FS=m
@@ -1010,6 +1048,7 @@ CONFIG_SUNRPC=y
1010CONFIG_SMB_FS=m 1048CONFIG_SMB_FS=m
1011# CONFIG_SMB_NLS_DEFAULT is not set 1049# CONFIG_SMB_NLS_DEFAULT is not set
1012# CONFIG_CIFS is not set 1050# CONFIG_CIFS is not set
1051# CONFIG_CIFS_DEBUG2 is not set
1013# CONFIG_NCP_FS is not set 1052# CONFIG_NCP_FS is not set
1014# CONFIG_CODA_FS is not set 1053# CONFIG_CODA_FS is not set
1015# CONFIG_AFS_FS is not set 1054# CONFIG_AFS_FS is not set
@@ -1075,6 +1114,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1075# 1114#
1076# CONFIG_PRINTK_TIME is not set 1115# CONFIG_PRINTK_TIME is not set
1077# CONFIG_MAGIC_SYSRQ is not set 1116# CONFIG_MAGIC_SYSRQ is not set
1117# CONFIG_UNUSED_SYMBOLS is not set
1078# CONFIG_DEBUG_KERNEL is not set 1118# CONFIG_DEBUG_KERNEL is not set
1079CONFIG_LOG_BUF_SHIFT=14 1119CONFIG_LOG_BUF_SHIFT=14
1080# CONFIG_DEBUG_FS is not set 1120# CONFIG_DEBUG_FS is not set
@@ -1134,3 +1174,4 @@ CONFIG_TEXTSEARCH=y
1134CONFIG_TEXTSEARCH_KMP=m 1174CONFIG_TEXTSEARCH_KMP=m
1135CONFIG_TEXTSEARCH_BM=m 1175CONFIG_TEXTSEARCH_BM=m
1136CONFIG_TEXTSEARCH_FSM=m 1176CONFIG_TEXTSEARCH_FSM=m
1177CONFIG_PLIST=y
diff --git a/arch/mips/configs/ddb5477_defconfig b/arch/mips/configs/ddb5477_defconfig
index c1c6bfee970e..b598cf08f156 100644
--- a/arch/mips/configs/ddb5477_defconfig
+++ b/arch/mips/configs/ddb5477_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:51:01 2006 4# Thu Jul 6 10:04:00 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_DDB5477=y
45# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -66,6 +69,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
66CONFIG_GENERIC_FIND_NEXT_BIT=y 69CONFIG_GENERIC_FIND_NEXT_BIT=y
67CONFIG_GENERIC_HWEIGHT=y 70CONFIG_GENERIC_HWEIGHT=y
68CONFIG_GENERIC_CALIBRATE_DELAY=y 71CONFIG_GENERIC_CALIBRATE_DELAY=y
72CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
69CONFIG_DMA_NONCOHERENT=y 73CONFIG_DMA_NONCOHERENT=y
70CONFIG_DMA_NEED_PCI_MAP_STATE=y 74CONFIG_DMA_NEED_PCI_MAP_STATE=y
71CONFIG_I8259=y 75CONFIG_I8259=y
@@ -113,7 +117,10 @@ CONFIG_PAGE_SIZE_4KB=y
113# CONFIG_PAGE_SIZE_8KB is not set 117# CONFIG_PAGE_SIZE_8KB is not set
114# CONFIG_PAGE_SIZE_16KB is not set 118# CONFIG_PAGE_SIZE_16KB is not set
115# CONFIG_PAGE_SIZE_64KB is not set 119# CONFIG_PAGE_SIZE_64KB is not set
116# CONFIG_MIPS_MT is not set 120CONFIG_MIPS_MT_DISABLED=y
121# CONFIG_MIPS_MT_SMTC is not set
122# CONFIG_MIPS_MT_SMP is not set
123# CONFIG_MIPS_VPE_LOADER is not set
117CONFIG_CPU_HAS_LLSC=y 124CONFIG_CPU_HAS_LLSC=y
118CONFIG_CPU_HAS_SYNC=y 125CONFIG_CPU_HAS_SYNC=y
119CONFIG_GENERIC_HARDIRQS=y 126CONFIG_GENERIC_HARDIRQS=y
@@ -127,6 +134,7 @@ CONFIG_FLATMEM=y
127CONFIG_FLAT_NODE_MEM_MAP=y 134CONFIG_FLAT_NODE_MEM_MAP=y
128# CONFIG_SPARSEMEM_STATIC is not set 135# CONFIG_SPARSEMEM_STATIC is not set
129CONFIG_SPLIT_PTLOCK_CPUS=4 136CONFIG_SPLIT_PTLOCK_CPUS=4
137# CONFIG_RESOURCES_64BIT is not set
130# CONFIG_HZ_48 is not set 138# CONFIG_HZ_48 is not set
131# CONFIG_HZ_100 is not set 139# CONFIG_HZ_100 is not set
132# CONFIG_HZ_128 is not set 140# CONFIG_HZ_128 is not set
@@ -139,6 +147,7 @@ CONFIG_HZ=1000
139CONFIG_PREEMPT_NONE=y 147CONFIG_PREEMPT_NONE=y
140# CONFIG_PREEMPT_VOLUNTARY is not set 148# CONFIG_PREEMPT_VOLUNTARY is not set
141# CONFIG_PREEMPT is not set 149# CONFIG_PREEMPT is not set
150CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
142 151
143# 152#
144# Code maturity level options 153# Code maturity level options
@@ -170,10 +179,12 @@ CONFIG_PRINTK=y
170CONFIG_BUG=y 179CONFIG_BUG=y
171CONFIG_ELF_CORE=y 180CONFIG_ELF_CORE=y
172CONFIG_BASE_FULL=y 181CONFIG_BASE_FULL=y
182CONFIG_RT_MUTEXES=y
173CONFIG_FUTEX=y 183CONFIG_FUTEX=y
174CONFIG_EPOLL=y 184CONFIG_EPOLL=y
175CONFIG_SHMEM=y 185CONFIG_SHMEM=y
176CONFIG_SLAB=y 186CONFIG_SLAB=y
187CONFIG_VM_EVENT_COUNTERS=y
177# CONFIG_TINY_SHMEM is not set 188# CONFIG_TINY_SHMEM is not set
178CONFIG_BASE_SMALL=0 189CONFIG_BASE_SMALL=0
179# CONFIG_SLOB is not set 190# CONFIG_SLOB is not set
@@ -259,6 +270,8 @@ CONFIG_IP_PNP_BOOTP=y
259# CONFIG_INET_IPCOMP is not set 270# CONFIG_INET_IPCOMP is not set
260# CONFIG_INET_XFRM_TUNNEL is not set 271# CONFIG_INET_XFRM_TUNNEL is not set
261# CONFIG_INET_TUNNEL is not set 272# CONFIG_INET_TUNNEL is not set
273CONFIG_INET_XFRM_MODE_TRANSPORT=y
274CONFIG_INET_XFRM_MODE_TUNNEL=y
262CONFIG_INET_DIAG=y 275CONFIG_INET_DIAG=y
263CONFIG_INET_TCP_DIAG=y 276CONFIG_INET_TCP_DIAG=y
264# CONFIG_TCP_CONG_ADVANCED is not set 277# CONFIG_TCP_CONG_ADVANCED is not set
@@ -266,6 +279,7 @@ CONFIG_TCP_CONG_BIC=y
266# CONFIG_IPV6 is not set 279# CONFIG_IPV6 is not set
267# CONFIG_INET6_XFRM_TUNNEL is not set 280# CONFIG_INET6_XFRM_TUNNEL is not set
268# CONFIG_INET6_TUNNEL is not set 281# CONFIG_INET6_TUNNEL is not set
282CONFIG_NETWORK_SECMARK=y
269# CONFIG_NETFILTER is not set 283# CONFIG_NETFILTER is not set
270 284
271# 285#
@@ -325,6 +339,7 @@ CONFIG_WIRELESS_EXT=y
325CONFIG_STANDALONE=y 339CONFIG_STANDALONE=y
326CONFIG_PREVENT_FIRMWARE_BUILD=y 340CONFIG_PREVENT_FIRMWARE_BUILD=y
327CONFIG_FW_LOADER=y 341CONFIG_FW_LOADER=y
342# CONFIG_SYS_HYPERVISOR is not set
328 343
329# 344#
330# Connector - unified userspace <-> kernelspace linker 345# Connector - unified userspace <-> kernelspace linker
@@ -422,6 +437,8 @@ CONFIG_DAVICOM_PHY=y
422CONFIG_QSEMI_PHY=y 437CONFIG_QSEMI_PHY=y
423CONFIG_LXT_PHY=y 438CONFIG_LXT_PHY=y
424CONFIG_CICADA_PHY=y 439CONFIG_CICADA_PHY=y
440CONFIG_VITESSE_PHY=y
441CONFIG_SMSC_PHY=y
425 442
426# 443#
427# Ethernet (10 or 100Mbit) 444# Ethernet (10 or 100Mbit)
@@ -484,6 +501,7 @@ CONFIG_PCNET32=y
484# CONFIG_CHELSIO_T1 is not set 501# CONFIG_CHELSIO_T1 is not set
485# CONFIG_IXGB is not set 502# CONFIG_IXGB is not set
486# CONFIG_S2IO is not set 503# CONFIG_S2IO is not set
504# CONFIG_MYRI10GE is not set
487 505
488# 506#
489# Token Ring devices 507# Token Ring devices
@@ -561,6 +579,7 @@ CONFIG_SERIO_RAW=y
561CONFIG_VT=y 579CONFIG_VT=y
562CONFIG_VT_CONSOLE=y 580CONFIG_VT_CONSOLE=y
563CONFIG_HW_CONSOLE=y 581CONFIG_HW_CONSOLE=y
582CONFIG_VT_HW_CONSOLE_BINDING=y
564# CONFIG_SERIAL_NONSTANDARD is not set 583# CONFIG_SERIAL_NONSTANDARD is not set
565 584
566# 585#
@@ -592,6 +611,7 @@ CONFIG_LEGACY_PTY_COUNT=256
592# Watchdog Cards 611# Watchdog Cards
593# 612#
594# CONFIG_WATCHDOG is not set 613# CONFIG_WATCHDOG is not set
614# CONFIG_HW_RANDOM is not set
595# CONFIG_RTC is not set 615# CONFIG_RTC is not set
596# CONFIG_GEN_RTC is not set 616# CONFIG_GEN_RTC is not set
597# CONFIG_DTLK is not set 617# CONFIG_DTLK is not set
@@ -640,6 +660,7 @@ CONFIG_LEGACY_PTY_COUNT=256
640# Multimedia devices 660# Multimedia devices
641# 661#
642# CONFIG_VIDEO_DEV is not set 662# CONFIG_VIDEO_DEV is not set
663CONFIG_VIDEO_V4L2=y
643 664
644# 665#
645# Digital Video Broadcasting Devices 666# Digital Video Broadcasting Devices
@@ -649,6 +670,7 @@ CONFIG_LEGACY_PTY_COUNT=256
649# 670#
650# Graphics support 671# Graphics support
651# 672#
673# CONFIG_FIRMWARE_EDID is not set
652# CONFIG_FB is not set 674# CONFIG_FB is not set
653 675
654# 676#
@@ -712,6 +734,19 @@ CONFIG_USB_ARCH_HAS_EHCI=y
712# CONFIG_RTC_CLASS is not set 734# CONFIG_RTC_CLASS is not set
713 735
714# 736#
737# DMA Engine support
738#
739# CONFIG_DMA_ENGINE is not set
740
741#
742# DMA Clients
743#
744
745#
746# DMA Devices
747#
748
749#
715# File systems 750# File systems
716# 751#
717CONFIG_EXT2_FS=y 752CONFIG_EXT2_FS=y
@@ -726,6 +761,7 @@ CONFIG_EXT2_FS=y
726# CONFIG_MINIX_FS is not set 761# CONFIG_MINIX_FS is not set
727# CONFIG_ROMFS_FS is not set 762# CONFIG_ROMFS_FS is not set
728CONFIG_INOTIFY=y 763CONFIG_INOTIFY=y
764CONFIG_INOTIFY_USER=y
729# CONFIG_QUOTA is not set 765# CONFIG_QUOTA is not set
730CONFIG_DNOTIFY=y 766CONFIG_DNOTIFY=y
731CONFIG_AUTOFS_FS=y 767CONFIG_AUTOFS_FS=y
@@ -792,6 +828,7 @@ CONFIG_SUNRPC=y
792# CONFIG_RPCSEC_GSS_SPKM3 is not set 828# CONFIG_RPCSEC_GSS_SPKM3 is not set
793# CONFIG_SMB_FS is not set 829# CONFIG_SMB_FS is not set
794# CONFIG_CIFS is not set 830# CONFIG_CIFS is not set
831# CONFIG_CIFS_DEBUG2 is not set
795# CONFIG_NCP_FS is not set 832# CONFIG_NCP_FS is not set
796# CONFIG_CODA_FS is not set 833# CONFIG_CODA_FS is not set
797# CONFIG_AFS_FS is not set 834# CONFIG_AFS_FS is not set
@@ -818,6 +855,7 @@ CONFIG_MSDOS_PARTITION=y
818# 855#
819# CONFIG_PRINTK_TIME is not set 856# CONFIG_PRINTK_TIME is not set
820# CONFIG_MAGIC_SYSRQ is not set 857# CONFIG_MAGIC_SYSRQ is not set
858# CONFIG_UNUSED_SYMBOLS is not set
821# CONFIG_DEBUG_KERNEL is not set 859# CONFIG_DEBUG_KERNEL is not set
822CONFIG_LOG_BUF_SHIFT=14 860CONFIG_LOG_BUF_SHIFT=14
823# CONFIG_DEBUG_FS is not set 861# CONFIG_DEBUG_FS is not set
@@ -859,7 +897,6 @@ CONFIG_CRYPTO_ANUBIS=y
859CONFIG_CRYPTO_DEFLATE=y 897CONFIG_CRYPTO_DEFLATE=y
860CONFIG_CRYPTO_MICHAEL_MIC=y 898CONFIG_CRYPTO_MICHAEL_MIC=y
861CONFIG_CRYPTO_CRC32C=y 899CONFIG_CRYPTO_CRC32C=y
862# CONFIG_CRYPTO_TEST is not set
863 900
864# 901#
865# Hardware crypto devices 902# Hardware crypto devices
@@ -874,3 +911,4 @@ CONFIG_CRC32=y
874CONFIG_LIBCRC32C=y 911CONFIG_LIBCRC32C=y
875CONFIG_ZLIB_INFLATE=y 912CONFIG_ZLIB_INFLATE=y
876CONFIG_ZLIB_DEFLATE=y 913CONFIG_ZLIB_DEFLATE=y
914CONFIG_PLIST=y
diff --git a/arch/mips/configs/decstation_defconfig b/arch/mips/configs/decstation_defconfig
index d5d0d3faae94..597150b14077 100644
--- a/arch/mips/configs/decstation_defconfig
+++ b/arch/mips/configs/decstation_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:51:01 2006 4# Thu Jul 6 10:04:01 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25CONFIG_MACH_DECSTATION=y 26CONFIG_MACH_DECSTATION=y
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MACH_DECSTATION=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MACH_DECSTATION=y
45# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -66,6 +69,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
66CONFIG_GENERIC_FIND_NEXT_BIT=y 69CONFIG_GENERIC_FIND_NEXT_BIT=y
67CONFIG_GENERIC_HWEIGHT=y 70CONFIG_GENERIC_HWEIGHT=y
68CONFIG_GENERIC_CALIBRATE_DELAY=y 71CONFIG_GENERIC_CALIBRATE_DELAY=y
72CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
69CONFIG_DMA_NONCOHERENT=y 73CONFIG_DMA_NONCOHERENT=y
70CONFIG_DMA_NEED_PCI_MAP_STATE=y 74CONFIG_DMA_NEED_PCI_MAP_STATE=y
71# CONFIG_CPU_BIG_ENDIAN is not set 75# CONFIG_CPU_BIG_ENDIAN is not set
@@ -112,7 +116,10 @@ CONFIG_PAGE_SIZE_4KB=y
112# CONFIG_PAGE_SIZE_8KB is not set 116# CONFIG_PAGE_SIZE_8KB is not set
113# CONFIG_PAGE_SIZE_16KB is not set 117# CONFIG_PAGE_SIZE_16KB is not set
114# CONFIG_PAGE_SIZE_64KB is not set 118# CONFIG_PAGE_SIZE_64KB is not set
115# CONFIG_MIPS_MT is not set 119CONFIG_MIPS_MT_DISABLED=y
120# CONFIG_MIPS_MT_SMTC is not set
121# CONFIG_MIPS_MT_SMP is not set
122# CONFIG_MIPS_VPE_LOADER is not set
116CONFIG_CPU_HAS_WB=y 123CONFIG_CPU_HAS_WB=y
117CONFIG_GENERIC_HARDIRQS=y 124CONFIG_GENERIC_HARDIRQS=y
118CONFIG_GENERIC_IRQ_PROBE=y 125CONFIG_GENERIC_IRQ_PROBE=y
@@ -126,6 +133,7 @@ CONFIG_FLATMEM=y
126CONFIG_FLAT_NODE_MEM_MAP=y 133CONFIG_FLAT_NODE_MEM_MAP=y
127# CONFIG_SPARSEMEM_STATIC is not set 134# CONFIG_SPARSEMEM_STATIC is not set
128CONFIG_SPLIT_PTLOCK_CPUS=4 135CONFIG_SPLIT_PTLOCK_CPUS=4
136# CONFIG_RESOURCES_64BIT is not set
129# CONFIG_HZ_48 is not set 137# CONFIG_HZ_48 is not set
130# CONFIG_HZ_100 is not set 138# CONFIG_HZ_100 is not set
131CONFIG_HZ_128=y 139CONFIG_HZ_128=y
@@ -140,6 +148,7 @@ CONFIG_HZ=128
140CONFIG_PREEMPT_NONE=y 148CONFIG_PREEMPT_NONE=y
141# CONFIG_PREEMPT_VOLUNTARY is not set 149# CONFIG_PREEMPT_VOLUNTARY is not set
142# CONFIG_PREEMPT is not set 150# CONFIG_PREEMPT is not set
151CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
143 152
144# 153#
145# Code maturity level options 154# Code maturity level options
@@ -172,10 +181,12 @@ CONFIG_PRINTK=y
172CONFIG_BUG=y 181CONFIG_BUG=y
173CONFIG_ELF_CORE=y 182CONFIG_ELF_CORE=y
174CONFIG_BASE_FULL=y 183CONFIG_BASE_FULL=y
184CONFIG_RT_MUTEXES=y
175CONFIG_FUTEX=y 185CONFIG_FUTEX=y
176CONFIG_EPOLL=y 186CONFIG_EPOLL=y
177CONFIG_SHMEM=y 187CONFIG_SHMEM=y
178CONFIG_SLAB=y 188CONFIG_SLAB=y
189CONFIG_VM_EVENT_COUNTERS=y
179# CONFIG_TINY_SHMEM is not set 190# CONFIG_TINY_SHMEM is not set
180CONFIG_BASE_SMALL=0 191CONFIG_BASE_SMALL=0
181# CONFIG_SLOB is not set 192# CONFIG_SLOB is not set
@@ -244,6 +255,8 @@ CONFIG_NET=y
244CONFIG_PACKET=y 255CONFIG_PACKET=y
245CONFIG_PACKET_MMAP=y 256CONFIG_PACKET_MMAP=y
246CONFIG_UNIX=y 257CONFIG_UNIX=y
258CONFIG_XFRM=y
259# CONFIG_XFRM_USER is not set
247# CONFIG_NET_KEY is not set 260# CONFIG_NET_KEY is not set
248CONFIG_INET=y 261CONFIG_INET=y
249# CONFIG_IP_MULTICAST is not set 262# CONFIG_IP_MULTICAST is not set
@@ -262,6 +275,8 @@ CONFIG_IP_PNP_BOOTP=y
262# CONFIG_INET_IPCOMP is not set 275# CONFIG_INET_IPCOMP is not set
263# CONFIG_INET_XFRM_TUNNEL is not set 276# CONFIG_INET_XFRM_TUNNEL is not set
264# CONFIG_INET_TUNNEL is not set 277# CONFIG_INET_TUNNEL is not set
278CONFIG_INET_XFRM_MODE_TRANSPORT=m
279CONFIG_INET_XFRM_MODE_TUNNEL=m
265CONFIG_INET_DIAG=y 280CONFIG_INET_DIAG=y
266CONFIG_INET_TCP_DIAG=y 281CONFIG_INET_TCP_DIAG=y
267# CONFIG_TCP_CONG_ADVANCED is not set 282# CONFIG_TCP_CONG_ADVANCED is not set
@@ -269,6 +284,7 @@ CONFIG_TCP_CONG_BIC=y
269# CONFIG_IPV6 is not set 284# CONFIG_IPV6 is not set
270# CONFIG_INET6_XFRM_TUNNEL is not set 285# CONFIG_INET6_XFRM_TUNNEL is not set
271# CONFIG_INET6_TUNNEL is not set 286# CONFIG_INET6_TUNNEL is not set
287CONFIG_NETWORK_SECMARK=y
272# CONFIG_NETFILTER is not set 288# CONFIG_NETFILTER is not set
273 289
274# 290#
@@ -329,6 +345,7 @@ CONFIG_STANDALONE=y
329CONFIG_PREVENT_FIRMWARE_BUILD=y 345CONFIG_PREVENT_FIRMWARE_BUILD=y
330# CONFIG_FW_LOADER is not set 346# CONFIG_FW_LOADER is not set
331# CONFIG_DEBUG_DRIVER is not set 347# CONFIG_DEBUG_DRIVER is not set
348# CONFIG_SYS_HYPERVISOR is not set
332 349
333# 350#
334# Connector - unified userspace <-> kernelspace linker 351# Connector - unified userspace <-> kernelspace linker
@@ -448,6 +465,8 @@ CONFIG_DAVICOM_PHY=m
448CONFIG_QSEMI_PHY=m 465CONFIG_QSEMI_PHY=m
449CONFIG_LXT_PHY=m 466CONFIG_LXT_PHY=m
450CONFIG_CICADA_PHY=m 467CONFIG_CICADA_PHY=m
468CONFIG_VITESSE_PHY=m
469CONFIG_SMSC_PHY=m
451 470
452# 471#
453# Ethernet (10 or 100Mbit) 472# Ethernet (10 or 100Mbit)
@@ -537,6 +556,7 @@ CONFIG_LEGACY_PTY_COUNT=256
537# Watchdog Cards 556# Watchdog Cards
538# 557#
539# CONFIG_WATCHDOG is not set 558# CONFIG_WATCHDOG is not set
559# CONFIG_HW_RANDOM is not set
540CONFIG_RTC=y 560CONFIG_RTC=y
541# CONFIG_DTLK is not set 561# CONFIG_DTLK is not set
542# CONFIG_R3964 is not set 562# CONFIG_R3964 is not set
@@ -582,6 +602,7 @@ CONFIG_RTC=y
582# Multimedia devices 602# Multimedia devices
583# 603#
584# CONFIG_VIDEO_DEV is not set 604# CONFIG_VIDEO_DEV is not set
605CONFIG_VIDEO_V4L2=y
585 606
586# 607#
587# Digital Video Broadcasting Devices 608# Digital Video Broadcasting Devices
@@ -591,12 +612,13 @@ CONFIG_RTC=y
591# 612#
592# Graphics support 613# Graphics support
593# 614#
615# CONFIG_FIRMWARE_EDID is not set
594CONFIG_FB=y 616CONFIG_FB=y
595CONFIG_FB_CFB_FILLRECT=y 617CONFIG_FB_CFB_FILLRECT=y
596CONFIG_FB_CFB_COPYAREA=y 618CONFIG_FB_CFB_COPYAREA=y
597CONFIG_FB_CFB_IMAGEBLIT=y 619CONFIG_FB_CFB_IMAGEBLIT=y
598# CONFIG_FB_MACMODES is not set 620# CONFIG_FB_MACMODES is not set
599CONFIG_FB_FIRMWARE_EDID=y 621# CONFIG_FB_BACKLIGHT is not set
600# CONFIG_FB_MODE_HELPERS is not set 622# CONFIG_FB_MODE_HELPERS is not set
601# CONFIG_FB_TILEBLITTING is not set 623# CONFIG_FB_TILEBLITTING is not set
602# CONFIG_FB_S1D13XXX is not set 624# CONFIG_FB_S1D13XXX is not set
@@ -669,6 +691,19 @@ CONFIG_LOGO_DEC_CLUT224=y
669# CONFIG_RTC_CLASS is not set 691# CONFIG_RTC_CLASS is not set
670 692
671# 693#
694# DMA Engine support
695#
696# CONFIG_DMA_ENGINE is not set
697
698#
699# DMA Clients
700#
701
702#
703# DMA Devices
704#
705
706#
672# File systems 707# File systems
673# 708#
674CONFIG_EXT2_FS=y 709CONFIG_EXT2_FS=y
@@ -686,6 +721,7 @@ CONFIG_FS_POSIX_ACL=y
686# CONFIG_MINIX_FS is not set 721# CONFIG_MINIX_FS is not set
687# CONFIG_ROMFS_FS is not set 722# CONFIG_ROMFS_FS is not set
688CONFIG_INOTIFY=y 723CONFIG_INOTIFY=y
724CONFIG_INOTIFY_USER=y
689# CONFIG_QUOTA is not set 725# CONFIG_QUOTA is not set
690CONFIG_DNOTIFY=y 726CONFIG_DNOTIFY=y
691# CONFIG_AUTOFS_FS is not set 727# CONFIG_AUTOFS_FS is not set
@@ -732,6 +768,8 @@ CONFIG_RAMFS=y
732# CONFIG_QNX4FS_FS is not set 768# CONFIG_QNX4FS_FS is not set
733# CONFIG_SYSV_FS is not set 769# CONFIG_SYSV_FS is not set
734CONFIG_UFS_FS=y 770CONFIG_UFS_FS=y
771# CONFIG_UFS_FS_WRITE is not set
772# CONFIG_UFS_DEBUG is not set
735 773
736# 774#
737# Network File Systems 775# Network File Systems
@@ -751,6 +789,7 @@ CONFIG_SUNRPC=y
751# CONFIG_RPCSEC_GSS_SPKM3 is not set 789# CONFIG_RPCSEC_GSS_SPKM3 is not set
752# CONFIG_SMB_FS is not set 790# CONFIG_SMB_FS is not set
753# CONFIG_CIFS is not set 791# CONFIG_CIFS is not set
792# CONFIG_CIFS_DEBUG2 is not set
754# CONFIG_NCP_FS is not set 793# CONFIG_NCP_FS is not set
755# CONFIG_CODA_FS is not set 794# CONFIG_CODA_FS is not set
756# CONFIG_AFS_FS is not set 795# CONFIG_AFS_FS is not set
@@ -792,14 +831,19 @@ CONFIG_ULTRIX_PARTITION=y
792# 831#
793# CONFIG_PRINTK_TIME is not set 832# CONFIG_PRINTK_TIME is not set
794CONFIG_MAGIC_SYSRQ=y 833CONFIG_MAGIC_SYSRQ=y
834# CONFIG_UNUSED_SYMBOLS is not set
795CONFIG_DEBUG_KERNEL=y 835CONFIG_DEBUG_KERNEL=y
796CONFIG_LOG_BUF_SHIFT=14 836CONFIG_LOG_BUF_SHIFT=14
797CONFIG_DETECT_SOFTLOCKUP=y 837CONFIG_DETECT_SOFTLOCKUP=y
798# CONFIG_SCHEDSTATS is not set 838# CONFIG_SCHEDSTATS is not set
799# CONFIG_DEBUG_SLAB is not set 839# CONFIG_DEBUG_SLAB is not set
800CONFIG_DEBUG_MUTEXES=y 840# CONFIG_DEBUG_RT_MUTEXES is not set
841# CONFIG_RT_MUTEX_TESTER is not set
801# CONFIG_DEBUG_SPINLOCK is not set 842# CONFIG_DEBUG_SPINLOCK is not set
843CONFIG_DEBUG_MUTEXES=y
844# CONFIG_DEBUG_RWSEMS is not set
802# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 845# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
846# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
803# CONFIG_DEBUG_KOBJECT is not set 847# CONFIG_DEBUG_KOBJECT is not set
804# CONFIG_DEBUG_INFO is not set 848# CONFIG_DEBUG_INFO is not set
805# CONFIG_DEBUG_FS is not set 849# CONFIG_DEBUG_FS is not set
@@ -862,3 +906,4 @@ CONFIG_CRC32=y
862CONFIG_LIBCRC32C=m 906CONFIG_LIBCRC32C=m
863CONFIG_ZLIB_INFLATE=m 907CONFIG_ZLIB_INFLATE=m
864CONFIG_ZLIB_DEFLATE=m 908CONFIG_ZLIB_DEFLATE=m
909CONFIG_PLIST=y
diff --git a/arch/mips/configs/e55_defconfig b/arch/mips/configs/e55_defconfig
index 439677ba751c..fa2996bb4b7c 100644
--- a/arch/mips/configs/e55_defconfig
+++ b/arch/mips/configs/e55_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Tue Apr 25 00:08:20 2006 4# Thu Jul 6 10:04:02 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MIPS=y
45CONFIG_MACH_VR41XX=y 47CONFIG_MACH_VR41XX=y
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -71,6 +74,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
71CONFIG_GENERIC_FIND_NEXT_BIT=y 74CONFIG_GENERIC_FIND_NEXT_BIT=y
72CONFIG_GENERIC_HWEIGHT=y 75CONFIG_GENERIC_HWEIGHT=y
73CONFIG_GENERIC_CALIBRATE_DELAY=y 76CONFIG_GENERIC_CALIBRATE_DELAY=y
77CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
74CONFIG_DMA_NONCOHERENT=y 78CONFIG_DMA_NONCOHERENT=y
75CONFIG_DMA_NEED_PCI_MAP_STATE=y 79CONFIG_DMA_NEED_PCI_MAP_STATE=y
76# CONFIG_CPU_BIG_ENDIAN is not set 80# CONFIG_CPU_BIG_ENDIAN is not set
@@ -115,7 +119,10 @@ CONFIG_PAGE_SIZE_4KB=y
115# CONFIG_PAGE_SIZE_8KB is not set 119# CONFIG_PAGE_SIZE_8KB is not set
116# CONFIG_PAGE_SIZE_16KB is not set 120# CONFIG_PAGE_SIZE_16KB is not set
117# CONFIG_PAGE_SIZE_64KB is not set 121# CONFIG_PAGE_SIZE_64KB is not set
118# CONFIG_MIPS_MT is not set 122CONFIG_MIPS_MT_DISABLED=y
123# CONFIG_MIPS_MT_SMTC is not set
124# CONFIG_MIPS_MT_SMP is not set
125# CONFIG_MIPS_VPE_LOADER is not set
119CONFIG_CPU_HAS_SYNC=y 126CONFIG_CPU_HAS_SYNC=y
120CONFIG_GENERIC_HARDIRQS=y 127CONFIG_GENERIC_HARDIRQS=y
121CONFIG_GENERIC_IRQ_PROBE=y 128CONFIG_GENERIC_IRQ_PROBE=y
@@ -128,6 +135,7 @@ CONFIG_FLATMEM=y
128CONFIG_FLAT_NODE_MEM_MAP=y 135CONFIG_FLAT_NODE_MEM_MAP=y
129# CONFIG_SPARSEMEM_STATIC is not set 136# CONFIG_SPARSEMEM_STATIC is not set
130CONFIG_SPLIT_PTLOCK_CPUS=4 137CONFIG_SPLIT_PTLOCK_CPUS=4
138# CONFIG_RESOURCES_64BIT is not set
131# CONFIG_HZ_48 is not set 139# CONFIG_HZ_48 is not set
132# CONFIG_HZ_100 is not set 140# CONFIG_HZ_100 is not set
133# CONFIG_HZ_128 is not set 141# CONFIG_HZ_128 is not set
@@ -140,6 +148,7 @@ CONFIG_HZ=1000
140CONFIG_PREEMPT_NONE=y 148CONFIG_PREEMPT_NONE=y
141# CONFIG_PREEMPT_VOLUNTARY is not set 149# CONFIG_PREEMPT_VOLUNTARY is not set
142# CONFIG_PREEMPT is not set 150# CONFIG_PREEMPT is not set
151CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
143 152
144# 153#
145# Code maturity level options 154# Code maturity level options
@@ -169,10 +178,12 @@ CONFIG_PRINTK=y
169CONFIG_BUG=y 178CONFIG_BUG=y
170CONFIG_ELF_CORE=y 179CONFIG_ELF_CORE=y
171CONFIG_BASE_FULL=y 180CONFIG_BASE_FULL=y
181CONFIG_RT_MUTEXES=y
172CONFIG_FUTEX=y 182CONFIG_FUTEX=y
173CONFIG_EPOLL=y 183CONFIG_EPOLL=y
174CONFIG_SHMEM=y 184CONFIG_SHMEM=y
175CONFIG_SLAB=y 185CONFIG_SLAB=y
186CONFIG_VM_EVENT_COUNTERS=y
176# CONFIG_TINY_SHMEM is not set 187# CONFIG_TINY_SHMEM is not set
177CONFIG_BASE_SMALL=0 188CONFIG_BASE_SMALL=0
178# CONFIG_SLOB is not set 189# CONFIG_SLOB is not set
@@ -244,6 +255,7 @@ CONFIG_TRAD_SIGNALS=y
244CONFIG_STANDALONE=y 255CONFIG_STANDALONE=y
245CONFIG_PREVENT_FIRMWARE_BUILD=y 256CONFIG_PREVENT_FIRMWARE_BUILD=y
246# CONFIG_FW_LOADER is not set 257# CONFIG_FW_LOADER is not set
258# CONFIG_SYS_HYPERVISOR is not set
247 259
248# 260#
249# Connector - unified userspace <-> kernelspace linker 261# Connector - unified userspace <-> kernelspace linker
@@ -378,6 +390,7 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=240
378CONFIG_VT=y 390CONFIG_VT=y
379CONFIG_VT_CONSOLE=y 391CONFIG_VT_CONSOLE=y
380CONFIG_HW_CONSOLE=y 392CONFIG_HW_CONSOLE=y
393CONFIG_VT_HW_CONSOLE_BINDING=y
381# CONFIG_SERIAL_NONSTANDARD is not set 394# CONFIG_SERIAL_NONSTANDARD is not set
382 395
383# 396#
@@ -418,6 +431,7 @@ CONFIG_WATCHDOG=y
418# CONFIG_PCWATCHDOG is not set 431# CONFIG_PCWATCHDOG is not set
419# CONFIG_MIXCOMWD is not set 432# CONFIG_MIXCOMWD is not set
420# CONFIG_WDT is not set 433# CONFIG_WDT is not set
434# CONFIG_HW_RANDOM is not set
421# CONFIG_RTC is not set 435# CONFIG_RTC is not set
422# CONFIG_GEN_RTC is not set 436# CONFIG_GEN_RTC is not set
423# CONFIG_DTLK is not set 437# CONFIG_DTLK is not set
@@ -449,7 +463,6 @@ CONFIG_GPIO_VR41XX=y
449# 463#
450# Dallas's 1-wire bus 464# Dallas's 1-wire bus
451# 465#
452# CONFIG_W1 is not set
453 466
454# 467#
455# Hardware Monitoring support 468# Hardware Monitoring support
@@ -465,6 +478,7 @@ CONFIG_GPIO_VR41XX=y
465# Multimedia devices 478# Multimedia devices
466# 479#
467# CONFIG_VIDEO_DEV is not set 480# CONFIG_VIDEO_DEV is not set
481CONFIG_VIDEO_V4L2=y
468 482
469# 483#
470# Digital Video Broadcasting Devices 484# Digital Video Broadcasting Devices
@@ -473,6 +487,7 @@ CONFIG_GPIO_VR41XX=y
473# 487#
474# Graphics support 488# Graphics support
475# 489#
490# CONFIG_FIRMWARE_EDID is not set
476# CONFIG_FB is not set 491# CONFIG_FB is not set
477 492
478# 493#
@@ -535,6 +550,19 @@ CONFIG_DUMMY_CONSOLE=y
535# CONFIG_RTC_CLASS is not set 550# CONFIG_RTC_CLASS is not set
536 551
537# 552#
553# DMA Engine support
554#
555# CONFIG_DMA_ENGINE is not set
556
557#
558# DMA Clients
559#
560
561#
562# DMA Devices
563#
564
565#
538# File systems 566# File systems
539# 567#
540CONFIG_EXT2_FS=y 568CONFIG_EXT2_FS=y
@@ -548,6 +576,7 @@ CONFIG_EXT2_FS=y
548# CONFIG_MINIX_FS is not set 576# CONFIG_MINIX_FS is not set
549# CONFIG_ROMFS_FS is not set 577# CONFIG_ROMFS_FS is not set
550CONFIG_INOTIFY=y 578CONFIG_INOTIFY=y
579CONFIG_INOTIFY_USER=y
551# CONFIG_QUOTA is not set 580# CONFIG_QUOTA is not set
552CONFIG_DNOTIFY=y 581CONFIG_DNOTIFY=y
553# CONFIG_AUTOFS_FS is not set 582# CONFIG_AUTOFS_FS is not set
@@ -616,6 +645,7 @@ CONFIG_MSDOS_PARTITION=y
616# 645#
617# CONFIG_PRINTK_TIME is not set 646# CONFIG_PRINTK_TIME is not set
618# CONFIG_MAGIC_SYSRQ is not set 647# CONFIG_MAGIC_SYSRQ is not set
648# CONFIG_UNUSED_SYMBOLS is not set
619# CONFIG_DEBUG_KERNEL is not set 649# CONFIG_DEBUG_KERNEL is not set
620CONFIG_LOG_BUF_SHIFT=14 650CONFIG_LOG_BUF_SHIFT=14
621# CONFIG_DEBUG_FS is not set 651# CONFIG_DEBUG_FS is not set
@@ -644,3 +674,4 @@ CONFIG_CMDLINE="console=ttyVR0,19200 mem=8M"
644# CONFIG_CRC16 is not set 674# CONFIG_CRC16 is not set
645# CONFIG_CRC32 is not set 675# CONFIG_CRC32 is not set
646# CONFIG_LIBCRC32C is not set 676# CONFIG_LIBCRC32C is not set
677CONFIG_PLIST=y
diff --git a/arch/mips/configs/emma2rh_defconfig b/arch/mips/configs/emma2rh_defconfig
index 01f29f44f3e8..375b2ac24a49 100644
--- a/arch/mips/configs/emma2rh_defconfig
+++ b/arch/mips/configs/emma2rh_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17 3# Linux kernel version: 2.6.18-rc1
4# Sun Jun 18 13:46:53 2006 4# Thu Jul 6 10:04:05 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -133,6 +134,7 @@ CONFIG_FLATMEM=y
133CONFIG_FLAT_NODE_MEM_MAP=y 134CONFIG_FLAT_NODE_MEM_MAP=y
134# CONFIG_SPARSEMEM_STATIC is not set 135# CONFIG_SPARSEMEM_STATIC is not set
135CONFIG_SPLIT_PTLOCK_CPUS=4 136CONFIG_SPLIT_PTLOCK_CPUS=4
137# CONFIG_RESOURCES_64BIT is not set
136# CONFIG_HZ_48 is not set 138# CONFIG_HZ_48 is not set
137# CONFIG_HZ_100 is not set 139# CONFIG_HZ_100 is not set
138# CONFIG_HZ_128 is not set 140# CONFIG_HZ_128 is not set
@@ -146,6 +148,7 @@ CONFIG_HZ=1000
146# CONFIG_PREEMPT_VOLUNTARY is not set 148# CONFIG_PREEMPT_VOLUNTARY is not set
147CONFIG_PREEMPT=y 149CONFIG_PREEMPT=y
148CONFIG_PREEMPT_BKL=y 150CONFIG_PREEMPT_BKL=y
151CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
149 152
150# 153#
151# Code maturity level options 154# Code maturity level options
@@ -180,14 +183,15 @@ CONFIG_PRINTK=y
180CONFIG_BUG=y 183CONFIG_BUG=y
181CONFIG_ELF_CORE=y 184CONFIG_ELF_CORE=y
182CONFIG_BASE_FULL=y 185CONFIG_BASE_FULL=y
186CONFIG_RT_MUTEXES=y
183CONFIG_FUTEX=y 187CONFIG_FUTEX=y
184CONFIG_EPOLL=y 188CONFIG_EPOLL=y
185CONFIG_SHMEM=y 189CONFIG_SHMEM=y
186CONFIG_SLAB=y 190CONFIG_SLAB=y
191CONFIG_VM_EVENT_COUNTERS=y
187# CONFIG_TINY_SHMEM is not set 192# CONFIG_TINY_SHMEM is not set
188CONFIG_BASE_SMALL=0 193CONFIG_BASE_SMALL=0
189# CONFIG_SLOB is not set 194# CONFIG_SLOB is not set
190CONFIG_OBSOLETE_INTERMODULE=y
191 195
192# 196#
193# Loadable module support 197# Loadable module support
@@ -283,6 +287,8 @@ CONFIG_SYN_COOKIES=y
283# CONFIG_INET_IPCOMP is not set 287# CONFIG_INET_IPCOMP is not set
284# CONFIG_INET_XFRM_TUNNEL is not set 288# CONFIG_INET_XFRM_TUNNEL is not set
285# CONFIG_INET_TUNNEL is not set 289# CONFIG_INET_TUNNEL is not set
290CONFIG_INET_XFRM_MODE_TRANSPORT=m
291CONFIG_INET_XFRM_MODE_TUNNEL=m
286CONFIG_INET_DIAG=y 292CONFIG_INET_DIAG=y
287CONFIG_INET_TCP_DIAG=y 293CONFIG_INET_TCP_DIAG=y
288# CONFIG_TCP_CONG_ADVANCED is not set 294# CONFIG_TCP_CONG_ADVANCED is not set
@@ -300,7 +306,10 @@ CONFIG_IPV6=m
300# CONFIG_INET6_IPCOMP is not set 306# CONFIG_INET6_IPCOMP is not set
301# CONFIG_INET6_XFRM_TUNNEL is not set 307# CONFIG_INET6_XFRM_TUNNEL is not set
302# CONFIG_INET6_TUNNEL is not set 308# CONFIG_INET6_TUNNEL is not set
309CONFIG_INET6_XFRM_MODE_TRANSPORT=m
310CONFIG_INET6_XFRM_MODE_TUNNEL=m
303# CONFIG_IPV6_TUNNEL is not set 311# CONFIG_IPV6_TUNNEL is not set
312CONFIG_NETWORK_SECMARK=y
304CONFIG_NETFILTER=y 313CONFIG_NETFILTER=y
305# CONFIG_NETFILTER_DEBUG is not set 314# CONFIG_NETFILTER_DEBUG is not set
306 315
@@ -378,6 +387,7 @@ CONFIG_SCTP_HMAC_MD5=y
378CONFIG_STANDALONE=y 387CONFIG_STANDALONE=y
379CONFIG_PREVENT_FIRMWARE_BUILD=y 388CONFIG_PREVENT_FIRMWARE_BUILD=y
380# CONFIG_FW_LOADER is not set 389# CONFIG_FW_LOADER is not set
390# CONFIG_SYS_HYPERVISOR is not set
381 391
382# 392#
383# Connector - unified userspace <-> kernelspace linker 393# Connector - unified userspace <-> kernelspace linker
@@ -545,6 +555,7 @@ CONFIG_CHR_DEV_SG=m
545# CONFIG_MEGARAID_LEGACY is not set 555# CONFIG_MEGARAID_LEGACY is not set
546# CONFIG_MEGARAID_SAS is not set 556# CONFIG_MEGARAID_SAS is not set
547# CONFIG_SCSI_SATA is not set 557# CONFIG_SCSI_SATA is not set
558# CONFIG_SCSI_HPTIOP is not set
548# CONFIG_SCSI_DMX3191D is not set 559# CONFIG_SCSI_DMX3191D is not set
549# CONFIG_SCSI_FUTURE_DOMAIN is not set 560# CONFIG_SCSI_FUTURE_DOMAIN is not set
550# CONFIG_SCSI_IPS is not set 561# CONFIG_SCSI_IPS is not set
@@ -663,6 +674,7 @@ CONFIG_NATSEMI=y
663# CONFIG_CHELSIO_T1 is not set 674# CONFIG_CHELSIO_T1 is not set
664# CONFIG_IXGB is not set 675# CONFIG_IXGB is not set
665# CONFIG_S2IO is not set 676# CONFIG_S2IO is not set
677# CONFIG_MYRI10GE is not set
666 678
667# 679#
668# Token Ring devices 680# Token Ring devices
@@ -770,6 +782,7 @@ CONFIG_LEGACY_PTY_COUNT=256
770# Watchdog Cards 782# Watchdog Cards
771# 783#
772# CONFIG_WATCHDOG is not set 784# CONFIG_WATCHDOG is not set
785# CONFIG_HW_RANDOM is not set
773CONFIG_RTC=m 786CONFIG_RTC=m
774CONFIG_GEN_RTC=m 787CONFIG_GEN_RTC=m
775CONFIG_GEN_RTC_X=y 788CONFIG_GEN_RTC_X=y
@@ -814,6 +827,7 @@ CONFIG_I2C_CHARDEV=y
814# CONFIG_I2C_I810 is not set 827# CONFIG_I2C_I810 is not set
815# CONFIG_I2C_PIIX4 is not set 828# CONFIG_I2C_PIIX4 is not set
816# CONFIG_I2C_NFORCE2 is not set 829# CONFIG_I2C_NFORCE2 is not set
830# CONFIG_I2C_OCORES is not set
817# CONFIG_I2C_PARPORT_LIGHT is not set 831# CONFIG_I2C_PARPORT_LIGHT is not set
818# CONFIG_I2C_PROSAVAGE is not set 832# CONFIG_I2C_PROSAVAGE is not set
819# CONFIG_I2C_SAVAGE4 is not set 833# CONFIG_I2C_SAVAGE4 is not set
@@ -850,13 +864,13 @@ CONFIG_I2C_DEBUG_BUS=y
850# 864#
851# Dallas's 1-wire bus 865# Dallas's 1-wire bus
852# 866#
853# CONFIG_W1 is not set
854 867
855# 868#
856# Hardware Monitoring support 869# Hardware Monitoring support
857# 870#
858CONFIG_HWMON=y 871CONFIG_HWMON=y
859# CONFIG_HWMON_VID is not set 872# CONFIG_HWMON_VID is not set
873# CONFIG_SENSORS_ABITUGURU is not set
860# CONFIG_SENSORS_ADM1021 is not set 874# CONFIG_SENSORS_ADM1021 is not set
861# CONFIG_SENSORS_ADM1025 is not set 875# CONFIG_SENSORS_ADM1025 is not set
862# CONFIG_SENSORS_ADM1026 is not set 876# CONFIG_SENSORS_ADM1026 is not set
@@ -885,10 +899,12 @@ CONFIG_HWMON=y
885# CONFIG_SENSORS_PC87360 is not set 899# CONFIG_SENSORS_PC87360 is not set
886# CONFIG_SENSORS_SIS5595 is not set 900# CONFIG_SENSORS_SIS5595 is not set
887# CONFIG_SENSORS_SMSC47M1 is not set 901# CONFIG_SENSORS_SMSC47M1 is not set
902# CONFIG_SENSORS_SMSC47M192 is not set
888# CONFIG_SENSORS_SMSC47B397 is not set 903# CONFIG_SENSORS_SMSC47B397 is not set
889# CONFIG_SENSORS_VIA686A is not set 904# CONFIG_SENSORS_VIA686A is not set
890# CONFIG_SENSORS_VT8231 is not set 905# CONFIG_SENSORS_VT8231 is not set
891# CONFIG_SENSORS_W83781D is not set 906# CONFIG_SENSORS_W83781D is not set
907# CONFIG_SENSORS_W83791D is not set
892# CONFIG_SENSORS_W83792D is not set 908# CONFIG_SENSORS_W83792D is not set
893# CONFIG_SENSORS_W83L785TS is not set 909# CONFIG_SENSORS_W83L785TS is not set
894# CONFIG_SENSORS_W83627HF is not set 910# CONFIG_SENSORS_W83627HF is not set
@@ -913,6 +929,7 @@ CONFIG_VIDEO_V4L2=y
913# 929#
914# Graphics support 930# Graphics support
915# 931#
932# CONFIG_FIRMWARE_EDID is not set
916# CONFIG_FB is not set 933# CONFIG_FB is not set
917 934
918# 935#
@@ -970,6 +987,19 @@ CONFIG_USB_ARCH_HAS_EHCI=y
970# CONFIG_RTC_CLASS is not set 987# CONFIG_RTC_CLASS is not set
971 988
972# 989#
990# DMA Engine support
991#
992# CONFIG_DMA_ENGINE is not set
993
994#
995# DMA Clients
996#
997
998#
999# DMA Devices
1000#
1001
1002#
973# File systems 1003# File systems
974# 1004#
975CONFIG_EXT2_FS=y 1005CONFIG_EXT2_FS=y
@@ -988,7 +1018,6 @@ CONFIG_FS_MBCACHE=y
988# CONFIG_JFS_FS is not set 1018# CONFIG_JFS_FS is not set
989CONFIG_FS_POSIX_ACL=y 1019CONFIG_FS_POSIX_ACL=y
990CONFIG_XFS_FS=m 1020CONFIG_XFS_FS=m
991CONFIG_XFS_EXPORT=y
992# CONFIG_XFS_QUOTA is not set 1021# CONFIG_XFS_QUOTA is not set
993# CONFIG_XFS_SECURITY is not set 1022# CONFIG_XFS_SECURITY is not set
994# CONFIG_XFS_POSIX_ACL is not set 1023# CONFIG_XFS_POSIX_ACL is not set
@@ -997,6 +1026,7 @@ CONFIG_XFS_EXPORT=y
997# CONFIG_MINIX_FS is not set 1026# CONFIG_MINIX_FS is not set
998# CONFIG_ROMFS_FS is not set 1027# CONFIG_ROMFS_FS is not set
999CONFIG_INOTIFY=y 1028CONFIG_INOTIFY=y
1029CONFIG_INOTIFY_USER=y
1000# CONFIG_QUOTA is not set 1030# CONFIG_QUOTA is not set
1001# CONFIG_DNOTIFY is not set 1031# CONFIG_DNOTIFY is not set
1002# CONFIG_AUTOFS_FS is not set 1032# CONFIG_AUTOFS_FS is not set
@@ -1047,6 +1077,7 @@ CONFIG_JFFS2_FS=y
1047CONFIG_JFFS2_FS_DEBUG=0 1077CONFIG_JFFS2_FS_DEBUG=0
1048CONFIG_JFFS2_FS_WRITEBUFFER=y 1078CONFIG_JFFS2_FS_WRITEBUFFER=y
1049# CONFIG_JFFS2_SUMMARY is not set 1079# CONFIG_JFFS2_SUMMARY is not set
1080# CONFIG_JFFS2_FS_XATTR is not set
1050CONFIG_JFFS2_COMPRESSION_OPTIONS=y 1081CONFIG_JFFS2_COMPRESSION_OPTIONS=y
1051CONFIG_JFFS2_ZLIB=y 1082CONFIG_JFFS2_ZLIB=y
1052CONFIG_JFFS2_RTIME=y 1083CONFIG_JFFS2_RTIME=y
@@ -1086,6 +1117,7 @@ CONFIG_RPCSEC_GSS_KRB5=y
1086CONFIG_SMB_FS=m 1117CONFIG_SMB_FS=m
1087# CONFIG_SMB_NLS_DEFAULT is not set 1118# CONFIG_SMB_NLS_DEFAULT is not set
1088# CONFIG_CIFS is not set 1119# CONFIG_CIFS is not set
1120# CONFIG_CIFS_DEBUG2 is not set
1089# CONFIG_NCP_FS is not set 1121# CONFIG_NCP_FS is not set
1090# CONFIG_CODA_FS is not set 1122# CONFIG_CODA_FS is not set
1091# CONFIG_AFS_FS is not set 1123# CONFIG_AFS_FS is not set
@@ -1151,6 +1183,7 @@ CONFIG_NLS_UTF8=m
1151# 1183#
1152# CONFIG_PRINTK_TIME is not set 1184# CONFIG_PRINTK_TIME is not set
1153# CONFIG_MAGIC_SYSRQ is not set 1185# CONFIG_MAGIC_SYSRQ is not set
1186# CONFIG_UNUSED_SYMBOLS is not set
1154# CONFIG_DEBUG_KERNEL is not set 1187# CONFIG_DEBUG_KERNEL is not set
1155CONFIG_LOG_BUF_SHIFT=14 1188CONFIG_LOG_BUF_SHIFT=14
1156# CONFIG_DEBUG_FS is not set 1189# CONFIG_DEBUG_FS is not set
@@ -1205,3 +1238,4 @@ CONFIG_CRC32=y
1205# CONFIG_LIBCRC32C is not set 1238# CONFIG_LIBCRC32C is not set
1206CONFIG_ZLIB_INFLATE=y 1239CONFIG_ZLIB_INFLATE=y
1207CONFIG_ZLIB_DEFLATE=y 1240CONFIG_ZLIB_DEFLATE=y
1241CONFIG_PLIST=y
diff --git a/arch/mips/configs/ev64120_defconfig b/arch/mips/configs/ev64120_defconfig
index 5248a1d8131d..b0afc118bd5c 100644
--- a/arch/mips/configs/ev64120_defconfig
+++ b/arch/mips/configs/ev64120_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:51:02 2006 4# Thu Jul 6 10:04:05 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26CONFIG_MIPS_EV64120=y 27CONFIG_MIPS_EV64120=y
@@ -32,6 +33,7 @@ CONFIG_MIPS_EV64120=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MIPS_EV64120=y
45# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -66,6 +69,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
66CONFIG_GENERIC_FIND_NEXT_BIT=y 69CONFIG_GENERIC_FIND_NEXT_BIT=y
67CONFIG_GENERIC_HWEIGHT=y 70CONFIG_GENERIC_HWEIGHT=y
68CONFIG_GENERIC_CALIBRATE_DELAY=y 71CONFIG_GENERIC_CALIBRATE_DELAY=y
72CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
69CONFIG_DMA_NONCOHERENT=y 73CONFIG_DMA_NONCOHERENT=y
70CONFIG_DMA_NEED_PCI_MAP_STATE=y 74CONFIG_DMA_NEED_PCI_MAP_STATE=y
71CONFIG_CPU_BIG_ENDIAN=y 75CONFIG_CPU_BIG_ENDIAN=y
@@ -114,7 +118,10 @@ CONFIG_PAGE_SIZE_4KB=y
114# CONFIG_PAGE_SIZE_8KB is not set 118# CONFIG_PAGE_SIZE_8KB is not set
115# CONFIG_PAGE_SIZE_16KB is not set 119# CONFIG_PAGE_SIZE_16KB is not set
116# CONFIG_PAGE_SIZE_64KB is not set 120# CONFIG_PAGE_SIZE_64KB is not set
117# CONFIG_MIPS_MT is not set 121CONFIG_MIPS_MT_DISABLED=y
122# CONFIG_MIPS_MT_SMTC is not set
123# CONFIG_MIPS_MT_SMP is not set
124# CONFIG_MIPS_VPE_LOADER is not set
118# CONFIG_64BIT_PHYS_ADDR is not set 125# CONFIG_64BIT_PHYS_ADDR is not set
119CONFIG_CPU_HAS_LLSC=y 126CONFIG_CPU_HAS_LLSC=y
120CONFIG_CPU_HAS_SYNC=y 127CONFIG_CPU_HAS_SYNC=y
@@ -129,6 +136,7 @@ CONFIG_FLATMEM=y
129CONFIG_FLAT_NODE_MEM_MAP=y 136CONFIG_FLAT_NODE_MEM_MAP=y
130# CONFIG_SPARSEMEM_STATIC is not set 137# CONFIG_SPARSEMEM_STATIC is not set
131CONFIG_SPLIT_PTLOCK_CPUS=4 138CONFIG_SPLIT_PTLOCK_CPUS=4
139# CONFIG_RESOURCES_64BIT is not set
132# CONFIG_HZ_48 is not set 140# CONFIG_HZ_48 is not set
133# CONFIG_HZ_100 is not set 141# CONFIG_HZ_100 is not set
134# CONFIG_HZ_128 is not set 142# CONFIG_HZ_128 is not set
@@ -141,6 +149,7 @@ CONFIG_HZ=1000
141CONFIG_PREEMPT_NONE=y 149CONFIG_PREEMPT_NONE=y
142# CONFIG_PREEMPT_VOLUNTARY is not set 150# CONFIG_PREEMPT_VOLUNTARY is not set
143# CONFIG_PREEMPT is not set 151# CONFIG_PREEMPT is not set
152CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
144 153
145# 154#
146# Code maturity level options 155# Code maturity level options
@@ -172,10 +181,12 @@ CONFIG_PRINTK=y
172CONFIG_BUG=y 181CONFIG_BUG=y
173CONFIG_ELF_CORE=y 182CONFIG_ELF_CORE=y
174CONFIG_BASE_FULL=y 183CONFIG_BASE_FULL=y
184CONFIG_RT_MUTEXES=y
175CONFIG_FUTEX=y 185CONFIG_FUTEX=y
176CONFIG_EPOLL=y 186CONFIG_EPOLL=y
177CONFIG_SHMEM=y 187CONFIG_SHMEM=y
178CONFIG_SLAB=y 188CONFIG_SLAB=y
189CONFIG_VM_EVENT_COUNTERS=y
179# CONFIG_TINY_SHMEM is not set 190# CONFIG_TINY_SHMEM is not set
180CONFIG_BASE_SMALL=0 191CONFIG_BASE_SMALL=0
181# CONFIG_SLOB is not set 192# CONFIG_SLOB is not set
@@ -265,6 +276,8 @@ CONFIG_IP_PNP=y
265# CONFIG_INET_IPCOMP is not set 276# CONFIG_INET_IPCOMP is not set
266# CONFIG_INET_XFRM_TUNNEL is not set 277# CONFIG_INET_XFRM_TUNNEL is not set
267# CONFIG_INET_TUNNEL is not set 278# CONFIG_INET_TUNNEL is not set
279CONFIG_INET_XFRM_MODE_TRANSPORT=m
280CONFIG_INET_XFRM_MODE_TUNNEL=m
268CONFIG_INET_DIAG=y 281CONFIG_INET_DIAG=y
269CONFIG_INET_TCP_DIAG=y 282CONFIG_INET_TCP_DIAG=y
270# CONFIG_TCP_CONG_ADVANCED is not set 283# CONFIG_TCP_CONG_ADVANCED is not set
@@ -272,6 +285,7 @@ CONFIG_TCP_CONG_BIC=y
272# CONFIG_IPV6 is not set 285# CONFIG_IPV6 is not set
273# CONFIG_INET6_XFRM_TUNNEL is not set 286# CONFIG_INET6_XFRM_TUNNEL is not set
274# CONFIG_INET6_TUNNEL is not set 287# CONFIG_INET6_TUNNEL is not set
288CONFIG_NETWORK_SECMARK=y
275# CONFIG_NETFILTER is not set 289# CONFIG_NETFILTER is not set
276 290
277# 291#
@@ -331,6 +345,7 @@ CONFIG_WIRELESS_EXT=y
331CONFIG_STANDALONE=y 345CONFIG_STANDALONE=y
332CONFIG_PREVENT_FIRMWARE_BUILD=y 346CONFIG_PREVENT_FIRMWARE_BUILD=y
333CONFIG_FW_LOADER=m 347CONFIG_FW_LOADER=m
348# CONFIG_SYS_HYPERVISOR is not set
334 349
335# 350#
336# Connector - unified userspace <-> kernelspace linker 351# Connector - unified userspace <-> kernelspace linker
@@ -427,6 +442,8 @@ CONFIG_DAVICOM_PHY=m
427CONFIG_QSEMI_PHY=m 442CONFIG_QSEMI_PHY=m
428CONFIG_LXT_PHY=m 443CONFIG_LXT_PHY=m
429CONFIG_CICADA_PHY=m 444CONFIG_CICADA_PHY=m
445CONFIG_VITESSE_PHY=m
446CONFIG_SMSC_PHY=m
430 447
431# 448#
432# Ethernet (10 or 100Mbit) 449# Ethernet (10 or 100Mbit)
@@ -469,6 +486,7 @@ CONFIG_NET_ETHERNET=y
469# CONFIG_CHELSIO_T1 is not set 486# CONFIG_CHELSIO_T1 is not set
470# CONFIG_IXGB is not set 487# CONFIG_IXGB is not set
471# CONFIG_S2IO is not set 488# CONFIG_S2IO is not set
489# CONFIG_MYRI10GE is not set
472 490
473# 491#
474# Token Ring devices 492# Token Ring devices
@@ -554,6 +572,7 @@ CONFIG_SERIO_RAW=m
554CONFIG_VT=y 572CONFIG_VT=y
555CONFIG_VT_CONSOLE=y 573CONFIG_VT_CONSOLE=y
556CONFIG_HW_CONSOLE=y 574CONFIG_HW_CONSOLE=y
575CONFIG_VT_HW_CONSOLE_BINDING=y
557# CONFIG_SERIAL_NONSTANDARD is not set 576# CONFIG_SERIAL_NONSTANDARD is not set
558 577
559# 578#
@@ -585,6 +604,7 @@ CONFIG_LEGACY_PTY_COUNT=256
585# Watchdog Cards 604# Watchdog Cards
586# 605#
587# CONFIG_WATCHDOG is not set 606# CONFIG_WATCHDOG is not set
607# CONFIG_HW_RANDOM is not set
588# CONFIG_RTC is not set 608# CONFIG_RTC is not set
589# CONFIG_GEN_RTC is not set 609# CONFIG_GEN_RTC is not set
590# CONFIG_DTLK is not set 610# CONFIG_DTLK is not set
@@ -633,6 +653,7 @@ CONFIG_LEGACY_PTY_COUNT=256
633# Multimedia devices 653# Multimedia devices
634# 654#
635# CONFIG_VIDEO_DEV is not set 655# CONFIG_VIDEO_DEV is not set
656CONFIG_VIDEO_V4L2=y
636 657
637# 658#
638# Digital Video Broadcasting Devices 659# Digital Video Broadcasting Devices
@@ -642,6 +663,7 @@ CONFIG_LEGACY_PTY_COUNT=256
642# 663#
643# Graphics support 664# Graphics support
644# 665#
666# CONFIG_FIRMWARE_EDID is not set
645# CONFIG_FB is not set 667# CONFIG_FB is not set
646 668
647# 669#
@@ -705,6 +727,19 @@ CONFIG_USB_ARCH_HAS_EHCI=y
705# CONFIG_RTC_CLASS is not set 727# CONFIG_RTC_CLASS is not set
706 728
707# 729#
730# DMA Engine support
731#
732# CONFIG_DMA_ENGINE is not set
733
734#
735# DMA Clients
736#
737
738#
739# DMA Devices
740#
741
742#
708# File systems 743# File systems
709# 744#
710CONFIG_EXT2_FS=y 745CONFIG_EXT2_FS=y
@@ -719,6 +754,7 @@ CONFIG_EXT2_FS=y
719# CONFIG_MINIX_FS is not set 754# CONFIG_MINIX_FS is not set
720# CONFIG_ROMFS_FS is not set 755# CONFIG_ROMFS_FS is not set
721CONFIG_INOTIFY=y 756CONFIG_INOTIFY=y
757CONFIG_INOTIFY_USER=y
722# CONFIG_QUOTA is not set 758# CONFIG_QUOTA is not set
723CONFIG_DNOTIFY=y 759CONFIG_DNOTIFY=y
724# CONFIG_AUTOFS_FS is not set 760# CONFIG_AUTOFS_FS is not set
@@ -782,6 +818,7 @@ CONFIG_SUNRPC=y
782# CONFIG_RPCSEC_GSS_SPKM3 is not set 818# CONFIG_RPCSEC_GSS_SPKM3 is not set
783# CONFIG_SMB_FS is not set 819# CONFIG_SMB_FS is not set
784# CONFIG_CIFS is not set 820# CONFIG_CIFS is not set
821# CONFIG_CIFS_DEBUG2 is not set
785# CONFIG_NCP_FS is not set 822# CONFIG_NCP_FS is not set
786# CONFIG_CODA_FS is not set 823# CONFIG_CODA_FS is not set
787# CONFIG_AFS_FS is not set 824# CONFIG_AFS_FS is not set
@@ -808,6 +845,7 @@ CONFIG_MSDOS_PARTITION=y
808# 845#
809# CONFIG_PRINTK_TIME is not set 846# CONFIG_PRINTK_TIME is not set
810# CONFIG_MAGIC_SYSRQ is not set 847# CONFIG_MAGIC_SYSRQ is not set
848# CONFIG_UNUSED_SYMBOLS is not set
811# CONFIG_DEBUG_KERNEL is not set 849# CONFIG_DEBUG_KERNEL is not set
812CONFIG_LOG_BUF_SHIFT=14 850CONFIG_LOG_BUF_SHIFT=14
813# CONFIG_DEBUG_FS is not set 851# CONFIG_DEBUG_FS is not set
@@ -863,3 +901,4 @@ CONFIG_CRC32=m
863CONFIG_LIBCRC32C=m 901CONFIG_LIBCRC32C=m
864CONFIG_ZLIB_INFLATE=m 902CONFIG_ZLIB_INFLATE=m
865CONFIG_ZLIB_DEFLATE=m 903CONFIG_ZLIB_DEFLATE=m
904CONFIG_PLIST=y
diff --git a/arch/mips/configs/ev96100_defconfig b/arch/mips/configs/ev96100_defconfig
index 4858491ce669..0bdc10f11610 100644
--- a/arch/mips/configs/ev96100_defconfig
+++ b/arch/mips/configs/ev96100_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:51:03 2006 4# Thu Jul 6 10:04:05 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS_EV96100=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MIPS_EV96100=y
45# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -65,6 +68,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
65CONFIG_GENERIC_FIND_NEXT_BIT=y 68CONFIG_GENERIC_FIND_NEXT_BIT=y
66CONFIG_GENERIC_HWEIGHT=y 69CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 70CONFIG_GENERIC_CALIBRATE_DELAY=y
71CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
68CONFIG_DMA_NONCOHERENT=y 72CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 73CONFIG_DMA_NEED_PCI_MAP_STATE=y
70CONFIG_CPU_BIG_ENDIAN=y 74CONFIG_CPU_BIG_ENDIAN=y
@@ -117,7 +121,10 @@ CONFIG_PAGE_SIZE_4KB=y
117CONFIG_BOARD_SCACHE=y 121CONFIG_BOARD_SCACHE=y
118CONFIG_RM7000_CPU_SCACHE=y 122CONFIG_RM7000_CPU_SCACHE=y
119CONFIG_CPU_HAS_PREFETCH=y 123CONFIG_CPU_HAS_PREFETCH=y
120# CONFIG_MIPS_MT is not set 124CONFIG_MIPS_MT_DISABLED=y
125# CONFIG_MIPS_MT_SMTC is not set
126# CONFIG_MIPS_MT_SMP is not set
127# CONFIG_MIPS_VPE_LOADER is not set
121# CONFIG_64BIT_PHYS_ADDR is not set 128# CONFIG_64BIT_PHYS_ADDR is not set
122CONFIG_CPU_HAS_LLSC=y 129CONFIG_CPU_HAS_LLSC=y
123CONFIG_CPU_HAS_SYNC=y 130CONFIG_CPU_HAS_SYNC=y
@@ -133,6 +140,7 @@ CONFIG_FLATMEM=y
133CONFIG_FLAT_NODE_MEM_MAP=y 140CONFIG_FLAT_NODE_MEM_MAP=y
134# CONFIG_SPARSEMEM_STATIC is not set 141# CONFIG_SPARSEMEM_STATIC is not set
135CONFIG_SPLIT_PTLOCK_CPUS=4 142CONFIG_SPLIT_PTLOCK_CPUS=4
143# CONFIG_RESOURCES_64BIT is not set
136# CONFIG_HZ_48 is not set 144# CONFIG_HZ_48 is not set
137# CONFIG_HZ_100 is not set 145# CONFIG_HZ_100 is not set
138# CONFIG_HZ_128 is not set 146# CONFIG_HZ_128 is not set
@@ -145,6 +153,7 @@ CONFIG_HZ=1000
145CONFIG_PREEMPT_NONE=y 153CONFIG_PREEMPT_NONE=y
146# CONFIG_PREEMPT_VOLUNTARY is not set 154# CONFIG_PREEMPT_VOLUNTARY is not set
147# CONFIG_PREEMPT is not set 155# CONFIG_PREEMPT is not set
156CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
148 157
149# 158#
150# Code maturity level options 159# Code maturity level options
@@ -176,10 +185,12 @@ CONFIG_PRINTK=y
176CONFIG_BUG=y 185CONFIG_BUG=y
177CONFIG_ELF_CORE=y 186CONFIG_ELF_CORE=y
178CONFIG_BASE_FULL=y 187CONFIG_BASE_FULL=y
188CONFIG_RT_MUTEXES=y
179CONFIG_FUTEX=y 189CONFIG_FUTEX=y
180CONFIG_EPOLL=y 190CONFIG_EPOLL=y
181CONFIG_SHMEM=y 191CONFIG_SHMEM=y
182CONFIG_SLAB=y 192CONFIG_SLAB=y
193CONFIG_VM_EVENT_COUNTERS=y
183# CONFIG_TINY_SHMEM is not set 194# CONFIG_TINY_SHMEM is not set
184CONFIG_BASE_SMALL=0 195CONFIG_BASE_SMALL=0
185# CONFIG_SLOB is not set 196# CONFIG_SLOB is not set
@@ -268,6 +279,8 @@ CONFIG_IP_PNP_BOOTP=y
268# CONFIG_INET_IPCOMP is not set 279# CONFIG_INET_IPCOMP is not set
269# CONFIG_INET_XFRM_TUNNEL is not set 280# CONFIG_INET_XFRM_TUNNEL is not set
270# CONFIG_INET_TUNNEL is not set 281# CONFIG_INET_TUNNEL is not set
282CONFIG_INET_XFRM_MODE_TRANSPORT=m
283CONFIG_INET_XFRM_MODE_TUNNEL=m
271CONFIG_INET_DIAG=y 284CONFIG_INET_DIAG=y
272CONFIG_INET_TCP_DIAG=y 285CONFIG_INET_TCP_DIAG=y
273# CONFIG_TCP_CONG_ADVANCED is not set 286# CONFIG_TCP_CONG_ADVANCED is not set
@@ -275,6 +288,7 @@ CONFIG_TCP_CONG_BIC=y
275# CONFIG_IPV6 is not set 288# CONFIG_IPV6 is not set
276# CONFIG_INET6_XFRM_TUNNEL is not set 289# CONFIG_INET6_XFRM_TUNNEL is not set
277# CONFIG_INET6_TUNNEL is not set 290# CONFIG_INET6_TUNNEL is not set
291CONFIG_NETWORK_SECMARK=y
278# CONFIG_NETFILTER is not set 292# CONFIG_NETFILTER is not set
279 293
280# 294#
@@ -334,6 +348,7 @@ CONFIG_WIRELESS_EXT=y
334CONFIG_STANDALONE=y 348CONFIG_STANDALONE=y
335CONFIG_PREVENT_FIRMWARE_BUILD=y 349CONFIG_PREVENT_FIRMWARE_BUILD=y
336# CONFIG_FW_LOADER is not set 350# CONFIG_FW_LOADER is not set
351# CONFIG_SYS_HYPERVISOR is not set
337 352
338# 353#
339# Connector - unified userspace <-> kernelspace linker 354# Connector - unified userspace <-> kernelspace linker
@@ -418,6 +433,8 @@ CONFIG_DAVICOM_PHY=m
418CONFIG_QSEMI_PHY=m 433CONFIG_QSEMI_PHY=m
419CONFIG_LXT_PHY=m 434CONFIG_LXT_PHY=m
420CONFIG_CICADA_PHY=m 435CONFIG_CICADA_PHY=m
436CONFIG_VITESSE_PHY=m
437CONFIG_SMSC_PHY=m
421 438
422# 439#
423# Ethernet (10 or 100Mbit) 440# Ethernet (10 or 100Mbit)
@@ -507,6 +524,7 @@ CONFIG_SERIO_RAW=m
507CONFIG_VT=y 524CONFIG_VT=y
508CONFIG_VT_CONSOLE=y 525CONFIG_VT_CONSOLE=y
509CONFIG_HW_CONSOLE=y 526CONFIG_HW_CONSOLE=y
527CONFIG_VT_HW_CONSOLE_BINDING=y
510# CONFIG_SERIAL_NONSTANDARD is not set 528# CONFIG_SERIAL_NONSTANDARD is not set
511 529
512# 530#
@@ -536,6 +554,7 @@ CONFIG_LEGACY_PTY_COUNT=256
536# Watchdog Cards 554# Watchdog Cards
537# 555#
538# CONFIG_WATCHDOG is not set 556# CONFIG_WATCHDOG is not set
557# CONFIG_HW_RANDOM is not set
539# CONFIG_RTC is not set 558# CONFIG_RTC is not set
540# CONFIG_GEN_RTC is not set 559# CONFIG_GEN_RTC is not set
541# CONFIG_DTLK is not set 560# CONFIG_DTLK is not set
@@ -582,6 +601,7 @@ CONFIG_LEGACY_PTY_COUNT=256
582# Multimedia devices 601# Multimedia devices
583# 602#
584# CONFIG_VIDEO_DEV is not set 603# CONFIG_VIDEO_DEV is not set
604CONFIG_VIDEO_V4L2=y
585 605
586# 606#
587# Digital Video Broadcasting Devices 607# Digital Video Broadcasting Devices
@@ -591,6 +611,7 @@ CONFIG_LEGACY_PTY_COUNT=256
591# 611#
592# Graphics support 612# Graphics support
593# 613#
614# CONFIG_FIRMWARE_EDID is not set
594# CONFIG_FB is not set 615# CONFIG_FB is not set
595 616
596# 617#
@@ -652,6 +673,19 @@ CONFIG_DUMMY_CONSOLE=y
652# CONFIG_RTC_CLASS is not set 673# CONFIG_RTC_CLASS is not set
653 674
654# 675#
676# DMA Engine support
677#
678# CONFIG_DMA_ENGINE is not set
679
680#
681# DMA Clients
682#
683
684#
685# DMA Devices
686#
687
688#
655# File systems 689# File systems
656# 690#
657CONFIG_EXT2_FS=y 691CONFIG_EXT2_FS=y
@@ -666,6 +700,7 @@ CONFIG_EXT2_FS=y
666# CONFIG_MINIX_FS is not set 700# CONFIG_MINIX_FS is not set
667# CONFIG_ROMFS_FS is not set 701# CONFIG_ROMFS_FS is not set
668CONFIG_INOTIFY=y 702CONFIG_INOTIFY=y
703CONFIG_INOTIFY_USER=y
669# CONFIG_QUOTA is not set 704# CONFIG_QUOTA is not set
670CONFIG_DNOTIFY=y 705CONFIG_DNOTIFY=y
671# CONFIG_AUTOFS_FS is not set 706# CONFIG_AUTOFS_FS is not set
@@ -729,6 +764,7 @@ CONFIG_SUNRPC=y
729# CONFIG_RPCSEC_GSS_SPKM3 is not set 764# CONFIG_RPCSEC_GSS_SPKM3 is not set
730# CONFIG_SMB_FS is not set 765# CONFIG_SMB_FS is not set
731# CONFIG_CIFS is not set 766# CONFIG_CIFS is not set
767# CONFIG_CIFS_DEBUG2 is not set
732# CONFIG_NCP_FS is not set 768# CONFIG_NCP_FS is not set
733# CONFIG_CODA_FS is not set 769# CONFIG_CODA_FS is not set
734# CONFIG_AFS_FS is not set 770# CONFIG_AFS_FS is not set
@@ -755,6 +791,7 @@ CONFIG_MSDOS_PARTITION=y
755# 791#
756# CONFIG_PRINTK_TIME is not set 792# CONFIG_PRINTK_TIME is not set
757# CONFIG_MAGIC_SYSRQ is not set 793# CONFIG_MAGIC_SYSRQ is not set
794# CONFIG_UNUSED_SYMBOLS is not set
758# CONFIG_DEBUG_KERNEL is not set 795# CONFIG_DEBUG_KERNEL is not set
759CONFIG_LOG_BUF_SHIFT=14 796CONFIG_LOG_BUF_SHIFT=14
760# CONFIG_DEBUG_FS is not set 797# CONFIG_DEBUG_FS is not set
@@ -810,3 +847,4 @@ CONFIG_CRC32=m
810CONFIG_LIBCRC32C=m 847CONFIG_LIBCRC32C=m
811CONFIG_ZLIB_INFLATE=m 848CONFIG_ZLIB_INFLATE=m
812CONFIG_ZLIB_DEFLATE=m 849CONFIG_ZLIB_DEFLATE=m
850CONFIG_PLIST=y
diff --git a/arch/mips/configs/excite_defconfig b/arch/mips/configs/excite_defconfig
index f2ce64cb41a8..045ebd089893 100644
--- a/arch/mips/configs/excite_defconfig
+++ b/arch/mips/configs/excite_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc4 3# Linux kernel version: 2.6.18-rc1
4# Thu Feb 23 13:15:27 2006 4# Thu Jul 6 10:04:09 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,8 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24CONFIG_BASLER_EXCITE=y
25# CONFIG_BASLER_EXCITE_PROTOTYPE is not set
24# CONFIG_MIPS_COBALT is not set 26# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 27# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 28# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +34,7 @@ CONFIG_MIPS=y
32# CONFIG_MIPS_ATLAS is not set 34# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 35# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 36# CONFIG_MIPS_SEAD is not set
37# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 38# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 39# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 40# CONFIG_MOMENCO_OCELOT is not set
@@ -41,14 +44,11 @@ CONFIG_MIPS=y
41# CONFIG_MIPS_XXS1500 is not set 44# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set 45# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 46# CONFIG_PNX8550_JBS is not set
44CONFIG_BASLER_EXCITE=y
45# CONFIG_BASLER_EXCITE_PROTOTYPE is not set
46# CONFIG_DDB5074 is not set
47# CONFIG_DDB5476 is not set
48# CONFIG_DDB5477 is not set 47# CONFIG_DDB5477 is not set
49# CONFIG_MACH_VR41XX is not set 48# CONFIG_MACH_VR41XX is not set
50# CONFIG_PMC_YOSEMITE is not set 49# CONFIG_PMC_YOSEMITE is not set
51# CONFIG_QEMU is not set 50# CONFIG_QEMU is not set
51# CONFIG_MARKEINS is not set
52# CONFIG_SGI_IP22 is not set 52# CONFIG_SGI_IP22 is not set
53# CONFIG_SGI_IP27 is not set 53# CONFIG_SGI_IP27 is not set
54# CONFIG_SGI_IP32 is not set 54# CONFIG_SGI_IP32 is not set
@@ -66,9 +66,11 @@ CONFIG_BASLER_EXCITE=y
66# CONFIG_TOSHIBA_RBTX4927 is not set 66# CONFIG_TOSHIBA_RBTX4927 is not set
67# CONFIG_TOSHIBA_RBTX4938 is not set 67# CONFIG_TOSHIBA_RBTX4938 is not set
68CONFIG_RWSEM_GENERIC_SPINLOCK=y 68CONFIG_RWSEM_GENERIC_SPINLOCK=y
69CONFIG_GENERIC_FIND_NEXT_BIT=y
70CONFIG_GENERIC_HWEIGHT=y
69CONFIG_GENERIC_CALIBRATE_DELAY=y 71CONFIG_GENERIC_CALIBRATE_DELAY=y
72CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
70CONFIG_DMA_COHERENT=y 73CONFIG_DMA_COHERENT=y
71CONFIG_SERIAL_RM9000=y
72CONFIG_CPU_BIG_ENDIAN=y 74CONFIG_CPU_BIG_ENDIAN=y
73# CONFIG_CPU_LITTLE_ENDIAN is not set 75# CONFIG_CPU_LITTLE_ENDIAN is not set
74CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y 76CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
@@ -115,9 +117,11 @@ CONFIG_PAGE_SIZE_4KB=y
115# CONFIG_PAGE_SIZE_16KB is not set 117# CONFIG_PAGE_SIZE_16KB is not set
116# CONFIG_PAGE_SIZE_64KB is not set 118# CONFIG_PAGE_SIZE_64KB is not set
117CONFIG_CPU_HAS_PREFETCH=y 119CONFIG_CPU_HAS_PREFETCH=y
118# CONFIG_MIPS_MT is not set 120CONFIG_MIPS_MT_DISABLED=y
121# CONFIG_MIPS_MT_SMTC is not set
122# CONFIG_MIPS_MT_SMP is not set
123# CONFIG_MIPS_VPE_LOADER is not set
119# CONFIG_64BIT_PHYS_ADDR is not set 124# CONFIG_64BIT_PHYS_ADDR is not set
120# CONFIG_CPU_ADVANCED is not set
121CONFIG_CPU_HAS_LLSC=y 125CONFIG_CPU_HAS_LLSC=y
122CONFIG_CPU_HAS_SYNC=y 126CONFIG_CPU_HAS_SYNC=y
123CONFIG_GENERIC_HARDIRQS=y 127CONFIG_GENERIC_HARDIRQS=y
@@ -132,6 +136,7 @@ CONFIG_FLATMEM=y
132CONFIG_FLAT_NODE_MEM_MAP=y 136CONFIG_FLAT_NODE_MEM_MAP=y
133# CONFIG_SPARSEMEM_STATIC is not set 137# CONFIG_SPARSEMEM_STATIC is not set
134CONFIG_SPLIT_PTLOCK_CPUS=4 138CONFIG_SPLIT_PTLOCK_CPUS=4
139# CONFIG_RESOURCES_64BIT is not set
135# CONFIG_HZ_48 is not set 140# CONFIG_HZ_48 is not set
136# CONFIG_HZ_100 is not set 141# CONFIG_HZ_100 is not set
137# CONFIG_HZ_128 is not set 142# CONFIG_HZ_128 is not set
@@ -141,11 +146,11 @@ CONFIG_HZ_1000=y
141# CONFIG_HZ_1024 is not set 146# CONFIG_HZ_1024 is not set
142CONFIG_SYS_SUPPORTS_ARBIT_HZ=y 147CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
143CONFIG_HZ=1000 148CONFIG_HZ=1000
144# CONFIG_SMP is not set
145# CONFIG_PREEMPT_NONE is not set 149# CONFIG_PREEMPT_NONE is not set
146# CONFIG_PREEMPT_VOLUNTARY is not set 150# CONFIG_PREEMPT_VOLUNTARY is not set
147CONFIG_PREEMPT=y 151CONFIG_PREEMPT=y
148CONFIG_PREEMPT_BKL=y 152CONFIG_PREEMPT_BKL=y
153CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
149 154
150# 155#
151# Code maturity level options 156# Code maturity level options
@@ -167,6 +172,7 @@ CONFIG_POSIX_MQUEUE=y
167CONFIG_SYSCTL=y 172CONFIG_SYSCTL=y
168# CONFIG_AUDIT is not set 173# CONFIG_AUDIT is not set
169# CONFIG_IKCONFIG is not set 174# CONFIG_IKCONFIG is not set
175# CONFIG_RELAY is not set
170CONFIG_INITRAMFS_SOURCE="" 176CONFIG_INITRAMFS_SOURCE=""
171CONFIG_CC_OPTIMIZE_FOR_SIZE=y 177CONFIG_CC_OPTIMIZE_FOR_SIZE=y
172CONFIG_EMBEDDED=y 178CONFIG_EMBEDDED=y
@@ -177,14 +183,12 @@ CONFIG_PRINTK=y
177CONFIG_BUG=y 183CONFIG_BUG=y
178CONFIG_ELF_CORE=y 184CONFIG_ELF_CORE=y
179CONFIG_BASE_FULL=y 185CONFIG_BASE_FULL=y
186CONFIG_RT_MUTEXES=y
180CONFIG_FUTEX=y 187CONFIG_FUTEX=y
181CONFIG_EPOLL=y 188CONFIG_EPOLL=y
182CONFIG_SHMEM=y 189CONFIG_SHMEM=y
183CONFIG_CC_ALIGN_FUNCTIONS=0
184CONFIG_CC_ALIGN_LABELS=0
185CONFIG_CC_ALIGN_LOOPS=0
186CONFIG_CC_ALIGN_JUMPS=0
187CONFIG_SLAB=y 190CONFIG_SLAB=y
191CONFIG_VM_EVENT_COUNTERS=y
188# CONFIG_TINY_SHMEM is not set 192# CONFIG_TINY_SHMEM is not set
189CONFIG_BASE_SMALL=0 193CONFIG_BASE_SMALL=0
190# CONFIG_SLOB is not set 194# CONFIG_SLOB is not set
@@ -195,7 +199,6 @@ CONFIG_BASE_SMALL=0
195CONFIG_MODULES=y 199CONFIG_MODULES=y
196CONFIG_MODULE_UNLOAD=y 200CONFIG_MODULE_UNLOAD=y
197# CONFIG_MODULE_FORCE_UNLOAD is not set 201# CONFIG_MODULE_FORCE_UNLOAD is not set
198CONFIG_OBSOLETE_MODPARM=y
199# CONFIG_MODVERSIONS is not set 202# CONFIG_MODVERSIONS is not set
200# CONFIG_MODULE_SRCVERSION_ALL is not set 203# CONFIG_MODULE_SRCVERSION_ALL is not set
201CONFIG_KMOD=y 204CONFIG_KMOD=y
@@ -204,6 +207,8 @@ CONFIG_KMOD=y
204# Block layer 207# Block layer
205# 208#
206# CONFIG_LBD is not set 209# CONFIG_LBD is not set
210# CONFIG_BLK_DEV_IO_TRACE is not set
211# CONFIG_LSF is not set
207 212
208# 213#
209# IO Schedulers 214# IO Schedulers
@@ -223,7 +228,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
223# 228#
224CONFIG_HW_HAS_PCI=y 229CONFIG_HW_HAS_PCI=y
225CONFIG_PCI=y 230CONFIG_PCI=y
226# CONFIG_PCI_LEGACY_PROC is not set
227CONFIG_MMU=y 231CONFIG_MMU=y
228 232
229# 233#
@@ -255,6 +259,8 @@ CONFIG_NET=y
255CONFIG_PACKET=y 259CONFIG_PACKET=y
256CONFIG_PACKET_MMAP=y 260CONFIG_PACKET_MMAP=y
257CONFIG_UNIX=y 261CONFIG_UNIX=y
262CONFIG_XFRM=y
263# CONFIG_XFRM_USER is not set
258# CONFIG_NET_KEY is not set 264# CONFIG_NET_KEY is not set
259CONFIG_INET=y 265CONFIG_INET=y
260# CONFIG_IP_MULTICAST is not set 266# CONFIG_IP_MULTICAST is not set
@@ -271,12 +277,18 @@ CONFIG_IP_PNP_DHCP=y
271# CONFIG_INET_AH is not set 277# CONFIG_INET_AH is not set
272# CONFIG_INET_ESP is not set 278# CONFIG_INET_ESP is not set
273# CONFIG_INET_IPCOMP is not set 279# CONFIG_INET_IPCOMP is not set
280# CONFIG_INET_XFRM_TUNNEL is not set
274# CONFIG_INET_TUNNEL is not set 281# CONFIG_INET_TUNNEL is not set
282CONFIG_INET_XFRM_MODE_TRANSPORT=m
283CONFIG_INET_XFRM_MODE_TUNNEL=m
275CONFIG_INET_DIAG=y 284CONFIG_INET_DIAG=y
276CONFIG_INET_TCP_DIAG=y 285CONFIG_INET_TCP_DIAG=y
277# CONFIG_TCP_CONG_ADVANCED is not set 286# CONFIG_TCP_CONG_ADVANCED is not set
278CONFIG_TCP_CONG_BIC=y 287CONFIG_TCP_CONG_BIC=y
279# CONFIG_IPV6 is not set 288# CONFIG_IPV6 is not set
289# CONFIG_INET6_XFRM_TUNNEL is not set
290# CONFIG_INET6_TUNNEL is not set
291CONFIG_NETWORK_SECMARK=y
280# CONFIG_NETFILTER is not set 292# CONFIG_NETFILTER is not set
281 293
282# 294#
@@ -330,6 +342,7 @@ CONFIG_TCP_CONG_BIC=y
330CONFIG_STANDALONE=y 342CONFIG_STANDALONE=y
331CONFIG_PREVENT_FIRMWARE_BUILD=y 343CONFIG_PREVENT_FIRMWARE_BUILD=y
332# CONFIG_FW_LOADER is not set 344# CONFIG_FW_LOADER is not set
345# CONFIG_SYS_HYPERVISOR is not set
333 346
334# 347#
335# Connector - unified userspace <-> kernelspace linker 348# Connector - unified userspace <-> kernelspace linker
@@ -389,7 +402,6 @@ CONFIG_MTD_CFI_I2=y
389# CONFIG_MTD_SLRAM is not set 402# CONFIG_MTD_SLRAM is not set
390# CONFIG_MTD_PHRAM is not set 403# CONFIG_MTD_PHRAM is not set
391# CONFIG_MTD_MTDRAM is not set 404# CONFIG_MTD_MTDRAM is not set
392# CONFIG_MTD_BLKMTD is not set
393# CONFIG_MTD_BLOCK2MTD is not set 405# CONFIG_MTD_BLOCK2MTD is not set
394 406
395# 407#
@@ -404,11 +416,9 @@ CONFIG_MTD_CFI_I2=y
404# 416#
405CONFIG_MTD_NAND=y 417CONFIG_MTD_NAND=y
406CONFIG_MTD_NAND_VERIFY_WRITE=y 418CONFIG_MTD_NAND_VERIFY_WRITE=y
419# CONFIG_MTD_NAND_ECC_SMC is not set
407CONFIG_MTD_NAND_IDS=y 420CONFIG_MTD_NAND_IDS=y
408# CONFIG_MTD_NAND_DISKONCHIP is not set 421# CONFIG_MTD_NAND_DISKONCHIP is not set
409CONFIG_MTD_NAND_BASLER_EXCITE=y
410# CONFIG_MTD_NAND_BASLER_EXCITE_RDNBY is not set
411# CONFIG_MTD_NAND_BASLER_EXCITE_PERF is not set
412# CONFIG_MTD_NAND_NANDSIM is not set 422# CONFIG_MTD_NAND_NANDSIM is not set
413 423
414# 424#
@@ -439,7 +449,7 @@ CONFIG_BLK_DEV_LOOP=m
439# CONFIG_BLK_DEV_SX8 is not set 449# CONFIG_BLK_DEV_SX8 is not set
440# CONFIG_BLK_DEV_UB is not set 450# CONFIG_BLK_DEV_UB is not set
441# CONFIG_BLK_DEV_RAM is not set 451# CONFIG_BLK_DEV_RAM is not set
442CONFIG_BLK_DEV_RAM_COUNT=16 452# CONFIG_BLK_DEV_INITRD is not set
443# CONFIG_CDROM_PKTCDVD is not set 453# CONFIG_CDROM_PKTCDVD is not set
444# CONFIG_ATA_OVER_ETH is not set 454# CONFIG_ATA_OVER_ETH is not set
445 455
@@ -496,6 +506,7 @@ CONFIG_BLK_DEV_SD=y
496# CONFIG_MEGARAID_LEGACY is not set 506# CONFIG_MEGARAID_LEGACY is not set
497# CONFIG_MEGARAID_SAS is not set 507# CONFIG_MEGARAID_SAS is not set
498# CONFIG_SCSI_SATA is not set 508# CONFIG_SCSI_SATA is not set
509# CONFIG_SCSI_HPTIOP is not set
499# CONFIG_SCSI_DMX3191D is not set 510# CONFIG_SCSI_DMX3191D is not set
500# CONFIG_SCSI_FUTURE_DOMAIN is not set 511# CONFIG_SCSI_FUTURE_DOMAIN is not set
501# CONFIG_SCSI_IPS is not set 512# CONFIG_SCSI_IPS is not set
@@ -503,7 +514,6 @@ CONFIG_BLK_DEV_SD=y
503# CONFIG_SCSI_INIA100 is not set 514# CONFIG_SCSI_INIA100 is not set
504# CONFIG_SCSI_SYM53C8XX_2 is not set 515# CONFIG_SCSI_SYM53C8XX_2 is not set
505# CONFIG_SCSI_IPR is not set 516# CONFIG_SCSI_IPR is not set
506# CONFIG_SCSI_QLOGIC_FC is not set
507# CONFIG_SCSI_QLOGIC_1280 is not set 517# CONFIG_SCSI_QLOGIC_1280 is not set
508# CONFIG_SCSI_QLA_FC is not set 518# CONFIG_SCSI_QLA_FC is not set
509# CONFIG_SCSI_LPFC is not set 519# CONFIG_SCSI_LPFC is not set
@@ -574,8 +584,6 @@ CONFIG_NETDEVICES=y
574# CONFIG_SK98LIN is not set 584# CONFIG_SK98LIN is not set
575# CONFIG_TIGON3 is not set 585# CONFIG_TIGON3 is not set
576# CONFIG_BNX2 is not set 586# CONFIG_BNX2 is not set
577# CONFIG_TITAN_GE is not set
578CONFIG_RM9K_GE=m
579 587
580# 588#
581# Ethernet (10000 Mbit) 589# Ethernet (10000 Mbit)
@@ -583,6 +591,7 @@ CONFIG_RM9K_GE=m
583# CONFIG_CHELSIO_T1 is not set 591# CONFIG_CHELSIO_T1 is not set
584# CONFIG_IXGB is not set 592# CONFIG_IXGB is not set
585# CONFIG_S2IO is not set 593# CONFIG_S2IO is not set
594# CONFIG_MYRI10GE is not set
586 595
587# 596#
588# Token Ring devices 597# Token Ring devices
@@ -656,6 +665,7 @@ CONFIG_INPUT_EVDEV=m
656CONFIG_VT=y 665CONFIG_VT=y
657CONFIG_VT_CONSOLE=y 666CONFIG_VT_CONSOLE=y
658CONFIG_HW_CONSOLE=y 667CONFIG_HW_CONSOLE=y
668CONFIG_VT_HW_CONSOLE_BINDING=y
659# CONFIG_SERIAL_NONSTANDARD is not set 669# CONFIG_SERIAL_NONSTANDARD is not set
660 670
661# 671#
@@ -663,6 +673,7 @@ CONFIG_HW_CONSOLE=y
663# 673#
664CONFIG_SERIAL_8250=y 674CONFIG_SERIAL_8250=y
665CONFIG_SERIAL_8250_CONSOLE=y 675CONFIG_SERIAL_8250_CONSOLE=y
676CONFIG_SERIAL_8250_PCI=y
666CONFIG_SERIAL_8250_NR_UARTS=2 677CONFIG_SERIAL_8250_NR_UARTS=2
667CONFIG_SERIAL_8250_RUNTIME_UARTS=2 678CONFIG_SERIAL_8250_RUNTIME_UARTS=2
668CONFIG_SERIAL_8250_EXTENDED=y 679CONFIG_SERIAL_8250_EXTENDED=y
@@ -695,7 +706,6 @@ CONFIG_WATCHDOG=y
695# Watchdog Device Drivers 706# Watchdog Device Drivers
696# 707#
697# CONFIG_SOFT_WATCHDOG is not set 708# CONFIG_SOFT_WATCHDOG is not set
698CONFIG_WDT_RM9K_GPI=m
699 709
700# 710#
701# PCI-based Watchdog Cards 711# PCI-based Watchdog Cards
@@ -707,6 +717,7 @@ CONFIG_WDT_RM9K_GPI=m
707# USB-based Watchdog Cards 717# USB-based Watchdog Cards
708# 718#
709# CONFIG_USBPCWATCHDOG is not set 719# CONFIG_USBPCWATCHDOG is not set
720# CONFIG_HW_RANDOM is not set
710# CONFIG_RTC is not set 721# CONFIG_RTC is not set
711# CONFIG_GEN_RTC is not set 722# CONFIG_GEN_RTC is not set
712# CONFIG_DTLK is not set 723# CONFIG_DTLK is not set
@@ -739,7 +750,6 @@ CONFIG_WDT_RM9K_GPI=m
739# 750#
740# Dallas's 1-wire bus 751# Dallas's 1-wire bus
741# 752#
742# CONFIG_W1 is not set
743 753
744# 754#
745# Hardware Monitoring support 755# Hardware Monitoring support
@@ -752,27 +762,27 @@ CONFIG_WDT_RM9K_GPI=m
752# 762#
753 763
754# 764#
755# Multimedia Capabilities Port drivers
756#
757
758#
759# Multimedia devices 765# Multimedia devices
760# 766#
761# CONFIG_VIDEO_DEV is not set 767# CONFIG_VIDEO_DEV is not set
768CONFIG_VIDEO_V4L2=y
762 769
763# 770#
764# Digital Video Broadcasting Devices 771# Digital Video Broadcasting Devices
765# 772#
766# CONFIG_DVB is not set 773# CONFIG_DVB is not set
774# CONFIG_USB_DABUSB is not set
767 775
768# 776#
769# Graphics support 777# Graphics support
770# 778#
779# CONFIG_FIRMWARE_EDID is not set
771CONFIG_FB=y 780CONFIG_FB=y
772CONFIG_FB_CFB_FILLRECT=y 781# CONFIG_FB_CFB_FILLRECT is not set
773CONFIG_FB_CFB_COPYAREA=y 782# CONFIG_FB_CFB_COPYAREA is not set
774CONFIG_FB_CFB_IMAGEBLIT=y 783# CONFIG_FB_CFB_IMAGEBLIT is not set
775# CONFIG_FB_MACMODES is not set 784# CONFIG_FB_MACMODES is not set
785# CONFIG_FB_BACKLIGHT is not set
776# CONFIG_FB_MODE_HELPERS is not set 786# CONFIG_FB_MODE_HELPERS is not set
777# CONFIG_FB_TILEBLITTING is not set 787# CONFIG_FB_TILEBLITTING is not set
778# CONFIG_FB_CIRRUS is not set 788# CONFIG_FB_CIRRUS is not set
@@ -784,7 +794,6 @@ CONFIG_FB_CFB_IMAGEBLIT=y
784# CONFIG_FB_NVIDIA is not set 794# CONFIG_FB_NVIDIA is not set
785# CONFIG_FB_RIVA is not set 795# CONFIG_FB_RIVA is not set
786# CONFIG_FB_MATROX is not set 796# CONFIG_FB_MATROX is not set
787# CONFIG_FB_RADEON_OLD is not set
788# CONFIG_FB_RADEON is not set 797# CONFIG_FB_RADEON is not set
789# CONFIG_FB_ATY128 is not set 798# CONFIG_FB_ATY128 is not set
790# CONFIG_FB_ATY is not set 799# CONFIG_FB_ATY is not set
@@ -797,7 +806,6 @@ CONFIG_FB_CFB_IMAGEBLIT=y
797# CONFIG_FB_SMIVGX is not set 806# CONFIG_FB_SMIVGX is not set
798# CONFIG_FB_TRIDENT is not set 807# CONFIG_FB_TRIDENT is not set
799# CONFIG_FB_VIRTUAL is not set 808# CONFIG_FB_VIRTUAL is not set
800CONFIG_FB_DD=y
801 809
802# 810#
803# Console display driver support 811# Console display driver support
@@ -826,6 +834,7 @@ CONFIG_FONT_8x16=y
826# 834#
827CONFIG_USB_ARCH_HAS_HCD=y 835CONFIG_USB_ARCH_HAS_HCD=y
828CONFIG_USB_ARCH_HAS_OHCI=y 836CONFIG_USB_ARCH_HAS_OHCI=y
837CONFIG_USB_ARCH_HAS_EHCI=y
829CONFIG_USB=y 838CONFIG_USB=y
830# CONFIG_USB_DEBUG is not set 839# CONFIG_USB_DEBUG is not set
831 840
@@ -843,6 +852,7 @@ CONFIG_USB_DEVICEFS=y
843CONFIG_USB_EHCI_HCD=y 852CONFIG_USB_EHCI_HCD=y
844# CONFIG_USB_EHCI_SPLIT_ISO is not set 853# CONFIG_USB_EHCI_SPLIT_ISO is not set
845# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 854# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
855# CONFIG_USB_EHCI_TT_NEWSCHED is not set
846# CONFIG_USB_ISP116X_HCD is not set 856# CONFIG_USB_ISP116X_HCD is not set
847CONFIG_USB_OHCI_HCD=y 857CONFIG_USB_OHCI_HCD=y
848# CONFIG_USB_OHCI_BIG_ENDIAN is not set 858# CONFIG_USB_OHCI_BIG_ENDIAN is not set
@@ -895,9 +905,7 @@ CONFIG_USB_HIDINPUT=y
895# CONFIG_USB_ACECAD is not set 905# CONFIG_USB_ACECAD is not set
896# CONFIG_USB_KBTAB is not set 906# CONFIG_USB_KBTAB is not set
897# CONFIG_USB_POWERMATE is not set 907# CONFIG_USB_POWERMATE is not set
898# CONFIG_USB_MTOUCH is not set 908# CONFIG_USB_TOUCHSCREEN is not set
899# CONFIG_USB_ITMTOUCH is not set
900# CONFIG_USB_EGALAX is not set
901# CONFIG_USB_YEALINK is not set 909# CONFIG_USB_YEALINK is not set
902# CONFIG_USB_XPAD is not set 910# CONFIG_USB_XPAD is not set
903# CONFIG_USB_ATI_REMOTE is not set 911# CONFIG_USB_ATI_REMOTE is not set
@@ -912,15 +920,6 @@ CONFIG_USB_HIDINPUT=y
912# CONFIG_USB_MICROTEK is not set 920# CONFIG_USB_MICROTEK is not set
913 921
914# 922#
915# USB Multimedia devices
916#
917# CONFIG_USB_DABUSB is not set
918
919#
920# Video4Linux support is needed for USB Multimedia device support
921#
922
923#
924# USB Network Adapters 923# USB Network Adapters
925# 924#
926# CONFIG_USB_CATC is not set 925# CONFIG_USB_CATC is not set
@@ -946,15 +945,15 @@ CONFIG_USB_HIDINPUT=y
946# CONFIG_USB_EMI26 is not set 945# CONFIG_USB_EMI26 is not set
947# CONFIG_USB_AUERSWALD is not set 946# CONFIG_USB_AUERSWALD is not set
948# CONFIG_USB_RIO500 is not set 947# CONFIG_USB_RIO500 is not set
949CONFIG_USB_ARTTFT=m
950# CONFIG_USB_ARTTOUCH is not set
951# CONFIG_USB_LEGOTOWER is not set 948# CONFIG_USB_LEGOTOWER is not set
952# CONFIG_USB_LCD is not set 949# CONFIG_USB_LCD is not set
953# CONFIG_USB_LED is not set 950# CONFIG_USB_LED is not set
951# CONFIG_USB_CY7C63 is not set
954# CONFIG_USB_CYTHERM is not set 952# CONFIG_USB_CYTHERM is not set
955# CONFIG_USB_PHIDGETKIT is not set 953# CONFIG_USB_PHIDGETKIT is not set
956# CONFIG_USB_PHIDGETSERVO is not set 954# CONFIG_USB_PHIDGETSERVO is not set
957# CONFIG_USB_IDMOUSE is not set 955# CONFIG_USB_IDMOUSE is not set
956# CONFIG_USB_APPLEDISPLAY is not set
958# CONFIG_USB_SISUSBVGA is not set 957# CONFIG_USB_SISUSBVGA is not set
959# CONFIG_USB_LD is not set 958# CONFIG_USB_LD is not set
960# CONFIG_USB_TEST is not set 959# CONFIG_USB_TEST is not set
@@ -974,23 +973,44 @@ CONFIG_USB_ARTTFT=m
974# CONFIG_MMC is not set 973# CONFIG_MMC is not set
975 974
976# 975#
976# LED devices
977#
978# CONFIG_NEW_LEDS is not set
979
980#
981# LED drivers
982#
983
984#
985# LED Triggers
986#
987
988#
977# InfiniBand support 989# InfiniBand support
978# 990#
979# CONFIG_INFINIBAND is not set 991# CONFIG_INFINIBAND is not set
980 992
981# 993#
982# SN Devices 994# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
995#
996
997#
998# Real Time Clock
999#
1000# CONFIG_RTC_CLASS is not set
1001
1002#
1003# DMA Engine support
983# 1004#
1005# CONFIG_DMA_ENGINE is not set
984 1006
985# 1007#
986# EDAC - error detection and reporting (RAS) 1008# DMA Clients
987# 1009#
988 1010
989# 1011#
990# eXcite frame capture support 1012# DMA Devices
991# 1013#
992CONFIG_EXCITE_FCAP=m
993CONFIG_EXCITE_FCAP_GPI=m
994 1014
995# 1015#
996# File systems 1016# File systems
@@ -1007,6 +1027,7 @@ CONFIG_EXT2_FS=y
1007# CONFIG_MINIX_FS is not set 1027# CONFIG_MINIX_FS is not set
1008# CONFIG_ROMFS_FS is not set 1028# CONFIG_ROMFS_FS is not set
1009CONFIG_INOTIFY=y 1029CONFIG_INOTIFY=y
1030CONFIG_INOTIFY_USER=y
1010# CONFIG_QUOTA is not set 1031# CONFIG_QUOTA is not set
1011# CONFIG_DNOTIFY is not set 1032# CONFIG_DNOTIFY is not set
1012# CONFIG_AUTOFS_FS is not set 1033# CONFIG_AUTOFS_FS is not set
@@ -1038,7 +1059,6 @@ CONFIG_SYSFS=y
1038CONFIG_TMPFS=y 1059CONFIG_TMPFS=y
1039# CONFIG_HUGETLB_PAGE is not set 1060# CONFIG_HUGETLB_PAGE is not set
1040CONFIG_RAMFS=y 1061CONFIG_RAMFS=y
1041# CONFIG_RELAYFS_FS is not set
1042# CONFIG_CONFIGFS_FS is not set 1062# CONFIG_CONFIGFS_FS is not set
1043 1063
1044# 1064#
@@ -1056,6 +1076,7 @@ CONFIG_JFFS2_FS=y
1056CONFIG_JFFS2_FS_DEBUG=0 1076CONFIG_JFFS2_FS_DEBUG=0
1057CONFIG_JFFS2_FS_WRITEBUFFER=y 1077CONFIG_JFFS2_FS_WRITEBUFFER=y
1058# CONFIG_JFFS2_SUMMARY is not set 1078# CONFIG_JFFS2_SUMMARY is not set
1079# CONFIG_JFFS2_FS_XATTR is not set
1059# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set 1080# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
1060CONFIG_JFFS2_ZLIB=y 1081CONFIG_JFFS2_ZLIB=y
1061CONFIG_JFFS2_RTIME=y 1082CONFIG_JFFS2_RTIME=y
@@ -1085,6 +1106,7 @@ CONFIG_SUNRPC=y
1085# CONFIG_RPCSEC_GSS_SPKM3 is not set 1106# CONFIG_RPCSEC_GSS_SPKM3 is not set
1086# CONFIG_SMB_FS is not set 1107# CONFIG_SMB_FS is not set
1087# CONFIG_CIFS is not set 1108# CONFIG_CIFS is not set
1109# CONFIG_CIFS_DEBUG2 is not set
1088# CONFIG_NCP_FS is not set 1110# CONFIG_NCP_FS is not set
1089# CONFIG_CODA_FS is not set 1111# CONFIG_CODA_FS is not set
1090# CONFIG_AFS_FS is not set 1112# CONFIG_AFS_FS is not set
@@ -1165,8 +1187,10 @@ CONFIG_NLS_ISO8859_1=m
1165# 1187#
1166# CONFIG_PRINTK_TIME is not set 1188# CONFIG_PRINTK_TIME is not set
1167# CONFIG_MAGIC_SYSRQ is not set 1189# CONFIG_MAGIC_SYSRQ is not set
1190# CONFIG_UNUSED_SYMBOLS is not set
1168# CONFIG_DEBUG_KERNEL is not set 1191# CONFIG_DEBUG_KERNEL is not set
1169CONFIG_LOG_BUF_SHIFT=14 1192CONFIG_LOG_BUF_SHIFT=14
1193# CONFIG_DEBUG_FS is not set
1170CONFIG_CROSSCOMPILE=y 1194CONFIG_CROSSCOMPILE=y
1171CONFIG_CMDLINE="" 1195CONFIG_CMDLINE=""
1172 1196
@@ -1218,3 +1242,4 @@ CONFIG_CRC32=y
1218# CONFIG_LIBCRC32C is not set 1242# CONFIG_LIBCRC32C is not set
1219CONFIG_ZLIB_INFLATE=y 1243CONFIG_ZLIB_INFLATE=y
1220CONFIG_ZLIB_DEFLATE=y 1244CONFIG_ZLIB_DEFLATE=y
1245CONFIG_PLIST=y
diff --git a/arch/mips/configs/ip22_defconfig b/arch/mips/configs/ip22_defconfig
index 879ba1ad99ca..ef16d1fb5071 100644
--- a/arch/mips/configs/ip22_defconfig
+++ b/arch/mips/configs/ip22_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:50:54 2006 4# Thu Jul 6 10:04:10 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MIPS=y
45# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48CONFIG_SGI_IP22=y 51CONFIG_SGI_IP22=y
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -65,6 +68,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
65CONFIG_GENERIC_FIND_NEXT_BIT=y 68CONFIG_GENERIC_FIND_NEXT_BIT=y
66CONFIG_GENERIC_HWEIGHT=y 69CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 70CONFIG_GENERIC_CALIBRATE_DELAY=y
71CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
68CONFIG_ARC=y 72CONFIG_ARC=y
69CONFIG_DMA_NONCOHERENT=y 73CONFIG_DMA_NONCOHERENT=y
70CONFIG_DMA_NEED_PCI_MAP_STATE=y 74CONFIG_DMA_NEED_PCI_MAP_STATE=y
@@ -119,7 +123,10 @@ CONFIG_PAGE_SIZE_4KB=y
119# CONFIG_PAGE_SIZE_64KB is not set 123# CONFIG_PAGE_SIZE_64KB is not set
120CONFIG_BOARD_SCACHE=y 124CONFIG_BOARD_SCACHE=y
121CONFIG_IP22_CPU_SCACHE=y 125CONFIG_IP22_CPU_SCACHE=y
122# CONFIG_MIPS_MT is not set 126CONFIG_MIPS_MT_DISABLED=y
127# CONFIG_MIPS_MT_SMTC is not set
128# CONFIG_MIPS_MT_SMP is not set
129# CONFIG_MIPS_VPE_LOADER is not set
123# CONFIG_64BIT_PHYS_ADDR is not set 130# CONFIG_64BIT_PHYS_ADDR is not set
124CONFIG_CPU_HAS_LLSC=y 131CONFIG_CPU_HAS_LLSC=y
125CONFIG_CPU_HAS_SYNC=y 132CONFIG_CPU_HAS_SYNC=y
@@ -134,6 +141,7 @@ CONFIG_FLATMEM=y
134CONFIG_FLAT_NODE_MEM_MAP=y 141CONFIG_FLAT_NODE_MEM_MAP=y
135# CONFIG_SPARSEMEM_STATIC is not set 142# CONFIG_SPARSEMEM_STATIC is not set
136CONFIG_SPLIT_PTLOCK_CPUS=4 143CONFIG_SPLIT_PTLOCK_CPUS=4
144# CONFIG_RESOURCES_64BIT is not set
137# CONFIG_HZ_48 is not set 145# CONFIG_HZ_48 is not set
138# CONFIG_HZ_100 is not set 146# CONFIG_HZ_100 is not set
139# CONFIG_HZ_128 is not set 147# CONFIG_HZ_128 is not set
@@ -146,6 +154,7 @@ CONFIG_HZ=1000
146# CONFIG_PREEMPT_NONE is not set 154# CONFIG_PREEMPT_NONE is not set
147CONFIG_PREEMPT_VOLUNTARY=y 155CONFIG_PREEMPT_VOLUNTARY=y
148# CONFIG_PREEMPT is not set 156# CONFIG_PREEMPT is not set
157CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
149 158
150# 159#
151# Code maturity level options 160# Code maturity level options
@@ -178,10 +187,12 @@ CONFIG_PRINTK=y
178CONFIG_BUG=y 187CONFIG_BUG=y
179CONFIG_ELF_CORE=y 188CONFIG_ELF_CORE=y
180CONFIG_BASE_FULL=y 189CONFIG_BASE_FULL=y
190CONFIG_RT_MUTEXES=y
181CONFIG_FUTEX=y 191CONFIG_FUTEX=y
182CONFIG_EPOLL=y 192CONFIG_EPOLL=y
183CONFIG_SHMEM=y 193CONFIG_SHMEM=y
184CONFIG_SLAB=y 194CONFIG_SLAB=y
195CONFIG_VM_EVENT_COUNTERS=y
185# CONFIG_TINY_SHMEM is not set 196# CONFIG_TINY_SHMEM is not set
186CONFIG_BASE_SMALL=0 197CONFIG_BASE_SMALL=0
187# CONFIG_SLOB is not set 198# CONFIG_SLOB is not set
@@ -272,6 +283,8 @@ CONFIG_INET_ESP=m
272CONFIG_INET_IPCOMP=m 283CONFIG_INET_IPCOMP=m
273CONFIG_INET_XFRM_TUNNEL=m 284CONFIG_INET_XFRM_TUNNEL=m
274CONFIG_INET_TUNNEL=m 285CONFIG_INET_TUNNEL=m
286CONFIG_INET_XFRM_MODE_TRANSPORT=m
287CONFIG_INET_XFRM_MODE_TUNNEL=m
275CONFIG_INET_DIAG=y 288CONFIG_INET_DIAG=y
276CONFIG_INET_TCP_DIAG=y 289CONFIG_INET_TCP_DIAG=y
277# CONFIG_TCP_CONG_ADVANCED is not set 290# CONFIG_TCP_CONG_ADVANCED is not set
@@ -319,7 +332,10 @@ CONFIG_INET6_ESP=m
319CONFIG_INET6_IPCOMP=m 332CONFIG_INET6_IPCOMP=m
320CONFIG_INET6_XFRM_TUNNEL=m 333CONFIG_INET6_XFRM_TUNNEL=m
321CONFIG_INET6_TUNNEL=m 334CONFIG_INET6_TUNNEL=m
335CONFIG_INET6_XFRM_MODE_TRANSPORT=m
336CONFIG_INET6_XFRM_MODE_TUNNEL=m
322CONFIG_IPV6_TUNNEL=m 337CONFIG_IPV6_TUNNEL=m
338CONFIG_NETWORK_SECMARK=y
323CONFIG_NETFILTER=y 339CONFIG_NETFILTER=y
324# CONFIG_NETFILTER_DEBUG is not set 340# CONFIG_NETFILTER_DEBUG is not set
325 341
@@ -335,6 +351,8 @@ CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
335CONFIG_NETFILTER_XT_TARGET_MARK=m 351CONFIG_NETFILTER_XT_TARGET_MARK=m
336CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m 352CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
337CONFIG_NETFILTER_XT_TARGET_NOTRACK=m 353CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
354CONFIG_NETFILTER_XT_TARGET_SECMARK=m
355CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m
338CONFIG_NETFILTER_XT_MATCH_COMMENT=m 356CONFIG_NETFILTER_XT_MATCH_COMMENT=m
339CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m 357CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
340CONFIG_NETFILTER_XT_MATCH_CONNMARK=m 358CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
@@ -349,9 +367,11 @@ CONFIG_NETFILTER_XT_MATCH_MARK=m
349CONFIG_NETFILTER_XT_MATCH_POLICY=m 367CONFIG_NETFILTER_XT_MATCH_POLICY=m
350CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m 368CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
351CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 369CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
370CONFIG_NETFILTER_XT_MATCH_QUOTA=m
352CONFIG_NETFILTER_XT_MATCH_REALM=m 371CONFIG_NETFILTER_XT_MATCH_REALM=m
353CONFIG_NETFILTER_XT_MATCH_SCTP=m 372CONFIG_NETFILTER_XT_MATCH_SCTP=m
354CONFIG_NETFILTER_XT_MATCH_STATE=m 373CONFIG_NETFILTER_XT_MATCH_STATE=m
374CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
355CONFIG_NETFILTER_XT_MATCH_STRING=m 375CONFIG_NETFILTER_XT_MATCH_STRING=m
356CONFIG_NETFILTER_XT_MATCH_TCPMSS=m 376CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
357 377
@@ -361,6 +381,7 @@ CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
361CONFIG_IP_NF_CONNTRACK=m 381CONFIG_IP_NF_CONNTRACK=m
362CONFIG_IP_NF_CT_ACCT=y 382CONFIG_IP_NF_CT_ACCT=y
363CONFIG_IP_NF_CONNTRACK_MARK=y 383CONFIG_IP_NF_CONNTRACK_MARK=y
384CONFIG_IP_NF_CONNTRACK_SECMARK=y
364CONFIG_IP_NF_CONNTRACK_EVENTS=y 385CONFIG_IP_NF_CONNTRACK_EVENTS=y
365CONFIG_IP_NF_CONNTRACK_NETLINK=m 386CONFIG_IP_NF_CONNTRACK_NETLINK=m
366# CONFIG_IP_NF_CT_PROTO_SCTP is not set 387# CONFIG_IP_NF_CT_PROTO_SCTP is not set
@@ -371,6 +392,7 @@ CONFIG_IP_NF_TFTP=m
371CONFIG_IP_NF_AMANDA=m 392CONFIG_IP_NF_AMANDA=m
372CONFIG_IP_NF_PPTP=m 393CONFIG_IP_NF_PPTP=m
373CONFIG_IP_NF_H323=m 394CONFIG_IP_NF_H323=m
395CONFIG_IP_NF_SIP=m
374CONFIG_IP_NF_QUEUE=m 396CONFIG_IP_NF_QUEUE=m
375CONFIG_IP_NF_IPTABLES=m 397CONFIG_IP_NF_IPTABLES=m
376CONFIG_IP_NF_MATCH_IPRANGE=m 398CONFIG_IP_NF_MATCH_IPRANGE=m
@@ -401,6 +423,7 @@ CONFIG_IP_NF_NAT_TFTP=m
401CONFIG_IP_NF_NAT_AMANDA=m 423CONFIG_IP_NF_NAT_AMANDA=m
402CONFIG_IP_NF_NAT_PPTP=m 424CONFIG_IP_NF_NAT_PPTP=m
403CONFIG_IP_NF_NAT_H323=m 425CONFIG_IP_NF_NAT_H323=m
426CONFIG_IP_NF_NAT_SIP=m
404CONFIG_IP_NF_MANGLE=m 427CONFIG_IP_NF_MANGLE=m
405CONFIG_IP_NF_TARGET_TOS=m 428CONFIG_IP_NF_TARGET_TOS=m
406CONFIG_IP_NF_TARGET_ECN=m 429CONFIG_IP_NF_TARGET_ECN=m
@@ -533,6 +556,7 @@ CONFIG_WIRELESS_EXT=y
533CONFIG_STANDALONE=y 556CONFIG_STANDALONE=y
534CONFIG_PREVENT_FIRMWARE_BUILD=y 557CONFIG_PREVENT_FIRMWARE_BUILD=y
535# CONFIG_FW_LOADER is not set 558# CONFIG_FW_LOADER is not set
559# CONFIG_SYS_HYPERVISOR is not set
536 560
537# 561#
538# Connector - unified userspace <-> kernelspace linker 562# Connector - unified userspace <-> kernelspace linker
@@ -652,6 +676,8 @@ CONFIG_DAVICOM_PHY=m
652CONFIG_QSEMI_PHY=m 676CONFIG_QSEMI_PHY=m
653CONFIG_LXT_PHY=m 677CONFIG_LXT_PHY=m
654CONFIG_CICADA_PHY=m 678CONFIG_CICADA_PHY=m
679# CONFIG_VITESSE_PHY is not set
680# CONFIG_SMSC_PHY is not set
655 681
656# 682#
657# Ethernet (10 or 100Mbit) 683# Ethernet (10 or 100Mbit)
@@ -749,6 +775,7 @@ CONFIG_SERIO_RAW=m
749CONFIG_VT=y 775CONFIG_VT=y
750CONFIG_VT_CONSOLE=y 776CONFIG_VT_CONSOLE=y
751CONFIG_HW_CONSOLE=y 777CONFIG_HW_CONSOLE=y
778CONFIG_VT_HW_CONSOLE_BINDING=y
752# CONFIG_SERIAL_NONSTANDARD is not set 779# CONFIG_SERIAL_NONSTANDARD is not set
753 780
754# 781#
@@ -781,6 +808,7 @@ CONFIG_WATCHDOG=y
781# 808#
782# CONFIG_SOFT_WATCHDOG is not set 809# CONFIG_SOFT_WATCHDOG is not set
783CONFIG_INDYDOG=m 810CONFIG_INDYDOG=m
811# CONFIG_HW_RANDOM is not set
784# CONFIG_RTC is not set 812# CONFIG_RTC is not set
785CONFIG_SGI_DS1286=m 813CONFIG_SGI_DS1286=m
786# CONFIG_GEN_RTC is not set 814# CONFIG_GEN_RTC is not set
@@ -829,6 +857,7 @@ CONFIG_MAX_RAW_DEVS=256
829# Multimedia devices 857# Multimedia devices
830# 858#
831# CONFIG_VIDEO_DEV is not set 859# CONFIG_VIDEO_DEV is not set
860CONFIG_VIDEO_V4L2=y
832 861
833# 862#
834# Digital Video Broadcasting Devices 863# Digital Video Broadcasting Devices
@@ -838,6 +867,7 @@ CONFIG_MAX_RAW_DEVS=256
838# 867#
839# Graphics support 868# Graphics support
840# 869#
870CONFIG_FIRMWARE_EDID=y
841# CONFIG_FB is not set 871# CONFIG_FB is not set
842 872
843# 873#
@@ -910,6 +940,19 @@ CONFIG_LOGO_SGI_CLUT224=y
910# CONFIG_RTC_CLASS is not set 940# CONFIG_RTC_CLASS is not set
911 941
912# 942#
943# DMA Engine support
944#
945# CONFIG_DMA_ENGINE is not set
946
947#
948# DMA Clients
949#
950
951#
952# DMA Devices
953#
954
955#
913# File systems 956# File systems
914# 957#
915CONFIG_EXT2_FS=m 958CONFIG_EXT2_FS=m
@@ -926,7 +969,6 @@ CONFIG_FS_MBCACHE=y
926# CONFIG_JFS_FS is not set 969# CONFIG_JFS_FS is not set
927CONFIG_FS_POSIX_ACL=y 970CONFIG_FS_POSIX_ACL=y
928CONFIG_XFS_FS=m 971CONFIG_XFS_FS=m
929CONFIG_XFS_EXPORT=y
930CONFIG_XFS_QUOTA=y 972CONFIG_XFS_QUOTA=y
931CONFIG_XFS_SECURITY=y 973CONFIG_XFS_SECURITY=y
932# CONFIG_XFS_POSIX_ACL is not set 974# CONFIG_XFS_POSIX_ACL is not set
@@ -935,6 +977,7 @@ CONFIG_XFS_SECURITY=y
935CONFIG_MINIX_FS=m 977CONFIG_MINIX_FS=m
936# CONFIG_ROMFS_FS is not set 978# CONFIG_ROMFS_FS is not set
937CONFIG_INOTIFY=y 979CONFIG_INOTIFY=y
980CONFIG_INOTIFY_USER=y
938CONFIG_QUOTA=y 981CONFIG_QUOTA=y
939# CONFIG_QFMT_V1 is not set 982# CONFIG_QFMT_V1 is not set
940CONFIG_QFMT_V2=m 983CONFIG_QFMT_V2=m
@@ -991,6 +1034,8 @@ CONFIG_EFS_FS=m
991# CONFIG_QNX4FS_FS is not set 1034# CONFIG_QNX4FS_FS is not set
992# CONFIG_SYSV_FS is not set 1035# CONFIG_SYSV_FS is not set
993CONFIG_UFS_FS=m 1036CONFIG_UFS_FS=m
1037# CONFIG_UFS_FS_WRITE is not set
1038# CONFIG_UFS_DEBUG is not set
994 1039
995# 1040#
996# Network File Systems 1041# Network File Systems
@@ -1020,7 +1065,9 @@ CONFIG_SMB_NLS_DEFAULT=y
1020CONFIG_SMB_NLS_REMOTE="cp437" 1065CONFIG_SMB_NLS_REMOTE="cp437"
1021CONFIG_CIFS=m 1066CONFIG_CIFS=m
1022# CONFIG_CIFS_STATS is not set 1067# CONFIG_CIFS_STATS is not set
1068# CONFIG_CIFS_WEAK_PW_HASH is not set
1023# CONFIG_CIFS_XATTR is not set 1069# CONFIG_CIFS_XATTR is not set
1070# CONFIG_CIFS_DEBUG2 is not set
1024# CONFIG_CIFS_EXPERIMENTAL is not set 1071# CONFIG_CIFS_EXPERIMENTAL is not set
1025# CONFIG_NCP_FS is not set 1072# CONFIG_NCP_FS is not set
1026CONFIG_CODA_FS=m 1073CONFIG_CODA_FS=m
@@ -1103,6 +1150,7 @@ CONFIG_NLS_UTF8=m
1103# 1150#
1104# CONFIG_PRINTK_TIME is not set 1151# CONFIG_PRINTK_TIME is not set
1105# CONFIG_MAGIC_SYSRQ is not set 1152# CONFIG_MAGIC_SYSRQ is not set
1153# CONFIG_UNUSED_SYMBOLS is not set
1106# CONFIG_DEBUG_KERNEL is not set 1154# CONFIG_DEBUG_KERNEL is not set
1107CONFIG_LOG_BUF_SHIFT=14 1155CONFIG_LOG_BUF_SHIFT=14
1108# CONFIG_DEBUG_FS is not set 1156# CONFIG_DEBUG_FS is not set
@@ -1162,3 +1210,4 @@ CONFIG_TEXTSEARCH=y
1162CONFIG_TEXTSEARCH_KMP=m 1210CONFIG_TEXTSEARCH_KMP=m
1163CONFIG_TEXTSEARCH_BM=m 1211CONFIG_TEXTSEARCH_BM=m
1164CONFIG_TEXTSEARCH_FSM=m 1212CONFIG_TEXTSEARCH_FSM=m
1213CONFIG_PLIST=y
diff --git a/arch/mips/configs/ip27_defconfig b/arch/mips/configs/ip27_defconfig
index bb1426806430..4bf1ee7f5f00 100644
--- a/arch/mips/configs/ip27_defconfig
+++ b/arch/mips/configs/ip27_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:51:04 2006 4# Thu Jul 6 10:04:10 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MIPS=y
45# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49CONFIG_SGI_IP27=y 52CONFIG_SGI_IP27=y
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -61,16 +64,17 @@ CONFIG_SGI_IP27=y
61# CONFIG_TOSHIBA_JMR3927 is not set 64# CONFIG_TOSHIBA_JMR3927 is not set
62# CONFIG_TOSHIBA_RBTX4927 is not set 65# CONFIG_TOSHIBA_RBTX4927 is not set
63# CONFIG_TOSHIBA_RBTX4938 is not set 66# CONFIG_TOSHIBA_RBTX4938 is not set
67CONFIG_SGI_SN_M_MODE=y
64# CONFIG_SGI_SN_N_MODE is not set 68# CONFIG_SGI_SN_N_MODE is not set
65CONFIG_ARCH_DISCONTIGMEM_ENABLE=y
66CONFIG_NUMA=y
67# CONFIG_MAPPED_KERNEL is not set 69# CONFIG_MAPPED_KERNEL is not set
68# CONFIG_REPLICATE_KTEXT is not set 70# CONFIG_REPLICATE_KTEXT is not set
69# CONFIG_REPLICATE_EXHANDLERS is not set 71# CONFIG_REPLICATE_EXHANDLERS is not set
72CONFIG_EARLY_PRINTK=y
70CONFIG_RWSEM_GENERIC_SPINLOCK=y 73CONFIG_RWSEM_GENERIC_SPINLOCK=y
71CONFIG_GENERIC_FIND_NEXT_BIT=y 74CONFIG_GENERIC_FIND_NEXT_BIT=y
72CONFIG_GENERIC_HWEIGHT=y 75CONFIG_GENERIC_HWEIGHT=y
73CONFIG_GENERIC_CALIBRATE_DELAY=y 76CONFIG_GENERIC_CALIBRATE_DELAY=y
77CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
74CONFIG_ARC=y 78CONFIG_ARC=y
75CONFIG_DMA_IP27=y 79CONFIG_DMA_IP27=y
76CONFIG_CPU_BIG_ENDIAN=y 80CONFIG_CPU_BIG_ENDIAN=y
@@ -117,12 +121,19 @@ CONFIG_PAGE_SIZE_4KB=y
117# CONFIG_PAGE_SIZE_16KB is not set 121# CONFIG_PAGE_SIZE_16KB is not set
118# CONFIG_PAGE_SIZE_64KB is not set 122# CONFIG_PAGE_SIZE_64KB is not set
119CONFIG_CPU_HAS_PREFETCH=y 123CONFIG_CPU_HAS_PREFETCH=y
120# CONFIG_MIPS_MT is not set 124CONFIG_MIPS_MT_DISABLED=y
125# CONFIG_MIPS_MT_SMTC is not set
126# CONFIG_MIPS_MT_SMP is not set
127# CONFIG_MIPS_VPE_LOADER is not set
121CONFIG_CPU_HAS_LLSC=y 128CONFIG_CPU_HAS_LLSC=y
122CONFIG_CPU_HAS_SYNC=y 129CONFIG_CPU_HAS_SYNC=y
123CONFIG_GENERIC_HARDIRQS=y 130CONFIG_GENERIC_HARDIRQS=y
124CONFIG_GENERIC_IRQ_PROBE=y 131CONFIG_GENERIC_IRQ_PROBE=y
132CONFIG_IRQ_PER_CPU=y
125CONFIG_CPU_SUPPORTS_HIGHMEM=y 133CONFIG_CPU_SUPPORTS_HIGHMEM=y
134CONFIG_ARCH_DISCONTIGMEM_ENABLE=y
135CONFIG_NUMA=y
136CONFIG_SYS_SUPPORTS_NUMA=y
126CONFIG_NODES_SHIFT=6 137CONFIG_NODES_SHIFT=6
127CONFIG_SELECT_MEMORY_MODEL=y 138CONFIG_SELECT_MEMORY_MODEL=y
128# CONFIG_FLATMEM_MANUAL is not set 139# CONFIG_FLATMEM_MANUAL is not set
@@ -133,6 +144,11 @@ CONFIG_FLAT_NODE_MEM_MAP=y
133CONFIG_NEED_MULTIPLE_NODES=y 144CONFIG_NEED_MULTIPLE_NODES=y
134# CONFIG_SPARSEMEM_STATIC is not set 145# CONFIG_SPARSEMEM_STATIC is not set
135CONFIG_SPLIT_PTLOCK_CPUS=4 146CONFIG_SPLIT_PTLOCK_CPUS=4
147CONFIG_MIGRATION=y
148CONFIG_RESOURCES_64BIT=y
149CONFIG_SMP=y
150CONFIG_SYS_SUPPORTS_SMP=y
151CONFIG_NR_CPUS=64
136# CONFIG_HZ_48 is not set 152# CONFIG_HZ_48 is not set
137# CONFIG_HZ_100 is not set 153# CONFIG_HZ_100 is not set
138# CONFIG_HZ_128 is not set 154# CONFIG_HZ_128 is not set
@@ -142,14 +158,12 @@ CONFIG_HZ_1000=y
142# CONFIG_HZ_1024 is not set 158# CONFIG_HZ_1024 is not set
143CONFIG_SYS_SUPPORTS_ARBIT_HZ=y 159CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
144CONFIG_HZ=1000 160CONFIG_HZ=1000
145CONFIG_MIGRATION=y
146CONFIG_SMP=y
147CONFIG_NR_CPUS=64
148CONFIG_PREEMPT_NONE=y 161CONFIG_PREEMPT_NONE=y
149# CONFIG_PREEMPT_VOLUNTARY is not set 162# CONFIG_PREEMPT_VOLUNTARY is not set
150# CONFIG_PREEMPT is not set 163# CONFIG_PREEMPT is not set
151CONFIG_PREEMPT_BKL=y 164CONFIG_PREEMPT_BKL=y
152# CONFIG_MIPS_INSANE_LARGE is not set 165# CONFIG_MIPS_INSANE_LARGE is not set
166CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
153 167
154# 168#
155# Code maturity level options 169# Code maturity level options
@@ -183,10 +197,12 @@ CONFIG_PRINTK=y
183CONFIG_BUG=y 197CONFIG_BUG=y
184CONFIG_ELF_CORE=y 198CONFIG_ELF_CORE=y
185CONFIG_BASE_FULL=y 199CONFIG_BASE_FULL=y
200CONFIG_RT_MUTEXES=y
186CONFIG_FUTEX=y 201CONFIG_FUTEX=y
187CONFIG_EPOLL=y 202CONFIG_EPOLL=y
188CONFIG_SHMEM=y 203CONFIG_SHMEM=y
189CONFIG_SLAB=y 204CONFIG_SLAB=y
205CONFIG_VM_EVENT_COUNTERS=y
190# CONFIG_TINY_SHMEM is not set 206# CONFIG_TINY_SHMEM is not set
191CONFIG_BASE_SMALL=0 207CONFIG_BASE_SMALL=0
192# CONFIG_SLOB is not set 208# CONFIG_SLOB is not set
@@ -283,6 +299,8 @@ CONFIG_IP_PNP=y
283# CONFIG_INET_IPCOMP is not set 299# CONFIG_INET_IPCOMP is not set
284# CONFIG_INET_XFRM_TUNNEL is not set 300# CONFIG_INET_XFRM_TUNNEL is not set
285# CONFIG_INET_TUNNEL is not set 301# CONFIG_INET_TUNNEL is not set
302CONFIG_INET_XFRM_MODE_TRANSPORT=m
303CONFIG_INET_XFRM_MODE_TUNNEL=m
286CONFIG_INET_DIAG=y 304CONFIG_INET_DIAG=y
287CONFIG_INET_TCP_DIAG=y 305CONFIG_INET_TCP_DIAG=y
288# CONFIG_TCP_CONG_ADVANCED is not set 306# CONFIG_TCP_CONG_ADVANCED is not set
@@ -290,6 +308,7 @@ CONFIG_TCP_CONG_BIC=y
290# CONFIG_IPV6 is not set 308# CONFIG_IPV6 is not set
291# CONFIG_INET6_XFRM_TUNNEL is not set 309# CONFIG_INET6_XFRM_TUNNEL is not set
292# CONFIG_INET6_TUNNEL is not set 310# CONFIG_INET6_TUNNEL is not set
311CONFIG_NETWORK_SECMARK=y
293# CONFIG_NETFILTER is not set 312# CONFIG_NETFILTER is not set
294 313
295# 314#
@@ -387,6 +406,7 @@ CONFIG_WIRELESS_EXT=y
387CONFIG_STANDALONE=y 406CONFIG_STANDALONE=y
388CONFIG_PREVENT_FIRMWARE_BUILD=y 407CONFIG_PREVENT_FIRMWARE_BUILD=y
389CONFIG_FW_LOADER=y 408CONFIG_FW_LOADER=y
409# CONFIG_SYS_HYPERVISOR is not set
390 410
391# 411#
392# Connector - unified userspace <-> kernelspace linker 412# Connector - unified userspace <-> kernelspace linker
@@ -479,6 +499,7 @@ CONFIG_SCSI_SAS_ATTRS=m
479# CONFIG_MEGARAID_LEGACY is not set 499# CONFIG_MEGARAID_LEGACY is not set
480# CONFIG_MEGARAID_SAS is not set 500# CONFIG_MEGARAID_SAS is not set
481# CONFIG_SCSI_SATA is not set 501# CONFIG_SCSI_SATA is not set
502# CONFIG_SCSI_HPTIOP is not set
482# CONFIG_SCSI_DMX3191D is not set 503# CONFIG_SCSI_DMX3191D is not set
483# CONFIG_SCSI_FUTURE_DOMAIN is not set 504# CONFIG_SCSI_FUTURE_DOMAIN is not set
484# CONFIG_SCSI_IPS is not set 505# CONFIG_SCSI_IPS is not set
@@ -502,9 +523,8 @@ CONFIG_MD_LINEAR=m
502CONFIG_MD_RAID0=y 523CONFIG_MD_RAID0=y
503CONFIG_MD_RAID1=y 524CONFIG_MD_RAID1=y
504CONFIG_MD_RAID10=m 525CONFIG_MD_RAID10=m
505CONFIG_MD_RAID5=y 526CONFIG_MD_RAID456=m
506CONFIG_MD_RAID5_RESHAPE=y 527CONFIG_MD_RAID5_RESHAPE=y
507CONFIG_MD_RAID6=m
508CONFIG_MD_MULTIPATH=m 528CONFIG_MD_MULTIPATH=m
509CONFIG_MD_FAULTY=m 529CONFIG_MD_FAULTY=m
510CONFIG_BLK_DEV_DM=m 530CONFIG_BLK_DEV_DM=m
@@ -560,6 +580,8 @@ CONFIG_DAVICOM_PHY=m
560CONFIG_QSEMI_PHY=m 580CONFIG_QSEMI_PHY=m
561CONFIG_LXT_PHY=m 581CONFIG_LXT_PHY=m
562CONFIG_CICADA_PHY=m 582CONFIG_CICADA_PHY=m
583CONFIG_VITESSE_PHY=m
584CONFIG_SMSC_PHY=m
563 585
564# 586#
565# Ethernet (10 or 100Mbit) 587# Ethernet (10 or 100Mbit)
@@ -567,8 +589,6 @@ CONFIG_CICADA_PHY=m
567CONFIG_NET_ETHERNET=y 589CONFIG_NET_ETHERNET=y
568CONFIG_MII=y 590CONFIG_MII=y
569CONFIG_SGI_IOC3_ETH=y 591CONFIG_SGI_IOC3_ETH=y
570CONFIG_SGI_IOC3_ETH_HW_RX_CSUM=y
571CONFIG_SGI_IOC3_ETH_HW_TX_CSUM=y
572# CONFIG_HAPPYMEAL is not set 592# CONFIG_HAPPYMEAL is not set
573# CONFIG_SUNGEM is not set 593# CONFIG_SUNGEM is not set
574# CONFIG_CASSINI is not set 594# CONFIG_CASSINI is not set
@@ -605,6 +625,7 @@ CONFIG_SGI_IOC3_ETH_HW_TX_CSUM=y
605# CONFIG_CHELSIO_T1 is not set 625# CONFIG_CHELSIO_T1 is not set
606# CONFIG_IXGB is not set 626# CONFIG_IXGB is not set
607# CONFIG_S2IO is not set 627# CONFIG_S2IO is not set
628# CONFIG_MYRI10GE is not set
608 629
609# 630#
610# Token Ring devices 631# Token Ring devices
@@ -695,6 +716,7 @@ CONFIG_LEGACY_PTY_COUNT=256
695# Watchdog Cards 716# Watchdog Cards
696# 717#
697# CONFIG_WATCHDOG is not set 718# CONFIG_WATCHDOG is not set
719# CONFIG_HW_RANDOM is not set
698# CONFIG_RTC is not set 720# CONFIG_RTC is not set
699CONFIG_SGI_IP27_RTC=y 721CONFIG_SGI_IP27_RTC=y
700# CONFIG_GEN_RTC is not set 722# CONFIG_GEN_RTC is not set
@@ -744,6 +766,7 @@ CONFIG_SGI_IP27_RTC=y
744# Multimedia devices 766# Multimedia devices
745# 767#
746# CONFIG_VIDEO_DEV is not set 768# CONFIG_VIDEO_DEV is not set
769CONFIG_VIDEO_V4L2=y
747 770
748# 771#
749# Digital Video Broadcasting Devices 772# Digital Video Broadcasting Devices
@@ -753,6 +776,7 @@ CONFIG_SGI_IP27_RTC=y
753# 776#
754# Graphics support 777# Graphics support
755# 778#
779# CONFIG_FIRMWARE_EDID is not set
756# CONFIG_FB is not set 780# CONFIG_FB is not set
757 781
758# 782#
@@ -810,6 +834,19 @@ CONFIG_USB_ARCH_HAS_EHCI=y
810# CONFIG_RTC_CLASS is not set 834# CONFIG_RTC_CLASS is not set
811 835
812# 836#
837# DMA Engine support
838#
839# CONFIG_DMA_ENGINE is not set
840
841#
842# DMA Clients
843#
844
845#
846# DMA Devices
847#
848
849#
813# File systems 850# File systems
814# 851#
815CONFIG_EXT2_FS=y 852CONFIG_EXT2_FS=y
@@ -836,6 +873,7 @@ CONFIG_XFS_POSIX_ACL=y
836# CONFIG_MINIX_FS is not set 873# CONFIG_MINIX_FS is not set
837# CONFIG_ROMFS_FS is not set 874# CONFIG_ROMFS_FS is not set
838CONFIG_INOTIFY=y 875CONFIG_INOTIFY=y
876CONFIG_INOTIFY_USER=y
839# CONFIG_QUOTA is not set 877# CONFIG_QUOTA is not set
840CONFIG_QUOTACTL=y 878CONFIG_QUOTACTL=y
841CONFIG_DNOTIFY=y 879CONFIG_DNOTIFY=y
@@ -903,6 +941,7 @@ CONFIG_RPCSEC_GSS_KRB5=y
903# CONFIG_RPCSEC_GSS_SPKM3 is not set 941# CONFIG_RPCSEC_GSS_SPKM3 is not set
904# CONFIG_SMB_FS is not set 942# CONFIG_SMB_FS is not set
905# CONFIG_CIFS is not set 943# CONFIG_CIFS is not set
944# CONFIG_CIFS_DEBUG2 is not set
906# CONFIG_NCP_FS is not set 945# CONFIG_NCP_FS is not set
907# CONFIG_CODA_FS is not set 946# CONFIG_CODA_FS is not set
908# CONFIG_AFS_FS is not set 947# CONFIG_AFS_FS is not set
@@ -944,6 +983,7 @@ CONFIG_SGI_PARTITION=y
944# 983#
945# CONFIG_PRINTK_TIME is not set 984# CONFIG_PRINTK_TIME is not set
946# CONFIG_MAGIC_SYSRQ is not set 985# CONFIG_MAGIC_SYSRQ is not set
986# CONFIG_UNUSED_SYMBOLS is not set
947# CONFIG_DEBUG_KERNEL is not set 987# CONFIG_DEBUG_KERNEL is not set
948CONFIG_LOG_BUF_SHIFT=15 988CONFIG_LOG_BUF_SHIFT=15
949# CONFIG_DEBUG_FS is not set 989# CONFIG_DEBUG_FS is not set
@@ -999,3 +1039,4 @@ CONFIG_CRC32=y
999CONFIG_LIBCRC32C=m 1039CONFIG_LIBCRC32C=m
1000CONFIG_ZLIB_INFLATE=m 1040CONFIG_ZLIB_INFLATE=m
1001CONFIG_ZLIB_DEFLATE=m 1041CONFIG_ZLIB_DEFLATE=m
1042CONFIG_PLIST=y
diff --git a/arch/mips/configs/ip32_defconfig b/arch/mips/configs/ip32_defconfig
index 31b3c92a3841..f83dc09c3ca9 100644
--- a/arch/mips/configs/ip32_defconfig
+++ b/arch/mips/configs/ip32_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:51:05 2006 4# Thu Jul 6 10:04:11 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MIPS=y
45# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50CONFIG_SGI_IP32=y 53CONFIG_SGI_IP32=y
@@ -65,6 +68,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
65CONFIG_GENERIC_FIND_NEXT_BIT=y 68CONFIG_GENERIC_FIND_NEXT_BIT=y
66CONFIG_GENERIC_HWEIGHT=y 69CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 70CONFIG_GENERIC_CALIBRATE_DELAY=y
71CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
68CONFIG_ARC=y 72CONFIG_ARC=y
69CONFIG_DMA_IP32=y 73CONFIG_DMA_IP32=y
70CONFIG_DMA_NONCOHERENT=y 74CONFIG_DMA_NONCOHERENT=y
@@ -120,7 +124,10 @@ CONFIG_PAGE_SIZE_4KB=y
120CONFIG_BOARD_SCACHE=y 124CONFIG_BOARD_SCACHE=y
121CONFIG_R5000_CPU_SCACHE=y 125CONFIG_R5000_CPU_SCACHE=y
122CONFIG_RM7000_CPU_SCACHE=y 126CONFIG_RM7000_CPU_SCACHE=y
123# CONFIG_MIPS_MT is not set 127CONFIG_MIPS_MT_DISABLED=y
128# CONFIG_MIPS_MT_SMTC is not set
129# CONFIG_MIPS_MT_SMP is not set
130# CONFIG_MIPS_VPE_LOADER is not set
124CONFIG_CPU_HAS_LLSC=y 131CONFIG_CPU_HAS_LLSC=y
125CONFIG_CPU_HAS_SYNC=y 132CONFIG_CPU_HAS_SYNC=y
126CONFIG_GENERIC_HARDIRQS=y 133CONFIG_GENERIC_HARDIRQS=y
@@ -134,6 +141,7 @@ CONFIG_FLATMEM=y
134CONFIG_FLAT_NODE_MEM_MAP=y 141CONFIG_FLAT_NODE_MEM_MAP=y
135# CONFIG_SPARSEMEM_STATIC is not set 142# CONFIG_SPARSEMEM_STATIC is not set
136CONFIG_SPLIT_PTLOCK_CPUS=4 143CONFIG_SPLIT_PTLOCK_CPUS=4
144CONFIG_RESOURCES_64BIT=y
137# CONFIG_HZ_48 is not set 145# CONFIG_HZ_48 is not set
138# CONFIG_HZ_100 is not set 146# CONFIG_HZ_100 is not set
139# CONFIG_HZ_128 is not set 147# CONFIG_HZ_128 is not set
@@ -146,6 +154,7 @@ CONFIG_HZ=1000
146# CONFIG_PREEMPT_NONE is not set 154# CONFIG_PREEMPT_NONE is not set
147CONFIG_PREEMPT_VOLUNTARY=y 155CONFIG_PREEMPT_VOLUNTARY=y
148# CONFIG_PREEMPT is not set 156# CONFIG_PREEMPT is not set
157CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
149 158
150# 159#
151# Code maturity level options 160# Code maturity level options
@@ -178,10 +187,12 @@ CONFIG_PRINTK=y
178CONFIG_BUG=y 187CONFIG_BUG=y
179CONFIG_ELF_CORE=y 188CONFIG_ELF_CORE=y
180CONFIG_BASE_FULL=y 189CONFIG_BASE_FULL=y
190CONFIG_RT_MUTEXES=y
181CONFIG_FUTEX=y 191CONFIG_FUTEX=y
182CONFIG_EPOLL=y 192CONFIG_EPOLL=y
183CONFIG_SHMEM=y 193CONFIG_SHMEM=y
184CONFIG_SLAB=y 194CONFIG_SLAB=y
195CONFIG_VM_EVENT_COUNTERS=y
185# CONFIG_TINY_SHMEM is not set 196# CONFIG_TINY_SHMEM is not set
186CONFIG_BASE_SMALL=0 197CONFIG_BASE_SMALL=0
187# CONFIG_SLOB is not set 198# CONFIG_SLOB is not set
@@ -270,6 +281,8 @@ CONFIG_IP_PNP_BOOTP=y
270# CONFIG_INET_IPCOMP is not set 281# CONFIG_INET_IPCOMP is not set
271# CONFIG_INET_XFRM_TUNNEL is not set 282# CONFIG_INET_XFRM_TUNNEL is not set
272# CONFIG_INET_TUNNEL is not set 283# CONFIG_INET_TUNNEL is not set
284CONFIG_INET_XFRM_MODE_TRANSPORT=y
285CONFIG_INET_XFRM_MODE_TUNNEL=y
273CONFIG_INET_DIAG=y 286CONFIG_INET_DIAG=y
274CONFIG_INET_TCP_DIAG=y 287CONFIG_INET_TCP_DIAG=y
275# CONFIG_TCP_CONG_ADVANCED is not set 288# CONFIG_TCP_CONG_ADVANCED is not set
@@ -277,6 +290,7 @@ CONFIG_TCP_CONG_BIC=y
277# CONFIG_IPV6 is not set 290# CONFIG_IPV6 is not set
278# CONFIG_INET6_XFRM_TUNNEL is not set 291# CONFIG_INET6_XFRM_TUNNEL is not set
279# CONFIG_INET6_TUNNEL is not set 292# CONFIG_INET6_TUNNEL is not set
293CONFIG_NETWORK_SECMARK=y
280# CONFIG_NETFILTER is not set 294# CONFIG_NETFILTER is not set
281 295
282# 296#
@@ -336,6 +350,7 @@ CONFIG_WIRELESS_EXT=y
336CONFIG_STANDALONE=y 350CONFIG_STANDALONE=y
337CONFIG_PREVENT_FIRMWARE_BUILD=y 351CONFIG_PREVENT_FIRMWARE_BUILD=y
338CONFIG_FW_LOADER=y 352CONFIG_FW_LOADER=y
353# CONFIG_SYS_HYPERVISOR is not set
339 354
340# 355#
341# Connector - unified userspace <-> kernelspace linker 356# Connector - unified userspace <-> kernelspace linker
@@ -434,6 +449,7 @@ CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
434# CONFIG_MEGARAID_LEGACY is not set 449# CONFIG_MEGARAID_LEGACY is not set
435# CONFIG_MEGARAID_SAS is not set 450# CONFIG_MEGARAID_SAS is not set
436# CONFIG_SCSI_SATA is not set 451# CONFIG_SCSI_SATA is not set
452# CONFIG_SCSI_HPTIOP is not set
437# CONFIG_SCSI_DMX3191D is not set 453# CONFIG_SCSI_DMX3191D is not set
438# CONFIG_SCSI_FUTURE_DOMAIN is not set 454# CONFIG_SCSI_FUTURE_DOMAIN is not set
439# CONFIG_SCSI_IPS is not set 455# CONFIG_SCSI_IPS is not set
@@ -498,6 +514,8 @@ CONFIG_DAVICOM_PHY=y
498CONFIG_QSEMI_PHY=y 514CONFIG_QSEMI_PHY=y
499CONFIG_LXT_PHY=y 515CONFIG_LXT_PHY=y
500CONFIG_CICADA_PHY=y 516CONFIG_CICADA_PHY=y
517CONFIG_VITESSE_PHY=y
518CONFIG_SMSC_PHY=y
501 519
502# 520#
503# Ethernet (10 or 100Mbit) 521# Ethernet (10 or 100Mbit)
@@ -541,6 +559,7 @@ CONFIG_SGI_O2MACE_ETH=y
541# CONFIG_CHELSIO_T1 is not set 559# CONFIG_CHELSIO_T1 is not set
542# CONFIG_IXGB is not set 560# CONFIG_IXGB is not set
543# CONFIG_S2IO is not set 561# CONFIG_S2IO is not set
562# CONFIG_MYRI10GE is not set
544 563
545# 564#
546# Token Ring devices 565# Token Ring devices
@@ -620,6 +639,7 @@ CONFIG_SERIO_RAW=y
620CONFIG_VT=y 639CONFIG_VT=y
621CONFIG_VT_CONSOLE=y 640CONFIG_VT_CONSOLE=y
622CONFIG_HW_CONSOLE=y 641CONFIG_HW_CONSOLE=y
642CONFIG_VT_HW_CONSOLE_BINDING=y
623# CONFIG_SERIAL_NONSTANDARD is not set 643# CONFIG_SERIAL_NONSTANDARD is not set
624 644
625# 645#
@@ -651,6 +671,7 @@ CONFIG_LEGACY_PTY_COUNT=256
651# Watchdog Cards 671# Watchdog Cards
652# 672#
653# CONFIG_WATCHDOG is not set 673# CONFIG_WATCHDOG is not set
674# CONFIG_HW_RANDOM is not set
654# CONFIG_RTC is not set 675# CONFIG_RTC is not set
655# CONFIG_GEN_RTC is not set 676# CONFIG_GEN_RTC is not set
656# CONFIG_DTLK is not set 677# CONFIG_DTLK is not set
@@ -699,6 +720,7 @@ CONFIG_LEGACY_PTY_COUNT=256
699# Multimedia devices 720# Multimedia devices
700# 721#
701# CONFIG_VIDEO_DEV is not set 722# CONFIG_VIDEO_DEV is not set
723CONFIG_VIDEO_V4L2=y
702 724
703# 725#
704# Digital Video Broadcasting Devices 726# Digital Video Broadcasting Devices
@@ -708,6 +730,7 @@ CONFIG_LEGACY_PTY_COUNT=256
708# 730#
709# Graphics support 731# Graphics support
710# 732#
733# CONFIG_FIRMWARE_EDID is not set
711# CONFIG_FB is not set 734# CONFIG_FB is not set
712 735
713# 736#
@@ -771,6 +794,19 @@ CONFIG_USB_ARCH_HAS_EHCI=y
771# CONFIG_RTC_CLASS is not set 794# CONFIG_RTC_CLASS is not set
772 795
773# 796#
797# DMA Engine support
798#
799# CONFIG_DMA_ENGINE is not set
800
801#
802# DMA Clients
803#
804
805#
806# DMA Devices
807#
808
809#
774# File systems 810# File systems
775# 811#
776CONFIG_EXT2_FS=y 812CONFIG_EXT2_FS=y
@@ -785,6 +821,7 @@ CONFIG_EXT2_FS=y
785# CONFIG_MINIX_FS is not set 821# CONFIG_MINIX_FS is not set
786# CONFIG_ROMFS_FS is not set 822# CONFIG_ROMFS_FS is not set
787CONFIG_INOTIFY=y 823CONFIG_INOTIFY=y
824CONFIG_INOTIFY_USER=y
788# CONFIG_QUOTA is not set 825# CONFIG_QUOTA is not set
789CONFIG_DNOTIFY=y 826CONFIG_DNOTIFY=y
790# CONFIG_AUTOFS_FS is not set 827# CONFIG_AUTOFS_FS is not set
@@ -850,6 +887,7 @@ CONFIG_SUNRPC=y
850# CONFIG_RPCSEC_GSS_SPKM3 is not set 887# CONFIG_RPCSEC_GSS_SPKM3 is not set
851# CONFIG_SMB_FS is not set 888# CONFIG_SMB_FS is not set
852# CONFIG_CIFS is not set 889# CONFIG_CIFS is not set
890# CONFIG_CIFS_DEBUG2 is not set
853# CONFIG_NCP_FS is not set 891# CONFIG_NCP_FS is not set
854# CONFIG_CODA_FS is not set 892# CONFIG_CODA_FS is not set
855# CONFIG_AFS_FS is not set 893# CONFIG_AFS_FS is not set
@@ -887,6 +925,7 @@ CONFIG_SGI_PARTITION=y
887# 925#
888# CONFIG_PRINTK_TIME is not set 926# CONFIG_PRINTK_TIME is not set
889# CONFIG_MAGIC_SYSRQ is not set 927# CONFIG_MAGIC_SYSRQ is not set
928# CONFIG_UNUSED_SYMBOLS is not set
890# CONFIG_DEBUG_KERNEL is not set 929# CONFIG_DEBUG_KERNEL is not set
891CONFIG_LOG_BUF_SHIFT=14 930CONFIG_LOG_BUF_SHIFT=14
892# CONFIG_DEBUG_FS is not set 931# CONFIG_DEBUG_FS is not set
@@ -928,7 +967,6 @@ CONFIG_CRYPTO_ANUBIS=y
928CONFIG_CRYPTO_DEFLATE=y 967CONFIG_CRYPTO_DEFLATE=y
929CONFIG_CRYPTO_MICHAEL_MIC=y 968CONFIG_CRYPTO_MICHAEL_MIC=y
930CONFIG_CRYPTO_CRC32C=y 969CONFIG_CRYPTO_CRC32C=y
931# CONFIG_CRYPTO_TEST is not set
932 970
933# 971#
934# Hardware crypto devices 972# Hardware crypto devices
@@ -943,3 +981,4 @@ CONFIG_CRC32=y
943CONFIG_LIBCRC32C=y 981CONFIG_LIBCRC32C=y
944CONFIG_ZLIB_INFLATE=y 982CONFIG_ZLIB_INFLATE=y
945CONFIG_ZLIB_DEFLATE=y 983CONFIG_ZLIB_DEFLATE=y
984CONFIG_PLIST=y
diff --git a/arch/mips/configs/it8172_defconfig b/arch/mips/configs/it8172_defconfig
index 809bae9013ac..a91d72a9ca86 100644
--- a/arch/mips/configs/it8172_defconfig
+++ b/arch/mips/configs/it8172_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:51:05 2006 4# Thu Jul 6 10:04:11 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS_ITE8172=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MIPS_ITE8172=y
45# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -66,6 +69,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
66CONFIG_GENERIC_FIND_NEXT_BIT=y 69CONFIG_GENERIC_FIND_NEXT_BIT=y
67CONFIG_GENERIC_HWEIGHT=y 70CONFIG_GENERIC_HWEIGHT=y
68CONFIG_GENERIC_CALIBRATE_DELAY=y 71CONFIG_GENERIC_CALIBRATE_DELAY=y
72CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
69CONFIG_DMA_NONCOHERENT=y 73CONFIG_DMA_NONCOHERENT=y
70CONFIG_DMA_NEED_PCI_MAP_STATE=y 74CONFIG_DMA_NEED_PCI_MAP_STATE=y
71# CONFIG_CPU_BIG_ENDIAN is not set 75# CONFIG_CPU_BIG_ENDIAN is not set
@@ -114,7 +118,10 @@ CONFIG_PAGE_SIZE_4KB=y
114# CONFIG_PAGE_SIZE_8KB is not set 118# CONFIG_PAGE_SIZE_8KB is not set
115# CONFIG_PAGE_SIZE_16KB is not set 119# CONFIG_PAGE_SIZE_16KB is not set
116# CONFIG_PAGE_SIZE_64KB is not set 120# CONFIG_PAGE_SIZE_64KB is not set
117# CONFIG_MIPS_MT is not set 121CONFIG_MIPS_MT_DISABLED=y
122# CONFIG_MIPS_MT_SMTC is not set
123# CONFIG_MIPS_MT_SMP is not set
124# CONFIG_MIPS_VPE_LOADER is not set
118CONFIG_CPU_HAS_LLSC=y 125CONFIG_CPU_HAS_LLSC=y
119CONFIG_CPU_HAS_SYNC=y 126CONFIG_CPU_HAS_SYNC=y
120CONFIG_GENERIC_HARDIRQS=y 127CONFIG_GENERIC_HARDIRQS=y
@@ -128,6 +135,7 @@ CONFIG_FLATMEM=y
128CONFIG_FLAT_NODE_MEM_MAP=y 135CONFIG_FLAT_NODE_MEM_MAP=y
129# CONFIG_SPARSEMEM_STATIC is not set 136# CONFIG_SPARSEMEM_STATIC is not set
130CONFIG_SPLIT_PTLOCK_CPUS=4 137CONFIG_SPLIT_PTLOCK_CPUS=4
138# CONFIG_RESOURCES_64BIT is not set
131# CONFIG_HZ_48 is not set 139# CONFIG_HZ_48 is not set
132# CONFIG_HZ_100 is not set 140# CONFIG_HZ_100 is not set
133# CONFIG_HZ_128 is not set 141# CONFIG_HZ_128 is not set
@@ -140,6 +148,7 @@ CONFIG_HZ=1000
140CONFIG_PREEMPT_NONE=y 148CONFIG_PREEMPT_NONE=y
141# CONFIG_PREEMPT_VOLUNTARY is not set 149# CONFIG_PREEMPT_VOLUNTARY is not set
142# CONFIG_PREEMPT is not set 150# CONFIG_PREEMPT is not set
151CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
143 152
144# 153#
145# Code maturity level options 154# Code maturity level options
@@ -172,14 +181,15 @@ CONFIG_PRINTK=y
172CONFIG_BUG=y 181CONFIG_BUG=y
173CONFIG_ELF_CORE=y 182CONFIG_ELF_CORE=y
174CONFIG_BASE_FULL=y 183CONFIG_BASE_FULL=y
184CONFIG_RT_MUTEXES=y
175CONFIG_FUTEX=y 185CONFIG_FUTEX=y
176CONFIG_EPOLL=y 186CONFIG_EPOLL=y
177CONFIG_SHMEM=y 187CONFIG_SHMEM=y
178CONFIG_SLAB=y 188CONFIG_SLAB=y
189CONFIG_VM_EVENT_COUNTERS=y
179# CONFIG_TINY_SHMEM is not set 190# CONFIG_TINY_SHMEM is not set
180CONFIG_BASE_SMALL=0 191CONFIG_BASE_SMALL=0
181# CONFIG_SLOB is not set 192# CONFIG_SLOB is not set
182CONFIG_OBSOLETE_INTERMODULE=y
183 193
184# 194#
185# Loadable module support 195# Loadable module support
@@ -266,6 +276,8 @@ CONFIG_IP_PNP_BOOTP=y
266# CONFIG_INET_IPCOMP is not set 276# CONFIG_INET_IPCOMP is not set
267# CONFIG_INET_XFRM_TUNNEL is not set 277# CONFIG_INET_XFRM_TUNNEL is not set
268# CONFIG_INET_TUNNEL is not set 278# CONFIG_INET_TUNNEL is not set
279CONFIG_INET_XFRM_MODE_TRANSPORT=m
280CONFIG_INET_XFRM_MODE_TUNNEL=m
269CONFIG_INET_DIAG=y 281CONFIG_INET_DIAG=y
270CONFIG_INET_TCP_DIAG=y 282CONFIG_INET_TCP_DIAG=y
271# CONFIG_TCP_CONG_ADVANCED is not set 283# CONFIG_TCP_CONG_ADVANCED is not set
@@ -273,6 +285,7 @@ CONFIG_TCP_CONG_BIC=y
273# CONFIG_IPV6 is not set 285# CONFIG_IPV6 is not set
274# CONFIG_INET6_XFRM_TUNNEL is not set 286# CONFIG_INET6_XFRM_TUNNEL is not set
275# CONFIG_INET6_TUNNEL is not set 287# CONFIG_INET6_TUNNEL is not set
288CONFIG_NETWORK_SECMARK=y
276# CONFIG_NETFILTER is not set 289# CONFIG_NETFILTER is not set
277 290
278# 291#
@@ -332,6 +345,7 @@ CONFIG_WIRELESS_EXT=y
332CONFIG_STANDALONE=y 345CONFIG_STANDALONE=y
333CONFIG_PREVENT_FIRMWARE_BUILD=y 346CONFIG_PREVENT_FIRMWARE_BUILD=y
334# CONFIG_FW_LOADER is not set 347# CONFIG_FW_LOADER is not set
348# CONFIG_SYS_HYPERVISOR is not set
335 349
336# 350#
337# Connector - unified userspace <-> kernelspace linker 351# Connector - unified userspace <-> kernelspace linker
@@ -513,6 +527,8 @@ CONFIG_DAVICOM_PHY=m
513CONFIG_QSEMI_PHY=m 527CONFIG_QSEMI_PHY=m
514CONFIG_LXT_PHY=m 528CONFIG_LXT_PHY=m
515CONFIG_CICADA_PHY=m 529CONFIG_CICADA_PHY=m
530CONFIG_VITESSE_PHY=m
531CONFIG_SMSC_PHY=m
516 532
517# 533#
518# Ethernet (10 or 100Mbit) 534# Ethernet (10 or 100Mbit)
@@ -601,6 +617,7 @@ CONFIG_SERIO_RAW=m
601CONFIG_VT=y 617CONFIG_VT=y
602CONFIG_VT_CONSOLE=y 618CONFIG_VT_CONSOLE=y
603CONFIG_HW_CONSOLE=y 619CONFIG_HW_CONSOLE=y
620CONFIG_VT_HW_CONSOLE_BINDING=y
604# CONFIG_SERIAL_NONSTANDARD is not set 621# CONFIG_SERIAL_NONSTANDARD is not set
605# CONFIG_QTRONIX_KEYBOARD is not set 622# CONFIG_QTRONIX_KEYBOARD is not set
606# CONFIG_IT8172_SCR0 is not set 623# CONFIG_IT8172_SCR0 is not set
@@ -634,6 +651,7 @@ CONFIG_LEGACY_PTY_COUNT=256
634# Watchdog Cards 651# Watchdog Cards
635# 652#
636# CONFIG_WATCHDOG is not set 653# CONFIG_WATCHDOG is not set
654# CONFIG_HW_RANDOM is not set
637# CONFIG_RTC is not set 655# CONFIG_RTC is not set
638# CONFIG_GEN_RTC is not set 656# CONFIG_GEN_RTC is not set
639# CONFIG_DTLK is not set 657# CONFIG_DTLK is not set
@@ -680,6 +698,7 @@ CONFIG_LEGACY_PTY_COUNT=256
680# Multimedia devices 698# Multimedia devices
681# 699#
682# CONFIG_VIDEO_DEV is not set 700# CONFIG_VIDEO_DEV is not set
701CONFIG_VIDEO_V4L2=y
683 702
684# 703#
685# Digital Video Broadcasting Devices 704# Digital Video Broadcasting Devices
@@ -689,6 +708,7 @@ CONFIG_LEGACY_PTY_COUNT=256
689# 708#
690# Graphics support 709# Graphics support
691# 710#
711# CONFIG_FIRMWARE_EDID is not set
692# CONFIG_FB is not set 712# CONFIG_FB is not set
693 713
694# 714#
@@ -763,6 +783,19 @@ CONFIG_SOUND_IT8172=y
763# CONFIG_RTC_CLASS is not set 783# CONFIG_RTC_CLASS is not set
764 784
765# 785#
786# DMA Engine support
787#
788# CONFIG_DMA_ENGINE is not set
789
790#
791# DMA Clients
792#
793
794#
795# DMA Devices
796#
797
798#
766# File systems 799# File systems
767# 800#
768CONFIG_EXT2_FS=y 801CONFIG_EXT2_FS=y
@@ -777,6 +810,7 @@ CONFIG_EXT2_FS=y
777# CONFIG_MINIX_FS is not set 810# CONFIG_MINIX_FS is not set
778# CONFIG_ROMFS_FS is not set 811# CONFIG_ROMFS_FS is not set
779CONFIG_INOTIFY=y 812CONFIG_INOTIFY=y
813CONFIG_INOTIFY_USER=y
780# CONFIG_QUOTA is not set 814# CONFIG_QUOTA is not set
781CONFIG_DNOTIFY=y 815CONFIG_DNOTIFY=y
782# CONFIG_AUTOFS_FS is not set 816# CONFIG_AUTOFS_FS is not set
@@ -842,6 +876,7 @@ CONFIG_SUNRPC=y
842# CONFIG_RPCSEC_GSS_SPKM3 is not set 876# CONFIG_RPCSEC_GSS_SPKM3 is not set
843# CONFIG_SMB_FS is not set 877# CONFIG_SMB_FS is not set
844# CONFIG_CIFS is not set 878# CONFIG_CIFS is not set
879# CONFIG_CIFS_DEBUG2 is not set
845# CONFIG_NCP_FS is not set 880# CONFIG_NCP_FS is not set
846# CONFIG_CODA_FS is not set 881# CONFIG_CODA_FS is not set
847# CONFIG_AFS_FS is not set 882# CONFIG_AFS_FS is not set
@@ -868,6 +903,7 @@ CONFIG_MSDOS_PARTITION=y
868# 903#
869# CONFIG_PRINTK_TIME is not set 904# CONFIG_PRINTK_TIME is not set
870# CONFIG_MAGIC_SYSRQ is not set 905# CONFIG_MAGIC_SYSRQ is not set
906# CONFIG_UNUSED_SYMBOLS is not set
871# CONFIG_DEBUG_KERNEL is not set 907# CONFIG_DEBUG_KERNEL is not set
872CONFIG_LOG_BUF_SHIFT=14 908CONFIG_LOG_BUF_SHIFT=14
873# CONFIG_DEBUG_FS is not set 909# CONFIG_DEBUG_FS is not set
@@ -923,3 +959,4 @@ CONFIG_CRC32=m
923CONFIG_LIBCRC32C=m 959CONFIG_LIBCRC32C=m
924CONFIG_ZLIB_INFLATE=m 960CONFIG_ZLIB_INFLATE=m
925CONFIG_ZLIB_DEFLATE=m 961CONFIG_ZLIB_DEFLATE=m
962CONFIG_PLIST=y
diff --git a/arch/mips/configs/ivr_defconfig b/arch/mips/configs/ivr_defconfig
index 55108fd67844..cebc67212d06 100644
--- a/arch/mips/configs/ivr_defconfig
+++ b/arch/mips/configs/ivr_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:51:06 2006 4# Thu Jul 6 10:04:12 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS_IVR=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MIPS_IVR=y
45# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -65,6 +68,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
65CONFIG_GENERIC_FIND_NEXT_BIT=y 68CONFIG_GENERIC_FIND_NEXT_BIT=y
66CONFIG_GENERIC_HWEIGHT=y 69CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 70CONFIG_GENERIC_CALIBRATE_DELAY=y
71CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
68CONFIG_DMA_NONCOHERENT=y 72CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 73CONFIG_DMA_NEED_PCI_MAP_STATE=y
70# CONFIG_CPU_BIG_ENDIAN is not set 74# CONFIG_CPU_BIG_ENDIAN is not set
@@ -111,7 +115,10 @@ CONFIG_PAGE_SIZE_4KB=y
111# CONFIG_PAGE_SIZE_8KB is not set 115# CONFIG_PAGE_SIZE_8KB is not set
112# CONFIG_PAGE_SIZE_16KB is not set 116# CONFIG_PAGE_SIZE_16KB is not set
113# CONFIG_PAGE_SIZE_64KB is not set 117# CONFIG_PAGE_SIZE_64KB is not set
114# CONFIG_MIPS_MT is not set 118CONFIG_MIPS_MT_DISABLED=y
119# CONFIG_MIPS_MT_SMTC is not set
120# CONFIG_MIPS_MT_SMP is not set
121# CONFIG_MIPS_VPE_LOADER is not set
115CONFIG_CPU_HAS_LLSC=y 122CONFIG_CPU_HAS_LLSC=y
116CONFIG_CPU_HAS_SYNC=y 123CONFIG_CPU_HAS_SYNC=y
117CONFIG_GENERIC_HARDIRQS=y 124CONFIG_GENERIC_HARDIRQS=y
@@ -125,6 +132,7 @@ CONFIG_FLATMEM=y
125CONFIG_FLAT_NODE_MEM_MAP=y 132CONFIG_FLAT_NODE_MEM_MAP=y
126# CONFIG_SPARSEMEM_STATIC is not set 133# CONFIG_SPARSEMEM_STATIC is not set
127CONFIG_SPLIT_PTLOCK_CPUS=4 134CONFIG_SPLIT_PTLOCK_CPUS=4
135# CONFIG_RESOURCES_64BIT is not set
128# CONFIG_HZ_48 is not set 136# CONFIG_HZ_48 is not set
129# CONFIG_HZ_100 is not set 137# CONFIG_HZ_100 is not set
130# CONFIG_HZ_128 is not set 138# CONFIG_HZ_128 is not set
@@ -137,6 +145,7 @@ CONFIG_HZ=1000
137CONFIG_PREEMPT_NONE=y 145CONFIG_PREEMPT_NONE=y
138# CONFIG_PREEMPT_VOLUNTARY is not set 146# CONFIG_PREEMPT_VOLUNTARY is not set
139# CONFIG_PREEMPT is not set 147# CONFIG_PREEMPT is not set
148CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
140 149
141# 150#
142# Code maturity level options 151# Code maturity level options
@@ -169,10 +178,12 @@ CONFIG_PRINTK=y
169CONFIG_BUG=y 178CONFIG_BUG=y
170CONFIG_ELF_CORE=y 179CONFIG_ELF_CORE=y
171CONFIG_BASE_FULL=y 180CONFIG_BASE_FULL=y
181CONFIG_RT_MUTEXES=y
172CONFIG_FUTEX=y 182CONFIG_FUTEX=y
173CONFIG_EPOLL=y 183CONFIG_EPOLL=y
174CONFIG_SHMEM=y 184CONFIG_SHMEM=y
175CONFIG_SLAB=y 185CONFIG_SLAB=y
186CONFIG_VM_EVENT_COUNTERS=y
176# CONFIG_TINY_SHMEM is not set 187# CONFIG_TINY_SHMEM is not set
177CONFIG_BASE_SMALL=0 188CONFIG_BASE_SMALL=0
178# CONFIG_SLOB is not set 189# CONFIG_SLOB is not set
@@ -263,6 +274,8 @@ CONFIG_IP_PNP_BOOTP=y
263# CONFIG_INET_IPCOMP is not set 274# CONFIG_INET_IPCOMP is not set
264# CONFIG_INET_XFRM_TUNNEL is not set 275# CONFIG_INET_XFRM_TUNNEL is not set
265# CONFIG_INET_TUNNEL is not set 276# CONFIG_INET_TUNNEL is not set
277CONFIG_INET_XFRM_MODE_TRANSPORT=m
278CONFIG_INET_XFRM_MODE_TUNNEL=m
266CONFIG_INET_DIAG=y 279CONFIG_INET_DIAG=y
267CONFIG_INET_TCP_DIAG=y 280CONFIG_INET_TCP_DIAG=y
268# CONFIG_TCP_CONG_ADVANCED is not set 281# CONFIG_TCP_CONG_ADVANCED is not set
@@ -270,6 +283,7 @@ CONFIG_TCP_CONG_BIC=y
270# CONFIG_IPV6 is not set 283# CONFIG_IPV6 is not set
271# CONFIG_INET6_XFRM_TUNNEL is not set 284# CONFIG_INET6_XFRM_TUNNEL is not set
272# CONFIG_INET6_TUNNEL is not set 285# CONFIG_INET6_TUNNEL is not set
286CONFIG_NETWORK_SECMARK=y
273# CONFIG_NETFILTER is not set 287# CONFIG_NETFILTER is not set
274 288
275# 289#
@@ -329,6 +343,7 @@ CONFIG_WIRELESS_EXT=y
329CONFIG_STANDALONE=y 343CONFIG_STANDALONE=y
330CONFIG_PREVENT_FIRMWARE_BUILD=y 344CONFIG_PREVENT_FIRMWARE_BUILD=y
331CONFIG_FW_LOADER=m 345CONFIG_FW_LOADER=m
346# CONFIG_SYS_HYPERVISOR is not set
332 347
333# 348#
334# Connector - unified userspace <-> kernelspace linker 349# Connector - unified userspace <-> kernelspace linker
@@ -447,6 +462,8 @@ CONFIG_DAVICOM_PHY=m
447CONFIG_QSEMI_PHY=m 462CONFIG_QSEMI_PHY=m
448CONFIG_LXT_PHY=m 463CONFIG_LXT_PHY=m
449CONFIG_CICADA_PHY=m 464CONFIG_CICADA_PHY=m
465CONFIG_VITESSE_PHY=m
466CONFIG_SMSC_PHY=m
450 467
451# 468#
452# Ethernet (10 or 100Mbit) 469# Ethernet (10 or 100Mbit)
@@ -489,6 +506,7 @@ CONFIG_NET_ETHERNET=y
489# CONFIG_CHELSIO_T1 is not set 506# CONFIG_CHELSIO_T1 is not set
490# CONFIG_IXGB is not set 507# CONFIG_IXGB is not set
491# CONFIG_S2IO is not set 508# CONFIG_S2IO is not set
509# CONFIG_MYRI10GE is not set
492 510
493# 511#
494# Token Ring devices 512# Token Ring devices
@@ -566,6 +584,7 @@ CONFIG_SERIO_RAW=m
566CONFIG_VT=y 584CONFIG_VT=y
567CONFIG_VT_CONSOLE=y 585CONFIG_VT_CONSOLE=y
568CONFIG_HW_CONSOLE=y 586CONFIG_HW_CONSOLE=y
587CONFIG_VT_HW_CONSOLE_BINDING=y
569# CONFIG_SERIAL_NONSTANDARD is not set 588# CONFIG_SERIAL_NONSTANDARD is not set
570CONFIG_QTRONIX_KEYBOARD=y 589CONFIG_QTRONIX_KEYBOARD=y
571CONFIG_IT8172_SCR0=y 590CONFIG_IT8172_SCR0=y
@@ -600,6 +619,7 @@ CONFIG_LEGACY_PTY_COUNT=256
600# Watchdog Cards 619# Watchdog Cards
601# 620#
602# CONFIG_WATCHDOG is not set 621# CONFIG_WATCHDOG is not set
622# CONFIG_HW_RANDOM is not set
603CONFIG_RTC=y 623CONFIG_RTC=y
604# CONFIG_DTLK is not set 624# CONFIG_DTLK is not set
605# CONFIG_R3964 is not set 625# CONFIG_R3964 is not set
@@ -647,6 +667,7 @@ CONFIG_RTC=y
647# Multimedia devices 667# Multimedia devices
648# 668#
649# CONFIG_VIDEO_DEV is not set 669# CONFIG_VIDEO_DEV is not set
670CONFIG_VIDEO_V4L2=y
650 671
651# 672#
652# Digital Video Broadcasting Devices 673# Digital Video Broadcasting Devices
@@ -656,6 +677,7 @@ CONFIG_RTC=y
656# 677#
657# Graphics support 678# Graphics support
658# 679#
680# CONFIG_FIRMWARE_EDID is not set
659# CONFIG_FB is not set 681# CONFIG_FB is not set
660 682
661# 683#
@@ -719,6 +741,19 @@ CONFIG_USB_ARCH_HAS_EHCI=y
719# CONFIG_RTC_CLASS is not set 741# CONFIG_RTC_CLASS is not set
720 742
721# 743#
744# DMA Engine support
745#
746# CONFIG_DMA_ENGINE is not set
747
748#
749# DMA Clients
750#
751
752#
753# DMA Devices
754#
755
756#
722# File systems 757# File systems
723# 758#
724CONFIG_EXT2_FS=y 759CONFIG_EXT2_FS=y
@@ -733,6 +768,7 @@ CONFIG_EXT2_FS=y
733# CONFIG_MINIX_FS is not set 768# CONFIG_MINIX_FS is not set
734# CONFIG_ROMFS_FS is not set 769# CONFIG_ROMFS_FS is not set
735CONFIG_INOTIFY=y 770CONFIG_INOTIFY=y
771CONFIG_INOTIFY_USER=y
736# CONFIG_QUOTA is not set 772# CONFIG_QUOTA is not set
737CONFIG_DNOTIFY=y 773CONFIG_DNOTIFY=y
738# CONFIG_AUTOFS_FS is not set 774# CONFIG_AUTOFS_FS is not set
@@ -796,6 +832,7 @@ CONFIG_SUNRPC=y
796# CONFIG_RPCSEC_GSS_SPKM3 is not set 832# CONFIG_RPCSEC_GSS_SPKM3 is not set
797# CONFIG_SMB_FS is not set 833# CONFIG_SMB_FS is not set
798# CONFIG_CIFS is not set 834# CONFIG_CIFS is not set
835# CONFIG_CIFS_DEBUG2 is not set
799# CONFIG_NCP_FS is not set 836# CONFIG_NCP_FS is not set
800# CONFIG_CODA_FS is not set 837# CONFIG_CODA_FS is not set
801# CONFIG_AFS_FS is not set 838# CONFIG_AFS_FS is not set
@@ -822,6 +859,7 @@ CONFIG_MSDOS_PARTITION=y
822# 859#
823# CONFIG_PRINTK_TIME is not set 860# CONFIG_PRINTK_TIME is not set
824# CONFIG_MAGIC_SYSRQ is not set 861# CONFIG_MAGIC_SYSRQ is not set
862# CONFIG_UNUSED_SYMBOLS is not set
825# CONFIG_DEBUG_KERNEL is not set 863# CONFIG_DEBUG_KERNEL is not set
826CONFIG_LOG_BUF_SHIFT=14 864CONFIG_LOG_BUF_SHIFT=14
827# CONFIG_DEBUG_FS is not set 865# CONFIG_DEBUG_FS is not set
@@ -877,3 +915,4 @@ CONFIG_CRC32=m
877CONFIG_LIBCRC32C=m 915CONFIG_LIBCRC32C=m
878CONFIG_ZLIB_INFLATE=m 916CONFIG_ZLIB_INFLATE=m
879CONFIG_ZLIB_DEFLATE=m 917CONFIG_ZLIB_DEFLATE=m
918CONFIG_PLIST=y
diff --git a/arch/mips/configs/jaguar-atx_defconfig b/arch/mips/configs/jaguar-atx_defconfig
index ef2843436057..5d9eb11aba3d 100644
--- a/arch/mips/configs/jaguar-atx_defconfig
+++ b/arch/mips/configs/jaguar-atx_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:51:06 2006 4# Thu Jul 6 10:04:12 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36CONFIG_MOMENCO_JAGUAR_ATX=y 38CONFIG_MOMENCO_JAGUAR_ATX=y
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MOMENCO_JAGUAR_ATX=y
45# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -66,6 +69,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
66CONFIG_GENERIC_FIND_NEXT_BIT=y 69CONFIG_GENERIC_FIND_NEXT_BIT=y
67CONFIG_GENERIC_HWEIGHT=y 70CONFIG_GENERIC_HWEIGHT=y
68CONFIG_GENERIC_CALIBRATE_DELAY=y 71CONFIG_GENERIC_CALIBRATE_DELAY=y
72CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
69CONFIG_DMA_NONCOHERENT=y 73CONFIG_DMA_NONCOHERENT=y
70CONFIG_DMA_NEED_PCI_MAP_STATE=y 74CONFIG_DMA_NEED_PCI_MAP_STATE=y
71CONFIG_LIMITED_DMA=y 75CONFIG_LIMITED_DMA=y
@@ -120,7 +124,10 @@ CONFIG_PAGE_SIZE_4KB=y
120CONFIG_BOARD_SCACHE=y 124CONFIG_BOARD_SCACHE=y
121CONFIG_RM7000_CPU_SCACHE=y 125CONFIG_RM7000_CPU_SCACHE=y
122CONFIG_CPU_HAS_PREFETCH=y 126CONFIG_CPU_HAS_PREFETCH=y
123# CONFIG_MIPS_MT is not set 127CONFIG_MIPS_MT_DISABLED=y
128# CONFIG_MIPS_MT_SMTC is not set
129# CONFIG_MIPS_MT_SMP is not set
130# CONFIG_MIPS_VPE_LOADER is not set
124# CONFIG_64BIT_PHYS_ADDR is not set 131# CONFIG_64BIT_PHYS_ADDR is not set
125CONFIG_CPU_HAS_LLSC=y 132CONFIG_CPU_HAS_LLSC=y
126CONFIG_CPU_HAS_SYNC=y 133CONFIG_CPU_HAS_SYNC=y
@@ -134,6 +141,7 @@ CONFIG_FLATMEM=y
134CONFIG_FLAT_NODE_MEM_MAP=y 141CONFIG_FLAT_NODE_MEM_MAP=y
135# CONFIG_SPARSEMEM_STATIC is not set 142# CONFIG_SPARSEMEM_STATIC is not set
136CONFIG_SPLIT_PTLOCK_CPUS=4 143CONFIG_SPLIT_PTLOCK_CPUS=4
144# CONFIG_RESOURCES_64BIT is not set
137# CONFIG_HZ_48 is not set 145# CONFIG_HZ_48 is not set
138# CONFIG_HZ_100 is not set 146# CONFIG_HZ_100 is not set
139# CONFIG_HZ_128 is not set 147# CONFIG_HZ_128 is not set
@@ -143,10 +151,10 @@ CONFIG_HZ_1000=y
143# CONFIG_HZ_1024 is not set 151# CONFIG_HZ_1024 is not set
144CONFIG_SYS_SUPPORTS_ARBIT_HZ=y 152CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
145CONFIG_HZ=1000 153CONFIG_HZ=1000
146# CONFIG_SMP is not set
147CONFIG_PREEMPT_NONE=y 154CONFIG_PREEMPT_NONE=y
148# CONFIG_PREEMPT_VOLUNTARY is not set 155# CONFIG_PREEMPT_VOLUNTARY is not set
149# CONFIG_PREEMPT is not set 156# CONFIG_PREEMPT is not set
157CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
150 158
151# 159#
152# Code maturity level options 160# Code maturity level options
@@ -177,10 +185,12 @@ CONFIG_PRINTK=y
177CONFIG_BUG=y 185CONFIG_BUG=y
178CONFIG_ELF_CORE=y 186CONFIG_ELF_CORE=y
179CONFIG_BASE_FULL=y 187CONFIG_BASE_FULL=y
188CONFIG_RT_MUTEXES=y
180CONFIG_FUTEX=y 189CONFIG_FUTEX=y
181CONFIG_EPOLL=y 190CONFIG_EPOLL=y
182CONFIG_SHMEM=y 191CONFIG_SHMEM=y
183CONFIG_SLAB=y 192CONFIG_SLAB=y
193CONFIG_VM_EVENT_COUNTERS=y
184# CONFIG_TINY_SHMEM is not set 194# CONFIG_TINY_SHMEM is not set
185CONFIG_BASE_SMALL=0 195CONFIG_BASE_SMALL=0
186# CONFIG_SLOB is not set 196# CONFIG_SLOB is not set
@@ -267,6 +277,8 @@ CONFIG_IP_PNP_BOOTP=y
267# CONFIG_INET_IPCOMP is not set 277# CONFIG_INET_IPCOMP is not set
268# CONFIG_INET_XFRM_TUNNEL is not set 278# CONFIG_INET_XFRM_TUNNEL is not set
269# CONFIG_INET_TUNNEL is not set 279# CONFIG_INET_TUNNEL is not set
280CONFIG_INET_XFRM_MODE_TRANSPORT=m
281CONFIG_INET_XFRM_MODE_TUNNEL=m
270CONFIG_INET_DIAG=y 282CONFIG_INET_DIAG=y
271CONFIG_INET_TCP_DIAG=y 283CONFIG_INET_TCP_DIAG=y
272# CONFIG_TCP_CONG_ADVANCED is not set 284# CONFIG_TCP_CONG_ADVANCED is not set
@@ -279,7 +291,10 @@ CONFIG_INET6_ESP=m
279CONFIG_INET6_IPCOMP=m 291CONFIG_INET6_IPCOMP=m
280CONFIG_INET6_XFRM_TUNNEL=m 292CONFIG_INET6_XFRM_TUNNEL=m
281CONFIG_INET6_TUNNEL=m 293CONFIG_INET6_TUNNEL=m
294CONFIG_INET6_XFRM_MODE_TRANSPORT=m
295CONFIG_INET6_XFRM_MODE_TUNNEL=m
282CONFIG_IPV6_TUNNEL=m 296CONFIG_IPV6_TUNNEL=m
297CONFIG_NETWORK_SECMARK=y
283# CONFIG_NETFILTER is not set 298# CONFIG_NETFILTER is not set
284# CONFIG_BRIDGE is not set 299# CONFIG_BRIDGE is not set
285# CONFIG_VLAN_8021Q is not set 300# CONFIG_VLAN_8021Q is not set
@@ -315,6 +330,7 @@ CONFIG_IEEE80211_CRYPT_CCMP=m
315CONFIG_STANDALONE=y 330CONFIG_STANDALONE=y
316CONFIG_PREVENT_FIRMWARE_BUILD=y 331CONFIG_PREVENT_FIRMWARE_BUILD=y
317CONFIG_FW_LOADER=m 332CONFIG_FW_LOADER=m
333# CONFIG_SYS_HYPERVISOR is not set
318 334
319# 335#
320# Connector - unified userspace <-> kernelspace linker 336# Connector - unified userspace <-> kernelspace linker
@@ -409,6 +425,8 @@ CONFIG_DAVICOM_PHY=m
409CONFIG_QSEMI_PHY=m 425CONFIG_QSEMI_PHY=m
410CONFIG_LXT_PHY=m 426CONFIG_LXT_PHY=m
411CONFIG_CICADA_PHY=m 427CONFIG_CICADA_PHY=m
428CONFIG_VITESSE_PHY=m
429CONFIG_SMSC_PHY=m
412 430
413# 431#
414# Ethernet (10 or 100Mbit) 432# Ethernet (10 or 100Mbit)
@@ -430,6 +448,7 @@ CONFIG_NET_PCI=y
430# CONFIG_PCNET32 is not set 448# CONFIG_PCNET32 is not set
431# CONFIG_AMD8111_ETH is not set 449# CONFIG_AMD8111_ETH is not set
432# CONFIG_ADAPTEC_STARFIRE is not set 450# CONFIG_ADAPTEC_STARFIRE is not set
451# CONFIG_B44 is not set
433# CONFIG_FORCEDETH is not set 452# CONFIG_FORCEDETH is not set
434# CONFIG_DGRS is not set 453# CONFIG_DGRS is not set
435CONFIG_EEPRO100=y 454CONFIG_EEPRO100=y
@@ -470,6 +489,7 @@ CONFIG_MV643XX_ETH_2=y
470# CONFIG_CHELSIO_T1 is not set 489# CONFIG_CHELSIO_T1 is not set
471# CONFIG_IXGB is not set 490# CONFIG_IXGB is not set
472# CONFIG_S2IO is not set 491# CONFIG_S2IO is not set
492# CONFIG_MYRI10GE is not set
473 493
474# 494#
475# Token Ring devices 495# Token Ring devices
@@ -547,6 +567,7 @@ CONFIG_LEGACY_PTY_COUNT=256
547# Watchdog Cards 567# Watchdog Cards
548# 568#
549# CONFIG_WATCHDOG is not set 569# CONFIG_WATCHDOG is not set
570# CONFIG_HW_RANDOM is not set
550# CONFIG_RTC is not set 571# CONFIG_RTC is not set
551# CONFIG_GEN_RTC is not set 572# CONFIG_GEN_RTC is not set
552# CONFIG_DTLK is not set 573# CONFIG_DTLK is not set
@@ -593,6 +614,7 @@ CONFIG_LEGACY_PTY_COUNT=256
593# Multimedia devices 614# Multimedia devices
594# 615#
595# CONFIG_VIDEO_DEV is not set 616# CONFIG_VIDEO_DEV is not set
617CONFIG_VIDEO_V4L2=y
596 618
597# 619#
598# Digital Video Broadcasting Devices 620# Digital Video Broadcasting Devices
@@ -602,6 +624,7 @@ CONFIG_LEGACY_PTY_COUNT=256
602# 624#
603# Graphics support 625# Graphics support
604# 626#
627# CONFIG_FIRMWARE_EDID is not set
605# CONFIG_FB is not set 628# CONFIG_FB is not set
606 629
607# 630#
@@ -658,6 +681,19 @@ CONFIG_USB_ARCH_HAS_EHCI=y
658# 681#
659 682
660# 683#
684# DMA Engine support
685#
686# CONFIG_DMA_ENGINE is not set
687
688#
689# DMA Clients
690#
691
692#
693# DMA Devices
694#
695
696#
661# File systems 697# File systems
662# 698#
663# CONFIG_EXT2_FS is not set 699# CONFIG_EXT2_FS is not set
@@ -669,6 +705,7 @@ CONFIG_USB_ARCH_HAS_EHCI=y
669# CONFIG_MINIX_FS is not set 705# CONFIG_MINIX_FS is not set
670# CONFIG_ROMFS_FS is not set 706# CONFIG_ROMFS_FS is not set
671CONFIG_INOTIFY=y 707CONFIG_INOTIFY=y
708CONFIG_INOTIFY_USER=y
672# CONFIG_QUOTA is not set 709# CONFIG_QUOTA is not set
673CONFIG_DNOTIFY=y 710CONFIG_DNOTIFY=y
674# CONFIG_AUTOFS_FS is not set 711# CONFIG_AUTOFS_FS is not set
@@ -721,6 +758,7 @@ CONFIG_NFS_COMMON=y
721CONFIG_SUNRPC=y 758CONFIG_SUNRPC=y
722# CONFIG_SMB_FS is not set 759# CONFIG_SMB_FS is not set
723# CONFIG_CIFS is not set 760# CONFIG_CIFS is not set
761# CONFIG_CIFS_DEBUG2 is not set
724# CONFIG_NCP_FS is not set 762# CONFIG_NCP_FS is not set
725# CONFIG_CODA_FS is not set 763# CONFIG_CODA_FS is not set
726 764
@@ -740,6 +778,7 @@ CONFIG_MSDOS_PARTITION=y
740# 778#
741# CONFIG_PRINTK_TIME is not set 779# CONFIG_PRINTK_TIME is not set
742# CONFIG_MAGIC_SYSRQ is not set 780# CONFIG_MAGIC_SYSRQ is not set
781# CONFIG_UNUSED_SYMBOLS is not set
743# CONFIG_DEBUG_KERNEL is not set 782# CONFIG_DEBUG_KERNEL is not set
744CONFIG_LOG_BUF_SHIFT=14 783CONFIG_LOG_BUF_SHIFT=14
745# CONFIG_DEBUG_FS is not set 784# CONFIG_DEBUG_FS is not set
@@ -795,3 +834,4 @@ CONFIG_CRC32=m
795CONFIG_LIBCRC32C=m 834CONFIG_LIBCRC32C=m
796CONFIG_ZLIB_INFLATE=m 835CONFIG_ZLIB_INFLATE=m
797CONFIG_ZLIB_DEFLATE=m 836CONFIG_ZLIB_DEFLATE=m
837CONFIG_PLIST=y
diff --git a/arch/mips/configs/jmr3927_defconfig b/arch/mips/configs/jmr3927_defconfig
index 5ef5a08289a5..be45a9044d06 100644
--- a/arch/mips/configs/jmr3927_defconfig
+++ b/arch/mips/configs/jmr3927_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:51:07 2006 4# Thu Jul 6 10:04:12 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MIPS=y
45# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -65,6 +68,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
65CONFIG_GENERIC_FIND_NEXT_BIT=y 68CONFIG_GENERIC_FIND_NEXT_BIT=y
66CONFIG_GENERIC_HWEIGHT=y 69CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 70CONFIG_GENERIC_CALIBRATE_DELAY=y
71CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
68CONFIG_DMA_NONCOHERENT=y 72CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 73CONFIG_DMA_NEED_PCI_MAP_STATE=y
70CONFIG_CPU_BIG_ENDIAN=y 74CONFIG_CPU_BIG_ENDIAN=y
@@ -110,7 +114,10 @@ CONFIG_PAGE_SIZE_4KB=y
110# CONFIG_PAGE_SIZE_8KB is not set 114# CONFIG_PAGE_SIZE_8KB is not set
111# CONFIG_PAGE_SIZE_16KB is not set 115# CONFIG_PAGE_SIZE_16KB is not set
112# CONFIG_PAGE_SIZE_64KB is not set 116# CONFIG_PAGE_SIZE_64KB is not set
113# CONFIG_MIPS_MT is not set 117CONFIG_MIPS_MT_DISABLED=y
118# CONFIG_MIPS_MT_SMTC is not set
119# CONFIG_MIPS_MT_SMP is not set
120# CONFIG_MIPS_VPE_LOADER is not set
114CONFIG_CPU_HAS_SYNC=y 121CONFIG_CPU_HAS_SYNC=y
115CONFIG_GENERIC_HARDIRQS=y 122CONFIG_GENERIC_HARDIRQS=y
116CONFIG_GENERIC_IRQ_PROBE=y 123CONFIG_GENERIC_IRQ_PROBE=y
@@ -123,6 +130,7 @@ CONFIG_FLATMEM=y
123CONFIG_FLAT_NODE_MEM_MAP=y 130CONFIG_FLAT_NODE_MEM_MAP=y
124# CONFIG_SPARSEMEM_STATIC is not set 131# CONFIG_SPARSEMEM_STATIC is not set
125CONFIG_SPLIT_PTLOCK_CPUS=4 132CONFIG_SPLIT_PTLOCK_CPUS=4
133# CONFIG_RESOURCES_64BIT is not set
126# CONFIG_HZ_48 is not set 134# CONFIG_HZ_48 is not set
127# CONFIG_HZ_100 is not set 135# CONFIG_HZ_100 is not set
128# CONFIG_HZ_128 is not set 136# CONFIG_HZ_128 is not set
@@ -136,6 +144,7 @@ CONFIG_PREEMPT_NONE=y
136# CONFIG_PREEMPT_VOLUNTARY is not set 144# CONFIG_PREEMPT_VOLUNTARY is not set
137# CONFIG_PREEMPT is not set 145# CONFIG_PREEMPT is not set
138CONFIG_RTC_DS1742=y 146CONFIG_RTC_DS1742=y
147CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
139 148
140# 149#
141# Code maturity level options 150# Code maturity level options
@@ -167,10 +176,12 @@ CONFIG_PRINTK=y
167CONFIG_BUG=y 176CONFIG_BUG=y
168CONFIG_ELF_CORE=y 177CONFIG_ELF_CORE=y
169CONFIG_BASE_FULL=y 178CONFIG_BASE_FULL=y
179CONFIG_RT_MUTEXES=y
170CONFIG_FUTEX=y 180CONFIG_FUTEX=y
171CONFIG_EPOLL=y 181CONFIG_EPOLL=y
172CONFIG_SHMEM=y 182CONFIG_SHMEM=y
173CONFIG_SLAB=y 183CONFIG_SLAB=y
184CONFIG_VM_EVENT_COUNTERS=y
174# CONFIG_TINY_SHMEM is not set 185# CONFIG_TINY_SHMEM is not set
175CONFIG_BASE_SMALL=0 186CONFIG_BASE_SMALL=0
176# CONFIG_SLOB is not set 187# CONFIG_SLOB is not set
@@ -256,6 +267,8 @@ CONFIG_IP_PNP_BOOTP=y
256# CONFIG_INET_IPCOMP is not set 267# CONFIG_INET_IPCOMP is not set
257# CONFIG_INET_XFRM_TUNNEL is not set 268# CONFIG_INET_XFRM_TUNNEL is not set
258# CONFIG_INET_TUNNEL is not set 269# CONFIG_INET_TUNNEL is not set
270CONFIG_INET_XFRM_MODE_TRANSPORT=y
271CONFIG_INET_XFRM_MODE_TUNNEL=y
259CONFIG_INET_DIAG=y 272CONFIG_INET_DIAG=y
260CONFIG_INET_TCP_DIAG=y 273CONFIG_INET_TCP_DIAG=y
261# CONFIG_TCP_CONG_ADVANCED is not set 274# CONFIG_TCP_CONG_ADVANCED is not set
@@ -263,6 +276,7 @@ CONFIG_TCP_CONG_BIC=y
263# CONFIG_IPV6 is not set 276# CONFIG_IPV6 is not set
264# CONFIG_INET6_XFRM_TUNNEL is not set 277# CONFIG_INET6_XFRM_TUNNEL is not set
265# CONFIG_INET6_TUNNEL is not set 278# CONFIG_INET6_TUNNEL is not set
279CONFIG_NETWORK_SECMARK=y
266# CONFIG_NETFILTER is not set 280# CONFIG_NETFILTER is not set
267 281
268# 282#
@@ -322,6 +336,7 @@ CONFIG_WIRELESS_EXT=y
322CONFIG_STANDALONE=y 336CONFIG_STANDALONE=y
323CONFIG_PREVENT_FIRMWARE_BUILD=y 337CONFIG_PREVENT_FIRMWARE_BUILD=y
324CONFIG_FW_LOADER=y 338CONFIG_FW_LOADER=y
339# CONFIG_SYS_HYPERVISOR is not set
325 340
326# 341#
327# Connector - unified userspace <-> kernelspace linker 342# Connector - unified userspace <-> kernelspace linker
@@ -419,6 +434,8 @@ CONFIG_DAVICOM_PHY=y
419CONFIG_QSEMI_PHY=y 434CONFIG_QSEMI_PHY=y
420CONFIG_LXT_PHY=y 435CONFIG_LXT_PHY=y
421CONFIG_CICADA_PHY=y 436CONFIG_CICADA_PHY=y
437CONFIG_VITESSE_PHY=y
438CONFIG_SMSC_PHY=y
422 439
423# 440#
424# Ethernet (10 or 100Mbit) 441# Ethernet (10 or 100Mbit)
@@ -461,6 +478,7 @@ CONFIG_NET_ETHERNET=y
461# CONFIG_CHELSIO_T1 is not set 478# CONFIG_CHELSIO_T1 is not set
462# CONFIG_IXGB is not set 479# CONFIG_IXGB is not set
463# CONFIG_S2IO is not set 480# CONFIG_S2IO is not set
481# CONFIG_MYRI10GE is not set
464 482
465# 483#
466# Token Ring devices 484# Token Ring devices
@@ -538,6 +556,7 @@ CONFIG_SERIO_RAW=y
538CONFIG_VT=y 556CONFIG_VT=y
539CONFIG_VT_CONSOLE=y 557CONFIG_VT_CONSOLE=y
540CONFIG_HW_CONSOLE=y 558CONFIG_HW_CONSOLE=y
559CONFIG_VT_HW_CONSOLE_BINDING=y
541CONFIG_SERIAL_NONSTANDARD=y 560CONFIG_SERIAL_NONSTANDARD=y
542# CONFIG_COMPUTONE is not set 561# CONFIG_COMPUTONE is not set
543# CONFIG_ROCKETPORT is not set 562# CONFIG_ROCKETPORT is not set
@@ -582,6 +601,7 @@ CONFIG_LEGACY_PTY_COUNT=256
582# Watchdog Cards 601# Watchdog Cards
583# 602#
584# CONFIG_WATCHDOG is not set 603# CONFIG_WATCHDOG is not set
604# CONFIG_HW_RANDOM is not set
585# CONFIG_RTC is not set 605# CONFIG_RTC is not set
586# CONFIG_GEN_RTC is not set 606# CONFIG_GEN_RTC is not set
587# CONFIG_DTLK is not set 607# CONFIG_DTLK is not set
@@ -630,6 +650,7 @@ CONFIG_LEGACY_PTY_COUNT=256
630# Multimedia devices 650# Multimedia devices
631# 651#
632# CONFIG_VIDEO_DEV is not set 652# CONFIG_VIDEO_DEV is not set
653CONFIG_VIDEO_V4L2=y
633 654
634# 655#
635# Digital Video Broadcasting Devices 656# Digital Video Broadcasting Devices
@@ -639,12 +660,13 @@ CONFIG_LEGACY_PTY_COUNT=256
639# 660#
640# Graphics support 661# Graphics support
641# 662#
663# CONFIG_FIRMWARE_EDID is not set
642CONFIG_FB=y 664CONFIG_FB=y
643# CONFIG_FB_CFB_FILLRECT is not set 665# CONFIG_FB_CFB_FILLRECT is not set
644# CONFIG_FB_CFB_COPYAREA is not set 666# CONFIG_FB_CFB_COPYAREA is not set
645# CONFIG_FB_CFB_IMAGEBLIT is not set 667# CONFIG_FB_CFB_IMAGEBLIT is not set
646# CONFIG_FB_MACMODES is not set 668# CONFIG_FB_MACMODES is not set
647CONFIG_FB_FIRMWARE_EDID=y 669# CONFIG_FB_BACKLIGHT is not set
648# CONFIG_FB_MODE_HELPERS is not set 670# CONFIG_FB_MODE_HELPERS is not set
649# CONFIG_FB_TILEBLITTING is not set 671# CONFIG_FB_TILEBLITTING is not set
650# CONFIG_FB_CIRRUS is not set 672# CONFIG_FB_CIRRUS is not set
@@ -737,6 +759,19 @@ CONFIG_USB_ARCH_HAS_EHCI=y
737# CONFIG_RTC_CLASS is not set 759# CONFIG_RTC_CLASS is not set
738 760
739# 761#
762# DMA Engine support
763#
764# CONFIG_DMA_ENGINE is not set
765
766#
767# DMA Clients
768#
769
770#
771# DMA Devices
772#
773
774#
740# File systems 775# File systems
741# 776#
742# CONFIG_EXT2_FS is not set 777# CONFIG_EXT2_FS is not set
@@ -749,6 +784,7 @@ CONFIG_USB_ARCH_HAS_EHCI=y
749# CONFIG_MINIX_FS is not set 784# CONFIG_MINIX_FS is not set
750# CONFIG_ROMFS_FS is not set 785# CONFIG_ROMFS_FS is not set
751CONFIG_INOTIFY=y 786CONFIG_INOTIFY=y
787CONFIG_INOTIFY_USER=y
752# CONFIG_QUOTA is not set 788# CONFIG_QUOTA is not set
753CONFIG_DNOTIFY=y 789CONFIG_DNOTIFY=y
754# CONFIG_AUTOFS_FS is not set 790# CONFIG_AUTOFS_FS is not set
@@ -812,6 +848,7 @@ CONFIG_SUNRPC=y
812# CONFIG_RPCSEC_GSS_SPKM3 is not set 848# CONFIG_RPCSEC_GSS_SPKM3 is not set
813# CONFIG_SMB_FS is not set 849# CONFIG_SMB_FS is not set
814# CONFIG_CIFS is not set 850# CONFIG_CIFS is not set
851# CONFIG_CIFS_DEBUG2 is not set
815# CONFIG_NCP_FS is not set 852# CONFIG_NCP_FS is not set
816# CONFIG_CODA_FS is not set 853# CONFIG_CODA_FS is not set
817# CONFIG_AFS_FS is not set 854# CONFIG_AFS_FS is not set
@@ -838,6 +875,7 @@ CONFIG_MSDOS_PARTITION=y
838# 875#
839# CONFIG_PRINTK_TIME is not set 876# CONFIG_PRINTK_TIME is not set
840# CONFIG_MAGIC_SYSRQ is not set 877# CONFIG_MAGIC_SYSRQ is not set
878# CONFIG_UNUSED_SYMBOLS is not set
841# CONFIG_DEBUG_KERNEL is not set 879# CONFIG_DEBUG_KERNEL is not set
842CONFIG_LOG_BUF_SHIFT=14 880CONFIG_LOG_BUF_SHIFT=14
843# CONFIG_DEBUG_FS is not set 881# CONFIG_DEBUG_FS is not set
@@ -879,7 +917,6 @@ CONFIG_CRYPTO_ANUBIS=y
879CONFIG_CRYPTO_DEFLATE=y 917CONFIG_CRYPTO_DEFLATE=y
880CONFIG_CRYPTO_MICHAEL_MIC=y 918CONFIG_CRYPTO_MICHAEL_MIC=y
881CONFIG_CRYPTO_CRC32C=y 919CONFIG_CRYPTO_CRC32C=y
882# CONFIG_CRYPTO_TEST is not set
883 920
884# 921#
885# Hardware crypto devices 922# Hardware crypto devices
@@ -894,3 +931,4 @@ CONFIG_CRC32=y
894CONFIG_LIBCRC32C=y 931CONFIG_LIBCRC32C=y
895CONFIG_ZLIB_INFLATE=y 932CONFIG_ZLIB_INFLATE=y
896CONFIG_ZLIB_DEFLATE=y 933CONFIG_ZLIB_DEFLATE=y
934CONFIG_PLIST=y
diff --git a/arch/mips/configs/lasat200_defconfig b/arch/mips/configs/lasat200_defconfig
index eabcff26fc0e..64dc9f45a19c 100644
--- a/arch/mips/configs/lasat200_defconfig
+++ b/arch/mips/configs/lasat200_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:51:07 2006 4# Thu Jul 6 10:04:12 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_LASAT=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_LASAT=y
45# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -69,6 +72,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
69CONFIG_GENERIC_FIND_NEXT_BIT=y 72CONFIG_GENERIC_FIND_NEXT_BIT=y
70CONFIG_GENERIC_HWEIGHT=y 73CONFIG_GENERIC_HWEIGHT=y
71CONFIG_GENERIC_CALIBRATE_DELAY=y 74CONFIG_GENERIC_CALIBRATE_DELAY=y
75CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
72CONFIG_DMA_NONCOHERENT=y 76CONFIG_DMA_NONCOHERENT=y
73CONFIG_DMA_NEED_PCI_MAP_STATE=y 77CONFIG_DMA_NEED_PCI_MAP_STATE=y
74CONFIG_MIPS_NILE4=y 78CONFIG_MIPS_NILE4=y
@@ -117,7 +121,10 @@ CONFIG_PAGE_SIZE_4KB=y
117# CONFIG_PAGE_SIZE_64KB is not set 121# CONFIG_PAGE_SIZE_64KB is not set
118CONFIG_BOARD_SCACHE=y 122CONFIG_BOARD_SCACHE=y
119CONFIG_R5000_CPU_SCACHE=y 123CONFIG_R5000_CPU_SCACHE=y
120# CONFIG_MIPS_MT is not set 124CONFIG_MIPS_MT_DISABLED=y
125# CONFIG_MIPS_MT_SMTC is not set
126# CONFIG_MIPS_MT_SMP is not set
127# CONFIG_MIPS_VPE_LOADER is not set
121# CONFIG_64BIT_PHYS_ADDR is not set 128# CONFIG_64BIT_PHYS_ADDR is not set
122CONFIG_CPU_HAS_LLSC=y 129CONFIG_CPU_HAS_LLSC=y
123CONFIG_CPU_HAS_SYNC=y 130CONFIG_CPU_HAS_SYNC=y
@@ -132,6 +139,7 @@ CONFIG_FLATMEM=y
132CONFIG_FLAT_NODE_MEM_MAP=y 139CONFIG_FLAT_NODE_MEM_MAP=y
133# CONFIG_SPARSEMEM_STATIC is not set 140# CONFIG_SPARSEMEM_STATIC is not set
134CONFIG_SPLIT_PTLOCK_CPUS=4 141CONFIG_SPLIT_PTLOCK_CPUS=4
142# CONFIG_RESOURCES_64BIT is not set
135# CONFIG_HZ_48 is not set 143# CONFIG_HZ_48 is not set
136# CONFIG_HZ_100 is not set 144# CONFIG_HZ_100 is not set
137# CONFIG_HZ_128 is not set 145# CONFIG_HZ_128 is not set
@@ -144,6 +152,7 @@ CONFIG_HZ=1000
144CONFIG_PREEMPT_NONE=y 152CONFIG_PREEMPT_NONE=y
145# CONFIG_PREEMPT_VOLUNTARY is not set 153# CONFIG_PREEMPT_VOLUNTARY is not set
146# CONFIG_PREEMPT is not set 154# CONFIG_PREEMPT is not set
155CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
147 156
148# 157#
149# Code maturity level options 158# Code maturity level options
@@ -175,14 +184,15 @@ CONFIG_PRINTK=y
175CONFIG_BUG=y 184CONFIG_BUG=y
176CONFIG_ELF_CORE=y 185CONFIG_ELF_CORE=y
177CONFIG_BASE_FULL=y 186CONFIG_BASE_FULL=y
187CONFIG_RT_MUTEXES=y
178CONFIG_FUTEX=y 188CONFIG_FUTEX=y
179CONFIG_EPOLL=y 189CONFIG_EPOLL=y
180CONFIG_SHMEM=y 190CONFIG_SHMEM=y
181CONFIG_SLAB=y 191CONFIG_SLAB=y
192CONFIG_VM_EVENT_COUNTERS=y
182# CONFIG_TINY_SHMEM is not set 193# CONFIG_TINY_SHMEM is not set
183CONFIG_BASE_SMALL=0 194CONFIG_BASE_SMALL=0
184# CONFIG_SLOB is not set 195# CONFIG_SLOB is not set
185CONFIG_OBSOLETE_INTERMODULE=y
186 196
187# 197#
188# Loadable module support 198# Loadable module support
@@ -266,6 +276,8 @@ CONFIG_IP_FIB_HASH=y
266# CONFIG_INET_IPCOMP is not set 276# CONFIG_INET_IPCOMP is not set
267# CONFIG_INET_XFRM_TUNNEL is not set 277# CONFIG_INET_XFRM_TUNNEL is not set
268# CONFIG_INET_TUNNEL is not set 278# CONFIG_INET_TUNNEL is not set
279CONFIG_INET_XFRM_MODE_TRANSPORT=m
280CONFIG_INET_XFRM_MODE_TUNNEL=m
269CONFIG_INET_DIAG=y 281CONFIG_INET_DIAG=y
270CONFIG_INET_TCP_DIAG=y 282CONFIG_INET_TCP_DIAG=y
271# CONFIG_TCP_CONG_ADVANCED is not set 283# CONFIG_TCP_CONG_ADVANCED is not set
@@ -273,6 +285,7 @@ CONFIG_TCP_CONG_BIC=y
273# CONFIG_IPV6 is not set 285# CONFIG_IPV6 is not set
274# CONFIG_INET6_XFRM_TUNNEL is not set 286# CONFIG_INET6_XFRM_TUNNEL is not set
275# CONFIG_INET6_TUNNEL is not set 287# CONFIG_INET6_TUNNEL is not set
288CONFIG_NETWORK_SECMARK=y
276# CONFIG_NETFILTER is not set 289# CONFIG_NETFILTER is not set
277 290
278# 291#
@@ -332,6 +345,7 @@ CONFIG_WIRELESS_EXT=y
332CONFIG_STANDALONE=y 345CONFIG_STANDALONE=y
333CONFIG_PREVENT_FIRMWARE_BUILD=y 346CONFIG_PREVENT_FIRMWARE_BUILD=y
334CONFIG_FW_LOADER=m 347CONFIG_FW_LOADER=m
348# CONFIG_SYS_HYPERVISOR is not set
335 349
336# 350#
337# Connector - unified userspace <-> kernelspace linker 351# Connector - unified userspace <-> kernelspace linker
@@ -555,6 +569,8 @@ CONFIG_DAVICOM_PHY=m
555CONFIG_QSEMI_PHY=m 569CONFIG_QSEMI_PHY=m
556CONFIG_LXT_PHY=m 570CONFIG_LXT_PHY=m
557CONFIG_CICADA_PHY=m 571CONFIG_CICADA_PHY=m
572CONFIG_VITESSE_PHY=m
573CONFIG_SMSC_PHY=m
558 574
559# 575#
560# Ethernet (10 or 100Mbit) 576# Ethernet (10 or 100Mbit)
@@ -597,6 +613,7 @@ CONFIG_NET_ETHERNET=y
597# CONFIG_CHELSIO_T1 is not set 613# CONFIG_CHELSIO_T1 is not set
598# CONFIG_IXGB is not set 614# CONFIG_IXGB is not set
599# CONFIG_S2IO is not set 615# CONFIG_S2IO is not set
616# CONFIG_MYRI10GE is not set
600 617
601# 618#
602# Token Ring devices 619# Token Ring devices
@@ -674,6 +691,7 @@ CONFIG_SERIO_RAW=m
674CONFIG_VT=y 691CONFIG_VT=y
675CONFIG_VT_CONSOLE=y 692CONFIG_VT_CONSOLE=y
676CONFIG_HW_CONSOLE=y 693CONFIG_HW_CONSOLE=y
694CONFIG_VT_HW_CONSOLE_BINDING=y
677# CONFIG_SERIAL_NONSTANDARD is not set 695# CONFIG_SERIAL_NONSTANDARD is not set
678 696
679# 697#
@@ -705,6 +723,7 @@ CONFIG_LEGACY_PTY_COUNT=256
705# Watchdog Cards 723# Watchdog Cards
706# 724#
707# CONFIG_WATCHDOG is not set 725# CONFIG_WATCHDOG is not set
726# CONFIG_HW_RANDOM is not set
708# CONFIG_RTC is not set 727# CONFIG_RTC is not set
709# CONFIG_GEN_RTC is not set 728# CONFIG_GEN_RTC is not set
710# CONFIG_DTLK is not set 729# CONFIG_DTLK is not set
@@ -753,6 +772,7 @@ CONFIG_LEGACY_PTY_COUNT=256
753# Multimedia devices 772# Multimedia devices
754# 773#
755# CONFIG_VIDEO_DEV is not set 774# CONFIG_VIDEO_DEV is not set
775CONFIG_VIDEO_V4L2=y
756 776
757# 777#
758# Digital Video Broadcasting Devices 778# Digital Video Broadcasting Devices
@@ -762,6 +782,7 @@ CONFIG_LEGACY_PTY_COUNT=256
762# 782#
763# Graphics support 783# Graphics support
764# 784#
785# CONFIG_FIRMWARE_EDID is not set
765# CONFIG_FB is not set 786# CONFIG_FB is not set
766 787
767# 788#
@@ -825,6 +846,19 @@ CONFIG_USB_ARCH_HAS_EHCI=y
825# CONFIG_RTC_CLASS is not set 846# CONFIG_RTC_CLASS is not set
826 847
827# 848#
849# DMA Engine support
850#
851# CONFIG_DMA_ENGINE is not set
852
853#
854# DMA Clients
855#
856
857#
858# DMA Devices
859#
860
861#
828# File systems 862# File systems
829# 863#
830CONFIG_EXT2_FS=y 864CONFIG_EXT2_FS=y
@@ -845,6 +879,7 @@ CONFIG_FS_MBCACHE=y
845# CONFIG_MINIX_FS is not set 879# CONFIG_MINIX_FS is not set
846# CONFIG_ROMFS_FS is not set 880# CONFIG_ROMFS_FS is not set
847CONFIG_INOTIFY=y 881CONFIG_INOTIFY=y
882CONFIG_INOTIFY_USER=y
848# CONFIG_QUOTA is not set 883# CONFIG_QUOTA is not set
849CONFIG_DNOTIFY=y 884CONFIG_DNOTIFY=y
850# CONFIG_AUTOFS_FS is not set 885# CONFIG_AUTOFS_FS is not set
@@ -911,6 +946,7 @@ CONFIG_SUNRPC=y
911# CONFIG_RPCSEC_GSS_SPKM3 is not set 946# CONFIG_RPCSEC_GSS_SPKM3 is not set
912# CONFIG_SMB_FS is not set 947# CONFIG_SMB_FS is not set
913# CONFIG_CIFS is not set 948# CONFIG_CIFS is not set
949# CONFIG_CIFS_DEBUG2 is not set
914# CONFIG_NCP_FS is not set 950# CONFIG_NCP_FS is not set
915# CONFIG_CODA_FS is not set 951# CONFIG_CODA_FS is not set
916# CONFIG_AFS_FS is not set 952# CONFIG_AFS_FS is not set
@@ -937,6 +973,7 @@ CONFIG_MSDOS_PARTITION=y
937# 973#
938# CONFIG_PRINTK_TIME is not set 974# CONFIG_PRINTK_TIME is not set
939# CONFIG_MAGIC_SYSRQ is not set 975# CONFIG_MAGIC_SYSRQ is not set
976# CONFIG_UNUSED_SYMBOLS is not set
940# CONFIG_DEBUG_KERNEL is not set 977# CONFIG_DEBUG_KERNEL is not set
941CONFIG_LOG_BUF_SHIFT=14 978CONFIG_LOG_BUF_SHIFT=14
942# CONFIG_DEBUG_FS is not set 979# CONFIG_DEBUG_FS is not set
@@ -992,3 +1029,4 @@ CONFIG_CRC32=y
992CONFIG_LIBCRC32C=m 1029CONFIG_LIBCRC32C=m
993CONFIG_ZLIB_INFLATE=m 1030CONFIG_ZLIB_INFLATE=m
994CONFIG_ZLIB_DEFLATE=m 1031CONFIG_ZLIB_DEFLATE=m
1032CONFIG_PLIST=y
diff --git a/arch/mips/configs/malta_defconfig b/arch/mips/configs/malta_defconfig
index b73cff0d83ca..2690baf15a85 100644
--- a/arch/mips/configs/malta_defconfig
+++ b/arch/mips/configs/malta_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:51:08 2006 4# Thu Jul 6 10:04:13 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33CONFIG_MIPS_MALTA=y 34CONFIG_MIPS_MALTA=y
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MIPS_MALTA=y
45# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -65,6 +68,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
65CONFIG_GENERIC_FIND_NEXT_BIT=y 68CONFIG_GENERIC_FIND_NEXT_BIT=y
66CONFIG_GENERIC_HWEIGHT=y 69CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 70CONFIG_GENERIC_CALIBRATE_DELAY=y
71CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
68CONFIG_ARCH_MAY_HAVE_PC_FDC=y 72CONFIG_ARCH_MAY_HAVE_PC_FDC=y
69CONFIG_DMA_NONCOHERENT=y 73CONFIG_DMA_NONCOHERENT=y
70CONFIG_DMA_NEED_PCI_MAP_STATE=y 74CONFIG_DMA_NEED_PCI_MAP_STATE=y
@@ -126,19 +130,21 @@ CONFIG_PAGE_SIZE_4KB=y
126# CONFIG_PAGE_SIZE_8KB is not set 130# CONFIG_PAGE_SIZE_8KB is not set
127# CONFIG_PAGE_SIZE_16KB is not set 131# CONFIG_PAGE_SIZE_16KB is not set
128# CONFIG_PAGE_SIZE_64KB is not set 132# CONFIG_PAGE_SIZE_64KB is not set
133CONFIG_BOARD_SCACHE=y
134CONFIG_MIPS_CPU_SCACHE=y
129CONFIG_CPU_HAS_PREFETCH=y 135CONFIG_CPU_HAS_PREFETCH=y
130CONFIG_MIPS_MT=y 136# CONFIG_MIPS_MT_DISABLED is not set
131# CONFIG_MIPS_MT_SMTC is not set 137# CONFIG_MIPS_MT_SMTC is not set
132# CONFIG_MIPS_MT_SMP is not set 138# CONFIG_MIPS_MT_SMP is not set
133CONFIG_MIPS_VPE_LOADER=y 139CONFIG_MIPS_VPE_LOADER=y
140CONFIG_MIPS_MT=y
141CONFIG_SYS_SUPPORTS_MULTITHREADING=y
134CONFIG_MIPS_MT_FPAFF=y 142CONFIG_MIPS_MT_FPAFF=y
135CONFIG_MIPS_VPE_LOADER_TOM=y 143CONFIG_MIPS_VPE_LOADER_TOM=y
136CONFIG_MIPS_VPE_APSP_API=y 144CONFIG_MIPS_VPE_APSP_API=y
137CONFIG_MIPS_APSP_KSPD=y 145CONFIG_MIPS_APSP_KSPD=y
138# CONFIG_64BIT_PHYS_ADDR is not set 146# CONFIG_64BIT_PHYS_ADDR is not set
139CONFIG_CPU_HAS_LLSC=y 147CONFIG_CPU_HAS_LLSC=y
140# CONFIG_CPU_MIPSR2_IRQ_VI is not set
141# CONFIG_CPU_MIPSR2_IRQ_EI is not set
142CONFIG_CPU_HAS_SYNC=y 148CONFIG_CPU_HAS_SYNC=y
143CONFIG_GENERIC_HARDIRQS=y 149CONFIG_GENERIC_HARDIRQS=y
144CONFIG_GENERIC_IRQ_PROBE=y 150CONFIG_GENERIC_IRQ_PROBE=y
@@ -152,6 +158,7 @@ CONFIG_FLATMEM=y
152CONFIG_FLAT_NODE_MEM_MAP=y 158CONFIG_FLAT_NODE_MEM_MAP=y
153# CONFIG_SPARSEMEM_STATIC is not set 159# CONFIG_SPARSEMEM_STATIC is not set
154CONFIG_SPLIT_PTLOCK_CPUS=4 160CONFIG_SPLIT_PTLOCK_CPUS=4
161# CONFIG_RESOURCES_64BIT is not set
155# CONFIG_HZ_48 is not set 162# CONFIG_HZ_48 is not set
156CONFIG_HZ_100=y 163CONFIG_HZ_100=y
157# CONFIG_HZ_128 is not set 164# CONFIG_HZ_128 is not set
@@ -164,6 +171,7 @@ CONFIG_HZ=100
164CONFIG_PREEMPT_NONE=y 171CONFIG_PREEMPT_NONE=y
165# CONFIG_PREEMPT_VOLUNTARY is not set 172# CONFIG_PREEMPT_VOLUNTARY is not set
166# CONFIG_PREEMPT is not set 173# CONFIG_PREEMPT is not set
174CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
167 175
168# 176#
169# Code maturity level options 177# Code maturity level options
@@ -195,10 +203,12 @@ CONFIG_PRINTK=y
195CONFIG_BUG=y 203CONFIG_BUG=y
196CONFIG_ELF_CORE=y 204CONFIG_ELF_CORE=y
197CONFIG_BASE_FULL=y 205CONFIG_BASE_FULL=y
206CONFIG_RT_MUTEXES=y
198CONFIG_FUTEX=y 207CONFIG_FUTEX=y
199CONFIG_EPOLL=y 208CONFIG_EPOLL=y
200CONFIG_SHMEM=y 209CONFIG_SHMEM=y
201CONFIG_SLAB=y 210CONFIG_SLAB=y
211CONFIG_VM_EVENT_COUNTERS=y
202# CONFIG_TINY_SHMEM is not set 212# CONFIG_TINY_SHMEM is not set
203CONFIG_BASE_SMALL=0 213CONFIG_BASE_SMALL=0
204# CONFIG_SLOB is not set 214# CONFIG_SLOB is not set
@@ -300,6 +310,8 @@ CONFIG_INET_ESP=m
300CONFIG_INET_IPCOMP=m 310CONFIG_INET_IPCOMP=m
301CONFIG_INET_XFRM_TUNNEL=m 311CONFIG_INET_XFRM_TUNNEL=m
302CONFIG_INET_TUNNEL=m 312CONFIG_INET_TUNNEL=m
313CONFIG_INET_XFRM_MODE_TRANSPORT=m
314CONFIG_INET_XFRM_MODE_TUNNEL=m
303CONFIG_INET_DIAG=y 315CONFIG_INET_DIAG=y
304CONFIG_INET_TCP_DIAG=y 316CONFIG_INET_TCP_DIAG=y
305# CONFIG_TCP_CONG_ADVANCED is not set 317# CONFIG_TCP_CONG_ADVANCED is not set
@@ -347,7 +359,10 @@ CONFIG_INET6_ESP=m
347CONFIG_INET6_IPCOMP=m 359CONFIG_INET6_IPCOMP=m
348CONFIG_INET6_XFRM_TUNNEL=m 360CONFIG_INET6_XFRM_TUNNEL=m
349CONFIG_INET6_TUNNEL=m 361CONFIG_INET6_TUNNEL=m
362CONFIG_INET6_XFRM_MODE_TRANSPORT=m
363CONFIG_INET6_XFRM_MODE_TUNNEL=m
350CONFIG_IPV6_TUNNEL=m 364CONFIG_IPV6_TUNNEL=m
365CONFIG_NETWORK_SECMARK=y
351CONFIG_NETFILTER=y 366CONFIG_NETFILTER=y
352# CONFIG_NETFILTER_DEBUG is not set 367# CONFIG_NETFILTER_DEBUG is not set
353CONFIG_BRIDGE_NETFILTER=y 368CONFIG_BRIDGE_NETFILTER=y
@@ -364,6 +379,8 @@ CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
364CONFIG_NETFILTER_XT_TARGET_MARK=m 379CONFIG_NETFILTER_XT_TARGET_MARK=m
365CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m 380CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
366CONFIG_NETFILTER_XT_TARGET_NOTRACK=m 381CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
382CONFIG_NETFILTER_XT_TARGET_SECMARK=m
383# CONFIG_NETFILTER_XT_TARGET_CONNSECMARK is not set
367CONFIG_NETFILTER_XT_MATCH_COMMENT=m 384CONFIG_NETFILTER_XT_MATCH_COMMENT=m
368CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m 385CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
369CONFIG_NETFILTER_XT_MATCH_CONNMARK=m 386CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
@@ -379,9 +396,11 @@ CONFIG_NETFILTER_XT_MATCH_POLICY=m
379CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m 396CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
380# CONFIG_NETFILTER_XT_MATCH_PHYSDEV is not set 397# CONFIG_NETFILTER_XT_MATCH_PHYSDEV is not set
381CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 398CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
399CONFIG_NETFILTER_XT_MATCH_QUOTA=m
382CONFIG_NETFILTER_XT_MATCH_REALM=m 400CONFIG_NETFILTER_XT_MATCH_REALM=m
383CONFIG_NETFILTER_XT_MATCH_SCTP=m 401CONFIG_NETFILTER_XT_MATCH_SCTP=m
384CONFIG_NETFILTER_XT_MATCH_STATE=m 402CONFIG_NETFILTER_XT_MATCH_STATE=m
403CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
385CONFIG_NETFILTER_XT_MATCH_STRING=m 404CONFIG_NETFILTER_XT_MATCH_STRING=m
386CONFIG_NETFILTER_XT_MATCH_TCPMSS=m 405CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
387 406
@@ -391,6 +410,7 @@ CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
391CONFIG_IP_NF_CONNTRACK=m 410CONFIG_IP_NF_CONNTRACK=m
392CONFIG_IP_NF_CT_ACCT=y 411CONFIG_IP_NF_CT_ACCT=y
393CONFIG_IP_NF_CONNTRACK_MARK=y 412CONFIG_IP_NF_CONNTRACK_MARK=y
413CONFIG_IP_NF_CONNTRACK_SECMARK=y
394CONFIG_IP_NF_CONNTRACK_EVENTS=y 414CONFIG_IP_NF_CONNTRACK_EVENTS=y
395CONFIG_IP_NF_CONNTRACK_NETLINK=m 415CONFIG_IP_NF_CONNTRACK_NETLINK=m
396CONFIG_IP_NF_CT_PROTO_SCTP=m 416CONFIG_IP_NF_CT_PROTO_SCTP=m
@@ -401,6 +421,7 @@ CONFIG_IP_NF_TFTP=m
401CONFIG_IP_NF_AMANDA=m 421CONFIG_IP_NF_AMANDA=m
402CONFIG_IP_NF_PPTP=m 422CONFIG_IP_NF_PPTP=m
403CONFIG_IP_NF_H323=m 423CONFIG_IP_NF_H323=m
424CONFIG_IP_NF_SIP=m
404CONFIG_IP_NF_QUEUE=m 425CONFIG_IP_NF_QUEUE=m
405CONFIG_IP_NF_IPTABLES=m 426CONFIG_IP_NF_IPTABLES=m
406CONFIG_IP_NF_MATCH_IPRANGE=m 427CONFIG_IP_NF_MATCH_IPRANGE=m
@@ -431,6 +452,7 @@ CONFIG_IP_NF_NAT_TFTP=m
431CONFIG_IP_NF_NAT_AMANDA=m 452CONFIG_IP_NF_NAT_AMANDA=m
432CONFIG_IP_NF_NAT_PPTP=m 453CONFIG_IP_NF_NAT_PPTP=m
433CONFIG_IP_NF_NAT_H323=m 454CONFIG_IP_NF_NAT_H323=m
455CONFIG_IP_NF_NAT_SIP=m
434CONFIG_IP_NF_MANGLE=m 456CONFIG_IP_NF_MANGLE=m
435CONFIG_IP_NF_TARGET_TOS=m 457CONFIG_IP_NF_TARGET_TOS=m
436CONFIG_IP_NF_TARGET_ECN=m 458CONFIG_IP_NF_TARGET_ECN=m
@@ -592,6 +614,7 @@ CONFIG_WIRELESS_EXT=y
592CONFIG_STANDALONE=y 614CONFIG_STANDALONE=y
593CONFIG_PREVENT_FIRMWARE_BUILD=y 615CONFIG_PREVENT_FIRMWARE_BUILD=y
594CONFIG_FW_LOADER=y 616CONFIG_FW_LOADER=y
617# CONFIG_SYS_HYPERVISOR is not set
595 618
596# 619#
597# Connector - unified userspace <-> kernelspace linker 620# Connector - unified userspace <-> kernelspace linker
@@ -746,6 +769,7 @@ CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
746# CONFIG_MEGARAID_LEGACY is not set 769# CONFIG_MEGARAID_LEGACY is not set
747# CONFIG_MEGARAID_SAS is not set 770# CONFIG_MEGARAID_SAS is not set
748# CONFIG_SCSI_SATA is not set 771# CONFIG_SCSI_SATA is not set
772# CONFIG_SCSI_HPTIOP is not set
749# CONFIG_SCSI_DMX3191D is not set 773# CONFIG_SCSI_DMX3191D is not set
750# CONFIG_SCSI_FUTURE_DOMAIN is not set 774# CONFIG_SCSI_FUTURE_DOMAIN is not set
751# CONFIG_SCSI_IPS is not set 775# CONFIG_SCSI_IPS is not set
@@ -770,9 +794,8 @@ CONFIG_MD_LINEAR=m
770CONFIG_MD_RAID0=m 794CONFIG_MD_RAID0=m
771CONFIG_MD_RAID1=m 795CONFIG_MD_RAID1=m
772CONFIG_MD_RAID10=m 796CONFIG_MD_RAID10=m
773CONFIG_MD_RAID5=m 797CONFIG_MD_RAID456=m
774CONFIG_MD_RAID5_RESHAPE=y 798CONFIG_MD_RAID5_RESHAPE=y
775CONFIG_MD_RAID6=m
776CONFIG_MD_MULTIPATH=m 799CONFIG_MD_MULTIPATH=m
777CONFIG_MD_FAULTY=m 800CONFIG_MD_FAULTY=m
778CONFIG_BLK_DEV_DM=m 801CONFIG_BLK_DEV_DM=m
@@ -828,6 +851,8 @@ CONFIG_DAVICOM_PHY=m
828CONFIG_QSEMI_PHY=m 851CONFIG_QSEMI_PHY=m
829CONFIG_LXT_PHY=m 852CONFIG_LXT_PHY=m
830CONFIG_CICADA_PHY=m 853CONFIG_CICADA_PHY=m
854CONFIG_VITESSE_PHY=m
855CONFIG_SMSC_PHY=m
831 856
832# 857#
833# Ethernet (10 or 100Mbit) 858# Ethernet (10 or 100Mbit)
@@ -890,6 +915,7 @@ CONFIG_PCNET32=y
890# CONFIG_CHELSIO_T1 is not set 915# CONFIG_CHELSIO_T1 is not set
891# CONFIG_IXGB is not set 916# CONFIG_IXGB is not set
892# CONFIG_S2IO is not set 917# CONFIG_S2IO is not set
918# CONFIG_MYRI10GE is not set
893 919
894# 920#
895# Token Ring devices 921# Token Ring devices
@@ -968,6 +994,7 @@ CONFIG_SERIO_SERPORT=y
968CONFIG_VT=y 994CONFIG_VT=y
969CONFIG_VT_CONSOLE=y 995CONFIG_VT_CONSOLE=y
970CONFIG_HW_CONSOLE=y 996CONFIG_HW_CONSOLE=y
997CONFIG_VT_HW_CONSOLE_BINDING=y
971# CONFIG_SERIAL_NONSTANDARD is not set 998# CONFIG_SERIAL_NONSTANDARD is not set
972 999
973# 1000#
@@ -999,6 +1026,7 @@ CONFIG_LEGACY_PTY_COUNT=256
999# Watchdog Cards 1026# Watchdog Cards
1000# 1027#
1001# CONFIG_WATCHDOG is not set 1028# CONFIG_WATCHDOG is not set
1029# CONFIG_HW_RANDOM is not set
1002CONFIG_RTC=y 1030CONFIG_RTC=y
1003# CONFIG_DTLK is not set 1031# CONFIG_DTLK is not set
1004# CONFIG_R3964 is not set 1032# CONFIG_R3964 is not set
@@ -1046,6 +1074,7 @@ CONFIG_RTC=y
1046# Multimedia devices 1074# Multimedia devices
1047# 1075#
1048# CONFIG_VIDEO_DEV is not set 1076# CONFIG_VIDEO_DEV is not set
1077CONFIG_VIDEO_V4L2=y
1049 1078
1050# 1079#
1051# Digital Video Broadcasting Devices 1080# Digital Video Broadcasting Devices
@@ -1055,6 +1084,7 @@ CONFIG_RTC=y
1055# 1084#
1056# Graphics support 1085# Graphics support
1057# 1086#
1087# CONFIG_FIRMWARE_EDID is not set
1058# CONFIG_FB is not set 1088# CONFIG_FB is not set
1059 1089
1060# 1090#
@@ -1118,6 +1148,19 @@ CONFIG_USB_ARCH_HAS_EHCI=y
1118# CONFIG_RTC_CLASS is not set 1148# CONFIG_RTC_CLASS is not set
1119 1149
1120# 1150#
1151# DMA Engine support
1152#
1153# CONFIG_DMA_ENGINE is not set
1154
1155#
1156# DMA Clients
1157#
1158
1159#
1160# DMA Devices
1161#
1162
1163#
1121# File systems 1164# File systems
1122# 1165#
1123CONFIG_EXT2_FS=y 1166CONFIG_EXT2_FS=y
@@ -1143,7 +1186,6 @@ CONFIG_JFS_SECURITY=y
1143# CONFIG_JFS_STATISTICS is not set 1186# CONFIG_JFS_STATISTICS is not set
1144CONFIG_FS_POSIX_ACL=y 1187CONFIG_FS_POSIX_ACL=y
1145CONFIG_XFS_FS=m 1188CONFIG_XFS_FS=m
1146CONFIG_XFS_EXPORT=y
1147CONFIG_XFS_QUOTA=y 1189CONFIG_XFS_QUOTA=y
1148CONFIG_XFS_SECURITY=y 1190CONFIG_XFS_SECURITY=y
1149CONFIG_XFS_POSIX_ACL=y 1191CONFIG_XFS_POSIX_ACL=y
@@ -1152,6 +1194,7 @@ CONFIG_XFS_POSIX_ACL=y
1152CONFIG_MINIX_FS=m 1194CONFIG_MINIX_FS=m
1153CONFIG_ROMFS_FS=m 1195CONFIG_ROMFS_FS=m
1154CONFIG_INOTIFY=y 1196CONFIG_INOTIFY=y
1197CONFIG_INOTIFY_USER=y
1155CONFIG_QUOTA=y 1198CONFIG_QUOTA=y
1156# CONFIG_QFMT_V1 is not set 1199# CONFIG_QFMT_V1 is not set
1157CONFIG_QFMT_V2=y 1200CONFIG_QFMT_V2=y
@@ -1209,6 +1252,8 @@ CONFIG_VXFS_FS=m
1209# CONFIG_QNX4FS_FS is not set 1252# CONFIG_QNX4FS_FS is not set
1210CONFIG_SYSV_FS=m 1253CONFIG_SYSV_FS=m
1211CONFIG_UFS_FS=m 1254CONFIG_UFS_FS=m
1255# CONFIG_UFS_FS_WRITE is not set
1256# CONFIG_UFS_DEBUG is not set
1212 1257
1213# 1258#
1214# Network File Systems 1259# Network File Systems
@@ -1233,6 +1278,7 @@ CONFIG_SUNRPC=y
1233# CONFIG_RPCSEC_GSS_SPKM3 is not set 1278# CONFIG_RPCSEC_GSS_SPKM3 is not set
1234# CONFIG_SMB_FS is not set 1279# CONFIG_SMB_FS is not set
1235# CONFIG_CIFS is not set 1280# CONFIG_CIFS is not set
1281# CONFIG_CIFS_DEBUG2 is not set
1236# CONFIG_NCP_FS is not set 1282# CONFIG_NCP_FS is not set
1237# CONFIG_CODA_FS is not set 1283# CONFIG_CODA_FS is not set
1238# CONFIG_AFS_FS is not set 1284# CONFIG_AFS_FS is not set
@@ -1298,6 +1344,7 @@ CONFIG_NLS_UTF8=m
1298# 1344#
1299# CONFIG_PRINTK_TIME is not set 1345# CONFIG_PRINTK_TIME is not set
1300# CONFIG_MAGIC_SYSRQ is not set 1346# CONFIG_MAGIC_SYSRQ is not set
1347# CONFIG_UNUSED_SYMBOLS is not set
1301# CONFIG_DEBUG_KERNEL is not set 1348# CONFIG_DEBUG_KERNEL is not set
1302CONFIG_LOG_BUF_SHIFT=14 1349CONFIG_LOG_BUF_SHIFT=14
1303# CONFIG_DEBUG_FS is not set 1350# CONFIG_DEBUG_FS is not set
@@ -1356,3 +1403,4 @@ CONFIG_TEXTSEARCH=y
1356CONFIG_TEXTSEARCH_KMP=m 1403CONFIG_TEXTSEARCH_KMP=m
1357CONFIG_TEXTSEARCH_BM=m 1404CONFIG_TEXTSEARCH_BM=m
1358CONFIG_TEXTSEARCH_FSM=m 1405CONFIG_TEXTSEARCH_FSM=m
1406CONFIG_PLIST=y
diff --git a/arch/mips/configs/mipssim_defconfig b/arch/mips/configs/mipssim_defconfig
index 8dd27b55413d..c298979c18ae 100644
--- a/arch/mips/configs/mipssim_defconfig
+++ b/arch/mips/configs/mipssim_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:51:09 2006 4# Thu Jul 6 10:04:13 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35CONFIG_MIPS_SIM=y 37CONFIG_MIPS_SIM=y
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MIPS_SIM=y
45# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -65,6 +68,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
65CONFIG_GENERIC_FIND_NEXT_BIT=y 68CONFIG_GENERIC_FIND_NEXT_BIT=y
66CONFIG_GENERIC_HWEIGHT=y 69CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 70CONFIG_GENERIC_CALIBRATE_DELAY=y
71CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
68CONFIG_DMA_NONCOHERENT=y 72CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 73CONFIG_DMA_NEED_PCI_MAP_STATE=y
70# CONFIG_CPU_BIG_ENDIAN is not set 74# CONFIG_CPU_BIG_ENDIAN is not set
@@ -113,14 +117,10 @@ CONFIG_PAGE_SIZE_4KB=y
113# CONFIG_PAGE_SIZE_16KB is not set 117# CONFIG_PAGE_SIZE_16KB is not set
114# CONFIG_PAGE_SIZE_64KB is not set 118# CONFIG_PAGE_SIZE_64KB is not set
115CONFIG_CPU_HAS_PREFETCH=y 119CONFIG_CPU_HAS_PREFETCH=y
116CONFIG_MIPS_MT=y 120CONFIG_MIPS_MT_DISABLED=y
117# CONFIG_MIPS_MT_SMTC is not set 121# CONFIG_MIPS_MT_SMTC is not set
118# CONFIG_MIPS_MT_SMP is not set 122# CONFIG_MIPS_MT_SMP is not set
119CONFIG_MIPS_VPE_LOADER=y 123# CONFIG_MIPS_VPE_LOADER is not set
120CONFIG_MIPS_MT_FPAFF=y
121CONFIG_MIPS_VPE_LOADER_TOM=y
122CONFIG_MIPS_VPE_APSP_API=y
123CONFIG_MIPS_APSP_KSPD=y
124# CONFIG_64BIT_PHYS_ADDR is not set 124# CONFIG_64BIT_PHYS_ADDR is not set
125CONFIG_CPU_HAS_LLSC=y 125CONFIG_CPU_HAS_LLSC=y
126CONFIG_CPU_HAS_SYNC=y 126CONFIG_CPU_HAS_SYNC=y
@@ -136,6 +136,7 @@ CONFIG_FLATMEM=y
136CONFIG_FLAT_NODE_MEM_MAP=y 136CONFIG_FLAT_NODE_MEM_MAP=y
137# CONFIG_SPARSEMEM_STATIC is not set 137# CONFIG_SPARSEMEM_STATIC is not set
138CONFIG_SPLIT_PTLOCK_CPUS=4 138CONFIG_SPLIT_PTLOCK_CPUS=4
139# CONFIG_RESOURCES_64BIT is not set
139# CONFIG_HZ_48 is not set 140# CONFIG_HZ_48 is not set
140# CONFIG_HZ_100 is not set 141# CONFIG_HZ_100 is not set
141# CONFIG_HZ_128 is not set 142# CONFIG_HZ_128 is not set
@@ -148,6 +149,7 @@ CONFIG_HZ=1000
148CONFIG_PREEMPT_NONE=y 149CONFIG_PREEMPT_NONE=y
149# CONFIG_PREEMPT_VOLUNTARY is not set 150# CONFIG_PREEMPT_VOLUNTARY is not set
150# CONFIG_PREEMPT is not set 151# CONFIG_PREEMPT is not set
152CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
151 153
152# 154#
153# Code maturity level options 155# Code maturity level options
@@ -180,10 +182,12 @@ CONFIG_PRINTK=y
180CONFIG_BUG=y 182CONFIG_BUG=y
181CONFIG_ELF_CORE=y 183CONFIG_ELF_CORE=y
182CONFIG_BASE_FULL=y 184CONFIG_BASE_FULL=y
185CONFIG_RT_MUTEXES=y
183CONFIG_FUTEX=y 186CONFIG_FUTEX=y
184CONFIG_EPOLL=y 187CONFIG_EPOLL=y
185CONFIG_SHMEM=y 188CONFIG_SHMEM=y
186CONFIG_SLAB=y 189CONFIG_SLAB=y
190CONFIG_VM_EVENT_COUNTERS=y
187# CONFIG_TINY_SHMEM is not set 191# CONFIG_TINY_SHMEM is not set
188CONFIG_BASE_SMALL=0 192CONFIG_BASE_SMALL=0
189# CONFIG_SLOB is not set 193# CONFIG_SLOB is not set
@@ -279,6 +283,8 @@ CONFIG_SYN_COOKIES=y
279# CONFIG_INET_IPCOMP is not set 283# CONFIG_INET_IPCOMP is not set
280# CONFIG_INET_XFRM_TUNNEL is not set 284# CONFIG_INET_XFRM_TUNNEL is not set
281# CONFIG_INET_TUNNEL is not set 285# CONFIG_INET_TUNNEL is not set
286CONFIG_INET_XFRM_MODE_TRANSPORT=m
287CONFIG_INET_XFRM_MODE_TUNNEL=m
282CONFIG_INET_DIAG=y 288CONFIG_INET_DIAG=y
283CONFIG_INET_TCP_DIAG=y 289CONFIG_INET_TCP_DIAG=y
284# CONFIG_TCP_CONG_ADVANCED is not set 290# CONFIG_TCP_CONG_ADVANCED is not set
@@ -286,6 +292,7 @@ CONFIG_TCP_CONG_BIC=y
286# CONFIG_IPV6 is not set 292# CONFIG_IPV6 is not set
287# CONFIG_INET6_XFRM_TUNNEL is not set 293# CONFIG_INET6_XFRM_TUNNEL is not set
288# CONFIG_INET6_TUNNEL is not set 294# CONFIG_INET6_TUNNEL is not set
295CONFIG_NETWORK_SECMARK=y
289# CONFIG_NETFILTER is not set 296# CONFIG_NETFILTER is not set
290 297
291# 298#
@@ -381,6 +388,7 @@ CONFIG_NET_ESTIMATOR=y
381# CONFIG_PREVENT_FIRMWARE_BUILD is not set 388# CONFIG_PREVENT_FIRMWARE_BUILD is not set
382# CONFIG_FW_LOADER is not set 389# CONFIG_FW_LOADER is not set
383# CONFIG_DEBUG_DRIVER is not set 390# CONFIG_DEBUG_DRIVER is not set
391# CONFIG_SYS_HYPERVISOR is not set
384 392
385# 393#
386# Connector - unified userspace <-> kernelspace linker 394# Connector - unified userspace <-> kernelspace linker
@@ -565,6 +573,7 @@ CONFIG_LEGACY_PTY_COUNT=256
565# Watchdog Cards 573# Watchdog Cards
566# 574#
567# CONFIG_WATCHDOG is not set 575# CONFIG_WATCHDOG is not set
576# CONFIG_HW_RANDOM is not set
568# CONFIG_RTC is not set 577# CONFIG_RTC is not set
569# CONFIG_GEN_RTC is not set 578# CONFIG_GEN_RTC is not set
570# CONFIG_DTLK is not set 579# CONFIG_DTLK is not set
@@ -595,7 +604,6 @@ CONFIG_LEGACY_PTY_COUNT=256
595# 604#
596# Dallas's 1-wire bus 605# Dallas's 1-wire bus
597# 606#
598# CONFIG_W1 is not set
599 607
600# 608#
601# Hardware Monitoring support 609# Hardware Monitoring support
@@ -611,6 +619,7 @@ CONFIG_LEGACY_PTY_COUNT=256
611# Multimedia devices 619# Multimedia devices
612# 620#
613# CONFIG_VIDEO_DEV is not set 621# CONFIG_VIDEO_DEV is not set
622CONFIG_VIDEO_V4L2=y
614 623
615# 624#
616# Digital Video Broadcasting Devices 625# Digital Video Broadcasting Devices
@@ -620,6 +629,7 @@ CONFIG_LEGACY_PTY_COUNT=256
620# 629#
621# Graphics support 630# Graphics support
622# 631#
632# CONFIG_FIRMWARE_EDID is not set
623# CONFIG_FB is not set 633# CONFIG_FB is not set
624 634
625# 635#
@@ -675,6 +685,19 @@ CONFIG_LEGACY_PTY_COUNT=256
675# CONFIG_RTC_CLASS is not set 685# CONFIG_RTC_CLASS is not set
676 686
677# 687#
688# DMA Engine support
689#
690# CONFIG_DMA_ENGINE is not set
691
692#
693# DMA Clients
694#
695
696#
697# DMA Devices
698#
699
700#
678# File systems 701# File systems
679# 702#
680CONFIG_EXT2_FS=y 703CONFIG_EXT2_FS=y
@@ -685,7 +708,6 @@ CONFIG_EXT2_FS=y
685# CONFIG_JFS_FS is not set 708# CONFIG_JFS_FS is not set
686# CONFIG_FS_POSIX_ACL is not set 709# CONFIG_FS_POSIX_ACL is not set
687# CONFIG_XFS_FS is not set 710# CONFIG_XFS_FS is not set
688# CONFIG_OCFS2_FS is not set
689# CONFIG_MINIX_FS is not set 711# CONFIG_MINIX_FS is not set
690CONFIG_ROMFS_FS=y 712CONFIG_ROMFS_FS=y
691# CONFIG_INOTIFY is not set 713# CONFIG_INOTIFY is not set
@@ -753,6 +775,7 @@ CONFIG_SUNRPC=y
753# CONFIG_RPCSEC_GSS_SPKM3 is not set 775# CONFIG_RPCSEC_GSS_SPKM3 is not set
754# CONFIG_SMB_FS is not set 776# CONFIG_SMB_FS is not set
755# CONFIG_CIFS is not set 777# CONFIG_CIFS is not set
778# CONFIG_CIFS_DEBUG2 is not set
756# CONFIG_NCP_FS is not set 779# CONFIG_NCP_FS is not set
757# CONFIG_CODA_FS is not set 780# CONFIG_CODA_FS is not set
758# CONFIG_AFS_FS is not set 781# CONFIG_AFS_FS is not set
@@ -779,14 +802,19 @@ CONFIG_MSDOS_PARTITION=y
779# 802#
780# CONFIG_PRINTK_TIME is not set 803# CONFIG_PRINTK_TIME is not set
781# CONFIG_MAGIC_SYSRQ is not set 804# CONFIG_MAGIC_SYSRQ is not set
805# CONFIG_UNUSED_SYMBOLS is not set
782CONFIG_DEBUG_KERNEL=y 806CONFIG_DEBUG_KERNEL=y
783CONFIG_LOG_BUF_SHIFT=14 807CONFIG_LOG_BUF_SHIFT=14
784# CONFIG_DETECT_SOFTLOCKUP is not set 808# CONFIG_DETECT_SOFTLOCKUP is not set
785# CONFIG_SCHEDSTATS is not set 809# CONFIG_SCHEDSTATS is not set
786# CONFIG_DEBUG_SLAB is not set 810# CONFIG_DEBUG_SLAB is not set
787CONFIG_DEBUG_MUTEXES=y 811# CONFIG_DEBUG_RT_MUTEXES is not set
812# CONFIG_RT_MUTEX_TESTER is not set
788# CONFIG_DEBUG_SPINLOCK is not set 813# CONFIG_DEBUG_SPINLOCK is not set
814CONFIG_DEBUG_MUTEXES=y
815# CONFIG_DEBUG_RWSEMS is not set
789# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 816# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
817# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
790# CONFIG_DEBUG_KOBJECT is not set 818# CONFIG_DEBUG_KOBJECT is not set
791CONFIG_DEBUG_INFO=y 819CONFIG_DEBUG_INFO=y
792# CONFIG_DEBUG_VM is not set 820# CONFIG_DEBUG_VM is not set
@@ -844,3 +872,4 @@ CONFIG_CRYPTO_MD5=y
844CONFIG_CRC16=y 872CONFIG_CRC16=y
845CONFIG_CRC32=y 873CONFIG_CRC32=y
846# CONFIG_LIBCRC32C is not set 874# CONFIG_LIBCRC32C is not set
875CONFIG_PLIST=y
diff --git a/arch/mips/configs/mpc30x_defconfig b/arch/mips/configs/mpc30x_defconfig
index 5d6ff3c352c9..938b38ab5239 100644
--- a/arch/mips/configs/mpc30x_defconfig
+++ b/arch/mips/configs/mpc30x_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:51:09 2006 4# Thu Jul 6 10:04:15 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MIPS=y
45CONFIG_MACH_VR41XX=y 47CONFIG_MACH_VR41XX=y
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -73,6 +76,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
73CONFIG_GENERIC_FIND_NEXT_BIT=y 76CONFIG_GENERIC_FIND_NEXT_BIT=y
74CONFIG_GENERIC_HWEIGHT=y 77CONFIG_GENERIC_HWEIGHT=y
75CONFIG_GENERIC_CALIBRATE_DELAY=y 78CONFIG_GENERIC_CALIBRATE_DELAY=y
79CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
76CONFIG_DMA_NONCOHERENT=y 80CONFIG_DMA_NONCOHERENT=y
77CONFIG_DMA_NEED_PCI_MAP_STATE=y 81CONFIG_DMA_NEED_PCI_MAP_STATE=y
78# CONFIG_CPU_BIG_ENDIAN is not set 82# CONFIG_CPU_BIG_ENDIAN is not set
@@ -117,7 +121,10 @@ CONFIG_PAGE_SIZE_4KB=y
117# CONFIG_PAGE_SIZE_8KB is not set 121# CONFIG_PAGE_SIZE_8KB is not set
118# CONFIG_PAGE_SIZE_16KB is not set 122# CONFIG_PAGE_SIZE_16KB is not set
119# CONFIG_PAGE_SIZE_64KB is not set 123# CONFIG_PAGE_SIZE_64KB is not set
120# CONFIG_MIPS_MT is not set 124CONFIG_MIPS_MT_DISABLED=y
125# CONFIG_MIPS_MT_SMTC is not set
126# CONFIG_MIPS_MT_SMP is not set
127# CONFIG_MIPS_VPE_LOADER is not set
121CONFIG_CPU_HAS_SYNC=y 128CONFIG_CPU_HAS_SYNC=y
122CONFIG_GENERIC_HARDIRQS=y 129CONFIG_GENERIC_HARDIRQS=y
123CONFIG_GENERIC_IRQ_PROBE=y 130CONFIG_GENERIC_IRQ_PROBE=y
@@ -130,6 +137,7 @@ CONFIG_FLATMEM=y
130CONFIG_FLAT_NODE_MEM_MAP=y 137CONFIG_FLAT_NODE_MEM_MAP=y
131# CONFIG_SPARSEMEM_STATIC is not set 138# CONFIG_SPARSEMEM_STATIC is not set
132CONFIG_SPLIT_PTLOCK_CPUS=4 139CONFIG_SPLIT_PTLOCK_CPUS=4
140# CONFIG_RESOURCES_64BIT is not set
133# CONFIG_HZ_48 is not set 141# CONFIG_HZ_48 is not set
134# CONFIG_HZ_100 is not set 142# CONFIG_HZ_100 is not set
135# CONFIG_HZ_128 is not set 143# CONFIG_HZ_128 is not set
@@ -142,6 +150,7 @@ CONFIG_HZ=1000
142CONFIG_PREEMPT_NONE=y 150CONFIG_PREEMPT_NONE=y
143# CONFIG_PREEMPT_VOLUNTARY is not set 151# CONFIG_PREEMPT_VOLUNTARY is not set
144# CONFIG_PREEMPT is not set 152# CONFIG_PREEMPT is not set
153CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
145 154
146# 155#
147# Code maturity level options 156# Code maturity level options
@@ -173,10 +182,12 @@ CONFIG_PRINTK=y
173CONFIG_BUG=y 182CONFIG_BUG=y
174CONFIG_ELF_CORE=y 183CONFIG_ELF_CORE=y
175CONFIG_BASE_FULL=y 184CONFIG_BASE_FULL=y
185CONFIG_RT_MUTEXES=y
176CONFIG_FUTEX=y 186CONFIG_FUTEX=y
177CONFIG_EPOLL=y 187CONFIG_EPOLL=y
178CONFIG_SHMEM=y 188CONFIG_SHMEM=y
179CONFIG_SLAB=y 189CONFIG_SLAB=y
190CONFIG_VM_EVENT_COUNTERS=y
180# CONFIG_TINY_SHMEM is not set 191# CONFIG_TINY_SHMEM is not set
181CONFIG_BASE_SMALL=0 192CONFIG_BASE_SMALL=0
182# CONFIG_SLOB is not set 193# CONFIG_SLOB is not set
@@ -278,6 +289,8 @@ CONFIG_IP_FIB_HASH=y
278# CONFIG_INET_IPCOMP is not set 289# CONFIG_INET_IPCOMP is not set
279# CONFIG_INET_XFRM_TUNNEL is not set 290# CONFIG_INET_XFRM_TUNNEL is not set
280# CONFIG_INET_TUNNEL is not set 291# CONFIG_INET_TUNNEL is not set
292CONFIG_INET_XFRM_MODE_TRANSPORT=m
293CONFIG_INET_XFRM_MODE_TUNNEL=m
281CONFIG_INET_DIAG=y 294CONFIG_INET_DIAG=y
282CONFIG_INET_TCP_DIAG=y 295CONFIG_INET_TCP_DIAG=y
283# CONFIG_TCP_CONG_ADVANCED is not set 296# CONFIG_TCP_CONG_ADVANCED is not set
@@ -285,6 +298,7 @@ CONFIG_TCP_CONG_BIC=y
285# CONFIG_IPV6 is not set 298# CONFIG_IPV6 is not set
286# CONFIG_INET6_XFRM_TUNNEL is not set 299# CONFIG_INET6_XFRM_TUNNEL is not set
287# CONFIG_INET6_TUNNEL is not set 300# CONFIG_INET6_TUNNEL is not set
301CONFIG_NETWORK_SECMARK=y
288# CONFIG_NETFILTER is not set 302# CONFIG_NETFILTER is not set
289 303
290# 304#
@@ -345,6 +359,7 @@ CONFIG_WIRELESS_EXT=y
345CONFIG_STANDALONE=y 359CONFIG_STANDALONE=y
346CONFIG_PREVENT_FIRMWARE_BUILD=y 360CONFIG_PREVENT_FIRMWARE_BUILD=y
347CONFIG_FW_LOADER=y 361CONFIG_FW_LOADER=y
362# CONFIG_SYS_HYPERVISOR is not set
348 363
349# 364#
350# Connector - unified userspace <-> kernelspace linker 365# Connector - unified userspace <-> kernelspace linker
@@ -483,6 +498,7 @@ CONFIG_MII=m
483# CONFIG_CHELSIO_T1 is not set 498# CONFIG_CHELSIO_T1 is not set
484# CONFIG_IXGB is not set 499# CONFIG_IXGB is not set
485# CONFIG_S2IO is not set 500# CONFIG_S2IO is not set
501# CONFIG_MYRI10GE is not set
486 502
487# 503#
488# Token Ring devices 504# Token Ring devices
@@ -531,8 +547,10 @@ CONFIG_PCMCIA_HERMES=m
531# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support 547# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support
532# 548#
533# CONFIG_PRISM54 is not set 549# CONFIG_PRISM54 is not set
550# CONFIG_USB_ZD1201 is not set
534# CONFIG_HOSTAP is not set 551# CONFIG_HOSTAP is not set
535# CONFIG_BCM43XX is not set 552# CONFIG_BCM43XX is not set
553# CONFIG_ZD1211RW is not set
536CONFIG_NET_WIRELESS=y 554CONFIG_NET_WIRELESS=y
537 555
538# 556#
@@ -614,6 +632,7 @@ CONFIG_SERIO_RAW=m
614CONFIG_VT=y 632CONFIG_VT=y
615CONFIG_VT_CONSOLE=y 633CONFIG_VT_CONSOLE=y
616CONFIG_HW_CONSOLE=y 634CONFIG_HW_CONSOLE=y
635CONFIG_VT_HW_CONSOLE_BINDING=y
617# CONFIG_SERIAL_NONSTANDARD is not set 636# CONFIG_SERIAL_NONSTANDARD is not set
618 637
619# 638#
@@ -639,6 +658,7 @@ CONFIG_LEGACY_PTY_COUNT=256
639# Watchdog Cards 658# Watchdog Cards
640# 659#
641# CONFIG_WATCHDOG is not set 660# CONFIG_WATCHDOG is not set
661# CONFIG_HW_RANDOM is not set
642# CONFIG_RTC is not set 662# CONFIG_RTC is not set
643# CONFIG_GEN_RTC is not set 663# CONFIG_GEN_RTC is not set
644# CONFIG_DTLK is not set 664# CONFIG_DTLK is not set
@@ -695,6 +715,7 @@ CONFIG_LEGACY_PTY_COUNT=256
695# Multimedia devices 715# Multimedia devices
696# 716#
697# CONFIG_VIDEO_DEV is not set 717# CONFIG_VIDEO_DEV is not set
718CONFIG_VIDEO_V4L2=y
698 719
699# 720#
700# Digital Video Broadcasting Devices 721# Digital Video Broadcasting Devices
@@ -705,6 +726,7 @@ CONFIG_LEGACY_PTY_COUNT=256
705# 726#
706# Graphics support 727# Graphics support
707# 728#
729# CONFIG_FIRMWARE_EDID is not set
708# CONFIG_FB is not set 730# CONFIG_FB is not set
709 731
710# 732#
@@ -798,7 +820,6 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
798CONFIG_USB_PEGASUS=m 820CONFIG_USB_PEGASUS=m
799# CONFIG_USB_RTL8150 is not set 821# CONFIG_USB_RTL8150 is not set
800# CONFIG_USB_USBNET is not set 822# CONFIG_USB_USBNET is not set
801# CONFIG_USB_ZD1201 is not set
802# CONFIG_USB_MON is not set 823# CONFIG_USB_MON is not set
803 824
804# 825#
@@ -820,10 +841,12 @@ CONFIG_USB_PEGASUS=m
820# CONFIG_USB_LEGOTOWER is not set 841# CONFIG_USB_LEGOTOWER is not set
821# CONFIG_USB_LCD is not set 842# CONFIG_USB_LCD is not set
822# CONFIG_USB_LED is not set 843# CONFIG_USB_LED is not set
844# CONFIG_USB_CY7C63 is not set
823# CONFIG_USB_CYTHERM is not set 845# CONFIG_USB_CYTHERM is not set
824# CONFIG_USB_PHIDGETKIT is not set 846# CONFIG_USB_PHIDGETKIT is not set
825# CONFIG_USB_PHIDGETSERVO is not set 847# CONFIG_USB_PHIDGETSERVO is not set
826# CONFIG_USB_IDMOUSE is not set 848# CONFIG_USB_IDMOUSE is not set
849# CONFIG_USB_APPLEDISPLAY is not set
827# CONFIG_USB_LD is not set 850# CONFIG_USB_LD is not set
828# CONFIG_USB_TEST is not set 851# CONFIG_USB_TEST is not set
829 852
@@ -869,6 +892,19 @@ CONFIG_USB_PEGASUS=m
869# CONFIG_RTC_CLASS is not set 892# CONFIG_RTC_CLASS is not set
870 893
871# 894#
895# DMA Engine support
896#
897# CONFIG_DMA_ENGINE is not set
898
899#
900# DMA Clients
901#
902
903#
904# DMA Devices
905#
906
907#
872# File systems 908# File systems
873# 909#
874CONFIG_EXT2_FS=y 910CONFIG_EXT2_FS=y
@@ -883,6 +919,7 @@ CONFIG_EXT2_FS=y
883# CONFIG_MINIX_FS is not set 919# CONFIG_MINIX_FS is not set
884# CONFIG_ROMFS_FS is not set 920# CONFIG_ROMFS_FS is not set
885CONFIG_INOTIFY=y 921CONFIG_INOTIFY=y
922CONFIG_INOTIFY_USER=y
886# CONFIG_QUOTA is not set 923# CONFIG_QUOTA is not set
887CONFIG_DNOTIFY=y 924CONFIG_DNOTIFY=y
888CONFIG_AUTOFS_FS=y 925CONFIG_AUTOFS_FS=y
@@ -945,6 +982,7 @@ CONFIG_SUNRPC=y
945# CONFIG_RPCSEC_GSS_SPKM3 is not set 982# CONFIG_RPCSEC_GSS_SPKM3 is not set
946# CONFIG_SMB_FS is not set 983# CONFIG_SMB_FS is not set
947# CONFIG_CIFS is not set 984# CONFIG_CIFS is not set
985# CONFIG_CIFS_DEBUG2 is not set
948# CONFIG_NCP_FS is not set 986# CONFIG_NCP_FS is not set
949# CONFIG_CODA_FS is not set 987# CONFIG_CODA_FS is not set
950# CONFIG_AFS_FS is not set 988# CONFIG_AFS_FS is not set
@@ -971,6 +1009,7 @@ CONFIG_MSDOS_PARTITION=y
971# 1009#
972# CONFIG_PRINTK_TIME is not set 1010# CONFIG_PRINTK_TIME is not set
973# CONFIG_MAGIC_SYSRQ is not set 1011# CONFIG_MAGIC_SYSRQ is not set
1012# CONFIG_UNUSED_SYMBOLS is not set
974# CONFIG_DEBUG_KERNEL is not set 1013# CONFIG_DEBUG_KERNEL is not set
975CONFIG_LOG_BUF_SHIFT=14 1014CONFIG_LOG_BUF_SHIFT=14
976# CONFIG_DEBUG_FS is not set 1015# CONFIG_DEBUG_FS is not set
@@ -1026,3 +1065,4 @@ CONFIG_CRC32=y
1026CONFIG_LIBCRC32C=m 1065CONFIG_LIBCRC32C=m
1027CONFIG_ZLIB_INFLATE=m 1066CONFIG_ZLIB_INFLATE=m
1028CONFIG_ZLIB_DEFLATE=m 1067CONFIG_ZLIB_DEFLATE=m
1068CONFIG_PLIST=y
diff --git a/arch/mips/configs/ocelot_3_defconfig b/arch/mips/configs/ocelot_3_defconfig
index fe5e3dd915f5..ec5758f22676 100644
--- a/arch/mips/configs/ocelot_3_defconfig
+++ b/arch/mips/configs/ocelot_3_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:51:10 2006 4# Thu Jul 6 10:04:15 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MOMENCO_OCELOT_3=y
45# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -65,6 +68,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
65CONFIG_GENERIC_FIND_NEXT_BIT=y 68CONFIG_GENERIC_FIND_NEXT_BIT=y
66CONFIG_GENERIC_HWEIGHT=y 69CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 70CONFIG_GENERIC_CALIBRATE_DELAY=y
71CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
68CONFIG_DMA_NONCOHERENT=y 72CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 73CONFIG_DMA_NEED_PCI_MAP_STATE=y
70CONFIG_CPU_BIG_ENDIAN=y 74CONFIG_CPU_BIG_ENDIAN=y
@@ -118,7 +122,10 @@ CONFIG_PAGE_SIZE_4KB=y
118CONFIG_BOARD_SCACHE=y 122CONFIG_BOARD_SCACHE=y
119CONFIG_RM7000_CPU_SCACHE=y 123CONFIG_RM7000_CPU_SCACHE=y
120CONFIG_CPU_HAS_PREFETCH=y 124CONFIG_CPU_HAS_PREFETCH=y
121# CONFIG_MIPS_MT is not set 125CONFIG_MIPS_MT_DISABLED=y
126# CONFIG_MIPS_MT_SMTC is not set
127# CONFIG_MIPS_MT_SMP is not set
128# CONFIG_MIPS_VPE_LOADER is not set
122# CONFIG_64BIT_PHYS_ADDR is not set 129# CONFIG_64BIT_PHYS_ADDR is not set
123CONFIG_CPU_HAS_LLSC=y 130CONFIG_CPU_HAS_LLSC=y
124CONFIG_CPU_HAS_SYNC=y 131CONFIG_CPU_HAS_SYNC=y
@@ -134,6 +141,7 @@ CONFIG_FLATMEM=y
134CONFIG_FLAT_NODE_MEM_MAP=y 141CONFIG_FLAT_NODE_MEM_MAP=y
135# CONFIG_SPARSEMEM_STATIC is not set 142# CONFIG_SPARSEMEM_STATIC is not set
136CONFIG_SPLIT_PTLOCK_CPUS=4 143CONFIG_SPLIT_PTLOCK_CPUS=4
144# CONFIG_RESOURCES_64BIT is not set
137# CONFIG_HZ_48 is not set 145# CONFIG_HZ_48 is not set
138# CONFIG_HZ_100 is not set 146# CONFIG_HZ_100 is not set
139# CONFIG_HZ_128 is not set 147# CONFIG_HZ_128 is not set
@@ -143,10 +151,10 @@ CONFIG_HZ_1000=y
143# CONFIG_HZ_1024 is not set 151# CONFIG_HZ_1024 is not set
144CONFIG_SYS_SUPPORTS_ARBIT_HZ=y 152CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
145CONFIG_HZ=1000 153CONFIG_HZ=1000
146# CONFIG_SMP is not set
147CONFIG_PREEMPT_NONE=y 154CONFIG_PREEMPT_NONE=y
148# CONFIG_PREEMPT_VOLUNTARY is not set 155# CONFIG_PREEMPT_VOLUNTARY is not set
149# CONFIG_PREEMPT is not set 156# CONFIG_PREEMPT is not set
157CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
150 158
151# 159#
152# Code maturity level options 160# Code maturity level options
@@ -179,10 +187,12 @@ CONFIG_PRINTK=y
179CONFIG_BUG=y 187CONFIG_BUG=y
180CONFIG_ELF_CORE=y 188CONFIG_ELF_CORE=y
181CONFIG_BASE_FULL=y 189CONFIG_BASE_FULL=y
190CONFIG_RT_MUTEXES=y
182CONFIG_FUTEX=y 191CONFIG_FUTEX=y
183CONFIG_EPOLL=y 192CONFIG_EPOLL=y
184CONFIG_SHMEM=y 193CONFIG_SHMEM=y
185CONFIG_SLAB=y 194CONFIG_SLAB=y
195CONFIG_VM_EVENT_COUNTERS=y
186# CONFIG_TINY_SHMEM is not set 196# CONFIG_TINY_SHMEM is not set
187CONFIG_BASE_SMALL=0 197CONFIG_BASE_SMALL=0
188# CONFIG_SLOB is not set 198# CONFIG_SLOB is not set
@@ -273,6 +283,8 @@ CONFIG_IP_PNP_BOOTP=y
273# CONFIG_INET_IPCOMP is not set 283# CONFIG_INET_IPCOMP is not set
274# CONFIG_INET_XFRM_TUNNEL is not set 284# CONFIG_INET_XFRM_TUNNEL is not set
275# CONFIG_INET_TUNNEL is not set 285# CONFIG_INET_TUNNEL is not set
286CONFIG_INET_XFRM_MODE_TRANSPORT=m
287CONFIG_INET_XFRM_MODE_TUNNEL=m
276CONFIG_INET_DIAG=y 288CONFIG_INET_DIAG=y
277CONFIG_INET_TCP_DIAG=y 289CONFIG_INET_TCP_DIAG=y
278# CONFIG_TCP_CONG_ADVANCED is not set 290# CONFIG_TCP_CONG_ADVANCED is not set
@@ -291,7 +303,10 @@ CONFIG_IPV6_ROUTE_INFO=y
291# CONFIG_INET6_IPCOMP is not set 303# CONFIG_INET6_IPCOMP is not set
292# CONFIG_INET6_XFRM_TUNNEL is not set 304# CONFIG_INET6_XFRM_TUNNEL is not set
293# CONFIG_INET6_TUNNEL is not set 305# CONFIG_INET6_TUNNEL is not set
306CONFIG_INET6_XFRM_MODE_TRANSPORT=m
307CONFIG_INET6_XFRM_MODE_TUNNEL=m
294# CONFIG_IPV6_TUNNEL is not set 308# CONFIG_IPV6_TUNNEL is not set
309CONFIG_NETWORK_SECMARK=y
295CONFIG_NETFILTER=y 310CONFIG_NETFILTER=y
296# CONFIG_NETFILTER_DEBUG is not set 311# CONFIG_NETFILTER_DEBUG is not set
297 312
@@ -306,6 +321,7 @@ CONFIG_NETFILTER_XTABLES=m
306CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m 321CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
307CONFIG_NETFILTER_XT_TARGET_MARK=m 322CONFIG_NETFILTER_XT_TARGET_MARK=m
308CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m 323CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
324CONFIG_NETFILTER_XT_TARGET_SECMARK=m
309CONFIG_NETFILTER_XT_MATCH_COMMENT=m 325CONFIG_NETFILTER_XT_MATCH_COMMENT=m
310CONFIG_NETFILTER_XT_MATCH_DCCP=m 326CONFIG_NETFILTER_XT_MATCH_DCCP=m
311CONFIG_NETFILTER_XT_MATCH_ESP=m 327CONFIG_NETFILTER_XT_MATCH_ESP=m
@@ -316,8 +332,10 @@ CONFIG_NETFILTER_XT_MATCH_MARK=m
316CONFIG_NETFILTER_XT_MATCH_POLICY=m 332CONFIG_NETFILTER_XT_MATCH_POLICY=m
317CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m 333CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
318CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 334CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
335CONFIG_NETFILTER_XT_MATCH_QUOTA=m
319CONFIG_NETFILTER_XT_MATCH_REALM=m 336CONFIG_NETFILTER_XT_MATCH_REALM=m
320CONFIG_NETFILTER_XT_MATCH_SCTP=m 337CONFIG_NETFILTER_XT_MATCH_SCTP=m
338CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
321CONFIG_NETFILTER_XT_MATCH_STRING=m 339CONFIG_NETFILTER_XT_MATCH_STRING=m
322CONFIG_NETFILTER_XT_MATCH_TCPMSS=m 340CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
323 341
@@ -393,6 +411,7 @@ CONFIG_WIRELESS_EXT=y
393CONFIG_STANDALONE=y 411CONFIG_STANDALONE=y
394CONFIG_PREVENT_FIRMWARE_BUILD=y 412CONFIG_PREVENT_FIRMWARE_BUILD=y
395CONFIG_FW_LOADER=m 413CONFIG_FW_LOADER=m
414# CONFIG_SYS_HYPERVISOR is not set
396 415
397# 416#
398# Connector - unified userspace <-> kernelspace linker 417# Connector - unified userspace <-> kernelspace linker
@@ -483,6 +502,7 @@ CONFIG_ISCSI_TCP=m
483# CONFIG_MEGARAID_LEGACY is not set 502# CONFIG_MEGARAID_LEGACY is not set
484# CONFIG_MEGARAID_SAS is not set 503# CONFIG_MEGARAID_SAS is not set
485# CONFIG_SCSI_SATA is not set 504# CONFIG_SCSI_SATA is not set
505# CONFIG_SCSI_HPTIOP is not set
486# CONFIG_SCSI_DMX3191D is not set 506# CONFIG_SCSI_DMX3191D is not set
487# CONFIG_SCSI_FUTURE_DOMAIN is not set 507# CONFIG_SCSI_FUTURE_DOMAIN is not set
488# CONFIG_SCSI_IPS is not set 508# CONFIG_SCSI_IPS is not set
@@ -548,6 +568,8 @@ CONFIG_DAVICOM_PHY=m
548CONFIG_QSEMI_PHY=m 568CONFIG_QSEMI_PHY=m
549CONFIG_LXT_PHY=m 569CONFIG_LXT_PHY=m
550CONFIG_CICADA_PHY=m 570CONFIG_CICADA_PHY=m
571CONFIG_VITESSE_PHY=m
572CONFIG_SMSC_PHY=m
551 573
552# 574#
553# Ethernet (10 or 100Mbit) 575# Ethernet (10 or 100Mbit)
@@ -614,6 +636,7 @@ CONFIG_MV643XX_ETH_2=y
614# CONFIG_CHELSIO_T1 is not set 636# CONFIG_CHELSIO_T1 is not set
615# CONFIG_IXGB is not set 637# CONFIG_IXGB is not set
616# CONFIG_S2IO is not set 638# CONFIG_S2IO is not set
639# CONFIG_MYRI10GE is not set
617 640
618# 641#
619# Token Ring devices 642# Token Ring devices
@@ -697,6 +720,7 @@ CONFIG_SERIO=y
697CONFIG_VT=y 720CONFIG_VT=y
698CONFIG_VT_CONSOLE=y 721CONFIG_VT_CONSOLE=y
699CONFIG_HW_CONSOLE=y 722CONFIG_HW_CONSOLE=y
723CONFIG_VT_HW_CONSOLE_BINDING=y
700# CONFIG_SERIAL_NONSTANDARD is not set 724# CONFIG_SERIAL_NONSTANDARD is not set
701 725
702# 726#
@@ -728,6 +752,7 @@ CONFIG_LEGACY_PTY_COUNT=256
728# Watchdog Cards 752# Watchdog Cards
729# 753#
730# CONFIG_WATCHDOG is not set 754# CONFIG_WATCHDOG is not set
755# CONFIG_HW_RANDOM is not set
731CONFIG_RTC=y 756CONFIG_RTC=y
732# CONFIG_DTLK is not set 757# CONFIG_DTLK is not set
733# CONFIG_R3964 is not set 758# CONFIG_R3964 is not set
@@ -775,6 +800,7 @@ CONFIG_RTC=y
775# Multimedia devices 800# Multimedia devices
776# 801#
777# CONFIG_VIDEO_DEV is not set 802# CONFIG_VIDEO_DEV is not set
803CONFIG_VIDEO_V4L2=y
778 804
779# 805#
780# Digital Video Broadcasting Devices 806# Digital Video Broadcasting Devices
@@ -784,12 +810,13 @@ CONFIG_RTC=y
784# 810#
785# Graphics support 811# Graphics support
786# 812#
813# CONFIG_FIRMWARE_EDID is not set
787CONFIG_FB=y 814CONFIG_FB=y
788# CONFIG_FB_CFB_FILLRECT is not set 815# CONFIG_FB_CFB_FILLRECT is not set
789# CONFIG_FB_CFB_COPYAREA is not set 816# CONFIG_FB_CFB_COPYAREA is not set
790# CONFIG_FB_CFB_IMAGEBLIT is not set 817# CONFIG_FB_CFB_IMAGEBLIT is not set
791# CONFIG_FB_MACMODES is not set 818# CONFIG_FB_MACMODES is not set
792CONFIG_FB_FIRMWARE_EDID=y 819# CONFIG_FB_BACKLIGHT is not set
793CONFIG_FB_MODE_HELPERS=y 820CONFIG_FB_MODE_HELPERS=y
794# CONFIG_FB_TILEBLITTING is not set 821# CONFIG_FB_TILEBLITTING is not set
795# CONFIG_FB_CIRRUS is not set 822# CONFIG_FB_CIRRUS is not set
@@ -889,6 +916,19 @@ CONFIG_USB_ARCH_HAS_EHCI=y
889# CONFIG_RTC_CLASS is not set 916# CONFIG_RTC_CLASS is not set
890 917
891# 918#
919# DMA Engine support
920#
921# CONFIG_DMA_ENGINE is not set
922
923#
924# DMA Clients
925#
926
927#
928# DMA Devices
929#
930
931#
892# File systems 932# File systems
893# 933#
894CONFIG_EXT2_FS=y 934CONFIG_EXT2_FS=y
@@ -908,7 +948,6 @@ CONFIG_REISERFS_FS=m
908# CONFIG_JFS_FS is not set 948# CONFIG_JFS_FS is not set
909# CONFIG_FS_POSIX_ACL is not set 949# CONFIG_FS_POSIX_ACL is not set
910CONFIG_XFS_FS=m 950CONFIG_XFS_FS=m
911CONFIG_XFS_EXPORT=y
912# CONFIG_XFS_QUOTA is not set 951# CONFIG_XFS_QUOTA is not set
913# CONFIG_XFS_SECURITY is not set 952# CONFIG_XFS_SECURITY is not set
914# CONFIG_XFS_POSIX_ACL is not set 953# CONFIG_XFS_POSIX_ACL is not set
@@ -917,6 +956,7 @@ CONFIG_XFS_EXPORT=y
917# CONFIG_MINIX_FS is not set 956# CONFIG_MINIX_FS is not set
918# CONFIG_ROMFS_FS is not set 957# CONFIG_ROMFS_FS is not set
919CONFIG_INOTIFY=y 958CONFIG_INOTIFY=y
959CONFIG_INOTIFY_USER=y
920# CONFIG_QUOTA is not set 960# CONFIG_QUOTA is not set
921CONFIG_DNOTIFY=y 961CONFIG_DNOTIFY=y
922CONFIG_AUTOFS_FS=y 962CONFIG_AUTOFS_FS=y
@@ -988,6 +1028,7 @@ CONFIG_SUNRPC=y
988CONFIG_SMB_FS=m 1028CONFIG_SMB_FS=m
989# CONFIG_SMB_NLS_DEFAULT is not set 1029# CONFIG_SMB_NLS_DEFAULT is not set
990# CONFIG_CIFS is not set 1030# CONFIG_CIFS is not set
1031# CONFIG_CIFS_DEBUG2 is not set
991# CONFIG_NCP_FS is not set 1032# CONFIG_NCP_FS is not set
992# CONFIG_CODA_FS is not set 1033# CONFIG_CODA_FS is not set
993# CONFIG_AFS_FS is not set 1034# CONFIG_AFS_FS is not set
@@ -1053,6 +1094,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1053# 1094#
1054# CONFIG_PRINTK_TIME is not set 1095# CONFIG_PRINTK_TIME is not set
1055# CONFIG_MAGIC_SYSRQ is not set 1096# CONFIG_MAGIC_SYSRQ is not set
1097# CONFIG_UNUSED_SYMBOLS is not set
1056# CONFIG_DEBUG_KERNEL is not set 1098# CONFIG_DEBUG_KERNEL is not set
1057CONFIG_LOG_BUF_SHIFT=14 1099CONFIG_LOG_BUF_SHIFT=14
1058# CONFIG_DEBUG_FS is not set 1100# CONFIG_DEBUG_FS is not set
@@ -1111,3 +1153,4 @@ CONFIG_TEXTSEARCH=y
1111CONFIG_TEXTSEARCH_KMP=m 1153CONFIG_TEXTSEARCH_KMP=m
1112CONFIG_TEXTSEARCH_BM=m 1154CONFIG_TEXTSEARCH_BM=m
1113CONFIG_TEXTSEARCH_FSM=m 1155CONFIG_TEXTSEARCH_FSM=m
1156CONFIG_PLIST=y
diff --git a/arch/mips/configs/ocelot_c_defconfig b/arch/mips/configs/ocelot_c_defconfig
index f4a33ce47e50..0d33d87de1a1 100644
--- a/arch/mips/configs/ocelot_c_defconfig
+++ b/arch/mips/configs/ocelot_c_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:51:10 2006 4# Thu Jul 6 10:04:16 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MOMENCO_OCELOT_C=y
45# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -65,6 +68,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
65CONFIG_GENERIC_FIND_NEXT_BIT=y 68CONFIG_GENERIC_FIND_NEXT_BIT=y
66CONFIG_GENERIC_HWEIGHT=y 69CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 70CONFIG_GENERIC_CALIBRATE_DELAY=y
71CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
68CONFIG_DMA_NONCOHERENT=y 72CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 73CONFIG_DMA_NEED_PCI_MAP_STATE=y
70CONFIG_CPU_BIG_ENDIAN=y 74CONFIG_CPU_BIG_ENDIAN=y
@@ -116,7 +120,10 @@ CONFIG_PAGE_SIZE_4KB=y
116CONFIG_BOARD_SCACHE=y 120CONFIG_BOARD_SCACHE=y
117CONFIG_RM7000_CPU_SCACHE=y 121CONFIG_RM7000_CPU_SCACHE=y
118CONFIG_CPU_HAS_PREFETCH=y 122CONFIG_CPU_HAS_PREFETCH=y
119# CONFIG_MIPS_MT is not set 123CONFIG_MIPS_MT_DISABLED=y
124# CONFIG_MIPS_MT_SMTC is not set
125# CONFIG_MIPS_MT_SMP is not set
126# CONFIG_MIPS_VPE_LOADER is not set
120CONFIG_CPU_HAS_LLSC=y 127CONFIG_CPU_HAS_LLSC=y
121CONFIG_CPU_HAS_SYNC=y 128CONFIG_CPU_HAS_SYNC=y
122CONFIG_GENERIC_HARDIRQS=y 129CONFIG_GENERIC_HARDIRQS=y
@@ -131,6 +138,7 @@ CONFIG_FLATMEM=y
131CONFIG_FLAT_NODE_MEM_MAP=y 138CONFIG_FLAT_NODE_MEM_MAP=y
132# CONFIG_SPARSEMEM_STATIC is not set 139# CONFIG_SPARSEMEM_STATIC is not set
133CONFIG_SPLIT_PTLOCK_CPUS=4 140CONFIG_SPLIT_PTLOCK_CPUS=4
141CONFIG_RESOURCES_64BIT=y
134# CONFIG_HZ_48 is not set 142# CONFIG_HZ_48 is not set
135# CONFIG_HZ_100 is not set 143# CONFIG_HZ_100 is not set
136# CONFIG_HZ_128 is not set 144# CONFIG_HZ_128 is not set
@@ -143,6 +151,7 @@ CONFIG_HZ=1000
143CONFIG_PREEMPT_NONE=y 151CONFIG_PREEMPT_NONE=y
144# CONFIG_PREEMPT_VOLUNTARY is not set 152# CONFIG_PREEMPT_VOLUNTARY is not set
145# CONFIG_PREEMPT is not set 153# CONFIG_PREEMPT is not set
154CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
146 155
147# 156#
148# Code maturity level options 157# Code maturity level options
@@ -174,10 +183,12 @@ CONFIG_PRINTK=y
174CONFIG_BUG=y 183CONFIG_BUG=y
175CONFIG_ELF_CORE=y 184CONFIG_ELF_CORE=y
176CONFIG_BASE_FULL=y 185CONFIG_BASE_FULL=y
186CONFIG_RT_MUTEXES=y
177CONFIG_FUTEX=y 187CONFIG_FUTEX=y
178CONFIG_EPOLL=y 188CONFIG_EPOLL=y
179CONFIG_SHMEM=y 189CONFIG_SHMEM=y
180CONFIG_SLAB=y 190CONFIG_SLAB=y
191CONFIG_VM_EVENT_COUNTERS=y
181# CONFIG_TINY_SHMEM is not set 192# CONFIG_TINY_SHMEM is not set
182CONFIG_BASE_SMALL=0 193CONFIG_BASE_SMALL=0
183# CONFIG_SLOB is not set 194# CONFIG_SLOB is not set
@@ -265,6 +276,8 @@ CONFIG_IP_PNP_DHCP=y
265# CONFIG_INET_IPCOMP is not set 276# CONFIG_INET_IPCOMP is not set
266# CONFIG_INET_XFRM_TUNNEL is not set 277# CONFIG_INET_XFRM_TUNNEL is not set
267# CONFIG_INET_TUNNEL is not set 278# CONFIG_INET_TUNNEL is not set
279CONFIG_INET_XFRM_MODE_TRANSPORT=y
280CONFIG_INET_XFRM_MODE_TUNNEL=y
268CONFIG_INET_DIAG=y 281CONFIG_INET_DIAG=y
269CONFIG_INET_TCP_DIAG=y 282CONFIG_INET_TCP_DIAG=y
270# CONFIG_TCP_CONG_ADVANCED is not set 283# CONFIG_TCP_CONG_ADVANCED is not set
@@ -272,6 +285,7 @@ CONFIG_TCP_CONG_BIC=y
272# CONFIG_IPV6 is not set 285# CONFIG_IPV6 is not set
273# CONFIG_INET6_XFRM_TUNNEL is not set 286# CONFIG_INET6_XFRM_TUNNEL is not set
274# CONFIG_INET6_TUNNEL is not set 287# CONFIG_INET6_TUNNEL is not set
288CONFIG_NETWORK_SECMARK=y
275# CONFIG_NETFILTER is not set 289# CONFIG_NETFILTER is not set
276 290
277# 291#
@@ -331,6 +345,7 @@ CONFIG_WIRELESS_EXT=y
331CONFIG_STANDALONE=y 345CONFIG_STANDALONE=y
332CONFIG_PREVENT_FIRMWARE_BUILD=y 346CONFIG_PREVENT_FIRMWARE_BUILD=y
333CONFIG_FW_LOADER=y 347CONFIG_FW_LOADER=y
348# CONFIG_SYS_HYPERVISOR is not set
334 349
335# 350#
336# Connector - unified userspace <-> kernelspace linker 351# Connector - unified userspace <-> kernelspace linker
@@ -428,6 +443,8 @@ CONFIG_DAVICOM_PHY=y
428CONFIG_QSEMI_PHY=y 443CONFIG_QSEMI_PHY=y
429CONFIG_LXT_PHY=y 444CONFIG_LXT_PHY=y
430CONFIG_CICADA_PHY=y 445CONFIG_CICADA_PHY=y
446CONFIG_VITESSE_PHY=y
447CONFIG_SMSC_PHY=y
431 448
432# 449#
433# Ethernet (10 or 100Mbit) 450# Ethernet (10 or 100Mbit)
@@ -471,6 +488,7 @@ CONFIG_NET_ETHERNET=y
471# CONFIG_CHELSIO_T1 is not set 488# CONFIG_CHELSIO_T1 is not set
472# CONFIG_IXGB is not set 489# CONFIG_IXGB is not set
473# CONFIG_S2IO is not set 490# CONFIG_S2IO is not set
491# CONFIG_MYRI10GE is not set
474 492
475# 493#
476# Token Ring devices 494# Token Ring devices
@@ -548,6 +566,7 @@ CONFIG_SERIO_RAW=y
548CONFIG_VT=y 566CONFIG_VT=y
549CONFIG_VT_CONSOLE=y 567CONFIG_VT_CONSOLE=y
550CONFIG_HW_CONSOLE=y 568CONFIG_HW_CONSOLE=y
569CONFIG_VT_HW_CONSOLE_BINDING=y
551# CONFIG_SERIAL_NONSTANDARD is not set 570# CONFIG_SERIAL_NONSTANDARD is not set
552 571
553# 572#
@@ -579,6 +598,7 @@ CONFIG_LEGACY_PTY_COUNT=256
579# Watchdog Cards 598# Watchdog Cards
580# 599#
581# CONFIG_WATCHDOG is not set 600# CONFIG_WATCHDOG is not set
601# CONFIG_HW_RANDOM is not set
582# CONFIG_RTC is not set 602# CONFIG_RTC is not set
583# CONFIG_GEN_RTC is not set 603# CONFIG_GEN_RTC is not set
584# CONFIG_DTLK is not set 604# CONFIG_DTLK is not set
@@ -627,6 +647,7 @@ CONFIG_LEGACY_PTY_COUNT=256
627# Multimedia devices 647# Multimedia devices
628# 648#
629# CONFIG_VIDEO_DEV is not set 649# CONFIG_VIDEO_DEV is not set
650CONFIG_VIDEO_V4L2=y
630 651
631# 652#
632# Digital Video Broadcasting Devices 653# Digital Video Broadcasting Devices
@@ -636,6 +657,7 @@ CONFIG_LEGACY_PTY_COUNT=256
636# 657#
637# Graphics support 658# Graphics support
638# 659#
660# CONFIG_FIRMWARE_EDID is not set
639# CONFIG_FB is not set 661# CONFIG_FB is not set
640 662
641# 663#
@@ -699,6 +721,19 @@ CONFIG_USB_ARCH_HAS_EHCI=y
699# CONFIG_RTC_CLASS is not set 721# CONFIG_RTC_CLASS is not set
700 722
701# 723#
724# DMA Engine support
725#
726# CONFIG_DMA_ENGINE is not set
727
728#
729# DMA Clients
730#
731
732#
733# DMA Devices
734#
735
736#
702# File systems 737# File systems
703# 738#
704CONFIG_EXT2_FS=y 739CONFIG_EXT2_FS=y
@@ -713,6 +748,7 @@ CONFIG_EXT2_FS=y
713# CONFIG_MINIX_FS is not set 748# CONFIG_MINIX_FS is not set
714# CONFIG_ROMFS_FS is not set 749# CONFIG_ROMFS_FS is not set
715CONFIG_INOTIFY=y 750CONFIG_INOTIFY=y
751CONFIG_INOTIFY_USER=y
716# CONFIG_QUOTA is not set 752# CONFIG_QUOTA is not set
717CONFIG_DNOTIFY=y 753CONFIG_DNOTIFY=y
718# CONFIG_AUTOFS_FS is not set 754# CONFIG_AUTOFS_FS is not set
@@ -779,6 +815,7 @@ CONFIG_SUNRPC=y
779# CONFIG_RPCSEC_GSS_SPKM3 is not set 815# CONFIG_RPCSEC_GSS_SPKM3 is not set
780# CONFIG_SMB_FS is not set 816# CONFIG_SMB_FS is not set
781# CONFIG_CIFS is not set 817# CONFIG_CIFS is not set
818# CONFIG_CIFS_DEBUG2 is not set
782# CONFIG_NCP_FS is not set 819# CONFIG_NCP_FS is not set
783# CONFIG_CODA_FS is not set 820# CONFIG_CODA_FS is not set
784# CONFIG_AFS_FS is not set 821# CONFIG_AFS_FS is not set
@@ -805,6 +842,7 @@ CONFIG_MSDOS_PARTITION=y
805# 842#
806# CONFIG_PRINTK_TIME is not set 843# CONFIG_PRINTK_TIME is not set
807# CONFIG_MAGIC_SYSRQ is not set 844# CONFIG_MAGIC_SYSRQ is not set
845# CONFIG_UNUSED_SYMBOLS is not set
808# CONFIG_DEBUG_KERNEL is not set 846# CONFIG_DEBUG_KERNEL is not set
809CONFIG_LOG_BUF_SHIFT=14 847CONFIG_LOG_BUF_SHIFT=14
810# CONFIG_DEBUG_FS is not set 848# CONFIG_DEBUG_FS is not set
@@ -846,7 +884,6 @@ CONFIG_CRYPTO_ANUBIS=y
846CONFIG_CRYPTO_DEFLATE=y 884CONFIG_CRYPTO_DEFLATE=y
847CONFIG_CRYPTO_MICHAEL_MIC=y 885CONFIG_CRYPTO_MICHAEL_MIC=y
848CONFIG_CRYPTO_CRC32C=y 886CONFIG_CRYPTO_CRC32C=y
849# CONFIG_CRYPTO_TEST is not set
850 887
851# 888#
852# Hardware crypto devices 889# Hardware crypto devices
@@ -861,3 +898,4 @@ CONFIG_CRC32=y
861CONFIG_LIBCRC32C=y 898CONFIG_LIBCRC32C=y
862CONFIG_ZLIB_INFLATE=y 899CONFIG_ZLIB_INFLATE=y
863CONFIG_ZLIB_DEFLATE=y 900CONFIG_ZLIB_DEFLATE=y
901CONFIG_PLIST=y
diff --git a/arch/mips/configs/ocelot_defconfig b/arch/mips/configs/ocelot_defconfig
index 21dea9549feb..4b999102715e 100644
--- a/arch/mips/configs/ocelot_defconfig
+++ b/arch/mips/configs/ocelot_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:51:11 2006 4# Thu Jul 6 10:04:16 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37CONFIG_MOMENCO_OCELOT=y 39CONFIG_MOMENCO_OCELOT=y
@@ -45,6 +47,7 @@ CONFIG_MOMENCO_OCELOT=y
45# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -65,6 +68,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
65CONFIG_GENERIC_FIND_NEXT_BIT=y 68CONFIG_GENERIC_FIND_NEXT_BIT=y
66CONFIG_GENERIC_HWEIGHT=y 69CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 70CONFIG_GENERIC_CALIBRATE_DELAY=y
71CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
68CONFIG_DMA_NONCOHERENT=y 72CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 73CONFIG_DMA_NEED_PCI_MAP_STATE=y
70CONFIG_CPU_BIG_ENDIAN=y 74CONFIG_CPU_BIG_ENDIAN=y
@@ -119,7 +123,10 @@ CONFIG_PAGE_SIZE_4KB=y
119CONFIG_BOARD_SCACHE=y 123CONFIG_BOARD_SCACHE=y
120CONFIG_RM7000_CPU_SCACHE=y 124CONFIG_RM7000_CPU_SCACHE=y
121CONFIG_CPU_HAS_PREFETCH=y 125CONFIG_CPU_HAS_PREFETCH=y
122# CONFIG_MIPS_MT is not set 126CONFIG_MIPS_MT_DISABLED=y
127# CONFIG_MIPS_MT_SMTC is not set
128# CONFIG_MIPS_MT_SMP is not set
129# CONFIG_MIPS_VPE_LOADER is not set
123# CONFIG_64BIT_PHYS_ADDR is not set 130# CONFIG_64BIT_PHYS_ADDR is not set
124CONFIG_CPU_HAS_LLSC=y 131CONFIG_CPU_HAS_LLSC=y
125CONFIG_CPU_HAS_SYNC=y 132CONFIG_CPU_HAS_SYNC=y
@@ -135,6 +142,7 @@ CONFIG_FLATMEM=y
135CONFIG_FLAT_NODE_MEM_MAP=y 142CONFIG_FLAT_NODE_MEM_MAP=y
136# CONFIG_SPARSEMEM_STATIC is not set 143# CONFIG_SPARSEMEM_STATIC is not set
137CONFIG_SPLIT_PTLOCK_CPUS=4 144CONFIG_SPLIT_PTLOCK_CPUS=4
145# CONFIG_RESOURCES_64BIT is not set
138# CONFIG_HZ_48 is not set 146# CONFIG_HZ_48 is not set
139# CONFIG_HZ_100 is not set 147# CONFIG_HZ_100 is not set
140# CONFIG_HZ_128 is not set 148# CONFIG_HZ_128 is not set
@@ -147,6 +155,7 @@ CONFIG_HZ=1000
147CONFIG_PREEMPT_NONE=y 155CONFIG_PREEMPT_NONE=y
148# CONFIG_PREEMPT_VOLUNTARY is not set 156# CONFIG_PREEMPT_VOLUNTARY is not set
149# CONFIG_PREEMPT is not set 157# CONFIG_PREEMPT is not set
158CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
150 159
151# 160#
152# Code maturity level options 161# Code maturity level options
@@ -178,10 +187,12 @@ CONFIG_PRINTK=y
178CONFIG_BUG=y 187CONFIG_BUG=y
179CONFIG_ELF_CORE=y 188CONFIG_ELF_CORE=y
180CONFIG_BASE_FULL=y 189CONFIG_BASE_FULL=y
190CONFIG_RT_MUTEXES=y
181CONFIG_FUTEX=y 191CONFIG_FUTEX=y
182CONFIG_EPOLL=y 192CONFIG_EPOLL=y
183CONFIG_SHMEM=y 193CONFIG_SHMEM=y
184CONFIG_SLAB=y 194CONFIG_SLAB=y
195CONFIG_VM_EVENT_COUNTERS=y
185# CONFIG_TINY_SHMEM is not set 196# CONFIG_TINY_SHMEM is not set
186CONFIG_BASE_SMALL=0 197CONFIG_BASE_SMALL=0
187# CONFIG_SLOB is not set 198# CONFIG_SLOB is not set
@@ -265,6 +276,8 @@ CONFIG_IP_PNP_BOOTP=y
265# CONFIG_INET_IPCOMP is not set 276# CONFIG_INET_IPCOMP is not set
266# CONFIG_INET_XFRM_TUNNEL is not set 277# CONFIG_INET_XFRM_TUNNEL is not set
267# CONFIG_INET_TUNNEL is not set 278# CONFIG_INET_TUNNEL is not set
279CONFIG_INET_XFRM_MODE_TRANSPORT=y
280CONFIG_INET_XFRM_MODE_TUNNEL=y
268CONFIG_INET_DIAG=y 281CONFIG_INET_DIAG=y
269CONFIG_INET_TCP_DIAG=y 282CONFIG_INET_TCP_DIAG=y
270# CONFIG_TCP_CONG_ADVANCED is not set 283# CONFIG_TCP_CONG_ADVANCED is not set
@@ -272,6 +285,7 @@ CONFIG_TCP_CONG_BIC=y
272# CONFIG_IPV6 is not set 285# CONFIG_IPV6 is not set
273# CONFIG_INET6_XFRM_TUNNEL is not set 286# CONFIG_INET6_XFRM_TUNNEL is not set
274# CONFIG_INET6_TUNNEL is not set 287# CONFIG_INET6_TUNNEL is not set
288CONFIG_NETWORK_SECMARK=y
275# CONFIG_NETFILTER is not set 289# CONFIG_NETFILTER is not set
276 290
277# 291#
@@ -331,6 +345,7 @@ CONFIG_WIRELESS_EXT=y
331CONFIG_STANDALONE=y 345CONFIG_STANDALONE=y
332CONFIG_PREVENT_FIRMWARE_BUILD=y 346CONFIG_PREVENT_FIRMWARE_BUILD=y
333# CONFIG_FW_LOADER is not set 347# CONFIG_FW_LOADER is not set
348# CONFIG_SYS_HYPERVISOR is not set
334 349
335# 350#
336# Connector - unified userspace <-> kernelspace linker 351# Connector - unified userspace <-> kernelspace linker
@@ -416,6 +431,8 @@ CONFIG_DAVICOM_PHY=y
416CONFIG_QSEMI_PHY=y 431CONFIG_QSEMI_PHY=y
417CONFIG_LXT_PHY=y 432CONFIG_LXT_PHY=y
418CONFIG_CICADA_PHY=y 433CONFIG_CICADA_PHY=y
434CONFIG_VITESSE_PHY=y
435CONFIG_SMSC_PHY=y
419 436
420# 437#
421# Ethernet (10 or 100Mbit) 438# Ethernet (10 or 100Mbit)
@@ -504,6 +521,7 @@ CONFIG_SERIO_RAW=y
504CONFIG_VT=y 521CONFIG_VT=y
505CONFIG_VT_CONSOLE=y 522CONFIG_VT_CONSOLE=y
506CONFIG_HW_CONSOLE=y 523CONFIG_HW_CONSOLE=y
524CONFIG_VT_HW_CONSOLE_BINDING=y
507# CONFIG_SERIAL_NONSTANDARD is not set 525# CONFIG_SERIAL_NONSTANDARD is not set
508 526
509# 527#
@@ -533,6 +551,7 @@ CONFIG_LEGACY_PTY_COUNT=256
533# Watchdog Cards 551# Watchdog Cards
534# 552#
535# CONFIG_WATCHDOG is not set 553# CONFIG_WATCHDOG is not set
554# CONFIG_HW_RANDOM is not set
536# CONFIG_RTC is not set 555# CONFIG_RTC is not set
537# CONFIG_GEN_RTC is not set 556# CONFIG_GEN_RTC is not set
538# CONFIG_DTLK is not set 557# CONFIG_DTLK is not set
@@ -579,6 +598,7 @@ CONFIG_LEGACY_PTY_COUNT=256
579# Multimedia devices 598# Multimedia devices
580# 599#
581# CONFIG_VIDEO_DEV is not set 600# CONFIG_VIDEO_DEV is not set
601CONFIG_VIDEO_V4L2=y
582 602
583# 603#
584# Digital Video Broadcasting Devices 604# Digital Video Broadcasting Devices
@@ -588,6 +608,7 @@ CONFIG_LEGACY_PTY_COUNT=256
588# 608#
589# Graphics support 609# Graphics support
590# 610#
611# CONFIG_FIRMWARE_EDID is not set
591# CONFIG_FB is not set 612# CONFIG_FB is not set
592 613
593# 614#
@@ -649,6 +670,19 @@ CONFIG_DUMMY_CONSOLE=y
649# CONFIG_RTC_CLASS is not set 670# CONFIG_RTC_CLASS is not set
650 671
651# 672#
673# DMA Engine support
674#
675# CONFIG_DMA_ENGINE is not set
676
677#
678# DMA Clients
679#
680
681#
682# DMA Devices
683#
684
685#
652# File systems 686# File systems
653# 687#
654CONFIG_EXT2_FS=y 688CONFIG_EXT2_FS=y
@@ -663,6 +697,7 @@ CONFIG_EXT2_FS=y
663# CONFIG_MINIX_FS is not set 697# CONFIG_MINIX_FS is not set
664# CONFIG_ROMFS_FS is not set 698# CONFIG_ROMFS_FS is not set
665CONFIG_INOTIFY=y 699CONFIG_INOTIFY=y
700CONFIG_INOTIFY_USER=y
666# CONFIG_QUOTA is not set 701# CONFIG_QUOTA is not set
667CONFIG_DNOTIFY=y 702CONFIG_DNOTIFY=y
668# CONFIG_AUTOFS_FS is not set 703# CONFIG_AUTOFS_FS is not set
@@ -729,6 +764,7 @@ CONFIG_SUNRPC=y
729# CONFIG_RPCSEC_GSS_SPKM3 is not set 764# CONFIG_RPCSEC_GSS_SPKM3 is not set
730# CONFIG_SMB_FS is not set 765# CONFIG_SMB_FS is not set
731# CONFIG_CIFS is not set 766# CONFIG_CIFS is not set
767# CONFIG_CIFS_DEBUG2 is not set
732# CONFIG_NCP_FS is not set 768# CONFIG_NCP_FS is not set
733# CONFIG_CODA_FS is not set 769# CONFIG_CODA_FS is not set
734# CONFIG_AFS_FS is not set 770# CONFIG_AFS_FS is not set
@@ -755,6 +791,7 @@ CONFIG_MSDOS_PARTITION=y
755# 791#
756# CONFIG_PRINTK_TIME is not set 792# CONFIG_PRINTK_TIME is not set
757# CONFIG_MAGIC_SYSRQ is not set 793# CONFIG_MAGIC_SYSRQ is not set
794# CONFIG_UNUSED_SYMBOLS is not set
758# CONFIG_DEBUG_KERNEL is not set 795# CONFIG_DEBUG_KERNEL is not set
759CONFIG_LOG_BUF_SHIFT=14 796CONFIG_LOG_BUF_SHIFT=14
760# CONFIG_DEBUG_FS is not set 797# CONFIG_DEBUG_FS is not set
@@ -796,7 +833,6 @@ CONFIG_CRYPTO_ANUBIS=y
796CONFIG_CRYPTO_DEFLATE=y 833CONFIG_CRYPTO_DEFLATE=y
797CONFIG_CRYPTO_MICHAEL_MIC=y 834CONFIG_CRYPTO_MICHAEL_MIC=y
798CONFIG_CRYPTO_CRC32C=y 835CONFIG_CRYPTO_CRC32C=y
799# CONFIG_CRYPTO_TEST is not set
800 836
801# 837#
802# Hardware crypto devices 838# Hardware crypto devices
@@ -811,3 +847,4 @@ CONFIG_CRC32=y
811CONFIG_LIBCRC32C=y 847CONFIG_LIBCRC32C=y
812CONFIG_ZLIB_INFLATE=y 848CONFIG_ZLIB_INFLATE=y
813CONFIG_ZLIB_DEFLATE=y 849CONFIG_ZLIB_DEFLATE=y
850CONFIG_PLIST=y
diff --git a/arch/mips/configs/ocelot_g_defconfig b/arch/mips/configs/ocelot_g_defconfig
index c63b1ca8c8b3..827b344f6010 100644
--- a/arch/mips/configs/ocelot_g_defconfig
+++ b/arch/mips/configs/ocelot_g_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:51:11 2006 4# Thu Jul 6 10:04:16 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MOMENCO_OCELOT_G=y
45# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -65,6 +68,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
65CONFIG_GENERIC_FIND_NEXT_BIT=y 68CONFIG_GENERIC_FIND_NEXT_BIT=y
66CONFIG_GENERIC_HWEIGHT=y 69CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 70CONFIG_GENERIC_CALIBRATE_DELAY=y
71CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
68CONFIG_DMA_NONCOHERENT=y 72CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 73CONFIG_DMA_NEED_PCI_MAP_STATE=y
70CONFIG_CPU_BIG_ENDIAN=y 74CONFIG_CPU_BIG_ENDIAN=y
@@ -119,7 +123,10 @@ CONFIG_PAGE_SIZE_4KB=y
119CONFIG_BOARD_SCACHE=y 123CONFIG_BOARD_SCACHE=y
120CONFIG_RM7000_CPU_SCACHE=y 124CONFIG_RM7000_CPU_SCACHE=y
121CONFIG_CPU_HAS_PREFETCH=y 125CONFIG_CPU_HAS_PREFETCH=y
122# CONFIG_MIPS_MT is not set 126CONFIG_MIPS_MT_DISABLED=y
127# CONFIG_MIPS_MT_SMTC is not set
128# CONFIG_MIPS_MT_SMP is not set
129# CONFIG_MIPS_VPE_LOADER is not set
123CONFIG_CPU_HAS_LLSC=y 130CONFIG_CPU_HAS_LLSC=y
124CONFIG_CPU_HAS_SYNC=y 131CONFIG_CPU_HAS_SYNC=y
125CONFIG_GENERIC_HARDIRQS=y 132CONFIG_GENERIC_HARDIRQS=y
@@ -134,6 +141,7 @@ CONFIG_FLATMEM=y
134CONFIG_FLAT_NODE_MEM_MAP=y 141CONFIG_FLAT_NODE_MEM_MAP=y
135# CONFIG_SPARSEMEM_STATIC is not set 142# CONFIG_SPARSEMEM_STATIC is not set
136CONFIG_SPLIT_PTLOCK_CPUS=4 143CONFIG_SPLIT_PTLOCK_CPUS=4
144CONFIG_RESOURCES_64BIT=y
137# CONFIG_HZ_48 is not set 145# CONFIG_HZ_48 is not set
138# CONFIG_HZ_100 is not set 146# CONFIG_HZ_100 is not set
139# CONFIG_HZ_128 is not set 147# CONFIG_HZ_128 is not set
@@ -146,6 +154,7 @@ CONFIG_HZ=1000
146CONFIG_PREEMPT_NONE=y 154CONFIG_PREEMPT_NONE=y
147# CONFIG_PREEMPT_VOLUNTARY is not set 155# CONFIG_PREEMPT_VOLUNTARY is not set
148# CONFIG_PREEMPT is not set 156# CONFIG_PREEMPT is not set
157CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
149 158
150# 159#
151# Code maturity level options 160# Code maturity level options
@@ -177,10 +186,12 @@ CONFIG_PRINTK=y
177CONFIG_BUG=y 186CONFIG_BUG=y
178CONFIG_ELF_CORE=y 187CONFIG_ELF_CORE=y
179CONFIG_BASE_FULL=y 188CONFIG_BASE_FULL=y
189CONFIG_RT_MUTEXES=y
180CONFIG_FUTEX=y 190CONFIG_FUTEX=y
181CONFIG_EPOLL=y 191CONFIG_EPOLL=y
182CONFIG_SHMEM=y 192CONFIG_SHMEM=y
183CONFIG_SLAB=y 193CONFIG_SLAB=y
194CONFIG_VM_EVENT_COUNTERS=y
184# CONFIG_TINY_SHMEM is not set 195# CONFIG_TINY_SHMEM is not set
185CONFIG_BASE_SMALL=0 196CONFIG_BASE_SMALL=0
186# CONFIG_SLOB is not set 197# CONFIG_SLOB is not set
@@ -268,6 +279,8 @@ CONFIG_IP_PNP_DHCP=y
268# CONFIG_INET_IPCOMP is not set 279# CONFIG_INET_IPCOMP is not set
269# CONFIG_INET_XFRM_TUNNEL is not set 280# CONFIG_INET_XFRM_TUNNEL is not set
270# CONFIG_INET_TUNNEL is not set 281# CONFIG_INET_TUNNEL is not set
282CONFIG_INET_XFRM_MODE_TRANSPORT=y
283CONFIG_INET_XFRM_MODE_TUNNEL=y
271CONFIG_INET_DIAG=y 284CONFIG_INET_DIAG=y
272CONFIG_INET_TCP_DIAG=y 285CONFIG_INET_TCP_DIAG=y
273# CONFIG_TCP_CONG_ADVANCED is not set 286# CONFIG_TCP_CONG_ADVANCED is not set
@@ -275,6 +288,7 @@ CONFIG_TCP_CONG_BIC=y
275# CONFIG_IPV6 is not set 288# CONFIG_IPV6 is not set
276# CONFIG_INET6_XFRM_TUNNEL is not set 289# CONFIG_INET6_XFRM_TUNNEL is not set
277# CONFIG_INET6_TUNNEL is not set 290# CONFIG_INET6_TUNNEL is not set
291CONFIG_NETWORK_SECMARK=y
278# CONFIG_NETFILTER is not set 292# CONFIG_NETFILTER is not set
279 293
280# 294#
@@ -334,6 +348,7 @@ CONFIG_WIRELESS_EXT=y
334CONFIG_STANDALONE=y 348CONFIG_STANDALONE=y
335CONFIG_PREVENT_FIRMWARE_BUILD=y 349CONFIG_PREVENT_FIRMWARE_BUILD=y
336CONFIG_FW_LOADER=y 350CONFIG_FW_LOADER=y
351# CONFIG_SYS_HYPERVISOR is not set
337 352
338# 353#
339# Connector - unified userspace <-> kernelspace linker 354# Connector - unified userspace <-> kernelspace linker
@@ -431,6 +446,8 @@ CONFIG_DAVICOM_PHY=y
431CONFIG_QSEMI_PHY=y 446CONFIG_QSEMI_PHY=y
432CONFIG_LXT_PHY=y 447CONFIG_LXT_PHY=y
433CONFIG_CICADA_PHY=y 448CONFIG_CICADA_PHY=y
449CONFIG_VITESSE_PHY=y
450CONFIG_SMSC_PHY=y
434 451
435# 452#
436# Ethernet (10 or 100Mbit) 453# Ethernet (10 or 100Mbit)
@@ -474,6 +491,7 @@ CONFIG_GALILEO_64240_ETH=y
474# CONFIG_CHELSIO_T1 is not set 491# CONFIG_CHELSIO_T1 is not set
475# CONFIG_IXGB is not set 492# CONFIG_IXGB is not set
476# CONFIG_S2IO is not set 493# CONFIG_S2IO is not set
494# CONFIG_MYRI10GE is not set
477 495
478# 496#
479# Token Ring devices 497# Token Ring devices
@@ -551,6 +569,7 @@ CONFIG_SERIO_RAW=y
551CONFIG_VT=y 569CONFIG_VT=y
552CONFIG_VT_CONSOLE=y 570CONFIG_VT_CONSOLE=y
553CONFIG_HW_CONSOLE=y 571CONFIG_HW_CONSOLE=y
572CONFIG_VT_HW_CONSOLE_BINDING=y
554# CONFIG_SERIAL_NONSTANDARD is not set 573# CONFIG_SERIAL_NONSTANDARD is not set
555 574
556# 575#
@@ -582,6 +601,7 @@ CONFIG_LEGACY_PTY_COUNT=256
582# Watchdog Cards 601# Watchdog Cards
583# 602#
584# CONFIG_WATCHDOG is not set 603# CONFIG_WATCHDOG is not set
604# CONFIG_HW_RANDOM is not set
585# CONFIG_RTC is not set 605# CONFIG_RTC is not set
586# CONFIG_GEN_RTC is not set 606# CONFIG_GEN_RTC is not set
587# CONFIG_DTLK is not set 607# CONFIG_DTLK is not set
@@ -630,6 +650,7 @@ CONFIG_LEGACY_PTY_COUNT=256
630# Multimedia devices 650# Multimedia devices
631# 651#
632# CONFIG_VIDEO_DEV is not set 652# CONFIG_VIDEO_DEV is not set
653CONFIG_VIDEO_V4L2=y
633 654
634# 655#
635# Digital Video Broadcasting Devices 656# Digital Video Broadcasting Devices
@@ -639,6 +660,7 @@ CONFIG_LEGACY_PTY_COUNT=256
639# 660#
640# Graphics support 661# Graphics support
641# 662#
663# CONFIG_FIRMWARE_EDID is not set
642# CONFIG_FB is not set 664# CONFIG_FB is not set
643 665
644# 666#
@@ -702,6 +724,19 @@ CONFIG_USB_ARCH_HAS_EHCI=y
702# CONFIG_RTC_CLASS is not set 724# CONFIG_RTC_CLASS is not set
703 725
704# 726#
727# DMA Engine support
728#
729# CONFIG_DMA_ENGINE is not set
730
731#
732# DMA Clients
733#
734
735#
736# DMA Devices
737#
738
739#
705# File systems 740# File systems
706# 741#
707CONFIG_EXT2_FS=y 742CONFIG_EXT2_FS=y
@@ -716,6 +751,7 @@ CONFIG_EXT2_FS=y
716# CONFIG_MINIX_FS is not set 751# CONFIG_MINIX_FS is not set
717# CONFIG_ROMFS_FS is not set 752# CONFIG_ROMFS_FS is not set
718CONFIG_INOTIFY=y 753CONFIG_INOTIFY=y
754CONFIG_INOTIFY_USER=y
719# CONFIG_QUOTA is not set 755# CONFIG_QUOTA is not set
720CONFIG_DNOTIFY=y 756CONFIG_DNOTIFY=y
721# CONFIG_AUTOFS_FS is not set 757# CONFIG_AUTOFS_FS is not set
@@ -782,6 +818,7 @@ CONFIG_SUNRPC=y
782# CONFIG_RPCSEC_GSS_SPKM3 is not set 818# CONFIG_RPCSEC_GSS_SPKM3 is not set
783# CONFIG_SMB_FS is not set 819# CONFIG_SMB_FS is not set
784# CONFIG_CIFS is not set 820# CONFIG_CIFS is not set
821# CONFIG_CIFS_DEBUG2 is not set
785# CONFIG_NCP_FS is not set 822# CONFIG_NCP_FS is not set
786# CONFIG_CODA_FS is not set 823# CONFIG_CODA_FS is not set
787# CONFIG_AFS_FS is not set 824# CONFIG_AFS_FS is not set
@@ -808,6 +845,7 @@ CONFIG_MSDOS_PARTITION=y
808# 845#
809# CONFIG_PRINTK_TIME is not set 846# CONFIG_PRINTK_TIME is not set
810# CONFIG_MAGIC_SYSRQ is not set 847# CONFIG_MAGIC_SYSRQ is not set
848# CONFIG_UNUSED_SYMBOLS is not set
811# CONFIG_DEBUG_KERNEL is not set 849# CONFIG_DEBUG_KERNEL is not set
812CONFIG_LOG_BUF_SHIFT=14 850CONFIG_LOG_BUF_SHIFT=14
813# CONFIG_DEBUG_FS is not set 851# CONFIG_DEBUG_FS is not set
@@ -849,7 +887,6 @@ CONFIG_CRYPTO_ANUBIS=y
849CONFIG_CRYPTO_DEFLATE=y 887CONFIG_CRYPTO_DEFLATE=y
850CONFIG_CRYPTO_MICHAEL_MIC=y 888CONFIG_CRYPTO_MICHAEL_MIC=y
851CONFIG_CRYPTO_CRC32C=y 889CONFIG_CRYPTO_CRC32C=y
852# CONFIG_CRYPTO_TEST is not set
853 890
854# 891#
855# Hardware crypto devices 892# Hardware crypto devices
@@ -864,3 +901,4 @@ CONFIG_CRC32=y
864CONFIG_LIBCRC32C=y 901CONFIG_LIBCRC32C=y
865CONFIG_ZLIB_INFLATE=y 902CONFIG_ZLIB_INFLATE=y
866CONFIG_ZLIB_DEFLATE=y 903CONFIG_ZLIB_DEFLATE=y
904CONFIG_PLIST=y
diff --git a/arch/mips/configs/pb1100_defconfig b/arch/mips/configs/pb1100_defconfig
index 6f5c7261e9de..9ed60fef69e0 100644
--- a/arch/mips/configs/pb1100_defconfig
+++ b/arch/mips/configs/pb1100_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:51:12 2006 4# Thu Jul 6 10:04:17 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS_PB1100=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS_PB1100=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MIPS_PB1100=y
45# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -65,6 +68,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
65CONFIG_GENERIC_FIND_NEXT_BIT=y 68CONFIG_GENERIC_FIND_NEXT_BIT=y
66CONFIG_GENERIC_HWEIGHT=y 69CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 70CONFIG_GENERIC_CALIBRATE_DELAY=y
71CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
68CONFIG_DMA_NONCOHERENT=y 72CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 73CONFIG_DMA_NEED_PCI_MAP_STATE=y
70# CONFIG_CPU_BIG_ENDIAN is not set 74# CONFIG_CPU_BIG_ENDIAN is not set
@@ -114,7 +118,10 @@ CONFIG_PAGE_SIZE_4KB=y
114# CONFIG_PAGE_SIZE_16KB is not set 118# CONFIG_PAGE_SIZE_16KB is not set
115# CONFIG_PAGE_SIZE_64KB is not set 119# CONFIG_PAGE_SIZE_64KB is not set
116CONFIG_CPU_HAS_PREFETCH=y 120CONFIG_CPU_HAS_PREFETCH=y
117# CONFIG_MIPS_MT is not set 121CONFIG_MIPS_MT_DISABLED=y
122# CONFIG_MIPS_MT_SMTC is not set
123# CONFIG_MIPS_MT_SMP is not set
124# CONFIG_MIPS_VPE_LOADER is not set
118CONFIG_64BIT_PHYS_ADDR=y 125CONFIG_64BIT_PHYS_ADDR=y
119CONFIG_CPU_HAS_LLSC=y 126CONFIG_CPU_HAS_LLSC=y
120CONFIG_CPU_HAS_SYNC=y 127CONFIG_CPU_HAS_SYNC=y
@@ -130,6 +137,7 @@ CONFIG_FLATMEM=y
130CONFIG_FLAT_NODE_MEM_MAP=y 137CONFIG_FLAT_NODE_MEM_MAP=y
131# CONFIG_SPARSEMEM_STATIC is not set 138# CONFIG_SPARSEMEM_STATIC is not set
132CONFIG_SPLIT_PTLOCK_CPUS=4 139CONFIG_SPLIT_PTLOCK_CPUS=4
140# CONFIG_RESOURCES_64BIT is not set
133# CONFIG_HZ_48 is not set 141# CONFIG_HZ_48 is not set
134# CONFIG_HZ_100 is not set 142# CONFIG_HZ_100 is not set
135# CONFIG_HZ_128 is not set 143# CONFIG_HZ_128 is not set
@@ -142,6 +150,7 @@ CONFIG_HZ=1000
142CONFIG_PREEMPT_NONE=y 150CONFIG_PREEMPT_NONE=y
143# CONFIG_PREEMPT_VOLUNTARY is not set 151# CONFIG_PREEMPT_VOLUNTARY is not set
144# CONFIG_PREEMPT is not set 152# CONFIG_PREEMPT is not set
153CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
145 154
146# 155#
147# Code maturity level options 156# Code maturity level options
@@ -173,14 +182,15 @@ CONFIG_PRINTK=y
173CONFIG_BUG=y 182CONFIG_BUG=y
174CONFIG_ELF_CORE=y 183CONFIG_ELF_CORE=y
175CONFIG_BASE_FULL=y 184CONFIG_BASE_FULL=y
185CONFIG_RT_MUTEXES=y
176CONFIG_FUTEX=y 186CONFIG_FUTEX=y
177CONFIG_EPOLL=y 187CONFIG_EPOLL=y
178CONFIG_SHMEM=y 188CONFIG_SHMEM=y
179CONFIG_SLAB=y 189CONFIG_SLAB=y
190CONFIG_VM_EVENT_COUNTERS=y
180# CONFIG_TINY_SHMEM is not set 191# CONFIG_TINY_SHMEM is not set
181CONFIG_BASE_SMALL=0 192CONFIG_BASE_SMALL=0
182# CONFIG_SLOB is not set 193# CONFIG_SLOB is not set
183CONFIG_OBSOLETE_INTERMODULE=y
184 194
185# 195#
186# Loadable module support 196# Loadable module support
@@ -278,6 +288,8 @@ CONFIG_IP_PNP_BOOTP=y
278# CONFIG_INET_IPCOMP is not set 288# CONFIG_INET_IPCOMP is not set
279# CONFIG_INET_XFRM_TUNNEL is not set 289# CONFIG_INET_XFRM_TUNNEL is not set
280# CONFIG_INET_TUNNEL is not set 290# CONFIG_INET_TUNNEL is not set
291CONFIG_INET_XFRM_MODE_TRANSPORT=m
292CONFIG_INET_XFRM_MODE_TUNNEL=m
281CONFIG_INET_DIAG=y 293CONFIG_INET_DIAG=y
282CONFIG_INET_TCP_DIAG=y 294CONFIG_INET_TCP_DIAG=y
283# CONFIG_TCP_CONG_ADVANCED is not set 295# CONFIG_TCP_CONG_ADVANCED is not set
@@ -290,6 +302,7 @@ CONFIG_TCP_CONG_BIC=y
290# CONFIG_IPV6 is not set 302# CONFIG_IPV6 is not set
291# CONFIG_INET6_XFRM_TUNNEL is not set 303# CONFIG_INET6_XFRM_TUNNEL is not set
292# CONFIG_INET6_TUNNEL is not set 304# CONFIG_INET6_TUNNEL is not set
305CONFIG_NETWORK_SECMARK=y
293CONFIG_NETFILTER=y 306CONFIG_NETFILTER=y
294# CONFIG_NETFILTER_DEBUG is not set 307# CONFIG_NETFILTER_DEBUG is not set
295 308
@@ -304,6 +317,7 @@ CONFIG_NETFILTER_XTABLES=m
304CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m 317CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
305CONFIG_NETFILTER_XT_TARGET_MARK=m 318CONFIG_NETFILTER_XT_TARGET_MARK=m
306CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m 319CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
320CONFIG_NETFILTER_XT_TARGET_SECMARK=m
307CONFIG_NETFILTER_XT_MATCH_COMMENT=m 321CONFIG_NETFILTER_XT_MATCH_COMMENT=m
308CONFIG_NETFILTER_XT_MATCH_DCCP=m 322CONFIG_NETFILTER_XT_MATCH_DCCP=m
309CONFIG_NETFILTER_XT_MATCH_ESP=m 323CONFIG_NETFILTER_XT_MATCH_ESP=m
@@ -314,8 +328,10 @@ CONFIG_NETFILTER_XT_MATCH_MARK=m
314CONFIG_NETFILTER_XT_MATCH_POLICY=m 328CONFIG_NETFILTER_XT_MATCH_POLICY=m
315CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m 329CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
316CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 330CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
331CONFIG_NETFILTER_XT_MATCH_QUOTA=m
317CONFIG_NETFILTER_XT_MATCH_REALM=m 332CONFIG_NETFILTER_XT_MATCH_REALM=m
318CONFIG_NETFILTER_XT_MATCH_SCTP=m 333CONFIG_NETFILTER_XT_MATCH_SCTP=m
334CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
319CONFIG_NETFILTER_XT_MATCH_STRING=m 335CONFIG_NETFILTER_XT_MATCH_STRING=m
320CONFIG_NETFILTER_XT_MATCH_TCPMSS=m 336CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
321 337
@@ -385,6 +401,7 @@ CONFIG_WIRELESS_EXT=y
385CONFIG_STANDALONE=y 401CONFIG_STANDALONE=y
386CONFIG_PREVENT_FIRMWARE_BUILD=y 402CONFIG_PREVENT_FIRMWARE_BUILD=y
387CONFIG_FW_LOADER=m 403CONFIG_FW_LOADER=m
404# CONFIG_SYS_HYPERVISOR is not set
388 405
389# 406#
390# Connector - unified userspace <-> kernelspace linker 407# Connector - unified userspace <-> kernelspace linker
@@ -544,6 +561,8 @@ CONFIG_DAVICOM_PHY=m
544CONFIG_QSEMI_PHY=m 561CONFIG_QSEMI_PHY=m
545CONFIG_LXT_PHY=m 562CONFIG_LXT_PHY=m
546CONFIG_CICADA_PHY=m 563CONFIG_CICADA_PHY=m
564CONFIG_VITESSE_PHY=m
565CONFIG_SMSC_PHY=m
547 566
548# 567#
549# Ethernet (10 or 100Mbit) 568# Ethernet (10 or 100Mbit)
@@ -647,6 +666,7 @@ CONFIG_SERIO_RAW=m
647CONFIG_VT=y 666CONFIG_VT=y
648CONFIG_VT_CONSOLE=y 667CONFIG_VT_CONSOLE=y
649CONFIG_HW_CONSOLE=y 668CONFIG_HW_CONSOLE=y
669CONFIG_VT_HW_CONSOLE_BINDING=y
650# CONFIG_SERIAL_NONSTANDARD is not set 670# CONFIG_SERIAL_NONSTANDARD is not set
651# CONFIG_AU1X00_GPIO is not set 671# CONFIG_AU1X00_GPIO is not set
652# CONFIG_TS_AU1X00_ADS7846 is not set 672# CONFIG_TS_AU1X00_ADS7846 is not set
@@ -680,6 +700,7 @@ CONFIG_LEGACY_PTY_COUNT=256
680# Watchdog Cards 700# Watchdog Cards
681# 701#
682# CONFIG_WATCHDOG is not set 702# CONFIG_WATCHDOG is not set
703# CONFIG_HW_RANDOM is not set
683# CONFIG_RTC is not set 704# CONFIG_RTC is not set
684# CONFIG_GEN_RTC is not set 705# CONFIG_GEN_RTC is not set
685# CONFIG_DTLK is not set 706# CONFIG_DTLK is not set
@@ -733,6 +754,7 @@ CONFIG_SYNCLINK_CS=m
733# Multimedia devices 754# Multimedia devices
734# 755#
735# CONFIG_VIDEO_DEV is not set 756# CONFIG_VIDEO_DEV is not set
757CONFIG_VIDEO_V4L2=y
736 758
737# 759#
738# Digital Video Broadcasting Devices 760# Digital Video Broadcasting Devices
@@ -742,6 +764,7 @@ CONFIG_SYNCLINK_CS=m
742# 764#
743# Graphics support 765# Graphics support
744# 766#
767# CONFIG_FIRMWARE_EDID is not set
745# CONFIG_FB is not set 768# CONFIG_FB is not set
746 769
747# 770#
@@ -804,6 +827,19 @@ CONFIG_USB_ARCH_HAS_OHCI=y
804# CONFIG_RTC_CLASS is not set 827# CONFIG_RTC_CLASS is not set
805 828
806# 829#
830# DMA Engine support
831#
832# CONFIG_DMA_ENGINE is not set
833
834#
835# DMA Clients
836#
837
838#
839# DMA Devices
840#
841
842#
807# File systems 843# File systems
808# 844#
809CONFIG_EXT2_FS=y 845CONFIG_EXT2_FS=y
@@ -831,6 +867,7 @@ CONFIG_FS_POSIX_ACL=y
831# CONFIG_MINIX_FS is not set 867# CONFIG_MINIX_FS is not set
832# CONFIG_ROMFS_FS is not set 868# CONFIG_ROMFS_FS is not set
833CONFIG_INOTIFY=y 869CONFIG_INOTIFY=y
870CONFIG_INOTIFY_USER=y
834# CONFIG_QUOTA is not set 871# CONFIG_QUOTA is not set
835CONFIG_DNOTIFY=y 872CONFIG_DNOTIFY=y
836CONFIG_AUTOFS_FS=m 873CONFIG_AUTOFS_FS=m
@@ -900,6 +937,7 @@ CONFIG_SUNRPC=y
900CONFIG_SMB_FS=m 937CONFIG_SMB_FS=m
901# CONFIG_SMB_NLS_DEFAULT is not set 938# CONFIG_SMB_NLS_DEFAULT is not set
902# CONFIG_CIFS is not set 939# CONFIG_CIFS is not set
940# CONFIG_CIFS_DEBUG2 is not set
903# CONFIG_NCP_FS is not set 941# CONFIG_NCP_FS is not set
904# CONFIG_CODA_FS is not set 942# CONFIG_CODA_FS is not set
905# CONFIG_AFS_FS is not set 943# CONFIG_AFS_FS is not set
@@ -965,6 +1003,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
965# 1003#
966# CONFIG_PRINTK_TIME is not set 1004# CONFIG_PRINTK_TIME is not set
967# CONFIG_MAGIC_SYSRQ is not set 1005# CONFIG_MAGIC_SYSRQ is not set
1006# CONFIG_UNUSED_SYMBOLS is not set
968# CONFIG_DEBUG_KERNEL is not set 1007# CONFIG_DEBUG_KERNEL is not set
969CONFIG_LOG_BUF_SHIFT=14 1008CONFIG_LOG_BUF_SHIFT=14
970# CONFIG_DEBUG_FS is not set 1009# CONFIG_DEBUG_FS is not set
@@ -1024,3 +1063,4 @@ CONFIG_TEXTSEARCH=y
1024CONFIG_TEXTSEARCH_KMP=m 1063CONFIG_TEXTSEARCH_KMP=m
1025CONFIG_TEXTSEARCH_BM=m 1064CONFIG_TEXTSEARCH_BM=m
1026CONFIG_TEXTSEARCH_FSM=m 1065CONFIG_TEXTSEARCH_FSM=m
1066CONFIG_PLIST=y
diff --git a/arch/mips/configs/pb1500_defconfig b/arch/mips/configs/pb1500_defconfig
index 5676f3747fd5..6774254b1be6 100644
--- a/arch/mips/configs/pb1500_defconfig
+++ b/arch/mips/configs/pb1500_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:51:13 2006 4# Thu Jul 6 10:04:17 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS_PB1500=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS_PB1500=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MIPS_PB1500=y
45# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -65,6 +68,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
65CONFIG_GENERIC_FIND_NEXT_BIT=y 68CONFIG_GENERIC_FIND_NEXT_BIT=y
66CONFIG_GENERIC_HWEIGHT=y 69CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 70CONFIG_GENERIC_CALIBRATE_DELAY=y
71CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
68CONFIG_DMA_NONCOHERENT=y 72CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 73CONFIG_DMA_NEED_PCI_MAP_STATE=y
70# CONFIG_CPU_BIG_ENDIAN is not set 74# CONFIG_CPU_BIG_ENDIAN is not set
@@ -113,7 +117,10 @@ CONFIG_PAGE_SIZE_4KB=y
113# CONFIG_PAGE_SIZE_16KB is not set 117# CONFIG_PAGE_SIZE_16KB is not set
114# CONFIG_PAGE_SIZE_64KB is not set 118# CONFIG_PAGE_SIZE_64KB is not set
115CONFIG_CPU_HAS_PREFETCH=y 119CONFIG_CPU_HAS_PREFETCH=y
116# CONFIG_MIPS_MT is not set 120CONFIG_MIPS_MT_DISABLED=y
121# CONFIG_MIPS_MT_SMTC is not set
122# CONFIG_MIPS_MT_SMP is not set
123# CONFIG_MIPS_VPE_LOADER is not set
117CONFIG_64BIT_PHYS_ADDR=y 124CONFIG_64BIT_PHYS_ADDR=y
118CONFIG_CPU_HAS_LLSC=y 125CONFIG_CPU_HAS_LLSC=y
119CONFIG_CPU_HAS_SYNC=y 126CONFIG_CPU_HAS_SYNC=y
@@ -129,6 +136,7 @@ CONFIG_FLATMEM=y
129CONFIG_FLAT_NODE_MEM_MAP=y 136CONFIG_FLAT_NODE_MEM_MAP=y
130# CONFIG_SPARSEMEM_STATIC is not set 137# CONFIG_SPARSEMEM_STATIC is not set
131CONFIG_SPLIT_PTLOCK_CPUS=4 138CONFIG_SPLIT_PTLOCK_CPUS=4
139# CONFIG_RESOURCES_64BIT is not set
132# CONFIG_HZ_48 is not set 140# CONFIG_HZ_48 is not set
133# CONFIG_HZ_100 is not set 141# CONFIG_HZ_100 is not set
134# CONFIG_HZ_128 is not set 142# CONFIG_HZ_128 is not set
@@ -141,6 +149,7 @@ CONFIG_HZ=1000
141CONFIG_PREEMPT_NONE=y 149CONFIG_PREEMPT_NONE=y
142# CONFIG_PREEMPT_VOLUNTARY is not set 150# CONFIG_PREEMPT_VOLUNTARY is not set
143# CONFIG_PREEMPT is not set 151# CONFIG_PREEMPT is not set
152CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
144 153
145# 154#
146# Code maturity level options 155# Code maturity level options
@@ -172,14 +181,15 @@ CONFIG_PRINTK=y
172CONFIG_BUG=y 181CONFIG_BUG=y
173CONFIG_ELF_CORE=y 182CONFIG_ELF_CORE=y
174CONFIG_BASE_FULL=y 183CONFIG_BASE_FULL=y
184CONFIG_RT_MUTEXES=y
175CONFIG_FUTEX=y 185CONFIG_FUTEX=y
176CONFIG_EPOLL=y 186CONFIG_EPOLL=y
177CONFIG_SHMEM=y 187CONFIG_SHMEM=y
178CONFIG_SLAB=y 188CONFIG_SLAB=y
189CONFIG_VM_EVENT_COUNTERS=y
179# CONFIG_TINY_SHMEM is not set 190# CONFIG_TINY_SHMEM is not set
180CONFIG_BASE_SMALL=0 191CONFIG_BASE_SMALL=0
181# CONFIG_SLOB is not set 192# CONFIG_SLOB is not set
182CONFIG_OBSOLETE_INTERMODULE=y
183 193
184# 194#
185# Loadable module support 195# Loadable module support
@@ -283,6 +293,8 @@ CONFIG_IP_PNP_BOOTP=y
283# CONFIG_INET_IPCOMP is not set 293# CONFIG_INET_IPCOMP is not set
284# CONFIG_INET_XFRM_TUNNEL is not set 294# CONFIG_INET_XFRM_TUNNEL is not set
285# CONFIG_INET_TUNNEL is not set 295# CONFIG_INET_TUNNEL is not set
296CONFIG_INET_XFRM_MODE_TRANSPORT=m
297CONFIG_INET_XFRM_MODE_TUNNEL=m
286CONFIG_INET_DIAG=y 298CONFIG_INET_DIAG=y
287CONFIG_INET_TCP_DIAG=y 299CONFIG_INET_TCP_DIAG=y
288# CONFIG_TCP_CONG_ADVANCED is not set 300# CONFIG_TCP_CONG_ADVANCED is not set
@@ -295,6 +307,7 @@ CONFIG_TCP_CONG_BIC=y
295# CONFIG_IPV6 is not set 307# CONFIG_IPV6 is not set
296# CONFIG_INET6_XFRM_TUNNEL is not set 308# CONFIG_INET6_XFRM_TUNNEL is not set
297# CONFIG_INET6_TUNNEL is not set 309# CONFIG_INET6_TUNNEL is not set
310CONFIG_NETWORK_SECMARK=y
298CONFIG_NETFILTER=y 311CONFIG_NETFILTER=y
299# CONFIG_NETFILTER_DEBUG is not set 312# CONFIG_NETFILTER_DEBUG is not set
300 313
@@ -309,6 +322,7 @@ CONFIG_NETFILTER_XTABLES=m
309CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m 322CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
310CONFIG_NETFILTER_XT_TARGET_MARK=m 323CONFIG_NETFILTER_XT_TARGET_MARK=m
311CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m 324CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
325CONFIG_NETFILTER_XT_TARGET_SECMARK=m
312CONFIG_NETFILTER_XT_MATCH_COMMENT=m 326CONFIG_NETFILTER_XT_MATCH_COMMENT=m
313CONFIG_NETFILTER_XT_MATCH_DCCP=m 327CONFIG_NETFILTER_XT_MATCH_DCCP=m
314CONFIG_NETFILTER_XT_MATCH_ESP=m 328CONFIG_NETFILTER_XT_MATCH_ESP=m
@@ -319,8 +333,10 @@ CONFIG_NETFILTER_XT_MATCH_MARK=m
319CONFIG_NETFILTER_XT_MATCH_POLICY=m 333CONFIG_NETFILTER_XT_MATCH_POLICY=m
320CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m 334CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
321CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 335CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
336CONFIG_NETFILTER_XT_MATCH_QUOTA=m
322CONFIG_NETFILTER_XT_MATCH_REALM=m 337CONFIG_NETFILTER_XT_MATCH_REALM=m
323CONFIG_NETFILTER_XT_MATCH_SCTP=m 338CONFIG_NETFILTER_XT_MATCH_SCTP=m
339CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
324CONFIG_NETFILTER_XT_MATCH_STRING=m 340CONFIG_NETFILTER_XT_MATCH_STRING=m
325CONFIG_NETFILTER_XT_MATCH_TCPMSS=m 341CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
326 342
@@ -390,6 +406,7 @@ CONFIG_WIRELESS_EXT=y
390CONFIG_STANDALONE=y 406CONFIG_STANDALONE=y
391CONFIG_PREVENT_FIRMWARE_BUILD=y 407CONFIG_PREVENT_FIRMWARE_BUILD=y
392CONFIG_FW_LOADER=m 408CONFIG_FW_LOADER=m
409# CONFIG_SYS_HYPERVISOR is not set
393 410
394# 411#
395# Connector - unified userspace <-> kernelspace linker 412# Connector - unified userspace <-> kernelspace linker
@@ -604,7 +621,7 @@ CONFIG_NETDEVICES=y
604# 621#
605# PHY device support 622# PHY device support
606# 623#
607CONFIG_PHYLIB=m 624CONFIG_PHYLIB=y
608 625
609# 626#
610# MII PHY device drivers 627# MII PHY device drivers
@@ -614,6 +631,8 @@ CONFIG_DAVICOM_PHY=m
614CONFIG_QSEMI_PHY=m 631CONFIG_QSEMI_PHY=m
615CONFIG_LXT_PHY=m 632CONFIG_LXT_PHY=m
616CONFIG_CICADA_PHY=m 633CONFIG_CICADA_PHY=m
634CONFIG_VITESSE_PHY=m
635CONFIG_SMSC_PHY=m
617 636
618# 637#
619# Ethernet (10 or 100Mbit) 638# Ethernet (10 or 100Mbit)
@@ -658,6 +677,7 @@ CONFIG_MIPS_AU1X00_ENET=y
658# CONFIG_CHELSIO_T1 is not set 677# CONFIG_CHELSIO_T1 is not set
659# CONFIG_IXGB is not set 678# CONFIG_IXGB is not set
660# CONFIG_S2IO is not set 679# CONFIG_S2IO is not set
680# CONFIG_MYRI10GE is not set
661 681
662# 682#
663# Token Ring devices 683# Token Ring devices
@@ -789,6 +809,7 @@ CONFIG_LEGACY_PTY_COUNT=256
789# Watchdog Cards 809# Watchdog Cards
790# 810#
791# CONFIG_WATCHDOG is not set 811# CONFIG_WATCHDOG is not set
812# CONFIG_HW_RANDOM is not set
792# CONFIG_RTC is not set 813# CONFIG_RTC is not set
793# CONFIG_GEN_RTC is not set 814# CONFIG_GEN_RTC is not set
794# CONFIG_DTLK is not set 815# CONFIG_DTLK is not set
@@ -844,6 +865,7 @@ CONFIG_SYNCLINK_CS=m
844# Multimedia devices 865# Multimedia devices
845# 866#
846# CONFIG_VIDEO_DEV is not set 867# CONFIG_VIDEO_DEV is not set
868CONFIG_VIDEO_V4L2=y
847 869
848# 870#
849# Digital Video Broadcasting Devices 871# Digital Video Broadcasting Devices
@@ -853,6 +875,7 @@ CONFIG_SYNCLINK_CS=m
853# 875#
854# Graphics support 876# Graphics support
855# 877#
878# CONFIG_FIRMWARE_EDID is not set
856# CONFIG_FB is not set 879# CONFIG_FB is not set
857 880
858# 881#
@@ -910,6 +933,19 @@ CONFIG_USB_ARCH_HAS_EHCI=y
910# CONFIG_RTC_CLASS is not set 933# CONFIG_RTC_CLASS is not set
911 934
912# 935#
936# DMA Engine support
937#
938# CONFIG_DMA_ENGINE is not set
939
940#
941# DMA Clients
942#
943
944#
945# DMA Devices
946#
947
948#
913# File systems 949# File systems
914# 950#
915CONFIG_EXT2_FS=y 951CONFIG_EXT2_FS=y
@@ -937,6 +973,7 @@ CONFIG_FS_POSIX_ACL=y
937# CONFIG_MINIX_FS is not set 973# CONFIG_MINIX_FS is not set
938# CONFIG_ROMFS_FS is not set 974# CONFIG_ROMFS_FS is not set
939CONFIG_INOTIFY=y 975CONFIG_INOTIFY=y
976CONFIG_INOTIFY_USER=y
940# CONFIG_QUOTA is not set 977# CONFIG_QUOTA is not set
941CONFIG_DNOTIFY=y 978CONFIG_DNOTIFY=y
942CONFIG_AUTOFS_FS=m 979CONFIG_AUTOFS_FS=m
@@ -1006,6 +1043,7 @@ CONFIG_SUNRPC=y
1006CONFIG_SMB_FS=m 1043CONFIG_SMB_FS=m
1007# CONFIG_SMB_NLS_DEFAULT is not set 1044# CONFIG_SMB_NLS_DEFAULT is not set
1008# CONFIG_CIFS is not set 1045# CONFIG_CIFS is not set
1046# CONFIG_CIFS_DEBUG2 is not set
1009# CONFIG_NCP_FS is not set 1047# CONFIG_NCP_FS is not set
1010# CONFIG_CODA_FS is not set 1048# CONFIG_CODA_FS is not set
1011# CONFIG_AFS_FS is not set 1049# CONFIG_AFS_FS is not set
@@ -1071,6 +1109,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1071# 1109#
1072# CONFIG_PRINTK_TIME is not set 1110# CONFIG_PRINTK_TIME is not set
1073# CONFIG_MAGIC_SYSRQ is not set 1111# CONFIG_MAGIC_SYSRQ is not set
1112# CONFIG_UNUSED_SYMBOLS is not set
1074# CONFIG_DEBUG_KERNEL is not set 1113# CONFIG_DEBUG_KERNEL is not set
1075CONFIG_LOG_BUF_SHIFT=14 1114CONFIG_LOG_BUF_SHIFT=14
1076# CONFIG_DEBUG_FS is not set 1115# CONFIG_DEBUG_FS is not set
@@ -1130,3 +1169,4 @@ CONFIG_TEXTSEARCH=y
1130CONFIG_TEXTSEARCH_KMP=m 1169CONFIG_TEXTSEARCH_KMP=m
1131CONFIG_TEXTSEARCH_BM=m 1170CONFIG_TEXTSEARCH_BM=m
1132CONFIG_TEXTSEARCH_FSM=m 1171CONFIG_TEXTSEARCH_FSM=m
1172CONFIG_PLIST=y
diff --git a/arch/mips/configs/pb1550_defconfig b/arch/mips/configs/pb1550_defconfig
index a1c479fa613b..1afe5bf6e765 100644
--- a/arch/mips/configs/pb1550_defconfig
+++ b/arch/mips/configs/pb1550_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:51:13 2006 4# Thu Jul 6 10:04:17 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS_PB1550=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS_PB1550=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MIPS_PB1550=y
45# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -65,6 +68,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
65CONFIG_GENERIC_FIND_NEXT_BIT=y 68CONFIG_GENERIC_FIND_NEXT_BIT=y
66CONFIG_GENERIC_HWEIGHT=y 69CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 70CONFIG_GENERIC_CALIBRATE_DELAY=y
71CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
68CONFIG_DMA_NONCOHERENT=y 72CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 73CONFIG_DMA_NEED_PCI_MAP_STATE=y
70CONFIG_MIPS_DISABLE_OBSOLETE_IDE=y 74CONFIG_MIPS_DISABLE_OBSOLETE_IDE=y
@@ -113,7 +117,10 @@ CONFIG_PAGE_SIZE_4KB=y
113# CONFIG_PAGE_SIZE_16KB is not set 117# CONFIG_PAGE_SIZE_16KB is not set
114# CONFIG_PAGE_SIZE_64KB is not set 118# CONFIG_PAGE_SIZE_64KB is not set
115CONFIG_CPU_HAS_PREFETCH=y 119CONFIG_CPU_HAS_PREFETCH=y
116# CONFIG_MIPS_MT is not set 120CONFIG_MIPS_MT_DISABLED=y
121# CONFIG_MIPS_MT_SMTC is not set
122# CONFIG_MIPS_MT_SMP is not set
123# CONFIG_MIPS_VPE_LOADER is not set
117CONFIG_64BIT_PHYS_ADDR=y 124CONFIG_64BIT_PHYS_ADDR=y
118CONFIG_CPU_HAS_LLSC=y 125CONFIG_CPU_HAS_LLSC=y
119CONFIG_CPU_HAS_SYNC=y 126CONFIG_CPU_HAS_SYNC=y
@@ -129,6 +136,7 @@ CONFIG_FLATMEM=y
129CONFIG_FLAT_NODE_MEM_MAP=y 136CONFIG_FLAT_NODE_MEM_MAP=y
130# CONFIG_SPARSEMEM_STATIC is not set 137# CONFIG_SPARSEMEM_STATIC is not set
131CONFIG_SPLIT_PTLOCK_CPUS=4 138CONFIG_SPLIT_PTLOCK_CPUS=4
139# CONFIG_RESOURCES_64BIT is not set
132# CONFIG_HZ_48 is not set 140# CONFIG_HZ_48 is not set
133# CONFIG_HZ_100 is not set 141# CONFIG_HZ_100 is not set
134# CONFIG_HZ_128 is not set 142# CONFIG_HZ_128 is not set
@@ -141,6 +149,7 @@ CONFIG_HZ=1000
141CONFIG_PREEMPT_NONE=y 149CONFIG_PREEMPT_NONE=y
142# CONFIG_PREEMPT_VOLUNTARY is not set 150# CONFIG_PREEMPT_VOLUNTARY is not set
143# CONFIG_PREEMPT is not set 151# CONFIG_PREEMPT is not set
152CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
144 153
145# 154#
146# Code maturity level options 155# Code maturity level options
@@ -172,14 +181,15 @@ CONFIG_PRINTK=y
172CONFIG_BUG=y 181CONFIG_BUG=y
173CONFIG_ELF_CORE=y 182CONFIG_ELF_CORE=y
174CONFIG_BASE_FULL=y 183CONFIG_BASE_FULL=y
184CONFIG_RT_MUTEXES=y
175CONFIG_FUTEX=y 185CONFIG_FUTEX=y
176CONFIG_EPOLL=y 186CONFIG_EPOLL=y
177CONFIG_SHMEM=y 187CONFIG_SHMEM=y
178CONFIG_SLAB=y 188CONFIG_SLAB=y
189CONFIG_VM_EVENT_COUNTERS=y
179# CONFIG_TINY_SHMEM is not set 190# CONFIG_TINY_SHMEM is not set
180CONFIG_BASE_SMALL=0 191CONFIG_BASE_SMALL=0
181# CONFIG_SLOB is not set 192# CONFIG_SLOB is not set
182CONFIG_OBSOLETE_INTERMODULE=y
183 193
184# 194#
185# Loadable module support 195# Loadable module support
@@ -283,6 +293,8 @@ CONFIG_IP_PNP_BOOTP=y
283# CONFIG_INET_IPCOMP is not set 293# CONFIG_INET_IPCOMP is not set
284# CONFIG_INET_XFRM_TUNNEL is not set 294# CONFIG_INET_XFRM_TUNNEL is not set
285# CONFIG_INET_TUNNEL is not set 295# CONFIG_INET_TUNNEL is not set
296CONFIG_INET_XFRM_MODE_TRANSPORT=m
297CONFIG_INET_XFRM_MODE_TUNNEL=m
286CONFIG_INET_DIAG=y 298CONFIG_INET_DIAG=y
287CONFIG_INET_TCP_DIAG=y 299CONFIG_INET_TCP_DIAG=y
288# CONFIG_TCP_CONG_ADVANCED is not set 300# CONFIG_TCP_CONG_ADVANCED is not set
@@ -295,6 +307,7 @@ CONFIG_TCP_CONG_BIC=y
295# CONFIG_IPV6 is not set 307# CONFIG_IPV6 is not set
296# CONFIG_INET6_XFRM_TUNNEL is not set 308# CONFIG_INET6_XFRM_TUNNEL is not set
297# CONFIG_INET6_TUNNEL is not set 309# CONFIG_INET6_TUNNEL is not set
310CONFIG_NETWORK_SECMARK=y
298CONFIG_NETFILTER=y 311CONFIG_NETFILTER=y
299# CONFIG_NETFILTER_DEBUG is not set 312# CONFIG_NETFILTER_DEBUG is not set
300 313
@@ -309,6 +322,7 @@ CONFIG_NETFILTER_XTABLES=m
309CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m 322CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
310CONFIG_NETFILTER_XT_TARGET_MARK=m 323CONFIG_NETFILTER_XT_TARGET_MARK=m
311CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m 324CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
325CONFIG_NETFILTER_XT_TARGET_SECMARK=m
312CONFIG_NETFILTER_XT_MATCH_COMMENT=m 326CONFIG_NETFILTER_XT_MATCH_COMMENT=m
313CONFIG_NETFILTER_XT_MATCH_DCCP=m 327CONFIG_NETFILTER_XT_MATCH_DCCP=m
314CONFIG_NETFILTER_XT_MATCH_ESP=m 328CONFIG_NETFILTER_XT_MATCH_ESP=m
@@ -319,8 +333,10 @@ CONFIG_NETFILTER_XT_MATCH_MARK=m
319CONFIG_NETFILTER_XT_MATCH_POLICY=m 333CONFIG_NETFILTER_XT_MATCH_POLICY=m
320CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m 334CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
321CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 335CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
336CONFIG_NETFILTER_XT_MATCH_QUOTA=m
322CONFIG_NETFILTER_XT_MATCH_REALM=m 337CONFIG_NETFILTER_XT_MATCH_REALM=m
323CONFIG_NETFILTER_XT_MATCH_SCTP=m 338CONFIG_NETFILTER_XT_MATCH_SCTP=m
339CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
324CONFIG_NETFILTER_XT_MATCH_STRING=m 340CONFIG_NETFILTER_XT_MATCH_STRING=m
325CONFIG_NETFILTER_XT_MATCH_TCPMSS=m 341CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
326 342
@@ -390,6 +406,7 @@ CONFIG_WIRELESS_EXT=y
390CONFIG_STANDALONE=y 406CONFIG_STANDALONE=y
391CONFIG_PREVENT_FIRMWARE_BUILD=y 407CONFIG_PREVENT_FIRMWARE_BUILD=y
392CONFIG_FW_LOADER=m 408CONFIG_FW_LOADER=m
409# CONFIG_SYS_HYPERVISOR is not set
393 410
394# 411#
395# Connector - unified userspace <-> kernelspace linker 412# Connector - unified userspace <-> kernelspace linker
@@ -604,7 +621,7 @@ CONFIG_NETDEVICES=y
604# 621#
605# PHY device support 622# PHY device support
606# 623#
607CONFIG_PHYLIB=m 624CONFIG_PHYLIB=y
608 625
609# 626#
610# MII PHY device drivers 627# MII PHY device drivers
@@ -614,6 +631,8 @@ CONFIG_DAVICOM_PHY=m
614CONFIG_QSEMI_PHY=m 631CONFIG_QSEMI_PHY=m
615CONFIG_LXT_PHY=m 632CONFIG_LXT_PHY=m
616CONFIG_CICADA_PHY=m 633CONFIG_CICADA_PHY=m
634CONFIG_VITESSE_PHY=m
635CONFIG_SMSC_PHY=m
617 636
618# 637#
619# Ethernet (10 or 100Mbit) 638# Ethernet (10 or 100Mbit)
@@ -658,6 +677,7 @@ CONFIG_MIPS_AU1X00_ENET=y
658# CONFIG_CHELSIO_T1 is not set 677# CONFIG_CHELSIO_T1 is not set
659# CONFIG_IXGB is not set 678# CONFIG_IXGB is not set
660# CONFIG_S2IO is not set 679# CONFIG_S2IO is not set
680# CONFIG_MYRI10GE is not set
661 681
662# 682#
663# Token Ring devices 683# Token Ring devices
@@ -781,6 +801,7 @@ CONFIG_LEGACY_PTY_COUNT=256
781# Watchdog Cards 801# Watchdog Cards
782# 802#
783# CONFIG_WATCHDOG is not set 803# CONFIG_WATCHDOG is not set
804# CONFIG_HW_RANDOM is not set
784# CONFIG_RTC is not set 805# CONFIG_RTC is not set
785# CONFIG_GEN_RTC is not set 806# CONFIG_GEN_RTC is not set
786# CONFIG_DTLK is not set 807# CONFIG_DTLK is not set
@@ -836,6 +857,7 @@ CONFIG_SYNCLINK_CS=m
836# Multimedia devices 857# Multimedia devices
837# 858#
838# CONFIG_VIDEO_DEV is not set 859# CONFIG_VIDEO_DEV is not set
860CONFIG_VIDEO_V4L2=y
839 861
840# 862#
841# Digital Video Broadcasting Devices 863# Digital Video Broadcasting Devices
@@ -845,6 +867,7 @@ CONFIG_SYNCLINK_CS=m
845# 867#
846# Graphics support 868# Graphics support
847# 869#
870# CONFIG_FIRMWARE_EDID is not set
848# CONFIG_FB is not set 871# CONFIG_FB is not set
849 872
850# 873#
@@ -902,6 +925,19 @@ CONFIG_USB_ARCH_HAS_EHCI=y
902# CONFIG_RTC_CLASS is not set 925# CONFIG_RTC_CLASS is not set
903 926
904# 927#
928# DMA Engine support
929#
930# CONFIG_DMA_ENGINE is not set
931
932#
933# DMA Clients
934#
935
936#
937# DMA Devices
938#
939
940#
905# File systems 941# File systems
906# 942#
907CONFIG_EXT2_FS=y 943CONFIG_EXT2_FS=y
@@ -929,6 +965,7 @@ CONFIG_FS_POSIX_ACL=y
929# CONFIG_MINIX_FS is not set 965# CONFIG_MINIX_FS is not set
930# CONFIG_ROMFS_FS is not set 966# CONFIG_ROMFS_FS is not set
931CONFIG_INOTIFY=y 967CONFIG_INOTIFY=y
968CONFIG_INOTIFY_USER=y
932# CONFIG_QUOTA is not set 969# CONFIG_QUOTA is not set
933CONFIG_DNOTIFY=y 970CONFIG_DNOTIFY=y
934CONFIG_AUTOFS_FS=m 971CONFIG_AUTOFS_FS=m
@@ -998,6 +1035,7 @@ CONFIG_SUNRPC=y
998CONFIG_SMB_FS=m 1035CONFIG_SMB_FS=m
999# CONFIG_SMB_NLS_DEFAULT is not set 1036# CONFIG_SMB_NLS_DEFAULT is not set
1000# CONFIG_CIFS is not set 1037# CONFIG_CIFS is not set
1038# CONFIG_CIFS_DEBUG2 is not set
1001# CONFIG_NCP_FS is not set 1039# CONFIG_NCP_FS is not set
1002# CONFIG_CODA_FS is not set 1040# CONFIG_CODA_FS is not set
1003# CONFIG_AFS_FS is not set 1041# CONFIG_AFS_FS is not set
@@ -1063,6 +1101,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1063# 1101#
1064# CONFIG_PRINTK_TIME is not set 1102# CONFIG_PRINTK_TIME is not set
1065# CONFIG_MAGIC_SYSRQ is not set 1103# CONFIG_MAGIC_SYSRQ is not set
1104# CONFIG_UNUSED_SYMBOLS is not set
1066# CONFIG_DEBUG_KERNEL is not set 1105# CONFIG_DEBUG_KERNEL is not set
1067CONFIG_LOG_BUF_SHIFT=14 1106CONFIG_LOG_BUF_SHIFT=14
1068# CONFIG_DEBUG_FS is not set 1107# CONFIG_DEBUG_FS is not set
@@ -1122,3 +1161,4 @@ CONFIG_TEXTSEARCH=y
1122CONFIG_TEXTSEARCH_KMP=m 1161CONFIG_TEXTSEARCH_KMP=m
1123CONFIG_TEXTSEARCH_BM=m 1162CONFIG_TEXTSEARCH_BM=m
1124CONFIG_TEXTSEARCH_FSM=m 1163CONFIG_TEXTSEARCH_FSM=m
1164CONFIG_PLIST=y
diff --git a/arch/mips/configs/pnx8550-jbs_defconfig b/arch/mips/configs/pnx8550-jbs_defconfig
index b2d991b80309..ac616c82d348 100644
--- a/arch/mips/configs/pnx8550-jbs_defconfig
+++ b/arch/mips/configs/pnx8550-jbs_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:51:14 2006 4# Thu Jul 6 10:04:18 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -40,12 +42,13 @@ CONFIG_MIPS=y
40# CONFIG_MOMENCO_OCELOT_G is not set 42# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 43# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set 44# CONFIG_PNX8550_V2PCI is not set
43CONFIG_PNX8550_JBS=y 45# CONFIG_PNX8550_JBS is not set
44# CONFIG_DDB5477 is not set 46# CONFIG_DDB5477 is not set
45# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
48# CONFIG_SGI_IP22 is not set 50# CONFIG_MARKEINS is not set
51CONFIG_SGI_IP22=y
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
51# CONFIG_SIBYTE_BIGSUR is not set 54# CONFIG_SIBYTE_BIGSUR is not set
@@ -65,19 +68,25 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
65CONFIG_GENERIC_FIND_NEXT_BIT=y 68CONFIG_GENERIC_FIND_NEXT_BIT=y
66CONFIG_GENERIC_HWEIGHT=y 69CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 70CONFIG_GENERIC_CALIBRATE_DELAY=y
71CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
72CONFIG_ARC=y
68CONFIG_DMA_NONCOHERENT=y 73CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 74CONFIG_DMA_NEED_PCI_MAP_STATE=y
70# CONFIG_CPU_BIG_ENDIAN is not set 75CONFIG_CPU_BIG_ENDIAN=y
71CONFIG_CPU_LITTLE_ENDIAN=y 76# CONFIG_CPU_LITTLE_ENDIAN is not set
72CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y 77CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
73CONFIG_PNX8550=y 78CONFIG_IRQ_CPU=y
74CONFIG_SOC_PNX8550=y 79CONFIG_SWAP_IO_SPACE=y
80CONFIG_ARC32=y
81CONFIG_BOOT_ELF32=y
75CONFIG_MIPS_L1_CACHE_SHIFT=5 82CONFIG_MIPS_L1_CACHE_SHIFT=5
83# CONFIG_ARC_CONSOLE is not set
84CONFIG_ARC_PROMLIB=y
76 85
77# 86#
78# CPU selection 87# CPU selection
79# 88#
80CONFIG_CPU_MIPS32_R1=y 89# CONFIG_CPU_MIPS32_R1 is not set
81# CONFIG_CPU_MIPS32_R2 is not set 90# CONFIG_CPU_MIPS32_R2 is not set
82# CONFIG_CPU_MIPS64_R1 is not set 91# CONFIG_CPU_MIPS64_R1 is not set
83# CONFIG_CPU_MIPS64_R2 is not set 92# CONFIG_CPU_MIPS64_R2 is not set
@@ -85,7 +94,7 @@ CONFIG_CPU_MIPS32_R1=y
85# CONFIG_CPU_TX39XX is not set 94# CONFIG_CPU_TX39XX is not set
86# CONFIG_CPU_VR41XX is not set 95# CONFIG_CPU_VR41XX is not set
87# CONFIG_CPU_R4300 is not set 96# CONFIG_CPU_R4300 is not set
88# CONFIG_CPU_R4X00 is not set 97CONFIG_CPU_R4X00=y
89# CONFIG_CPU_TX49XX is not set 98# CONFIG_CPU_TX49XX is not set
90# CONFIG_CPU_R5000 is not set 99# CONFIG_CPU_R5000 is not set
91# CONFIG_CPU_R5432 is not set 100# CONFIG_CPU_R5432 is not set
@@ -96,11 +105,12 @@ CONFIG_CPU_MIPS32_R1=y
96# CONFIG_CPU_RM7000 is not set 105# CONFIG_CPU_RM7000 is not set
97# CONFIG_CPU_RM9000 is not set 106# CONFIG_CPU_RM9000 is not set
98# CONFIG_CPU_SB1 is not set 107# CONFIG_CPU_SB1 is not set
99CONFIG_SYS_HAS_CPU_MIPS32_R1=y 108CONFIG_SYS_HAS_CPU_R4X00=y
100CONFIG_CPU_MIPS32=y 109CONFIG_SYS_HAS_CPU_R5000=y
101CONFIG_CPU_MIPSR1=y
102CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y 110CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
111CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
103CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y 112CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
113CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
104 114
105# 115#
106# Kernel type 116# Kernel type
@@ -111,14 +121,17 @@ CONFIG_PAGE_SIZE_4KB=y
111# CONFIG_PAGE_SIZE_8KB is not set 121# CONFIG_PAGE_SIZE_8KB is not set
112# CONFIG_PAGE_SIZE_16KB is not set 122# CONFIG_PAGE_SIZE_16KB is not set
113# CONFIG_PAGE_SIZE_64KB is not set 123# CONFIG_PAGE_SIZE_64KB is not set
114CONFIG_CPU_HAS_PREFETCH=y 124CONFIG_BOARD_SCACHE=y
115# CONFIG_MIPS_MT is not set 125CONFIG_IP22_CPU_SCACHE=y
126CONFIG_MIPS_MT_DISABLED=y
127# CONFIG_MIPS_MT_SMTC is not set
128# CONFIG_MIPS_MT_SMP is not set
129# CONFIG_MIPS_VPE_LOADER is not set
116# CONFIG_64BIT_PHYS_ADDR is not set 130# CONFIG_64BIT_PHYS_ADDR is not set
117CONFIG_CPU_HAS_LLSC=y 131CONFIG_CPU_HAS_LLSC=y
118CONFIG_CPU_HAS_SYNC=y 132CONFIG_CPU_HAS_SYNC=y
119CONFIG_GENERIC_HARDIRQS=y 133CONFIG_GENERIC_HARDIRQS=y
120CONFIG_GENERIC_IRQ_PROBE=y 134CONFIG_GENERIC_IRQ_PROBE=y
121CONFIG_CPU_SUPPORTS_HIGHMEM=y
122CONFIG_ARCH_FLATMEM_ENABLE=y 135CONFIG_ARCH_FLATMEM_ENABLE=y
123CONFIG_SELECT_MEMORY_MODEL=y 136CONFIG_SELECT_MEMORY_MODEL=y
124CONFIG_FLATMEM_MANUAL=y 137CONFIG_FLATMEM_MANUAL=y
@@ -128,6 +141,7 @@ CONFIG_FLATMEM=y
128CONFIG_FLAT_NODE_MEM_MAP=y 141CONFIG_FLAT_NODE_MEM_MAP=y
129# CONFIG_SPARSEMEM_STATIC is not set 142# CONFIG_SPARSEMEM_STATIC is not set
130CONFIG_SPLIT_PTLOCK_CPUS=4 143CONFIG_SPLIT_PTLOCK_CPUS=4
144# CONFIG_RESOURCES_64BIT is not set
131# CONFIG_HZ_48 is not set 145# CONFIG_HZ_48 is not set
132# CONFIG_HZ_100 is not set 146# CONFIG_HZ_100 is not set
133# CONFIG_HZ_128 is not set 147# CONFIG_HZ_128 is not set
@@ -140,6 +154,7 @@ CONFIG_HZ=1000
140CONFIG_PREEMPT_NONE=y 154CONFIG_PREEMPT_NONE=y
141# CONFIG_PREEMPT_VOLUNTARY is not set 155# CONFIG_PREEMPT_VOLUNTARY is not set
142# CONFIG_PREEMPT is not set 156# CONFIG_PREEMPT is not set
157CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
143 158
144# 159#
145# Code maturity level options 160# Code maturity level options
@@ -173,10 +188,12 @@ CONFIG_PRINTK=y
173CONFIG_BUG=y 188CONFIG_BUG=y
174CONFIG_ELF_CORE=y 189CONFIG_ELF_CORE=y
175CONFIG_BASE_FULL=y 190CONFIG_BASE_FULL=y
191CONFIG_RT_MUTEXES=y
176CONFIG_FUTEX=y 192CONFIG_FUTEX=y
177CONFIG_EPOLL=y 193CONFIG_EPOLL=y
178CONFIG_SHMEM=y 194CONFIG_SHMEM=y
179CONFIG_SLAB=y 195CONFIG_SLAB=y
196CONFIG_VM_EVENT_COUNTERS=y
180# CONFIG_TINY_SHMEM is not set 197# CONFIG_TINY_SHMEM is not set
181CONFIG_BASE_SMALL=0 198CONFIG_BASE_SMALL=0
182# CONFIG_SLOB is not set 199# CONFIG_SLOB is not set
@@ -213,9 +230,8 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
213# 230#
214# Bus options (PCI, PCMCIA, EISA, ISA, TC) 231# Bus options (PCI, PCMCIA, EISA, ISA, TC)
215# 232#
216CONFIG_HW_HAS_PCI=y 233CONFIG_HW_HAS_EISA=y
217CONFIG_PCI=y 234# CONFIG_EISA is not set
218# CONFIG_PCI_DEBUG is not set
219CONFIG_MMU=y 235CONFIG_MMU=y
220 236
221# 237#
@@ -226,7 +242,6 @@ CONFIG_MMU=y
226# 242#
227# PCI Hotplug Support 243# PCI Hotplug Support
228# 244#
229# CONFIG_HOTPLUG_PCI is not set
230 245
231# 246#
232# Executable file formats 247# Executable file formats
@@ -247,6 +262,8 @@ CONFIG_NET=y
247CONFIG_PACKET=y 262CONFIG_PACKET=y
248# CONFIG_PACKET_MMAP is not set 263# CONFIG_PACKET_MMAP is not set
249CONFIG_UNIX=y 264CONFIG_UNIX=y
265CONFIG_XFRM=y
266# CONFIG_XFRM_USER is not set
250# CONFIG_NET_KEY is not set 267# CONFIG_NET_KEY is not set
251CONFIG_INET=y 268CONFIG_INET=y
252# CONFIG_IP_MULTICAST is not set 269# CONFIG_IP_MULTICAST is not set
@@ -265,6 +282,8 @@ CONFIG_IP_PNP_BOOTP=y
265# CONFIG_INET_IPCOMP is not set 282# CONFIG_INET_IPCOMP is not set
266# CONFIG_INET_XFRM_TUNNEL is not set 283# CONFIG_INET_XFRM_TUNNEL is not set
267# CONFIG_INET_TUNNEL is not set 284# CONFIG_INET_TUNNEL is not set
285CONFIG_INET_XFRM_MODE_TRANSPORT=m
286CONFIG_INET_XFRM_MODE_TUNNEL=m
268CONFIG_INET_DIAG=y 287CONFIG_INET_DIAG=y
269CONFIG_INET_TCP_DIAG=y 288CONFIG_INET_TCP_DIAG=y
270# CONFIG_TCP_CONG_ADVANCED is not set 289# CONFIG_TCP_CONG_ADVANCED is not set
@@ -272,6 +291,7 @@ CONFIG_TCP_CONG_BIC=y
272# CONFIG_IPV6 is not set 291# CONFIG_IPV6 is not set
273# CONFIG_INET6_XFRM_TUNNEL is not set 292# CONFIG_INET6_XFRM_TUNNEL is not set
274# CONFIG_INET6_TUNNEL is not set 293# CONFIG_INET6_TUNNEL is not set
294CONFIG_NETWORK_SECMARK=y
275# CONFIG_NETFILTER is not set 295# CONFIG_NETFILTER is not set
276 296
277# 297#
@@ -326,6 +346,7 @@ CONFIG_STANDALONE=y
326CONFIG_PREVENT_FIRMWARE_BUILD=y 346CONFIG_PREVENT_FIRMWARE_BUILD=y
327CONFIG_FW_LOADER=y 347CONFIG_FW_LOADER=y
328# CONFIG_DEBUG_DRIVER is not set 348# CONFIG_DEBUG_DRIVER is not set
349# CONFIG_SYS_HYPERVISOR is not set
329 350
330# 351#
331# Connector - unified userspace <-> kernelspace linker 352# Connector - unified userspace <-> kernelspace linker
@@ -349,16 +370,10 @@ CONFIG_FW_LOADER=y
349# 370#
350# Block devices 371# Block devices
351# 372#
352# CONFIG_BLK_CPQ_DA is not set
353# CONFIG_BLK_CPQ_CISS_DA is not set
354# CONFIG_BLK_DEV_DAC960 is not set
355# CONFIG_BLK_DEV_UMEM is not set
356# CONFIG_BLK_DEV_COW_COMMON is not set 373# CONFIG_BLK_DEV_COW_COMMON is not set
357CONFIG_BLK_DEV_LOOP=y 374CONFIG_BLK_DEV_LOOP=y
358# CONFIG_BLK_DEV_CRYPTOLOOP is not set 375# CONFIG_BLK_DEV_CRYPTOLOOP is not set
359# CONFIG_BLK_DEV_NBD is not set 376# CONFIG_BLK_DEV_NBD is not set
360# CONFIG_BLK_DEV_SX8 is not set
361# CONFIG_BLK_DEV_UB is not set
362CONFIG_BLK_DEV_RAM=y 377CONFIG_BLK_DEV_RAM=y
363CONFIG_BLK_DEV_RAM_COUNT=16 378CONFIG_BLK_DEV_RAM_COUNT=16
364CONFIG_BLK_DEV_RAM_SIZE=8192 379CONFIG_BLK_DEV_RAM_SIZE=8192
@@ -388,38 +403,8 @@ CONFIG_BLK_DEV_IDESCSI=y
388# IDE chipset support/bugfixes 403# IDE chipset support/bugfixes
389# 404#
390CONFIG_IDE_GENERIC=y 405CONFIG_IDE_GENERIC=y
391CONFIG_BLK_DEV_IDEPCI=y
392CONFIG_IDEPCI_SHARE_IRQ=y
393CONFIG_BLK_DEV_OFFBOARD=y
394CONFIG_BLK_DEV_GENERIC=y
395# CONFIG_BLK_DEV_OPTI621 is not set
396CONFIG_BLK_DEV_IDEDMA_PCI=y
397# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
398# CONFIG_IDEDMA_PCI_AUTO is not set
399# CONFIG_BLK_DEV_AEC62XX is not set
400# CONFIG_BLK_DEV_ALI15X3 is not set
401# CONFIG_BLK_DEV_AMD74XX is not set
402# CONFIG_BLK_DEV_CMD64X is not set
403# CONFIG_BLK_DEV_TRIFLEX is not set
404# CONFIG_BLK_DEV_CY82C693 is not set
405# CONFIG_BLK_DEV_CS5520 is not set
406# CONFIG_BLK_DEV_CS5530 is not set
407# CONFIG_BLK_DEV_HPT34X is not set
408CONFIG_BLK_DEV_HPT366=y
409# CONFIG_BLK_DEV_SC1200 is not set
410# CONFIG_BLK_DEV_PIIX is not set
411# CONFIG_BLK_DEV_IT821X is not set
412# CONFIG_BLK_DEV_NS87415 is not set
413# CONFIG_BLK_DEV_PDC202XX_OLD is not set
414# CONFIG_BLK_DEV_PDC202XX_NEW is not set
415# CONFIG_BLK_DEV_SVWKS is not set
416# CONFIG_BLK_DEV_SIIMAGE is not set
417# CONFIG_BLK_DEV_SLC90E66 is not set
418# CONFIG_BLK_DEV_TRM290 is not set
419# CONFIG_BLK_DEV_VIA82CXXX is not set
420# CONFIG_IDE_ARM is not set 406# CONFIG_IDE_ARM is not set
421CONFIG_BLK_DEV_IDEDMA=y 407# CONFIG_BLK_DEV_IDEDMA is not set
422# CONFIG_IDEDMA_IVB is not set
423# CONFIG_IDEDMA_AUTO is not set 408# CONFIG_IDEDMA_AUTO is not set
424# CONFIG_BLK_DEV_HD is not set 409# CONFIG_BLK_DEV_HD is not set
425 410
@@ -459,31 +444,8 @@ CONFIG_SCSI_ISCSI_ATTRS=m
459# SCSI low-level drivers 444# SCSI low-level drivers
460# 445#
461CONFIG_ISCSI_TCP=m 446CONFIG_ISCSI_TCP=m
462# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 447# CONFIG_SGIWD93_SCSI is not set
463# CONFIG_SCSI_3W_9XXX is not set
464# CONFIG_SCSI_ACARD is not set
465# CONFIG_SCSI_AACRAID is not set
466# CONFIG_SCSI_AIC7XXX is not set
467# CONFIG_SCSI_AIC7XXX_OLD is not set
468# CONFIG_SCSI_AIC79XX is not set
469# CONFIG_SCSI_DPT_I2O is not set
470# CONFIG_MEGARAID_NEWGEN is not set
471# CONFIG_MEGARAID_LEGACY is not set
472# CONFIG_MEGARAID_SAS is not set
473# CONFIG_SCSI_SATA is not set 448# CONFIG_SCSI_SATA is not set
474# CONFIG_SCSI_DMX3191D is not set
475# CONFIG_SCSI_FUTURE_DOMAIN is not set
476# CONFIG_SCSI_IPS is not set
477# CONFIG_SCSI_INITIO is not set
478# CONFIG_SCSI_INIA100 is not set
479# CONFIG_SCSI_SYM53C8XX_2 is not set
480# CONFIG_SCSI_IPR is not set
481# CONFIG_SCSI_QLOGIC_1280 is not set
482# CONFIG_SCSI_QLA_FC is not set
483# CONFIG_SCSI_LPFC is not set
484# CONFIG_SCSI_DC395x is not set
485# CONFIG_SCSI_DC390T is not set
486# CONFIG_SCSI_NSP32 is not set
487# CONFIG_SCSI_DEBUG is not set 449# CONFIG_SCSI_DEBUG is not set
488 450
489# 451#
@@ -495,19 +457,14 @@ CONFIG_ISCSI_TCP=m
495# Fusion MPT device support 457# Fusion MPT device support
496# 458#
497# CONFIG_FUSION is not set 459# CONFIG_FUSION is not set
498# CONFIG_FUSION_SPI is not set
499# CONFIG_FUSION_FC is not set
500# CONFIG_FUSION_SAS is not set
501 460
502# 461#
503# IEEE 1394 (FireWire) support 462# IEEE 1394 (FireWire) support
504# 463#
505# CONFIG_IEEE1394 is not set
506 464
507# 465#
508# I2O device support 466# I2O device support
509# 467#
510# CONFIG_I2O is not set
511 468
512# 469#
513# Network device support 470# Network device support
@@ -519,11 +476,6 @@ CONFIG_NETDEVICES=y
519# CONFIG_TUN is not set 476# CONFIG_TUN is not set
520 477
521# 478#
522# ARCnet devices
523#
524# CONFIG_ARCNET is not set
525
526#
527# PHY device support 479# PHY device support
528# 480#
529# CONFIG_PHYLIB is not set 481# CONFIG_PHYLIB is not set
@@ -533,71 +485,20 @@ CONFIG_NETDEVICES=y
533# 485#
534CONFIG_NET_ETHERNET=y 486CONFIG_NET_ETHERNET=y
535CONFIG_MII=y 487CONFIG_MII=y
536# CONFIG_HAPPYMEAL is not set
537# CONFIG_SUNGEM is not set
538# CONFIG_CASSINI is not set
539# CONFIG_NET_VENDOR_3COM is not set
540# CONFIG_DM9000 is not set 488# CONFIG_DM9000 is not set
541 489# CONFIG_SGISEEQ is not set
542#
543# Tulip family network device support
544#
545# CONFIG_NET_TULIP is not set
546# CONFIG_HP100 is not set
547CONFIG_NET_PCI=y
548# CONFIG_PCNET32 is not set
549# CONFIG_AMD8111_ETH is not set
550# CONFIG_ADAPTEC_STARFIRE is not set
551# CONFIG_B44 is not set
552# CONFIG_FORCEDETH is not set
553# CONFIG_DGRS is not set
554# CONFIG_EEPRO100 is not set
555# CONFIG_E100 is not set
556# CONFIG_FEALNX is not set
557# CONFIG_NATSEMI is not set
558# CONFIG_NE2K_PCI is not set
559# CONFIG_8139CP is not set
560CONFIG_8139TOO=y
561# CONFIG_8139TOO_PIO is not set
562CONFIG_8139TOO_TUNE_TWISTER=y
563CONFIG_8139TOO_8129=y
564# CONFIG_8139_OLD_RX_RESET is not set
565# CONFIG_SIS900 is not set
566# CONFIG_EPIC100 is not set
567# CONFIG_SUNDANCE is not set
568# CONFIG_TLAN is not set
569# CONFIG_VIA_RHINE is not set
570# CONFIG_LAN_SAA9730 is not set
571 490
572# 491#
573# Ethernet (1000 Mbit) 492# Ethernet (1000 Mbit)
574# 493#
575# CONFIG_ACENIC is not set
576# CONFIG_DL2K is not set
577# CONFIG_E1000 is not set
578# CONFIG_NS83820 is not set
579# CONFIG_HAMACHI is not set
580# CONFIG_YELLOWFIN is not set
581# CONFIG_R8169 is not set
582# CONFIG_SIS190 is not set
583# CONFIG_SKGE is not set
584# CONFIG_SKY2 is not set
585# CONFIG_SK98LIN is not set
586# CONFIG_VIA_VELOCITY is not set
587# CONFIG_TIGON3 is not set
588# CONFIG_BNX2 is not set
589 494
590# 495#
591# Ethernet (10000 Mbit) 496# Ethernet (10000 Mbit)
592# 497#
593# CONFIG_CHELSIO_T1 is not set
594# CONFIG_IXGB is not set
595# CONFIG_S2IO is not set
596 498
597# 499#
598# Token Ring devices 500# Token Ring devices
599# 501#
600# CONFIG_TR is not set
601 502
602# 503#
603# Wireless LAN (non-hamradio) 504# Wireless LAN (non-hamradio)
@@ -608,11 +509,8 @@ CONFIG_8139TOO_8129=y
608# Wan interfaces 509# Wan interfaces
609# 510#
610# CONFIG_WAN is not set 511# CONFIG_WAN is not set
611# CONFIG_FDDI is not set
612# CONFIG_HIPPI is not set
613# CONFIG_PPP is not set 512# CONFIG_PPP is not set
614# CONFIG_SLIP is not set 513# CONFIG_SLIP is not set
615# CONFIG_NET_FC is not set
616# CONFIG_SHAPER is not set 514# CONFIG_SHAPER is not set
617# CONFIG_NETCONSOLE is not set 515# CONFIG_NETCONSOLE is not set
618# CONFIG_NETPOLL is not set 516# CONFIG_NETPOLL is not set
@@ -657,7 +555,6 @@ CONFIG_INPUT=y
657CONFIG_SERIO=y 555CONFIG_SERIO=y
658# CONFIG_SERIO_I8042 is not set 556# CONFIG_SERIO_I8042 is not set
659# CONFIG_SERIO_SERPORT is not set 557# CONFIG_SERIO_SERPORT is not set
660# CONFIG_SERIO_PCIPS2 is not set
661CONFIG_SERIO_LIBPS2=y 558CONFIG_SERIO_LIBPS2=y
662# CONFIG_SERIO_RAW is not set 559# CONFIG_SERIO_RAW is not set
663# CONFIG_GAMEPORT is not set 560# CONFIG_GAMEPORT is not set
@@ -668,6 +565,7 @@ CONFIG_SERIO_LIBPS2=y
668CONFIG_VT=y 565CONFIG_VT=y
669CONFIG_VT_CONSOLE=y 566CONFIG_VT_CONSOLE=y
670CONFIG_HW_CONSOLE=y 567CONFIG_HW_CONSOLE=y
568CONFIG_VT_HW_CONSOLE_BINDING=y
671# CONFIG_SERIAL_NONSTANDARD is not set 569# CONFIG_SERIAL_NONSTANDARD is not set
672 570
673# 571#
@@ -678,8 +576,7 @@ CONFIG_HW_CONSOLE=y
678# 576#
679# Non-8250 serial port support 577# Non-8250 serial port support
680# 578#
681# CONFIG_SERIAL_IP3106 is not set 579# CONFIG_SERIAL_IP22_ZILOG is not set
682# CONFIG_SERIAL_JSM is not set
683CONFIG_UNIX98_PTYS=y 580CONFIG_UNIX98_PTYS=y
684CONFIG_LEGACY_PTYS=y 581CONFIG_LEGACY_PTYS=y
685CONFIG_LEGACY_PTY_COUNT=256 582CONFIG_LEGACY_PTY_COUNT=256
@@ -693,16 +590,16 @@ CONFIG_LEGACY_PTY_COUNT=256
693# Watchdog Cards 590# Watchdog Cards
694# 591#
695# CONFIG_WATCHDOG is not set 592# CONFIG_WATCHDOG is not set
593# CONFIG_HW_RANDOM is not set
696# CONFIG_RTC is not set 594# CONFIG_RTC is not set
595# CONFIG_SGI_DS1286 is not set
697# CONFIG_GEN_RTC is not set 596# CONFIG_GEN_RTC is not set
698# CONFIG_DTLK is not set 597# CONFIG_DTLK is not set
699# CONFIG_R3964 is not set 598# CONFIG_R3964 is not set
700# CONFIG_APPLICOM is not set
701 599
702# 600#
703# Ftape, the floppy tape device driver 601# Ftape, the floppy tape device driver
704# 602#
705# CONFIG_DRM is not set
706# CONFIG_RAW_DRIVER is not set 603# CONFIG_RAW_DRIVER is not set
707 604
708# 605#
@@ -725,13 +622,13 @@ CONFIG_LEGACY_PTY_COUNT=256
725# 622#
726# Dallas's 1-wire bus 623# Dallas's 1-wire bus
727# 624#
728# CONFIG_W1 is not set
729 625
730# 626#
731# Hardware Monitoring support 627# Hardware Monitoring support
732# 628#
733CONFIG_HWMON=y 629CONFIG_HWMON=y
734# CONFIG_HWMON_VID is not set 630# CONFIG_HWMON_VID is not set
631# CONFIG_SENSORS_ABITUGURU is not set
735# CONFIG_SENSORS_F71805F is not set 632# CONFIG_SENSORS_F71805F is not set
736# CONFIG_HWMON_DEBUG_CHIP is not set 633# CONFIG_HWMON_DEBUG_CHIP is not set
737 634
@@ -743,22 +640,24 @@ CONFIG_HWMON=y
743# Multimedia devices 640# Multimedia devices
744# 641#
745# CONFIG_VIDEO_DEV is not set 642# CONFIG_VIDEO_DEV is not set
643CONFIG_VIDEO_V4L2=y
746 644
747# 645#
748# Digital Video Broadcasting Devices 646# Digital Video Broadcasting Devices
749# 647#
750# CONFIG_DVB is not set 648# CONFIG_DVB is not set
751# CONFIG_USB_DABUSB is not set
752 649
753# 650#
754# Graphics support 651# Graphics support
755# 652#
653# CONFIG_FIRMWARE_EDID is not set
756# CONFIG_FB is not set 654# CONFIG_FB is not set
757 655
758# 656#
759# Console display driver support 657# Console display driver support
760# 658#
761# CONFIG_VGA_CONSOLE is not set 659# CONFIG_VGA_CONSOLE is not set
660# CONFIG_SGI_NEWPORT_CONSOLE is not set
762CONFIG_DUMMY_CONSOLE=y 661CONFIG_DUMMY_CONSOLE=y
763 662
764# 663#
@@ -769,126 +668,15 @@ CONFIG_DUMMY_CONSOLE=y
769# 668#
770# USB support 669# USB support
771# 670#
772CONFIG_USB_ARCH_HAS_HCD=y 671# CONFIG_USB_ARCH_HAS_HCD is not set
773CONFIG_USB_ARCH_HAS_OHCI=y 672# CONFIG_USB_ARCH_HAS_OHCI is not set
774CONFIG_USB_ARCH_HAS_EHCI=y 673# CONFIG_USB_ARCH_HAS_EHCI is not set
775CONFIG_USB=y
776# CONFIG_USB_DEBUG is not set
777
778#
779# Miscellaneous USB options
780#
781# CONFIG_USB_DEVICEFS is not set
782# CONFIG_USB_BANDWIDTH is not set
783# CONFIG_USB_DYNAMIC_MINORS is not set
784# CONFIG_USB_OTG is not set
785
786#
787# USB Host Controller Drivers
788#
789# CONFIG_USB_EHCI_HCD is not set
790# CONFIG_USB_ISP116X_HCD is not set
791CONFIG_USB_OHCI_HCD=y
792# CONFIG_USB_OHCI_BIG_ENDIAN is not set
793CONFIG_USB_OHCI_LITTLE_ENDIAN=y
794# CONFIG_USB_UHCI_HCD is not set
795# CONFIG_USB_SL811_HCD is not set
796
797#
798# USB Device Class drivers
799#
800# CONFIG_USB_ACM is not set
801# CONFIG_USB_PRINTER is not set
802 674
803# 675#
804# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 676# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
805# 677#
806 678
807# 679#
808# may also be needed; see USB_STORAGE Help for more information
809#
810CONFIG_USB_STORAGE=y
811# CONFIG_USB_STORAGE_DEBUG is not set
812CONFIG_USB_STORAGE_DATAFAB=y
813CONFIG_USB_STORAGE_FREECOM=y
814CONFIG_USB_STORAGE_ISD200=y
815CONFIG_USB_STORAGE_DPCM=y
816CONFIG_USB_STORAGE_USBAT=y
817CONFIG_USB_STORAGE_SDDR09=y
818CONFIG_USB_STORAGE_SDDR55=y
819CONFIG_USB_STORAGE_JUMPSHOT=y
820# CONFIG_USB_STORAGE_ALAUDA is not set
821# CONFIG_USB_LIBUSUAL is not set
822
823#
824# USB Input Devices
825#
826# CONFIG_USB_HID is not set
827
828#
829# USB HID Boot Protocol drivers
830#
831# CONFIG_USB_KBD is not set
832# CONFIG_USB_MOUSE is not set
833# CONFIG_USB_AIPTEK is not set
834# CONFIG_USB_WACOM is not set
835# CONFIG_USB_ACECAD is not set
836# CONFIG_USB_KBTAB is not set
837# CONFIG_USB_POWERMATE is not set
838# CONFIG_USB_TOUCHSCREEN is not set
839# CONFIG_USB_YEALINK is not set
840# CONFIG_USB_XPAD is not set
841# CONFIG_USB_ATI_REMOTE is not set
842# CONFIG_USB_ATI_REMOTE2 is not set
843# CONFIG_USB_KEYSPAN_REMOTE is not set
844# CONFIG_USB_APPLETOUCH is not set
845
846#
847# USB Imaging devices
848#
849# CONFIG_USB_MDC800 is not set
850# CONFIG_USB_MICROTEK is not set
851
852#
853# USB Network Adapters
854#
855# CONFIG_USB_CATC is not set
856# CONFIG_USB_KAWETH is not set
857# CONFIG_USB_PEGASUS is not set
858# CONFIG_USB_RTL8150 is not set
859# CONFIG_USB_USBNET is not set
860CONFIG_USB_MON=y
861
862#
863# USB port drivers
864#
865
866#
867# USB Serial Converter support
868#
869# CONFIG_USB_SERIAL is not set
870
871#
872# USB Miscellaneous drivers
873#
874# CONFIG_USB_EMI62 is not set
875# CONFIG_USB_EMI26 is not set
876# CONFIG_USB_AUERSWALD is not set
877# CONFIG_USB_RIO500 is not set
878# CONFIG_USB_LEGOTOWER is not set
879# CONFIG_USB_LCD is not set
880# CONFIG_USB_LED is not set
881# CONFIG_USB_CYTHERM is not set
882# CONFIG_USB_PHIDGETKIT is not set
883# CONFIG_USB_PHIDGETSERVO is not set
884# CONFIG_USB_IDMOUSE is not set
885# CONFIG_USB_LD is not set
886
887#
888# USB DSL modem support
889#
890
891#
892# USB Gadget Support 680# USB Gadget Support
893# 681#
894# CONFIG_USB_GADGET is not set 682# CONFIG_USB_GADGET is not set
@@ -914,7 +702,6 @@ CONFIG_USB_MON=y
914# 702#
915# InfiniBand support 703# InfiniBand support
916# 704#
917# CONFIG_INFINIBAND is not set
918 705
919# 706#
920# EDAC - error detection and reporting (RAS) (EXPERIMENTAL) 707# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
@@ -926,6 +713,19 @@ CONFIG_USB_MON=y
926# CONFIG_RTC_CLASS is not set 713# CONFIG_RTC_CLASS is not set
927 714
928# 715#
716# DMA Engine support
717#
718# CONFIG_DMA_ENGINE is not set
719
720#
721# DMA Clients
722#
723
724#
725# DMA Devices
726#
727
728#
929# File systems 729# File systems
930# 730#
931CONFIG_EXT2_FS=y 731CONFIG_EXT2_FS=y
@@ -940,6 +740,7 @@ CONFIG_EXT2_FS=y
940# CONFIG_MINIX_FS is not set 740# CONFIG_MINIX_FS is not set
941# CONFIG_ROMFS_FS is not set 741# CONFIG_ROMFS_FS is not set
942CONFIG_INOTIFY=y 742CONFIG_INOTIFY=y
743CONFIG_INOTIFY_USER=y
943# CONFIG_QUOTA is not set 744# CONFIG_QUOTA is not set
944# CONFIG_DNOTIFY is not set 745# CONFIG_DNOTIFY is not set
945# CONFIG_AUTOFS_FS is not set 746# CONFIG_AUTOFS_FS is not set
@@ -1011,6 +812,7 @@ CONFIG_SUNRPC=y
1011# CONFIG_RPCSEC_GSS_SPKM3 is not set 812# CONFIG_RPCSEC_GSS_SPKM3 is not set
1012# CONFIG_SMB_FS is not set 813# CONFIG_SMB_FS is not set
1013# CONFIG_CIFS is not set 814# CONFIG_CIFS is not set
815# CONFIG_CIFS_DEBUG2 is not set
1014# CONFIG_NCP_FS is not set 816# CONFIG_NCP_FS is not set
1015# CONFIG_CODA_FS is not set 817# CONFIG_CODA_FS is not set
1016# CONFIG_AFS_FS is not set 818# CONFIG_AFS_FS is not set
@@ -1021,6 +823,7 @@ CONFIG_SUNRPC=y
1021# 823#
1022# CONFIG_PARTITION_ADVANCED is not set 824# CONFIG_PARTITION_ADVANCED is not set
1023CONFIG_MSDOS_PARTITION=y 825CONFIG_MSDOS_PARTITION=y
826CONFIG_SGI_PARTITION=y
1024 827
1025# 828#
1026# Native Language Support 829# Native Language Support
@@ -1076,15 +879,20 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1076# 879#
1077# CONFIG_PRINTK_TIME is not set 880# CONFIG_PRINTK_TIME is not set
1078CONFIG_MAGIC_SYSRQ=y 881CONFIG_MAGIC_SYSRQ=y
882# CONFIG_UNUSED_SYMBOLS is not set
1079CONFIG_DEBUG_KERNEL=y 883CONFIG_DEBUG_KERNEL=y
1080CONFIG_LOG_BUF_SHIFT=14 884CONFIG_LOG_BUF_SHIFT=14
1081CONFIG_DETECT_SOFTLOCKUP=y 885CONFIG_DETECT_SOFTLOCKUP=y
1082# CONFIG_SCHEDSTATS is not set 886# CONFIG_SCHEDSTATS is not set
1083CONFIG_DEBUG_SLAB=y 887CONFIG_DEBUG_SLAB=y
1084# CONFIG_DEBUG_SLAB_LEAK is not set 888# CONFIG_DEBUG_SLAB_LEAK is not set
1085CONFIG_DEBUG_MUTEXES=y 889# CONFIG_DEBUG_RT_MUTEXES is not set
890# CONFIG_RT_MUTEX_TESTER is not set
1086# CONFIG_DEBUG_SPINLOCK is not set 891# CONFIG_DEBUG_SPINLOCK is not set
892CONFIG_DEBUG_MUTEXES=y
893# CONFIG_DEBUG_RWSEMS is not set
1087# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 894# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
895# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1088# CONFIG_DEBUG_KOBJECT is not set 896# CONFIG_DEBUG_KOBJECT is not set
1089# CONFIG_DEBUG_INFO is not set 897# CONFIG_DEBUG_INFO is not set
1090# CONFIG_DEBUG_FS is not set 898# CONFIG_DEBUG_FS is not set
@@ -1144,3 +952,4 @@ CONFIG_CRC_CCITT=m
1144# CONFIG_CRC16 is not set 952# CONFIG_CRC16 is not set
1145CONFIG_CRC32=y 953CONFIG_CRC32=y
1146CONFIG_LIBCRC32C=m 954CONFIG_LIBCRC32C=m
955CONFIG_PLIST=y
diff --git a/arch/mips/configs/pnx8550-v2pci_defconfig b/arch/mips/configs/pnx8550-v2pci_defconfig
index fe092ac92e89..a8eb51bae3f3 100644
--- a/arch/mips/configs/pnx8550-v2pci_defconfig
+++ b/arch/mips/configs/pnx8550-v2pci_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:51:14 2006 4# Thu Jul 6 10:04:18 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -39,13 +41,14 @@ CONFIG_MIPS=y
39# CONFIG_MOMENCO_OCELOT_C is not set 41# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set 42# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set 43# CONFIG_MIPS_XXS1500 is not set
42CONFIG_PNX8550_V2PCI=y 44# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set 45# CONFIG_PNX8550_JBS is not set
44# CONFIG_DDB5477 is not set 46# CONFIG_DDB5477 is not set
45# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
48# CONFIG_SGI_IP22 is not set 50# CONFIG_MARKEINS is not set
51CONFIG_SGI_IP22=y
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
51# CONFIG_SIBYTE_BIGSUR is not set 54# CONFIG_SIBYTE_BIGSUR is not set
@@ -65,19 +68,25 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
65CONFIG_GENERIC_FIND_NEXT_BIT=y 68CONFIG_GENERIC_FIND_NEXT_BIT=y
66CONFIG_GENERIC_HWEIGHT=y 69CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 70CONFIG_GENERIC_CALIBRATE_DELAY=y
71CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
72CONFIG_ARC=y
68CONFIG_DMA_NONCOHERENT=y 73CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 74CONFIG_DMA_NEED_PCI_MAP_STATE=y
70# CONFIG_CPU_BIG_ENDIAN is not set 75CONFIG_CPU_BIG_ENDIAN=y
71CONFIG_CPU_LITTLE_ENDIAN=y 76# CONFIG_CPU_LITTLE_ENDIAN is not set
72CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y 77CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
73CONFIG_PNX8550=y 78CONFIG_IRQ_CPU=y
74CONFIG_SOC_PNX8550=y 79CONFIG_SWAP_IO_SPACE=y
80CONFIG_ARC32=y
81CONFIG_BOOT_ELF32=y
75CONFIG_MIPS_L1_CACHE_SHIFT=5 82CONFIG_MIPS_L1_CACHE_SHIFT=5
83# CONFIG_ARC_CONSOLE is not set
84CONFIG_ARC_PROMLIB=y
76 85
77# 86#
78# CPU selection 87# CPU selection
79# 88#
80CONFIG_CPU_MIPS32_R1=y 89# CONFIG_CPU_MIPS32_R1 is not set
81# CONFIG_CPU_MIPS32_R2 is not set 90# CONFIG_CPU_MIPS32_R2 is not set
82# CONFIG_CPU_MIPS64_R1 is not set 91# CONFIG_CPU_MIPS64_R1 is not set
83# CONFIG_CPU_MIPS64_R2 is not set 92# CONFIG_CPU_MIPS64_R2 is not set
@@ -85,7 +94,7 @@ CONFIG_CPU_MIPS32_R1=y
85# CONFIG_CPU_TX39XX is not set 94# CONFIG_CPU_TX39XX is not set
86# CONFIG_CPU_VR41XX is not set 95# CONFIG_CPU_VR41XX is not set
87# CONFIG_CPU_R4300 is not set 96# CONFIG_CPU_R4300 is not set
88# CONFIG_CPU_R4X00 is not set 97CONFIG_CPU_R4X00=y
89# CONFIG_CPU_TX49XX is not set 98# CONFIG_CPU_TX49XX is not set
90# CONFIG_CPU_R5000 is not set 99# CONFIG_CPU_R5000 is not set
91# CONFIG_CPU_R5432 is not set 100# CONFIG_CPU_R5432 is not set
@@ -96,11 +105,12 @@ CONFIG_CPU_MIPS32_R1=y
96# CONFIG_CPU_RM7000 is not set 105# CONFIG_CPU_RM7000 is not set
97# CONFIG_CPU_RM9000 is not set 106# CONFIG_CPU_RM9000 is not set
98# CONFIG_CPU_SB1 is not set 107# CONFIG_CPU_SB1 is not set
99CONFIG_SYS_HAS_CPU_MIPS32_R1=y 108CONFIG_SYS_HAS_CPU_R4X00=y
100CONFIG_CPU_MIPS32=y 109CONFIG_SYS_HAS_CPU_R5000=y
101CONFIG_CPU_MIPSR1=y
102CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y 110CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
111CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
103CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y 112CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
113CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
104 114
105# 115#
106# Kernel type 116# Kernel type
@@ -111,14 +121,17 @@ CONFIG_PAGE_SIZE_4KB=y
111# CONFIG_PAGE_SIZE_8KB is not set 121# CONFIG_PAGE_SIZE_8KB is not set
112# CONFIG_PAGE_SIZE_16KB is not set 122# CONFIG_PAGE_SIZE_16KB is not set
113# CONFIG_PAGE_SIZE_64KB is not set 123# CONFIG_PAGE_SIZE_64KB is not set
114CONFIG_CPU_HAS_PREFETCH=y 124CONFIG_BOARD_SCACHE=y
115# CONFIG_MIPS_MT is not set 125CONFIG_IP22_CPU_SCACHE=y
126CONFIG_MIPS_MT_DISABLED=y
127# CONFIG_MIPS_MT_SMTC is not set
128# CONFIG_MIPS_MT_SMP is not set
129# CONFIG_MIPS_VPE_LOADER is not set
116# CONFIG_64BIT_PHYS_ADDR is not set 130# CONFIG_64BIT_PHYS_ADDR is not set
117CONFIG_CPU_HAS_LLSC=y 131CONFIG_CPU_HAS_LLSC=y
118CONFIG_CPU_HAS_SYNC=y 132CONFIG_CPU_HAS_SYNC=y
119CONFIG_GENERIC_HARDIRQS=y 133CONFIG_GENERIC_HARDIRQS=y
120CONFIG_GENERIC_IRQ_PROBE=y 134CONFIG_GENERIC_IRQ_PROBE=y
121CONFIG_CPU_SUPPORTS_HIGHMEM=y
122CONFIG_ARCH_FLATMEM_ENABLE=y 135CONFIG_ARCH_FLATMEM_ENABLE=y
123CONFIG_SELECT_MEMORY_MODEL=y 136CONFIG_SELECT_MEMORY_MODEL=y
124CONFIG_FLATMEM_MANUAL=y 137CONFIG_FLATMEM_MANUAL=y
@@ -128,6 +141,7 @@ CONFIG_FLATMEM=y
128CONFIG_FLAT_NODE_MEM_MAP=y 141CONFIG_FLAT_NODE_MEM_MAP=y
129# CONFIG_SPARSEMEM_STATIC is not set 142# CONFIG_SPARSEMEM_STATIC is not set
130CONFIG_SPLIT_PTLOCK_CPUS=4 143CONFIG_SPLIT_PTLOCK_CPUS=4
144# CONFIG_RESOURCES_64BIT is not set
131# CONFIG_HZ_48 is not set 145# CONFIG_HZ_48 is not set
132# CONFIG_HZ_100 is not set 146# CONFIG_HZ_100 is not set
133# CONFIG_HZ_128 is not set 147# CONFIG_HZ_128 is not set
@@ -140,6 +154,7 @@ CONFIG_HZ=1000
140CONFIG_PREEMPT_NONE=y 154CONFIG_PREEMPT_NONE=y
141# CONFIG_PREEMPT_VOLUNTARY is not set 155# CONFIG_PREEMPT_VOLUNTARY is not set
142# CONFIG_PREEMPT is not set 156# CONFIG_PREEMPT is not set
157CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
143 158
144# 159#
145# Code maturity level options 160# Code maturity level options
@@ -172,10 +187,12 @@ CONFIG_PRINTK=y
172CONFIG_BUG=y 187CONFIG_BUG=y
173CONFIG_ELF_CORE=y 188CONFIG_ELF_CORE=y
174CONFIG_BASE_FULL=y 189CONFIG_BASE_FULL=y
190CONFIG_RT_MUTEXES=y
175CONFIG_FUTEX=y 191CONFIG_FUTEX=y
176CONFIG_EPOLL=y 192CONFIG_EPOLL=y
177CONFIG_SHMEM=y 193CONFIG_SHMEM=y
178CONFIG_SLAB=y 194CONFIG_SLAB=y
195CONFIG_VM_EVENT_COUNTERS=y
179# CONFIG_TINY_SHMEM is not set 196# CONFIG_TINY_SHMEM is not set
180CONFIG_BASE_SMALL=0 197CONFIG_BASE_SMALL=0
181# CONFIG_SLOB is not set 198# CONFIG_SLOB is not set
@@ -212,8 +229,8 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
212# 229#
213# Bus options (PCI, PCMCIA, EISA, ISA, TC) 230# Bus options (PCI, PCMCIA, EISA, ISA, TC)
214# 231#
215CONFIG_HW_HAS_PCI=y 232CONFIG_HW_HAS_EISA=y
216CONFIG_PCI=y 233# CONFIG_EISA is not set
217CONFIG_MMU=y 234CONFIG_MMU=y
218 235
219# 236#
@@ -224,7 +241,6 @@ CONFIG_MMU=y
224# 241#
225# PCI Hotplug Support 242# PCI Hotplug Support
226# 243#
227# CONFIG_HOTPLUG_PCI is not set
228 244
229# 245#
230# Executable file formats 246# Executable file formats
@@ -245,6 +261,8 @@ CONFIG_NET=y
245CONFIG_PACKET=y 261CONFIG_PACKET=y
246# CONFIG_PACKET_MMAP is not set 262# CONFIG_PACKET_MMAP is not set
247CONFIG_UNIX=y 263CONFIG_UNIX=y
264CONFIG_XFRM=y
265# CONFIG_XFRM_USER is not set
248# CONFIG_NET_KEY is not set 266# CONFIG_NET_KEY is not set
249CONFIG_INET=y 267CONFIG_INET=y
250# CONFIG_IP_MULTICAST is not set 268# CONFIG_IP_MULTICAST is not set
@@ -263,6 +281,8 @@ CONFIG_IP_PNP=y
263# CONFIG_INET_IPCOMP is not set 281# CONFIG_INET_IPCOMP is not set
264# CONFIG_INET_XFRM_TUNNEL is not set 282# CONFIG_INET_XFRM_TUNNEL is not set
265# CONFIG_INET_TUNNEL is not set 283# CONFIG_INET_TUNNEL is not set
284CONFIG_INET_XFRM_MODE_TRANSPORT=m
285CONFIG_INET_XFRM_MODE_TUNNEL=m
266CONFIG_INET_DIAG=y 286CONFIG_INET_DIAG=y
267CONFIG_INET_TCP_DIAG=y 287CONFIG_INET_TCP_DIAG=y
268# CONFIG_TCP_CONG_ADVANCED is not set 288# CONFIG_TCP_CONG_ADVANCED is not set
@@ -281,7 +301,10 @@ CONFIG_IPV6_ROUTE_INFO=y
281# CONFIG_INET6_IPCOMP is not set 301# CONFIG_INET6_IPCOMP is not set
282# CONFIG_INET6_XFRM_TUNNEL is not set 302# CONFIG_INET6_XFRM_TUNNEL is not set
283# CONFIG_INET6_TUNNEL is not set 303# CONFIG_INET6_TUNNEL is not set
304CONFIG_INET6_XFRM_MODE_TRANSPORT=m
305CONFIG_INET6_XFRM_MODE_TUNNEL=m
284# CONFIG_IPV6_TUNNEL is not set 306# CONFIG_IPV6_TUNNEL is not set
307CONFIG_NETWORK_SECMARK=y
285CONFIG_NETFILTER=y 308CONFIG_NETFILTER=y
286# CONFIG_NETFILTER_DEBUG is not set 309# CONFIG_NETFILTER_DEBUG is not set
287 310
@@ -294,6 +317,7 @@ CONFIG_NETFILTER_XTABLES=m
294CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m 317CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
295CONFIG_NETFILTER_XT_TARGET_MARK=m 318CONFIG_NETFILTER_XT_TARGET_MARK=m
296CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m 319CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
320CONFIG_NETFILTER_XT_TARGET_SECMARK=m
297CONFIG_NETFILTER_XT_MATCH_COMMENT=m 321CONFIG_NETFILTER_XT_MATCH_COMMENT=m
298CONFIG_NETFILTER_XT_MATCH_DCCP=m 322CONFIG_NETFILTER_XT_MATCH_DCCP=m
299CONFIG_NETFILTER_XT_MATCH_ESP=m 323CONFIG_NETFILTER_XT_MATCH_ESP=m
@@ -301,10 +325,13 @@ CONFIG_NETFILTER_XT_MATCH_LENGTH=m
301CONFIG_NETFILTER_XT_MATCH_LIMIT=m 325CONFIG_NETFILTER_XT_MATCH_LIMIT=m
302CONFIG_NETFILTER_XT_MATCH_MAC=m 326CONFIG_NETFILTER_XT_MATCH_MAC=m
303CONFIG_NETFILTER_XT_MATCH_MARK=m 327CONFIG_NETFILTER_XT_MATCH_MARK=m
328# CONFIG_NETFILTER_XT_MATCH_POLICY is not set
304CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m 329CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
305CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 330CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
331CONFIG_NETFILTER_XT_MATCH_QUOTA=m
306CONFIG_NETFILTER_XT_MATCH_REALM=m 332CONFIG_NETFILTER_XT_MATCH_REALM=m
307CONFIG_NETFILTER_XT_MATCH_SCTP=m 333CONFIG_NETFILTER_XT_MATCH_SCTP=m
334CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
308CONFIG_NETFILTER_XT_MATCH_STRING=m 335CONFIG_NETFILTER_XT_MATCH_STRING=m
309CONFIG_NETFILTER_XT_MATCH_TCPMSS=m 336CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
310 337
@@ -374,6 +401,7 @@ CONFIG_NET_CLS_ROUTE=y
374CONFIG_STANDALONE=y 401CONFIG_STANDALONE=y
375CONFIG_PREVENT_FIRMWARE_BUILD=y 402CONFIG_PREVENT_FIRMWARE_BUILD=y
376CONFIG_FW_LOADER=y 403CONFIG_FW_LOADER=y
404# CONFIG_SYS_HYPERVISOR is not set
377 405
378# 406#
379# Connector - unified userspace <-> kernelspace linker 407# Connector - unified userspace <-> kernelspace linker
@@ -397,16 +425,10 @@ CONFIG_FW_LOADER=y
397# 425#
398# Block devices 426# Block devices
399# 427#
400# CONFIG_BLK_CPQ_DA is not set
401# CONFIG_BLK_CPQ_CISS_DA is not set
402# CONFIG_BLK_DEV_DAC960 is not set
403# CONFIG_BLK_DEV_UMEM is not set
404# CONFIG_BLK_DEV_COW_COMMON is not set 428# CONFIG_BLK_DEV_COW_COMMON is not set
405CONFIG_BLK_DEV_LOOP=y 429CONFIG_BLK_DEV_LOOP=y
406# CONFIG_BLK_DEV_CRYPTOLOOP is not set 430# CONFIG_BLK_DEV_CRYPTOLOOP is not set
407# CONFIG_BLK_DEV_NBD is not set 431# CONFIG_BLK_DEV_NBD is not set
408# CONFIG_BLK_DEV_SX8 is not set
409# CONFIG_BLK_DEV_UB is not set
410CONFIG_BLK_DEV_RAM=y 432CONFIG_BLK_DEV_RAM=y
411CONFIG_BLK_DEV_RAM_COUNT=16 433CONFIG_BLK_DEV_RAM_COUNT=16
412CONFIG_BLK_DEV_RAM_SIZE=8192 434CONFIG_BLK_DEV_RAM_SIZE=8192
@@ -436,40 +458,9 @@ CONFIG_IDEDISK_MULTI_MODE=y
436# IDE chipset support/bugfixes 458# IDE chipset support/bugfixes
437# 459#
438CONFIG_IDE_GENERIC=y 460CONFIG_IDE_GENERIC=y
439CONFIG_BLK_DEV_IDEPCI=y
440CONFIG_IDEPCI_SHARE_IRQ=y
441# CONFIG_BLK_DEV_OFFBOARD is not set
442# CONFIG_BLK_DEV_GENERIC is not set
443# CONFIG_BLK_DEV_OPTI621 is not set
444CONFIG_BLK_DEV_IDEDMA_PCI=y
445# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
446CONFIG_IDEDMA_PCI_AUTO=y
447# CONFIG_IDEDMA_ONLYDISK is not set
448# CONFIG_BLK_DEV_AEC62XX is not set
449# CONFIG_BLK_DEV_ALI15X3 is not set
450# CONFIG_BLK_DEV_AMD74XX is not set
451CONFIG_BLK_DEV_CMD64X=y
452# CONFIG_BLK_DEV_TRIFLEX is not set
453# CONFIG_BLK_DEV_CY82C693 is not set
454# CONFIG_BLK_DEV_CS5520 is not set
455# CONFIG_BLK_DEV_CS5530 is not set
456# CONFIG_BLK_DEV_HPT34X is not set
457# CONFIG_BLK_DEV_HPT366 is not set
458# CONFIG_BLK_DEV_SC1200 is not set
459# CONFIG_BLK_DEV_PIIX is not set
460# CONFIG_BLK_DEV_IT821X is not set
461# CONFIG_BLK_DEV_NS87415 is not set
462# CONFIG_BLK_DEV_PDC202XX_OLD is not set
463# CONFIG_BLK_DEV_PDC202XX_NEW is not set
464# CONFIG_BLK_DEV_SVWKS is not set
465# CONFIG_BLK_DEV_SIIMAGE is not set
466# CONFIG_BLK_DEV_SLC90E66 is not set
467# CONFIG_BLK_DEV_TRM290 is not set
468# CONFIG_BLK_DEV_VIA82CXXX is not set
469# CONFIG_IDE_ARM is not set 461# CONFIG_IDE_ARM is not set
470CONFIG_BLK_DEV_IDEDMA=y 462# CONFIG_BLK_DEV_IDEDMA is not set
471# CONFIG_IDEDMA_IVB is not set 463# CONFIG_IDEDMA_AUTO is not set
472CONFIG_IDEDMA_AUTO=y
473# CONFIG_BLK_DEV_HD is not set 464# CONFIG_BLK_DEV_HD is not set
474 465
475# 466#
@@ -508,36 +499,8 @@ CONFIG_SCSI_ISCSI_ATTRS=m
508# SCSI low-level drivers 499# SCSI low-level drivers
509# 500#
510CONFIG_ISCSI_TCP=m 501CONFIG_ISCSI_TCP=m
511# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 502# CONFIG_SGIWD93_SCSI is not set
512# CONFIG_SCSI_3W_9XXX is not set
513# CONFIG_SCSI_ACARD is not set
514# CONFIG_SCSI_AACRAID is not set
515CONFIG_SCSI_AIC7XXX=m
516CONFIG_AIC7XXX_CMDS_PER_DEVICE=32
517CONFIG_AIC7XXX_RESET_DELAY_MS=15000
518# CONFIG_AIC7XXX_DEBUG_ENABLE is not set
519CONFIG_AIC7XXX_DEBUG_MASK=0
520# CONFIG_AIC7XXX_REG_PRETTY_PRINT is not set
521# CONFIG_SCSI_AIC7XXX_OLD is not set
522# CONFIG_SCSI_AIC79XX is not set
523# CONFIG_SCSI_DPT_I2O is not set
524# CONFIG_MEGARAID_NEWGEN is not set
525# CONFIG_MEGARAID_LEGACY is not set
526# CONFIG_MEGARAID_SAS is not set
527# CONFIG_SCSI_SATA is not set 503# CONFIG_SCSI_SATA is not set
528# CONFIG_SCSI_DMX3191D is not set
529# CONFIG_SCSI_FUTURE_DOMAIN is not set
530# CONFIG_SCSI_IPS is not set
531# CONFIG_SCSI_INITIO is not set
532# CONFIG_SCSI_INIA100 is not set
533# CONFIG_SCSI_SYM53C8XX_2 is not set
534# CONFIG_SCSI_IPR is not set
535# CONFIG_SCSI_QLOGIC_1280 is not set
536# CONFIG_SCSI_QLA_FC is not set
537# CONFIG_SCSI_LPFC is not set
538# CONFIG_SCSI_DC395x is not set
539# CONFIG_SCSI_DC390T is not set
540# CONFIG_SCSI_NSP32 is not set
541# CONFIG_SCSI_DEBUG is not set 504# CONFIG_SCSI_DEBUG is not set
542 505
543# 506#
@@ -549,19 +512,14 @@ CONFIG_AIC7XXX_DEBUG_MASK=0
549# Fusion MPT device support 512# Fusion MPT device support
550# 513#
551# CONFIG_FUSION is not set 514# CONFIG_FUSION is not set
552# CONFIG_FUSION_SPI is not set
553# CONFIG_FUSION_FC is not set
554# CONFIG_FUSION_SAS is not set
555 515
556# 516#
557# IEEE 1394 (FireWire) support 517# IEEE 1394 (FireWire) support
558# 518#
559# CONFIG_IEEE1394 is not set
560 519
561# 520#
562# I2O device support 521# I2O device support
563# 522#
564# CONFIG_I2O is not set
565 523
566# 524#
567# Network device support 525# Network device support
@@ -573,11 +531,6 @@ CONFIG_NETDEVICES=y
573CONFIG_TUN=m 531CONFIG_TUN=m
574 532
575# 533#
576# ARCnet devices
577#
578# CONFIG_ARCNET is not set
579
580#
581# PHY device support 534# PHY device support
582# 535#
583# CONFIG_PHYLIB is not set 536# CONFIG_PHYLIB is not set
@@ -587,71 +540,20 @@ CONFIG_TUN=m
587# 540#
588CONFIG_NET_ETHERNET=y 541CONFIG_NET_ETHERNET=y
589CONFIG_MII=y 542CONFIG_MII=y
590# CONFIG_HAPPYMEAL is not set
591# CONFIG_SUNGEM is not set
592# CONFIG_CASSINI is not set
593# CONFIG_NET_VENDOR_3COM is not set
594# CONFIG_DM9000 is not set 543# CONFIG_DM9000 is not set
595 544# CONFIG_SGISEEQ is not set
596#
597# Tulip family network device support
598#
599# CONFIG_NET_TULIP is not set
600# CONFIG_HP100 is not set
601CONFIG_NET_PCI=y
602# CONFIG_PCNET32 is not set
603# CONFIG_AMD8111_ETH is not set
604# CONFIG_ADAPTEC_STARFIRE is not set
605# CONFIG_B44 is not set
606# CONFIG_FORCEDETH is not set
607# CONFIG_DGRS is not set
608# CONFIG_EEPRO100 is not set
609# CONFIG_E100 is not set
610# CONFIG_FEALNX is not set
611CONFIG_NATSEMI=y
612# CONFIG_NE2K_PCI is not set
613# CONFIG_8139CP is not set
614CONFIG_8139TOO=y
615# CONFIG_8139TOO_PIO is not set
616# CONFIG_8139TOO_TUNE_TWISTER is not set
617# CONFIG_8139TOO_8129 is not set
618# CONFIG_8139_OLD_RX_RESET is not set
619# CONFIG_SIS900 is not set
620# CONFIG_EPIC100 is not set
621# CONFIG_SUNDANCE is not set
622# CONFIG_TLAN is not set
623# CONFIG_VIA_RHINE is not set
624# CONFIG_LAN_SAA9730 is not set
625 545
626# 546#
627# Ethernet (1000 Mbit) 547# Ethernet (1000 Mbit)
628# 548#
629# CONFIG_ACENIC is not set
630# CONFIG_DL2K is not set
631# CONFIG_E1000 is not set
632# CONFIG_NS83820 is not set
633# CONFIG_HAMACHI is not set
634# CONFIG_YELLOWFIN is not set
635# CONFIG_R8169 is not set
636# CONFIG_SIS190 is not set
637# CONFIG_SKGE is not set
638# CONFIG_SKY2 is not set
639# CONFIG_SK98LIN is not set
640# CONFIG_VIA_VELOCITY is not set
641# CONFIG_TIGON3 is not set
642# CONFIG_BNX2 is not set
643 549
644# 550#
645# Ethernet (10000 Mbit) 551# Ethernet (10000 Mbit)
646# 552#
647# CONFIG_CHELSIO_T1 is not set
648# CONFIG_IXGB is not set
649# CONFIG_S2IO is not set
650 553
651# 554#
652# Token Ring devices 555# Token Ring devices
653# 556#
654# CONFIG_TR is not set
655 557
656# 558#
657# Wireless LAN (non-hamradio) 559# Wireless LAN (non-hamradio)
@@ -662,8 +564,6 @@ CONFIG_8139TOO=y
662# Wan interfaces 564# Wan interfaces
663# 565#
664# CONFIG_WAN is not set 566# CONFIG_WAN is not set
665# CONFIG_FDDI is not set
666# CONFIG_HIPPI is not set
667CONFIG_PPP=m 567CONFIG_PPP=m
668# CONFIG_PPP_MULTILINK is not set 568# CONFIG_PPP_MULTILINK is not set
669# CONFIG_PPP_FILTER is not set 569# CONFIG_PPP_FILTER is not set
@@ -674,7 +574,6 @@ CONFIG_PPP_DEFLATE=m
674CONFIG_PPP_MPPE=m 574CONFIG_PPP_MPPE=m
675# CONFIG_PPPOE is not set 575# CONFIG_PPPOE is not set
676# CONFIG_SLIP is not set 576# CONFIG_SLIP is not set
677# CONFIG_NET_FC is not set
678# CONFIG_SHAPER is not set 577# CONFIG_SHAPER is not set
679# CONFIG_NETCONSOLE is not set 578# CONFIG_NETCONSOLE is not set
680# CONFIG_NETPOLL is not set 579# CONFIG_NETPOLL is not set
@@ -730,7 +629,6 @@ CONFIG_MOUSE_PS2=y
730CONFIG_SERIO=y 629CONFIG_SERIO=y
731CONFIG_SERIO_I8042=y 630CONFIG_SERIO_I8042=y
732CONFIG_SERIO_SERPORT=y 631CONFIG_SERIO_SERPORT=y
733# CONFIG_SERIO_PCIPS2 is not set
734CONFIG_SERIO_LIBPS2=y 632CONFIG_SERIO_LIBPS2=y
735# CONFIG_SERIO_RAW is not set 633# CONFIG_SERIO_RAW is not set
736# CONFIG_GAMEPORT is not set 634# CONFIG_GAMEPORT is not set
@@ -741,6 +639,7 @@ CONFIG_SERIO_LIBPS2=y
741CONFIG_VT=y 639CONFIG_VT=y
742# CONFIG_VT_CONSOLE is not set 640# CONFIG_VT_CONSOLE is not set
743CONFIG_HW_CONSOLE=y 641CONFIG_HW_CONSOLE=y
642CONFIG_VT_HW_CONSOLE_BINDING=y
744CONFIG_SERIAL_NONSTANDARD=y 643CONFIG_SERIAL_NONSTANDARD=y
745# CONFIG_COMPUTONE is not set 644# CONFIG_COMPUTONE is not set
746# CONFIG_ROCKETPORT is not set 645# CONFIG_ROCKETPORT is not set
@@ -750,7 +649,6 @@ CONFIG_SERIAL_NONSTANDARD=y
750# CONFIG_MOXA_SMARTIO is not set 649# CONFIG_MOXA_SMARTIO is not set
751# CONFIG_ISI is not set 650# CONFIG_ISI is not set
752# CONFIG_SYNCLINKMP is not set 651# CONFIG_SYNCLINKMP is not set
753# CONFIG_SYNCLINK_GT is not set
754# CONFIG_N_HDLC is not set 652# CONFIG_N_HDLC is not set
755# CONFIG_RISCOM8 is not set 653# CONFIG_RISCOM8 is not set
756# CONFIG_SPECIALIX is not set 654# CONFIG_SPECIALIX is not set
@@ -766,8 +664,7 @@ CONFIG_SERIAL_NONSTANDARD=y
766# 664#
767# Non-8250 serial port support 665# Non-8250 serial port support
768# 666#
769# CONFIG_SERIAL_IP3106 is not set 667# CONFIG_SERIAL_IP22_ZILOG is not set
770# CONFIG_SERIAL_JSM is not set
771CONFIG_UNIX98_PTYS=y 668CONFIG_UNIX98_PTYS=y
772CONFIG_LEGACY_PTYS=y 669CONFIG_LEGACY_PTYS=y
773CONFIG_LEGACY_PTY_COUNT=256 670CONFIG_LEGACY_PTY_COUNT=256
@@ -781,16 +678,16 @@ CONFIG_LEGACY_PTY_COUNT=256
781# Watchdog Cards 678# Watchdog Cards
782# 679#
783# CONFIG_WATCHDOG is not set 680# CONFIG_WATCHDOG is not set
681# CONFIG_HW_RANDOM is not set
784# CONFIG_RTC is not set 682# CONFIG_RTC is not set
683# CONFIG_SGI_DS1286 is not set
785# CONFIG_GEN_RTC is not set 684# CONFIG_GEN_RTC is not set
786# CONFIG_DTLK is not set 685# CONFIG_DTLK is not set
787# CONFIG_R3964 is not set 686# CONFIG_R3964 is not set
788# CONFIG_APPLICOM is not set
789 687
790# 688#
791# Ftape, the floppy tape device driver 689# Ftape, the floppy tape device driver
792# 690#
793# CONFIG_DRM is not set
794# CONFIG_RAW_DRIVER is not set 691# CONFIG_RAW_DRIVER is not set
795 692
796# 693#
@@ -811,29 +708,14 @@ CONFIG_I2C_CHARDEV=m
811CONFIG_I2C_ALGOBIT=m 708CONFIG_I2C_ALGOBIT=m
812# CONFIG_I2C_ALGOPCF is not set 709# CONFIG_I2C_ALGOPCF is not set
813# CONFIG_I2C_ALGOPCA is not set 710# CONFIG_I2C_ALGOPCA is not set
711# CONFIG_I2C_ALGO_SGI is not set
814 712
815# 713#
816# I2C Hardware Bus support 714# I2C Hardware Bus support
817# 715#
818# CONFIG_I2C_ALI1535 is not set 716# CONFIG_I2C_OCORES is not set
819# CONFIG_I2C_ALI1563 is not set
820# CONFIG_I2C_ALI15X3 is not set
821# CONFIG_I2C_AMD756 is not set
822# CONFIG_I2C_AMD8111 is not set
823# CONFIG_I2C_I801 is not set
824# CONFIG_I2C_I810 is not set
825# CONFIG_I2C_PIIX4 is not set
826# CONFIG_I2C_NFORCE2 is not set
827# CONFIG_I2C_PARPORT_LIGHT is not set 717# CONFIG_I2C_PARPORT_LIGHT is not set
828# CONFIG_I2C_PROSAVAGE is not set
829# CONFIG_I2C_SAVAGE4 is not set
830# CONFIG_I2C_SIS5595 is not set
831# CONFIG_I2C_SIS630 is not set
832# CONFIG_I2C_SIS96X is not set
833# CONFIG_I2C_STUB is not set 718# CONFIG_I2C_STUB is not set
834# CONFIG_I2C_VIA is not set
835# CONFIG_I2C_VIAPRO is not set
836# CONFIG_I2C_VOODOO3 is not set
837# CONFIG_I2C_PCA_ISA is not set 719# CONFIG_I2C_PCA_ISA is not set
838 720
839# 721#
@@ -860,13 +742,13 @@ CONFIG_I2C_ALGOBIT=m
860# 742#
861# Dallas's 1-wire bus 743# Dallas's 1-wire bus
862# 744#
863# CONFIG_W1 is not set
864 745
865# 746#
866# Hardware Monitoring support 747# Hardware Monitoring support
867# 748#
868CONFIG_HWMON=y 749CONFIG_HWMON=y
869# CONFIG_HWMON_VID is not set 750# CONFIG_HWMON_VID is not set
751# CONFIG_SENSORS_ABITUGURU is not set
870# CONFIG_SENSORS_ADM1021 is not set 752# CONFIG_SENSORS_ADM1021 is not set
871# CONFIG_SENSORS_ADM1025 is not set 753# CONFIG_SENSORS_ADM1025 is not set
872# CONFIG_SENSORS_ADM1026 is not set 754# CONFIG_SENSORS_ADM1026 is not set
@@ -893,12 +775,11 @@ CONFIG_HWMON=y
893# CONFIG_SENSORS_LM92 is not set 775# CONFIG_SENSORS_LM92 is not set
894# CONFIG_SENSORS_MAX1619 is not set 776# CONFIG_SENSORS_MAX1619 is not set
895# CONFIG_SENSORS_PC87360 is not set 777# CONFIG_SENSORS_PC87360 is not set
896# CONFIG_SENSORS_SIS5595 is not set
897# CONFIG_SENSORS_SMSC47M1 is not set 778# CONFIG_SENSORS_SMSC47M1 is not set
779# CONFIG_SENSORS_SMSC47M192 is not set
898# CONFIG_SENSORS_SMSC47B397 is not set 780# CONFIG_SENSORS_SMSC47B397 is not set
899# CONFIG_SENSORS_VIA686A is not set
900# CONFIG_SENSORS_VT8231 is not set
901# CONFIG_SENSORS_W83781D is not set 781# CONFIG_SENSORS_W83781D is not set
782# CONFIG_SENSORS_W83791D is not set
902# CONFIG_SENSORS_W83792D is not set 783# CONFIG_SENSORS_W83792D is not set
903# CONFIG_SENSORS_W83L785TS is not set 784# CONFIG_SENSORS_W83L785TS is not set
904# CONFIG_SENSORS_W83627HF is not set 785# CONFIG_SENSORS_W83627HF is not set
@@ -913,50 +794,33 @@ CONFIG_HWMON=y
913# Multimedia devices 794# Multimedia devices
914# 795#
915# CONFIG_VIDEO_DEV is not set 796# CONFIG_VIDEO_DEV is not set
797CONFIG_VIDEO_V4L2=y
916 798
917# 799#
918# Digital Video Broadcasting Devices 800# Digital Video Broadcasting Devices
919# 801#
920# CONFIG_DVB is not set 802# CONFIG_DVB is not set
921# CONFIG_USB_DABUSB is not set
922 803
923# 804#
924# Graphics support 805# Graphics support
925# 806#
807# CONFIG_FIRMWARE_EDID is not set
926CONFIG_FB=y 808CONFIG_FB=y
927# CONFIG_FB_CFB_FILLRECT is not set 809# CONFIG_FB_CFB_FILLRECT is not set
928# CONFIG_FB_CFB_COPYAREA is not set 810# CONFIG_FB_CFB_COPYAREA is not set
929# CONFIG_FB_CFB_IMAGEBLIT is not set 811# CONFIG_FB_CFB_IMAGEBLIT is not set
930# CONFIG_FB_MACMODES is not set 812# CONFIG_FB_MACMODES is not set
931CONFIG_FB_FIRMWARE_EDID=y 813# CONFIG_FB_BACKLIGHT is not set
932# CONFIG_FB_MODE_HELPERS is not set 814# CONFIG_FB_MODE_HELPERS is not set
933# CONFIG_FB_TILEBLITTING is not set 815# CONFIG_FB_TILEBLITTING is not set
934# CONFIG_FB_CIRRUS is not set
935# CONFIG_FB_PM2 is not set
936# CONFIG_FB_CYBER2000 is not set
937# CONFIG_FB_ASILIANT is not set
938# CONFIG_FB_IMSTT is not set
939# CONFIG_FB_S1D13XXX is not set 816# CONFIG_FB_S1D13XXX is not set
940# CONFIG_FB_NVIDIA is not set
941# CONFIG_FB_RIVA is not set
942# CONFIG_FB_MATROX is not set
943# CONFIG_FB_RADEON is not set
944# CONFIG_FB_ATY128 is not set
945# CONFIG_FB_ATY is not set
946# CONFIG_FB_SAVAGE is not set
947# CONFIG_FB_SIS is not set
948# CONFIG_FB_NEOMAGIC is not set
949# CONFIG_FB_KYRO is not set
950# CONFIG_FB_3DFX is not set
951# CONFIG_FB_VOODOO1 is not set
952# CONFIG_FB_SMIVGX is not set
953# CONFIG_FB_TRIDENT is not set
954# CONFIG_FB_VIRTUAL is not set 817# CONFIG_FB_VIRTUAL is not set
955 818
956# 819#
957# Console display driver support 820# Console display driver support
958# 821#
959# CONFIG_VGA_CONSOLE is not set 822# CONFIG_VGA_CONSOLE is not set
823# CONFIG_SGI_NEWPORT_CONSOLE is not set
960CONFIG_DUMMY_CONSOLE=y 824CONFIG_DUMMY_CONSOLE=y
961# CONFIG_FRAMEBUFFER_CONSOLE is not set 825# CONFIG_FRAMEBUFFER_CONSOLE is not set
962 826
@@ -974,124 +838,15 @@ CONFIG_DUMMY_CONSOLE=y
974# 838#
975# USB support 839# USB support
976# 840#
977CONFIG_USB_ARCH_HAS_HCD=y 841# CONFIG_USB_ARCH_HAS_HCD is not set
978CONFIG_USB_ARCH_HAS_OHCI=y 842# CONFIG_USB_ARCH_HAS_OHCI is not set
979CONFIG_USB_ARCH_HAS_EHCI=y 843# CONFIG_USB_ARCH_HAS_EHCI is not set
980CONFIG_USB=y
981# CONFIG_USB_DEBUG is not set
982
983#
984# Miscellaneous USB options
985#
986CONFIG_USB_DEVICEFS=y
987# CONFIG_USB_BANDWIDTH is not set
988# CONFIG_USB_DYNAMIC_MINORS is not set
989# CONFIG_USB_OTG is not set
990
991#
992# USB Host Controller Drivers
993#
994# CONFIG_USB_EHCI_HCD is not set
995# CONFIG_USB_ISP116X_HCD is not set
996# CONFIG_USB_OHCI_HCD is not set
997# CONFIG_USB_UHCI_HCD is not set
998# CONFIG_USB_SL811_HCD is not set
999
1000#
1001# USB Device Class drivers
1002#
1003# CONFIG_USB_ACM is not set
1004# CONFIG_USB_PRINTER is not set
1005 844
1006# 845#
1007# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 846# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
1008# 847#
1009 848
1010# 849#
1011# may also be needed; see USB_STORAGE Help for more information
1012#
1013CONFIG_USB_STORAGE=y
1014# CONFIG_USB_STORAGE_DEBUG is not set
1015# CONFIG_USB_STORAGE_DATAFAB is not set
1016# CONFIG_USB_STORAGE_FREECOM is not set
1017# CONFIG_USB_STORAGE_ISD200 is not set
1018# CONFIG_USB_STORAGE_DPCM is not set
1019# CONFIG_USB_STORAGE_USBAT is not set
1020# CONFIG_USB_STORAGE_SDDR09 is not set
1021# CONFIG_USB_STORAGE_SDDR55 is not set
1022# CONFIG_USB_STORAGE_JUMPSHOT is not set
1023# CONFIG_USB_STORAGE_ALAUDA is not set
1024# CONFIG_USB_STORAGE_ONETOUCH is not set
1025# CONFIG_USB_LIBUSUAL is not set
1026
1027#
1028# USB Input Devices
1029#
1030CONFIG_USB_HID=y
1031CONFIG_USB_HIDINPUT=y
1032# CONFIG_USB_HIDINPUT_POWERBOOK is not set
1033# CONFIG_HID_FF is not set
1034CONFIG_USB_HIDDEV=y
1035# CONFIG_USB_AIPTEK is not set
1036# CONFIG_USB_WACOM is not set
1037# CONFIG_USB_ACECAD is not set
1038# CONFIG_USB_KBTAB is not set
1039# CONFIG_USB_POWERMATE is not set
1040# CONFIG_USB_TOUCHSCREEN is not set
1041# CONFIG_USB_YEALINK is not set
1042# CONFIG_USB_XPAD is not set
1043# CONFIG_USB_ATI_REMOTE is not set
1044# CONFIG_USB_ATI_REMOTE2 is not set
1045# CONFIG_USB_KEYSPAN_REMOTE is not set
1046# CONFIG_USB_APPLETOUCH is not set
1047
1048#
1049# USB Imaging devices
1050#
1051# CONFIG_USB_MDC800 is not set
1052# CONFIG_USB_MICROTEK is not set
1053
1054#
1055# USB Network Adapters
1056#
1057# CONFIG_USB_CATC is not set
1058# CONFIG_USB_KAWETH is not set
1059# CONFIG_USB_PEGASUS is not set
1060# CONFIG_USB_RTL8150 is not set
1061# CONFIG_USB_USBNET is not set
1062CONFIG_USB_MON=y
1063
1064#
1065# USB port drivers
1066#
1067
1068#
1069# USB Serial Converter support
1070#
1071# CONFIG_USB_SERIAL is not set
1072
1073#
1074# USB Miscellaneous drivers
1075#
1076# CONFIG_USB_EMI62 is not set
1077# CONFIG_USB_EMI26 is not set
1078# CONFIG_USB_AUERSWALD is not set
1079# CONFIG_USB_RIO500 is not set
1080# CONFIG_USB_LEGOTOWER is not set
1081# CONFIG_USB_LCD is not set
1082# CONFIG_USB_LED is not set
1083# CONFIG_USB_CYTHERM is not set
1084# CONFIG_USB_PHIDGETKIT is not set
1085# CONFIG_USB_PHIDGETSERVO is not set
1086# CONFIG_USB_IDMOUSE is not set
1087# CONFIG_USB_LD is not set
1088# CONFIG_USB_TEST is not set
1089
1090#
1091# USB DSL modem support
1092#
1093
1094#
1095# USB Gadget Support 850# USB Gadget Support
1096# 851#
1097# CONFIG_USB_GADGET is not set 852# CONFIG_USB_GADGET is not set
@@ -1117,7 +872,6 @@ CONFIG_USB_MON=y
1117# 872#
1118# InfiniBand support 873# InfiniBand support
1119# 874#
1120# CONFIG_INFINIBAND is not set
1121 875
1122# 876#
1123# EDAC - error detection and reporting (RAS) (EXPERIMENTAL) 877# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
@@ -1129,6 +883,19 @@ CONFIG_USB_MON=y
1129# CONFIG_RTC_CLASS is not set 883# CONFIG_RTC_CLASS is not set
1130 884
1131# 885#
886# DMA Engine support
887#
888# CONFIG_DMA_ENGINE is not set
889
890#
891# DMA Clients
892#
893
894#
895# DMA Devices
896#
897
898#
1132# File systems 899# File systems
1133# 900#
1134CONFIG_EXT2_FS=y 901CONFIG_EXT2_FS=y
@@ -1145,7 +912,6 @@ CONFIG_FS_MBCACHE=y
1145# CONFIG_JFS_FS is not set 912# CONFIG_JFS_FS is not set
1146# CONFIG_FS_POSIX_ACL is not set 913# CONFIG_FS_POSIX_ACL is not set
1147CONFIG_XFS_FS=m 914CONFIG_XFS_FS=m
1148CONFIG_XFS_EXPORT=y
1149# CONFIG_XFS_QUOTA is not set 915# CONFIG_XFS_QUOTA is not set
1150# CONFIG_XFS_SECURITY is not set 916# CONFIG_XFS_SECURITY is not set
1151# CONFIG_XFS_POSIX_ACL is not set 917# CONFIG_XFS_POSIX_ACL is not set
@@ -1154,6 +920,7 @@ CONFIG_XFS_EXPORT=y
1154# CONFIG_MINIX_FS is not set 920# CONFIG_MINIX_FS is not set
1155# CONFIG_ROMFS_FS is not set 921# CONFIG_ROMFS_FS is not set
1156CONFIG_INOTIFY=y 922CONFIG_INOTIFY=y
923CONFIG_INOTIFY_USER=y
1157# CONFIG_QUOTA is not set 924# CONFIG_QUOTA is not set
1158CONFIG_DNOTIFY=y 925CONFIG_DNOTIFY=y
1159CONFIG_AUTOFS_FS=y 926CONFIG_AUTOFS_FS=y
@@ -1226,6 +993,7 @@ CONFIG_SUNRPC=y
1226CONFIG_SMB_FS=m 993CONFIG_SMB_FS=m
1227# CONFIG_SMB_NLS_DEFAULT is not set 994# CONFIG_SMB_NLS_DEFAULT is not set
1228# CONFIG_CIFS is not set 995# CONFIG_CIFS is not set
996# CONFIG_CIFS_DEBUG2 is not set
1229# CONFIG_NCP_FS is not set 997# CONFIG_NCP_FS is not set
1230# CONFIG_CODA_FS is not set 998# CONFIG_CODA_FS is not set
1231# CONFIG_AFS_FS is not set 999# CONFIG_AFS_FS is not set
@@ -1236,6 +1004,7 @@ CONFIG_SMB_FS=m
1236# 1004#
1237# CONFIG_PARTITION_ADVANCED is not set 1005# CONFIG_PARTITION_ADVANCED is not set
1238CONFIG_MSDOS_PARTITION=y 1006CONFIG_MSDOS_PARTITION=y
1007CONFIG_SGI_PARTITION=y
1239 1008
1240# 1009#
1241# Native Language Support 1010# Native Language Support
@@ -1291,6 +1060,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1291# 1060#
1292# CONFIG_PRINTK_TIME is not set 1061# CONFIG_PRINTK_TIME is not set
1293# CONFIG_MAGIC_SYSRQ is not set 1062# CONFIG_MAGIC_SYSRQ is not set
1063# CONFIG_UNUSED_SYMBOLS is not set
1294# CONFIG_DEBUG_KERNEL is not set 1064# CONFIG_DEBUG_KERNEL is not set
1295CONFIG_LOG_BUF_SHIFT=14 1065CONFIG_LOG_BUF_SHIFT=14
1296# CONFIG_DEBUG_FS is not set 1066# CONFIG_DEBUG_FS is not set
@@ -1349,3 +1119,4 @@ CONFIG_TEXTSEARCH=y
1349CONFIG_TEXTSEARCH_KMP=m 1119CONFIG_TEXTSEARCH_KMP=m
1350CONFIG_TEXTSEARCH_BM=m 1120CONFIG_TEXTSEARCH_BM=m
1351CONFIG_TEXTSEARCH_FSM=m 1121CONFIG_TEXTSEARCH_FSM=m
1122CONFIG_PLIST=y
diff --git a/arch/mips/configs/qemu_defconfig b/arch/mips/configs/qemu_defconfig
index db8701344cee..6a63a113b7ea 100644
--- a/arch/mips/configs/qemu_defconfig
+++ b/arch/mips/configs/qemu_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:51:15 2006 4# Thu Jul 6 10:04:18 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MIPS=y
45# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47CONFIG_QEMU=y 49CONFIG_QEMU=y
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -65,6 +68,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
65CONFIG_GENERIC_FIND_NEXT_BIT=y 68CONFIG_GENERIC_FIND_NEXT_BIT=y
66CONFIG_GENERIC_HWEIGHT=y 69CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 70CONFIG_GENERIC_CALIBRATE_DELAY=y
71CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
68CONFIG_DMA_COHERENT=y 72CONFIG_DMA_COHERENT=y
69CONFIG_GENERIC_ISA_DMA=y 73CONFIG_GENERIC_ISA_DMA=y
70CONFIG_I8259=y 74CONFIG_I8259=y
@@ -113,7 +117,10 @@ CONFIG_PAGE_SIZE_4KB=y
113# CONFIG_PAGE_SIZE_16KB is not set 117# CONFIG_PAGE_SIZE_16KB is not set
114# CONFIG_PAGE_SIZE_64KB is not set 118# CONFIG_PAGE_SIZE_64KB is not set
115CONFIG_CPU_HAS_PREFETCH=y 119CONFIG_CPU_HAS_PREFETCH=y
116# CONFIG_MIPS_MT is not set 120CONFIG_MIPS_MT_DISABLED=y
121# CONFIG_MIPS_MT_SMTC is not set
122# CONFIG_MIPS_MT_SMP is not set
123# CONFIG_MIPS_VPE_LOADER is not set
117# CONFIG_64BIT_PHYS_ADDR is not set 124# CONFIG_64BIT_PHYS_ADDR is not set
118CONFIG_CPU_HAS_LLSC=y 125CONFIG_CPU_HAS_LLSC=y
119CONFIG_CPU_HAS_SYNC=y 126CONFIG_CPU_HAS_SYNC=y
@@ -121,11 +128,12 @@ CONFIG_GENERIC_HARDIRQS=y
121CONFIG_GENERIC_IRQ_PROBE=y 128CONFIG_GENERIC_IRQ_PROBE=y
122CONFIG_CPU_SUPPORTS_HIGHMEM=y 129CONFIG_CPU_SUPPORTS_HIGHMEM=y
123CONFIG_ARCH_FLATMEM_ENABLE=y 130CONFIG_ARCH_FLATMEM_ENABLE=y
131CONFIG_ARCH_SPARSEMEM_ENABLE=y
124CONFIG_FLATMEM=y 132CONFIG_FLATMEM=y
125CONFIG_FLAT_NODE_MEM_MAP=y 133CONFIG_FLAT_NODE_MEM_MAP=y
126# CONFIG_SPARSEMEM_STATIC is not set 134# CONFIG_SPARSEMEM_STATIC is not set
127CONFIG_SPLIT_PTLOCK_CPUS=4 135CONFIG_SPLIT_PTLOCK_CPUS=4
128# CONFIG_SMP is not set 136# CONFIG_RESOURCES_64BIT is not set
129# CONFIG_HZ_48 is not set 137# CONFIG_HZ_48 is not set
130CONFIG_HZ_100=y 138CONFIG_HZ_100=y
131# CONFIG_HZ_128 is not set 139# CONFIG_HZ_128 is not set
@@ -138,6 +146,7 @@ CONFIG_HZ=100
138CONFIG_PREEMPT_NONE=y 146CONFIG_PREEMPT_NONE=y
139# CONFIG_PREEMPT_VOLUNTARY is not set 147# CONFIG_PREEMPT_VOLUNTARY is not set
140# CONFIG_PREEMPT is not set 148# CONFIG_PREEMPT is not set
149CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
141 150
142# 151#
143# Code maturity level options 152# Code maturity level options
@@ -171,6 +180,7 @@ CONFIG_ELF_CORE=y
171# CONFIG_EPOLL is not set 180# CONFIG_EPOLL is not set
172# CONFIG_SHMEM is not set 181# CONFIG_SHMEM is not set
173CONFIG_SLAB=y 182CONFIG_SLAB=y
183CONFIG_VM_EVENT_COUNTERS=y
174CONFIG_TINY_SHMEM=y 184CONFIG_TINY_SHMEM=y
175CONFIG_BASE_SMALL=1 185CONFIG_BASE_SMALL=1
176# CONFIG_SLOB is not set 186# CONFIG_SLOB is not set
@@ -235,6 +245,8 @@ CONFIG_NET=y
235CONFIG_PACKET=y 245CONFIG_PACKET=y
236CONFIG_PACKET_MMAP=y 246CONFIG_PACKET_MMAP=y
237CONFIG_UNIX=y 247CONFIG_UNIX=y
248CONFIG_XFRM=y
249# CONFIG_XFRM_USER is not set
238# CONFIG_NET_KEY is not set 250# CONFIG_NET_KEY is not set
239CONFIG_INET=y 251CONFIG_INET=y
240CONFIG_IP_MULTICAST=y 252CONFIG_IP_MULTICAST=y
@@ -253,6 +265,8 @@ CONFIG_IP_PNP_BOOTP=y
253# CONFIG_INET_IPCOMP is not set 265# CONFIG_INET_IPCOMP is not set
254# CONFIG_INET_XFRM_TUNNEL is not set 266# CONFIG_INET_XFRM_TUNNEL is not set
255# CONFIG_INET_TUNNEL is not set 267# CONFIG_INET_TUNNEL is not set
268CONFIG_INET_XFRM_MODE_TRANSPORT=y
269CONFIG_INET_XFRM_MODE_TUNNEL=y
256CONFIG_INET_DIAG=y 270CONFIG_INET_DIAG=y
257CONFIG_INET_TCP_DIAG=y 271CONFIG_INET_TCP_DIAG=y
258# CONFIG_TCP_CONG_ADVANCED is not set 272# CONFIG_TCP_CONG_ADVANCED is not set
@@ -260,6 +274,7 @@ CONFIG_TCP_CONG_BIC=y
260# CONFIG_IPV6 is not set 274# CONFIG_IPV6 is not set
261# CONFIG_INET6_XFRM_TUNNEL is not set 275# CONFIG_INET6_XFRM_TUNNEL is not set
262# CONFIG_INET6_TUNNEL is not set 276# CONFIG_INET6_TUNNEL is not set
277CONFIG_NETWORK_SECMARK=y
263# CONFIG_NETFILTER is not set 278# CONFIG_NETFILTER is not set
264# CONFIG_BRIDGE is not set 279# CONFIG_BRIDGE is not set
265# CONFIG_VLAN_8021Q is not set 280# CONFIG_VLAN_8021Q is not set
@@ -292,6 +307,7 @@ CONFIG_TCP_CONG_BIC=y
292CONFIG_STANDALONE=y 307CONFIG_STANDALONE=y
293# CONFIG_PREVENT_FIRMWARE_BUILD is not set 308# CONFIG_PREVENT_FIRMWARE_BUILD is not set
294# CONFIG_FW_LOADER is not set 309# CONFIG_FW_LOADER is not set
310# CONFIG_SYS_HYPERVISOR is not set
295 311
296# 312#
297# Connector - unified userspace <-> kernelspace linker 313# Connector - unified userspace <-> kernelspace linker
@@ -473,6 +489,7 @@ CONFIG_INPUT=y
473CONFIG_VT=y 489CONFIG_VT=y
474CONFIG_VT_CONSOLE=y 490CONFIG_VT_CONSOLE=y
475CONFIG_HW_CONSOLE=y 491CONFIG_HW_CONSOLE=y
492CONFIG_VT_HW_CONSOLE_BINDING=y
476# CONFIG_SERIAL_NONSTANDARD is not set 493# CONFIG_SERIAL_NONSTANDARD is not set
477 494
478# 495#
@@ -502,6 +519,7 @@ CONFIG_LEGACY_PTY_COUNT=256
502# Watchdog Cards 519# Watchdog Cards
503# 520#
504# CONFIG_WATCHDOG is not set 521# CONFIG_WATCHDOG is not set
522# CONFIG_HW_RANDOM is not set
505# CONFIG_RTC is not set 523# CONFIG_RTC is not set
506# CONFIG_GEN_RTC is not set 524# CONFIG_GEN_RTC is not set
507# CONFIG_DTLK is not set 525# CONFIG_DTLK is not set
@@ -546,6 +564,7 @@ CONFIG_LEGACY_PTY_COUNT=256
546# Multimedia devices 564# Multimedia devices
547# 565#
548# CONFIG_VIDEO_DEV is not set 566# CONFIG_VIDEO_DEV is not set
567CONFIG_VIDEO_V4L2=y
549 568
550# 569#
551# Digital Video Broadcasting Devices 570# Digital Video Broadcasting Devices
@@ -555,6 +574,7 @@ CONFIG_LEGACY_PTY_COUNT=256
555# 574#
556# Graphics support 575# Graphics support
557# 576#
577# CONFIG_FIRMWARE_EDID is not set
558# CONFIG_FB is not set 578# CONFIG_FB is not set
559 579
560# 580#
@@ -617,6 +637,19 @@ CONFIG_DUMMY_CONSOLE=y
617# 637#
618 638
619# 639#
640# DMA Engine support
641#
642# CONFIG_DMA_ENGINE is not set
643
644#
645# DMA Clients
646#
647
648#
649# DMA Devices
650#
651
652#
620# File systems 653# File systems
621# 654#
622# CONFIG_EXT2_FS is not set 655# CONFIG_EXT2_FS is not set
@@ -628,6 +661,7 @@ CONFIG_DUMMY_CONSOLE=y
628# CONFIG_MINIX_FS is not set 661# CONFIG_MINIX_FS is not set
629# CONFIG_ROMFS_FS is not set 662# CONFIG_ROMFS_FS is not set
630CONFIG_INOTIFY=y 663CONFIG_INOTIFY=y
664CONFIG_INOTIFY_USER=y
631# CONFIG_QUOTA is not set 665# CONFIG_QUOTA is not set
632# CONFIG_DNOTIFY is not set 666# CONFIG_DNOTIFY is not set
633# CONFIG_AUTOFS_FS is not set 667# CONFIG_AUTOFS_FS is not set
@@ -682,6 +716,7 @@ CONFIG_NFS_COMMON=y
682CONFIG_SUNRPC=y 716CONFIG_SUNRPC=y
683# CONFIG_SMB_FS is not set 717# CONFIG_SMB_FS is not set
684# CONFIG_CIFS is not set 718# CONFIG_CIFS is not set
719# CONFIG_CIFS_DEBUG2 is not set
685# CONFIG_NCP_FS is not set 720# CONFIG_NCP_FS is not set
686# CONFIG_CODA_FS is not set 721# CONFIG_CODA_FS is not set
687 722
@@ -701,6 +736,7 @@ CONFIG_MSDOS_PARTITION=y
701# 736#
702# CONFIG_PRINTK_TIME is not set 737# CONFIG_PRINTK_TIME is not set
703# CONFIG_MAGIC_SYSRQ is not set 738# CONFIG_MAGIC_SYSRQ is not set
739# CONFIG_UNUSED_SYMBOLS is not set
704# CONFIG_DEBUG_KERNEL is not set 740# CONFIG_DEBUG_KERNEL is not set
705CONFIG_LOG_BUF_SHIFT=14 741CONFIG_LOG_BUF_SHIFT=14
706# CONFIG_DEBUG_FS is not set 742# CONFIG_DEBUG_FS is not set
diff --git a/arch/mips/configs/rbhma4500_defconfig b/arch/mips/configs/rbhma4500_defconfig
index b16731f3684b..6779f449bd2d 100644
--- a/arch/mips/configs/rbhma4500_defconfig
+++ b/arch/mips/configs/rbhma4500_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:51:16 2006 4# Thu Jul 6 10:04:19 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MIPS=y
45# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -72,6 +75,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
72CONFIG_GENERIC_FIND_NEXT_BIT=y 75CONFIG_GENERIC_FIND_NEXT_BIT=y
73CONFIG_GENERIC_HWEIGHT=y 76CONFIG_GENERIC_HWEIGHT=y
74CONFIG_GENERIC_CALIBRATE_DELAY=y 77CONFIG_GENERIC_CALIBRATE_DELAY=y
78CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
75CONFIG_DMA_NONCOHERENT=y 79CONFIG_DMA_NONCOHERENT=y
76CONFIG_DMA_NEED_PCI_MAP_STATE=y 80CONFIG_DMA_NEED_PCI_MAP_STATE=y
77CONFIG_GENERIC_ISA_DMA=y 81CONFIG_GENERIC_ISA_DMA=y
@@ -122,7 +126,10 @@ CONFIG_PAGE_SIZE_4KB=y
122# CONFIG_PAGE_SIZE_16KB is not set 126# CONFIG_PAGE_SIZE_16KB is not set
123# CONFIG_PAGE_SIZE_64KB is not set 127# CONFIG_PAGE_SIZE_64KB is not set
124CONFIG_CPU_HAS_PREFETCH=y 128CONFIG_CPU_HAS_PREFETCH=y
125# CONFIG_MIPS_MT is not set 129CONFIG_MIPS_MT_DISABLED=y
130# CONFIG_MIPS_MT_SMTC is not set
131# CONFIG_MIPS_MT_SMP is not set
132# CONFIG_MIPS_VPE_LOADER is not set
126CONFIG_CPU_HAS_LLSC=y 133CONFIG_CPU_HAS_LLSC=y
127CONFIG_CPU_HAS_SYNC=y 134CONFIG_CPU_HAS_SYNC=y
128CONFIG_GENERIC_HARDIRQS=y 135CONFIG_GENERIC_HARDIRQS=y
@@ -136,6 +143,7 @@ CONFIG_FLATMEM=y
136CONFIG_FLAT_NODE_MEM_MAP=y 143CONFIG_FLAT_NODE_MEM_MAP=y
137# CONFIG_SPARSEMEM_STATIC is not set 144# CONFIG_SPARSEMEM_STATIC is not set
138CONFIG_SPLIT_PTLOCK_CPUS=4 145CONFIG_SPLIT_PTLOCK_CPUS=4
146# CONFIG_RESOURCES_64BIT is not set
139# CONFIG_HZ_48 is not set 147# CONFIG_HZ_48 is not set
140# CONFIG_HZ_100 is not set 148# CONFIG_HZ_100 is not set
141# CONFIG_HZ_128 is not set 149# CONFIG_HZ_128 is not set
@@ -148,6 +156,7 @@ CONFIG_HZ=1000
148CONFIG_PREEMPT_NONE=y 156CONFIG_PREEMPT_NONE=y
149# CONFIG_PREEMPT_VOLUNTARY is not set 157# CONFIG_PREEMPT_VOLUNTARY is not set
150# CONFIG_PREEMPT is not set 158# CONFIG_PREEMPT is not set
159CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
151 160
152# 161#
153# Code maturity level options 162# Code maturity level options
@@ -184,10 +193,10 @@ CONFIG_BASE_FULL=y
184# CONFIG_EPOLL is not set 193# CONFIG_EPOLL is not set
185CONFIG_SHMEM=y 194CONFIG_SHMEM=y
186CONFIG_SLAB=y 195CONFIG_SLAB=y
196CONFIG_VM_EVENT_COUNTERS=y
187# CONFIG_TINY_SHMEM is not set 197# CONFIG_TINY_SHMEM is not set
188CONFIG_BASE_SMALL=0 198CONFIG_BASE_SMALL=0
189# CONFIG_SLOB is not set 199# CONFIG_SLOB is not set
190CONFIG_OBSOLETE_INTERMODULE=y
191 200
192# 201#
193# Loadable module support 202# Loadable module support
@@ -255,6 +264,8 @@ CONFIG_NET=y
255CONFIG_PACKET=y 264CONFIG_PACKET=y
256# CONFIG_PACKET_MMAP is not set 265# CONFIG_PACKET_MMAP is not set
257CONFIG_UNIX=y 266CONFIG_UNIX=y
267CONFIG_XFRM=y
268# CONFIG_XFRM_USER is not set
258# CONFIG_NET_KEY is not set 269# CONFIG_NET_KEY is not set
259CONFIG_INET=y 270CONFIG_INET=y
260CONFIG_IP_MULTICAST=y 271CONFIG_IP_MULTICAST=y
@@ -274,6 +285,8 @@ CONFIG_IP_PNP_BOOTP=y
274# CONFIG_INET_IPCOMP is not set 285# CONFIG_INET_IPCOMP is not set
275# CONFIG_INET_XFRM_TUNNEL is not set 286# CONFIG_INET_XFRM_TUNNEL is not set
276# CONFIG_INET_TUNNEL is not set 287# CONFIG_INET_TUNNEL is not set
288CONFIG_INET_XFRM_MODE_TRANSPORT=m
289CONFIG_INET_XFRM_MODE_TUNNEL=m
277CONFIG_INET_DIAG=y 290CONFIG_INET_DIAG=y
278CONFIG_INET_TCP_DIAG=y 291CONFIG_INET_TCP_DIAG=y
279# CONFIG_TCP_CONG_ADVANCED is not set 292# CONFIG_TCP_CONG_ADVANCED is not set
@@ -292,7 +305,10 @@ CONFIG_IPV6_ROUTE_INFO=y
292# CONFIG_INET6_IPCOMP is not set 305# CONFIG_INET6_IPCOMP is not set
293# CONFIG_INET6_XFRM_TUNNEL is not set 306# CONFIG_INET6_XFRM_TUNNEL is not set
294# CONFIG_INET6_TUNNEL is not set 307# CONFIG_INET6_TUNNEL is not set
308CONFIG_INET6_XFRM_MODE_TRANSPORT=m
309CONFIG_INET6_XFRM_MODE_TUNNEL=m
295# CONFIG_IPV6_TUNNEL is not set 310# CONFIG_IPV6_TUNNEL is not set
311CONFIG_NETWORK_SECMARK=y
296CONFIG_NETFILTER=y 312CONFIG_NETFILTER=y
297# CONFIG_NETFILTER_DEBUG is not set 313# CONFIG_NETFILTER_DEBUG is not set
298 314
@@ -307,6 +323,7 @@ CONFIG_NETFILTER_XTABLES=m
307CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m 323CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
308CONFIG_NETFILTER_XT_TARGET_MARK=m 324CONFIG_NETFILTER_XT_TARGET_MARK=m
309CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m 325CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
326CONFIG_NETFILTER_XT_TARGET_SECMARK=m
310CONFIG_NETFILTER_XT_MATCH_COMMENT=m 327CONFIG_NETFILTER_XT_MATCH_COMMENT=m
311CONFIG_NETFILTER_XT_MATCH_DCCP=m 328CONFIG_NETFILTER_XT_MATCH_DCCP=m
312CONFIG_NETFILTER_XT_MATCH_ESP=m 329CONFIG_NETFILTER_XT_MATCH_ESP=m
@@ -314,10 +331,13 @@ CONFIG_NETFILTER_XT_MATCH_LENGTH=m
314CONFIG_NETFILTER_XT_MATCH_LIMIT=m 331CONFIG_NETFILTER_XT_MATCH_LIMIT=m
315CONFIG_NETFILTER_XT_MATCH_MAC=m 332CONFIG_NETFILTER_XT_MATCH_MAC=m
316CONFIG_NETFILTER_XT_MATCH_MARK=m 333CONFIG_NETFILTER_XT_MATCH_MARK=m
334# CONFIG_NETFILTER_XT_MATCH_POLICY is not set
317CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m 335CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
318CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 336CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
337CONFIG_NETFILTER_XT_MATCH_QUOTA=m
319CONFIG_NETFILTER_XT_MATCH_REALM=m 338CONFIG_NETFILTER_XT_MATCH_REALM=m
320CONFIG_NETFILTER_XT_MATCH_SCTP=m 339CONFIG_NETFILTER_XT_MATCH_SCTP=m
340CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
321CONFIG_NETFILTER_XT_MATCH_STRING=m 341CONFIG_NETFILTER_XT_MATCH_STRING=m
322CONFIG_NETFILTER_XT_MATCH_TCPMSS=m 342CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
323 343
@@ -394,6 +414,7 @@ CONFIG_WIRELESS_EXT=y
394CONFIG_STANDALONE=y 414CONFIG_STANDALONE=y
395CONFIG_PREVENT_FIRMWARE_BUILD=y 415CONFIG_PREVENT_FIRMWARE_BUILD=y
396CONFIG_FW_LOADER=m 416CONFIG_FW_LOADER=m
417# CONFIG_SYS_HYPERVISOR is not set
397 418
398# 419#
399# Connector - unified userspace <-> kernelspace linker 420# Connector - unified userspace <-> kernelspace linker
@@ -624,6 +645,8 @@ CONFIG_DAVICOM_PHY=m
624CONFIG_QSEMI_PHY=m 645CONFIG_QSEMI_PHY=m
625CONFIG_LXT_PHY=m 646CONFIG_LXT_PHY=m
626CONFIG_CICADA_PHY=m 647CONFIG_CICADA_PHY=m
648CONFIG_VITESSE_PHY=m
649CONFIG_SMSC_PHY=m
627 650
628# 651#
629# Ethernet (10 or 100Mbit) 652# Ethernet (10 or 100Mbit)
@@ -704,6 +727,7 @@ CONFIG_NET_PCI=y
704# CONFIG_CHELSIO_T1 is not set 727# CONFIG_CHELSIO_T1 is not set
705# CONFIG_IXGB is not set 728# CONFIG_IXGB is not set
706# CONFIG_S2IO is not set 729# CONFIG_S2IO is not set
730# CONFIG_MYRI10GE is not set
707 731
708# 732#
709# Token Ring devices 733# Token Ring devices
@@ -729,7 +753,7 @@ CONFIG_NET_RADIO=y
729# CONFIG_IPW2100 is not set 753# CONFIG_IPW2100 is not set
730CONFIG_IPW2200=m 754CONFIG_IPW2200=m
731# CONFIG_IPW2200_MONITOR is not set 755# CONFIG_IPW2200_MONITOR is not set
732# CONFIG_IPW_QOS is not set 756# CONFIG_IPW2200_QOS is not set
733# CONFIG_IPW2200_DEBUG is not set 757# CONFIG_IPW2200_DEBUG is not set
734# CONFIG_HERMES is not set 758# CONFIG_HERMES is not set
735# CONFIG_ATMEL is not set 759# CONFIG_ATMEL is not set
@@ -738,8 +762,10 @@ CONFIG_IPW2200=m
738# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support 762# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support
739# 763#
740# CONFIG_PRISM54 is not set 764# CONFIG_PRISM54 is not set
765# CONFIG_USB_ZD1201 is not set
741# CONFIG_HOSTAP is not set 766# CONFIG_HOSTAP is not set
742# CONFIG_BCM43XX is not set 767# CONFIG_BCM43XX is not set
768# CONFIG_ZD1211RW is not set
743CONFIG_NET_WIRELESS=y 769CONFIG_NET_WIRELESS=y
744 770
745# 771#
@@ -827,6 +853,7 @@ CONFIG_SERIO_LIBPS2=y
827CONFIG_VT=y 853CONFIG_VT=y
828CONFIG_VT_CONSOLE=y 854CONFIG_VT_CONSOLE=y
829CONFIG_HW_CONSOLE=y 855CONFIG_HW_CONSOLE=y
856CONFIG_VT_HW_CONSOLE_BINDING=y
830# CONFIG_SERIAL_NONSTANDARD is not set 857# CONFIG_SERIAL_NONSTANDARD is not set
831 858
832# 859#
@@ -856,6 +883,7 @@ CONFIG_LEGACY_PTY_COUNT=256
856# Watchdog Cards 883# Watchdog Cards
857# 884#
858# CONFIG_WATCHDOG is not set 885# CONFIG_WATCHDOG is not set
886# CONFIG_HW_RANDOM is not set
859# CONFIG_RTC is not set 887# CONFIG_RTC is not set
860# CONFIG_GEN_RTC is not set 888# CONFIG_GEN_RTC is not set
861# CONFIG_DTLK is not set 889# CONFIG_DTLK is not set
@@ -895,6 +923,7 @@ CONFIG_LEGACY_PTY_COUNT=256
895# 923#
896CONFIG_HWMON=y 924CONFIG_HWMON=y
897# CONFIG_HWMON_VID is not set 925# CONFIG_HWMON_VID is not set
926# CONFIG_SENSORS_ABITUGURU is not set
898# CONFIG_SENSORS_F71805F is not set 927# CONFIG_SENSORS_F71805F is not set
899# CONFIG_HWMON_DEBUG_CHIP is not set 928# CONFIG_HWMON_DEBUG_CHIP is not set
900 929
@@ -906,6 +935,7 @@ CONFIG_HWMON=y
906# Multimedia devices 935# Multimedia devices
907# 936#
908# CONFIG_VIDEO_DEV is not set 937# CONFIG_VIDEO_DEV is not set
938CONFIG_VIDEO_V4L2=y
909 939
910# 940#
911# Digital Video Broadcasting Devices 941# Digital Video Broadcasting Devices
@@ -916,12 +946,13 @@ CONFIG_HWMON=y
916# 946#
917# Graphics support 947# Graphics support
918# 948#
949# CONFIG_FIRMWARE_EDID is not set
919CONFIG_FB=y 950CONFIG_FB=y
920CONFIG_FB_CFB_FILLRECT=y 951CONFIG_FB_CFB_FILLRECT=y
921CONFIG_FB_CFB_COPYAREA=y 952CONFIG_FB_CFB_COPYAREA=y
922CONFIG_FB_CFB_IMAGEBLIT=y 953CONFIG_FB_CFB_IMAGEBLIT=y
923# CONFIG_FB_MACMODES is not set 954# CONFIG_FB_MACMODES is not set
924CONFIG_FB_FIRMWARE_EDID=y 955# CONFIG_FB_BACKLIGHT is not set
925# CONFIG_FB_MODE_HELPERS is not set 956# CONFIG_FB_MODE_HELPERS is not set
926# CONFIG_FB_TILEBLITTING is not set 957# CONFIG_FB_TILEBLITTING is not set
927# CONFIG_FB_CIRRUS is not set 958# CONFIG_FB_CIRRUS is not set
@@ -1045,7 +1076,6 @@ CONFIG_USB_YEALINK=m
1045# CONFIG_USB_PEGASUS is not set 1076# CONFIG_USB_PEGASUS is not set
1046# CONFIG_USB_RTL8150 is not set 1077# CONFIG_USB_RTL8150 is not set
1047# CONFIG_USB_USBNET is not set 1078# CONFIG_USB_USBNET is not set
1048# CONFIG_USB_ZD1201 is not set
1049CONFIG_USB_MON=y 1079CONFIG_USB_MON=y
1050 1080
1051# 1081#
@@ -1067,10 +1097,12 @@ CONFIG_USB_MON=y
1067# CONFIG_USB_LEGOTOWER is not set 1097# CONFIG_USB_LEGOTOWER is not set
1068# CONFIG_USB_LCD is not set 1098# CONFIG_USB_LCD is not set
1069# CONFIG_USB_LED is not set 1099# CONFIG_USB_LED is not set
1100# CONFIG_USB_CY7C63 is not set
1070# CONFIG_USB_CYTHERM is not set 1101# CONFIG_USB_CYTHERM is not set
1071# CONFIG_USB_PHIDGETKIT is not set 1102# CONFIG_USB_PHIDGETKIT is not set
1072# CONFIG_USB_PHIDGETSERVO is not set 1103# CONFIG_USB_PHIDGETSERVO is not set
1073# CONFIG_USB_IDMOUSE is not set 1104# CONFIG_USB_IDMOUSE is not set
1105# CONFIG_USB_APPLEDISPLAY is not set
1074# CONFIG_USB_LD is not set 1106# CONFIG_USB_LD is not set
1075 1107
1076# 1108#
@@ -1115,6 +1147,19 @@ CONFIG_USB_MON=y
1115# CONFIG_RTC_CLASS is not set 1147# CONFIG_RTC_CLASS is not set
1116 1148
1117# 1149#
1150# DMA Engine support
1151#
1152# CONFIG_DMA_ENGINE is not set
1153
1154#
1155# DMA Clients
1156#
1157
1158#
1159# DMA Devices
1160#
1161
1162#
1118# File systems 1163# File systems
1119# 1164#
1120CONFIG_EXT2_FS=y 1165CONFIG_EXT2_FS=y
@@ -1134,7 +1179,6 @@ CONFIG_REISERFS_FS=m
1134# CONFIG_JFS_FS is not set 1179# CONFIG_JFS_FS is not set
1135# CONFIG_FS_POSIX_ACL is not set 1180# CONFIG_FS_POSIX_ACL is not set
1136CONFIG_XFS_FS=m 1181CONFIG_XFS_FS=m
1137CONFIG_XFS_EXPORT=y
1138# CONFIG_XFS_QUOTA is not set 1182# CONFIG_XFS_QUOTA is not set
1139# CONFIG_XFS_SECURITY is not set 1183# CONFIG_XFS_SECURITY is not set
1140# CONFIG_XFS_POSIX_ACL is not set 1184# CONFIG_XFS_POSIX_ACL is not set
@@ -1143,6 +1187,7 @@ CONFIG_XFS_EXPORT=y
1143# CONFIG_MINIX_FS is not set 1187# CONFIG_MINIX_FS is not set
1144# CONFIG_ROMFS_FS is not set 1188# CONFIG_ROMFS_FS is not set
1145CONFIG_INOTIFY=y 1189CONFIG_INOTIFY=y
1190CONFIG_INOTIFY_USER=y
1146# CONFIG_QUOTA is not set 1191# CONFIG_QUOTA is not set
1147# CONFIG_DNOTIFY is not set 1192# CONFIG_DNOTIFY is not set
1148# CONFIG_AUTOFS_FS is not set 1193# CONFIG_AUTOFS_FS is not set
@@ -1193,6 +1238,7 @@ CONFIG_JFFS2_FS=y
1193CONFIG_JFFS2_FS_DEBUG=0 1238CONFIG_JFFS2_FS_DEBUG=0
1194CONFIG_JFFS2_FS_WRITEBUFFER=y 1239CONFIG_JFFS2_FS_WRITEBUFFER=y
1195# CONFIG_JFFS2_SUMMARY is not set 1240# CONFIG_JFFS2_SUMMARY is not set
1241# CONFIG_JFFS2_FS_XATTR is not set
1196# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set 1242# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
1197CONFIG_JFFS2_ZLIB=y 1243CONFIG_JFFS2_ZLIB=y
1198CONFIG_JFFS2_RTIME=y 1244CONFIG_JFFS2_RTIME=y
@@ -1226,6 +1272,7 @@ CONFIG_SUNRPC=y
1226CONFIG_SMB_FS=m 1272CONFIG_SMB_FS=m
1227# CONFIG_SMB_NLS_DEFAULT is not set 1273# CONFIG_SMB_NLS_DEFAULT is not set
1228# CONFIG_CIFS is not set 1274# CONFIG_CIFS is not set
1275# CONFIG_CIFS_DEBUG2 is not set
1229# CONFIG_NCP_FS is not set 1276# CONFIG_NCP_FS is not set
1230# CONFIG_CODA_FS is not set 1277# CONFIG_CODA_FS is not set
1231# CONFIG_AFS_FS is not set 1278# CONFIG_AFS_FS is not set
@@ -1291,6 +1338,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1291# 1338#
1292# CONFIG_PRINTK_TIME is not set 1339# CONFIG_PRINTK_TIME is not set
1293# CONFIG_MAGIC_SYSRQ is not set 1340# CONFIG_MAGIC_SYSRQ is not set
1341# CONFIG_UNUSED_SYMBOLS is not set
1294# CONFIG_DEBUG_KERNEL is not set 1342# CONFIG_DEBUG_KERNEL is not set
1295CONFIG_LOG_BUF_SHIFT=14 1343CONFIG_LOG_BUF_SHIFT=14
1296# CONFIG_DEBUG_FS is not set 1344# CONFIG_DEBUG_FS is not set
diff --git a/arch/mips/configs/rm200_defconfig b/arch/mips/configs/rm200_defconfig
index 8b0dd8651264..b7826d3a2b77 100644
--- a/arch/mips/configs/rm200_defconfig
+++ b/arch/mips/configs/rm200_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:51:16 2006 4# Thu Jul 6 10:04:19 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MIPS=y
45# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -65,6 +68,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
65CONFIG_GENERIC_FIND_NEXT_BIT=y 68CONFIG_GENERIC_FIND_NEXT_BIT=y
66CONFIG_GENERIC_HWEIGHT=y 69CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 70CONFIG_GENERIC_CALIBRATE_DELAY=y
71CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
68CONFIG_ARC=y 72CONFIG_ARC=y
69CONFIG_ARCH_MAY_HAVE_PC_FDC=y 73CONFIG_ARCH_MAY_HAVE_PC_FDC=y
70CONFIG_DMA_NONCOHERENT=y 74CONFIG_DMA_NONCOHERENT=y
@@ -106,6 +110,7 @@ CONFIG_CPU_R4X00=y
106# CONFIG_CPU_RM9000 is not set 110# CONFIG_CPU_RM9000 is not set
107# CONFIG_CPU_SB1 is not set 111# CONFIG_CPU_SB1 is not set
108CONFIG_SYS_HAS_CPU_R4X00=y 112CONFIG_SYS_HAS_CPU_R4X00=y
113CONFIG_SYS_HAS_CPU_R5000=y
109CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y 114CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
110CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y 115CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
111CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y 116CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
@@ -120,7 +125,12 @@ CONFIG_PAGE_SIZE_4KB=y
120# CONFIG_PAGE_SIZE_8KB is not set 125# CONFIG_PAGE_SIZE_8KB is not set
121# CONFIG_PAGE_SIZE_16KB is not set 126# CONFIG_PAGE_SIZE_16KB is not set
122# CONFIG_PAGE_SIZE_64KB is not set 127# CONFIG_PAGE_SIZE_64KB is not set
123# CONFIG_MIPS_MT is not set 128CONFIG_BOARD_SCACHE=y
129CONFIG_R5000_CPU_SCACHE=y
130CONFIG_MIPS_MT_DISABLED=y
131# CONFIG_MIPS_MT_SMTC is not set
132# CONFIG_MIPS_MT_SMP is not set
133# CONFIG_MIPS_VPE_LOADER is not set
124# CONFIG_64BIT_PHYS_ADDR is not set 134# CONFIG_64BIT_PHYS_ADDR is not set
125CONFIG_CPU_HAS_LLSC=y 135CONFIG_CPU_HAS_LLSC=y
126CONFIG_CPU_HAS_SYNC=y 136CONFIG_CPU_HAS_SYNC=y
@@ -136,6 +146,7 @@ CONFIG_FLATMEM=y
136CONFIG_FLAT_NODE_MEM_MAP=y 146CONFIG_FLAT_NODE_MEM_MAP=y
137# CONFIG_SPARSEMEM_STATIC is not set 147# CONFIG_SPARSEMEM_STATIC is not set
138CONFIG_SPLIT_PTLOCK_CPUS=4 148CONFIG_SPLIT_PTLOCK_CPUS=4
149# CONFIG_RESOURCES_64BIT is not set
139# CONFIG_HZ_48 is not set 150# CONFIG_HZ_48 is not set
140# CONFIG_HZ_100 is not set 151# CONFIG_HZ_100 is not set
141# CONFIG_HZ_128 is not set 152# CONFIG_HZ_128 is not set
@@ -148,6 +159,7 @@ CONFIG_HZ=1000
148# CONFIG_PREEMPT_NONE is not set 159# CONFIG_PREEMPT_NONE is not set
149CONFIG_PREEMPT_VOLUNTARY=y 160CONFIG_PREEMPT_VOLUNTARY=y
150# CONFIG_PREEMPT is not set 161# CONFIG_PREEMPT is not set
162CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
151 163
152# 164#
153# Code maturity level options 165# Code maturity level options
@@ -181,10 +193,12 @@ CONFIG_PRINTK=y
181CONFIG_BUG=y 193CONFIG_BUG=y
182CONFIG_ELF_CORE=y 194CONFIG_ELF_CORE=y
183CONFIG_BASE_FULL=y 195CONFIG_BASE_FULL=y
196CONFIG_RT_MUTEXES=y
184CONFIG_FUTEX=y 197CONFIG_FUTEX=y
185CONFIG_EPOLL=y 198CONFIG_EPOLL=y
186CONFIG_SHMEM=y 199CONFIG_SHMEM=y
187CONFIG_SLAB=y 200CONFIG_SLAB=y
201CONFIG_VM_EVENT_COUNTERS=y
188# CONFIG_TINY_SHMEM is not set 202# CONFIG_TINY_SHMEM is not set
189CONFIG_BASE_SMALL=0 203CONFIG_BASE_SMALL=0
190# CONFIG_SLOB is not set 204# CONFIG_SLOB is not set
@@ -280,6 +294,8 @@ CONFIG_IP_PIMSM_V2=y
280# CONFIG_INET_IPCOMP is not set 294# CONFIG_INET_IPCOMP is not set
281# CONFIG_INET_XFRM_TUNNEL is not set 295# CONFIG_INET_XFRM_TUNNEL is not set
282CONFIG_INET_TUNNEL=m 296CONFIG_INET_TUNNEL=m
297CONFIG_INET_XFRM_MODE_TRANSPORT=m
298CONFIG_INET_XFRM_MODE_TUNNEL=m
283CONFIG_INET_DIAG=y 299CONFIG_INET_DIAG=y
284CONFIG_INET_TCP_DIAG=y 300CONFIG_INET_TCP_DIAG=y
285# CONFIG_TCP_CONG_ADVANCED is not set 301# CONFIG_TCP_CONG_ADVANCED is not set
@@ -298,7 +314,10 @@ CONFIG_INET6_ESP=m
298CONFIG_INET6_IPCOMP=m 314CONFIG_INET6_IPCOMP=m
299CONFIG_INET6_XFRM_TUNNEL=m 315CONFIG_INET6_XFRM_TUNNEL=m
300CONFIG_INET6_TUNNEL=m 316CONFIG_INET6_TUNNEL=m
317CONFIG_INET6_XFRM_MODE_TRANSPORT=m
318CONFIG_INET6_XFRM_MODE_TUNNEL=m
301CONFIG_IPV6_TUNNEL=m 319CONFIG_IPV6_TUNNEL=m
320CONFIG_NETWORK_SECMARK=y
302CONFIG_NETFILTER=y 321CONFIG_NETFILTER=y
303# CONFIG_NETFILTER_DEBUG is not set 322# CONFIG_NETFILTER_DEBUG is not set
304CONFIG_BRIDGE_NETFILTER=y 323CONFIG_BRIDGE_NETFILTER=y
@@ -315,6 +334,8 @@ CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
315CONFIG_NETFILTER_XT_TARGET_MARK=m 334CONFIG_NETFILTER_XT_TARGET_MARK=m
316CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m 335CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
317CONFIG_NETFILTER_XT_TARGET_NOTRACK=m 336CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
337CONFIG_NETFILTER_XT_TARGET_SECMARK=m
338# CONFIG_NETFILTER_XT_TARGET_CONNSECMARK is not set
318CONFIG_NETFILTER_XT_MATCH_COMMENT=m 339CONFIG_NETFILTER_XT_MATCH_COMMENT=m
319CONFIG_NETFILTER_XT_MATCH_CONNMARK=m 340CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
320CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m 341CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
@@ -329,9 +350,11 @@ CONFIG_NETFILTER_XT_MATCH_POLICY=m
329CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m 350CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
330CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m 351CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m
331CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 352CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
353CONFIG_NETFILTER_XT_MATCH_QUOTA=m
332CONFIG_NETFILTER_XT_MATCH_REALM=m 354CONFIG_NETFILTER_XT_MATCH_REALM=m
333CONFIG_NETFILTER_XT_MATCH_SCTP=m 355CONFIG_NETFILTER_XT_MATCH_SCTP=m
334CONFIG_NETFILTER_XT_MATCH_STATE=m 356CONFIG_NETFILTER_XT_MATCH_STATE=m
357CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
335CONFIG_NETFILTER_XT_MATCH_STRING=m 358CONFIG_NETFILTER_XT_MATCH_STRING=m
336CONFIG_NETFILTER_XT_MATCH_TCPMSS=m 359CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
337 360
@@ -341,6 +364,7 @@ CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
341CONFIG_IP_NF_CONNTRACK=m 364CONFIG_IP_NF_CONNTRACK=m
342# CONFIG_IP_NF_CT_ACCT is not set 365# CONFIG_IP_NF_CT_ACCT is not set
343CONFIG_IP_NF_CONNTRACK_MARK=y 366CONFIG_IP_NF_CONNTRACK_MARK=y
367CONFIG_IP_NF_CONNTRACK_SECMARK=y
344CONFIG_IP_NF_CONNTRACK_EVENTS=y 368CONFIG_IP_NF_CONNTRACK_EVENTS=y
345CONFIG_IP_NF_CONNTRACK_NETLINK=m 369CONFIG_IP_NF_CONNTRACK_NETLINK=m
346CONFIG_IP_NF_CT_PROTO_SCTP=m 370CONFIG_IP_NF_CT_PROTO_SCTP=m
@@ -351,6 +375,7 @@ CONFIG_IP_NF_TFTP=m
351CONFIG_IP_NF_AMANDA=m 375CONFIG_IP_NF_AMANDA=m
352CONFIG_IP_NF_PPTP=m 376CONFIG_IP_NF_PPTP=m
353CONFIG_IP_NF_H323=m 377CONFIG_IP_NF_H323=m
378CONFIG_IP_NF_SIP=m
354CONFIG_IP_NF_QUEUE=m 379CONFIG_IP_NF_QUEUE=m
355CONFIG_IP_NF_IPTABLES=m 380CONFIG_IP_NF_IPTABLES=m
356CONFIG_IP_NF_MATCH_IPRANGE=m 381CONFIG_IP_NF_MATCH_IPRANGE=m
@@ -381,6 +406,7 @@ CONFIG_IP_NF_NAT_TFTP=m
381CONFIG_IP_NF_NAT_AMANDA=m 406CONFIG_IP_NF_NAT_AMANDA=m
382CONFIG_IP_NF_NAT_PPTP=m 407CONFIG_IP_NF_NAT_PPTP=m
383CONFIG_IP_NF_NAT_H323=m 408CONFIG_IP_NF_NAT_H323=m
409CONFIG_IP_NF_NAT_SIP=m
384CONFIG_IP_NF_MANGLE=m 410CONFIG_IP_NF_MANGLE=m
385CONFIG_IP_NF_TARGET_TOS=m 411CONFIG_IP_NF_TARGET_TOS=m
386CONFIG_IP_NF_TARGET_ECN=m 412CONFIG_IP_NF_TARGET_ECN=m
@@ -559,6 +585,7 @@ CONFIG_WIRELESS_EXT=y
559CONFIG_STANDALONE=y 585CONFIG_STANDALONE=y
560CONFIG_PREVENT_FIRMWARE_BUILD=y 586CONFIG_PREVENT_FIRMWARE_BUILD=y
561CONFIG_FW_LOADER=y 587CONFIG_FW_LOADER=y
588# CONFIG_SYS_HYPERVISOR is not set
562 589
563# 590#
564# Connector - unified userspace <-> kernelspace linker 591# Connector - unified userspace <-> kernelspace linker
@@ -580,6 +607,7 @@ CONFIG_PARPORT_SERIAL=m
580# CONFIG_PARPORT_PC_SUPERIO is not set 607# CONFIG_PARPORT_PC_SUPERIO is not set
581CONFIG_PARPORT_NOT_PC=y 608CONFIG_PARPORT_NOT_PC=y
582# CONFIG_PARPORT_GSC is not set 609# CONFIG_PARPORT_GSC is not set
610# CONFIG_PARPORT_AX88796 is not set
583CONFIG_PARPORT_1284=y 611CONFIG_PARPORT_1284=y
584 612
585# 613#
@@ -699,6 +727,7 @@ CONFIG_MEGARAID_MAILBOX=m
699# CONFIG_MEGARAID_LEGACY is not set 727# CONFIG_MEGARAID_LEGACY is not set
700# CONFIG_MEGARAID_SAS is not set 728# CONFIG_MEGARAID_SAS is not set
701# CONFIG_SCSI_SATA is not set 729# CONFIG_SCSI_SATA is not set
730# CONFIG_SCSI_HPTIOP is not set
702# CONFIG_SCSI_DMX3191D is not set 731# CONFIG_SCSI_DMX3191D is not set
703# CONFIG_SCSI_DTC3280 is not set 732# CONFIG_SCSI_DTC3280 is not set
704# CONFIG_SCSI_FUTURE_DOMAIN is not set 733# CONFIG_SCSI_FUTURE_DOMAIN is not set
@@ -745,9 +774,8 @@ CONFIG_MD_LINEAR=m
745CONFIG_MD_RAID0=m 774CONFIG_MD_RAID0=m
746CONFIG_MD_RAID1=m 775CONFIG_MD_RAID1=m
747CONFIG_MD_RAID10=m 776CONFIG_MD_RAID10=m
748CONFIG_MD_RAID5=m 777CONFIG_MD_RAID456=m
749CONFIG_MD_RAID5_RESHAPE=y 778CONFIG_MD_RAID5_RESHAPE=y
750# CONFIG_MD_RAID6 is not set
751CONFIG_MD_MULTIPATH=m 779CONFIG_MD_MULTIPATH=m
752CONFIG_MD_FAULTY=m 780CONFIG_MD_FAULTY=m
753CONFIG_BLK_DEV_DM=m 781CONFIG_BLK_DEV_DM=m
@@ -803,6 +831,8 @@ CONFIG_DAVICOM_PHY=m
803CONFIG_QSEMI_PHY=m 831CONFIG_QSEMI_PHY=m
804CONFIG_LXT_PHY=m 832CONFIG_LXT_PHY=m
805CONFIG_CICADA_PHY=m 833CONFIG_CICADA_PHY=m
834CONFIG_VITESSE_PHY=m
835CONFIG_SMSC_PHY=m
806 836
807# 837#
808# Ethernet (10 or 100Mbit) 838# Ethernet (10 or 100Mbit)
@@ -884,6 +914,7 @@ CONFIG_VIA_VELOCITY=m
884# CONFIG_CHELSIO_T1 is not set 914# CONFIG_CHELSIO_T1 is not set
885# CONFIG_IXGB is not set 915# CONFIG_IXGB is not set
886# CONFIG_S2IO is not set 916# CONFIG_S2IO is not set
917# CONFIG_MYRI10GE is not set
887 918
888# 919#
889# Token Ring devices 920# Token Ring devices
@@ -975,6 +1006,7 @@ CONFIG_SERIO_RAW=m
975CONFIG_VT=y 1006CONFIG_VT=y
976CONFIG_VT_CONSOLE=y 1007CONFIG_VT_CONSOLE=y
977CONFIG_HW_CONSOLE=y 1008CONFIG_HW_CONSOLE=y
1009CONFIG_VT_HW_CONSOLE_BINDING=y
978# CONFIG_SERIAL_NONSTANDARD is not set 1010# CONFIG_SERIAL_NONSTANDARD is not set
979 1011
980# 1012#
@@ -1012,6 +1044,7 @@ CONFIG_TIPAR=m
1012# Watchdog Cards 1044# Watchdog Cards
1013# 1045#
1014# CONFIG_WATCHDOG is not set 1046# CONFIG_WATCHDOG is not set
1047# CONFIG_HW_RANDOM is not set
1015CONFIG_RTC=m 1048CONFIG_RTC=m
1016# CONFIG_GEN_RTC is not set 1049# CONFIG_GEN_RTC is not set
1017# CONFIG_DTLK is not set 1050# CONFIG_DTLK is not set
@@ -1045,12 +1078,13 @@ CONFIG_RTC=m
1045# Dallas's 1-wire bus 1078# Dallas's 1-wire bus
1046# 1079#
1047CONFIG_W1=m 1080CONFIG_W1=m
1081CONFIG_W1_CON=y
1048 1082
1049# 1083#
1050# 1-wire Bus Masters 1084# 1-wire Bus Masters
1051# 1085#
1052# CONFIG_W1_MASTER_MATROX is not set 1086# CONFIG_W1_MASTER_MATROX is not set
1053# CONFIG_W1_MASTER_DS9490 is not set 1087# CONFIG_W1_MASTER_DS2490 is not set
1054 1088
1055# 1089#
1056# 1-wire Slaves 1090# 1-wire Slaves
@@ -1073,6 +1107,7 @@ CONFIG_W1=m
1073# Multimedia devices 1107# Multimedia devices
1074# 1108#
1075# CONFIG_VIDEO_DEV is not set 1109# CONFIG_VIDEO_DEV is not set
1110CONFIG_VIDEO_V4L2=y
1076 1111
1077# 1112#
1078# Digital Video Broadcasting Devices 1113# Digital Video Broadcasting Devices
@@ -1083,6 +1118,7 @@ CONFIG_USB_DABUSB=m
1083# 1118#
1084# Graphics support 1119# Graphics support
1085# 1120#
1121# CONFIG_FIRMWARE_EDID is not set
1086# CONFIG_FB is not set 1122# CONFIG_FB is not set
1087 1123
1088# 1124#
@@ -1121,6 +1157,7 @@ CONFIG_USB_DEVICEFS=y
1121CONFIG_USB_EHCI_HCD=m 1157CONFIG_USB_EHCI_HCD=m
1122# CONFIG_USB_EHCI_SPLIT_ISO is not set 1158# CONFIG_USB_EHCI_SPLIT_ISO is not set
1123# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 1159# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
1160# CONFIG_USB_EHCI_TT_NEWSCHED is not set
1124# CONFIG_USB_ISP116X_HCD is not set 1161# CONFIG_USB_ISP116X_HCD is not set
1125CONFIG_USB_OHCI_HCD=m 1162CONFIG_USB_OHCI_HCD=m
1126# CONFIG_USB_OHCI_BIG_ENDIAN is not set 1163# CONFIG_USB_OHCI_BIG_ENDIAN is not set
@@ -1219,6 +1256,7 @@ CONFIG_USB_SERIAL=m
1219CONFIG_USB_SERIAL_GENERIC=y 1256CONFIG_USB_SERIAL_GENERIC=y
1220CONFIG_USB_SERIAL_AIRPRIME=m 1257CONFIG_USB_SERIAL_AIRPRIME=m
1221CONFIG_USB_SERIAL_ANYDATA=m 1258CONFIG_USB_SERIAL_ANYDATA=m
1259# CONFIG_USB_SERIAL_ARK3116 is not set
1222CONFIG_USB_SERIAL_BELKIN=m 1260CONFIG_USB_SERIAL_BELKIN=m
1223CONFIG_USB_SERIAL_WHITEHEAT=m 1261CONFIG_USB_SERIAL_WHITEHEAT=m
1224CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m 1262CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
@@ -1259,6 +1297,7 @@ CONFIG_USB_SERIAL_SAFE_PADDED=y
1259# CONFIG_USB_SERIAL_TI is not set 1297# CONFIG_USB_SERIAL_TI is not set
1260CONFIG_USB_SERIAL_CYBERJACK=m 1298CONFIG_USB_SERIAL_CYBERJACK=m
1261CONFIG_USB_SERIAL_XIRCOM=m 1299CONFIG_USB_SERIAL_XIRCOM=m
1300# CONFIG_USB_SERIAL_OPTION is not set
1262CONFIG_USB_SERIAL_OMNINET=m 1301CONFIG_USB_SERIAL_OMNINET=m
1263CONFIG_USB_EZUSB=y 1302CONFIG_USB_EZUSB=y
1264 1303
@@ -1272,10 +1311,12 @@ CONFIG_USB_RIO500=m
1272CONFIG_USB_LEGOTOWER=m 1311CONFIG_USB_LEGOTOWER=m
1273CONFIG_USB_LCD=m 1312CONFIG_USB_LCD=m
1274CONFIG_USB_LED=m 1313CONFIG_USB_LED=m
1314# CONFIG_USB_CY7C63 is not set
1275CONFIG_USB_CYTHERM=m 1315CONFIG_USB_CYTHERM=m
1276CONFIG_USB_PHIDGETKIT=m 1316CONFIG_USB_PHIDGETKIT=m
1277CONFIG_USB_PHIDGETSERVO=m 1317CONFIG_USB_PHIDGETSERVO=m
1278# CONFIG_USB_IDMOUSE is not set 1318# CONFIG_USB_IDMOUSE is not set
1319# CONFIG_USB_APPLEDISPLAY is not set
1279CONFIG_USB_SISUSBVGA=m 1320CONFIG_USB_SISUSBVGA=m
1280# CONFIG_USB_SISUSBVGA_CON is not set 1321# CONFIG_USB_SISUSBVGA_CON is not set
1281CONFIG_USB_LD=m 1322CONFIG_USB_LD=m
@@ -1323,6 +1364,19 @@ CONFIG_USB_TEST=m
1323# CONFIG_RTC_CLASS is not set 1364# CONFIG_RTC_CLASS is not set
1324 1365
1325# 1366#
1367# DMA Engine support
1368#
1369# CONFIG_DMA_ENGINE is not set
1370
1371#
1372# DMA Clients
1373#
1374
1375#
1376# DMA Devices
1377#
1378
1379#
1326# File systems 1380# File systems
1327# 1381#
1328CONFIG_EXT2_FS=m 1382CONFIG_EXT2_FS=m
@@ -1344,7 +1398,6 @@ CONFIG_REISERFS_FS_SECURITY=y
1344# CONFIG_JFS_FS is not set 1398# CONFIG_JFS_FS is not set
1345CONFIG_FS_POSIX_ACL=y 1399CONFIG_FS_POSIX_ACL=y
1346CONFIG_XFS_FS=m 1400CONFIG_XFS_FS=m
1347CONFIG_XFS_EXPORT=y
1348CONFIG_XFS_QUOTA=y 1401CONFIG_XFS_QUOTA=y
1349CONFIG_XFS_SECURITY=y 1402CONFIG_XFS_SECURITY=y
1350# CONFIG_XFS_POSIX_ACL is not set 1403# CONFIG_XFS_POSIX_ACL is not set
@@ -1353,6 +1406,7 @@ CONFIG_XFS_SECURITY=y
1353CONFIG_MINIX_FS=m 1406CONFIG_MINIX_FS=m
1354CONFIG_ROMFS_FS=m 1407CONFIG_ROMFS_FS=m
1355CONFIG_INOTIFY=y 1408CONFIG_INOTIFY=y
1409CONFIG_INOTIFY_USER=y
1356# CONFIG_QUOTA is not set 1410# CONFIG_QUOTA is not set
1357CONFIG_QUOTACTL=y 1411CONFIG_QUOTACTL=y
1358CONFIG_DNOTIFY=y 1412CONFIG_DNOTIFY=y
@@ -1411,6 +1465,8 @@ CONFIG_HPFS_FS=m
1411CONFIG_QNX4FS_FS=m 1465CONFIG_QNX4FS_FS=m
1412CONFIG_SYSV_FS=m 1466CONFIG_SYSV_FS=m
1413CONFIG_UFS_FS=m 1467CONFIG_UFS_FS=m
1468# CONFIG_UFS_FS_WRITE is not set
1469# CONFIG_UFS_DEBUG is not set
1414 1470
1415# 1471#
1416# Network File Systems 1472# Network File Systems
@@ -1437,7 +1493,9 @@ CONFIG_SMB_FS=m
1437# CONFIG_SMB_NLS_DEFAULT is not set 1493# CONFIG_SMB_NLS_DEFAULT is not set
1438CONFIG_CIFS=m 1494CONFIG_CIFS=m
1439# CONFIG_CIFS_STATS is not set 1495# CONFIG_CIFS_STATS is not set
1496# CONFIG_CIFS_WEAK_PW_HASH is not set
1440# CONFIG_CIFS_XATTR is not set 1497# CONFIG_CIFS_XATTR is not set
1498# CONFIG_CIFS_DEBUG2 is not set
1441# CONFIG_CIFS_EXPERIMENTAL is not set 1499# CONFIG_CIFS_EXPERIMENTAL is not set
1442CONFIG_NCP_FS=m 1500CONFIG_NCP_FS=m
1443CONFIG_NCPFS_PACKET_SIGNING=y 1501CONFIG_NCPFS_PACKET_SIGNING=y
@@ -1529,6 +1587,7 @@ CONFIG_NLS_UTF8=m
1529# 1587#
1530# CONFIG_PRINTK_TIME is not set 1588# CONFIG_PRINTK_TIME is not set
1531# CONFIG_MAGIC_SYSRQ is not set 1589# CONFIG_MAGIC_SYSRQ is not set
1590# CONFIG_UNUSED_SYMBOLS is not set
1532# CONFIG_DEBUG_KERNEL is not set 1591# CONFIG_DEBUG_KERNEL is not set
1533CONFIG_LOG_BUF_SHIFT=14 1592CONFIG_LOG_BUF_SHIFT=14
1534# CONFIG_DEBUG_FS is not set 1593# CONFIG_DEBUG_FS is not set
@@ -1588,3 +1647,4 @@ CONFIG_TEXTSEARCH=y
1588CONFIG_TEXTSEARCH_KMP=m 1647CONFIG_TEXTSEARCH_KMP=m
1589CONFIG_TEXTSEARCH_BM=m 1648CONFIG_TEXTSEARCH_BM=m
1590CONFIG_TEXTSEARCH_FSM=m 1649CONFIG_TEXTSEARCH_FSM=m
1650CONFIG_PLIST=y
diff --git a/arch/mips/configs/sb1250-swarm_defconfig b/arch/mips/configs/sb1250-swarm_defconfig
index ff34ed66fe65..625c1c619b6b 100644
--- a/arch/mips/configs/sb1250-swarm_defconfig
+++ b/arch/mips/configs/sb1250-swarm_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:51:17 2006 4# Thu Jul 6 10:04:19 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MIPS=y
45# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -82,6 +85,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
82CONFIG_GENERIC_FIND_NEXT_BIT=y 85CONFIG_GENERIC_FIND_NEXT_BIT=y
83CONFIG_GENERIC_HWEIGHT=y 86CONFIG_GENERIC_HWEIGHT=y
84CONFIG_GENERIC_CALIBRATE_DELAY=y 87CONFIG_GENERIC_CALIBRATE_DELAY=y
88CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
85CONFIG_DMA_COHERENT=y 89CONFIG_DMA_COHERENT=y
86CONFIG_CPU_BIG_ENDIAN=y 90CONFIG_CPU_BIG_ENDIAN=y
87# CONFIG_CPU_LITTLE_ENDIAN is not set 91# CONFIG_CPU_LITTLE_ENDIAN is not set
@@ -130,12 +134,16 @@ CONFIG_PAGE_SIZE_4KB=y
130# CONFIG_PAGE_SIZE_64KB is not set 134# CONFIG_PAGE_SIZE_64KB is not set
131# CONFIG_SIBYTE_DMA_PAGEOPS is not set 135# CONFIG_SIBYTE_DMA_PAGEOPS is not set
132CONFIG_CPU_HAS_PREFETCH=y 136CONFIG_CPU_HAS_PREFETCH=y
133# CONFIG_MIPS_MT is not set 137CONFIG_MIPS_MT_DISABLED=y
138# CONFIG_MIPS_MT_SMTC is not set
139# CONFIG_MIPS_MT_SMP is not set
140# CONFIG_MIPS_VPE_LOADER is not set
134CONFIG_SB1_PASS_1_WORKAROUNDS=y 141CONFIG_SB1_PASS_1_WORKAROUNDS=y
135CONFIG_CPU_HAS_LLSC=y 142CONFIG_CPU_HAS_LLSC=y
136CONFIG_CPU_HAS_SYNC=y 143CONFIG_CPU_HAS_SYNC=y
137CONFIG_GENERIC_HARDIRQS=y 144CONFIG_GENERIC_HARDIRQS=y
138CONFIG_GENERIC_IRQ_PROBE=y 145CONFIG_GENERIC_IRQ_PROBE=y
146CONFIG_IRQ_PER_CPU=y
139CONFIG_CPU_SUPPORTS_HIGHMEM=y 147CONFIG_CPU_SUPPORTS_HIGHMEM=y
140CONFIG_SYS_SUPPORTS_HIGHMEM=y 148CONFIG_SYS_SUPPORTS_HIGHMEM=y
141CONFIG_ARCH_FLATMEM_ENABLE=y 149CONFIG_ARCH_FLATMEM_ENABLE=y
@@ -147,6 +155,10 @@ CONFIG_FLATMEM=y
147CONFIG_FLAT_NODE_MEM_MAP=y 155CONFIG_FLAT_NODE_MEM_MAP=y
148# CONFIG_SPARSEMEM_STATIC is not set 156# CONFIG_SPARSEMEM_STATIC is not set
149CONFIG_SPLIT_PTLOCK_CPUS=4 157CONFIG_SPLIT_PTLOCK_CPUS=4
158CONFIG_RESOURCES_64BIT=y
159CONFIG_SMP=y
160CONFIG_SYS_SUPPORTS_SMP=y
161CONFIG_NR_CPUS=2
150# CONFIG_HZ_48 is not set 162# CONFIG_HZ_48 is not set
151# CONFIG_HZ_100 is not set 163# CONFIG_HZ_100 is not set
152# CONFIG_HZ_128 is not set 164# CONFIG_HZ_128 is not set
@@ -156,12 +168,11 @@ CONFIG_HZ_1000=y
156# CONFIG_HZ_1024 is not set 168# CONFIG_HZ_1024 is not set
157CONFIG_SYS_SUPPORTS_ARBIT_HZ=y 169CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
158CONFIG_HZ=1000 170CONFIG_HZ=1000
159CONFIG_SMP=y
160CONFIG_NR_CPUS=2
161CONFIG_PREEMPT_NONE=y 171CONFIG_PREEMPT_NONE=y
162# CONFIG_PREEMPT_VOLUNTARY is not set 172# CONFIG_PREEMPT_VOLUNTARY is not set
163# CONFIG_PREEMPT is not set 173# CONFIG_PREEMPT is not set
164CONFIG_PREEMPT_BKL=y 174CONFIG_PREEMPT_BKL=y
175CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
165 176
166# 177#
167# Code maturity level options 178# Code maturity level options
@@ -194,10 +205,12 @@ CONFIG_PRINTK=y
194CONFIG_BUG=y 205CONFIG_BUG=y
195CONFIG_ELF_CORE=y 206CONFIG_ELF_CORE=y
196CONFIG_BASE_FULL=y 207CONFIG_BASE_FULL=y
208CONFIG_RT_MUTEXES=y
197CONFIG_FUTEX=y 209CONFIG_FUTEX=y
198CONFIG_EPOLL=y 210CONFIG_EPOLL=y
199CONFIG_SHMEM=y 211CONFIG_SHMEM=y
200CONFIG_SLAB=y 212CONFIG_SLAB=y
213CONFIG_VM_EVENT_COUNTERS=y
201# CONFIG_TINY_SHMEM is not set 214# CONFIG_TINY_SHMEM is not set
202CONFIG_BASE_SMALL=0 215CONFIG_BASE_SMALL=0
203# CONFIG_SLOB is not set 216# CONFIG_SLOB is not set
@@ -292,6 +305,8 @@ CONFIG_IP_PNP_BOOTP=y
292# CONFIG_INET_IPCOMP is not set 305# CONFIG_INET_IPCOMP is not set
293# CONFIG_INET_XFRM_TUNNEL is not set 306# CONFIG_INET_XFRM_TUNNEL is not set
294# CONFIG_INET_TUNNEL is not set 307# CONFIG_INET_TUNNEL is not set
308CONFIG_INET_XFRM_MODE_TRANSPORT=m
309CONFIG_INET_XFRM_MODE_TUNNEL=m
295CONFIG_INET_DIAG=y 310CONFIG_INET_DIAG=y
296CONFIG_INET_TCP_DIAG=y 311CONFIG_INET_TCP_DIAG=y
297# CONFIG_TCP_CONG_ADVANCED is not set 312# CONFIG_TCP_CONG_ADVANCED is not set
@@ -299,6 +314,7 @@ CONFIG_TCP_CONG_BIC=y
299# CONFIG_IPV6 is not set 314# CONFIG_IPV6 is not set
300# CONFIG_INET6_XFRM_TUNNEL is not set 315# CONFIG_INET6_XFRM_TUNNEL is not set
301# CONFIG_INET6_TUNNEL is not set 316# CONFIG_INET6_TUNNEL is not set
317CONFIG_NETWORK_SECMARK=y
302# CONFIG_NETFILTER is not set 318# CONFIG_NETFILTER is not set
303 319
304# 320#
@@ -358,6 +374,7 @@ CONFIG_WIRELESS_EXT=y
358CONFIG_STANDALONE=y 374CONFIG_STANDALONE=y
359CONFIG_PREVENT_FIRMWARE_BUILD=y 375CONFIG_PREVENT_FIRMWARE_BUILD=y
360CONFIG_FW_LOADER=m 376CONFIG_FW_LOADER=m
377# CONFIG_SYS_HYPERVISOR is not set
361 378
362# 379#
363# Connector - unified userspace <-> kernelspace linker 380# Connector - unified userspace <-> kernelspace linker
@@ -479,6 +496,8 @@ CONFIG_DAVICOM_PHY=m
479CONFIG_QSEMI_PHY=m 496CONFIG_QSEMI_PHY=m
480CONFIG_LXT_PHY=m 497CONFIG_LXT_PHY=m
481CONFIG_CICADA_PHY=m 498CONFIG_CICADA_PHY=m
499CONFIG_VITESSE_PHY=m
500CONFIG_SMSC_PHY=m
482 501
483# 502#
484# Ethernet (10 or 100Mbit) 503# Ethernet (10 or 100Mbit)
@@ -522,6 +541,7 @@ CONFIG_NET_SB1250_MAC=y
522# CONFIG_CHELSIO_T1 is not set 541# CONFIG_CHELSIO_T1 is not set
523# CONFIG_IXGB is not set 542# CONFIG_IXGB is not set
524# CONFIG_S2IO is not set 543# CONFIG_S2IO is not set
544# CONFIG_MYRI10GE is not set
525 545
526# 546#
527# Token Ring devices 547# Token Ring devices
@@ -589,6 +609,7 @@ CONFIG_SERIAL_NONSTANDARD=y
589# CONFIG_N_HDLC is not set 609# CONFIG_N_HDLC is not set
590# CONFIG_SPECIALIX is not set 610# CONFIG_SPECIALIX is not set
591# CONFIG_SX is not set 611# CONFIG_SX is not set
612# CONFIG_RIO is not set
592# CONFIG_STALDRV is not set 613# CONFIG_STALDRV is not set
593CONFIG_SIBYTE_SB1250_DUART=y 614CONFIG_SIBYTE_SB1250_DUART=y
594CONFIG_SIBYTE_SB1250_DUART_CONSOLE=y 615CONFIG_SIBYTE_SB1250_DUART_CONSOLE=y
@@ -615,6 +636,7 @@ CONFIG_LEGACY_PTY_COUNT=256
615# Watchdog Cards 636# Watchdog Cards
616# 637#
617# CONFIG_WATCHDOG is not set 638# CONFIG_WATCHDOG is not set
639# CONFIG_HW_RANDOM is not set
618# CONFIG_RTC is not set 640# CONFIG_RTC is not set
619# CONFIG_GEN_RTC is not set 641# CONFIG_GEN_RTC is not set
620# CONFIG_DTLK is not set 642# CONFIG_DTLK is not set
@@ -663,6 +685,7 @@ CONFIG_LEGACY_PTY_COUNT=256
663# Multimedia devices 685# Multimedia devices
664# 686#
665# CONFIG_VIDEO_DEV is not set 687# CONFIG_VIDEO_DEV is not set
688CONFIG_VIDEO_V4L2=y
666 689
667# 690#
668# Digital Video Broadcasting Devices 691# Digital Video Broadcasting Devices
@@ -672,6 +695,7 @@ CONFIG_LEGACY_PTY_COUNT=256
672# 695#
673# Graphics support 696# Graphics support
674# 697#
698# CONFIG_FIRMWARE_EDID is not set
675# CONFIG_FB is not set 699# CONFIG_FB is not set
676 700
677# 701#
@@ -729,6 +753,19 @@ CONFIG_USB_ARCH_HAS_EHCI=y
729# CONFIG_RTC_CLASS is not set 753# CONFIG_RTC_CLASS is not set
730 754
731# 755#
756# DMA Engine support
757#
758# CONFIG_DMA_ENGINE is not set
759
760#
761# DMA Clients
762#
763
764#
765# DMA Devices
766#
767
768#
732# File systems 769# File systems
733# 770#
734CONFIG_EXT2_FS=y 771CONFIG_EXT2_FS=y
@@ -746,6 +783,7 @@ CONFIG_FS_POSIX_ACL=y
746# CONFIG_MINIX_FS is not set 783# CONFIG_MINIX_FS is not set
747# CONFIG_ROMFS_FS is not set 784# CONFIG_ROMFS_FS is not set
748CONFIG_INOTIFY=y 785CONFIG_INOTIFY=y
786CONFIG_INOTIFY_USER=y
749# CONFIG_QUOTA is not set 787# CONFIG_QUOTA is not set
750CONFIG_DNOTIFY=y 788CONFIG_DNOTIFY=y
751# CONFIG_AUTOFS_FS is not set 789# CONFIG_AUTOFS_FS is not set
@@ -811,6 +849,7 @@ CONFIG_SUNRPC=y
811# CONFIG_RPCSEC_GSS_SPKM3 is not set 849# CONFIG_RPCSEC_GSS_SPKM3 is not set
812# CONFIG_SMB_FS is not set 850# CONFIG_SMB_FS is not set
813# CONFIG_CIFS is not set 851# CONFIG_CIFS is not set
852# CONFIG_CIFS_DEBUG2 is not set
814# CONFIG_NCP_FS is not set 853# CONFIG_NCP_FS is not set
815# CONFIG_CODA_FS is not set 854# CONFIG_CODA_FS is not set
816# CONFIG_AFS_FS is not set 855# CONFIG_AFS_FS is not set
@@ -837,6 +876,7 @@ CONFIG_MSDOS_PARTITION=y
837# 876#
838# CONFIG_PRINTK_TIME is not set 877# CONFIG_PRINTK_TIME is not set
839# CONFIG_MAGIC_SYSRQ is not set 878# CONFIG_MAGIC_SYSRQ is not set
879# CONFIG_UNUSED_SYMBOLS is not set
840# CONFIG_DEBUG_KERNEL is not set 880# CONFIG_DEBUG_KERNEL is not set
841CONFIG_LOG_BUF_SHIFT=15 881CONFIG_LOG_BUF_SHIFT=15
842# CONFIG_DEBUG_FS is not set 882# CONFIG_DEBUG_FS is not set
@@ -893,3 +933,4 @@ CONFIG_CRC32=y
893CONFIG_LIBCRC32C=m 933CONFIG_LIBCRC32C=m
894CONFIG_ZLIB_INFLATE=m 934CONFIG_ZLIB_INFLATE=m
895CONFIG_ZLIB_DEFLATE=m 935CONFIG_ZLIB_DEFLATE=m
936CONFIG_PLIST=y
diff --git a/arch/mips/configs/sead_defconfig b/arch/mips/configs/sead_defconfig
index 77edeae7f018..4401b602118f 100644
--- a/arch/mips/configs/sead_defconfig
+++ b/arch/mips/configs/sead_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:51:17 2006 4# Thu Jul 6 10:04:20 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34CONFIG_MIPS_SEAD=y 35CONFIG_MIPS_SEAD=y
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MIPS_SEAD=y
45# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -65,6 +68,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
65CONFIG_GENERIC_FIND_NEXT_BIT=y 68CONFIG_GENERIC_FIND_NEXT_BIT=y
66CONFIG_GENERIC_HWEIGHT=y 69CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 70CONFIG_GENERIC_CALIBRATE_DELAY=y
71CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
68CONFIG_DMA_NONCOHERENT=y 72CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 73CONFIG_DMA_NEED_PCI_MAP_STATE=y
70# CONFIG_CPU_BIG_ENDIAN is not set 74# CONFIG_CPU_BIG_ENDIAN is not set
@@ -116,7 +120,10 @@ CONFIG_PAGE_SIZE_4KB=y
116# CONFIG_PAGE_SIZE_16KB is not set 120# CONFIG_PAGE_SIZE_16KB is not set
117# CONFIG_PAGE_SIZE_64KB is not set 121# CONFIG_PAGE_SIZE_64KB is not set
118CONFIG_CPU_HAS_PREFETCH=y 122CONFIG_CPU_HAS_PREFETCH=y
119# CONFIG_MIPS_MT is not set 123CONFIG_MIPS_MT_DISABLED=y
124# CONFIG_MIPS_MT_SMTC is not set
125# CONFIG_MIPS_MT_SMP is not set
126# CONFIG_MIPS_VPE_LOADER is not set
120# CONFIG_64BIT_PHYS_ADDR is not set 127# CONFIG_64BIT_PHYS_ADDR is not set
121CONFIG_CPU_HAS_LLSC=y 128CONFIG_CPU_HAS_LLSC=y
122CONFIG_CPU_HAS_SYNC=y 129CONFIG_CPU_HAS_SYNC=y
@@ -132,6 +139,7 @@ CONFIG_FLATMEM=y
132CONFIG_FLAT_NODE_MEM_MAP=y 139CONFIG_FLAT_NODE_MEM_MAP=y
133# CONFIG_SPARSEMEM_STATIC is not set 140# CONFIG_SPARSEMEM_STATIC is not set
134CONFIG_SPLIT_PTLOCK_CPUS=4 141CONFIG_SPLIT_PTLOCK_CPUS=4
142# CONFIG_RESOURCES_64BIT is not set
135# CONFIG_HZ_48 is not set 143# CONFIG_HZ_48 is not set
136# CONFIG_HZ_100 is not set 144# CONFIG_HZ_100 is not set
137# CONFIG_HZ_128 is not set 145# CONFIG_HZ_128 is not set
@@ -144,6 +152,7 @@ CONFIG_HZ=1000
144CONFIG_PREEMPT_NONE=y 152CONFIG_PREEMPT_NONE=y
145# CONFIG_PREEMPT_VOLUNTARY is not set 153# CONFIG_PREEMPT_VOLUNTARY is not set
146# CONFIG_PREEMPT is not set 154# CONFIG_PREEMPT is not set
155CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
147 156
148# 157#
149# Code maturity level options 158# Code maturity level options
@@ -173,10 +182,12 @@ CONFIG_PRINTK=y
173CONFIG_BUG=y 182CONFIG_BUG=y
174CONFIG_ELF_CORE=y 183CONFIG_ELF_CORE=y
175CONFIG_BASE_FULL=y 184CONFIG_BASE_FULL=y
185CONFIG_RT_MUTEXES=y
176CONFIG_FUTEX=y 186CONFIG_FUTEX=y
177CONFIG_EPOLL=y 187CONFIG_EPOLL=y
178CONFIG_SHMEM=y 188CONFIG_SHMEM=y
179CONFIG_SLAB=y 189CONFIG_SLAB=y
190CONFIG_VM_EVENT_COUNTERS=y
180# CONFIG_TINY_SHMEM is not set 191# CONFIG_TINY_SHMEM is not set
181CONFIG_BASE_SMALL=0 192CONFIG_BASE_SMALL=0
182# CONFIG_SLOB is not set 193# CONFIG_SLOB is not set
@@ -242,6 +253,7 @@ CONFIG_TRAD_SIGNALS=y
242CONFIG_STANDALONE=y 253CONFIG_STANDALONE=y
243CONFIG_PREVENT_FIRMWARE_BUILD=y 254CONFIG_PREVENT_FIRMWARE_BUILD=y
244# CONFIG_FW_LOADER is not set 255# CONFIG_FW_LOADER is not set
256# CONFIG_SYS_HYPERVISOR is not set
245 257
246# 258#
247# Connector - unified userspace <-> kernelspace linker 259# Connector - unified userspace <-> kernelspace linker
@@ -355,6 +367,7 @@ CONFIG_LEGACY_PTY_COUNT=256
355# Watchdog Cards 367# Watchdog Cards
356# 368#
357# CONFIG_WATCHDOG is not set 369# CONFIG_WATCHDOG is not set
370# CONFIG_HW_RANDOM is not set
358# CONFIG_RTC is not set 371# CONFIG_RTC is not set
359# CONFIG_GEN_RTC is not set 372# CONFIG_GEN_RTC is not set
360# CONFIG_DTLK is not set 373# CONFIG_DTLK is not set
@@ -385,7 +398,6 @@ CONFIG_LEGACY_PTY_COUNT=256
385# 398#
386# Dallas's 1-wire bus 399# Dallas's 1-wire bus
387# 400#
388# CONFIG_W1 is not set
389 401
390# 402#
391# Hardware Monitoring support 403# Hardware Monitoring support
@@ -401,6 +413,7 @@ CONFIG_LEGACY_PTY_COUNT=256
401# Multimedia devices 413# Multimedia devices
402# 414#
403# CONFIG_VIDEO_DEV is not set 415# CONFIG_VIDEO_DEV is not set
416CONFIG_VIDEO_V4L2=y
404 417
405# 418#
406# Digital Video Broadcasting Devices 419# Digital Video Broadcasting Devices
@@ -409,6 +422,7 @@ CONFIG_LEGACY_PTY_COUNT=256
409# 422#
410# Graphics support 423# Graphics support
411# 424#
425# CONFIG_FIRMWARE_EDID is not set
412# CONFIG_FB is not set 426# CONFIG_FB is not set
413 427
414# 428#
@@ -464,6 +478,19 @@ CONFIG_LEGACY_PTY_COUNT=256
464# CONFIG_RTC_CLASS is not set 478# CONFIG_RTC_CLASS is not set
465 479
466# 480#
481# DMA Engine support
482#
483# CONFIG_DMA_ENGINE is not set
484
485#
486# DMA Clients
487#
488
489#
490# DMA Devices
491#
492
493#
467# File systems 494# File systems
468# 495#
469CONFIG_EXT2_FS=y 496CONFIG_EXT2_FS=y
@@ -477,6 +504,7 @@ CONFIG_EXT2_FS=y
477# CONFIG_MINIX_FS is not set 504# CONFIG_MINIX_FS is not set
478# CONFIG_ROMFS_FS is not set 505# CONFIG_ROMFS_FS is not set
479CONFIG_INOTIFY=y 506CONFIG_INOTIFY=y
507CONFIG_INOTIFY_USER=y
480# CONFIG_QUOTA is not set 508# CONFIG_QUOTA is not set
481CONFIG_DNOTIFY=y 509CONFIG_DNOTIFY=y
482# CONFIG_AUTOFS_FS is not set 510# CONFIG_AUTOFS_FS is not set
@@ -556,6 +584,7 @@ CONFIG_PARTITION_ADVANCED=y
556# 584#
557# CONFIG_PRINTK_TIME is not set 585# CONFIG_PRINTK_TIME is not set
558# CONFIG_MAGIC_SYSRQ is not set 586# CONFIG_MAGIC_SYSRQ is not set
587# CONFIG_UNUSED_SYMBOLS is not set
559# CONFIG_DEBUG_KERNEL is not set 588# CONFIG_DEBUG_KERNEL is not set
560CONFIG_LOG_BUF_SHIFT=14 589CONFIG_LOG_BUF_SHIFT=14
561# CONFIG_DEBUG_FS is not set 590# CONFIG_DEBUG_FS is not set
@@ -585,3 +614,4 @@ CONFIG_CMDLINE=""
585CONFIG_CRC16=y 614CONFIG_CRC16=y
586# CONFIG_CRC32 is not set 615# CONFIG_CRC32 is not set
587# CONFIG_LIBCRC32C is not set 616# CONFIG_LIBCRC32C is not set
617CONFIG_PLIST=y
diff --git a/arch/mips/configs/tb0226_defconfig b/arch/mips/configs/tb0226_defconfig
index 6aa229d54851..2ba4e25e8c34 100644
--- a/arch/mips/configs/tb0226_defconfig
+++ b/arch/mips/configs/tb0226_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Tue Apr 25 00:08:41 2006 4# Thu Jul 6 10:04:20 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MIPS=y
45CONFIG_MACH_VR41XX=y 47CONFIG_MACH_VR41XX=y
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -75,6 +78,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
75CONFIG_GENERIC_FIND_NEXT_BIT=y 78CONFIG_GENERIC_FIND_NEXT_BIT=y
76CONFIG_GENERIC_HWEIGHT=y 79CONFIG_GENERIC_HWEIGHT=y
77CONFIG_GENERIC_CALIBRATE_DELAY=y 80CONFIG_GENERIC_CALIBRATE_DELAY=y
81CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
78CONFIG_DMA_NONCOHERENT=y 82CONFIG_DMA_NONCOHERENT=y
79CONFIG_DMA_NEED_PCI_MAP_STATE=y 83CONFIG_DMA_NEED_PCI_MAP_STATE=y
80# CONFIG_CPU_BIG_ENDIAN is not set 84# CONFIG_CPU_BIG_ENDIAN is not set
@@ -119,7 +123,10 @@ CONFIG_PAGE_SIZE_4KB=y
119# CONFIG_PAGE_SIZE_8KB is not set 123# CONFIG_PAGE_SIZE_8KB is not set
120# CONFIG_PAGE_SIZE_16KB is not set 124# CONFIG_PAGE_SIZE_16KB is not set
121# CONFIG_PAGE_SIZE_64KB is not set 125# CONFIG_PAGE_SIZE_64KB is not set
122# CONFIG_MIPS_MT is not set 126CONFIG_MIPS_MT_DISABLED=y
127# CONFIG_MIPS_MT_SMTC is not set
128# CONFIG_MIPS_MT_SMP is not set
129# CONFIG_MIPS_VPE_LOADER is not set
123CONFIG_CPU_HAS_SYNC=y 130CONFIG_CPU_HAS_SYNC=y
124CONFIG_GENERIC_HARDIRQS=y 131CONFIG_GENERIC_HARDIRQS=y
125CONFIG_GENERIC_IRQ_PROBE=y 132CONFIG_GENERIC_IRQ_PROBE=y
@@ -132,6 +139,7 @@ CONFIG_FLATMEM=y
132CONFIG_FLAT_NODE_MEM_MAP=y 139CONFIG_FLAT_NODE_MEM_MAP=y
133# CONFIG_SPARSEMEM_STATIC is not set 140# CONFIG_SPARSEMEM_STATIC is not set
134CONFIG_SPLIT_PTLOCK_CPUS=4 141CONFIG_SPLIT_PTLOCK_CPUS=4
142# CONFIG_RESOURCES_64BIT is not set
135# CONFIG_HZ_48 is not set 143# CONFIG_HZ_48 is not set
136# CONFIG_HZ_100 is not set 144# CONFIG_HZ_100 is not set
137# CONFIG_HZ_128 is not set 145# CONFIG_HZ_128 is not set
@@ -144,6 +152,7 @@ CONFIG_HZ=1000
144CONFIG_PREEMPT_NONE=y 152CONFIG_PREEMPT_NONE=y
145# CONFIG_PREEMPT_VOLUNTARY is not set 153# CONFIG_PREEMPT_VOLUNTARY is not set
146# CONFIG_PREEMPT is not set 154# CONFIG_PREEMPT is not set
155CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
147 156
148# 157#
149# Code maturity level options 158# Code maturity level options
@@ -175,10 +184,12 @@ CONFIG_PRINTK=y
175CONFIG_BUG=y 184CONFIG_BUG=y
176CONFIG_ELF_CORE=y 185CONFIG_ELF_CORE=y
177CONFIG_BASE_FULL=y 186CONFIG_BASE_FULL=y
187CONFIG_RT_MUTEXES=y
178CONFIG_FUTEX=y 188CONFIG_FUTEX=y
179CONFIG_EPOLL=y 189CONFIG_EPOLL=y
180CONFIG_SHMEM=y 190CONFIG_SHMEM=y
181CONFIG_SLAB=y 191CONFIG_SLAB=y
192CONFIG_VM_EVENT_COUNTERS=y
182# CONFIG_TINY_SHMEM is not set 193# CONFIG_TINY_SHMEM is not set
183CONFIG_BASE_SMALL=0 194CONFIG_BASE_SMALL=0
184# CONFIG_SLOB is not set 195# CONFIG_SLOB is not set
@@ -249,6 +260,8 @@ CONFIG_NET=y
249CONFIG_PACKET=y 260CONFIG_PACKET=y
250# CONFIG_PACKET_MMAP is not set 261# CONFIG_PACKET_MMAP is not set
251CONFIG_UNIX=y 262CONFIG_UNIX=y
263CONFIG_XFRM=y
264# CONFIG_XFRM_USER is not set
252# CONFIG_NET_KEY is not set 265# CONFIG_NET_KEY is not set
253CONFIG_INET=y 266CONFIG_INET=y
254CONFIG_IP_MULTICAST=y 267CONFIG_IP_MULTICAST=y
@@ -274,6 +287,8 @@ CONFIG_SYN_COOKIES=y
274# CONFIG_INET_IPCOMP is not set 287# CONFIG_INET_IPCOMP is not set
275# CONFIG_INET_XFRM_TUNNEL is not set 288# CONFIG_INET_XFRM_TUNNEL is not set
276# CONFIG_INET_TUNNEL is not set 289# CONFIG_INET_TUNNEL is not set
290CONFIG_INET_XFRM_MODE_TRANSPORT=m
291CONFIG_INET_XFRM_MODE_TUNNEL=m
277CONFIG_INET_DIAG=y 292CONFIG_INET_DIAG=y
278CONFIG_INET_TCP_DIAG=y 293CONFIG_INET_TCP_DIAG=y
279# CONFIG_TCP_CONG_ADVANCED is not set 294# CONFIG_TCP_CONG_ADVANCED is not set
@@ -281,6 +296,7 @@ CONFIG_TCP_CONG_BIC=y
281# CONFIG_IPV6 is not set 296# CONFIG_IPV6 is not set
282# CONFIG_INET6_XFRM_TUNNEL is not set 297# CONFIG_INET6_XFRM_TUNNEL is not set
283# CONFIG_INET6_TUNNEL is not set 298# CONFIG_INET6_TUNNEL is not set
299CONFIG_NETWORK_SECMARK=y
284# CONFIG_NETFILTER is not set 300# CONFIG_NETFILTER is not set
285 301
286# 302#
@@ -334,6 +350,7 @@ CONFIG_TCP_CONG_BIC=y
334CONFIG_STANDALONE=y 350CONFIG_STANDALONE=y
335CONFIG_PREVENT_FIRMWARE_BUILD=y 351CONFIG_PREVENT_FIRMWARE_BUILD=y
336CONFIG_FW_LOADER=y 352CONFIG_FW_LOADER=y
353# CONFIG_SYS_HYPERVISOR is not set
337 354
338# 355#
339# Connector - unified userspace <-> kernelspace linker 356# Connector - unified userspace <-> kernelspace linker
@@ -427,6 +444,7 @@ CONFIG_SCSI_MULTI_LUN=y
427# CONFIG_MEGARAID_LEGACY is not set 444# CONFIG_MEGARAID_LEGACY is not set
428# CONFIG_MEGARAID_SAS is not set 445# CONFIG_MEGARAID_SAS is not set
429# CONFIG_SCSI_SATA is not set 446# CONFIG_SCSI_SATA is not set
447# CONFIG_SCSI_HPTIOP is not set
430# CONFIG_SCSI_DMX3191D is not set 448# CONFIG_SCSI_DMX3191D is not set
431# CONFIG_SCSI_FUTURE_DOMAIN is not set 449# CONFIG_SCSI_FUTURE_DOMAIN is not set
432# CONFIG_SCSI_IPS is not set 450# CONFIG_SCSI_IPS is not set
@@ -492,6 +510,8 @@ CONFIG_DAVICOM_PHY=m
492CONFIG_QSEMI_PHY=m 510CONFIG_QSEMI_PHY=m
493CONFIG_LXT_PHY=m 511CONFIG_LXT_PHY=m
494CONFIG_CICADA_PHY=m 512CONFIG_CICADA_PHY=m
513CONFIG_VITESSE_PHY=m
514CONFIG_SMSC_PHY=m
495 515
496# 516#
497# Ethernet (10 or 100Mbit) 517# Ethernet (10 or 100Mbit)
@@ -554,6 +574,7 @@ CONFIG_E100=y
554# CONFIG_CHELSIO_T1 is not set 574# CONFIG_CHELSIO_T1 is not set
555# CONFIG_IXGB is not set 575# CONFIG_IXGB is not set
556# CONFIG_S2IO is not set 576# CONFIG_S2IO is not set
577# CONFIG_MYRI10GE is not set
557 578
558# 579#
559# Token Ring devices 580# Token Ring devices
@@ -624,6 +645,7 @@ CONFIG_INPUT=y
624CONFIG_VT=y 645CONFIG_VT=y
625CONFIG_VT_CONSOLE=y 646CONFIG_VT_CONSOLE=y
626CONFIG_HW_CONSOLE=y 647CONFIG_HW_CONSOLE=y
648CONFIG_VT_HW_CONSOLE_BINDING=y
627# CONFIG_SERIAL_NONSTANDARD is not set 649# CONFIG_SERIAL_NONSTANDARD is not set
628 650
629# 651#
@@ -652,6 +674,7 @@ CONFIG_LEGACY_PTY_COUNT=256
652# Watchdog Cards 674# Watchdog Cards
653# 675#
654# CONFIG_WATCHDOG is not set 676# CONFIG_WATCHDOG is not set
677# CONFIG_HW_RANDOM is not set
655# CONFIG_RTC is not set 678# CONFIG_RTC is not set
656# CONFIG_GEN_RTC is not set 679# CONFIG_GEN_RTC is not set
657# CONFIG_DTLK is not set 680# CONFIG_DTLK is not set
@@ -702,6 +725,7 @@ CONFIG_GPIO_VR41XX=y
702# Multimedia devices 725# Multimedia devices
703# 726#
704# CONFIG_VIDEO_DEV is not set 727# CONFIG_VIDEO_DEV is not set
728CONFIG_VIDEO_V4L2=y
705 729
706# 730#
707# Digital Video Broadcasting Devices 731# Digital Video Broadcasting Devices
@@ -712,6 +736,7 @@ CONFIG_GPIO_VR41XX=y
712# 736#
713# Graphics support 737# Graphics support
714# 738#
739# CONFIG_FIRMWARE_EDID is not set
715# CONFIG_FB is not set 740# CONFIG_FB is not set
716 741
717# 742#
@@ -748,6 +773,7 @@ CONFIG_USB_DEVICEFS=y
748CONFIG_USB_EHCI_HCD=y 773CONFIG_USB_EHCI_HCD=y
749# CONFIG_USB_EHCI_SPLIT_ISO is not set 774# CONFIG_USB_EHCI_SPLIT_ISO is not set
750# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 775# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
776# CONFIG_USB_EHCI_TT_NEWSCHED is not set
751# CONFIG_USB_ISP116X_HCD is not set 777# CONFIG_USB_ISP116X_HCD is not set
752CONFIG_USB_OHCI_HCD=y 778CONFIG_USB_OHCI_HCD=y
753# CONFIG_USB_OHCI_BIG_ENDIAN is not set 779# CONFIG_USB_OHCI_BIG_ENDIAN is not set
@@ -838,10 +864,12 @@ CONFIG_USB_STORAGE=y
838# CONFIG_USB_LEGOTOWER is not set 864# CONFIG_USB_LEGOTOWER is not set
839# CONFIG_USB_LCD is not set 865# CONFIG_USB_LCD is not set
840# CONFIG_USB_LED is not set 866# CONFIG_USB_LED is not set
867# CONFIG_USB_CY7C63 is not set
841# CONFIG_USB_CYTHERM is not set 868# CONFIG_USB_CYTHERM is not set
842# CONFIG_USB_PHIDGETKIT is not set 869# CONFIG_USB_PHIDGETKIT is not set
843# CONFIG_USB_PHIDGETSERVO is not set 870# CONFIG_USB_PHIDGETSERVO is not set
844# CONFIG_USB_IDMOUSE is not set 871# CONFIG_USB_IDMOUSE is not set
872# CONFIG_USB_APPLEDISPLAY is not set
845# CONFIG_USB_SISUSBVGA is not set 873# CONFIG_USB_SISUSBVGA is not set
846# CONFIG_USB_LD is not set 874# CONFIG_USB_LD is not set
847# CONFIG_USB_TEST is not set 875# CONFIG_USB_TEST is not set
@@ -896,13 +924,30 @@ CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
896CONFIG_RTC_INTF_SYSFS=y 924CONFIG_RTC_INTF_SYSFS=y
897CONFIG_RTC_INTF_PROC=y 925CONFIG_RTC_INTF_PROC=y
898CONFIG_RTC_INTF_DEV=y 926CONFIG_RTC_INTF_DEV=y
927# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
899 928
900# 929#
901# RTC drivers 930# RTC drivers
902# 931#
932# CONFIG_RTC_DRV_DS1553 is not set
933# CONFIG_RTC_DRV_DS1742 is not set
903# CONFIG_RTC_DRV_M48T86 is not set 934# CONFIG_RTC_DRV_M48T86 is not set
904CONFIG_RTC_DRV_VR41XX=y 935CONFIG_RTC_DRV_VR41XX=y
905# CONFIG_RTC_DRV_TEST is not set 936# CONFIG_RTC_DRV_TEST is not set
937# CONFIG_RTC_DRV_V3020 is not set
938
939#
940# DMA Engine support
941#
942# CONFIG_DMA_ENGINE is not set
943
944#
945# DMA Clients
946#
947
948#
949# DMA Devices
950#
906 951
907# 952#
908# File systems 953# File systems
@@ -919,6 +964,7 @@ CONFIG_EXT2_FS=y
919# CONFIG_MINIX_FS is not set 964# CONFIG_MINIX_FS is not set
920CONFIG_ROMFS_FS=m 965CONFIG_ROMFS_FS=m
921CONFIG_INOTIFY=y 966CONFIG_INOTIFY=y
967CONFIG_INOTIFY_USER=y
922# CONFIG_QUOTA is not set 968# CONFIG_QUOTA is not set
923CONFIG_DNOTIFY=y 969CONFIG_DNOTIFY=y
924# CONFIG_AUTOFS_FS is not set 970# CONFIG_AUTOFS_FS is not set
@@ -989,6 +1035,7 @@ CONFIG_SUNRPC=y
989# CONFIG_RPCSEC_GSS_SPKM3 is not set 1035# CONFIG_RPCSEC_GSS_SPKM3 is not set
990# CONFIG_SMB_FS is not set 1036# CONFIG_SMB_FS is not set
991# CONFIG_CIFS is not set 1037# CONFIG_CIFS is not set
1038# CONFIG_CIFS_DEBUG2 is not set
992# CONFIG_NCP_FS is not set 1039# CONFIG_NCP_FS is not set
993# CONFIG_CODA_FS is not set 1040# CONFIG_CODA_FS is not set
994# CONFIG_AFS_FS is not set 1041# CONFIG_AFS_FS is not set
@@ -1015,6 +1062,7 @@ CONFIG_MSDOS_PARTITION=y
1015# 1062#
1016# CONFIG_PRINTK_TIME is not set 1063# CONFIG_PRINTK_TIME is not set
1017# CONFIG_MAGIC_SYSRQ is not set 1064# CONFIG_MAGIC_SYSRQ is not set
1065# CONFIG_UNUSED_SYMBOLS is not set
1018# CONFIG_DEBUG_KERNEL is not set 1066# CONFIG_DEBUG_KERNEL is not set
1019CONFIG_LOG_BUF_SHIFT=14 1067CONFIG_LOG_BUF_SHIFT=14
1020# CONFIG_DEBUG_FS is not set 1068# CONFIG_DEBUG_FS is not set
@@ -1044,3 +1092,4 @@ CONFIG_CMDLINE="mem=32M console=ttyVR0,115200"
1044# CONFIG_CRC32 is not set 1092# CONFIG_CRC32 is not set
1045# CONFIG_LIBCRC32C is not set 1093# CONFIG_LIBCRC32C is not set
1046CONFIG_ZLIB_INFLATE=m 1094CONFIG_ZLIB_INFLATE=m
1095CONFIG_PLIST=y
diff --git a/arch/mips/configs/tb0229_defconfig b/arch/mips/configs/tb0229_defconfig
index a187b1f0004c..fc8a407c1add 100644
--- a/arch/mips/configs/tb0229_defconfig
+++ b/arch/mips/configs/tb0229_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Tue Apr 25 00:08:59 2006 4# Thu Jul 6 10:04:20 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MIPS=y
45CONFIG_MACH_VR41XX=y 47CONFIG_MACH_VR41XX=y
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -75,6 +78,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
75CONFIG_GENERIC_FIND_NEXT_BIT=y 78CONFIG_GENERIC_FIND_NEXT_BIT=y
76CONFIG_GENERIC_HWEIGHT=y 79CONFIG_GENERIC_HWEIGHT=y
77CONFIG_GENERIC_CALIBRATE_DELAY=y 80CONFIG_GENERIC_CALIBRATE_DELAY=y
81CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
78CONFIG_DMA_NONCOHERENT=y 82CONFIG_DMA_NONCOHERENT=y
79CONFIG_DMA_NEED_PCI_MAP_STATE=y 83CONFIG_DMA_NEED_PCI_MAP_STATE=y
80# CONFIG_CPU_BIG_ENDIAN is not set 84# CONFIG_CPU_BIG_ENDIAN is not set
@@ -119,7 +123,10 @@ CONFIG_PAGE_SIZE_4KB=y
119# CONFIG_PAGE_SIZE_8KB is not set 123# CONFIG_PAGE_SIZE_8KB is not set
120# CONFIG_PAGE_SIZE_16KB is not set 124# CONFIG_PAGE_SIZE_16KB is not set
121# CONFIG_PAGE_SIZE_64KB is not set 125# CONFIG_PAGE_SIZE_64KB is not set
122# CONFIG_MIPS_MT is not set 126CONFIG_MIPS_MT_DISABLED=y
127# CONFIG_MIPS_MT_SMTC is not set
128# CONFIG_MIPS_MT_SMP is not set
129# CONFIG_MIPS_VPE_LOADER is not set
123CONFIG_CPU_HAS_SYNC=y 130CONFIG_CPU_HAS_SYNC=y
124CONFIG_GENERIC_HARDIRQS=y 131CONFIG_GENERIC_HARDIRQS=y
125CONFIG_GENERIC_IRQ_PROBE=y 132CONFIG_GENERIC_IRQ_PROBE=y
@@ -132,6 +139,7 @@ CONFIG_FLATMEM=y
132CONFIG_FLAT_NODE_MEM_MAP=y 139CONFIG_FLAT_NODE_MEM_MAP=y
133# CONFIG_SPARSEMEM_STATIC is not set 140# CONFIG_SPARSEMEM_STATIC is not set
134CONFIG_SPLIT_PTLOCK_CPUS=4 141CONFIG_SPLIT_PTLOCK_CPUS=4
142# CONFIG_RESOURCES_64BIT is not set
135# CONFIG_HZ_48 is not set 143# CONFIG_HZ_48 is not set
136# CONFIG_HZ_100 is not set 144# CONFIG_HZ_100 is not set
137# CONFIG_HZ_128 is not set 145# CONFIG_HZ_128 is not set
@@ -144,6 +152,7 @@ CONFIG_HZ=1000
144CONFIG_PREEMPT_NONE=y 152CONFIG_PREEMPT_NONE=y
145# CONFIG_PREEMPT_VOLUNTARY is not set 153# CONFIG_PREEMPT_VOLUNTARY is not set
146# CONFIG_PREEMPT is not set 154# CONFIG_PREEMPT is not set
155CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
147 156
148# 157#
149# Code maturity level options 158# Code maturity level options
@@ -175,10 +184,12 @@ CONFIG_PRINTK=y
175CONFIG_BUG=y 184CONFIG_BUG=y
176CONFIG_ELF_CORE=y 185CONFIG_ELF_CORE=y
177CONFIG_BASE_FULL=y 186CONFIG_BASE_FULL=y
187CONFIG_RT_MUTEXES=y
178CONFIG_FUTEX=y 188CONFIG_FUTEX=y
179CONFIG_EPOLL=y 189CONFIG_EPOLL=y
180CONFIG_SHMEM=y 190CONFIG_SHMEM=y
181CONFIG_SLAB=y 191CONFIG_SLAB=y
192CONFIG_VM_EVENT_COUNTERS=y
182# CONFIG_TINY_SHMEM is not set 193# CONFIG_TINY_SHMEM is not set
183CONFIG_BASE_SMALL=0 194CONFIG_BASE_SMALL=0
184# CONFIG_SLOB is not set 195# CONFIG_SLOB is not set
@@ -249,6 +260,8 @@ CONFIG_NET=y
249CONFIG_PACKET=y 260CONFIG_PACKET=y
250# CONFIG_PACKET_MMAP is not set 261# CONFIG_PACKET_MMAP is not set
251CONFIG_UNIX=y 262CONFIG_UNIX=y
263CONFIG_XFRM=y
264# CONFIG_XFRM_USER is not set
252# CONFIG_NET_KEY is not set 265# CONFIG_NET_KEY is not set
253CONFIG_INET=y 266CONFIG_INET=y
254CONFIG_IP_MULTICAST=y 267CONFIG_IP_MULTICAST=y
@@ -275,6 +288,8 @@ CONFIG_SYN_COOKIES=y
275# CONFIG_INET_IPCOMP is not set 288# CONFIG_INET_IPCOMP is not set
276# CONFIG_INET_XFRM_TUNNEL is not set 289# CONFIG_INET_XFRM_TUNNEL is not set
277CONFIG_INET_TUNNEL=m 290CONFIG_INET_TUNNEL=m
291CONFIG_INET_XFRM_MODE_TRANSPORT=m
292CONFIG_INET_XFRM_MODE_TUNNEL=m
278CONFIG_INET_DIAG=y 293CONFIG_INET_DIAG=y
279CONFIG_INET_TCP_DIAG=y 294CONFIG_INET_TCP_DIAG=y
280# CONFIG_TCP_CONG_ADVANCED is not set 295# CONFIG_TCP_CONG_ADVANCED is not set
@@ -282,6 +297,7 @@ CONFIG_TCP_CONG_BIC=y
282# CONFIG_IPV6 is not set 297# CONFIG_IPV6 is not set
283# CONFIG_INET6_XFRM_TUNNEL is not set 298# CONFIG_INET6_XFRM_TUNNEL is not set
284# CONFIG_INET6_TUNNEL is not set 299# CONFIG_INET6_TUNNEL is not set
300CONFIG_NETWORK_SECMARK=y
285# CONFIG_NETFILTER is not set 301# CONFIG_NETFILTER is not set
286 302
287# 303#
@@ -335,6 +351,7 @@ CONFIG_TCP_CONG_BIC=y
335CONFIG_STANDALONE=y 351CONFIG_STANDALONE=y
336CONFIG_PREVENT_FIRMWARE_BUILD=y 352CONFIG_PREVENT_FIRMWARE_BUILD=y
337# CONFIG_FW_LOADER is not set 353# CONFIG_FW_LOADER is not set
354# CONFIG_SYS_HYPERVISOR is not set
338 355
339# 356#
340# Connector - unified userspace <-> kernelspace linker 357# Connector - unified userspace <-> kernelspace linker
@@ -433,6 +450,8 @@ CONFIG_DAVICOM_PHY=m
433CONFIG_QSEMI_PHY=m 450CONFIG_QSEMI_PHY=m
434CONFIG_LXT_PHY=m 451CONFIG_LXT_PHY=m
435CONFIG_CICADA_PHY=m 452CONFIG_CICADA_PHY=m
453CONFIG_VITESSE_PHY=m
454CONFIG_SMSC_PHY=m
436 455
437# 456#
438# Ethernet (10 or 100Mbit) 457# Ethernet (10 or 100Mbit)
@@ -476,6 +495,7 @@ CONFIG_R8169=y
476# CONFIG_CHELSIO_T1 is not set 495# CONFIG_CHELSIO_T1 is not set
477# CONFIG_IXGB is not set 496# CONFIG_IXGB is not set
478# CONFIG_S2IO is not set 497# CONFIG_S2IO is not set
498# CONFIG_MYRI10GE is not set
479 499
480# 500#
481# Token Ring devices 501# Token Ring devices
@@ -545,6 +565,7 @@ CONFIG_INPUT=y
545CONFIG_VT=y 565CONFIG_VT=y
546CONFIG_VT_CONSOLE=y 566CONFIG_VT_CONSOLE=y
547CONFIG_HW_CONSOLE=y 567CONFIG_HW_CONSOLE=y
568CONFIG_VT_HW_CONSOLE_BINDING=y
548# CONFIG_SERIAL_NONSTANDARD is not set 569# CONFIG_SERIAL_NONSTANDARD is not set
549 570
550# 571#
@@ -573,6 +594,7 @@ CONFIG_LEGACY_PTY_COUNT=256
573# Watchdog Cards 594# Watchdog Cards
574# 595#
575# CONFIG_WATCHDOG is not set 596# CONFIG_WATCHDOG is not set
597# CONFIG_HW_RANDOM is not set
576# CONFIG_RTC is not set 598# CONFIG_RTC is not set
577# CONFIG_GEN_RTC is not set 599# CONFIG_GEN_RTC is not set
578# CONFIG_DTLK is not set 600# CONFIG_DTLK is not set
@@ -607,7 +629,6 @@ CONFIG_GPIO_VR41XX=y
607# 629#
608# Dallas's 1-wire bus 630# Dallas's 1-wire bus
609# 631#
610# CONFIG_W1 is not set
611 632
612# 633#
613# Hardware Monitoring support 634# Hardware Monitoring support
@@ -623,6 +644,7 @@ CONFIG_GPIO_VR41XX=y
623# Multimedia devices 644# Multimedia devices
624# 645#
625# CONFIG_VIDEO_DEV is not set 646# CONFIG_VIDEO_DEV is not set
647CONFIG_VIDEO_V4L2=y
626 648
627# 649#
628# Digital Video Broadcasting Devices 650# Digital Video Broadcasting Devices
@@ -633,6 +655,7 @@ CONFIG_GPIO_VR41XX=y
633# 655#
634# Graphics support 656# Graphics support
635# 657#
658# CONFIG_FIRMWARE_EDID is not set
636# CONFIG_FB is not set 659# CONFIG_FB is not set
637 660
638# 661#
@@ -669,6 +692,7 @@ CONFIG_USB_DEVICEFS=y
669CONFIG_USB_EHCI_HCD=m 692CONFIG_USB_EHCI_HCD=m
670# CONFIG_USB_EHCI_SPLIT_ISO is not set 693# CONFIG_USB_EHCI_SPLIT_ISO is not set
671# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 694# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
695# CONFIG_USB_EHCI_TT_NEWSCHED is not set
672# CONFIG_USB_ISP116X_HCD is not set 696# CONFIG_USB_ISP116X_HCD is not set
673CONFIG_USB_OHCI_HCD=m 697CONFIG_USB_OHCI_HCD=m
674# CONFIG_USB_OHCI_BIG_ENDIAN is not set 698# CONFIG_USB_OHCI_BIG_ENDIAN is not set
@@ -749,10 +773,12 @@ CONFIG_USB_MON=y
749# CONFIG_USB_LEGOTOWER is not set 773# CONFIG_USB_LEGOTOWER is not set
750# CONFIG_USB_LCD is not set 774# CONFIG_USB_LCD is not set
751# CONFIG_USB_LED is not set 775# CONFIG_USB_LED is not set
776# CONFIG_USB_CY7C63 is not set
752# CONFIG_USB_CYTHERM is not set 777# CONFIG_USB_CYTHERM is not set
753# CONFIG_USB_PHIDGETKIT is not set 778# CONFIG_USB_PHIDGETKIT is not set
754# CONFIG_USB_PHIDGETSERVO is not set 779# CONFIG_USB_PHIDGETSERVO is not set
755# CONFIG_USB_IDMOUSE is not set 780# CONFIG_USB_IDMOUSE is not set
781# CONFIG_USB_APPLEDISPLAY is not set
756# CONFIG_USB_SISUSBVGA is not set 782# CONFIG_USB_SISUSBVGA is not set
757# CONFIG_USB_LD is not set 783# CONFIG_USB_LD is not set
758# CONFIG_USB_TEST is not set 784# CONFIG_USB_TEST is not set
@@ -807,13 +833,30 @@ CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
807CONFIG_RTC_INTF_SYSFS=y 833CONFIG_RTC_INTF_SYSFS=y
808CONFIG_RTC_INTF_PROC=y 834CONFIG_RTC_INTF_PROC=y
809CONFIG_RTC_INTF_DEV=y 835CONFIG_RTC_INTF_DEV=y
836# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
810 837
811# 838#
812# RTC drivers 839# RTC drivers
813# 840#
841# CONFIG_RTC_DRV_DS1553 is not set
842# CONFIG_RTC_DRV_DS1742 is not set
814# CONFIG_RTC_DRV_M48T86 is not set 843# CONFIG_RTC_DRV_M48T86 is not set
815CONFIG_RTC_DRV_VR41XX=y 844CONFIG_RTC_DRV_VR41XX=y
816# CONFIG_RTC_DRV_TEST is not set 845# CONFIG_RTC_DRV_TEST is not set
846# CONFIG_RTC_DRV_V3020 is not set
847
848#
849# DMA Engine support
850#
851# CONFIG_DMA_ENGINE is not set
852
853#
854# DMA Clients
855#
856
857#
858# DMA Devices
859#
817 860
818# 861#
819# File systems 862# File systems
@@ -830,6 +873,7 @@ CONFIG_EXT2_FS=y
830# CONFIG_MINIX_FS is not set 873# CONFIG_MINIX_FS is not set
831CONFIG_ROMFS_FS=m 874CONFIG_ROMFS_FS=m
832CONFIG_INOTIFY=y 875CONFIG_INOTIFY=y
876CONFIG_INOTIFY_USER=y
833# CONFIG_QUOTA is not set 877# CONFIG_QUOTA is not set
834CONFIG_DNOTIFY=y 878CONFIG_DNOTIFY=y
835# CONFIG_AUTOFS_FS is not set 879# CONFIG_AUTOFS_FS is not set
@@ -900,6 +944,7 @@ CONFIG_SUNRPC=y
900# CONFIG_RPCSEC_GSS_SPKM3 is not set 944# CONFIG_RPCSEC_GSS_SPKM3 is not set
901# CONFIG_SMB_FS is not set 945# CONFIG_SMB_FS is not set
902# CONFIG_CIFS is not set 946# CONFIG_CIFS is not set
947# CONFIG_CIFS_DEBUG2 is not set
903# CONFIG_NCP_FS is not set 948# CONFIG_NCP_FS is not set
904# CONFIG_CODA_FS is not set 949# CONFIG_CODA_FS is not set
905# CONFIG_AFS_FS is not set 950# CONFIG_AFS_FS is not set
@@ -926,6 +971,7 @@ CONFIG_MSDOS_PARTITION=y
926# 971#
927# CONFIG_PRINTK_TIME is not set 972# CONFIG_PRINTK_TIME is not set
928# CONFIG_MAGIC_SYSRQ is not set 973# CONFIG_MAGIC_SYSRQ is not set
974# CONFIG_UNUSED_SYMBOLS is not set
929# CONFIG_DEBUG_KERNEL is not set 975# CONFIG_DEBUG_KERNEL is not set
930CONFIG_LOG_BUF_SHIFT=14 976CONFIG_LOG_BUF_SHIFT=14
931# CONFIG_DEBUG_FS is not set 977# CONFIG_DEBUG_FS is not set
@@ -955,3 +1001,4 @@ CONFIG_CMDLINE="mem=64M console=ttyVR0,115200 ip=any root=/dev/nfs"
955CONFIG_CRC32=y 1001CONFIG_CRC32=y
956# CONFIG_LIBCRC32C is not set 1002# CONFIG_LIBCRC32C is not set
957CONFIG_ZLIB_INFLATE=m 1003CONFIG_ZLIB_INFLATE=m
1004CONFIG_PLIST=y
diff --git a/arch/mips/configs/tb0287_defconfig b/arch/mips/configs/tb0287_defconfig
index 258457fcbe11..effcb63b81a3 100644
--- a/arch/mips/configs/tb0287_defconfig
+++ b/arch/mips/configs/tb0287_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Tue Apr 25 00:09:17 2006 4# Thu Jul 6 10:04:21 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MIPS=y
45CONFIG_MACH_VR41XX=y 47CONFIG_MACH_VR41XX=y
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -120,7 +123,10 @@ CONFIG_PAGE_SIZE_4KB=y
120# CONFIG_PAGE_SIZE_8KB is not set 123# CONFIG_PAGE_SIZE_8KB is not set
121# CONFIG_PAGE_SIZE_16KB is not set 124# CONFIG_PAGE_SIZE_16KB is not set
122# CONFIG_PAGE_SIZE_64KB is not set 125# CONFIG_PAGE_SIZE_64KB is not set
123# CONFIG_MIPS_MT is not set 126CONFIG_MIPS_MT_DISABLED=y
127# CONFIG_MIPS_MT_SMTC is not set
128# CONFIG_MIPS_MT_SMP is not set
129# CONFIG_MIPS_VPE_LOADER is not set
124CONFIG_CPU_HAS_SYNC=y 130CONFIG_CPU_HAS_SYNC=y
125CONFIG_GENERIC_HARDIRQS=y 131CONFIG_GENERIC_HARDIRQS=y
126CONFIG_GENERIC_IRQ_PROBE=y 132CONFIG_GENERIC_IRQ_PROBE=y
@@ -133,6 +139,7 @@ CONFIG_FLATMEM=y
133CONFIG_FLAT_NODE_MEM_MAP=y 139CONFIG_FLAT_NODE_MEM_MAP=y
134# CONFIG_SPARSEMEM_STATIC is not set 140# CONFIG_SPARSEMEM_STATIC is not set
135CONFIG_SPLIT_PTLOCK_CPUS=4 141CONFIG_SPLIT_PTLOCK_CPUS=4
142# CONFIG_RESOURCES_64BIT is not set
136# CONFIG_HZ_48 is not set 143# CONFIG_HZ_48 is not set
137# CONFIG_HZ_100 is not set 144# CONFIG_HZ_100 is not set
138# CONFIG_HZ_128 is not set 145# CONFIG_HZ_128 is not set
@@ -145,6 +152,7 @@ CONFIG_HZ=1000
145CONFIG_PREEMPT_NONE=y 152CONFIG_PREEMPT_NONE=y
146# CONFIG_PREEMPT_VOLUNTARY is not set 153# CONFIG_PREEMPT_VOLUNTARY is not set
147# CONFIG_PREEMPT is not set 154# CONFIG_PREEMPT is not set
155CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
148 156
149# 157#
150# Code maturity level options 158# Code maturity level options
@@ -176,10 +184,12 @@ CONFIG_PRINTK=y
176CONFIG_BUG=y 184CONFIG_BUG=y
177CONFIG_ELF_CORE=y 185CONFIG_ELF_CORE=y
178CONFIG_BASE_FULL=y 186CONFIG_BASE_FULL=y
187CONFIG_RT_MUTEXES=y
179CONFIG_FUTEX=y 188CONFIG_FUTEX=y
180CONFIG_EPOLL=y 189CONFIG_EPOLL=y
181CONFIG_SHMEM=y 190CONFIG_SHMEM=y
182CONFIG_SLAB=y 191CONFIG_SLAB=y
192CONFIG_VM_EVENT_COUNTERS=y
183# CONFIG_TINY_SHMEM is not set 193# CONFIG_TINY_SHMEM is not set
184CONFIG_BASE_SMALL=0 194CONFIG_BASE_SMALL=0
185# CONFIG_SLOB is not set 195# CONFIG_SLOB is not set
@@ -250,6 +260,8 @@ CONFIG_NET=y
250CONFIG_PACKET=y 260CONFIG_PACKET=y
251# CONFIG_PACKET_MMAP is not set 261# CONFIG_PACKET_MMAP is not set
252CONFIG_UNIX=y 262CONFIG_UNIX=y
263CONFIG_XFRM=y
264# CONFIG_XFRM_USER is not set
253# CONFIG_NET_KEY is not set 265# CONFIG_NET_KEY is not set
254CONFIG_INET=y 266CONFIG_INET=y
255CONFIG_IP_MULTICAST=y 267CONFIG_IP_MULTICAST=y
@@ -276,6 +288,8 @@ CONFIG_SYN_COOKIES=y
276# CONFIG_INET_IPCOMP is not set 288# CONFIG_INET_IPCOMP is not set
277# CONFIG_INET_XFRM_TUNNEL is not set 289# CONFIG_INET_XFRM_TUNNEL is not set
278CONFIG_INET_TUNNEL=m 290CONFIG_INET_TUNNEL=m
291CONFIG_INET_XFRM_MODE_TRANSPORT=m
292CONFIG_INET_XFRM_MODE_TUNNEL=m
279CONFIG_INET_DIAG=y 293CONFIG_INET_DIAG=y
280CONFIG_INET_TCP_DIAG=y 294CONFIG_INET_TCP_DIAG=y
281CONFIG_TCP_CONG_ADVANCED=y 295CONFIG_TCP_CONG_ADVANCED=y
@@ -291,9 +305,13 @@ CONFIG_TCP_CONG_HTCP=m
291# CONFIG_TCP_CONG_HYBLA is not set 305# CONFIG_TCP_CONG_HYBLA is not set
292# CONFIG_TCP_CONG_VEGAS is not set 306# CONFIG_TCP_CONG_VEGAS is not set
293# CONFIG_TCP_CONG_SCALABLE is not set 307# CONFIG_TCP_CONG_SCALABLE is not set
308# CONFIG_TCP_CONG_LP is not set
309# CONFIG_TCP_CONG_VENO is not set
310# CONFIG_TCP_CONG_COMPOUND is not set
294# CONFIG_IPV6 is not set 311# CONFIG_IPV6 is not set
295# CONFIG_INET6_XFRM_TUNNEL is not set 312# CONFIG_INET6_XFRM_TUNNEL is not set
296# CONFIG_INET6_TUNNEL is not set 313# CONFIG_INET6_TUNNEL is not set
314CONFIG_NETWORK_SECMARK=y
297# CONFIG_NETFILTER is not set 315# CONFIG_NETFILTER is not set
298 316
299# 317#
@@ -347,6 +365,7 @@ CONFIG_TCP_CONG_HTCP=m
347CONFIG_STANDALONE=y 365CONFIG_STANDALONE=y
348CONFIG_PREVENT_FIRMWARE_BUILD=y 366CONFIG_PREVENT_FIRMWARE_BUILD=y
349# CONFIG_FW_LOADER is not set 367# CONFIG_FW_LOADER is not set
368# CONFIG_SYS_HYPERVISOR is not set
350 369
351# 370#
352# Connector - unified userspace <-> kernelspace linker 371# Connector - unified userspace <-> kernelspace linker
@@ -492,6 +511,7 @@ CONFIG_BLK_DEV_SD=y
492# CONFIG_MEGARAID_LEGACY is not set 511# CONFIG_MEGARAID_LEGACY is not set
493# CONFIG_MEGARAID_SAS is not set 512# CONFIG_MEGARAID_SAS is not set
494# CONFIG_SCSI_SATA is not set 513# CONFIG_SCSI_SATA is not set
514# CONFIG_SCSI_HPTIOP is not set
495# CONFIG_SCSI_DMX3191D is not set 515# CONFIG_SCSI_DMX3191D is not set
496# CONFIG_SCSI_FUTURE_DOMAIN is not set 516# CONFIG_SCSI_FUTURE_DOMAIN is not set
497# CONFIG_SCSI_IPS is not set 517# CONFIG_SCSI_IPS is not set
@@ -548,7 +568,6 @@ CONFIG_IEEE1394_OHCI1394=m
548# 568#
549CONFIG_IEEE1394_VIDEO1394=m 569CONFIG_IEEE1394_VIDEO1394=m
550CONFIG_IEEE1394_SBP2=m 570CONFIG_IEEE1394_SBP2=m
551# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set
552CONFIG_IEEE1394_ETH1394=m 571CONFIG_IEEE1394_ETH1394=m
553CONFIG_IEEE1394_DV1394=m 572CONFIG_IEEE1394_DV1394=m
554CONFIG_IEEE1394_RAWIO=m 573CONFIG_IEEE1394_RAWIO=m
@@ -619,6 +638,7 @@ CONFIG_R8169=y
619# CONFIG_CHELSIO_T1 is not set 638# CONFIG_CHELSIO_T1 is not set
620# CONFIG_IXGB is not set 639# CONFIG_IXGB is not set
621# CONFIG_S2IO is not set 640# CONFIG_S2IO is not set
641# CONFIG_MYRI10GE is not set
622 642
623# 643#
624# Token Ring devices 644# Token Ring devices
@@ -689,6 +709,7 @@ CONFIG_INPUT=y
689CONFIG_VT=y 709CONFIG_VT=y
690CONFIG_VT_CONSOLE=y 710CONFIG_VT_CONSOLE=y
691CONFIG_HW_CONSOLE=y 711CONFIG_HW_CONSOLE=y
712CONFIG_VT_HW_CONSOLE_BINDING=y
692# CONFIG_SERIAL_NONSTANDARD is not set 713# CONFIG_SERIAL_NONSTANDARD is not set
693 714
694# 715#
@@ -717,6 +738,7 @@ CONFIG_LEGACY_PTY_COUNT=256
717# Watchdog Cards 738# Watchdog Cards
718# 739#
719# CONFIG_WATCHDOG is not set 740# CONFIG_WATCHDOG is not set
741# CONFIG_HW_RANDOM is not set
720# CONFIG_RTC is not set 742# CONFIG_RTC is not set
721# CONFIG_GEN_RTC is not set 743# CONFIG_GEN_RTC is not set
722# CONFIG_DTLK is not set 744# CONFIG_DTLK is not set
@@ -751,7 +773,6 @@ CONFIG_GPIO_VR41XX=y
751# 773#
752# Dallas's 1-wire bus 774# Dallas's 1-wire bus
753# 775#
754# CONFIG_W1 is not set
755 776
756# 777#
757# Hardware Monitoring support 778# Hardware Monitoring support
@@ -767,6 +788,7 @@ CONFIG_GPIO_VR41XX=y
767# Multimedia devices 788# Multimedia devices
768# 789#
769# CONFIG_VIDEO_DEV is not set 790# CONFIG_VIDEO_DEV is not set
791CONFIG_VIDEO_V4L2=y
770 792
771# 793#
772# Digital Video Broadcasting Devices 794# Digital Video Broadcasting Devices
@@ -777,12 +799,13 @@ CONFIG_GPIO_VR41XX=y
777# 799#
778# Graphics support 800# Graphics support
779# 801#
802# CONFIG_FIRMWARE_EDID is not set
780CONFIG_FB=y 803CONFIG_FB=y
781CONFIG_FB_CFB_FILLRECT=y 804CONFIG_FB_CFB_FILLRECT=y
782CONFIG_FB_CFB_COPYAREA=y 805CONFIG_FB_CFB_COPYAREA=y
783CONFIG_FB_CFB_IMAGEBLIT=y 806CONFIG_FB_CFB_IMAGEBLIT=y
784# CONFIG_FB_MACMODES is not set 807# CONFIG_FB_MACMODES is not set
785CONFIG_FB_FIRMWARE_EDID=y 808# CONFIG_FB_BACKLIGHT is not set
786# CONFIG_FB_MODE_HELPERS is not set 809# CONFIG_FB_MODE_HELPERS is not set
787# CONFIG_FB_TILEBLITTING is not set 810# CONFIG_FB_TILEBLITTING is not set
788# CONFIG_FB_CIRRUS is not set 811# CONFIG_FB_CIRRUS is not set
@@ -848,6 +871,7 @@ CONFIG_USB=m
848CONFIG_USB_EHCI_HCD=m 871CONFIG_USB_EHCI_HCD=m
849# CONFIG_USB_EHCI_SPLIT_ISO is not set 872# CONFIG_USB_EHCI_SPLIT_ISO is not set
850# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 873# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
874# CONFIG_USB_EHCI_TT_NEWSCHED is not set
851# CONFIG_USB_ISP116X_HCD is not set 875# CONFIG_USB_ISP116X_HCD is not set
852CONFIG_USB_OHCI_HCD=m 876CONFIG_USB_OHCI_HCD=m
853# CONFIG_USB_OHCI_BIG_ENDIAN is not set 877# CONFIG_USB_OHCI_BIG_ENDIAN is not set
@@ -943,10 +967,12 @@ CONFIG_USB_MON=y
943# CONFIG_USB_LEGOTOWER is not set 967# CONFIG_USB_LEGOTOWER is not set
944# CONFIG_USB_LCD is not set 968# CONFIG_USB_LCD is not set
945# CONFIG_USB_LED is not set 969# CONFIG_USB_LED is not set
970# CONFIG_USB_CY7C63 is not set
946# CONFIG_USB_CYTHERM is not set 971# CONFIG_USB_CYTHERM is not set
947# CONFIG_USB_PHIDGETKIT is not set 972# CONFIG_USB_PHIDGETKIT is not set
948# CONFIG_USB_PHIDGETSERVO is not set 973# CONFIG_USB_PHIDGETSERVO is not set
949# CONFIG_USB_IDMOUSE is not set 974# CONFIG_USB_IDMOUSE is not set
975# CONFIG_USB_APPLEDISPLAY is not set
950# CONFIG_USB_SISUSBVGA is not set 976# CONFIG_USB_SISUSBVGA is not set
951# CONFIG_USB_LD is not set 977# CONFIG_USB_LD is not set
952 978
@@ -992,6 +1018,19 @@ CONFIG_USB_MON=y
992# CONFIG_RTC_CLASS is not set 1018# CONFIG_RTC_CLASS is not set
993 1019
994# 1020#
1021# DMA Engine support
1022#
1023# CONFIG_DMA_ENGINE is not set
1024
1025#
1026# DMA Clients
1027#
1028
1029#
1030# DMA Devices
1031#
1032
1033#
995# File systems 1034# File systems
996# 1035#
997CONFIG_EXT2_FS=y 1036CONFIG_EXT2_FS=y
@@ -1016,6 +1055,7 @@ CONFIG_XFS_POSIX_ACL=y
1016# CONFIG_MINIX_FS is not set 1055# CONFIG_MINIX_FS is not set
1017CONFIG_ROMFS_FS=m 1056CONFIG_ROMFS_FS=m
1018CONFIG_INOTIFY=y 1057CONFIG_INOTIFY=y
1058CONFIG_INOTIFY_USER=y
1019# CONFIG_QUOTA is not set 1059# CONFIG_QUOTA is not set
1020CONFIG_QUOTACTL=y 1060CONFIG_QUOTACTL=y
1021# CONFIG_DNOTIFY is not set 1061# CONFIG_DNOTIFY is not set
@@ -1082,6 +1122,7 @@ CONFIG_SUNRPC=y
1082# CONFIG_RPCSEC_GSS_SPKM3 is not set 1122# CONFIG_RPCSEC_GSS_SPKM3 is not set
1083# CONFIG_SMB_FS is not set 1123# CONFIG_SMB_FS is not set
1084# CONFIG_CIFS is not set 1124# CONFIG_CIFS is not set
1125# CONFIG_CIFS_DEBUG2 is not set
1085# CONFIG_NCP_FS is not set 1126# CONFIG_NCP_FS is not set
1086# CONFIG_CODA_FS is not set 1127# CONFIG_CODA_FS is not set
1087# CONFIG_AFS_FS is not set 1128# CONFIG_AFS_FS is not set
@@ -1108,6 +1149,7 @@ CONFIG_MSDOS_PARTITION=y
1108# 1149#
1109# CONFIG_PRINTK_TIME is not set 1150# CONFIG_PRINTK_TIME is not set
1110# CONFIG_MAGIC_SYSRQ is not set 1151# CONFIG_MAGIC_SYSRQ is not set
1152# CONFIG_UNUSED_SYMBOLS is not set
1111# CONFIG_DEBUG_KERNEL is not set 1153# CONFIG_DEBUG_KERNEL is not set
1112CONFIG_LOG_BUF_SHIFT=14 1154CONFIG_LOG_BUF_SHIFT=14
1113# CONFIG_DEBUG_FS is not set 1155# CONFIG_DEBUG_FS is not set
@@ -1137,3 +1179,4 @@ CONFIG_CMDLINE="mem=64M console=ttyVR0,115200 ip=any root=/dev/nfs"
1137CONFIG_CRC32=y 1179CONFIG_CRC32=y
1138# CONFIG_LIBCRC32C is not set 1180# CONFIG_LIBCRC32C is not set
1139CONFIG_ZLIB_INFLATE=m 1181CONFIG_ZLIB_INFLATE=m
1182CONFIG_PLIST=y
diff --git a/arch/mips/configs/workpad_defconfig b/arch/mips/configs/workpad_defconfig
index 68af54f746e1..4891d02ef8ca 100644
--- a/arch/mips/configs/workpad_defconfig
+++ b/arch/mips/configs/workpad_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Tue Apr 25 00:09:33 2006 4# Thu Jul 6 10:04:21 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MIPS=y
45CONFIG_MACH_VR41XX=y 47CONFIG_MACH_VR41XX=y
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -71,6 +74,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
71CONFIG_GENERIC_FIND_NEXT_BIT=y 74CONFIG_GENERIC_FIND_NEXT_BIT=y
72CONFIG_GENERIC_HWEIGHT=y 75CONFIG_GENERIC_HWEIGHT=y
73CONFIG_GENERIC_CALIBRATE_DELAY=y 76CONFIG_GENERIC_CALIBRATE_DELAY=y
77CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
74CONFIG_DMA_NONCOHERENT=y 78CONFIG_DMA_NONCOHERENT=y
75CONFIG_DMA_NEED_PCI_MAP_STATE=y 79CONFIG_DMA_NEED_PCI_MAP_STATE=y
76# CONFIG_CPU_BIG_ENDIAN is not set 80# CONFIG_CPU_BIG_ENDIAN is not set
@@ -115,7 +119,10 @@ CONFIG_PAGE_SIZE_4KB=y
115# CONFIG_PAGE_SIZE_8KB is not set 119# CONFIG_PAGE_SIZE_8KB is not set
116# CONFIG_PAGE_SIZE_16KB is not set 120# CONFIG_PAGE_SIZE_16KB is not set
117# CONFIG_PAGE_SIZE_64KB is not set 121# CONFIG_PAGE_SIZE_64KB is not set
118# CONFIG_MIPS_MT is not set 122CONFIG_MIPS_MT_DISABLED=y
123# CONFIG_MIPS_MT_SMTC is not set
124# CONFIG_MIPS_MT_SMP is not set
125# CONFIG_MIPS_VPE_LOADER is not set
119CONFIG_CPU_HAS_SYNC=y 126CONFIG_CPU_HAS_SYNC=y
120CONFIG_GENERIC_HARDIRQS=y 127CONFIG_GENERIC_HARDIRQS=y
121CONFIG_GENERIC_IRQ_PROBE=y 128CONFIG_GENERIC_IRQ_PROBE=y
@@ -128,6 +135,7 @@ CONFIG_FLATMEM=y
128CONFIG_FLAT_NODE_MEM_MAP=y 135CONFIG_FLAT_NODE_MEM_MAP=y
129# CONFIG_SPARSEMEM_STATIC is not set 136# CONFIG_SPARSEMEM_STATIC is not set
130CONFIG_SPLIT_PTLOCK_CPUS=4 137CONFIG_SPLIT_PTLOCK_CPUS=4
138# CONFIG_RESOURCES_64BIT is not set
131# CONFIG_HZ_48 is not set 139# CONFIG_HZ_48 is not set
132# CONFIG_HZ_100 is not set 140# CONFIG_HZ_100 is not set
133# CONFIG_HZ_128 is not set 141# CONFIG_HZ_128 is not set
@@ -140,6 +148,7 @@ CONFIG_HZ=1000
140CONFIG_PREEMPT_NONE=y 148CONFIG_PREEMPT_NONE=y
141# CONFIG_PREEMPT_VOLUNTARY is not set 149# CONFIG_PREEMPT_VOLUNTARY is not set
142# CONFIG_PREEMPT is not set 150# CONFIG_PREEMPT is not set
151CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
143 152
144# 153#
145# Code maturity level options 154# Code maturity level options
@@ -171,10 +180,12 @@ CONFIG_PRINTK=y
171CONFIG_BUG=y 180CONFIG_BUG=y
172CONFIG_ELF_CORE=y 181CONFIG_ELF_CORE=y
173CONFIG_BASE_FULL=y 182CONFIG_BASE_FULL=y
183CONFIG_RT_MUTEXES=y
174CONFIG_FUTEX=y 184CONFIG_FUTEX=y
175CONFIG_EPOLL=y 185CONFIG_EPOLL=y
176CONFIG_SHMEM=y 186CONFIG_SHMEM=y
177CONFIG_SLAB=y 187CONFIG_SLAB=y
188CONFIG_VM_EVENT_COUNTERS=y
178# CONFIG_TINY_SHMEM is not set 189# CONFIG_TINY_SHMEM is not set
179CONFIG_BASE_SMALL=0 190CONFIG_BASE_SMALL=0
180# CONFIG_SLOB is not set 191# CONFIG_SLOB is not set
@@ -273,6 +284,8 @@ CONFIG_IP_FIB_HASH=y
273# CONFIG_INET_IPCOMP is not set 284# CONFIG_INET_IPCOMP is not set
274# CONFIG_INET_XFRM_TUNNEL is not set 285# CONFIG_INET_XFRM_TUNNEL is not set
275# CONFIG_INET_TUNNEL is not set 286# CONFIG_INET_TUNNEL is not set
287CONFIG_INET_XFRM_MODE_TRANSPORT=m
288CONFIG_INET_XFRM_MODE_TUNNEL=m
276CONFIG_INET_DIAG=y 289CONFIG_INET_DIAG=y
277CONFIG_INET_TCP_DIAG=y 290CONFIG_INET_TCP_DIAG=y
278# CONFIG_TCP_CONG_ADVANCED is not set 291# CONFIG_TCP_CONG_ADVANCED is not set
@@ -280,6 +293,7 @@ CONFIG_TCP_CONG_BIC=y
280# CONFIG_IPV6 is not set 293# CONFIG_IPV6 is not set
281# CONFIG_INET6_XFRM_TUNNEL is not set 294# CONFIG_INET6_XFRM_TUNNEL is not set
282# CONFIG_INET6_TUNNEL is not set 295# CONFIG_INET6_TUNNEL is not set
296CONFIG_NETWORK_SECMARK=y
283# CONFIG_NETFILTER is not set 297# CONFIG_NETFILTER is not set
284 298
285# 299#
@@ -334,6 +348,7 @@ CONFIG_WIRELESS_EXT=y
334CONFIG_STANDALONE=y 348CONFIG_STANDALONE=y
335CONFIG_PREVENT_FIRMWARE_BUILD=y 349CONFIG_PREVENT_FIRMWARE_BUILD=y
336CONFIG_FW_LOADER=y 350CONFIG_FW_LOADER=y
351# CONFIG_SYS_HYPERVISOR is not set
337 352
338# 353#
339# Connector - unified userspace <-> kernelspace linker 354# Connector - unified userspace <-> kernelspace linker
@@ -452,6 +467,8 @@ CONFIG_DAVICOM_PHY=m
452CONFIG_QSEMI_PHY=m 467CONFIG_QSEMI_PHY=m
453CONFIG_LXT_PHY=m 468CONFIG_LXT_PHY=m
454CONFIG_CICADA_PHY=m 469CONFIG_CICADA_PHY=m
470CONFIG_VITESSE_PHY=m
471CONFIG_SMSC_PHY=m
455 472
456# 473#
457# Ethernet (10 or 100Mbit) 474# Ethernet (10 or 100Mbit)
@@ -586,6 +603,7 @@ CONFIG_INPUT=y
586CONFIG_VT=y 603CONFIG_VT=y
587CONFIG_VT_CONSOLE=y 604CONFIG_VT_CONSOLE=y
588CONFIG_HW_CONSOLE=y 605CONFIG_HW_CONSOLE=y
606CONFIG_VT_HW_CONSOLE_BINDING=y
589# CONFIG_SERIAL_NONSTANDARD is not set 607# CONFIG_SERIAL_NONSTANDARD is not set
590 608
591# 609#
@@ -613,6 +631,7 @@ CONFIG_LEGACY_PTY_COUNT=256
613# Watchdog Cards 631# Watchdog Cards
614# 632#
615# CONFIG_WATCHDOG is not set 633# CONFIG_WATCHDOG is not set
634# CONFIG_HW_RANDOM is not set
616# CONFIG_RTC is not set 635# CONFIG_RTC is not set
617# CONFIG_GEN_RTC is not set 636# CONFIG_GEN_RTC is not set
618# CONFIG_DTLK is not set 637# CONFIG_DTLK is not set
@@ -667,6 +686,7 @@ CONFIG_LEGACY_PTY_COUNT=256
667# Multimedia devices 686# Multimedia devices
668# 687#
669# CONFIG_VIDEO_DEV is not set 688# CONFIG_VIDEO_DEV is not set
689CONFIG_VIDEO_V4L2=y
670 690
671# 691#
672# Digital Video Broadcasting Devices 692# Digital Video Broadcasting Devices
@@ -676,6 +696,7 @@ CONFIG_LEGACY_PTY_COUNT=256
676# 696#
677# Graphics support 697# Graphics support
678# 698#
699# CONFIG_FIRMWARE_EDID is not set
679# CONFIG_FB is not set 700# CONFIG_FB is not set
680 701
681# 702#
@@ -738,6 +759,19 @@ CONFIG_DUMMY_CONSOLE=y
738# CONFIG_RTC_CLASS is not set 759# CONFIG_RTC_CLASS is not set
739 760
740# 761#
762# DMA Engine support
763#
764# CONFIG_DMA_ENGINE is not set
765
766#
767# DMA Clients
768#
769
770#
771# DMA Devices
772#
773
774#
741# File systems 775# File systems
742# 776#
743CONFIG_EXT2_FS=y 777CONFIG_EXT2_FS=y
@@ -755,6 +789,7 @@ CONFIG_FS_POSIX_ACL=y
755# CONFIG_MINIX_FS is not set 789# CONFIG_MINIX_FS is not set
756# CONFIG_ROMFS_FS is not set 790# CONFIG_ROMFS_FS is not set
757CONFIG_INOTIFY=y 791CONFIG_INOTIFY=y
792CONFIG_INOTIFY_USER=y
758# CONFIG_QUOTA is not set 793# CONFIG_QUOTA is not set
759CONFIG_DNOTIFY=y 794CONFIG_DNOTIFY=y
760# CONFIG_AUTOFS_FS is not set 795# CONFIG_AUTOFS_FS is not set
@@ -820,6 +855,7 @@ CONFIG_SUNRPC=y
820# CONFIG_RPCSEC_GSS_SPKM3 is not set 855# CONFIG_RPCSEC_GSS_SPKM3 is not set
821# CONFIG_SMB_FS is not set 856# CONFIG_SMB_FS is not set
822# CONFIG_CIFS is not set 857# CONFIG_CIFS is not set
858# CONFIG_CIFS_DEBUG2 is not set
823# CONFIG_NCP_FS is not set 859# CONFIG_NCP_FS is not set
824# CONFIG_CODA_FS is not set 860# CONFIG_CODA_FS is not set
825# CONFIG_AFS_FS is not set 861# CONFIG_AFS_FS is not set
@@ -846,6 +882,7 @@ CONFIG_MSDOS_PARTITION=y
846# 882#
847# CONFIG_PRINTK_TIME is not set 883# CONFIG_PRINTK_TIME is not set
848# CONFIG_MAGIC_SYSRQ is not set 884# CONFIG_MAGIC_SYSRQ is not set
885# CONFIG_UNUSED_SYMBOLS is not set
849# CONFIG_DEBUG_KERNEL is not set 886# CONFIG_DEBUG_KERNEL is not set
850CONFIG_LOG_BUF_SHIFT=14 887CONFIG_LOG_BUF_SHIFT=14
851# CONFIG_DEBUG_FS is not set 888# CONFIG_DEBUG_FS is not set
@@ -874,3 +911,4 @@ CONFIG_CMDLINE="console=ttyVR0,19200 mem=16M"
874# CONFIG_CRC16 is not set 911# CONFIG_CRC16 is not set
875CONFIG_CRC32=y 912CONFIG_CRC32=y
876# CONFIG_LIBCRC32C is not set 913# CONFIG_LIBCRC32C is not set
914CONFIG_PLIST=y
diff --git a/arch/mips/configs/wrppmc_defconfig b/arch/mips/configs/wrppmc_defconfig
index 40572a3c8cac..3e4b16b39827 100644
--- a/arch/mips/configs/wrppmc_defconfig
+++ b/arch/mips/configs/wrppmc_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16.11 3# Linux kernel version: 2.6.18-rc1
4# Fri May 5 17:11:22 2006 4# Thu Jul 6 10:04:21 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -46,6 +47,7 @@ CONFIG_WR_PPMC=y
46# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
47# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
48# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
49# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
50# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
51# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -63,7 +65,10 @@ CONFIG_WR_PPMC=y
63# CONFIG_TOSHIBA_RBTX4927 is not set 65# CONFIG_TOSHIBA_RBTX4927 is not set
64# CONFIG_TOSHIBA_RBTX4938 is not set 66# CONFIG_TOSHIBA_RBTX4938 is not set
65CONFIG_RWSEM_GENERIC_SPINLOCK=y 67CONFIG_RWSEM_GENERIC_SPINLOCK=y
68CONFIG_GENERIC_FIND_NEXT_BIT=y
69CONFIG_GENERIC_HWEIGHT=y
66CONFIG_GENERIC_CALIBRATE_DELAY=y 70CONFIG_GENERIC_CALIBRATE_DELAY=y
71CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
67CONFIG_DMA_NONCOHERENT=y 72CONFIG_DMA_NONCOHERENT=y
68CONFIG_DMA_NEED_PCI_MAP_STATE=y 73CONFIG_DMA_NEED_PCI_MAP_STATE=y
69CONFIG_CPU_BIG_ENDIAN=y 74CONFIG_CPU_BIG_ENDIAN=y
@@ -119,9 +124,11 @@ CONFIG_PAGE_SIZE_4KB=y
119# CONFIG_PAGE_SIZE_16KB is not set 124# CONFIG_PAGE_SIZE_16KB is not set
120# CONFIG_PAGE_SIZE_64KB is not set 125# CONFIG_PAGE_SIZE_64KB is not set
121CONFIG_CPU_HAS_PREFETCH=y 126CONFIG_CPU_HAS_PREFETCH=y
122# CONFIG_MIPS_MT is not set 127CONFIG_MIPS_MT_DISABLED=y
128# CONFIG_MIPS_MT_SMTC is not set
129# CONFIG_MIPS_MT_SMP is not set
130# CONFIG_MIPS_VPE_LOADER is not set
123# CONFIG_64BIT_PHYS_ADDR is not set 131# CONFIG_64BIT_PHYS_ADDR is not set
124# CONFIG_CPU_ADVANCED is not set
125CONFIG_CPU_HAS_LLSC=y 132CONFIG_CPU_HAS_LLSC=y
126CONFIG_CPU_HAS_SYNC=y 133CONFIG_CPU_HAS_SYNC=y
127CONFIG_GENERIC_HARDIRQS=y 134CONFIG_GENERIC_HARDIRQS=y
@@ -136,6 +143,7 @@ CONFIG_FLATMEM=y
136CONFIG_FLAT_NODE_MEM_MAP=y 143CONFIG_FLAT_NODE_MEM_MAP=y
137# CONFIG_SPARSEMEM_STATIC is not set 144# CONFIG_SPARSEMEM_STATIC is not set
138CONFIG_SPLIT_PTLOCK_CPUS=4 145CONFIG_SPLIT_PTLOCK_CPUS=4
146# CONFIG_RESOURCES_64BIT is not set
139# CONFIG_HZ_48 is not set 147# CONFIG_HZ_48 is not set
140# CONFIG_HZ_100 is not set 148# CONFIG_HZ_100 is not set
141# CONFIG_HZ_128 is not set 149# CONFIG_HZ_128 is not set
@@ -148,6 +156,7 @@ CONFIG_HZ=1000
148CONFIG_PREEMPT_NONE=y 156CONFIG_PREEMPT_NONE=y
149# CONFIG_PREEMPT_VOLUNTARY is not set 157# CONFIG_PREEMPT_VOLUNTARY is not set
150# CONFIG_PREEMPT is not set 158# CONFIG_PREEMPT is not set
159CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
151 160
152# 161#
153# Code maturity level options 162# Code maturity level options
@@ -169,6 +178,7 @@ CONFIG_BSD_PROCESS_ACCT=y
169CONFIG_SYSCTL=y 178CONFIG_SYSCTL=y
170# CONFIG_AUDIT is not set 179# CONFIG_AUDIT is not set
171# CONFIG_IKCONFIG is not set 180# CONFIG_IKCONFIG is not set
181# CONFIG_RELAY is not set
172CONFIG_INITRAMFS_SOURCE="" 182CONFIG_INITRAMFS_SOURCE=""
173# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 183# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
174CONFIG_EMBEDDED=y 184CONFIG_EMBEDDED=y
@@ -179,14 +189,12 @@ CONFIG_PRINTK=y
179CONFIG_BUG=y 189CONFIG_BUG=y
180CONFIG_ELF_CORE=y 190CONFIG_ELF_CORE=y
181CONFIG_BASE_FULL=y 191CONFIG_BASE_FULL=y
192CONFIG_RT_MUTEXES=y
182CONFIG_FUTEX=y 193CONFIG_FUTEX=y
183# CONFIG_EPOLL is not set 194# CONFIG_EPOLL is not set
184CONFIG_SHMEM=y 195CONFIG_SHMEM=y
185CONFIG_CC_ALIGN_FUNCTIONS=0
186CONFIG_CC_ALIGN_LABELS=0
187CONFIG_CC_ALIGN_LOOPS=0
188CONFIG_CC_ALIGN_JUMPS=0
189CONFIG_SLAB=y 196CONFIG_SLAB=y
197CONFIG_VM_EVENT_COUNTERS=y
190# CONFIG_TINY_SHMEM is not set 198# CONFIG_TINY_SHMEM is not set
191CONFIG_BASE_SMALL=0 199CONFIG_BASE_SMALL=0
192# CONFIG_SLOB is not set 200# CONFIG_SLOB is not set
@@ -197,7 +205,6 @@ CONFIG_BASE_SMALL=0
197CONFIG_MODULES=y 205CONFIG_MODULES=y
198CONFIG_MODULE_UNLOAD=y 206CONFIG_MODULE_UNLOAD=y
199# CONFIG_MODULE_FORCE_UNLOAD is not set 207# CONFIG_MODULE_FORCE_UNLOAD is not set
200CONFIG_OBSOLETE_MODPARM=y
201CONFIG_MODVERSIONS=y 208CONFIG_MODVERSIONS=y
202CONFIG_MODULE_SRCVERSION_ALL=y 209CONFIG_MODULE_SRCVERSION_ALL=y
203# CONFIG_KMOD is not set 210# CONFIG_KMOD is not set
@@ -206,6 +213,8 @@ CONFIG_MODULE_SRCVERSION_ALL=y
206# Block layer 213# Block layer
207# 214#
208# CONFIG_LBD is not set 215# CONFIG_LBD is not set
216# CONFIG_BLK_DEV_IO_TRACE is not set
217# CONFIG_LSF is not set
209 218
210# 219#
211# IO Schedulers 220# IO Schedulers
@@ -225,7 +234,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
225# 234#
226CONFIG_HW_HAS_PCI=y 235CONFIG_HW_HAS_PCI=y
227CONFIG_PCI=y 236CONFIG_PCI=y
228CONFIG_PCI_LEGACY_PROC=y
229CONFIG_MMU=y 237CONFIG_MMU=y
230 238
231# 239#
@@ -260,6 +268,8 @@ CONFIG_NET=y
260CONFIG_PACKET=y 268CONFIG_PACKET=y
261CONFIG_PACKET_MMAP=y 269CONFIG_PACKET_MMAP=y
262CONFIG_UNIX=y 270CONFIG_UNIX=y
271CONFIG_XFRM=y
272# CONFIG_XFRM_USER is not set
263# CONFIG_NET_KEY is not set 273# CONFIG_NET_KEY is not set
264CONFIG_INET=y 274CONFIG_INET=y
265CONFIG_IP_MULTICAST=y 275CONFIG_IP_MULTICAST=y
@@ -279,12 +289,18 @@ CONFIG_ARPD=y
279# CONFIG_INET_AH is not set 289# CONFIG_INET_AH is not set
280# CONFIG_INET_ESP is not set 290# CONFIG_INET_ESP is not set
281# CONFIG_INET_IPCOMP is not set 291# CONFIG_INET_IPCOMP is not set
292# CONFIG_INET_XFRM_TUNNEL is not set
282# CONFIG_INET_TUNNEL is not set 293# CONFIG_INET_TUNNEL is not set
294CONFIG_INET_XFRM_MODE_TRANSPORT=m
295CONFIG_INET_XFRM_MODE_TUNNEL=m
283CONFIG_INET_DIAG=y 296CONFIG_INET_DIAG=y
284CONFIG_INET_TCP_DIAG=y 297CONFIG_INET_TCP_DIAG=y
285# CONFIG_TCP_CONG_ADVANCED is not set 298# CONFIG_TCP_CONG_ADVANCED is not set
286CONFIG_TCP_CONG_BIC=y 299CONFIG_TCP_CONG_BIC=y
287# CONFIG_IPV6 is not set 300# CONFIG_IPV6 is not set
301# CONFIG_INET6_XFRM_TUNNEL is not set
302# CONFIG_INET6_TUNNEL is not set
303CONFIG_NETWORK_SECMARK=y
288# CONFIG_NETFILTER is not set 304# CONFIG_NETFILTER is not set
289 305
290# 306#
@@ -338,6 +354,7 @@ CONFIG_TCP_CONG_BIC=y
338CONFIG_STANDALONE=y 354CONFIG_STANDALONE=y
339CONFIG_PREVENT_FIRMWARE_BUILD=y 355CONFIG_PREVENT_FIRMWARE_BUILD=y
340# CONFIG_FW_LOADER is not set 356# CONFIG_FW_LOADER is not set
357# CONFIG_SYS_HYPERVISOR is not set
341 358
342# 359#
343# Connector - unified userspace <-> kernelspace linker 360# Connector - unified userspace <-> kernelspace linker
@@ -434,6 +451,8 @@ CONFIG_PHYLIB=y
434# CONFIG_QSEMI_PHY is not set 451# CONFIG_QSEMI_PHY is not set
435# CONFIG_LXT_PHY is not set 452# CONFIG_LXT_PHY is not set
436# CONFIG_CICADA_PHY is not set 453# CONFIG_CICADA_PHY is not set
454CONFIG_VITESSE_PHY=m
455CONFIG_SMSC_PHY=m
437 456
438# 457#
439# Ethernet (10 or 100Mbit) 458# Ethernet (10 or 100Mbit)
@@ -496,6 +515,7 @@ CONFIG_E100=y
496# CONFIG_CHELSIO_T1 is not set 515# CONFIG_CHELSIO_T1 is not set
497# CONFIG_IXGB is not set 516# CONFIG_IXGB is not set
498# CONFIG_S2IO is not set 517# CONFIG_S2IO is not set
518# CONFIG_MYRI10GE is not set
499 519
500# 520#
501# Token Ring devices 521# Token Ring devices
@@ -552,6 +572,7 @@ CONFIG_E100=y
552# 572#
553CONFIG_SERIAL_8250=y 573CONFIG_SERIAL_8250=y
554CONFIG_SERIAL_8250_CONSOLE=y 574CONFIG_SERIAL_8250_CONSOLE=y
575CONFIG_SERIAL_8250_PCI=y
555CONFIG_SERIAL_8250_NR_UARTS=1 576CONFIG_SERIAL_8250_NR_UARTS=1
556CONFIG_SERIAL_8250_RUNTIME_UARTS=1 577CONFIG_SERIAL_8250_RUNTIME_UARTS=1
557# CONFIG_SERIAL_8250_EXTENDED is not set 578# CONFIG_SERIAL_8250_EXTENDED is not set
@@ -575,6 +596,7 @@ CONFIG_LEGACY_PTY_COUNT=256
575# Watchdog Cards 596# Watchdog Cards
576# 597#
577# CONFIG_WATCHDOG is not set 598# CONFIG_WATCHDOG is not set
599# CONFIG_HW_RANDOM is not set
578CONFIG_RTC=y 600CONFIG_RTC=y
579# CONFIG_DTLK is not set 601# CONFIG_DTLK is not set
580# CONFIG_R3964 is not set 602# CONFIG_R3964 is not set
@@ -606,13 +628,13 @@ CONFIG_RTC=y
606# 628#
607# Dallas's 1-wire bus 629# Dallas's 1-wire bus
608# 630#
609# CONFIG_W1 is not set
610 631
611# 632#
612# Hardware Monitoring support 633# Hardware Monitoring support
613# 634#
614CONFIG_HWMON=y 635CONFIG_HWMON=y
615# CONFIG_HWMON_VID is not set 636# CONFIG_HWMON_VID is not set
637# CONFIG_SENSORS_ABITUGURU is not set
616# CONFIG_SENSORS_F71805F is not set 638# CONFIG_SENSORS_F71805F is not set
617# CONFIG_HWMON_DEBUG_CHIP is not set 639# CONFIG_HWMON_DEBUG_CHIP is not set
618 640
@@ -621,13 +643,10 @@ CONFIG_HWMON=y
621# 643#
622 644
623# 645#
624# Multimedia Capabilities Port drivers
625#
626
627#
628# Multimedia devices 646# Multimedia devices
629# 647#
630# CONFIG_VIDEO_DEV is not set 648# CONFIG_VIDEO_DEV is not set
649CONFIG_VIDEO_V4L2=y
631 650
632# 651#
633# Digital Video Broadcasting Devices 652# Digital Video Broadcasting Devices
@@ -637,6 +656,7 @@ CONFIG_HWMON=y
637# 656#
638# Graphics support 657# Graphics support
639# 658#
659# CONFIG_FIRMWARE_EDID is not set
640# CONFIG_FB is not set 660# CONFIG_FB is not set
641 661
642# 662#
@@ -649,6 +669,7 @@ CONFIG_HWMON=y
649# 669#
650CONFIG_USB_ARCH_HAS_HCD=y 670CONFIG_USB_ARCH_HAS_HCD=y
651CONFIG_USB_ARCH_HAS_OHCI=y 671CONFIG_USB_ARCH_HAS_OHCI=y
672CONFIG_USB_ARCH_HAS_EHCI=y
652# CONFIG_USB is not set 673# CONFIG_USB is not set
653 674
654# 675#
@@ -666,6 +687,19 @@ CONFIG_USB_ARCH_HAS_OHCI=y
666# CONFIG_MMC is not set 687# CONFIG_MMC is not set
667 688
668# 689#
690# LED devices
691#
692# CONFIG_NEW_LEDS is not set
693
694#
695# LED drivers
696#
697
698#
699# LED Triggers
700#
701
702#
669# InfiniBand support 703# InfiniBand support
670# 704#
671# CONFIG_INFINIBAND is not set 705# CONFIG_INFINIBAND is not set
@@ -675,6 +709,24 @@ CONFIG_USB_ARCH_HAS_OHCI=y
675# 709#
676 710
677# 711#
712# Real Time Clock
713#
714# CONFIG_RTC_CLASS is not set
715
716#
717# DMA Engine support
718#
719# CONFIG_DMA_ENGINE is not set
720
721#
722# DMA Clients
723#
724
725#
726# DMA Devices
727#
728
729#
678# File systems 730# File systems
679# 731#
680# CONFIG_EXT2_FS is not set 732# CONFIG_EXT2_FS is not set
@@ -687,6 +739,7 @@ CONFIG_USB_ARCH_HAS_OHCI=y
687# CONFIG_MINIX_FS is not set 739# CONFIG_MINIX_FS is not set
688# CONFIG_ROMFS_FS is not set 740# CONFIG_ROMFS_FS is not set
689CONFIG_INOTIFY=y 741CONFIG_INOTIFY=y
742CONFIG_INOTIFY_USER=y
690# CONFIG_QUOTA is not set 743# CONFIG_QUOTA is not set
691CONFIG_DNOTIFY=y 744CONFIG_DNOTIFY=y
692# CONFIG_AUTOFS_FS is not set 745# CONFIG_AUTOFS_FS is not set
@@ -715,7 +768,6 @@ CONFIG_SYSFS=y
715CONFIG_TMPFS=y 768CONFIG_TMPFS=y
716# CONFIG_HUGETLB_PAGE is not set 769# CONFIG_HUGETLB_PAGE is not set
717CONFIG_RAMFS=y 770CONFIG_RAMFS=y
718# CONFIG_RELAYFS_FS is not set
719# CONFIG_CONFIGFS_FS is not set 771# CONFIG_CONFIGFS_FS is not set
720 772
721# 773#
@@ -753,6 +805,7 @@ CONFIG_SUNRPC=y
753# CONFIG_RPCSEC_GSS_SPKM3 is not set 805# CONFIG_RPCSEC_GSS_SPKM3 is not set
754# CONFIG_SMB_FS is not set 806# CONFIG_SMB_FS is not set
755# CONFIG_CIFS is not set 807# CONFIG_CIFS is not set
808# CONFIG_CIFS_DEBUG2 is not set
756# CONFIG_NCP_FS is not set 809# CONFIG_NCP_FS is not set
757# CONFIG_CODA_FS is not set 810# CONFIG_CODA_FS is not set
758# CONFIG_AFS_FS is not set 811# CONFIG_AFS_FS is not set
@@ -779,8 +832,10 @@ CONFIG_MSDOS_PARTITION=y
779# 832#
780# CONFIG_PRINTK_TIME is not set 833# CONFIG_PRINTK_TIME is not set
781# CONFIG_MAGIC_SYSRQ is not set 834# CONFIG_MAGIC_SYSRQ is not set
835# CONFIG_UNUSED_SYMBOLS is not set
782# CONFIG_DEBUG_KERNEL is not set 836# CONFIG_DEBUG_KERNEL is not set
783CONFIG_LOG_BUF_SHIFT=14 837CONFIG_LOG_BUF_SHIFT=14
838# CONFIG_DEBUG_FS is not set
784CONFIG_CROSSCOMPILE=y 839CONFIG_CROSSCOMPILE=y
785CONFIG_CMDLINE="console=ttyS0,115200n8" 840CONFIG_CMDLINE="console=ttyS0,115200n8"
786 841
@@ -806,3 +861,4 @@ CONFIG_CRC_CCITT=y
806CONFIG_CRC16=y 861CONFIG_CRC16=y
807CONFIG_CRC32=y 862CONFIG_CRC32=y
808CONFIG_LIBCRC32C=y 863CONFIG_LIBCRC32C=y
864CONFIG_PLIST=y
diff --git a/arch/mips/configs/yosemite_defconfig b/arch/mips/configs/yosemite_defconfig
index 7ece2c008e9b..3a68d8a25b66 100644
--- a/arch/mips/configs/yosemite_defconfig
+++ b/arch/mips/configs/yosemite_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:51:20 2006 4# Thu Jul 6 10:04:21 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MIPS=y
45# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
46CONFIG_PMC_YOSEMITE=y 48CONFIG_PMC_YOSEMITE=y
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48# CONFIG_SGI_IP22 is not set 51# CONFIG_SGI_IP22 is not set
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -66,6 +69,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
66CONFIG_GENERIC_FIND_NEXT_BIT=y 69CONFIG_GENERIC_FIND_NEXT_BIT=y
67CONFIG_GENERIC_HWEIGHT=y 70CONFIG_GENERIC_HWEIGHT=y
68CONFIG_GENERIC_CALIBRATE_DELAY=y 71CONFIG_GENERIC_CALIBRATE_DELAY=y
72CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
69CONFIG_DMA_COHERENT=y 73CONFIG_DMA_COHERENT=y
70CONFIG_CPU_BIG_ENDIAN=y 74CONFIG_CPU_BIG_ENDIAN=y
71# CONFIG_CPU_LITTLE_ENDIAN is not set 75# CONFIG_CPU_LITTLE_ENDIAN is not set
@@ -114,12 +118,16 @@ CONFIG_PAGE_SIZE_4KB=y
114# CONFIG_PAGE_SIZE_16KB is not set 118# CONFIG_PAGE_SIZE_16KB is not set
115# CONFIG_PAGE_SIZE_64KB is not set 119# CONFIG_PAGE_SIZE_64KB is not set
116CONFIG_CPU_HAS_PREFETCH=y 120CONFIG_CPU_HAS_PREFETCH=y
117# CONFIG_MIPS_MT is not set 121CONFIG_MIPS_MT_DISABLED=y
122# CONFIG_MIPS_MT_SMTC is not set
123# CONFIG_MIPS_MT_SMP is not set
124# CONFIG_MIPS_VPE_LOADER is not set
118# CONFIG_64BIT_PHYS_ADDR is not set 125# CONFIG_64BIT_PHYS_ADDR is not set
119CONFIG_CPU_HAS_LLSC=y 126CONFIG_CPU_HAS_LLSC=y
120CONFIG_CPU_HAS_SYNC=y 127CONFIG_CPU_HAS_SYNC=y
121CONFIG_GENERIC_HARDIRQS=y 128CONFIG_GENERIC_HARDIRQS=y
122CONFIG_GENERIC_IRQ_PROBE=y 129CONFIG_GENERIC_IRQ_PROBE=y
130CONFIG_IRQ_PER_CPU=y
123CONFIG_HIGHMEM=y 131CONFIG_HIGHMEM=y
124CONFIG_CPU_SUPPORTS_HIGHMEM=y 132CONFIG_CPU_SUPPORTS_HIGHMEM=y
125CONFIG_SYS_SUPPORTS_HIGHMEM=y 133CONFIG_SYS_SUPPORTS_HIGHMEM=y
@@ -128,6 +136,10 @@ CONFIG_FLATMEM=y
128CONFIG_FLAT_NODE_MEM_MAP=y 136CONFIG_FLAT_NODE_MEM_MAP=y
129# CONFIG_SPARSEMEM_STATIC is not set 137# CONFIG_SPARSEMEM_STATIC is not set
130CONFIG_SPLIT_PTLOCK_CPUS=4 138CONFIG_SPLIT_PTLOCK_CPUS=4
139# CONFIG_RESOURCES_64BIT is not set
140CONFIG_SMP=y
141CONFIG_SYS_SUPPORTS_SMP=y
142CONFIG_NR_CPUS=2
131# CONFIG_HZ_48 is not set 143# CONFIG_HZ_48 is not set
132# CONFIG_HZ_100 is not set 144# CONFIG_HZ_100 is not set
133# CONFIG_HZ_128 is not set 145# CONFIG_HZ_128 is not set
@@ -137,12 +149,11 @@ CONFIG_HZ_1000=y
137# CONFIG_HZ_1024 is not set 149# CONFIG_HZ_1024 is not set
138CONFIG_SYS_SUPPORTS_ARBIT_HZ=y 150CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
139CONFIG_HZ=1000 151CONFIG_HZ=1000
140CONFIG_SMP=y
141CONFIG_NR_CPUS=2
142CONFIG_PREEMPT_NONE=y 152CONFIG_PREEMPT_NONE=y
143# CONFIG_PREEMPT_VOLUNTARY is not set 153# CONFIG_PREEMPT_VOLUNTARY is not set
144# CONFIG_PREEMPT is not set 154# CONFIG_PREEMPT is not set
145CONFIG_PREEMPT_BKL=y 155CONFIG_PREEMPT_BKL=y
156CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
146 157
147# 158#
148# Code maturity level options 159# Code maturity level options
@@ -175,10 +186,12 @@ CONFIG_PRINTK=y
175CONFIG_BUG=y 186CONFIG_BUG=y
176CONFIG_ELF_CORE=y 187CONFIG_ELF_CORE=y
177CONFIG_BASE_FULL=y 188CONFIG_BASE_FULL=y
189CONFIG_RT_MUTEXES=y
178CONFIG_FUTEX=y 190CONFIG_FUTEX=y
179CONFIG_EPOLL=y 191CONFIG_EPOLL=y
180CONFIG_SHMEM=y 192CONFIG_SHMEM=y
181CONFIG_SLAB=y 193CONFIG_SLAB=y
194CONFIG_VM_EVENT_COUNTERS=y
182# CONFIG_TINY_SHMEM is not set 195# CONFIG_TINY_SHMEM is not set
183CONFIG_BASE_SMALL=0 196CONFIG_BASE_SMALL=0
184# CONFIG_SLOB is not set 197# CONFIG_SLOB is not set
@@ -268,6 +281,8 @@ CONFIG_IP_PNP_BOOTP=y
268# CONFIG_INET_IPCOMP is not set 281# CONFIG_INET_IPCOMP is not set
269# CONFIG_INET_XFRM_TUNNEL is not set 282# CONFIG_INET_XFRM_TUNNEL is not set
270# CONFIG_INET_TUNNEL is not set 283# CONFIG_INET_TUNNEL is not set
284CONFIG_INET_XFRM_MODE_TRANSPORT=m
285CONFIG_INET_XFRM_MODE_TUNNEL=m
271CONFIG_INET_DIAG=y 286CONFIG_INET_DIAG=y
272CONFIG_INET_TCP_DIAG=y 287CONFIG_INET_TCP_DIAG=y
273# CONFIG_TCP_CONG_ADVANCED is not set 288# CONFIG_TCP_CONG_ADVANCED is not set
@@ -280,7 +295,10 @@ CONFIG_INET6_ESP=m
280CONFIG_INET6_IPCOMP=m 295CONFIG_INET6_IPCOMP=m
281CONFIG_INET6_XFRM_TUNNEL=m 296CONFIG_INET6_XFRM_TUNNEL=m
282CONFIG_INET6_TUNNEL=m 297CONFIG_INET6_TUNNEL=m
298CONFIG_INET6_XFRM_MODE_TRANSPORT=m
299CONFIG_INET6_XFRM_MODE_TUNNEL=m
283CONFIG_IPV6_TUNNEL=m 300CONFIG_IPV6_TUNNEL=m
301CONFIG_NETWORK_SECMARK=y
284# CONFIG_NETFILTER is not set 302# CONFIG_NETFILTER is not set
285# CONFIG_BRIDGE is not set 303# CONFIG_BRIDGE is not set
286# CONFIG_VLAN_8021Q is not set 304# CONFIG_VLAN_8021Q is not set
@@ -317,6 +335,7 @@ CONFIG_STANDALONE=y
317CONFIG_PREVENT_FIRMWARE_BUILD=y 335CONFIG_PREVENT_FIRMWARE_BUILD=y
318CONFIG_FW_LOADER=m 336CONFIG_FW_LOADER=m
319# CONFIG_DEBUG_DRIVER is not set 337# CONFIG_DEBUG_DRIVER is not set
338# CONFIG_SYS_HYPERVISOR is not set
320 339
321# 340#
322# Connector - unified userspace <-> kernelspace linker 341# Connector - unified userspace <-> kernelspace linker
@@ -411,6 +430,8 @@ CONFIG_DAVICOM_PHY=m
411CONFIG_QSEMI_PHY=m 430CONFIG_QSEMI_PHY=m
412CONFIG_LXT_PHY=m 431CONFIG_LXT_PHY=m
413CONFIG_CICADA_PHY=m 432CONFIG_CICADA_PHY=m
433CONFIG_VITESSE_PHY=m
434CONFIG_SMSC_PHY=m
414 435
415# 436#
416# Ethernet (10 or 100Mbit) 437# Ethernet (10 or 100Mbit)
@@ -452,6 +473,7 @@ CONFIG_TITAN_GE=y
452# CONFIG_CHELSIO_T1 is not set 473# CONFIG_CHELSIO_T1 is not set
453# CONFIG_IXGB is not set 474# CONFIG_IXGB is not set
454# CONFIG_S2IO is not set 475# CONFIG_S2IO is not set
476# CONFIG_MYRI10GE is not set
455 477
456# 478#
457# Token Ring devices 479# Token Ring devices
@@ -529,6 +551,7 @@ CONFIG_LEGACY_PTY_COUNT=256
529# Watchdog Cards 551# Watchdog Cards
530# 552#
531# CONFIG_WATCHDOG is not set 553# CONFIG_WATCHDOG is not set
554# CONFIG_HW_RANDOM is not set
532# CONFIG_RTC is not set 555# CONFIG_RTC is not set
533CONFIG_GEN_RTC=y 556CONFIG_GEN_RTC=y
534CONFIG_GEN_RTC_X=y 557CONFIG_GEN_RTC_X=y
@@ -576,6 +599,7 @@ CONFIG_GEN_RTC_X=y
576# Multimedia devices 599# Multimedia devices
577# 600#
578# CONFIG_VIDEO_DEV is not set 601# CONFIG_VIDEO_DEV is not set
602CONFIG_VIDEO_V4L2=y
579 603
580# 604#
581# Digital Video Broadcasting Devices 605# Digital Video Broadcasting Devices
@@ -585,6 +609,7 @@ CONFIG_GEN_RTC_X=y
585# 609#
586# Graphics support 610# Graphics support
587# 611#
612# CONFIG_FIRMWARE_EDID is not set
588# CONFIG_FB is not set 613# CONFIG_FB is not set
589 614
590# 615#
@@ -641,6 +666,19 @@ CONFIG_USB_ARCH_HAS_EHCI=y
641# 666#
642 667
643# 668#
669# DMA Engine support
670#
671# CONFIG_DMA_ENGINE is not set
672
673#
674# DMA Clients
675#
676
677#
678# DMA Devices
679#
680
681#
644# File systems 682# File systems
645# 683#
646# CONFIG_EXT2_FS is not set 684# CONFIG_EXT2_FS is not set
@@ -652,6 +690,7 @@ CONFIG_USB_ARCH_HAS_EHCI=y
652# CONFIG_MINIX_FS is not set 690# CONFIG_MINIX_FS is not set
653# CONFIG_ROMFS_FS is not set 691# CONFIG_ROMFS_FS is not set
654CONFIG_INOTIFY=y 692CONFIG_INOTIFY=y
693CONFIG_INOTIFY_USER=y
655# CONFIG_QUOTA is not set 694# CONFIG_QUOTA is not set
656CONFIG_DNOTIFY=y 695CONFIG_DNOTIFY=y
657# CONFIG_AUTOFS_FS is not set 696# CONFIG_AUTOFS_FS is not set
@@ -704,6 +743,7 @@ CONFIG_NFS_COMMON=y
704CONFIG_SUNRPC=y 743CONFIG_SUNRPC=y
705# CONFIG_SMB_FS is not set 744# CONFIG_SMB_FS is not set
706# CONFIG_CIFS is not set 745# CONFIG_CIFS is not set
746# CONFIG_CIFS_DEBUG2 is not set
707# CONFIG_NCP_FS is not set 747# CONFIG_NCP_FS is not set
708# CONFIG_CODA_FS is not set 748# CONFIG_CODA_FS is not set
709 749
@@ -723,14 +763,19 @@ CONFIG_MSDOS_PARTITION=y
723# 763#
724# CONFIG_PRINTK_TIME is not set 764# CONFIG_PRINTK_TIME is not set
725# CONFIG_MAGIC_SYSRQ is not set 765# CONFIG_MAGIC_SYSRQ is not set
766# CONFIG_UNUSED_SYMBOLS is not set
726CONFIG_DEBUG_KERNEL=y 767CONFIG_DEBUG_KERNEL=y
727CONFIG_LOG_BUF_SHIFT=14 768CONFIG_LOG_BUF_SHIFT=14
728CONFIG_DETECT_SOFTLOCKUP=y 769CONFIG_DETECT_SOFTLOCKUP=y
729# CONFIG_SCHEDSTATS is not set 770# CONFIG_SCHEDSTATS is not set
730# CONFIG_DEBUG_SLAB is not set 771# CONFIG_DEBUG_SLAB is not set
731CONFIG_DEBUG_MUTEXES=y 772# CONFIG_DEBUG_RT_MUTEXES is not set
773# CONFIG_RT_MUTEX_TESTER is not set
732# CONFIG_DEBUG_SPINLOCK is not set 774# CONFIG_DEBUG_SPINLOCK is not set
775CONFIG_DEBUG_MUTEXES=y
776# CONFIG_DEBUG_RWSEMS is not set
733# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 777# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
778# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
734# CONFIG_DEBUG_KOBJECT is not set 779# CONFIG_DEBUG_KOBJECT is not set
735# CONFIG_DEBUG_HIGHMEM is not set 780# CONFIG_DEBUG_HIGHMEM is not set
736# CONFIG_DEBUG_INFO is not set 781# CONFIG_DEBUG_INFO is not set
@@ -793,3 +838,4 @@ CONFIG_CRC32=m
793CONFIG_LIBCRC32C=m 838CONFIG_LIBCRC32C=m
794CONFIG_ZLIB_INFLATE=m 839CONFIG_ZLIB_INFLATE=m
795CONFIG_ZLIB_DEFLATE=m 840CONFIG_ZLIB_DEFLATE=m
841CONFIG_PLIST=y
diff --git a/arch/mips/ddb5xxx/ddb5477/irq.c b/arch/mips/ddb5xxx/ddb5477/irq.c
index 22fb94b7c440..513fc6722d84 100644
--- a/arch/mips/ddb5xxx/ddb5477/irq.c
+++ b/arch/mips/ddb5xxx/ddb5477/irq.c
@@ -74,7 +74,6 @@ set_pci_int_attr(u32 pci, u32 intn, u32 active, u32 trigger)
74 74
75extern void vrc5477_irq_init(u32 base); 75extern void vrc5477_irq_init(u32 base);
76extern void mips_cpu_irq_init(u32 base); 76extern void mips_cpu_irq_init(u32 base);
77extern int setup_irq(unsigned int irq, struct irqaction *irqaction);
78static struct irqaction irq_cascade = { no_action, 0, CPU_MASK_NONE, "cascade", NULL, NULL }; 77static struct irqaction irq_cascade = { no_action, 0, CPU_MASK_NONE, "cascade", NULL, NULL };
79 78
80void __init arch_init_irq(void) 79void __init arch_init_irq(void)
diff --git a/arch/mips/ddb5xxx/ddb5477/irq_5477.c b/arch/mips/ddb5xxx/ddb5477/irq_5477.c
index 63c3d6534b3a..ba52705a2738 100644
--- a/arch/mips/ddb5xxx/ddb5477/irq_5477.c
+++ b/arch/mips/ddb5xxx/ddb5477/irq_5477.c
@@ -89,7 +89,7 @@ vrc5477_irq_end(unsigned int irq)
89 ll_vrc5477_irq_enable( irq - vrc5477_irq_base); 89 ll_vrc5477_irq_enable( irq - vrc5477_irq_base);
90} 90}
91 91
92hw_irq_controller vrc5477_irq_controller = { 92struct irq_chip vrc5477_irq_controller = {
93 .typename = "vrc5477_irq", 93 .typename = "vrc5477_irq",
94 .startup = vrc5477_irq_startup, 94 .startup = vrc5477_irq_startup,
95 .shutdown = vrc5477_irq_shutdown, 95 .shutdown = vrc5477_irq_shutdown,
diff --git a/arch/mips/ddb5xxx/ddb5477/setup.c b/arch/mips/ddb5xxx/ddb5477/setup.c
index 47ba0b6f210f..f0cc0e8a8afa 100644
--- a/arch/mips/ddb5xxx/ddb5477/setup.c
+++ b/arch/mips/ddb5xxx/ddb5477/setup.c
@@ -19,6 +19,7 @@
19#include <linux/sched.h> 19#include <linux/sched.h>
20#include <linux/pci.h> 20#include <linux/pci.h>
21#include <linux/ide.h> 21#include <linux/ide.h>
22#include <linux/irq.h>
22#include <linux/fs.h> 23#include <linux/fs.h>
23#include <linux/ioport.h> 24#include <linux/ioport.h>
24#include <linux/param.h> /* for HZ */ 25#include <linux/param.h> /* for HZ */
@@ -146,9 +147,7 @@ static void __init ddb_time_init(void)
146 mips_hpt_frequency = bus_frequency*(i+4)/4; 147 mips_hpt_frequency = bus_frequency*(i+4)/4;
147} 148}
148 149
149extern int setup_irq(unsigned int irq, struct irqaction *irqaction); 150void __init plat_timer_setup(struct irqaction *irq)
150
151static void __init ddb_timer_setup(struct irqaction *irq)
152{ 151{
153#if defined(USE_CPU_COUNTER_TIMER) 152#if defined(USE_CPU_COUNTER_TIMER)
154 153
@@ -178,7 +177,6 @@ void __init plat_mem_setup(void)
178 set_io_port_base(KSEG1ADDR(DDB_PCI_IO_BASE)); 177 set_io_port_base(KSEG1ADDR(DDB_PCI_IO_BASE));
179 178
180 board_time_init = ddb_time_init; 179 board_time_init = ddb_time_init;
181 board_timer_setup = ddb_timer_setup;
182 180
183 _machine_restart = ddb_machine_restart; 181 _machine_restart = ddb_machine_restart;
184 _machine_halt = ddb_machine_halt; 182 _machine_halt = ddb_machine_halt;
diff --git a/arch/mips/dec/ioasic-irq.c b/arch/mips/dec/ioasic-irq.c
index da2dbb42f913..41cd2a96148b 100644
--- a/arch/mips/dec/ioasic-irq.c
+++ b/arch/mips/dec/ioasic-irq.c
@@ -93,7 +93,7 @@ static inline void end_ioasic_irq(unsigned int irq)
93 enable_ioasic_irq(irq); 93 enable_ioasic_irq(irq);
94} 94}
95 95
96static struct hw_interrupt_type ioasic_irq_type = { 96static struct irq_chip ioasic_irq_type = {
97 .typename = "IO-ASIC", 97 .typename = "IO-ASIC",
98 .startup = startup_ioasic_irq, 98 .startup = startup_ioasic_irq,
99 .shutdown = shutdown_ioasic_irq, 99 .shutdown = shutdown_ioasic_irq,
@@ -121,7 +121,7 @@ static inline void end_ioasic_dma_irq(unsigned int irq)
121 end_ioasic_irq(irq); 121 end_ioasic_irq(irq);
122} 122}
123 123
124static struct hw_interrupt_type ioasic_dma_irq_type = { 124static struct irq_chip ioasic_dma_irq_type = {
125 .typename = "IO-ASIC-DMA", 125 .typename = "IO-ASIC-DMA",
126 .startup = startup_ioasic_dma_irq, 126 .startup = startup_ioasic_dma_irq,
127 .shutdown = shutdown_ioasic_dma_irq, 127 .shutdown = shutdown_ioasic_dma_irq,
diff --git a/arch/mips/dec/kn02-irq.c b/arch/mips/dec/kn02-irq.c
index d44c00d9e80f..04a367a60a57 100644
--- a/arch/mips/dec/kn02-irq.c
+++ b/arch/mips/dec/kn02-irq.c
@@ -94,7 +94,7 @@ static void end_kn02_irq(unsigned int irq)
94 enable_kn02_irq(irq); 94 enable_kn02_irq(irq);
95} 95}
96 96
97static struct hw_interrupt_type kn02_irq_type = { 97static struct irq_chip kn02_irq_type = {
98 .typename = "KN02-CSR", 98 .typename = "KN02-CSR",
99 .startup = startup_kn02_irq, 99 .startup = startup_kn02_irq,
100 .shutdown = shutdown_kn02_irq, 100 .shutdown = shutdown_kn02_irq,
diff --git a/arch/mips/dec/setup.c b/arch/mips/dec/setup.c
index 2684f121784b..d43241c2f541 100644
--- a/arch/mips/dec/setup.c
+++ b/arch/mips/dec/setup.c
@@ -145,13 +145,11 @@ static void __init dec_be_init(void)
145 145
146 146
147extern void dec_time_init(void); 147extern void dec_time_init(void);
148extern void dec_timer_setup(struct irqaction *);
149 148
150void __init plat_mem_setup(void) 149void __init plat_mem_setup(void)
151{ 150{
152 board_be_init = dec_be_init; 151 board_be_init = dec_be_init;
153 board_time_init = dec_time_init; 152 board_time_init = dec_time_init;
154 board_timer_setup = dec_timer_setup;
155 153
156 wbflush_setup(); 154 wbflush_setup();
157 155
diff --git a/arch/mips/dec/time.c b/arch/mips/dec/time.c
index 76e4d09ff4d2..57294740c2dd 100644
--- a/arch/mips/dec/time.c
+++ b/arch/mips/dec/time.c
@@ -186,7 +186,7 @@ void __init dec_time_init(void)
186 186
187EXPORT_SYMBOL(do_settimeofday); 187EXPORT_SYMBOL(do_settimeofday);
188 188
189void __init dec_timer_setup(struct irqaction *irq) 189void __init plat_timer_setup(struct irqaction *irq)
190{ 190{
191 setup_irq(dec_interrupt[DEC_IRQ_RTC], irq); 191 setup_irq(dec_interrupt[DEC_IRQ_RTC], irq);
192 192
diff --git a/arch/mips/defconfig b/arch/mips/defconfig
index 879ba1ad99ca..fff6fcc96212 100644
--- a/arch/mips/defconfig
+++ b/arch/mips/defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2 3# Linux kernel version: 2.6.18-rc1
4# Mon Apr 24 14:50:54 2006 4# Thu Jul 6 09:49:33 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -21,6 +21,7 @@ CONFIG_MIPS=y
21# CONFIG_MIPS_DB1550 is not set 21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set 22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set 23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_BASLER_EXCITE is not set
24# CONFIG_MIPS_COBALT is not set 25# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set 26# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set 27# CONFIG_MIPS_EV64120 is not set
@@ -32,6 +33,7 @@ CONFIG_MIPS=y
32# CONFIG_MIPS_ATLAS is not set 33# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set 34# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set 35# CONFIG_MIPS_SEAD is not set
36# CONFIG_WR_PPMC is not set
35# CONFIG_MIPS_SIM is not set 37# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set 38# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set 39# CONFIG_MOMENCO_OCELOT is not set
@@ -45,6 +47,7 @@ CONFIG_MIPS=y
45# CONFIG_MACH_VR41XX is not set 47# CONFIG_MACH_VR41XX is not set
46# CONFIG_PMC_YOSEMITE is not set 48# CONFIG_PMC_YOSEMITE is not set
47# CONFIG_QEMU is not set 49# CONFIG_QEMU is not set
50# CONFIG_MARKEINS is not set
48CONFIG_SGI_IP22=y 51CONFIG_SGI_IP22=y
49# CONFIG_SGI_IP27 is not set 52# CONFIG_SGI_IP27 is not set
50# CONFIG_SGI_IP32 is not set 53# CONFIG_SGI_IP32 is not set
@@ -65,6 +68,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
65CONFIG_GENERIC_FIND_NEXT_BIT=y 68CONFIG_GENERIC_FIND_NEXT_BIT=y
66CONFIG_GENERIC_HWEIGHT=y 69CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 70CONFIG_GENERIC_CALIBRATE_DELAY=y
71CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
68CONFIG_ARC=y 72CONFIG_ARC=y
69CONFIG_DMA_NONCOHERENT=y 73CONFIG_DMA_NONCOHERENT=y
70CONFIG_DMA_NEED_PCI_MAP_STATE=y 74CONFIG_DMA_NEED_PCI_MAP_STATE=y
@@ -119,7 +123,10 @@ CONFIG_PAGE_SIZE_4KB=y
119# CONFIG_PAGE_SIZE_64KB is not set 123# CONFIG_PAGE_SIZE_64KB is not set
120CONFIG_BOARD_SCACHE=y 124CONFIG_BOARD_SCACHE=y
121CONFIG_IP22_CPU_SCACHE=y 125CONFIG_IP22_CPU_SCACHE=y
122# CONFIG_MIPS_MT is not set 126CONFIG_MIPS_MT_DISABLED=y
127# CONFIG_MIPS_MT_SMTC is not set
128# CONFIG_MIPS_MT_SMP is not set
129# CONFIG_MIPS_VPE_LOADER is not set
123# CONFIG_64BIT_PHYS_ADDR is not set 130# CONFIG_64BIT_PHYS_ADDR is not set
124CONFIG_CPU_HAS_LLSC=y 131CONFIG_CPU_HAS_LLSC=y
125CONFIG_CPU_HAS_SYNC=y 132CONFIG_CPU_HAS_SYNC=y
@@ -134,6 +141,7 @@ CONFIG_FLATMEM=y
134CONFIG_FLAT_NODE_MEM_MAP=y 141CONFIG_FLAT_NODE_MEM_MAP=y
135# CONFIG_SPARSEMEM_STATIC is not set 142# CONFIG_SPARSEMEM_STATIC is not set
136CONFIG_SPLIT_PTLOCK_CPUS=4 143CONFIG_SPLIT_PTLOCK_CPUS=4
144# CONFIG_RESOURCES_64BIT is not set
137# CONFIG_HZ_48 is not set 145# CONFIG_HZ_48 is not set
138# CONFIG_HZ_100 is not set 146# CONFIG_HZ_100 is not set
139# CONFIG_HZ_128 is not set 147# CONFIG_HZ_128 is not set
@@ -146,6 +154,7 @@ CONFIG_HZ=1000
146# CONFIG_PREEMPT_NONE is not set 154# CONFIG_PREEMPT_NONE is not set
147CONFIG_PREEMPT_VOLUNTARY=y 155CONFIG_PREEMPT_VOLUNTARY=y
148# CONFIG_PREEMPT is not set 156# CONFIG_PREEMPT is not set
157CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
149 158
150# 159#
151# Code maturity level options 160# Code maturity level options
@@ -178,10 +187,12 @@ CONFIG_PRINTK=y
178CONFIG_BUG=y 187CONFIG_BUG=y
179CONFIG_ELF_CORE=y 188CONFIG_ELF_CORE=y
180CONFIG_BASE_FULL=y 189CONFIG_BASE_FULL=y
190CONFIG_RT_MUTEXES=y
181CONFIG_FUTEX=y 191CONFIG_FUTEX=y
182CONFIG_EPOLL=y 192CONFIG_EPOLL=y
183CONFIG_SHMEM=y 193CONFIG_SHMEM=y
184CONFIG_SLAB=y 194CONFIG_SLAB=y
195CONFIG_VM_EVENT_COUNTERS=y
185# CONFIG_TINY_SHMEM is not set 196# CONFIG_TINY_SHMEM is not set
186CONFIG_BASE_SMALL=0 197CONFIG_BASE_SMALL=0
187# CONFIG_SLOB is not set 198# CONFIG_SLOB is not set
@@ -272,6 +283,8 @@ CONFIG_INET_ESP=m
272CONFIG_INET_IPCOMP=m 283CONFIG_INET_IPCOMP=m
273CONFIG_INET_XFRM_TUNNEL=m 284CONFIG_INET_XFRM_TUNNEL=m
274CONFIG_INET_TUNNEL=m 285CONFIG_INET_TUNNEL=m
286CONFIG_INET_XFRM_MODE_TRANSPORT=m
287CONFIG_INET_XFRM_MODE_TUNNEL=m
275CONFIG_INET_DIAG=y 288CONFIG_INET_DIAG=y
276CONFIG_INET_TCP_DIAG=y 289CONFIG_INET_TCP_DIAG=y
277# CONFIG_TCP_CONG_ADVANCED is not set 290# CONFIG_TCP_CONG_ADVANCED is not set
@@ -319,7 +332,10 @@ CONFIG_INET6_ESP=m
319CONFIG_INET6_IPCOMP=m 332CONFIG_INET6_IPCOMP=m
320CONFIG_INET6_XFRM_TUNNEL=m 333CONFIG_INET6_XFRM_TUNNEL=m
321CONFIG_INET6_TUNNEL=m 334CONFIG_INET6_TUNNEL=m
335CONFIG_INET6_XFRM_MODE_TRANSPORT=m
336CONFIG_INET6_XFRM_MODE_TUNNEL=m
322CONFIG_IPV6_TUNNEL=m 337CONFIG_IPV6_TUNNEL=m
338CONFIG_NETWORK_SECMARK=y
323CONFIG_NETFILTER=y 339CONFIG_NETFILTER=y
324# CONFIG_NETFILTER_DEBUG is not set 340# CONFIG_NETFILTER_DEBUG is not set
325 341
@@ -335,6 +351,8 @@ CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
335CONFIG_NETFILTER_XT_TARGET_MARK=m 351CONFIG_NETFILTER_XT_TARGET_MARK=m
336CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m 352CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
337CONFIG_NETFILTER_XT_TARGET_NOTRACK=m 353CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
354CONFIG_NETFILTER_XT_TARGET_SECMARK=m
355CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m
338CONFIG_NETFILTER_XT_MATCH_COMMENT=m 356CONFIG_NETFILTER_XT_MATCH_COMMENT=m
339CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m 357CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
340CONFIG_NETFILTER_XT_MATCH_CONNMARK=m 358CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
@@ -349,9 +367,11 @@ CONFIG_NETFILTER_XT_MATCH_MARK=m
349CONFIG_NETFILTER_XT_MATCH_POLICY=m 367CONFIG_NETFILTER_XT_MATCH_POLICY=m
350CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m 368CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
351CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 369CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
370CONFIG_NETFILTER_XT_MATCH_QUOTA=m
352CONFIG_NETFILTER_XT_MATCH_REALM=m 371CONFIG_NETFILTER_XT_MATCH_REALM=m
353CONFIG_NETFILTER_XT_MATCH_SCTP=m 372CONFIG_NETFILTER_XT_MATCH_SCTP=m
354CONFIG_NETFILTER_XT_MATCH_STATE=m 373CONFIG_NETFILTER_XT_MATCH_STATE=m
374CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
355CONFIG_NETFILTER_XT_MATCH_STRING=m 375CONFIG_NETFILTER_XT_MATCH_STRING=m
356CONFIG_NETFILTER_XT_MATCH_TCPMSS=m 376CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
357 377
@@ -361,6 +381,7 @@ CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
361CONFIG_IP_NF_CONNTRACK=m 381CONFIG_IP_NF_CONNTRACK=m
362CONFIG_IP_NF_CT_ACCT=y 382CONFIG_IP_NF_CT_ACCT=y
363CONFIG_IP_NF_CONNTRACK_MARK=y 383CONFIG_IP_NF_CONNTRACK_MARK=y
384CONFIG_IP_NF_CONNTRACK_SECMARK=y
364CONFIG_IP_NF_CONNTRACK_EVENTS=y 385CONFIG_IP_NF_CONNTRACK_EVENTS=y
365CONFIG_IP_NF_CONNTRACK_NETLINK=m 386CONFIG_IP_NF_CONNTRACK_NETLINK=m
366# CONFIG_IP_NF_CT_PROTO_SCTP is not set 387# CONFIG_IP_NF_CT_PROTO_SCTP is not set
@@ -371,6 +392,7 @@ CONFIG_IP_NF_TFTP=m
371CONFIG_IP_NF_AMANDA=m 392CONFIG_IP_NF_AMANDA=m
372CONFIG_IP_NF_PPTP=m 393CONFIG_IP_NF_PPTP=m
373CONFIG_IP_NF_H323=m 394CONFIG_IP_NF_H323=m
395CONFIG_IP_NF_SIP=m
374CONFIG_IP_NF_QUEUE=m 396CONFIG_IP_NF_QUEUE=m
375CONFIG_IP_NF_IPTABLES=m 397CONFIG_IP_NF_IPTABLES=m
376CONFIG_IP_NF_MATCH_IPRANGE=m 398CONFIG_IP_NF_MATCH_IPRANGE=m
@@ -401,6 +423,7 @@ CONFIG_IP_NF_NAT_TFTP=m
401CONFIG_IP_NF_NAT_AMANDA=m 423CONFIG_IP_NF_NAT_AMANDA=m
402CONFIG_IP_NF_NAT_PPTP=m 424CONFIG_IP_NF_NAT_PPTP=m
403CONFIG_IP_NF_NAT_H323=m 425CONFIG_IP_NF_NAT_H323=m
426CONFIG_IP_NF_NAT_SIP=m
404CONFIG_IP_NF_MANGLE=m 427CONFIG_IP_NF_MANGLE=m
405CONFIG_IP_NF_TARGET_TOS=m 428CONFIG_IP_NF_TARGET_TOS=m
406CONFIG_IP_NF_TARGET_ECN=m 429CONFIG_IP_NF_TARGET_ECN=m
@@ -533,6 +556,7 @@ CONFIG_WIRELESS_EXT=y
533CONFIG_STANDALONE=y 556CONFIG_STANDALONE=y
534CONFIG_PREVENT_FIRMWARE_BUILD=y 557CONFIG_PREVENT_FIRMWARE_BUILD=y
535# CONFIG_FW_LOADER is not set 558# CONFIG_FW_LOADER is not set
559# CONFIG_SYS_HYPERVISOR is not set
536 560
537# 561#
538# Connector - unified userspace <-> kernelspace linker 562# Connector - unified userspace <-> kernelspace linker
@@ -652,6 +676,8 @@ CONFIG_DAVICOM_PHY=m
652CONFIG_QSEMI_PHY=m 676CONFIG_QSEMI_PHY=m
653CONFIG_LXT_PHY=m 677CONFIG_LXT_PHY=m
654CONFIG_CICADA_PHY=m 678CONFIG_CICADA_PHY=m
679# CONFIG_VITESSE_PHY is not set
680# CONFIG_SMSC_PHY is not set
655 681
656# 682#
657# Ethernet (10 or 100Mbit) 683# Ethernet (10 or 100Mbit)
@@ -749,6 +775,7 @@ CONFIG_SERIO_RAW=m
749CONFIG_VT=y 775CONFIG_VT=y
750CONFIG_VT_CONSOLE=y 776CONFIG_VT_CONSOLE=y
751CONFIG_HW_CONSOLE=y 777CONFIG_HW_CONSOLE=y
778CONFIG_VT_HW_CONSOLE_BINDING=y
752# CONFIG_SERIAL_NONSTANDARD is not set 779# CONFIG_SERIAL_NONSTANDARD is not set
753 780
754# 781#
@@ -781,6 +808,7 @@ CONFIG_WATCHDOG=y
781# 808#
782# CONFIG_SOFT_WATCHDOG is not set 809# CONFIG_SOFT_WATCHDOG is not set
783CONFIG_INDYDOG=m 810CONFIG_INDYDOG=m
811# CONFIG_HW_RANDOM is not set
784# CONFIG_RTC is not set 812# CONFIG_RTC is not set
785CONFIG_SGI_DS1286=m 813CONFIG_SGI_DS1286=m
786# CONFIG_GEN_RTC is not set 814# CONFIG_GEN_RTC is not set
@@ -829,6 +857,7 @@ CONFIG_MAX_RAW_DEVS=256
829# Multimedia devices 857# Multimedia devices
830# 858#
831# CONFIG_VIDEO_DEV is not set 859# CONFIG_VIDEO_DEV is not set
860CONFIG_VIDEO_V4L2=y
832 861
833# 862#
834# Digital Video Broadcasting Devices 863# Digital Video Broadcasting Devices
@@ -838,6 +867,7 @@ CONFIG_MAX_RAW_DEVS=256
838# 867#
839# Graphics support 868# Graphics support
840# 869#
870CONFIG_FIRMWARE_EDID=y
841# CONFIG_FB is not set 871# CONFIG_FB is not set
842 872
843# 873#
@@ -910,6 +940,19 @@ CONFIG_LOGO_SGI_CLUT224=y
910# CONFIG_RTC_CLASS is not set 940# CONFIG_RTC_CLASS is not set
911 941
912# 942#
943# DMA Engine support
944#
945# CONFIG_DMA_ENGINE is not set
946
947#
948# DMA Clients
949#
950
951#
952# DMA Devices
953#
954
955#
913# File systems 956# File systems
914# 957#
915CONFIG_EXT2_FS=m 958CONFIG_EXT2_FS=m
@@ -926,7 +969,6 @@ CONFIG_FS_MBCACHE=y
926# CONFIG_JFS_FS is not set 969# CONFIG_JFS_FS is not set
927CONFIG_FS_POSIX_ACL=y 970CONFIG_FS_POSIX_ACL=y
928CONFIG_XFS_FS=m 971CONFIG_XFS_FS=m
929CONFIG_XFS_EXPORT=y
930CONFIG_XFS_QUOTA=y 972CONFIG_XFS_QUOTA=y
931CONFIG_XFS_SECURITY=y 973CONFIG_XFS_SECURITY=y
932# CONFIG_XFS_POSIX_ACL is not set 974# CONFIG_XFS_POSIX_ACL is not set
@@ -935,6 +977,7 @@ CONFIG_XFS_SECURITY=y
935CONFIG_MINIX_FS=m 977CONFIG_MINIX_FS=m
936# CONFIG_ROMFS_FS is not set 978# CONFIG_ROMFS_FS is not set
937CONFIG_INOTIFY=y 979CONFIG_INOTIFY=y
980CONFIG_INOTIFY_USER=y
938CONFIG_QUOTA=y 981CONFIG_QUOTA=y
939# CONFIG_QFMT_V1 is not set 982# CONFIG_QFMT_V1 is not set
940CONFIG_QFMT_V2=m 983CONFIG_QFMT_V2=m
@@ -991,6 +1034,8 @@ CONFIG_EFS_FS=m
991# CONFIG_QNX4FS_FS is not set 1034# CONFIG_QNX4FS_FS is not set
992# CONFIG_SYSV_FS is not set 1035# CONFIG_SYSV_FS is not set
993CONFIG_UFS_FS=m 1036CONFIG_UFS_FS=m
1037# CONFIG_UFS_FS_WRITE is not set
1038# CONFIG_UFS_DEBUG is not set
994 1039
995# 1040#
996# Network File Systems 1041# Network File Systems
@@ -1020,7 +1065,9 @@ CONFIG_SMB_NLS_DEFAULT=y
1020CONFIG_SMB_NLS_REMOTE="cp437" 1065CONFIG_SMB_NLS_REMOTE="cp437"
1021CONFIG_CIFS=m 1066CONFIG_CIFS=m
1022# CONFIG_CIFS_STATS is not set 1067# CONFIG_CIFS_STATS is not set
1068# CONFIG_CIFS_WEAK_PW_HASH is not set
1023# CONFIG_CIFS_XATTR is not set 1069# CONFIG_CIFS_XATTR is not set
1070# CONFIG_CIFS_DEBUG2 is not set
1024# CONFIG_CIFS_EXPERIMENTAL is not set 1071# CONFIG_CIFS_EXPERIMENTAL is not set
1025# CONFIG_NCP_FS is not set 1072# CONFIG_NCP_FS is not set
1026CONFIG_CODA_FS=m 1073CONFIG_CODA_FS=m
@@ -1103,6 +1150,7 @@ CONFIG_NLS_UTF8=m
1103# 1150#
1104# CONFIG_PRINTK_TIME is not set 1151# CONFIG_PRINTK_TIME is not set
1105# CONFIG_MAGIC_SYSRQ is not set 1152# CONFIG_MAGIC_SYSRQ is not set
1153# CONFIG_UNUSED_SYMBOLS is not set
1106# CONFIG_DEBUG_KERNEL is not set 1154# CONFIG_DEBUG_KERNEL is not set
1107CONFIG_LOG_BUF_SHIFT=14 1155CONFIG_LOG_BUF_SHIFT=14
1108# CONFIG_DEBUG_FS is not set 1156# CONFIG_DEBUG_FS is not set
@@ -1162,3 +1210,4 @@ CONFIG_TEXTSEARCH=y
1162CONFIG_TEXTSEARCH_KMP=m 1210CONFIG_TEXTSEARCH_KMP=m
1163CONFIG_TEXTSEARCH_BM=m 1211CONFIG_TEXTSEARCH_BM=m
1164CONFIG_TEXTSEARCH_FSM=m 1212CONFIG_TEXTSEARCH_FSM=m
1213CONFIG_PLIST=y
diff --git a/arch/mips/emma2rh/common/irq.c b/arch/mips/emma2rh/common/irq.c
index b075281e50e9..3af57693c84c 100644
--- a/arch/mips/emma2rh/common/irq.c
+++ b/arch/mips/emma2rh/common/irq.c
@@ -22,7 +22,6 @@
22 * along with this program; if not, write to the Free Software 22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 */ 24 */
25#include <linux/config.h>
26#include <linux/init.h> 25#include <linux/init.h>
27#include <linux/interrupt.h> 26#include <linux/interrupt.h>
28#include <linux/irq.h> 27#include <linux/irq.h>
diff --git a/arch/mips/emma2rh/common/irq_emma2rh.c b/arch/mips/emma2rh/common/irq_emma2rh.c
index b886aa94ca90..7c930860c921 100644
--- a/arch/mips/emma2rh/common/irq_emma2rh.c
+++ b/arch/mips/emma2rh/common/irq_emma2rh.c
@@ -78,7 +78,7 @@ static void emma2rh_irq_end(unsigned int irq)
78 ll_emma2rh_irq_enable(irq - emma2rh_irq_base); 78 ll_emma2rh_irq_enable(irq - emma2rh_irq_base);
79} 79}
80 80
81hw_irq_controller emma2rh_irq_controller = { 81struct irq_chip emma2rh_irq_controller = {
82 .typename = "emma2rh_irq", 82 .typename = "emma2rh_irq",
83 .startup = emma2rh_irq_startup, 83 .startup = emma2rh_irq_startup,
84 .shutdown = emma2rh_irq_shutdown, 84 .shutdown = emma2rh_irq_shutdown,
diff --git a/arch/mips/emma2rh/common/prom.c b/arch/mips/emma2rh/common/prom.c
index 8bba0b02a204..7433bd8e5562 100644
--- a/arch/mips/emma2rh/common/prom.c
+++ b/arch/mips/emma2rh/common/prom.c
@@ -22,7 +22,6 @@
22 * along with this program; if not, write to the Free Software 22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 */ 24 */
25#include <linux/config.h>
26#include <linux/init.h> 25#include <linux/init.h>
27#include <linux/mm.h> 26#include <linux/mm.h>
28#include <linux/sched.h> 27#include <linux/sched.h>
diff --git a/arch/mips/emma2rh/markeins/irq.c b/arch/mips/emma2rh/markeins/irq.c
index 76dc3faeaf4e..2a736be42c8c 100644
--- a/arch/mips/emma2rh/markeins/irq.c
+++ b/arch/mips/emma2rh/markeins/irq.c
@@ -22,7 +22,6 @@
22 * along with this program; if not, write to the Free Software 22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 */ 24 */
25#include <linux/config.h>
26#include <linux/init.h> 25#include <linux/init.h>
27#include <linux/interrupt.h> 26#include <linux/interrupt.h>
28#include <linux/irq.h> 27#include <linux/irq.h>
diff --git a/arch/mips/emma2rh/markeins/irq_markeins.c b/arch/mips/emma2rh/markeins/irq_markeins.c
index 1783fdab6459..f23ae9fcffa0 100644
--- a/arch/mips/emma2rh/markeins/irq_markeins.c
+++ b/arch/mips/emma2rh/markeins/irq_markeins.c
@@ -67,7 +67,7 @@ static void emma2rh_sw_irq_end(unsigned int irq)
67 ll_emma2rh_sw_irq_enable(irq - emma2rh_sw_irq_base); 67 ll_emma2rh_sw_irq_enable(irq - emma2rh_sw_irq_base);
68} 68}
69 69
70hw_irq_controller emma2rh_sw_irq_controller = { 70struct irq_chip emma2rh_sw_irq_controller = {
71 .typename = "emma2rh_sw_irq", 71 .typename = "emma2rh_sw_irq",
72 .startup = emma2rh_sw_irq_startup, 72 .startup = emma2rh_sw_irq_startup,
73 .shutdown = emma2rh_sw_irq_shutdown, 73 .shutdown = emma2rh_sw_irq_shutdown,
@@ -147,7 +147,7 @@ static void emma2rh_gpio_irq_end(unsigned int irq)
147 ll_emma2rh_gpio_irq_enable(irq - emma2rh_gpio_irq_base); 147 ll_emma2rh_gpio_irq_enable(irq - emma2rh_gpio_irq_base);
148} 148}
149 149
150hw_irq_controller emma2rh_gpio_irq_controller = { 150struct irq_chip emma2rh_gpio_irq_controller = {
151 .typename = "emma2rh_gpio_irq", 151 .typename = "emma2rh_gpio_irq",
152 .startup = emma2rh_gpio_irq_startup, 152 .startup = emma2rh_gpio_irq_startup,
153 .shutdown = emma2rh_gpio_irq_shutdown, 153 .shutdown = emma2rh_gpio_irq_shutdown,
diff --git a/arch/mips/emma2rh/markeins/platform.c b/arch/mips/emma2rh/markeins/platform.c
index 6c1eeae1a898..15cc61df3622 100644
--- a/arch/mips/emma2rh/markeins/platform.c
+++ b/arch/mips/emma2rh/markeins/platform.c
@@ -20,7 +20,6 @@
20 * along with this program; if not, write to the Free Software 20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */ 22 */
23#include <linux/config.h>
24#include <linux/init.h> 23#include <linux/init.h>
25#include <linux/kernel.h> 24#include <linux/kernel.h>
26#include <linux/types.h> 25#include <linux/types.h>
diff --git a/arch/mips/emma2rh/markeins/setup.c b/arch/mips/emma2rh/markeins/setup.c
index 7d98fdbf8390..b29a44739230 100644
--- a/arch/mips/emma2rh/markeins/setup.c
+++ b/arch/mips/emma2rh/markeins/setup.c
@@ -22,7 +22,6 @@
22 * along with this program; if not, write to the Free Software 22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 */ 24 */
25#include <linux/config.h>
26#include <linux/init.h> 25#include <linux/init.h>
27#include <linux/kernel.h> 26#include <linux/kernel.h>
28#include <linux/types.h> 27#include <linux/types.h>
@@ -105,7 +104,7 @@ static void __init emma2rh_time_init(void)
105 mips_hpt_frequency = (bus_frequency * (4 + reg)) / 4 / 2; 104 mips_hpt_frequency = (bus_frequency * (4 + reg)) / 4 / 2;
106} 105}
107 106
108static void __init emma2rh_timer_setup(struct irqaction *irq) 107void __init plat_timer_setup(struct irqaction *irq)
109{ 108{
110 /* we are using the cpu counter for timer interrupts */ 109 /* we are using the cpu counter for timer interrupts */
111 setup_irq(CPU_IRQ_BASE + 7, irq); 110 setup_irq(CPU_IRQ_BASE + 7, irq);
@@ -150,7 +149,6 @@ void __init plat_mem_setup(void)
150 set_io_port_base(KSEG1ADDR(EMMA2RH_PCI_IO_BASE)); 149 set_io_port_base(KSEG1ADDR(EMMA2RH_PCI_IO_BASE));
151 150
152 board_time_init = emma2rh_time_init; 151 board_time_init = emma2rh_time_init;
153 board_timer_setup = emma2rh_timer_setup;
154 152
155 _machine_restart = markeins_machine_restart; 153 _machine_restart = markeins_machine_restart;
156 _machine_halt = markeins_machine_halt; 154 _machine_halt = markeins_machine_halt;
diff --git a/arch/mips/gt64120/ev64120/irq.c b/arch/mips/gt64120/ev64120/irq.c
index f489a8067a93..5d939ac58f3f 100644
--- a/arch/mips/gt64120/ev64120/irq.c
+++ b/arch/mips/gt64120/ev64120/irq.c
@@ -104,7 +104,7 @@ static void end_ev64120_irq(unsigned int irq)
104 enable_ev64120_irq(irq); 104 enable_ev64120_irq(irq);
105} 105}
106 106
107static struct hw_interrupt_type ev64120_irq_type = { 107static struct irq_chip ev64120_irq_type = {
108 .typename = "EV64120", 108 .typename = "EV64120",
109 .startup = startup_ev64120_irq, 109 .startup = startup_ev64120_irq,
110 .shutdown = shutdown_ev64120_irq, 110 .shutdown = shutdown_ev64120_irq,
@@ -138,7 +138,7 @@ void __init arch_init_irq(void)
138 /* Let's initialize our IRQ descriptors */ 138 /* Let's initialize our IRQ descriptors */
139 for (i = 0; i < NR_IRQS; i++) { 139 for (i = 0; i < NR_IRQS; i++) {
140 irq_desc[i].status = 0; 140 irq_desc[i].status = 0;
141 irq_desc[i].chip = &no_irq_type; 141 irq_desc[i].chip = &no_irq_chip;
142 irq_desc[i].action = NULL; 142 irq_desc[i].action = NULL;
143 irq_desc[i].depth = 0; 143 irq_desc[i].depth = 0;
144 spin_lock_init(&irq_desc[i].lock); 144 spin_lock_init(&irq_desc[i].lock);
diff --git a/arch/mips/gt64120/wrppmc/setup.c b/arch/mips/gt64120/wrppmc/setup.c
index 2db6375ef29e..429afc400cb4 100644
--- a/arch/mips/gt64120/wrppmc/setup.c
+++ b/arch/mips/gt64120/wrppmc/setup.c
@@ -8,7 +8,6 @@
8 * Copyright (C) 1996, 1997, 2004 by Ralf Baechle (ralf@linux-mips.org) 8 * Copyright (C) 1996, 1997, 2004 by Ralf Baechle (ralf@linux-mips.org)
9 * Copyright (C) 2006, Wind River System Inc. Rongkai.zhan <rongkai.zhan@windriver.com> 9 * Copyright (C) 2006, Wind River System Inc. Rongkai.zhan <rongkai.zhan@windriver.com>
10 */ 10 */
11#include <linux/config.h>
12#include <linux/init.h> 11#include <linux/init.h>
13#include <linux/string.h> 12#include <linux/string.h>
14#include <linux/kernel.h> 13#include <linux/kernel.h>
@@ -128,7 +127,6 @@ static void wrppmc_setup_serial(void)
128void __init plat_mem_setup(void) 127void __init plat_mem_setup(void)
129{ 128{
130 extern void wrppmc_time_init(void); 129 extern void wrppmc_time_init(void);
131 extern void wrppmc_timer_setup(struct irqaction *);
132 extern void wrppmc_machine_restart(char *command); 130 extern void wrppmc_machine_restart(char *command);
133 extern void wrppmc_machine_halt(void); 131 extern void wrppmc_machine_halt(void);
134 extern void wrppmc_machine_power_off(void); 132 extern void wrppmc_machine_power_off(void);
@@ -139,7 +137,6 @@ void __init plat_mem_setup(void)
139 137
140 /* Use MIPS Count/Compare Timer */ 138 /* Use MIPS Count/Compare Timer */
141 board_time_init = wrppmc_time_init; 139 board_time_init = wrppmc_time_init;
142 board_timer_setup = wrppmc_timer_setup;
143 140
144 /* This makes the operations of 'in/out[bwl]' to the 141 /* This makes the operations of 'in/out[bwl]' to the
145 * physical address ( < KSEG0) can work via KSEG1 142 * physical address ( < KSEG0) can work via KSEG1
diff --git a/arch/mips/gt64120/wrppmc/time.c b/arch/mips/gt64120/wrppmc/time.c
index 6c24a82df0dd..5b440859bcee 100644
--- a/arch/mips/gt64120/wrppmc/time.c
+++ b/arch/mips/gt64120/wrppmc/time.c
@@ -10,7 +10,6 @@
10 * Copyright (C) 1996, 1997, 2004 by Ralf Baechle (ralf@linux-mips.org) 10 * Copyright (C) 1996, 1997, 2004 by Ralf Baechle (ralf@linux-mips.org)
11 * Copyright (C) 2006, Wind River System Inc. 11 * Copyright (C) 2006, Wind River System Inc.
12 */ 12 */
13#include <linux/config.h>
14#include <linux/init.h> 13#include <linux/init.h>
15#include <linux/string.h> 14#include <linux/string.h>
16#include <linux/kernel.h> 15#include <linux/kernel.h>
@@ -27,7 +26,7 @@
27 26
28#define WRPPMC_CPU_CLK_FREQ 40000000 /* 40MHZ */ 27#define WRPPMC_CPU_CLK_FREQ 40000000 /* 40MHZ */
29 28
30void __init wrppmc_timer_setup(struct irqaction *irq) 29void __init plat_timer_setup(struct irqaction *irq)
31{ 30{
32 /* Install ISR for timer interrupt */ 31 /* Install ISR for timer interrupt */
33 setup_irq(WRPPMC_MIPS_TIMER_IRQ, irq); 32 setup_irq(WRPPMC_MIPS_TIMER_IRQ, irq);
diff --git a/arch/mips/ite-boards/generic/irq.c b/arch/mips/ite-boards/generic/irq.c
index a6749c56fe38..cb59ca4f76f0 100644
--- a/arch/mips/ite-boards/generic/irq.c
+++ b/arch/mips/ite-boards/generic/irq.c
@@ -133,7 +133,7 @@ static void end_ite_irq(unsigned int irq)
133 enable_it8172_irq(irq); 133 enable_it8172_irq(irq);
134} 134}
135 135
136static struct hw_interrupt_type it8172_irq_type = { 136static struct irq_chip it8172_irq_type = {
137 .typename = "ITE8172", 137 .typename = "ITE8172",
138 .startup = startup_ite_irq, 138 .startup = startup_ite_irq,
139 .shutdown = shutdown_ite_irq, 139 .shutdown = shutdown_ite_irq,
@@ -153,7 +153,7 @@ static void ack_none(unsigned int irq) { }
153#define shutdown_none disable_none 153#define shutdown_none disable_none
154#define end_none enable_none 154#define end_none enable_none
155 155
156static struct hw_interrupt_type cp0_irq_type = { 156static struct irq_chip cp0_irq_type = {
157 .typename = "CP0 Count", 157 .typename = "CP0 Count",
158 .startup = startup_none, 158 .startup = startup_none,
159 .shutdown = shutdown_none, 159 .shutdown = shutdown_none,
diff --git a/arch/mips/ite-boards/generic/it8172_setup.c b/arch/mips/ite-boards/generic/it8172_setup.c
index a4615a5904aa..07faf3cacff2 100644
--- a/arch/mips/ite-boards/generic/it8172_setup.c
+++ b/arch/mips/ite-boards/generic/it8172_setup.c
@@ -29,6 +29,7 @@
29#include <linux/init.h> 29#include <linux/init.h>
30#include <linux/sched.h> 30#include <linux/sched.h>
31#include <linux/ioport.h> 31#include <linux/ioport.h>
32#include <linux/irq.h>
32#include <linux/serial_reg.h> 33#include <linux/serial_reg.h>
33#include <linux/major.h> 34#include <linux/major.h>
34#include <linux/kdev_t.h> 35#include <linux/kdev_t.h>
@@ -58,10 +59,7 @@ extern void it8172_restart(char *command);
58extern void it8172_halt(void); 59extern void it8172_halt(void);
59extern void it8172_power_off(void); 60extern void it8172_power_off(void);
60 61
61extern void (*board_time_init)(void);
62extern void (*board_timer_setup)(struct irqaction *irq);
63extern void it8172_time_init(void); 62extern void it8172_time_init(void);
64extern void it8172_timer_setup(struct irqaction *irq);
65 63
66#ifdef CONFIG_IT8172_REVC 64#ifdef CONFIG_IT8172_REVC
67struct { 65struct {
@@ -169,7 +167,6 @@ void __init plat_mem_setup(void)
169 clear_c0_status(ST0_FR); 167 clear_c0_status(ST0_FR);
170 168
171 board_time_init = it8172_time_init; 169 board_time_init = it8172_time_init;
172 board_timer_setup = it8172_timer_setup;
173 170
174 _machine_restart = it8172_restart; 171 _machine_restart = it8172_restart;
175 _machine_halt = it8172_halt; 172 _machine_halt = it8172_halt;
diff --git a/arch/mips/ite-boards/generic/time.c b/arch/mips/ite-boards/generic/time.c
index dee497a91807..3dc55569ff7f 100644
--- a/arch/mips/ite-boards/generic/time.c
+++ b/arch/mips/ite-boards/generic/time.c
@@ -233,7 +233,8 @@ void __init it8172_time_init(void)
233} 233}
234 234
235#define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5) 235#define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5)
236void __init it8172_timer_setup(struct irqaction *irq) 236
237void __init plat_timer_setup(struct irqaction *irq)
237{ 238{
238 puts("timer_setup\n"); 239 puts("timer_setup\n");
239 put32(NR_IRQS); 240 put32(NR_IRQS);
diff --git a/arch/mips/jazz/irq.c b/arch/mips/jazz/irq.c
index 478be9858a1e..eef05093deb4 100644
--- a/arch/mips/jazz/irq.c
+++ b/arch/mips/jazz/irq.c
@@ -55,7 +55,7 @@ static void end_r4030_irq(unsigned int irq)
55 enable_r4030_irq(irq); 55 enable_r4030_irq(irq);
56} 56}
57 57
58static struct hw_interrupt_type r4030_irq_type = { 58static struct irq_chip r4030_irq_type = {
59 .typename = "R4030", 59 .typename = "R4030",
60 .startup = startup_r4030_irq, 60 .startup = startup_r4030_irq,
61 .shutdown = shutdown_r4030_irq, 61 .shutdown = shutdown_r4030_irq,
diff --git a/arch/mips/jazz/setup.c b/arch/mips/jazz/setup.c
index 385413e30fdd..487a9ea1ef00 100644
--- a/arch/mips/jazz/setup.c
+++ b/arch/mips/jazz/setup.c
@@ -37,7 +37,7 @@ extern void jazz_machine_restart(char *command);
37extern void jazz_machine_halt(void); 37extern void jazz_machine_halt(void);
38extern void jazz_machine_power_off(void); 38extern void jazz_machine_power_off(void);
39 39
40static void __init jazz_time_init(struct irqaction *irq) 40void __init plat_time_init(struct irqaction *irq)
41{ 41{
42 /* set the clock to 100 Hz */ 42 /* set the clock to 100 Hz */
43 r4030_write_reg32(JAZZ_TIMER_INTERVAL, 9); 43 r4030_write_reg32(JAZZ_TIMER_INTERVAL, 9);
@@ -75,7 +75,6 @@ void __init plat_mem_setup(void)
75 for (i = 0; i < ARRAY_SIZE(jazz_io_resources); i++) 75 for (i = 0; i < ARRAY_SIZE(jazz_io_resources); i++)
76 request_resource(&ioport_resource, jazz_io_resources + i); 76 request_resource(&ioport_resource, jazz_io_resources + i);
77 77
78 board_timer_setup = jazz_time_init;
79 /* The RTC is outside the port address space */ 78 /* The RTC is outside the port address space */
80 79
81 _machine_restart = jazz_machine_restart; 80 _machine_restart = jazz_machine_restart;
diff --git a/arch/mips/jmr3927/rbhma3100/irq.c b/arch/mips/jmr3927/rbhma3100/irq.c
index 9c43702e7a93..722174481467 100644
--- a/arch/mips/jmr3927/rbhma3100/irq.c
+++ b/arch/mips/jmr3927/rbhma3100/irq.c
@@ -416,7 +416,7 @@ void __init arch_init_irq(void)
416 set_c0_status(ST0_IM); /* IE bit is still 0. */ 416 set_c0_status(ST0_IM); /* IE bit is still 0. */
417} 417}
418 418
419static hw_irq_controller jmr3927_irq_controller = { 419static struct irq_chip jmr3927_irq_controller = {
420 .typename = "jmr3927_irq", 420 .typename = "jmr3927_irq",
421 .startup = jmr3927_irq_startup, 421 .startup = jmr3927_irq_startup,
422 .shutdown = jmr3927_irq_shutdown, 422 .shutdown = jmr3927_irq_shutdown,
diff --git a/arch/mips/jmr3927/rbhma3100/setup.c b/arch/mips/jmr3927/rbhma3100/setup.c
index 6d4635d89d94..025434054ed0 100644
--- a/arch/mips/jmr3927/rbhma3100/setup.c
+++ b/arch/mips/jmr3927/rbhma3100/setup.c
@@ -40,6 +40,7 @@
40#include <linux/sched.h> 40#include <linux/sched.h>
41#include <linux/pci.h> 41#include <linux/pci.h>
42#include <linux/ide.h> 42#include <linux/ide.h>
43#include <linux/irq.h>
43#include <linux/ioport.h> 44#include <linux/ioport.h>
44#include <linux/param.h> /* for HZ */ 45#include <linux/param.h> /* for HZ */
45#include <linux/delay.h> 46#include <linux/delay.h>
@@ -183,9 +184,8 @@ static void __init jmr3927_time_init(void)
183} 184}
184 185
185unsigned long jmr3927_do_gettimeoffset(void); 186unsigned long jmr3927_do_gettimeoffset(void);
186extern int setup_irq(unsigned int irq, struct irqaction *irqaction);
187 187
188static void __init jmr3927_timer_setup(struct irqaction *irq) 188void __init plat_timer_setup(struct irqaction *irq)
189{ 189{
190 do_gettimeoffset = jmr3927_do_gettimeoffset; 190 do_gettimeoffset = jmr3927_do_gettimeoffset;
191 191
@@ -244,7 +244,6 @@ void __init plat_mem_setup(void)
244 set_io_port_base(JMR3927_PORT_BASE + JMR3927_PCIIO); 244 set_io_port_base(JMR3927_PORT_BASE + JMR3927_PCIIO);
245 245
246 board_time_init = jmr3927_time_init; 246 board_time_init = jmr3927_time_init;
247 board_timer_setup = jmr3927_timer_setup;
248 247
249 _machine_restart = jmr3927_machine_restart; 248 _machine_restart = jmr3927_machine_restart;
250 _machine_halt = jmr3927_machine_halt; 249 _machine_halt = jmr3927_machine_halt;
diff --git a/arch/mips/kernel/apm.c b/arch/mips/kernel/apm.c
index 7bdbcd811b57..528e731049c1 100644
--- a/arch/mips/kernel/apm.c
+++ b/arch/mips/kernel/apm.c
@@ -10,7 +10,6 @@
10 * [This document is available from Microsoft at: 10 * [This document is available from Microsoft at:
11 * http://www.microsoft.com/hwdev/busbios/amp_12.htm] 11 * http://www.microsoft.com/hwdev/busbios/amp_12.htm]
12 */ 12 */
13#include <linux/config.h>
14#include <linux/module.h> 13#include <linux/module.h>
15#include <linux/poll.h> 14#include <linux/poll.h>
16#include <linux/timer.h> 15#include <linux/timer.h>
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index ba08f055feb2..aa2caa67299a 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -459,7 +459,7 @@ static inline unsigned int decode_config0(struct cpuinfo_mips *c)
459 isa = (config0 & MIPS_CONF_AT) >> 13; 459 isa = (config0 & MIPS_CONF_AT) >> 13;
460 switch (isa) { 460 switch (isa) {
461 case 0: 461 case 0:
462 switch ((config0 >> 10) & 7) { 462 switch ((config0 & MIPS_CONF_AR) >> 10) {
463 case 0: 463 case 0:
464 c->isa_level = MIPS_CPU_ISA_M32R1; 464 c->isa_level = MIPS_CPU_ISA_M32R1;
465 break; 465 break;
@@ -471,7 +471,7 @@ static inline unsigned int decode_config0(struct cpuinfo_mips *c)
471 } 471 }
472 break; 472 break;
473 case 2: 473 case 2:
474 switch ((config0 >> 10) & 7) { 474 switch ((config0 & MIPS_CONF_AR) >> 10) {
475 case 0: 475 case 0:
476 c->isa_level = MIPS_CPU_ISA_M64R1; 476 c->isa_level = MIPS_CPU_ISA_M64R1;
477 break; 477 break;
@@ -548,7 +548,7 @@ static inline unsigned int decode_config3(struct cpuinfo_mips *c)
548 return config3 & MIPS_CONF_M; 548 return config3 & MIPS_CONF_M;
549} 549}
550 550
551static inline void decode_configs(struct cpuinfo_mips *c) 551static void __init decode_configs(struct cpuinfo_mips *c)
552{ 552{
553 /* MIPS32 or MIPS64 compliant CPU. */ 553 /* MIPS32 or MIPS64 compliant CPU. */
554 c->options = MIPS_CPU_4KEX | MIPS_CPU_4K_CACHE | MIPS_CPU_COUNTER | 554 c->options = MIPS_CPU_4KEX | MIPS_CPU_4K_CACHE | MIPS_CPU_COUNTER |
diff --git a/arch/mips/kernel/entry.S b/arch/mips/kernel/entry.S
index 01e7fa86aa43..766655f35250 100644
--- a/arch/mips/kernel/entry.S
+++ b/arch/mips/kernel/entry.S
@@ -113,6 +113,21 @@ FEXPORT(restore_all) # restore full frame
113 RESTORE_AT 113 RESTORE_AT
114 RESTORE_STATIC 114 RESTORE_STATIC
115FEXPORT(restore_partial) # restore partial frame 115FEXPORT(restore_partial) # restore partial frame
116#ifdef CONFIG_TRACE_IRQFLAGS
117 SAVE_STATIC
118 SAVE_AT
119 SAVE_TEMP
120 LONG_L v0, PT_STATUS(sp)
121 and v0, 1
122 beqz v0, 1f
123 jal trace_hardirqs_on
124 b 2f
1251: jal trace_hardirqs_off
1262:
127 RESTORE_TEMP
128 RESTORE_AT
129 RESTORE_STATIC
130#endif
116 RESTORE_SOME 131 RESTORE_SOME
117 RESTORE_SP_AND_RET 132 RESTORE_SP_AND_RET
118 .set at 133 .set at
diff --git a/arch/mips/kernel/gdb-low.S b/arch/mips/kernel/gdb-low.S
index 666bc9014cbd..2c446063636a 100644
--- a/arch/mips/kernel/gdb-low.S
+++ b/arch/mips/kernel/gdb-low.S
@@ -7,6 +7,7 @@
7 7
8#include <asm/asm.h> 8#include <asm/asm.h>
9#include <asm/errno.h> 9#include <asm/errno.h>
10#include <asm/irqflags.h>
10#include <asm/mipsregs.h> 11#include <asm/mipsregs.h>
11#include <asm/regdef.h> 12#include <asm/regdef.h>
12#include <asm/stackframe.h> 13#include <asm/stackframe.h>
@@ -120,6 +121,7 @@
120 LONG_S $31, GDB_FR_REG31(sp) 121 LONG_S $31, GDB_FR_REG31(sp)
121 122
122 CLI /* disable interrupts */ 123 CLI /* disable interrupts */
124 TRACE_IRQS_OFF
123 125
124/* 126/*
125 * Followed by the floating point registers 127 * Followed by the floating point registers
diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S
index 5254a2222d2b..37fda3dcdfc5 100644
--- a/arch/mips/kernel/genex.S
+++ b/arch/mips/kernel/genex.S
@@ -13,6 +13,7 @@
13#include <asm/asm.h> 13#include <asm/asm.h>
14#include <asm/asmmacro.h> 14#include <asm/asmmacro.h>
15#include <asm/cacheops.h> 15#include <asm/cacheops.h>
16#include <asm/irqflags.h>
16#include <asm/regdef.h> 17#include <asm/regdef.h>
17#include <asm/fpregdef.h> 18#include <asm/fpregdef.h>
18#include <asm/mipsregs.h> 19#include <asm/mipsregs.h>
@@ -128,6 +129,7 @@ handle_vcei:
128NESTED(handle_int, PT_SIZE, sp) 129NESTED(handle_int, PT_SIZE, sp)
129 SAVE_ALL 130 SAVE_ALL
130 CLI 131 CLI
132 TRACE_IRQS_OFF
131 133
132 PTR_LA ra, ret_from_irq 134 PTR_LA ra, ret_from_irq
133 move a0, sp 135 move a0, sp
@@ -216,6 +218,7 @@ NESTED(except_vec_vi_handler, 0, sp)
216 _ehb 218 _ehb
217#endif /* CONFIG_MIPS_MT_SMTC */ 219#endif /* CONFIG_MIPS_MT_SMTC */
218 CLI 220 CLI
221 TRACE_IRQS_OFF
219 move a0, sp 222 move a0, sp
220 jalr v0 223 jalr v0
221 j ret_from_irq 224 j ret_from_irq
@@ -288,11 +291,13 @@ NESTED(nmi_handler, PT_SIZE, sp)
288 .endm 291 .endm
289 292
290 .macro __build_clear_sti 293 .macro __build_clear_sti
294 TRACE_IRQS_ON
291 STI 295 STI
292 .endm 296 .endm
293 297
294 .macro __build_clear_cli 298 .macro __build_clear_cli
295 CLI 299 CLI
300 TRACE_IRQS_OFF
296 .endm 301 .endm
297 302
298 .macro __build_clear_fpe 303 .macro __build_clear_fpe
@@ -300,6 +305,7 @@ NESTED(nmi_handler, PT_SIZE, sp)
300 li a2, ~(0x3f << 12) 305 li a2, ~(0x3f << 12)
301 and a2, a1 306 and a2, a1
302 ctc1 a2, fcr31 307 ctc1 a2, fcr31
308 TRACE_IRQS_ON
303 STI 309 STI
304 .endm 310 .endm
305 311
@@ -365,7 +371,7 @@ NESTED(nmi_handler, PT_SIZE, sp)
365 BUILD_HANDLER mdmx mdmx sti silent /* #22 */ 371 BUILD_HANDLER mdmx mdmx sti silent /* #22 */
366 BUILD_HANDLER watch watch sti verbose /* #23 */ 372 BUILD_HANDLER watch watch sti verbose /* #23 */
367 BUILD_HANDLER mcheck mcheck cli verbose /* #24 */ 373 BUILD_HANDLER mcheck mcheck cli verbose /* #24 */
368 BUILD_HANDLER mt mt sti verbose /* #25 */ 374 BUILD_HANDLER mt mt sti silent /* #25 */
369 BUILD_HANDLER dsp dsp sti silent /* #26 */ 375 BUILD_HANDLER dsp dsp sti silent /* #26 */
370 BUILD_HANDLER reserved reserved sti verbose /* others */ 376 BUILD_HANDLER reserved reserved sti verbose /* others */
371 377
diff --git a/arch/mips/kernel/head.S b/arch/mips/kernel/head.S
index 476c1eb33c94..8c6db0fc72f0 100644
--- a/arch/mips/kernel/head.S
+++ b/arch/mips/kernel/head.S
@@ -5,7 +5,7 @@
5 * 5 *
6 * Copyright (C) 1994, 1995 Waldorf Electronics 6 * Copyright (C) 1994, 1995 Waldorf Electronics
7 * Written by Ralf Baechle and Andreas Busse 7 * Written by Ralf Baechle and Andreas Busse
8 * Copyright (C) 1994, 95, 96, 97, 98, 99, 2003 Ralf Baechle 8 * Copyright (C) 1994 - 99, 2003, 06 Ralf Baechle
9 * Copyright (C) 1996 Paul M. Antoine 9 * Copyright (C) 1996 Paul M. Antoine
10 * Modified for DECStation and hence R3000 support by Paul M. Antoine 10 * Modified for DECStation and hence R3000 support by Paul M. Antoine
11 * Further modifications by David S. Miller and Harald Koerfgen 11 * Further modifications by David S. Miller and Harald Koerfgen
@@ -18,6 +18,7 @@
18 18
19#include <asm/asm.h> 19#include <asm/asm.h>
20#include <asm/asmmacro.h> 20#include <asm/asmmacro.h>
21#include <asm/irqflags.h>
21#include <asm/regdef.h> 22#include <asm/regdef.h>
22#include <asm/page.h> 23#include <asm/page.h>
23#include <asm/mipsregs.h> 24#include <asm/mipsregs.h>
diff --git a/arch/mips/kernel/i8259.c b/arch/mips/kernel/i8259.c
index 91ffb1233cad..ea36c8e8852c 100644
--- a/arch/mips/kernel/i8259.c
+++ b/arch/mips/kernel/i8259.c
@@ -51,7 +51,7 @@ static unsigned int startup_8259A_irq(unsigned int irq)
51 return 0; /* never anything pending */ 51 return 0; /* never anything pending */
52} 52}
53 53
54static struct hw_interrupt_type i8259A_irq_type = { 54static struct irq_chip i8259A_irq_type = {
55 .typename = "XT-PIC", 55 .typename = "XT-PIC",
56 .startup = startup_8259A_irq, 56 .startup = startup_8259A_irq,
57 .shutdown = shutdown_8259A_irq, 57 .shutdown = shutdown_8259A_irq,
diff --git a/arch/mips/kernel/irixelf.c b/arch/mips/kernel/irixelf.c
index 10d3644e3608..ab12c8f01518 100644
--- a/arch/mips/kernel/irixelf.c
+++ b/arch/mips/kernel/irixelf.c
@@ -999,8 +999,6 @@ static inline int maydump(struct vm_area_struct *vma)
999 return 1; 999 return 1;
1000} 1000}
1001 1001
1002#define roundup(x, y) ((((x)+((y)-1))/(y))*(y))
1003
1004/* An ELF note in memory. */ 1002/* An ELF note in memory. */
1005struct memelfnote 1003struct memelfnote
1006{ 1004{
diff --git a/arch/mips/kernel/irq-msc01.c b/arch/mips/kernel/irq-msc01.c
index f8cd1ac64d88..63dfeb41796b 100644
--- a/arch/mips/kernel/irq-msc01.c
+++ b/arch/mips/kernel/irq-msc01.c
@@ -137,7 +137,7 @@ msc_bind_eic_interrupt (unsigned int irq, unsigned int set)
137 137
138#define shutdown_msc_irq disable_msc_irq 138#define shutdown_msc_irq disable_msc_irq
139 139
140struct hw_interrupt_type msc_levelirq_type = { 140struct irq_chip msc_levelirq_type = {
141 .typename = "SOC-it-Level", 141 .typename = "SOC-it-Level",
142 .startup = startup_msc_irq, 142 .startup = startup_msc_irq,
143 .shutdown = shutdown_msc_irq, 143 .shutdown = shutdown_msc_irq,
@@ -147,7 +147,7 @@ struct hw_interrupt_type msc_levelirq_type = {
147 .end = end_msc_irq, 147 .end = end_msc_irq,
148}; 148};
149 149
150struct hw_interrupt_type msc_edgeirq_type = { 150struct irq_chip msc_edgeirq_type = {
151 .typename = "SOC-it-Edge", 151 .typename = "SOC-it-Edge",
152 .startup =startup_msc_irq, 152 .startup =startup_msc_irq,
153 .shutdown = shutdown_msc_irq, 153 .shutdown = shutdown_msc_irq,
diff --git a/arch/mips/kernel/irq-mv6434x.c b/arch/mips/kernel/irq-mv6434x.c
index f9c763a65547..b117e64da64d 100644
--- a/arch/mips/kernel/irq-mv6434x.c
+++ b/arch/mips/kernel/irq-mv6434x.c
@@ -136,7 +136,7 @@ void ll_mv64340_irq(struct pt_regs *regs)
136 136
137#define shutdown_mv64340_irq disable_mv64340_irq 137#define shutdown_mv64340_irq disable_mv64340_irq
138 138
139struct hw_interrupt_type mv64340_irq_type = { 139struct irq_chip mv64340_irq_type = {
140 .typename = "MV-64340", 140 .typename = "MV-64340",
141 .startup = startup_mv64340_irq, 141 .startup = startup_mv64340_irq,
142 .shutdown = shutdown_mv64340_irq, 142 .shutdown = shutdown_mv64340_irq,
diff --git a/arch/mips/kernel/irq-rm7000.c b/arch/mips/kernel/irq-rm7000.c
index 121da385a94d..6b54c7109e2e 100644
--- a/arch/mips/kernel/irq-rm7000.c
+++ b/arch/mips/kernel/irq-rm7000.c
@@ -71,7 +71,7 @@ static void rm7k_cpu_irq_end(unsigned int irq)
71 unmask_rm7k_irq(irq); 71 unmask_rm7k_irq(irq);
72} 72}
73 73
74static hw_irq_controller rm7k_irq_controller = { 74static struct irq_chip rm7k_irq_controller = {
75 .typename = "RM7000", 75 .typename = "RM7000",
76 .startup = rm7k_cpu_irq_startup, 76 .startup = rm7k_cpu_irq_startup,
77 .shutdown = rm7k_cpu_irq_shutdown, 77 .shutdown = rm7k_cpu_irq_shutdown,
diff --git a/arch/mips/kernel/irq-rm9000.c b/arch/mips/kernel/irq-rm9000.c
index 25109c103e44..62f011ba97a2 100644
--- a/arch/mips/kernel/irq-rm9000.c
+++ b/arch/mips/kernel/irq-rm9000.c
@@ -105,7 +105,7 @@ static void rm9k_cpu_irq_end(unsigned int irq)
105 unmask_rm9k_irq(irq); 105 unmask_rm9k_irq(irq);
106} 106}
107 107
108static hw_irq_controller rm9k_irq_controller = { 108static struct irq_chip rm9k_irq_controller = {
109 .typename = "RM9000", 109 .typename = "RM9000",
110 .startup = rm9k_cpu_irq_startup, 110 .startup = rm9k_cpu_irq_startup,
111 .shutdown = rm9k_cpu_irq_shutdown, 111 .shutdown = rm9k_cpu_irq_shutdown,
@@ -115,7 +115,7 @@ static hw_irq_controller rm9k_irq_controller = {
115 .end = rm9k_cpu_irq_end, 115 .end = rm9k_cpu_irq_end,
116}; 116};
117 117
118static hw_irq_controller rm9k_perfcounter_irq = { 118static struct irq_chip rm9k_perfcounter_irq = {
119 .typename = "RM9000", 119 .typename = "RM9000",
120 .startup = rm9k_perfcounter_irq_startup, 120 .startup = rm9k_perfcounter_irq_startup,
121 .shutdown = rm9k_perfcounter_irq_shutdown, 121 .shutdown = rm9k_perfcounter_irq_shutdown,
diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c
index cde5e5afa179..d955aaefbb8e 100644
--- a/arch/mips/kernel/irq.c
+++ b/arch/mips/kernel/irq.c
@@ -136,7 +136,7 @@ void __init init_IRQ(void)
136 irq_desc[i].status = IRQ_DISABLED; 136 irq_desc[i].status = IRQ_DISABLED;
137 irq_desc[i].action = NULL; 137 irq_desc[i].action = NULL;
138 irq_desc[i].depth = 1; 138 irq_desc[i].depth = 1;
139 irq_desc[i].chip = &no_irq_type; 139 irq_desc[i].chip = &no_irq_chip;
140 spin_lock_init(&irq_desc[i].lock); 140 spin_lock_init(&irq_desc[i].lock);
141#ifdef CONFIG_MIPS_MT_SMTC 141#ifdef CONFIG_MIPS_MT_SMTC
142 irq_hwmask[i] = 0; 142 irq_hwmask[i] = 0;
diff --git a/arch/mips/kernel/irq_cpu.c b/arch/mips/kernel/irq_cpu.c
index 0e455a8ad860..9bb21c7f2149 100644
--- a/arch/mips/kernel/irq_cpu.c
+++ b/arch/mips/kernel/irq_cpu.c
@@ -94,7 +94,7 @@ static void mips_cpu_irq_end(unsigned int irq)
94 unmask_mips_irq(irq); 94 unmask_mips_irq(irq);
95} 95}
96 96
97static hw_irq_controller mips_cpu_irq_controller = { 97static struct irq_chip mips_cpu_irq_controller = {
98 .typename = "MIPS", 98 .typename = "MIPS",
99 .startup = mips_cpu_irq_startup, 99 .startup = mips_cpu_irq_startup,
100 .shutdown = mips_cpu_irq_shutdown, 100 .shutdown = mips_cpu_irq_shutdown,
@@ -140,7 +140,7 @@ static void mips_mt_cpu_irq_ack(unsigned int irq)
140 140
141#define mips_mt_cpu_irq_end mips_cpu_irq_end 141#define mips_mt_cpu_irq_end mips_cpu_irq_end
142 142
143static hw_irq_controller mips_mt_cpu_irq_controller = { 143static struct irq_chip mips_mt_cpu_irq_controller = {
144 .typename = "MIPS", 144 .typename = "MIPS",
145 .startup = mips_mt_cpu_irq_startup, 145 .startup = mips_mt_cpu_irq_startup,
146 .shutdown = mips_mt_cpu_irq_shutdown, 146 .shutdown = mips_mt_cpu_irq_shutdown,
diff --git a/arch/mips/kernel/mips-mt.c b/arch/mips/kernel/mips-mt.c
index 4dcc39f42951..c1373a6e668b 100644
--- a/arch/mips/kernel/mips-mt.c
+++ b/arch/mips/kernel/mips-mt.c
@@ -7,6 +7,7 @@
7#include <linux/sched.h> 7#include <linux/sched.h>
8#include <linux/cpumask.h> 8#include <linux/cpumask.h>
9#include <linux/interrupt.h> 9#include <linux/interrupt.h>
10#include <linux/security.h>
10 11
11#include <asm/cpu.h> 12#include <asm/cpu.h>
12#include <asm/processor.h> 13#include <asm/processor.h>
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S
index 8f8101f878ca..ba1bcd83c7d3 100644
--- a/arch/mips/kernel/scall32-o32.S
+++ b/arch/mips/kernel/scall32-o32.S
@@ -3,13 +3,14 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 1995, 96, 97, 98, 99, 2000, 01, 02 by Ralf Baechle 6 * Copyright (C) 1995-99, 2000- 02, 06 Ralf Baechle <ralf@linux-mips.org>
7 * Copyright (C) 2001 MIPS Technologies, Inc. 7 * Copyright (C) 2001 MIPS Technologies, Inc.
8 * Copyright (C) 2004 Thiemo Seufer 8 * Copyright (C) 2004 Thiemo Seufer
9 */ 9 */
10#include <linux/errno.h> 10#include <linux/errno.h>
11#include <asm/asm.h> 11#include <asm/asm.h>
12#include <asm/asmmacro.h> 12#include <asm/asmmacro.h>
13#include <asm/irqflags.h>
13#include <asm/mipsregs.h> 14#include <asm/mipsregs.h>
14#include <asm/regdef.h> 15#include <asm/regdef.h>
15#include <asm/stackframe.h> 16#include <asm/stackframe.h>
@@ -27,6 +28,18 @@
27NESTED(handle_sys, PT_SIZE, sp) 28NESTED(handle_sys, PT_SIZE, sp)
28 .set noat 29 .set noat
29 SAVE_SOME 30 SAVE_SOME
31#ifdef CONFIG_TRACE_IRQFLAGS
32 TRACE_IRQS_ON
33#ifdef CONFIG_64BIT
34 LONG_L $8, PT_R8(sp)
35 LONG_L $9, PT_R9(sp)
36#endif
37 LONG_L $7, PT_R7(sp)
38 LONG_L $6, PT_R6(sp)
39 LONG_L $5, PT_R5(sp)
40 LONG_L $4, PT_R4(sp)
41 LONG_L $2, PT_R2(sp)
42#endif
30 STI 43 STI
31 .set at 44 .set at
32 45
@@ -647,6 +660,8 @@ einval: li v0, -EINVAL
647 sys sys_splice 4 660 sys sys_splice 4
648 sys sys_sync_file_range 7 /* 4305 */ 661 sys sys_sync_file_range 7 /* 4305 */
649 sys sys_tee 4 662 sys sys_tee 4
663 sys sys_vmsplice 4
664 sys sys_move_pages 6
650 .endm 665 .endm
651 666
652 /* We pre-compute the number of _instruction_ bytes needed to 667 /* We pre-compute the number of _instruction_ bytes needed to
diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S
index b4a34a625a2e..939e172db953 100644
--- a/arch/mips/kernel/scall64-64.S
+++ b/arch/mips/kernel/scall64-64.S
@@ -10,6 +10,7 @@
10#include <linux/errno.h> 10#include <linux/errno.h>
11#include <asm/asm.h> 11#include <asm/asm.h>
12#include <asm/asmmacro.h> 12#include <asm/asmmacro.h>
13#include <asm/irqflags.h>
13#include <asm/mipsregs.h> 14#include <asm/mipsregs.h>
14#include <asm/regdef.h> 15#include <asm/regdef.h>
15#include <asm/stackframe.h> 16#include <asm/stackframe.h>
@@ -33,6 +34,7 @@ NESTED(handle_sys64, PT_SIZE, sp)
33 */ 34 */
34 .set noat 35 .set noat
35 SAVE_SOME 36 SAVE_SOME
37 TRACE_IRQS_ON
36 STI 38 STI
37 .set at 39 .set at
38#endif 40#endif
@@ -462,3 +464,5 @@ sys_call_table:
462 PTR sys_splice 464 PTR sys_splice
463 PTR sys_sync_file_range 465 PTR sys_sync_file_range
464 PTR sys_tee /* 5265 */ 466 PTR sys_tee /* 5265 */
467 PTR sys_vmsplice
468 PTR sys_move_pages
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S
index df8c4f8ccd61..98abbc5a9f13 100644
--- a/arch/mips/kernel/scall64-n32.S
+++ b/arch/mips/kernel/scall64-n32.S
@@ -10,6 +10,7 @@
10#include <linux/errno.h> 10#include <linux/errno.h>
11#include <asm/asm.h> 11#include <asm/asm.h>
12#include <asm/asmmacro.h> 12#include <asm/asmmacro.h>
13#include <asm/irqflags.h>
13#include <asm/mipsregs.h> 14#include <asm/mipsregs.h>
14#include <asm/regdef.h> 15#include <asm/regdef.h>
15#include <asm/stackframe.h> 16#include <asm/stackframe.h>
@@ -32,6 +33,7 @@ NESTED(handle_sysn32, PT_SIZE, sp)
32#ifndef CONFIG_MIPS32_O32 33#ifndef CONFIG_MIPS32_O32
33 .set noat 34 .set noat
34 SAVE_SOME 35 SAVE_SOME
36 TRACE_IRQS_ON
35 STI 37 STI
36 .set at 38 .set at
37#endif 39#endif
@@ -388,3 +390,5 @@ EXPORT(sysn32_call_table)
388 PTR sys_splice 390 PTR sys_splice
389 PTR sys_sync_file_range 391 PTR sys_sync_file_range
390 PTR sys_tee 392 PTR sys_tee
393 PTR sys_vmsplice /* 6271 */
394 PTR sys_move_pages
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S
index f04fe4f085c3..505c9ee54009 100644
--- a/arch/mips/kernel/scall64-o32.S
+++ b/arch/mips/kernel/scall64-o32.S
@@ -16,6 +16,7 @@
16#include <linux/errno.h> 16#include <linux/errno.h>
17#include <asm/asm.h> 17#include <asm/asm.h>
18#include <asm/asmmacro.h> 18#include <asm/asmmacro.h>
19#include <asm/irqflags.h>
19#include <asm/mipsregs.h> 20#include <asm/mipsregs.h>
20#include <asm/regdef.h> 21#include <asm/regdef.h>
21#include <asm/stackframe.h> 22#include <asm/stackframe.h>
@@ -27,6 +28,7 @@
27NESTED(handle_sys, PT_SIZE, sp) 28NESTED(handle_sys, PT_SIZE, sp)
28 .set noat 29 .set noat
29 SAVE_SOME 30 SAVE_SOME
31 TRACE_IRQS_ON
30 STI 32 STI
31 .set at 33 .set at
32 ld t1, PT_EPC(sp) # skip syscall on return 34 ld t1, PT_EPC(sp) # skip syscall on return
@@ -510,4 +512,6 @@ sys_call_table:
510 PTR sys_splice 512 PTR sys_splice
511 PTR sys32_sync_file_range /* 4305 */ 513 PTR sys32_sync_file_range /* 4305 */
512 PTR sys_tee 514 PTR sys_tee
515 PTR sys_vmsplice
516 PTR compat_sys_move_pages
513 .size sys_call_table,.-sys_call_table 517 .size sys_call_table,.-sys_call_table
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index 5edd8d4bb665..8c2b596a136f 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -24,7 +24,7 @@
24#include <linux/user.h> 24#include <linux/user.h>
25#include <linux/utsname.h> 25#include <linux/utsname.h>
26#include <linux/a.out.h> 26#include <linux/a.out.h>
27#include <linux/tty.h> 27#include <linux/screen_info.h>
28#include <linux/bootmem.h> 28#include <linux/bootmem.h>
29#include <linux/initrd.h> 29#include <linux/initrd.h>
30#include <linux/major.h> 30#include <linux/major.h>
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c
index 9096a5ea4229..221895802dca 100644
--- a/arch/mips/kernel/smp.c
+++ b/arch/mips/kernel/smp.c
@@ -319,6 +319,32 @@ static void flush_tlb_mm_ipi(void *mm)
319} 319}
320 320
321/* 321/*
322 * Special Variant of smp_call_function for use by TLB functions:
323 *
324 * o No return value
325 * o collapses to normal function call on UP kernels
326 * o collapses to normal function call on systems with a single shared
327 * primary cache.
328 * o CONFIG_MIPS_MT_SMTC currently implies there is only one physical core.
329 */
330static inline void smp_on_other_tlbs(void (*func) (void *info), void *info)
331{
332#ifndef CONFIG_MIPS_MT_SMTC
333 smp_call_function(func, info, 1, 1);
334#endif
335}
336
337static inline void smp_on_each_tlb(void (*func) (void *info), void *info)
338{
339 preempt_disable();
340
341 smp_on_other_tlbs(func, info);
342 func(info);
343
344 preempt_enable();
345}
346
347/*
322 * The following tlb flush calls are invoked when old translations are 348 * The following tlb flush calls are invoked when old translations are
323 * being torn down, or pte attributes are changing. For single threaded 349 * being torn down, or pte attributes are changing. For single threaded
324 * address spaces, a new context is obtained on the current cpu, and tlb 350 * address spaces, a new context is obtained on the current cpu, and tlb
@@ -336,7 +362,7 @@ void flush_tlb_mm(struct mm_struct *mm)
336 preempt_disable(); 362 preempt_disable();
337 363
338 if ((atomic_read(&mm->mm_users) != 1) || (current->mm != mm)) { 364 if ((atomic_read(&mm->mm_users) != 1) || (current->mm != mm)) {
339 smp_call_function(flush_tlb_mm_ipi, (void *)mm, 1, 1); 365 smp_on_other_tlbs(flush_tlb_mm_ipi, (void *)mm);
340 } else { 366 } else {
341 int i; 367 int i;
342 for (i = 0; i < num_online_cpus(); i++) 368 for (i = 0; i < num_online_cpus(); i++)
@@ -372,7 +398,7 @@ void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, unsigned l
372 fd.vma = vma; 398 fd.vma = vma;
373 fd.addr1 = start; 399 fd.addr1 = start;
374 fd.addr2 = end; 400 fd.addr2 = end;
375 smp_call_function(flush_tlb_range_ipi, (void *)&fd, 1, 1); 401 smp_on_other_tlbs(flush_tlb_range_ipi, (void *)&fd);
376 } else { 402 } else {
377 int i; 403 int i;
378 for (i = 0; i < num_online_cpus(); i++) 404 for (i = 0; i < num_online_cpus(); i++)
@@ -414,7 +440,7 @@ void flush_tlb_page(struct vm_area_struct *vma, unsigned long page)
414 440
415 fd.vma = vma; 441 fd.vma = vma;
416 fd.addr1 = page; 442 fd.addr1 = page;
417 smp_call_function(flush_tlb_page_ipi, (void *)&fd, 1, 1); 443 smp_on_other_tlbs(flush_tlb_page_ipi, (void *)&fd);
418 } else { 444 } else {
419 int i; 445 int i;
420 for (i = 0; i < num_online_cpus(); i++) 446 for (i = 0; i < num_online_cpus(); i++)
@@ -434,8 +460,7 @@ static void flush_tlb_one_ipi(void *info)
434 460
435void flush_tlb_one(unsigned long vaddr) 461void flush_tlb_one(unsigned long vaddr)
436{ 462{
437 smp_call_function(flush_tlb_one_ipi, (void *) vaddr, 1, 1); 463 smp_on_each_tlb(flush_tlb_one_ipi, (void *) vaddr);
438 local_flush_tlb_one(vaddr);
439} 464}
440 465
441static DEFINE_PER_CPU(struct cpu, cpu_devices); 466static DEFINE_PER_CPU(struct cpu, cpu_devices);
diff --git a/arch/mips/kernel/smtc-asm.S b/arch/mips/kernel/smtc-asm.S
index 72c6d98f8854..4cc3dea36612 100644
--- a/arch/mips/kernel/smtc-asm.S
+++ b/arch/mips/kernel/smtc-asm.S
@@ -96,6 +96,7 @@ FEXPORT(__smtc_ipi_vector)
96 /* Save all will redundantly recompute the SP, but use it for now */ 96 /* Save all will redundantly recompute the SP, but use it for now */
97 SAVE_ALL 97 SAVE_ALL
98 CLI 98 CLI
99 TRACE_IRQS_OFF
99 move a0,sp 100 move a0,sp
100 /* Function to be invoked passed stack pad slot 5 */ 101 /* Function to be invoked passed stack pad slot 5 */
101 lw t0,PT_PADSLOT5(sp) 102 lw t0,PT_PADSLOT5(sp)
diff --git a/arch/mips/kernel/smtc.c b/arch/mips/kernel/smtc.c
index a48d9e553083..604bcc5cb7c8 100644
--- a/arch/mips/kernel/smtc.c
+++ b/arch/mips/kernel/smtc.c
@@ -127,7 +127,7 @@ static int __init stlb_disable(char *s)
127static int __init asidmask_set(char *str) 127static int __init asidmask_set(char *str)
128{ 128{
129 get_option(&str, &asidmask); 129 get_option(&str, &asidmask);
130 switch(asidmask) { 130 switch (asidmask) {
131 case 0x1: 131 case 0x1:
132 case 0x3: 132 case 0x3:
133 case 0x7: 133 case 0x7:
@@ -249,7 +249,7 @@ void smtc_configure_tlb(void)
249 /* 249 /*
250 * Only count if the MMU Type indicated is TLB 250 * Only count if the MMU Type indicated is TLB
251 */ 251 */
252 if(((read_vpe_c0_config() & MIPS_CONF_MT) >> 7) == 1) { 252 if (((read_vpe_c0_config() & MIPS_CONF_MT) >> 7) == 1) {
253 config1val = read_vpe_c0_config1(); 253 config1val = read_vpe_c0_config1();
254 tlbsiz += ((config1val >> 25) & 0x3f) + 1; 254 tlbsiz += ((config1val >> 25) & 0x3f) + 1;
255 } 255 }
@@ -500,7 +500,7 @@ void mipsmt_prepare_cpus(void)
500 /* Set up coprocessor affinity CPU mask(s) */ 500 /* Set up coprocessor affinity CPU mask(s) */
501 501
502 for (tc = 0; tc < ntc; tc++) { 502 for (tc = 0; tc < ntc; tc++) {
503 if(cpu_data[tc].options & MIPS_CPU_FPU) 503 if (cpu_data[tc].options & MIPS_CPU_FPU)
504 cpu_set(tc, mt_fpu_cpumask); 504 cpu_set(tc, mt_fpu_cpumask);
505 } 505 }
506 506
@@ -577,13 +577,13 @@ void smtc_init_secondary(void)
577{ 577{
578 /* 578 /*
579 * Start timer on secondary VPEs if necessary. 579 * Start timer on secondary VPEs if necessary.
580 * mips_timer_setup should already have been invoked by init/main 580 * plat_timer_setup has already have been invoked by init/main
581 * on "boot" TC. Like per_cpu_trap_init() hack, this assumes that 581 * on "boot" TC. Like per_cpu_trap_init() hack, this assumes that
582 * SMTC init code assigns TCs consdecutively and in ascending order 582 * SMTC init code assigns TCs consdecutively and in ascending order
583 * to across available VPEs. 583 * to across available VPEs.
584 */ 584 */
585 if(((read_c0_tcbind() & TCBIND_CURTC) != 0) 585 if (((read_c0_tcbind() & TCBIND_CURTC) != 0) &&
586 && ((read_c0_tcbind() & TCBIND_CURVPE) 586 ((read_c0_tcbind() & TCBIND_CURVPE)
587 != cpu_data[smp_processor_id() - 1].vpe_id)){ 587 != cpu_data[smp_processor_id() - 1].vpe_id)){
588 write_c0_compare (read_c0_count() + mips_hpt_frequency/HZ); 588 write_c0_compare (read_c0_count() + mips_hpt_frequency/HZ);
589 } 589 }
@@ -757,8 +757,8 @@ void smtc_send_ipi(int cpu, int type, unsigned int action)
757 write_tc_c0_tchalt(0); 757 write_tc_c0_tchalt(0);
758 UNLOCK_CORE_PRA(); 758 UNLOCK_CORE_PRA();
759 /* Try to reduce redundant timer interrupt messages */ 759 /* Try to reduce redundant timer interrupt messages */
760 if(type == SMTC_CLOCK_TICK) { 760 if (type == SMTC_CLOCK_TICK) {
761 if(atomic_postincrement(&ipi_timer_latch[cpu])!=0) { 761 if (atomic_postincrement(&ipi_timer_latch[cpu])!=0){
762 smtc_ipi_nq(&freeIPIq, pipi); 762 smtc_ipi_nq(&freeIPIq, pipi);
763 return; 763 return;
764 } 764 }
@@ -797,7 +797,7 @@ void post_direct_ipi(int cpu, struct smtc_ipi *pipi)
797 * CU bit of Status is indicator that TC was 797 * CU bit of Status is indicator that TC was
798 * already running on a kernel stack... 798 * already running on a kernel stack...
799 */ 799 */
800 if(tcstatus & ST0_CU0) { 800 if (tcstatus & ST0_CU0) {
801 /* Note that this "- 1" is pointer arithmetic */ 801 /* Note that this "- 1" is pointer arithmetic */
802 kstack = ((struct pt_regs *)read_tc_gpr_sp()) - 1; 802 kstack = ((struct pt_regs *)read_tc_gpr_sp()) - 1;
803 } else { 803 } else {
@@ -840,31 +840,31 @@ void ipi_decode(struct pt_regs *regs, struct smtc_ipi *pipi)
840 840
841 smtc_ipi_nq(&freeIPIq, pipi); 841 smtc_ipi_nq(&freeIPIq, pipi);
842 switch (type_copy) { 842 switch (type_copy) {
843 case SMTC_CLOCK_TICK: 843 case SMTC_CLOCK_TICK:
844 /* Invoke Clock "Interrupt" */ 844 /* Invoke Clock "Interrupt" */
845 ipi_timer_latch[dest_copy] = 0; 845 ipi_timer_latch[dest_copy] = 0;
846#ifdef SMTC_IDLE_HOOK_DEBUG 846#ifdef SMTC_IDLE_HOOK_DEBUG
847 clock_hang_reported[dest_copy] = 0; 847 clock_hang_reported[dest_copy] = 0;
848#endif /* SMTC_IDLE_HOOK_DEBUG */ 848#endif /* SMTC_IDLE_HOOK_DEBUG */
849 local_timer_interrupt(0, NULL, regs); 849 local_timer_interrupt(0, NULL, regs);
850 break;
851 case LINUX_SMP_IPI:
852 switch ((int)arg_copy) {
853 case SMP_RESCHEDULE_YOURSELF:
854 ipi_resched_interrupt(regs);
850 break; 855 break;
851 case LINUX_SMP_IPI: 856 case SMP_CALL_FUNCTION:
852 switch ((int)arg_copy) { 857 ipi_call_interrupt(regs);
853 case SMP_RESCHEDULE_YOURSELF:
854 ipi_resched_interrupt(regs);
855 break;
856 case SMP_CALL_FUNCTION:
857 ipi_call_interrupt(regs);
858 break;
859 default:
860 printk("Impossible SMTC IPI Argument 0x%x\n",
861 (int)arg_copy);
862 break;
863 }
864 break; 858 break;
865 default: 859 default:
866 printk("Impossible SMTC IPI Type 0x%x\n", type_copy); 860 printk("Impossible SMTC IPI Argument 0x%x\n",
861 (int)arg_copy);
867 break; 862 break;
863 }
864 break;
865 default:
866 printk("Impossible SMTC IPI Type 0x%x\n", type_copy);
867 break;
868 } 868 }
869} 869}
870 870
@@ -879,7 +879,7 @@ void deferred_smtc_ipi(struct pt_regs *regs)
879 * Test is not atomic, but much faster than a dequeue, 879 * Test is not atomic, but much faster than a dequeue,
880 * and the vast majority of invocations will have a null queue. 880 * and the vast majority of invocations will have a null queue.
881 */ 881 */
882 if(IPIQ[q].head != NULL) { 882 if (IPIQ[q].head != NULL) {
883 while((pipi = smtc_ipi_dq(&IPIQ[q])) != NULL) { 883 while((pipi = smtc_ipi_dq(&IPIQ[q])) != NULL) {
884 /* ipi_decode() should be called with interrupts off */ 884 /* ipi_decode() should be called with interrupts off */
885 local_irq_save(flags); 885 local_irq_save(flags);
@@ -1254,7 +1254,7 @@ void smtc_flush_tlb_asid(unsigned long asid)
1254 tlb_read(); 1254 tlb_read();
1255 ehb(); 1255 ehb();
1256 ehi = read_c0_entryhi(); 1256 ehi = read_c0_entryhi();
1257 if((ehi & ASID_MASK) == asid) { 1257 if ((ehi & ASID_MASK) == asid) {
1258 /* 1258 /*
1259 * Invalidate only entries with specified ASID, 1259 * Invalidate only entries with specified ASID,
1260 * makiing sure all entries differ. 1260 * makiing sure all entries differ.
diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c
index 2393c11d5a20..170cb67f4ede 100644
--- a/arch/mips/kernel/time.c
+++ b/arch/mips/kernel/time.c
@@ -566,14 +566,13 @@ asmlinkage void ll_local_timer_interrupt(int irq, struct pt_regs *regs)
566 * 2) setup xtime based on rtc_mips_get_time(). 566 * 2) setup xtime based on rtc_mips_get_time().
567 * 3) choose a appropriate gettimeoffset routine. 567 * 3) choose a appropriate gettimeoffset routine.
568 * 4) calculate a couple of cached variables for later usage 568 * 4) calculate a couple of cached variables for later usage
569 * 5) board_timer_setup() - 569 * 5) plat_timer_setup() -
570 * a) (optional) over-write any choices made above by time_init(). 570 * a) (optional) over-write any choices made above by time_init().
571 * b) machine specific code should setup the timer irqaction. 571 * b) machine specific code should setup the timer irqaction.
572 * c) enable the timer interrupt 572 * c) enable the timer interrupt
573 */ 573 */
574 574
575void (*board_time_init)(void); 575void (*board_time_init)(void);
576void (*board_timer_setup)(struct irqaction *irq);
577 576
578unsigned int mips_hpt_frequency; 577unsigned int mips_hpt_frequency;
579 578
@@ -718,7 +717,7 @@ void __init time_init(void)
718 * to be NULL function so that we are sure the high-level code 717 * to be NULL function so that we are sure the high-level code
719 * is not invoked accidentally. 718 * is not invoked accidentally.
720 */ 719 */
721 board_timer_setup(&timer_irqaction); 720 plat_timer_setup(&timer_irqaction);
722} 721}
723 722
724#define FEBRUARY 2 723#define FEBRUARY 2
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index 8b95eca9ac74..954a198494ef 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -569,6 +569,8 @@ asmlinkage void do_ov(struct pt_regs *regs)
569 */ 569 */
570asmlinkage void do_fpe(struct pt_regs *regs, unsigned long fcr31) 570asmlinkage void do_fpe(struct pt_regs *regs, unsigned long fcr31)
571{ 571{
572 die_if_kernel("FP exception in kernel code", regs);
573
572 if (fcr31 & FPU_CSR_UNI_X) { 574 if (fcr31 & FPU_CSR_UNI_X) {
573 int sig; 575 int sig;
574 576
@@ -847,31 +849,29 @@ asmlinkage void do_mt(struct pt_regs *regs)
847{ 849{
848 int subcode; 850 int subcode;
849 851
850 die_if_kernel("MIPS MT Thread exception in kernel", regs);
851
852 subcode = (read_vpe_c0_vpecontrol() & VPECONTROL_EXCPT) 852 subcode = (read_vpe_c0_vpecontrol() & VPECONTROL_EXCPT)
853 >> VPECONTROL_EXCPT_SHIFT; 853 >> VPECONTROL_EXCPT_SHIFT;
854 switch (subcode) { 854 switch (subcode) {
855 case 0: 855 case 0:
856 printk(KERN_ERR "Thread Underflow\n"); 856 printk(KERN_DEBUG "Thread Underflow\n");
857 break; 857 break;
858 case 1: 858 case 1:
859 printk(KERN_ERR "Thread Overflow\n"); 859 printk(KERN_DEBUG "Thread Overflow\n");
860 break; 860 break;
861 case 2: 861 case 2:
862 printk(KERN_ERR "Invalid YIELD Qualifier\n"); 862 printk(KERN_DEBUG "Invalid YIELD Qualifier\n");
863 break; 863 break;
864 case 3: 864 case 3:
865 printk(KERN_ERR "Gating Storage Exception\n"); 865 printk(KERN_DEBUG "Gating Storage Exception\n");
866 break; 866 break;
867 case 4: 867 case 4:
868 printk(KERN_ERR "YIELD Scheduler Exception\n"); 868 printk(KERN_DEBUG "YIELD Scheduler Exception\n");
869 break; 869 break;
870 case 5: 870 case 5:
871 printk(KERN_ERR "Gating Storage Schedulier Exception\n"); 871 printk(KERN_DEBUG "Gating Storage Schedulier Exception\n");
872 break; 872 break;
873 default: 873 default:
874 printk(KERN_ERR "*** UNKNOWN THREAD EXCEPTION %d ***\n", 874 printk(KERN_DEBUG "*** UNKNOWN THREAD EXCEPTION %d ***\n",
875 subcode); 875 subcode);
876 break; 876 break;
877 } 877 }
@@ -980,10 +980,10 @@ void ejtag_exception_handler(struct pt_regs *regs)
980 unsigned long depc, old_epc; 980 unsigned long depc, old_epc;
981 unsigned int debug; 981 unsigned int debug;
982 982
983 printk("SDBBP EJTAG debug exception - not handled yet, just ignored!\n"); 983 printk(KERN_DEBUG "SDBBP EJTAG debug exception - not handled yet, just ignored!\n");
984 depc = read_c0_depc(); 984 depc = read_c0_depc();
985 debug = read_c0_debug(); 985 debug = read_c0_debug();
986 printk("c0_depc = %0*lx, DEBUG = %08x\n", field, depc, debug); 986 printk(KERN_DEBUG "c0_depc = %0*lx, DEBUG = %08x\n", field, depc, debug);
987 if (debug & 0x80000000) { 987 if (debug & 0x80000000) {
988 /* 988 /*
989 * In branch delay slot. 989 * In branch delay slot.
@@ -1001,7 +1001,7 @@ void ejtag_exception_handler(struct pt_regs *regs)
1001 write_c0_depc(depc); 1001 write_c0_depc(depc);
1002 1002
1003#if 0 1003#if 0
1004 printk("\n\n----- Enable EJTAG single stepping ----\n\n"); 1004 printk(KERN_DEBUG "\n\n----- Enable EJTAG single stepping ----\n\n");
1005 write_c0_debug(debug | 0x100); 1005 write_c0_debug(debug | 0x100);
1006#endif 1006#endif
1007} 1007}
diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c
index 85d7df7b18e1..9ee0ec2cd067 100644
--- a/arch/mips/kernel/vpe.c
+++ b/arch/mips/kernel/vpe.c
@@ -28,7 +28,6 @@
28 * i.e cat spapp >/dev/vpe1. 28 * i.e cat spapp >/dev/vpe1.
29 */ 29 */
30 30
31#include <linux/config.h>
32#include <linux/kernel.h> 31#include <linux/kernel.h>
33#include <linux/module.h> 32#include <linux/module.h>
34#include <linux/fs.h> 33#include <linux/fs.h>
diff --git a/arch/mips/lasat/interrupt.c b/arch/mips/lasat/interrupt.c
index 9316a024a818..456be8fc961a 100644
--- a/arch/mips/lasat/interrupt.c
+++ b/arch/mips/lasat/interrupt.c
@@ -69,7 +69,7 @@ static void end_lasat_irq(unsigned int irq)
69 enable_lasat_irq(irq); 69 enable_lasat_irq(irq);
70} 70}
71 71
72static struct hw_interrupt_type lasat_irq_type = { 72static struct irq_chip lasat_irq_type = {
73 .typename = "Lasat", 73 .typename = "Lasat",
74 .startup = startup_lasat_irq, 74 .startup = startup_lasat_irq,
75 .shutdown = shutdown_lasat_irq, 75 .shutdown = shutdown_lasat_irq,
diff --git a/arch/mips/lasat/setup.c b/arch/mips/lasat/setup.c
index 2187e63c6d88..0ffc43c600d9 100644
--- a/arch/mips/lasat/setup.c
+++ b/arch/mips/lasat/setup.c
@@ -115,12 +115,9 @@ static void lasat_time_init(void)
115 mips_hpt_frequency = lasat_board_info.li_cpu_hz / 2; 115 mips_hpt_frequency = lasat_board_info.li_cpu_hz / 2;
116} 116}
117 117
118static void lasat_timer_setup(struct irqaction *irq) 118void __init plat_timer_setup(struct irqaction *irq)
119{ 119{
120 120 write_c0_compare( read_c0_count() + mips_hpt_frequency / HZ);
121 write_c0_compare(
122 read_c0_count() +
123 mips_hpt_frequency / HZ);
124 change_c0_status(ST0_IM, IE_IRQ0 | IE_IRQ5); 121 change_c0_status(ST0_IM, IE_IRQ0 | IE_IRQ5);
125} 122}
126 123
@@ -170,7 +167,6 @@ void __init plat_mem_setup(void)
170 lasat_reboot_setup(); 167 lasat_reboot_setup();
171 168
172 board_time_init = lasat_time_init; 169 board_time_init = lasat_time_init;
173 board_timer_setup = lasat_timer_setup;
174 170
175#ifdef CONFIG_DS1603 171#ifdef CONFIG_DS1603
176 ds1603 = &ds_defs[mips_machtype]; 172 ds1603 = &ds_defs[mips_machtype];
diff --git a/arch/mips/mips-boards/atlas/atlas_int.c b/arch/mips/mips-boards/atlas/atlas_int.c
index 9dd6b8925581..fb25e0377f11 100644
--- a/arch/mips/mips-boards/atlas/atlas_int.c
+++ b/arch/mips/mips-boards/atlas/atlas_int.c
@@ -73,7 +73,7 @@ static void end_atlas_irq(unsigned int irq)
73 enable_atlas_irq(irq); 73 enable_atlas_irq(irq);
74} 74}
75 75
76static struct hw_interrupt_type atlas_irq_type = { 76static struct irq_chip atlas_irq_type = {
77 .typename = "Atlas", 77 .typename = "Atlas",
78 .startup = startup_atlas_irq, 78 .startup = startup_atlas_irq,
79 .shutdown = shutdown_atlas_irq, 79 .shutdown = shutdown_atlas_irq,
diff --git a/arch/mips/mips-boards/atlas/atlas_setup.c b/arch/mips/mips-boards/atlas/atlas_setup.c
index 3a7c3d28aa0d..9871a91fdb07 100644
--- a/arch/mips/mips-boards/atlas/atlas_setup.c
+++ b/arch/mips/mips-boards/atlas/atlas_setup.c
@@ -35,7 +35,6 @@
35 35
36extern void mips_reboot_setup(void); 36extern void mips_reboot_setup(void);
37extern void mips_time_init(void); 37extern void mips_time_init(void);
38extern void mips_timer_setup(struct irqaction *irq);
39extern unsigned long mips_rtc_get_time(void); 38extern unsigned long mips_rtc_get_time(void);
40 39
41#ifdef CONFIG_KGDB 40#ifdef CONFIG_KGDB
@@ -63,7 +62,6 @@ void __init plat_mem_setup(void)
63 mips_reboot_setup(); 62 mips_reboot_setup();
64 63
65 board_time_init = mips_time_init; 64 board_time_init = mips_time_init;
66 board_timer_setup = mips_timer_setup;
67 rtc_mips_get_time = mips_rtc_get_time; 65 rtc_mips_get_time = mips_rtc_get_time;
68} 66}
69 67
diff --git a/arch/mips/mips-boards/generic/memory.c b/arch/mips/mips-boards/generic/memory.c
index c89fcf9e9c22..be80c5dd4a0c 100644
--- a/arch/mips/mips-boards/generic/memory.c
+++ b/arch/mips/mips-boards/generic/memory.c
@@ -47,43 +47,45 @@ static char *mtypes[3] = {
47}; 47};
48#endif 48#endif
49 49
50/* determined physical memory size, not overridden by command line args */
51unsigned long physical_memsize = 0L;
52
50struct prom_pmemblock * __init prom_getmdesc(void) 53struct prom_pmemblock * __init prom_getmdesc(void)
51{ 54{
52 char *memsize_str; 55 char *memsize_str;
53 unsigned int memsize; 56 unsigned int memsize;
54 char cmdline[CL_SIZE], *ptr; 57 char cmdline[CL_SIZE], *ptr;
55 58
56 /* Check the command line first for a memsize directive */ 59 /* otherwise look in the environment */
57 strcpy(cmdline, arcs_cmdline); 60 memsize_str = prom_getenv("memsize");
58 ptr = strstr(cmdline, "memsize="); 61 if (!memsize_str) {
59 if (ptr && (ptr != cmdline) && (*(ptr - 1) != ' ')) 62 prom_printf("memsize not set in boot prom, set to default (32Mb)\n");
60 ptr = strstr(ptr, " memsize="); 63 physical_memsize = 0x02000000;
61 64 } else {
62 if (ptr) {
63 memsize = memparse(ptr + 8, &ptr);
64 }
65 else {
66 /* otherwise look in the environment */
67 memsize_str = prom_getenv("memsize");
68 if (!memsize_str) {
69 prom_printf("memsize not set in boot prom, set to default (32Mb)\n");
70 memsize = 0x02000000;
71 } else {
72#ifdef DEBUG 65#ifdef DEBUG
73 prom_printf("prom_memsize = %s\n", memsize_str); 66 prom_printf("prom_memsize = %s\n", memsize_str);
74#endif 67#endif
75 memsize = simple_strtol(memsize_str, NULL, 0); 68 physical_memsize = simple_strtol(memsize_str, NULL, 0);
76 }
77 } 69 }
78 70
79#ifdef CONFIG_CPU_BIG_ENDIAN 71#ifdef CONFIG_CPU_BIG_ENDIAN
80 /* 72 /* SOC-it swaps, or perhaps doesn't swap, when DMA'ing the last
81 * SOC-it swaps, or perhaps doesn't swap, when DMA'ing the last 73 word of physical memory */
82 * word of physical memory 74 physical_memsize -= PAGE_SIZE;
83 */
84 memsize -= PAGE_SIZE;
85#endif 75#endif
86 76
77 /* Check the command line for a memsize directive that overrides
78 the physical/default amount */
79 strcpy(cmdline, arcs_cmdline);
80 ptr = strstr(cmdline, "memsize=");
81 if (ptr && (ptr != cmdline) && (*(ptr - 1) != ' '))
82 ptr = strstr(ptr, " memsize=");
83
84 if (ptr)
85 memsize = memparse(ptr + 8, &ptr);
86 else
87 memsize = physical_memsize;
88
87 memset(mdesc, 0, sizeof(mdesc)); 89 memset(mdesc, 0, sizeof(mdesc));
88 90
89 mdesc[0].type = yamon_dontuse; 91 mdesc[0].type = yamon_dontuse;
diff --git a/arch/mips/mips-boards/generic/time.c b/arch/mips/mips-boards/generic/time.c
index 5e207760826b..557bf961f36a 100644
--- a/arch/mips/mips-boards/generic/time.c
+++ b/arch/mips/mips-boards/generic/time.c
@@ -228,9 +228,7 @@ unsigned long __init mips_rtc_get_time(void)
228 228
229void __init mips_time_init(void) 229void __init mips_time_init(void)
230{ 230{
231 unsigned int est_freq, flags; 231 unsigned int est_freq;
232
233 local_irq_save(flags);
234 232
235 /* Set Data mode - binary. */ 233 /* Set Data mode - binary. */
236 CMOS_WRITE(CMOS_READ(RTC_CONTROL) | RTC_DM_BINARY, RTC_CONTROL); 234 CMOS_WRITE(CMOS_READ(RTC_CONTROL) | RTC_DM_BINARY, RTC_CONTROL);
@@ -241,11 +239,9 @@ void __init mips_time_init(void)
241 (est_freq%1000000)*100/1000000); 239 (est_freq%1000000)*100/1000000);
242 240
243 cpu_khz = est_freq / 1000; 241 cpu_khz = est_freq / 1000;
244
245 local_irq_restore(flags);
246} 242}
247 243
248void __init mips_timer_setup(struct irqaction *irq) 244void __init plat_timer_setup(struct irqaction *irq)
249{ 245{
250 if (cpu_has_veic) { 246 if (cpu_has_veic) {
251 set_vi_handler (MSC01E_INT_CPUCTR, mips_timer_dispatch); 247 set_vi_handler (MSC01E_INT_CPUCTR, mips_timer_dispatch);
diff --git a/arch/mips/mips-boards/malta/malta_setup.c b/arch/mips/mips-boards/malta/malta_setup.c
index bc4ac6f01877..ab460f805bef 100644
--- a/arch/mips/mips-boards/malta/malta_setup.c
+++ b/arch/mips/mips-boards/malta/malta_setup.c
@@ -19,7 +19,7 @@
19#include <linux/sched.h> 19#include <linux/sched.h>
20#include <linux/ioport.h> 20#include <linux/ioport.h>
21#include <linux/pci.h> 21#include <linux/pci.h>
22#include <linux/tty.h> 22#include <linux/screen_info.h>
23 23
24#ifdef CONFIG_MTD 24#ifdef CONFIG_MTD
25#include <linux/mtd/partitions.h> 25#include <linux/mtd/partitions.h>
@@ -44,7 +44,6 @@
44 44
45extern void mips_reboot_setup(void); 45extern void mips_reboot_setup(void);
46extern void mips_time_init(void); 46extern void mips_time_init(void);
47extern void mips_timer_setup(struct irqaction *irq);
48extern unsigned long mips_rtc_get_time(void); 47extern unsigned long mips_rtc_get_time(void);
49 48
50#ifdef CONFIG_KGDB 49#ifdef CONFIG_KGDB
@@ -223,6 +222,5 @@ void __init plat_mem_setup(void)
223 mips_reboot_setup(); 222 mips_reboot_setup();
224 223
225 board_time_init = mips_time_init; 224 board_time_init = mips_time_init;
226 board_timer_setup = mips_timer_setup;
227 rtc_mips_get_time = mips_rtc_get_time; 225 rtc_mips_get_time = mips_rtc_get_time;
228} 226}
diff --git a/arch/mips/mips-boards/sead/sead_setup.c b/arch/mips/mips-boards/sead/sead_setup.c
index a856bd664879..a189dec7c7bc 100644
--- a/arch/mips/mips-boards/sead/sead_setup.c
+++ b/arch/mips/mips-boards/sead/sead_setup.c
@@ -35,7 +35,6 @@
35 35
36extern void mips_reboot_setup(void); 36extern void mips_reboot_setup(void);
37extern void mips_time_init(void); 37extern void mips_time_init(void);
38extern void mips_timer_setup(struct irqaction *irq);
39 38
40static void __init serial_init(void); 39static void __init serial_init(void);
41 40
@@ -51,7 +50,6 @@ void __init plat_mem_setup(void)
51 serial_init (); 50 serial_init ();
52 51
53 board_time_init = mips_time_init; 52 board_time_init = mips_time_init;
54 board_timer_setup = mips_timer_setup;
55 53
56 mips_reboot_setup(); 54 mips_reboot_setup();
57} 55}
diff --git a/arch/mips/mips-boards/sim/Makefile b/arch/mips/mips-boards/sim/Makefile
index 5b977de4ecff..a12e32aafde0 100644
--- a/arch/mips/mips-boards/sim/Makefile
+++ b/arch/mips/mips-boards/sim/Makefile
@@ -15,6 +15,5 @@
15# 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. 15# 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
16# 16#
17 17
18obj-y := sim_setup.o sim_mem.o sim_time.o sim_printf.o sim_int.o sim_irq.o \ 18obj-y := sim_setup.o sim_mem.o sim_time.o sim_printf.o sim_int.o sim_cmdline.o
19 sim_cmdline.o
20obj-$(CONFIG_SMP) += sim_smp.o 19obj-$(CONFIG_SMP) += sim_smp.o
diff --git a/arch/mips/mips-boards/sim/sim_IRQ.c b/arch/mips/mips-boards/sim/sim_IRQ.c
deleted file mode 100644
index ec549f3e2011..000000000000
--- a/arch/mips/mips-boards/sim/sim_IRQ.c
+++ /dev/null
@@ -1,147 +0,0 @@
1/*
2 * Carsten Langgaard, carstenl@mips.com
3 * Copyright (C) 1999, 2000 MIPS Technologies, Inc. All rights reserved.
4 *
5 * This program is free software; you can distribute it and/or modify it
6 * under the terms of the GNU General Public License (Version 2) as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
17 *
18 * Interrupt exception dispatch code.
19 */
20
21#include <asm/asm.h>
22#include <asm/mipsregs.h>
23#include <asm/regdef.h>
24#include <asm/stackframe.h>
25
26/* A lot of complication here is taken away because:
27 *
28 * 1) We handle one interrupt and return, sitting in a loop and moving across
29 * all the pending IRQ bits in the cause register is _NOT_ the answer, the
30 * common case is one pending IRQ so optimize in that direction.
31 *
32 * 2) We need not check against bits in the status register IRQ mask, that
33 * would make this routine slow as hell.
34 *
35 * 3) Linux only thinks in terms of all IRQs on or all IRQs off, nothing in
36 * between like BSD spl() brain-damage.
37 *
38 * Furthermore, the IRQs on the MIPS board look basically (barring software
39 * IRQs which we don't use at all and all external interrupt sources are
40 * combined together on hardware interrupt 0 (MIPS IRQ 2)) like:
41 *
42 * MIPS IRQ Source
43 * -------- ------
44 * 0 Software (ignored)
45 * 1 Software (ignored)
46 * 2 Combined hardware interrupt (hw0)
47 * 3 Hardware (ignored)
48 * 4 Hardware (ignored)
49 * 5 Hardware (ignored)
50 * 6 Hardware (ignored)
51 * 7 R4k timer (what we use)
52 *
53 * Note: On the SEAD board thing are a little bit different.
54 * Here IRQ 2 (hw0) is wired to the UART0 and IRQ 3 (hw1) is wired
55 * wired to UART1.
56 *
57 * We handle the IRQ according to _our_ priority which is:
58 *
59 * Highest ---- R4k Timer
60 * Lowest ---- Combined hardware interrupt
61 *
62 * then we just return, if multiple IRQs are pending then we will just take
63 * another exception, big deal.
64 */
65
66 .text
67 .set noreorder
68 .set noat
69 .align 5
70 NESTED(mipsIRQ, PT_SIZE, sp)
71 SAVE_ALL
72 CLI
73 .set at
74
75 mfc0 s0, CP0_CAUSE # get irq bits
76 mfc0 s1, CP0_STATUS # get irq mask
77 and s0, s1
78
79 /* First we check for r4k counter/timer IRQ. */
80 andi a0, s0, CAUSEF_IP7
81 beq a0, zero, 1f
82 andi a0, s0, CAUSEF_IP2 # delay slot, check hw0 interrupt
83
84 /* Wheee, a timer interrupt. */
85 move a0, sp
86 jal mips_timer_interrupt
87 nop
88
89 j ret_from_irq
90 nop
91
921:
93#if defined(CONFIG_MIPS_SEAD)
94 beq a0, zero, 1f
95 andi a0, s0, CAUSEF_IP3 # delay slot, check hw1 interrupt
96#else
97 beq a0, zero, 1f # delay slot, check hw3 interrupt
98 andi a0, s0, CAUSEF_IP5
99#endif
100
101 /* Wheee, combined hardware level zero interrupt. */
102#if defined(CONFIG_MIPS_ATLAS)
103 jal atlas_hw0_irqdispatch
104#elif defined(CONFIG_MIPS_MALTA)
105 jal malta_hw0_irqdispatch
106#elif defined(CONFIG_MIPS_SEAD)
107 jal sead_hw0_irqdispatch
108#else
109#error "MIPS board not supported\n"
110#endif
111 move a0, sp # delay slot
112
113 j ret_from_irq
114 nop # delay slot
115
1161:
117#if defined(CONFIG_MIPS_SEAD)
118 beq a0, zero, 1f
119 andi a0, s0, CAUSEF_IP5 # delay slot, check hw3 interrupt
120 jal sead_hw1_irqdispatch
121 move a0, sp # delay slot
122 j ret_from_irq
123 nop # delay slot
1241:
125#endif
126#if defined(CONFIG_MIPS_MALTA)
127 beq a0, zero, 1f # check hw3 (coreHI) interrupt
128 nop
129 jal corehi_irqdispatch
130 move a0, sp
131 j ret_from_irq
132 nop
1331:
134#endif
135 /*
136 * Here by mistake? This is possible, what can happen is that by the
137 * time we take the exception the IRQ pin goes low, so just leave if
138 * this is the case.
139 */
140 move a1,s0
141 PRINT("Got interrupt: c0_cause = %08x\n")
142 mfc0 a1, CP0_EPC
143 PRINT("c0_epc = %08x\n")
144
145 j ret_from_irq
146 nop
147 END(mipsIRQ)
diff --git a/arch/mips/mips-boards/sim/sim_irq.S b/arch/mips/mips-boards/sim/sim_irq.S
deleted file mode 100644
index b7444e74a6a1..000000000000
--- a/arch/mips/mips-boards/sim/sim_irq.S
+++ /dev/null
@@ -1,100 +0,0 @@
1/*
2 * Copyright (C) 1999, 2005 MIPS Technologies, Inc. All rights reserved.
3 *
4 * This program is free software; you can distribute it and/or modify it
5 * under the terms of the GNU General Public License (Version 2) as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
16 *
17 * Interrupt exception dispatch code.
18 *
19 */
20
21#include <asm/asm.h>
22#include <asm/mipsregs.h>
23#include <asm/regdef.h>
24#include <asm/stackframe.h>
25
26#include <asm/mips-boards/simint.h>
27
28
29 .text
30 .set noreorder
31 .set noat
32 .align 5
33 NESTED(simIRQ, PT_SIZE, sp)
34 SAVE_ALL
35 CLI
36 .set at
37
38 mfc0 s0, CP0_CAUSE # get irq bits
39 mfc0 s1, CP0_STATUS # get irq mask
40 andi s0, ST0_IM # CAUSE.CE may be non-zero!
41 and s0, s1
42
43#if defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64)
44 .set mips32
45 clz a0, s0
46 .set mips0
47 negu a0
48 addu a0, 31-CAUSEB_IP
49 bltz a0, spurious
50#else
51 beqz s0, spurious
52 li a0, 7
53
54 and t0, s0, 0xf000
55 sltiu t0, t0, 1
56 sll t0, 2
57 subu a0, t0
58 sll s0, t0
59
60 and t0, s0, 0xc000
61 sltiu t0, t0, 1
62 sll t0, 1
63 subu a0, t0
64 sll s0, t0
65
66 and t0, s0, 0x8000
67 sltiu t0, t0, 1
68 # sll t0, 0
69 subu a0, t0
70 # sll s0, t0
71#endif
72
73#ifdef CASCADE_IRQ
74 li a1, CASCADE_IRQ
75 bne a0, a1, 1f
76 addu a0, MIPSCPU_INT_BASE
77
78 jal CASCADE_DISPATCH
79 move a0, sp
80
81 j ret_from_irq
82 nop
831:
84#else
85 addu a0, MIPSCPU_INT_BASE
86#endif
87
88 jal do_IRQ
89 move a1, sp
90
91 j ret_from_irq
92 nop
93
94
95spurious:
96 jal spurious_interrupt
97 nop
98 j ret_from_irq
99 nop
100 END(simIRQ)
diff --git a/arch/mips/mips-boards/sim/sim_setup.c b/arch/mips/mips-boards/sim/sim_setup.c
index 3d4a785b565a..2659c1c3b78d 100644
--- a/arch/mips/mips-boards/sim/sim_setup.c
+++ b/arch/mips/mips-boards/sim/sim_setup.c
@@ -37,7 +37,6 @@
37 37
38 38
39extern void sim_time_init(void); 39extern void sim_time_init(void);
40extern void sim_timer_setup(struct irqaction *irq);
41static void __init serial_init(void); 40static void __init serial_init(void);
42unsigned int _isbonito = 0; 41unsigned int _isbonito = 0;
43 42
@@ -56,7 +55,6 @@ void __init plat_mem_setup(void)
56 serial_init(); 55 serial_init();
57 56
58 board_time_init = sim_time_init; 57 board_time_init = sim_time_init;
59 board_timer_setup = sim_timer_setup;
60 prom_printf("Linux started...\n"); 58 prom_printf("Linux started...\n");
61 59
62#ifdef CONFIG_MT_SMP 60#ifdef CONFIG_MT_SMP
diff --git a/arch/mips/mips-boards/sim/sim_time.c b/arch/mips/mips-boards/sim/sim_time.c
index e7f6003357f7..230929ecd57f 100644
--- a/arch/mips/mips-boards/sim/sim_time.c
+++ b/arch/mips/mips-boards/sim/sim_time.c
@@ -33,8 +33,6 @@
33 33
34unsigned long cpu_khz; 34unsigned long cpu_khz;
35 35
36extern asmlinkage void ll_local_timer_interrupt(int irq, struct pt_regs *regs);
37
38irqreturn_t sim_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) 36irqreturn_t sim_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
39{ 37{
40#ifdef CONFIG_SMP 38#ifdef CONFIG_SMP
@@ -185,7 +183,7 @@ static void mips_timer_dispatch (struct pt_regs *regs)
185} 183}
186 184
187 185
188void __init sim_timer_setup(struct irqaction *irq) 186void __init plat_timer_setup(struct irqaction *irq)
189{ 187{
190 if (cpu_has_veic) { 188 if (cpu_has_veic) {
191 set_vi_handler(MSC01E_INT_CPUCTR, mips_timer_dispatch); 189 set_vi_handler(MSC01E_INT_CPUCTR, mips_timer_dispatch);
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
index 857b726f4d41..069803f58f3b 100644
--- a/arch/mips/mm/c-r4k.c
+++ b/arch/mips/mm/c-r4k.c
@@ -578,7 +578,7 @@ static inline void local_r4k_flush_icache_page(void *args)
578 * secondary cache will result in any entries in the primary caches 578 * secondary cache will result in any entries in the primary caches
579 * also getting invalidated which hopefully is a bit more economical. 579 * also getting invalidated which hopefully is a bit more economical.
580 */ 580 */
581 if (cpu_has_subset_pcaches) { 581 if (cpu_has_inclusive_pcaches) {
582 unsigned long addr = (unsigned long) page_address(page); 582 unsigned long addr = (unsigned long) page_address(page);
583 583
584 r4k_blast_scache_page(addr); 584 r4k_blast_scache_page(addr);
@@ -634,7 +634,7 @@ static void r4k_dma_cache_wback_inv(unsigned long addr, unsigned long size)
634 /* Catch bad driver code */ 634 /* Catch bad driver code */
635 BUG_ON(size == 0); 635 BUG_ON(size == 0);
636 636
637 if (cpu_has_subset_pcaches) { 637 if (cpu_has_inclusive_pcaches) {
638 if (size >= scache_size) 638 if (size >= scache_size)
639 r4k_blast_scache(); 639 r4k_blast_scache();
640 else 640 else
@@ -662,7 +662,7 @@ static void r4k_dma_cache_inv(unsigned long addr, unsigned long size)
662 /* Catch bad driver code */ 662 /* Catch bad driver code */
663 BUG_ON(size == 0); 663 BUG_ON(size == 0);
664 664
665 if (cpu_has_subset_pcaches) { 665 if (cpu_has_inclusive_pcaches) {
666 if (size >= scache_size) 666 if (size >= scache_size)
667 r4k_blast_scache(); 667 r4k_blast_scache();
668 else 668 else
@@ -862,15 +862,18 @@ static void __init probe_pcache(void)
862 break; 862 break;
863 863
864 case CPU_VR4133: 864 case CPU_VR4133:
865 write_c0_config(config & ~CONF_EB); 865 write_c0_config(config & ~VR41_CONF_P4K);
866 case CPU_VR4131: 866 case CPU_VR4131:
867 /* Workaround for cache instruction bug of VR4131 */ 867 /* Workaround for cache instruction bug of VR4131 */
868 if (c->processor_id == 0x0c80U || c->processor_id == 0x0c81U || 868 if (c->processor_id == 0x0c80U || c->processor_id == 0x0c81U ||
869 c->processor_id == 0x0c82U) { 869 c->processor_id == 0x0c82U) {
870 config &= ~0x00000030U; 870 config |= 0x00400000U;
871 config |= 0x00410000U; 871 if (c->processor_id == 0x0c80U)
872 config |= VR41_CONF_BP;
872 write_c0_config(config); 873 write_c0_config(config);
873 } 874 } else
875 c->options |= MIPS_CPU_CACHE_CDEX_P;
876
874 icache_size = 1 << (10 + ((config & CONF_IC) >> 9)); 877 icache_size = 1 << (10 + ((config & CONF_IC) >> 9));
875 c->icache.linesz = 16 << ((config & CONF_IB) >> 5); 878 c->icache.linesz = 16 << ((config & CONF_IB) >> 5);
876 c->icache.ways = 2; 879 c->icache.ways = 2;
@@ -880,8 +883,6 @@ static void __init probe_pcache(void)
880 c->dcache.linesz = 16 << ((config & CONF_DB) >> 4); 883 c->dcache.linesz = 16 << ((config & CONF_DB) >> 4);
881 c->dcache.ways = 2; 884 c->dcache.ways = 2;
882 c->dcache.waybit = __ffs(dcache_size/2); 885 c->dcache.waybit = __ffs(dcache_size/2);
883
884 c->options |= MIPS_CPU_CACHE_CDEX_P;
885 break; 886 break;
886 887
887 case CPU_VR41XX: 888 case CPU_VR41XX:
@@ -1192,7 +1193,7 @@ static void __init setup_scache(void)
1192 printk("Unified secondary cache %ldkB %s, linesize %d bytes.\n", 1193 printk("Unified secondary cache %ldkB %s, linesize %d bytes.\n",
1193 scache_size >> 10, way_string[c->scache.ways], c->scache.linesz); 1194 scache_size >> 10, way_string[c->scache.ways], c->scache.linesz);
1194 1195
1195 c->options |= MIPS_CPU_SUBSET_CACHES; 1196 c->options |= MIPS_CPU_INCLUSIVE_CACHES;
1196} 1197}
1197 1198
1198void au1x00_fixup_config_od(void) 1199void au1x00_fixup_config_od(void)
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index 802bdd32aa2b..c52497bb102a 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -139,10 +139,36 @@ void __init fixrange_init(unsigned long start, unsigned long end,
139#ifndef CONFIG_NEED_MULTIPLE_NODES 139#ifndef CONFIG_NEED_MULTIPLE_NODES
140extern void pagetable_init(void); 140extern void pagetable_init(void);
141 141
142static int __init page_is_ram(unsigned long pagenr)
143{
144 int i;
145
146 for (i = 0; i < boot_mem_map.nr_map; i++) {
147 unsigned long addr, end;
148
149 if (boot_mem_map.map[i].type != BOOT_MEM_RAM)
150 /* not usable memory */
151 continue;
152
153 addr = PFN_UP(boot_mem_map.map[i].addr);
154 end = PFN_DOWN(boot_mem_map.map[i].addr +
155 boot_mem_map.map[i].size);
156
157 if (pagenr >= addr && pagenr < end)
158 return 1;
159 }
160
161 return 0;
162}
163
142void __init paging_init(void) 164void __init paging_init(void)
143{ 165{
144 unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0}; 166 unsigned long zones_size[] = { [0 ... MAX_NR_ZONES - 1] = 0 };
145 unsigned long max_dma, high, low; 167 unsigned long max_dma, high, low;
168#ifndef CONFIG_FLATMEM
169 unsigned long zholes_size[] = { [0 ... MAX_NR_ZONES - 1] = 0 };
170 unsigned long i, j, pfn;
171#endif
146 172
147 pagetable_init(); 173 pagetable_init();
148 174
@@ -174,29 +200,16 @@ void __init paging_init(void)
174 zones_size[ZONE_HIGHMEM] = high - low; 200 zones_size[ZONE_HIGHMEM] = high - low;
175#endif 201#endif
176 202
203#ifdef CONFIG_FLATMEM
177 free_area_init(zones_size); 204 free_area_init(zones_size);
178} 205#else
179 206 pfn = 0;
180static inline int page_is_ram(unsigned long pagenr) 207 for (i = 0; i < MAX_NR_ZONES; i++)
181{ 208 for (j = 0; j < zones_size[i]; j++, pfn++)
182 int i; 209 if (!page_is_ram(pfn))
183 210 zholes_size[i]++;
184 for (i = 0; i < boot_mem_map.nr_map; i++) { 211 free_area_init_node(0, NODE_DATA(0), zones_size, 0, zholes_size);
185 unsigned long addr, end; 212#endif
186
187 if (boot_mem_map.map[i].type != BOOT_MEM_RAM)
188 /* not usable memory */
189 continue;
190
191 addr = PFN_UP(boot_mem_map.map[i].addr);
192 end = PFN_DOWN(boot_mem_map.map[i].addr +
193 boot_mem_map.map[i].size);
194
195 if (pagenr >= addr && pagenr < end)
196 return 1;
197 }
198
199 return 0;
200} 213}
201 214
202static struct kcore_list kcore_mem, kcore_vmalloc; 215static struct kcore_list kcore_mem, kcore_vmalloc;
@@ -213,9 +226,9 @@ void __init mem_init(void)
213#ifdef CONFIG_DISCONTIGMEM 226#ifdef CONFIG_DISCONTIGMEM
214#error "CONFIG_HIGHMEM and CONFIG_DISCONTIGMEM dont work together yet" 227#error "CONFIG_HIGHMEM and CONFIG_DISCONTIGMEM dont work together yet"
215#endif 228#endif
216 max_mapnr = num_physpages = highend_pfn; 229 max_mapnr = highend_pfn;
217#else 230#else
218 max_mapnr = num_physpages = max_low_pfn; 231 max_mapnr = max_low_pfn;
219#endif 232#endif
220 high_memory = (void *) __va(max_low_pfn << PAGE_SHIFT); 233 high_memory = (void *) __va(max_low_pfn << PAGE_SHIFT);
221 234
@@ -229,6 +242,7 @@ void __init mem_init(void)
229 if (PageReserved(pfn_to_page(tmp))) 242 if (PageReserved(pfn_to_page(tmp)))
230 reservedpages++; 243 reservedpages++;
231 } 244 }
245 num_physpages = ram;
232 246
233#ifdef CONFIG_HIGHMEM 247#ifdef CONFIG_HIGHMEM
234 for (tmp = highstart_pfn; tmp < highend_pfn; tmp++) { 248 for (tmp = highstart_pfn; tmp < highend_pfn; tmp++) {
@@ -247,6 +261,7 @@ void __init mem_init(void)
247 totalhigh_pages++; 261 totalhigh_pages++;
248 } 262 }
249 totalram_pages += totalhigh_pages; 263 totalram_pages += totalhigh_pages;
264 num_physpages += totalhigh_pages;
250#endif 265#endif
251 266
252 codesize = (unsigned long) &_etext - (unsigned long) &_text; 267 codesize = (unsigned long) &_etext - (unsigned long) &_text;
diff --git a/arch/mips/mm/pgtable.c b/arch/mips/mm/pgtable.c
index 792c6eb44232..c93aa6cbcaca 100644
--- a/arch/mips/mm/pgtable.c
+++ b/arch/mips/mm/pgtable.c
@@ -15,6 +15,8 @@ void show_mem(void)
15 printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); 15 printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
16 pfn = max_mapnr; 16 pfn = max_mapnr;
17 while (pfn-- > 0) { 17 while (pfn-- > 0) {
18 if (!pfn_valid(pfn))
19 continue;
18 page = pfn_to_page(pfn); 20 page = pfn_to_page(pfn);
19 total++; 21 total++;
20 if (PageHighMem(page)) 22 if (PageHighMem(page))
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index e1a8139fc8fb..375e0991505d 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -5,7 +5,7 @@
5 * 5 *
6 * Synthesize TLB refill handlers at runtime. 6 * Synthesize TLB refill handlers at runtime.
7 * 7 *
8 * Copyright (C) 2004,2005 by Thiemo Seufer 8 * Copyright (C) 2004,2005,2006 by Thiemo Seufer
9 * Copyright (C) 2005 Maciej W. Rozycki 9 * Copyright (C) 2005 Maciej W. Rozycki
10 * Copyright (C) 2006 Ralf Baechle (ralf@linux-mips.org) 10 * Copyright (C) 2006 Ralf Baechle (ralf@linux-mips.org)
11 * 11 *
@@ -35,8 +35,6 @@
35#include <asm/smp.h> 35#include <asm/smp.h>
36#include <asm/war.h> 36#include <asm/war.h>
37 37
38/* #define DEBUG_TLB */
39
40static __init int __attribute__((unused)) r45k_bvahwbug(void) 38static __init int __attribute__((unused)) r45k_bvahwbug(void)
41{ 39{
42 /* XXX: We should probe for the presence of this bug, but we don't. */ 40 /* XXX: We should probe for the presence of this bug, but we don't. */
@@ -728,6 +726,7 @@ static void __init build_r3000_tlb_refill_handler(void)
728{ 726{
729 long pgdc = (long)pgd_current; 727 long pgdc = (long)pgd_current;
730 u32 *p; 728 u32 *p;
729 int i;
731 730
732 memset(tlb_handler, 0, sizeof(tlb_handler)); 731 memset(tlb_handler, 0, sizeof(tlb_handler));
733 p = tlb_handler; 732 p = tlb_handler;
@@ -753,16 +752,14 @@ static void __init build_r3000_tlb_refill_handler(void)
753 if (p > tlb_handler + 32) 752 if (p > tlb_handler + 32)
754 panic("TLB refill handler space exceeded"); 753 panic("TLB refill handler space exceeded");
755 754
756 printk("Synthesized TLB refill handler (%u instructions).\n", 755 pr_info("Synthesized TLB refill handler (%u instructions).\n",
757 (unsigned int)(p - tlb_handler)); 756 (unsigned int)(p - tlb_handler));
758#ifdef DEBUG_TLB
759 {
760 int i;
761 757
762 for (i = 0; i < (p - tlb_handler); i++) 758 pr_debug("\t.set push\n");
763 printk("%08x\n", tlb_handler[i]); 759 pr_debug("\t.set noreorder\n");
764 } 760 for (i = 0; i < (p - tlb_handler); i++)
765#endif 761 pr_debug("\t.word 0x%08x\n", tlb_handler[i]);
762 pr_debug("\t.set pop\n");
766 763
767 memcpy((void *)ebase, tlb_handler, 0x80); 764 memcpy((void *)ebase, tlb_handler, 0x80);
768} 765}
@@ -1175,6 +1172,7 @@ static void __init build_r4000_tlb_refill_handler(void)
1175 struct reloc *r = relocs; 1172 struct reloc *r = relocs;
1176 u32 *f; 1173 u32 *f;
1177 unsigned int final_len; 1174 unsigned int final_len;
1175 int i;
1178 1176
1179 memset(tlb_handler, 0, sizeof(tlb_handler)); 1177 memset(tlb_handler, 0, sizeof(tlb_handler));
1180 memset(labels, 0, sizeof(labels)); 1178 memset(labels, 0, sizeof(labels));
@@ -1272,24 +1270,21 @@ static void __init build_r4000_tlb_refill_handler(void)
1272#endif /* CONFIG_64BIT */ 1270#endif /* CONFIG_64BIT */
1273 1271
1274 resolve_relocs(relocs, labels); 1272 resolve_relocs(relocs, labels);
1275 printk("Synthesized TLB refill handler (%u instructions).\n", 1273 pr_info("Synthesized TLB refill handler (%u instructions).\n",
1276 final_len); 1274 final_len);
1277
1278#ifdef DEBUG_TLB
1279 {
1280 int i;
1281 1275
1282 f = final_handler; 1276 f = final_handler;
1283#ifdef CONFIG_64BIT 1277#ifdef CONFIG_64BIT
1284 if (final_len > 32) 1278 if (final_len > 32)
1285 final_len = 64; 1279 final_len = 64;
1286 else 1280 else
1287 f = final_handler + 32; 1281 f = final_handler + 32;
1288#endif /* CONFIG_64BIT */ 1282#endif /* CONFIG_64BIT */
1289 for (i = 0; i < final_len; i++) 1283 pr_debug("\t.set push\n");
1290 printk("%08x\n", f[i]); 1284 pr_debug("\t.set noreorder\n");
1291 } 1285 for (i = 0; i < final_len; i++)
1292#endif 1286 pr_debug("\t.word 0x%08x\n", f[i]);
1287 pr_debug("\t.set pop\n");
1293 1288
1294 memcpy((void *)ebase, final_handler, 0x100); 1289 memcpy((void *)ebase, final_handler, 0x100);
1295} 1290}
@@ -1522,6 +1517,7 @@ static void __init build_r3000_tlb_load_handler(void)
1522 u32 *p = handle_tlbl; 1517 u32 *p = handle_tlbl;
1523 struct label *l = labels; 1518 struct label *l = labels;
1524 struct reloc *r = relocs; 1519 struct reloc *r = relocs;
1520 int i;
1525 1521
1526 memset(handle_tlbl, 0, sizeof(handle_tlbl)); 1522 memset(handle_tlbl, 0, sizeof(handle_tlbl));
1527 memset(labels, 0, sizeof(labels)); 1523 memset(labels, 0, sizeof(labels));
@@ -1541,17 +1537,14 @@ static void __init build_r3000_tlb_load_handler(void)
1541 panic("TLB load handler fastpath space exceeded"); 1537 panic("TLB load handler fastpath space exceeded");
1542 1538
1543 resolve_relocs(relocs, labels); 1539 resolve_relocs(relocs, labels);
1544 printk("Synthesized TLB load handler fastpath (%u instructions).\n", 1540 pr_info("Synthesized TLB load handler fastpath (%u instructions).\n",
1545 (unsigned int)(p - handle_tlbl)); 1541 (unsigned int)(p - handle_tlbl));
1546
1547#ifdef DEBUG_TLB
1548 {
1549 int i;
1550 1542
1551 for (i = 0; i < (p - handle_tlbl); i++) 1543 pr_debug("\t.set push\n");
1552 printk("%08x\n", handle_tlbl[i]); 1544 pr_debug("\t.set noreorder\n");
1553 } 1545 for (i = 0; i < (p - handle_tlbl); i++)
1554#endif 1546 pr_debug("\t.word 0x%08x\n", handle_tlbl[i]);
1547 pr_debug("\t.set pop\n");
1555} 1548}
1556 1549
1557static void __init build_r3000_tlb_store_handler(void) 1550static void __init build_r3000_tlb_store_handler(void)
@@ -1559,6 +1552,7 @@ static void __init build_r3000_tlb_store_handler(void)
1559 u32 *p = handle_tlbs; 1552 u32 *p = handle_tlbs;
1560 struct label *l = labels; 1553 struct label *l = labels;
1561 struct reloc *r = relocs; 1554 struct reloc *r = relocs;
1555 int i;
1562 1556
1563 memset(handle_tlbs, 0, sizeof(handle_tlbs)); 1557 memset(handle_tlbs, 0, sizeof(handle_tlbs));
1564 memset(labels, 0, sizeof(labels)); 1558 memset(labels, 0, sizeof(labels));
@@ -1578,17 +1572,14 @@ static void __init build_r3000_tlb_store_handler(void)
1578 panic("TLB store handler fastpath space exceeded"); 1572 panic("TLB store handler fastpath space exceeded");
1579 1573
1580 resolve_relocs(relocs, labels); 1574 resolve_relocs(relocs, labels);
1581 printk("Synthesized TLB store handler fastpath (%u instructions).\n", 1575 pr_info("Synthesized TLB store handler fastpath (%u instructions).\n",
1582 (unsigned int)(p - handle_tlbs)); 1576 (unsigned int)(p - handle_tlbs));
1583 1577
1584#ifdef DEBUG_TLB 1578 pr_debug("\t.set push\n");
1585 { 1579 pr_debug("\t.set noreorder\n");
1586 int i; 1580 for (i = 0; i < (p - handle_tlbs); i++)
1587 1581 pr_debug("\t.word 0x%08x\n", handle_tlbs[i]);
1588 for (i = 0; i < (p - handle_tlbs); i++) 1582 pr_debug("\t.set pop\n");
1589 printk("%08x\n", handle_tlbs[i]);
1590 }
1591#endif
1592} 1583}
1593 1584
1594static void __init build_r3000_tlb_modify_handler(void) 1585static void __init build_r3000_tlb_modify_handler(void)
@@ -1596,6 +1587,7 @@ static void __init build_r3000_tlb_modify_handler(void)
1596 u32 *p = handle_tlbm; 1587 u32 *p = handle_tlbm;
1597 struct label *l = labels; 1588 struct label *l = labels;
1598 struct reloc *r = relocs; 1589 struct reloc *r = relocs;
1590 int i;
1599 1591
1600 memset(handle_tlbm, 0, sizeof(handle_tlbm)); 1592 memset(handle_tlbm, 0, sizeof(handle_tlbm));
1601 memset(labels, 0, sizeof(labels)); 1593 memset(labels, 0, sizeof(labels));
@@ -1615,17 +1607,14 @@ static void __init build_r3000_tlb_modify_handler(void)
1615 panic("TLB modify handler fastpath space exceeded"); 1607 panic("TLB modify handler fastpath space exceeded");
1616 1608
1617 resolve_relocs(relocs, labels); 1609 resolve_relocs(relocs, labels);
1618 printk("Synthesized TLB modify handler fastpath (%u instructions).\n", 1610 pr_info("Synthesized TLB modify handler fastpath (%u instructions).\n",
1619 (unsigned int)(p - handle_tlbm)); 1611 (unsigned int)(p - handle_tlbm));
1620 1612
1621#ifdef DEBUG_TLB 1613 pr_debug("\t.set push\n");
1622 { 1614 pr_debug("\t.set noreorder\n");
1623 int i; 1615 for (i = 0; i < (p - handle_tlbm); i++)
1624 1616 pr_debug("\t.word 0x%08x\n", handle_tlbm[i]);
1625 for (i = 0; i < (p - handle_tlbm); i++) 1617 pr_debug("\t.set pop\n");
1626 printk("%08x\n", handle_tlbm[i]);
1627 }
1628#endif
1629} 1618}
1630 1619
1631/* 1620/*
@@ -1677,6 +1666,7 @@ static void __init build_r4000_tlb_load_handler(void)
1677 u32 *p = handle_tlbl; 1666 u32 *p = handle_tlbl;
1678 struct label *l = labels; 1667 struct label *l = labels;
1679 struct reloc *r = relocs; 1668 struct reloc *r = relocs;
1669 int i;
1680 1670
1681 memset(handle_tlbl, 0, sizeof(handle_tlbl)); 1671 memset(handle_tlbl, 0, sizeof(handle_tlbl));
1682 memset(labels, 0, sizeof(labels)); 1672 memset(labels, 0, sizeof(labels));
@@ -1704,17 +1694,14 @@ static void __init build_r4000_tlb_load_handler(void)
1704 panic("TLB load handler fastpath space exceeded"); 1694 panic("TLB load handler fastpath space exceeded");
1705 1695
1706 resolve_relocs(relocs, labels); 1696 resolve_relocs(relocs, labels);
1707 printk("Synthesized TLB load handler fastpath (%u instructions).\n", 1697 pr_info("Synthesized TLB load handler fastpath (%u instructions).\n",
1708 (unsigned int)(p - handle_tlbl)); 1698 (unsigned int)(p - handle_tlbl));
1709
1710#ifdef DEBUG_TLB
1711 {
1712 int i;
1713 1699
1714 for (i = 0; i < (p - handle_tlbl); i++) 1700 pr_debug("\t.set push\n");
1715 printk("%08x\n", handle_tlbl[i]); 1701 pr_debug("\t.set noreorder\n");
1716 } 1702 for (i = 0; i < (p - handle_tlbl); i++)
1717#endif 1703 pr_debug("\t.word 0x%08x\n", handle_tlbl[i]);
1704 pr_debug("\t.set pop\n");
1718} 1705}
1719 1706
1720static void __init build_r4000_tlb_store_handler(void) 1707static void __init build_r4000_tlb_store_handler(void)
@@ -1722,6 +1709,7 @@ static void __init build_r4000_tlb_store_handler(void)
1722 u32 *p = handle_tlbs; 1709 u32 *p = handle_tlbs;
1723 struct label *l = labels; 1710 struct label *l = labels;
1724 struct reloc *r = relocs; 1711 struct reloc *r = relocs;
1712 int i;
1725 1713
1726 memset(handle_tlbs, 0, sizeof(handle_tlbs)); 1714 memset(handle_tlbs, 0, sizeof(handle_tlbs));
1727 memset(labels, 0, sizeof(labels)); 1715 memset(labels, 0, sizeof(labels));
@@ -1740,17 +1728,14 @@ static void __init build_r4000_tlb_store_handler(void)
1740 panic("TLB store handler fastpath space exceeded"); 1728 panic("TLB store handler fastpath space exceeded");
1741 1729
1742 resolve_relocs(relocs, labels); 1730 resolve_relocs(relocs, labels);
1743 printk("Synthesized TLB store handler fastpath (%u instructions).\n", 1731 pr_info("Synthesized TLB store handler fastpath (%u instructions).\n",
1744 (unsigned int)(p - handle_tlbs)); 1732 (unsigned int)(p - handle_tlbs));
1745
1746#ifdef DEBUG_TLB
1747 {
1748 int i;
1749 1733
1750 for (i = 0; i < (p - handle_tlbs); i++) 1734 pr_debug("\t.set push\n");
1751 printk("%08x\n", handle_tlbs[i]); 1735 pr_debug("\t.set noreorder\n");
1752 } 1736 for (i = 0; i < (p - handle_tlbs); i++)
1753#endif 1737 pr_debug("\t.word 0x%08x\n", handle_tlbs[i]);
1738 pr_debug("\t.set pop\n");
1754} 1739}
1755 1740
1756static void __init build_r4000_tlb_modify_handler(void) 1741static void __init build_r4000_tlb_modify_handler(void)
@@ -1758,6 +1743,7 @@ static void __init build_r4000_tlb_modify_handler(void)
1758 u32 *p = handle_tlbm; 1743 u32 *p = handle_tlbm;
1759 struct label *l = labels; 1744 struct label *l = labels;
1760 struct reloc *r = relocs; 1745 struct reloc *r = relocs;
1746 int i;
1761 1747
1762 memset(handle_tlbm, 0, sizeof(handle_tlbm)); 1748 memset(handle_tlbm, 0, sizeof(handle_tlbm));
1763 memset(labels, 0, sizeof(labels)); 1749 memset(labels, 0, sizeof(labels));
@@ -1777,17 +1763,14 @@ static void __init build_r4000_tlb_modify_handler(void)
1777 panic("TLB modify handler fastpath space exceeded"); 1763 panic("TLB modify handler fastpath space exceeded");
1778 1764
1779 resolve_relocs(relocs, labels); 1765 resolve_relocs(relocs, labels);
1780 printk("Synthesized TLB modify handler fastpath (%u instructions).\n", 1766 pr_info("Synthesized TLB modify handler fastpath (%u instructions).\n",
1781 (unsigned int)(p - handle_tlbm)); 1767 (unsigned int)(p - handle_tlbm));
1782 1768
1783#ifdef DEBUG_TLB 1769 pr_debug("\t.set push\n");
1784 { 1770 pr_debug("\t.set noreorder\n");
1785 int i; 1771 for (i = 0; i < (p - handle_tlbm); i++)
1786 1772 pr_debug("\t.word 0x%08x\n", handle_tlbm[i]);
1787 for (i = 0; i < (p - handle_tlbm); i++) 1773 pr_debug("\t.set pop\n");
1788 printk("%08x\n", handle_tlbm[i]);
1789 }
1790#endif
1791} 1774}
1792 1775
1793void __init build_tlb_refill_handler(void) 1776void __init build_tlb_refill_handler(void)
diff --git a/arch/mips/momentum/jaguar_atx/setup.c b/arch/mips/momentum/jaguar_atx/setup.c
index b08e6a0456c1..e6fe2992227d 100644
--- a/arch/mips/momentum/jaguar_atx/setup.c
+++ b/arch/mips/momentum/jaguar_atx/setup.c
@@ -212,7 +212,7 @@ int m48t37y_set_time(unsigned long sec)
212 return 0; 212 return 0;
213} 213}
214 214
215void momenco_timer_setup(struct irqaction *irq) 215void __init plat_timer_setup(struct irqaction *irq)
216{ 216{
217 setup_irq(8, irq); 217 setup_irq(8, irq);
218} 218}
@@ -226,7 +226,6 @@ void momenco_time_init(void)
226 wire_stupidity_into_tlb(); 226 wire_stupidity_into_tlb();
227 227
228 mips_hpt_frequency = cpu_clock / 2; 228 mips_hpt_frequency = cpu_clock / 2;
229 board_timer_setup = momenco_timer_setup;
230 229
231 rtc_mips_get_time = m48t37y_get_time; 230 rtc_mips_get_time = m48t37y_get_time;
232 rtc_mips_set_time = m48t37y_set_time; 231 rtc_mips_set_time = m48t37y_set_time;
diff --git a/arch/mips/momentum/ocelot_3/setup.c b/arch/mips/momentum/ocelot_3/setup.c
index 8c53490ba6f1..435d0787329e 100644
--- a/arch/mips/momentum/ocelot_3/setup.c
+++ b/arch/mips/momentum/ocelot_3/setup.c
@@ -197,7 +197,7 @@ int m48t37y_set_time(unsigned long sec)
197 return 0; 197 return 0;
198} 198}
199 199
200void momenco_timer_setup(struct irqaction *irq) 200void __init plat_timer_setup(struct irqaction *irq)
201{ 201{
202 setup_irq(7, irq); /* Timer interrupt, unmask status IM7 */ 202 setup_irq(7, irq); /* Timer interrupt, unmask status IM7 */
203} 203}
@@ -211,7 +211,6 @@ void momenco_time_init(void)
211 * the Rm7900 and the Rm7065C 211 * the Rm7900 and the Rm7065C
212 */ 212 */
213 mips_hpt_frequency = cpu_clock / 2; 213 mips_hpt_frequency = cpu_clock / 2;
214 board_timer_setup = momenco_timer_setup;
215 214
216 rtc_mips_get_time = m48t37y_get_time; 215 rtc_mips_get_time = m48t37y_get_time;
217 rtc_mips_set_time = m48t37y_set_time; 216 rtc_mips_set_time = m48t37y_set_time;
diff --git a/arch/mips/momentum/ocelot_c/cpci-irq.c b/arch/mips/momentum/ocelot_c/cpci-irq.c
index 31d179c4673f..a5dc230520df 100644
--- a/arch/mips/momentum/ocelot_c/cpci-irq.c
+++ b/arch/mips/momentum/ocelot_c/cpci-irq.c
@@ -128,7 +128,7 @@ void ll_cpci_irq(struct pt_regs *regs)
128 128
129#define shutdown_cpci_irq disable_cpci_irq 129#define shutdown_cpci_irq disable_cpci_irq
130 130
131struct hw_interrupt_type cpci_irq_type = { 131struct irq_chip cpci_irq_type = {
132 .typename = "CPCI/FPGA", 132 .typename = "CPCI/FPGA",
133 .startup = startup_cpci_irq, 133 .startup = startup_cpci_irq,
134 .shutdown = shutdown_cpci_irq, 134 .shutdown = shutdown_cpci_irq,
diff --git a/arch/mips/momentum/ocelot_c/setup.c b/arch/mips/momentum/ocelot_c/setup.c
index 6a4519936ee9..36f570ecc6fb 100644
--- a/arch/mips/momentum/ocelot_c/setup.c
+++ b/arch/mips/momentum/ocelot_c/setup.c
@@ -209,7 +209,7 @@ int m48t37y_set_time(unsigned long sec)
209 return 0; 209 return 0;
210} 210}
211 211
212void momenco_timer_setup(struct irqaction *irq) 212void __init plat_timer_setup(struct irqaction *irq)
213{ 213{
214 setup_irq(7, irq); 214 setup_irq(7, irq);
215} 215}
@@ -224,7 +224,6 @@ void momenco_time_init(void)
224#error Unknown CPU for this board 224#error Unknown CPU for this board
225#endif 225#endif
226 printk("momenco_time_init cpu_clock=%d\n", cpu_clock); 226 printk("momenco_time_init cpu_clock=%d\n", cpu_clock);
227 board_timer_setup = momenco_timer_setup;
228 227
229 rtc_mips_get_time = m48t37y_get_time; 228 rtc_mips_get_time = m48t37y_get_time;
230 rtc_mips_set_time = m48t37y_set_time; 229 rtc_mips_set_time = m48t37y_set_time;
diff --git a/arch/mips/momentum/ocelot_c/uart-irq.c b/arch/mips/momentum/ocelot_c/uart-irq.c
index 852265026fd1..9f33d8f1d826 100644
--- a/arch/mips/momentum/ocelot_c/uart-irq.c
+++ b/arch/mips/momentum/ocelot_c/uart-irq.c
@@ -121,7 +121,7 @@ void ll_uart_irq(struct pt_regs *regs)
121 121
122#define shutdown_uart_irq disable_uart_irq 122#define shutdown_uart_irq disable_uart_irq
123 123
124struct hw_interrupt_type uart_irq_type = { 124struct irq_chip uart_irq_type = {
125 .typename = "UART/FPGA", 125 .typename = "UART/FPGA",
126 .startup = startup_uart_irq, 126 .startup = startup_uart_irq,
127 .shutdown = shutdown_uart_irq, 127 .shutdown = shutdown_uart_irq,
diff --git a/arch/mips/oprofile/op_model_mipsxx.c b/arch/mips/oprofile/op_model_mipsxx.c
index a09c5f901233..a175d673540f 100644
--- a/arch/mips/oprofile/op_model_mipsxx.c
+++ b/arch/mips/oprofile/op_model_mipsxx.c
@@ -49,6 +49,7 @@ static inline unsigned int r_c0_ ## r ## n(void) \
49 default: \ 49 default: \
50 BUG(); \ 50 BUG(); \
51 } \ 51 } \
52 return 0; \
52} \ 53} \
53 \ 54 \
54static inline void w_c0_ ## r ## n(unsigned int value) \ 55static inline void w_c0_ ## r ## n(unsigned int value) \
@@ -65,6 +66,7 @@ static inline void w_c0_ ## r ## n(unsigned int value) \
65 default: \ 66 default: \
66 BUG(); \ 67 BUG(); \
67 } \ 68 } \
69 return; \
68} \ 70} \
69 71
70__define_perf_accessors(perfcntr, 0, 2) 72__define_perf_accessors(perfcntr, 0, 2)
diff --git a/arch/mips/pci/fixup-emma2rh.c b/arch/mips/pci/fixup-emma2rh.c
index 3a34cd0efd6b..7abcfd175d43 100644
--- a/arch/mips/pci/fixup-emma2rh.c
+++ b/arch/mips/pci/fixup-emma2rh.c
@@ -23,7 +23,6 @@
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 */ 24 */
25 25
26#include <linux/config.h>
27#include <linux/kernel.h> 26#include <linux/kernel.h>
28#include <linux/init.h> 27#include <linux/init.h>
29#include <linux/types.h> 28#include <linux/types.h>
diff --git a/arch/mips/pci/fixup-mpc30x.c b/arch/mips/pci/fixup-mpc30x.c
index b67ddaa47122..3c9ae41f7517 100644
--- a/arch/mips/pci/fixup-mpc30x.c
+++ b/arch/mips/pci/fixup-mpc30x.c
@@ -21,7 +21,6 @@
21#include <linux/pci.h> 21#include <linux/pci.h>
22 22
23#include <asm/vr41xx/mpc30x.h> 23#include <asm/vr41xx/mpc30x.h>
24#include <asm/vr41xx/vrc4173.h>
25 24
26static const int internal_func_irqs[] __initdata = { 25static const int internal_func_irqs[] __initdata = {
27 VRC4173_CASCADE_IRQ, 26 VRC4173_CASCADE_IRQ,
diff --git a/arch/mips/pci/ops-emma2rh.c b/arch/mips/pci/ops-emma2rh.c
index e21b11bf66bc..38f181625e10 100644
--- a/arch/mips/pci/ops-emma2rh.c
+++ b/arch/mips/pci/ops-emma2rh.c
@@ -23,7 +23,6 @@
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 */ 24 */
25 25
26#include <linux/config.h>
27#include <linux/pci.h> 26#include <linux/pci.h>
28#include <linux/kernel.h> 27#include <linux/kernel.h>
29#include <linux/types.h> 28#include <linux/types.h>
diff --git a/arch/mips/pci/pci-emma2rh.c b/arch/mips/pci/pci-emma2rh.c
index 0f8b230057d3..d99591a0cdfe 100644
--- a/arch/mips/pci/pci-emma2rh.c
+++ b/arch/mips/pci/pci-emma2rh.c
@@ -23,7 +23,6 @@
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 */ 24 */
25 25
26#include <linux/config.h>
27#include <linux/kernel.h> 26#include <linux/kernel.h>
28#include <linux/init.h> 27#include <linux/init.h>
29#include <linux/types.h> 28#include <linux/types.h>
diff --git a/arch/mips/philips/pnx8550/common/int.c b/arch/mips/philips/pnx8550/common/int.c
index 8aca317d4624..099679a9dfb9 100644
--- a/arch/mips/philips/pnx8550/common/int.c
+++ b/arch/mips/philips/pnx8550/common/int.c
@@ -207,7 +207,7 @@ static void end_irq(unsigned int irq)
207 } 207 }
208} 208}
209 209
210static struct hw_interrupt_type level_irq_type = { 210static struct irq_chip level_irq_type = {
211 .typename = "PNX Level IRQ", 211 .typename = "PNX Level IRQ",
212 .startup = startup_irq, 212 .startup = startup_irq,
213 .shutdown = shutdown_irq, 213 .shutdown = shutdown_irq,
diff --git a/arch/mips/philips/pnx8550/common/setup.c b/arch/mips/philips/pnx8550/common/setup.c
index 8ac81a9dc293..36b0c8bc6c06 100644
--- a/arch/mips/philips/pnx8550/common/setup.c
+++ b/arch/mips/philips/pnx8550/common/setup.c
@@ -20,6 +20,7 @@
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/sched.h> 21#include <linux/sched.h>
22#include <linux/ioport.h> 22#include <linux/ioport.h>
23#include <linux/irq.h>
23#include <linux/mm.h> 24#include <linux/mm.h>
24#include <linux/delay.h> 25#include <linux/delay.h>
25#include <linux/interrupt.h> 26#include <linux/interrupt.h>
@@ -48,10 +49,7 @@ extern void pnx8550_machine_halt(void);
48extern void pnx8550_machine_power_off(void); 49extern void pnx8550_machine_power_off(void);
49extern struct resource ioport_resource; 50extern struct resource ioport_resource;
50extern struct resource iomem_resource; 51extern struct resource iomem_resource;
51extern void (*board_time_init)(void);
52extern void pnx8550_time_init(void); 52extern void pnx8550_time_init(void);
53extern void (*board_timer_setup)(struct irqaction *irq);
54extern void pnx8550_timer_setup(struct irqaction *irq);
55extern void rs_kgdb_hook(int tty_no); 53extern void rs_kgdb_hook(int tty_no);
56extern void prom_printf(char *fmt, ...); 54extern void prom_printf(char *fmt, ...);
57extern char *prom_getcmdline(void); 55extern char *prom_getcmdline(void);
@@ -110,7 +108,6 @@ void __init plat_mem_setup(void)
110 pm_power_off = pnx8550_machine_power_off; 108 pm_power_off = pnx8550_machine_power_off;
111 109
112 board_time_init = pnx8550_time_init; 110 board_time_init = pnx8550_time_init;
113 board_timer_setup = pnx8550_timer_setup;
114 111
115 /* Clear the Global 2 Register, PCI Inta Output Enable Registers 112 /* Clear the Global 2 Register, PCI Inta Output Enable Registers
116 Bit 1:Enable DAC Powerdown 113 Bit 1:Enable DAC Powerdown
diff --git a/arch/mips/philips/pnx8550/common/time.c b/arch/mips/philips/pnx8550/common/time.c
index 70664ea96b92..0af655b1f330 100644
--- a/arch/mips/philips/pnx8550/common/time.c
+++ b/arch/mips/philips/pnx8550/common/time.c
@@ -70,16 +70,7 @@ void pnx8550_time_init(void)
70 mips_hpt_frequency = 27UL * ((1000000UL * n)/(m * pow2p)); 70 mips_hpt_frequency = 27UL * ((1000000UL * n)/(m * pow2p));
71} 71}
72 72
73/* 73void __init plat_timer_setup(struct irqaction *irq)
74 * pnx8550_timer_setup() - it does the following things:
75 *
76 * 5) board_timer_setup() -
77 * a) (optional) over-write any choices made above by time_init().
78 * b) machine specific code should setup the timer irqaction.
79 * c) enable the timer interrupt
80 */
81
82void __init pnx8550_timer_setup(struct irqaction *irq)
83{ 74{
84 int configPR; 75 int configPR;
85 76
diff --git a/arch/mips/pmc-sierra/yosemite/setup.c b/arch/mips/pmc-sierra/yosemite/setup.c
index aa0d6ff3c6ec..0a6ee8e5eec2 100644
--- a/arch/mips/pmc-sierra/yosemite/setup.c
+++ b/arch/mips/pmc-sierra/yosemite/setup.c
@@ -133,14 +133,13 @@ int m48t37y_set_time(unsigned long sec)
133 return 0; 133 return 0;
134} 134}
135 135
136void yosemite_timer_setup(struct irqaction *irq) 136void __init plat_timer_setup(struct irqaction *irq)
137{ 137{
138 setup_irq(7, irq); 138 setup_irq(7, irq);
139} 139}
140 140
141void yosemite_time_init(void) 141void yosemite_time_init(void)
142{ 142{
143 board_timer_setup = yosemite_timer_setup;
144 mips_hpt_frequency = cpu_clock / 2; 143 mips_hpt_frequency = cpu_clock / 2;
145mips_hpt_frequency = 33000000 * 3 * 5; 144mips_hpt_frequency = 33000000 * 3 * 5;
146} 145}
diff --git a/arch/mips/qemu/q-reset.c b/arch/mips/qemu/q-reset.c
index c04ebcfc7843..dbbe44ad7e89 100644
--- a/arch/mips/qemu/q-reset.c
+++ b/arch/mips/qemu/q-reset.c
@@ -1,4 +1,3 @@
1#include <linux/config.h>
2 1
3#include <asm/io.h> 2#include <asm/io.h>
4#include <asm/reboot.h> 3#include <asm/reboot.h>
diff --git a/arch/mips/qemu/q-setup.c b/arch/mips/qemu/q-setup.c
index e100d6072e31..841394336f00 100644
--- a/arch/mips/qemu/q-setup.c
+++ b/arch/mips/qemu/q-setup.c
@@ -11,7 +11,7 @@ const char *get_system_type(void)
11 return "Qemu"; 11 return "Qemu";
12} 12}
13 13
14static void __init qemu_timer_setup(struct irqaction *irq) 14void __init plat_timer_setup(struct irqaction *irq)
15{ 15{
16 /* set the clock to 100 Hz */ 16 /* set the clock to 100 Hz */
17 outb_p(0x34,0x43); /* binary, mode 2, LSB/MSB, ch 0 */ 17 outb_p(0x34,0x43); /* binary, mode 2, LSB/MSB, ch 0 */
@@ -23,7 +23,5 @@ static void __init qemu_timer_setup(struct irqaction *irq)
23void __init plat_mem_setup(void) 23void __init plat_mem_setup(void)
24{ 24{
25 set_io_port_base(QEMU_PORT_BASE); 25 set_io_port_base(QEMU_PORT_BASE);
26 board_timer_setup = qemu_timer_setup;
27
28 qemu_reboot_setup(); 26 qemu_reboot_setup();
29} 27}
diff --git a/arch/mips/sgi-ip22/ip22-eisa.c b/arch/mips/sgi-ip22/ip22-eisa.c
index ce8e4a7869b0..ee0514a29922 100644
--- a/arch/mips/sgi-ip22/ip22-eisa.c
+++ b/arch/mips/sgi-ip22/ip22-eisa.c
@@ -144,7 +144,7 @@ static void end_eisa1_irq(unsigned int irq)
144 enable_eisa1_irq(irq); 144 enable_eisa1_irq(irq);
145} 145}
146 146
147static struct hw_interrupt_type ip22_eisa1_irq_type = { 147static struct irq_chip ip22_eisa1_irq_type = {
148 .typename = "IP22 EISA", 148 .typename = "IP22 EISA",
149 .startup = startup_eisa1_irq, 149 .startup = startup_eisa1_irq,
150 .shutdown = shutdown_eisa1_irq, 150 .shutdown = shutdown_eisa1_irq,
@@ -206,7 +206,7 @@ static void end_eisa2_irq(unsigned int irq)
206 enable_eisa2_irq(irq); 206 enable_eisa2_irq(irq);
207} 207}
208 208
209static struct hw_interrupt_type ip22_eisa2_irq_type = { 209static struct irq_chip ip22_eisa2_irq_type = {
210 .typename = "IP22 EISA", 210 .typename = "IP22 EISA",
211 .startup = startup_eisa2_irq, 211 .startup = startup_eisa2_irq,
212 .shutdown = shutdown_eisa2_irq, 212 .shutdown = shutdown_eisa2_irq,
diff --git a/arch/mips/sgi-ip22/ip22-int.c b/arch/mips/sgi-ip22/ip22-int.c
index 2d8762818d95..f66026e5d64b 100644
--- a/arch/mips/sgi-ip22/ip22-int.c
+++ b/arch/mips/sgi-ip22/ip22-int.c
@@ -74,7 +74,7 @@ static void end_local0_irq (unsigned int irq)
74 enable_local0_irq(irq); 74 enable_local0_irq(irq);
75} 75}
76 76
77static struct hw_interrupt_type ip22_local0_irq_type = { 77static struct irq_chip ip22_local0_irq_type = {
78 .typename = "IP22 local 0", 78 .typename = "IP22 local 0",
79 .startup = startup_local0_irq, 79 .startup = startup_local0_irq,
80 .shutdown = shutdown_local0_irq, 80 .shutdown = shutdown_local0_irq,
@@ -120,7 +120,7 @@ static void end_local1_irq (unsigned int irq)
120 enable_local1_irq(irq); 120 enable_local1_irq(irq);
121} 121}
122 122
123static struct hw_interrupt_type ip22_local1_irq_type = { 123static struct irq_chip ip22_local1_irq_type = {
124 .typename = "IP22 local 1", 124 .typename = "IP22 local 1",
125 .startup = startup_local1_irq, 125 .startup = startup_local1_irq,
126 .shutdown = shutdown_local1_irq, 126 .shutdown = shutdown_local1_irq,
@@ -166,7 +166,7 @@ static void end_local2_irq (unsigned int irq)
166 enable_local2_irq(irq); 166 enable_local2_irq(irq);
167} 167}
168 168
169static struct hw_interrupt_type ip22_local2_irq_type = { 169static struct irq_chip ip22_local2_irq_type = {
170 .typename = "IP22 local 2", 170 .typename = "IP22 local 2",
171 .startup = startup_local2_irq, 171 .startup = startup_local2_irq,
172 .shutdown = shutdown_local2_irq, 172 .shutdown = shutdown_local2_irq,
@@ -212,7 +212,7 @@ static void end_local3_irq (unsigned int irq)
212 enable_local3_irq(irq); 212 enable_local3_irq(irq);
213} 213}
214 214
215static struct hw_interrupt_type ip22_local3_irq_type = { 215static struct irq_chip ip22_local3_irq_type = {
216 .typename = "IP22 local 3", 216 .typename = "IP22 local 3",
217 .startup = startup_local3_irq, 217 .startup = startup_local3_irq,
218 .shutdown = shutdown_local3_irq, 218 .shutdown = shutdown_local3_irq,
@@ -421,7 +421,7 @@ void __init arch_init_irq(void)
421 mips_cpu_irq_init(SGINT_CPU); 421 mips_cpu_irq_init(SGINT_CPU);
422 422
423 for (i = SGINT_LOCAL0; i < SGI_INTERRUPTS; i++) { 423 for (i = SGINT_LOCAL0; i < SGI_INTERRUPTS; i++) {
424 hw_irq_controller *handler; 424 struct irq_chip *handler;
425 425
426 if (i < SGINT_LOCAL1) 426 if (i < SGINT_LOCAL1)
427 handler = &ip22_local0_irq_type; 427 handler = &ip22_local0_irq_type;
diff --git a/arch/mips/sgi-ip22/ip22-time.c b/arch/mips/sgi-ip22/ip22-time.c
index cca688ad64ad..0e061890f797 100644
--- a/arch/mips/sgi-ip22/ip22-time.c
+++ b/arch/mips/sgi-ip22/ip22-time.c
@@ -7,11 +7,12 @@
7 * Ralf Baechle or David S. Miller (sorry guys, i'm really not sure) 7 * Ralf Baechle or David S. Miller (sorry guys, i'm really not sure)
8 * 8 *
9 * Copyright (C) 2001 by Ladislav Michl 9 * Copyright (C) 2001 by Ladislav Michl
10 * Copyright (C) 2003 Ralf Baechle (ralf@linux-mips.org) 10 * Copyright (C) 2003, 06 Ralf Baechle (ralf@linux-mips.org)
11 */ 11 */
12#include <linux/bcd.h> 12#include <linux/bcd.h>
13#include <linux/ds1286.h> 13#include <linux/ds1286.h>
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/irq.h>
15#include <linux/kernel.h> 16#include <linux/kernel.h>
16#include <linux/interrupt.h> 17#include <linux/interrupt.h>
17#include <linux/kernel_stat.h> 18#include <linux/kernel_stat.h>
@@ -76,7 +77,7 @@ static int indy_rtc_set_time(unsigned long tim)
76 save_control = hpc3c0->rtcregs[RTC_CMD] & 0xff; 77 save_control = hpc3c0->rtcregs[RTC_CMD] & 0xff;
77 hpc3c0->rtcregs[RTC_CMD] = save_control | RTC_TE; 78 hpc3c0->rtcregs[RTC_CMD] = save_control | RTC_TE;
78 79
79 hpc3c0->rtcregs[RTC_YEAR] = BIN2BCD(tm.tm_sec); 80 hpc3c0->rtcregs[RTC_YEAR] = BIN2BCD(tm.tm_year);
80 hpc3c0->rtcregs[RTC_MONTH] = BIN2BCD(tm.tm_mon); 81 hpc3c0->rtcregs[RTC_MONTH] = BIN2BCD(tm.tm_mon);
81 hpc3c0->rtcregs[RTC_DATE] = BIN2BCD(tm.tm_mday); 82 hpc3c0->rtcregs[RTC_DATE] = BIN2BCD(tm.tm_mday);
82 hpc3c0->rtcregs[RTC_HOURS] = BIN2BCD(tm.tm_hour); 83 hpc3c0->rtcregs[RTC_HOURS] = BIN2BCD(tm.tm_hour);
@@ -198,9 +199,7 @@ void indy_r4k_timer_interrupt(struct pt_regs *regs)
198 irq_exit(); 199 irq_exit();
199} 200}
200 201
201extern int setup_irq(unsigned int irq, struct irqaction *irqaction); 202void __init plat_timer_setup(struct irqaction *irq)
202
203static void indy_timer_setup(struct irqaction *irq)
204{ 203{
205 /* over-write the handler, we use our own way */ 204 /* over-write the handler, we use our own way */
206 irq->handler = no_action; 205 irq->handler = no_action;
@@ -216,5 +215,4 @@ void __init ip22_time_init(void)
216 rtc_mips_set_time = indy_rtc_set_time; 215 rtc_mips_set_time = indy_rtc_set_time;
217 216
218 board_time_init = indy_time_init; 217 board_time_init = indy_time_init;
219 board_timer_setup = indy_timer_setup;
220} 218}
diff --git a/arch/mips/sgi-ip27/ip27-irq.c b/arch/mips/sgi-ip27/ip27-irq.c
index 597ec73359b7..24a85372284f 100644
--- a/arch/mips/sgi-ip27/ip27-irq.c
+++ b/arch/mips/sgi-ip27/ip27-irq.c
@@ -296,7 +296,6 @@ static void shutdown_bridge_irq(unsigned int irq)
296 struct bridge_controller *bc = IRQ_TO_BRIDGE(irq); 296 struct bridge_controller *bc = IRQ_TO_BRIDGE(irq);
297 struct hub_data *hub = hub_data(cpu_to_node(bc->irq_cpu)); 297 struct hub_data *hub = hub_data(cpu_to_node(bc->irq_cpu));
298 bridge_t *bridge = bc->base; 298 bridge_t *bridge = bc->base;
299 struct slice_data *si = cpu_data[bc->irq_cpu].data;
300 int pin, swlevel; 299 int pin, swlevel;
301 cpuid_t cpu; 300 cpuid_t cpu;
302 301
@@ -311,7 +310,6 @@ static void shutdown_bridge_irq(unsigned int irq)
311 intr_disconnect_level(cpu, swlevel); 310 intr_disconnect_level(cpu, swlevel);
312 311
313 __clear_bit(swlevel, hub->irq_alloc_mask); 312 __clear_bit(swlevel, hub->irq_alloc_mask);
314 si->level_to_irq[swlevel] = -1;
315 313
316 bridge->b_int_enable &= ~(1 << pin); 314 bridge->b_int_enable &= ~(1 << pin);
317 bridge->b_wid_tflush; 315 bridge->b_wid_tflush;
@@ -347,7 +345,7 @@ static void end_bridge_irq(unsigned int irq)
347 enable_bridge_irq(irq); 345 enable_bridge_irq(irq);
348} 346}
349 347
350static struct hw_interrupt_type bridge_irq_type = { 348static struct irq_chip bridge_irq_type = {
351 .typename = "bridge", 349 .typename = "bridge",
352 .startup = startup_bridge_irq, 350 .startup = startup_bridge_irq,
353 .shutdown = shutdown_bridge_irq, 351 .shutdown = shutdown_bridge_irq,
diff --git a/arch/mips/sgi-ip27/ip27-timer.c b/arch/mips/sgi-ip27/ip27-timer.c
index 3ca614a851e5..b029ba79c27a 100644
--- a/arch/mips/sgi-ip27/ip27-timer.c
+++ b/arch/mips/sgi-ip27/ip27-timer.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copytight (C) 1999, 2000, 05 Ralf Baechle (ralf@linux-mips.org) 2 * Copytight (C) 1999, 2000, 05, 06 Ralf Baechle (ralf@linux-mips.org)
3 * Copytight (C) 1999, 2000 Silicon Graphics, Inc. 3 * Copytight (C) 1999, 2000 Silicon Graphics, Inc.
4 */ 4 */
5#include <linux/bcd.h> 5#include <linux/bcd.h>
@@ -181,8 +181,9 @@ static __init unsigned long get_m48t35_time(void)
181 return mktime(year, month, date, hour, min, sec); 181 return mktime(year, month, date, hour, min, sec);
182} 182}
183 183
184static void startup_rt_irq(unsigned int irq) 184static unsigned int startup_rt_irq(unsigned int irq)
185{ 185{
186 return 0;
186} 187}
187 188
188static void shutdown_rt_irq(unsigned int irq) 189static void shutdown_rt_irq(unsigned int irq)
@@ -205,7 +206,7 @@ static void end_rt_irq(unsigned int irq)
205{ 206{
206} 207}
207 208
208static struct hw_interrupt_type rt_irq_type = { 209static struct irq_chip rt_irq_type = {
209 .typename = "SN HUB RT timer", 210 .typename = "SN HUB RT timer",
210 .startup = startup_rt_irq, 211 .startup = startup_rt_irq,
211 .shutdown = shutdown_rt_irq, 212 .shutdown = shutdown_rt_irq,
@@ -224,17 +225,17 @@ static struct irqaction rt_irqaction = {
224 225
225extern int allocate_irqno(void); 226extern int allocate_irqno(void);
226 227
227static void ip27_timer_setup(struct irqaction *irq) 228void __init plat_timer_setup(struct irqaction *irq)
228{ 229{
229 int irqno = allocate_irqno(); 230 int irqno = allocate_irqno();
230 231
231 if (irqno < 0) 232 if (irqno < 0)
232 panic("Can't allocate interrupt number for timer interrupt"); 233 panic("Can't allocate interrupt number for timer interrupt");
233 234
234 irq_desc[irqno].status = IRQ_DISABLED; 235 irq_desc[irqno].status = IRQ_DISABLED;
235 irq_desc[irqno].action = NULL; 236 irq_desc[irqno].action = NULL;
236 irq_desc[irqno].depth = 1; 237 irq_desc[irqno].depth = 1;
237 irq_desc[irqno].handler = &rt_irq_type; 238 irq_desc[irqno].chip = &rt_irq_type;
238 239
239 /* over-write the handler, we use our own way */ 240 /* over-write the handler, we use our own way */
240 irq->handler = no_action; 241 irq->handler = no_action;
@@ -243,6 +244,10 @@ static void ip27_timer_setup(struct irqaction *irq)
243 irq_desc[irqno].status |= IRQ_PER_CPU; 244 irq_desc[irqno].status |= IRQ_PER_CPU;
244 245
245 rt_timer_irq = irqno; 246 rt_timer_irq = irqno;
247 /*
248 * Only needed to get /proc/interrupt to display timer irq stats
249 */
250 setup_irq(irqno, &rt_irqaction);
246} 251}
247 252
248void __init ip27_time_init(void) 253void __init ip27_time_init(void)
@@ -251,8 +256,6 @@ void __init ip27_time_init(void)
251 xtime.tv_nsec = 0; 256 xtime.tv_nsec = 0;
252 257
253 do_gettimeoffset = ip27_do_gettimeoffset; 258 do_gettimeoffset = ip27_do_gettimeoffset;
254
255 board_timer_setup = ip27_timer_setup;
256} 259}
257 260
258void __init cpu_time_init(void) 261void __init cpu_time_init(void)
diff --git a/arch/mips/sgi-ip32/ip32-irq.c b/arch/mips/sgi-ip32/ip32-irq.c
index 3b7e74b6222e..c64a820373de 100644
--- a/arch/mips/sgi-ip32/ip32-irq.c
+++ b/arch/mips/sgi-ip32/ip32-irq.c
@@ -160,7 +160,7 @@ static void end_cpu_irq(unsigned int irq)
160#define shutdown_cpu_irq disable_cpu_irq 160#define shutdown_cpu_irq disable_cpu_irq
161#define mask_and_ack_cpu_irq disable_cpu_irq 161#define mask_and_ack_cpu_irq disable_cpu_irq
162 162
163static struct hw_interrupt_type ip32_cpu_interrupt = { 163static struct irq_chip ip32_cpu_interrupt = {
164 .typename = "IP32 CPU", 164 .typename = "IP32 CPU",
165 .startup = startup_cpu_irq, 165 .startup = startup_cpu_irq,
166 .shutdown = shutdown_cpu_irq, 166 .shutdown = shutdown_cpu_irq,
@@ -230,7 +230,7 @@ static void end_crime_irq(unsigned int irq)
230 230
231#define shutdown_crime_irq disable_crime_irq 231#define shutdown_crime_irq disable_crime_irq
232 232
233static struct hw_interrupt_type ip32_crime_interrupt = { 233static struct irq_chip ip32_crime_interrupt = {
234 .typename = "IP32 CRIME", 234 .typename = "IP32 CRIME",
235 .startup = startup_crime_irq, 235 .startup = startup_crime_irq,
236 .shutdown = shutdown_crime_irq, 236 .shutdown = shutdown_crime_irq,
@@ -289,7 +289,7 @@ static void end_macepci_irq(unsigned int irq)
289#define shutdown_macepci_irq disable_macepci_irq 289#define shutdown_macepci_irq disable_macepci_irq
290#define mask_and_ack_macepci_irq disable_macepci_irq 290#define mask_and_ack_macepci_irq disable_macepci_irq
291 291
292static struct hw_interrupt_type ip32_macepci_interrupt = { 292static struct irq_chip ip32_macepci_interrupt = {
293 .typename = "IP32 MACE PCI", 293 .typename = "IP32 MACE PCI",
294 .startup = startup_macepci_irq, 294 .startup = startup_macepci_irq,
295 .shutdown = shutdown_macepci_irq, 295 .shutdown = shutdown_macepci_irq,
@@ -316,9 +316,9 @@ static struct hw_interrupt_type ip32_macepci_interrupt = {
316 MACEISA_KEYB_POLL_INT | \ 316 MACEISA_KEYB_POLL_INT | \
317 MACEISA_MOUSE_INT | \ 317 MACEISA_MOUSE_INT | \
318 MACEISA_MOUSE_POLL_INT | \ 318 MACEISA_MOUSE_POLL_INT | \
319 MACEIIRQF_TIMER0_INT | \ 319 MACEISA_TIMER0_INT | \
320 MACEIIRQF_TIMER1_INT | \ 320 MACEISA_TIMER1_INT | \
321 MACEIIRQF_TIMER2_INT) 321 MACEISA_TIMER2_INT)
322#define MACEISA_SUPERIO_INT (MACEISA_PARALLEL_INT | \ 322#define MACEISA_SUPERIO_INT (MACEISA_PARALLEL_INT | \
323 MACEISA_PAR_CTXA_INT | \ 323 MACEISA_PAR_CTXA_INT | \
324 MACEISA_PAR_CTXB_INT | \ 324 MACEISA_PAR_CTXB_INT | \
@@ -349,7 +349,7 @@ static void enable_maceisa_irq (unsigned int irq)
349 case MACEISA_AUDIO_SW_IRQ ... MACEISA_AUDIO3_MERR_IRQ: 349 case MACEISA_AUDIO_SW_IRQ ... MACEISA_AUDIO3_MERR_IRQ:
350 crime_int = MACE_AUDIO_INT; 350 crime_int = MACE_AUDIO_INT;
351 break; 351 break;
352 case MACEISA_RTC_IRQ ... MACEIIRQF_TIMER2_IRQ: 352 case MACEISA_RTC_IRQ ... MACEISA_TIMER2_IRQ:
353 crime_int = MACE_MISC_INT; 353 crime_int = MACE_MISC_INT;
354 break; 354 break;
355 case MACEISA_PARALLEL_IRQ ... MACEISA_SERIAL2_RDMAOR_IRQ: 355 case MACEISA_PARALLEL_IRQ ... MACEISA_SERIAL2_RDMAOR_IRQ:
@@ -419,7 +419,7 @@ static void end_maceisa_irq(unsigned irq)
419 419
420#define shutdown_maceisa_irq disable_maceisa_irq 420#define shutdown_maceisa_irq disable_maceisa_irq
421 421
422static struct hw_interrupt_type ip32_maceisa_interrupt = { 422static struct irq_chip ip32_maceisa_interrupt = {
423 .typename = "IP32 MACE ISA", 423 .typename = "IP32 MACE ISA",
424 .startup = startup_maceisa_irq, 424 .startup = startup_maceisa_irq,
425 .shutdown = shutdown_maceisa_irq, 425 .shutdown = shutdown_maceisa_irq,
@@ -469,7 +469,7 @@ static void end_mace_irq(unsigned int irq)
469#define shutdown_mace_irq disable_mace_irq 469#define shutdown_mace_irq disable_mace_irq
470#define mask_and_ack_mace_irq disable_mace_irq 470#define mask_and_ack_mace_irq disable_mace_irq
471 471
472static struct hw_interrupt_type ip32_mace_interrupt = { 472static struct irq_chip ip32_mace_interrupt = {
473 .typename = "IP32 MACE", 473 .typename = "IP32 MACE",
474 .startup = startup_mace_irq, 474 .startup = startup_mace_irq,
475 .shutdown = shutdown_mace_irq, 475 .shutdown = shutdown_mace_irq,
@@ -575,7 +575,7 @@ void __init arch_init_irq(void)
575 mace->perif.ctrl.imask = 0; 575 mace->perif.ctrl.imask = 0;
576 576
577 for (irq = 0; irq <= IP32_IRQ_MAX; irq++) { 577 for (irq = 0; irq <= IP32_IRQ_MAX; irq++) {
578 hw_irq_controller *controller; 578 struct irq_chip *controller;
579 579
580 if (irq == IP32_R4K_TIMER_IRQ) 580 if (irq == IP32_R4K_TIMER_IRQ)
581 controller = &ip32_cpu_interrupt; 581 controller = &ip32_cpu_interrupt;
diff --git a/arch/mips/sgi-ip32/ip32-setup.c b/arch/mips/sgi-ip32/ip32-setup.c
index 240a2f981d08..57708fe28bd7 100644
--- a/arch/mips/sgi-ip32/ip32-setup.c
+++ b/arch/mips/sgi-ip32/ip32-setup.c
@@ -7,6 +7,7 @@
7 * 7 *
8 * Copyright (C) 2000 Harald Koerfgen 8 * Copyright (C) 2000 Harald Koerfgen
9 * Copyright (C) 2002, 2003, 2005 Ilya A. Volynets 9 * Copyright (C) 2002, 2003, 2005 Ilya A. Volynets
10 * Copyright (C) 2006 Ralf Baechle <ralf@linux-mips.org>
10 */ 11 */
11#include <linux/console.h> 12#include <linux/console.h>
12#include <linux/init.h> 13#include <linux/init.h>
@@ -80,7 +81,7 @@ void __init ip32_time_init(void)
80 printk("%d MHz CPU detected\n", mips_hpt_frequency * 2 / 1000000); 81 printk("%d MHz CPU detected\n", mips_hpt_frequency * 2 / 1000000);
81} 82}
82 83
83void __init ip32_timer_setup(struct irqaction *irq) 84void __init plat_timer_setup(struct irqaction *irq)
84{ 85{
85 irq->handler = no_action; 86 irq->handler = no_action;
86 setup_irq(IP32_R4K_TIMER_IRQ, irq); 87 setup_irq(IP32_R4K_TIMER_IRQ, irq);
@@ -94,7 +95,6 @@ void __init plat_mem_setup(void)
94 rtc_mips_set_mmss = mc146818_set_rtc_mmss; 95 rtc_mips_set_mmss = mc146818_set_rtc_mmss;
95 96
96 board_time_init = ip32_time_init; 97 board_time_init = ip32_time_init;
97 board_timer_setup = ip32_timer_setup;
98 98
99#ifdef CONFIG_SERIAL_8250 99#ifdef CONFIG_SERIAL_8250
100 { 100 {
diff --git a/arch/mips/sibyte/bcm1480/irq.c b/arch/mips/sibyte/bcm1480/irq.c
index 29d3bbb5847d..ed325f0ab28a 100644
--- a/arch/mips/sibyte/bcm1480/irq.c
+++ b/arch/mips/sibyte/bcm1480/irq.c
@@ -83,7 +83,7 @@ extern char sb1250_duart_present[];
83#endif 83#endif
84#endif 84#endif
85 85
86static struct hw_interrupt_type bcm1480_irq_type = { 86static struct irq_chip bcm1480_irq_type = {
87 .typename = "BCM1480-IMR", 87 .typename = "BCM1480-IMR",
88 .startup = startup_bcm1480_irq, 88 .startup = startup_bcm1480_irq,
89 .shutdown = shutdown_bcm1480_irq, 89 .shutdown = shutdown_bcm1480_irq,
@@ -140,7 +140,7 @@ static void bcm1480_set_affinity(unsigned int irq, cpumask_t mask)
140{ 140{
141 int i = 0, old_cpu, cpu, int_on, k; 141 int i = 0, old_cpu, cpu, int_on, k;
142 u64 cur_ints; 142 u64 cur_ints;
143 irq_desc_t *desc = irq_desc + irq; 143 struct irq_desc *desc = irq_desc + irq;
144 unsigned long flags; 144 unsigned long flags;
145 unsigned int irq_dirty; 145 unsigned int irq_dirty;
146 146
@@ -278,7 +278,7 @@ void __init init_bcm1480_irqs(void)
278 irq_desc[i].chip = &bcm1480_irq_type; 278 irq_desc[i].chip = &bcm1480_irq_type;
279 bcm1480_irq_owner[i] = 0; 279 bcm1480_irq_owner[i] = 0;
280 } else { 280 } else {
281 irq_desc[i].chip = &no_irq_type; 281 irq_desc[i].chip = &no_irq_chip;
282 } 282 }
283 } 283 }
284} 284}
@@ -301,7 +301,7 @@ static struct irqaction bcm1480_dummy_action = {
301 301
302int bcm1480_steal_irq(int irq) 302int bcm1480_steal_irq(int irq)
303{ 303{
304 irq_desc_t *desc = irq_desc + irq; 304 struct irq_desc *desc = irq_desc + irq;
305 unsigned long flags; 305 unsigned long flags;
306 int retval = 0; 306 int retval = 0;
307 307
@@ -502,22 +502,23 @@ asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
502#ifdef CONFIG_SIBYTE_BCM1480_PROF 502#ifdef CONFIG_SIBYTE_BCM1480_PROF
503 if (pending & CAUSEF_IP7) /* Cpu performance counter interrupt */ 503 if (pending & CAUSEF_IP7) /* Cpu performance counter interrupt */
504 sbprof_cpu_intr(exception_epc(regs)); 504 sbprof_cpu_intr(exception_epc(regs));
505 else
505#endif 506#endif
506 507
507 if (pending & CAUSEF_IP4) 508 if (pending & CAUSEF_IP4)
508 bcm1480_timer_interrupt(regs); 509 bcm1480_timer_interrupt(regs);
509 510
510#ifdef CONFIG_SMP 511#ifdef CONFIG_SMP
511 if (pending & CAUSEF_IP3) 512 else if (pending & CAUSEF_IP3)
512 bcm1480_mailbox_interrupt(regs); 513 bcm1480_mailbox_interrupt(regs);
513#endif 514#endif
514 515
515#ifdef CONFIG_KGDB 516#ifdef CONFIG_KGDB
516 if (pending & CAUSEF_IP6) 517 else if (pending & CAUSEF_IP6)
517 bcm1480_kgdb_interrupt(regs); /* KGDB (uart 1) */ 518 bcm1480_kgdb_interrupt(regs); /* KGDB (uart 1) */
518#endif 519#endif
519 520
520 if (pending & CAUSEF_IP2) { 521 else if (pending & CAUSEF_IP2) {
521 unsigned long long mask_h, mask_l; 522 unsigned long long mask_h, mask_l;
522 unsigned long base; 523 unsigned long base;
523 524
@@ -533,7 +534,7 @@ asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
533 mask_l = __raw_readq( 534 mask_l = __raw_readq(
534 IOADDR(base + R_BCM1480_IMR_INTERRUPT_STATUS_BASE_L)); 535 IOADDR(base + R_BCM1480_IMR_INTERRUPT_STATUS_BASE_L));
535 536
536 if (!mask_h) { 537 if (mask_h) {
537 if (mask_h ^ 1) 538 if (mask_h ^ 1)
538 do_IRQ(63 - dclz(mask_h), regs); 539 do_IRQ(63 - dclz(mask_h), regs);
539 else 540 else
diff --git a/arch/mips/sibyte/sb1250/irq.c b/arch/mips/sibyte/sb1250/irq.c
index 1d280aabcf6a..1de71adec6c6 100644
--- a/arch/mips/sibyte/sb1250/irq.c
+++ b/arch/mips/sibyte/sb1250/irq.c
@@ -69,7 +69,7 @@ extern char sb1250_duart_present[];
69#endif 69#endif
70#endif 70#endif
71 71
72static struct hw_interrupt_type sb1250_irq_type = { 72static struct irq_chip sb1250_irq_type = {
73 .typename = "SB1250-IMR", 73 .typename = "SB1250-IMR",
74 .startup = startup_sb1250_irq, 74 .startup = startup_sb1250_irq,
75 .shutdown = shutdown_sb1250_irq, 75 .shutdown = shutdown_sb1250_irq,
@@ -120,7 +120,7 @@ static void sb1250_set_affinity(unsigned int irq, cpumask_t mask)
120{ 120{
121 int i = 0, old_cpu, cpu, int_on; 121 int i = 0, old_cpu, cpu, int_on;
122 u64 cur_ints; 122 u64 cur_ints;
123 irq_desc_t *desc = irq_desc + irq; 123 struct irq_desc *desc = irq_desc + irq;
124 unsigned long flags; 124 unsigned long flags;
125 125
126 i = first_cpu(mask); 126 i = first_cpu(mask);
@@ -248,7 +248,7 @@ void __init init_sb1250_irqs(void)
248 irq_desc[i].chip = &sb1250_irq_type; 248 irq_desc[i].chip = &sb1250_irq_type;
249 sb1250_irq_owner[i] = 0; 249 sb1250_irq_owner[i] = 0;
250 } else { 250 } else {
251 irq_desc[i].chip = &no_irq_type; 251 irq_desc[i].chip = &no_irq_chip;
252 } 252 }
253 } 253 }
254} 254}
@@ -271,7 +271,7 @@ static struct irqaction sb1250_dummy_action = {
271 271
272int sb1250_steal_irq(int irq) 272int sb1250_steal_irq(int irq)
273{ 273{
274 irq_desc_t *desc = irq_desc + irq; 274 struct irq_desc *desc = irq_desc + irq;
275 unsigned long flags; 275 unsigned long flags;
276 int retval = 0; 276 int retval = 0;
277 277
@@ -460,25 +460,25 @@ asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
460 pending = read_c0_cause(); 460 pending = read_c0_cause();
461 461
462#ifdef CONFIG_SIBYTE_SB1250_PROF 462#ifdef CONFIG_SIBYTE_SB1250_PROF
463 if (pending & CAUSEF_IP7) { /* Cpu performance counter interrupt */ 463 if (pending & CAUSEF_IP7) /* Cpu performance counter interrupt */
464 sbprof_cpu_intr(exception_epc(regs)); 464 sbprof_cpu_intr(exception_epc(regs));
465 } 465 else
466#endif 466#endif
467 467
468 if (pending & CAUSEF_IP4) 468 if (pending & CAUSEF_IP4)
469 sb1250_timer_interrupt(regs); 469 sb1250_timer_interrupt(regs);
470 470
471#ifdef CONFIG_SMP 471#ifdef CONFIG_SMP
472 if (pending & CAUSEF_IP3) 472 else if (pending & CAUSEF_IP3)
473 sb1250_mailbox_interrupt(regs); 473 sb1250_mailbox_interrupt(regs);
474#endif 474#endif
475 475
476#ifdef CONFIG_KGDB 476#ifdef CONFIG_KGDB
477 if (pending & CAUSEF_IP6) /* KGDB (uart 1) */ 477 else if (pending & CAUSEF_IP6) /* KGDB (uart 1) */
478 sb1250_kgdb_interrupt(regs); 478 sb1250_kgdb_interrupt(regs);
479#endif 479#endif
480 480
481 if (pending & CAUSEF_IP2) { 481 else if (pending & CAUSEF_IP2) {
482 unsigned long long mask; 482 unsigned long long mask;
483 483
484 /* 484 /*
diff --git a/arch/mips/sibyte/swarm/setup.c b/arch/mips/sibyte/swarm/setup.c
index a9a6dbc06849..ac342f5643c9 100644
--- a/arch/mips/sibyte/swarm/setup.c
+++ b/arch/mips/sibyte/swarm/setup.c
@@ -27,7 +27,7 @@
27#include <linux/blkdev.h> 27#include <linux/blkdev.h>
28#include <linux/init.h> 28#include <linux/init.h>
29#include <linux/kernel.h> 29#include <linux/kernel.h>
30#include <linux/tty.h> 30#include <linux/screen_info.h>
31#include <linux/initrd.h> 31#include <linux/initrd.h>
32 32
33#include <asm/irq.h> 33#include <asm/irq.h>
@@ -77,7 +77,7 @@ void __init swarm_time_init(void)
77#endif 77#endif
78} 78}
79 79
80void __init swarm_timer_setup(struct irqaction *irq) 80void __init plat_timer_setup(struct irqaction *irq)
81{ 81{
82 /* 82 /*
83 * we don't set up irqaction, because we will deliver timer 83 * we don't set up irqaction, because we will deliver timer
@@ -117,7 +117,6 @@ void __init plat_mem_setup(void)
117 panic_timeout = 5; /* For debug. */ 117 panic_timeout = 5; /* For debug. */
118 118
119 board_time_init = swarm_time_init; 119 board_time_init = swarm_time_init;
120 board_timer_setup = swarm_timer_setup;
121 board_be_handler = swarm_be_handler; 120 board_be_handler = swarm_be_handler;
122 121
123 if (xicor_probe()) { 122 if (xicor_probe()) {
diff --git a/arch/mips/sni/irq.c b/arch/mips/sni/irq.c
index c19e158ec402..cda165f42b6a 100644
--- a/arch/mips/sni/irq.c
+++ b/arch/mips/sni/irq.c
@@ -55,7 +55,7 @@ static void end_pciasic_irq(unsigned int irq)
55 enable_pciasic_irq(irq); 55 enable_pciasic_irq(irq);
56} 56}
57 57
58static struct hw_interrupt_type pciasic_irq_type = { 58static struct irq_chip pciasic_irq_type = {
59 .typename = "ASIC-PCI", 59 .typename = "ASIC-PCI",
60 .startup = startup_pciasic_irq, 60 .startup = startup_pciasic_irq,
61 .shutdown = shutdown_pciasic_irq, 61 .shutdown = shutdown_pciasic_irq,
diff --git a/arch/mips/sni/setup.c b/arch/mips/sni/setup.c
index 870486d6cd75..4e98feb15410 100644
--- a/arch/mips/sni/setup.c
+++ b/arch/mips/sni/setup.c
@@ -18,7 +18,7 @@
18#include <linux/pci.h> 18#include <linux/pci.h>
19#include <linux/console.h> 19#include <linux/console.h>
20#include <linux/fb.h> 20#include <linux/fb.h>
21#include <linux/tty.h> 21#include <linux/screen_info.h>
22 22
23#ifdef CONFIG_ARC 23#ifdef CONFIG_ARC
24#include <asm/arc/types.h> 24#include <asm/arc/types.h>
@@ -41,7 +41,7 @@ extern void sni_machine_restart(char *command);
41extern void sni_machine_halt(void); 41extern void sni_machine_halt(void);
42extern void sni_machine_power_off(void); 42extern void sni_machine_power_off(void);
43 43
44static void __init sni_rm200_pci_timer_setup(struct irqaction *irq) 44void __init plat_timer_setup(struct irqaction *irq)
45{ 45{
46 /* set the clock to 100 Hz */ 46 /* set the clock to 100 Hz */
47 outb_p(0x34,0x43); /* binary, mode 2, LSB/MSB, ch 0 */ 47 outb_p(0x34,0x43); /* binary, mode 2, LSB/MSB, ch 0 */
@@ -270,7 +270,6 @@ void __init plat_mem_setup(void)
270#endif 270#endif
271 271
272 sni_resource_init(); 272 sni_resource_init();
273 board_timer_setup = sni_rm200_pci_timer_setup;
274 273
275 _machine_restart = sni_machine_restart; 274 _machine_restart = sni_machine_restart;
276 _machine_halt = sni_machine_halt; 275 _machine_halt = sni_machine_halt;
diff --git a/arch/mips/tx4927/common/tx4927_irq.c b/arch/mips/tx4927/common/tx4927_irq.c
index ae9d5653a863..cd176f6a06c8 100644
--- a/arch/mips/tx4927/common/tx4927_irq.c
+++ b/arch/mips/tx4927/common/tx4927_irq.c
@@ -146,7 +146,7 @@ static DEFINE_SPINLOCK(tx4927_cp0_lock);
146static DEFINE_SPINLOCK(tx4927_pic_lock); 146static DEFINE_SPINLOCK(tx4927_pic_lock);
147 147
148#define TX4927_CP0_NAME "TX4927-CP0" 148#define TX4927_CP0_NAME "TX4927-CP0"
149static struct hw_interrupt_type tx4927_irq_cp0_type = { 149static struct irq_chip tx4927_irq_cp0_type = {
150 .typename = TX4927_CP0_NAME, 150 .typename = TX4927_CP0_NAME,
151 .startup = tx4927_irq_cp0_startup, 151 .startup = tx4927_irq_cp0_startup,
152 .shutdown = tx4927_irq_cp0_shutdown, 152 .shutdown = tx4927_irq_cp0_shutdown,
@@ -158,7 +158,7 @@ static struct hw_interrupt_type tx4927_irq_cp0_type = {
158}; 158};
159 159
160#define TX4927_PIC_NAME "TX4927-PIC" 160#define TX4927_PIC_NAME "TX4927-PIC"
161static struct hw_interrupt_type tx4927_irq_pic_type = { 161static struct irq_chip tx4927_irq_pic_type = {
162 .typename = TX4927_PIC_NAME, 162 .typename = TX4927_PIC_NAME,
163 .startup = tx4927_irq_pic_startup, 163 .startup = tx4927_irq_pic_startup,
164 .shutdown = tx4927_irq_pic_shutdown, 164 .shutdown = tx4927_irq_pic_shutdown,
diff --git a/arch/mips/tx4927/common/tx4927_setup.c b/arch/mips/tx4927/common/tx4927_setup.c
index 64a1b394b252..3ace4037343e 100644
--- a/arch/mips/tx4927/common/tx4927_setup.c
+++ b/arch/mips/tx4927/common/tx4927_setup.c
@@ -50,7 +50,6 @@
50#undef DEBUG 50#undef DEBUG
51 51
52void __init tx4927_time_init(void); 52void __init tx4927_time_init(void);
53void __init tx4927_timer_setup(struct irqaction *irq);
54void dump_cp0(char *key); 53void dump_cp0(char *key);
55 54
56 55
@@ -66,7 +65,6 @@ static void tx4927_write_buffer_flush(void)
66void __init plat_mem_setup(void) 65void __init plat_mem_setup(void)
67{ 66{
68 board_time_init = tx4927_time_init; 67 board_time_init = tx4927_time_init;
69 board_timer_setup = tx4927_timer_setup;
70 __wbflush = tx4927_write_buffer_flush; 68 __wbflush = tx4927_write_buffer_flush;
71 69
72#ifdef CONFIG_TOSHIBA_RBTX4927 70#ifdef CONFIG_TOSHIBA_RBTX4927
@@ -91,7 +89,7 @@ void __init tx4927_time_init(void)
91} 89}
92 90
93 91
94void __init tx4927_timer_setup(struct irqaction *irq) 92void __init plat_timer_setup(struct irqaction *irq)
95{ 93{
96 u32 count; 94 u32 count;
97 u32 c1; 95 u32 c1;
diff --git a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c
index ec0a0de3083d..b0f021f2a6c4 100644
--- a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c
+++ b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c
@@ -251,7 +251,7 @@ static DEFINE_SPINLOCK(toshiba_rbtx4927_ioc_lock);
251 251
252 252
253#define TOSHIBA_RBTX4927_IOC_NAME "RBTX4927-IOC" 253#define TOSHIBA_RBTX4927_IOC_NAME "RBTX4927-IOC"
254static struct hw_interrupt_type toshiba_rbtx4927_irq_ioc_type = { 254static struct irq_chip toshiba_rbtx4927_irq_ioc_type = {
255 .typename = TOSHIBA_RBTX4927_IOC_NAME, 255 .typename = TOSHIBA_RBTX4927_IOC_NAME,
256 .startup = toshiba_rbtx4927_irq_ioc_startup, 256 .startup = toshiba_rbtx4927_irq_ioc_startup,
257 .shutdown = toshiba_rbtx4927_irq_ioc_shutdown, 257 .shutdown = toshiba_rbtx4927_irq_ioc_shutdown,
@@ -267,7 +267,7 @@ static struct hw_interrupt_type toshiba_rbtx4927_irq_ioc_type = {
267 267
268#ifdef CONFIG_TOSHIBA_FPCIB0 268#ifdef CONFIG_TOSHIBA_FPCIB0
269#define TOSHIBA_RBTX4927_ISA_NAME "RBTX4927-ISA" 269#define TOSHIBA_RBTX4927_ISA_NAME "RBTX4927-ISA"
270static struct hw_interrupt_type toshiba_rbtx4927_irq_isa_type = { 270static struct irq_chip toshiba_rbtx4927_irq_isa_type = {
271 .typename = TOSHIBA_RBTX4927_ISA_NAME, 271 .typename = TOSHIBA_RBTX4927_ISA_NAME,
272 .startup = toshiba_rbtx4927_irq_isa_startup, 272 .startup = toshiba_rbtx4927_irq_isa_startup,
273 .shutdown = toshiba_rbtx4927_irq_isa_shutdown, 273 .shutdown = toshiba_rbtx4927_irq_isa_shutdown,
diff --git a/arch/mips/tx4938/common/irq.c b/arch/mips/tx4938/common/irq.c
index 0b2f8c849218..dc30d66123b6 100644
--- a/arch/mips/tx4938/common/irq.c
+++ b/arch/mips/tx4938/common/irq.c
@@ -57,7 +57,7 @@ DEFINE_SPINLOCK(tx4938_cp0_lock);
57DEFINE_SPINLOCK(tx4938_pic_lock); 57DEFINE_SPINLOCK(tx4938_pic_lock);
58 58
59#define TX4938_CP0_NAME "TX4938-CP0" 59#define TX4938_CP0_NAME "TX4938-CP0"
60static struct hw_interrupt_type tx4938_irq_cp0_type = { 60static struct irq_chip tx4938_irq_cp0_type = {
61 .typename = TX4938_CP0_NAME, 61 .typename = TX4938_CP0_NAME,
62 .startup = tx4938_irq_cp0_startup, 62 .startup = tx4938_irq_cp0_startup,
63 .shutdown = tx4938_irq_cp0_shutdown, 63 .shutdown = tx4938_irq_cp0_shutdown,
@@ -69,7 +69,7 @@ static struct hw_interrupt_type tx4938_irq_cp0_type = {
69}; 69};
70 70
71#define TX4938_PIC_NAME "TX4938-PIC" 71#define TX4938_PIC_NAME "TX4938-PIC"
72static struct hw_interrupt_type tx4938_irq_pic_type = { 72static struct irq_chip tx4938_irq_pic_type = {
73 .typename = TX4938_PIC_NAME, 73 .typename = TX4938_PIC_NAME,
74 .startup = tx4938_irq_pic_startup, 74 .startup = tx4938_irq_pic_startup,
75 .shutdown = tx4938_irq_pic_shutdown, 75 .shutdown = tx4938_irq_pic_shutdown,
diff --git a/arch/mips/tx4938/common/setup.c b/arch/mips/tx4938/common/setup.c
index ef59a5cffc69..71859c4fee84 100644
--- a/arch/mips/tx4938/common/setup.c
+++ b/arch/mips/tx4938/common/setup.c
@@ -39,7 +39,6 @@ extern void rbtx4938_time_init(void);
39 39
40void __init tx4938_setup(void); 40void __init tx4938_setup(void);
41void __init tx4938_time_init(void); 41void __init tx4938_time_init(void);
42void __init tx4938_timer_setup(struct irqaction *irq);
43void dump_cp0(char *key); 42void dump_cp0(char *key);
44 43
45void (*__wbflush) (void); 44void (*__wbflush) (void);
@@ -64,7 +63,6 @@ void __init
64plat_mem_setup(void) 63plat_mem_setup(void)
65{ 64{
66 board_time_init = tx4938_time_init; 65 board_time_init = tx4938_time_init;
67 board_timer_setup = tx4938_timer_setup;
68 __wbflush = tx4938_write_buffer_flush; 66 __wbflush = tx4938_write_buffer_flush;
69 toshiba_rbtx4938_setup(); 67 toshiba_rbtx4938_setup();
70} 68}
@@ -75,8 +73,7 @@ tx4938_time_init(void)
75 rbtx4938_time_init(); 73 rbtx4938_time_init();
76} 74}
77 75
78void __init 76void __init plat_timer_setup(struct irqaction *irq)
79tx4938_timer_setup(struct irqaction *irq)
80{ 77{
81 u32 count; 78 u32 count;
82 u32 c1; 79 u32 c1;
diff --git a/arch/mips/tx4938/toshiba_rbtx4938/irq.c b/arch/mips/tx4938/toshiba_rbtx4938/irq.c
index 3b8245dc5bd3..83f2750825a4 100644
--- a/arch/mips/tx4938/toshiba_rbtx4938/irq.c
+++ b/arch/mips/tx4938/toshiba_rbtx4938/irq.c
@@ -97,7 +97,7 @@ static void toshiba_rbtx4938_irq_ioc_end(unsigned int irq);
97DEFINE_SPINLOCK(toshiba_rbtx4938_ioc_lock); 97DEFINE_SPINLOCK(toshiba_rbtx4938_ioc_lock);
98 98
99#define TOSHIBA_RBTX4938_IOC_NAME "RBTX4938-IOC" 99#define TOSHIBA_RBTX4938_IOC_NAME "RBTX4938-IOC"
100static struct hw_interrupt_type toshiba_rbtx4938_irq_ioc_type = { 100static struct irq_chip toshiba_rbtx4938_irq_ioc_type = {
101 .typename = TOSHIBA_RBTX4938_IOC_NAME, 101 .typename = TOSHIBA_RBTX4938_IOC_NAME,
102 .startup = toshiba_rbtx4938_irq_ioc_startup, 102 .startup = toshiba_rbtx4938_irq_ioc_startup,
103 .shutdown = toshiba_rbtx4938_irq_ioc_shutdown, 103 .shutdown = toshiba_rbtx4938_irq_ioc_shutdown,
diff --git a/arch/mips/vr41xx/Kconfig b/arch/mips/vr41xx/Kconfig
index 6046ef23b2bf..92f41f6f934a 100644
--- a/arch/mips/vr41xx/Kconfig
+++ b/arch/mips/vr41xx/Kconfig
@@ -86,9 +86,3 @@ config PCI_VR41XX
86 depends on MACH_VR41XX && HW_HAS_PCI 86 depends on MACH_VR41XX && HW_HAS_PCI
87 default y 87 default y
88 select PCI 88 select PCI
89
90config VRC4173
91 tristate "Add NEC VRC4173 companion chip support"
92 depends on MACH_VR41XX && PCI_VR41XX
93 help
94 The NEC VRC4173 is a companion chip for NEC VR4122/VR4131.
diff --git a/arch/mips/vr41xx/casio-e55/setup.c b/arch/mips/vr41xx/casio-e55/setup.c
index 814900915c28..6d9bab890587 100644
--- a/arch/mips/vr41xx/casio-e55/setup.c
+++ b/arch/mips/vr41xx/casio-e55/setup.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * setup.c, Setup for the CASIO CASSIOPEIA E-11/15/55/65. 2 * setup.c, Setup for the CASIO CASSIOPEIA E-11/15/55/65.
3 * 3 *
4 * Copyright (C) 2002-2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2002-2006 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
@@ -21,13 +21,18 @@
21#include <linux/ioport.h> 21#include <linux/ioport.h>
22 22
23#include <asm/io.h> 23#include <asm/io.h>
24#include <asm/vr41xx/e55.h> 24
25#define E55_ISA_IO_BASE 0x1400c000
26#define E55_ISA_IO_SIZE 0x03ff4000
27#define E55_ISA_IO_START 0
28#define E55_ISA_IO_END (E55_ISA_IO_SIZE - 1)
29#define E55_IO_PORT_BASE KSEG1ADDR(E55_ISA_IO_BASE)
25 30
26static int __init casio_e55_setup(void) 31static int __init casio_e55_setup(void)
27{ 32{
28 set_io_port_base(IO_PORT_BASE); 33 set_io_port_base(E55_IO_PORT_BASE);
29 ioport_resource.start = IO_PORT_RESOURCE_START; 34 ioport_resource.start = E55_ISA_IO_START;
30 ioport_resource.end = IO_PORT_RESOURCE_END; 35 ioport_resource.end = E55_ISA_IO_END;
31 36
32 return 0; 37 return 0;
33} 38}
diff --git a/arch/mips/vr41xx/common/Makefile b/arch/mips/vr41xx/common/Makefile
index aa373974c80f..975d5caf9d1b 100644
--- a/arch/mips/vr41xx/common/Makefile
+++ b/arch/mips/vr41xx/common/Makefile
@@ -2,7 +2,6 @@
2# Makefile for common code of the NEC VR4100 series. 2# Makefile for common code of the NEC VR4100 series.
3# 3#
4 4
5obj-y += bcu.o cmu.o icu.o init.o irq.o pmu.o type.o 5obj-y += bcu.o cmu.o icu.o init.o irq.o pmu.o type.o
6obj-$(CONFIG_VRC4173) += vrc4173.o
7 6
8EXTRA_AFLAGS := $(CFLAGS) 7EXTRA_AFLAGS := $(CFLAGS)
diff --git a/arch/mips/vr41xx/common/icu.c b/arch/mips/vr41xx/common/icu.c
index b9323302cc4e..7a5c31d58378 100644
--- a/arch/mips/vr41xx/common/icu.c
+++ b/arch/mips/vr41xx/common/icu.c
@@ -38,6 +38,7 @@
38 38
39#include <asm/cpu.h> 39#include <asm/cpu.h>
40#include <asm/io.h> 40#include <asm/io.h>
41#include <asm/vr41xx/irq.h>
41#include <asm/vr41xx/vr41xx.h> 42#include <asm/vr41xx/vr41xx.h>
42 43
43static void __iomem *icu1_base; 44static void __iomem *icu1_base;
@@ -152,7 +153,7 @@ static inline uint16_t icu2_clear(uint8_t offset, uint16_t clear)
152 153
153void vr41xx_enable_piuint(uint16_t mask) 154void vr41xx_enable_piuint(uint16_t mask)
154{ 155{
155 irq_desc_t *desc = irq_desc + PIU_IRQ; 156 struct irq_desc *desc = irq_desc + PIU_IRQ;
156 unsigned long flags; 157 unsigned long flags;
157 158
158 if (current_cpu_data.cputype == CPU_VR4111 || 159 if (current_cpu_data.cputype == CPU_VR4111 ||
@@ -167,7 +168,7 @@ EXPORT_SYMBOL(vr41xx_enable_piuint);
167 168
168void vr41xx_disable_piuint(uint16_t mask) 169void vr41xx_disable_piuint(uint16_t mask)
169{ 170{
170 irq_desc_t *desc = irq_desc + PIU_IRQ; 171 struct irq_desc *desc = irq_desc + PIU_IRQ;
171 unsigned long flags; 172 unsigned long flags;
172 173
173 if (current_cpu_data.cputype == CPU_VR4111 || 174 if (current_cpu_data.cputype == CPU_VR4111 ||
@@ -182,7 +183,7 @@ EXPORT_SYMBOL(vr41xx_disable_piuint);
182 183
183void vr41xx_enable_aiuint(uint16_t mask) 184void vr41xx_enable_aiuint(uint16_t mask)
184{ 185{
185 irq_desc_t *desc = irq_desc + AIU_IRQ; 186 struct irq_desc *desc = irq_desc + AIU_IRQ;
186 unsigned long flags; 187 unsigned long flags;
187 188
188 if (current_cpu_data.cputype == CPU_VR4111 || 189 if (current_cpu_data.cputype == CPU_VR4111 ||
@@ -197,7 +198,7 @@ EXPORT_SYMBOL(vr41xx_enable_aiuint);
197 198
198void vr41xx_disable_aiuint(uint16_t mask) 199void vr41xx_disable_aiuint(uint16_t mask)
199{ 200{
200 irq_desc_t *desc = irq_desc + AIU_IRQ; 201 struct irq_desc *desc = irq_desc + AIU_IRQ;
201 unsigned long flags; 202 unsigned long flags;
202 203
203 if (current_cpu_data.cputype == CPU_VR4111 || 204 if (current_cpu_data.cputype == CPU_VR4111 ||
@@ -212,7 +213,7 @@ EXPORT_SYMBOL(vr41xx_disable_aiuint);
212 213
213void vr41xx_enable_kiuint(uint16_t mask) 214void vr41xx_enable_kiuint(uint16_t mask)
214{ 215{
215 irq_desc_t *desc = irq_desc + KIU_IRQ; 216 struct irq_desc *desc = irq_desc + KIU_IRQ;
216 unsigned long flags; 217 unsigned long flags;
217 218
218 if (current_cpu_data.cputype == CPU_VR4111 || 219 if (current_cpu_data.cputype == CPU_VR4111 ||
@@ -227,7 +228,7 @@ EXPORT_SYMBOL(vr41xx_enable_kiuint);
227 228
228void vr41xx_disable_kiuint(uint16_t mask) 229void vr41xx_disable_kiuint(uint16_t mask)
229{ 230{
230 irq_desc_t *desc = irq_desc + KIU_IRQ; 231 struct irq_desc *desc = irq_desc + KIU_IRQ;
231 unsigned long flags; 232 unsigned long flags;
232 233
233 if (current_cpu_data.cputype == CPU_VR4111 || 234 if (current_cpu_data.cputype == CPU_VR4111 ||
@@ -242,7 +243,7 @@ EXPORT_SYMBOL(vr41xx_disable_kiuint);
242 243
243void vr41xx_enable_dsiuint(uint16_t mask) 244void vr41xx_enable_dsiuint(uint16_t mask)
244{ 245{
245 irq_desc_t *desc = irq_desc + DSIU_IRQ; 246 struct irq_desc *desc = irq_desc + DSIU_IRQ;
246 unsigned long flags; 247 unsigned long flags;
247 248
248 spin_lock_irqsave(&desc->lock, flags); 249 spin_lock_irqsave(&desc->lock, flags);
@@ -254,7 +255,7 @@ EXPORT_SYMBOL(vr41xx_enable_dsiuint);
254 255
255void vr41xx_disable_dsiuint(uint16_t mask) 256void vr41xx_disable_dsiuint(uint16_t mask)
256{ 257{
257 irq_desc_t *desc = irq_desc + DSIU_IRQ; 258 struct irq_desc *desc = irq_desc + DSIU_IRQ;
258 unsigned long flags; 259 unsigned long flags;
259 260
260 spin_lock_irqsave(&desc->lock, flags); 261 spin_lock_irqsave(&desc->lock, flags);
@@ -266,7 +267,7 @@ EXPORT_SYMBOL(vr41xx_disable_dsiuint);
266 267
267void vr41xx_enable_firint(uint16_t mask) 268void vr41xx_enable_firint(uint16_t mask)
268{ 269{
269 irq_desc_t *desc = irq_desc + FIR_IRQ; 270 struct irq_desc *desc = irq_desc + FIR_IRQ;
270 unsigned long flags; 271 unsigned long flags;
271 272
272 spin_lock_irqsave(&desc->lock, flags); 273 spin_lock_irqsave(&desc->lock, flags);
@@ -278,7 +279,7 @@ EXPORT_SYMBOL(vr41xx_enable_firint);
278 279
279void vr41xx_disable_firint(uint16_t mask) 280void vr41xx_disable_firint(uint16_t mask)
280{ 281{
281 irq_desc_t *desc = irq_desc + FIR_IRQ; 282 struct irq_desc *desc = irq_desc + FIR_IRQ;
282 unsigned long flags; 283 unsigned long flags;
283 284
284 spin_lock_irqsave(&desc->lock, flags); 285 spin_lock_irqsave(&desc->lock, flags);
@@ -290,7 +291,7 @@ EXPORT_SYMBOL(vr41xx_disable_firint);
290 291
291void vr41xx_enable_pciint(void) 292void vr41xx_enable_pciint(void)
292{ 293{
293 irq_desc_t *desc = irq_desc + PCI_IRQ; 294 struct irq_desc *desc = irq_desc + PCI_IRQ;
294 unsigned long flags; 295 unsigned long flags;
295 296
296 if (current_cpu_data.cputype == CPU_VR4122 || 297 if (current_cpu_data.cputype == CPU_VR4122 ||
@@ -306,7 +307,7 @@ EXPORT_SYMBOL(vr41xx_enable_pciint);
306 307
307void vr41xx_disable_pciint(void) 308void vr41xx_disable_pciint(void)
308{ 309{
309 irq_desc_t *desc = irq_desc + PCI_IRQ; 310 struct irq_desc *desc = irq_desc + PCI_IRQ;
310 unsigned long flags; 311 unsigned long flags;
311 312
312 if (current_cpu_data.cputype == CPU_VR4122 || 313 if (current_cpu_data.cputype == CPU_VR4122 ||
@@ -322,7 +323,7 @@ EXPORT_SYMBOL(vr41xx_disable_pciint);
322 323
323void vr41xx_enable_scuint(void) 324void vr41xx_enable_scuint(void)
324{ 325{
325 irq_desc_t *desc = irq_desc + SCU_IRQ; 326 struct irq_desc *desc = irq_desc + SCU_IRQ;
326 unsigned long flags; 327 unsigned long flags;
327 328
328 if (current_cpu_data.cputype == CPU_VR4122 || 329 if (current_cpu_data.cputype == CPU_VR4122 ||
@@ -338,7 +339,7 @@ EXPORT_SYMBOL(vr41xx_enable_scuint);
338 339
339void vr41xx_disable_scuint(void) 340void vr41xx_disable_scuint(void)
340{ 341{
341 irq_desc_t *desc = irq_desc + SCU_IRQ; 342 struct irq_desc *desc = irq_desc + SCU_IRQ;
342 unsigned long flags; 343 unsigned long flags;
343 344
344 if (current_cpu_data.cputype == CPU_VR4122 || 345 if (current_cpu_data.cputype == CPU_VR4122 ||
@@ -354,7 +355,7 @@ EXPORT_SYMBOL(vr41xx_disable_scuint);
354 355
355void vr41xx_enable_csiint(uint16_t mask) 356void vr41xx_enable_csiint(uint16_t mask)
356{ 357{
357 irq_desc_t *desc = irq_desc + CSI_IRQ; 358 struct irq_desc *desc = irq_desc + CSI_IRQ;
358 unsigned long flags; 359 unsigned long flags;
359 360
360 if (current_cpu_data.cputype == CPU_VR4122 || 361 if (current_cpu_data.cputype == CPU_VR4122 ||
@@ -370,7 +371,7 @@ EXPORT_SYMBOL(vr41xx_enable_csiint);
370 371
371void vr41xx_disable_csiint(uint16_t mask) 372void vr41xx_disable_csiint(uint16_t mask)
372{ 373{
373 irq_desc_t *desc = irq_desc + CSI_IRQ; 374 struct irq_desc *desc = irq_desc + CSI_IRQ;
374 unsigned long flags; 375 unsigned long flags;
375 376
376 if (current_cpu_data.cputype == CPU_VR4122 || 377 if (current_cpu_data.cputype == CPU_VR4122 ||
@@ -386,7 +387,7 @@ EXPORT_SYMBOL(vr41xx_disable_csiint);
386 387
387void vr41xx_enable_bcuint(void) 388void vr41xx_enable_bcuint(void)
388{ 389{
389 irq_desc_t *desc = irq_desc + BCU_IRQ; 390 struct irq_desc *desc = irq_desc + BCU_IRQ;
390 unsigned long flags; 391 unsigned long flags;
391 392
392 if (current_cpu_data.cputype == CPU_VR4122 || 393 if (current_cpu_data.cputype == CPU_VR4122 ||
@@ -402,7 +403,7 @@ EXPORT_SYMBOL(vr41xx_enable_bcuint);
402 403
403void vr41xx_disable_bcuint(void) 404void vr41xx_disable_bcuint(void)
404{ 405{
405 irq_desc_t *desc = irq_desc + BCU_IRQ; 406 struct irq_desc *desc = irq_desc + BCU_IRQ;
406 unsigned long flags; 407 unsigned long flags;
407 408
408 if (current_cpu_data.cputype == CPU_VR4122 || 409 if (current_cpu_data.cputype == CPU_VR4122 ||
@@ -442,7 +443,7 @@ static void end_sysint1_irq(unsigned int irq)
442 icu1_set(MSYSINT1REG, 1 << SYSINT1_IRQ_TO_PIN(irq)); 443 icu1_set(MSYSINT1REG, 1 << SYSINT1_IRQ_TO_PIN(irq));
443} 444}
444 445
445static struct hw_interrupt_type sysint1_irq_type = { 446static struct irq_chip sysint1_irq_type = {
446 .typename = "SYSINT1", 447 .typename = "SYSINT1",
447 .startup = startup_sysint1_irq, 448 .startup = startup_sysint1_irq,
448 .shutdown = shutdown_sysint1_irq, 449 .shutdown = shutdown_sysint1_irq,
@@ -478,7 +479,7 @@ static void end_sysint2_irq(unsigned int irq)
478 icu2_set(MSYSINT2REG, 1 << SYSINT2_IRQ_TO_PIN(irq)); 479 icu2_set(MSYSINT2REG, 1 << SYSINT2_IRQ_TO_PIN(irq));
479} 480}
480 481
481static struct hw_interrupt_type sysint2_irq_type = { 482static struct irq_chip sysint2_irq_type = {
482 .typename = "SYSINT2", 483 .typename = "SYSINT2",
483 .startup = startup_sysint2_irq, 484 .startup = startup_sysint2_irq,
484 .shutdown = shutdown_sysint2_irq, 485 .shutdown = shutdown_sysint2_irq,
@@ -490,7 +491,7 @@ static struct hw_interrupt_type sysint2_irq_type = {
490 491
491static inline int set_sysint1_assign(unsigned int irq, unsigned char assign) 492static inline int set_sysint1_assign(unsigned int irq, unsigned char assign)
492{ 493{
493 irq_desc_t *desc = irq_desc + irq; 494 struct irq_desc *desc = irq_desc + irq;
494 uint16_t intassign0, intassign1; 495 uint16_t intassign0, intassign1;
495 unsigned int pin; 496 unsigned int pin;
496 497
@@ -549,7 +550,7 @@ static inline int set_sysint1_assign(unsigned int irq, unsigned char assign)
549 550
550static inline int set_sysint2_assign(unsigned int irq, unsigned char assign) 551static inline int set_sysint2_assign(unsigned int irq, unsigned char assign)
551{ 552{
552 irq_desc_t *desc = irq_desc + irq; 553 struct irq_desc *desc = irq_desc + irq;
553 uint16_t intassign2, intassign3; 554 uint16_t intassign2, intassign3;
554 unsigned int pin; 555 unsigned int pin;
555 556
diff --git a/arch/mips/vr41xx/common/init.c b/arch/mips/vr41xx/common/init.c
index 915bfa5c0719..a2e285c1d4d5 100644
--- a/arch/mips/vr41xx/common/init.c
+++ b/arch/mips/vr41xx/common/init.c
@@ -24,6 +24,7 @@
24 24
25#include <asm/bootinfo.h> 25#include <asm/bootinfo.h>
26#include <asm/time.h> 26#include <asm/time.h>
27#include <asm/vr41xx/irq.h>
27#include <asm/vr41xx/vr41xx.h> 28#include <asm/vr41xx/vr41xx.h>
28 29
29#define IO_MEM_RESOURCE_START 0UL 30#define IO_MEM_RESOURCE_START 0UL
@@ -47,7 +48,7 @@ static void __init setup_timer_frequency(void)
47 mips_hpt_frequency = tclock / 4; 48 mips_hpt_frequency = tclock / 4;
48} 49}
49 50
50static void __init setup_timer_irq(struct irqaction *irq) 51void __init plat_timer_setup(struct irqaction *irq)
51{ 52{
52 setup_irq(TIMER_IRQ, irq); 53 setup_irq(TIMER_IRQ, irq);
53} 54}
@@ -55,7 +56,6 @@ static void __init setup_timer_irq(struct irqaction *irq)
55static void __init timer_init(void) 56static void __init timer_init(void)
56{ 57{
57 board_time_init = setup_timer_frequency; 58 board_time_init = setup_timer_frequency;
58 board_timer_setup = setup_timer_irq;
59} 59}
60 60
61void __init plat_mem_setup(void) 61void __init plat_mem_setup(void)
diff --git a/arch/mips/vr41xx/common/irq.c b/arch/mips/vr41xx/common/irq.c
index 66aa50802deb..4733c5344467 100644
--- a/arch/mips/vr41xx/common/irq.c
+++ b/arch/mips/vr41xx/common/irq.c
@@ -22,7 +22,7 @@
22 22
23#include <asm/irq_cpu.h> 23#include <asm/irq_cpu.h>
24#include <asm/system.h> 24#include <asm/system.h>
25#include <asm/vr41xx/vr41xx.h> 25#include <asm/vr41xx/irq.h>
26 26
27typedef struct irq_cascade { 27typedef struct irq_cascade {
28 int (*get_irq)(unsigned int, struct pt_regs *); 28 int (*get_irq)(unsigned int, struct pt_regs *);
@@ -62,7 +62,7 @@ EXPORT_SYMBOL_GPL(cascade_irq);
62static void irq_dispatch(unsigned int irq, struct pt_regs *regs) 62static void irq_dispatch(unsigned int irq, struct pt_regs *regs)
63{ 63{
64 irq_cascade_t *cascade; 64 irq_cascade_t *cascade;
65 irq_desc_t *desc; 65 struct irq_desc *desc;
66 66
67 if (irq >= NR_IRQS) { 67 if (irq >= NR_IRQS) {
68 atomic_inc(&irq_err_count); 68 atomic_inc(&irq_err_count);
diff --git a/arch/mips/vr41xx/common/vrc4173.c b/arch/mips/vr41xx/common/vrc4173.c
deleted file mode 100644
index 2d287b8893d9..000000000000
--- a/arch/mips/vr41xx/common/vrc4173.c
+++ /dev/null
@@ -1,581 +0,0 @@
1/*
2 * vrc4173.c, NEC VRC4173 base driver for NEC VR4122/VR4131.
3 *
4 * Copyright (C) 2001-2003 MontaVista Software Inc.
5 * Author: Yoichi Yuasa <yyuasa@mvista.com, or source@mvista.com>
6 * Copyright (C) 2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
7 * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org)
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */
23#include <linux/init.h>
24#include <linux/module.h>
25#include <linux/interrupt.h>
26#include <linux/irq.h>
27#include <linux/pci.h>
28#include <linux/spinlock.h>
29#include <linux/types.h>
30
31#include <asm/vr41xx/vr41xx.h>
32#include <asm/vr41xx/vrc4173.h>
33
34MODULE_DESCRIPTION("NEC VRC4173 base driver for NEC VR4122/4131");
35MODULE_AUTHOR("Yoichi Yuasa <yyuasa@mvista.com>");
36MODULE_LICENSE("GPL");
37
38#define VRC4173_CMUCLKMSK 0x040
39 #define MSKPIU 0x0001
40 #define MSKKIU 0x0002
41 #define MSKAIU 0x0004
42 #define MSKPS2CH1 0x0008
43 #define MSKPS2CH2 0x0010
44 #define MSKUSB 0x0020
45 #define MSKCARD1 0x0040
46 #define MSKCARD2 0x0080
47 #define MSKAC97 0x0100
48 #define MSK48MUSB 0x0400
49 #define MSK48MPIN 0x0800
50 #define MSK48MOSC 0x1000
51#define VRC4173_CMUSRST 0x042
52 #define USBRST 0x0001
53 #define CARD1RST 0x0002
54 #define CARD2RST 0x0004
55 #define AC97RST 0x0008
56
57#define VRC4173_SYSINT1REG 0x060
58#define VRC4173_MSYSINT1REG 0x06c
59#define VRC4173_MPIUINTREG 0x06e
60#define VRC4173_MAIUINTREG 0x070
61#define VRC4173_MKIUINTREG 0x072
62
63#define VRC4173_SELECTREG 0x09e
64 #define SEL3 0x0008
65 #define SEL2 0x0004
66 #define SEL1 0x0002
67 #define SEL0 0x0001
68
69static struct pci_device_id vrc4173_id_table[] __devinitdata = {
70 { .vendor = PCI_VENDOR_ID_NEC,
71 .device = PCI_DEVICE_ID_NEC_VRC4173,
72 .subvendor = PCI_ANY_ID,
73 .subdevice = PCI_ANY_ID, },
74 { .vendor = 0, },
75};
76
77unsigned long vrc4173_io_offset = 0;
78
79EXPORT_SYMBOL(vrc4173_io_offset);
80
81static int vrc4173_initialized;
82static uint16_t vrc4173_cmuclkmsk;
83static uint16_t vrc4173_selectreg;
84static DEFINE_SPINLOCK(vrc4173_cmu_lock);
85static DEFINE_SPINLOCK(vrc4173_giu_lock);
86
87static inline void set_cmusrst(uint16_t val)
88{
89 uint16_t cmusrst;
90
91 cmusrst = vrc4173_inw(VRC4173_CMUSRST);
92 cmusrst |= val;
93 vrc4173_outw(cmusrst, VRC4173_CMUSRST);
94}
95
96static inline void clear_cmusrst(uint16_t val)
97{
98 uint16_t cmusrst;
99
100 cmusrst = vrc4173_inw(VRC4173_CMUSRST);
101 cmusrst &= ~val;
102 vrc4173_outw(cmusrst, VRC4173_CMUSRST);
103}
104
105void vrc4173_supply_clock(vrc4173_clock_t clock)
106{
107 if (vrc4173_initialized) {
108 spin_lock_irq(&vrc4173_cmu_lock);
109
110 switch (clock) {
111 case VRC4173_PIU_CLOCK:
112 vrc4173_cmuclkmsk |= MSKPIU;
113 break;
114 case VRC4173_KIU_CLOCK:
115 vrc4173_cmuclkmsk |= MSKKIU;
116 break;
117 case VRC4173_AIU_CLOCK:
118 vrc4173_cmuclkmsk |= MSKAIU;
119 break;
120 case VRC4173_PS2_CH1_CLOCK:
121 vrc4173_cmuclkmsk |= MSKPS2CH1;
122 break;
123 case VRC4173_PS2_CH2_CLOCK:
124 vrc4173_cmuclkmsk |= MSKPS2CH2;
125 break;
126 case VRC4173_USBU_PCI_CLOCK:
127 set_cmusrst(USBRST);
128 vrc4173_cmuclkmsk |= MSKUSB;
129 break;
130 case VRC4173_CARDU1_PCI_CLOCK:
131 set_cmusrst(CARD1RST);
132 vrc4173_cmuclkmsk |= MSKCARD1;
133 break;
134 case VRC4173_CARDU2_PCI_CLOCK:
135 set_cmusrst(CARD2RST);
136 vrc4173_cmuclkmsk |= MSKCARD2;
137 break;
138 case VRC4173_AC97U_PCI_CLOCK:
139 set_cmusrst(AC97RST);
140 vrc4173_cmuclkmsk |= MSKAC97;
141 break;
142 case VRC4173_USBU_48MHz_CLOCK:
143 set_cmusrst(USBRST);
144 vrc4173_cmuclkmsk |= MSK48MUSB;
145 break;
146 case VRC4173_EXT_48MHz_CLOCK:
147 if (vrc4173_cmuclkmsk & MSK48MOSC)
148 vrc4173_cmuclkmsk |= MSK48MPIN;
149 else
150 printk(KERN_WARNING
151 "vrc4173_supply_clock: "
152 "Please supply VRC4173_48MHz_CLOCK first "
153 "rather than VRC4173_EXT_48MHz_CLOCK.\n");
154 break;
155 case VRC4173_48MHz_CLOCK:
156 vrc4173_cmuclkmsk |= MSK48MOSC;
157 break;
158 default:
159 printk(KERN_WARNING
160 "vrc4173_supply_clock: Invalid CLOCK value %u\n", clock);
161 break;
162 }
163
164 vrc4173_outw(vrc4173_cmuclkmsk, VRC4173_CMUCLKMSK);
165
166 switch (clock) {
167 case VRC4173_USBU_PCI_CLOCK:
168 case VRC4173_USBU_48MHz_CLOCK:
169 clear_cmusrst(USBRST);
170 break;
171 case VRC4173_CARDU1_PCI_CLOCK:
172 clear_cmusrst(CARD1RST);
173 break;
174 case VRC4173_CARDU2_PCI_CLOCK:
175 clear_cmusrst(CARD2RST);
176 break;
177 case VRC4173_AC97U_PCI_CLOCK:
178 clear_cmusrst(AC97RST);
179 break;
180 default:
181 break;
182 }
183
184 spin_unlock_irq(&vrc4173_cmu_lock);
185 }
186}
187
188EXPORT_SYMBOL(vrc4173_supply_clock);
189
190void vrc4173_mask_clock(vrc4173_clock_t clock)
191{
192 if (vrc4173_initialized) {
193 spin_lock_irq(&vrc4173_cmu_lock);
194
195 switch (clock) {
196 case VRC4173_PIU_CLOCK:
197 vrc4173_cmuclkmsk &= ~MSKPIU;
198 break;
199 case VRC4173_KIU_CLOCK:
200 vrc4173_cmuclkmsk &= ~MSKKIU;
201 break;
202 case VRC4173_AIU_CLOCK:
203 vrc4173_cmuclkmsk &= ~MSKAIU;
204 break;
205 case VRC4173_PS2_CH1_CLOCK:
206 vrc4173_cmuclkmsk &= ~MSKPS2CH1;
207 break;
208 case VRC4173_PS2_CH2_CLOCK:
209 vrc4173_cmuclkmsk &= ~MSKPS2CH2;
210 break;
211 case VRC4173_USBU_PCI_CLOCK:
212 set_cmusrst(USBRST);
213 vrc4173_cmuclkmsk &= ~MSKUSB;
214 break;
215 case VRC4173_CARDU1_PCI_CLOCK:
216 set_cmusrst(CARD1RST);
217 vrc4173_cmuclkmsk &= ~MSKCARD1;
218 break;
219 case VRC4173_CARDU2_PCI_CLOCK:
220 set_cmusrst(CARD2RST);
221 vrc4173_cmuclkmsk &= ~MSKCARD2;
222 break;
223 case VRC4173_AC97U_PCI_CLOCK:
224 set_cmusrst(AC97RST);
225 vrc4173_cmuclkmsk &= ~MSKAC97;
226 break;
227 case VRC4173_USBU_48MHz_CLOCK:
228 set_cmusrst(USBRST);
229 vrc4173_cmuclkmsk &= ~MSK48MUSB;
230 break;
231 case VRC4173_EXT_48MHz_CLOCK:
232 vrc4173_cmuclkmsk &= ~MSK48MPIN;
233 break;
234 case VRC4173_48MHz_CLOCK:
235 vrc4173_cmuclkmsk &= ~MSK48MOSC;
236 break;
237 default:
238 printk(KERN_WARNING "vrc4173_mask_clock: Invalid CLOCK value %u\n", clock);
239 break;
240 }
241
242 vrc4173_outw(vrc4173_cmuclkmsk, VRC4173_CMUCLKMSK);
243
244 switch (clock) {
245 case VRC4173_USBU_PCI_CLOCK:
246 case VRC4173_USBU_48MHz_CLOCK:
247 clear_cmusrst(USBRST);
248 break;
249 case VRC4173_CARDU1_PCI_CLOCK:
250 clear_cmusrst(CARD1RST);
251 break;
252 case VRC4173_CARDU2_PCI_CLOCK:
253 clear_cmusrst(CARD2RST);
254 break;
255 case VRC4173_AC97U_PCI_CLOCK:
256 clear_cmusrst(AC97RST);
257 break;
258 default:
259 break;
260 }
261
262 spin_unlock_irq(&vrc4173_cmu_lock);
263 }
264}
265
266EXPORT_SYMBOL(vrc4173_mask_clock);
267
268static inline void vrc4173_cmu_init(void)
269{
270 vrc4173_cmuclkmsk = vrc4173_inw(VRC4173_CMUCLKMSK);
271
272 spin_lock_init(&vrc4173_cmu_lock);
273}
274
275void vrc4173_select_function(vrc4173_function_t function)
276{
277 if (vrc4173_initialized) {
278 spin_lock_irq(&vrc4173_giu_lock);
279
280 switch(function) {
281 case PS2_CHANNEL1:
282 vrc4173_selectreg |= SEL2;
283 break;
284 case PS2_CHANNEL2:
285 vrc4173_selectreg |= SEL1;
286 break;
287 case TOUCHPANEL:
288 vrc4173_selectreg &= SEL2 | SEL1 | SEL0;
289 break;
290 case KEYBOARD_8SCANLINES:
291 vrc4173_selectreg &= SEL3 | SEL2 | SEL1;
292 break;
293 case KEYBOARD_10SCANLINES:
294 vrc4173_selectreg &= SEL3 | SEL2;
295 break;
296 case KEYBOARD_12SCANLINES:
297 vrc4173_selectreg &= SEL3;
298 break;
299 case GPIO_0_15PINS:
300 vrc4173_selectreg |= SEL0;
301 break;
302 case GPIO_16_20PINS:
303 vrc4173_selectreg |= SEL3;
304 break;
305 }
306
307 vrc4173_outw(vrc4173_selectreg, VRC4173_SELECTREG);
308
309 spin_unlock_irq(&vrc4173_giu_lock);
310 }
311}
312
313EXPORT_SYMBOL(vrc4173_select_function);
314
315static inline void vrc4173_giu_init(void)
316{
317 vrc4173_selectreg = vrc4173_inw(VRC4173_SELECTREG);
318
319 spin_lock_init(&vrc4173_giu_lock);
320}
321
322void vrc4173_enable_piuint(uint16_t mask)
323{
324 irq_desc_t *desc = irq_desc + VRC4173_PIU_IRQ;
325 unsigned long flags;
326 uint16_t val;
327
328 spin_lock_irqsave(&desc->lock, flags);
329 val = vrc4173_inw(VRC4173_MPIUINTREG);
330 val |= mask;
331 vrc4173_outw(val, VRC4173_MPIUINTREG);
332 spin_unlock_irqrestore(&desc->lock, flags);
333}
334
335EXPORT_SYMBOL(vrc4173_enable_piuint);
336
337void vrc4173_disable_piuint(uint16_t mask)
338{
339 irq_desc_t *desc = irq_desc + VRC4173_PIU_IRQ;
340 unsigned long flags;
341 uint16_t val;
342
343 spin_lock_irqsave(&desc->lock, flags);
344 val = vrc4173_inw(VRC4173_MPIUINTREG);
345 val &= ~mask;
346 vrc4173_outw(val, VRC4173_MPIUINTREG);
347 spin_unlock_irqrestore(&desc->lock, flags);
348}
349
350EXPORT_SYMBOL(vrc4173_disable_piuint);
351
352void vrc4173_enable_aiuint(uint16_t mask)
353{
354 irq_desc_t *desc = irq_desc + VRC4173_AIU_IRQ;
355 unsigned long flags;
356 uint16_t val;
357
358 spin_lock_irqsave(&desc->lock, flags);
359 val = vrc4173_inw(VRC4173_MAIUINTREG);
360 val |= mask;
361 vrc4173_outw(val, VRC4173_MAIUINTREG);
362 spin_unlock_irqrestore(&desc->lock, flags);
363}
364
365EXPORT_SYMBOL(vrc4173_enable_aiuint);
366
367void vrc4173_disable_aiuint(uint16_t mask)
368{
369 irq_desc_t *desc = irq_desc + VRC4173_AIU_IRQ;
370 unsigned long flags;
371 uint16_t val;
372
373 spin_lock_irqsave(&desc->lock, flags);
374 val = vrc4173_inw(VRC4173_MAIUINTREG);
375 val &= ~mask;
376 vrc4173_outw(val, VRC4173_MAIUINTREG);
377 spin_unlock_irqrestore(&desc->lock, flags);
378}
379
380EXPORT_SYMBOL(vrc4173_disable_aiuint);
381
382void vrc4173_enable_kiuint(uint16_t mask)
383{
384 irq_desc_t *desc = irq_desc + VRC4173_KIU_IRQ;
385 unsigned long flags;
386 uint16_t val;
387
388 spin_lock_irqsave(&desc->lock, flags);
389 val = vrc4173_inw(VRC4173_MKIUINTREG);
390 val |= mask;
391 vrc4173_outw(val, VRC4173_MKIUINTREG);
392 spin_unlock_irqrestore(&desc->lock, flags);
393}
394
395EXPORT_SYMBOL(vrc4173_enable_kiuint);
396
397void vrc4173_disable_kiuint(uint16_t mask)
398{
399 irq_desc_t *desc = irq_desc + VRC4173_KIU_IRQ;
400 unsigned long flags;
401 uint16_t val;
402
403 spin_lock_irqsave(&desc->lock, flags);
404 val = vrc4173_inw(VRC4173_MKIUINTREG);
405 val &= ~mask;
406 vrc4173_outw(val, VRC4173_MKIUINTREG);
407 spin_unlock_irqrestore(&desc->lock, flags);
408}
409
410EXPORT_SYMBOL(vrc4173_disable_kiuint);
411
412static void enable_vrc4173_irq(unsigned int irq)
413{
414 uint16_t val;
415
416 val = vrc4173_inw(VRC4173_MSYSINT1REG);
417 val |= (uint16_t)1 << (irq - VRC4173_IRQ_BASE);
418 vrc4173_outw(val, VRC4173_MSYSINT1REG);
419}
420
421static void disable_vrc4173_irq(unsigned int irq)
422{
423 uint16_t val;
424
425 val = vrc4173_inw(VRC4173_MSYSINT1REG);
426 val &= ~((uint16_t)1 << (irq - VRC4173_IRQ_BASE));
427 vrc4173_outw(val, VRC4173_MSYSINT1REG);
428}
429
430static unsigned int startup_vrc4173_irq(unsigned int irq)
431{
432 enable_vrc4173_irq(irq);
433 return 0; /* never anything pending */
434}
435
436#define shutdown_vrc4173_irq disable_vrc4173_irq
437#define ack_vrc4173_irq disable_vrc4173_irq
438
439static void end_vrc4173_irq(unsigned int irq)
440{
441 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
442 enable_vrc4173_irq(irq);
443}
444
445static struct hw_interrupt_type vrc4173_irq_type = {
446 .typename = "VRC4173",
447 .startup = startup_vrc4173_irq,
448 .shutdown = shutdown_vrc4173_irq,
449 .enable = enable_vrc4173_irq,
450 .disable = disable_vrc4173_irq,
451 .ack = ack_vrc4173_irq,
452 .end = end_vrc4173_irq,
453};
454
455static int vrc4173_get_irq_number(int irq)
456{
457 uint16_t status, mask;
458 int i;
459
460 status = vrc4173_inw(VRC4173_SYSINT1REG);
461 mask = vrc4173_inw(VRC4173_MSYSINT1REG);
462
463 status &= mask;
464 if (status) {
465 for (i = 0; i < 16; i++)
466 if (status & (0x0001 << i))
467 return VRC4173_IRQ(i);
468 }
469
470 return -EINVAL;
471}
472
473static inline int vrc4173_icu_init(int cascade_irq)
474{
475 int i;
476
477 if (cascade_irq < GIU_IRQ(0) || cascade_irq > GIU_IRQ(15))
478 return -EINVAL;
479
480 vrc4173_outw(0, VRC4173_MSYSINT1REG);
481
482 vr41xx_set_irq_trigger(GIU_IRQ_TO_PIN(cascade_irq), TRIGGER_LEVEL, SIGNAL_THROUGH);
483 vr41xx_set_irq_level(GIU_IRQ_TO_PIN(cascade_irq), LEVEL_LOW);
484
485 for (i = VRC4173_IRQ_BASE; i <= VRC4173_IRQ_LAST; i++)
486 irq_desc[i].chip = &vrc4173_irq_type;
487
488 return 0;
489}
490
491static int __devinit vrc4173_probe(struct pci_dev *dev,
492 const struct pci_device_id *id)
493{
494 unsigned long start, flags;
495 int err;
496
497 err = pci_enable_device(dev);
498 if (err < 0) {
499 printk(KERN_ERR "vrc4173: Failed to enable PCI device, aborting\n");
500 return err;
501 }
502
503 pci_set_master(dev);
504
505 start = pci_resource_start(dev, 0);
506 if (start == 0) {
507 printk(KERN_ERR "vrc4173:No such PCI I/O resource, aborting\n");
508 return -ENXIO;
509 }
510
511 flags = pci_resource_flags(dev, 0);
512 if ((flags & IORESOURCE_IO) == 0) {
513 printk(KERN_ERR "vrc4173: No such PCI I/O resource, aborting\n");
514 return -ENXIO;
515 }
516
517 err = pci_request_regions(dev, "NEC VRC4173");
518 if (err < 0) {
519 printk(KERN_ERR "vrc4173: PCI resources are busy, aborting\n");
520 return err;
521 }
522
523 set_vrc4173_io_offset(start);
524
525 vrc4173_cmu_init();
526 vrc4173_giu_init();
527
528 err = vrc4173_icu_init(dev->irq);
529 if (err < 0) {
530 printk(KERN_ERR "vrc4173: Invalid IRQ %d, aborting\n", dev->irq);
531 return err;
532 }
533
534 err = vr41xx_cascade_irq(dev->irq, vrc4173_get_irq_number);
535 if (err < 0) {
536 printk(KERN_ERR "vrc4173: IRQ resource %d is busy, aborting\n", dev->irq);
537 return err;
538 }
539
540 printk(KERN_INFO
541 "NEC VRC4173 at 0x%#08lx, IRQ is cascaded to %d\n", start, dev->irq);
542
543 return 0;
544}
545
546static void vrc4173_remove(struct pci_dev *dev)
547{
548 free_irq(dev->irq, NULL);
549
550 pci_release_regions(dev);
551}
552
553static struct pci_driver vrc4173_driver = {
554 .name = "NEC VRC4173",
555 .probe = vrc4173_probe,
556 .remove = vrc4173_remove,
557 .id_table = vrc4173_id_table,
558};
559
560static int __devinit vrc4173_init(void)
561{
562 int err;
563
564 err = pci_register_driver(&vrc4173_driver);
565 if (err < 0)
566 return err;
567
568 vrc4173_initialized = 1;
569
570 return 0;
571}
572
573static void __devexit vrc4173_exit(void)
574{
575 vrc4173_initialized = 0;
576
577 pci_unregister_driver(&vrc4173_driver);
578}
579
580module_init(vrc4173_init);
581module_exit(vrc4173_exit);
diff --git a/arch/mips/vr41xx/ibm-workpad/setup.c b/arch/mips/vr41xx/ibm-workpad/setup.c
index 50fe8af4c52c..9eef297eca1a 100644
--- a/arch/mips/vr41xx/ibm-workpad/setup.c
+++ b/arch/mips/vr41xx/ibm-workpad/setup.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * setup.c, Setup for the IBM WorkPad z50. 2 * setup.c, Setup for the IBM WorkPad z50.
3 * 3 *
4 * Copyright (C) 2002-2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2002-2006 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
@@ -21,13 +21,18 @@
21#include <linux/ioport.h> 21#include <linux/ioport.h>
22 22
23#include <asm/io.h> 23#include <asm/io.h>
24#include <asm/vr41xx/workpad.h> 24
25#define WORKPAD_ISA_IO_BASE 0x15000000
26#define WORKPAD_ISA_IO_SIZE 0x03000000
27#define WORKPAD_ISA_IO_START 0
28#define WORKPAD_ISA_IO_END (WORKPAD_ISA_IO_SIZE - 1)
29#define WORKPAD_IO_PORT_BASE KSEG1ADDR(WORKPAD_ISA_IO_BASE)
25 30
26static int __init ibm_workpad_setup(void) 31static int __init ibm_workpad_setup(void)
27{ 32{
28 set_io_port_base(IO_PORT_BASE); 33 set_io_port_base(WORKPAD_IO_PORT_BASE);
29 ioport_resource.start = IO_PORT_RESOURCE_START; 34 ioport_resource.start = WORKPAD_ISA_IO_START;
30 ioport_resource.end = IO_PORT_RESOURCE_END; 35 ioport_resource.end = WORKPAD_ISA_IO_END;
31 36
32 return 0; 37 return 0;
33} 38}
diff --git a/arch/mips/vr41xx/nec-cmbvr4133/irq.c b/arch/mips/vr41xx/nec-cmbvr4133/irq.c
index 7b2511ca0a61..2483487344c2 100644
--- a/arch/mips/vr41xx/nec-cmbvr4133/irq.c
+++ b/arch/mips/vr41xx/nec-cmbvr4133/irq.c
@@ -62,7 +62,7 @@ static void end_i8259_irq(unsigned int irq)
62 enable_8259A_irq(irq - I8259_IRQ_BASE); 62 enable_8259A_irq(irq - I8259_IRQ_BASE);
63} 63}
64 64
65static struct hw_interrupt_type i8259_irq_type = { 65static struct irq_chip i8259_irq_type = {
66 .typename = "XT-PIC", 66 .typename = "XT-PIC",
67 .startup = startup_i8259_irq, 67 .startup = startup_i8259_irq,
68 .shutdown = shutdown_i8259_irq, 68 .shutdown = shutdown_i8259_irq,
diff --git a/arch/parisc/kernel/pdc_cons.c b/arch/parisc/kernel/pdc_cons.c
index ce78f412ff2e..aab05767427c 100644
--- a/arch/parisc/kernel/pdc_cons.c
+++ b/arch/parisc/kernel/pdc_cons.c
@@ -89,6 +89,8 @@ static int pdc_console_setup(struct console *co, char *options)
89} 89}
90 90
91#if defined(CONFIG_PDC_CONSOLE) 91#if defined(CONFIG_PDC_CONSOLE)
92#include <linux/vt_kern.h>
93
92static struct tty_driver * pdc_console_device (struct console *c, int *index) 94static struct tty_driver * pdc_console_device (struct console *c, int *index)
93{ 95{
94 extern struct tty_driver console_driver; 96 extern struct tty_driver console_driver;
diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S
index 9989495a51dd..b3677fc8eef5 100644
--- a/arch/parisc/kernel/vmlinux.lds.S
+++ b/arch/parisc/kernel/vmlinux.lds.S
@@ -204,6 +204,7 @@ SECTIONS
204 *(.dynstr) 204 *(.dynstr)
205 *(.dynamic) 205 *(.dynamic)
206 *(.hash) 206 *(.hash)
207 *(.gnu.hash)
207#endif 208#endif
208 } 209 }
209 210
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 2643dbc3f289..13e583f16ede 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -504,7 +504,7 @@ config CPU_FREQ_PMAC
504 504
505config CPU_FREQ_PMAC64 505config CPU_FREQ_PMAC64
506 bool "Support for some Apple G5s" 506 bool "Support for some Apple G5s"
507 depends on CPU_FREQ && PMAC_SMU && PPC64 507 depends on CPU_FREQ && PPC64
508 select CPU_FREQ_TABLE 508 select CPU_FREQ_TABLE
509 help 509 help
510 This adds support for frequency switching on Apple iMac G5, 510 This adds support for frequency switching on Apple iMac G5,
diff --git a/arch/powerpc/configs/pmac32_defconfig b/arch/powerpc/configs/pmac32_defconfig
index addc79381c3b..3545af9896af 100644
--- a/arch/powerpc/configs/pmac32_defconfig
+++ b/arch/powerpc/configs/pmac32_defconfig
@@ -1,16 +1,18 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc5 3# Linux kernel version: 2.6.17
4# Mon May 29 14:47:49 2006 4# Mon Jul 3 14:20:49 2006
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7CONFIG_PPC32=y 7CONFIG_PPC32=y
8CONFIG_PPC_MERGE=y 8CONFIG_PPC_MERGE=y
9CONFIG_MMU=y 9CONFIG_MMU=y
10CONFIG_GENERIC_HARDIRQS=y 10CONFIG_GENERIC_HARDIRQS=y
11CONFIG_IRQ_PER_CPU=y
11CONFIG_RWSEM_XCHGADD_ALGORITHM=y 12CONFIG_RWSEM_XCHGADD_ALGORITHM=y
12CONFIG_GENERIC_HWEIGHT=y 13CONFIG_GENERIC_HWEIGHT=y
13CONFIG_GENERIC_CALIBRATE_DELAY=y 14CONFIG_GENERIC_CALIBRATE_DELAY=y
15CONFIG_GENERIC_FIND_NEXT_BIT=y
14CONFIG_PPC=y 16CONFIG_PPC=y
15CONFIG_EARLY_PRINTK=y 17CONFIG_EARLY_PRINTK=y
16CONFIG_GENERIC_NVRAM=y 18CONFIG_GENERIC_NVRAM=y
@@ -29,6 +31,7 @@ CONFIG_CLASSIC32=y
29# CONFIG_PPC_82xx is not set 31# CONFIG_PPC_82xx is not set
30# CONFIG_PPC_83xx is not set 32# CONFIG_PPC_83xx is not set
31# CONFIG_PPC_85xx is not set 33# CONFIG_PPC_85xx is not set
34# CONFIG_PPC_86xx is not set
32# CONFIG_40x is not set 35# CONFIG_40x is not set
33# CONFIG_44x is not set 36# CONFIG_44x is not set
34# CONFIG_8xx is not set 37# CONFIG_8xx is not set
@@ -39,6 +42,7 @@ CONFIG_ALTIVEC=y
39CONFIG_PPC_STD_MMU=y 42CONFIG_PPC_STD_MMU=y
40CONFIG_PPC_STD_MMU_32=y 43CONFIG_PPC_STD_MMU_32=y
41# CONFIG_SMP is not set 44# CONFIG_SMP is not set
45CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
42 46
43# 47#
44# Code maturity level options 48# Code maturity level options
@@ -72,10 +76,12 @@ CONFIG_PRINTK=y
72CONFIG_BUG=y 76CONFIG_BUG=y
73CONFIG_ELF_CORE=y 77CONFIG_ELF_CORE=y
74CONFIG_BASE_FULL=y 78CONFIG_BASE_FULL=y
79CONFIG_RT_MUTEXES=y
75CONFIG_FUTEX=y 80CONFIG_FUTEX=y
76CONFIG_EPOLL=y 81CONFIG_EPOLL=y
77CONFIG_SHMEM=y 82CONFIG_SHMEM=y
78CONFIG_SLAB=y 83CONFIG_SLAB=y
84CONFIG_VM_EVENT_COUNTERS=y
79# CONFIG_TINY_SHMEM is not set 85# CONFIG_TINY_SHMEM is not set
80CONFIG_BASE_SMALL=0 86CONFIG_BASE_SMALL=0
81# CONFIG_SLOB is not set 87# CONFIG_SLOB is not set
@@ -119,6 +125,9 @@ CONFIG_PPC_MULTIPLATFORM=y
119# CONFIG_APUS is not set 125# CONFIG_APUS is not set
120# CONFIG_PPC_CHRP is not set 126# CONFIG_PPC_CHRP is not set
121CONFIG_PPC_PMAC=y 127CONFIG_PPC_PMAC=y
128# CONFIG_PPC_CELL is not set
129# CONFIG_PPC_CELL_NATIVE is not set
130# CONFIG_UDBG_RTAS_CONSOLE is not set
122CONFIG_MPIC=y 131CONFIG_MPIC=y
123# CONFIG_PPC_RTAS is not set 132# CONFIG_PPC_RTAS is not set
124# CONFIG_MMIO_NVRAM is not set 133# CONFIG_MMIO_NVRAM is not set
@@ -154,6 +163,7 @@ CONFIG_PREEMPT_NONE=y
154# CONFIG_PREEMPT is not set 163# CONFIG_PREEMPT is not set
155CONFIG_BINFMT_ELF=y 164CONFIG_BINFMT_ELF=y
156CONFIG_BINFMT_MISC=m 165CONFIG_BINFMT_MISC=m
166CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
157# CONFIG_KEXEC is not set 167# CONFIG_KEXEC is not set
158CONFIG_ARCH_FLATMEM_ENABLE=y 168CONFIG_ARCH_FLATMEM_ENABLE=y
159CONFIG_SELECT_MEMORY_MODEL=y 169CONFIG_SELECT_MEMORY_MODEL=y
@@ -164,6 +174,7 @@ CONFIG_FLATMEM=y
164CONFIG_FLAT_NODE_MEM_MAP=y 174CONFIG_FLAT_NODE_MEM_MAP=y
165# CONFIG_SPARSEMEM_STATIC is not set 175# CONFIG_SPARSEMEM_STATIC is not set
166CONFIG_SPLIT_PTLOCK_CPUS=4 176CONFIG_SPLIT_PTLOCK_CPUS=4
177# CONFIG_RESOURCES_64BIT is not set
167CONFIG_PROC_DEVICETREE=y 178CONFIG_PROC_DEVICETREE=y
168# CONFIG_CMDLINE_BOOL is not set 179# CONFIG_CMDLINE_BOOL is not set
169CONFIG_PM=y 180CONFIG_PM=y
@@ -182,6 +193,7 @@ CONFIG_GENERIC_ISA_DMA=y
182CONFIG_PPC_INDIRECT_PCI=y 193CONFIG_PPC_INDIRECT_PCI=y
183CONFIG_PCI=y 194CONFIG_PCI=y
184CONFIG_PCI_DOMAINS=y 195CONFIG_PCI_DOMAINS=y
196# CONFIG_PCIEPORTBUS is not set
185# CONFIG_PCI_DEBUG is not set 197# CONFIG_PCI_DEBUG is not set
186 198
187# 199#
@@ -256,6 +268,8 @@ CONFIG_INET_ESP=y
256# CONFIG_INET_IPCOMP is not set 268# CONFIG_INET_IPCOMP is not set
257# CONFIG_INET_XFRM_TUNNEL is not set 269# CONFIG_INET_XFRM_TUNNEL is not set
258# CONFIG_INET_TUNNEL is not set 270# CONFIG_INET_TUNNEL is not set
271# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
272# CONFIG_INET_XFRM_MODE_TUNNEL is not set
259CONFIG_INET_DIAG=y 273CONFIG_INET_DIAG=y
260CONFIG_INET_TCP_DIAG=y 274CONFIG_INET_TCP_DIAG=y
261# CONFIG_TCP_CONG_ADVANCED is not set 275# CONFIG_TCP_CONG_ADVANCED is not set
@@ -268,6 +282,7 @@ CONFIG_TCP_CONG_BIC=y
268# CONFIG_IPV6 is not set 282# CONFIG_IPV6 is not set
269# CONFIG_INET6_XFRM_TUNNEL is not set 283# CONFIG_INET6_XFRM_TUNNEL is not set
270# CONFIG_INET6_TUNNEL is not set 284# CONFIG_INET6_TUNNEL is not set
285# CONFIG_NETWORK_SECMARK is not set
271CONFIG_NETFILTER=y 286CONFIG_NETFILTER=y
272# CONFIG_NETFILTER_DEBUG is not set 287# CONFIG_NETFILTER_DEBUG is not set
273 288
@@ -292,9 +307,11 @@ CONFIG_NETFILTER_XT_MATCH_MARK=m
292CONFIG_NETFILTER_XT_MATCH_POLICY=m 307CONFIG_NETFILTER_XT_MATCH_POLICY=m
293CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m 308CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
294CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 309CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
310# CONFIG_NETFILTER_XT_MATCH_QUOTA is not set
295CONFIG_NETFILTER_XT_MATCH_REALM=m 311CONFIG_NETFILTER_XT_MATCH_REALM=m
296CONFIG_NETFILTER_XT_MATCH_SCTP=m 312CONFIG_NETFILTER_XT_MATCH_SCTP=m
297CONFIG_NETFILTER_XT_MATCH_STATE=m 313CONFIG_NETFILTER_XT_MATCH_STATE=m
314# CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set
298CONFIG_NETFILTER_XT_MATCH_STRING=m 315CONFIG_NETFILTER_XT_MATCH_STRING=m
299CONFIG_NETFILTER_XT_MATCH_TCPMSS=m 316CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
300 317
@@ -313,6 +330,7 @@ CONFIG_IP_NF_TFTP=m
313CONFIG_IP_NF_AMANDA=m 330CONFIG_IP_NF_AMANDA=m
314CONFIG_IP_NF_PPTP=m 331CONFIG_IP_NF_PPTP=m
315CONFIG_IP_NF_H323=m 332CONFIG_IP_NF_H323=m
333# CONFIG_IP_NF_SIP is not set
316# CONFIG_IP_NF_QUEUE is not set 334# CONFIG_IP_NF_QUEUE is not set
317CONFIG_IP_NF_IPTABLES=m 335CONFIG_IP_NF_IPTABLES=m
318CONFIG_IP_NF_MATCH_IPRANGE=m 336CONFIG_IP_NF_MATCH_IPRANGE=m
@@ -457,6 +475,7 @@ CONFIG_IRTTY_SIR=m
457# CONFIG_ALI_FIR is not set 475# CONFIG_ALI_FIR is not set
458# CONFIG_VLSI_FIR is not set 476# CONFIG_VLSI_FIR is not set
459# CONFIG_VIA_FIR is not set 477# CONFIG_VIA_FIR is not set
478# CONFIG_MCS_FIR is not set
460CONFIG_BT=m 479CONFIG_BT=m
461CONFIG_BT_L2CAP=m 480CONFIG_BT_L2CAP=m
462CONFIG_BT_SCO=m 481CONFIG_BT_SCO=m
@@ -500,6 +519,7 @@ CONFIG_WIRELESS_EXT=y
500CONFIG_PREVENT_FIRMWARE_BUILD=y 519CONFIG_PREVENT_FIRMWARE_BUILD=y
501CONFIG_FW_LOADER=y 520CONFIG_FW_LOADER=y
502# CONFIG_DEBUG_DRIVER is not set 521# CONFIG_DEBUG_DRIVER is not set
522# CONFIG_SYS_HYPERVISOR is not set
503 523
504# 524#
505# Connector - unified userspace <-> kernelspace linker 525# Connector - unified userspace <-> kernelspace linker
@@ -600,7 +620,6 @@ CONFIG_BLK_DEV_PDC202XX_NEW=y
600CONFIG_BLK_DEV_IDE_PMAC=y 620CONFIG_BLK_DEV_IDE_PMAC=y
601CONFIG_BLK_DEV_IDE_PMAC_ATA100FIRST=y 621CONFIG_BLK_DEV_IDE_PMAC_ATA100FIRST=y
602CONFIG_BLK_DEV_IDEDMA_PMAC=y 622CONFIG_BLK_DEV_IDEDMA_PMAC=y
603CONFIG_BLK_DEV_IDE_PMAC_BLINK=y
604# CONFIG_IDE_ARM is not set 623# CONFIG_IDE_ARM is not set
605CONFIG_BLK_DEV_IDEDMA=y 624CONFIG_BLK_DEV_IDEDMA=y
606# CONFIG_IDEDMA_IVB is not set 625# CONFIG_IDEDMA_IVB is not set
@@ -661,6 +680,7 @@ CONFIG_SCSI_AIC7XXX_OLD=m
661# CONFIG_MEGARAID_LEGACY is not set 680# CONFIG_MEGARAID_LEGACY is not set
662# CONFIG_MEGARAID_SAS is not set 681# CONFIG_MEGARAID_SAS is not set
663# CONFIG_SCSI_SATA is not set 682# CONFIG_SCSI_SATA is not set
683# CONFIG_SCSI_HPTIOP is not set
664# CONFIG_SCSI_BUSLOGIC is not set 684# CONFIG_SCSI_BUSLOGIC is not set
665# CONFIG_SCSI_DMX3191D is not set 685# CONFIG_SCSI_DMX3191D is not set
666# CONFIG_SCSI_EATA is not set 686# CONFIG_SCSI_EATA is not set
@@ -705,9 +725,7 @@ CONFIG_MD_LINEAR=m
705CONFIG_MD_RAID0=m 725CONFIG_MD_RAID0=m
706CONFIG_MD_RAID1=m 726CONFIG_MD_RAID1=m
707CONFIG_MD_RAID10=m 727CONFIG_MD_RAID10=m
708CONFIG_MD_RAID5=m 728# CONFIG_MD_RAID456 is not set
709CONFIG_MD_RAID5_RESHAPE=y
710CONFIG_MD_RAID6=m
711CONFIG_MD_MULTIPATH=m 729CONFIG_MD_MULTIPATH=m
712CONFIG_MD_FAULTY=m 730CONFIG_MD_FAULTY=m
713CONFIG_BLK_DEV_DM=m 731CONFIG_BLK_DEV_DM=m
@@ -750,7 +768,6 @@ CONFIG_IEEE1394_OHCI1394=m
750# 768#
751CONFIG_IEEE1394_VIDEO1394=m 769CONFIG_IEEE1394_VIDEO1394=m
752CONFIG_IEEE1394_SBP2=m 770CONFIG_IEEE1394_SBP2=m
753# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set
754# CONFIG_IEEE1394_ETH1394 is not set 771# CONFIG_IEEE1394_ETH1394 is not set
755CONFIG_IEEE1394_DV1394=m 772CONFIG_IEEE1394_DV1394=m
756CONFIG_IEEE1394_RAWIO=m 773CONFIG_IEEE1394_RAWIO=m
@@ -766,9 +783,12 @@ CONFIG_IEEE1394_RAWIO=m
766CONFIG_ADB=y 783CONFIG_ADB=y
767CONFIG_ADB_CUDA=y 784CONFIG_ADB_CUDA=y
768CONFIG_ADB_PMU=y 785CONFIG_ADB_PMU=y
786CONFIG_ADB_PMU_LED=y
787CONFIG_ADB_PMU_LED_IDE=y
769CONFIG_PMAC_APM_EMU=m 788CONFIG_PMAC_APM_EMU=m
770CONFIG_PMAC_MEDIABAY=y 789CONFIG_PMAC_MEDIABAY=y
771CONFIG_PMAC_BACKLIGHT=y 790CONFIG_PMAC_BACKLIGHT=y
791CONFIG_PMAC_BACKLIGHT_LEGACY=y
772CONFIG_INPUT_ADBHID=y 792CONFIG_INPUT_ADBHID=y
773CONFIG_MAC_EMUMOUSEBTN=y 793CONFIG_MAC_EMUMOUSEBTN=y
774CONFIG_THERM_WINDTUNNEL=m 794CONFIG_THERM_WINDTUNNEL=m
@@ -858,6 +878,7 @@ CONFIG_PCNET32=y
858# CONFIG_CHELSIO_T1 is not set 878# CONFIG_CHELSIO_T1 is not set
859# CONFIG_IXGB is not set 879# CONFIG_IXGB is not set
860# CONFIG_S2IO is not set 880# CONFIG_S2IO is not set
881# CONFIG_MYRI10GE is not set
861 882
862# 883#
863# Token Ring devices 884# Token Ring devices
@@ -908,6 +929,7 @@ CONFIG_APPLE_AIRPORT=m
908# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support 929# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support
909# 930#
910CONFIG_PRISM54=m 931CONFIG_PRISM54=m
932# CONFIG_USB_ZD1201 is not set
911# CONFIG_HOSTAP is not set 933# CONFIG_HOSTAP is not set
912CONFIG_NET_WIRELESS=y 934CONFIG_NET_WIRELESS=y
913 935
@@ -998,6 +1020,7 @@ CONFIG_SERIO=y
998CONFIG_VT=y 1020CONFIG_VT=y
999CONFIG_VT_CONSOLE=y 1021CONFIG_VT_CONSOLE=y
1000CONFIG_HW_CONSOLE=y 1022CONFIG_HW_CONSOLE=y
1023# CONFIG_VT_HW_CONSOLE_BINDING is not set
1001# CONFIG_SERIAL_NONSTANDARD is not set 1024# CONFIG_SERIAL_NONSTANDARD is not set
1002 1025
1003# 1026#
@@ -1029,6 +1052,7 @@ CONFIG_LEGACY_PTY_COUNT=256
1029# Watchdog Cards 1052# Watchdog Cards
1030# 1053#
1031# CONFIG_WATCHDOG is not set 1054# CONFIG_WATCHDOG is not set
1055# CONFIG_HW_RANDOM is not set
1032CONFIG_NVRAM=y 1056CONFIG_NVRAM=y
1033CONFIG_GEN_RTC=y 1057CONFIG_GEN_RTC=y
1034# CONFIG_GEN_RTC_X is not set 1058# CONFIG_GEN_RTC_X is not set
@@ -1040,6 +1064,7 @@ CONFIG_GEN_RTC=y
1040# Ftape, the floppy tape device driver 1064# Ftape, the floppy tape device driver
1041# 1065#
1042CONFIG_AGP=m 1066CONFIG_AGP=m
1067# CONFIG_AGP_SIS is not set
1043# CONFIG_AGP_VIA is not set 1068# CONFIG_AGP_VIA is not set
1044CONFIG_AGP_UNINORTH=m 1069CONFIG_AGP_UNINORTH=m
1045CONFIG_DRM=m 1070CONFIG_DRM=m
@@ -1092,6 +1117,7 @@ CONFIG_I2C_ALGOBIT=y
1092CONFIG_I2C_POWERMAC=y 1117CONFIG_I2C_POWERMAC=y
1093# CONFIG_I2C_MPC is not set 1118# CONFIG_I2C_MPC is not set
1094# CONFIG_I2C_NFORCE2 is not set 1119# CONFIG_I2C_NFORCE2 is not set
1120# CONFIG_I2C_OCORES is not set
1095# CONFIG_I2C_PARPORT_LIGHT is not set 1121# CONFIG_I2C_PARPORT_LIGHT is not set
1096# CONFIG_I2C_PROSAVAGE is not set 1122# CONFIG_I2C_PROSAVAGE is not set
1097# CONFIG_I2C_SAVAGE4 is not set 1123# CONFIG_I2C_SAVAGE4 is not set
@@ -1156,12 +1182,13 @@ CONFIG_VIDEO_V4L2=y
1156# 1182#
1157# Graphics support 1183# Graphics support
1158# 1184#
1185# CONFIG_FIRMWARE_EDID is not set
1159CONFIG_FB=y 1186CONFIG_FB=y
1160CONFIG_FB_CFB_FILLRECT=y 1187CONFIG_FB_CFB_FILLRECT=y
1161CONFIG_FB_CFB_COPYAREA=y 1188CONFIG_FB_CFB_COPYAREA=y
1162CONFIG_FB_CFB_IMAGEBLIT=y 1189CONFIG_FB_CFB_IMAGEBLIT=y
1163CONFIG_FB_MACMODES=y 1190CONFIG_FB_MACMODES=y
1164CONFIG_FB_FIRMWARE_EDID=y 1191CONFIG_FB_BACKLIGHT=y
1165CONFIG_FB_MODE_HELPERS=y 1192CONFIG_FB_MODE_HELPERS=y
1166CONFIG_FB_TILEBLITTING=y 1193CONFIG_FB_TILEBLITTING=y
1167# CONFIG_FB_CIRRUS is not set 1194# CONFIG_FB_CIRRUS is not set
@@ -1178,6 +1205,7 @@ CONFIG_FB_IMSTT=y
1178# CONFIG_FB_S1D13XXX is not set 1205# CONFIG_FB_S1D13XXX is not set
1179CONFIG_FB_NVIDIA=y 1206CONFIG_FB_NVIDIA=y
1180CONFIG_FB_NVIDIA_I2C=y 1207CONFIG_FB_NVIDIA_I2C=y
1208CONFIG_FB_NVIDIA_BACKLIGHT=y
1181# CONFIG_FB_RIVA is not set 1209# CONFIG_FB_RIVA is not set
1182CONFIG_FB_MATROX=y 1210CONFIG_FB_MATROX=y
1183CONFIG_FB_MATROX_MILLENIUM=y 1211CONFIG_FB_MATROX_MILLENIUM=y
@@ -1187,12 +1215,15 @@ CONFIG_FB_MATROX_MYSTIQUE=y
1187# CONFIG_FB_MATROX_MULTIHEAD is not set 1215# CONFIG_FB_MATROX_MULTIHEAD is not set
1188CONFIG_FB_RADEON=y 1216CONFIG_FB_RADEON=y
1189CONFIG_FB_RADEON_I2C=y 1217CONFIG_FB_RADEON_I2C=y
1218CONFIG_FB_RADEON_BACKLIGHT=y
1190# CONFIG_FB_RADEON_DEBUG is not set 1219# CONFIG_FB_RADEON_DEBUG is not set
1191CONFIG_FB_ATY128=y 1220CONFIG_FB_ATY128=y
1221CONFIG_FB_ATY128_BACKLIGHT=y
1192CONFIG_FB_ATY=y 1222CONFIG_FB_ATY=y
1193CONFIG_FB_ATY_CT=y 1223CONFIG_FB_ATY_CT=y
1194# CONFIG_FB_ATY_GENERIC_LCD is not set 1224# CONFIG_FB_ATY_GENERIC_LCD is not set
1195CONFIG_FB_ATY_GX=y 1225CONFIG_FB_ATY_GX=y
1226CONFIG_FB_ATY_BACKLIGHT=y
1196# CONFIG_FB_SAVAGE is not set 1227# CONFIG_FB_SAVAGE is not set
1197# CONFIG_FB_SIS is not set 1228# CONFIG_FB_SIS is not set
1198# CONFIG_FB_NEOMAGIC is not set 1229# CONFIG_FB_NEOMAGIC is not set
@@ -1221,7 +1252,11 @@ CONFIG_LOGO=y
1221CONFIG_LOGO_LINUX_MONO=y 1252CONFIG_LOGO_LINUX_MONO=y
1222CONFIG_LOGO_LINUX_VGA16=y 1253CONFIG_LOGO_LINUX_VGA16=y
1223CONFIG_LOGO_LINUX_CLUT224=y 1254CONFIG_LOGO_LINUX_CLUT224=y
1224# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 1255CONFIG_BACKLIGHT_LCD_SUPPORT=y
1256CONFIG_BACKLIGHT_CLASS_DEVICE=y
1257CONFIG_BACKLIGHT_DEVICE=y
1258CONFIG_LCD_CLASS_DEVICE=m
1259CONFIG_LCD_DEVICE=y
1225 1260
1226# 1261#
1227# Sound 1262# Sound
@@ -1278,6 +1313,18 @@ CONFIG_SND_DUMMY=m
1278# CONFIG_SND_CMIPCI is not set 1313# CONFIG_SND_CMIPCI is not set
1279# CONFIG_SND_CS4281 is not set 1314# CONFIG_SND_CS4281 is not set
1280# CONFIG_SND_CS46XX is not set 1315# CONFIG_SND_CS46XX is not set
1316# CONFIG_SND_DARLA20 is not set
1317# CONFIG_SND_GINA20 is not set
1318# CONFIG_SND_LAYLA20 is not set
1319# CONFIG_SND_DARLA24 is not set
1320# CONFIG_SND_GINA24 is not set
1321# CONFIG_SND_LAYLA24 is not set
1322# CONFIG_SND_MONA is not set
1323# CONFIG_SND_MIA is not set
1324# CONFIG_SND_ECHO3G is not set
1325# CONFIG_SND_INDIGO is not set
1326# CONFIG_SND_INDIGOIO is not set
1327# CONFIG_SND_INDIGODJ is not set
1281# CONFIG_SND_EMU10K1 is not set 1328# CONFIG_SND_EMU10K1 is not set
1282# CONFIG_SND_EMU10K1X is not set 1329# CONFIG_SND_EMU10K1X is not set
1283# CONFIG_SND_ENS1370 is not set 1330# CONFIG_SND_ENS1370 is not set
@@ -1315,6 +1362,17 @@ CONFIG_SND_POWERMAC=m
1315CONFIG_SND_POWERMAC_AUTO_DRC=y 1362CONFIG_SND_POWERMAC_AUTO_DRC=y
1316 1363
1317# 1364#
1365# Apple Onboard Audio driver
1366#
1367CONFIG_SND_AOA=m
1368CONFIG_SND_AOA_FABRIC_LAYOUT=m
1369CONFIG_SND_AOA_ONYX=m
1370CONFIG_SND_AOA_TAS=m
1371CONFIG_SND_AOA_TOONIE=m
1372CONFIG_SND_AOA_SOUNDBUS=m
1373CONFIG_SND_AOA_SOUNDBUS_I2S=m
1374
1375#
1318# USB devices 1376# USB devices
1319# 1377#
1320CONFIG_SND_USB_AUDIO=m 1378CONFIG_SND_USB_AUDIO=m
@@ -1355,6 +1413,7 @@ CONFIG_USB_DYNAMIC_MINORS=y
1355CONFIG_USB_EHCI_HCD=m 1413CONFIG_USB_EHCI_HCD=m
1356CONFIG_USB_EHCI_SPLIT_ISO=y 1414CONFIG_USB_EHCI_SPLIT_ISO=y
1357CONFIG_USB_EHCI_ROOT_HUB_TT=y 1415CONFIG_USB_EHCI_ROOT_HUB_TT=y
1416# CONFIG_USB_EHCI_TT_NEWSCHED is not set
1358# CONFIG_USB_ISP116X_HCD is not set 1417# CONFIG_USB_ISP116X_HCD is not set
1359CONFIG_USB_OHCI_HCD=y 1418CONFIG_USB_OHCI_HCD=y
1360# CONFIG_USB_OHCI_BIG_ENDIAN is not set 1419# CONFIG_USB_OHCI_BIG_ENDIAN is not set
@@ -1431,7 +1490,6 @@ CONFIG_USB_NET_NET1080=m
1431# CONFIG_USB_NET_RNDIS_HOST is not set 1490# CONFIG_USB_NET_RNDIS_HOST is not set
1432# CONFIG_USB_NET_CDC_SUBSET is not set 1491# CONFIG_USB_NET_CDC_SUBSET is not set
1433CONFIG_USB_NET_ZAURUS=m 1492CONFIG_USB_NET_ZAURUS=m
1434# CONFIG_USB_ZD1201 is not set
1435CONFIG_USB_MON=y 1493CONFIG_USB_MON=y
1436 1494
1437# 1495#
@@ -1499,10 +1557,12 @@ CONFIG_USB_EZUSB=y
1499# CONFIG_USB_LEGOTOWER is not set 1557# CONFIG_USB_LEGOTOWER is not set
1500# CONFIG_USB_LCD is not set 1558# CONFIG_USB_LCD is not set
1501# CONFIG_USB_LED is not set 1559# CONFIG_USB_LED is not set
1560# CONFIG_USB_CY7C63 is not set
1502# CONFIG_USB_CYTHERM is not set 1561# CONFIG_USB_CYTHERM is not set
1503# CONFIG_USB_PHIDGETKIT is not set 1562# CONFIG_USB_PHIDGETKIT is not set
1504# CONFIG_USB_PHIDGETSERVO is not set 1563# CONFIG_USB_PHIDGETSERVO is not set
1505# CONFIG_USB_IDMOUSE is not set 1564# CONFIG_USB_IDMOUSE is not set
1565CONFIG_USB_APPLEDISPLAY=m
1506# CONFIG_USB_SISUSBVGA is not set 1566# CONFIG_USB_SISUSBVGA is not set
1507# CONFIG_USB_LD is not set 1567# CONFIG_USB_LD is not set
1508# CONFIG_USB_TEST is not set 1568# CONFIG_USB_TEST is not set
@@ -1524,7 +1584,8 @@ CONFIG_USB_EZUSB=y
1524# 1584#
1525# LED devices 1585# LED devices
1526# 1586#
1527# CONFIG_NEW_LEDS is not set 1587CONFIG_NEW_LEDS=y
1588CONFIG_LEDS_CLASS=y
1528 1589
1529# 1590#
1530# LED drivers 1591# LED drivers
@@ -1533,6 +1594,10 @@ CONFIG_USB_EZUSB=y
1533# 1594#
1534# LED Triggers 1595# LED Triggers
1535# 1596#
1597CONFIG_LEDS_TRIGGERS=y
1598# CONFIG_LEDS_TRIGGER_TIMER is not set
1599CONFIG_LEDS_TRIGGER_IDE_DISK=y
1600# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set
1536 1601
1537# 1602#
1538# InfiniBand support 1603# InfiniBand support
@@ -1549,6 +1614,19 @@ CONFIG_USB_EZUSB=y
1549# CONFIG_RTC_CLASS is not set 1614# CONFIG_RTC_CLASS is not set
1550 1615
1551# 1616#
1617# DMA Engine support
1618#
1619# CONFIG_DMA_ENGINE is not set
1620
1621#
1622# DMA Clients
1623#
1624
1625#
1626# DMA Devices
1627#
1628
1629#
1552# File systems 1630# File systems
1553# 1631#
1554CONFIG_EXT2_FS=y 1632CONFIG_EXT2_FS=y
@@ -1569,6 +1647,7 @@ CONFIG_FS_POSIX_ACL=y
1569# CONFIG_MINIX_FS is not set 1647# CONFIG_MINIX_FS is not set
1570# CONFIG_ROMFS_FS is not set 1648# CONFIG_ROMFS_FS is not set
1571CONFIG_INOTIFY=y 1649CONFIG_INOTIFY=y
1650CONFIG_INOTIFY_USER=y
1572# CONFIG_QUOTA is not set 1651# CONFIG_QUOTA is not set
1573CONFIG_DNOTIFY=y 1652CONFIG_DNOTIFY=y
1574# CONFIG_AUTOFS_FS is not set 1653# CONFIG_AUTOFS_FS is not set
@@ -1649,6 +1728,7 @@ CONFIG_RPCSEC_GSS_KRB5=y
1649CONFIG_SMB_FS=m 1728CONFIG_SMB_FS=m
1650# CONFIG_SMB_NLS_DEFAULT is not set 1729# CONFIG_SMB_NLS_DEFAULT is not set
1651# CONFIG_CIFS is not set 1730# CONFIG_CIFS is not set
1731# CONFIG_CIFS_DEBUG2 is not set
1652# CONFIG_NCP_FS is not set 1732# CONFIG_NCP_FS is not set
1653# CONFIG_CODA_FS is not set 1733# CONFIG_CODA_FS is not set
1654# CONFIG_AFS_FS is not set 1734# CONFIG_AFS_FS is not set
@@ -1732,6 +1812,7 @@ CONFIG_TEXTSEARCH=y
1732CONFIG_TEXTSEARCH_KMP=m 1812CONFIG_TEXTSEARCH_KMP=m
1733CONFIG_TEXTSEARCH_BM=m 1813CONFIG_TEXTSEARCH_BM=m
1734CONFIG_TEXTSEARCH_FSM=m 1814CONFIG_TEXTSEARCH_FSM=m
1815CONFIG_PLIST=y
1735 1816
1736# 1817#
1737# Instrumentation Support 1818# Instrumentation Support
@@ -1744,12 +1825,15 @@ CONFIG_OPROFILE=y
1744# 1825#
1745# CONFIG_PRINTK_TIME is not set 1826# CONFIG_PRINTK_TIME is not set
1746# CONFIG_MAGIC_SYSRQ is not set 1827# CONFIG_MAGIC_SYSRQ is not set
1828# CONFIG_UNUSED_SYMBOLS is not set
1747CONFIG_DEBUG_KERNEL=y 1829CONFIG_DEBUG_KERNEL=y
1748CONFIG_LOG_BUF_SHIFT=14 1830CONFIG_LOG_BUF_SHIFT=14
1749CONFIG_DETECT_SOFTLOCKUP=y 1831CONFIG_DETECT_SOFTLOCKUP=y
1750# CONFIG_SCHEDSTATS is not set 1832# CONFIG_SCHEDSTATS is not set
1751# CONFIG_DEBUG_SLAB is not set 1833# CONFIG_DEBUG_SLAB is not set
1752# CONFIG_DEBUG_MUTEXES is not set 1834# CONFIG_DEBUG_MUTEXES is not set
1835# CONFIG_DEBUG_RT_MUTEXES is not set
1836# CONFIG_RT_MUTEX_TESTER is not set
1753# CONFIG_DEBUG_SPINLOCK is not set 1837# CONFIG_DEBUG_SPINLOCK is not set
1754# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1838# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1755# CONFIG_DEBUG_KOBJECT is not set 1839# CONFIG_DEBUG_KOBJECT is not set
@@ -1763,11 +1847,7 @@ CONFIG_XMON=y
1763CONFIG_XMON_DEFAULT=y 1847CONFIG_XMON_DEFAULT=y
1764# CONFIG_BDI_SWITCH is not set 1848# CONFIG_BDI_SWITCH is not set
1765CONFIG_BOOTX_TEXT=y 1849CONFIG_BOOTX_TEXT=y
1766# CONFIG_PPC_EARLY_DEBUG_LPAR is not set 1850# CONFIG_PPC_EARLY_DEBUG is not set
1767# CONFIG_PPC_EARLY_DEBUG_G5 is not set
1768# CONFIG_PPC_EARLY_DEBUG_RTAS is not set
1769# CONFIG_PPC_EARLY_DEBUG_MAPLE is not set
1770# CONFIG_PPC_EARLY_DEBUG_ISERIES is not set
1771 1851
1772# 1852#
1773# Security options 1853# Security options
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index e16eb2a33173..6ff3cf506088 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -191,6 +191,37 @@ exception_marker:
191 ori reg,reg,(label)@l; /* virt addr of handler ... */ 191 ori reg,reg,(label)@l; /* virt addr of handler ... */
192#endif 192#endif
193 193
194/*
195 * Equal to EXCEPTION_PROLOG_PSERIES, except that it forces 64bit mode.
196 * The firmware calls the registered system_reset_fwnmi and
197 * machine_check_fwnmi handlers in 32bit mode if the cpu happens to run
198 * a 32bit application at the time of the event.
199 * This firmware bug is present on POWER4 and JS20.
200 */
201#define EXCEPTION_PROLOG_PSERIES_FORCE_64BIT(area, label) \
202 mfspr r13,SPRN_SPRG3; /* get paca address into r13 */ \
203 std r9,area+EX_R9(r13); /* save r9 - r12 */ \
204 std r10,area+EX_R10(r13); \
205 std r11,area+EX_R11(r13); \
206 std r12,area+EX_R12(r13); \
207 mfspr r9,SPRN_SPRG1; \
208 std r9,area+EX_R13(r13); \
209 mfcr r9; \
210 clrrdi r12,r13,32; /* get high part of &label */ \
211 mfmsr r10; \
212 /* force 64bit mode */ \
213 li r11,5; /* MSR_SF_LG|MSR_ISF_LG */ \
214 rldimi r10,r11,61,0; /* insert into top 3 bits */ \
215 /* done 64bit mode */ \
216 mfspr r11,SPRN_SRR0; /* save SRR0 */ \
217 LOAD_HANDLER(r12,label) \
218 ori r10,r10,MSR_IR|MSR_DR|MSR_RI; \
219 mtspr SPRN_SRR0,r12; \
220 mfspr r12,SPRN_SRR1; /* and SRR1 */ \
221 mtspr SPRN_SRR1,r10; \
222 rfid; \
223 b . /* prevent speculative execution */
224
194#define EXCEPTION_PROLOG_PSERIES(area, label) \ 225#define EXCEPTION_PROLOG_PSERIES(area, label) \
195 mfspr r13,SPRN_SPRG3; /* get paca address into r13 */ \ 226 mfspr r13,SPRN_SPRG3; /* get paca address into r13 */ \
196 std r9,area+EX_R9(r13); /* save r9 - r12 */ \ 227 std r9,area+EX_R9(r13); /* save r9 - r12 */ \
@@ -604,14 +635,14 @@ slb_miss_user_pseries:
604system_reset_fwnmi: 635system_reset_fwnmi:
605 HMT_MEDIUM 636 HMT_MEDIUM
606 mtspr SPRN_SPRG1,r13 /* save r13 */ 637 mtspr SPRN_SPRG1,r13 /* save r13 */
607 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, system_reset_common) 638 EXCEPTION_PROLOG_PSERIES_FORCE_64BIT(PACA_EXGEN, system_reset_common)
608 639
609 .globl machine_check_fwnmi 640 .globl machine_check_fwnmi
610 .align 7 641 .align 7
611machine_check_fwnmi: 642machine_check_fwnmi:
612 HMT_MEDIUM 643 HMT_MEDIUM
613 mtspr SPRN_SPRG1,r13 /* save r13 */ 644 mtspr SPRN_SPRG1,r13 /* save r13 */
614 EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common) 645 EXCEPTION_PROLOG_PSERIES_FORCE_64BIT(PACA_EXMC, machine_check_common)
615 646
616#ifdef CONFIG_PPC_ISERIES 647#ifdef CONFIG_PPC_ISERIES
617/*** ISeries-LPAR interrupt handlers ***/ 648/*** ISeries-LPAR interrupt handlers ***/
diff --git a/arch/powerpc/kernel/ibmebus.c b/arch/powerpc/kernel/ibmebus.c
index 97ddc02a3d42..68e5ab0443d2 100644
--- a/arch/powerpc/kernel/ibmebus.c
+++ b/arch/powerpc/kernel/ibmebus.c
@@ -323,7 +323,7 @@ int ibmebus_request_irq(struct ibmebus_dev *dev,
323 unsigned long irq_flags, const char * devname, 323 unsigned long irq_flags, const char * devname,
324 void *dev_id) 324 void *dev_id)
325{ 325{
326 unsigned int irq = irq_create_mapping(NULL, ist, 0); 326 unsigned int irq = irq_create_mapping(NULL, ist);
327 327
328 if (irq == NO_IRQ) 328 if (irq == NO_IRQ)
329 return -EINVAL; 329 return -EINVAL;
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 8cf987809c66..01bdae35cb55 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -391,15 +391,14 @@ struct irq_host *irq_alloc_host(unsigned int revmap_type,
391 irq_map[i].host = host; 391 irq_map[i].host = host;
392 smp_wmb(); 392 smp_wmb();
393 393
394 /* Clear some flags */ 394 /* Clear norequest flags */
395 get_irq_desc(i)->status 395 get_irq_desc(i)->status &= ~IRQ_NOREQUEST;
396 &= ~(IRQ_NOREQUEST | IRQ_LEVEL);
397 396
398 /* Legacy flags are left to default at this point, 397 /* Legacy flags are left to default at this point,
399 * one can then use irq_create_mapping() to 398 * one can then use irq_create_mapping() to
400 * explicitely change them 399 * explicitely change them
401 */ 400 */
402 ops->map(host, i, i, 0); 401 ops->map(host, i, i);
403 } 402 }
404 break; 403 break;
405 case IRQ_HOST_MAP_LINEAR: 404 case IRQ_HOST_MAP_LINEAR:
@@ -457,13 +456,11 @@ void irq_set_virq_count(unsigned int count)
457} 456}
458 457
459unsigned int irq_create_mapping(struct irq_host *host, 458unsigned int irq_create_mapping(struct irq_host *host,
460 irq_hw_number_t hwirq, 459 irq_hw_number_t hwirq)
461 unsigned int flags)
462{ 460{
463 unsigned int virq, hint; 461 unsigned int virq, hint;
464 462
465 pr_debug("irq: irq_create_mapping(0x%p, 0x%lx, 0x%x)\n", 463 pr_debug("irq: irq_create_mapping(0x%p, 0x%lx)\n", host, hwirq);
466 host, hwirq, flags);
467 464
468 /* Look for default host if nececssary */ 465 /* Look for default host if nececssary */
469 if (host == NULL) 466 if (host == NULL)
@@ -482,7 +479,6 @@ unsigned int irq_create_mapping(struct irq_host *host,
482 virq = irq_find_mapping(host, hwirq); 479 virq = irq_find_mapping(host, hwirq);
483 if (virq != IRQ_NONE) { 480 if (virq != IRQ_NONE) {
484 pr_debug("irq: -> existing mapping on virq %d\n", virq); 481 pr_debug("irq: -> existing mapping on virq %d\n", virq);
485 host->ops->map(host, virq, hwirq, flags);
486 return virq; 482 return virq;
487 } 483 }
488 484
@@ -504,18 +500,18 @@ unsigned int irq_create_mapping(struct irq_host *host,
504 } 500 }
505 pr_debug("irq: -> obtained virq %d\n", virq); 501 pr_debug("irq: -> obtained virq %d\n", virq);
506 502
507 /* Clear some flags */ 503 /* Clear IRQ_NOREQUEST flag */
508 get_irq_desc(virq)->status &= ~(IRQ_NOREQUEST | IRQ_LEVEL); 504 get_irq_desc(virq)->status &= ~IRQ_NOREQUEST;
509 505
510 /* map it */ 506 /* map it */
511 if (host->ops->map(host, virq, hwirq, flags)) { 507 smp_wmb();
508 irq_map[virq].hwirq = hwirq;
509 smp_mb();
510 if (host->ops->map(host, virq, hwirq)) {
512 pr_debug("irq: -> mapping failed, freeing\n"); 511 pr_debug("irq: -> mapping failed, freeing\n");
513 irq_free_virt(virq, 1); 512 irq_free_virt(virq, 1);
514 return NO_IRQ; 513 return NO_IRQ;
515 } 514 }
516 smp_wmb();
517 irq_map[virq].hwirq = hwirq;
518 smp_mb();
519 return virq; 515 return virq;
520} 516}
521EXPORT_SYMBOL_GPL(irq_create_mapping); 517EXPORT_SYMBOL_GPL(irq_create_mapping);
@@ -525,25 +521,38 @@ extern unsigned int irq_create_of_mapping(struct device_node *controller,
525{ 521{
526 struct irq_host *host; 522 struct irq_host *host;
527 irq_hw_number_t hwirq; 523 irq_hw_number_t hwirq;
528 unsigned int flags = IRQ_TYPE_NONE; 524 unsigned int type = IRQ_TYPE_NONE;
525 unsigned int virq;
529 526
530 if (controller == NULL) 527 if (controller == NULL)
531 host = irq_default_host; 528 host = irq_default_host;
532 else 529 else
533 host = irq_find_host(controller); 530 host = irq_find_host(controller);
534 if (host == NULL) 531 if (host == NULL) {
532 printk(KERN_WARNING "irq: no irq host found for %s !\n",
533 controller->full_name);
535 return NO_IRQ; 534 return NO_IRQ;
535 }
536 536
537 /* If host has no translation, then we assume interrupt line */ 537 /* If host has no translation, then we assume interrupt line */
538 if (host->ops->xlate == NULL) 538 if (host->ops->xlate == NULL)
539 hwirq = intspec[0]; 539 hwirq = intspec[0];
540 else { 540 else {
541 if (host->ops->xlate(host, controller, intspec, intsize, 541 if (host->ops->xlate(host, controller, intspec, intsize,
542 &hwirq, &flags)) 542 &hwirq, &type))
543 return NO_IRQ; 543 return NO_IRQ;
544 } 544 }
545 545
546 return irq_create_mapping(host, hwirq, flags); 546 /* Create mapping */
547 virq = irq_create_mapping(host, hwirq);
548 if (virq == NO_IRQ)
549 return virq;
550
551 /* Set type if specified and different than the current one */
552 if (type != IRQ_TYPE_NONE &&
553 type != (get_irq_desc(virq)->status & IRQF_TRIGGER_MASK))
554 set_irq_type(virq, type);
555 return virq;
547} 556}
548EXPORT_SYMBOL_GPL(irq_create_of_mapping); 557EXPORT_SYMBOL_GPL(irq_create_of_mapping);
549 558
diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c
index 7e98e778b52f..359ab89748e0 100644
--- a/arch/powerpc/kernel/legacy_serial.c
+++ b/arch/powerpc/kernel/legacy_serial.c
@@ -112,7 +112,7 @@ static int __init add_legacy_port(struct device_node *np, int want_index,
112static int __init add_legacy_soc_port(struct device_node *np, 112static int __init add_legacy_soc_port(struct device_node *np,
113 struct device_node *soc_dev) 113 struct device_node *soc_dev)
114{ 114{
115 phys_addr_t addr; 115 u64 addr;
116 u32 *addrp; 116 u32 *addrp;
117 upf_t flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_SHARE_IRQ; 117 upf_t flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_SHARE_IRQ;
118 118
@@ -143,7 +143,7 @@ static int __init add_legacy_isa_port(struct device_node *np,
143 u32 *reg; 143 u32 *reg;
144 char *typep; 144 char *typep;
145 int index = -1; 145 int index = -1;
146 phys_addr_t taddr; 146 u64 taddr;
147 147
148 DBG(" -> add_legacy_isa_port(%s)\n", np->full_name); 148 DBG(" -> add_legacy_isa_port(%s)\n", np->full_name);
149 149
@@ -165,10 +165,13 @@ static int __init add_legacy_isa_port(struct device_node *np,
165 if (typep && *typep == 'S') 165 if (typep && *typep == 'S')
166 index = simple_strtol(typep+1, NULL, 0) - 1; 166 index = simple_strtol(typep+1, NULL, 0) - 1;
167 167
168 /* Translate ISA address */ 168 /* Translate ISA address. If it fails, we still register the port
169 * with no translated address so that it can be picked up as an IO
170 * port later by the serial driver
171 */
169 taddr = of_translate_address(np, reg); 172 taddr = of_translate_address(np, reg);
170 if (taddr == OF_BAD_ADDR) 173 if (taddr == OF_BAD_ADDR)
171 return -1; 174 taddr = 0;
172 175
173 /* Add port, irq will be dealt with later */ 176 /* Add port, irq will be dealt with later */
174 return add_legacy_port(np, index, UPIO_PORT, reg[1], taddr, 177 return add_legacy_port(np, index, UPIO_PORT, reg[1], taddr,
@@ -180,7 +183,7 @@ static int __init add_legacy_isa_port(struct device_node *np,
180static int __init add_legacy_pci_port(struct device_node *np, 183static int __init add_legacy_pci_port(struct device_node *np,
181 struct device_node *pci_dev) 184 struct device_node *pci_dev)
182{ 185{
183 phys_addr_t addr, base; 186 u64 addr, base;
184 u32 *addrp; 187 u32 *addrp;
185 unsigned int flags; 188 unsigned int flags;
186 int iotype, index = -1, lindex = 0; 189 int iotype, index = -1, lindex = 0;
diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S
index bfb407fc1aa1..e3ed21cd3d94 100644
--- a/arch/powerpc/kernel/misc_64.S
+++ b/arch/powerpc/kernel/misc_64.S
@@ -687,7 +687,7 @@ _GLOBAL(kexec_sequence)
687 /* clear out hardware hash page table and tlb */ 687 /* clear out hardware hash page table and tlb */
688 ld r5,0(r27) /* deref function descriptor */ 688 ld r5,0(r27) /* deref function descriptor */
689 mtctr r5 689 mtctr r5
690 bctrl /* ppc_md.hash_clear_all(void); */ 690 bctrl /* ppc_md.hpte_clear_all(void); */
691 691
692/* 692/*
693 * kexec image calling is: 693 * kexec image calling is:
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index 898dae8ab6d9..09b1e1bbb29b 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -11,6 +11,7 @@
11#include <linux/sched.h> 11#include <linux/sched.h>
12#include <linux/errno.h> 12#include <linux/errno.h>
13#include <linux/bootmem.h> 13#include <linux/bootmem.h>
14#include <linux/irq.h>
14 15
15#include <asm/processor.h> 16#include <asm/processor.h>
16#include <asm/io.h> 17#include <asm/io.h>
@@ -18,7 +19,6 @@
18#include <asm/sections.h> 19#include <asm/sections.h>
19#include <asm/pci-bridge.h> 20#include <asm/pci-bridge.h>
20#include <asm/byteorder.h> 21#include <asm/byteorder.h>
21#include <asm/irq.h>
22#include <asm/uaccess.h> 22#include <asm/uaccess.h>
23#include <asm/machdep.h> 23#include <asm/machdep.h>
24 24
@@ -1420,15 +1420,37 @@ int pci_read_irq_line(struct pci_dev *pci_dev)
1420 1420
1421 DBG("Try to map irq for %s...\n", pci_name(pci_dev)); 1421 DBG("Try to map irq for %s...\n", pci_name(pci_dev));
1422 1422
1423 /* Try to get a mapping from the device-tree */
1423 if (of_irq_map_pci(pci_dev, &oirq)) { 1424 if (of_irq_map_pci(pci_dev, &oirq)) {
1424 DBG(" -> failed !\n"); 1425 u8 line, pin;
1425 return -1; 1426
1426 } 1427 /* If that fails, lets fallback to what is in the config
1428 * space and map that through the default controller. We
1429 * also set the type to level low since that's what PCI
1430 * interrupts are. If your platform does differently, then
1431 * either provide a proper interrupt tree or don't use this
1432 * function.
1433 */
1434 if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_PIN, &pin))
1435 return -1;
1436 if (pin == 0)
1437 return -1;
1438 if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_LINE, &line) ||
1439 line == 0xff) {
1440 return -1;
1441 }
1442 DBG(" -> no map ! Using irq line %d from PCI config\n", line);
1427 1443
1428 DBG(" -> got one, spec %d cells (0x%08x...) on %s\n", 1444 virq = irq_create_mapping(NULL, line);
1429 oirq.size, oirq.specifier[0], oirq.controller->full_name); 1445 if (virq != NO_IRQ)
1446 set_irq_type(virq, IRQ_TYPE_LEVEL_LOW);
1447 } else {
1448 DBG(" -> got one, spec %d cells (0x%08x...) on %s\n",
1449 oirq.size, oirq.specifier[0], oirq.controller->full_name);
1430 1450
1431 virq = irq_create_of_mapping(oirq.controller, oirq.specifier, oirq.size); 1451 virq = irq_create_of_mapping(oirq.controller, oirq.specifier,
1452 oirq.size);
1453 }
1432 if(virq == NO_IRQ) { 1454 if(virq == NO_IRQ) {
1433 DBG(" -> failed to map !\n"); 1455 DBG(" -> failed to map !\n");
1434 return -1; 1456 return -1;
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index efc0b5559ee0..2fce7738e9e2 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -21,13 +21,13 @@
21#include <linux/mm.h> 21#include <linux/mm.h>
22#include <linux/list.h> 22#include <linux/list.h>
23#include <linux/syscalls.h> 23#include <linux/syscalls.h>
24#include <linux/irq.h>
24 25
25#include <asm/processor.h> 26#include <asm/processor.h>
26#include <asm/io.h> 27#include <asm/io.h>
27#include <asm/prom.h> 28#include <asm/prom.h>
28#include <asm/pci-bridge.h> 29#include <asm/pci-bridge.h>
29#include <asm/byteorder.h> 30#include <asm/byteorder.h>
30#include <asm/irq.h>
31#include <asm/machdep.h> 31#include <asm/machdep.h>
32#include <asm/ppc-pci.h> 32#include <asm/ppc-pci.h>
33 33
@@ -1289,15 +1289,37 @@ int pci_read_irq_line(struct pci_dev *pci_dev)
1289 1289
1290 DBG("Try to map irq for %s...\n", pci_name(pci_dev)); 1290 DBG("Try to map irq for %s...\n", pci_name(pci_dev));
1291 1291
1292 /* Try to get a mapping from the device-tree */
1292 if (of_irq_map_pci(pci_dev, &oirq)) { 1293 if (of_irq_map_pci(pci_dev, &oirq)) {
1293 DBG(" -> failed !\n"); 1294 u8 line, pin;
1294 return -1; 1295
1295 } 1296 /* If that fails, lets fallback to what is in the config
1297 * space and map that through the default controller. We
1298 * also set the type to level low since that's what PCI
1299 * interrupts are. If your platform does differently, then
1300 * either provide a proper interrupt tree or don't use this
1301 * function.
1302 */
1303 if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_PIN, &pin))
1304 return -1;
1305 if (pin == 0)
1306 return -1;
1307 if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_LINE, &line) ||
1308 line == 0xff) {
1309 return -1;
1310 }
1311 DBG(" -> no map ! Using irq line %d from PCI config\n", line);
1296 1312
1297 DBG(" -> got one, spec %d cells (0x%08x...) on %s\n", 1313 virq = irq_create_mapping(NULL, line);
1298 oirq.size, oirq.specifier[0], oirq.controller->full_name); 1314 if (virq != NO_IRQ)
1315 set_irq_type(virq, IRQ_TYPE_LEVEL_LOW);
1316 } else {
1317 DBG(" -> got one, spec %d cells (0x%08x...) on %s\n",
1318 oirq.size, oirq.specifier[0], oirq.controller->full_name);
1299 1319
1300 virq = irq_create_of_mapping(oirq.controller, oirq.specifier, oirq.size); 1320 virq = irq_create_of_mapping(oirq.controller, oirq.specifier,
1321 oirq.size);
1322 }
1301 if(virq == NO_IRQ) { 1323 if(virq == NO_IRQ) {
1302 DBG(" -> failed to map !\n"); 1324 DBG(" -> failed to map !\n");
1303 return -1; 1325 return -1;
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index e3b80f71748e..f6a05f090b25 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -5,7 +5,7 @@
5#include <linux/elfcore.h> 5#include <linux/elfcore.h>
6#include <linux/string.h> 6#include <linux/string.h>
7#include <linux/interrupt.h> 7#include <linux/interrupt.h>
8#include <linux/tty.h> 8#include <linux/screen_info.h>
9#include <linux/vt_kern.h> 9#include <linux/vt_kern.h>
10#include <linux/nvram.h> 10#include <linux/nvram.h>
11#include <linux/console.h> 11#include <linux/console.h>
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index ebd501a59abd..462bced40c12 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -557,7 +557,9 @@ unsigned long prom_memparse(const char *ptr, const char **retptr)
557static void __init early_cmdline_parse(void) 557static void __init early_cmdline_parse(void)
558{ 558{
559 struct prom_t *_prom = &RELOC(prom); 559 struct prom_t *_prom = &RELOC(prom);
560#ifdef CONFIG_PPC64
560 const char *opt; 561 const char *opt;
562#endif
561 char *p; 563 char *p;
562 int l = 0; 564 int l = 0;
563 565
@@ -2030,6 +2032,39 @@ static void __init fixup_device_tree_maple(void)
2030#define fixup_device_tree_maple() 2032#define fixup_device_tree_maple()
2031#endif 2033#endif
2032 2034
2035#ifdef CONFIG_PPC_CHRP
2036/* Pegasos lacks the "ranges" property in the isa node */
2037static void __init fixup_device_tree_chrp(void)
2038{
2039 phandle isa;
2040 u32 isa_ranges[6];
2041 char *name;
2042 int rc;
2043
2044 name = "/pci@80000000/isa@c";
2045 isa = call_prom("finddevice", 1, 1, ADDR(name));
2046 if (!PHANDLE_VALID(isa))
2047 return;
2048
2049 rc = prom_getproplen(isa, "ranges");
2050 if (rc != 0 && rc != PROM_ERROR)
2051 return;
2052
2053 prom_printf("Fixing up missing ISA range on Pegasos...\n");
2054
2055 isa_ranges[0] = 0x1;
2056 isa_ranges[1] = 0x0;
2057 isa_ranges[2] = 0x01006000;
2058 isa_ranges[3] = 0x0;
2059 isa_ranges[4] = 0x0;
2060 isa_ranges[5] = 0x00010000;
2061 prom_setprop(isa, name, "ranges",
2062 isa_ranges, sizeof(isa_ranges));
2063}
2064#else
2065#define fixup_device_tree_chrp()
2066#endif
2067
2033#if defined(CONFIG_PPC64) && defined(CONFIG_PPC_PMAC) 2068#if defined(CONFIG_PPC64) && defined(CONFIG_PPC_PMAC)
2034static void __init fixup_device_tree_pmac(void) 2069static void __init fixup_device_tree_pmac(void)
2035{ 2070{
@@ -2077,6 +2112,7 @@ static void __init fixup_device_tree_pmac(void)
2077static void __init fixup_device_tree(void) 2112static void __init fixup_device_tree(void)
2078{ 2113{
2079 fixup_device_tree_maple(); 2114 fixup_device_tree_maple();
2115 fixup_device_tree_chrp();
2080 fixup_device_tree_pmac(); 2116 fixup_device_tree_pmac();
2081} 2117}
2082 2118
diff --git a/arch/powerpc/kernel/prom_parse.c b/arch/powerpc/kernel/prom_parse.c
index 21009b1f7869..6a7e997c401d 100644
--- a/arch/powerpc/kernel/prom_parse.c
+++ b/arch/powerpc/kernel/prom_parse.c
@@ -881,7 +881,7 @@ int of_irq_map_one(struct device_node *device, int index, struct of_irq *out_irq
881 intsize = *tmp; 881 intsize = *tmp;
882 882
883 /* Check index */ 883 /* Check index */
884 if (index * intsize >= intlen) 884 if ((index + 1) * intsize > intlen)
885 return -EINVAL; 885 return -EINVAL;
886 886
887 /* Get new specifier and map it */ 887 /* Get new specifier and map it */
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index c6d7b98af7d5..499c3861074f 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -26,7 +26,7 @@
26#include <linux/ioport.h> 26#include <linux/ioport.h>
27#include <linux/console.h> 27#include <linux/console.h>
28#include <linux/utsname.h> 28#include <linux/utsname.h>
29#include <linux/tty.h> 29#include <linux/screen_info.h>
30#include <linux/root_dev.h> 30#include <linux/root_dev.h>
31#include <linux/notifier.h> 31#include <linux/notifier.h>
32#include <linux/cpu.h> 32#include <linux/cpu.h>
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 46c56cfd1b2f..6a9bc9ce54e0 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -144,13 +144,15 @@ void smp_message_recv(int msg, struct pt_regs *regs)
144 144
145void smp_send_reschedule(int cpu) 145void smp_send_reschedule(int cpu)
146{ 146{
147 smp_ops->message_pass(cpu, PPC_MSG_RESCHEDULE); 147 if (likely(smp_ops))
148 smp_ops->message_pass(cpu, PPC_MSG_RESCHEDULE);
148} 149}
149 150
150#ifdef CONFIG_DEBUGGER 151#ifdef CONFIG_DEBUGGER
151void smp_send_debugger_break(int cpu) 152void smp_send_debugger_break(int cpu)
152{ 153{
153 smp_ops->message_pass(cpu, PPC_MSG_DEBUGGER_BREAK); 154 if (likely(smp_ops))
155 smp_ops->message_pass(cpu, PPC_MSG_DEBUGGER_BREAK);
154} 156}
155#endif 157#endif
156 158
@@ -158,7 +160,7 @@ void smp_send_debugger_break(int cpu)
158void crash_send_ipi(void (*crash_ipi_callback)(struct pt_regs *)) 160void crash_send_ipi(void (*crash_ipi_callback)(struct pt_regs *))
159{ 161{
160 crash_ipi_function_ptr = crash_ipi_callback; 162 crash_ipi_function_ptr = crash_ipi_callback;
161 if (crash_ipi_callback) { 163 if (crash_ipi_callback && smp_ops) {
162 mb(); 164 mb();
163 smp_ops->message_pass(MSG_ALL_BUT_SELF, PPC_MSG_DEBUGGER_BREAK); 165 smp_ops->message_pass(MSG_ALL_BUT_SELF, PPC_MSG_DEBUGGER_BREAK);
164 } 166 }
@@ -220,6 +222,9 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
220 /* Can deadlock when called with interrupts disabled */ 222 /* Can deadlock when called with interrupts disabled */
221 WARN_ON(irqs_disabled()); 223 WARN_ON(irqs_disabled());
222 224
225 if (unlikely(smp_ops == NULL))
226 return -1;
227
223 data.func = func; 228 data.func = func;
224 data.info = info; 229 data.info = info;
225 atomic_set(&data.started, 0); 230 atomic_set(&data.started, 0);
@@ -357,7 +362,10 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
357 smp_store_cpu_info(boot_cpuid); 362 smp_store_cpu_info(boot_cpuid);
358 cpu_callin_map[boot_cpuid] = 1; 363 cpu_callin_map[boot_cpuid] = 1;
359 364
360 max_cpus = smp_ops->probe(); 365 if (smp_ops)
366 max_cpus = smp_ops->probe();
367 else
368 max_cpus = 1;
361 369
362 smp_space_timers(max_cpus); 370 smp_space_timers(max_cpus);
363 371
@@ -453,7 +461,7 @@ void generic_mach_cpu_die(void)
453 461
454static int __devinit cpu_enable(unsigned int cpu) 462static int __devinit cpu_enable(unsigned int cpu)
455{ 463{
456 if (smp_ops->cpu_enable) 464 if (smp_ops && smp_ops->cpu_enable)
457 return smp_ops->cpu_enable(cpu); 465 return smp_ops->cpu_enable(cpu);
458 466
459 return -ENOSYS; 467 return -ENOSYS;
@@ -467,7 +475,8 @@ int __devinit __cpu_up(unsigned int cpu)
467 if (!cpu_enable(cpu)) 475 if (!cpu_enable(cpu))
468 return 0; 476 return 0;
469 477
470 if (smp_ops->cpu_bootable && !smp_ops->cpu_bootable(cpu)) 478 if (smp_ops == NULL ||
479 (smp_ops->cpu_bootable && !smp_ops->cpu_bootable(cpu)))
471 return -EINVAL; 480 return -EINVAL;
472 481
473 /* Make sure callin-map entry is 0 (can be leftover a CPU 482 /* Make sure callin-map entry is 0 (can be leftover a CPU
@@ -568,7 +577,8 @@ void __init smp_cpus_done(unsigned int max_cpus)
568 old_mask = current->cpus_allowed; 577 old_mask = current->cpus_allowed;
569 set_cpus_allowed(current, cpumask_of_cpu(boot_cpuid)); 578 set_cpus_allowed(current, cpumask_of_cpu(boot_cpuid));
570 579
571 smp_ops->setup_cpu(boot_cpuid); 580 if (smp_ops)
581 smp_ops->setup_cpu(boot_cpuid);
572 582
573 set_cpus_allowed(current, old_mask); 583 set_cpus_allowed(current, old_mask);
574 584
diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c
index 010435095550..fec228cd0163 100644
--- a/arch/powerpc/kernel/sysfs.c
+++ b/arch/powerpc/kernel/sysfs.c
@@ -278,7 +278,7 @@ static void unregister_cpu_online(unsigned int cpu)
278} 278}
279#endif /* CONFIG_HOTPLUG_CPU */ 279#endif /* CONFIG_HOTPLUG_CPU */
280 280
281static int __devinit sysfs_cpu_notify(struct notifier_block *self, 281static int __cpuinit sysfs_cpu_notify(struct notifier_block *self,
282 unsigned long action, void *hcpu) 282 unsigned long action, void *hcpu)
283{ 283{
284 unsigned int cpu = (unsigned int)(long)hcpu; 284 unsigned int cpu = (unsigned int)(long)hcpu;
@@ -296,7 +296,7 @@ static int __devinit sysfs_cpu_notify(struct notifier_block *self,
296 return NOTIFY_OK; 296 return NOTIFY_OK;
297} 297}
298 298
299static struct notifier_block __devinitdata sysfs_cpu_nb = { 299static struct notifier_block __cpuinitdata sysfs_cpu_nb = {
300 .notifier_call = sysfs_cpu_notify, 300 .notifier_call = sysfs_cpu_notify,
301}; 301};
302 302
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 3c668078e524..2105767fcc57 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -150,13 +150,9 @@ int die(const char *str, struct pt_regs *regs, long err)
150 if (in_interrupt()) 150 if (in_interrupt())
151 panic("Fatal exception in interrupt"); 151 panic("Fatal exception in interrupt");
152 152
153 if (panic_on_oops) { 153 if (panic_on_oops)
154#ifdef CONFIG_PPC64 154 panic("Fatal exception: panic_on_oops");
155 printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n"); 155
156 ssleep(5);
157#endif
158 panic("Fatal exception");
159 }
160 do_exit(err); 156 do_exit(err);
161 157
162 return 0; 158 return 0;
diff --git a/arch/powerpc/kernel/udbg_16550.c b/arch/powerpc/kernel/udbg_16550.c
index 0835b4841dea..2d17f2b8eda7 100644
--- a/arch/powerpc/kernel/udbg_16550.c
+++ b/arch/powerpc/kernel/udbg_16550.c
@@ -81,10 +81,14 @@ static int udbg_550_getc(void)
81void udbg_init_uart(void __iomem *comport, unsigned int speed, 81void udbg_init_uart(void __iomem *comport, unsigned int speed,
82 unsigned int clock) 82 unsigned int clock)
83{ 83{
84 unsigned int dll, base_bauds = clock / 16; 84 unsigned int dll, base_bauds;
85 85
86 if (clock == 0)
87 clock = 1843200;
86 if (speed == 0) 88 if (speed == 0)
87 speed = 9600; 89 speed = 9600;
90
91 base_bauds = clock / 16;
88 dll = base_bauds / speed; 92 dll = base_bauds / speed;
89 93
90 if (comport) { 94 if (comport) {
diff --git a/arch/powerpc/kernel/vdso32/Makefile b/arch/powerpc/kernel/vdso32/Makefile
index 8a3bed5f143a..3726358faae8 100644
--- a/arch/powerpc/kernel/vdso32/Makefile
+++ b/arch/powerpc/kernel/vdso32/Makefile
@@ -14,7 +14,8 @@ obj-vdso32 := $(addprefix $(obj)/, $(obj-vdso32))
14 14
15 15
16EXTRA_CFLAGS := -shared -s -fno-common -fno-builtin 16EXTRA_CFLAGS := -shared -s -fno-common -fno-builtin
17EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso32.so.1 17EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso32.so.1 \
18 $(call ld-option, -Wl$(comma)--hash-style=sysv)
18EXTRA_AFLAGS := -D__VDSO32__ -s 19EXTRA_AFLAGS := -D__VDSO32__ -s
19 20
20obj-y += vdso32_wrapper.o 21obj-y += vdso32_wrapper.o
diff --git a/arch/powerpc/kernel/vdso32/vdso32.lds.S b/arch/powerpc/kernel/vdso32/vdso32.lds.S
index f4bad720cb0a..6187af2d54c3 100644
--- a/arch/powerpc/kernel/vdso32/vdso32.lds.S
+++ b/arch/powerpc/kernel/vdso32/vdso32.lds.S
@@ -14,6 +14,7 @@ SECTIONS
14{ 14{
15 . = VDSO32_LBASE + SIZEOF_HEADERS; 15 . = VDSO32_LBASE + SIZEOF_HEADERS;
16 .hash : { *(.hash) } :text 16 .hash : { *(.hash) } :text
17 .gnu.hash : { *(.gnu.hash) }
17 .dynsym : { *(.dynsym) } 18 .dynsym : { *(.dynsym) }
18 .dynstr : { *(.dynstr) } 19 .dynstr : { *(.dynstr) }
19 .gnu.version : { *(.gnu.version) } 20 .gnu.version : { *(.gnu.version) }
diff --git a/arch/powerpc/kernel/vdso64/Makefile b/arch/powerpc/kernel/vdso64/Makefile
index ab39988452cc..43af9b2a6f3b 100644
--- a/arch/powerpc/kernel/vdso64/Makefile
+++ b/arch/powerpc/kernel/vdso64/Makefile
@@ -8,7 +8,8 @@ targets := $(obj-vdso64) vdso64.so
8obj-vdso64 := $(addprefix $(obj)/, $(obj-vdso64)) 8obj-vdso64 := $(addprefix $(obj)/, $(obj-vdso64))
9 9
10EXTRA_CFLAGS := -shared -s -fno-common -fno-builtin 10EXTRA_CFLAGS := -shared -s -fno-common -fno-builtin
11EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso64.so.1 11EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso64.so.1 \
12 $(call ld-option, -Wl$(comma)--hash-style=sysv)
12EXTRA_AFLAGS := -D__VDSO64__ -s 13EXTRA_AFLAGS := -D__VDSO64__ -s
13 14
14obj-y += vdso64_wrapper.o 15obj-y += vdso64_wrapper.o
diff --git a/arch/powerpc/kernel/vdso64/vdso64.lds.S b/arch/powerpc/kernel/vdso64/vdso64.lds.S
index 4bdf224464ab..4a2b6dc0960c 100644
--- a/arch/powerpc/kernel/vdso64/vdso64.lds.S
+++ b/arch/powerpc/kernel/vdso64/vdso64.lds.S
@@ -12,6 +12,7 @@ SECTIONS
12{ 12{
13 . = VDSO64_LBASE + SIZEOF_HEADERS; 13 . = VDSO64_LBASE + SIZEOF_HEADERS;
14 .hash : { *(.hash) } :text 14 .hash : { *(.hash) } :text
15 .gnu.hash : { *(.gnu.hash) }
15 .dynsym : { *(.dynsym) } 16 .dynsym : { *(.dynsym) }
16 .dynstr : { *(.dynstr) } 17 .dynstr : { *(.dynstr) }
17 .gnu.version : { *(.gnu.version) } 18 .gnu.version : { *(.gnu.version) }
diff --git a/arch/powerpc/mm/lmb.c b/arch/powerpc/mm/lmb.c
index 4b17a7359924..716a2906a24d 100644
--- a/arch/powerpc/mm/lmb.c
+++ b/arch/powerpc/mm/lmb.c
@@ -320,7 +320,8 @@ void __init lmb_enforce_memory_limit(unsigned long memory_limit)
320 break; 320 break;
321 } 321 }
322 322
323 lmb.rmo_size = lmb.memory.region[0].size; 323 if (lmb.memory.region[0].size < lmb.rmo_size)
324 lmb.rmo_size = lmb.memory.region[0].size;
324 325
325 /* And truncate any reserves above the limit also. */ 326 /* And truncate any reserves above the limit also. */
326 for (i = 0; i < lmb.reserved.cnt; i++) { 327 for (i = 0; i < lmb.reserved.cnt; i++) {
diff --git a/arch/powerpc/platforms/cell/interrupt.c b/arch/powerpc/platforms/cell/interrupt.c
index 9d5da7896892..d7bbb61109f9 100644
--- a/arch/powerpc/platforms/cell/interrupt.c
+++ b/arch/powerpc/platforms/cell/interrupt.c
@@ -159,7 +159,7 @@ static void iic_request_ipi(int ipi, const char *name)
159 if (iic_hosts[node] == NULL) 159 if (iic_hosts[node] == NULL)
160 continue; 160 continue;
161 virq = irq_create_mapping(iic_hosts[node], 161 virq = irq_create_mapping(iic_hosts[node],
162 iic_ipi_to_irq(ipi), 0); 162 iic_ipi_to_irq(ipi));
163 if (virq == NO_IRQ) { 163 if (virq == NO_IRQ) {
164 printk(KERN_ERR 164 printk(KERN_ERR
165 "iic: failed to map IPI %s on node %d\n", 165 "iic: failed to map IPI %s on node %d\n",
@@ -197,7 +197,7 @@ static int iic_host_match(struct irq_host *h, struct device_node *node)
197} 197}
198 198
199static int iic_host_map(struct irq_host *h, unsigned int virq, 199static int iic_host_map(struct irq_host *h, unsigned int virq,
200 irq_hw_number_t hw, unsigned int flags) 200 irq_hw_number_t hw)
201{ 201{
202 if (hw < IIC_IRQ_IPI0) 202 if (hw < IIC_IRQ_IPI0)
203 set_irq_chip_and_handler(virq, &iic_chip, handle_fasteoi_irq); 203 set_irq_chip_and_handler(virq, &iic_chip, handle_fasteoi_irq);
diff --git a/arch/powerpc/platforms/cell/spider-pic.c b/arch/powerpc/platforms/cell/spider-pic.c
index ae7ef88f1a37..15217bb0402f 100644
--- a/arch/powerpc/platforms/cell/spider-pic.c
+++ b/arch/powerpc/platforms/cell/spider-pic.c
@@ -85,9 +85,6 @@ static void spider_unmask_irq(unsigned int virq)
85 struct spider_pic *pic = spider_virq_to_pic(virq); 85 struct spider_pic *pic = spider_virq_to_pic(virq);
86 void __iomem *cfg = spider_get_irq_config(pic, irq_map[virq].hwirq); 86 void __iomem *cfg = spider_get_irq_config(pic, irq_map[virq].hwirq);
87 87
88 /* We use no locking as we should be covered by the descriptor lock
89 * for access to invidual source configuration registers
90 */
91 out_be32(cfg, in_be32(cfg) | 0x30000000u); 88 out_be32(cfg, in_be32(cfg) | 0x30000000u);
92} 89}
93 90
@@ -96,9 +93,6 @@ static void spider_mask_irq(unsigned int virq)
96 struct spider_pic *pic = spider_virq_to_pic(virq); 93 struct spider_pic *pic = spider_virq_to_pic(virq);
97 void __iomem *cfg = spider_get_irq_config(pic, irq_map[virq].hwirq); 94 void __iomem *cfg = spider_get_irq_config(pic, irq_map[virq].hwirq);
98 95
99 /* We use no locking as we should be covered by the descriptor lock
100 * for access to invidual source configuration registers
101 */
102 out_be32(cfg, in_be32(cfg) & ~0x30000000u); 96 out_be32(cfg, in_be32(cfg) & ~0x30000000u);
103} 97}
104 98
@@ -120,26 +114,14 @@ static void spider_ack_irq(unsigned int virq)
120 out_be32(pic->regs + TIR_EDC, 0x100 | (src & 0xf)); 114 out_be32(pic->regs + TIR_EDC, 0x100 | (src & 0xf));
121} 115}
122 116
123static struct irq_chip spider_pic = { 117static int spider_set_irq_type(unsigned int virq, unsigned int type)
124 .typename = " SPIDER ",
125 .unmask = spider_unmask_irq,
126 .mask = spider_mask_irq,
127 .ack = spider_ack_irq,
128};
129
130static int spider_host_match(struct irq_host *h, struct device_node *node)
131{
132 struct spider_pic *pic = h->host_data;
133 return node == pic->of_node;
134}
135
136static int spider_host_map(struct irq_host *h, unsigned int virq,
137 irq_hw_number_t hw, unsigned int flags)
138{ 118{
139 unsigned int sense = flags & IRQ_TYPE_SENSE_MASK; 119 unsigned int sense = type & IRQ_TYPE_SENSE_MASK;
140 struct spider_pic *pic = h->host_data; 120 struct spider_pic *pic = spider_virq_to_pic(virq);
121 unsigned int hw = irq_map[virq].hwirq;
141 void __iomem *cfg = spider_get_irq_config(pic, hw); 122 void __iomem *cfg = spider_get_irq_config(pic, hw);
142 int level = 0; 123 struct irq_desc *desc = get_irq_desc(virq);
124 u32 old_mask;
143 u32 ic; 125 u32 ic;
144 126
145 /* Note that only level high is supported for most interrupts */ 127 /* Note that only level high is supported for most interrupts */
@@ -157,29 +139,57 @@ static int spider_host_map(struct irq_host *h, unsigned int virq,
157 break; 139 break;
158 case IRQ_TYPE_LEVEL_LOW: 140 case IRQ_TYPE_LEVEL_LOW:
159 ic = 0x0; 141 ic = 0x0;
160 level = 1;
161 break; 142 break;
162 case IRQ_TYPE_LEVEL_HIGH: 143 case IRQ_TYPE_LEVEL_HIGH:
163 case IRQ_TYPE_NONE: 144 case IRQ_TYPE_NONE:
164 ic = 0x1; 145 ic = 0x1;
165 level = 1;
166 break; 146 break;
167 default: 147 default:
168 return -EINVAL; 148 return -EINVAL;
169 } 149 }
170 150
151 /* Update irq_desc */
152 desc->status &= ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL);
153 desc->status |= type & IRQ_TYPE_SENSE_MASK;
154 if (type & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW))
155 desc->status |= IRQ_LEVEL;
156
171 /* Configure the source. One gross hack that was there before and 157 /* Configure the source. One gross hack that was there before and
172 * that I've kept around is the priority to the BE which I set to 158 * that I've kept around is the priority to the BE which I set to
173 * be the same as the interrupt source number. I don't know wether 159 * be the same as the interrupt source number. I don't know wether
174 * that's supposed to make any kind of sense however, we'll have to 160 * that's supposed to make any kind of sense however, we'll have to
175 * decide that, but for now, I'm not changing the behaviour. 161 * decide that, but for now, I'm not changing the behaviour.
176 */ 162 */
177 out_be32(cfg, (ic << 24) | (0x7 << 16) | (pic->node_id << 4) | 0xe); 163 old_mask = in_be32(cfg) & 0x30000000u;
164 out_be32(cfg, old_mask | (ic << 24) | (0x7 << 16) |
165 (pic->node_id << 4) | 0xe);
178 out_be32(cfg + 4, (0x2 << 16) | (hw & 0xff)); 166 out_be32(cfg + 4, (0x2 << 16) | (hw & 0xff));
179 167
180 if (level) 168 return 0;
181 get_irq_desc(virq)->status |= IRQ_LEVEL; 169}
170
171static struct irq_chip spider_pic = {
172 .typename = " SPIDER ",
173 .unmask = spider_unmask_irq,
174 .mask = spider_mask_irq,
175 .ack = spider_ack_irq,
176 .set_type = spider_set_irq_type,
177};
178
179static int spider_host_match(struct irq_host *h, struct device_node *node)
180{
181 struct spider_pic *pic = h->host_data;
182 return node == pic->of_node;
183}
184
185static int spider_host_map(struct irq_host *h, unsigned int virq,
186 irq_hw_number_t hw)
187{
182 set_irq_chip_and_handler(virq, &spider_pic, handle_level_irq); 188 set_irq_chip_and_handler(virq, &spider_pic, handle_level_irq);
189
190 /* Set default irq type */
191 set_irq_type(virq, IRQ_TYPE_NONE);
192
183 return 0; 193 return 0;
184} 194}
185 195
@@ -283,7 +293,7 @@ static unsigned int __init spider_find_cascade_and_node(struct spider_pic *pic)
283 if (iic_host == NULL) 293 if (iic_host == NULL)
284 return NO_IRQ; 294 return NO_IRQ;
285 /* Manufacture an IIC interrupt number of class 2 */ 295 /* Manufacture an IIC interrupt number of class 2 */
286 virq = irq_create_mapping(iic_host, 0x20 | unit, 0); 296 virq = irq_create_mapping(iic_host, 0x20 | unit);
287 if (virq == NO_IRQ) 297 if (virq == NO_IRQ)
288 printk(KERN_ERR "spider_pic: failed to map cascade !"); 298 printk(KERN_ERR "spider_pic: failed to map cascade !");
289 return virq; 299 return virq;
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c
index 5d2313a6c82b..d06042deb021 100644
--- a/arch/powerpc/platforms/cell/spu_base.c
+++ b/arch/powerpc/platforms/cell/spu_base.c
@@ -583,9 +583,9 @@ static int __init spu_map_interrupts(struct spu *spu, struct device_node *np)
583 spu->isrc = isrc = tmp[0]; 583 spu->isrc = isrc = tmp[0];
584 584
585 /* Now map interrupts of all 3 classes */ 585 /* Now map interrupts of all 3 classes */
586 spu->irqs[0] = irq_create_mapping(host, 0x00 | isrc, 0); 586 spu->irqs[0] = irq_create_mapping(host, 0x00 | isrc);
587 spu->irqs[1] = irq_create_mapping(host, 0x10 | isrc, 0); 587 spu->irqs[1] = irq_create_mapping(host, 0x10 | isrc);
588 spu->irqs[2] = irq_create_mapping(host, 0x20 | isrc, 0); 588 spu->irqs[2] = irq_create_mapping(host, 0x20 | isrc);
589 589
590 /* Right now, we only fail if class 2 failed */ 590 /* Right now, we only fail if class 2 failed */
591 return spu->irqs[2] == NO_IRQ ? -EINVAL : 0; 591 return spu->irqs[2] == NO_IRQ ? -EINVAL : 0;
diff --git a/arch/powerpc/platforms/chrp/setup.c b/arch/powerpc/platforms/chrp/setup.c
index 538e337d63e2..9c08ff322290 100644
--- a/arch/powerpc/platforms/chrp/setup.c
+++ b/arch/powerpc/platforms/chrp/setup.c
@@ -291,10 +291,6 @@ void __init chrp_setup_arch(void)
291 291
292 pci_create_OF_bus_map(); 292 pci_create_OF_bus_map();
293 293
294#ifdef CONFIG_SMP
295 smp_ops = &chrp_smp_ops;
296#endif /* CONFIG_SMP */
297
298 /* 294 /*
299 * Print the banner, then scroll down so boot progress 295 * Print the banner, then scroll down so boot progress
300 * can be printed. -- Cort 296 * can be printed. -- Cort
@@ -479,6 +475,14 @@ void __init chrp_init_IRQ(void)
479 chrp_find_openpic(); 475 chrp_find_openpic();
480 chrp_find_8259(); 476 chrp_find_8259();
481 477
478#ifdef CONFIG_SMP
479 /* Pegasos has no MPIC, those ops would make it crash. It might be an
480 * option to move setting them to after we probe the PIC though
481 */
482 if (chrp_mpic != NULL)
483 smp_ops = &chrp_smp_ops;
484#endif /* CONFIG_SMP */
485
482 if (_chrp_type == _CHRP_Pegasos) 486 if (_chrp_type == _CHRP_Pegasos)
483 ppc_md.get_irq = i8259_irq; 487 ppc_md.get_irq = i8259_irq;
484 488
diff --git a/arch/powerpc/platforms/iseries/irq.c b/arch/powerpc/platforms/iseries/irq.c
index 2275e64f3152..e32446877e78 100644
--- a/arch/powerpc/platforms/iseries/irq.c
+++ b/arch/powerpc/platforms/iseries/irq.c
@@ -300,7 +300,7 @@ int __init iSeries_allocate_IRQ(HvBusNumber bus,
300 realirq = (((((sub_bus << 8) + (bus - 1)) << 3) + (idsel - 1)) << 3) 300 realirq = (((((sub_bus << 8) + (bus - 1)) << 3) + (idsel - 1)) << 3)
301 + function; 301 + function;
302 302
303 return irq_create_mapping(NULL, realirq, IRQ_TYPE_NONE); 303 return irq_create_mapping(NULL, realirq);
304} 304}
305 305
306#endif /* CONFIG_PCI */ 306#endif /* CONFIG_PCI */
@@ -341,7 +341,7 @@ unsigned int iSeries_get_irq(struct pt_regs *regs)
341} 341}
342 342
343static int iseries_irq_host_map(struct irq_host *h, unsigned int virq, 343static int iseries_irq_host_map(struct irq_host *h, unsigned int virq,
344 irq_hw_number_t hw, unsigned int flags) 344 irq_hw_number_t hw)
345{ 345{
346 set_irq_chip_and_handler(virq, &iseries_pic, handle_fasteoi_irq); 346 set_irq_chip_and_handler(virq, &iseries_pic, handle_fasteoi_irq);
347 347
diff --git a/arch/powerpc/platforms/maple/setup.c b/arch/powerpc/platforms/maple/setup.c
index cb528c9de4c3..57567dfb9819 100644
--- a/arch/powerpc/platforms/maple/setup.c
+++ b/arch/powerpc/platforms/maple/setup.c
@@ -221,10 +221,17 @@ static void __init maple_init_IRQ(void)
221 * in Maple device-tree where the type of the controller is 221 * in Maple device-tree where the type of the controller is
222 * open-pic and not interrupt-controller 222 * open-pic and not interrupt-controller
223 */ 223 */
224 for_each_node_by_type(np, "open-pic") { 224
225 mpic_node = np; 225 for_each_node_by_type(np, "interrupt-controller")
226 break; 226 if (device_is_compatible(np, "open-pic")) {
227 } 227 mpic_node = np;
228 break;
229 }
230 if (mpic_node == NULL)
231 for_each_node_by_type(np, "open-pic") {
232 mpic_node = np;
233 break;
234 }
228 if (mpic_node == NULL) { 235 if (mpic_node == NULL) {
229 printk(KERN_ERR 236 printk(KERN_ERR
230 "Failed to locate the MPIC interrupt controller\n"); 237 "Failed to locate the MPIC interrupt controller\n");
@@ -252,6 +259,8 @@ static void __init maple_init_IRQ(void)
252 259
253 /* XXX Maple specific bits */ 260 /* XXX Maple specific bits */
254 flags |= MPIC_BROKEN_U3 | MPIC_WANTS_RESET; 261 flags |= MPIC_BROKEN_U3 | MPIC_WANTS_RESET;
262 /* All U3/U4 are big-endian, older SLOF firmware doesn't encode this */
263 flags |= MPIC_BIG_ENDIAN;
255 264
256 /* Setup the openpic driver. More device-tree junks, we hard code no 265 /* Setup the openpic driver. More device-tree junks, we hard code no
257 * ISUs for now. I'll have to revisit some stuffs with the folks doing 266 * ISUs for now. I'll have to revisit some stuffs with the folks doing
diff --git a/arch/powerpc/platforms/powermac/backlight.c b/arch/powerpc/platforms/powermac/backlight.c
index 69f65e215a5c..d66415491055 100644
--- a/arch/powerpc/platforms/powermac/backlight.c
+++ b/arch/powerpc/platforms/powermac/backlight.c
@@ -10,11 +10,33 @@
10#include <linux/kernel.h> 10#include <linux/kernel.h>
11#include <linux/fb.h> 11#include <linux/fb.h>
12#include <linux/backlight.h> 12#include <linux/backlight.h>
13#include <linux/adb.h>
14#include <linux/pmu.h>
15#include <asm/atomic.h>
13#include <asm/prom.h> 16#include <asm/prom.h>
14#include <asm/backlight.h> 17#include <asm/backlight.h>
15 18
16#define OLD_BACKLIGHT_MAX 15 19#define OLD_BACKLIGHT_MAX 15
17 20
21static void pmac_backlight_key_worker(void *data);
22static void pmac_backlight_set_legacy_worker(void *data);
23
24static DECLARE_WORK(pmac_backlight_key_work, pmac_backlight_key_worker, NULL);
25static DECLARE_WORK(pmac_backlight_set_legacy_work, pmac_backlight_set_legacy_worker, NULL);
26
27/* Although these variables are used in interrupt context, it makes no sense to
28 * protect them. No user is able to produce enough key events per second and
29 * notice the errors that might happen.
30 */
31static int pmac_backlight_key_queued;
32static int pmac_backlight_set_legacy_queued;
33
34/* The via-pmu code allows the backlight to be grabbed, in which case the
35 * in-kernel control of the brightness needs to be disabled. This should
36 * only be used by really old PowerBooks.
37 */
38static atomic_t kernel_backlight_disabled = ATOMIC_INIT(0);
39
18/* Protect the pmac_backlight variable */ 40/* Protect the pmac_backlight variable */
19DEFINE_MUTEX(pmac_backlight_mutex); 41DEFINE_MUTEX(pmac_backlight_mutex);
20 42
@@ -71,8 +93,11 @@ int pmac_backlight_curve_lookup(struct fb_info *info, int value)
71 return level; 93 return level;
72} 94}
73 95
74static void pmac_backlight_key(int direction) 96static void pmac_backlight_key_worker(void *data)
75{ 97{
98 if (atomic_read(&kernel_backlight_disabled))
99 return;
100
76 mutex_lock(&pmac_backlight_mutex); 101 mutex_lock(&pmac_backlight_mutex);
77 if (pmac_backlight) { 102 if (pmac_backlight) {
78 struct backlight_properties *props; 103 struct backlight_properties *props;
@@ -82,7 +107,8 @@ static void pmac_backlight_key(int direction)
82 props = pmac_backlight->props; 107 props = pmac_backlight->props;
83 108
84 brightness = props->brightness + 109 brightness = props->brightness +
85 ((direction?-1:1) * (props->max_brightness / 15)); 110 ((pmac_backlight_key_queued?-1:1) *
111 (props->max_brightness / 15));
86 112
87 if (brightness < 0) 113 if (brightness < 0)
88 brightness = 0; 114 brightness = 0;
@@ -97,17 +123,20 @@ static void pmac_backlight_key(int direction)
97 mutex_unlock(&pmac_backlight_mutex); 123 mutex_unlock(&pmac_backlight_mutex);
98} 124}
99 125
100void pmac_backlight_key_up() 126/* This function is called in interrupt context */
127void pmac_backlight_key(int direction)
101{ 128{
102 pmac_backlight_key(0); 129 if (atomic_read(&kernel_backlight_disabled))
130 return;
131
132 /* we can receive multiple interrupts here, but the scheduled work
133 * will run only once, with the last value
134 */
135 pmac_backlight_key_queued = direction;
136 schedule_work(&pmac_backlight_key_work);
103} 137}
104 138
105void pmac_backlight_key_down() 139static int __pmac_backlight_set_legacy_brightness(int brightness)
106{
107 pmac_backlight_key(1);
108}
109
110int pmac_backlight_set_legacy_brightness(int brightness)
111{ 140{
112 int error = -ENXIO; 141 int error = -ENXIO;
113 142
@@ -136,6 +165,28 @@ int pmac_backlight_set_legacy_brightness(int brightness)
136 return error; 165 return error;
137} 166}
138 167
168static void pmac_backlight_set_legacy_worker(void *data)
169{
170 if (atomic_read(&kernel_backlight_disabled))
171 return;
172
173 __pmac_backlight_set_legacy_brightness(pmac_backlight_set_legacy_queued);
174}
175
176/* This function is called in interrupt context */
177void pmac_backlight_set_legacy_brightness_pmu(int brightness) {
178 if (atomic_read(&kernel_backlight_disabled))
179 return;
180
181 pmac_backlight_set_legacy_queued = brightness;
182 schedule_work(&pmac_backlight_set_legacy_work);
183}
184
185int pmac_backlight_set_legacy_brightness(int brightness)
186{
187 return __pmac_backlight_set_legacy_brightness(brightness);
188}
189
139int pmac_backlight_get_legacy_brightness() 190int pmac_backlight_get_legacy_brightness()
140{ 191{
141 int result = -ENXIO; 192 int result = -ENXIO;
@@ -157,3 +208,17 @@ int pmac_backlight_get_legacy_brightness()
157 208
158 return result; 209 return result;
159} 210}
211
212void pmac_backlight_disable()
213{
214 atomic_inc(&kernel_backlight_disabled);
215}
216
217void pmac_backlight_enable()
218{
219 atomic_dec(&kernel_backlight_disabled);
220}
221
222EXPORT_SYMBOL_GPL(pmac_backlight);
223EXPORT_SYMBOL_GPL(pmac_backlight_mutex);
224EXPORT_SYMBOL_GPL(pmac_has_backlight_type);
diff --git a/arch/powerpc/platforms/powermac/bootx_init.c b/arch/powerpc/platforms/powermac/bootx_init.c
index 871b002c9f90..6a026c733f6a 100644
--- a/arch/powerpc/platforms/powermac/bootx_init.c
+++ b/arch/powerpc/platforms/powermac/bootx_init.c
@@ -181,13 +181,18 @@ static void __init bootx_add_chosen_props(unsigned long base,
181} 181}
182 182
183static void __init bootx_add_display_props(unsigned long base, 183static void __init bootx_add_display_props(unsigned long base,
184 unsigned long *mem_end) 184 unsigned long *mem_end,
185 int has_real_node)
185{ 186{
186 boot_infos_t *bi = bootx_info; 187 boot_infos_t *bi = bootx_info;
187 u32 tmp; 188 u32 tmp;
188 189
189 bootx_dt_add_prop("linux,boot-display", NULL, 0, mem_end); 190 if (has_real_node) {
190 bootx_dt_add_prop("linux,opened", NULL, 0, mem_end); 191 bootx_dt_add_prop("linux,boot-display", NULL, 0, mem_end);
192 bootx_dt_add_prop("linux,opened", NULL, 0, mem_end);
193 } else
194 bootx_dt_add_prop("linux,bootx-noscreen", NULL, 0, mem_end);
195
191 tmp = bi->dispDeviceDepth; 196 tmp = bi->dispDeviceDepth;
192 bootx_dt_add_prop("linux,bootx-depth", &tmp, 4, mem_end); 197 bootx_dt_add_prop("linux,bootx-depth", &tmp, 4, mem_end);
193 tmp = bi->dispDeviceRect[2] - bi->dispDeviceRect[0]; 198 tmp = bi->dispDeviceRect[2] - bi->dispDeviceRect[0];
@@ -241,11 +246,6 @@ static void __init bootx_scan_dt_build_strings(unsigned long base,
241 DBG(" detected display ! adding properties names !\n"); 246 DBG(" detected display ! adding properties names !\n");
242 bootx_dt_add_string("linux,boot-display", mem_end); 247 bootx_dt_add_string("linux,boot-display", mem_end);
243 bootx_dt_add_string("linux,opened", mem_end); 248 bootx_dt_add_string("linux,opened", mem_end);
244 bootx_dt_add_string("linux,bootx-depth", mem_end);
245 bootx_dt_add_string("linux,bootx-width", mem_end);
246 bootx_dt_add_string("linux,bootx-height", mem_end);
247 bootx_dt_add_string("linux,bootx-linebytes", mem_end);
248 bootx_dt_add_string("linux,bootx-addr", mem_end);
249 strncpy(bootx_disp_path, namep, 255); 249 strncpy(bootx_disp_path, namep, 255);
250 } 250 }
251 251
@@ -329,10 +329,13 @@ static void __init bootx_scan_dt_build_struct(unsigned long base,
329 ppp = &pp->next; 329 ppp = &pp->next;
330 } 330 }
331 331
332 if (node == bootx_node_chosen) 332 if (node == bootx_node_chosen) {
333 bootx_add_chosen_props(base, mem_end); 333 bootx_add_chosen_props(base, mem_end);
334 if (node == bootx_info->dispDeviceRegEntryOffset) 334 if (bootx_info->dispDeviceRegEntryOffset == 0)
335 bootx_add_display_props(base, mem_end); 335 bootx_add_display_props(base, mem_end, 0);
336 }
337 else if (node == bootx_info->dispDeviceRegEntryOffset)
338 bootx_add_display_props(base, mem_end, 1);
336 339
337 /* do all our children */ 340 /* do all our children */
338 cpp = &np->child; 341 cpp = &np->child;
@@ -374,6 +377,14 @@ static unsigned long __init bootx_flatten_dt(unsigned long start)
374 mem_end += 4; 377 mem_end += 4;
375 bootx_dt_strend = mem_end; 378 bootx_dt_strend = mem_end;
376 bootx_scan_dt_build_strings(base, 4, &mem_end); 379 bootx_scan_dt_build_strings(base, 4, &mem_end);
380 /* Add some strings */
381 bootx_dt_add_string("linux,bootx-noscreen", &mem_end);
382 bootx_dt_add_string("linux,bootx-depth", &mem_end);
383 bootx_dt_add_string("linux,bootx-width", &mem_end);
384 bootx_dt_add_string("linux,bootx-height", &mem_end);
385 bootx_dt_add_string("linux,bootx-linebytes", &mem_end);
386 bootx_dt_add_string("linux,bootx-addr", &mem_end);
387 /* Wrap up strings */
377 hdr->off_dt_strings = bootx_dt_strbase - mem_start; 388 hdr->off_dt_strings = bootx_dt_strbase - mem_start;
378 hdr->dt_strings_size = bootx_dt_strend - bootx_dt_strbase; 389 hdr->dt_strings_size = bootx_dt_strend - bootx_dt_strbase;
379 390
@@ -471,6 +482,7 @@ void __init bootx_init(unsigned long r3, unsigned long r4)
471 if (bi->dispDeviceDepth == 16) 482 if (bi->dispDeviceDepth == 16)
472 bi->dispDeviceDepth = 15; 483 bi->dispDeviceDepth = 15;
473 484
485
474#ifdef CONFIG_BOOTX_TEXT 486#ifdef CONFIG_BOOTX_TEXT
475 ptr = (unsigned long)bi->logicalDisplayBase; 487 ptr = (unsigned long)bi->logicalDisplayBase;
476 ptr += bi->dispDeviceRect[1] * bi->dispDeviceRowBytes; 488 ptr += bi->dispDeviceRect[1] * bi->dispDeviceRowBytes;
@@ -508,6 +520,7 @@ void __init bootx_init(unsigned long r3, unsigned long r4)
508#ifdef CONFIG_BOOTX_TEXT 520#ifdef CONFIG_BOOTX_TEXT
509 btext_welcome(bi); 521 btext_welcome(bi);
510#endif 522#endif
523
511 /* New BootX enters kernel with MMU off, i/os are not allowed 524 /* New BootX enters kernel with MMU off, i/os are not allowed
512 * here. This hack will have been done by the boostrap anyway. 525 * here. This hack will have been done by the boostrap anyway.
513 */ 526 */
diff --git a/arch/powerpc/platforms/powermac/cpufreq_64.c b/arch/powerpc/platforms/powermac/cpufreq_64.c
index f08a14516139..7b1156ea5341 100644
--- a/arch/powerpc/platforms/powermac/cpufreq_64.c
+++ b/arch/powerpc/platforms/powermac/cpufreq_64.c
@@ -10,6 +10,8 @@
10 * that is iMac G5 and latest single CPU desktop. 10 * that is iMac G5 and latest single CPU desktop.
11 */ 11 */
12 12
13#undef DEBUG
14
13#include <linux/module.h> 15#include <linux/module.h>
14#include <linux/types.h> 16#include <linux/types.h>
15#include <linux/errno.h> 17#include <linux/errno.h>
@@ -30,13 +32,7 @@
30#include <asm/smu.h> 32#include <asm/smu.h>
31#include <asm/pmac_pfunc.h> 33#include <asm/pmac_pfunc.h>
32 34
33#undef DEBUG 35#define DBG(fmt...) pr_debug(fmt)
34
35#ifdef DEBUG
36#define DBG(fmt...) printk(fmt)
37#else
38#define DBG(fmt...)
39#endif
40 36
41/* see 970FX user manual */ 37/* see 970FX user manual */
42 38
@@ -82,8 +78,6 @@ static struct freq_attr* g5_cpu_freqs_attr[] = {
82/* Power mode data is an array of the 32 bits PCR values to use for 78/* Power mode data is an array of the 32 bits PCR values to use for
83 * the various frequencies, retrieved from the device-tree 79 * the various frequencies, retrieved from the device-tree
84 */ 80 */
85static u32 *g5_pmode_data;
86static int g5_pmode_max;
87static int g5_pmode_cur; 81static int g5_pmode_cur;
88 82
89static void (*g5_switch_volt)(int speed_mode); 83static void (*g5_switch_volt)(int speed_mode);
@@ -93,6 +87,11 @@ static int (*g5_query_freq)(void);
93static DEFINE_MUTEX(g5_switch_mutex); 87static DEFINE_MUTEX(g5_switch_mutex);
94 88
95 89
90#ifdef CONFIG_PMAC_SMU
91
92static u32 *g5_pmode_data;
93static int g5_pmode_max;
94
96static struct smu_sdbp_fvt *g5_fvt_table; /* table of op. points */ 95static struct smu_sdbp_fvt *g5_fvt_table; /* table of op. points */
97static int g5_fvt_count; /* number of op. points */ 96static int g5_fvt_count; /* number of op. points */
98static int g5_fvt_cur; /* current op. point */ 97static int g5_fvt_cur; /* current op. point */
@@ -210,6 +209,16 @@ static int g5_scom_query_freq(void)
210} 209}
211 210
212/* 211/*
212 * Fake voltage switching for platforms with missing support
213 */
214
215static void g5_dummy_switch_volt(int speed_mode)
216{
217}
218
219#endif /* CONFIG_PMAC_SMU */
220
221/*
213 * Platform function based voltage switching for PowerMac7,2 & 7,3 222 * Platform function based voltage switching for PowerMac7,2 & 7,3
214 */ 223 */
215 224
@@ -248,6 +257,9 @@ static int g5_pfunc_switch_freq(int speed_mode)
248 struct pmf_args args; 257 struct pmf_args args;
249 u32 done = 0; 258 u32 done = 0;
250 unsigned long timeout; 259 unsigned long timeout;
260 int rc;
261
262 DBG("g5_pfunc_switch_freq(%d)\n", speed_mode);
251 263
252 /* If frequency is going up, first ramp up the voltage */ 264 /* If frequency is going up, first ramp up the voltage */
253 if (speed_mode < g5_pmode_cur) 265 if (speed_mode < g5_pmode_cur)
@@ -255,9 +267,12 @@ static int g5_pfunc_switch_freq(int speed_mode)
255 267
256 /* Do it */ 268 /* Do it */
257 if (speed_mode == CPUFREQ_HIGH) 269 if (speed_mode == CPUFREQ_HIGH)
258 pmf_call_one(pfunc_cpu_setfreq_high, NULL); 270 rc = pmf_call_one(pfunc_cpu_setfreq_high, NULL);
259 else 271 else
260 pmf_call_one(pfunc_cpu_setfreq_low, NULL); 272 rc = pmf_call_one(pfunc_cpu_setfreq_low, NULL);
273
274 if (rc)
275 printk(KERN_WARNING "cpufreq: pfunc switch error %d\n", rc);
261 276
262 /* It's an irq GPIO so we should be able to just block here, 277 /* It's an irq GPIO so we should be able to just block here,
263 * I'll do that later after I've properly tested the IRQ code for 278 * I'll do that later after I've properly tested the IRQ code for
@@ -296,13 +311,6 @@ static int g5_pfunc_query_freq(void)
296 return val ? CPUFREQ_HIGH : CPUFREQ_LOW; 311 return val ? CPUFREQ_HIGH : CPUFREQ_LOW;
297} 312}
298 313
299/*
300 * Fake voltage switching for platforms with missing support
301 */
302
303static void g5_dummy_switch_volt(int speed_mode)
304{
305}
306 314
307/* 315/*
308 * Common interface to the cpufreq core 316 * Common interface to the cpufreq core
@@ -375,6 +383,8 @@ static struct cpufreq_driver g5_cpufreq_driver = {
375}; 383};
376 384
377 385
386#ifdef CONFIG_PMAC_SMU
387
378static int __init g5_neo2_cpufreq_init(struct device_node *cpus) 388static int __init g5_neo2_cpufreq_init(struct device_node *cpus)
379{ 389{
380 struct device_node *cpunode; 390 struct device_node *cpunode;
@@ -525,6 +535,9 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus)
525 return rc; 535 return rc;
526} 536}
527 537
538#endif /* CONFIG_PMAC_SMU */
539
540
528static int __init g5_pm72_cpufreq_init(struct device_node *cpus) 541static int __init g5_pm72_cpufreq_init(struct device_node *cpus)
529{ 542{
530 struct device_node *cpuid = NULL, *hwclock = NULL, *cpunode = NULL; 543 struct device_node *cpuid = NULL, *hwclock = NULL, *cpunode = NULL;
@@ -533,6 +546,9 @@ static int __init g5_pm72_cpufreq_init(struct device_node *cpus)
533 u64 max_freq, min_freq, ih, il; 546 u64 max_freq, min_freq, ih, il;
534 int has_volt = 1, rc = 0; 547 int has_volt = 1, rc = 0;
535 548
549 DBG("cpufreq: Initializing for PowerMac7,2, PowerMac7,3 and"
550 " RackMac3,1...\n");
551
536 /* Get first CPU node */ 552 /* Get first CPU node */
537 for (cpunode = NULL; 553 for (cpunode = NULL;
538 (cpunode = of_get_next_child(cpus, cpunode)) != NULL;) { 554 (cpunode = of_get_next_child(cpus, cpunode)) != NULL;) {
@@ -636,6 +652,15 @@ static int __init g5_pm72_cpufreq_init(struct device_node *cpus)
636 */ 652 */
637 ih = *((u32 *)(eeprom + 0x10)); 653 ih = *((u32 *)(eeprom + 0x10));
638 il = *((u32 *)(eeprom + 0x20)); 654 il = *((u32 *)(eeprom + 0x20));
655
656 /* Check for machines with no useful settings */
657 if (il == ih) {
658 printk(KERN_WARNING "cpufreq: No low frequency mode available"
659 " on this model !\n");
660 rc = -ENODEV;
661 goto bail;
662 }
663
639 min_freq = 0; 664 min_freq = 0;
640 if (ih != 0 && il != 0) 665 if (ih != 0 && il != 0)
641 min_freq = (max_freq * il) / ih; 666 min_freq = (max_freq * il) / ih;
@@ -643,7 +668,7 @@ static int __init g5_pm72_cpufreq_init(struct device_node *cpus)
643 /* Sanity check */ 668 /* Sanity check */
644 if (min_freq >= max_freq || min_freq < 1000) { 669 if (min_freq >= max_freq || min_freq < 1000) {
645 printk(KERN_ERR "cpufreq: Can't calculate low frequency !\n"); 670 printk(KERN_ERR "cpufreq: Can't calculate low frequency !\n");
646 rc = -ENODEV; 671 rc = -ENXIO;
647 goto bail; 672 goto bail;
648 } 673 }
649 g5_cpu_freqs[0].frequency = max_freq; 674 g5_cpu_freqs[0].frequency = max_freq;
@@ -690,16 +715,10 @@ static int __init g5_pm72_cpufreq_init(struct device_node *cpus)
690 return rc; 715 return rc;
691} 716}
692 717
693static int __init g5_rm31_cpufreq_init(struct device_node *cpus)
694{
695 /* NYI */
696 return 0;
697}
698
699static int __init g5_cpufreq_init(void) 718static int __init g5_cpufreq_init(void)
700{ 719{
701 struct device_node *cpus; 720 struct device_node *cpus;
702 int rc; 721 int rc = 0;
703 722
704 cpus = of_find_node_by_path("/cpus"); 723 cpus = of_find_node_by_path("/cpus");
705 if (cpus == NULL) { 724 if (cpus == NULL) {
@@ -708,12 +727,13 @@ static int __init g5_cpufreq_init(void)
708 } 727 }
709 728
710 if (machine_is_compatible("PowerMac7,2") || 729 if (machine_is_compatible("PowerMac7,2") ||
711 machine_is_compatible("PowerMac7,3")) 730 machine_is_compatible("PowerMac7,3") ||
731 machine_is_compatible("RackMac3,1"))
712 rc = g5_pm72_cpufreq_init(cpus); 732 rc = g5_pm72_cpufreq_init(cpus);
713 else if (machine_is_compatible("RackMac3,1")) 733#ifdef CONFIG_PMAC_SMU
714 rc = g5_rm31_cpufreq_init(cpus);
715 else 734 else
716 rc = g5_neo2_cpufreq_init(cpus); 735 rc = g5_neo2_cpufreq_init(cpus);
736#endif /* CONFIG_PMAC_SMU */
717 737
718 of_node_put(cpus); 738 of_node_put(cpus);
719 return rc; 739 return rc;
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c
index 556b349797e8..205d04471161 100644
--- a/arch/powerpc/platforms/powermac/pci.c
+++ b/arch/powerpc/platforms/powermac/pci.c
@@ -16,6 +16,7 @@
16#include <linux/string.h> 16#include <linux/string.h>
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/bootmem.h> 18#include <linux/bootmem.h>
19#include <linux/irq.h>
19 20
20#include <asm/sections.h> 21#include <asm/sections.h>
21#include <asm/io.h> 22#include <asm/io.h>
@@ -24,10 +25,7 @@
24#include <asm/machdep.h> 25#include <asm/machdep.h>
25#include <asm/pmac_feature.h> 26#include <asm/pmac_feature.h>
26#include <asm/grackle.h> 27#include <asm/grackle.h>
27#ifdef CONFIG_PPC64
28//#include <asm/iommu.h>
29#include <asm/ppc-pci.h> 28#include <asm/ppc-pci.h>
30#endif
31 29
32#undef DEBUG 30#undef DEBUG
33 31
@@ -46,7 +44,6 @@ static int has_uninorth;
46static struct pci_controller *u3_agp; 44static struct pci_controller *u3_agp;
47static struct pci_controller *u4_pcie; 45static struct pci_controller *u4_pcie;
48static struct pci_controller *u3_ht; 46static struct pci_controller *u3_ht;
49#define has_second_ohare 0
50#else 47#else
51static int has_second_ohare; 48static int has_second_ohare;
52#endif /* CONFIG_PPC64 */ 49#endif /* CONFIG_PPC64 */
@@ -993,6 +990,7 @@ void __init pmac_pcibios_fixup(void)
993 /* Read interrupt from the device-tree */ 990 /* Read interrupt from the device-tree */
994 pci_read_irq_line(dev); 991 pci_read_irq_line(dev);
995 992
993#ifdef CONFIG_PPC32
996 /* Fixup interrupt for the modem/ethernet combo controller. 994 /* Fixup interrupt for the modem/ethernet combo controller.
997 * on machines with a second ohare chip. 995 * on machines with a second ohare chip.
998 * The number in the device tree (27) is bogus (correct for 996 * The number in the device tree (27) is bogus (correct for
@@ -1002,8 +1000,11 @@ void __init pmac_pcibios_fixup(void)
1002 */ 1000 */
1003 if (has_second_ohare && 1001 if (has_second_ohare &&
1004 dev->vendor == PCI_VENDOR_ID_DEC && 1002 dev->vendor == PCI_VENDOR_ID_DEC &&
1005 dev->device == PCI_DEVICE_ID_DEC_TULIP_PLUS) 1003 dev->device == PCI_DEVICE_ID_DEC_TULIP_PLUS) {
1006 dev->irq = irq_create_mapping(NULL, 60, 0); 1004 dev->irq = irq_create_mapping(NULL, 60);
1005 set_irq_type(dev->irq, IRQ_TYPE_LEVEL_LOW);
1006 }
1007#endif /* CONFIG_PPC32 */
1007 } 1008 }
1008} 1009}
1009 1010
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c
index 3d328bc1f7e0..060789e31c67 100644
--- a/arch/powerpc/platforms/powermac/pic.c
+++ b/arch/powerpc/platforms/powermac/pic.c
@@ -291,7 +291,7 @@ static int pmac_pic_host_match(struct irq_host *h, struct device_node *node)
291} 291}
292 292
293static int pmac_pic_host_map(struct irq_host *h, unsigned int virq, 293static int pmac_pic_host_map(struct irq_host *h, unsigned int virq,
294 irq_hw_number_t hw, unsigned int flags) 294 irq_hw_number_t hw)
295{ 295{
296 struct irq_desc *desc = get_irq_desc(virq); 296 struct irq_desc *desc = get_irq_desc(virq);
297 int level; 297 int level;
@@ -318,6 +318,7 @@ static int pmac_pic_host_xlate(struct irq_host *h, struct device_node *ct,
318 unsigned int *out_flags) 318 unsigned int *out_flags)
319 319
320{ 320{
321 *out_flags = IRQ_TYPE_NONE;
321 *out_hwirq = *intspec; 322 *out_hwirq = *intspec;
322 return 0; 323 return 0;
323} 324}
@@ -434,7 +435,7 @@ static void __init pmac_pic_probe_oldstyle(void)
434 435
435 printk(KERN_INFO "irq: System has %d possible interrupts\n", max_irqs); 436 printk(KERN_INFO "irq: System has %d possible interrupts\n", max_irqs);
436#ifdef CONFIG_XMON 437#ifdef CONFIG_XMON
437 setup_irq(irq_create_mapping(NULL, 20, 0), &xmon_action); 438 setup_irq(irq_create_mapping(NULL, 20), &xmon_action);
438#endif 439#endif
439} 440}
440#endif /* CONFIG_PPC32 */ 441#endif /* CONFIG_PPC32 */
@@ -579,9 +580,10 @@ void __init pmac_pic_init(void)
579 flags |= OF_IMAP_OLDWORLD_MAC; 580 flags |= OF_IMAP_OLDWORLD_MAC;
580 if (get_property(of_chosen, "linux,bootx", NULL) != NULL) 581 if (get_property(of_chosen, "linux,bootx", NULL) != NULL)
581 flags |= OF_IMAP_NO_PHANDLE; 582 flags |= OF_IMAP_NO_PHANDLE;
582 of_irq_map_init(flags);
583#endif /* CONFIG_PPC_32 */ 583#endif /* CONFIG_PPC_32 */
584 584
585 of_irq_map_init(flags);
586
585 /* We first try to detect Apple's new Core99 chipset, since mac-io 587 /* We first try to detect Apple's new Core99 chipset, since mac-io
586 * is quite different on those machines and contains an IBM MPIC2. 588 * is quite different on those machines and contains an IBM MPIC2.
587 */ 589 */
diff --git a/arch/powerpc/platforms/pseries/ras.c b/arch/powerpc/platforms/pseries/ras.c
index 9df783088b61..c7ffde1a614e 100644
--- a/arch/powerpc/platforms/pseries/ras.c
+++ b/arch/powerpc/platforms/pseries/ras.c
@@ -93,8 +93,7 @@ static void request_ras_irqs(struct device_node *np,
93 for (i = 0; i < opicplen; i++) { 93 for (i = 0; i < opicplen; i++) {
94 if (count > 15) 94 if (count > 15)
95 break; 95 break;
96 virqs[count] = irq_create_mapping(NULL, *(opicprop++), 96 virqs[count] = irq_create_mapping(NULL, *(opicprop++));
97 IRQ_TYPE_NONE);
98 if (virqs[count] == NO_IRQ) 97 if (virqs[count] == NO_IRQ)
99 printk(KERN_ERR "Unable to allocate interrupt " 98 printk(KERN_ERR "Unable to allocate interrupt "
100 "number for %s\n", np->full_name); 99 "number for %s\n", np->full_name);
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index 54a52437265c..71c634e0b87c 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -501,7 +501,8 @@ static void pseries_dedicated_idle_sleep(void)
501 } 501 }
502 502
503 /* 503 /*
504 * Cede if the other thread is not idle, so that it can 504 * If not SMT, cede processor. If CPU is running SMT
505 * cede if the other thread is not idle, so that it can
505 * go single-threaded. If the other thread is idle, 506 * go single-threaded. If the other thread is idle,
506 * we ask the hypervisor if it has pending work it 507 * we ask the hypervisor if it has pending work it
507 * wants to do and cede if it does. Otherwise we keep 508 * wants to do and cede if it does. Otherwise we keep
@@ -514,7 +515,8 @@ static void pseries_dedicated_idle_sleep(void)
514 * very low priority. The cede enables interrupts, which 515 * very low priority. The cede enables interrupts, which
515 * doesn't matter here. 516 * doesn't matter here.
516 */ 517 */
517 if (!lppaca[cpu ^ 1].idle || poll_pending() == H_PENDING) 518 if (!cpu_has_feature(CPU_FTR_SMT) || !lppaca[cpu ^ 1].idle
519 || poll_pending() == H_PENDING)
518 cede_processor(); 520 cede_processor();
519 521
520out: 522out:
diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c
index 716972aa9777..2d0da6f9e244 100644
--- a/arch/powerpc/platforms/pseries/xics.c
+++ b/arch/powerpc/platforms/pseries/xics.c
@@ -502,16 +502,9 @@ static int xics_host_match(struct irq_host *h, struct device_node *node)
502} 502}
503 503
504static int xics_host_map_direct(struct irq_host *h, unsigned int virq, 504static int xics_host_map_direct(struct irq_host *h, unsigned int virq,
505 irq_hw_number_t hw, unsigned int flags) 505 irq_hw_number_t hw)
506{ 506{
507 unsigned int sense = flags & IRQ_TYPE_SENSE_MASK; 507 pr_debug("xics: map_direct virq %d, hwirq 0x%lx\n", virq, hw);
508
509 pr_debug("xics: map_direct virq %d, hwirq 0x%lx, flags: 0x%x\n",
510 virq, hw, flags);
511
512 if (sense && sense != IRQ_TYPE_LEVEL_LOW)
513 printk(KERN_WARNING "xics: using unsupported sense 0x%x"
514 " for irq %d (h: 0x%lx)\n", flags, virq, hw);
515 508
516 get_irq_desc(virq)->status |= IRQ_LEVEL; 509 get_irq_desc(virq)->status |= IRQ_LEVEL;
517 set_irq_chip_and_handler(virq, &xics_pic_direct, handle_fasteoi_irq); 510 set_irq_chip_and_handler(virq, &xics_pic_direct, handle_fasteoi_irq);
@@ -519,16 +512,9 @@ static int xics_host_map_direct(struct irq_host *h, unsigned int virq,
519} 512}
520 513
521static int xics_host_map_lpar(struct irq_host *h, unsigned int virq, 514static int xics_host_map_lpar(struct irq_host *h, unsigned int virq,
522 irq_hw_number_t hw, unsigned int flags) 515 irq_hw_number_t hw)
523{ 516{
524 unsigned int sense = flags & IRQ_TYPE_SENSE_MASK; 517 pr_debug("xics: map_direct virq %d, hwirq 0x%lx\n", virq, hw);
525
526 pr_debug("xics: map_lpar virq %d, hwirq 0x%lx, flags: 0x%x\n",
527 virq, hw, flags);
528
529 if (sense && sense != IRQ_TYPE_LEVEL_LOW)
530 printk(KERN_WARNING "xics: using unsupported sense 0x%x"
531 " for irq %d (h: 0x%lx)\n", flags, virq, hw);
532 518
533 get_irq_desc(virq)->status |= IRQ_LEVEL; 519 get_irq_desc(virq)->status |= IRQ_LEVEL;
534 set_irq_chip_and_handler(virq, &xics_pic_lpar, handle_fasteoi_irq); 520 set_irq_chip_and_handler(virq, &xics_pic_lpar, handle_fasteoi_irq);
@@ -757,7 +743,7 @@ void xics_request_IPIs(void)
757{ 743{
758 unsigned int ipi; 744 unsigned int ipi;
759 745
760 ipi = irq_create_mapping(xics_host, XICS_IPI, 0); 746 ipi = irq_create_mapping(xics_host, XICS_IPI);
761 BUG_ON(ipi == NO_IRQ); 747 BUG_ON(ipi == NO_IRQ);
762 748
763 /* 749 /*
@@ -783,6 +769,14 @@ void xics_teardown_cpu(int secondary)
783 xics_set_cpu_priority(cpu, 0); 769 xics_set_cpu_priority(cpu, 0);
784 770
785 /* 771 /*
772 * Clear IPI
773 */
774 if (firmware_has_feature(FW_FEATURE_LPAR))
775 lpar_qirr_info(cpu, 0xff);
776 else
777 direct_qirr_info(cpu, 0xff);
778
779 /*
786 * we need to EOI the IPI if we got here from kexec down IPI 780 * we need to EOI the IPI if we got here from kexec down IPI
787 * 781 *
788 * probably need to check all the other interrupts too 782 * probably need to check all the other interrupts too
@@ -795,7 +789,7 @@ void xics_teardown_cpu(int secondary)
795 return; 789 return;
796 desc = get_irq_desc(ipi); 790 desc = get_irq_desc(ipi);
797 if (desc->chip && desc->chip->eoi) 791 if (desc->chip && desc->chip->eoi)
798 desc->chip->eoi(XICS_IPI); 792 desc->chip->eoi(ipi);
799 793
800 /* 794 /*
801 * Some machines need to have at least one cpu in the GIQ, 795 * Some machines need to have at least one cpu in the GIQ,
diff --git a/arch/powerpc/sysdev/i8259.c b/arch/powerpc/sysdev/i8259.c
index 72c73a6105cd..9855820b9548 100644
--- a/arch/powerpc/sysdev/i8259.c
+++ b/arch/powerpc/sysdev/i8259.c
@@ -169,7 +169,7 @@ static int i8259_host_match(struct irq_host *h, struct device_node *node)
169} 169}
170 170
171static int i8259_host_map(struct irq_host *h, unsigned int virq, 171static int i8259_host_map(struct irq_host *h, unsigned int virq,
172 irq_hw_number_t hw, unsigned int flags) 172 irq_hw_number_t hw)
173{ 173{
174 pr_debug("i8259_host_map(%d, 0x%lx)\n", virq, hw); 174 pr_debug("i8259_host_map(%d, 0x%lx)\n", virq, hw);
175 175
@@ -177,7 +177,7 @@ static int i8259_host_map(struct irq_host *h, unsigned int virq,
177 if (hw == 2) 177 if (hw == 2)
178 get_irq_desc(virq)->status |= IRQ_NOREQUEST; 178 get_irq_desc(virq)->status |= IRQ_NOREQUEST;
179 179
180 /* We use the level stuff only for now, we might want to 180 /* We use the level handler only for now, we might want to
181 * be more cautious here but that works for now 181 * be more cautious here but that works for now
182 */ 182 */
183 get_irq_desc(virq)->status |= IRQ_LEVEL; 183 get_irq_desc(virq)->status |= IRQ_LEVEL;
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 9cecebaa0360..6e0281afa6c3 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -204,7 +204,7 @@ static void mpic_startup_ht_interrupt(struct mpic *mpic, unsigned int source,
204 if (fixup->base == NULL) 204 if (fixup->base == NULL)
205 return; 205 return;
206 206
207 DBG("startup_ht_interrupt(%u, %u) index: %d\n", 207 DBG("startup_ht_interrupt(0x%x, 0x%x) index: %d\n",
208 source, irqflags, fixup->index); 208 source, irqflags, fixup->index);
209 spin_lock_irqsave(&mpic->fixup_lock, flags); 209 spin_lock_irqsave(&mpic->fixup_lock, flags);
210 /* Enable and configure */ 210 /* Enable and configure */
@@ -227,7 +227,7 @@ static void mpic_shutdown_ht_interrupt(struct mpic *mpic, unsigned int source,
227 if (fixup->base == NULL) 227 if (fixup->base == NULL)
228 return; 228 return;
229 229
230 DBG("shutdown_ht_interrupt(%u, %u)\n", source, irqflags); 230 DBG("shutdown_ht_interrupt(0x%x, 0x%x)\n", source, irqflags);
231 231
232 /* Disable */ 232 /* Disable */
233 spin_lock_irqsave(&mpic->fixup_lock, flags); 233 spin_lock_irqsave(&mpic->fixup_lock, flags);
@@ -337,6 +337,17 @@ static void __init mpic_scan_ht_pics(struct mpic *mpic)
337 } 337 }
338} 338}
339 339
340#else /* CONFIG_MPIC_BROKEN_U3 */
341
342static inline int mpic_is_ht_interrupt(struct mpic *mpic, unsigned int source)
343{
344 return 0;
345}
346
347static void __init mpic_scan_ht_pics(struct mpic *mpic)
348{
349}
350
340#endif /* CONFIG_MPIC_BROKEN_U3 */ 351#endif /* CONFIG_MPIC_BROKEN_U3 */
341 352
342 353
@@ -405,11 +416,9 @@ static void mpic_unmask_irq(unsigned int irq)
405 unsigned int loops = 100000; 416 unsigned int loops = 100000;
406 struct mpic *mpic = mpic_from_irq(irq); 417 struct mpic *mpic = mpic_from_irq(irq);
407 unsigned int src = mpic_irq_to_hw(irq); 418 unsigned int src = mpic_irq_to_hw(irq);
408 unsigned long flags;
409 419
410 DBG("%p: %s: enable_irq: %d (src %d)\n", mpic, mpic->name, irq, src); 420 DBG("%p: %s: enable_irq: %d (src %d)\n", mpic, mpic->name, irq, src);
411 421
412 spin_lock_irqsave(&mpic_lock, flags);
413 mpic_irq_write(src, MPIC_IRQ_VECTOR_PRI, 422 mpic_irq_write(src, MPIC_IRQ_VECTOR_PRI,
414 mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) & 423 mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) &
415 ~MPIC_VECPRI_MASK); 424 ~MPIC_VECPRI_MASK);
@@ -420,7 +429,6 @@ static void mpic_unmask_irq(unsigned int irq)
420 break; 429 break;
421 } 430 }
422 } while(mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) & MPIC_VECPRI_MASK); 431 } while(mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) & MPIC_VECPRI_MASK);
423 spin_unlock_irqrestore(&mpic_lock, flags);
424} 432}
425 433
426static void mpic_mask_irq(unsigned int irq) 434static void mpic_mask_irq(unsigned int irq)
@@ -428,11 +436,9 @@ static void mpic_mask_irq(unsigned int irq)
428 unsigned int loops = 100000; 436 unsigned int loops = 100000;
429 struct mpic *mpic = mpic_from_irq(irq); 437 struct mpic *mpic = mpic_from_irq(irq);
430 unsigned int src = mpic_irq_to_hw(irq); 438 unsigned int src = mpic_irq_to_hw(irq);
431 unsigned long flags;
432 439
433 DBG("%s: disable_irq: %d (src %d)\n", mpic->name, irq, src); 440 DBG("%s: disable_irq: %d (src %d)\n", mpic->name, irq, src);
434 441
435 spin_lock_irqsave(&mpic_lock, flags);
436 mpic_irq_write(src, MPIC_IRQ_VECTOR_PRI, 442 mpic_irq_write(src, MPIC_IRQ_VECTOR_PRI,
437 mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) | 443 mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) |
438 MPIC_VECPRI_MASK); 444 MPIC_VECPRI_MASK);
@@ -444,7 +450,6 @@ static void mpic_mask_irq(unsigned int irq)
444 break; 450 break;
445 } 451 }
446 } while(!(mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) & MPIC_VECPRI_MASK)); 452 } while(!(mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) & MPIC_VECPRI_MASK));
447 spin_unlock_irqrestore(&mpic_lock, flags);
448} 453}
449 454
450static void mpic_end_irq(unsigned int irq) 455static void mpic_end_irq(unsigned int irq)
@@ -512,8 +517,7 @@ static void mpic_end_ht_irq(unsigned int irq)
512 mpic_ht_end_irq(mpic, src); 517 mpic_ht_end_irq(mpic, src);
513 mpic_eoi(mpic); 518 mpic_eoi(mpic);
514} 519}
515 520#endif /* !CONFIG_MPIC_BROKEN_U3 */
516#endif /* CONFIG_MPIC_BROKEN_U3 */
517 521
518#ifdef CONFIG_SMP 522#ifdef CONFIG_SMP
519 523
@@ -560,47 +564,74 @@ static void mpic_set_affinity(unsigned int irq, cpumask_t cpumask)
560 mpic_physmask(cpus_addr(tmp)[0])); 564 mpic_physmask(cpus_addr(tmp)[0]));
561} 565}
562 566
563static unsigned int mpic_flags_to_vecpri(unsigned int flags, int *level) 567static unsigned int mpic_type_to_vecpri(unsigned int type)
564{ 568{
565 unsigned int vecpri;
566
567 /* Now convert sense value */ 569 /* Now convert sense value */
568 switch(flags & IRQ_TYPE_SENSE_MASK) { 570 switch(type & IRQ_TYPE_SENSE_MASK) {
569 case IRQ_TYPE_EDGE_RISING: 571 case IRQ_TYPE_EDGE_RISING:
570 vecpri = MPIC_VECPRI_SENSE_EDGE | 572 return MPIC_VECPRI_SENSE_EDGE | MPIC_VECPRI_POLARITY_POSITIVE;
571 MPIC_VECPRI_POLARITY_POSITIVE;
572 *level = 0;
573 break;
574 case IRQ_TYPE_EDGE_FALLING: 573 case IRQ_TYPE_EDGE_FALLING:
575 vecpri = MPIC_VECPRI_SENSE_EDGE | 574 case IRQ_TYPE_EDGE_BOTH:
576 MPIC_VECPRI_POLARITY_NEGATIVE; 575 return MPIC_VECPRI_SENSE_EDGE | MPIC_VECPRI_POLARITY_NEGATIVE;
577 *level = 0;
578 break;
579 case IRQ_TYPE_LEVEL_HIGH: 576 case IRQ_TYPE_LEVEL_HIGH:
580 vecpri = MPIC_VECPRI_SENSE_LEVEL | 577 return MPIC_VECPRI_SENSE_LEVEL | MPIC_VECPRI_POLARITY_POSITIVE;
581 MPIC_VECPRI_POLARITY_POSITIVE;
582 *level = 1;
583 break;
584 case IRQ_TYPE_LEVEL_LOW: 578 case IRQ_TYPE_LEVEL_LOW:
585 default: 579 default:
586 vecpri = MPIC_VECPRI_SENSE_LEVEL | 580 return MPIC_VECPRI_SENSE_LEVEL | MPIC_VECPRI_POLARITY_NEGATIVE;
587 MPIC_VECPRI_POLARITY_NEGATIVE;
588 *level = 1;
589 } 581 }
590 return vecpri; 582}
583
584static int mpic_set_irq_type(unsigned int virq, unsigned int flow_type)
585{
586 struct mpic *mpic = mpic_from_irq(virq);
587 unsigned int src = mpic_irq_to_hw(virq);
588 struct irq_desc *desc = get_irq_desc(virq);
589 unsigned int vecpri, vold, vnew;
590
591 DBG("mpic: set_irq_type(mpic:@%p,virq:%d,src:0x%x,type:0x%x)\n",
592 mpic, virq, src, flow_type);
593
594 if (src >= mpic->irq_count)
595 return -EINVAL;
596
597 if (flow_type == IRQ_TYPE_NONE)
598 if (mpic->senses && src < mpic->senses_count)
599 flow_type = mpic->senses[src];
600 if (flow_type == IRQ_TYPE_NONE)
601 flow_type = IRQ_TYPE_LEVEL_LOW;
602
603 desc->status &= ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL);
604 desc->status |= flow_type & IRQ_TYPE_SENSE_MASK;
605 if (flow_type & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW))
606 desc->status |= IRQ_LEVEL;
607
608 if (mpic_is_ht_interrupt(mpic, src))
609 vecpri = MPIC_VECPRI_POLARITY_POSITIVE |
610 MPIC_VECPRI_SENSE_EDGE;
611 else
612 vecpri = mpic_type_to_vecpri(flow_type);
613
614 vold = mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI);
615 vnew = vold & ~(MPIC_VECPRI_POLARITY_MASK | MPIC_VECPRI_SENSE_MASK);
616 vnew |= vecpri;
617 if (vold != vnew)
618 mpic_irq_write(src, MPIC_IRQ_VECTOR_PRI, vnew);
619
620 return 0;
591} 621}
592 622
593static struct irq_chip mpic_irq_chip = { 623static struct irq_chip mpic_irq_chip = {
594 .mask = mpic_mask_irq, 624 .mask = mpic_mask_irq,
595 .unmask = mpic_unmask_irq, 625 .unmask = mpic_unmask_irq,
596 .eoi = mpic_end_irq, 626 .eoi = mpic_end_irq,
627 .set_type = mpic_set_irq_type,
597}; 628};
598 629
599#ifdef CONFIG_SMP 630#ifdef CONFIG_SMP
600static struct irq_chip mpic_ipi_chip = { 631static struct irq_chip mpic_ipi_chip = {
601 .mask = mpic_mask_ipi, 632 .mask = mpic_mask_ipi,
602 .unmask = mpic_unmask_ipi, 633 .unmask = mpic_unmask_ipi,
603 .eoi = mpic_end_ipi, 634 .eoi = mpic_end_ipi,
604}; 635};
605#endif /* CONFIG_SMP */ 636#endif /* CONFIG_SMP */
606 637
@@ -611,6 +642,7 @@ static struct irq_chip mpic_irq_ht_chip = {
611 .mask = mpic_mask_irq, 642 .mask = mpic_mask_irq,
612 .unmask = mpic_unmask_ht_irq, 643 .unmask = mpic_unmask_ht_irq,
613 .eoi = mpic_end_ht_irq, 644 .eoi = mpic_end_ht_irq,
645 .set_type = mpic_set_irq_type,
614}; 646};
615#endif /* CONFIG_MPIC_BROKEN_U3 */ 647#endif /* CONFIG_MPIC_BROKEN_U3 */
616 648
@@ -624,26 +656,21 @@ static int mpic_host_match(struct irq_host *h, struct device_node *node)
624} 656}
625 657
626static int mpic_host_map(struct irq_host *h, unsigned int virq, 658static int mpic_host_map(struct irq_host *h, unsigned int virq,
627 irq_hw_number_t hw, unsigned int flags) 659 irq_hw_number_t hw)
628{ 660{
629 struct irq_desc *desc = get_irq_desc(virq);
630 struct irq_chip *chip;
631 struct mpic *mpic = h->host_data; 661 struct mpic *mpic = h->host_data;
632 u32 v, vecpri = MPIC_VECPRI_SENSE_LEVEL | 662 struct irq_chip *chip;
633 MPIC_VECPRI_POLARITY_NEGATIVE;
634 int level;
635 unsigned long iflags;
636 663
637 pr_debug("mpic: map virq %d, hwirq 0x%lx, flags: 0x%x\n", 664 DBG("mpic: map virq %d, hwirq 0x%lx\n", virq, hw);
638 virq, hw, flags);
639 665
640 if (hw == MPIC_VEC_SPURRIOUS) 666 if (hw == MPIC_VEC_SPURRIOUS)
641 return -EINVAL; 667 return -EINVAL;
668
642#ifdef CONFIG_SMP 669#ifdef CONFIG_SMP
643 else if (hw >= MPIC_VEC_IPI_0) { 670 else if (hw >= MPIC_VEC_IPI_0) {
644 WARN_ON(!(mpic->flags & MPIC_PRIMARY)); 671 WARN_ON(!(mpic->flags & MPIC_PRIMARY));
645 672
646 pr_debug("mpic: mapping as IPI\n"); 673 DBG("mpic: mapping as IPI\n");
647 set_irq_chip_data(virq, mpic); 674 set_irq_chip_data(virq, mpic);
648 set_irq_chip_and_handler(virq, &mpic->hc_ipi, 675 set_irq_chip_and_handler(virq, &mpic->hc_ipi,
649 handle_percpu_irq); 676 handle_percpu_irq);
@@ -654,44 +681,23 @@ static int mpic_host_map(struct irq_host *h, unsigned int virq,
654 if (hw >= mpic->irq_count) 681 if (hw >= mpic->irq_count)
655 return -EINVAL; 682 return -EINVAL;
656 683
657 /* If no sense provided, check default sense array */ 684 /* Default chip */
658 if (((flags & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_NONE) &&
659 mpic->senses && hw < mpic->senses_count)
660 flags |= mpic->senses[hw];
661
662 vecpri = mpic_flags_to_vecpri(flags, &level);
663 if (level)
664 desc->status |= IRQ_LEVEL;
665 chip = &mpic->hc_irq; 685 chip = &mpic->hc_irq;
666 686
667#ifdef CONFIG_MPIC_BROKEN_U3 687#ifdef CONFIG_MPIC_BROKEN_U3
668 /* Check for HT interrupts, override vecpri */ 688 /* Check for HT interrupts, override vecpri */
669 if (mpic_is_ht_interrupt(mpic, hw)) { 689 if (mpic_is_ht_interrupt(mpic, hw))
670 vecpri &= ~(MPIC_VECPRI_SENSE_MASK |
671 MPIC_VECPRI_POLARITY_MASK);
672 vecpri |= MPIC_VECPRI_POLARITY_POSITIVE;
673 chip = &mpic->hc_ht_irq; 690 chip = &mpic->hc_ht_irq;
674 } 691#endif /* CONFIG_MPIC_BROKEN_U3 */
675#endif
676 692
677 /* Reconfigure irq. We must preserve the mask bit as we can be called 693 DBG("mpic: mapping to irq chip @%p\n", chip);
678 * while the interrupt is still active (This may change in the future
679 * but for now, it is the case).
680 */
681 spin_lock_irqsave(&mpic_lock, iflags);
682 v = mpic_irq_read(hw, MPIC_IRQ_VECTOR_PRI);
683 vecpri = (v &
684 ~(MPIC_VECPRI_POLARITY_MASK | MPIC_VECPRI_SENSE_MASK)) |
685 vecpri;
686 if (vecpri != v)
687 mpic_irq_write(hw, MPIC_IRQ_VECTOR_PRI, vecpri);
688 spin_unlock_irqrestore(&mpic_lock, iflags);
689
690 pr_debug("mpic: mapping as IRQ, vecpri = 0x%08x (was 0x%08x)\n",
691 vecpri, v);
692 694
693 set_irq_chip_data(virq, mpic); 695 set_irq_chip_data(virq, mpic);
694 set_irq_chip_and_handler(virq, chip, handle_fasteoi_irq); 696 set_irq_chip_and_handler(virq, chip, handle_fasteoi_irq);
697
698 /* Set default irq type */
699 set_irq_type(virq, IRQ_TYPE_NONE);
700
695 return 0; 701 return 0;
696} 702}
697 703
@@ -708,11 +714,28 @@ static int mpic_host_xlate(struct irq_host *h, struct device_node *ct,
708 }; 714 };
709 715
710 *out_hwirq = intspec[0]; 716 *out_hwirq = intspec[0];
711 if (intsize > 1 && intspec[1] < 4) 717 if (intsize > 1) {
712 *out_flags = map_mpic_senses[intspec[1]]; 718 u32 mask = 0x3;
713 else 719
720 /* Apple invented a new race of encoding on machines with
721 * an HT APIC. They encode, among others, the index within
722 * the HT APIC. We don't care about it here since thankfully,
723 * it appears that they have the APIC already properly
724 * configured, and thus our current fixup code that reads the
725 * APIC config works fine. However, we still need to mask out
726 * bits in the specifier to make sure we only get bit 0 which
727 * is the level/edge bit (the only sense bit exposed by Apple),
728 * as their bit 1 means something else.
729 */
730 if (machine_is(powermac))
731 mask = 0x1;
732 *out_flags = map_mpic_senses[intspec[1] & mask];
733 } else
714 *out_flags = IRQ_TYPE_NONE; 734 *out_flags = IRQ_TYPE_NONE;
715 735
736 DBG("mpic: xlate (%d cells: 0x%08x 0x%08x) to line 0x%lx sense 0x%x\n",
737 intsize, intspec[0], intspec[1], *out_hwirq, *out_flags);
738
716 return 0; 739 return 0;
717} 740}
718 741
@@ -906,41 +929,16 @@ void __init mpic_init(struct mpic *mpic)
906 if (mpic->irq_count == 0) 929 if (mpic->irq_count == 0)
907 mpic->irq_count = mpic->num_sources; 930 mpic->irq_count = mpic->num_sources;
908 931
909#ifdef CONFIG_MPIC_BROKEN_U3
910 /* Do the HT PIC fixups on U3 broken mpic */ 932 /* Do the HT PIC fixups on U3 broken mpic */
911 DBG("MPIC flags: %x\n", mpic->flags); 933 DBG("MPIC flags: %x\n", mpic->flags);
912 if ((mpic->flags & MPIC_BROKEN_U3) && (mpic->flags & MPIC_PRIMARY)) 934 if ((mpic->flags & MPIC_BROKEN_U3) && (mpic->flags & MPIC_PRIMARY))
913 mpic_scan_ht_pics(mpic); 935 mpic_scan_ht_pics(mpic);
914#endif /* CONFIG_MPIC_BROKEN_U3 */
915 936
916 for (i = 0; i < mpic->num_sources; i++) { 937 for (i = 0; i < mpic->num_sources; i++) {
917 /* start with vector = source number, and masked */ 938 /* start with vector = source number, and masked */
918 u32 vecpri = MPIC_VECPRI_MASK | i | (8 << MPIC_VECPRI_PRIORITY_SHIFT); 939 u32 vecpri = MPIC_VECPRI_MASK | i |
919 int level = 1; 940 (8 << MPIC_VECPRI_PRIORITY_SHIFT);
920 941
921 /* do senses munging */
922 if (mpic->senses && i < mpic->senses_count)
923 vecpri |= mpic_flags_to_vecpri(mpic->senses[i],
924 &level);
925 else
926 vecpri |= MPIC_VECPRI_SENSE_LEVEL;
927
928 /* deal with broken U3 */
929 if (mpic->flags & MPIC_BROKEN_U3) {
930#ifdef CONFIG_MPIC_BROKEN_U3
931 if (mpic_is_ht_interrupt(mpic, i)) {
932 vecpri &= ~(MPIC_VECPRI_SENSE_MASK |
933 MPIC_VECPRI_POLARITY_MASK);
934 vecpri |= MPIC_VECPRI_POLARITY_POSITIVE;
935 }
936#else
937 printk(KERN_ERR "mpic: BROKEN_U3 set, but CONFIG doesn't match\n");
938#endif
939 }
940
941 DBG("setup source %d, vecpri: %08x, level: %d\n", i, vecpri,
942 (level != 0));
943
944 /* init hw */ 942 /* init hw */
945 mpic_irq_write(i, MPIC_IRQ_VECTOR_PRI, vecpri); 943 mpic_irq_write(i, MPIC_IRQ_VECTOR_PRI, vecpri);
946 mpic_irq_write(i, MPIC_IRQ_DESTINATION, 944 mpic_irq_write(i, MPIC_IRQ_DESTINATION,
@@ -1154,7 +1152,7 @@ void mpic_request_ipis(void)
1154 1152
1155 for (i = 0; i < 4; i++) { 1153 for (i = 0; i < 4; i++) {
1156 unsigned int vipi = irq_create_mapping(mpic->irqhost, 1154 unsigned int vipi = irq_create_mapping(mpic->irqhost,
1157 MPIC_VEC_IPI_0 + i, 0); 1155 MPIC_VEC_IPI_0 + i);
1158 if (vipi == NO_IRQ) { 1156 if (vipi == NO_IRQ) {
1159 printk(KERN_ERR "Failed to map IPI %d\n", i); 1157 printk(KERN_ERR "Failed to map IPI %d\n", i);
1160 break; 1158 break;
diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c
index 50c1b4739ca7..d1735401384c 100644
--- a/arch/ppc/kernel/ppc_ksyms.c
+++ b/arch/ppc/kernel/ppc_ksyms.c
@@ -5,7 +5,7 @@
5#include <linux/elfcore.h> 5#include <linux/elfcore.h>
6#include <linux/string.h> 6#include <linux/string.h>
7#include <linux/interrupt.h> 7#include <linux/interrupt.h>
8#include <linux/tty.h> 8#include <linux/screen_info.h>
9#include <linux/vt_kern.h> 9#include <linux/vt_kern.h>
10#include <linux/nvram.h> 10#include <linux/nvram.h>
11#include <linux/console.h> 11#include <linux/console.h>
diff --git a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c
index faf2940300b0..a74f46d9826f 100644
--- a/arch/ppc/kernel/setup.c
+++ b/arch/ppc/kernel/setup.c
@@ -11,7 +11,7 @@
11#include <linux/delay.h> 11#include <linux/delay.h>
12#include <linux/initrd.h> 12#include <linux/initrd.h>
13#include <linux/ide.h> 13#include <linux/ide.h>
14#include <linux/tty.h> 14#include <linux/screen_info.h>
15#include <linux/bootmem.h> 15#include <linux/bootmem.h>
16#include <linux/seq_file.h> 16#include <linux/seq_file.h>
17#include <linux/root_dev.h> 17#include <linux/root_dev.h>
diff --git a/arch/ppc/kernel/vmlinux.lds.S b/arch/ppc/kernel/vmlinux.lds.S
index 09c6525cfa61..095fd3323323 100644
--- a/arch/ppc/kernel/vmlinux.lds.S
+++ b/arch/ppc/kernel/vmlinux.lds.S
@@ -8,6 +8,7 @@ SECTIONS
8 . = + SIZEOF_HEADERS; 8 . = + SIZEOF_HEADERS;
9 .interp : { *(.interp) } 9 .interp : { *(.interp) }
10 .hash : { *(.hash) } 10 .hash : { *(.hash) }
11 .gnu.hash : { *(.gnu.hash) }
11 .dynsym : { *(.dynsym) } 12 .dynsym : { *(.dynsym) }
12 .dynstr : { *(.dynstr) } 13 .dynstr : { *(.dynstr) }
13 .rel.text : { *(.rel.text) } 14 .rel.text : { *(.rel.text) }
diff --git a/arch/ppc/platforms/prep_setup.c b/arch/ppc/platforms/prep_setup.c
index 6436beffdc96..1cb75a1f825e 100644
--- a/arch/ppc/platforms/prep_setup.c
+++ b/arch/ppc/platforms/prep_setup.c
@@ -23,7 +23,7 @@
23#include <linux/slab.h> 23#include <linux/slab.h>
24#include <linux/user.h> 24#include <linux/user.h>
25#include <linux/a.out.h> 25#include <linux/a.out.h>
26#include <linux/tty.h> 26#include <linux/screen_info.h>
27#include <linux/major.h> 27#include <linux/major.h>
28#include <linux/interrupt.h> 28#include <linux/interrupt.h>
29#include <linux/reboot.h> 29#include <linux/reboot.h>
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 224fbff79969..ae071a11ce71 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -118,13 +118,6 @@ config SYSVIPC_COMPAT
118 depends on COMPAT && SYSVIPC 118 depends on COMPAT && SYSVIPC
119 default y 119 default y
120 120
121config BINFMT_ELF32
122 tristate "Kernel support for 31 bit ELF binaries"
123 depends on COMPAT
124 help
125 This allows you to run 32-bit Linux/ELF binaries on your zSeries
126 in 64 bit mode. Everybody wants this; say Y.
127
128comment "Code generation options" 121comment "Code generation options"
129 122
130choice 123choice
diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c
index d0f82c995af6..6a4b5f9715c9 100644
--- a/arch/s390/appldata/appldata_base.c
+++ b/arch/s390/appldata/appldata_base.c
@@ -617,7 +617,8 @@ appldata_offline_cpu(int cpu)
617 spin_unlock(&appldata_timer_lock); 617 spin_unlock(&appldata_timer_lock);
618} 618}
619 619
620static int __cpuinit 620#ifdef CONFIG_HOTPLUG_CPU
621static int
621appldata_cpu_notify(struct notifier_block *self, 622appldata_cpu_notify(struct notifier_block *self,
622 unsigned long action, void *hcpu) 623 unsigned long action, void *hcpu)
623{ 624{
@@ -625,20 +626,19 @@ appldata_cpu_notify(struct notifier_block *self,
625 case CPU_ONLINE: 626 case CPU_ONLINE:
626 appldata_online_cpu((long) hcpu); 627 appldata_online_cpu((long) hcpu);
627 break; 628 break;
628#ifdef CONFIG_HOTPLUG_CPU
629 case CPU_DEAD: 629 case CPU_DEAD:
630 appldata_offline_cpu((long) hcpu); 630 appldata_offline_cpu((long) hcpu);
631 break; 631 break;
632#endif
633 default: 632 default:
634 break; 633 break;
635 } 634 }
636 return NOTIFY_OK; 635 return NOTIFY_OK;
637} 636}
638 637
639static struct notifier_block __devinitdata appldata_nb = { 638static struct notifier_block appldata_nb = {
640 .notifier_call = appldata_cpu_notify, 639 .notifier_call = appldata_cpu_notify,
641}; 640};
641#endif
642 642
643/* 643/*
644 * appldata_init() 644 * appldata_init()
@@ -662,7 +662,7 @@ static int __init appldata_init(void)
662 appldata_online_cpu(i); 662 appldata_online_cpu(i);
663 663
664 /* Register cpu hotplug notifier */ 664 /* Register cpu hotplug notifier */
665 register_cpu_notifier(&appldata_nb); 665 register_hotcpu_notifier(&appldata_nb);
666 666
667 appldata_sysctl_header = register_sysctl_table(appldata_dir_table, 1); 667 appldata_sysctl_header = register_sysctl_table(appldata_dir_table, 1);
668#ifdef MODULE 668#ifdef MODULE
diff --git a/arch/s390/defconfig b/arch/s390/defconfig
index f4dfc10026d2..f1d4591eddbb 100644
--- a/arch/s390/defconfig
+++ b/arch/s390/defconfig
@@ -1,13 +1,16 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc1 3# Linux kernel version: 2.6.18-rc2
4# Mon Apr 3 14:34:15 2006 4# Thu Jul 27 13:51:07 2006
5# 5#
6CONFIG_MMU=y 6CONFIG_MMU=y
7CONFIG_LOCKDEP_SUPPORT=y
8CONFIG_STACKTRACE_SUPPORT=y
7CONFIG_RWSEM_XCHGADD_ALGORITHM=y 9CONFIG_RWSEM_XCHGADD_ALGORITHM=y
8CONFIG_GENERIC_HWEIGHT=y 10CONFIG_GENERIC_HWEIGHT=y
9CONFIG_GENERIC_CALIBRATE_DELAY=y 11CONFIG_GENERIC_CALIBRATE_DELAY=y
10CONFIG_S390=y 12CONFIG_S390=y
13CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
11 14
12# 15#
13# Code maturity level options 16# Code maturity level options
@@ -25,6 +28,7 @@ CONFIG_SWAP=y
25CONFIG_SYSVIPC=y 28CONFIG_SYSVIPC=y
26CONFIG_POSIX_MQUEUE=y 29CONFIG_POSIX_MQUEUE=y
27# CONFIG_BSD_PROCESS_ACCT is not set 30# CONFIG_BSD_PROCESS_ACCT is not set
31# CONFIG_TASKSTATS is not set
28CONFIG_SYSCTL=y 32CONFIG_SYSCTL=y
29CONFIG_AUDIT=y 33CONFIG_AUDIT=y
30# CONFIG_AUDITSYSCALL is not set 34# CONFIG_AUDITSYSCALL is not set
@@ -43,10 +47,12 @@ CONFIG_PRINTK=y
43CONFIG_BUG=y 47CONFIG_BUG=y
44CONFIG_ELF_CORE=y 48CONFIG_ELF_CORE=y
45CONFIG_BASE_FULL=y 49CONFIG_BASE_FULL=y
50CONFIG_RT_MUTEXES=y
46CONFIG_FUTEX=y 51CONFIG_FUTEX=y
47CONFIG_EPOLL=y 52CONFIG_EPOLL=y
48CONFIG_SHMEM=y 53CONFIG_SHMEM=y
49CONFIG_SLAB=y 54CONFIG_SLAB=y
55CONFIG_VM_EVENT_COUNTERS=y
50# CONFIG_TINY_SHMEM is not set 56# CONFIG_TINY_SHMEM is not set
51CONFIG_BASE_SMALL=0 57CONFIG_BASE_SMALL=0
52# CONFIG_SLOB is not set 58# CONFIG_SLOB is not set
@@ -94,7 +100,6 @@ CONFIG_HOTPLUG_CPU=y
94CONFIG_DEFAULT_MIGRATION_COST=1000000 100CONFIG_DEFAULT_MIGRATION_COST=1000000
95CONFIG_COMPAT=y 101CONFIG_COMPAT=y
96CONFIG_SYSVIPC_COMPAT=y 102CONFIG_SYSVIPC_COMPAT=y
97CONFIG_BINFMT_ELF32=y
98 103
99# 104#
100# Code generation options 105# Code generation options
@@ -115,6 +120,7 @@ CONFIG_FLATMEM=y
115CONFIG_FLAT_NODE_MEM_MAP=y 120CONFIG_FLAT_NODE_MEM_MAP=y
116# CONFIG_SPARSEMEM_STATIC is not set 121# CONFIG_SPARSEMEM_STATIC is not set
117CONFIG_SPLIT_PTLOCK_CPUS=4 122CONFIG_SPLIT_PTLOCK_CPUS=4
123CONFIG_RESOURCES_64BIT=y
118 124
119# 125#
120# I/O subsystem configuration 126# I/O subsystem configuration
@@ -142,6 +148,7 @@ CONFIG_VIRT_CPU_ACCOUNTING=y
142# CONFIG_APPLDATA_BASE is not set 148# CONFIG_APPLDATA_BASE is not set
143CONFIG_NO_IDLE_HZ=y 149CONFIG_NO_IDLE_HZ=y
144CONFIG_NO_IDLE_HZ_INIT=y 150CONFIG_NO_IDLE_HZ_INIT=y
151CONFIG_S390_HYPFS_FS=y
145CONFIG_KEXEC=y 152CONFIG_KEXEC=y
146 153
147# 154#
@@ -174,6 +181,8 @@ CONFIG_IP_FIB_HASH=y
174# CONFIG_INET_IPCOMP is not set 181# CONFIG_INET_IPCOMP is not set
175# CONFIG_INET_XFRM_TUNNEL is not set 182# CONFIG_INET_XFRM_TUNNEL is not set
176# CONFIG_INET_TUNNEL is not set 183# CONFIG_INET_TUNNEL is not set
184CONFIG_INET_XFRM_MODE_TRANSPORT=y
185CONFIG_INET_XFRM_MODE_TUNNEL=y
177CONFIG_INET_DIAG=y 186CONFIG_INET_DIAG=y
178CONFIG_INET_TCP_DIAG=y 187CONFIG_INET_TCP_DIAG=y
179# CONFIG_TCP_CONG_ADVANCED is not set 188# CONFIG_TCP_CONG_ADVANCED is not set
@@ -186,7 +195,10 @@ CONFIG_IPV6=y
186# CONFIG_INET6_IPCOMP is not set 195# CONFIG_INET6_IPCOMP is not set
187# CONFIG_INET6_XFRM_TUNNEL is not set 196# CONFIG_INET6_XFRM_TUNNEL is not set
188# CONFIG_INET6_TUNNEL is not set 197# CONFIG_INET6_TUNNEL is not set
198CONFIG_INET6_XFRM_MODE_TRANSPORT=y
199CONFIG_INET6_XFRM_MODE_TUNNEL=y
189# CONFIG_IPV6_TUNNEL is not set 200# CONFIG_IPV6_TUNNEL is not set
201# CONFIG_NETWORK_SECMARK is not set
190# CONFIG_NETFILTER is not set 202# CONFIG_NETFILTER is not set
191 203
192# 204#
@@ -263,6 +275,7 @@ CONFIG_NET_ESTIMATOR=y
263# Network testing 275# Network testing
264# 276#
265# CONFIG_NET_PKTGEN is not set 277# CONFIG_NET_PKTGEN is not set
278# CONFIG_NET_TCPPROBE is not set
266# CONFIG_HAMRADIO is not set 279# CONFIG_HAMRADIO is not set
267# CONFIG_IRDA is not set 280# CONFIG_IRDA is not set
268# CONFIG_BT is not set 281# CONFIG_BT is not set
@@ -276,6 +289,7 @@ CONFIG_STANDALONE=y
276CONFIG_PREVENT_FIRMWARE_BUILD=y 289CONFIG_PREVENT_FIRMWARE_BUILD=y
277# CONFIG_FW_LOADER is not set 290# CONFIG_FW_LOADER is not set
278# CONFIG_DEBUG_DRIVER is not set 291# CONFIG_DEBUG_DRIVER is not set
292CONFIG_SYS_HYPERVISOR=y
279 293
280# 294#
281# Connector - unified userspace <-> kernelspace linker 295# Connector - unified userspace <-> kernelspace linker
@@ -334,6 +348,7 @@ CONFIG_BLK_DEV_NBD=m
334CONFIG_BLK_DEV_RAM=y 348CONFIG_BLK_DEV_RAM=y
335CONFIG_BLK_DEV_RAM_COUNT=16 349CONFIG_BLK_DEV_RAM_COUNT=16
336CONFIG_BLK_DEV_RAM_SIZE=4096 350CONFIG_BLK_DEV_RAM_SIZE=4096
351CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
337CONFIG_BLK_DEV_INITRD=y 352CONFIG_BLK_DEV_INITRD=y
338# CONFIG_CDROM_PKTCDVD is not set 353# CONFIG_CDROM_PKTCDVD is not set
339 354
@@ -359,9 +374,7 @@ CONFIG_MD_LINEAR=m
359CONFIG_MD_RAID0=m 374CONFIG_MD_RAID0=m
360CONFIG_MD_RAID1=m 375CONFIG_MD_RAID1=m
361# CONFIG_MD_RAID10 is not set 376# CONFIG_MD_RAID10 is not set
362CONFIG_MD_RAID5=m 377# CONFIG_MD_RAID456 is not set
363# CONFIG_MD_RAID5_RESHAPE is not set
364# CONFIG_MD_RAID6 is not set
365CONFIG_MD_MULTIPATH=m 378CONFIG_MD_MULTIPATH=m
366# CONFIG_MD_FAULTY is not set 379# CONFIG_MD_FAULTY is not set
367CONFIG_BLK_DEV_DM=y 380CONFIG_BLK_DEV_DM=y
@@ -419,7 +432,8 @@ CONFIG_S390_TAPE_34XX=m
419# 432#
420# Cryptographic devices 433# Cryptographic devices
421# 434#
422CONFIG_Z90CRYPT=m 435CONFIG_ZCRYPT=m
436# CONFIG_ZCRYPT_MONOLITHIC is not set
423 437
424# 438#
425# Network device support 439# Network device support
@@ -509,6 +523,7 @@ CONFIG_FS_MBCACHE=y
509# CONFIG_MINIX_FS is not set 523# CONFIG_MINIX_FS is not set
510# CONFIG_ROMFS_FS is not set 524# CONFIG_ROMFS_FS is not set
511CONFIG_INOTIFY=y 525CONFIG_INOTIFY=y
526CONFIG_INOTIFY_USER=y
512# CONFIG_QUOTA is not set 527# CONFIG_QUOTA is not set
513CONFIG_DNOTIFY=y 528CONFIG_DNOTIFY=y
514# CONFIG_AUTOFS_FS is not set 529# CONFIG_AUTOFS_FS is not set
@@ -614,26 +629,36 @@ CONFIG_MSDOS_PARTITION=y
614# Instrumentation Support 629# Instrumentation Support
615# 630#
616# CONFIG_PROFILING is not set 631# CONFIG_PROFILING is not set
617# CONFIG_STATISTICS is not set 632CONFIG_STATISTICS=y
633CONFIG_KPROBES=y
618 634
619# 635#
620# Kernel hacking 636# Kernel hacking
621# 637#
638CONFIG_TRACE_IRQFLAGS_SUPPORT=y
622# CONFIG_PRINTK_TIME is not set 639# CONFIG_PRINTK_TIME is not set
623CONFIG_MAGIC_SYSRQ=y 640CONFIG_MAGIC_SYSRQ=y
641# CONFIG_UNUSED_SYMBOLS is not set
624CONFIG_DEBUG_KERNEL=y 642CONFIG_DEBUG_KERNEL=y
625CONFIG_LOG_BUF_SHIFT=17 643CONFIG_LOG_BUF_SHIFT=17
626# CONFIG_DETECT_SOFTLOCKUP is not set 644# CONFIG_DETECT_SOFTLOCKUP is not set
627# CONFIG_SCHEDSTATS is not set 645# CONFIG_SCHEDSTATS is not set
628# CONFIG_DEBUG_SLAB is not set 646# CONFIG_DEBUG_SLAB is not set
629CONFIG_DEBUG_PREEMPT=y 647CONFIG_DEBUG_PREEMPT=y
630CONFIG_DEBUG_MUTEXES=y 648# CONFIG_DEBUG_RT_MUTEXES is not set
649# CONFIG_RT_MUTEX_TESTER is not set
631CONFIG_DEBUG_SPINLOCK=y 650CONFIG_DEBUG_SPINLOCK=y
651CONFIG_DEBUG_MUTEXES=y
652# CONFIG_DEBUG_RWSEMS is not set
653# CONFIG_DEBUG_LOCK_ALLOC is not set
654# CONFIG_PROVE_LOCKING is not set
632CONFIG_DEBUG_SPINLOCK_SLEEP=y 655CONFIG_DEBUG_SPINLOCK_SLEEP=y
656# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
633# CONFIG_DEBUG_KOBJECT is not set 657# CONFIG_DEBUG_KOBJECT is not set
634# CONFIG_DEBUG_INFO is not set 658# CONFIG_DEBUG_INFO is not set
635CONFIG_DEBUG_FS=y 659CONFIG_DEBUG_FS=y
636# CONFIG_DEBUG_VM is not set 660# CONFIG_DEBUG_VM is not set
661# CONFIG_FRAME_POINTER is not set
637# CONFIG_UNWIND_INFO is not set 662# CONFIG_UNWIND_INFO is not set
638CONFIG_FORCED_INLINING=y 663CONFIG_FORCED_INLINING=y
639# CONFIG_RCU_TORTURE_TEST is not set 664# CONFIG_RCU_TORTURE_TEST is not set
@@ -688,3 +713,4 @@ CONFIG_CRYPTO=y
688# CONFIG_CRC16 is not set 713# CONFIG_CRC16 is not set
689CONFIG_CRC32=m 714CONFIG_CRC32=m
690# CONFIG_LIBCRC32C is not set 715# CONFIG_LIBCRC32C is not set
716CONFIG_PLIST=y
diff --git a/arch/s390/hypfs/hypfs_diag.c b/arch/s390/hypfs/hypfs_diag.c
index efa74af7f04a..1785bce2b919 100644
--- a/arch/s390/hypfs/hypfs_diag.c
+++ b/arch/s390/hypfs/hypfs_diag.c
@@ -403,7 +403,7 @@ static void *diag204_get_buffer(enum diag204_format fmt, int *pages)
403 *pages = 1; 403 *pages = 1;
404 return diag204_alloc_rbuf(); 404 return diag204_alloc_rbuf();
405 } else {/* INFO_EXT */ 405 } else {/* INFO_EXT */
406 *pages = diag204(SUBC_RSI | INFO_EXT, 0, 0); 406 *pages = diag204(SUBC_RSI | INFO_EXT, 0, NULL);
407 if (*pages <= 0) 407 if (*pages <= 0)
408 return ERR_PTR(-ENOSYS); 408 return ERR_PTR(-ENOSYS);
409 else 409 else
diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile
index eabf00a6f770..86601a945709 100644
--- a/arch/s390/kernel/Makefile
+++ b/arch/s390/kernel/Makefile
@@ -17,8 +17,8 @@ obj-$(CONFIG_MODULES) += s390_ksyms.o module.o
17obj-$(CONFIG_SMP) += smp.o 17obj-$(CONFIG_SMP) += smp.o
18 18
19obj-$(CONFIG_COMPAT) += compat_linux.o compat_signal.o \ 19obj-$(CONFIG_COMPAT) += compat_linux.o compat_signal.o \
20 compat_wrapper.o compat_exec_domain.o 20 compat_wrapper.o compat_exec_domain.o \
21obj-$(CONFIG_BINFMT_ELF32) += binfmt_elf32.o 21 binfmt_elf32.o
22 22
23obj-$(CONFIG_VIRT_TIMER) += vtime.o 23obj-$(CONFIG_VIRT_TIMER) += vtime.o
24obj-$(CONFIG_STACKTRACE) += stacktrace.o 24obj-$(CONFIG_STACKTRACE) += stacktrace.o
diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c
index cabb4ff54cd7..785c9f70ac98 100644
--- a/arch/s390/kernel/compat_linux.c
+++ b/arch/s390/kernel/compat_linux.c
@@ -409,7 +409,7 @@ asmlinkage long sys32_sysinfo(struct sysinfo32 __user *info)
409 mm_segment_t old_fs = get_fs (); 409 mm_segment_t old_fs = get_fs ();
410 410
411 set_fs (KERNEL_DS); 411 set_fs (KERNEL_DS);
412 ret = sys_sysinfo(&s); 412 ret = sys_sysinfo((struct sysinfo __user *) &s);
413 set_fs (old_fs); 413 set_fs (old_fs);
414 err = put_user (s.uptime, &info->uptime); 414 err = put_user (s.uptime, &info->uptime);
415 err |= __put_user (s.loads[0], &info->loads[0]); 415 err |= __put_user (s.loads[0], &info->loads[0]);
@@ -438,7 +438,7 @@ asmlinkage long sys32_sched_rr_get_interval(compat_pid_t pid,
438 mm_segment_t old_fs = get_fs (); 438 mm_segment_t old_fs = get_fs ();
439 439
440 set_fs (KERNEL_DS); 440 set_fs (KERNEL_DS);
441 ret = sys_sched_rr_get_interval(pid, &t); 441 ret = sys_sched_rr_get_interval(pid, (struct timespec __user *) &t);
442 set_fs (old_fs); 442 set_fs (old_fs);
443 if (put_compat_timespec(&t, interval)) 443 if (put_compat_timespec(&t, interval))
444 return -EFAULT; 444 return -EFAULT;
@@ -464,7 +464,10 @@ asmlinkage long sys32_rt_sigprocmask(int how, compat_sigset_t __user *set,
464 } 464 }
465 } 465 }
466 set_fs (KERNEL_DS); 466 set_fs (KERNEL_DS);
467 ret = sys_rt_sigprocmask(how, set ? &s : NULL, oset ? &s : NULL, sigsetsize); 467 ret = sys_rt_sigprocmask(how,
468 set ? (sigset_t __user *) &s : NULL,
469 oset ? (sigset_t __user *) &s : NULL,
470 sigsetsize);
468 set_fs (old_fs); 471 set_fs (old_fs);
469 if (ret) return ret; 472 if (ret) return ret;
470 if (oset) { 473 if (oset) {
@@ -489,7 +492,7 @@ asmlinkage long sys32_rt_sigpending(compat_sigset_t __user *set,
489 mm_segment_t old_fs = get_fs(); 492 mm_segment_t old_fs = get_fs();
490 493
491 set_fs (KERNEL_DS); 494 set_fs (KERNEL_DS);
492 ret = sys_rt_sigpending(&s, sigsetsize); 495 ret = sys_rt_sigpending((sigset_t __user *) &s, sigsetsize);
493 set_fs (old_fs); 496 set_fs (old_fs);
494 if (!ret) { 497 if (!ret) {
495 switch (_NSIG_WORDS) { 498 switch (_NSIG_WORDS) {
@@ -514,7 +517,7 @@ sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user *uinfo)
514 if (copy_siginfo_from_user32(&info, uinfo)) 517 if (copy_siginfo_from_user32(&info, uinfo))
515 return -EFAULT; 518 return -EFAULT;
516 set_fs (KERNEL_DS); 519 set_fs (KERNEL_DS);
517 ret = sys_rt_sigqueueinfo(pid, sig, &info); 520 ret = sys_rt_sigqueueinfo(pid, sig, (siginfo_t __user *) &info);
518 set_fs (old_fs); 521 set_fs (old_fs);
519 return ret; 522 return ret;
520} 523}
@@ -674,7 +677,8 @@ asmlinkage long sys32_sendfile(int out_fd, int in_fd, compat_off_t __user *offse
674 return -EFAULT; 677 return -EFAULT;
675 678
676 set_fs(KERNEL_DS); 679 set_fs(KERNEL_DS);
677 ret = sys_sendfile(out_fd, in_fd, offset ? &of : NULL, count); 680 ret = sys_sendfile(out_fd, in_fd,
681 offset ? (off_t __user *) &of : NULL, count);
678 set_fs(old_fs); 682 set_fs(old_fs);
679 683
680 if (offset && put_user(of, offset)) 684 if (offset && put_user(of, offset))
@@ -694,7 +698,8 @@ asmlinkage long sys32_sendfile64(int out_fd, int in_fd,
694 return -EFAULT; 698 return -EFAULT;
695 699
696 set_fs(KERNEL_DS); 700 set_fs(KERNEL_DS);
697 ret = sys_sendfile64(out_fd, in_fd, offset ? &lof : NULL, count); 701 ret = sys_sendfile64(out_fd, in_fd,
702 offset ? (loff_t __user *) &lof : NULL, count);
698 set_fs(old_fs); 703 set_fs(old_fs);
699 704
700 if (offset && put_user(lof, offset)) 705 if (offset && put_user(lof, offset))
diff --git a/arch/s390/kernel/head31.S b/arch/s390/kernel/head31.S
index d00de17b3778..a4dc61f3285e 100644
--- a/arch/s390/kernel/head31.S
+++ b/arch/s390/kernel/head31.S
@@ -273,7 +273,7 @@ startup_continue:
273.Lbss_end: .long _end 273.Lbss_end: .long _end
274.Lparmaddr: .long PARMAREA 274.Lparmaddr: .long PARMAREA
275.Lsccbaddr: .long .Lsccb 275.Lsccbaddr: .long .Lsccb
276 .align 4096 276 .org 0x12000
277.Lsccb: 277.Lsccb:
278 .hword 0x1000 # length, one page 278 .hword 0x1000 # length, one page
279 .byte 0x00,0x00,0x00 279 .byte 0x00,0x00,0x00
@@ -290,7 +290,7 @@ startup_continue:
290.Lscpincr2: 290.Lscpincr2:
291 .quad 0x00 291 .quad 0x00
292 .fill 3984,1,0 292 .fill 3984,1,0
293 .align 4096 293 .org 0x13000
294 294
295#ifdef CONFIG_SHARED_KERNEL 295#ifdef CONFIG_SHARED_KERNEL
296 .org 0x100000 296 .org 0x100000
diff --git a/arch/s390/kernel/head64.S b/arch/s390/kernel/head64.S
index 47744fcca930..9d80c5b1ef95 100644
--- a/arch/s390/kernel/head64.S
+++ b/arch/s390/kernel/head64.S
@@ -268,7 +268,7 @@ startup_continue:
268.Lparmaddr: 268.Lparmaddr:
269 .quad PARMAREA 269 .quad PARMAREA
270 270
271 .align 4096 271 .org 0x12000
272.Lsccb: 272.Lsccb:
273 .hword 0x1000 # length, one page 273 .hword 0x1000 # length, one page
274 .byte 0x00,0x00,0x00 274 .byte 0x00,0x00,0x00
@@ -285,7 +285,7 @@ startup_continue:
285.Lscpincr2: 285.Lscpincr2:
286 .quad 0x00 286 .quad 0x00
287 .fill 3984,1,0 287 .fill 3984,1,0
288 .align 4096 288 .org 0x13000
289 289
290#ifdef CONFIG_SHARED_KERNEL 290#ifdef CONFIG_SHARED_KERNEL
291 .org 0x100000 291 .org 0x100000
diff --git a/arch/s390/kernel/machine_kexec.c b/arch/s390/kernel/machine_kexec.c
index fbde6a915264..60b1ea9f946b 100644
--- a/arch/s390/kernel/machine_kexec.c
+++ b/arch/s390/kernel/machine_kexec.c
@@ -63,6 +63,7 @@ NORET_TYPE void
63machine_kexec(struct kimage *image) 63machine_kexec(struct kimage *image)
64{ 64{
65 clear_all_subchannels(); 65 clear_all_subchannels();
66 cio_reset_channel_paths();
66 67
67 /* Disable lowcore protection */ 68 /* Disable lowcore protection */
68 ctl_clear_bit(0,28); 69 ctl_clear_bit(0,28);
diff --git a/arch/s390/kernel/module.c b/arch/s390/kernel/module.c
index c271cdab58e2..d989ed45a7aa 100644
--- a/arch/s390/kernel/module.c
+++ b/arch/s390/kernel/module.c
@@ -119,7 +119,7 @@ module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
119 int nrela, i, j; 119 int nrela, i, j;
120 120
121 /* Find symbol table and string table. */ 121 /* Find symbol table and string table. */
122 symtab = 0; 122 symtab = NULL;
123 for (i = 0; i < hdr->e_shnum; i++) 123 for (i = 0; i < hdr->e_shnum; i++)
124 switch (sechdrs[i].sh_type) { 124 switch (sechdrs[i].sh_type) {
125 case SHT_SYMTAB: 125 case SHT_SYMTAB:
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c
index 78c8e5548caf..d3cbfa3005ec 100644
--- a/arch/s390/kernel/process.c
+++ b/arch/s390/kernel/process.c
@@ -172,7 +172,7 @@ void show_regs(struct pt_regs *regs)
172 show_registers(regs); 172 show_registers(regs);
173 /* Show stack backtrace if pt_regs is from kernel mode */ 173 /* Show stack backtrace if pt_regs is from kernel mode */
174 if (!(regs->psw.mask & PSW_MASK_PSTATE)) 174 if (!(regs->psw.mask & PSW_MASK_PSTATE))
175 show_trace(0,(unsigned long *) regs->gprs[15]); 175 show_trace(NULL, (unsigned long *) regs->gprs[15]);
176} 176}
177 177
178extern void kernel_thread_starter(void); 178extern void kernel_thread_starter(void);
diff --git a/arch/s390/kernel/profile.c b/arch/s390/kernel/profile.c
index 7ba777eec1a8..b81aa1f569ca 100644
--- a/arch/s390/kernel/profile.c
+++ b/arch/s390/kernel/profile.c
@@ -13,7 +13,7 @@ static struct proc_dir_entry * root_irq_dir;
13void init_irq_proc(void) 13void init_irq_proc(void)
14{ 14{
15 /* create /proc/irq */ 15 /* create /proc/irq */
16 root_irq_dir = proc_mkdir("irq", 0); 16 root_irq_dir = proc_mkdir("irq", NULL);
17 17
18 /* create /proc/irq/prof_cpu_mask */ 18 /* create /proc/irq/prof_cpu_mask */
19 create_prof_cpu_mask(root_irq_dir); 19 create_prof_cpu_mask(root_irq_dir);
diff --git a/arch/s390/kernel/s390_ext.c b/arch/s390/kernel/s390_ext.c
index 207bc511a6e3..c1b383537fec 100644
--- a/arch/s390/kernel/s390_ext.c
+++ b/arch/s390/kernel/s390_ext.c
@@ -24,7 +24,7 @@
24 * (0x1202 external call, 0x1004 cpu timer, 0x2401 hwc console, 0x4000 24 * (0x1202 external call, 0x1004 cpu timer, 0x2401 hwc console, 0x4000
25 * iucv and 0x2603 pfault) this is always the first element. 25 * iucv and 0x2603 pfault) this is always the first element.
26 */ 26 */
27ext_int_info_t *ext_int_hash[256] = { 0, }; 27ext_int_info_t *ext_int_hash[256] = { NULL, };
28 28
29static inline int ext_hash(__u16 code) 29static inline int ext_hash(__u16 code)
30{ 30{
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index 1ca34f54ea8a..c902f059c7aa 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -877,31 +877,57 @@ static struct bin_attribute ipl_scp_data_attr = {
877 877
878static decl_subsys(ipl, NULL, NULL); 878static decl_subsys(ipl, NULL, NULL);
879 879
880static int ipl_register_fcp_files(void)
881{
882 int rc;
883
884 rc = sysfs_create_group(&ipl_subsys.kset.kobj,
885 &ipl_fcp_attr_group);
886 if (rc)
887 goto out;
888 rc = sysfs_create_bin_file(&ipl_subsys.kset.kobj,
889 &ipl_parameter_attr);
890 if (rc)
891 goto out_ipl_parm;
892 rc = sysfs_create_bin_file(&ipl_subsys.kset.kobj,
893 &ipl_scp_data_attr);
894 if (!rc)
895 goto out;
896
897 sysfs_remove_bin_file(&ipl_subsys.kset.kobj, &ipl_parameter_attr);
898
899out_ipl_parm:
900 sysfs_remove_group(&ipl_subsys.kset.kobj, &ipl_fcp_attr_group);
901out:
902 return rc;
903}
904
880static int __init 905static int __init
881ipl_device_sysfs_register(void) { 906ipl_device_sysfs_register(void) {
882 int rc; 907 int rc;
883 908
884 rc = firmware_register(&ipl_subsys); 909 rc = firmware_register(&ipl_subsys);
885 if (rc) 910 if (rc)
886 return rc; 911 goto out;
887 912
888 switch (get_ipl_type()) { 913 switch (get_ipl_type()) {
889 case ipl_type_ccw: 914 case ipl_type_ccw:
890 sysfs_create_group(&ipl_subsys.kset.kobj, &ipl_ccw_attr_group); 915 rc = sysfs_create_group(&ipl_subsys.kset.kobj,
916 &ipl_ccw_attr_group);
891 break; 917 break;
892 case ipl_type_fcp: 918 case ipl_type_fcp:
893 sysfs_create_group(&ipl_subsys.kset.kobj, &ipl_fcp_attr_group); 919 rc = ipl_register_fcp_files();
894 sysfs_create_bin_file(&ipl_subsys.kset.kobj,
895 &ipl_parameter_attr);
896 sysfs_create_bin_file(&ipl_subsys.kset.kobj,
897 &ipl_scp_data_attr);
898 break; 920 break;
899 default: 921 default:
900 sysfs_create_group(&ipl_subsys.kset.kobj, 922 rc = sysfs_create_group(&ipl_subsys.kset.kobj,
901 &ipl_unknown_attr_group); 923 &ipl_unknown_attr_group);
902 break; 924 break;
903 } 925 }
904 return 0; 926
927 if (rc)
928 firmware_unregister(&ipl_subsys);
929out:
930 return rc;
905} 931}
906 932
907__initcall(ipl_device_sysfs_register); 933__initcall(ipl_device_sysfs_register);
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index f7fe9bc43397..74e6178fbaf2 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -379,7 +379,7 @@ void __init time_init(void)
379 -xtime.tv_sec, -xtime.tv_nsec); 379 -xtime.tv_sec, -xtime.tv_nsec);
380 380
381 /* request the clock comparator external interrupt */ 381 /* request the clock comparator external interrupt */
382 if (register_early_external_interrupt(0x1004, 0, 382 if (register_early_external_interrupt(0x1004, NULL,
383 &ext_int_info_cc) != 0) 383 &ext_int_info_cc) != 0)
384 panic("Couldn't request external interrupt 0x1004"); 384 panic("Couldn't request external interrupt 0x1004");
385 385
diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c
index 12240c03a6dd..bde1d1d59858 100644
--- a/arch/s390/kernel/traps.c
+++ b/arch/s390/kernel/traps.c
@@ -170,7 +170,7 @@ void show_stack(struct task_struct *task, unsigned long *sp)
170 */ 170 */
171void dump_stack(void) 171void dump_stack(void)
172{ 172{
173 show_stack(0, 0); 173 show_stack(NULL, NULL);
174} 174}
175 175
176EXPORT_SYMBOL(dump_stack); 176EXPORT_SYMBOL(dump_stack);
@@ -331,9 +331,9 @@ static void inline do_trap(long interruption_code, int signr, char *str,
331 } 331 }
332} 332}
333 333
334static inline void *get_check_address(struct pt_regs *regs) 334static inline void __user *get_check_address(struct pt_regs *regs)
335{ 335{
336 return (void *)((regs->psw.addr-S390_lowcore.pgm_ilc) & PSW_ADDR_INSN); 336 return (void __user *)((regs->psw.addr-S390_lowcore.pgm_ilc) & PSW_ADDR_INSN);
337} 337}
338 338
339void do_single_step(struct pt_regs *regs) 339void do_single_step(struct pt_regs *regs)
@@ -360,7 +360,7 @@ asmlinkage void name(struct pt_regs * regs, long interruption_code) \
360 info.si_signo = signr; \ 360 info.si_signo = signr; \
361 info.si_errno = 0; \ 361 info.si_errno = 0; \
362 info.si_code = sicode; \ 362 info.si_code = sicode; \
363 info.si_addr = (void *)siaddr; \ 363 info.si_addr = siaddr; \
364 do_trap(interruption_code, signr, str, regs, &info); \ 364 do_trap(interruption_code, signr, str, regs, &info); \
365} 365}
366 366
@@ -392,7 +392,7 @@ DO_ERROR_INFO(SIGILL, "translation exception", translation_exception,
392 ILL_ILLOPN, get_check_address(regs)) 392 ILL_ILLOPN, get_check_address(regs))
393 393
394static inline void 394static inline void
395do_fp_trap(struct pt_regs *regs, void *location, 395do_fp_trap(struct pt_regs *regs, void __user *location,
396 int fpc, long interruption_code) 396 int fpc, long interruption_code)
397{ 397{
398 siginfo_t si; 398 siginfo_t si;
@@ -424,10 +424,10 @@ asmlinkage void illegal_op(struct pt_regs * regs, long interruption_code)
424{ 424{
425 siginfo_t info; 425 siginfo_t info;
426 __u8 opcode[6]; 426 __u8 opcode[6];
427 __u16 *location; 427 __u16 __user *location;
428 int signal = 0; 428 int signal = 0;
429 429
430 location = (__u16 *) get_check_address(regs); 430 location = get_check_address(regs);
431 431
432 /* 432 /*
433 * We got all needed information from the lowcore and can 433 * We got all needed information from the lowcore and can
@@ -559,10 +559,10 @@ DO_ERROR_INFO(SIGILL, "specification exception", specification_exception,
559 559
560asmlinkage void data_exception(struct pt_regs * regs, long interruption_code) 560asmlinkage void data_exception(struct pt_regs * regs, long interruption_code)
561{ 561{
562 __u16 *location; 562 __u16 __user *location;
563 int signal = 0; 563 int signal = 0;
564 564
565 location = (__u16 *) get_check_address(regs); 565 location = get_check_address(regs);
566 566
567 /* 567 /*
568 * We got all needed information from the lowcore and can 568 * We got all needed information from the lowcore and can
diff --git a/arch/s390/lib/string.c b/arch/s390/lib/string.c
index 8240cc77e06e..ae5cf5d03d41 100644
--- a/arch/s390/lib/string.c
+++ b/arch/s390/lib/string.c
@@ -233,7 +233,7 @@ char * strrchr(const char * s, int c)
233 if (s[len] == (char) c) 233 if (s[len] == (char) c)
234 return (char *) s + len; 234 return (char *) s + len;
235 } while (--len > 0); 235 } while (--len > 0);
236 return 0; 236 return NULL;
237} 237}
238EXPORT_SYMBOL(strrchr); 238EXPORT_SYMBOL(strrchr);
239 239
@@ -267,7 +267,7 @@ char * strstr(const char * s1,const char * s2)
267 return (char *) s1; 267 return (char *) s1;
268 s1++; 268 s1++;
269 } 269 }
270 return 0; 270 return NULL;
271} 271}
272EXPORT_SYMBOL(strstr); 272EXPORT_SYMBOL(strstr);
273 273
diff --git a/arch/s390/mm/cmm.c b/arch/s390/mm/cmm.c
index 81be2fec7dc5..ceea51cff03b 100644
--- a/arch/s390/mm/cmm.c
+++ b/arch/s390/mm/cmm.c
@@ -161,7 +161,7 @@ cmm_thread(void *dummy)
161static void 161static void
162cmm_start_thread(void) 162cmm_start_thread(void)
163{ 163{
164 kernel_thread(cmm_thread, 0, 0); 164 kernel_thread(cmm_thread, NULL, 0);
165} 165}
166 166
167static void 167static void
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index 833d5941746a..7cd82575813d 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -144,7 +144,7 @@ static void do_sigsegv(struct pt_regs *regs, unsigned long error_code,
144#endif 144#endif
145 si.si_signo = SIGSEGV; 145 si.si_signo = SIGSEGV;
146 si.si_code = si_code; 146 si.si_code = si_code;
147 si.si_addr = (void *) address; 147 si.si_addr = (void __user *) address;
148 force_sig_info(SIGSEGV, &si, current); 148 force_sig_info(SIGSEGV, &si, current);
149} 149}
150 150
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
index 9af22116c9a2..e75189cb1db7 100644
--- a/arch/sh/kernel/setup.c
+++ b/arch/sh/kernel/setup.c
@@ -10,7 +10,7 @@
10 * This file handles the architecture-dependent parts of initialization 10 * This file handles the architecture-dependent parts of initialization
11 */ 11 */
12 12
13#include <linux/tty.h> 13#include <linux/screen_info.h>
14#include <linux/ioport.h> 14#include <linux/ioport.h>
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/initrd.h> 16#include <linux/initrd.h>
diff --git a/arch/sh64/kernel/setup.c b/arch/sh64/kernel/setup.c
index 0359fa647bbc..ffb310e33cef 100644
--- a/arch/sh64/kernel/setup.c
+++ b/arch/sh64/kernel/setup.c
@@ -36,7 +36,7 @@
36#include <linux/slab.h> 36#include <linux/slab.h>
37#include <linux/user.h> 37#include <linux/user.h>
38#include <linux/a.out.h> 38#include <linux/a.out.h>
39#include <linux/tty.h> 39#include <linux/screen_info.h>
40#include <linux/ioport.h> 40#include <linux/ioport.h>
41#include <linux/delay.h> 41#include <linux/delay.h>
42#include <linux/init.h> 42#include <linux/init.h>
diff --git a/arch/sh64/kernel/sh_ksyms.c b/arch/sh64/kernel/sh_ksyms.c
index 6efdfa2c3994..4b2df7247b59 100644
--- a/arch/sh64/kernel/sh_ksyms.c
+++ b/arch/sh64/kernel/sh_ksyms.c
@@ -18,7 +18,7 @@
18#include <linux/in6.h> 18#include <linux/in6.h>
19#include <linux/interrupt.h> 19#include <linux/interrupt.h>
20#include <linux/smp_lock.h> 20#include <linux/smp_lock.h>
21#include <linux/tty.h> 21#include <linux/screen_info.h>
22 22
23#include <asm/semaphore.h> 23#include <asm/semaphore.h>
24#include <asm/processor.h> 24#include <asm/processor.h>
diff --git a/arch/sparc/kernel/devices.c b/arch/sparc/kernel/devices.c
index adba9dfee35e..af90a5f9ab57 100644
--- a/arch/sparc/kernel/devices.c
+++ b/arch/sparc/kernel/devices.c
@@ -15,6 +15,7 @@
15 15
16#include <asm/page.h> 16#include <asm/page.h>
17#include <asm/oplib.h> 17#include <asm/oplib.h>
18#include <asm/prom.h>
18#include <asm/smp.h> 19#include <asm/smp.h>
19#include <asm/system.h> 20#include <asm/system.h>
20#include <asm/cpudata.h> 21#include <asm/cpudata.h>
@@ -34,12 +35,6 @@ static int check_cpu_node(int nd, int *cur_inst,
34 int (*compare)(int, int, void *), void *compare_arg, 35 int (*compare)(int, int, void *), void *compare_arg,
35 int *prom_node, int *mid) 36 int *prom_node, int *mid)
36{ 37{
37 char node_str[128];
38
39 prom_getstring(nd, "device_type", node_str, sizeof(node_str));
40 if (strcmp(node_str, "cpu"))
41 return -ENODEV;
42
43 if (!compare(nd, *cur_inst, compare_arg)) { 38 if (!compare(nd, *cur_inst, compare_arg)) {
44 if (prom_node) 39 if (prom_node)
45 *prom_node = nd; 40 *prom_node = nd;
@@ -59,20 +54,14 @@ static int check_cpu_node(int nd, int *cur_inst,
59static int __cpu_find_by(int (*compare)(int, int, void *), void *compare_arg, 54static int __cpu_find_by(int (*compare)(int, int, void *), void *compare_arg,
60 int *prom_node, int *mid) 55 int *prom_node, int *mid)
61{ 56{
62 int nd, cur_inst, err; 57 struct device_node *dp;
58 int cur_inst;
63 59
64 nd = prom_root_node;
65 cur_inst = 0; 60 cur_inst = 0;
66 61 for_each_node_by_type(dp, "cpu") {
67 err = check_cpu_node(nd, &cur_inst, compare, compare_arg, 62 int err = check_cpu_node(dp->node, &cur_inst,
68 prom_node, mid); 63 compare, compare_arg,
69 if (!err) 64 prom_node, mid);
70 return 0;
71
72 nd = prom_getchild(nd);
73 while ((nd = prom_getsibling(nd)) != 0) {
74 err = check_cpu_node(nd, &cur_inst, compare, compare_arg,
75 prom_node, mid);
76 if (!err) 65 if (!err)
77 return 0; 66 return 0;
78 } 67 }
diff --git a/arch/sparc/kernel/irq.c b/arch/sparc/kernel/irq.c
index cde73327ca96..72f0201051a0 100644
--- a/arch/sparc/kernel/irq.c
+++ b/arch/sparc/kernel/irq.c
@@ -329,7 +329,7 @@ void handler_irq(int irq, struct pt_regs * regs)
329 disable_pil_irq(irq); 329 disable_pil_irq(irq);
330#ifdef CONFIG_SMP 330#ifdef CONFIG_SMP
331 /* Only rotate on lower priority IRQ's (scsi, ethernet, etc.). */ 331 /* Only rotate on lower priority IRQ's (scsi, ethernet, etc.). */
332 if(irq < 10) 332 if((sparc_cpu_model==sun4m) && (irq < 10))
333 smp4m_irq_rotate(cpu); 333 smp4m_irq_rotate(cpu);
334#endif 334#endif
335 action = sparc_irq[irq].action; 335 action = sparc_irq[irq].action;
diff --git a/arch/sparc/kernel/of_device.c b/arch/sparc/kernel/of_device.c
index bc956c530376..97bf87e8cdde 100644
--- a/arch/sparc/kernel/of_device.c
+++ b/arch/sparc/kernel/of_device.c
@@ -183,7 +183,7 @@ struct bus_type of_bus_type = {
183}; 183};
184EXPORT_SYMBOL(of_bus_type); 184EXPORT_SYMBOL(of_bus_type);
185 185
186static inline u64 of_read_addr(u32 *cell, int size) 186static inline u64 of_read_addr(const u32 *cell, int size)
187{ 187{
188 u64 r = 0; 188 u64 r = 0;
189 while (size--) 189 while (size--)
@@ -209,8 +209,8 @@ struct of_bus {
209 int (*match)(struct device_node *parent); 209 int (*match)(struct device_node *parent);
210 void (*count_cells)(struct device_node *child, 210 void (*count_cells)(struct device_node *child,
211 int *addrc, int *sizec); 211 int *addrc, int *sizec);
212 u64 (*map)(u32 *addr, u32 *range, int na, int ns, int pna); 212 int (*map)(u32 *addr, const u32 *range,
213 int (*translate)(u32 *addr, u64 offset, int na); 213 int na, int ns, int pna);
214 unsigned int (*get_flags)(u32 *addr); 214 unsigned int (*get_flags)(u32 *addr);
215}; 215};
216 216
@@ -224,27 +224,49 @@ static void of_bus_default_count_cells(struct device_node *dev,
224 get_cells(dev, addrc, sizec); 224 get_cells(dev, addrc, sizec);
225} 225}
226 226
227static u64 of_bus_default_map(u32 *addr, u32 *range, int na, int ns, int pna) 227/* Make sure the least significant 64-bits are in-range. Even
228 * for 3 or 4 cell values it is a good enough approximation.
229 */
230static int of_out_of_range(const u32 *addr, const u32 *base,
231 const u32 *size, int na, int ns)
228{ 232{
229 u64 cp, s, da; 233 u64 a = of_read_addr(addr, na);
234 u64 b = of_read_addr(base, na);
230 235
231 cp = of_read_addr(range, na); 236 if (a < b)
232 s = of_read_addr(range + na + pna, ns); 237 return 1;
233 da = of_read_addr(addr, na);
234 238
235 if (da < cp || da >= (cp + s)) 239 b += of_read_addr(size, ns);
236 return OF_BAD_ADDR; 240 if (a >= b)
237 return da - cp; 241 return 1;
242
243 return 0;
238} 244}
239 245
240static int of_bus_default_translate(u32 *addr, u64 offset, int na) 246static int of_bus_default_map(u32 *addr, const u32 *range,
247 int na, int ns, int pna)
241{ 248{
242 u64 a = of_read_addr(addr, na); 249 u32 result[OF_MAX_ADDR_CELLS];
243 memset(addr, 0, na * 4); 250 int i;
244 a += offset; 251
245 if (na > 1) 252 if (ns > 2) {
246 addr[na - 2] = a >> 32; 253 printk("of_device: Cannot handle size cells (%d) > 2.", ns);
247 addr[na - 1] = a & 0xffffffffu; 254 return -EINVAL;
255 }
256
257 if (of_out_of_range(addr, range, range + na + pna, na, ns))
258 return -EINVAL;
259
260 /* Start with the parent range base. */
261 memcpy(result, range + na, pna * 4);
262
263 /* Add in the child address offset. */
264 for (i = 0; i < na; i++)
265 result[pna - 1 - i] +=
266 (addr[na - 1 - i] -
267 range[na - 1 - i]);
268
269 memcpy(addr, result, pna * 4);
248 270
249 return 0; 271 return 0;
250} 272}
@@ -254,14 +276,26 @@ static unsigned int of_bus_default_get_flags(u32 *addr)
254 return IORESOURCE_MEM; 276 return IORESOURCE_MEM;
255} 277}
256 278
257
258/* 279/*
259 * PCI bus specific translator 280 * PCI bus specific translator
260 */ 281 */
261 282
262static int of_bus_pci_match(struct device_node *np) 283static int of_bus_pci_match(struct device_node *np)
263{ 284{
264 return !strcmp(np->type, "pci") || !strcmp(np->type, "pciex"); 285 if (!strcmp(np->type, "pci") || !strcmp(np->type, "pciex")) {
286 /* Do not do PCI specific frobbing if the
287 * PCI bridge lacks a ranges property. We
288 * want to pass it through up to the next
289 * parent as-is, not with the PCI translate
290 * method which chops off the top address cell.
291 */
292 if (!of_find_property(np, "ranges", NULL))
293 return 0;
294
295 return 1;
296 }
297
298 return 0;
265} 299}
266 300
267static void of_bus_pci_count_cells(struct device_node *np, 301static void of_bus_pci_count_cells(struct device_node *np,
@@ -273,27 +307,32 @@ static void of_bus_pci_count_cells(struct device_node *np,
273 *sizec = 2; 307 *sizec = 2;
274} 308}
275 309
276static u64 of_bus_pci_map(u32 *addr, u32 *range, int na, int ns, int pna) 310static int of_bus_pci_map(u32 *addr, const u32 *range,
311 int na, int ns, int pna)
277{ 312{
278 u64 cp, s, da; 313 u32 result[OF_MAX_ADDR_CELLS];
314 int i;
279 315
280 /* Check address type match */ 316 /* Check address type match */
281 if ((addr[0] ^ range[0]) & 0x03000000) 317 if ((addr[0] ^ range[0]) & 0x03000000)
282 return OF_BAD_ADDR; 318 return -EINVAL;
283 319
284 /* Read address values, skipping high cell */ 320 if (of_out_of_range(addr + 1, range + 1, range + na + pna,
285 cp = of_read_addr(range + 1, na - 1); 321 na - 1, ns))
286 s = of_read_addr(range + na + pna, ns); 322 return -EINVAL;
287 da = of_read_addr(addr + 1, na - 1);
288 323
289 if (da < cp || da >= (cp + s)) 324 /* Start with the parent range base. */
290 return OF_BAD_ADDR; 325 memcpy(result, range + na, pna * 4);
291 return da - cp;
292}
293 326
294static int of_bus_pci_translate(u32 *addr, u64 offset, int na) 327 /* Add in the child address offset, skipping high cell. */
295{ 328 for (i = 0; i < na - 1; i++)
296 return of_bus_default_translate(addr + 1, offset, na - 1); 329 result[pna - 1 - i] +=
330 (addr[na - 1 - i] -
331 range[na - 1 - i]);
332
333 memcpy(addr, result, pna * 4);
334
335 return 0;
297} 336}
298 337
299static unsigned int of_bus_pci_get_flags(u32 *addr) 338static unsigned int of_bus_pci_get_flags(u32 *addr)
@@ -332,16 +371,11 @@ static void of_bus_sbus_count_cells(struct device_node *child,
332 *sizec = 1; 371 *sizec = 1;
333} 372}
334 373
335static u64 of_bus_sbus_map(u32 *addr, u32 *range, int na, int ns, int pna) 374static int of_bus_sbus_map(u32 *addr, const u32 *range, int na, int ns, int pna)
336{ 375{
337 return of_bus_default_map(addr, range, na, ns, pna); 376 return of_bus_default_map(addr, range, na, ns, pna);
338} 377}
339 378
340static int of_bus_sbus_translate(u32 *addr, u64 offset, int na)
341{
342 return of_bus_default_translate(addr, offset, na);
343}
344
345static unsigned int of_bus_sbus_get_flags(u32 *addr) 379static unsigned int of_bus_sbus_get_flags(u32 *addr)
346{ 380{
347 return IORESOURCE_MEM; 381 return IORESOURCE_MEM;
@@ -360,7 +394,6 @@ static struct of_bus of_busses[] = {
360 .match = of_bus_pci_match, 394 .match = of_bus_pci_match,
361 .count_cells = of_bus_pci_count_cells, 395 .count_cells = of_bus_pci_count_cells,
362 .map = of_bus_pci_map, 396 .map = of_bus_pci_map,
363 .translate = of_bus_pci_translate,
364 .get_flags = of_bus_pci_get_flags, 397 .get_flags = of_bus_pci_get_flags,
365 }, 398 },
366 /* SBUS */ 399 /* SBUS */
@@ -370,7 +403,6 @@ static struct of_bus of_busses[] = {
370 .match = of_bus_sbus_match, 403 .match = of_bus_sbus_match,
371 .count_cells = of_bus_sbus_count_cells, 404 .count_cells = of_bus_sbus_count_cells,
372 .map = of_bus_sbus_map, 405 .map = of_bus_sbus_map,
373 .translate = of_bus_sbus_translate,
374 .get_flags = of_bus_sbus_get_flags, 406 .get_flags = of_bus_sbus_get_flags,
375 }, 407 },
376 /* Default */ 408 /* Default */
@@ -380,7 +412,6 @@ static struct of_bus of_busses[] = {
380 .match = NULL, 412 .match = NULL,
381 .count_cells = of_bus_default_count_cells, 413 .count_cells = of_bus_default_count_cells,
382 .map = of_bus_default_map, 414 .map = of_bus_default_map,
383 .translate = of_bus_default_translate,
384 .get_flags = of_bus_default_get_flags, 415 .get_flags = of_bus_default_get_flags,
385 }, 416 },
386}; 417};
@@ -405,33 +436,34 @@ static int __init build_one_resource(struct device_node *parent,
405 u32 *ranges; 436 u32 *ranges;
406 unsigned int rlen; 437 unsigned int rlen;
407 int rone; 438 int rone;
408 u64 offset = OF_BAD_ADDR;
409 439
410 ranges = of_get_property(parent, "ranges", &rlen); 440 ranges = of_get_property(parent, "ranges", &rlen);
411 if (ranges == NULL || rlen == 0) { 441 if (ranges == NULL || rlen == 0) {
412 offset = of_read_addr(addr, na); 442 u32 result[OF_MAX_ADDR_CELLS];
413 memset(addr, 0, pna * 4); 443 int i;
414 goto finish; 444
445 memset(result, 0, pna * 4);
446 for (i = 0; i < na; i++)
447 result[pna - 1 - i] =
448 addr[na - 1 - i];
449
450 memcpy(addr, result, pna * 4);
451 return 0;
415 } 452 }
416 453
417 /* Now walk through the ranges */ 454 /* Now walk through the ranges */
418 rlen /= 4; 455 rlen /= 4;
419 rone = na + pna + ns; 456 rone = na + pna + ns;
420 for (; rlen >= rone; rlen -= rone, ranges += rone) { 457 for (; rlen >= rone; rlen -= rone, ranges += rone) {
421 offset = bus->map(addr, ranges, na, ns, pna); 458 if (!bus->map(addr, ranges, na, ns, pna))
422 if (offset != OF_BAD_ADDR) 459 return 0;
423 break;
424 } 460 }
425 if (offset == OF_BAD_ADDR)
426 return 1;
427 461
428 memcpy(addr, ranges + na, 4 * pna); 462 return 1;
429
430finish:
431 /* Translate it into parent bus space */
432 return pbus->translate(addr, offset, pna);
433} 463}
434 464
465static int of_resource_verbose;
466
435static void __init build_device_resources(struct of_device *op, 467static void __init build_device_resources(struct of_device *op,
436 struct device *parent) 468 struct device *parent)
437{ 469{
@@ -497,7 +529,8 @@ static void __init build_device_resources(struct of_device *op,
497 pbus = of_match_bus(pp); 529 pbus = of_match_bus(pp);
498 pbus->count_cells(dp, &pna, &pns); 530 pbus->count_cells(dp, &pna, &pns);
499 531
500 if (build_one_resource(dp, bus, pbus, addr, dna, dns, pna)) 532 if (build_one_resource(dp, bus, pbus, addr,
533 dna, dns, pna))
501 break; 534 break;
502 535
503 dna = pna; 536 dna = pna;
@@ -507,6 +540,12 @@ static void __init build_device_resources(struct of_device *op,
507 540
508 build_res: 541 build_res:
509 memset(r, 0, sizeof(*r)); 542 memset(r, 0, sizeof(*r));
543
544 if (of_resource_verbose)
545 printk("%s reg[%d] -> %llx\n",
546 op->node->full_name, index,
547 result);
548
510 if (result != OF_BAD_ADDR) { 549 if (result != OF_BAD_ADDR) {
511 r->start = result & 0xffffffff; 550 r->start = result & 0xffffffff;
512 r->end = result + size - 1; 551 r->end = result + size - 1;
@@ -557,14 +596,41 @@ static struct of_device * __init scan_one_device(struct device_node *dp,
557 static int pil_to_sbus[] = { 596 static int pil_to_sbus[] = {
558 0, 0, 1, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0, 0, 597 0, 0, 1, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0, 0,
559 }; 598 };
560 struct device_node *busp = dp->parent; 599 struct device_node *io_unit, *sbi = dp->parent;
561 struct linux_prom_registers *regs; 600 struct linux_prom_registers *regs;
562 int board = of_getintprop_default(busp, "board#", 0); 601 int board, slot;
563 int slot; 602
603 while (sbi) {
604 if (!strcmp(sbi->name, "sbi"))
605 break;
606
607 sbi = sbi->parent;
608 }
609 if (!sbi)
610 goto build_resources;
564 611
565 regs = of_get_property(dp, "reg", NULL); 612 regs = of_get_property(dp, "reg", NULL);
613 if (!regs)
614 goto build_resources;
615
566 slot = regs->which_io; 616 slot = regs->which_io;
567 617
618 /* If SBI's parent is not io-unit or the io-unit lacks
619 * a "board#" property, something is very wrong.
620 */
621 if (!sbi->parent || strcmp(sbi->parent->name, "io-unit")) {
622 printk("%s: Error, parent is not io-unit.\n",
623 sbi->full_name);
624 goto build_resources;
625 }
626 io_unit = sbi->parent;
627 board = of_getintprop_default(io_unit, "board#", -1);
628 if (board == -1) {
629 printk("%s: Error, lacks board# property.\n",
630 io_unit->full_name);
631 goto build_resources;
632 }
633
568 for (i = 0; i < op->num_irqs; i++) { 634 for (i = 0; i < op->num_irqs; i++) {
569 int this_irq = op->irqs[i]; 635 int this_irq = op->irqs[i];
570 int sbusl = pil_to_sbus[this_irq]; 636 int sbusl = pil_to_sbus[this_irq];
@@ -578,6 +644,7 @@ static struct of_device * __init scan_one_device(struct device_node *dp,
578 } 644 }
579 } 645 }
580 646
647build_resources:
581 build_device_resources(op, parent); 648 build_device_resources(op, parent);
582 649
583 op->dev.parent = parent; 650 op->dev.parent = parent;
@@ -643,6 +710,18 @@ static int __init of_bus_driver_init(void)
643 710
644postcore_initcall(of_bus_driver_init); 711postcore_initcall(of_bus_driver_init);
645 712
713static int __init of_debug(char *str)
714{
715 int val = 0;
716
717 get_option(&str, &val);
718 if (val & 1)
719 of_resource_verbose = 1;
720 return 1;
721}
722
723__setup("of_debug=", of_debug);
724
646int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus) 725int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus)
647{ 726{
648 /* initialize common driver fields */ 727 /* initialize common driver fields */
@@ -695,9 +774,11 @@ int of_device_register(struct of_device *ofdev)
695 if (rc) 774 if (rc)
696 return rc; 775 return rc;
697 776
698 device_create_file(&ofdev->dev, &dev_attr_devspec); 777 rc = device_create_file(&ofdev->dev, &dev_attr_devspec);
778 if (rc)
779 device_unregister(&ofdev->dev);
699 780
700 return 0; 781 return rc;
701} 782}
702 783
703void of_device_unregister(struct of_device *ofdev) 784void of_device_unregister(struct of_device *ofdev)
diff --git a/arch/sparc/kernel/prom.c b/arch/sparc/kernel/prom.c
index 4b06dcb00ebd..4ca9e5fc97f4 100644
--- a/arch/sparc/kernel/prom.c
+++ b/arch/sparc/kernel/prom.c
@@ -444,6 +444,7 @@ static struct property * __init build_one_prop(phandle node, char *prev, char *s
444 static struct property *tmp = NULL; 444 static struct property *tmp = NULL;
445 struct property *p; 445 struct property *p;
446 int len; 446 int len;
447 const char *name;
447 448
448 if (tmp) { 449 if (tmp) {
449 p = tmp; 450 p = tmp;
@@ -456,19 +457,21 @@ static struct property * __init build_one_prop(phandle node, char *prev, char *s
456 457
457 p->name = (char *) (p + 1); 458 p->name = (char *) (p + 1);
458 if (special_name) { 459 if (special_name) {
460 strcpy(p->name, special_name);
459 p->length = special_len; 461 p->length = special_len;
460 p->value = prom_early_alloc(special_len); 462 p->value = prom_early_alloc(special_len);
461 memcpy(p->value, special_val, special_len); 463 memcpy(p->value, special_val, special_len);
462 } else { 464 } else {
463 if (prev == NULL) { 465 if (prev == NULL) {
464 prom_firstprop(node, p->name); 466 name = prom_firstprop(node, NULL);
465 } else { 467 } else {
466 prom_nextprop(node, prev, p->name); 468 name = prom_nextprop(node, prev, NULL);
467 } 469 }
468 if (strlen(p->name) == 0) { 470 if (strlen(name) == 0) {
469 tmp = p; 471 tmp = p;
470 return NULL; 472 return NULL;
471 } 473 }
474 strcpy(p->name, name);
472 p->length = prom_getproplen(node, p->name); 475 p->length = prom_getproplen(node, p->name);
473 if (p->length <= 0) { 476 if (p->length <= 0) {
474 p->length = 0; 477 p->length = 0;
diff --git a/arch/sparc/kernel/setup.c b/arch/sparc/kernel/setup.c
index 8606ef4e52e9..35488d6c7457 100644
--- a/arch/sparc/kernel/setup.c
+++ b/arch/sparc/kernel/setup.c
@@ -17,7 +17,7 @@
17#include <asm/smp.h> 17#include <asm/smp.h>
18#include <linux/user.h> 18#include <linux/user.h>
19#include <linux/a.out.h> 19#include <linux/a.out.h>
20#include <linux/tty.h> 20#include <linux/screen_info.h>
21#include <linux/delay.h> 21#include <linux/delay.h>
22#include <linux/fs.h> 22#include <linux/fs.h>
23#include <linux/seq_file.h> 23#include <linux/seq_file.h>
diff --git a/arch/sparc/kernel/smp.c b/arch/sparc/kernel/smp.c
index 6135d4faeeeb..e311ade1b490 100644
--- a/arch/sparc/kernel/smp.c
+++ b/arch/sparc/kernel/smp.c
@@ -87,6 +87,7 @@ void __cpuinit smp_store_cpu_info(int id)
87void __init smp_cpus_done(unsigned int max_cpus) 87void __init smp_cpus_done(unsigned int max_cpus)
88{ 88{
89 extern void smp4m_smp_done(void); 89 extern void smp4m_smp_done(void);
90 extern void smp4d_smp_done(void);
90 unsigned long bogosum = 0; 91 unsigned long bogosum = 0;
91 int cpu, num; 92 int cpu, num;
92 93
@@ -100,8 +101,34 @@ void __init smp_cpus_done(unsigned int max_cpus)
100 num, bogosum/(500000/HZ), 101 num, bogosum/(500000/HZ),
101 (bogosum/(5000/HZ))%100); 102 (bogosum/(5000/HZ))%100);
102 103
103 BUG_ON(sparc_cpu_model != sun4m); 104 switch(sparc_cpu_model) {
104 smp4m_smp_done(); 105 case sun4:
106 printk("SUN4\n");
107 BUG();
108 break;
109 case sun4c:
110 printk("SUN4C\n");
111 BUG();
112 break;
113 case sun4m:
114 smp4m_smp_done();
115 break;
116 case sun4d:
117 smp4d_smp_done();
118 break;
119 case sun4e:
120 printk("SUN4E\n");
121 BUG();
122 break;
123 case sun4u:
124 printk("SUN4U\n");
125 BUG();
126 break;
127 default:
128 printk("UNKNOWN!\n");
129 BUG();
130 break;
131 };
105} 132}
106 133
107void cpu_panic(void) 134void cpu_panic(void)
@@ -267,9 +294,9 @@ int setup_profiling_timer(unsigned int multiplier)
267void __init smp_prepare_cpus(unsigned int max_cpus) 294void __init smp_prepare_cpus(unsigned int max_cpus)
268{ 295{
269 extern void smp4m_boot_cpus(void); 296 extern void smp4m_boot_cpus(void);
297 extern void smp4d_boot_cpus(void);
270 int i, cpuid, extra; 298 int i, cpuid, extra;
271 299
272 BUG_ON(sparc_cpu_model != sun4m);
273 printk("Entering SMP Mode...\n"); 300 printk("Entering SMP Mode...\n");
274 301
275 extra = 0; 302 extra = 0;
@@ -283,7 +310,34 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
283 310
284 smp_store_cpu_info(boot_cpu_id); 311 smp_store_cpu_info(boot_cpu_id);
285 312
286 smp4m_boot_cpus(); 313 switch(sparc_cpu_model) {
314 case sun4:
315 printk("SUN4\n");
316 BUG();
317 break;
318 case sun4c:
319 printk("SUN4C\n");
320 BUG();
321 break;
322 case sun4m:
323 smp4m_boot_cpus();
324 break;
325 case sun4d:
326 smp4d_boot_cpus();
327 break;
328 case sun4e:
329 printk("SUN4E\n");
330 BUG();
331 break;
332 case sun4u:
333 printk("SUN4U\n");
334 BUG();
335 break;
336 default:
337 printk("UNKNOWN!\n");
338 BUG();
339 break;
340 };
287} 341}
288 342
289/* Set this up early so that things like the scheduler can init 343/* Set this up early so that things like the scheduler can init
@@ -323,9 +377,37 @@ void __init smp_prepare_boot_cpu(void)
323int __cpuinit __cpu_up(unsigned int cpu) 377int __cpuinit __cpu_up(unsigned int cpu)
324{ 378{
325 extern int smp4m_boot_one_cpu(int); 379 extern int smp4m_boot_one_cpu(int);
326 int ret; 380 extern int smp4d_boot_one_cpu(int);
327 381 int ret=0;
328 ret = smp4m_boot_one_cpu(cpu); 382
383 switch(sparc_cpu_model) {
384 case sun4:
385 printk("SUN4\n");
386 BUG();
387 break;
388 case sun4c:
389 printk("SUN4C\n");
390 BUG();
391 break;
392 case sun4m:
393 ret = smp4m_boot_one_cpu(cpu);
394 break;
395 case sun4d:
396 ret = smp4d_boot_one_cpu(cpu);
397 break;
398 case sun4e:
399 printk("SUN4E\n");
400 BUG();
401 break;
402 case sun4u:
403 printk("SUN4U\n");
404 BUG();
405 break;
406 default:
407 printk("UNKNOWN!\n");
408 BUG();
409 break;
410 };
329 411
330 if (!ret) { 412 if (!ret) {
331 cpu_set(cpu, smp_commenced_mask); 413 cpu_set(cpu, smp_commenced_mask);
diff --git a/arch/sparc/kernel/sparc_ksyms.c b/arch/sparc/kernel/sparc_ksyms.c
index 5fb987fc3d63..4d441a554d35 100644
--- a/arch/sparc/kernel/sparc_ksyms.c
+++ b/arch/sparc/kernel/sparc_ksyms.c
@@ -237,7 +237,6 @@ EXPORT_SYMBOL(prom_node_has_property);
237EXPORT_SYMBOL(prom_setprop); 237EXPORT_SYMBOL(prom_setprop);
238EXPORT_SYMBOL(saved_command_line); 238EXPORT_SYMBOL(saved_command_line);
239EXPORT_SYMBOL(prom_apply_obio_ranges); 239EXPORT_SYMBOL(prom_apply_obio_ranges);
240EXPORT_SYMBOL(prom_getname);
241EXPORT_SYMBOL(prom_feval); 240EXPORT_SYMBOL(prom_feval);
242EXPORT_SYMBOL(prom_getbool); 241EXPORT_SYMBOL(prom_getbool);
243EXPORT_SYMBOL(prom_getstring); 242EXPORT_SYMBOL(prom_getstring);
diff --git a/arch/sparc/kernel/sun4d_smp.c b/arch/sparc/kernel/sun4d_smp.c
index b141b7ee6717..ba843f6a2832 100644
--- a/arch/sparc/kernel/sun4d_smp.c
+++ b/arch/sparc/kernel/sun4d_smp.c
@@ -43,15 +43,10 @@ extern ctxd_t *srmmu_ctx_table_phys;
43extern void calibrate_delay(void); 43extern void calibrate_delay(void);
44 44
45extern volatile int smp_processors_ready; 45extern volatile int smp_processors_ready;
46extern int smp_num_cpus;
47static int smp_highest_cpu; 46static int smp_highest_cpu;
48extern volatile unsigned long cpu_callin_map[NR_CPUS]; 47extern volatile unsigned long cpu_callin_map[NR_CPUS];
49extern cpuinfo_sparc cpu_data[NR_CPUS]; 48extern cpuinfo_sparc cpu_data[NR_CPUS];
50extern unsigned char boot_cpu_id; 49extern unsigned char boot_cpu_id;
51extern int smp_activated;
52extern volatile int __cpu_number_map[NR_CPUS];
53extern volatile int __cpu_logical_map[NR_CPUS];
54extern volatile unsigned long ipi_count;
55extern volatile int smp_process_available; 50extern volatile int smp_process_available;
56 51
57extern cpumask_t smp_commenced_mask; 52extern cpumask_t smp_commenced_mask;
@@ -144,6 +139,8 @@ void __init smp4d_callin(void)
144 spin_lock_irqsave(&sun4d_imsk_lock, flags); 139 spin_lock_irqsave(&sun4d_imsk_lock, flags);
145 cc_set_imsk(cc_get_imsk() & ~0x4000); /* Allow PIL 14 as well */ 140 cc_set_imsk(cc_get_imsk() & ~0x4000); /* Allow PIL 14 as well */
146 spin_unlock_irqrestore(&sun4d_imsk_lock, flags); 141 spin_unlock_irqrestore(&sun4d_imsk_lock, flags);
142 cpu_set(cpuid, cpu_online_map);
143
147} 144}
148 145
149extern void init_IRQ(void); 146extern void init_IRQ(void);
@@ -160,51 +157,24 @@ extern unsigned long trapbase_cpu3[];
160 157
161void __init smp4d_boot_cpus(void) 158void __init smp4d_boot_cpus(void)
162{ 159{
163 int cpucount = 0;
164 int i, mid;
165
166 printk("Entering SMP Mode...\n");
167
168 if (boot_cpu_id) 160 if (boot_cpu_id)
169 current_set[0] = NULL; 161 current_set[0] = NULL;
170
171 local_irq_enable();
172 cpus_clear(cpu_present_map);
173
174 /* XXX This whole thing has to go. See sparc64. */
175 for (i = 0; !cpu_find_by_instance(i, NULL, &mid); i++)
176 cpu_set(mid, cpu_present_map);
177 SMP_PRINTK(("cpu_present_map %08lx\n", cpus_addr(cpu_present_map)[0]));
178 for(i=0; i < NR_CPUS; i++)
179 __cpu_number_map[i] = -1;
180 for(i=0; i < NR_CPUS; i++)
181 __cpu_logical_map[i] = -1;
182 __cpu_number_map[boot_cpu_id] = 0;
183 __cpu_logical_map[0] = boot_cpu_id;
184 current_thread_info()->cpu = boot_cpu_id;
185 smp_store_cpu_info(boot_cpu_id);
186 smp_setup_percpu_timer(); 162 smp_setup_percpu_timer();
187 local_flush_cache_all(); 163 local_flush_cache_all();
188 if (cpu_find_by_instance(1, NULL, NULL)) 164}
189 return; /* Not an MP box. */ 165
190 SMP_PRINTK(("Iterating over CPUs\n")); 166int smp4d_boot_one_cpu(int i)
191 for(i = 0; i < NR_CPUS; i++) { 167{
192 if(i == boot_cpu_id)
193 continue;
194
195 if (cpu_isset(i, cpu_present_map)) {
196 extern unsigned long sun4d_cpu_startup; 168 extern unsigned long sun4d_cpu_startup;
197 unsigned long *entry = &sun4d_cpu_startup; 169 unsigned long *entry = &sun4d_cpu_startup;
198 struct task_struct *p; 170 struct task_struct *p;
199 int timeout; 171 int timeout;
200 int no; 172 int cpu_node;
201 173
174 cpu_find_by_instance(i, &cpu_node,NULL);
202 /* Cook up an idler for this guy. */ 175 /* Cook up an idler for this guy. */
203 p = fork_idle(i); 176 p = fork_idle(i);
204 cpucount++;
205 current_set[i] = task_thread_info(p); 177 current_set[i] = task_thread_info(p);
206 for (no = 0; !cpu_find_by_instance(no, NULL, &mid)
207 && mid != i; no++) ;
208 178
209 /* 179 /*
210 * Initialize the contexts table 180 * Initialize the contexts table
@@ -216,9 +186,9 @@ void __init smp4d_boot_cpus(void)
216 smp_penguin_ctable.reg_size = 0; 186 smp_penguin_ctable.reg_size = 0;
217 187
218 /* whirrr, whirrr, whirrrrrrrrr... */ 188 /* whirrr, whirrr, whirrrrrrrrr... */
219 SMP_PRINTK(("Starting CPU %d at %p task %d node %08x\n", i, entry, cpucount, cpu_data(no).prom_node)); 189 SMP_PRINTK(("Starting CPU %d at %p \n", i, entry));
220 local_flush_cache_all(); 190 local_flush_cache_all();
221 prom_startcpu(cpu_data(no).prom_node, 191 prom_startcpu(cpu_node,
222 &smp_penguin_ctable, 0, (char *)entry); 192 &smp_penguin_ctable, 0, (char *)entry);
223 193
224 SMP_PRINTK(("prom_startcpu returned :)\n")); 194 SMP_PRINTK(("prom_startcpu returned :)\n"));
@@ -230,39 +200,30 @@ void __init smp4d_boot_cpus(void)
230 udelay(200); 200 udelay(200);
231 } 201 }
232 202
233 if(cpu_callin_map[i]) { 203 if (!(cpu_callin_map[i])) {
234 /* Another "Red Snapper". */ 204 printk("Processor %d is stuck.\n", i);
235 __cpu_number_map[i] = cpucount; 205 return -ENODEV;
236 __cpu_logical_map[cpucount] = i; 206
237 } else {
238 cpucount--;
239 printk("Processor %d is stuck.\n", i);
240 }
241 }
242 if(!(cpu_callin_map[i])) {
243 cpu_clear(i, cpu_present_map);
244 __cpu_number_map[i] = -1;
245 }
246 } 207 }
247 local_flush_cache_all(); 208 local_flush_cache_all();
248 if(cpucount == 0) { 209 return 0;
249 printk("Error: only one Processor found.\n"); 210}
250 cpu_present_map = cpumask_of_cpu(hard_smp4d_processor_id()); 211
251 } else { 212void __init smp4d_smp_done(void)
252 unsigned long bogosum = 0; 213{
253 214 int i, first;
254 for_each_present_cpu(i) { 215 int *prev;
255 bogosum += cpu_data(i).udelay_val; 216
256 smp_highest_cpu = i; 217 /* setup cpu list for irq rotation */
218 first = 0;
219 prev = &first;
220 for (i = 0; i < NR_CPUS; i++)
221 if (cpu_online(i)) {
222 *prev = i;
223 prev = &cpu_data(i).next;
257 } 224 }
258 SMP_PRINTK(("Total of %d Processors activated (%lu.%02lu BogoMIPS).\n", cpucount + 1, bogosum/(500000/HZ), (bogosum/(5000/HZ))%100)); 225 *prev = first;
259 printk("Total of %d Processors activated (%lu.%02lu BogoMIPS).\n", 226 local_flush_cache_all();
260 cpucount + 1,
261 bogosum/(500000/HZ),
262 (bogosum/(5000/HZ))%100);
263 smp_activated = 1;
264 smp_num_cpus = cpucount + 1;
265 }
266 227
267 /* Free unneeded trap tables */ 228 /* Free unneeded trap tables */
268 ClearPageReserved(virt_to_page(trapbase_cpu1)); 229 ClearPageReserved(virt_to_page(trapbase_cpu1));
@@ -334,7 +295,7 @@ void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2,
334 register int i; 295 register int i;
335 296
336 mask = cpumask_of_cpu(hard_smp4d_processor_id()); 297 mask = cpumask_of_cpu(hard_smp4d_processor_id());
337 cpus_andnot(mask, cpu_present_map, mask); 298 cpus_andnot(mask, cpu_online_map, mask);
338 for(i = 0; i <= high; i++) { 299 for(i = 0; i <= high; i++) {
339 if (cpu_isset(i, mask)) { 300 if (cpu_isset(i, mask)) {
340 ccall_info.processors_in[i] = 0; 301 ccall_info.processors_in[i] = 0;
diff --git a/arch/sparc/kernel/sys_sparc.c b/arch/sparc/kernel/sys_sparc.c
index 0cdfc9d294b4..a41c8a5c2007 100644
--- a/arch/sparc/kernel/sys_sparc.c
+++ b/arch/sparc/kernel/sys_sparc.c
@@ -465,21 +465,21 @@ sys_rt_sigaction(int sig,
465 465
466asmlinkage int sys_getdomainname(char __user *name, int len) 466asmlinkage int sys_getdomainname(char __user *name, int len)
467{ 467{
468 int nlen; 468 int nlen, err;
469 int err = -EFAULT;
470 469
470 if (len < 0 || len > __NEW_UTS_LEN)
471 return -EINVAL;
472
471 down_read(&uts_sem); 473 down_read(&uts_sem);
472 474
473 nlen = strlen(system_utsname.domainname) + 1; 475 nlen = strlen(system_utsname.domainname) + 1;
474
475 if (nlen < len) 476 if (nlen < len)
476 len = nlen; 477 len = nlen;
477 if (len > __NEW_UTS_LEN) 478
478 goto done; 479 err = -EFAULT;
479 if (copy_to_user(name, system_utsname.domainname, len)) 480 if (!copy_to_user(name, system_utsname.domainname, len))
480 goto done; 481 err = 0;
481 err = 0; 482
482done:
483 up_read(&uts_sem); 483 up_read(&uts_sem);
484 return err; 484 return err;
485} 485}
diff --git a/arch/sparc/kernel/time.c b/arch/sparc/kernel/time.c
index 04eb1eab6e3e..845081b01267 100644
--- a/arch/sparc/kernel/time.c
+++ b/arch/sparc/kernel/time.c
@@ -225,6 +225,32 @@ static __inline__ int has_low_battery(void)
225 return (data1 == data2); /* Was the write blocked? */ 225 return (data1 == data2); /* Was the write blocked? */
226} 226}
227 227
228static void __init mostek_set_system_time(void)
229{
230 unsigned int year, mon, day, hour, min, sec;
231 struct mostek48t02 *mregs;
232
233 mregs = (struct mostek48t02 *)mstk48t02_regs;
234 if(!mregs) {
235 prom_printf("Something wrong, clock regs not mapped yet.\n");
236 prom_halt();
237 }
238 spin_lock_irq(&mostek_lock);
239 mregs->creg |= MSTK_CREG_READ;
240 sec = MSTK_REG_SEC(mregs);
241 min = MSTK_REG_MIN(mregs);
242 hour = MSTK_REG_HOUR(mregs);
243 day = MSTK_REG_DOM(mregs);
244 mon = MSTK_REG_MONTH(mregs);
245 year = MSTK_CVT_YEAR( MSTK_REG_YEAR(mregs) );
246 xtime.tv_sec = mktime(year, mon, day, hour, min, sec);
247 xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ);
248 set_normalized_timespec(&wall_to_monotonic,
249 -xtime.tv_sec, -xtime.tv_nsec);
250 mregs->creg &= ~MSTK_CREG_READ;
251 spin_unlock_irq(&mostek_lock);
252}
253
228/* Probe for the real time clock chip on Sun4 */ 254/* Probe for the real time clock chip on Sun4 */
229static __inline__ void sun4_clock_probe(void) 255static __inline__ void sun4_clock_probe(void)
230{ 256{
@@ -273,6 +299,7 @@ static __inline__ void sun4_clock_probe(void)
273#endif 299#endif
274} 300}
275 301
302#ifndef CONFIG_SUN4
276static int __devinit clock_probe(struct of_device *op, const struct of_device_id *match) 303static int __devinit clock_probe(struct of_device *op, const struct of_device_id *match)
277{ 304{
278 struct device_node *dp = op->node; 305 struct device_node *dp = op->node;
@@ -307,6 +334,8 @@ static int __devinit clock_probe(struct of_device *op, const struct of_device_id
307 if (mostek_read(mstk48t02_regs + MOSTEK_SEC) & MSTK_STOP) 334 if (mostek_read(mstk48t02_regs + MOSTEK_SEC) & MSTK_STOP)
308 kick_start_clock(); 335 kick_start_clock();
309 336
337 mostek_set_system_time();
338
310 return 0; 339 return 0;
311} 340}
312 341
@@ -325,56 +354,37 @@ static struct of_platform_driver clock_driver = {
325 354
326 355
327/* Probe for the mostek real time clock chip. */ 356/* Probe for the mostek real time clock chip. */
328static void clock_init(void) 357static int __init clock_init(void)
329{ 358{
330 of_register_driver(&clock_driver, &of_bus_type); 359 return of_register_driver(&clock_driver, &of_bus_type);
331} 360}
332 361
362/* Must be after subsys_initcall() so that busses are probed. Must
363 * be before device_initcall() because things like the RTC driver
364 * need to see the clock registers.
365 */
366fs_initcall(clock_init);
367#endif /* !CONFIG_SUN4 */
368
333void __init sbus_time_init(void) 369void __init sbus_time_init(void)
334{ 370{
335 unsigned int year, mon, day, hour, min, sec;
336 struct mostek48t02 *mregs;
337
338#ifdef CONFIG_SUN4
339 int temp;
340 struct intersil *iregs;
341#endif
342 371
343 BTFIXUPSET_CALL(bus_do_settimeofday, sbus_do_settimeofday, BTFIXUPCALL_NORM); 372 BTFIXUPSET_CALL(bus_do_settimeofday, sbus_do_settimeofday, BTFIXUPCALL_NORM);
344 btfixup(); 373 btfixup();
345 374
346 if (ARCH_SUN4) 375 if (ARCH_SUN4)
347 sun4_clock_probe(); 376 sun4_clock_probe();
348 else
349 clock_init();
350 377
351 sparc_init_timers(timer_interrupt); 378 sparc_init_timers(timer_interrupt);
352 379
353#ifdef CONFIG_SUN4 380#ifdef CONFIG_SUN4
354 if(idprom->id_machtype == (SM_SUN4 | SM_4_330)) { 381 if(idprom->id_machtype == (SM_SUN4 | SM_4_330)) {
355#endif 382 mostek_set_system_time();
356 mregs = (struct mostek48t02 *)mstk48t02_regs;
357 if(!mregs) {
358 prom_printf("Something wrong, clock regs not mapped yet.\n");
359 prom_halt();
360 }
361 spin_lock_irq(&mostek_lock);
362 mregs->creg |= MSTK_CREG_READ;
363 sec = MSTK_REG_SEC(mregs);
364 min = MSTK_REG_MIN(mregs);
365 hour = MSTK_REG_HOUR(mregs);
366 day = MSTK_REG_DOM(mregs);
367 mon = MSTK_REG_MONTH(mregs);
368 year = MSTK_CVT_YEAR( MSTK_REG_YEAR(mregs) );
369 xtime.tv_sec = mktime(year, mon, day, hour, min, sec);
370 xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ);
371 set_normalized_timespec(&wall_to_monotonic,
372 -xtime.tv_sec, -xtime.tv_nsec);
373 mregs->creg &= ~MSTK_CREG_READ;
374 spin_unlock_irq(&mostek_lock);
375#ifdef CONFIG_SUN4
376 } else if(idprom->id_machtype == (SM_SUN4 | SM_4_260) ) { 383 } else if(idprom->id_machtype == (SM_SUN4 | SM_4_260) ) {
377 /* initialise the intersil on sun4 */ 384 /* initialise the intersil on sun4 */
385 unsigned int year, mon, day, hour, min, sec;
386 int temp;
387 struct intersil *iregs;
378 388
379 iregs=intersil_clock; 389 iregs=intersil_clock;
380 if(!iregs) { 390 if(!iregs) {
diff --git a/arch/sparc/mm/io-unit.c b/arch/sparc/mm/io-unit.c
index 42c1c700c0a7..2bb1309003dd 100644
--- a/arch/sparc/mm/io-unit.c
+++ b/arch/sparc/mm/io-unit.c
@@ -64,6 +64,7 @@ iounit_init(int sbi_node, int io_node, struct sbus_bus *sbus)
64 64
65 sbus->iommu = (struct iommu_struct *)iounit; 65 sbus->iommu = (struct iommu_struct *)iounit;
66 iounit->page_table = xpt; 66 iounit->page_table = xpt;
67 spin_lock_init(&iounit->lock);
67 68
68 for (xptend = iounit->page_table + (16 * PAGE_SIZE) / sizeof(iopte_t); 69 for (xptend = iounit->page_table + (16 * PAGE_SIZE) / sizeof(iopte_t);
69 xpt < xptend;) 70 xpt < xptend;)
diff --git a/arch/sparc/prom/tree.c b/arch/sparc/prom/tree.c
index 2bf03ee8cde5..5ec246573a98 100644
--- a/arch/sparc/prom/tree.c
+++ b/arch/sparc/prom/tree.c
@@ -205,24 +205,6 @@ int prom_searchsiblings(int node_start, char *nodename)
205 return 0; 205 return 0;
206} 206}
207 207
208/* Gets name in the form prom v2+ uses it (name@x,yyyyy or name (if no reg)) */
209int prom_getname (int node, char *buffer, int len)
210{
211 int i;
212 struct linux_prom_registers reg[PROMREG_MAX];
213
214 i = prom_getproperty (node, "name", buffer, len);
215 if (i <= 0) return -1;
216 buffer [i] = 0;
217 len -= i;
218 i = prom_getproperty (node, "reg", (char *)reg, sizeof (reg));
219 if (i <= 0) return 0;
220 if (len < 11) return -1;
221 buffer = strchr (buffer, 0);
222 sprintf (buffer, "@%x,%x", reg[0].which_io, (uint)reg[0].phys_addr);
223 return 0;
224}
225
226/* Interal version of nextprop that does not alter return values. */ 208/* Interal version of nextprop that does not alter return values. */
227char * __prom_nextprop(int node, char * oprop) 209char * __prom_nextprop(int node, char * oprop)
228{ 210{
diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig
index a7a111db25b2..8a36ba8868db 100644
--- a/arch/sparc64/Kconfig
+++ b/arch/sparc64/Kconfig
@@ -334,7 +334,7 @@ config COMPAT
334 default y 334 default y
335 335
336config BINFMT_ELF32 336config BINFMT_ELF32
337 tristate "Kernel support for 32-bit ELF binaries" 337 bool "Kernel support for 32-bit ELF binaries"
338 depends on SPARC32_COMPAT 338 depends on SPARC32_COMPAT
339 help 339 help
340 This allows you to run 32-bit Linux/ELF binaries on your Ultra. 340 This allows you to run 32-bit Linux/ELF binaries on your Ultra.
diff --git a/arch/sparc64/defconfig b/arch/sparc64/defconfig
index b2f41147d0e4..43d9229fca07 100644
--- a/arch/sparc64/defconfig
+++ b/arch/sparc64/defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17 3# Linux kernel version: 2.6.18-rc2
4# Fri Jun 23 23:17:09 2006 4# Fri Jul 21 14:19:24 2006
5# 5#
6CONFIG_SPARC=y 6CONFIG_SPARC=y
7CONFIG_SPARC64=y 7CONFIG_SPARC64=y
@@ -18,6 +18,7 @@ CONFIG_SECCOMP=y
18CONFIG_HZ_250=y 18CONFIG_HZ_250=y
19# CONFIG_HZ_1000 is not set 19# CONFIG_HZ_1000 is not set
20CONFIG_HZ=250 20CONFIG_HZ=250
21CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
21 22
22# 23#
23# Code maturity level options 24# Code maturity level options
@@ -35,6 +36,7 @@ CONFIG_SWAP=y
35CONFIG_SYSVIPC=y 36CONFIG_SYSVIPC=y
36CONFIG_POSIX_MQUEUE=y 37CONFIG_POSIX_MQUEUE=y
37# CONFIG_BSD_PROCESS_ACCT is not set 38# CONFIG_BSD_PROCESS_ACCT is not set
39# CONFIG_TASKSTATS is not set
38CONFIG_SYSCTL=y 40CONFIG_SYSCTL=y
39# CONFIG_AUDIT is not set 41# CONFIG_AUDIT is not set
40# CONFIG_IKCONFIG is not set 42# CONFIG_IKCONFIG is not set
@@ -51,10 +53,12 @@ CONFIG_PRINTK=y
51CONFIG_BUG=y 53CONFIG_BUG=y
52CONFIG_ELF_CORE=y 54CONFIG_ELF_CORE=y
53CONFIG_BASE_FULL=y 55CONFIG_BASE_FULL=y
56CONFIG_RT_MUTEXES=y
54CONFIG_FUTEX=y 57CONFIG_FUTEX=y
55CONFIG_EPOLL=y 58CONFIG_EPOLL=y
56CONFIG_SHMEM=y 59CONFIG_SHMEM=y
57CONFIG_SLAB=y 60CONFIG_SLAB=y
61CONFIG_VM_EVENT_COUNTERS=y
58# CONFIG_TINY_SHMEM is not set 62# CONFIG_TINY_SHMEM is not set
59CONFIG_BASE_SMALL=0 63CONFIG_BASE_SMALL=0
60# CONFIG_SLOB is not set 64# CONFIG_SLOB is not set
@@ -127,8 +131,8 @@ CONFIG_SPARSEMEM=y
127CONFIG_HAVE_MEMORY_PRESENT=y 131CONFIG_HAVE_MEMORY_PRESENT=y
128# CONFIG_SPARSEMEM_STATIC is not set 132# CONFIG_SPARSEMEM_STATIC is not set
129CONFIG_SPARSEMEM_EXTREME=y 133CONFIG_SPARSEMEM_EXTREME=y
130CONFIG_MEMORY_HOTPLUG=y
131CONFIG_SPLIT_PTLOCK_CPUS=4 134CONFIG_SPLIT_PTLOCK_CPUS=4
135CONFIG_RESOURCES_64BIT=y
132CONFIG_GENERIC_ISA_DMA=y 136CONFIG_GENERIC_ISA_DMA=y
133CONFIG_SBUS=y 137CONFIG_SBUS=y
134CONFIG_SBUSCHAR=y 138CONFIG_SBUSCHAR=y
@@ -203,7 +207,6 @@ CONFIG_TCP_CONG_VEGAS=m
203CONFIG_TCP_CONG_SCALABLE=m 207CONFIG_TCP_CONG_SCALABLE=m
204CONFIG_TCP_CONG_LP=m 208CONFIG_TCP_CONG_LP=m
205CONFIG_TCP_CONG_VENO=m 209CONFIG_TCP_CONG_VENO=m
206CONFIG_TCP_CONG_COMPOUND=m
207CONFIG_IPV6=m 210CONFIG_IPV6=m
208CONFIG_IPV6_PRIVACY=y 211CONFIG_IPV6_PRIVACY=y
209CONFIG_IPV6_ROUTER_PREF=y 212CONFIG_IPV6_ROUTER_PREF=y
@@ -461,9 +464,8 @@ CONFIG_MD_LINEAR=m
461CONFIG_MD_RAID0=m 464CONFIG_MD_RAID0=m
462CONFIG_MD_RAID1=m 465CONFIG_MD_RAID1=m
463CONFIG_MD_RAID10=m 466CONFIG_MD_RAID10=m
464CONFIG_MD_RAID5=m 467CONFIG_MD_RAID456=m
465# CONFIG_MD_RAID5_RESHAPE is not set 468# CONFIG_MD_RAID5_RESHAPE is not set
466CONFIG_MD_RAID6=m
467CONFIG_MD_MULTIPATH=m 469CONFIG_MD_MULTIPATH=m
468# CONFIG_MD_FAULTY is not set 470# CONFIG_MD_FAULTY is not set
469CONFIG_BLK_DEV_DM=m 471CONFIG_BLK_DEV_DM=m
@@ -663,6 +665,7 @@ CONFIG_SERIO_RAW=m
663CONFIG_VT=y 665CONFIG_VT=y
664CONFIG_VT_CONSOLE=y 666CONFIG_VT_CONSOLE=y
665CONFIG_HW_CONSOLE=y 667CONFIG_HW_CONSOLE=y
668# CONFIG_VT_HW_CONSOLE_BINDING is not set
666# CONFIG_SERIAL_NONSTANDARD is not set 669# CONFIG_SERIAL_NONSTANDARD is not set
667 670
668# 671#
@@ -693,6 +696,7 @@ CONFIG_UNIX98_PTYS=y
693# Watchdog Cards 696# Watchdog Cards
694# 697#
695# CONFIG_WATCHDOG is not set 698# CONFIG_WATCHDOG is not set
699# CONFIG_HW_RANDOM is not set
696CONFIG_RTC=y 700CONFIG_RTC=y
697# CONFIG_DTLK is not set 701# CONFIG_DTLK is not set
698# CONFIG_R3964 is not set 702# CONFIG_R3964 is not set
@@ -839,12 +843,13 @@ CONFIG_VIDEO_V4L2=y
839# 843#
840# Graphics support 844# Graphics support
841# 845#
846# CONFIG_FIRMWARE_EDID is not set
842CONFIG_FB=y 847CONFIG_FB=y
843CONFIG_FB_CFB_FILLRECT=y 848CONFIG_FB_CFB_FILLRECT=y
844CONFIG_FB_CFB_COPYAREA=y 849CONFIG_FB_CFB_COPYAREA=y
845CONFIG_FB_CFB_IMAGEBLIT=y 850CONFIG_FB_CFB_IMAGEBLIT=y
846# CONFIG_FB_MACMODES is not set 851# CONFIG_FB_MACMODES is not set
847# CONFIG_FB_FIRMWARE_EDID is not set 852# CONFIG_FB_BACKLIGHT is not set
848CONFIG_FB_MODE_HELPERS=y 853CONFIG_FB_MODE_HELPERS=y
849CONFIG_FB_TILEBLITTING=y 854CONFIG_FB_TILEBLITTING=y
850# CONFIG_FB_CIRRUS is not set 855# CONFIG_FB_CIRRUS is not set
@@ -954,6 +959,18 @@ CONFIG_SND_ALI5451=m
954# CONFIG_SND_CMIPCI is not set 959# CONFIG_SND_CMIPCI is not set
955# CONFIG_SND_CS4281 is not set 960# CONFIG_SND_CS4281 is not set
956# CONFIG_SND_CS46XX is not set 961# CONFIG_SND_CS46XX is not set
962# CONFIG_SND_DARLA20 is not set
963# CONFIG_SND_GINA20 is not set
964# CONFIG_SND_LAYLA20 is not set
965# CONFIG_SND_DARLA24 is not set
966# CONFIG_SND_GINA24 is not set
967# CONFIG_SND_LAYLA24 is not set
968# CONFIG_SND_MONA is not set
969# CONFIG_SND_MIA is not set
970# CONFIG_SND_ECHO3G is not set
971# CONFIG_SND_INDIGO is not set
972# CONFIG_SND_INDIGOIO is not set
973# CONFIG_SND_INDIGODJ is not set
957# CONFIG_SND_EMU10K1 is not set 974# CONFIG_SND_EMU10K1 is not set
958# CONFIG_SND_EMU10K1X is not set 975# CONFIG_SND_EMU10K1X is not set
959# CONFIG_SND_ENS1370 is not set 976# CONFIG_SND_ENS1370 is not set
@@ -1104,7 +1121,7 @@ CONFIG_USB_HIDDEV=y
1104# CONFIG_USB_LEGOTOWER is not set 1121# CONFIG_USB_LEGOTOWER is not set
1105# CONFIG_USB_LCD is not set 1122# CONFIG_USB_LCD is not set
1106# CONFIG_USB_LED is not set 1123# CONFIG_USB_LED is not set
1107# CONFIG_USB_CY7C63 is not set 1124# CONFIG_USB_CYPRESS_CY7C63 is not set
1108# CONFIG_USB_CYTHERM is not set 1125# CONFIG_USB_CYTHERM is not set
1109# CONFIG_USB_PHIDGETKIT is not set 1126# CONFIG_USB_PHIDGETKIT is not set
1110# CONFIG_USB_PHIDGETSERVO is not set 1127# CONFIG_USB_PHIDGETSERVO is not set
@@ -1331,14 +1348,19 @@ CONFIG_KPROBES=y
1331# 1348#
1332CONFIG_PRINTK_TIME=y 1349CONFIG_PRINTK_TIME=y
1333CONFIG_MAGIC_SYSRQ=y 1350CONFIG_MAGIC_SYSRQ=y
1351# CONFIG_UNUSED_SYMBOLS is not set
1334CONFIG_DEBUG_KERNEL=y 1352CONFIG_DEBUG_KERNEL=y
1335CONFIG_LOG_BUF_SHIFT=18 1353CONFIG_LOG_BUF_SHIFT=18
1336CONFIG_DETECT_SOFTLOCKUP=y 1354CONFIG_DETECT_SOFTLOCKUP=y
1337CONFIG_SCHEDSTATS=y 1355CONFIG_SCHEDSTATS=y
1338# CONFIG_DEBUG_SLAB is not set 1356# CONFIG_DEBUG_SLAB is not set
1339# CONFIG_DEBUG_MUTEXES is not set 1357# CONFIG_DEBUG_RT_MUTEXES is not set
1358# CONFIG_RT_MUTEX_TESTER is not set
1340# CONFIG_DEBUG_SPINLOCK is not set 1359# CONFIG_DEBUG_SPINLOCK is not set
1360# CONFIG_DEBUG_MUTEXES is not set
1361# CONFIG_DEBUG_RWSEMS is not set
1341# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1362# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1363# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1342# CONFIG_DEBUG_KOBJECT is not set 1364# CONFIG_DEBUG_KOBJECT is not set
1343CONFIG_DEBUG_BUGVERBOSE=y 1365CONFIG_DEBUG_BUGVERBOSE=y
1344# CONFIG_DEBUG_INFO is not set 1366# CONFIG_DEBUG_INFO is not set
@@ -1402,3 +1424,4 @@ CONFIG_CRC32=y
1402CONFIG_LIBCRC32C=m 1424CONFIG_LIBCRC32C=m
1403CONFIG_ZLIB_INFLATE=y 1425CONFIG_ZLIB_INFLATE=y
1404CONFIG_ZLIB_DEFLATE=y 1426CONFIG_ZLIB_DEFLATE=y
1427CONFIG_PLIST=y
diff --git a/arch/sparc64/kernel/devices.c b/arch/sparc64/kernel/devices.c
index f8ef2f2b9b37..ec10f7edcf86 100644
--- a/arch/sparc64/kernel/devices.c
+++ b/arch/sparc64/kernel/devices.c
@@ -66,9 +66,6 @@ static int check_cpu_node(struct device_node *dp, int *cur_inst,
66 void *compare_arg, 66 void *compare_arg,
67 struct device_node **dev_node, int *mid) 67 struct device_node **dev_node, int *mid)
68{ 68{
69 if (strcmp(dp->type, "cpu"))
70 return -ENODEV;
71
72 if (!compare(dp, *cur_inst, compare_arg)) { 69 if (!compare(dp, *cur_inst, compare_arg)) {
73 if (dev_node) 70 if (dev_node)
74 *dev_node = dp; 71 *dev_node = dp;
diff --git a/arch/sparc64/kernel/head.S b/arch/sparc64/kernel/head.S
index 75684b56767e..c8e9dc9d68a9 100644
--- a/arch/sparc64/kernel/head.S
+++ b/arch/sparc64/kernel/head.S
@@ -551,9 +551,10 @@ setup_trap_table:
551 save %sp, -192, %sp 551 save %sp, -192, %sp
552 552
553 /* Force interrupts to be disabled. */ 553 /* Force interrupts to be disabled. */
554 rdpr %pstate, %o1 554 rdpr %pstate, %l0
555 andn %o1, PSTATE_IE, %o1 555 andn %l0, PSTATE_IE, %o1
556 wrpr %o1, 0x0, %pstate 556 wrpr %o1, 0x0, %pstate
557 rdpr %pil, %l1
557 wrpr %g0, 15, %pil 558 wrpr %g0, 15, %pil
558 559
559 /* Make the firmware call to jump over to the Linux trap table. */ 560 /* Make the firmware call to jump over to the Linux trap table. */
@@ -622,11 +623,9 @@ setup_trap_table:
622 call init_irqwork_curcpu 623 call init_irqwork_curcpu
623 nop 624 nop
624 625
625 /* Now we can turn interrupts back on. */ 626 /* Now we can restore interrupt state. */
626 rdpr %pstate, %o1 627 wrpr %l0, 0, %pstate
627 or %o1, PSTATE_IE, %o1 628 wrpr %l1, 0x0, %pil
628 wrpr %o1, 0, %pstate
629 wrpr %g0, 0x0, %pil
630 629
631 ret 630 ret
632 restore 631 restore
diff --git a/arch/sparc64/kernel/of_device.c b/arch/sparc64/kernel/of_device.c
index 169b017eec0b..238bbf6de07d 100644
--- a/arch/sparc64/kernel/of_device.c
+++ b/arch/sparc64/kernel/of_device.c
@@ -210,7 +210,7 @@ struct bus_type of_bus_type = {
210}; 210};
211EXPORT_SYMBOL(of_bus_type); 211EXPORT_SYMBOL(of_bus_type);
212 212
213static inline u64 of_read_addr(u32 *cell, int size) 213static inline u64 of_read_addr(const u32 *cell, int size)
214{ 214{
215 u64 r = 0; 215 u64 r = 0;
216 while (size--) 216 while (size--)
@@ -236,8 +236,8 @@ struct of_bus {
236 int (*match)(struct device_node *parent); 236 int (*match)(struct device_node *parent);
237 void (*count_cells)(struct device_node *child, 237 void (*count_cells)(struct device_node *child,
238 int *addrc, int *sizec); 238 int *addrc, int *sizec);
239 u64 (*map)(u32 *addr, u32 *range, int na, int ns, int pna); 239 int (*map)(u32 *addr, const u32 *range,
240 int (*translate)(u32 *addr, u64 offset, int na); 240 int na, int ns, int pna);
241 unsigned int (*get_flags)(u32 *addr); 241 unsigned int (*get_flags)(u32 *addr);
242}; 242};
243 243
@@ -251,27 +251,49 @@ static void of_bus_default_count_cells(struct device_node *dev,
251 get_cells(dev, addrc, sizec); 251 get_cells(dev, addrc, sizec);
252} 252}
253 253
254static u64 of_bus_default_map(u32 *addr, u32 *range, int na, int ns, int pna) 254/* Make sure the least significant 64-bits are in-range. Even
255 * for 3 or 4 cell values it is a good enough approximation.
256 */
257static int of_out_of_range(const u32 *addr, const u32 *base,
258 const u32 *size, int na, int ns)
255{ 259{
256 u64 cp, s, da; 260 u64 a = of_read_addr(addr, na);
261 u64 b = of_read_addr(base, na);
262
263 if (a < b)
264 return 1;
257 265
258 cp = of_read_addr(range, na); 266 b += of_read_addr(size, ns);
259 s = of_read_addr(range + na + pna, ns); 267 if (a >= b)
260 da = of_read_addr(addr, na); 268 return 1;
261 269
262 if (da < cp || da >= (cp + s)) 270 return 0;
263 return OF_BAD_ADDR;
264 return da - cp;
265} 271}
266 272
267static int of_bus_default_translate(u32 *addr, u64 offset, int na) 273static int of_bus_default_map(u32 *addr, const u32 *range,
274 int na, int ns, int pna)
268{ 275{
269 u64 a = of_read_addr(addr, na); 276 u32 result[OF_MAX_ADDR_CELLS];
270 memset(addr, 0, na * 4); 277 int i;
271 a += offset; 278
272 if (na > 1) 279 if (ns > 2) {
273 addr[na - 2] = a >> 32; 280 printk("of_device: Cannot handle size cells (%d) > 2.", ns);
274 addr[na - 1] = a & 0xffffffffu; 281 return -EINVAL;
282 }
283
284 if (of_out_of_range(addr, range, range + na + pna, na, ns))
285 return -EINVAL;
286
287 /* Start with the parent range base. */
288 memcpy(result, range + na, pna * 4);
289
290 /* Add in the child address offset. */
291 for (i = 0; i < na; i++)
292 result[pna - 1 - i] +=
293 (addr[na - 1 - i] -
294 range[na - 1 - i]);
295
296 memcpy(addr, result, pna * 4);
275 297
276 return 0; 298 return 0;
277} 299}
@@ -287,7 +309,20 @@ static unsigned int of_bus_default_get_flags(u32 *addr)
287 309
288static int of_bus_pci_match(struct device_node *np) 310static int of_bus_pci_match(struct device_node *np)
289{ 311{
290 return !strcmp(np->type, "pci") || !strcmp(np->type, "pciex"); 312 if (!strcmp(np->type, "pci") || !strcmp(np->type, "pciex")) {
313 /* Do not do PCI specific frobbing if the
314 * PCI bridge lacks a ranges property. We
315 * want to pass it through up to the next
316 * parent as-is, not with the PCI translate
317 * method which chops off the top address cell.
318 */
319 if (!of_find_property(np, "ranges", NULL))
320 return 0;
321
322 return 1;
323 }
324
325 return 0;
291} 326}
292 327
293static void of_bus_pci_count_cells(struct device_node *np, 328static void of_bus_pci_count_cells(struct device_node *np,
@@ -299,27 +334,32 @@ static void of_bus_pci_count_cells(struct device_node *np,
299 *sizec = 2; 334 *sizec = 2;
300} 335}
301 336
302static u64 of_bus_pci_map(u32 *addr, u32 *range, int na, int ns, int pna) 337static int of_bus_pci_map(u32 *addr, const u32 *range,
338 int na, int ns, int pna)
303{ 339{
304 u64 cp, s, da; 340 u32 result[OF_MAX_ADDR_CELLS];
341 int i;
305 342
306 /* Check address type match */ 343 /* Check address type match */
307 if ((addr[0] ^ range[0]) & 0x03000000) 344 if ((addr[0] ^ range[0]) & 0x03000000)
308 return OF_BAD_ADDR; 345 return -EINVAL;
309 346
310 /* Read address values, skipping high cell */ 347 if (of_out_of_range(addr + 1, range + 1, range + na + pna,
311 cp = of_read_addr(range + 1, na - 1); 348 na - 1, ns))
312 s = of_read_addr(range + na + pna, ns); 349 return -EINVAL;
313 da = of_read_addr(addr + 1, na - 1);
314 350
315 if (da < cp || da >= (cp + s)) 351 /* Start with the parent range base. */
316 return OF_BAD_ADDR; 352 memcpy(result, range + na, pna * 4);
317 return da - cp;
318}
319 353
320static int of_bus_pci_translate(u32 *addr, u64 offset, int na) 354 /* Add in the child address offset, skipping high cell. */
321{ 355 for (i = 0; i < na - 1; i++)
322 return of_bus_default_translate(addr + 1, offset, na - 1); 356 result[pna - 1 - i] +=
357 (addr[na - 1 - i] -
358 range[na - 1 - i]);
359
360 memcpy(addr, result, pna * 4);
361
362 return 0;
323} 363}
324 364
325static unsigned int of_bus_pci_get_flags(u32 *addr) 365static unsigned int of_bus_pci_get_flags(u32 *addr)
@@ -340,59 +380,6 @@ static unsigned int of_bus_pci_get_flags(u32 *addr)
340} 380}
341 381
342/* 382/*
343 * ISA bus specific translator
344 */
345
346static int of_bus_isa_match(struct device_node *np)
347{
348 return !strcmp(np->name, "isa");
349}
350
351static void of_bus_isa_count_cells(struct device_node *child,
352 int *addrc, int *sizec)
353{
354 if (addrc)
355 *addrc = 2;
356 if (sizec)
357 *sizec = 1;
358}
359
360static u64 of_bus_isa_map(u32 *addr, u32 *range, int na, int ns, int pna)
361{
362 u64 cp, s, da;
363
364 /* Check address type match */
365 if ((addr[0] ^ range[0]) & 0x00000001)
366 return OF_BAD_ADDR;
367
368 /* Read address values, skipping high cell */
369 cp = of_read_addr(range + 1, na - 1);
370 s = of_read_addr(range + na + pna, ns);
371 da = of_read_addr(addr + 1, na - 1);
372
373 if (da < cp || da >= (cp + s))
374 return OF_BAD_ADDR;
375 return da - cp;
376}
377
378static int of_bus_isa_translate(u32 *addr, u64 offset, int na)
379{
380 return of_bus_default_translate(addr + 1, offset, na - 1);
381}
382
383static unsigned int of_bus_isa_get_flags(u32 *addr)
384{
385 unsigned int flags = 0;
386 u32 w = addr[0];
387
388 if (w & 1)
389 flags |= IORESOURCE_IO;
390 else
391 flags |= IORESOURCE_MEM;
392 return flags;
393}
394
395/*
396 * SBUS bus specific translator 383 * SBUS bus specific translator
397 */ 384 */
398 385
@@ -411,16 +398,11 @@ static void of_bus_sbus_count_cells(struct device_node *child,
411 *sizec = 1; 398 *sizec = 1;
412} 399}
413 400
414static u64 of_bus_sbus_map(u32 *addr, u32 *range, int na, int ns, int pna) 401static int of_bus_sbus_map(u32 *addr, const u32 *range, int na, int ns, int pna)
415{ 402{
416 return of_bus_default_map(addr, range, na, ns, pna); 403 return of_bus_default_map(addr, range, na, ns, pna);
417} 404}
418 405
419static int of_bus_sbus_translate(u32 *addr, u64 offset, int na)
420{
421 return of_bus_default_translate(addr, offset, na);
422}
423
424static unsigned int of_bus_sbus_get_flags(u32 *addr) 406static unsigned int of_bus_sbus_get_flags(u32 *addr)
425{ 407{
426 return IORESOURCE_MEM; 408 return IORESOURCE_MEM;
@@ -439,19 +421,8 @@ static struct of_bus of_busses[] = {
439 .match = of_bus_pci_match, 421 .match = of_bus_pci_match,
440 .count_cells = of_bus_pci_count_cells, 422 .count_cells = of_bus_pci_count_cells,
441 .map = of_bus_pci_map, 423 .map = of_bus_pci_map,
442 .translate = of_bus_pci_translate,
443 .get_flags = of_bus_pci_get_flags, 424 .get_flags = of_bus_pci_get_flags,
444 }, 425 },
445 /* ISA */
446 {
447 .name = "isa",
448 .addr_prop_name = "reg",
449 .match = of_bus_isa_match,
450 .count_cells = of_bus_isa_count_cells,
451 .map = of_bus_isa_map,
452 .translate = of_bus_isa_translate,
453 .get_flags = of_bus_isa_get_flags,
454 },
455 /* SBUS */ 426 /* SBUS */
456 { 427 {
457 .name = "sbus", 428 .name = "sbus",
@@ -459,7 +430,6 @@ static struct of_bus of_busses[] = {
459 .match = of_bus_sbus_match, 430 .match = of_bus_sbus_match,
460 .count_cells = of_bus_sbus_count_cells, 431 .count_cells = of_bus_sbus_count_cells,
461 .map = of_bus_sbus_map, 432 .map = of_bus_sbus_map,
462 .translate = of_bus_sbus_translate,
463 .get_flags = of_bus_sbus_get_flags, 433 .get_flags = of_bus_sbus_get_flags,
464 }, 434 },
465 /* Default */ 435 /* Default */
@@ -469,7 +439,6 @@ static struct of_bus of_busses[] = {
469 .match = NULL, 439 .match = NULL,
470 .count_cells = of_bus_default_count_cells, 440 .count_cells = of_bus_default_count_cells,
471 .map = of_bus_default_map, 441 .map = of_bus_default_map,
472 .translate = of_bus_default_translate,
473 .get_flags = of_bus_default_get_flags, 442 .get_flags = of_bus_default_get_flags,
474 }, 443 },
475}; 444};
@@ -494,33 +463,62 @@ static int __init build_one_resource(struct device_node *parent,
494 u32 *ranges; 463 u32 *ranges;
495 unsigned int rlen; 464 unsigned int rlen;
496 int rone; 465 int rone;
497 u64 offset = OF_BAD_ADDR;
498 466
499 ranges = of_get_property(parent, "ranges", &rlen); 467 ranges = of_get_property(parent, "ranges", &rlen);
500 if (ranges == NULL || rlen == 0) { 468 if (ranges == NULL || rlen == 0) {
501 offset = of_read_addr(addr, na); 469 u32 result[OF_MAX_ADDR_CELLS];
502 memset(addr, 0, pna * 4); 470 int i;
503 goto finish; 471
472 memset(result, 0, pna * 4);
473 for (i = 0; i < na; i++)
474 result[pna - 1 - i] =
475 addr[na - 1 - i];
476
477 memcpy(addr, result, pna * 4);
478 return 0;
504 } 479 }
505 480
506 /* Now walk through the ranges */ 481 /* Now walk through the ranges */
507 rlen /= 4; 482 rlen /= 4;
508 rone = na + pna + ns; 483 rone = na + pna + ns;
509 for (; rlen >= rone; rlen -= rone, ranges += rone) { 484 for (; rlen >= rone; rlen -= rone, ranges += rone) {
510 offset = bus->map(addr, ranges, na, ns, pna); 485 if (!bus->map(addr, ranges, na, ns, pna))
511 if (offset != OF_BAD_ADDR) 486 return 0;
512 break;
513 } 487 }
514 if (offset == OF_BAD_ADDR) 488
489 return 1;
490}
491
492static int __init use_1to1_mapping(struct device_node *pp)
493{
494 char *model;
495
496 /* If this is on the PMU bus, don't try to translate it even
497 * if a ranges property exists.
498 */
499 if (!strcmp(pp->name, "pmu"))
515 return 1; 500 return 1;
516 501
517 memcpy(addr, ranges + na, 4 * pna); 502 /* If we have a ranges property in the parent, use it. */
503 if (of_find_property(pp, "ranges", NULL) != NULL)
504 return 0;
505
506 /* If the parent is the dma node of an ISA bus, pass
507 * the translation up to the root.
508 */
509 if (!strcmp(pp->name, "dma"))
510 return 0;
511
512 /* Similarly for Simba PCI bridges. */
513 model = of_get_property(pp, "model", NULL);
514 if (model && !strcmp(model, "SUNW,simba"))
515 return 0;
518 516
519finish: 517 return 1;
520 /* Translate it into parent bus space */
521 return pbus->translate(addr, offset, pna);
522} 518}
523 519
520static int of_resource_verbose;
521
524static void __init build_device_resources(struct of_device *op, 522static void __init build_device_resources(struct of_device *op,
525 struct device *parent) 523 struct device *parent)
526{ 524{
@@ -544,9 +542,17 @@ static void __init build_device_resources(struct of_device *op,
544 /* Convert to num-cells. */ 542 /* Convert to num-cells. */
545 num_reg /= 4; 543 num_reg /= 4;
546 544
547 /* Conver to num-entries. */ 545 /* Convert to num-entries. */
548 num_reg /= na + ns; 546 num_reg /= na + ns;
549 547
548 /* Prevent overruning the op->resources[] array. */
549 if (num_reg > PROMREG_MAX) {
550 printk(KERN_WARNING "%s: Too many regs (%d), "
551 "limiting to %d.\n",
552 op->node->full_name, num_reg, PROMREG_MAX);
553 num_reg = PROMREG_MAX;
554 }
555
550 for (index = 0; index < num_reg; index++) { 556 for (index = 0; index < num_reg; index++) {
551 struct resource *r = &op->resource[index]; 557 struct resource *r = &op->resource[index];
552 u32 addr[OF_MAX_ADDR_CELLS]; 558 u32 addr[OF_MAX_ADDR_CELLS];
@@ -564,15 +570,7 @@ static void __init build_device_resources(struct of_device *op,
564 570
565 memcpy(addr, reg, na * 4); 571 memcpy(addr, reg, na * 4);
566 572
567 /* If the immediate parent has no ranges property to apply, 573 if (use_1to1_mapping(pp)) {
568 * just use a 1<->1 mapping. Unless it is the 'dma' child
569 * of an isa bus, which must be passed up towards the root.
570 *
571 * Also, don't try to translate PMU bus device registers.
572 */
573 if ((of_find_property(pp, "ranges", NULL) == NULL &&
574 strcmp(pp->name, "dma") != 0) ||
575 !strcmp(pp->name, "pmu")) {
576 result = of_read_addr(addr, na); 574 result = of_read_addr(addr, na);
577 goto build_res; 575 goto build_res;
578 } 576 }
@@ -591,7 +589,8 @@ static void __init build_device_resources(struct of_device *op,
591 pbus = of_match_bus(pp); 589 pbus = of_match_bus(pp);
592 pbus->count_cells(dp, &pna, &pns); 590 pbus->count_cells(dp, &pna, &pns);
593 591
594 if (build_one_resource(dp, bus, pbus, addr, dna, dns, pna)) 592 if (build_one_resource(dp, bus, pbus, addr,
593 dna, dns, pna))
595 break; 594 break;
596 595
597 dna = pna; 596 dna = pna;
@@ -601,6 +600,12 @@ static void __init build_device_resources(struct of_device *op,
601 600
602 build_res: 601 build_res:
603 memset(r, 0, sizeof(*r)); 602 memset(r, 0, sizeof(*r));
603
604 if (of_resource_verbose)
605 printk("%s reg[%d] -> %lx\n",
606 op->node->full_name, index,
607 result);
608
604 if (result != OF_BAD_ADDR) { 609 if (result != OF_BAD_ADDR) {
605 if (tlb_type == hypervisor) 610 if (tlb_type == hypervisor)
606 result &= 0x0fffffffffffffffUL; 611 result &= 0x0fffffffffffffffUL;
@@ -653,8 +658,22 @@ apply_interrupt_map(struct device_node *dp, struct device_node *pp,
653 next: 658 next:
654 imap += (na + 3); 659 imap += (na + 3);
655 } 660 }
656 if (i == imlen) 661 if (i == imlen) {
662 /* Psycho and Sabre PCI controllers can have 'interrupt-map'
663 * properties that do not include the on-board device
664 * interrupts. Instead, the device's 'interrupts' property
665 * is already a fully specified INO value.
666 *
667 * Handle this by deciding that, if we didn't get a
668 * match in the parent's 'interrupt-map', and the
669 * parent is an IRQ translater, then use the parent as
670 * our IRQ controller.
671 */
672 if (pp->irq_trans)
673 return pp;
674
657 return NULL; 675 return NULL;
676 }
658 677
659 *irq_p = irq; 678 *irq_p = irq;
660 cp = of_find_node_by_phandle(handle); 679 cp = of_find_node_by_phandle(handle);
@@ -684,6 +703,8 @@ static unsigned int __init pci_irq_swizzle(struct device_node *dp,
684 return ret; 703 return ret;
685} 704}
686 705
706static int of_irq_verbose;
707
687static unsigned int __init build_one_device_irq(struct of_device *op, 708static unsigned int __init build_one_device_irq(struct of_device *op,
688 struct device *parent, 709 struct device *parent,
689 unsigned int irq) 710 unsigned int irq)
@@ -698,10 +719,11 @@ static unsigned int __init build_one_device_irq(struct of_device *op,
698 if (dp->irq_trans) { 719 if (dp->irq_trans) {
699 irq = dp->irq_trans->irq_build(dp, irq, 720 irq = dp->irq_trans->irq_build(dp, irq,
700 dp->irq_trans->data); 721 dp->irq_trans->data);
701#if 1 722
702 printk("%s: direct translate %x --> %x\n", 723 if (of_irq_verbose)
703 dp->full_name, orig_irq, irq); 724 printk("%s: direct translate %x --> %x\n",
704#endif 725 dp->full_name, orig_irq, irq);
726
705 return irq; 727 return irq;
706 } 728 }
707 729
@@ -728,12 +750,13 @@ static unsigned int __init build_one_device_irq(struct of_device *op,
728 iret = apply_interrupt_map(dp, pp, 750 iret = apply_interrupt_map(dp, pp,
729 imap, imlen, imsk, 751 imap, imlen, imsk,
730 &irq); 752 &irq);
731#if 1 753
732 printk("%s: Apply [%s:%x] imap --> [%s:%x]\n", 754 if (of_irq_verbose)
733 op->node->full_name, 755 printk("%s: Apply [%s:%x] imap --> [%s:%x]\n",
734 pp->full_name, this_orig_irq, 756 op->node->full_name,
735 (iret ? iret->full_name : "NULL"), irq); 757 pp->full_name, this_orig_irq,
736#endif 758 (iret ? iret->full_name : "NULL"), irq);
759
737 if (!iret) 760 if (!iret)
738 break; 761 break;
739 762
@@ -747,11 +770,13 @@ static unsigned int __init build_one_device_irq(struct of_device *op,
747 unsigned int this_orig_irq = irq; 770 unsigned int this_orig_irq = irq;
748 771
749 irq = pci_irq_swizzle(dp, pp, irq); 772 irq = pci_irq_swizzle(dp, pp, irq);
750#if 1 773 if (of_irq_verbose)
751 printk("%s: PCI swizzle [%s] %x --> %x\n", 774 printk("%s: PCI swizzle [%s] "
752 op->node->full_name, 775 "%x --> %x\n",
753 pp->full_name, this_orig_irq, irq); 776 op->node->full_name,
754#endif 777 pp->full_name, this_orig_irq,
778 irq);
779
755 } 780 }
756 781
757 if (pp->irq_trans) { 782 if (pp->irq_trans) {
@@ -767,10 +792,9 @@ static unsigned int __init build_one_device_irq(struct of_device *op,
767 792
768 irq = ip->irq_trans->irq_build(op->node, irq, 793 irq = ip->irq_trans->irq_build(op->node, irq,
769 ip->irq_trans->data); 794 ip->irq_trans->data);
770#if 1 795 if (of_irq_verbose)
771 printk("%s: Apply IRQ trans [%s] %x --> %x\n", 796 printk("%s: Apply IRQ trans [%s] %x --> %x\n",
772 op->node->full_name, ip->full_name, orig_irq, irq); 797 op->node->full_name, ip->full_name, orig_irq, irq);
773#endif
774 798
775 return irq; 799 return irq;
776} 800}
@@ -801,6 +825,14 @@ static struct of_device * __init scan_one_device(struct device_node *dp,
801 op->num_irqs = 0; 825 op->num_irqs = 0;
802 } 826 }
803 827
828 /* Prevent overruning the op->irqs[] array. */
829 if (op->num_irqs > PROMINTR_MAX) {
830 printk(KERN_WARNING "%s: Too many irqs (%d), "
831 "limiting to %d.\n",
832 dp->full_name, op->num_irqs, PROMINTR_MAX);
833 op->num_irqs = PROMINTR_MAX;
834 }
835
804 build_device_resources(op, parent); 836 build_device_resources(op, parent);
805 for (i = 0; i < op->num_irqs; i++) 837 for (i = 0; i < op->num_irqs; i++)
806 op->irqs[i] = build_one_device_irq(op, parent, op->irqs[i]); 838 op->irqs[i] = build_one_device_irq(op, parent, op->irqs[i]);
@@ -870,6 +902,20 @@ static int __init of_bus_driver_init(void)
870 902
871postcore_initcall(of_bus_driver_init); 903postcore_initcall(of_bus_driver_init);
872 904
905static int __init of_debug(char *str)
906{
907 int val = 0;
908
909 get_option(&str, &val);
910 if (val & 1)
911 of_resource_verbose = 1;
912 if (val & 2)
913 of_irq_verbose = 1;
914 return 1;
915}
916
917__setup("of_debug=", of_debug);
918
873int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus) 919int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus)
874{ 920{
875 /* initialize common driver fields */ 921 /* initialize common driver fields */
@@ -922,9 +968,11 @@ int of_device_register(struct of_device *ofdev)
922 if (rc) 968 if (rc)
923 return rc; 969 return rc;
924 970
925 device_create_file(&ofdev->dev, &dev_attr_devspec); 971 rc = device_create_file(&ofdev->dev, &dev_attr_devspec);
972 if (rc)
973 device_unregister(&ofdev->dev);
926 974
927 return 0; 975 return rc;
928} 976}
929 977
930void of_device_unregister(struct of_device *ofdev) 978void of_device_unregister(struct of_device *ofdev)
diff --git a/arch/sparc64/kernel/pci_psycho.c b/arch/sparc64/kernel/pci_psycho.c
index 197a7ffd57ee..1ec0aab68c08 100644
--- a/arch/sparc64/kernel/pci_psycho.c
+++ b/arch/sparc64/kernel/pci_psycho.c
@@ -1099,9 +1099,6 @@ static void pbm_register_toplevel_resources(struct pci_controller_info *p,
1099{ 1099{
1100 char *name = pbm->name; 1100 char *name = pbm->name;
1101 1101
1102 sprintf(name, "PSYCHO%d PBM%c",
1103 p->index,
1104 (pbm == &p->pbm_A ? 'A' : 'B'));
1105 pbm->io_space.name = pbm->mem_space.name = name; 1102 pbm->io_space.name = pbm->mem_space.name = name;
1106 1103
1107 request_resource(&ioport_resource, &pbm->io_space); 1104 request_resource(&ioport_resource, &pbm->io_space);
@@ -1203,12 +1200,13 @@ static void psycho_pbm_init(struct pci_controller_info *p,
1203 pbm->io_space.flags = IORESOURCE_IO; 1200 pbm->io_space.flags = IORESOURCE_IO;
1204 pbm->mem_space.end = pbm->mem_space.start + PSYCHO_MEMSPACE_SIZE; 1201 pbm->mem_space.end = pbm->mem_space.start + PSYCHO_MEMSPACE_SIZE;
1205 pbm->mem_space.flags = IORESOURCE_MEM; 1202 pbm->mem_space.flags = IORESOURCE_MEM;
1206 pbm_register_toplevel_resources(p, pbm);
1207 1203
1208 pbm->parent = p; 1204 pbm->parent = p;
1209 pbm->prom_node = dp; 1205 pbm->prom_node = dp;
1210 pbm->name = dp->full_name; 1206 pbm->name = dp->full_name;
1211 1207
1208 pbm_register_toplevel_resources(p, pbm);
1209
1212 printk("%s: PSYCHO PCI Bus Module ver[%x:%x]\n", 1210 printk("%s: PSYCHO PCI Bus Module ver[%x:%x]\n",
1213 pbm->name, 1211 pbm->name,
1214 pbm->chip_version, pbm->chip_revision); 1212 pbm->chip_version, pbm->chip_revision);
diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c
index fa484d4f241e..5cc5ab63293f 100644
--- a/arch/sparc64/kernel/prom.c
+++ b/arch/sparc64/kernel/prom.c
@@ -344,10 +344,12 @@ static unsigned long __psycho_onboard_imap_off[] = {
344/*0x2f*/ PSYCHO_IMAP_CE, 344/*0x2f*/ PSYCHO_IMAP_CE,
345/*0x30*/ PSYCHO_IMAP_A_ERR, 345/*0x30*/ PSYCHO_IMAP_A_ERR,
346/*0x31*/ PSYCHO_IMAP_B_ERR, 346/*0x31*/ PSYCHO_IMAP_B_ERR,
347/*0x32*/ PSYCHO_IMAP_PMGMT 347/*0x32*/ PSYCHO_IMAP_PMGMT,
348/*0x33*/ PSYCHO_IMAP_GFX,
349/*0x34*/ PSYCHO_IMAP_EUPA,
348}; 350};
349#define PSYCHO_ONBOARD_IRQ_BASE 0x20 351#define PSYCHO_ONBOARD_IRQ_BASE 0x20
350#define PSYCHO_ONBOARD_IRQ_LAST 0x32 352#define PSYCHO_ONBOARD_IRQ_LAST 0x34
351#define psycho_onboard_imap_offset(__ino) \ 353#define psycho_onboard_imap_offset(__ino) \
352 __psycho_onboard_imap_off[(__ino) - PSYCHO_ONBOARD_IRQ_BASE] 354 __psycho_onboard_imap_off[(__ino) - PSYCHO_ONBOARD_IRQ_BASE]
353 355
@@ -529,6 +531,10 @@ static unsigned long __sabre_onboard_imap_off[] = {
529/*0x2e*/ SABRE_IMAP_UE, 531/*0x2e*/ SABRE_IMAP_UE,
530/*0x2f*/ SABRE_IMAP_CE, 532/*0x2f*/ SABRE_IMAP_CE,
531/*0x30*/ SABRE_IMAP_PCIERR, 533/*0x30*/ SABRE_IMAP_PCIERR,
534/*0x31*/ 0 /* reserved */,
535/*0x32*/ 0 /* reserved */,
536/*0x33*/ SABRE_IMAP_GFX,
537/*0x34*/ SABRE_IMAP_EUPA,
532}; 538};
533#define SABRE_ONBOARD_IRQ_BASE 0x20 539#define SABRE_ONBOARD_IRQ_BASE 0x20
534#define SABRE_ONBOARD_IRQ_LAST 0x30 540#define SABRE_ONBOARD_IRQ_LAST 0x30
@@ -539,6 +545,45 @@ static unsigned long __sabre_onboard_imap_off[] = {
539 ((ino & 0x20) ? (SABRE_ICLR_SCSI + (((ino) & 0x1f) << 3)) : \ 545 ((ino & 0x20) ? (SABRE_ICLR_SCSI + (((ino) & 0x1f) << 3)) : \
540 (SABRE_ICLR_A_SLOT0 + (((ino) & 0x1f)<<3))) 546 (SABRE_ICLR_A_SLOT0 + (((ino) & 0x1f)<<3)))
541 547
548static int sabre_device_needs_wsync(struct device_node *dp)
549{
550 struct device_node *parent = dp->parent;
551 char *parent_model, *parent_compat;
552
553 /* This traversal up towards the root is meant to
554 * handle two cases:
555 *
556 * 1) non-PCI bus sitting under PCI, such as 'ebus'
557 * 2) the PCI controller interrupts themselves, which
558 * will use the sabre_irq_build but do not need
559 * the DMA synchronization handling
560 */
561 while (parent) {
562 if (!strcmp(parent->type, "pci"))
563 break;
564 parent = parent->parent;
565 }
566
567 if (!parent)
568 return 0;
569
570 parent_model = of_get_property(parent,
571 "model", NULL);
572 if (parent_model &&
573 (!strcmp(parent_model, "SUNW,sabre") ||
574 !strcmp(parent_model, "SUNW,simba")))
575 return 0;
576
577 parent_compat = of_get_property(parent,
578 "compatible", NULL);
579 if (parent_compat &&
580 (!strcmp(parent_compat, "pci108e,a000") ||
581 !strcmp(parent_compat, "pci108e,a001")))
582 return 0;
583
584 return 1;
585}
586
542static unsigned int sabre_irq_build(struct device_node *dp, 587static unsigned int sabre_irq_build(struct device_node *dp,
543 unsigned int ino, 588 unsigned int ino,
544 void *_data) 589 void *_data)
@@ -577,15 +622,17 @@ static unsigned int sabre_irq_build(struct device_node *dp,
577 622
578 virt_irq = build_irq(inofixup, iclr, imap); 623 virt_irq = build_irq(inofixup, iclr, imap);
579 624
625 /* If the parent device is a PCI<->PCI bridge other than
626 * APB, we have to install a pre-handler to ensure that
627 * all pending DMA is drained before the interrupt handler
628 * is run.
629 */
580 regs = of_get_property(dp, "reg", NULL); 630 regs = of_get_property(dp, "reg", NULL);
581 if (regs && 631 if (regs && sabre_device_needs_wsync(dp)) {
582 ((regs->phys_hi >> 16) & 0xff) != irq_data->pci_first_busno) {
583 irq_install_pre_handler(virt_irq, 632 irq_install_pre_handler(virt_irq,
584 sabre_wsync_handler, 633 sabre_wsync_handler,
585 (void *) (long) regs->phys_hi, 634 (void *) (long) regs->phys_hi,
586 (void *) 635 (void *) irq_data);
587 controller_regs +
588 SABRE_WRSYNC);
589 } 636 }
590 637
591 return virt_irq; 638 return virt_irq;
@@ -854,6 +901,8 @@ static unsigned long sysio_irq_offsets[] = {
854 SYSIO_IMAP_CE, 901 SYSIO_IMAP_CE,
855 SYSIO_IMAP_SBERR, 902 SYSIO_IMAP_SBERR,
856 SYSIO_IMAP_PMGMT, 903 SYSIO_IMAP_PMGMT,
904 SYSIO_IMAP_GFX,
905 SYSIO_IMAP_EUPA,
857}; 906};
858 907
859#undef bogon 908#undef bogon
@@ -1032,7 +1081,9 @@ static void sun4v_vdev_irq_trans_init(struct device_node *dp)
1032static void irq_trans_init(struct device_node *dp) 1081static void irq_trans_init(struct device_node *dp)
1033{ 1082{
1034 const char *model; 1083 const char *model;
1084#ifdef CONFIG_PCI
1035 int i; 1085 int i;
1086#endif
1036 1087
1037 model = of_get_property(dp, "model", NULL); 1088 model = of_get_property(dp, "model", NULL);
1038 if (!model) 1089 if (!model)
diff --git a/arch/sparc64/kernel/setup.c b/arch/sparc64/kernel/setup.c
index a73140466e01..958287448cfe 100644
--- a/arch/sparc64/kernel/setup.c
+++ b/arch/sparc64/kernel/setup.c
@@ -16,7 +16,7 @@
16#include <asm/smp.h> 16#include <asm/smp.h>
17#include <linux/user.h> 17#include <linux/user.h>
18#include <linux/a.out.h> 18#include <linux/a.out.h>
19#include <linux/tty.h> 19#include <linux/screen_info.h>
20#include <linux/delay.h> 20#include <linux/delay.h>
21#include <linux/fs.h> 21#include <linux/fs.h>
22#include <linux/seq_file.h> 22#include <linux/seq_file.h>
diff --git a/arch/sparc64/kernel/sparc64_ksyms.c b/arch/sparc64/kernel/sparc64_ksyms.c
index 4173de425f09..beffc82a1e85 100644
--- a/arch/sparc64/kernel/sparc64_ksyms.c
+++ b/arch/sparc64/kernel/sparc64_ksyms.c
@@ -124,11 +124,6 @@ EXPORT_SYMBOL(__write_lock);
124EXPORT_SYMBOL(__write_unlock); 124EXPORT_SYMBOL(__write_unlock);
125EXPORT_SYMBOL(__write_trylock); 125EXPORT_SYMBOL(__write_trylock);
126 126
127#if defined(CONFIG_MCOUNT)
128extern void _mcount(void);
129EXPORT_SYMBOL(_mcount);
130#endif
131
132/* CPU online map and active count. */ 127/* CPU online map and active count. */
133EXPORT_SYMBOL(cpu_online_map); 128EXPORT_SYMBOL(cpu_online_map);
134EXPORT_SYMBOL(phys_cpu_present_map); 129EXPORT_SYMBOL(phys_cpu_present_map);
@@ -136,6 +131,11 @@ EXPORT_SYMBOL(phys_cpu_present_map);
136EXPORT_SYMBOL(smp_call_function); 131EXPORT_SYMBOL(smp_call_function);
137#endif /* CONFIG_SMP */ 132#endif /* CONFIG_SMP */
138 133
134#if defined(CONFIG_MCOUNT)
135extern void _mcount(void);
136EXPORT_SYMBOL(_mcount);
137#endif
138
139EXPORT_SYMBOL(sparc64_get_clock_tick); 139EXPORT_SYMBOL(sparc64_get_clock_tick);
140 140
141/* semaphores */ 141/* semaphores */
@@ -254,7 +254,6 @@ EXPORT_SYMBOL(prom_getproperty);
254EXPORT_SYMBOL(prom_node_has_property); 254EXPORT_SYMBOL(prom_node_has_property);
255EXPORT_SYMBOL(prom_setprop); 255EXPORT_SYMBOL(prom_setprop);
256EXPORT_SYMBOL(saved_command_line); 256EXPORT_SYMBOL(saved_command_line);
257EXPORT_SYMBOL(prom_getname);
258EXPORT_SYMBOL(prom_finddevice); 257EXPORT_SYMBOL(prom_finddevice);
259EXPORT_SYMBOL(prom_feval); 258EXPORT_SYMBOL(prom_feval);
260EXPORT_SYMBOL(prom_getbool); 259EXPORT_SYMBOL(prom_getbool);
diff --git a/arch/sparc64/kernel/sys_sparc.c b/arch/sparc64/kernel/sys_sparc.c
index 51c056df528e..054d0abdb7ee 100644
--- a/arch/sparc64/kernel/sys_sparc.c
+++ b/arch/sparc64/kernel/sys_sparc.c
@@ -701,21 +701,21 @@ extern void check_pending(int signum);
701 701
702asmlinkage long sys_getdomainname(char __user *name, int len) 702asmlinkage long sys_getdomainname(char __user *name, int len)
703{ 703{
704 int nlen; 704 int nlen, err;
705 int err = -EFAULT; 705
706 if (len < 0 || len > __NEW_UTS_LEN)
707 return -EINVAL;
706 708
707 down_read(&uts_sem); 709 down_read(&uts_sem);
708 710
709 nlen = strlen(system_utsname.domainname) + 1; 711 nlen = strlen(system_utsname.domainname) + 1;
710
711 if (nlen < len) 712 if (nlen < len)
712 len = nlen; 713 len = nlen;
713 if (len > __NEW_UTS_LEN) 714
714 goto done; 715 err = -EFAULT;
715 if (copy_to_user(name, system_utsname.domainname, len)) 716 if (!copy_to_user(name, system_utsname.domainname, len))
716 goto done; 717 err = 0;
717 err = 0; 718
718done:
719 up_read(&uts_sem); 719 up_read(&uts_sem);
720 return err; 720 return err;
721} 721}
diff --git a/arch/sparc64/kernel/time.c b/arch/sparc64/kernel/time.c
index 8dcbfbffacc9..094d3e35be18 100644
--- a/arch/sparc64/kernel/time.c
+++ b/arch/sparc64/kernel/time.c
@@ -788,12 +788,15 @@ static int __devinit clock_probe(struct of_device *op, const struct of_device_id
788 if (!regs) 788 if (!regs)
789 return -ENOMEM; 789 return -ENOMEM;
790 790
791#ifdef CONFIG_PCI
791 if (!strcmp(model, "ds1287") || 792 if (!strcmp(model, "ds1287") ||
792 !strcmp(model, "m5819") || 793 !strcmp(model, "m5819") ||
793 !strcmp(model, "m5819p") || 794 !strcmp(model, "m5819p") ||
794 !strcmp(model, "m5823")) { 795 !strcmp(model, "m5823")) {
795 ds1287_regs = (unsigned long) regs; 796 ds1287_regs = (unsigned long) regs;
796 } else if (model[5] == '0' && model[6] == '2') { 797 } else
798#endif
799 if (model[5] == '0' && model[6] == '2') {
797 mstk48t02_regs = regs; 800 mstk48t02_regs = regs;
798 } else if(model[5] == '0' && model[6] == '8') { 801 } else if(model[5] == '0' && model[6] == '8') {
799 mstk48t08_regs = regs; 802 mstk48t08_regs = regs;
@@ -925,8 +928,6 @@ static void sparc64_start_timers(void)
925 __asm__ __volatile__("wrpr %0, 0x0, %%pstate" 928 __asm__ __volatile__("wrpr %0, 0x0, %%pstate"
926 : /* no outputs */ 929 : /* no outputs */
927 : "r" (pstate)); 930 : "r" (pstate));
928
929 local_irq_enable();
930} 931}
931 932
932struct freq_table { 933struct freq_table {
diff --git a/arch/sparc64/mm/fault.c b/arch/sparc64/mm/fault.c
index 1605967cce91..55ae802dc0ad 100644
--- a/arch/sparc64/mm/fault.c
+++ b/arch/sparc64/mm/fault.c
@@ -19,6 +19,7 @@
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/interrupt.h> 20#include <linux/interrupt.h>
21#include <linux/kprobes.h> 21#include <linux/kprobes.h>
22#include <linux/kallsyms.h>
22 23
23#include <asm/page.h> 24#include <asm/page.h>
24#include <asm/pgtable.h> 25#include <asm/pgtable.h>
@@ -132,6 +133,8 @@ static void bad_kernel_pc(struct pt_regs *regs, unsigned long vaddr)
132 133
133 printk(KERN_CRIT "OOPS: Bogus kernel PC [%016lx] in fault handler\n", 134 printk(KERN_CRIT "OOPS: Bogus kernel PC [%016lx] in fault handler\n",
134 regs->tpc); 135 regs->tpc);
136 printk(KERN_CRIT "OOPS: RPC [%016lx]\n", regs->u_regs[15]);
137 print_symbol("RPC: <%s>\n", regs->u_regs[15]);
135 printk(KERN_CRIT "OOPS: Fault was to vaddr[%lx]\n", vaddr); 138 printk(KERN_CRIT "OOPS: Fault was to vaddr[%lx]\n", vaddr);
136 __asm__("mov %%sp, %0" : "=r" (ksp)); 139 __asm__("mov %%sp, %0" : "=r" (ksp));
137 show_stack(current, ksp); 140 show_stack(current, ksp);
diff --git a/arch/sparc64/prom/tree.c b/arch/sparc64/prom/tree.c
index 49075abd7cbc..500f05e2cfcb 100644
--- a/arch/sparc64/prom/tree.c
+++ b/arch/sparc64/prom/tree.c
@@ -193,91 +193,6 @@ prom_searchsiblings(int node_start, const char *nodename)
193 return 0; 193 return 0;
194} 194}
195 195
196/* Gets name in the {name@x,yyyyy|name (if no reg)} form */
197int
198prom_getname (int node, char *buffer, int len)
199{
200 int i, sbus = 0;
201 int pci = 0, ebus = 0, ide = 0;
202 struct linux_prom_registers *reg;
203 struct linux_prom64_registers reg64[PROMREG_MAX];
204
205 for (sbus = prom_getparent (node); sbus; sbus = prom_getparent (sbus)) {
206 i = prom_getproperty (sbus, "name", buffer, len);
207 if (i > 0) {
208 buffer [i] = 0;
209 if (!strcmp (buffer, "sbus"))
210 goto getit;
211 }
212 }
213 if ((pci = prom_getparent (node))) {
214 i = prom_getproperty (pci, "name", buffer, len);
215 if (i > 0) {
216 buffer [i] = 0;
217 if (!strcmp (buffer, "pci"))
218 goto getit;
219 }
220 pci = 0;
221 }
222 if ((ebus = prom_getparent (node))) {
223 i = prom_getproperty (ebus, "name", buffer, len);
224 if (i > 0) {
225 buffer[i] = 0;
226 if (!strcmp (buffer, "ebus"))
227 goto getit;
228 }
229 ebus = 0;
230 }
231 if ((ide = prom_getparent (node))) {
232 i = prom_getproperty (ide, "name", buffer, len);
233 if (i > 0) {
234 buffer [i] = 0;
235 if (!strcmp (buffer, "ide"))
236 goto getit;
237 }
238 ide = 0;
239 }
240getit:
241 i = prom_getproperty (node, "name", buffer, len);
242 if (i <= 0) {
243 buffer [0] = 0;
244 return -1;
245 }
246 buffer [i] = 0;
247 len -= i;
248 i = prom_getproperty (node, "reg", (char *)reg64, sizeof (reg64));
249 if (i <= 0) return 0;
250 if (len < 16) return -1;
251 buffer = strchr (buffer, 0);
252 if (sbus) {
253 reg = (struct linux_prom_registers *)reg64;
254 sprintf (buffer, "@%x,%x", reg[0].which_io, (uint)reg[0].phys_addr);
255 } else if (pci) {
256 int dev, fn;
257 reg = (struct linux_prom_registers *)reg64;
258 fn = (reg[0].which_io >> 8) & 0x07;
259 dev = (reg[0].which_io >> 11) & 0x1f;
260 if (fn)
261 sprintf (buffer, "@%x,%x", dev, fn);
262 else
263 sprintf (buffer, "@%x", dev);
264 } else if (ebus) {
265 reg = (struct linux_prom_registers *)reg64;
266 sprintf (buffer, "@%x,%x", reg[0].which_io, reg[0].phys_addr);
267 } else if (ide) {
268 reg = (struct linux_prom_registers *)reg64;
269 sprintf (buffer, "@%x,%x", reg[0].which_io, reg[0].phys_addr);
270 } else if (i == 4) { /* Happens on 8042's children on Ultra/PCI. */
271 reg = (struct linux_prom_registers *)reg64;
272 sprintf (buffer, "@%x", reg[0].which_io);
273 } else {
274 sprintf (buffer, "@%x,%x",
275 (unsigned int)(reg64[0].phys_addr >> 36),
276 (unsigned int)(reg64[0].phys_addr));
277 }
278 return 0;
279}
280
281/* Return the first property type for node 'node'. 196/* Return the first property type for node 'node'.
282 * buffer should be at least 32B in length 197 * buffer should be at least 32B in length
283 */ 198 */
diff --git a/arch/um/Kconfig.debug b/arch/um/Kconfig.debug
index bab51d619173..09c1aca6339f 100644
--- a/arch/um/Kconfig.debug
+++ b/arch/um/Kconfig.debug
@@ -47,13 +47,4 @@ config GCOV
47 If you're involved in UML kernel development and want to use gcov, 47 If you're involved in UML kernel development and want to use gcov,
48 say Y. If you're unsure, say N. 48 say Y. If you're unsure, say N.
49 49
50config SYSCALL_DEBUG
51 bool "Enable system call debugging"
52 depends on DEBUG_INFO
53 help
54 This adds some system debugging to UML, including keeping a ring buffer
55 with recent system calls and some global and per-task statistics.
56
57 If unsure, say N
58
59endmenu 50endmenu
diff --git a/arch/um/Makefile-x86_64 b/arch/um/Makefile-x86_64
index dffd1184c956..9558a7cf34d5 100644
--- a/arch/um/Makefile-x86_64
+++ b/arch/um/Makefile-x86_64
@@ -11,6 +11,7 @@ USER_CFLAGS += -fno-builtin -m64
11CHECKFLAGS += -m64 11CHECKFLAGS += -m64
12AFLAGS += -m64 12AFLAGS += -m64
13LDFLAGS += -m elf_x86_64 13LDFLAGS += -m elf_x86_64
14CPPFLAGS += -m64
14 15
15ELF_ARCH := i386:x86-64 16ELF_ARCH := i386:x86-64
16ELF_FORMAT := elf64-x86-64 17ELF_FORMAT := elf64-x86-64
diff --git a/arch/um/defconfig b/arch/um/defconfig
index 402a74dc5026..780cc0a4a128 100644
--- a/arch/um/defconfig
+++ b/arch/um/defconfig
@@ -526,4 +526,3 @@ CONFIG_FORCED_INLINING=y
526# CONFIG_RCU_TORTURE_TEST is not set 526# CONFIG_RCU_TORTURE_TEST is not set
527# CONFIG_GPROF is not set 527# CONFIG_GPROF is not set
528# CONFIG_GCOV is not set 528# CONFIG_GCOV is not set
529# CONFIG_SYSCALL_DEBUG is not set
diff --git a/arch/um/drivers/mconsole_user.c b/arch/um/drivers/mconsole_user.c
index 4b109fe7fff8..9bfd405c3bd8 100644
--- a/arch/um/drivers/mconsole_user.c
+++ b/arch/um/drivers/mconsole_user.c
@@ -18,7 +18,12 @@
18#include "umid.h" 18#include "umid.h"
19 19
20static struct mconsole_command commands[] = { 20static struct mconsole_command commands[] = {
21 { "version", mconsole_version, MCONSOLE_INTR }, 21 /* With uts namespaces, uts information becomes process-specific, so
22 * we need a process context. If we try handling this in interrupt
23 * context, we may hit an exiting process without a valid uts
24 * namespace.
25 */
26 { "version", mconsole_version, MCONSOLE_PROC },
22 { "halt", mconsole_halt, MCONSOLE_PROC }, 27 { "halt", mconsole_halt, MCONSOLE_PROC },
23 { "reboot", mconsole_reboot, MCONSOLE_PROC }, 28 { "reboot", mconsole_reboot, MCONSOLE_PROC },
24 { "config", mconsole_config, MCONSOLE_PROC }, 29 { "config", mconsole_config, MCONSOLE_PROC },
diff --git a/arch/um/drivers/net_user.c b/arch/um/drivers/net_user.c
index 0a7786e00cfb..107c5e43fa00 100644
--- a/arch/um/drivers/net_user.c
+++ b/arch/um/drivers/net_user.c
@@ -22,13 +22,14 @@ int tap_open_common(void *dev, char *gate_addr)
22{ 22{
23 int tap_addr[4]; 23 int tap_addr[4];
24 24
25 if(gate_addr == NULL) return(0); 25 if(gate_addr == NULL)
26 return 0;
26 if(sscanf(gate_addr, "%d.%d.%d.%d", &tap_addr[0], 27 if(sscanf(gate_addr, "%d.%d.%d.%d", &tap_addr[0],
27 &tap_addr[1], &tap_addr[2], &tap_addr[3]) != 4){ 28 &tap_addr[1], &tap_addr[2], &tap_addr[3]) != 4){
28 printk("Invalid tap IP address - '%s'\n", gate_addr); 29 printk("Invalid tap IP address - '%s'\n", gate_addr);
29 return(-EINVAL); 30 return -EINVAL;
30 } 31 }
31 return(0); 32 return 0;
32} 33}
33 34
34void tap_check_ips(char *gate_addr, unsigned char *eth_addr) 35void tap_check_ips(char *gate_addr, unsigned char *eth_addr)
@@ -94,25 +95,25 @@ int net_read(int fd, void *buf, int len)
94 n = os_read_file(fd, buf, len); 95 n = os_read_file(fd, buf, len);
95 96
96 if(n == -EAGAIN) 97 if(n == -EAGAIN)
97 return(0); 98 return 0;
98 else if(n == 0) 99 else if(n == 0)
99 return(-ENOTCONN); 100 return -ENOTCONN;
100 return(n); 101 return n;
101} 102}
102 103
103int net_recvfrom(int fd, void *buf, int len) 104int net_recvfrom(int fd, void *buf, int len)
104{ 105{
105 int n; 106 int n;
106 107
107 while(((n = recvfrom(fd, buf, len, 0, NULL, NULL)) < 0) && 108 CATCH_EINTR(n = recvfrom(fd, buf, len, 0, NULL, NULL));
108 (errno == EINTR)) ;
109
110 if(n < 0){ 109 if(n < 0){
111 if(errno == EAGAIN) return(0); 110 if(errno == EAGAIN)
112 return(-errno); 111 return 0;
112 return -errno;
113 } 113 }
114 else if(n == 0) return(-ENOTCONN); 114 else if(n == 0)
115 return(n); 115 return -ENOTCONN;
116 return n;
116} 117}
117 118
118int net_write(int fd, void *buf, int len) 119int net_write(int fd, void *buf, int len)
@@ -122,37 +123,41 @@ int net_write(int fd, void *buf, int len)
122 n = os_write_file(fd, buf, len); 123 n = os_write_file(fd, buf, len);
123 124
124 if(n == -EAGAIN) 125 if(n == -EAGAIN)
125 return(0); 126 return 0;
126 else if(n == 0) 127 else if(n == 0)
127 return(-ENOTCONN); 128 return -ENOTCONN;
128 return(n); 129 return n;
129} 130}
130 131
131int net_send(int fd, void *buf, int len) 132int net_send(int fd, void *buf, int len)
132{ 133{
133 int n; 134 int n;
134 135
135 while(((n = send(fd, buf, len, 0)) < 0) && (errno == EINTR)) ; 136 CATCH_EINTR(n = send(fd, buf, len, 0));
136 if(n < 0){ 137 if(n < 0){
137 if(errno == EAGAIN) return(0); 138 if(errno == EAGAIN)
138 return(-errno); 139 return 0;
140 return -errno;
139 } 141 }
140 else if(n == 0) return(-ENOTCONN); 142 else if(n == 0)
141 return(n); 143 return -ENOTCONN;
144 return n;
142} 145}
143 146
144int net_sendto(int fd, void *buf, int len, void *to, int sock_len) 147int net_sendto(int fd, void *buf, int len, void *to, int sock_len)
145{ 148{
146 int n; 149 int n;
147 150
148 while(((n = sendto(fd, buf, len, 0, (struct sockaddr *) to, 151 CATCH_EINTR(n = sendto(fd, buf, len, 0, (struct sockaddr *) to,
149 sock_len)) < 0) && (errno == EINTR)) ; 152 sock_len));
150 if(n < 0){ 153 if(n < 0){
151 if(errno == EAGAIN) return(0); 154 if(errno == EAGAIN)
152 return(-errno); 155 return 0;
156 return -errno;
153 } 157 }
154 else if(n == 0) return(-ENOTCONN); 158 else if(n == 0)
155 return(n); 159 return -ENOTCONN;
160 return n;
156} 161}
157 162
158struct change_pre_exec_data { 163struct change_pre_exec_data {
@@ -176,7 +181,7 @@ static int change_tramp(char **argv, char *output, int output_len)
176 err = os_pipe(fds, 1, 0); 181 err = os_pipe(fds, 1, 0);
177 if(err < 0){ 182 if(err < 0){
178 printk("change_tramp - pipe failed, err = %d\n", -err); 183 printk("change_tramp - pipe failed, err = %d\n", -err);
179 return(err); 184 return err;
180 } 185 }
181 pe_data.close_me = fds[0]; 186 pe_data.close_me = fds[0];
182 pe_data.stdout = fds[1]; 187 pe_data.stdout = fds[1];
@@ -190,7 +195,7 @@ static int change_tramp(char **argv, char *output, int output_len)
190 195
191 if (pid > 0) 196 if (pid > 0)
192 CATCH_EINTR(err = waitpid(pid, NULL, 0)); 197 CATCH_EINTR(err = waitpid(pid, NULL, 0));
193 return(pid); 198 return pid;
194} 199}
195 200
196static void change(char *dev, char *what, unsigned char *addr, 201static void change(char *dev, char *what, unsigned char *addr,
@@ -241,26 +246,15 @@ char *split_if_spec(char *str, ...)
241 va_start(ap, str); 246 va_start(ap, str);
242 while((arg = va_arg(ap, char **)) != NULL){ 247 while((arg = va_arg(ap, char **)) != NULL){
243 if(*str == '\0') 248 if(*str == '\0')
244 return(NULL); 249 return NULL;
245 end = strchr(str, ','); 250 end = strchr(str, ',');
246 if(end != str) 251 if(end != str)
247 *arg = str; 252 *arg = str;
248 if(end == NULL) 253 if(end == NULL)
249 return(NULL); 254 return NULL;
250 *end++ = '\0'; 255 *end++ = '\0';
251 str = end; 256 str = end;
252 } 257 }
253 va_end(ap); 258 va_end(ap);
254 return(str); 259 return str;
255} 260}
256
257/*
258 * Overrides for Emacs so that we follow Linus's tabbing style.
259 * Emacs will notice this stuff at the end of the file and automatically
260 * adjust the settings for this buffer only. This must remain at the end
261 * of the file.
262 * ---------------------------------------------------------------------------
263 * Local variables:
264 * c-file-style: "linux"
265 * End:
266 */
diff --git a/arch/um/drivers/tty.c b/arch/um/drivers/tty.c
index 94c9265a4f2c..9f70edf5d8ef 100644
--- a/arch/um/drivers/tty.c
+++ b/arch/um/drivers/tty.c
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (C) 2001 Jeff Dike (jdike@karaya.com) 2 * Copyright (C) 2001 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
@@ -25,17 +25,17 @@ static void *tty_chan_init(char *str, int device, struct chan_opts *opts)
25 if(*str != ':'){ 25 if(*str != ':'){
26 printk("tty_init : channel type 'tty' must specify " 26 printk("tty_init : channel type 'tty' must specify "
27 "a device\n"); 27 "a device\n");
28 return(NULL); 28 return NULL;
29 } 29 }
30 str++; 30 str++;
31 31
32 data = um_kmalloc(sizeof(*data)); 32 data = um_kmalloc(sizeof(*data));
33 if(data == NULL) 33 if(data == NULL)
34 return(NULL); 34 return NULL;
35 *data = ((struct tty_chan) { .dev = str, 35 *data = ((struct tty_chan) { .dev = str,
36 .raw = opts->raw }); 36 .raw = opts->raw });
37 37
38 return(data); 38 return data;
39} 39}
40 40
41static int tty_open(int input, int output, int primary, void *d, 41static int tty_open(int input, int output, int primary, void *d,
@@ -45,19 +45,21 @@ static int tty_open(int input, int output, int primary, void *d,
45 int fd, err; 45 int fd, err;
46 46
47 fd = os_open_file(data->dev, of_set_rw(OPENFLAGS(), input, output), 0); 47 fd = os_open_file(data->dev, of_set_rw(OPENFLAGS(), input, output), 0);
48 if(fd < 0) return(fd); 48 if(fd < 0)
49 return fd;
50
49 if(data->raw){ 51 if(data->raw){
50 CATCH_EINTR(err = tcgetattr(fd, &data->tt)); 52 CATCH_EINTR(err = tcgetattr(fd, &data->tt));
51 if(err) 53 if(err)
52 return(err); 54 return err;
53 55
54 err = raw(fd); 56 err = raw(fd);
55 if(err) 57 if(err)
56 return(err); 58 return err;
57 } 59 }
58 60
59 *dev_out = data->dev; 61 *dev_out = data->dev;
60 return(fd); 62 return fd;
61} 63}
62 64
63struct chan_ops tty_ops = { 65struct chan_ops tty_ops = {
@@ -72,14 +74,3 @@ struct chan_ops tty_ops = {
72 .free = generic_free, 74 .free = generic_free,
73 .winch = 0, 75 .winch = 0,
74}; 76};
75
76/*
77 * Overrides for Emacs so that we follow Linus's tabbing style.
78 * Emacs will notice this stuff at the end of the file and automatically
79 * adjust the settings for this buffer only. This must remain at the end
80 * of the file.
81 * ---------------------------------------------------------------------------
82 * Local variables:
83 * c-file-style: "linux"
84 * End:
85 */
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index 602d7286b9e0..34085315aa57 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -627,7 +627,6 @@ static int ubd_new_disk(int major, u64 size, int unit,
627 627
628{ 628{
629 struct gendisk *disk; 629 struct gendisk *disk;
630 int err;
631 630
632 disk = alloc_disk(1 << UBD_SHIFT); 631 disk = alloc_disk(1 << UBD_SHIFT);
633 if(disk == NULL) 632 if(disk == NULL)
diff --git a/arch/um/include/irq_user.h b/arch/um/include/irq_user.h
index 69a93c804f0e..15d311b9be9e 100644
--- a/arch/um/include/irq_user.h
+++ b/arch/um/include/irq_user.h
@@ -6,6 +6,8 @@
6#ifndef __IRQ_USER_H__ 6#ifndef __IRQ_USER_H__
7#define __IRQ_USER_H__ 7#define __IRQ_USER_H__
8 8
9#include "uml-config.h"
10
9struct irq_fd { 11struct irq_fd {
10 struct irq_fd *next; 12 struct irq_fd *next;
11 void *id; 13 void *id;
@@ -26,9 +28,10 @@ extern void free_irq_by_fd(int fd);
26extern void reactivate_fd(int fd, int irqnum); 28extern void reactivate_fd(int fd, int irqnum);
27extern void deactivate_fd(int fd, int irqnum); 29extern void deactivate_fd(int fd, int irqnum);
28extern int deactivate_all_fds(void); 30extern int deactivate_all_fds(void);
29extern void forward_interrupts(int pid);
30extern int activate_ipi(int fd, int pid); 31extern int activate_ipi(int fd, int pid);
31extern unsigned long irq_lock(void); 32
32extern void irq_unlock(unsigned long flags); 33#ifdef CONFIG_MODE_TT
34extern void forward_interrupts(int pid);
35#endif
33 36
34#endif 37#endif
diff --git a/arch/um/include/kern_util.h b/arch/um/include/kern_util.h
index 310980b32173..b98bdd8e052a 100644
--- a/arch/um/include/kern_util.h
+++ b/arch/um/include/kern_util.h
@@ -72,10 +72,8 @@ extern void init_flush_vm(void);
72extern void *syscall_sp(void *t); 72extern void *syscall_sp(void *t);
73extern void syscall_trace(union uml_pt_regs *regs, int entryexit); 73extern void syscall_trace(union uml_pt_regs *regs, int entryexit);
74extern int hz(void); 74extern int hz(void);
75extern void uml_idle_timer(void);
76extern unsigned int do_IRQ(int irq, union uml_pt_regs *regs); 75extern unsigned int do_IRQ(int irq, union uml_pt_regs *regs);
77extern int external_pid(void *t); 76extern int external_pid(void *t);
78extern void boot_timer_handler(int sig);
79extern void interrupt_end(void); 77extern void interrupt_end(void);
80extern void initial_thread_cb(void (*proc)(void *), void *arg); 78extern void initial_thread_cb(void (*proc)(void *), void *arg);
81extern int debugger_signal(int status, int pid); 79extern int debugger_signal(int status, int pid);
diff --git a/arch/um/include/longjmp.h b/arch/um/include/longjmp.h
index 8e7053013f7b..1b5c0131a12e 100644
--- a/arch/um/include/longjmp.h
+++ b/arch/um/include/longjmp.h
@@ -8,8 +8,8 @@
8 longjmp(*buf, val); \ 8 longjmp(*buf, val); \
9} while(0) 9} while(0)
10 10
11#define UML_SETJMP(buf, enable) ({ \ 11#define UML_SETJMP(buf) ({ \
12 int n; \ 12 int n, enable; \
13 enable = get_signals(); \ 13 enable = get_signals(); \
14 n = setjmp(*buf); \ 14 n = setjmp(*buf); \
15 if(n != 0) \ 15 if(n != 0) \
diff --git a/arch/um/include/os.h b/arch/um/include/os.h
index f88856c28a66..5316e8a4a4fd 100644
--- a/arch/um/include/os.h
+++ b/arch/um/include/os.h
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) 2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
@@ -15,9 +15,9 @@
15#include "irq_user.h" 15#include "irq_user.h"
16#include "sysdep/tls.h" 16#include "sysdep/tls.h"
17 17
18#define OS_TYPE_FILE 1 18#define OS_TYPE_FILE 1
19#define OS_TYPE_DIR 2 19#define OS_TYPE_DIR 2
20#define OS_TYPE_SYMLINK 3 20#define OS_TYPE_SYMLINK 3
21#define OS_TYPE_CHARDEV 4 21#define OS_TYPE_CHARDEV 4
22#define OS_TYPE_BLOCKDEV 5 22#define OS_TYPE_BLOCKDEV 5
23#define OS_TYPE_FIFO 6 23#define OS_TYPE_FIFO 6
@@ -61,68 +61,68 @@ struct openflags {
61}; 61};
62 62
63#define OPENFLAGS() ((struct openflags) { .r = 0, .w = 0, .s = 0, .c = 0, \ 63#define OPENFLAGS() ((struct openflags) { .r = 0, .w = 0, .s = 0, .c = 0, \
64 .t = 0, .a = 0, .e = 0, .cl = 0 }) 64 .t = 0, .a = 0, .e = 0, .cl = 0 })
65 65
66static inline struct openflags of_read(struct openflags flags) 66static inline struct openflags of_read(struct openflags flags)
67{ 67{
68 flags.r = 1; 68 flags.r = 1;
69 return(flags); 69 return flags;
70} 70}
71 71
72static inline struct openflags of_write(struct openflags flags) 72static inline struct openflags of_write(struct openflags flags)
73{ 73{
74 flags.w = 1; 74 flags.w = 1;
75 return(flags); 75 return flags;
76} 76}
77 77
78static inline struct openflags of_rdwr(struct openflags flags) 78static inline struct openflags of_rdwr(struct openflags flags)
79{ 79{
80 return(of_read(of_write(flags))); 80 return of_read(of_write(flags));
81} 81}
82 82
83static inline struct openflags of_set_rw(struct openflags flags, int r, int w) 83static inline struct openflags of_set_rw(struct openflags flags, int r, int w)
84{ 84{
85 flags.r = r; 85 flags.r = r;
86 flags.w = w; 86 flags.w = w;
87 return(flags); 87 return flags;
88} 88}
89 89
90static inline struct openflags of_sync(struct openflags flags) 90static inline struct openflags of_sync(struct openflags flags)
91{ 91{
92 flags.s = 1; 92 flags.s = 1;
93 return(flags); 93 return flags;
94} 94}
95 95
96static inline struct openflags of_create(struct openflags flags) 96static inline struct openflags of_create(struct openflags flags)
97{ 97{
98 flags.c = 1; 98 flags.c = 1;
99 return(flags); 99 return flags;
100} 100}
101 101
102static inline struct openflags of_trunc(struct openflags flags) 102static inline struct openflags of_trunc(struct openflags flags)
103{ 103{
104 flags.t = 1; 104 flags.t = 1;
105 return(flags); 105 return flags;
106} 106}
107 107
108static inline struct openflags of_append(struct openflags flags) 108static inline struct openflags of_append(struct openflags flags)
109{ 109{
110 flags.a = 1; 110 flags.a = 1;
111 return(flags); 111 return flags;
112} 112}
113 113
114static inline struct openflags of_excl(struct openflags flags) 114static inline struct openflags of_excl(struct openflags flags)
115{ 115{
116 flags.e = 1; 116 flags.e = 1;
117 return(flags); 117 return flags;
118} 118}
119 119
120static inline struct openflags of_cloexec(struct openflags flags) 120static inline struct openflags of_cloexec(struct openflags flags)
121{ 121{
122 flags.cl = 1; 122 flags.cl = 1;
123 return(flags); 123 return flags;
124} 124}
125 125
126/* file.c */ 126/* file.c */
127extern int os_stat_file(const char *file_name, struct uml_stat *buf); 127extern int os_stat_file(const char *file_name, struct uml_stat *buf);
128extern int os_stat_fd(const int fd, struct uml_stat *buf); 128extern int os_stat_fd(const int fd, struct uml_stat *buf);
@@ -199,12 +199,12 @@ extern int os_getpid(void);
199extern int os_getpgrp(void); 199extern int os_getpgrp(void);
200 200
201extern void init_new_thread_stack(void *sig_stack, void (*usr1_handler)(int)); 201extern void init_new_thread_stack(void *sig_stack, void (*usr1_handler)(int));
202extern void init_new_thread_signals(int altstack); 202extern void init_new_thread_signals(void);
203extern int run_kernel_thread(int (*fn)(void *), void *arg, void **jmp_ptr); 203extern int run_kernel_thread(int (*fn)(void *), void *arg, void **jmp_ptr);
204 204
205extern int os_map_memory(void *virt, int fd, unsigned long long off, 205extern int os_map_memory(void *virt, int fd, unsigned long long off,
206 unsigned long len, int r, int w, int x); 206 unsigned long len, int r, int w, int x);
207extern int os_protect_memory(void *addr, unsigned long len, 207extern int os_protect_memory(void *addr, unsigned long len,
208 int r, int w, int x); 208 int r, int w, int x);
209extern int os_unmap_memory(void *addr, int len); 209extern int os_unmap_memory(void *addr, int len);
210extern int os_drop_memory(void *addr, int length); 210extern int os_drop_memory(void *addr, int length);
@@ -318,7 +318,6 @@ extern void reboot_skas(void);
318 318
319/* irq.c */ 319/* irq.c */
320extern int os_waiting_for_events(struct irq_fd *active_fds); 320extern int os_waiting_for_events(struct irq_fd *active_fds);
321extern int os_isatty(int fd);
322extern int os_create_pollfd(int fd, int events, void *tmp_pfd, int size_tmpfds); 321extern int os_create_pollfd(int fd, int events, void *tmp_pfd, int size_tmpfds);
323extern void os_free_irq_by_cb(int (*test)(struct irq_fd *, void *), void *arg, 322extern void os_free_irq_by_cb(int (*test)(struct irq_fd *, void *), void *arg,
324 struct irq_fd *active_fds, struct irq_fd ***last_irq_ptr2); 323 struct irq_fd *active_fds, struct irq_fd ***last_irq_ptr2);
@@ -330,9 +329,8 @@ extern void os_set_ioignore(void);
330extern void init_irq_signals(int on_sigstack); 329extern void init_irq_signals(int on_sigstack);
331 330
332/* sigio.c */ 331/* sigio.c */
333extern void write_sigio_workaround(void);
334extern int add_sigio_fd(int fd, int read);
335extern int ignore_sigio_fd(int fd); 332extern int ignore_sigio_fd(int fd);
333extern void maybe_sigio_broken(int fd, int read);
336 334
337/* skas/trap */ 335/* skas/trap */
338extern void sig_handler_common_skas(int sig, void *sc_ptr); 336extern void sig_handler_common_skas(int sig, void *sc_ptr);
diff --git a/arch/um/include/skas/mode_kern_skas.h b/arch/um/include/skas/mode_kern_skas.h
index 63c58739bde0..9cd9c6ec9a63 100644
--- a/arch/um/include/skas/mode_kern_skas.h
+++ b/arch/um/include/skas/mode_kern_skas.h
@@ -29,8 +29,7 @@ extern void flush_tlb_mm_skas(struct mm_struct *mm);
29extern void force_flush_all_skas(void); 29extern void force_flush_all_skas(void);
30extern long execute_syscall_skas(void *r); 30extern long execute_syscall_skas(void *r);
31extern void before_mem_skas(unsigned long unused); 31extern void before_mem_skas(unsigned long unused);
32extern unsigned long set_task_sizes_skas(int arg, unsigned long *host_size_out, 32extern unsigned long set_task_sizes_skas(unsigned long *task_size_out);
33 unsigned long *task_size_out);
34extern int start_uml_skas(void); 33extern int start_uml_skas(void);
35extern int external_pid_skas(struct task_struct *task); 34extern int external_pid_skas(struct task_struct *task);
36extern int thread_pid_skas(struct task_struct *task); 35extern int thread_pid_skas(struct task_struct *task);
diff --git a/arch/um/include/tt/mode_kern_tt.h b/arch/um/include/tt/mode_kern_tt.h
index efa0012550d0..a4fc63057195 100644
--- a/arch/um/include/tt/mode_kern_tt.h
+++ b/arch/um/include/tt/mode_kern_tt.h
@@ -30,8 +30,7 @@ extern void flush_tlb_mm_tt(struct mm_struct *mm);
30extern void force_flush_all_tt(void); 30extern void force_flush_all_tt(void);
31extern long execute_syscall_tt(void *r); 31extern long execute_syscall_tt(void *r);
32extern void before_mem_tt(unsigned long brk_start); 32extern void before_mem_tt(unsigned long brk_start);
33extern unsigned long set_task_sizes_tt(int arg, unsigned long *host_size_out, 33extern unsigned long set_task_sizes_tt(unsigned long *task_size_out);
34 unsigned long *task_size_out);
35extern int start_uml_tt(void); 34extern int start_uml_tt(void);
36extern int external_pid_tt(struct task_struct *task); 35extern int external_pid_tt(struct task_struct *task);
37extern int thread_pid_tt(struct task_struct *task); 36extern int thread_pid_tt(struct task_struct *task);
diff --git a/arch/um/kernel/Makefile b/arch/um/kernel/Makefile
index fe08971b64cf..a2d93065b2d0 100644
--- a/arch/um/kernel/Makefile
+++ b/arch/um/kernel/Makefile
@@ -6,16 +6,14 @@
6extra-y := vmlinux.lds 6extra-y := vmlinux.lds
7clean-files := 7clean-files :=
8 8
9obj-y = config.o exec_kern.o exitcode.o \ 9obj-y = config.o exec.o exitcode.o init_task.o irq.o ksyms.o mem.o \
10 init_task.o irq.o ksyms.o mem.o physmem.o \ 10 physmem.o process_kern.o ptrace.o reboot.o resource.o sigio.o \
11 process_kern.o ptrace.o reboot.o resource.o sigio_kern.o \ 11 signal.o smp.o syscall.o sysrq.o time.o tlb.o trap.o uaccess.o \
12 signal_kern.o smp.o syscall_kern.o sysrq.o \ 12 um_arch.o umid.o
13 time_kern.o tlb.o trap_kern.o uaccess.o um_arch.o umid.o
14 13
15obj-$(CONFIG_BLK_DEV_INITRD) += initrd.o 14obj-$(CONFIG_BLK_DEV_INITRD) += initrd.o
16obj-$(CONFIG_GPROF) += gprof_syms.o 15obj-$(CONFIG_GPROF) += gprof_syms.o
17obj-$(CONFIG_GCOV) += gmon_syms.o 16obj-$(CONFIG_GCOV) += gmon_syms.o
18obj-$(CONFIG_SYSCALL_DEBUG) += syscall.o
19 17
20obj-$(CONFIG_MODE_TT) += tt/ 18obj-$(CONFIG_MODE_TT) += tt/
21obj-$(CONFIG_MODE_SKAS) += skas/ 19obj-$(CONFIG_MODE_SKAS) += skas/
diff --git a/arch/um/kernel/dyn.lds.S b/arch/um/kernel/dyn.lds.S
index 2517ecb8bf27..68ed24df5c8f 100644
--- a/arch/um/kernel/dyn.lds.S
+++ b/arch/um/kernel/dyn.lds.S
@@ -26,6 +26,7 @@ SECTIONS
26 26
27 /* Read-only sections, merged into text segment: */ 27 /* Read-only sections, merged into text segment: */
28 .hash : { *(.hash) } 28 .hash : { *(.hash) }
29 .gnu.hash : { *(.gnu.hash) }
29 .dynsym : { *(.dynsym) } 30 .dynsym : { *(.dynsym) }
30 .dynstr : { *(.dynstr) } 31 .dynstr : { *(.dynstr) }
31 .gnu.version : { *(.gnu.version) } 32 .gnu.version : { *(.gnu.version) }
diff --git a/arch/um/kernel/exec_kern.c b/arch/um/kernel/exec.c
index c0cb627bf594..fc38a6d5906d 100644
--- a/arch/um/kernel/exec_kern.c
+++ b/arch/um/kernel/exec.c
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (C) 2000, 2001 Jeff Dike (jdike@karaya.com) 2 * Copyright (C) 2000, 2001 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
@@ -31,18 +31,27 @@ void start_thread(struct pt_regs *regs, unsigned long eip, unsigned long esp)
31 CHOOSE_MODE_PROC(start_thread_tt, start_thread_skas, regs, eip, esp); 31 CHOOSE_MODE_PROC(start_thread_tt, start_thread_skas, regs, eip, esp);
32} 32}
33 33
34#ifdef CONFIG_TTY_LOG
35extern void log_exec(char **argv, void *tty);
36#endif
37
34static long execve1(char *file, char __user * __user *argv, 38static long execve1(char *file, char __user * __user *argv,
35 char __user *__user *env) 39 char __user *__user *env)
36{ 40{
37 long error; 41 long error;
38 42
39#ifdef CONFIG_TTY_LOG 43#ifdef CONFIG_TTY_LOG
40 log_exec(argv, current->tty); 44 task_lock(current);
45 log_exec(argv, current->signal->tty);
46 task_unlock(current);
41#endif 47#endif
42 error = do_execve(file, argv, env, &current->thread.regs); 48 error = do_execve(file, argv, env, &current->thread.regs);
43 if (error == 0){ 49 if (error == 0){
44 task_lock(current); 50 task_lock(current);
45 current->ptrace &= ~PT_DTRACE; 51 current->ptrace &= ~PT_DTRACE;
52#ifdef SUBARCH_EXECVE1
53 SUBARCH_EXECVE1(&current->thread.regs.regs);
54#endif
46 task_unlock(current); 55 task_unlock(current);
47 set_cmdline(current_cmd()); 56 set_cmdline(current_cmd());
48 } 57 }
diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c
index bfd0bdc8cd40..589c69a75043 100644
--- a/arch/um/kernel/irq.c
+++ b/arch/um/kernel/irq.c
@@ -110,18 +110,7 @@ void sigio_handler(int sig, union uml_pt_regs *regs)
110 free_irqs(); 110 free_irqs();
111} 111}
112 112
113static void maybe_sigio_broken(int fd, int type) 113static DEFINE_SPINLOCK(irq_lock);
114{
115 if (os_isatty(fd)) {
116 if ((type == IRQ_WRITE) && !pty_output_sigio) {
117 write_sigio_workaround();
118 add_sigio_fd(fd, 0);
119 } else if ((type == IRQ_READ) && !pty_close_sigio) {
120 write_sigio_workaround();
121 add_sigio_fd(fd, 1);
122 }
123 }
124}
125 114
126int activate_fd(int irq, int fd, int type, void *dev_id) 115int activate_fd(int irq, int fd, int type, void *dev_id)
127{ 116{
@@ -166,7 +155,7 @@ int activate_fd(int irq, int fd, int type, void *dev_id)
166 * this is called only from process context, and can be locked with 155 * this is called only from process context, and can be locked with
167 * a semaphore. 156 * a semaphore.
168 */ 157 */
169 flags = irq_lock(); 158 spin_lock_irqsave(&irq_lock, flags);
170 for (irq_fd = active_fds; irq_fd != NULL; irq_fd = irq_fd->next) { 159 for (irq_fd = active_fds; irq_fd != NULL; irq_fd = irq_fd->next) {
171 if ((irq_fd->fd == fd) && (irq_fd->type == type)) { 160 if ((irq_fd->fd == fd) && (irq_fd->type == type)) {
172 printk("Registering fd %d twice\n", fd); 161 printk("Registering fd %d twice\n", fd);
@@ -199,7 +188,7 @@ int activate_fd(int irq, int fd, int type, void *dev_id)
199 * so we will not be able to put new pollfd struct to pollfds 188 * so we will not be able to put new pollfd struct to pollfds
200 * then we free the buffer tmp_fds and try again. 189 * then we free the buffer tmp_fds and try again.
201 */ 190 */
202 irq_unlock(flags); 191 spin_unlock_irqrestore(&irq_lock, flags);
203 kfree(tmp_pfd); 192 kfree(tmp_pfd);
204 tmp_pfd = NULL; 193 tmp_pfd = NULL;
205 194
@@ -207,24 +196,24 @@ int activate_fd(int irq, int fd, int type, void *dev_id)
207 if (tmp_pfd == NULL) 196 if (tmp_pfd == NULL)
208 goto out_kfree; 197 goto out_kfree;
209 198
210 flags = irq_lock(); 199 spin_lock_irqsave(&irq_lock, flags);
211 } 200 }
212 /*-------------*/ 201 /*-------------*/
213 202
214 *last_irq_ptr = new_fd; 203 *last_irq_ptr = new_fd;
215 last_irq_ptr = &new_fd->next; 204 last_irq_ptr = &new_fd->next;
216 205
217 irq_unlock(flags); 206 spin_unlock_irqrestore(&irq_lock, flags);
218 207
219 /* This calls activate_fd, so it has to be outside the critical 208 /* This calls activate_fd, so it has to be outside the critical
220 * section. 209 * section.
221 */ 210 */
222 maybe_sigio_broken(fd, type); 211 maybe_sigio_broken(fd, (type == IRQ_READ));
223 212
224 return(0); 213 return(0);
225 214
226 out_unlock: 215 out_unlock:
227 irq_unlock(flags); 216 spin_unlock_irqrestore(&irq_lock, flags);
228 out_kfree: 217 out_kfree:
229 kfree(new_fd); 218 kfree(new_fd);
230 out: 219 out:
@@ -235,9 +224,9 @@ static void free_irq_by_cb(int (*test)(struct irq_fd *, void *), void *arg)
235{ 224{
236 unsigned long flags; 225 unsigned long flags;
237 226
238 flags = irq_lock(); 227 spin_lock_irqsave(&irq_lock, flags);
239 os_free_irq_by_cb(test, arg, active_fds, &last_irq_ptr); 228 os_free_irq_by_cb(test, arg, active_fds, &last_irq_ptr);
240 irq_unlock(flags); 229 spin_unlock_irqrestore(&irq_lock, flags);
241} 230}
242 231
243struct irq_and_dev { 232struct irq_and_dev {
@@ -304,19 +293,19 @@ void reactivate_fd(int fd, int irqnum)
304 unsigned long flags; 293 unsigned long flags;
305 int i; 294 int i;
306 295
307 flags = irq_lock(); 296 spin_lock_irqsave(&irq_lock, flags);
308 irq = find_irq_by_fd(fd, irqnum, &i); 297 irq = find_irq_by_fd(fd, irqnum, &i);
309 if (irq == NULL) { 298 if (irq == NULL) {
310 irq_unlock(flags); 299 spin_unlock_irqrestore(&irq_lock, flags);
311 return; 300 return;
312 } 301 }
313 os_set_pollfd(i, irq->fd); 302 os_set_pollfd(i, irq->fd);
314 irq_unlock(flags); 303 spin_unlock_irqrestore(&irq_lock, flags);
315 304
316 /* This calls activate_fd, so it has to be outside the critical 305 /* This calls activate_fd, so it has to be outside the critical
317 * section. 306 * section.
318 */ 307 */
319 maybe_sigio_broken(fd, irq->type); 308 maybe_sigio_broken(fd, (irq->type == IRQ_READ));
320} 309}
321 310
322void deactivate_fd(int fd, int irqnum) 311void deactivate_fd(int fd, int irqnum)
@@ -325,13 +314,13 @@ void deactivate_fd(int fd, int irqnum)
325 unsigned long flags; 314 unsigned long flags;
326 int i; 315 int i;
327 316
328 flags = irq_lock(); 317 spin_lock_irqsave(&irq_lock, flags);
329 irq = find_irq_by_fd(fd, irqnum, &i); 318 irq = find_irq_by_fd(fd, irqnum, &i);
330 if (irq == NULL) 319 if (irq == NULL)
331 goto out; 320 goto out;
332 os_set_pollfd(i, -1); 321 os_set_pollfd(i, -1);
333 out: 322 out:
334 irq_unlock(flags); 323 spin_unlock_irqrestore(&irq_lock, flags);
335} 324}
336 325
337int deactivate_all_fds(void) 326int deactivate_all_fds(void)
@@ -350,13 +339,14 @@ int deactivate_all_fds(void)
350 return 0; 339 return 0;
351} 340}
352 341
342#ifdef CONFIG_MODE_TT
353void forward_interrupts(int pid) 343void forward_interrupts(int pid)
354{ 344{
355 struct irq_fd *irq; 345 struct irq_fd *irq;
356 unsigned long flags; 346 unsigned long flags;
357 int err; 347 int err;
358 348
359 flags = irq_lock(); 349 spin_lock_irqsave(&irq_lock, flags);
360 for (irq = active_fds; irq != NULL; irq = irq->next) { 350 for (irq = active_fds; irq != NULL; irq = irq->next) {
361 err = os_set_owner(irq->fd, pid); 351 err = os_set_owner(irq->fd, pid);
362 if (err < 0) { 352 if (err < 0) {
@@ -369,8 +359,9 @@ void forward_interrupts(int pid)
369 359
370 irq->pid = pid; 360 irq->pid = pid;
371 } 361 }
372 irq_unlock(flags); 362 spin_unlock_irqrestore(&irq_lock, flags);
373} 363}
364#endif
374 365
375/* 366/*
376 * do_IRQ handles all normal device IRQ's (the special 367 * do_IRQ handles all normal device IRQ's (the special
@@ -403,21 +394,6 @@ int um_request_irq(unsigned int irq, int fd, int type,
403EXPORT_SYMBOL(um_request_irq); 394EXPORT_SYMBOL(um_request_irq);
404EXPORT_SYMBOL(reactivate_fd); 395EXPORT_SYMBOL(reactivate_fd);
405 396
406static DEFINE_SPINLOCK(irq_spinlock);
407
408unsigned long irq_lock(void)
409{
410 unsigned long flags;
411
412 spin_lock_irqsave(&irq_spinlock, flags);
413 return flags;
414}
415
416void irq_unlock(unsigned long flags)
417{
418 spin_unlock_irqrestore(&irq_spinlock, flags);
419}
420
421/* hw_interrupt_type must define (startup || enable) && 397/* hw_interrupt_type must define (startup || enable) &&
422 * (shutdown || disable) && end */ 398 * (shutdown || disable) && end */
423static void dummy(unsigned int irq) 399static void dummy(unsigned int irq)
diff --git a/arch/um/kernel/ksyms.c b/arch/um/kernel/ksyms.c
index 432cf0b97a13..c97045d6d89f 100644
--- a/arch/um/kernel/ksyms.c
+++ b/arch/um/kernel/ksyms.c
@@ -88,12 +88,6 @@ EXPORT_SYMBOL(dump_thread);
88EXPORT_SYMBOL(do_gettimeofday); 88EXPORT_SYMBOL(do_gettimeofday);
89EXPORT_SYMBOL(do_settimeofday); 89EXPORT_SYMBOL(do_settimeofday);
90 90
91/* This is here because UML expands lseek to sys_lseek, not to a system
92 * call instruction.
93 */
94EXPORT_SYMBOL(sys_lseek);
95EXPORT_SYMBOL(sys_wait4);
96
97#ifdef CONFIG_SMP 91#ifdef CONFIG_SMP
98 92
99/* required for SMP */ 93/* required for SMP */
diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c
index 44e41a35f000..61280167c560 100644
--- a/arch/um/kernel/mem.c
+++ b/arch/um/kernel/mem.c
@@ -24,8 +24,6 @@
24#include "init.h" 24#include "init.h"
25#include "kern_constants.h" 25#include "kern_constants.h"
26 26
27extern char __binary_start;
28
29/* Changed during early boot */ 27/* Changed during early boot */
30unsigned long *empty_zero_page = NULL; 28unsigned long *empty_zero_page = NULL;
31unsigned long *empty_bad_page = NULL; 29unsigned long *empty_bad_page = NULL;
@@ -65,8 +63,6 @@ static void setup_highmem(unsigned long highmem_start,
65 63
66void mem_init(void) 64void mem_init(void)
67{ 65{
68 unsigned long start;
69
70 max_low_pfn = (high_physmem - uml_physmem) >> PAGE_SHIFT; 66 max_low_pfn = (high_physmem - uml_physmem) >> PAGE_SHIFT;
71 67
72 /* clear the zero-page */ 68 /* clear the zero-page */
@@ -81,13 +77,6 @@ void mem_init(void)
81 free_bootmem(__pa(brk_end), uml_reserved - brk_end); 77 free_bootmem(__pa(brk_end), uml_reserved - brk_end);
82 uml_reserved = brk_end; 78 uml_reserved = brk_end;
83 79
84 /* Fill in any hole at the start of the binary */
85 start = (unsigned long) &__binary_start & PAGE_MASK;
86 if(uml_physmem != start){
87 map_memory(uml_physmem, __pa(uml_physmem), start - uml_physmem,
88 1, 1, 0);
89 }
90
91 /* this will put all low memory onto the freelists */ 80 /* this will put all low memory onto the freelists */
92 totalram_pages = free_all_bootmem(); 81 totalram_pages = free_all_bootmem();
93 totalhigh_pages = highmem >> PAGE_SHIFT; 82 totalhigh_pages = highmem >> PAGE_SHIFT;
diff --git a/arch/um/kernel/physmem.c b/arch/um/kernel/physmem.c
index 166cb09cae4c..abafa64b8727 100644
--- a/arch/um/kernel/physmem.c
+++ b/arch/um/kernel/physmem.c
@@ -317,7 +317,7 @@ void map_memory(unsigned long virt, unsigned long phys, unsigned long len,
317 } 317 }
318} 318}
319 319
320extern int __syscall_stub_start, __binary_start; 320extern int __syscall_stub_start;
321 321
322void setup_physmem(unsigned long start, unsigned long reserve_end, 322void setup_physmem(unsigned long start, unsigned long reserve_end,
323 unsigned long len, unsigned long long highmem) 323 unsigned long len, unsigned long long highmem)
diff --git a/arch/um/kernel/sigio_kern.c b/arch/um/kernel/sigio.c
index 51b677083948..0ad755ceb212 100644
--- a/arch/um/kernel/sigio_kern.c
+++ b/arch/um/kernel/sigio.c
@@ -31,7 +31,7 @@ int write_sigio_irq(int fd)
31 int err; 31 int err;
32 32
33 err = um_request_irq(SIGIO_WRITE_IRQ, fd, IRQ_READ, sigio_interrupt, 33 err = um_request_irq(SIGIO_WRITE_IRQ, fd, IRQ_READ, sigio_interrupt,
34 IRQF_DISABLED | IRQF_SAMPLE_RANDOM, "write sigio", 34 IRQF_DISABLED|IRQF_SAMPLE_RANDOM, "write sigio",
35 NULL); 35 NULL);
36 if(err){ 36 if(err){
37 printk("write_sigio_irq : um_request_irq failed, err = %d\n", 37 printk("write_sigio_irq : um_request_irq failed, err = %d\n",
@@ -53,17 +53,3 @@ void sigio_unlock(void)
53{ 53{
54 spin_unlock(&sigio_spinlock); 54 spin_unlock(&sigio_spinlock);
55} 55}
56
57extern void sigio_cleanup(void);
58__uml_exitcall(sigio_cleanup);
59
60/*
61 * Overrides for Emacs so that we follow Linus's tabbing style.
62 * Emacs will notice this stuff at the end of the file and automatically
63 * adjust the settings for this buffer only. This must remain at the end
64 * of the file.
65 * ---------------------------------------------------------------------------
66 * Local variables:
67 * c-file-style: "linux"
68 * End:
69 */
diff --git a/arch/um/kernel/signal_kern.c b/arch/um/kernel/signal.c
index da17b7541e08..4aa9808ba264 100644
--- a/arch/um/kernel/signal_kern.c
+++ b/arch/um/kernel/signal.c
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) 2 * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
@@ -36,7 +36,7 @@ EXPORT_SYMBOL(unblock_signals);
36 36
37/* 37/*
38 * OK, we're invoking a handler 38 * OK, we're invoking a handler
39 */ 39 */
40static int handle_signal(struct pt_regs *regs, unsigned long signr, 40static int handle_signal(struct pt_regs *regs, unsigned long signr,
41 struct k_sigaction *ka, siginfo_t *info, 41 struct k_sigaction *ka, siginfo_t *info,
42 sigset_t *oldset) 42 sigset_t *oldset)
@@ -88,7 +88,7 @@ static int handle_signal(struct pt_regs *regs, unsigned long signr,
88 force_sigsegv(signr, current); 88 force_sigsegv(signr, current);
89 } else { 89 } else {
90 spin_lock_irq(&current->sighand->siglock); 90 spin_lock_irq(&current->sighand->siglock);
91 sigorsets(&current->blocked, &current->blocked, 91 sigorsets(&current->blocked, &current->blocked,
92 &ka->sa.sa_mask); 92 &ka->sa.sa_mask);
93 if(!(ka->sa.sa_flags & SA_NODEFER)) 93 if(!(ka->sa.sa_flags & SA_NODEFER))
94 sigaddset(&current->blocked, signr); 94 sigaddset(&current->blocked, signr);
@@ -136,7 +136,7 @@ static int kern_do_signal(struct pt_regs *regs)
136 PT_REGS_RESTART_SYSCALL(regs); 136 PT_REGS_RESTART_SYSCALL(regs);
137 break; 137 break;
138 case -ERESTART_RESTARTBLOCK: 138 case -ERESTART_RESTARTBLOCK:
139 PT_REGS_SYSCALL_RET(regs) = __NR_restart_syscall; 139 PT_REGS_ORIG_SYSCALL(regs) = __NR_restart_syscall;
140 PT_REGS_RESTART_SYSCALL(regs); 140 PT_REGS_RESTART_SYSCALL(regs);
141 break; 141 break;
142 } 142 }
@@ -146,7 +146,7 @@ static int kern_do_signal(struct pt_regs *regs)
146 * you set a breakpoint on a system call instruction and singlestep 146 * you set a breakpoint on a system call instruction and singlestep
147 * from it, the tracing thread used to PTRACE_SINGLESTEP the process 147 * from it, the tracing thread used to PTRACE_SINGLESTEP the process
148 * rather than PTRACE_SYSCALL it, allowing the system call to execute 148 * rather than PTRACE_SYSCALL it, allowing the system call to execute
149 * on the host. The tracing thread will check this flag and 149 * on the host. The tracing thread will check this flag and
150 * PTRACE_SYSCALL if necessary. 150 * PTRACE_SYSCALL if necessary.
151 */ 151 */
152 if(current->ptrace & PT_DTRACE) 152 if(current->ptrace & PT_DTRACE)
diff --git a/arch/um/kernel/skas/mem.c b/arch/um/kernel/skas/mem.c
index 88ab96c609ce..27bbf54b1e52 100644
--- a/arch/um/kernel/skas/mem.c
+++ b/arch/um/kernel/skas/mem.c
@@ -9,31 +9,19 @@
9#include "mem_user.h" 9#include "mem_user.h"
10#include "skas.h" 10#include "skas.h"
11 11
12unsigned long set_task_sizes_skas(int arg, unsigned long *host_size_out, 12unsigned long set_task_sizes_skas(unsigned long *task_size_out)
13 unsigned long *task_size_out)
14{ 13{
15 /* Round up to the nearest 4M */ 14 /* Round up to the nearest 4M */
16 unsigned long top = ROUND_4M((unsigned long) &arg); 15 unsigned long host_task_size = ROUND_4M((unsigned long)
16 &host_task_size);
17 17
18#ifdef CONFIG_HOST_TASK_SIZE 18#ifdef CONFIG_HOST_TASK_SIZE
19 *host_size_out = CONFIG_HOST_TASK_SIZE; 19 *host_size_out = ROUND_4M(CONFIG_HOST_TASK_SIZE);
20 *task_size_out = CONFIG_HOST_TASK_SIZE; 20 *task_size_out = CONFIG_HOST_TASK_SIZE;
21#else 21#else
22 *host_size_out = top;
23 if (!skas_needs_stub) 22 if (!skas_needs_stub)
24 *task_size_out = top; 23 *task_size_out = host_task_size;
25 else *task_size_out = CONFIG_STUB_START & PGDIR_MASK; 24 else *task_size_out = CONFIG_STUB_START & PGDIR_MASK;
26#endif 25#endif
27 return(((unsigned long) set_task_sizes_skas) & ~0xffffff); 26 return host_task_size;
28} 27}
29
30/*
31 * Overrides for Emacs so that we follow Linus's tabbing style.
32 * Emacs will notice this stuff at the end of the file and automatically
33 * adjust the settings for this buffer only. This must remain at the end
34 * of the file.
35 * ---------------------------------------------------------------------------
36 * Local variables:
37 * c-file-style: "linux"
38 * End:
39 */
diff --git a/arch/um/kernel/skas/process_kern.c b/arch/um/kernel/skas/process_kern.c
index 2135eaf98a93..55caeec8b257 100644
--- a/arch/um/kernel/skas/process_kern.c
+++ b/arch/um/kernel/skas/process_kern.c
@@ -177,7 +177,7 @@ int start_uml_skas(void)
177 if(proc_mm) 177 if(proc_mm)
178 userspace_pid[0] = start_userspace(0); 178 userspace_pid[0] = start_userspace(0);
179 179
180 init_new_thread_signals(1); 180 init_new_thread_signals();
181 181
182 init_task.thread.request.u.thread.proc = start_kernel_proc; 182 init_task.thread.request.u.thread.proc = start_kernel_proc;
183 init_task.thread.request.u.thread.arg = NULL; 183 init_task.thread.request.u.thread.arg = NULL;
diff --git a/arch/um/kernel/skas/syscall.c b/arch/um/kernel/skas/syscall.c
index 51fb94076fcf..0ae4eea21be4 100644
--- a/arch/um/kernel/skas/syscall.c
+++ b/arch/um/kernel/skas/syscall.c
@@ -18,11 +18,7 @@ void handle_syscall(union uml_pt_regs *r)
18 struct pt_regs *regs = container_of(r, struct pt_regs, regs); 18 struct pt_regs *regs = container_of(r, struct pt_regs, regs);
19 long result; 19 long result;
20 int syscall; 20 int syscall;
21#ifdef UML_CONFIG_SYSCALL_DEBUG
22 int index;
23 21
24 index = record_syscall_start(UPT_SYSCALL_NR(r));
25#endif
26 syscall_trace(r, 0); 22 syscall_trace(r, 0);
27 23
28 current->thread.nsyscalls++; 24 current->thread.nsyscalls++;
@@ -44,7 +40,4 @@ void handle_syscall(union uml_pt_regs *r)
44 REGS_SET_SYSCALL_RETURN(r->skas.regs, result); 40 REGS_SET_SYSCALL_RETURN(r->skas.regs, result);
45 41
46 syscall_trace(r, 1); 42 syscall_trace(r, 1);
47#ifdef UML_CONFIG_SYSCALL_DEBUG
48 record_syscall_end(index, result);
49#endif
50} 43}
diff --git a/arch/um/kernel/syscall.c b/arch/um/kernel/syscall.c
index 1731d90e6850..48cf88dd02d4 100644
--- a/arch/um/kernel/syscall.c
+++ b/arch/um/kernel/syscall.c
@@ -1,36 +1,166 @@
1/* 1/*
2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) 2 * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
5 5
6#include "linux/sched.h"
7#include "linux/file.h"
8#include "linux/smp_lock.h"
9#include "linux/mm.h"
10#include "linux/utsname.h"
11#include "linux/msg.h"
12#include "linux/shm.h"
13#include "linux/sys.h"
14#include "linux/syscalls.h"
15#include "linux/unistd.h"
16#include "linux/slab.h"
17#include "linux/utime.h"
18#include "asm/mman.h"
19#include "asm/uaccess.h"
6#include "kern_util.h" 20#include "kern_util.h"
7#include "syscall.h" 21#include "user_util.h"
8#include "os.h" 22#include "sysdep/syscalls.h"
23#include "mode_kern.h"
24#include "choose-mode.h"
9 25
10struct { 26/* Unlocked, I don't care if this is a bit off */
11 int syscall; 27int nsyscalls = 0;
12 int pid;
13 long result;
14 unsigned long long start;
15 unsigned long long end;
16} syscall_record[1024];
17 28
18int record_syscall_start(int syscall) 29long sys_fork(void)
19{ 30{
20 int max, index; 31 long ret;
21 32
22 max = sizeof(syscall_record)/sizeof(syscall_record[0]); 33 current->thread.forking = 1;
23 index = next_syscall_index(max); 34 ret = do_fork(SIGCHLD, UPT_SP(&current->thread.regs.regs),
35 &current->thread.regs, 0, NULL, NULL);
36 current->thread.forking = 0;
37 return(ret);
38}
39
40long sys_vfork(void)
41{
42 long ret;
43
44 current->thread.forking = 1;
45 ret = do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD,
46 UPT_SP(&current->thread.regs.regs),
47 &current->thread.regs, 0, NULL, NULL);
48 current->thread.forking = 0;
49 return(ret);
50}
51
52/* common code for old and new mmaps */
53long sys_mmap2(unsigned long addr, unsigned long len,
54 unsigned long prot, unsigned long flags,
55 unsigned long fd, unsigned long pgoff)
56{
57 long error = -EBADF;
58 struct file * file = NULL;
59
60 flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
61 if (!(flags & MAP_ANONYMOUS)) {
62 file = fget(fd);
63 if (!file)
64 goto out;
65 }
66
67 down_write(&current->mm->mmap_sem);
68 error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff);
69 up_write(&current->mm->mmap_sem);
70
71 if (file)
72 fput(file);
73 out:
74 return error;
75}
76
77long old_mmap(unsigned long addr, unsigned long len,
78 unsigned long prot, unsigned long flags,
79 unsigned long fd, unsigned long offset)
80{
81 long err = -EINVAL;
82 if (offset & ~PAGE_MASK)
83 goto out;
84
85 err = sys_mmap2(addr, len, prot, flags, fd, offset >> PAGE_SHIFT);
86 out:
87 return err;
88}
89/*
90 * sys_pipe() is the normal C calling standard for creating
91 * a pipe. It's not the way unix traditionally does this, though.
92 */
93long sys_pipe(unsigned long __user * fildes)
94{
95 int fd[2];
96 long error;
97
98 error = do_pipe(fd);
99 if (!error) {
100 if (copy_to_user(fildes, fd, sizeof(fd)))
101 error = -EFAULT;
102 }
103 return error;
104}
24 105
25 syscall_record[index].syscall = syscall; 106
26 syscall_record[index].pid = current_pid(); 107long sys_uname(struct old_utsname __user * name)
27 syscall_record[index].result = 0xdeadbeef; 108{
28 syscall_record[index].start = os_nsecs(); 109 long err;
29 return(index); 110 if (!name)
111 return -EFAULT;
112 down_read(&uts_sem);
113 err = copy_to_user(name, &system_utsname, sizeof (*name));
114 up_read(&uts_sem);
115 return err?-EFAULT:0;
30} 116}
31 117
32void record_syscall_end(int index, long result) 118long sys_olduname(struct oldold_utsname __user * name)
33{ 119{
34 syscall_record[index].result = result; 120 long error;
35 syscall_record[index].end = os_nsecs(); 121
122 if (!name)
123 return -EFAULT;
124 if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname)))
125 return -EFAULT;
126
127 down_read(&uts_sem);
128
129 error = __copy_to_user(&name->sysname,&system_utsname.sysname,
130 __OLD_UTS_LEN);
131 error |= __put_user(0,name->sysname+__OLD_UTS_LEN);
132 error |= __copy_to_user(&name->nodename,&system_utsname.nodename,
133 __OLD_UTS_LEN);
134 error |= __put_user(0,name->nodename+__OLD_UTS_LEN);
135 error |= __copy_to_user(&name->release,&system_utsname.release,
136 __OLD_UTS_LEN);
137 error |= __put_user(0,name->release+__OLD_UTS_LEN);
138 error |= __copy_to_user(&name->version,&system_utsname.version,
139 __OLD_UTS_LEN);
140 error |= __put_user(0,name->version+__OLD_UTS_LEN);
141 error |= __copy_to_user(&name->machine,&system_utsname.machine,
142 __OLD_UTS_LEN);
143 error |= __put_user(0,name->machine+__OLD_UTS_LEN);
144
145 up_read(&uts_sem);
146
147 error = error ? -EFAULT : 0;
148
149 return error;
150}
151
152DEFINE_SPINLOCK(syscall_lock);
153
154static int syscall_index = 0;
155
156int next_syscall_index(int limit)
157{
158 int ret;
159
160 spin_lock(&syscall_lock);
161 ret = syscall_index;
162 if(++syscall_index == limit)
163 syscall_index = 0;
164 spin_unlock(&syscall_lock);
165 return(ret);
36} 166}
diff --git a/arch/um/kernel/syscall_kern.c b/arch/um/kernel/syscall_kern.c
deleted file mode 100644
index 37d3978337d8..000000000000
--- a/arch/um/kernel/syscall_kern.c
+++ /dev/null
@@ -1,166 +0,0 @@
1/*
2 * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com)
3 * Licensed under the GPL
4 */
5
6#include "linux/sched.h"
7#include "linux/file.h"
8#include "linux/smp_lock.h"
9#include "linux/mm.h"
10#include "linux/utsname.h"
11#include "linux/msg.h"
12#include "linux/shm.h"
13#include "linux/sys.h"
14#include "linux/syscalls.h"
15#include "linux/unistd.h"
16#include "linux/slab.h"
17#include "linux/utime.h"
18#include "asm/mman.h"
19#include "asm/uaccess.h"
20#include "kern_util.h"
21#include "user_util.h"
22#include "sysdep/syscalls.h"
23#include "mode_kern.h"
24#include "choose-mode.h"
25
26/* Unlocked, I don't care if this is a bit off */
27int nsyscalls = 0;
28
29long sys_fork(void)
30{
31 long ret;
32
33 current->thread.forking = 1;
34 ret = do_fork(SIGCHLD, UPT_SP(&current->thread.regs.regs),
35 &current->thread.regs, 0, NULL, NULL);
36 current->thread.forking = 0;
37 return(ret);
38}
39
40long sys_vfork(void)
41{
42 long ret;
43
44 current->thread.forking = 1;
45 ret = do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD,
46 UPT_SP(&current->thread.regs.regs),
47 &current->thread.regs, 0, NULL, NULL);
48 current->thread.forking = 0;
49 return(ret);
50}
51
52/* common code for old and new mmaps */
53long sys_mmap2(unsigned long addr, unsigned long len,
54 unsigned long prot, unsigned long flags,
55 unsigned long fd, unsigned long pgoff)
56{
57 long error = -EBADF;
58 struct file * file = NULL;
59
60 flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
61 if (!(flags & MAP_ANONYMOUS)) {
62 file = fget(fd);
63 if (!file)
64 goto out;
65 }
66
67 down_write(&current->mm->mmap_sem);
68 error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff);
69 up_write(&current->mm->mmap_sem);
70
71 if (file)
72 fput(file);
73 out:
74 return error;
75}
76
77long old_mmap(unsigned long addr, unsigned long len,
78 unsigned long prot, unsigned long flags,
79 unsigned long fd, unsigned long offset)
80{
81 long err = -EINVAL;
82 if (offset & ~PAGE_MASK)
83 goto out;
84
85 err = sys_mmap2(addr, len, prot, flags, fd, offset >> PAGE_SHIFT);
86 out:
87 return err;
88}
89/*
90 * sys_pipe() is the normal C calling standard for creating
91 * a pipe. It's not the way unix traditionally does this, though.
92 */
93long sys_pipe(unsigned long __user * fildes)
94{
95 int fd[2];
96 long error;
97
98 error = do_pipe(fd);
99 if (!error) {
100 if (copy_to_user(fildes, fd, sizeof(fd)))
101 error = -EFAULT;
102 }
103 return error;
104}
105
106
107long sys_uname(struct old_utsname __user * name)
108{
109 long err;
110 if (!name)
111 return -EFAULT;
112 down_read(&uts_sem);
113 err=copy_to_user(name, &system_utsname, sizeof (*name));
114 up_read(&uts_sem);
115 return err?-EFAULT:0;
116}
117
118long sys_olduname(struct oldold_utsname __user * name)
119{
120 long error;
121
122 if (!name)
123 return -EFAULT;
124 if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname)))
125 return -EFAULT;
126
127 down_read(&uts_sem);
128
129 error = __copy_to_user(&name->sysname,&system_utsname.sysname,
130 __OLD_UTS_LEN);
131 error |= __put_user(0,name->sysname+__OLD_UTS_LEN);
132 error |= __copy_to_user(&name->nodename,&system_utsname.nodename,
133 __OLD_UTS_LEN);
134 error |= __put_user(0,name->nodename+__OLD_UTS_LEN);
135 error |= __copy_to_user(&name->release,&system_utsname.release,
136 __OLD_UTS_LEN);
137 error |= __put_user(0,name->release+__OLD_UTS_LEN);
138 error |= __copy_to_user(&name->version,&system_utsname.version,
139 __OLD_UTS_LEN);
140 error |= __put_user(0,name->version+__OLD_UTS_LEN);
141 error |= __copy_to_user(&name->machine,&system_utsname.machine,
142 __OLD_UTS_LEN);
143 error |= __put_user(0,name->machine+__OLD_UTS_LEN);
144
145 up_read(&uts_sem);
146
147 error = error ? -EFAULT : 0;
148
149 return error;
150}
151
152DEFINE_SPINLOCK(syscall_lock);
153
154static int syscall_index = 0;
155
156int next_syscall_index(int limit)
157{
158 int ret;
159
160 spin_lock(&syscall_lock);
161 ret = syscall_index;
162 if(++syscall_index == limit)
163 syscall_index = 0;
164 spin_unlock(&syscall_lock);
165 return(ret);
166}
diff --git a/arch/um/kernel/time_kern.c b/arch/um/kernel/time.c
index d7e044b5e5ee..552ca1cb9847 100644
--- a/arch/um/kernel/time_kern.c
+++ b/arch/um/kernel/time.c
@@ -38,7 +38,6 @@ unsigned long long sched_clock(void)
38/* Changed at early boot */ 38/* Changed at early boot */
39int timer_irq_inited = 0; 39int timer_irq_inited = 0;
40 40
41static int first_tick;
42static unsigned long long prev_nsecs; 41static unsigned long long prev_nsecs;
43#ifdef CONFIG_UML_REAL_TIME_CLOCK 42#ifdef CONFIG_UML_REAL_TIME_CLOCK
44static long long delta; /* Deviation per interval */ 43static long long delta; /* Deviation per interval */
@@ -48,15 +47,8 @@ void timer_irq(union uml_pt_regs *regs)
48{ 47{
49 unsigned long long ticks = 0; 48 unsigned long long ticks = 0;
50 49
51 if(!timer_irq_inited){
52 /* This is to ensure that ticks don't pile up when
53 * the timer handler is suspended */
54 first_tick = 0;
55 return;
56 }
57
58 if(first_tick){
59#ifdef CONFIG_UML_REAL_TIME_CLOCK 50#ifdef CONFIG_UML_REAL_TIME_CLOCK
51 if(prev_nsecs){
60 /* We've had 1 tick */ 52 /* We've had 1 tick */
61 unsigned long long nsecs = os_nsecs(); 53 unsigned long long nsecs = os_nsecs();
62 54
@@ -69,44 +61,17 @@ void timer_irq(union uml_pt_regs *regs)
69 61
70 ticks += (delta * HZ) / BILLION; 62 ticks += (delta * HZ) / BILLION;
71 delta -= (ticks * BILLION) / HZ; 63 delta -= (ticks * BILLION) / HZ;
64 }
65 else prev_nsecs = os_nsecs();
72#else 66#else
73 ticks = 1; 67 ticks = 1;
74#endif 68#endif
75 }
76 else {
77 prev_nsecs = os_nsecs();
78 first_tick = 1;
79 }
80
81 while(ticks > 0){ 69 while(ticks > 0){
82 do_IRQ(TIMER_IRQ, regs); 70 do_IRQ(TIMER_IRQ, regs);
83 ticks--; 71 ticks--;
84 } 72 }
85} 73}
86 74
87
88void time_init_kern(void)
89{
90 long long nsecs;
91
92 nsecs = os_nsecs();
93 set_normalized_timespec(&wall_to_monotonic, -nsecs / BILLION,
94 -nsecs % BILLION);
95}
96
97void do_boot_timer_handler(struct sigcontext * sc)
98{
99 unsigned long flags;
100 struct pt_regs regs;
101
102 CHOOSE_MODE((void) (UPT_SC(&regs.regs) = sc),
103 (void) (regs.regs.skas.is_user = 0));
104
105 write_seqlock_irqsave(&xtime_lock, flags);
106 do_timer(&regs);
107 write_sequnlock_irqrestore(&xtime_lock, flags);
108}
109
110static DEFINE_SPINLOCK(timer_spinlock); 75static DEFINE_SPINLOCK(timer_spinlock);
111 76
112static unsigned long long local_offset = 0; 77static unsigned long long local_offset = 0;
@@ -142,6 +107,32 @@ irqreturn_t um_timer(int irq, void *dev, struct pt_regs *regs)
142 return IRQ_HANDLED; 107 return IRQ_HANDLED;
143} 108}
144 109
110static void register_timer(void)
111{
112 int err;
113
114 err = request_irq(TIMER_IRQ, um_timer, IRQF_DISABLED, "timer", NULL);
115 if(err != 0)
116 printk(KERN_ERR "timer_init : request_irq failed - "
117 "errno = %d\n", -err);
118
119 timer_irq_inited = 1;
120
121 user_time_init();
122}
123
124extern void (*late_time_init)(void);
125
126void time_init(void)
127{
128 long long nsecs;
129
130 nsecs = os_nsecs();
131 set_normalized_timespec(&wall_to_monotonic, -nsecs / BILLION,
132 -nsecs % BILLION);
133 late_time_init = register_timer;
134}
135
145void do_gettimeofday(struct timeval *tv) 136void do_gettimeofday(struct timeval *tv)
146{ 137{
147 unsigned long long nsecs = get_time(); 138 unsigned long long nsecs = get_time();
@@ -189,18 +180,3 @@ void timer_handler(int sig, union uml_pt_regs *regs)
189 if(current_thread->cpu == 0) 180 if(current_thread->cpu == 0)
190 timer_irq(regs); 181 timer_irq(regs);
191} 182}
192
193int __init timer_init(void)
194{
195 int err;
196
197 user_time_init();
198 err = request_irq(TIMER_IRQ, um_timer, IRQF_DISABLED, "timer", NULL);
199 if(err != 0)
200 printk(KERN_ERR "timer_init : request_irq failed - "
201 "errno = %d\n", -err);
202 timer_irq_inited = 1;
203 return(0);
204}
205
206arch_initcall(timer_init);
diff --git a/arch/um/kernel/trap_kern.c b/arch/um/kernel/trap.c
index 02f6d4d8dc3a..ac70fa5a2e2a 100644
--- a/arch/um/kernel/trap_kern.c
+++ b/arch/um/kernel/trap.c
@@ -35,7 +35,7 @@
35#include "os.h" 35#include "os.h"
36 36
37/* Note this is constrained to return 0, -EFAULT, -EACCESS, -ENOMEM by segv(). */ 37/* Note this is constrained to return 0, -EFAULT, -EACCESS, -ENOMEM by segv(). */
38int handle_page_fault(unsigned long address, unsigned long ip, 38int handle_page_fault(unsigned long address, unsigned long ip,
39 int is_write, int is_user, int *code_out) 39 int is_write, int is_user, int *code_out)
40{ 40{
41 struct mm_struct *mm = current->mm; 41 struct mm_struct *mm = current->mm;
@@ -55,20 +55,20 @@ int handle_page_fault(unsigned long address, unsigned long ip,
55 55
56 down_read(&mm->mmap_sem); 56 down_read(&mm->mmap_sem);
57 vma = find_vma(mm, address); 57 vma = find_vma(mm, address);
58 if(!vma) 58 if(!vma)
59 goto out; 59 goto out;
60 else if(vma->vm_start <= address) 60 else if(vma->vm_start <= address)
61 goto good_area; 61 goto good_area;
62 else if(!(vma->vm_flags & VM_GROWSDOWN)) 62 else if(!(vma->vm_flags & VM_GROWSDOWN))
63 goto out; 63 goto out;
64 else if(is_user && !ARCH_IS_STACKGROW(address)) 64 else if(is_user && !ARCH_IS_STACKGROW(address))
65 goto out; 65 goto out;
66 else if(expand_stack(vma, address)) 66 else if(expand_stack(vma, address))
67 goto out; 67 goto out;
68 68
69good_area: 69good_area:
70 *code_out = SEGV_ACCERR; 70 *code_out = SEGV_ACCERR;
71 if(is_write && !(vma->vm_flags & VM_WRITE)) 71 if(is_write && !(vma->vm_flags & VM_WRITE))
72 goto out; 72 goto out;
73 73
74 /* Don't require VM_READ|VM_EXEC for write faults! */ 74 /* Don't require VM_READ|VM_EXEC for write faults! */
@@ -184,14 +184,14 @@ unsigned long segv(struct faultinfo fi, unsigned long ip, int is_user, void *sc)
184 else if(catcher != NULL){ 184 else if(catcher != NULL){
185 current->thread.fault_addr = (void *) address; 185 current->thread.fault_addr = (void *) address;
186 do_longjmp(catcher, 1); 186 do_longjmp(catcher, 1);
187 } 187 }
188 else if(current->thread.fault_addr != NULL) 188 else if(current->thread.fault_addr != NULL)
189 panic("fault_addr set but no fault catcher"); 189 panic("fault_addr set but no fault catcher");
190 else if(!is_user && arch_fixup(ip, sc)) 190 else if(!is_user && arch_fixup(ip, sc))
191 return(0); 191 return(0);
192 192
193 if(!is_user) 193 if(!is_user)
194 panic("Kernel mode fault at addr 0x%lx, ip 0x%lx", 194 panic("Kernel mode fault at addr 0x%lx, ip 0x%lx",
195 address, ip); 195 address, ip);
196 196
197 if (err == -EACCES) { 197 if (err == -EACCES) {
diff --git a/arch/um/kernel/tt/exec_kern.c b/arch/um/kernel/tt/exec_kern.c
index 5c1e4cc1c049..ad66df17d9d7 100644
--- a/arch/um/kernel/tt/exec_kern.c
+++ b/arch/um/kernel/tt/exec_kern.c
@@ -21,7 +21,7 @@
21static int exec_tramp(void *sig_stack) 21static int exec_tramp(void *sig_stack)
22{ 22{
23 init_new_thread_stack(sig_stack, NULL); 23 init_new_thread_stack(sig_stack, NULL);
24 init_new_thread_signals(1); 24 init_new_thread_signals();
25 os_stop_process(os_getpid()); 25 os_stop_process(os_getpid());
26 return(0); 26 return(0);
27} 27}
diff --git a/arch/um/kernel/tt/mem.c b/arch/um/kernel/tt/mem.c
index bcb8796c3cb1..84a23b14f770 100644
--- a/arch/um/kernel/tt/mem.c
+++ b/arch/um/kernel/tt/mem.c
@@ -24,22 +24,13 @@ void before_mem_tt(unsigned long brk_start)
24#define SIZE ((CONFIG_NEST_LEVEL + CONFIG_KERNEL_HALF_GIGS) * 0x20000000) 24#define SIZE ((CONFIG_NEST_LEVEL + CONFIG_KERNEL_HALF_GIGS) * 0x20000000)
25#define START (CONFIG_TOP_ADDR - SIZE) 25#define START (CONFIG_TOP_ADDR - SIZE)
26 26
27unsigned long set_task_sizes_tt(int arg, unsigned long *host_size_out, 27unsigned long set_task_sizes_tt(unsigned long *task_size_out)
28 unsigned long *task_size_out)
29{ 28{
29 unsigned long host_task_size;
30
30 /* Round up to the nearest 4M */ 31 /* Round up to the nearest 4M */
31 *host_size_out = ROUND_4M((unsigned long) &arg); 32 host_task_size = ROUND_4M((unsigned long) &host_task_size);
32 *task_size_out = START; 33 *task_size_out = START;
33 return(START);
34}
35 34
36/* 35 return host_task_size;
37 * Overrides for Emacs so that we follow Linus's tabbing style. 36}
38 * Emacs will notice this stuff at the end of the file and automatically
39 * adjust the settings for this buffer only. This must remain at the end
40 * of the file.
41 * ---------------------------------------------------------------------------
42 * Local variables:
43 * c-file-style: "linux"
44 * End:
45 */
diff --git a/arch/um/kernel/tt/process_kern.c b/arch/um/kernel/tt/process_kern.c
index 8368c2dbe635..1e86f0bfef72 100644
--- a/arch/um/kernel/tt/process_kern.c
+++ b/arch/um/kernel/tt/process_kern.c
@@ -142,7 +142,7 @@ static void new_thread_handler(int sig)
142 schedule_tail(current->thread.prev_sched); 142 schedule_tail(current->thread.prev_sched);
143 current->thread.prev_sched = NULL; 143 current->thread.prev_sched = NULL;
144 144
145 init_new_thread_signals(1); 145 init_new_thread_signals();
146 enable_timer(); 146 enable_timer();
147 free_page(current->thread.temp_stack); 147 free_page(current->thread.temp_stack);
148 set_cmdline("(kernel thread)"); 148 set_cmdline("(kernel thread)");
diff --git a/arch/um/kernel/tt/syscall_kern.c b/arch/um/kernel/tt/syscall_kern.c
index 3fda9a03c59a..293caa6d0c2d 100644
--- a/arch/um/kernel/tt/syscall_kern.c
+++ b/arch/um/kernel/tt/syscall_kern.c
@@ -21,18 +21,11 @@ void syscall_handler_tt(int sig, struct pt_regs *regs)
21 void *sc; 21 void *sc;
22 long result; 22 long result;
23 int syscall; 23 int syscall;
24#ifdef CONFIG_SYSCALL_DEBUG 24
25 int index;
26#endif
27 sc = UPT_SC(&regs->regs); 25 sc = UPT_SC(&regs->regs);
28 SC_START_SYSCALL(sc); 26 SC_START_SYSCALL(sc);
29 27
30 syscall = UPT_SYSCALL_NR(&regs->regs); 28 syscall = UPT_SYSCALL_NR(&regs->regs);
31
32#ifdef CONFIG_SYSCALL_DEBUG
33 index = record_syscall_start(syscall);
34#endif
35
36 syscall_trace(&regs->regs, 0); 29 syscall_trace(&regs->regs, 0);
37 30
38 current->thread.nsyscalls++; 31 current->thread.nsyscalls++;
@@ -50,7 +43,4 @@ void syscall_handler_tt(int sig, struct pt_regs *regs)
50 SC_SET_SYSCALL_RETURN(sc, result); 43 SC_SET_SYSCALL_RETURN(sc, result);
51 44
52 syscall_trace(&regs->regs, 1); 45 syscall_trace(&regs->regs, 1);
53#ifdef CONFIG_SYSCALL_DEBUG
54 record_syscall_end(index, result);
55#endif
56} 46}
diff --git a/arch/um/kernel/tt/tracer.c b/arch/um/kernel/tt/tracer.c
index 71daae24e48a..9882342206ec 100644
--- a/arch/um/kernel/tt/tracer.c
+++ b/arch/um/kernel/tt/tracer.c
@@ -188,10 +188,7 @@ int tracer(int (*init_proc)(void *), void *sp)
188 int status, pid = 0, sig = 0, cont_type, tracing = 0, op = 0; 188 int status, pid = 0, sig = 0, cont_type, tracing = 0, op = 0;
189 int proc_id = 0, n, err, old_tracing = 0, strace = 0; 189 int proc_id = 0, n, err, old_tracing = 0, strace = 0;
190 int local_using_sysemu = 0; 190 int local_using_sysemu = 0;
191#ifdef UML_CONFIG_SYSCALL_DEBUG 191
192 unsigned long eip = 0;
193 int last_index;
194#endif
195 signal(SIGPIPE, SIG_IGN); 192 signal(SIGPIPE, SIG_IGN);
196 setup_tracer_winch(); 193 setup_tracer_winch();
197 tracing_pid = os_getpid(); 194 tracing_pid = os_getpid();
@@ -282,23 +279,6 @@ int tracer(int (*init_proc)(void *), void *sp)
282 else if(WIFSTOPPED(status)){ 279 else if(WIFSTOPPED(status)){
283 proc_id = pid_to_processor_id(pid); 280 proc_id = pid_to_processor_id(pid);
284 sig = WSTOPSIG(status); 281 sig = WSTOPSIG(status);
285#ifdef UML_CONFIG_SYSCALL_DEBUG
286 if(signal_index[proc_id] == 1024){
287 signal_index[proc_id] = 0;
288 last_index = 1023;
289 }
290 else last_index = signal_index[proc_id] - 1;
291 if(((sig == SIGPROF) || (sig == SIGVTALRM) ||
292 (sig == SIGALRM)) &&
293 (signal_record[proc_id][last_index].signal == sig)&&
294 (signal_record[proc_id][last_index].pid == pid))
295 signal_index[proc_id] = last_index;
296 signal_record[proc_id][signal_index[proc_id]].pid = pid;
297 gettimeofday(&signal_record[proc_id][signal_index[proc_id]].time, NULL);
298 eip = ptrace(PTRACE_PEEKUSR, pid, PT_IP_OFFSET, 0);
299 signal_record[proc_id][signal_index[proc_id]].addr = eip;
300 signal_record[proc_id][signal_index[proc_id]++].signal = sig;
301#endif
302 if(proc_id == -1){ 282 if(proc_id == -1){
303 sleeping_process_signal(pid, sig); 283 sleeping_process_signal(pid, sig);
304 continue; 284 continue;
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c
index 37cfe7701f06..7896cf98232d 100644
--- a/arch/um/kernel/um_arch.c
+++ b/arch/um/kernel/um_arch.c
@@ -330,6 +330,8 @@ EXPORT_SYMBOL(end_iomem);
330 330
331#define MIN_VMALLOC (32 * 1024 * 1024) 331#define MIN_VMALLOC (32 * 1024 * 1024)
332 332
333extern char __binary_start;
334
333int linux_main(int argc, char **argv) 335int linux_main(int argc, char **argv)
334{ 336{
335 unsigned long avail, diff; 337 unsigned long avail, diff;
@@ -374,8 +376,9 @@ int linux_main(int argc, char **argv)
374 376
375 printf("UML running in %s mode\n", mode); 377 printf("UML running in %s mode\n", mode);
376 378
377 uml_start = CHOOSE_MODE_PROC(set_task_sizes_tt, set_task_sizes_skas, 0, 379 uml_start = (unsigned long) &__binary_start;
378 &host_task_size, &task_size); 380 host_task_size = CHOOSE_MODE_PROC(set_task_sizes_tt,
381 set_task_sizes_skas, &task_size);
379 382
380 /* 383 /*
381 * Setting up handlers to 'sig_info' struct 384 * Setting up handlers to 'sig_info' struct
@@ -395,7 +398,7 @@ int linux_main(int argc, char **argv)
395 physmem_size += UML_ROUND_UP(brk_start) - UML_ROUND_UP(&_end); 398 physmem_size += UML_ROUND_UP(brk_start) - UML_ROUND_UP(&_end);
396 } 399 }
397 400
398 uml_physmem = uml_start; 401 uml_physmem = uml_start & PAGE_MASK;
399 402
400 /* Reserve up to 4M after the current brk */ 403 /* Reserve up to 4M after the current brk */
401 uml_reserved = ROUND_4M(brk_start) + (1 << 22); 404 uml_reserved = ROUND_4M(brk_start) + (1 << 22);
diff --git a/arch/um/kernel/uml.lds.S b/arch/um/kernel/uml.lds.S
index af11915ce0a8..8eca47a6ff08 100644
--- a/arch/um/kernel/uml.lds.S
+++ b/arch/um/kernel/uml.lds.S
@@ -7,13 +7,16 @@ jiffies = jiffies_64;
7 7
8SECTIONS 8SECTIONS
9{ 9{
10 /*This must contain the right address - not quite the default ELF one.*/ 10 /* This must contain the right address - not quite the default ELF one.*/
11 PROVIDE (__executable_start = START); 11 PROVIDE (__executable_start = START);
12 . = START + SIZEOF_HEADERS; 12 /* Static binaries stick stuff here, like the sigreturn trampoline,
13 * invisibly to objdump. So, just make __binary_start equal to the very
14 * beginning of the executable, and if there are unmapped pages after this,
15 * they are forever unusable.
16 */
17 __binary_start = START;
13 18
14 /* Used in arch/um/kernel/mem.c. Any memory between START and __binary_start 19 . = START + SIZEOF_HEADERS;
15 * is remapped.*/
16 __binary_start = .;
17 20
18#ifdef MODE_TT 21#ifdef MODE_TT
19 .remap_data : { UNMAP_PATH (.data .bss) } 22 .remap_data : { UNMAP_PATH (.data .bss) }
diff --git a/arch/um/kernel/vmlinux.lds.S b/arch/um/kernel/vmlinux.lds.S
index 72acdce205e0..f8aeb448aab6 100644
--- a/arch/um/kernel/vmlinux.lds.S
+++ b/arch/um/kernel/vmlinux.lds.S
@@ -1,5 +1,3 @@
1/* in case the preprocessor is a 32bit one */
2#undef i386
3#ifdef CONFIG_LD_SCRIPT_STATIC 1#ifdef CONFIG_LD_SCRIPT_STATIC
4#include "uml.lds.S" 2#include "uml.lds.S"
5#else 3#else
diff --git a/arch/um/os-Linux/file.c b/arch/um/os-Linux/file.c
index 09251338d99e..189fa677085a 100644
--- a/arch/um/os-Linux/file.c
+++ b/arch/um/os-Linux/file.c
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) 2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
@@ -18,6 +18,7 @@
18#include "os.h" 18#include "os.h"
19#include "user.h" 19#include "user.h"
20#include "kern_util.h" 20#include "kern_util.h"
21#include "user_util.h"
21 22
22static void copy_stat(struct uml_stat *dst, struct stat64 *src) 23static void copy_stat(struct uml_stat *dst, struct stat64 *src)
23{ 24{
@@ -42,16 +43,13 @@ int os_stat_fd(const int fd, struct uml_stat *ubuf)
42 struct stat64 sbuf; 43 struct stat64 sbuf;
43 int err; 44 int err;
44 45
45 do { 46 CATCH_EINTR(err = fstat64(fd, &sbuf));
46 err = fstat64(fd, &sbuf);
47 } while((err < 0) && (errno == EINTR)) ;
48
49 if(err < 0) 47 if(err < 0)
50 return(-errno); 48 return -errno;
51 49
52 if(ubuf != NULL) 50 if(ubuf != NULL)
53 copy_stat(ubuf, &sbuf); 51 copy_stat(ubuf, &sbuf);
54 return(err); 52 return err;
55} 53}
56 54
57int os_stat_file(const char *file_name, struct uml_stat *ubuf) 55int os_stat_file(const char *file_name, struct uml_stat *ubuf)
@@ -64,11 +62,11 @@ int os_stat_file(const char *file_name, struct uml_stat *ubuf)
64 } while((err < 0) && (errno == EINTR)) ; 62 } while((err < 0) && (errno == EINTR)) ;
65 63
66 if(err < 0) 64 if(err < 0)
67 return(-errno); 65 return -errno;
68 66
69 if(ubuf != NULL) 67 if(ubuf != NULL)
70 copy_stat(ubuf, &sbuf); 68 copy_stat(ubuf, &sbuf);
71 return(err); 69 return err;
72} 70}
73 71
74int os_access(const char* file, int mode) 72int os_access(const char* file, int mode)
@@ -80,9 +78,9 @@ int os_access(const char* file, int mode)
80 78
81 err = access(file, amode); 79 err = access(file, amode);
82 if(err < 0) 80 if(err < 0)
83 return(-errno); 81 return -errno;
84 82
85 return(0); 83 return 0;
86} 84}
87 85
88void os_print_error(int error, const char* str) 86void os_print_error(int error, const char* str)
@@ -99,9 +97,9 @@ int os_ioctl_generic(int fd, unsigned int cmd, unsigned long arg)
99 97
100 err = ioctl(fd, cmd, arg); 98 err = ioctl(fd, cmd, arg);
101 if(err < 0) 99 if(err < 0)
102 return(-errno); 100 return -errno;
103 101
104 return(err); 102 return err;
105} 103}
106 104
107int os_window_size(int fd, int *rows, int *cols) 105int os_window_size(int fd, int *rows, int *cols)
@@ -109,12 +107,12 @@ int os_window_size(int fd, int *rows, int *cols)
109 struct winsize size; 107 struct winsize size;
110 108
111 if(ioctl(fd, TIOCGWINSZ, &size) < 0) 109 if(ioctl(fd, TIOCGWINSZ, &size) < 0)
112 return(-errno); 110 return -errno;
113 111
114 *rows = size.ws_row; 112 *rows = size.ws_row;
115 *cols = size.ws_col; 113 *cols = size.ws_col;
116 114
117 return(0); 115 return 0;
118} 116}
119 117
120int os_new_tty_pgrp(int fd, int pid) 118int os_new_tty_pgrp(int fd, int pid)
@@ -125,16 +123,16 @@ int os_new_tty_pgrp(int fd, int pid)
125 if(tcsetpgrp(fd, pid) < 0) 123 if(tcsetpgrp(fd, pid) < 0)
126 return -errno; 124 return -errno;
127 125
128 return(0); 126 return 0;
129} 127}
130 128
131/* FIXME: ensure namebuf in os_get_if_name is big enough */ 129/* FIXME: ensure namebuf in os_get_if_name is big enough */
132int os_get_ifname(int fd, char* namebuf) 130int os_get_ifname(int fd, char* namebuf)
133{ 131{
134 if(ioctl(fd, SIOCGIFNAME, namebuf) < 0) 132 if(ioctl(fd, SIOCGIFNAME, namebuf) < 0)
135 return(-errno); 133 return -errno;
136 134
137 return(0); 135 return 0;
138} 136}
139 137
140int os_set_slip(int fd) 138int os_set_slip(int fd)
@@ -149,7 +147,7 @@ int os_set_slip(int fd)
149 if(ioctl(fd, SIOCSIFENCAP, &sencap) < 0) 147 if(ioctl(fd, SIOCSIFENCAP, &sencap) < 0)
150 return -errno; 148 return -errno;
151 149
152 return(0); 150 return 0;
153} 151}
154 152
155int os_set_owner(int fd, int pid) 153int os_set_owner(int fd, int pid)
@@ -158,10 +156,10 @@ int os_set_owner(int fd, int pid)
158 int save_errno = errno; 156 int save_errno = errno;
159 157
160 if(fcntl(fd, F_GETOWN, 0) != pid) 158 if(fcntl(fd, F_GETOWN, 0) != pid)
161 return(-save_errno); 159 return -save_errno;
162 } 160 }
163 161
164 return(0); 162 return 0;
165} 163}
166 164
167/* FIXME? moved wholesale from sigio_user.c to get fcntls out of that file */ 165/* FIXME? moved wholesale from sigio_user.c to get fcntls out of that file */
@@ -192,9 +190,9 @@ int os_mode_fd(int fd, int mode)
192 } while((err < 0) && (errno==EINTR)) ; 190 } while((err < 0) && (errno==EINTR)) ;
193 191
194 if(err < 0) 192 if(err < 0)
195 return(-errno); 193 return -errno;
196 194
197 return(0); 195 return 0;
198} 196}
199 197
200int os_file_type(char *file) 198int os_file_type(char *file)
@@ -204,15 +202,21 @@ int os_file_type(char *file)
204 202
205 err = os_stat_file(file, &buf); 203 err = os_stat_file(file, &buf);
206 if(err < 0) 204 if(err < 0)
207 return(err); 205 return err;
208 206
209 if(S_ISDIR(buf.ust_mode)) return(OS_TYPE_DIR); 207 if(S_ISDIR(buf.ust_mode))
210 else if(S_ISLNK(buf.ust_mode)) return(OS_TYPE_SYMLINK); 208 return OS_TYPE_DIR;
211 else if(S_ISCHR(buf.ust_mode)) return(OS_TYPE_CHARDEV); 209 else if(S_ISLNK(buf.ust_mode))
212 else if(S_ISBLK(buf.ust_mode)) return(OS_TYPE_BLOCKDEV); 210 return OS_TYPE_SYMLINK;
213 else if(S_ISFIFO(buf.ust_mode)) return(OS_TYPE_FIFO); 211 else if(S_ISCHR(buf.ust_mode))
214 else if(S_ISSOCK(buf.ust_mode)) return(OS_TYPE_SOCK); 212 return OS_TYPE_CHARDEV;
215 else return(OS_TYPE_FILE); 213 else if(S_ISBLK(buf.ust_mode))
214 return OS_TYPE_BLOCKDEV;
215 else if(S_ISFIFO(buf.ust_mode))
216 return OS_TYPE_FIFO;
217 else if(S_ISSOCK(buf.ust_mode))
218 return OS_TYPE_SOCK;
219 else return OS_TYPE_FILE;
216} 220}
217 221
218int os_file_mode(char *file, struct openflags *mode_out) 222int os_file_mode(char *file, struct openflags *mode_out)
@@ -302,8 +306,8 @@ int os_seek_file(int fd, __u64 offset)
302 306
303 actual = lseek64(fd, offset, SEEK_SET); 307 actual = lseek64(fd, offset, SEEK_SET);
304 if(actual != offset) 308 if(actual != offset)
305 return(-errno); 309 return -errno;
306 return(0); 310 return 0;
307} 311}
308 312
309static int fault_buffer(void *start, int len, 313static int fault_buffer(void *start, int len,
@@ -314,13 +318,13 @@ static int fault_buffer(void *start, int len,
314 318
315 for(i = 0; i < len; i += page){ 319 for(i = 0; i < len; i += page){
316 if((*copy_proc)(start + i, &c, sizeof(c))) 320 if((*copy_proc)(start + i, &c, sizeof(c)))
317 return(-EFAULT); 321 return -EFAULT;
318 } 322 }
319 if((len % page) != 0){ 323 if((len % page) != 0){
320 if((*copy_proc)(start + len - 1, &c, sizeof(c))) 324 if((*copy_proc)(start + len - 1, &c, sizeof(c)))
321 return(-EFAULT); 325 return -EFAULT;
322 } 326 }
323 return(0); 327 return 0;
324} 328}
325 329
326static int file_io(int fd, void *buf, int len, 330static int file_io(int fd, void *buf, int len,
@@ -334,26 +338,26 @@ static int file_io(int fd, void *buf, int len,
334 if((n < 0) && (errno == EFAULT)){ 338 if((n < 0) && (errno == EFAULT)){
335 err = fault_buffer(buf, len, copy_user_proc); 339 err = fault_buffer(buf, len, copy_user_proc);
336 if(err) 340 if(err)
337 return(err); 341 return err;
338 n = (*io_proc)(fd, buf, len); 342 n = (*io_proc)(fd, buf, len);
339 } 343 }
340 } while((n < 0) && (errno == EINTR)); 344 } while((n < 0) && (errno == EINTR));
341 345
342 if(n < 0) 346 if(n < 0)
343 return(-errno); 347 return -errno;
344 return(n); 348 return n;
345} 349}
346 350
347int os_read_file(int fd, void *buf, int len) 351int os_read_file(int fd, void *buf, int len)
348{ 352{
349 return(file_io(fd, buf, len, (int (*)(int, void *, int)) read, 353 return file_io(fd, buf, len, (int (*)(int, void *, int)) read,
350 copy_from_user_proc)); 354 copy_from_user_proc);
351} 355}
352 356
353int os_write_file(int fd, const void *buf, int len) 357int os_write_file(int fd, const void *buf, int len)
354{ 358{
355 return(file_io(fd, (void *) buf, len, 359 return file_io(fd, (void *) buf, len,
356 (int (*)(int, void *, int)) write, copy_to_user_proc)); 360 (int (*)(int, void *, int)) write, copy_to_user_proc);
357} 361}
358 362
359int os_file_size(char *file, unsigned long long *size_out) 363int os_file_size(char *file, unsigned long long *size_out)
@@ -398,11 +402,11 @@ int os_file_modtime(char *file, unsigned long *modtime)
398 err = os_stat_file(file, &buf); 402 err = os_stat_file(file, &buf);
399 if(err < 0){ 403 if(err < 0){
400 printk("Couldn't stat \"%s\" : err = %d\n", file, -err); 404 printk("Couldn't stat \"%s\" : err = %d\n", file, -err);
401 return(err); 405 return err;
402 } 406 }
403 407
404 *modtime = buf.ust_mtime; 408 *modtime = buf.ust_mtime;
405 return(0); 409 return 0;
406} 410}
407 411
408int os_get_exec_close(int fd, int* close_on_exec) 412int os_get_exec_close(int fd, int* close_on_exec)
@@ -455,7 +459,7 @@ int os_pipe(int *fds, int stream, int close_on_exec)
455 if(err < 0) 459 if(err < 0)
456 goto error; 460 goto error;
457 461
458 return(0); 462 return 0;
459 463
460 error: 464 error:
461 printk("os_pipe : Setting FD_CLOEXEC failed, err = %d\n", -err); 465 printk("os_pipe : Setting FD_CLOEXEC failed, err = %d\n", -err);
@@ -486,12 +490,12 @@ int os_set_fd_async(int fd, int owner)
486 (fcntl(fd, F_SETOWN, owner) < 0)){ 490 (fcntl(fd, F_SETOWN, owner) < 0)){
487 err = -errno; 491 err = -errno;
488 printk("os_set_fd_async : Failed to fcntl F_SETOWN " 492 printk("os_set_fd_async : Failed to fcntl F_SETOWN "
489 "(or F_SETSIG) fd %d to pid %d, errno = %d\n", fd, 493 "(or F_SETSIG) fd %d to pid %d, errno = %d\n", fd,
490 owner, errno); 494 owner, errno);
491 return err; 495 return err;
492 } 496 }
493 497
494 return(0); 498 return 0;
495} 499}
496 500
497int os_clear_fd_async(int fd) 501int os_clear_fd_async(int fd)
@@ -500,8 +504,8 @@ int os_clear_fd_async(int fd)
500 504
501 flags &= ~(O_ASYNC | O_NONBLOCK); 505 flags &= ~(O_ASYNC | O_NONBLOCK);
502 if(fcntl(fd, F_SETFL, flags) < 0) 506 if(fcntl(fd, F_SETFL, flags) < 0)
503 return(-errno); 507 return -errno;
504 return(0); 508 return 0;
505} 509}
506 510
507int os_set_fd_block(int fd, int blocking) 511int os_set_fd_block(int fd, int blocking)
@@ -516,7 +520,7 @@ int os_set_fd_block(int fd, int blocking)
516 if(fcntl(fd, F_SETFL, flags) < 0) 520 if(fcntl(fd, F_SETFL, flags) < 0)
517 return -errno; 521 return -errno;
518 522
519 return(0); 523 return 0;
520} 524}
521 525
522int os_accept_connection(int fd) 526int os_accept_connection(int fd)
@@ -524,9 +528,9 @@ int os_accept_connection(int fd)
524 int new; 528 int new;
525 529
526 new = accept(fd, NULL, 0); 530 new = accept(fd, NULL, 0);
527 if(new < 0) 531 if(new < 0)
528 return(-errno); 532 return -errno;
529 return(new); 533 return new;
530} 534}
531 535
532#ifndef SHUT_RD 536#ifndef SHUT_RD
@@ -550,12 +554,12 @@ int os_shutdown_socket(int fd, int r, int w)
550 else if(w) what = SHUT_WR; 554 else if(w) what = SHUT_WR;
551 else { 555 else {
552 printk("os_shutdown_socket : neither r or w was set\n"); 556 printk("os_shutdown_socket : neither r or w was set\n");
553 return(-EINVAL); 557 return -EINVAL;
554 } 558 }
555 err = shutdown(fd, what); 559 err = shutdown(fd, what);
556 if(err < 0) 560 if(err < 0)
557 return(-errno); 561 return -errno;
558 return(0); 562 return 0;
559} 563}
560 564
561int os_rcv_fd(int fd, int *helper_pid_out) 565int os_rcv_fd(int fd, int *helper_pid_out)
@@ -578,7 +582,7 @@ int os_rcv_fd(int fd, int *helper_pid_out)
578 582
579 n = recvmsg(fd, &msg, 0); 583 n = recvmsg(fd, &msg, 0);
580 if(n < 0) 584 if(n < 0)
581 return(-errno); 585 return -errno;
582 586
583 else if(n != sizeof(iov.iov_len)) 587 else if(n != sizeof(iov.iov_len))
584 *helper_pid_out = -1; 588 *helper_pid_out = -1;
@@ -586,16 +590,16 @@ int os_rcv_fd(int fd, int *helper_pid_out)
586 cmsg = CMSG_FIRSTHDR(&msg); 590 cmsg = CMSG_FIRSTHDR(&msg);
587 if(cmsg == NULL){ 591 if(cmsg == NULL){
588 printk("rcv_fd didn't receive anything, error = %d\n", errno); 592 printk("rcv_fd didn't receive anything, error = %d\n", errno);
589 return(-1); 593 return -1;
590 } 594 }
591 if((cmsg->cmsg_level != SOL_SOCKET) || 595 if((cmsg->cmsg_level != SOL_SOCKET) ||
592 (cmsg->cmsg_type != SCM_RIGHTS)){ 596 (cmsg->cmsg_type != SCM_RIGHTS)){
593 printk("rcv_fd didn't receive a descriptor\n"); 597 printk("rcv_fd didn't receive a descriptor\n");
594 return(-1); 598 return -1;
595 } 599 }
596 600
597 new = ((int *) CMSG_DATA(cmsg))[0]; 601 new = ((int *) CMSG_DATA(cmsg))[0];
598 return(new); 602 return new;
599} 603}
600 604
601int os_create_unix_socket(char *file, int len, int close_on_exec) 605int os_create_unix_socket(char *file, int len, int close_on_exec)
@@ -623,7 +627,7 @@ int os_create_unix_socket(char *file, int len, int close_on_exec)
623 if(err < 0) 627 if(err < 0)
624 return -errno; 628 return -errno;
625 629
626 return(sock); 630 return sock;
627} 631}
628 632
629void os_flush_stdout(void) 633void os_flush_stdout(void)
@@ -654,16 +658,5 @@ int os_lock_file(int fd, int excl)
654 printk("F_SETLK failed, file already locked by pid %d\n", lock.l_pid); 658 printk("F_SETLK failed, file already locked by pid %d\n", lock.l_pid);
655 err = save; 659 err = save;
656 out: 660 out:
657 return(err); 661 return err;
658} 662}
659
660/*
661 * Overrides for Emacs so that we follow Linus's tabbing style.
662 * Emacs will notice this stuff at the end of the file and automatically
663 * adjust the settings for this buffer only. This must remain at the end
664 * of the file.
665 * ---------------------------------------------------------------------------
666 * Local variables:
667 * c-file-style: "linux"
668 * End:
669 */
diff --git a/arch/um/os-Linux/irq.c b/arch/um/os-Linux/irq.c
index 3788d4568d33..7555bf9c33d9 100644
--- a/arch/um/os-Linux/irq.c
+++ b/arch/um/os-Linux/irq.c
@@ -52,11 +52,6 @@ int os_waiting_for_events(struct irq_fd *active_fds)
52 return n; 52 return n;
53} 53}
54 54
55int os_isatty(int fd)
56{
57 return isatty(fd);
58}
59
60int os_create_pollfd(int fd, int events, void *tmp_pfd, int size_tmpfds) 55int os_create_pollfd(int fd, int events, void *tmp_pfd, int size_tmpfds)
61{ 56{
62 if (pollfds_num == pollfds_size) { 57 if (pollfds_num == pollfds_size) {
@@ -142,17 +137,14 @@ void os_set_ioignore(void)
142 137
143void init_irq_signals(int on_sigstack) 138void init_irq_signals(int on_sigstack)
144{ 139{
145 __sighandler_t h;
146 int flags; 140 int flags;
147 141
148 flags = on_sigstack ? SA_ONSTACK : 0; 142 flags = on_sigstack ? SA_ONSTACK : 0;
149 if (timer_irq_inited)
150 h = (__sighandler_t)alarm_handler;
151 else
152 h = boot_timer_handler;
153 143
154 set_handler(SIGVTALRM, h, flags | SA_RESTART, 144 set_handler(SIGVTALRM, (__sighandler_t) alarm_handler,
155 SIGUSR1, SIGIO, SIGWINCH, SIGALRM, -1); 145 flags | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH, SIGALRM, -1);
146 set_handler(SIGALRM, (__sighandler_t) alarm_handler,
147 flags | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH, SIGALRM, -1);
156 set_handler(SIGIO, (__sighandler_t) sig_handler, flags | SA_RESTART, 148 set_handler(SIGIO, (__sighandler_t) sig_handler, flags | SA_RESTART,
157 SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1); 149 SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1);
158 signal(SIGWINCH, SIG_IGN); 150 signal(SIGWINCH, SIG_IGN);
diff --git a/arch/um/os-Linux/process.c b/arch/um/os-Linux/process.c
index 233be2f4f8cb..b98d3ca2cd1b 100644
--- a/arch/um/os-Linux/process.c
+++ b/arch/um/os-Linux/process.c
@@ -250,36 +250,35 @@ void init_new_thread_stack(void *sig_stack, void (*usr1_handler)(int))
250 if(usr1_handler) set_handler(SIGUSR1, usr1_handler, flags, -1); 250 if(usr1_handler) set_handler(SIGUSR1, usr1_handler, flags, -1);
251} 251}
252 252
253void init_new_thread_signals(int altstack) 253void init_new_thread_signals(void)
254{ 254{
255 int flags = altstack ? SA_ONSTACK : 0; 255 set_handler(SIGSEGV, (__sighandler_t) sig_handler, SA_ONSTACK,
256
257 set_handler(SIGSEGV, (__sighandler_t) sig_handler, flags,
258 SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1); 256 SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1);
259 set_handler(SIGTRAP, (__sighandler_t) sig_handler, flags, 257 set_handler(SIGTRAP, (__sighandler_t) sig_handler, SA_ONSTACK,
260 SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1); 258 SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1);
261 set_handler(SIGFPE, (__sighandler_t) sig_handler, flags, 259 set_handler(SIGFPE, (__sighandler_t) sig_handler, SA_ONSTACK,
262 SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1); 260 SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1);
263 set_handler(SIGILL, (__sighandler_t) sig_handler, flags, 261 set_handler(SIGILL, (__sighandler_t) sig_handler, SA_ONSTACK,
264 SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1); 262 SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1);
265 set_handler(SIGBUS, (__sighandler_t) sig_handler, flags, 263 set_handler(SIGBUS, (__sighandler_t) sig_handler, SA_ONSTACK,
266 SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1); 264 SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1);
267 set_handler(SIGUSR2, (__sighandler_t) sig_handler, 265 set_handler(SIGUSR2, (__sighandler_t) sig_handler,
268 flags, SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1); 266 SA_ONSTACK, SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM,
267 -1);
269 signal(SIGHUP, SIG_IGN); 268 signal(SIGHUP, SIG_IGN);
270 269
271 init_irq_signals(altstack); 270 init_irq_signals(1);
272} 271}
273 272
274int run_kernel_thread(int (*fn)(void *), void *arg, void **jmp_ptr) 273int run_kernel_thread(int (*fn)(void *), void *arg, void **jmp_ptr)
275{ 274{
276 jmp_buf buf; 275 jmp_buf buf;
277 int n, enable; 276 int n;
278 277
279 *jmp_ptr = &buf; 278 *jmp_ptr = &buf;
280 n = UML_SETJMP(&buf, enable); 279 n = UML_SETJMP(&buf);
281 if(n != 0) 280 if(n != 0)
282 return(n); 281 return n;
283 (*fn)(arg); 282 (*fn)(arg);
284 return(0); 283 return 0;
285} 284}
diff --git a/arch/um/os-Linux/sigio.c b/arch/um/os-Linux/sigio.c
index 00e9388e947a..0ecac563c7b3 100644
--- a/arch/um/os-Linux/sigio.c
+++ b/arch/um/os-Linux/sigio.c
@@ -43,13 +43,13 @@ struct pollfds {
43/* Protected by sigio_lock(). Used by the sigio thread, but the UML thread 43/* Protected by sigio_lock(). Used by the sigio thread, but the UML thread
44 * synchronizes with it. 44 * synchronizes with it.
45 */ 45 */
46struct pollfds current_poll = { 46static struct pollfds current_poll = {
47 .poll = NULL, 47 .poll = NULL,
48 .size = 0, 48 .size = 0,
49 .used = 0 49 .used = 0
50}; 50};
51 51
52struct pollfds next_poll = { 52static struct pollfds next_poll = {
53 .poll = NULL, 53 .poll = NULL,
54 .size = 0, 54 .size = 0,
55 .used = 0 55 .used = 0
@@ -156,7 +156,7 @@ static void update_thread(void)
156 set_signals(flags); 156 set_signals(flags);
157} 157}
158 158
159int add_sigio_fd(int fd, int read) 159static int add_sigio_fd(int fd, int read)
160{ 160{
161 int err = 0, i, n, events; 161 int err = 0, i, n, events;
162 162
@@ -191,6 +191,13 @@ int ignore_sigio_fd(int fd)
191 struct pollfd *p; 191 struct pollfd *p;
192 int err = 0, i, n = 0; 192 int err = 0, i, n = 0;
193 193
194 /* This is called from exitcalls elsewhere in UML - if
195 * sigio_cleanup has already run, then update_thread will hang
196 * or fail because the thread is no longer running.
197 */
198 if(write_sigio_pid == -1)
199 return -EIO;
200
194 sigio_lock(); 201 sigio_lock();
195 for(i = 0; i < current_poll.used; i++){ 202 for(i = 0; i < current_poll.used; i++){
196 if(current_poll.poll[i].fd == fd) break; 203 if(current_poll.poll[i].fd == fd) break;
@@ -215,7 +222,7 @@ int ignore_sigio_fd(int fd)
215 update_thread(); 222 update_thread();
216 out: 223 out:
217 sigio_unlock(); 224 sigio_unlock();
218 return(err); 225 return err;
219} 226}
220 227
221static struct pollfd *setup_initial_poll(int fd) 228static struct pollfd *setup_initial_poll(int fd)
@@ -233,7 +240,7 @@ static struct pollfd *setup_initial_poll(int fd)
233 return p; 240 return p;
234} 241}
235 242
236void write_sigio_workaround(void) 243static void write_sigio_workaround(void)
237{ 244{
238 unsigned long stack; 245 unsigned long stack;
239 struct pollfd *p; 246 struct pollfd *p;
@@ -314,10 +321,24 @@ out_close1:
314 close(l_write_sigio_fds[1]); 321 close(l_write_sigio_fds[1]);
315} 322}
316 323
317void sigio_cleanup(void) 324void maybe_sigio_broken(int fd, int read)
325{
326 if(!isatty(fd))
327 return;
328
329 if((read || pty_output_sigio) && (!read || pty_close_sigio))
330 return;
331
332 write_sigio_workaround();
333 add_sigio_fd(fd, read);
334}
335
336static void sigio_cleanup(void)
318{ 337{
319 if(write_sigio_pid != -1){ 338 if(write_sigio_pid != -1){
320 os_kill_process(write_sigio_pid, 1); 339 os_kill_process(write_sigio_pid, 1);
321 write_sigio_pid = -1; 340 write_sigio_pid = -1;
322 } 341 }
323} 342}
343
344__uml_exitcall(sigio_cleanup);
diff --git a/arch/um/os-Linux/signal.c b/arch/um/os-Linux/signal.c
index f11b3124a0c8..60e4faedf254 100644
--- a/arch/um/os-Linux/signal.c
+++ b/arch/um/os-Linux/signal.c
@@ -106,29 +106,6 @@ void alarm_handler(ARCH_SIGHDLR_PARAM)
106 set_signals(enabled); 106 set_signals(enabled);
107} 107}
108 108
109extern void do_boot_timer_handler(struct sigcontext * sc);
110
111void boot_timer_handler(ARCH_SIGHDLR_PARAM)
112{
113 struct sigcontext *sc;
114 int enabled;
115
116 ARCH_GET_SIGCONTEXT(sc, sig);
117
118 enabled = signals_enabled;
119 if(!enabled){
120 if(sig == SIGVTALRM)
121 pending |= SIGVTALRM_MASK;
122 else pending |= SIGALRM_MASK;
123 return;
124 }
125
126 block_signals();
127
128 do_boot_timer_handler(sc);
129 set_signals(enabled);
130}
131
132void set_sigstack(void *sig_stack, int size) 109void set_sigstack(void *sig_stack, int size)
133{ 110{
134 stack_t stack = ((stack_t) { .ss_flags = 0, 111 stack_t stack = ((stack_t) { .ss_flags = 0,
diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c
index bd89c6b99d5d..7baf90fda58b 100644
--- a/arch/um/os-Linux/skas/process.c
+++ b/arch/um/os-Linux/skas/process.c
@@ -159,7 +159,7 @@ static int userspace_tramp(void *stack)
159 159
160 ptrace(PTRACE_TRACEME, 0, 0, 0); 160 ptrace(PTRACE_TRACEME, 0, 0, 0);
161 161
162 init_new_thread_signals(1); 162 init_new_thread_signals();
163 enable_timer(); 163 enable_timer();
164 164
165 if(!proc_mm){ 165 if(!proc_mm){
@@ -435,7 +435,6 @@ void new_thread(void *stack, void **switch_buf_ptr, void **fork_buf_ptr,
435{ 435{
436 unsigned long flags; 436 unsigned long flags;
437 jmp_buf switch_buf, fork_buf; 437 jmp_buf switch_buf, fork_buf;
438 int enable;
439 438
440 *switch_buf_ptr = &switch_buf; 439 *switch_buf_ptr = &switch_buf;
441 *fork_buf_ptr = &fork_buf; 440 *fork_buf_ptr = &fork_buf;
@@ -450,7 +449,7 @@ void new_thread(void *stack, void **switch_buf_ptr, void **fork_buf_ptr,
450 */ 449 */
451 flags = get_signals(); 450 flags = get_signals();
452 block_signals(); 451 block_signals();
453 if(UML_SETJMP(&fork_buf, enable) == 0) 452 if(UML_SETJMP(&fork_buf) == 0)
454 new_thread_proc(stack, handler); 453 new_thread_proc(stack, handler);
455 454
456 remove_sigstack(); 455 remove_sigstack();
@@ -467,21 +466,19 @@ void new_thread(void *stack, void **switch_buf_ptr, void **fork_buf_ptr,
467void thread_wait(void *sw, void *fb) 466void thread_wait(void *sw, void *fb)
468{ 467{
469 jmp_buf buf, **switch_buf = sw, *fork_buf; 468 jmp_buf buf, **switch_buf = sw, *fork_buf;
470 int enable;
471 469
472 *switch_buf = &buf; 470 *switch_buf = &buf;
473 fork_buf = fb; 471 fork_buf = fb;
474 if(UML_SETJMP(&buf, enable) == 0) 472 if(UML_SETJMP(&buf) == 0)
475 siglongjmp(*fork_buf, INIT_JMP_REMOVE_SIGSTACK); 473 siglongjmp(*fork_buf, INIT_JMP_REMOVE_SIGSTACK);
476} 474}
477 475
478void switch_threads(void *me, void *next) 476void switch_threads(void *me, void *next)
479{ 477{
480 jmp_buf my_buf, **me_ptr = me, *next_buf = next; 478 jmp_buf my_buf, **me_ptr = me, *next_buf = next;
481 int enable;
482 479
483 *me_ptr = &my_buf; 480 *me_ptr = &my_buf;
484 if(UML_SETJMP(&my_buf, enable) == 0) 481 if(UML_SETJMP(&my_buf) == 0)
485 UML_LONGJMP(next_buf, 1); 482 UML_LONGJMP(next_buf, 1);
486} 483}
487 484
@@ -495,14 +492,14 @@ static jmp_buf *cb_back;
495int start_idle_thread(void *stack, void *switch_buf_ptr, void **fork_buf_ptr) 492int start_idle_thread(void *stack, void *switch_buf_ptr, void **fork_buf_ptr)
496{ 493{
497 jmp_buf **switch_buf = switch_buf_ptr; 494 jmp_buf **switch_buf = switch_buf_ptr;
498 int n, enable; 495 int n;
499 496
500 set_handler(SIGWINCH, (__sighandler_t) sig_handler, 497 set_handler(SIGWINCH, (__sighandler_t) sig_handler,
501 SA_ONSTACK | SA_RESTART, SIGUSR1, SIGIO, SIGALRM, 498 SA_ONSTACK | SA_RESTART, SIGUSR1, SIGIO, SIGALRM,
502 SIGVTALRM, -1); 499 SIGVTALRM, -1);
503 500
504 *fork_buf_ptr = &initial_jmpbuf; 501 *fork_buf_ptr = &initial_jmpbuf;
505 n = UML_SETJMP(&initial_jmpbuf, enable); 502 n = UML_SETJMP(&initial_jmpbuf);
506 switch(n){ 503 switch(n){
507 case INIT_JMP_NEW_THREAD: 504 case INIT_JMP_NEW_THREAD:
508 new_thread_proc((void *) stack, new_thread_handler); 505 new_thread_proc((void *) stack, new_thread_handler);
@@ -529,14 +526,13 @@ int start_idle_thread(void *stack, void *switch_buf_ptr, void **fork_buf_ptr)
529void initial_thread_cb_skas(void (*proc)(void *), void *arg) 526void initial_thread_cb_skas(void (*proc)(void *), void *arg)
530{ 527{
531 jmp_buf here; 528 jmp_buf here;
532 int enable;
533 529
534 cb_proc = proc; 530 cb_proc = proc;
535 cb_arg = arg; 531 cb_arg = arg;
536 cb_back = &here; 532 cb_back = &here;
537 533
538 block_signals(); 534 block_signals();
539 if(UML_SETJMP(&here, enable) == 0) 535 if(UML_SETJMP(&here) == 0)
540 UML_LONGJMP(&initial_jmpbuf, INIT_JMP_CALLBACK); 536 UML_LONGJMP(&initial_jmpbuf, INIT_JMP_CALLBACK);
541 unblock_signals(); 537 unblock_signals();
542 538
diff --git a/arch/um/os-Linux/time.c b/arch/um/os-Linux/time.c
index 280c4fb9b585..4ae73c0e5485 100644
--- a/arch/um/os-Linux/time.c
+++ b/arch/um/os-Linux/time.c
@@ -17,11 +17,6 @@
17#include "kern_constants.h" 17#include "kern_constants.h"
18#include "os.h" 18#include "os.h"
19 19
20/* XXX This really needs to be declared and initialized in a kernel file since
21 * it's in <linux/time.h>
22 */
23extern struct timespec wall_to_monotonic;
24
25static void set_interval(int timer_type) 20static void set_interval(int timer_type)
26{ 21{
27 int usec = 1000000/hz(); 22 int usec = 1000000/hz();
@@ -71,6 +66,7 @@ void switch_timers(int to_real)
71 errno); 66 errno);
72} 67}
73 68
69#ifdef UML_CONFIG_MODE_TT
74void uml_idle_timer(void) 70void uml_idle_timer(void)
75{ 71{
76 if(signal(SIGVTALRM, SIG_IGN) == SIG_ERR) 72 if(signal(SIGVTALRM, SIG_IGN) == SIG_ERR)
@@ -80,14 +76,7 @@ void uml_idle_timer(void)
80 SA_RESTART, SIGUSR1, SIGIO, SIGWINCH, SIGVTALRM, -1); 76 SA_RESTART, SIGUSR1, SIGIO, SIGWINCH, SIGVTALRM, -1);
81 set_interval(ITIMER_REAL); 77 set_interval(ITIMER_REAL);
82} 78}
83 79#endif
84void time_init(void)
85{
86 if(signal(SIGVTALRM, boot_timer_handler) == SIG_ERR)
87 panic("Couldn't set SIGVTALRM handler");
88 set_interval(ITIMER_VIRTUAL);
89 time_init_kern();
90}
91 80
92unsigned long long os_nsecs(void) 81unsigned long long os_nsecs(void)
93{ 82{
@@ -106,15 +95,7 @@ void idle_sleep(int secs)
106 nanosleep(&ts, NULL); 95 nanosleep(&ts, NULL);
107} 96}
108 97
109/* XXX This partly duplicates init_irq_signals */
110
111void user_time_init(void) 98void user_time_init(void)
112{ 99{
113 set_handler(SIGVTALRM, (__sighandler_t) alarm_handler,
114 SA_ONSTACK | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH,
115 SIGALRM, SIGUSR2, -1);
116 set_handler(SIGALRM, (__sighandler_t) alarm_handler,
117 SA_ONSTACK | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH,
118 SIGVTALRM, SIGUSR2, -1);
119 set_interval(ITIMER_VIRTUAL); 100 set_interval(ITIMER_VIRTUAL);
120} 101}
diff --git a/arch/um/os-Linux/uaccess.c b/arch/um/os-Linux/uaccess.c
index e523719330b2..865f6a6a2590 100644
--- a/arch/um/os-Linux/uaccess.c
+++ b/arch/um/os-Linux/uaccess.c
@@ -14,11 +14,10 @@ unsigned long __do_user_copy(void *to, const void *from, int n,
14 int n), int *faulted_out) 14 int n), int *faulted_out)
15{ 15{
16 unsigned long *faddrp = (unsigned long *) fault_addr, ret; 16 unsigned long *faddrp = (unsigned long *) fault_addr, ret;
17 int enable;
18 17
19 jmp_buf jbuf; 18 jmp_buf jbuf;
20 *fault_catcher = &jbuf; 19 *fault_catcher = &jbuf;
21 if(UML_SETJMP(&jbuf, enable) == 0){ 20 if(UML_SETJMP(&jbuf) == 0){
22 (*op)(to, from, n); 21 (*op)(to, from, n);
23 ret = 0; 22 ret = 0;
24 *faulted_out = 0; 23 *faulted_out = 0;
diff --git a/arch/v850/kernel/setup.c b/arch/v850/kernel/setup.c
index 62bdb8d29fc0..1bf672a25692 100644
--- a/arch/v850/kernel/setup.c
+++ b/arch/v850/kernel/setup.c
@@ -1,8 +1,8 @@
1/* 1/*
2 * arch/v850/kernel/setup.c -- Arch-dependent initialization functions 2 * arch/v850/kernel/setup.c -- Arch-dependent initialization functions
3 * 3 *
4 * Copyright (C) 2001,02,03,05 NEC Electronics Corporation 4 * Copyright (C) 2001,02,03,05,06 NEC Electronics Corporation
5 * Copyright (C) 2001,02,03,05 Miles Bader <miles@gnu.org> 5 * Copyright (C) 2001,02,03,05,06 Miles Bader <miles@gnu.org>
6 * 6 *
7 * This file is subject to the terms and conditions of the GNU General 7 * This file is subject to the terms and conditions of the GNU General
8 * Public License. See the file COPYING in the main directory of this 8 * Public License. See the file COPYING in the main directory of this
@@ -190,7 +190,7 @@ void free_initmem (void)
190 for (addr = start; addr < end; addr += PAGE_SIZE) { 190 for (addr = start; addr < end; addr += PAGE_SIZE) {
191 struct page *page = virt_to_page (addr); 191 struct page *page = virt_to_page (addr);
192 ClearPageReserved (page); 192 ClearPageReserved (page);
193 set_page_count (page, 1); 193 init_page_count (page);
194 __free_page (page); 194 __free_page (page);
195 total_ram_pages++; 195 total_ram_pages++;
196 } 196 }
diff --git a/arch/v850/kernel/v850_ksyms.c b/arch/v850/kernel/v850_ksyms.c
index c03ad6ed61cc..67bc48e57c60 100644
--- a/arch/v850/kernel/v850_ksyms.c
+++ b/arch/v850/kernel/v850_ksyms.c
@@ -21,9 +21,6 @@ EXPORT_SYMBOL (trap_table);
21 21
22/* platform dependent support */ 22/* platform dependent support */
23EXPORT_SYMBOL (kernel_thread); 23EXPORT_SYMBOL (kernel_thread);
24EXPORT_SYMBOL (enable_irq);
25EXPORT_SYMBOL (disable_irq);
26EXPORT_SYMBOL (disable_irq_nosync);
27EXPORT_SYMBOL (__bug); 24EXPORT_SYMBOL (__bug);
28 25
29/* Networking helper routines. */ 26/* Networking helper routines. */
@@ -33,22 +30,9 @@ EXPORT_SYMBOL (ip_compute_csum);
33EXPORT_SYMBOL (ip_fast_csum); 30EXPORT_SYMBOL (ip_fast_csum);
34 31
35/* string / mem functions */ 32/* string / mem functions */
36EXPORT_SYMBOL (strcpy);
37EXPORT_SYMBOL (strncpy);
38EXPORT_SYMBOL (strcat);
39EXPORT_SYMBOL (strncat);
40EXPORT_SYMBOL (strcmp);
41EXPORT_SYMBOL (strncmp);
42EXPORT_SYMBOL (strchr);
43EXPORT_SYMBOL (strlen);
44EXPORT_SYMBOL (strnlen);
45EXPORT_SYMBOL (strrchr);
46EXPORT_SYMBOL (strstr);
47EXPORT_SYMBOL (memset); 33EXPORT_SYMBOL (memset);
48EXPORT_SYMBOL (memcpy); 34EXPORT_SYMBOL (memcpy);
49EXPORT_SYMBOL (memmove); 35EXPORT_SYMBOL (memmove);
50EXPORT_SYMBOL (memcmp);
51EXPORT_SYMBOL (memscan);
52 36
53/* semaphores */ 37/* semaphores */
54EXPORT_SYMBOL (__down); 38EXPORT_SYMBOL (__down);
diff --git a/arch/x86_64/defconfig b/arch/x86_64/defconfig
index e69d403949c8..840d5d93d5cc 100644
--- a/arch/x86_64/defconfig
+++ b/arch/x86_64/defconfig
@@ -1,11 +1,13 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-git6 3# Linux kernel version: 2.6.18-rc2
4# Sat Jun 24 00:52:28 2006 4# Tue Jul 18 17:13:20 2006
5# 5#
6CONFIG_X86_64=y 6CONFIG_X86_64=y
7CONFIG_64BIT=y 7CONFIG_64BIT=y
8CONFIG_X86=y 8CONFIG_X86=y
9CONFIG_LOCKDEP_SUPPORT=y
10CONFIG_STACKTRACE_SUPPORT=y
9CONFIG_SEMAPHORE_SLEEPERS=y 11CONFIG_SEMAPHORE_SLEEPERS=y
10CONFIG_MMU=y 12CONFIG_MMU=y
11CONFIG_RWSEM_GENERIC_SPINLOCK=y 13CONFIG_RWSEM_GENERIC_SPINLOCK=y
@@ -17,6 +19,7 @@ CONFIG_GENERIC_ISA_DMA=y
17CONFIG_GENERIC_IOMAP=y 19CONFIG_GENERIC_IOMAP=y
18CONFIG_ARCH_MAY_HAVE_PC_FDC=y 20CONFIG_ARCH_MAY_HAVE_PC_FDC=y
19CONFIG_DMI=y 21CONFIG_DMI=y
22CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
20 23
21# 24#
22# Code maturity level options 25# Code maturity level options
@@ -34,6 +37,7 @@ CONFIG_SWAP=y
34CONFIG_SYSVIPC=y 37CONFIG_SYSVIPC=y
35CONFIG_POSIX_MQUEUE=y 38CONFIG_POSIX_MQUEUE=y
36# CONFIG_BSD_PROCESS_ACCT is not set 39# CONFIG_BSD_PROCESS_ACCT is not set
40# CONFIG_TASKSTATS is not set
37CONFIG_SYSCTL=y 41CONFIG_SYSCTL=y
38# CONFIG_AUDIT is not set 42# CONFIG_AUDIT is not set
39CONFIG_IKCONFIG=y 43CONFIG_IKCONFIG=y
@@ -52,10 +56,12 @@ CONFIG_PRINTK=y
52CONFIG_BUG=y 56CONFIG_BUG=y
53CONFIG_ELF_CORE=y 57CONFIG_ELF_CORE=y
54CONFIG_BASE_FULL=y 58CONFIG_BASE_FULL=y
59CONFIG_RT_MUTEXES=y
55CONFIG_FUTEX=y 60CONFIG_FUTEX=y
56CONFIG_EPOLL=y 61CONFIG_EPOLL=y
57CONFIG_SHMEM=y 62CONFIG_SHMEM=y
58CONFIG_SLAB=y 63CONFIG_SLAB=y
64CONFIG_VM_EVENT_COUNTERS=y
59# CONFIG_TINY_SHMEM is not set 65# CONFIG_TINY_SHMEM is not set
60CONFIG_BASE_SMALL=0 66CONFIG_BASE_SMALL=0
61# CONFIG_SLOB is not set 67# CONFIG_SLOB is not set
@@ -136,10 +142,12 @@ CONFIG_NEED_MULTIPLE_NODES=y
136# CONFIG_SPARSEMEM_STATIC is not set 142# CONFIG_SPARSEMEM_STATIC is not set
137CONFIG_SPLIT_PTLOCK_CPUS=4 143CONFIG_SPLIT_PTLOCK_CPUS=4
138CONFIG_MIGRATION=y 144CONFIG_MIGRATION=y
145CONFIG_RESOURCES_64BIT=y
139CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y 146CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y
140CONFIG_OUT_OF_LINE_PFN_TO_PAGE=y 147CONFIG_OUT_OF_LINE_PFN_TO_PAGE=y
141CONFIG_NR_CPUS=32 148CONFIG_NR_CPUS=32
142CONFIG_HOTPLUG_CPU=y 149CONFIG_HOTPLUG_CPU=y
150CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
143CONFIG_HPET_TIMER=y 151CONFIG_HPET_TIMER=y
144CONFIG_HPET_EMULATE_RTC=y 152CONFIG_HPET_EMULATE_RTC=y
145CONFIG_IOMMU=y 153CONFIG_IOMMU=y
@@ -186,6 +194,7 @@ CONFIG_ACPI_BUTTON=y
186# CONFIG_ACPI_VIDEO is not set 194# CONFIG_ACPI_VIDEO is not set
187# CONFIG_ACPI_HOTKEY is not set 195# CONFIG_ACPI_HOTKEY is not set
188CONFIG_ACPI_FAN=y 196CONFIG_ACPI_FAN=y
197# CONFIG_ACPI_DOCK is not set
189CONFIG_ACPI_PROCESSOR=y 198CONFIG_ACPI_PROCESSOR=y
190CONFIG_ACPI_HOTPLUG_CPU=y 199CONFIG_ACPI_HOTPLUG_CPU=y
191CONFIG_ACPI_THERMAL=y 200CONFIG_ACPI_THERMAL=y
@@ -200,7 +209,7 @@ CONFIG_ACPI_POWER=y
200CONFIG_ACPI_SYSTEM=y 209CONFIG_ACPI_SYSTEM=y
201CONFIG_X86_PM_TIMER=y 210CONFIG_X86_PM_TIMER=y
202CONFIG_ACPI_CONTAINER=y 211CONFIG_ACPI_CONTAINER=y
203CONFIG_ACPI_HOTPLUG_MEMORY=y 212# CONFIG_ACPI_SBS is not set
204 213
205# 214#
206# CPU Frequency scaling 215# CPU Frequency scaling
@@ -405,6 +414,7 @@ CONFIG_BLK_DEV_LOOP=y
405CONFIG_BLK_DEV_RAM=y 414CONFIG_BLK_DEV_RAM=y
406CONFIG_BLK_DEV_RAM_COUNT=16 415CONFIG_BLK_DEV_RAM_COUNT=16
407CONFIG_BLK_DEV_RAM_SIZE=4096 416CONFIG_BLK_DEV_RAM_SIZE=4096
417CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
408CONFIG_BLK_DEV_INITRD=y 418CONFIG_BLK_DEV_INITRD=y
409# CONFIG_CDROM_PKTCDVD is not set 419# CONFIG_CDROM_PKTCDVD is not set
410# CONFIG_ATA_OVER_ETH is not set 420# CONFIG_ATA_OVER_ETH is not set
@@ -801,6 +811,7 @@ CONFIG_SERIO_LIBPS2=y
801CONFIG_VT=y 811CONFIG_VT=y
802CONFIG_VT_CONSOLE=y 812CONFIG_VT_CONSOLE=y
803CONFIG_HW_CONSOLE=y 813CONFIG_HW_CONSOLE=y
814# CONFIG_VT_HW_CONSOLE_BINDING is not set
804# CONFIG_SERIAL_NONSTANDARD is not set 815# CONFIG_SERIAL_NONSTANDARD is not set
805 816
806# 817#
@@ -870,6 +881,9 @@ CONFIG_SOFT_WATCHDOG=y
870# 881#
871# CONFIG_USBPCWATCHDOG is not set 882# CONFIG_USBPCWATCHDOG is not set
872CONFIG_HW_RANDOM=y 883CONFIG_HW_RANDOM=y
884CONFIG_HW_RANDOM_INTEL=y
885CONFIG_HW_RANDOM_AMD=y
886# CONFIG_HW_RANDOM_GEODE is not set
873# CONFIG_NVRAM is not set 887# CONFIG_NVRAM is not set
874CONFIG_RTC=y 888CONFIG_RTC=y
875# CONFIG_DTLK is not set 889# CONFIG_DTLK is not set
@@ -886,6 +900,7 @@ CONFIG_AGP_INTEL=y
886# CONFIG_AGP_VIA is not set 900# CONFIG_AGP_VIA is not set
887# CONFIG_DRM is not set 901# CONFIG_DRM is not set
888# CONFIG_MWAVE is not set 902# CONFIG_MWAVE is not set
903# CONFIG_PC8736x_GPIO is not set
889CONFIG_RAW_DRIVER=y 904CONFIG_RAW_DRIVER=y
890CONFIG_MAX_RAW_DEVS=256 905CONFIG_MAX_RAW_DEVS=256
891CONFIG_HPET=y 906CONFIG_HPET=y
@@ -1030,8 +1045,8 @@ CONFIG_VIDEO_V4L2=y
1030# 1045#
1031# Graphics support 1046# Graphics support
1032# 1047#
1048# CONFIG_FIRMWARE_EDID is not set
1033# CONFIG_FB is not set 1049# CONFIG_FB is not set
1034CONFIG_VIDEO_SELECT=y
1035 1050
1036# 1051#
1037# Console display driver support 1052# Console display driver support
@@ -1039,6 +1054,7 @@ CONFIG_VIDEO_SELECT=y
1039CONFIG_VGA_CONSOLE=y 1054CONFIG_VGA_CONSOLE=y
1040CONFIG_VGACON_SOFT_SCROLLBACK=y 1055CONFIG_VGACON_SOFT_SCROLLBACK=y
1041CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=256 1056CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=256
1057CONFIG_VIDEO_SELECT=y
1042CONFIG_DUMMY_CONSOLE=y 1058CONFIG_DUMMY_CONSOLE=y
1043 1059
1044# 1060#
@@ -1181,7 +1197,7 @@ CONFIG_USB_MON=y
1181# CONFIG_USB_LEGOTOWER is not set 1197# CONFIG_USB_LEGOTOWER is not set
1182# CONFIG_USB_LCD is not set 1198# CONFIG_USB_LCD is not set
1183# CONFIG_USB_LED is not set 1199# CONFIG_USB_LED is not set
1184# CONFIG_USB_CY7C63 is not set 1200# CONFIG_USB_CYPRESS_CY7C63 is not set
1185# CONFIG_USB_CYTHERM is not set 1201# CONFIG_USB_CYTHERM is not set
1186# CONFIG_USB_PHIDGETKIT is not set 1202# CONFIG_USB_PHIDGETKIT is not set
1187# CONFIG_USB_PHIDGETSERVO is not set 1203# CONFIG_USB_PHIDGETSERVO is not set
@@ -1424,16 +1440,24 @@ CONFIG_KPROBES=y
1424# 1440#
1425# Kernel hacking 1441# Kernel hacking
1426# 1442#
1443CONFIG_TRACE_IRQFLAGS_SUPPORT=y
1427# CONFIG_PRINTK_TIME is not set 1444# CONFIG_PRINTK_TIME is not set
1428CONFIG_MAGIC_SYSRQ=y 1445CONFIG_MAGIC_SYSRQ=y
1446CONFIG_UNUSED_SYMBOLS=y
1429CONFIG_DEBUG_KERNEL=y 1447CONFIG_DEBUG_KERNEL=y
1430CONFIG_LOG_BUF_SHIFT=18 1448CONFIG_LOG_BUF_SHIFT=18
1431CONFIG_DETECT_SOFTLOCKUP=y 1449CONFIG_DETECT_SOFTLOCKUP=y
1432# CONFIG_SCHEDSTATS is not set 1450# CONFIG_SCHEDSTATS is not set
1433# CONFIG_DEBUG_SLAB is not set 1451# CONFIG_DEBUG_SLAB is not set
1434# CONFIG_DEBUG_MUTEXES is not set 1452# CONFIG_DEBUG_RT_MUTEXES is not set
1453# CONFIG_RT_MUTEX_TESTER is not set
1435# CONFIG_DEBUG_SPINLOCK is not set 1454# CONFIG_DEBUG_SPINLOCK is not set
1455# CONFIG_DEBUG_MUTEXES is not set
1456# CONFIG_DEBUG_RWSEMS is not set
1457# CONFIG_DEBUG_LOCK_ALLOC is not set
1458# CONFIG_PROVE_LOCKING is not set
1436# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1459# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1460# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1437# CONFIG_DEBUG_KOBJECT is not set 1461# CONFIG_DEBUG_KOBJECT is not set
1438# CONFIG_DEBUG_INFO is not set 1462# CONFIG_DEBUG_INFO is not set
1439CONFIG_DEBUG_FS=y 1463CONFIG_DEBUG_FS=y
@@ -1445,6 +1469,8 @@ CONFIG_STACK_UNWIND=y
1445# CONFIG_RCU_TORTURE_TEST is not set 1469# CONFIG_RCU_TORTURE_TEST is not set
1446# CONFIG_DEBUG_RODATA is not set 1470# CONFIG_DEBUG_RODATA is not set
1447# CONFIG_IOMMU_DEBUG is not set 1471# CONFIG_IOMMU_DEBUG is not set
1472CONFIG_DEBUG_STACKOVERFLOW=y
1473# CONFIG_DEBUG_STACK_USAGE is not set
1448 1474
1449# 1475#
1450# Security options 1476# Security options
@@ -1468,3 +1494,4 @@ CONFIG_STACK_UNWIND=y
1468# CONFIG_CRC16 is not set 1494# CONFIG_CRC16 is not set
1469CONFIG_CRC32=y 1495CONFIG_CRC32=y
1470# CONFIG_LIBCRC32C is not set 1496# CONFIG_LIBCRC32C is not set
1497CONFIG_PLIST=y
diff --git a/arch/x86_64/ia32/Makefile b/arch/x86_64/ia32/Makefile
index 62bc5f56da9e..cdae36435e21 100644
--- a/arch/x86_64/ia32/Makefile
+++ b/arch/x86_64/ia32/Makefile
@@ -23,6 +23,7 @@ targets := $(foreach F,sysenter syscall,vsyscall-$F.o vsyscall-$F.so)
23# The DSO images are built using a special linker script 23# The DSO images are built using a special linker script
24quiet_cmd_syscall = SYSCALL $@ 24quiet_cmd_syscall = SYSCALL $@
25 cmd_syscall = $(CC) -m32 -nostdlib -shared -s \ 25 cmd_syscall = $(CC) -m32 -nostdlib -shared -s \
26 $(call ld-option, -Wl$(comma)--hash-style=sysv) \
26 -Wl,-soname=linux-gate.so.1 -o $@ \ 27 -Wl,-soname=linux-gate.so.1 -o $@ \
27 -Wl,-T,$(filter-out FORCE,$^) 28 -Wl,-T,$(filter-out FORCE,$^)
28 29
diff --git a/arch/x86_64/ia32/ia32_binfmt.c b/arch/x86_64/ia32/ia32_binfmt.c
index 926c4743d13b..a9dc0f3b5b51 100644
--- a/arch/x86_64/ia32/ia32_binfmt.c
+++ b/arch/x86_64/ia32/ia32_binfmt.c
@@ -182,7 +182,7 @@ struct elf_prpsinfo
182#define user user32 182#define user user32
183 183
184#define __ASM_X86_64_ELF_H 1 184#define __ASM_X86_64_ELF_H 1
185#define elf_read_implies_exec(ex, have_pt_gnu_stack) (!(have_pt_gnu_stack)) 185#define elf_read_implies_exec(ex, executable_stack) (executable_stack != EXSTACK_DISABLE_X)
186//#include <asm/ia32.h> 186//#include <asm/ia32.h>
187#include <linux/elf.h> 187#include <linux/elf.h>
188 188
diff --git a/arch/x86_64/ia32/ia32entry.S b/arch/x86_64/ia32/ia32entry.S
index 9b5bb413a6e9..5d4a7d125ed0 100644
--- a/arch/x86_64/ia32/ia32entry.S
+++ b/arch/x86_64/ia32/ia32entry.S
@@ -103,7 +103,7 @@ ENTRY(ia32_sysenter_target)
103 pushq %rax 103 pushq %rax
104 CFI_ADJUST_CFA_OFFSET 8 104 CFI_ADJUST_CFA_OFFSET 8
105 cld 105 cld
106 SAVE_ARGS 0,0,1 106 SAVE_ARGS 0,0,0
107 /* no need to do an access_ok check here because rbp has been 107 /* no need to do an access_ok check here because rbp has been
108 32bit zero extended */ 108 32bit zero extended */
1091: movl (%rbp),%r9d 1091: movl (%rbp),%r9d
diff --git a/arch/x86_64/ia32/ptrace32.c b/arch/x86_64/ia32/ptrace32.c
index a590b7a0d92d..659c0722f6b8 100644
--- a/arch/x86_64/ia32/ptrace32.c
+++ b/arch/x86_64/ia32/ptrace32.c
@@ -202,17 +202,24 @@ static long ptrace32_siginfo(unsigned request, u32 pid, u32 addr, u32 data)
202{ 202{
203 int ret; 203 int ret;
204 compat_siginfo_t *si32 = (compat_siginfo_t *)compat_ptr(data); 204 compat_siginfo_t *si32 = (compat_siginfo_t *)compat_ptr(data);
205 siginfo_t ssi;
205 siginfo_t *si = compat_alloc_user_space(sizeof(siginfo_t)); 206 siginfo_t *si = compat_alloc_user_space(sizeof(siginfo_t));
206 if (request == PTRACE_SETSIGINFO) { 207 if (request == PTRACE_SETSIGINFO) {
207 ret = copy_siginfo_from_user32(si, si32); 208 memset(&ssi, 0, sizeof(siginfo_t));
209 ret = copy_siginfo_from_user32(&ssi, si32);
208 if (ret) 210 if (ret)
209 return ret; 211 return ret;
212 if (copy_to_user(si, &ssi, sizeof(siginfo_t)))
213 return -EFAULT;
210 } 214 }
211 ret = sys_ptrace(request, pid, addr, (unsigned long)si); 215 ret = sys_ptrace(request, pid, addr, (unsigned long)si);
212 if (ret) 216 if (ret)
213 return ret; 217 return ret;
214 if (request == PTRACE_GETSIGINFO) 218 if (request == PTRACE_GETSIGINFO) {
215 ret = copy_siginfo_to_user32(si32, si); 219 if (copy_from_user(&ssi, si, sizeof(siginfo_t)))
220 return -EFAULT;
221 ret = copy_siginfo_to_user32(si32, &ssi);
222 }
216 return ret; 223 return ret;
217} 224}
218 225
diff --git a/arch/x86_64/ia32/vsyscall.lds b/arch/x86_64/ia32/vsyscall.lds
index f2e75ed4c6c7..1dc86ff5bcb9 100644
--- a/arch/x86_64/ia32/vsyscall.lds
+++ b/arch/x86_64/ia32/vsyscall.lds
@@ -11,6 +11,7 @@ SECTIONS
11 . = VSYSCALL_BASE + SIZEOF_HEADERS; 11 . = VSYSCALL_BASE + SIZEOF_HEADERS;
12 12
13 .hash : { *(.hash) } :text 13 .hash : { *(.hash) } :text
14 .gnu.hash : { *(.gnu.hash) }
14 .dynsym : { *(.dynsym) } 15 .dynsym : { *(.dynsym) }
15 .dynstr : { *(.dynstr) } 16 .dynstr : { *(.dynstr) }
16 .gnu.version : { *(.gnu.version) } 17 .gnu.version : { *(.gnu.version) }
diff --git a/arch/x86_64/kernel/e820.c b/arch/x86_64/kernel/e820.c
index b8eee4c7888b..e56c2adf57a4 100644
--- a/arch/x86_64/kernel/e820.c
+++ b/arch/x86_64/kernel/e820.c
@@ -17,6 +17,7 @@
17#include <linux/kexec.h> 17#include <linux/kexec.h>
18#include <linux/module.h> 18#include <linux/module.h>
19 19
20#include <asm/pgtable.h>
20#include <asm/page.h> 21#include <asm/page.h>
21#include <asm/e820.h> 22#include <asm/e820.h>
22#include <asm/proto.h> 23#include <asm/proto.h>
diff --git a/arch/x86_64/kernel/early_printk.c b/arch/x86_64/kernel/early_printk.c
index b93ef5b51980..140051e07fa6 100644
--- a/arch/x86_64/kernel/early_printk.c
+++ b/arch/x86_64/kernel/early_printk.c
@@ -2,7 +2,7 @@
2#include <linux/kernel.h> 2#include <linux/kernel.h>
3#include <linux/init.h> 3#include <linux/init.h>
4#include <linux/string.h> 4#include <linux/string.h>
5#include <linux/tty.h> 5#include <linux/screen_info.h>
6#include <asm/io.h> 6#include <asm/io.h>
7#include <asm/processor.h> 7#include <asm/processor.h>
8#include <asm/fcntl.h> 8#include <asm/fcntl.h>
diff --git a/arch/x86_64/kernel/entry.S b/arch/x86_64/kernel/entry.S
index d464dded68c0..6f810424df44 100644
--- a/arch/x86_64/kernel/entry.S
+++ b/arch/x86_64/kernel/entry.S
@@ -513,6 +513,7 @@ END(stub_rt_sigreturn)
513 swapgs 513 swapgs
5141: incl %gs:pda_irqcount # RED-PEN should check preempt count 5141: incl %gs:pda_irqcount # RED-PEN should check preempt count
515 cmoveq %gs:pda_irqstackptr,%rsp 515 cmoveq %gs:pda_irqstackptr,%rsp
516 push %rbp # backlink for old unwinder
516 /* 517 /*
517 * We entered an interrupt context - irqs are off: 518 * We entered an interrupt context - irqs are off:
518 */ 519 */
@@ -1139,18 +1140,21 @@ ENTRY(machine_check)
1139END(machine_check) 1140END(machine_check)
1140#endif 1141#endif
1141 1142
1143/* Call softirq on interrupt stack. Interrupts are off. */
1142ENTRY(call_softirq) 1144ENTRY(call_softirq)
1143 CFI_STARTPROC 1145 CFI_STARTPROC
1144 movq %gs:pda_irqstackptr,%rax 1146 push %rbp
1145 movq %rsp,%rdx 1147 CFI_ADJUST_CFA_OFFSET 8
1146 CFI_DEF_CFA_REGISTER rdx 1148 CFI_REL_OFFSET rbp,0
1149 mov %rsp,%rbp
1150 CFI_DEF_CFA_REGISTER rbp
1147 incl %gs:pda_irqcount 1151 incl %gs:pda_irqcount
1148 cmove %rax,%rsp 1152 cmove %gs:pda_irqstackptr,%rsp
1149 pushq %rdx 1153 push %rbp # backlink for old unwinder
1150 /*todo CFI_DEF_CFA_EXPRESSION ...*/
1151 call __do_softirq 1154 call __do_softirq
1152 popq %rsp 1155 leaveq
1153 CFI_DEF_CFA_REGISTER rsp 1156 CFI_DEF_CFA_REGISTER rsp
1157 CFI_ADJUST_CFA_OFFSET -8
1154 decl %gs:pda_irqcount 1158 decl %gs:pda_irqcount
1155 ret 1159 ret
1156 CFI_ENDPROC 1160 CFI_ENDPROC
diff --git a/arch/x86_64/kernel/machine_kexec.c b/arch/x86_64/kernel/machine_kexec.c
index 83fb24a02821..106076b370fc 100644
--- a/arch/x86_64/kernel/machine_kexec.c
+++ b/arch/x86_64/kernel/machine_kexec.c
@@ -207,14 +207,11 @@ NORET_TYPE void machine_kexec(struct kimage *image)
207 __flush_tlb(); 207 __flush_tlb();
208 208
209 209
210 /* The segment registers are funny things, they are 210 /* The segment registers are funny things, they have both a
211 * automatically loaded from a table, in memory wherever you 211 * visible and an invisible part. Whenever the visible part is
212 * set them to a specific selector, but this table is never 212 * set to a specific selector, the invisible part is loaded
213 * accessed again unless you set the segment to a different selector. 213 * with from a table in memory. At no other time is the
214 * 214 * descriptor table in memory accessed.
215 * The more common model are caches where the behide
216 * the scenes work is done, but is also dropped at arbitrary
217 * times.
218 * 215 *
219 * I take advantage of this here by force loading the 216 * I take advantage of this here by force loading the
220 * segments, before I zap the gdt with an invalid value. 217 * segments, before I zap the gdt with an invalid value.
diff --git a/arch/x86_64/kernel/mce.c b/arch/x86_64/kernel/mce.c
index 88845674c661..4e017fb30fb3 100644
--- a/arch/x86_64/kernel/mce.c
+++ b/arch/x86_64/kernel/mce.c
@@ -615,7 +615,7 @@ static __cpuinit int mce_create_device(unsigned int cpu)
615} 615}
616 616
617#ifdef CONFIG_HOTPLUG_CPU 617#ifdef CONFIG_HOTPLUG_CPU
618static __cpuinit void mce_remove_device(unsigned int cpu) 618static void mce_remove_device(unsigned int cpu)
619{ 619{
620 int i; 620 int i;
621 621
@@ -626,10 +626,9 @@ static __cpuinit void mce_remove_device(unsigned int cpu)
626 sysdev_remove_file(&per_cpu(device_mce,cpu), &attr_check_interval); 626 sysdev_remove_file(&per_cpu(device_mce,cpu), &attr_check_interval);
627 sysdev_unregister(&per_cpu(device_mce,cpu)); 627 sysdev_unregister(&per_cpu(device_mce,cpu));
628} 628}
629#endif
630 629
631/* Get notified when a cpu comes on/off. Be hotplug friendly. */ 630/* Get notified when a cpu comes on/off. Be hotplug friendly. */
632static __cpuinit int 631static int
633mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) 632mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
634{ 633{
635 unsigned int cpu = (unsigned long)hcpu; 634 unsigned int cpu = (unsigned long)hcpu;
@@ -638,18 +637,17 @@ mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
638 case CPU_ONLINE: 637 case CPU_ONLINE:
639 mce_create_device(cpu); 638 mce_create_device(cpu);
640 break; 639 break;
641#ifdef CONFIG_HOTPLUG_CPU
642 case CPU_DEAD: 640 case CPU_DEAD:
643 mce_remove_device(cpu); 641 mce_remove_device(cpu);
644 break; 642 break;
645#endif
646 } 643 }
647 return NOTIFY_OK; 644 return NOTIFY_OK;
648} 645}
649 646
650static struct notifier_block __cpuinitdata mce_cpu_notifier = { 647static struct notifier_block mce_cpu_notifier = {
651 .notifier_call = mce_cpu_callback, 648 .notifier_call = mce_cpu_callback,
652}; 649};
650#endif
653 651
654static __init int mce_init_device(void) 652static __init int mce_init_device(void)
655{ 653{
@@ -664,7 +662,7 @@ static __init int mce_init_device(void)
664 mce_create_device(i); 662 mce_create_device(i);
665 } 663 }
666 664
667 register_cpu_notifier(&mce_cpu_notifier); 665 register_hotcpu_notifier(&mce_cpu_notifier);
668 misc_register(&mce_log_device); 666 misc_register(&mce_log_device);
669 return err; 667 return err;
670} 668}
diff --git a/arch/x86_64/kernel/mce_amd.c b/arch/x86_64/kernel/mce_amd.c
index 335200aa2737..883fe747f64c 100644
--- a/arch/x86_64/kernel/mce_amd.c
+++ b/arch/x86_64/kernel/mce_amd.c
@@ -558,7 +558,7 @@ out:
558 * of shared sysfs dir/files, and rest of the cores will be symlinked to it. 558 * of shared sysfs dir/files, and rest of the cores will be symlinked to it.
559 */ 559 */
560 560
561static __cpuinit void deallocate_threshold_block(unsigned int cpu, 561static void deallocate_threshold_block(unsigned int cpu,
562 unsigned int bank) 562 unsigned int bank)
563{ 563{
564 struct threshold_block *pos = NULL; 564 struct threshold_block *pos = NULL;
@@ -578,7 +578,7 @@ static __cpuinit void deallocate_threshold_block(unsigned int cpu,
578 per_cpu(threshold_banks, cpu)[bank]->blocks = NULL; 578 per_cpu(threshold_banks, cpu)[bank]->blocks = NULL;
579} 579}
580 580
581static __cpuinit void threshold_remove_bank(unsigned int cpu, int bank) 581static void threshold_remove_bank(unsigned int cpu, int bank)
582{ 582{
583 int i = 0; 583 int i = 0;
584 struct threshold_bank *b; 584 struct threshold_bank *b;
@@ -597,7 +597,7 @@ static __cpuinit void threshold_remove_bank(unsigned int cpu, int bank)
597 /* sibling symlink */ 597 /* sibling symlink */
598 if (shared_bank[bank] && b->blocks->cpu != cpu) { 598 if (shared_bank[bank] && b->blocks->cpu != cpu) {
599 sysfs_remove_link(&per_cpu(device_mce, cpu).kobj, name); 599 sysfs_remove_link(&per_cpu(device_mce, cpu).kobj, name);
600 per_cpu(threshold_banks, i)[bank] = NULL; 600 per_cpu(threshold_banks, cpu)[bank] = NULL;
601 return; 601 return;
602 } 602 }
603 603
@@ -618,7 +618,7 @@ free_out:
618 per_cpu(threshold_banks, cpu)[bank] = NULL; 618 per_cpu(threshold_banks, cpu)[bank] = NULL;
619} 619}
620 620
621static __cpuinit void threshold_remove_device(unsigned int cpu) 621static void threshold_remove_device(unsigned int cpu)
622{ 622{
623 unsigned int bank; 623 unsigned int bank;
624 624
@@ -629,14 +629,8 @@ static __cpuinit void threshold_remove_device(unsigned int cpu)
629 } 629 }
630} 630}
631 631
632#else /* !CONFIG_HOTPLUG_CPU */
633static void threshold_remove_device(unsigned int cpu)
634{
635}
636#endif
637
638/* get notified when a cpu comes on/off */ 632/* get notified when a cpu comes on/off */
639static int __cpuinit threshold_cpu_callback(struct notifier_block *nfb, 633static int threshold_cpu_callback(struct notifier_block *nfb,
640 unsigned long action, void *hcpu) 634 unsigned long action, void *hcpu)
641{ 635{
642 /* cpu was unsigned int to begin with */ 636 /* cpu was unsigned int to begin with */
@@ -659,9 +653,10 @@ static int __cpuinit threshold_cpu_callback(struct notifier_block *nfb,
659 return NOTIFY_OK; 653 return NOTIFY_OK;
660} 654}
661 655
662static struct notifier_block threshold_cpu_notifier __cpuinitdata = { 656static struct notifier_block threshold_cpu_notifier = {
663 .notifier_call = threshold_cpu_callback, 657 .notifier_call = threshold_cpu_callback,
664}; 658};
659#endif /* CONFIG_HOTPLUG_CPU */
665 660
666static __init int threshold_init_device(void) 661static __init int threshold_init_device(void)
667{ 662{
@@ -673,7 +668,7 @@ static __init int threshold_init_device(void)
673 if (err) 668 if (err)
674 return err; 669 return err;
675 } 670 }
676 register_cpu_notifier(&threshold_cpu_notifier); 671 register_hotcpu_notifier(&threshold_cpu_notifier);
677 return 0; 672 return 0;
678} 673}
679 674
diff --git a/arch/x86_64/kernel/pci-calgary.c b/arch/x86_64/kernel/pci-calgary.c
index d91cb843f54d..146924ba5df5 100644
--- a/arch/x86_64/kernel/pci-calgary.c
+++ b/arch/x86_64/kernel/pci-calgary.c
@@ -1,9 +1,11 @@
1/* 1/*
2 * Derived from arch/powerpc/kernel/iommu.c 2 * Derived from arch/powerpc/kernel/iommu.c
3 * 3 *
4 * Copyright (C) 2006 Jon Mason <jdmason@us.ibm.com>, IBM Corporation 4 * Copyright (C) IBM Corporation, 2006
5 * Copyright (C) 2006 Muli Ben-Yehuda <muli@il.ibm.com>, IBM Corporation
6 * 5 *
6 * Author: Jon Mason <jdmason@us.ibm.com>
7 * Author: Muli Ben-Yehuda <muli@il.ibm.com>
8
7 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 10 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or 11 * the Free Software Foundation; either version 2 of the License, or
@@ -83,7 +85,8 @@
83#define CSR_AGENT_MASK 0xffe0ffff 85#define CSR_AGENT_MASK 0xffe0ffff
84 86
85#define MAX_NUM_OF_PHBS 8 /* how many PHBs in total? */ 87#define MAX_NUM_OF_PHBS 8 /* how many PHBs in total? */
86#define MAX_PHB_BUS_NUM (MAX_NUM_OF_PHBS * 2) /* max dev->bus->number */ 88#define MAX_NUM_CHASSIS 8 /* max number of chassis */
89#define MAX_PHB_BUS_NUM (MAX_NUM_OF_PHBS * MAX_NUM_CHASSIS * 2) /* max dev->bus->number */
87#define PHBS_PER_CALGARY 4 90#define PHBS_PER_CALGARY 4
88 91
89/* register offsets in Calgary's internal register space */ 92/* register offsets in Calgary's internal register space */
@@ -108,7 +111,8 @@ static const unsigned long phb_offsets[] = {
108 0xB000 /* PHB3 */ 111 0xB000 /* PHB3 */
109}; 112};
110 113
111void* tce_table_kva[MAX_NUM_OF_PHBS * MAX_NUMNODES]; 114static char bus_to_phb[MAX_PHB_BUS_NUM];
115void* tce_table_kva[MAX_PHB_BUS_NUM];
112unsigned int specified_table_size = TCE_TABLE_SIZE_UNSPECIFIED; 116unsigned int specified_table_size = TCE_TABLE_SIZE_UNSPECIFIED;
113static int translate_empty_slots __read_mostly = 0; 117static int translate_empty_slots __read_mostly = 0;
114static int calgary_detected __read_mostly = 0; 118static int calgary_detected __read_mostly = 0;
@@ -117,7 +121,7 @@ static int calgary_detected __read_mostly = 0;
117 * the bitmap of PHBs the user requested that we disable 121 * the bitmap of PHBs the user requested that we disable
118 * translation on. 122 * translation on.
119 */ 123 */
120static DECLARE_BITMAP(translation_disabled, MAX_NUMNODES * MAX_PHB_BUS_NUM); 124static DECLARE_BITMAP(translation_disabled, MAX_PHB_BUS_NUM);
121 125
122static void tce_cache_blast(struct iommu_table *tbl); 126static void tce_cache_blast(struct iommu_table *tbl);
123 127
@@ -450,7 +454,7 @@ static struct dma_mapping_ops calgary_dma_ops = {
450 454
451static inline int busno_to_phbid(unsigned char num) 455static inline int busno_to_phbid(unsigned char num)
452{ 456{
453 return bus_to_phb(num) % PHBS_PER_CALGARY; 457 return bus_to_phb[num];
454} 458}
455 459
456static inline unsigned long split_queue_offset(unsigned char num) 460static inline unsigned long split_queue_offset(unsigned char num)
@@ -810,7 +814,7 @@ static int __init calgary_init(void)
810 int i, ret = -ENODEV; 814 int i, ret = -ENODEV;
811 struct pci_dev *dev = NULL; 815 struct pci_dev *dev = NULL;
812 816
813 for (i = 0; i <= num_online_nodes() * MAX_NUM_OF_PHBS; i++) { 817 for (i = 0; i < MAX_PHB_BUS_NUM; i++) {
814 dev = pci_get_device(PCI_VENDOR_ID_IBM, 818 dev = pci_get_device(PCI_VENDOR_ID_IBM,
815 PCI_DEVICE_ID_IBM_CALGARY, 819 PCI_DEVICE_ID_IBM_CALGARY,
816 dev); 820 dev);
@@ -820,7 +824,7 @@ static int __init calgary_init(void)
820 calgary_init_one_nontraslated(dev); 824 calgary_init_one_nontraslated(dev);
821 continue; 825 continue;
822 } 826 }
823 if (!tce_table_kva[i] && !translate_empty_slots) { 827 if (!tce_table_kva[dev->bus->number] && !translate_empty_slots) {
824 pci_dev_put(dev); 828 pci_dev_put(dev);
825 continue; 829 continue;
826 } 830 }
@@ -840,7 +844,7 @@ error:
840 pci_dev_put(dev); 844 pci_dev_put(dev);
841 continue; 845 continue;
842 } 846 }
843 if (!tce_table_kva[i] && !translate_empty_slots) 847 if (!tce_table_kva[dev->bus->number] && !translate_empty_slots)
844 continue; 848 continue;
845 calgary_disable_translation(dev); 849 calgary_disable_translation(dev);
846 calgary_free_tar(dev); 850 calgary_free_tar(dev);
@@ -874,9 +878,10 @@ static inline int __init determine_tce_table_size(u64 ram)
874void __init detect_calgary(void) 878void __init detect_calgary(void)
875{ 879{
876 u32 val; 880 u32 val;
877 int bus, table_idx; 881 int bus;
878 void *tbl; 882 void *tbl;
879 int detected = 0; 883 int calgary_found = 0;
884 int phb = -1;
880 885
881 /* 886 /*
882 * if the user specified iommu=off or iommu=soft or we found 887 * if the user specified iommu=off or iommu=soft or we found
@@ -887,38 +892,46 @@ void __init detect_calgary(void)
887 892
888 specified_table_size = determine_tce_table_size(end_pfn * PAGE_SIZE); 893 specified_table_size = determine_tce_table_size(end_pfn * PAGE_SIZE);
889 894
890 for (bus = 0, table_idx = 0; 895 for (bus = 0; bus < MAX_PHB_BUS_NUM; bus++) {
891 bus <= num_online_nodes() * MAX_PHB_BUS_NUM; 896 int dev;
892 bus++) { 897
893 BUG_ON(bus > MAX_NUMNODES * MAX_PHB_BUS_NUM); 898 tce_table_kva[bus] = NULL;
899 bus_to_phb[bus] = -1;
900
894 if (read_pci_config(bus, 0, 0, 0) != PCI_VENDOR_DEVICE_ID_CALGARY) 901 if (read_pci_config(bus, 0, 0, 0) != PCI_VENDOR_DEVICE_ID_CALGARY)
895 continue; 902 continue;
903
904 /*
905 * There are 4 PHBs per Calgary chip. Set phb to which phb (0-3)
906 * it is connected to releative to the clagary chip.
907 */
908 phb = (phb + 1) % PHBS_PER_CALGARY;
909
896 if (test_bit(bus, translation_disabled)) { 910 if (test_bit(bus, translation_disabled)) {
897 printk(KERN_INFO "Calgary: translation is disabled for " 911 printk(KERN_INFO "Calgary: translation is disabled for "
898 "PHB 0x%x\n", bus); 912 "PHB 0x%x\n", bus);
899 /* skip this phb, don't allocate a tbl for it */ 913 /* skip this phb, don't allocate a tbl for it */
900 tce_table_kva[table_idx] = NULL;
901 table_idx++;
902 continue; 914 continue;
903 } 915 }
904 /* 916 /*
905 * scan the first slot of the PCI bus to see if there 917 * Scan the slots of the PCI bus to see if there is a device present.
906 * are any devices present 918 * The parent bus will be the zero-ith device, so start at 1.
907 */ 919 */
908 val = read_pci_config(bus, 1, 0, 0); 920 for (dev = 1; dev < 8; dev++) {
909 if (val != 0xffffffff || translate_empty_slots) { 921 val = read_pci_config(bus, dev, 0, 0);
910 tbl = alloc_tce_table(); 922 if (val != 0xffffffff || translate_empty_slots) {
911 if (!tbl) 923 tbl = alloc_tce_table();
912 goto cleanup; 924 if (!tbl)
913 detected = 1; 925 goto cleanup;
914 } else 926 tce_table_kva[bus] = tbl;
915 tbl = NULL; 927 bus_to_phb[bus] = phb;
916 928 calgary_found = 1;
917 tce_table_kva[table_idx] = tbl; 929 break;
918 table_idx++; 930 }
931 }
919 } 932 }
920 933
921 if (detected) { 934 if (calgary_found) {
922 iommu_detected = 1; 935 iommu_detected = 1;
923 calgary_detected = 1; 936 calgary_detected = 1;
924 printk(KERN_INFO "PCI-DMA: Calgary IOMMU detected. " 937 printk(KERN_INFO "PCI-DMA: Calgary IOMMU detected. "
@@ -927,9 +940,9 @@ void __init detect_calgary(void)
927 return; 940 return;
928 941
929cleanup: 942cleanup:
930 for (--table_idx; table_idx >= 0; --table_idx) 943 for (--bus; bus >= 0; --bus)
931 if (tce_table_kva[table_idx]) 944 if (tce_table_kva[bus])
932 free_tce_table(tce_table_kva[table_idx]); 945 free_tce_table(tce_table_kva[bus]);
933} 946}
934 947
935int __init calgary_iommu_init(void) 948int __init calgary_iommu_init(void)
@@ -1000,7 +1013,7 @@ static int __init calgary_parse_options(char *p)
1000 if (p == endp) 1013 if (p == endp)
1001 break; 1014 break;
1002 1015
1003 if (bridge <= (num_online_nodes() * MAX_PHB_BUS_NUM)) { 1016 if (bridge < MAX_PHB_BUS_NUM) {
1004 printk(KERN_INFO "Calgary: disabling " 1017 printk(KERN_INFO "Calgary: disabling "
1005 "translation for PHB 0x%x\n", bridge); 1018 "translation for PHB 0x%x\n", bridge);
1006 set_bit(bridge, translation_disabled); 1019 set_bit(bridge, translation_disabled);
diff --git a/arch/x86_64/kernel/pci-nommu.c b/arch/x86_64/kernel/pci-nommu.c
index c4c3cc36ac5b..aad7609d8e92 100644
--- a/arch/x86_64/kernel/pci-nommu.c
+++ b/arch/x86_64/kernel/pci-nommu.c
@@ -92,5 +92,7 @@ void __init no_iommu_init(void)
92{ 92{
93 if (dma_ops) 93 if (dma_ops)
94 return; 94 return;
95
96 force_iommu = 0; /* no HW IOMMU */
95 dma_ops = &nommu_dma_ops; 97 dma_ops = &nommu_dma_ops;
96} 98}
diff --git a/arch/x86_64/kernel/pci-swiotlb.c b/arch/x86_64/kernel/pci-swiotlb.c
index ebdb77fe2057..6a55f87ba97f 100644
--- a/arch/x86_64/kernel/pci-swiotlb.c
+++ b/arch/x86_64/kernel/pci-swiotlb.c
@@ -31,9 +31,10 @@ struct dma_mapping_ops swiotlb_dma_ops = {
31void pci_swiotlb_init(void) 31void pci_swiotlb_init(void)
32{ 32{
33 /* don't initialize swiotlb if iommu=off (no_iommu=1) */ 33 /* don't initialize swiotlb if iommu=off (no_iommu=1) */
34 if (!iommu_detected && !no_iommu && 34 if (!iommu_detected && !no_iommu && end_pfn > MAX_DMA32_PFN)
35 (end_pfn > MAX_DMA32_PFN || force_iommu))
36 swiotlb = 1; 35 swiotlb = 1;
36 if (swiotlb_force)
37 swiotlb = 1;
37 if (swiotlb) { 38 if (swiotlb) {
38 printk(KERN_INFO "PCI-DMA: Using software bounce buffering for IO (SWIOTLB)\n"); 39 printk(KERN_INFO "PCI-DMA: Using software bounce buffering for IO (SWIOTLB)\n");
39 swiotlb_init(); 40 swiotlb_init();
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c
index 0925518b58d0..8a099ff1f8bc 100644
--- a/arch/x86_64/kernel/setup.c
+++ b/arch/x86_64/kernel/setup.c
@@ -21,7 +21,7 @@
21#include <linux/slab.h> 21#include <linux/slab.h>
22#include <linux/user.h> 22#include <linux/user.h>
23#include <linux/a.out.h> 23#include <linux/a.out.h>
24#include <linux/tty.h> 24#include <linux/screen_info.h>
25#include <linux/ioport.h> 25#include <linux/ioport.h>
26#include <linux/delay.h> 26#include <linux/delay.h>
27#include <linux/init.h> 27#include <linux/init.h>
diff --git a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c
index b7c705969791..975380207b46 100644
--- a/arch/x86_64/kernel/smpboot.c
+++ b/arch/x86_64/kernel/smpboot.c
@@ -771,12 +771,10 @@ static int __cpuinit do_boot_cpu(int cpu, int apicid)
771 unsigned long start_rip; 771 unsigned long start_rip;
772 struct create_idle c_idle = { 772 struct create_idle c_idle = {
773 .cpu = cpu, 773 .cpu = cpu,
774 .done = COMPLETION_INITIALIZER(c_idle.done), 774 .done = COMPLETION_INITIALIZER_ONSTACK(c_idle.done),
775 }; 775 };
776 DECLARE_WORK(work, do_fork_idle, &c_idle); 776 DECLARE_WORK(work, do_fork_idle, &c_idle);
777 777
778 lockdep_set_class(&c_idle.done.wait.lock, &waitqueue_lock_key);
779
780 /* allocate memory for gdts of secondary cpus. Hotplug is considered */ 778 /* allocate memory for gdts of secondary cpus. Hotplug is considered */
781 if (!cpu_gdt_descr[cpu].address && 779 if (!cpu_gdt_descr[cpu].address &&
782 !(cpu_gdt_descr[cpu].address = get_zeroed_page(GFP_KERNEL))) { 780 !(cpu_gdt_descr[cpu].address = get_zeroed_page(GFP_KERNEL))) {
diff --git a/arch/x86_64/kernel/tce.c b/arch/x86_64/kernel/tce.c
index 8d4c67f61b8e..5530dda3f27a 100644
--- a/arch/x86_64/kernel/tce.c
+++ b/arch/x86_64/kernel/tce.c
@@ -1,8 +1,10 @@
1/* 1/*
2 * Derived from arch/powerpc/platforms/pseries/iommu.c 2 * Derived from arch/powerpc/platforms/pseries/iommu.c
3 * 3 *
4 * Copyright (C) 2006 Jon Mason <jdmason@us.ibm.com>, IBM Corporation 4 * Copyright (C) IBM Corporation, 2006
5 * Copyright (C) 2006 Muli Ben-Yehuda <muli@il.ibm.com>, IBM Corporation 5 *
6 * Author: Jon Mason <jdmason@us.ibm.com>
7 * Author: Muli Ben-Yehuda <muli@il.ibm.com>
6 * 8 *
7 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 10 * it under the terms of the GNU General Public License as published by
@@ -94,7 +96,6 @@ static inline unsigned int table_size_to_number_of_entries(unsigned char size)
94static int tce_table_setparms(struct pci_dev *dev, struct iommu_table *tbl) 96static int tce_table_setparms(struct pci_dev *dev, struct iommu_table *tbl)
95{ 97{
96 unsigned int bitmapsz; 98 unsigned int bitmapsz;
97 unsigned int tce_table_index;
98 unsigned long bmppages; 99 unsigned long bmppages;
99 int ret; 100 int ret;
100 101
@@ -103,8 +104,7 @@ static int tce_table_setparms(struct pci_dev *dev, struct iommu_table *tbl)
103 /* set the tce table size - measured in entries */ 104 /* set the tce table size - measured in entries */
104 tbl->it_size = table_size_to_number_of_entries(specified_table_size); 105 tbl->it_size = table_size_to_number_of_entries(specified_table_size);
105 106
106 tce_table_index = bus_to_phb(tbl->it_busno); 107 tbl->it_base = (unsigned long)tce_table_kva[dev->bus->number];
107 tbl->it_base = (unsigned long)tce_table_kva[tce_table_index];
108 if (!tbl->it_base) { 108 if (!tbl->it_base) {
109 printk(KERN_ERR "Calgary: iommu_table_setparms: " 109 printk(KERN_ERR "Calgary: iommu_table_setparms: "
110 "no table allocated?!\n"); 110 "no table allocated?!\n");
diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c
index b9ff75992c16..7a9b18224182 100644
--- a/arch/x86_64/kernel/time.c
+++ b/arch/x86_64/kernel/time.c
@@ -28,6 +28,7 @@
28#include <linux/acpi.h> 28#include <linux/acpi.h>
29#ifdef CONFIG_ACPI 29#ifdef CONFIG_ACPI
30#include <acpi/achware.h> /* for PM timer frequency */ 30#include <acpi/achware.h> /* for PM timer frequency */
31#include <acpi/acpi_bus.h>
31#endif 32#endif
32#include <asm/8253pit.h> 33#include <asm/8253pit.h>
33#include <asm/pgtable.h> 34#include <asm/pgtable.h>
@@ -193,7 +194,7 @@ unsigned long profile_pc(struct pt_regs *regs)
193 is just accounted to the spinlock function. 194 is just accounted to the spinlock function.
194 Better would be to write these functions in assembler again 195 Better would be to write these functions in assembler again
195 and check exactly. */ 196 and check exactly. */
196 if (in_lock_functions(pc)) { 197 if (!user_mode(regs) && in_lock_functions(pc)) {
197 char *v = *(char **)regs->rsp; 198 char *v = *(char **)regs->rsp;
198 if ((v >= _stext && v <= _etext) || 199 if ((v >= _stext && v <= _etext) ||
199 (v >= _sinittext && v <= _einittext) || 200 (v >= _sinittext && v <= _einittext) ||
@@ -953,11 +954,18 @@ __cpuinit int unsynchronized_tsc(void)
953#ifdef CONFIG_SMP 954#ifdef CONFIG_SMP
954 if (apic_is_clustered_box()) 955 if (apic_is_clustered_box())
955 return 1; 956 return 1;
956 /* Intel systems are normally all synchronized. Exceptions
957 are handled in the check above. */
958 if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL)
959 return 0;
960#endif 957#endif
958 /* Most intel systems have synchronized TSCs except for
959 multi node systems */
960 if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) {
961#ifdef CONFIG_ACPI
962 /* But TSC doesn't tick in C3 so don't use it there */
963 if (acpi_fadt.length > 0 && acpi_fadt.plvl3_lat < 100)
964 return 1;
965#endif
966 return 0;
967 }
968
961 /* Assume multi socket systems are not synchronized */ 969 /* Assume multi socket systems are not synchronized */
962 return num_present_cpus() > 1; 970 return num_present_cpus() > 1;
963} 971}
diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c
index 79d05c482072..4e9938dee060 100644
--- a/arch/x86_64/kernel/traps.c
+++ b/arch/x86_64/kernel/traps.c
@@ -76,13 +76,13 @@ int register_die_notifier(struct notifier_block *nb)
76 vmalloc_sync_all(); 76 vmalloc_sync_all();
77 return atomic_notifier_chain_register(&die_chain, nb); 77 return atomic_notifier_chain_register(&die_chain, nb);
78} 78}
79EXPORT_SYMBOL(register_die_notifier); 79EXPORT_SYMBOL(register_die_notifier); /* used modular by kdb */
80 80
81int unregister_die_notifier(struct notifier_block *nb) 81int unregister_die_notifier(struct notifier_block *nb)
82{ 82{
83 return atomic_notifier_chain_unregister(&die_chain, nb); 83 return atomic_notifier_chain_unregister(&die_chain, nb);
84} 84}
85EXPORT_SYMBOL(unregister_die_notifier); 85EXPORT_SYMBOL(unregister_die_notifier); /* used modular by kdb */
86 86
87static inline void conditional_sti(struct pt_regs *regs) 87static inline void conditional_sti(struct pt_regs *regs)
88{ 88{
@@ -254,7 +254,6 @@ void show_trace(struct task_struct *tsk, struct pt_regs *regs, unsigned long * s
254{ 254{
255 const unsigned cpu = safe_smp_processor_id(); 255 const unsigned cpu = safe_smp_processor_id();
256 unsigned long *irqstack_end = (unsigned long *)cpu_pda(cpu)->irqstackptr; 256 unsigned long *irqstack_end = (unsigned long *)cpu_pda(cpu)->irqstackptr;
257 int i = 11;
258 unsigned used = 0; 257 unsigned used = 0;
259 258
260 printk("\nCall Trace:\n"); 259 printk("\nCall Trace:\n");
@@ -275,11 +274,20 @@ void show_trace(struct task_struct *tsk, struct pt_regs *regs, unsigned long * s
275 if (unwind_init_blocked(&info, tsk) == 0) 274 if (unwind_init_blocked(&info, tsk) == 0)
276 unw_ret = show_trace_unwind(&info, NULL); 275 unw_ret = show_trace_unwind(&info, NULL);
277 } 276 }
278 if (unw_ret > 0) { 277 if (unw_ret > 0 && !arch_unw_user_mode(&info)) {
279 if (call_trace > 0) 278#ifdef CONFIG_STACK_UNWIND
279 unsigned long rip = info.regs.rip;
280 print_symbol("DWARF2 unwinder stuck at %s\n", rip);
281 if (call_trace == 1) {
282 printk("Leftover inexact backtrace:\n");
283 stack = (unsigned long *)info.regs.rsp;
284 } else if (call_trace > 1)
280 return; 285 return;
281 printk("Legacy call trace:"); 286 else
282 i = 18; 287 printk("Full inexact backtrace again:\n");
288#else
289 printk("Inexact backtrace:\n");
290#endif
283 } 291 }
284 } 292 }
285 293
@@ -521,7 +529,7 @@ void __kprobes oops_end(unsigned long flags)
521 /* Nest count reaches zero, release the lock. */ 529 /* Nest count reaches zero, release the lock. */
522 spin_unlock_irqrestore(&die_lock, flags); 530 spin_unlock_irqrestore(&die_lock, flags);
523 if (panic_on_oops) 531 if (panic_on_oops)
524 panic("Oops"); 532 panic("Fatal exception: panic_on_oops");
525} 533}
526 534
527void __kprobes __die(const char * str, struct pt_regs * regs, long err) 535void __kprobes __die(const char * str, struct pt_regs * regs, long err)
@@ -1118,8 +1126,10 @@ static int __init call_trace_setup(char *s)
1118 call_trace = -1; 1126 call_trace = -1;
1119 else if (strcmp(s, "both") == 0) 1127 else if (strcmp(s, "both") == 0)
1120 call_trace = 0; 1128 call_trace = 0;
1121 else if (strcmp(s, "new") == 0) 1129 else if (strcmp(s, "newfallback") == 0)
1122 call_trace = 1; 1130 call_trace = 1;
1131 else if (strcmp(s, "new") == 0)
1132 call_trace = 2;
1123 return 1; 1133 return 1;
1124} 1134}
1125__setup("call_trace=", call_trace_setup); 1135__setup("call_trace=", call_trace_setup);
diff --git a/arch/x86_64/pci/k8-bus.c b/arch/x86_64/pci/k8-bus.c
index b50a7c7c47f8..3acf60ded2a0 100644
--- a/arch/x86_64/pci/k8-bus.c
+++ b/arch/x86_64/pci/k8-bus.c
@@ -2,7 +2,6 @@
2#include <linux/pci.h> 2#include <linux/pci.h>
3#include <asm/mpspec.h> 3#include <asm/mpspec.h>
4#include <linux/cpumask.h> 4#include <linux/cpumask.h>
5#include <asm/k8.h>
6 5
7/* 6/*
8 * This discovers the pcibus <-> node mapping on AMD K8. 7 * This discovers the pcibus <-> node mapping on AMD K8.
@@ -19,6 +18,7 @@
19#define NR_LDT_BUS_NUMBER_REGISTERS 3 18#define NR_LDT_BUS_NUMBER_REGISTERS 3
20#define SECONDARY_LDT_BUS_NUMBER(dword) ((dword >> 8) & 0xFF) 19#define SECONDARY_LDT_BUS_NUMBER(dword) ((dword >> 8) & 0xFF)
21#define SUBORDINATE_LDT_BUS_NUMBER(dword) ((dword >> 16) & 0xFF) 20#define SUBORDINATE_LDT_BUS_NUMBER(dword) ((dword >> 16) & 0xFF)
21#define PCI_DEVICE_ID_K8HTCONFIG 0x1100
22 22
23/** 23/**
24 * fill_mp_bus_to_cpumask() 24 * fill_mp_bus_to_cpumask()
@@ -28,7 +28,8 @@
28__init static int 28__init static int
29fill_mp_bus_to_cpumask(void) 29fill_mp_bus_to_cpumask(void)
30{ 30{
31 int i, j, k; 31 struct pci_dev *nb_dev = NULL;
32 int i, j;
32 u32 ldtbus, nid; 33 u32 ldtbus, nid;
33 static int lbnr[3] = { 34 static int lbnr[3] = {
34 LDT_BUS_NUMBER_REGISTER_0, 35 LDT_BUS_NUMBER_REGISTER_0,
@@ -36,9 +37,8 @@ fill_mp_bus_to_cpumask(void)
36 LDT_BUS_NUMBER_REGISTER_2 37 LDT_BUS_NUMBER_REGISTER_2
37 }; 38 };
38 39
39 cache_k8_northbridges(); 40 while ((nb_dev = pci_get_device(PCI_VENDOR_ID_AMD,
40 for (k = 0; k < num_k8_northbridges; k++) { 41 PCI_DEVICE_ID_K8HTCONFIG, nb_dev))) {
41 struct pci_dev *nb_dev = k8_northbridges[k];
42 pci_read_config_dword(nb_dev, NODE_ID_REGISTER, &nid); 42 pci_read_config_dword(nb_dev, NODE_ID_REGISTER, &nid);
43 43
44 for (i = 0; i < NR_LDT_BUS_NUMBER_REGISTERS; i++) { 44 for (i = 0; i < NR_LDT_BUS_NUMBER_REGISTERS; i++) {
diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c
index edb29410d953..82684d05910a 100644
--- a/arch/xtensa/kernel/setup.c
+++ b/arch/xtensa/kernel/setup.c
@@ -17,7 +17,7 @@
17#include <linux/errno.h> 17#include <linux/errno.h>
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/proc_fs.h> 19#include <linux/proc_fs.h>
20#include <linux/tty.h> 20#include <linux/screen_info.h>
21#include <linux/bootmem.h> 21#include <linux/bootmem.h>
22#include <linux/kernel.h> 22#include <linux/kernel.h>
23 23
diff --git a/arch/xtensa/kernel/traps.c b/arch/xtensa/kernel/traps.c
index 27e409089a7b..9734960a2451 100644
--- a/arch/xtensa/kernel/traps.c
+++ b/arch/xtensa/kernel/traps.c
@@ -487,11 +487,9 @@ void die(const char * str, struct pt_regs * regs, long err)
487 if (in_interrupt()) 487 if (in_interrupt())
488 panic("Fatal exception in interrupt"); 488 panic("Fatal exception in interrupt");
489 489
490 if (panic_on_oops) { 490 if (panic_on_oops)
491 printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n"); 491 panic("Fatal exception: panic_on_oops");
492 ssleep(5); 492
493 panic("Fatal exception");
494 }
495 do_exit(err); 493 do_exit(err);
496} 494}
497 495
diff --git a/block/blktrace.c b/block/blktrace.c
index 92925e7d9e6c..265f7a830619 100644
--- a/block/blktrace.c
+++ b/block/blktrace.c
@@ -69,7 +69,7 @@ static u32 ddir_act[2] __read_mostly = { BLK_TC_ACT(BLK_TC_READ), BLK_TC_ACT(BLK
69/* 69/*
70 * Bio action bits of interest 70 * Bio action bits of interest
71 */ 71 */
72static u32 bio_act[3] __read_mostly = { 0, BLK_TC_ACT(BLK_TC_BARRIER), BLK_TC_ACT(BLK_TC_SYNC) }; 72static u32 bio_act[5] __read_mostly = { 0, BLK_TC_ACT(BLK_TC_BARRIER), BLK_TC_ACT(BLK_TC_SYNC), 0, BLK_TC_ACT(BLK_TC_AHEAD) };
73 73
74/* 74/*
75 * More could be added as needed, taking care to increment the decrementer 75 * More could be added as needed, taking care to increment the decrementer
@@ -79,6 +79,8 @@ static u32 bio_act[3] __read_mostly = { 0, BLK_TC_ACT(BLK_TC_BARRIER), BLK_TC_AC
79 (((rw) & (1 << BIO_RW_BARRIER)) >> (BIO_RW_BARRIER - 0)) 79 (((rw) & (1 << BIO_RW_BARRIER)) >> (BIO_RW_BARRIER - 0))
80#define trace_sync_bit(rw) \ 80#define trace_sync_bit(rw) \
81 (((rw) & (1 << BIO_RW_SYNC)) >> (BIO_RW_SYNC - 1)) 81 (((rw) & (1 << BIO_RW_SYNC)) >> (BIO_RW_SYNC - 1))
82#define trace_ahead_bit(rw) \
83 (((rw) & (1 << BIO_RW_AHEAD)) << (2 - BIO_RW_AHEAD))
82 84
83/* 85/*
84 * The worker for the various blk_add_trace*() types. Fills out a 86 * The worker for the various blk_add_trace*() types. Fills out a
@@ -100,6 +102,7 @@ void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes,
100 what |= ddir_act[rw & WRITE]; 102 what |= ddir_act[rw & WRITE];
101 what |= bio_act[trace_barrier_bit(rw)]; 103 what |= bio_act[trace_barrier_bit(rw)];
102 what |= bio_act[trace_sync_bit(rw)]; 104 what |= bio_act[trace_sync_bit(rw)];
105 what |= bio_act[trace_ahead_bit(rw)];
103 106
104 pid = tsk->pid; 107 pid = tsk->pid;
105 if (unlikely(act_log_check(bt, what, sector, pid))) 108 if (unlikely(act_log_check(bt, what, sector, pid)))
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 102ebc2c5c34..aae3123bf3ee 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -936,7 +936,7 @@ static int cfq_arm_slice_timer(struct cfq_data *cfqd, struct cfq_queue *cfqq)
936 * seeks. so allow a little bit of time for him to submit a new rq 936 * seeks. so allow a little bit of time for him to submit a new rq
937 */ 937 */
938 if (sample_valid(cic->seek_samples) && CIC_SEEKY(cic)) 938 if (sample_valid(cic->seek_samples) && CIC_SEEKY(cic))
939 sl = 2; 939 sl = min(sl, msecs_to_jiffies(2));
940 940
941 mod_timer(&cfqd->idle_slice_timer, jiffies + sl); 941 mod_timer(&cfqd->idle_slice_timer, jiffies + sl);
942 return 1; 942 return 1;
diff --git a/block/ioctl.c b/block/ioctl.c
index 9cfa2e1ecb24..309760b7e37f 100644
--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -72,7 +72,7 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user
72 bdevp = bdget_disk(disk, part); 72 bdevp = bdget_disk(disk, part);
73 if (!bdevp) 73 if (!bdevp)
74 return -ENOMEM; 74 return -ENOMEM;
75 mutex_lock(&bdevp->bd_mutex); 75 mutex_lock_nested(&bdevp->bd_mutex, BD_MUTEX_PARTITION);
76 if (bdevp->bd_openers) { 76 if (bdevp->bd_openers) {
77 mutex_unlock(&bdevp->bd_mutex); 77 mutex_unlock(&bdevp->bd_mutex);
78 bdput(bdevp); 78 bdput(bdevp);
@@ -82,7 +82,7 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user
82 fsync_bdev(bdevp); 82 fsync_bdev(bdevp);
83 invalidate_bdev(bdevp, 0); 83 invalidate_bdev(bdevp, 0);
84 84
85 mutex_lock(&bdev->bd_mutex); 85 mutex_lock_nested(&bdev->bd_mutex, BD_MUTEX_WHOLE);
86 delete_partition(disk, part); 86 delete_partition(disk, part);
87 mutex_unlock(&bdev->bd_mutex); 87 mutex_unlock(&bdev->bd_mutex);
88 mutex_unlock(&bdevp->bd_mutex); 88 mutex_unlock(&bdevp->bd_mutex);
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index ab17c7224bb6..61d6b3c65b66 100644
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -3491,8 +3491,8 @@ EXPORT_SYMBOL(end_request);
3491 3491
3492void blk_rq_bio_prep(request_queue_t *q, struct request *rq, struct bio *bio) 3492void blk_rq_bio_prep(request_queue_t *q, struct request *rq, struct bio *bio)
3493{ 3493{
3494 /* first three bits are identical in rq->flags and bio->bi_rw */ 3494 /* first two bits are identical in rq->flags and bio->bi_rw */
3495 rq->flags |= (bio->bi_rw & 7); 3495 rq->flags |= (bio->bi_rw & 3);
3496 3496
3497 rq->nr_phys_segments = bio_phys_segments(q, bio); 3497 rq->nr_phys_segments = bio_phys_segments(q, bio);
3498 rq->nr_hw_segments = bio_hw_segments(q, bio); 3498 rq->nr_hw_segments = bio_hw_segments(q, bio);
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index fef7bab12244..56c5ba874623 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -107,7 +107,6 @@ config ACPI_BUTTON
107config ACPI_VIDEO 107config ACPI_VIDEO
108 tristate "Video" 108 tristate "Video"
109 depends on X86 109 depends on X86
110 default y
111 help 110 help
112 This driver implement the ACPI Extensions For Display Adapters 111 This driver implement the ACPI Extensions For Display Adapters
113 for integrated graphics devices on motherboard, as specified in 112 for integrated graphics devices on motherboard, as specified in
@@ -135,8 +134,7 @@ config ACPI_FAN
135 134
136config ACPI_DOCK 135config ACPI_DOCK
137 tristate "Dock" 136 tristate "Dock"
138 depends on !ACPI_IBM_DOCK 137 depends on EXPERIMENTAL
139 default y
140 help 138 help
141 This driver adds support for ACPI controlled docking stations 139 This driver adds support for ACPI controlled docking stations
142 140
@@ -214,6 +212,7 @@ config ACPI_IBM
214config ACPI_IBM_DOCK 212config ACPI_IBM_DOCK
215 bool "Legacy Docking Station Support" 213 bool "Legacy Docking Station Support"
216 depends on ACPI_IBM 214 depends on ACPI_IBM
215 depends on ACPI_DOCK=n
217 default n 216 default n
218 ---help--- 217 ---help---
219 Allows the ibm_acpi driver to handle docking station events. 218 Allows the ibm_acpi driver to handle docking station events.
@@ -357,7 +356,6 @@ config ACPI_SBS
357 tristate "Smart Battery System (EXPERIMENTAL)" 356 tristate "Smart Battery System (EXPERIMENTAL)"
358 depends on X86 && I2C 357 depends on X86 && I2C
359 depends on EXPERIMENTAL 358 depends on EXPERIMENTAL
360 default y
361 help 359 help
362 This driver adds support for the Smart Battery System. 360 This driver adds support for the Smart Battery System.
363 Depends on I2C (Device Drivers ---> I2C support) 361 Depends on I2C (Device Drivers ---> I2C support)
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
index 24ccf81d135f..96309b9660da 100644
--- a/drivers/acpi/ac.c
+++ b/drivers/acpi/ac.c
@@ -72,7 +72,7 @@ struct acpi_ac {
72 unsigned long state; 72 unsigned long state;
73}; 73};
74 74
75static struct file_operations acpi_ac_fops = { 75static const struct file_operations acpi_ac_fops = {
76 .open = acpi_ac_open_fs, 76 .open = acpi_ac_open_fs,
77 .read = seq_read, 77 .read = seq_read,
78 .llseek = seq_lseek, 78 .llseek = seq_lseek,
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 24bf4dca88cc..6e5221707d97 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -557,7 +557,7 @@ static int acpi_battery_alarm_open_fs(struct inode *inode, struct file *file)
557 return single_open(file, acpi_battery_read_alarm, PDE(inode)->data); 557 return single_open(file, acpi_battery_read_alarm, PDE(inode)->data);
558} 558}
559 559
560static struct file_operations acpi_battery_info_ops = { 560static const struct file_operations acpi_battery_info_ops = {
561 .open = acpi_battery_info_open_fs, 561 .open = acpi_battery_info_open_fs,
562 .read = seq_read, 562 .read = seq_read,
563 .llseek = seq_lseek, 563 .llseek = seq_lseek,
@@ -565,7 +565,7 @@ static struct file_operations acpi_battery_info_ops = {
565 .owner = THIS_MODULE, 565 .owner = THIS_MODULE,
566}; 566};
567 567
568static struct file_operations acpi_battery_state_ops = { 568static const struct file_operations acpi_battery_state_ops = {
569 .open = acpi_battery_state_open_fs, 569 .open = acpi_battery_state_open_fs,
570 .read = seq_read, 570 .read = seq_read,
571 .llseek = seq_lseek, 571 .llseek = seq_lseek,
@@ -573,7 +573,7 @@ static struct file_operations acpi_battery_state_ops = {
573 .owner = THIS_MODULE, 573 .owner = THIS_MODULE,
574}; 574};
575 575
576static struct file_operations acpi_battery_alarm_ops = { 576static const struct file_operations acpi_battery_alarm_ops = {
577 .open = acpi_battery_alarm_open_fs, 577 .open = acpi_battery_alarm_open_fs,
578 .read = seq_read, 578 .read = seq_read,
579 .write = acpi_battery_write_alarm, 579 .write = acpi_battery_write_alarm,
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index ea5a0496a4fd..b2977695e120 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -192,8 +192,8 @@ int acpi_bus_set_power(acpi_handle handle, int state)
192 /* Make sure this is a valid target state */ 192 /* Make sure this is a valid target state */
193 193
194 if (!device->flags.power_manageable) { 194 if (!device->flags.power_manageable) {
195 printk(KERN_DEBUG "Device `[%s]' is not power manageable", 195 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device `[%s]' is not power manageable",
196 device->kobj.name); 196 device->kobj.name));
197 return -ENODEV; 197 return -ENODEV;
198 } 198 }
199 /* 199 /*
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
index fd1ba05eab68..5ef885e82c78 100644
--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -87,14 +87,14 @@ struct acpi_button {
87 unsigned long pushed; 87 unsigned long pushed;
88}; 88};
89 89
90static struct file_operations acpi_button_info_fops = { 90static const struct file_operations acpi_button_info_fops = {
91 .open = acpi_button_info_open_fs, 91 .open = acpi_button_info_open_fs,
92 .read = seq_read, 92 .read = seq_read,
93 .llseek = seq_lseek, 93 .llseek = seq_lseek,
94 .release = single_release, 94 .release = single_release,
95}; 95};
96 96
97static struct file_operations acpi_button_state_fops = { 97static const struct file_operations acpi_button_state_fops = {
98 .open = acpi_button_state_open_fs, 98 .open = acpi_button_state_open_fs,
99 .read = seq_read, 99 .read = seq_read,
100 .llseek = seq_lseek, 100 .llseek = seq_lseek,
diff --git a/drivers/acpi/cm_sbs.c b/drivers/acpi/cm_sbs.c
index 574a75a166c5..a01ce6700bfe 100644
--- a/drivers/acpi/cm_sbs.c
+++ b/drivers/acpi/cm_sbs.c
@@ -39,50 +39,43 @@ ACPI_MODULE_NAME("cm_sbs")
39static struct proc_dir_entry *acpi_ac_dir; 39static struct proc_dir_entry *acpi_ac_dir;
40static struct proc_dir_entry *acpi_battery_dir; 40static struct proc_dir_entry *acpi_battery_dir;
41 41
42static struct semaphore cm_sbs_sem; 42static DEFINE_MUTEX(cm_sbs_mutex);
43 43
44static int lock_ac_dir_cnt = 0; 44static int lock_ac_dir_cnt;
45static int lock_battery_dir_cnt = 0; 45static int lock_battery_dir_cnt;
46 46
47struct proc_dir_entry *acpi_lock_ac_dir(void) 47struct proc_dir_entry *acpi_lock_ac_dir(void)
48{ 48{
49 49 mutex_lock(&cm_sbs_mutex);
50 down(&cm_sbs_sem); 50 if (!acpi_ac_dir)
51 if (!acpi_ac_dir) {
52 acpi_ac_dir = proc_mkdir(ACPI_AC_CLASS, acpi_root_dir); 51 acpi_ac_dir = proc_mkdir(ACPI_AC_CLASS, acpi_root_dir);
53 }
54 if (acpi_ac_dir) { 52 if (acpi_ac_dir) {
55 lock_ac_dir_cnt++; 53 lock_ac_dir_cnt++;
56 } else { 54 } else {
57 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 55 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
58 "Cannot create %s\n", ACPI_AC_CLASS)); 56 "Cannot create %s\n", ACPI_AC_CLASS));
59 } 57 }
60 up(&cm_sbs_sem); 58 mutex_unlock(&cm_sbs_mutex);
61 return acpi_ac_dir; 59 return acpi_ac_dir;
62} 60}
63
64EXPORT_SYMBOL(acpi_lock_ac_dir); 61EXPORT_SYMBOL(acpi_lock_ac_dir);
65 62
66void acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir_param) 63void acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir_param)
67{ 64{
68 65 mutex_lock(&cm_sbs_mutex);
69 down(&cm_sbs_sem); 66 if (acpi_ac_dir_param)
70 if (acpi_ac_dir_param) {
71 lock_ac_dir_cnt--; 67 lock_ac_dir_cnt--;
72 }
73 if (lock_ac_dir_cnt == 0 && acpi_ac_dir_param && acpi_ac_dir) { 68 if (lock_ac_dir_cnt == 0 && acpi_ac_dir_param && acpi_ac_dir) {
74 remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir); 69 remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir);
75 acpi_ac_dir = 0; 70 acpi_ac_dir = 0;
76 } 71 }
77 up(&cm_sbs_sem); 72 mutex_unlock(&cm_sbs_mutex);
78} 73}
79
80EXPORT_SYMBOL(acpi_unlock_ac_dir); 74EXPORT_SYMBOL(acpi_unlock_ac_dir);
81 75
82struct proc_dir_entry *acpi_lock_battery_dir(void) 76struct proc_dir_entry *acpi_lock_battery_dir(void)
83{ 77{
84 78 mutex_lock(&cm_sbs_mutex);
85 down(&cm_sbs_sem);
86 if (!acpi_battery_dir) { 79 if (!acpi_battery_dir) {
87 acpi_battery_dir = 80 acpi_battery_dir =
88 proc_mkdir(ACPI_BATTERY_CLASS, acpi_root_dir); 81 proc_mkdir(ACPI_BATTERY_CLASS, acpi_root_dir);
@@ -93,39 +86,28 @@ struct proc_dir_entry *acpi_lock_battery_dir(void)
93 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 86 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
94 "Cannot create %s\n", ACPI_BATTERY_CLASS)); 87 "Cannot create %s\n", ACPI_BATTERY_CLASS));
95 } 88 }
96 up(&cm_sbs_sem); 89 mutex_unlock(&cm_sbs_mutex);
97 return acpi_battery_dir; 90 return acpi_battery_dir;
98} 91}
99
100EXPORT_SYMBOL(acpi_lock_battery_dir); 92EXPORT_SYMBOL(acpi_lock_battery_dir);
101 93
102void acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir_param) 94void acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir_param)
103{ 95{
104 96 mutex_lock(&cm_sbs_mutex);
105 down(&cm_sbs_sem); 97 if (acpi_battery_dir_param)
106 if (acpi_battery_dir_param) {
107 lock_battery_dir_cnt--; 98 lock_battery_dir_cnt--;
108 }
109 if (lock_battery_dir_cnt == 0 && acpi_battery_dir_param 99 if (lock_battery_dir_cnt == 0 && acpi_battery_dir_param
110 && acpi_battery_dir) { 100 && acpi_battery_dir) {
111 remove_proc_entry(ACPI_BATTERY_CLASS, acpi_root_dir); 101 remove_proc_entry(ACPI_BATTERY_CLASS, acpi_root_dir);
112 acpi_battery_dir = 0; 102 acpi_battery_dir = 0;
113 } 103 }
114 up(&cm_sbs_sem); 104 mutex_unlock(&cm_sbs_mutex);
115 return; 105 return;
116} 106}
117
118EXPORT_SYMBOL(acpi_unlock_battery_dir); 107EXPORT_SYMBOL(acpi_unlock_battery_dir);
119 108
120static int __init acpi_cm_sbs_init(void) 109static int __init acpi_cm_sbs_init(void)
121{ 110{
122
123 if (acpi_disabled)
124 return 0;
125
126 init_MUTEX(&cm_sbs_sem);
127
128 return 0; 111 return 0;
129} 112}
130
131subsys_initcall(acpi_cm_sbs_init); 113subsys_initcall(acpi_cm_sbs_init);
diff --git a/drivers/acpi/dispatcher/dsinit.c b/drivers/acpi/dispatcher/dsinit.c
index daf51b5b5875..1888c055d10f 100644
--- a/drivers/acpi/dispatcher/dsinit.c
+++ b/drivers/acpi/dispatcher/dsinit.c
@@ -116,16 +116,6 @@ acpi_ds_init_one_object(acpi_handle obj_handle,
116 116
117 case ACPI_TYPE_METHOD: 117 case ACPI_TYPE_METHOD:
118 118
119 /*
120 * Set the execution data width (32 or 64) based upon the
121 * revision number of the parent ACPI table.
122 * TBD: This is really for possible future support of integer width
123 * on a per-table basis. Currently, we just use a global for the width.
124 */
125 if (info->table_desc->pointer->revision == 1) {
126 node->flags |= ANOBJ_DATA_WIDTH_32;
127 }
128
129 info->method_count++; 119 info->method_count++;
130 break; 120 break;
131 121
diff --git a/drivers/acpi/dispatcher/dsmethod.c b/drivers/acpi/dispatcher/dsmethod.c
index a39a33f4847a..cf888add3191 100644
--- a/drivers/acpi/dispatcher/dsmethod.c
+++ b/drivers/acpi/dispatcher/dsmethod.c
@@ -134,7 +134,7 @@ acpi_ds_create_method_mutex(union acpi_operand_object *method_desc)
134 union acpi_operand_object *mutex_desc; 134 union acpi_operand_object *mutex_desc;
135 acpi_status status; 135 acpi_status status;
136 136
137 ACPI_FUNCTION_NAME(ds_create_method_mutex); 137 ACPI_FUNCTION_TRACE(ds_create_method_mutex);
138 138
139 /* Create the new mutex object */ 139 /* Create the new mutex object */
140 140
@@ -493,7 +493,7 @@ acpi_ds_restart_control_method(struct acpi_walk_state *walk_state,
493 493
494 ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, 494 ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
495 "****Restart [%4.4s] Op %p ReturnValueFromCallee %p\n", 495 "****Restart [%4.4s] Op %p ReturnValueFromCallee %p\n",
496 (char *)&walk_state->method_node->name, 496 acpi_ut_get_node_name(walk_state->method_node),
497 walk_state->method_call_op, return_desc)); 497 walk_state->method_call_op, return_desc));
498 498
499 ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, 499 ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
@@ -610,6 +610,7 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
610 610
611 acpi_os_release_mutex(method_desc->method.mutex->mutex. 611 acpi_os_release_mutex(method_desc->method.mutex->mutex.
612 os_mutex); 612 os_mutex);
613 method_desc->method.mutex->mutex.owner_thread = NULL;
613 } 614 }
614 } 615 }
615 616
@@ -620,27 +621,11 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
620 */ 621 */
621 method_node = walk_state->method_node; 622 method_node = walk_state->method_node;
622 623
623 /* Lock namespace for possible update */
624
625 status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
626 if (ACPI_FAILURE(status)) {
627 return_VOID;
628 }
629
630 /*
631 * Delete any namespace entries created immediately underneath
632 * the method
633 */
634 if (method_node && method_node->child) {
635 acpi_ns_delete_namespace_subtree(method_node);
636 }
637
638 /* 624 /*
639 * Delete any namespace entries created anywhere else within 625 * Delete any namespace objects created anywhere within
640 * the namespace by the execution of this method 626 * the namespace by the execution of this method
641 */ 627 */
642 acpi_ns_delete_namespace_by_owner(method_desc->method.owner_id); 628 acpi_ns_delete_namespace_by_owner(method_desc->method.owner_id);
643 status = acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
644 } 629 }
645 630
646 /* Decrement the thread count on the method */ 631 /* Decrement the thread count on the method */
diff --git a/drivers/acpi/dispatcher/dswexec.c b/drivers/acpi/dispatcher/dswexec.c
index b1ded62d0df1..d7a616c3104e 100644
--- a/drivers/acpi/dispatcher/dswexec.c
+++ b/drivers/acpi/dispatcher/dswexec.c
@@ -313,10 +313,10 @@ acpi_ds_exec_begin_op(struct acpi_walk_state *walk_state,
313 case AML_CLASS_EXECUTE: 313 case AML_CLASS_EXECUTE:
314 case AML_CLASS_CREATE: 314 case AML_CLASS_CREATE:
315 /* 315 /*
316 * Most operators with arguments. 316 * Most operators with arguments (except create_xxx_field operators)
317 * Start a new result/operand state 317 * Start a new result/operand state
318 */ 318 */
319 if (walk_state->opcode != AML_CREATE_FIELD_OP) { 319 if (walk_state->op_info->object_type != ACPI_TYPE_BUFFER_FIELD) {
320 status = acpi_ds_result_stack_push(walk_state); 320 status = acpi_ds_result_stack_push(walk_state);
321 } 321 }
322 break; 322 break;
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
index 510a94524298..578b99b71d9c 100644
--- a/drivers/acpi/dock.c
+++ b/drivers/acpi/dock.c
@@ -58,8 +58,8 @@ struct dock_dependent_device {
58}; 58};
59 59
60#define DOCK_DOCKING 0x00000001 60#define DOCK_DOCKING 0x00000001
61#define DOCK_EVENT KOBJ_DOCK 61#define DOCK_EVENT 3
62#define UNDOCK_EVENT KOBJ_UNDOCK 62#define UNDOCK_EVENT 2
63 63
64static struct dock_station *dock_station; 64static struct dock_station *dock_station;
65 65
@@ -322,11 +322,10 @@ static void hotplug_dock_devices(struct dock_station *ds, u32 event)
322 322
323static void dock_event(struct dock_station *ds, u32 event, int num) 323static void dock_event(struct dock_station *ds, u32 event, int num)
324{ 324{
325 struct acpi_device *device; 325 /*
326 326 * we don't do events until someone tells me that
327 device = dock_create_acpi_device(ds->handle); 327 * they would like to have them.
328 if (device) 328 */
329 kobject_uevent(&device->kobj, num);
330} 329}
331 330
332/** 331/**
@@ -627,6 +626,7 @@ static int dock_add(acpi_handle handle)
627 INIT_LIST_HEAD(&dock_station->hotplug_devices); 626 INIT_LIST_HEAD(&dock_station->hotplug_devices);
628 spin_lock_init(&dock_station->dd_lock); 627 spin_lock_init(&dock_station->dd_lock);
629 spin_lock_init(&dock_station->hp_lock); 628 spin_lock_init(&dock_station->hp_lock);
629 ATOMIC_INIT_NOTIFIER_HEAD(&dock_notifier_list);
630 630
631 /* Find dependent devices */ 631 /* Find dependent devices */
632 acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, 632 acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 8c5d7df7d343..e5d796362854 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -929,7 +929,7 @@ static int acpi_ec_info_open_fs(struct inode *inode, struct file *file)
929 return single_open(file, acpi_ec_read_info, PDE(inode)->data); 929 return single_open(file, acpi_ec_read_info, PDE(inode)->data);
930} 930}
931 931
932static struct file_operations acpi_ec_info_ops = { 932static const struct file_operations acpi_ec_info_ops = {
933 .open = acpi_ec_info_open_fs, 933 .open = acpi_ec_info_open_fs,
934 .read = seq_read, 934 .read = seq_read,
935 .llseek = seq_lseek, 935 .llseek = seq_lseek,
diff --git a/drivers/acpi/event.c b/drivers/acpi/event.c
index a901b23e95e7..959a893c8d1f 100644
--- a/drivers/acpi/event.c
+++ b/drivers/acpi/event.c
@@ -99,7 +99,7 @@ static unsigned int acpi_system_poll_event(struct file *file, poll_table * wait)
99 return 0; 99 return 0;
100} 100}
101 101
102static struct file_operations acpi_system_event_ops = { 102static const struct file_operations acpi_system_event_ops = {
103 .open = acpi_system_open_event, 103 .open = acpi_system_open_event,
104 .read = acpi_system_read_event, 104 .read = acpi_system_read_event,
105 .release = acpi_system_close_event, 105 .release = acpi_system_close_event,
diff --git a/drivers/acpi/events/evregion.c b/drivers/acpi/events/evregion.c
index 094a17e4c86d..21caae04fe85 100644
--- a/drivers/acpi/events/evregion.c
+++ b/drivers/acpi/events/evregion.c
@@ -528,34 +528,40 @@ acpi_ev_detach_region(union acpi_operand_object *region_obj,
528 } 528 }
529 } 529 }
530 530
531 /* Call the setup handler with the deactivate notification */ 531 /*
532 * If the region has been activated, call the setup handler
533 * with the deactivate notification
534 */
535 if (region_obj->region.flags & AOPOBJ_SETUP_COMPLETE) {
536 region_setup = handler_obj->address_space.setup;
537 status =
538 region_setup(region_obj,
539 ACPI_REGION_DEACTIVATE,
540 handler_obj->address_space.
541 context, region_context);
532 542
533 region_setup = handler_obj->address_space.setup; 543 /* Init routine may fail, Just ignore errors */
534 status =
535 region_setup(region_obj, ACPI_REGION_DEACTIVATE,
536 handler_obj->address_space.context,
537 region_context);
538 544
539 /* Init routine may fail, Just ignore errors */ 545 if (ACPI_FAILURE(status)) {
546 ACPI_EXCEPTION((AE_INFO, status,
547 "from region handler - deactivate, [%s]",
548 acpi_ut_get_region_name
549 (region_obj->region.
550 space_id)));
551 }
540 552
541 if (ACPI_FAILURE(status)) { 553 region_obj->region.flags &=
542 ACPI_EXCEPTION((AE_INFO, status, 554 ~(AOPOBJ_SETUP_COMPLETE);
543 "from region init, [%s]",
544 acpi_ut_get_region_name
545 (region_obj->region.space_id)));
546 } 555 }
547 556
548 region_obj->region.flags &= ~(AOPOBJ_SETUP_COMPLETE);
549
550 /* 557 /*
551 * Remove handler reference in the region 558 * Remove handler reference in the region
552 * 559 *
553 * NOTE: this doesn't mean that the region goes away 560 * NOTE: this doesn't mean that the region goes away, the region
554 * The region is just inaccessible as indicated to 561 * is just inaccessible as indicated to the _REG method
555 * the _REG method
556 * 562 *
557 * If the region is on the handler's list 563 * If the region is on the handler's list, this must be the
558 * this better be the region's handler 564 * region's handler
559 */ 565 */
560 region_obj->region.handler = NULL; 566 region_obj->region.handler = NULL;
561 acpi_ut_remove_reference(handler_obj); 567 acpi_ut_remove_reference(handler_obj);
diff --git a/drivers/acpi/events/evxface.c b/drivers/acpi/events/evxface.c
index 4f948df17ab9..923fd2b46955 100644
--- a/drivers/acpi/events/evxface.c
+++ b/drivers/acpi/events/evxface.c
@@ -428,7 +428,7 @@ acpi_remove_notify_handler(acpi_handle device,
428 node = acpi_ns_map_handle_to_node(device); 428 node = acpi_ns_map_handle_to_node(device);
429 if (!node) { 429 if (!node) {
430 status = AE_BAD_PARAMETER; 430 status = AE_BAD_PARAMETER;
431 goto unlock; 431 goto unlock_and_exit;
432 } 432 }
433 433
434 /* Root Object */ 434 /* Root Object */
@@ -442,7 +442,7 @@ acpi_remove_notify_handler(acpi_handle device,
442 ((handler_type & ACPI_DEVICE_NOTIFY) && 442 ((handler_type & ACPI_DEVICE_NOTIFY) &&
443 !acpi_gbl_device_notify.handler)) { 443 !acpi_gbl_device_notify.handler)) {
444 status = AE_NOT_EXIST; 444 status = AE_NOT_EXIST;
445 goto unlock; 445 goto unlock_and_exit;
446 } 446 }
447 447
448 /* Make sure all deferred tasks are completed */ 448 /* Make sure all deferred tasks are completed */
@@ -474,7 +474,7 @@ acpi_remove_notify_handler(acpi_handle device,
474 474
475 if (!acpi_ev_is_notify_object(node)) { 475 if (!acpi_ev_is_notify_object(node)) {
476 status = AE_TYPE; 476 status = AE_TYPE;
477 goto unlock; 477 goto unlock_and_exit;
478 } 478 }
479 479
480 /* Check for an existing internal object */ 480 /* Check for an existing internal object */
@@ -482,17 +482,21 @@ acpi_remove_notify_handler(acpi_handle device,
482 obj_desc = acpi_ns_get_attached_object(node); 482 obj_desc = acpi_ns_get_attached_object(node);
483 if (!obj_desc) { 483 if (!obj_desc) {
484 status = AE_NOT_EXIST; 484 status = AE_NOT_EXIST;
485 goto unlock; 485 goto unlock_and_exit;
486 } 486 }
487 487
488 /* Object exists - make sure there's an existing handler */ 488 /* Object exists - make sure there's an existing handler */
489 489
490 if (handler_type & ACPI_SYSTEM_NOTIFY) { 490 if (handler_type & ACPI_SYSTEM_NOTIFY) {
491 notify_obj = obj_desc->common_notify.system_notify; 491 notify_obj = obj_desc->common_notify.system_notify;
492 if ((!notify_obj) || 492 if (!notify_obj) {
493 (notify_obj->notify.handler != handler)) { 493 status = AE_NOT_EXIST;
494 goto unlock_and_exit;
495 }
496
497 if (notify_obj->notify.handler != handler) {
494 status = AE_BAD_PARAMETER; 498 status = AE_BAD_PARAMETER;
495 goto unlock; 499 goto unlock_and_exit;
496 } 500 }
497 /* Make sure all deferred tasks are completed */ 501 /* Make sure all deferred tasks are completed */
498 502
@@ -510,10 +514,14 @@ acpi_remove_notify_handler(acpi_handle device,
510 514
511 if (handler_type & ACPI_DEVICE_NOTIFY) { 515 if (handler_type & ACPI_DEVICE_NOTIFY) {
512 notify_obj = obj_desc->common_notify.device_notify; 516 notify_obj = obj_desc->common_notify.device_notify;
513 if ((!notify_obj) || 517 if (!notify_obj) {
514 (notify_obj->notify.handler != handler)) { 518 status = AE_NOT_EXIST;
519 goto unlock_and_exit;
520 }
521
522 if (notify_obj->notify.handler != handler) {
515 status = AE_BAD_PARAMETER; 523 status = AE_BAD_PARAMETER;
516 goto unlock; 524 goto unlock_and_exit;
517 } 525 }
518 /* Make sure all deferred tasks are completed */ 526 /* Make sure all deferred tasks are completed */
519 527
@@ -530,9 +538,9 @@ acpi_remove_notify_handler(acpi_handle device,
530 } 538 }
531 } 539 }
532 540
533unlock: 541 unlock_and_exit:
534 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 542 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
535exit: 543 exit:
536 if (ACPI_FAILURE(status)) 544 if (ACPI_FAILURE(status))
537 ACPI_EXCEPTION((AE_INFO, status, "Removing notify handler")); 545 ACPI_EXCEPTION((AE_INFO, status, "Removing notify handler"));
538 return_ACPI_STATUS(status); 546 return_ACPI_STATUS(status);
@@ -586,7 +594,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
586 gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number); 594 gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number);
587 if (!gpe_event_info) { 595 if (!gpe_event_info) {
588 status = AE_BAD_PARAMETER; 596 status = AE_BAD_PARAMETER;
589 goto unlock; 597 goto unlock_and_exit;
590 } 598 }
591 599
592 /* Make sure that there isn't a handler there already */ 600 /* Make sure that there isn't a handler there already */
@@ -594,7 +602,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
594 if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) == 602 if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) ==
595 ACPI_GPE_DISPATCH_HANDLER) { 603 ACPI_GPE_DISPATCH_HANDLER) {
596 status = AE_ALREADY_EXISTS; 604 status = AE_ALREADY_EXISTS;
597 goto unlock; 605 goto unlock_and_exit;
598 } 606 }
599 607
600 /* Allocate and init handler object */ 608 /* Allocate and init handler object */
@@ -602,7 +610,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
602 handler = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_handler_info)); 610 handler = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_handler_info));
603 if (!handler) { 611 if (!handler) {
604 status = AE_NO_MEMORY; 612 status = AE_NO_MEMORY;
605 goto unlock; 613 goto unlock_and_exit;
606 } 614 }
607 615
608 handler->address = address; 616 handler->address = address;
@@ -613,7 +621,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
613 621
614 status = acpi_ev_disable_gpe(gpe_event_info); 622 status = acpi_ev_disable_gpe(gpe_event_info);
615 if (ACPI_FAILURE(status)) { 623 if (ACPI_FAILURE(status)) {
616 goto unlock; 624 goto unlock_and_exit;
617 } 625 }
618 626
619 /* Install the handler */ 627 /* Install the handler */
@@ -628,9 +636,9 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
628 636
629 acpi_os_release_lock(acpi_gbl_gpe_lock, flags); 637 acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
630 638
631unlock: 639 unlock_and_exit:
632 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); 640 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
633exit: 641 exit:
634 if (ACPI_FAILURE(status)) 642 if (ACPI_FAILURE(status))
635 ACPI_EXCEPTION((AE_INFO, status, 643 ACPI_EXCEPTION((AE_INFO, status,
636 "Installing notify handler failed")); 644 "Installing notify handler failed"));
diff --git a/drivers/acpi/events/evxfregn.c b/drivers/acpi/events/evxfregn.c
index e8b86a0baad0..83b12a9afa32 100644
--- a/drivers/acpi/events/evxfregn.c
+++ b/drivers/acpi/events/evxfregn.c
@@ -155,7 +155,11 @@ acpi_remove_address_space_handler(acpi_handle device,
155 /* Convert and validate the device handle */ 155 /* Convert and validate the device handle */
156 156
157 node = acpi_ns_map_handle_to_node(device); 157 node = acpi_ns_map_handle_to_node(device);
158 if (!node) { 158 if (!node ||
159 ((node->type != ACPI_TYPE_DEVICE) &&
160 (node->type != ACPI_TYPE_PROCESSOR) &&
161 (node->type != ACPI_TYPE_THERMAL) &&
162 (node != acpi_gbl_root_node))) {
159 status = AE_BAD_PARAMETER; 163 status = AE_BAD_PARAMETER;
160 goto unlock_and_exit; 164 goto unlock_and_exit;
161 } 165 }
@@ -178,6 +182,13 @@ acpi_remove_address_space_handler(acpi_handle device,
178 182
179 if (handler_obj->address_space.space_id == space_id) { 183 if (handler_obj->address_space.space_id == space_id) {
180 184
185 /* Handler must be the same as the installed handler */
186
187 if (handler_obj->address_space.handler != handler) {
188 status = AE_BAD_PARAMETER;
189 goto unlock_and_exit;
190 }
191
181 /* Matched space_id, first dereference this in the Regions */ 192 /* Matched space_id, first dereference this in the Regions */
182 193
183 ACPI_DEBUG_PRINT((ACPI_DB_OPREGION, 194 ACPI_DEBUG_PRINT((ACPI_DB_OPREGION,
diff --git a/drivers/acpi/executer/exconfig.c b/drivers/acpi/executer/exconfig.c
index 83fed079a276..c8341fa5fe01 100644
--- a/drivers/acpi/executer/exconfig.c
+++ b/drivers/acpi/executer/exconfig.c
@@ -502,7 +502,6 @@ acpi_status acpi_ex_unload_table(union acpi_operand_object *ddb_handle)
502 * (Offset contains the table_id) 502 * (Offset contains the table_id)
503 */ 503 */
504 acpi_ns_delete_namespace_by_owner(table_info->owner_id); 504 acpi_ns_delete_namespace_by_owner(table_info->owner_id);
505 acpi_ut_release_owner_id(&table_info->owner_id);
506 505
507 /* Delete the table itself */ 506 /* Delete the table itself */
508 507
diff --git a/drivers/acpi/executer/exconvrt.c b/drivers/acpi/executer/exconvrt.c
index b732e399b1ef..544e81a6a438 100644
--- a/drivers/acpi/executer/exconvrt.c
+++ b/drivers/acpi/executer/exconvrt.c
@@ -170,6 +170,9 @@ acpi_ex_convert_to_integer(union acpi_operand_object *obj_desc,
170 return_ACPI_STATUS(AE_NO_MEMORY); 170 return_ACPI_STATUS(AE_NO_MEMORY);
171 } 171 }
172 172
173 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Converted value: %8.8X%8.8X\n",
174 ACPI_FORMAT_UINT64(result)));
175
173 /* Save the Result */ 176 /* Save the Result */
174 177
175 return_desc->integer.value = result; 178 return_desc->integer.value = result;
diff --git a/drivers/acpi/executer/exmutex.c b/drivers/acpi/executer/exmutex.c
index d8ac2877cf05..3a39c2e8e104 100644
--- a/drivers/acpi/executer/exmutex.c
+++ b/drivers/acpi/executer/exmutex.c
@@ -267,9 +267,9 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
267 && (obj_desc->mutex.os_mutex != ACPI_GLOBAL_LOCK)) { 267 && (obj_desc->mutex.os_mutex != ACPI_GLOBAL_LOCK)) {
268 ACPI_ERROR((AE_INFO, 268 ACPI_ERROR((AE_INFO,
269 "Thread %X cannot release Mutex [%4.4s] acquired by thread %X", 269 "Thread %X cannot release Mutex [%4.4s] acquired by thread %X",
270 walk_state->thread->thread_id, 270 (u32) walk_state->thread->thread_id,
271 acpi_ut_get_node_name(obj_desc->mutex.node), 271 acpi_ut_get_node_name(obj_desc->mutex.node),
272 obj_desc->mutex.owner_thread->thread_id)); 272 (u32) obj_desc->mutex.owner_thread->thread_id));
273 return_ACPI_STATUS(AE_AML_NOT_OWNER); 273 return_ACPI_STATUS(AE_AML_NOT_OWNER);
274 } 274 }
275 275
diff --git a/drivers/acpi/executer/exsystem.c b/drivers/acpi/executer/exsystem.c
index 6b5d1e6ce94b..28aef3e69ecc 100644
--- a/drivers/acpi/executer/exsystem.c
+++ b/drivers/acpi/executer/exsystem.c
@@ -60,7 +60,7 @@ ACPI_MODULE_NAME("exsystem")
60 * 60 *
61 * DESCRIPTION: Implements a semaphore wait with a check to see if the 61 * DESCRIPTION: Implements a semaphore wait with a check to see if the
62 * semaphore is available immediately. If it is not, the 62 * semaphore is available immediately. If it is not, the
63 * interpreter is released. 63 * interpreter is released before waiting.
64 * 64 *
65 ******************************************************************************/ 65 ******************************************************************************/
66acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout) 66acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout)
@@ -110,9 +110,9 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout)
110 * 110 *
111 * RETURN: Status 111 * RETURN: Status
112 * 112 *
113 * DESCRIPTION: Implements a semaphore wait with a check to see if the 113 * DESCRIPTION: Implements a mutex wait with a check to see if the
114 * semaphore is available immediately. If it is not, the 114 * mutex is available immediately. If it is not, the
115 * interpreter is released. 115 * interpreter is released before waiting.
116 * 116 *
117 ******************************************************************************/ 117 ******************************************************************************/
118 118
diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c
index daed2460924d..045c89477e59 100644
--- a/drivers/acpi/fan.c
+++ b/drivers/acpi/fan.c
@@ -120,7 +120,7 @@ acpi_fan_write_state(struct file *file, const char __user * buffer,
120 return count; 120 return count;
121} 121}
122 122
123static struct file_operations acpi_fan_state_ops = { 123static const struct file_operations acpi_fan_state_ops = {
124 .open = acpi_fan_state_open_fs, 124 .open = acpi_fan_state_open_fs,
125 .read = seq_read, 125 .read = seq_read,
126 .write = acpi_fan_write_state, 126 .write = acpi_fan_write_state,
diff --git a/drivers/acpi/hotkey.c b/drivers/acpi/hotkey.c
index fd81a0f5222f..32c9d88fd196 100644
--- a/drivers/acpi/hotkey.c
+++ b/drivers/acpi/hotkey.c
@@ -184,7 +184,7 @@ static union acpi_hotkey *get_hotkey_by_event(struct
184 *hotkey_list, int event); 184 *hotkey_list, int event);
185 185
186/* event based config */ 186/* event based config */
187static struct file_operations hotkey_config_fops = { 187static const struct file_operations hotkey_config_fops = {
188 .open = hotkey_open_config, 188 .open = hotkey_open_config,
189 .read = seq_read, 189 .read = seq_read,
190 .write = hotkey_write_config, 190 .write = hotkey_write_config,
@@ -193,7 +193,7 @@ static struct file_operations hotkey_config_fops = {
193}; 193};
194 194
195/* polling based config */ 195/* polling based config */
196static struct file_operations hotkey_poll_config_fops = { 196static const struct file_operations hotkey_poll_config_fops = {
197 .open = hotkey_poll_open_config, 197 .open = hotkey_poll_open_config,
198 .read = seq_read, 198 .read = seq_read,
199 .write = hotkey_write_config, 199 .write = hotkey_write_config,
@@ -202,7 +202,7 @@ static struct file_operations hotkey_poll_config_fops = {
202}; 202};
203 203
204/* hotkey driver info */ 204/* hotkey driver info */
205static struct file_operations hotkey_info_fops = { 205static const struct file_operations hotkey_info_fops = {
206 .open = hotkey_info_open_fs, 206 .open = hotkey_info_open_fs,
207 .read = seq_read, 207 .read = seq_read,
208 .llseek = seq_lseek, 208 .llseek = seq_lseek,
@@ -210,7 +210,7 @@ static struct file_operations hotkey_info_fops = {
210}; 210};
211 211
212/* action */ 212/* action */
213static struct file_operations hotkey_action_fops = { 213static const struct file_operations hotkey_action_fops = {
214 .open = hotkey_action_open_fs, 214 .open = hotkey_action_open_fs,
215 .read = seq_read, 215 .read = seq_read,
216 .write = hotkey_execute_aml_method, 216 .write = hotkey_execute_aml_method,
@@ -219,7 +219,7 @@ static struct file_operations hotkey_action_fops = {
219}; 219};
220 220
221/* polling results */ 221/* polling results */
222static struct file_operations hotkey_polling_fops = { 222static const struct file_operations hotkey_polling_fops = {
223 .open = hotkey_polling_open_fs, 223 .open = hotkey_polling_open_fs,
224 .read = seq_read, 224 .read = seq_read,
225 .llseek = seq_lseek, 225 .llseek = seq_lseek,
diff --git a/drivers/acpi/namespace/nsalloc.c b/drivers/acpi/namespace/nsalloc.c
index dc3f0739a46b..55b407aae266 100644
--- a/drivers/acpi/namespace/nsalloc.c
+++ b/drivers/acpi/namespace/nsalloc.c
@@ -386,14 +386,17 @@ void acpi_ns_delete_namespace_subtree(struct acpi_namespace_node *parent_node)
386 * specific ID. Used to delete entire ACPI tables. All 386 * specific ID. Used to delete entire ACPI tables. All
387 * reference counts are updated. 387 * reference counts are updated.
388 * 388 *
389 * MUTEX: Locks namespace during deletion walk.
390 *
389 ******************************************************************************/ 391 ******************************************************************************/
390 392
391void acpi_ns_delete_namespace_by_owner(acpi_owner_id owner_id) 393void acpi_ns_delete_namespace_by_owner(acpi_owner_id owner_id)
392{ 394{
393 struct acpi_namespace_node *child_node; 395 struct acpi_namespace_node *child_node;
394 struct acpi_namespace_node *deletion_node; 396 struct acpi_namespace_node *deletion_node;
395 u32 level;
396 struct acpi_namespace_node *parent_node; 397 struct acpi_namespace_node *parent_node;
398 u32 level;
399 acpi_status status;
397 400
398 ACPI_FUNCTION_TRACE_U32(ns_delete_namespace_by_owner, owner_id); 401 ACPI_FUNCTION_TRACE_U32(ns_delete_namespace_by_owner, owner_id);
399 402
@@ -401,6 +404,13 @@ void acpi_ns_delete_namespace_by_owner(acpi_owner_id owner_id)
401 return_VOID; 404 return_VOID;
402 } 405 }
403 406
407 /* Lock namespace for possible update */
408
409 status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
410 if (ACPI_FAILURE(status)) {
411 return_VOID;
412 }
413
404 deletion_node = NULL; 414 deletion_node = NULL;
405 parent_node = acpi_gbl_root_node; 415 parent_node = acpi_gbl_root_node;
406 child_node = NULL; 416 child_node = NULL;
@@ -469,5 +479,6 @@ void acpi_ns_delete_namespace_by_owner(acpi_owner_id owner_id)
469 } 479 }
470 } 480 }
471 481
482 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
472 return_VOID; 483 return_VOID;
473} 484}
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index eedb05c6dc7b..b7d1514cd199 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -36,7 +36,6 @@
36#include <linux/delay.h> 36#include <linux/delay.h>
37#include <linux/workqueue.h> 37#include <linux/workqueue.h>
38#include <linux/nmi.h> 38#include <linux/nmi.h>
39#include <linux/kthread.h>
40#include <acpi/acpi.h> 39#include <acpi/acpi.h>
41#include <asm/io.h> 40#include <asm/io.h>
42#include <acpi/acpi_bus.h> 41#include <acpi/acpi_bus.h>
@@ -136,16 +135,6 @@ void acpi_os_vprintf(const char *fmt, va_list args)
136#endif 135#endif
137} 136}
138 137
139
140extern int acpi_in_resume;
141void *acpi_os_allocate(acpi_size size)
142{
143 if (acpi_in_resume)
144 return kmalloc(size, GFP_ATOMIC);
145 else
146 return kmalloc(size, GFP_KERNEL);
147}
148
149acpi_status acpi_os_get_root_pointer(u32 flags, struct acpi_pointer *addr) 138acpi_status acpi_os_get_root_pointer(u32 flags, struct acpi_pointer *addr)
150{ 139{
151 if (efi_enabled) { 140 if (efi_enabled) {
@@ -593,16 +582,6 @@ static void acpi_os_execute_deferred(void *context)
593 return; 582 return;
594} 583}
595 584
596static int acpi_os_execute_thread(void *context)
597{
598 struct acpi_os_dpc *dpc = (struct acpi_os_dpc *)context;
599 if (dpc) {
600 dpc->function(dpc->context);
601 kfree(dpc);
602 }
603 do_exit(0);
604}
605
606/******************************************************************************* 585/*******************************************************************************
607 * 586 *
608 * FUNCTION: acpi_os_execute 587 * FUNCTION: acpi_os_execute
@@ -624,10 +603,16 @@ acpi_status acpi_os_execute(acpi_execute_type type,
624 acpi_status status = AE_OK; 603 acpi_status status = AE_OK;
625 struct acpi_os_dpc *dpc; 604 struct acpi_os_dpc *dpc;
626 struct work_struct *task; 605 struct work_struct *task;
627 struct task_struct *p; 606
607 ACPI_FUNCTION_TRACE("os_queue_for_execution");
608
609 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
610 "Scheduling function [%p(%p)] for deferred execution.\n",
611 function, context));
628 612
629 if (!function) 613 if (!function)
630 return AE_BAD_PARAMETER; 614 return_ACPI_STATUS(AE_BAD_PARAMETER);
615
631 /* 616 /*
632 * Allocate/initialize DPC structure. Note that this memory will be 617 * Allocate/initialize DPC structure. Note that this memory will be
633 * freed by the callee. The kernel handles the tq_struct list in a 618 * freed by the callee. The kernel handles the tq_struct list in a
@@ -638,34 +623,27 @@ acpi_status acpi_os_execute(acpi_execute_type type,
638 * We can save time and code by allocating the DPC and tq_structs 623 * We can save time and code by allocating the DPC and tq_structs
639 * from the same memory. 624 * from the same memory.
640 */ 625 */
641 if (type == OSL_NOTIFY_HANDLER) { 626
642 dpc = kmalloc(sizeof(struct acpi_os_dpc), GFP_KERNEL); 627 dpc =
643 } else { 628 kmalloc(sizeof(struct acpi_os_dpc) + sizeof(struct work_struct),
644 dpc = kmalloc(sizeof(struct acpi_os_dpc) + 629 GFP_ATOMIC);
645 sizeof(struct work_struct), GFP_ATOMIC);
646 }
647 if (!dpc) 630 if (!dpc)
648 return AE_NO_MEMORY; 631 return_ACPI_STATUS(AE_NO_MEMORY);
632
649 dpc->function = function; 633 dpc->function = function;
650 dpc->context = context; 634 dpc->context = context;
651 635
652 if (type == OSL_NOTIFY_HANDLER) { 636 task = (void *)(dpc + 1);
653 p = kthread_create(acpi_os_execute_thread, dpc, "kacpid_notify"); 637 INIT_WORK(task, acpi_os_execute_deferred, (void *)dpc);
654 if (!IS_ERR(p)) { 638
655 wake_up_process(p); 639 if (!queue_work(kacpid_wq, task)) {
656 } else { 640 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
657 status = AE_NO_MEMORY; 641 "Call to queue_work() failed.\n"));
658 kfree(dpc); 642 kfree(dpc);
659 } 643 status = AE_ERROR;
660 } else {
661 task = (void *)(dpc + 1);
662 INIT_WORK(task, acpi_os_execute_deferred, (void *)dpc);
663 if (!queue_work(kacpid_wq, task)) {
664 status = AE_ERROR;
665 kfree(dpc);
666 }
667 } 644 }
668 return status; 645
646 return_ACPI_STATUS(status);
669} 647}
670 648
671EXPORT_SYMBOL(acpi_os_execute); 649EXPORT_SYMBOL(acpi_os_execute);
@@ -1115,26 +1093,6 @@ acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object)
1115 return (AE_OK); 1093 return (AE_OK);
1116} 1094}
1117 1095
1118/*******************************************************************************
1119 *
1120 * FUNCTION: acpi_os_acquire_object
1121 *
1122 * PARAMETERS: Cache - Handle to cache object
1123 * ReturnObject - Where the object is returned
1124 *
1125 * RETURN: Status
1126 *
1127 * DESCRIPTION: Return a zero-filled object.
1128 *
1129 ******************************************************************************/
1130
1131void *acpi_os_acquire_object(acpi_cache_t * cache)
1132{
1133 void *object = kmem_cache_zalloc(cache, GFP_KERNEL);
1134 WARN_ON(!object);
1135 return object;
1136}
1137
1138/****************************************************************************** 1096/******************************************************************************
1139 * 1097 *
1140 * FUNCTION: acpi_os_validate_interface 1098 * FUNCTION: acpi_os_validate_interface
diff --git a/drivers/acpi/parser/psutils.c b/drivers/acpi/parser/psutils.c
index 182474ae8ce9..d405387b7414 100644
--- a/drivers/acpi/parser/psutils.c
+++ b/drivers/acpi/parser/psutils.c
@@ -139,12 +139,10 @@ union acpi_parse_object *acpi_ps_alloc_op(u16 opcode)
139 /* The generic op (default) is by far the most common (16 to 1) */ 139 /* The generic op (default) is by far the most common (16 to 1) */
140 140
141 op = acpi_os_acquire_object(acpi_gbl_ps_node_cache); 141 op = acpi_os_acquire_object(acpi_gbl_ps_node_cache);
142 memset(op, 0, sizeof(struct acpi_parse_obj_common));
143 } else { 142 } else {
144 /* Extended parseop */ 143 /* Extended parseop */
145 144
146 op = acpi_os_acquire_object(acpi_gbl_ps_node_ext_cache); 145 op = acpi_os_acquire_object(acpi_gbl_ps_node_ext_cache);
147 memset(op, 0, sizeof(struct acpi_parse_obj_named));
148 } 146 }
149 147
150 /* Initialize the Op */ 148 /* Initialize the Op */
diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c
index 8197c0e40769..7f3e7e77e794 100644
--- a/drivers/acpi/pci_link.c
+++ b/drivers/acpi/pci_link.c
@@ -780,11 +780,6 @@ static int acpi_pci_link_resume(struct acpi_pci_link *link)
780 return 0; 780 return 0;
781} 781}
782 782
783/*
784 * FIXME: this is a workaround to avoid nasty warning. It will be removed
785 * after every device calls pci_disable_device in .resume.
786 */
787int acpi_in_resume;
788static int irqrouter_resume(struct sys_device *dev) 783static int irqrouter_resume(struct sys_device *dev)
789{ 784{
790 struct list_head *node = NULL; 785 struct list_head *node = NULL;
@@ -794,7 +789,6 @@ static int irqrouter_resume(struct sys_device *dev)
794 /* Make sure SCI is enabled again (Apple firmware bug?) */ 789 /* Make sure SCI is enabled again (Apple firmware bug?) */
795 acpi_set_register(ACPI_BITREG_SCI_ENABLE, 1, ACPI_MTX_DO_NOT_LOCK); 790 acpi_set_register(ACPI_BITREG_SCI_ENABLE, 1, ACPI_MTX_DO_NOT_LOCK);
796 791
797 acpi_in_resume = 1;
798 list_for_each(node, &acpi_link.entries) { 792 list_for_each(node, &acpi_link.entries) {
799 link = list_entry(node, struct acpi_pci_link, node); 793 link = list_entry(node, struct acpi_pci_link, node);
800 if (!link) { 794 if (!link) {
@@ -803,7 +797,6 @@ static int irqrouter_resume(struct sys_device *dev)
803 } 797 }
804 acpi_pci_link_resume(link); 798 acpi_pci_link_resume(link);
805 } 799 }
806 acpi_in_resume = 0;
807 return 0; 800 return 0;
808} 801}
809 802
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index 5d3447f4582c..fec225d1b6b7 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -80,7 +80,7 @@ struct acpi_power_resource {
80 80
81static struct list_head acpi_power_resource_list; 81static struct list_head acpi_power_resource_list;
82 82
83static struct file_operations acpi_power_fops = { 83static const struct file_operations acpi_power_fops = {
84 .open = acpi_power_open_fs, 84 .open = acpi_power_open_fs,
85 .read = seq_read, 85 .read = seq_read,
86 .llseek = seq_lseek, 86 .llseek = seq_lseek,
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index 52674323b14d..b13d64415b7a 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -102,7 +102,7 @@ static struct acpi_driver acpi_processor_driver = {
102#define INSTALL_NOTIFY_HANDLER 1 102#define INSTALL_NOTIFY_HANDLER 1
103#define UNINSTALL_NOTIFY_HANDLER 2 103#define UNINSTALL_NOTIFY_HANDLER 2
104 104
105static struct file_operations acpi_processor_info_fops = { 105static const struct file_operations acpi_processor_info_fops = {
106 .open = acpi_processor_info_open_fs, 106 .open = acpi_processor_info_open_fs,
107 .read = seq_read, 107 .read = seq_read,
108 .llseek = seq_lseek, 108 .llseek = seq_lseek,
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 8e9c26aae8fe..71066066d626 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -1070,7 +1070,7 @@ static int acpi_processor_power_open_fs(struct inode *inode, struct file *file)
1070 PDE(inode)->data); 1070 PDE(inode)->data);
1071} 1071}
1072 1072
1073static struct file_operations acpi_processor_power_fops = { 1073static const struct file_operations acpi_processor_power_fops = {
1074 .open = acpi_processor_power_open_fs, 1074 .open = acpi_processor_power_open_fs,
1075 .read = seq_read, 1075 .read = seq_read,
1076 .llseek = seq_lseek, 1076 .llseek = seq_lseek,
diff --git a/drivers/acpi/sleep/proc.c b/drivers/acpi/sleep/proc.c
index 4696a85a98b9..34962578039d 100644
--- a/drivers/acpi/sleep/proc.c
+++ b/drivers/acpi/sleep/proc.c
@@ -434,7 +434,7 @@ acpi_system_wakeup_device_open_fs(struct inode *inode, struct file *file)
434 PDE(inode)->data); 434 PDE(inode)->data);
435} 435}
436 436
437static struct file_operations acpi_system_wakeup_device_fops = { 437static const struct file_operations acpi_system_wakeup_device_fops = {
438 .open = acpi_system_wakeup_device_open_fs, 438 .open = acpi_system_wakeup_device_open_fs,
439 .read = seq_read, 439 .read = seq_read,
440 .write = acpi_system_write_wakeup_device, 440 .write = acpi_system_write_wakeup_device,
@@ -443,7 +443,7 @@ static struct file_operations acpi_system_wakeup_device_fops = {
443}; 443};
444 444
445#ifdef CONFIG_ACPI_SLEEP_PROC_SLEEP 445#ifdef CONFIG_ACPI_SLEEP_PROC_SLEEP
446static struct file_operations acpi_system_sleep_fops = { 446static const struct file_operations acpi_system_sleep_fops = {
447 .open = acpi_system_sleep_open_fs, 447 .open = acpi_system_sleep_open_fs,
448 .read = seq_read, 448 .read = seq_read,
449 .write = acpi_system_write_sleep, 449 .write = acpi_system_write_sleep,
@@ -452,7 +452,7 @@ static struct file_operations acpi_system_sleep_fops = {
452}; 452};
453#endif /* CONFIG_ACPI_SLEEP_PROC_SLEEP */ 453#endif /* CONFIG_ACPI_SLEEP_PROC_SLEEP */
454 454
455static struct file_operations acpi_system_alarm_fops = { 455static const struct file_operations acpi_system_alarm_fops = {
456 .open = acpi_system_alarm_open_fs, 456 .open = acpi_system_alarm_open_fs,
457 .read = seq_read, 457 .read = seq_read,
458 .write = acpi_system_write_alarm, 458 .write = acpi_system_write_alarm,
diff --git a/drivers/acpi/system.c b/drivers/acpi/system.c
index c3bb7faad75e..d86dcb3c2366 100644
--- a/drivers/acpi/system.c
+++ b/drivers/acpi/system.c
@@ -57,7 +57,7 @@ static int acpi_system_info_open_fs(struct inode *inode, struct file *file)
57 return single_open(file, acpi_system_read_info, PDE(inode)->data); 57 return single_open(file, acpi_system_read_info, PDE(inode)->data);
58} 58}
59 59
60static struct file_operations acpi_system_info_ops = { 60static const struct file_operations acpi_system_info_ops = {
61 .open = acpi_system_info_open_fs, 61 .open = acpi_system_info_open_fs,
62 .read = seq_read, 62 .read = seq_read,
63 .llseek = seq_lseek, 63 .llseek = seq_lseek,
@@ -67,7 +67,7 @@ static struct file_operations acpi_system_info_ops = {
67static ssize_t acpi_system_read_dsdt(struct file *, char __user *, size_t, 67static ssize_t acpi_system_read_dsdt(struct file *, char __user *, size_t,
68 loff_t *); 68 loff_t *);
69 69
70static struct file_operations acpi_system_dsdt_ops = { 70static const struct file_operations acpi_system_dsdt_ops = {
71 .read = acpi_system_read_dsdt, 71 .read = acpi_system_read_dsdt,
72}; 72};
73 73
@@ -94,7 +94,7 @@ acpi_system_read_dsdt(struct file *file,
94static ssize_t acpi_system_read_fadt(struct file *, char __user *, size_t, 94static ssize_t acpi_system_read_fadt(struct file *, char __user *, size_t,
95 loff_t *); 95 loff_t *);
96 96
97static struct file_operations acpi_system_fadt_ops = { 97static const struct file_operations acpi_system_fadt_ops = {
98 .read = acpi_system_read_fadt, 98 .read = acpi_system_read_fadt,
99}; 99};
100 100
diff --git a/drivers/acpi/tables/tbget.c b/drivers/acpi/tables/tbget.c
index 99eacceff563..7856db759af0 100644
--- a/drivers/acpi/tables/tbget.c
+++ b/drivers/acpi/tables/tbget.c
@@ -320,6 +320,16 @@ acpi_tb_get_this_table(struct acpi_pointer *address,
320 320
321 ACPI_FUNCTION_TRACE(tb_get_this_table); 321 ACPI_FUNCTION_TRACE(tb_get_this_table);
322 322
323 /* Validate minimum length */
324
325 if (header->length < sizeof(struct acpi_table_header)) {
326 ACPI_ERROR((AE_INFO,
327 "Table length (%X) is smaller than minimum (%X)",
328 header->length, sizeof(struct acpi_table_header)));
329
330 return_ACPI_STATUS(AE_INVALID_TABLE_LENGTH);
331 }
332
323 /* 333 /*
324 * Flags contains the current processor mode (Virtual or Physical 334 * Flags contains the current processor mode (Virtual or Physical
325 * addressing) The pointer_type is either Logical or Physical 335 * addressing) The pointer_type is either Logical or Physical
@@ -356,7 +366,7 @@ acpi_tb_get_this_table(struct acpi_pointer *address,
356 */ 366 */
357 status = acpi_os_map_memory(address->pointer.physical, 367 status = acpi_os_map_memory(address->pointer.physical,
358 (acpi_size) header->length, 368 (acpi_size) header->length,
359 (void *)&full_table); 369 ACPI_CAST_PTR(void, &full_table));
360 if (ACPI_FAILURE(status)) { 370 if (ACPI_FAILURE(status)) {
361 ACPI_ERROR((AE_INFO, 371 ACPI_ERROR((AE_INFO,
362 "Could not map memory for table [%4.4s] at %8.8X%8.8X for length %X", 372 "Could not map memory for table [%4.4s] at %8.8X%8.8X for length %X",
diff --git a/drivers/acpi/tables/tbinstal.c b/drivers/acpi/tables/tbinstal.c
index 7ca2df75bb11..1668a232fb67 100644
--- a/drivers/acpi/tables/tbinstal.c
+++ b/drivers/acpi/tables/tbinstal.c
@@ -256,7 +256,7 @@ acpi_tb_init_table_descriptor(acpi_table_type table_type,
256 256
257 status = acpi_ut_allocate_owner_id(&table_desc->owner_id); 257 status = acpi_ut_allocate_owner_id(&table_desc->owner_id);
258 if (ACPI_FAILURE(status)) { 258 if (ACPI_FAILURE(status)) {
259 return_ACPI_STATUS(status); 259 goto error_exit1;
260 } 260 }
261 261
262 /* Install the table into the global data structure */ 262 /* Install the table into the global data structure */
@@ -274,8 +274,8 @@ acpi_tb_init_table_descriptor(acpi_table_type table_type,
274 * at this location, so return an error. 274 * at this location, so return an error.
275 */ 275 */
276 if (list_head->next) { 276 if (list_head->next) {
277 ACPI_FREE(table_desc); 277 status = AE_ALREADY_EXISTS;
278 return_ACPI_STATUS(AE_ALREADY_EXISTS); 278 goto error_exit2;
279 } 279 }
280 280
281 table_desc->next = list_head->next; 281 table_desc->next = list_head->next;
@@ -335,6 +335,17 @@ acpi_tb_init_table_descriptor(acpi_table_type table_type,
335 table_info->owner_id = table_desc->owner_id; 335 table_info->owner_id = table_desc->owner_id;
336 table_info->installed_desc = table_desc; 336 table_info->installed_desc = table_desc;
337 return_ACPI_STATUS(AE_OK); 337 return_ACPI_STATUS(AE_OK);
338
339 /* Error exit with cleanup */
340
341 error_exit2:
342
343 acpi_ut_release_owner_id(&table_desc->owner_id);
344
345 error_exit1:
346
347 ACPI_FREE(table_desc);
348 return_ACPI_STATUS(status);
338} 349}
339 350
340/******************************************************************************* 351/*******************************************************************************
@@ -525,6 +536,10 @@ struct acpi_table_desc *acpi_tb_uninstall_table(struct acpi_table_desc
525 536
526 acpi_tb_delete_single_table(table_desc); 537 acpi_tb_delete_single_table(table_desc);
527 538
539 /* Free the owner ID associated with this table */
540
541 acpi_ut_release_owner_id(&table_desc->owner_id);
542
528 /* Free the table descriptor */ 543 /* Free the table descriptor */
529 544
530 next_desc = table_desc->next; 545 next_desc = table_desc->next;
diff --git a/drivers/acpi/tables/tbrsdt.c b/drivers/acpi/tables/tbrsdt.c
index abcb08c2592a..0ad3dbb9ebca 100644
--- a/drivers/acpi/tables/tbrsdt.c
+++ b/drivers/acpi/tables/tbrsdt.c
@@ -183,6 +183,17 @@ acpi_status acpi_tb_validate_rsdt(struct acpi_table_header *table_ptr)
183 183
184 ACPI_FUNCTION_ENTRY(); 184 ACPI_FUNCTION_ENTRY();
185 185
186 /* Validate minimum length */
187
188 if (table_ptr->length < sizeof(struct acpi_table_header)) {
189 ACPI_ERROR((AE_INFO,
190 "RSDT/XSDT length (%X) is smaller than minimum (%X)",
191 table_ptr->length,
192 sizeof(struct acpi_table_header)));
193
194 return (AE_INVALID_TABLE_LENGTH);
195 }
196
186 /* Search for appropriate signature, RSDT or XSDT */ 197 /* Search for appropriate signature, RSDT or XSDT */
187 198
188 if (acpi_gbl_root_table_type == ACPI_TABLE_TYPE_RSDT) { 199 if (acpi_gbl_root_table_type == ACPI_TABLE_TYPE_RSDT) {
@@ -210,7 +221,7 @@ acpi_status acpi_tb_validate_rsdt(struct acpi_table_header *table_ptr)
210 ACPI_ERROR((AE_INFO, "Looking for XSDT")); 221 ACPI_ERROR((AE_INFO, "Looking for XSDT"));
211 } 222 }
212 223
213 ACPI_DUMP_BUFFER((char *)table_ptr, 48); 224 ACPI_DUMP_BUFFER(ACPI_CAST_PTR(char, table_ptr), 48);
214 return (AE_BAD_SIGNATURE); 225 return (AE_BAD_SIGNATURE);
215 } 226 }
216 227
@@ -258,7 +269,7 @@ acpi_status acpi_tb_get_table_rsdt(void)
258 269
259 status = acpi_tb_validate_rsdt(table_info.pointer); 270 status = acpi_tb_validate_rsdt(table_info.pointer);
260 if (ACPI_FAILURE(status)) { 271 if (ACPI_FAILURE(status)) {
261 return_ACPI_STATUS(status); 272 goto error_cleanup;
262 } 273 }
263 274
264 /* Get the number of tables defined in the RSDT or XSDT */ 275 /* Get the number of tables defined in the RSDT or XSDT */
@@ -270,14 +281,14 @@ acpi_status acpi_tb_get_table_rsdt(void)
270 281
271 status = acpi_tb_convert_to_xsdt(&table_info); 282 status = acpi_tb_convert_to_xsdt(&table_info);
272 if (ACPI_FAILURE(status)) { 283 if (ACPI_FAILURE(status)) {
273 return_ACPI_STATUS(status); 284 goto error_cleanup;
274 } 285 }
275 286
276 /* Save the table pointers and allocation info */ 287 /* Save the table pointers and allocation info */
277 288
278 status = acpi_tb_init_table_descriptor(ACPI_TABLE_ID_XSDT, &table_info); 289 status = acpi_tb_init_table_descriptor(ACPI_TABLE_ID_XSDT, &table_info);
279 if (ACPI_FAILURE(status)) { 290 if (ACPI_FAILURE(status)) {
280 return_ACPI_STATUS(status); 291 goto error_cleanup;
281 } 292 }
282 293
283 acpi_gbl_XSDT = 294 acpi_gbl_XSDT =
@@ -285,4 +296,12 @@ acpi_status acpi_tb_get_table_rsdt(void)
285 296
286 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "XSDT located at %p\n", acpi_gbl_XSDT)); 297 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "XSDT located at %p\n", acpi_gbl_XSDT));
287 return_ACPI_STATUS(status); 298 return_ACPI_STATUS(status);
299
300 error_cleanup:
301
302 /* Free table allocated by acpi_tb_get_table */
303
304 acpi_tb_delete_single_table(&table_info);
305
306 return_ACPI_STATUS(status);
288} 307}
diff --git a/drivers/acpi/tables/tbxface.c b/drivers/acpi/tables/tbxface.c
index 4e91f2984815..7767987be15a 100644
--- a/drivers/acpi/tables/tbxface.c
+++ b/drivers/acpi/tables/tbxface.c
@@ -134,8 +134,8 @@ ACPI_EXPORT_SYMBOL(acpi_load_tables)
134 * RETURN: Status 134 * RETURN: Status
135 * 135 *
136 * DESCRIPTION: This function is called to load a table from the caller's 136 * DESCRIPTION: This function is called to load a table from the caller's
137 * buffer. The buffer must contain an entire ACPI Table including 137 * buffer. The buffer must contain an entire ACPI Table including
138 * a valid header. The header fields will be verified, and if it 138 * a valid header. The header fields will be verified, and if it
139 * is determined that the table is invalid, the call will fail. 139 * is determined that the table is invalid, the call will fail.
140 * 140 *
141 ******************************************************************************/ 141 ******************************************************************************/
@@ -245,15 +245,18 @@ acpi_status acpi_unload_table(acpi_table_type table_type)
245 /* Find all tables of the requested type */ 245 /* Find all tables of the requested type */
246 246
247 table_desc = acpi_gbl_table_lists[table_type].next; 247 table_desc = acpi_gbl_table_lists[table_type].next;
248 if (!table_desc) {
249 return_ACPI_STATUS(AE_NOT_EXIST);
250 }
251
248 while (table_desc) { 252 while (table_desc) {
249 /* 253 /*
250 * Delete all namespace entries owned by this table. Note that these 254 * Delete all namespace objects owned by this table. Note that these
251 * entries can appear anywhere in the namespace by virtue of the AML 255 * objects can appear anywhere in the namespace by virtue of the AML
252 * "Scope" operator. Thus, we need to track ownership by an ID, not 256 * "Scope" operator. Thus, we need to track ownership by an ID, not
253 * simply a position within the hierarchy 257 * simply a position within the hierarchy
254 */ 258 */
255 acpi_ns_delete_namespace_by_owner(table_desc->owner_id); 259 acpi_ns_delete_namespace_by_owner(table_desc->owner_id);
256 acpi_ut_release_owner_id(&table_desc->owner_id);
257 table_desc = table_desc->next; 260 table_desc = table_desc->next;
258 } 261 }
259 262
@@ -275,12 +278,12 @@ ACPI_EXPORT_SYMBOL(acpi_unload_table)
275 * see acpi_gbl_acpi_table_flag 278 * see acpi_gbl_acpi_table_flag
276 * out_table_header - pointer to the struct acpi_table_header if successful 279 * out_table_header - pointer to the struct acpi_table_header if successful
277 * 280 *
278 * DESCRIPTION: This function is called to get an ACPI table header. The caller 281 * DESCRIPTION: This function is called to get an ACPI table header. The caller
279 * supplies an pointer to a data area sufficient to contain an ACPI 282 * supplies an pointer to a data area sufficient to contain an ACPI
280 * struct acpi_table_header structure. 283 * struct acpi_table_header structure.
281 * 284 *
282 * The header contains a length field that can be used to determine 285 * The header contains a length field that can be used to determine
283 * the size of the buffer needed to contain the entire table. This 286 * the size of the buffer needed to contain the entire table. This
284 * function is not valid for the RSD PTR table since it does not 287 * function is not valid for the RSD PTR table since it does not
285 * have a standard header and is fixed length. 288 * have a standard header and is fixed length.
286 * 289 *
@@ -322,7 +325,8 @@ acpi_get_table_header(acpi_table_type table_type,
322 325
323 /* Copy the header to the caller's buffer */ 326 /* Copy the header to the caller's buffer */
324 327
325 ACPI_MEMCPY((void *)out_table_header, (void *)tbl_ptr, 328 ACPI_MEMCPY(ACPI_CAST_PTR(void, out_table_header),
329 ACPI_CAST_PTR(void, tbl_ptr),
326 sizeof(struct acpi_table_header)); 330 sizeof(struct acpi_table_header));
327 331
328 return_ACPI_STATUS(status); 332 return_ACPI_STATUS(status);
@@ -344,10 +348,10 @@ ACPI_EXPORT_SYMBOL(acpi_get_table_header)
344 * 348 *
345 * RETURN: Status 349 * RETURN: Status
346 * 350 *
347 * DESCRIPTION: This function is called to get an ACPI table. The caller 351 * DESCRIPTION: This function is called to get an ACPI table. The caller
348 * supplies an out_buffer large enough to contain the entire ACPI 352 * supplies an out_buffer large enough to contain the entire ACPI
349 * table. The caller should call the acpi_get_table_header function 353 * table. The caller should call the acpi_get_table_header function
350 * first to determine the buffer size needed. Upon completion 354 * first to determine the buffer size needed. Upon completion
351 * the out_buffer->Length field will indicate the number of bytes 355 * the out_buffer->Length field will indicate the number of bytes
352 * copied into the out_buffer->buf_ptr buffer. This table will be 356 * copied into the out_buffer->buf_ptr buffer. This table will be
353 * a complete table including the header. 357 * a complete table including the header.
@@ -417,7 +421,9 @@ acpi_get_table(acpi_table_type table_type,
417 421
418 /* Copy the table to the buffer */ 422 /* Copy the table to the buffer */
419 423
420 ACPI_MEMCPY((void *)ret_buffer->pointer, (void *)tbl_ptr, table_length); 424 ACPI_MEMCPY(ACPI_CAST_PTR(void, ret_buffer->pointer),
425 ACPI_CAST_PTR(void, tbl_ptr), table_length);
426
421 return_ACPI_STATUS(AE_OK); 427 return_ACPI_STATUS(AE_OK);
422} 428}
423 429
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 503c0b99db12..5753d06b7860 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -176,21 +176,21 @@ struct acpi_thermal {
176 struct timer_list timer; 176 struct timer_list timer;
177}; 177};
178 178
179static struct file_operations acpi_thermal_state_fops = { 179static const struct file_operations acpi_thermal_state_fops = {
180 .open = acpi_thermal_state_open_fs, 180 .open = acpi_thermal_state_open_fs,
181 .read = seq_read, 181 .read = seq_read,
182 .llseek = seq_lseek, 182 .llseek = seq_lseek,
183 .release = single_release, 183 .release = single_release,
184}; 184};
185 185
186static struct file_operations acpi_thermal_temp_fops = { 186static const struct file_operations acpi_thermal_temp_fops = {
187 .open = acpi_thermal_temp_open_fs, 187 .open = acpi_thermal_temp_open_fs,
188 .read = seq_read, 188 .read = seq_read,
189 .llseek = seq_lseek, 189 .llseek = seq_lseek,
190 .release = single_release, 190 .release = single_release,
191}; 191};
192 192
193static struct file_operations acpi_thermal_trip_fops = { 193static const struct file_operations acpi_thermal_trip_fops = {
194 .open = acpi_thermal_trip_open_fs, 194 .open = acpi_thermal_trip_open_fs,
195 .read = seq_read, 195 .read = seq_read,
196 .write = acpi_thermal_write_trip_points, 196 .write = acpi_thermal_write_trip_points,
@@ -198,7 +198,7 @@ static struct file_operations acpi_thermal_trip_fops = {
198 .release = single_release, 198 .release = single_release,
199}; 199};
200 200
201static struct file_operations acpi_thermal_cooling_fops = { 201static const struct file_operations acpi_thermal_cooling_fops = {
202 .open = acpi_thermal_cooling_open_fs, 202 .open = acpi_thermal_cooling_open_fs,
203 .read = seq_read, 203 .read = seq_read,
204 .write = acpi_thermal_write_cooling_mode, 204 .write = acpi_thermal_write_cooling_mode,
@@ -206,7 +206,7 @@ static struct file_operations acpi_thermal_cooling_fops = {
206 .release = single_release, 206 .release = single_release,
207}; 207};
208 208
209static struct file_operations acpi_thermal_polling_fops = { 209static const struct file_operations acpi_thermal_polling_fops = {
210 .open = acpi_thermal_polling_open_fs, 210 .open = acpi_thermal_polling_open_fs,
211 .read = seq_read, 211 .read = seq_read,
212 .write = acpi_thermal_write_polling, 212 .write = acpi_thermal_write_polling,
@@ -1359,13 +1359,28 @@ static int acpi_thermal_remove(struct acpi_device *device, int type)
1359static int acpi_thermal_resume(struct acpi_device *device, int state) 1359static int acpi_thermal_resume(struct acpi_device *device, int state)
1360{ 1360{
1361 struct acpi_thermal *tz = NULL; 1361 struct acpi_thermal *tz = NULL;
1362 int i;
1362 1363
1363 if (!device || !acpi_driver_data(device)) 1364 if (!device || !acpi_driver_data(device))
1364 return -EINVAL; 1365 return -EINVAL;
1365 1366
1366 tz = (struct acpi_thermal *)acpi_driver_data(device); 1367 tz = (struct acpi_thermal *)acpi_driver_data(device);
1367 1368
1368 acpi_thermal_check(tz); 1369 acpi_thermal_get_temperature(tz);
1370
1371 for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++) {
1372 if (tz->trips.active[i].flags.valid) {
1373 tz->temperature = tz->trips.active[i].temperature;
1374 tz->trips.active[i].flags.enabled = 0;
1375
1376 acpi_thermal_active(tz);
1377
1378 tz->state.active |= tz->trips.active[i].flags.enabled;
1379 tz->state.active_index = i;
1380 }
1381 }
1382
1383 acpi_thermal_check(tz);
1369 1384
1370 return AE_OK; 1385 return AE_OK;
1371} 1386}
diff --git a/drivers/acpi/utilities/utalloc.c b/drivers/acpi/utilities/utalloc.c
index 5cff17dc78b3..f6cbc0b1bfd0 100644
--- a/drivers/acpi/utilities/utalloc.c
+++ b/drivers/acpi/utilities/utalloc.c
@@ -285,6 +285,7 @@ acpi_ut_initialize_buffer(struct acpi_buffer * buffer,
285 return (status); 285 return (status);
286} 286}
287 287
288#ifdef NOT_USED_BY_LINUX
288/******************************************************************************* 289/*******************************************************************************
289 * 290 *
290 * FUNCTION: acpi_ut_allocate 291 * FUNCTION: acpi_ut_allocate
@@ -360,3 +361,4 @@ void *acpi_ut_allocate_zeroed(acpi_size size,
360 361
361 return (allocation); 362 return (allocation);
362} 363}
364#endif
diff --git a/drivers/acpi/utilities/utdebug.c b/drivers/acpi/utilities/utdebug.c
index 5ec1cfcc611d..bb1eaf9aa653 100644
--- a/drivers/acpi/utilities/utdebug.c
+++ b/drivers/acpi/utilities/utdebug.c
@@ -47,7 +47,7 @@
47ACPI_MODULE_NAME("utdebug") 47ACPI_MODULE_NAME("utdebug")
48 48
49#ifdef ACPI_DEBUG_OUTPUT 49#ifdef ACPI_DEBUG_OUTPUT
50static u32 acpi_gbl_prev_thread_id = 0xFFFFFFFF; 50static acpi_thread_id acpi_gbl_prev_thread_id;
51static char *acpi_gbl_fn_entry_str = "----Entry"; 51static char *acpi_gbl_fn_entry_str = "----Entry";
52static char *acpi_gbl_fn_exit_str = "----Exit-"; 52static char *acpi_gbl_fn_exit_str = "----Exit-";
53 53
@@ -181,7 +181,7 @@ acpi_ut_debug_print(u32 requested_debug_level,
181 if (ACPI_LV_THREADS & acpi_dbg_level) { 181 if (ACPI_LV_THREADS & acpi_dbg_level) {
182 acpi_os_printf 182 acpi_os_printf
183 ("\n**** Context Switch from TID %X to TID %X ****\n\n", 183 ("\n**** Context Switch from TID %X to TID %X ****\n\n",
184 acpi_gbl_prev_thread_id, thread_id); 184 (u32) acpi_gbl_prev_thread_id, (u32) thread_id);
185 } 185 }
186 186
187 acpi_gbl_prev_thread_id = thread_id; 187 acpi_gbl_prev_thread_id = thread_id;
diff --git a/drivers/acpi/utilities/utdelete.c b/drivers/acpi/utilities/utdelete.c
index 38ebe1c54330..9d3f1149ba21 100644
--- a/drivers/acpi/utilities/utdelete.c
+++ b/drivers/acpi/utilities/utdelete.c
@@ -447,11 +447,16 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
447 */ 447 */
448 switch (ACPI_GET_OBJECT_TYPE(object)) { 448 switch (ACPI_GET_OBJECT_TYPE(object)) {
449 case ACPI_TYPE_DEVICE: 449 case ACPI_TYPE_DEVICE:
450 case ACPI_TYPE_PROCESSOR:
451 case ACPI_TYPE_POWER:
452 case ACPI_TYPE_THERMAL:
450 453
451 acpi_ut_update_ref_count(object->device.system_notify, 454 /* Update the notify objects for these types (if present) */
452 action); 455
453 acpi_ut_update_ref_count(object->device.device_notify, 456 acpi_ut_update_ref_count(object->common_notify.
454 action); 457 system_notify, action);
458 acpi_ut_update_ref_count(object->common_notify.
459 device_notify, action);
455 break; 460 break;
456 461
457 case ACPI_TYPE_PACKAGE: 462 case ACPI_TYPE_PACKAGE:
diff --git a/drivers/acpi/utilities/utmisc.c b/drivers/acpi/utilities/utmisc.c
index 33268310c738..6d8a8211be90 100644
--- a/drivers/acpi/utilities/utmisc.c
+++ b/drivers/acpi/utilities/utmisc.c
@@ -65,7 +65,7 @@ ACPI_MODULE_NAME("utmisc")
65u8 acpi_ut_is_aml_table(struct acpi_table_header *table) 65u8 acpi_ut_is_aml_table(struct acpi_table_header *table)
66{ 66{
67 67
68 /* Ignore tables that contain AML */ 68 /* These are the only tables that contain executable AML */
69 69
70 if (ACPI_COMPARE_NAME(table->signature, DSDT_SIG) || 70 if (ACPI_COMPARE_NAME(table->signature, DSDT_SIG) ||
71 ACPI_COMPARE_NAME(table->signature, PSDT_SIG) || 71 ACPI_COMPARE_NAME(table->signature, PSDT_SIG) ||
@@ -419,10 +419,15 @@ void acpi_ut_set_integer_width(u8 revision)
419{ 419{
420 420
421 if (revision <= 1) { 421 if (revision <= 1) {
422
423 /* 32-bit case */
424
422 acpi_gbl_integer_bit_width = 32; 425 acpi_gbl_integer_bit_width = 32;
423 acpi_gbl_integer_nybble_width = 8; 426 acpi_gbl_integer_nybble_width = 8;
424 acpi_gbl_integer_byte_width = 4; 427 acpi_gbl_integer_byte_width = 4;
425 } else { 428 } else {
429 /* 64-bit case (ACPI 2.0+) */
430
426 acpi_gbl_integer_bit_width = 64; 431 acpi_gbl_integer_bit_width = 64;
427 acpi_gbl_integer_nybble_width = 16; 432 acpi_gbl_integer_nybble_width = 16;
428 acpi_gbl_integer_byte_width = 8; 433 acpi_gbl_integer_byte_width = 8;
@@ -502,6 +507,7 @@ acpi_ut_display_init_pathname(u8 type,
502 * FUNCTION: acpi_ut_valid_acpi_char 507 * FUNCTION: acpi_ut_valid_acpi_char
503 * 508 *
504 * PARAMETERS: Char - The character to be examined 509 * PARAMETERS: Char - The character to be examined
510 * Position - Byte position (0-3)
505 * 511 *
506 * RETURN: TRUE if the character is valid, FALSE otherwise 512 * RETURN: TRUE if the character is valid, FALSE otherwise
507 * 513 *
@@ -609,7 +615,9 @@ acpi_name acpi_ut_repair_name(acpi_name name)
609 * 615 *
610 * RETURN: Status and Converted value 616 * RETURN: Status and Converted value
611 * 617 *
612 * DESCRIPTION: Convert a string into an unsigned value. 618 * DESCRIPTION: Convert a string into an unsigned value. Performs either a
619 * 32-bit or 64-bit conversion, depending on the current mode
620 * of the interpreter.
613 * NOTE: Does not support Octal strings, not needed. 621 * NOTE: Does not support Octal strings, not needed.
614 * 622 *
615 ******************************************************************************/ 623 ******************************************************************************/
@@ -627,7 +635,7 @@ acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer)
627 u8 sign_of0x = 0; 635 u8 sign_of0x = 0;
628 u8 term = 0; 636 u8 term = 0;
629 637
630 ACPI_FUNCTION_TRACE(ut_stroul64); 638 ACPI_FUNCTION_TRACE_STR(ut_stroul64, string);
631 639
632 switch (base) { 640 switch (base) {
633 case ACPI_ANY_BASE: 641 case ACPI_ANY_BASE:
@@ -675,11 +683,13 @@ acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer)
675 } 683 }
676 } 684 }
677 685
686 /*
687 * Perform a 32-bit or 64-bit conversion, depending upon the current
688 * execution mode of the interpreter
689 */
678 dividend = (mode32) ? ACPI_UINT32_MAX : ACPI_UINT64_MAX; 690 dividend = (mode32) ? ACPI_UINT32_MAX : ACPI_UINT64_MAX;
679 691
680 /* At least one character in the string here */ 692 /* Main loop: convert the string to a 32- or 64-bit integer */
681
682 /* Main loop: convert the string to a 64-bit integer */
683 693
684 while (*string) { 694 while (*string) {
685 if (ACPI_IS_DIGIT(*string)) { 695 if (ACPI_IS_DIGIT(*string)) {
@@ -754,6 +764,9 @@ acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer)
754 764
755 all_done: 765 all_done:
756 766
767 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Converted value: %8.8X%8.8X\n",
768 ACPI_FORMAT_UINT64(return_value)));
769
757 *ret_integer = return_value; 770 *ret_integer = return_value;
758 return_ACPI_STATUS(AE_OK); 771 return_ACPI_STATUS(AE_OK);
759 772
diff --git a/drivers/acpi/utilities/utmutex.c b/drivers/acpi/utilities/utmutex.c
index dfc8f30ca892..c39062a047cd 100644
--- a/drivers/acpi/utilities/utmutex.c
+++ b/drivers/acpi/utilities/utmutex.c
@@ -244,14 +244,14 @@ acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id)
244 244
245 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, 245 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX,
246 "Thread %X attempting to acquire Mutex [%s]\n", 246 "Thread %X attempting to acquire Mutex [%s]\n",
247 this_thread_id, acpi_ut_get_mutex_name(mutex_id))); 247 (u32) this_thread_id, acpi_ut_get_mutex_name(mutex_id)));
248 248
249 status = acpi_os_acquire_mutex(acpi_gbl_mutex_info[mutex_id].mutex, 249 status = acpi_os_acquire_mutex(acpi_gbl_mutex_info[mutex_id].mutex,
250 ACPI_WAIT_FOREVER); 250 ACPI_WAIT_FOREVER);
251 if (ACPI_SUCCESS(status)) { 251 if (ACPI_SUCCESS(status)) {
252 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, 252 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX,
253 "Thread %X acquired Mutex [%s]\n", 253 "Thread %X acquired Mutex [%s]\n",
254 this_thread_id, 254 (u32) this_thread_id,
255 acpi_ut_get_mutex_name(mutex_id))); 255 acpi_ut_get_mutex_name(mutex_id)));
256 256
257 acpi_gbl_mutex_info[mutex_id].use_count++; 257 acpi_gbl_mutex_info[mutex_id].use_count++;
@@ -259,7 +259,7 @@ acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id)
259 } else { 259 } else {
260 ACPI_EXCEPTION((AE_INFO, status, 260 ACPI_EXCEPTION((AE_INFO, status,
261 "Thread %X could not acquire Mutex [%X]", 261 "Thread %X could not acquire Mutex [%X]",
262 this_thread_id, mutex_id)); 262 (u32) this_thread_id, mutex_id));
263 } 263 }
264 264
265 return (status); 265 return (status);
@@ -285,7 +285,7 @@ acpi_status acpi_ut_release_mutex(acpi_mutex_handle mutex_id)
285 285
286 this_thread_id = acpi_os_get_thread_id(); 286 this_thread_id = acpi_os_get_thread_id();
287 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, 287 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX,
288 "Thread %X releasing Mutex [%s]\n", this_thread_id, 288 "Thread %X releasing Mutex [%s]\n", (u32) this_thread_id,
289 acpi_ut_get_mutex_name(mutex_id))); 289 acpi_ut_get_mutex_name(mutex_id)));
290 290
291 if (mutex_id > ACPI_MAX_MUTEX) { 291 if (mutex_id > ACPI_MAX_MUTEX) {
diff --git a/drivers/acpi/utilities/utstate.c b/drivers/acpi/utilities/utstate.c
index 0f5c5bb5deff..eaa13d05c859 100644
--- a/drivers/acpi/utilities/utstate.c
+++ b/drivers/acpi/utilities/utstate.c
@@ -199,6 +199,13 @@ struct acpi_thread_state *acpi_ut_create_thread_state(void)
199 state->common.descriptor_type = ACPI_DESC_TYPE_STATE_THREAD; 199 state->common.descriptor_type = ACPI_DESC_TYPE_STATE_THREAD;
200 state->thread.thread_id = acpi_os_get_thread_id(); 200 state->thread.thread_id = acpi_os_get_thread_id();
201 201
202 /* Check for invalid thread ID - zero is very bad, it will break things */
203
204 if (!state->thread.thread_id) {
205 ACPI_ERROR((AE_INFO, "Invalid zero ID from AcpiOsGetThreadId"));
206 state->thread.thread_id = (acpi_thread_id) 1;
207 }
208
202 return_PTR((struct acpi_thread_state *)state); 209 return_PTR((struct acpi_thread_state *)state);
203} 210}
204 211
diff --git a/drivers/atm/Kconfig b/drivers/atm/Kconfig
index 01a9f1cb7743..cfa5af883e13 100644
--- a/drivers/atm/Kconfig
+++ b/drivers/atm/Kconfig
@@ -398,7 +398,7 @@ config ATM_FORE200E_USE_TASKLET
398 default n 398 default n
399 help 399 help
400 This defers work to be done by the interrupt handler to a 400 This defers work to be done by the interrupt handler to a
401 tasklet instead of hanlding everything at interrupt time. This 401 tasklet instead of handling everything at interrupt time. This
402 may improve the responsive of the host. 402 may improve the responsive of the host.
403 403
404config ATM_FORE200E_TX_RETRY 404config ATM_FORE200E_TX_RETRY
diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig
index 80502dc6ed66..0b4e22436935 100644
--- a/drivers/base/Kconfig
+++ b/drivers/base/Kconfig
@@ -20,7 +20,7 @@ config PREVENT_FIRMWARE_BUILD
20 20
21config FW_LOADER 21config FW_LOADER
22 tristate "Userspace firmware loading support" 22 tristate "Userspace firmware loading support"
23 select HOTPLUG 23 depends on HOTPLUG
24 ---help--- 24 ---help---
25 This option is provided for the case where no in-kernel-tree modules 25 This option is provided for the case where no in-kernel-tree modules
26 require userspace firmware loading support, but a module built outside 26 require userspace firmware loading support, but a module built outside
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index 83fa8b291a59..2e954d07175a 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -129,7 +129,7 @@ static struct kobj_type ktype_bus = {
129 129
130}; 130};
131 131
132decl_subsys(bus, &ktype_bus, NULL); 132static decl_subsys(bus, &ktype_bus, NULL);
133 133
134 134
135#ifdef CONFIG_HOTPLUG 135#ifdef CONFIG_HOTPLUG
@@ -598,12 +598,13 @@ void put_bus(struct bus_type * bus)
598 * 598 *
599 * Note that kset_find_obj increments bus' reference count. 599 * Note that kset_find_obj increments bus' reference count.
600 */ 600 */
601 601#if 0
602struct bus_type * find_bus(char * name) 602struct bus_type * find_bus(char * name)
603{ 603{
604 struct kobject * k = kset_find_obj(&bus_subsys.kset, name); 604 struct kobject * k = kset_find_obj(&bus_subsys.kset, name);
605 return k ? to_bus(k) : NULL; 605 return k ? to_bus(k) : NULL;
606} 606}
607#endif /* 0 */
607 608
608 609
609/** 610/**
diff --git a/drivers/base/core.c b/drivers/base/core.c
index b21f864c9ce8..be6b5bc0677d 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -559,20 +559,20 @@ static void device_create_release(struct device *dev)
559 559
560/** 560/**
561 * device_create - creates a device and registers it with sysfs 561 * device_create - creates a device and registers it with sysfs
562 * @cs: pointer to the struct class that this device should be registered to. 562 * @class: pointer to the struct class that this device should be registered to
563 * @parent: pointer to the parent struct device of this new device, if any. 563 * @parent: pointer to the parent struct device of this new device, if any
564 * @dev: the dev_t for the char device to be added. 564 * @devt: the dev_t for the char device to be added
565 * @fmt: string for the class device's name 565 * @fmt: string for the device's name
566 *
567 * This function can be used by char device classes. A struct device
568 * will be created in sysfs, registered to the specified class.
566 * 569 *
567 * This function can be used by char device classes. A struct
568 * device will be created in sysfs, registered to the specified
569 * class.
570 * A "dev" file will be created, showing the dev_t for the device, if 570 * A "dev" file will be created, showing the dev_t for the device, if
571 * the dev_t is not 0,0. 571 * the dev_t is not 0,0.
572 * If a pointer to a parent struct device is passed in, the newly 572 * If a pointer to a parent struct device is passed in, the newly created
573 * created struct device will be a child of that device in sysfs. The 573 * struct device will be a child of that device in sysfs.
574 * pointer to the struct device will be returned from the call. Any 574 * The pointer to the struct device will be returned from the call.
575 * further sysfs files that might be required can be created using this 575 * Any further sysfs files that might be required can be created using this
576 * pointer. 576 * pointer.
577 * 577 *
578 * Note: the struct class passed to this function must have previously 578 * Note: the struct class passed to this function must have previously
@@ -620,11 +620,11 @@ EXPORT_SYMBOL_GPL(device_create);
620 620
621/** 621/**
622 * device_destroy - removes a device that was created with device_create() 622 * device_destroy - removes a device that was created with device_create()
623 * @class: the pointer to the struct class that this device was registered * with. 623 * @class: pointer to the struct class that this device was registered with
624 * @dev: the dev_t of the device that was previously registered. 624 * @devt: the dev_t of the device that was previously registered
625 * 625 *
626 * This call unregisters and cleans up a class device that was created with a 626 * This call unregisters and cleans up a device that was created with a
627 * call to class_device_create() 627 * call to device_create().
628 */ 628 */
629void device_destroy(struct class *class, dev_t devt) 629void device_destroy(struct class *class, dev_t devt)
630{ 630{
diff --git a/drivers/base/topology.c b/drivers/base/topology.c
index c2d621632383..3ef9d514b916 100644
--- a/drivers/base/topology.c
+++ b/drivers/base/topology.c
@@ -139,7 +139,7 @@ static int __cpuinit topology_sysfs_init(void)
139 (void *)(long)i); 139 (void *)(long)i);
140 } 140 }
141 141
142 register_cpu_notifier(&topology_cpu_notifier); 142 register_hotcpu_notifier(&topology_cpu_notifier);
143 143
144 return 0; 144 return 0;
145} 145}
diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig
index 93d94749310b..b5382cedf0c0 100644
--- a/drivers/block/Kconfig
+++ b/drivers/block/Kconfig
@@ -400,6 +400,16 @@ config BLK_DEV_RAM_SIZE
400 what are you doing. If you are using IBM S/390, then set this to 400 what are you doing. If you are using IBM S/390, then set this to
401 8192. 401 8192.
402 402
403config BLK_DEV_RAM_BLOCKSIZE
404 int "Default RAM disk block size (bytes)"
405 depends on BLK_DEV_RAM
406 default "1024"
407 help
408 The default value is 1024 kilobytes. PAGE_SIZE is a much more
409 efficient choice however. The default is kept to ensure initrd
410 setups function - apparently needed by the rd_load_image routine
411 that supposes the filesystem in the image uses a 1024 blocksize.
412
403config BLK_DEV_INITRD 413config BLK_DEV_INITRD
404 bool "Initial RAM filesystem and RAM disk (initramfs/initrd) support" 414 bool "Initial RAM filesystem and RAM disk (initramfs/initrd) support"
405 depends on BROKEN || !FRV 415 depends on BROKEN || !FRV
diff --git a/drivers/block/aoe/aoechr.c b/drivers/block/aoe/aoechr.c
index 5327f553b4f5..1bc1cf9603f1 100644
--- a/drivers/block/aoe/aoechr.c
+++ b/drivers/block/aoe/aoechr.c
@@ -162,7 +162,7 @@ aoechr_open(struct inode *inode, struct file *filp)
162{ 162{
163 int n, i; 163 int n, i;
164 164
165 n = MINOR(inode->i_rdev); 165 n = iminor(inode);
166 filp->private_data = (void *) (unsigned long) n; 166 filp->private_data = (void *) (unsigned long) n;
167 167
168 for (i = 0; i < ARRAY_SIZE(chardevs); ++i) 168 for (i = 0; i < ARRAY_SIZE(chardevs); ++i)
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 1c4df22dfd2a..7b0eca703a67 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1233,6 +1233,50 @@ static inline void complete_buffers(struct bio *bio, int status)
1233 } 1233 }
1234} 1234}
1235 1235
1236static void cciss_check_queues(ctlr_info_t *h)
1237{
1238 int start_queue = h->next_to_run;
1239 int i;
1240
1241 /* check to see if we have maxed out the number of commands that can
1242 * be placed on the queue. If so then exit. We do this check here
1243 * in case the interrupt we serviced was from an ioctl and did not
1244 * free any new commands.
1245 */
1246 if ((find_first_zero_bit(h->cmd_pool_bits, NR_CMDS)) == NR_CMDS)
1247 return;
1248
1249 /* We have room on the queue for more commands. Now we need to queue
1250 * them up. We will also keep track of the next queue to run so
1251 * that every queue gets a chance to be started first.
1252 */
1253 for (i = 0; i < h->highest_lun + 1; i++) {
1254 int curr_queue = (start_queue + i) % (h->highest_lun + 1);
1255 /* make sure the disk has been added and the drive is real
1256 * because this can be called from the middle of init_one.
1257 */
1258 if (!(h->drv[curr_queue].queue) || !(h->drv[curr_queue].heads))
1259 continue;
1260 blk_start_queue(h->gendisk[curr_queue]->queue);
1261
1262 /* check to see if we have maxed out the number of commands
1263 * that can be placed on the queue.
1264 */
1265 if ((find_first_zero_bit(h->cmd_pool_bits, NR_CMDS)) == NR_CMDS) {
1266 if (curr_queue == start_queue) {
1267 h->next_to_run =
1268 (start_queue + 1) % (h->highest_lun + 1);
1269 break;
1270 } else {
1271 h->next_to_run = curr_queue;
1272 break;
1273 }
1274 } else {
1275 curr_queue = (curr_queue + 1) % (h->highest_lun + 1);
1276 }
1277 }
1278}
1279
1236static void cciss_softirq_done(struct request *rq) 1280static void cciss_softirq_done(struct request *rq)
1237{ 1281{
1238 CommandList_struct *cmd = rq->completion_data; 1282 CommandList_struct *cmd = rq->completion_data;
@@ -1264,6 +1308,7 @@ static void cciss_softirq_done(struct request *rq)
1264 spin_lock_irqsave(&h->lock, flags); 1308 spin_lock_irqsave(&h->lock, flags);
1265 end_that_request_last(rq, rq->errors); 1309 end_that_request_last(rq, rq->errors);
1266 cmd_free(h, cmd, 1); 1310 cmd_free(h, cmd, 1);
1311 cciss_check_queues(h);
1267 spin_unlock_irqrestore(&h->lock, flags); 1312 spin_unlock_irqrestore(&h->lock, flags);
1268} 1313}
1269 1314
@@ -2528,8 +2573,6 @@ static irqreturn_t do_cciss_intr(int irq, void *dev_id, struct pt_regs *regs)
2528 CommandList_struct *c; 2573 CommandList_struct *c;
2529 unsigned long flags; 2574 unsigned long flags;
2530 __u32 a, a1, a2; 2575 __u32 a, a1, a2;
2531 int j;
2532 int start_queue = h->next_to_run;
2533 2576
2534 if (interrupt_not_for_us(h)) 2577 if (interrupt_not_for_us(h))
2535 return IRQ_NONE; 2578 return IRQ_NONE;
@@ -2588,45 +2631,6 @@ static irqreturn_t do_cciss_intr(int irq, void *dev_id, struct pt_regs *regs)
2588 } 2631 }
2589 } 2632 }
2590 2633
2591 /* check to see if we have maxed out the number of commands that can
2592 * be placed on the queue. If so then exit. We do this check here
2593 * in case the interrupt we serviced was from an ioctl and did not
2594 * free any new commands.
2595 */
2596 if ((find_first_zero_bit(h->cmd_pool_bits, NR_CMDS)) == NR_CMDS)
2597 goto cleanup;
2598
2599 /* We have room on the queue for more commands. Now we need to queue
2600 * them up. We will also keep track of the next queue to run so
2601 * that every queue gets a chance to be started first.
2602 */
2603 for (j = 0; j < h->highest_lun + 1; j++) {
2604 int curr_queue = (start_queue + j) % (h->highest_lun + 1);
2605 /* make sure the disk has been added and the drive is real
2606 * because this can be called from the middle of init_one.
2607 */
2608 if (!(h->drv[curr_queue].queue) || !(h->drv[curr_queue].heads))
2609 continue;
2610 blk_start_queue(h->gendisk[curr_queue]->queue);
2611
2612 /* check to see if we have maxed out the number of commands
2613 * that can be placed on the queue.
2614 */
2615 if ((find_first_zero_bit(h->cmd_pool_bits, NR_CMDS)) == NR_CMDS) {
2616 if (curr_queue == start_queue) {
2617 h->next_to_run =
2618 (start_queue + 1) % (h->highest_lun + 1);
2619 goto cleanup;
2620 } else {
2621 h->next_to_run = curr_queue;
2622 goto cleanup;
2623 }
2624 } else {
2625 curr_queue = (curr_queue + 1) % (h->highest_lun + 1);
2626 }
2627 }
2628
2629 cleanup:
2630 spin_unlock_irqrestore(CCISS_LOCK(h->ctlr), flags); 2634 spin_unlock_irqrestore(CCISS_LOCK(h->ctlr), flags);
2631 return IRQ_HANDLED; 2635 return IRQ_HANDLED;
2632} 2636}
diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c
index 757f42dd8e86..78082edc14b4 100644
--- a/drivers/block/cpqarray.c
+++ b/drivers/block/cpqarray.c
@@ -1739,8 +1739,6 @@ static void getgeometry(int ctlr)
1739 (log_index < id_ctlr_buf->nr_drvs) 1739 (log_index < id_ctlr_buf->nr_drvs)
1740 && (log_unit < NWD); 1740 && (log_unit < NWD);
1741 log_unit++) { 1741 log_unit++) {
1742 struct gendisk *disk = ida_gendisk[ctlr][log_unit];
1743
1744 size = sizeof(sense_log_drv_stat_t); 1742 size = sizeof(sense_log_drv_stat_t);
1745 1743
1746 /* 1744 /*
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 0a1b1ea36ddc..bdbade9a5cf5 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -300,6 +300,15 @@ static struct request *nbd_read_stat(struct nbd_device *lo)
300 lo->disk->disk_name, result); 300 lo->disk->disk_name, result);
301 goto harderror; 301 goto harderror;
302 } 302 }
303
304 if (ntohl(reply.magic) != NBD_REPLY_MAGIC) {
305 printk(KERN_ERR "%s: Wrong magic (0x%lx)\n",
306 lo->disk->disk_name,
307 (unsigned long)ntohl(reply.magic));
308 result = -EPROTO;
309 goto harderror;
310 }
311
303 req = nbd_find_request(lo, reply.handle); 312 req = nbd_find_request(lo, reply.handle);
304 if (unlikely(IS_ERR(req))) { 313 if (unlikely(IS_ERR(req))) {
305 result = PTR_ERR(req); 314 result = PTR_ERR(req);
@@ -312,13 +321,6 @@ static struct request *nbd_read_stat(struct nbd_device *lo)
312 goto harderror; 321 goto harderror;
313 } 322 }
314 323
315 if (ntohl(reply.magic) != NBD_REPLY_MAGIC) {
316 printk(KERN_ERR "%s: Wrong magic (0x%lx)\n",
317 lo->disk->disk_name,
318 (unsigned long)ntohl(reply.magic));
319 result = -EPROTO;
320 goto harderror;
321 }
322 if (ntohl(reply.error)) { 324 if (ntohl(reply.error)) {
323 printk(KERN_ERR "%s: Other side returned error (%d)\n", 325 printk(KERN_ERR "%s: Other side returned error (%d)\n",
324 lo->disk->disk_name, ntohl(reply.error)); 326 lo->disk->disk_name, ntohl(reply.error));
@@ -339,7 +341,8 @@ static struct request *nbd_read_stat(struct nbd_device *lo)
339 printk(KERN_ERR "%s: Receive data failed (result %d)\n", 341 printk(KERN_ERR "%s: Receive data failed (result %d)\n",
340 lo->disk->disk_name, 342 lo->disk->disk_name,
341 result); 343 result);
342 goto harderror; 344 req->errors++;
345 return req;
343 } 346 }
344 dprintk(DBG_RX, "%s: request %p: got %d bytes data\n", 347 dprintk(DBG_RX, "%s: request %p: got %d bytes data\n",
345 lo->disk->disk_name, req, bvec->bv_len); 348 lo->disk->disk_name, req, bvec->bv_len);
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index bde2c64b6346..451b996bba91 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -2577,19 +2577,19 @@ static int pkt_ctl_ioctl(struct inode *inode, struct file *file, unsigned int cm
2577 case PKT_CTRL_CMD_SETUP: 2577 case PKT_CTRL_CMD_SETUP:
2578 if (!capable(CAP_SYS_ADMIN)) 2578 if (!capable(CAP_SYS_ADMIN))
2579 return -EPERM; 2579 return -EPERM;
2580 mutex_lock(&ctl_mutex); 2580 mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING);
2581 ret = pkt_setup_dev(&ctrl_cmd); 2581 ret = pkt_setup_dev(&ctrl_cmd);
2582 mutex_unlock(&ctl_mutex); 2582 mutex_unlock(&ctl_mutex);
2583 break; 2583 break;
2584 case PKT_CTRL_CMD_TEARDOWN: 2584 case PKT_CTRL_CMD_TEARDOWN:
2585 if (!capable(CAP_SYS_ADMIN)) 2585 if (!capable(CAP_SYS_ADMIN))
2586 return -EPERM; 2586 return -EPERM;
2587 mutex_lock(&ctl_mutex); 2587 mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING);
2588 ret = pkt_remove_dev(&ctrl_cmd); 2588 ret = pkt_remove_dev(&ctrl_cmd);
2589 mutex_unlock(&ctl_mutex); 2589 mutex_unlock(&ctl_mutex);
2590 break; 2590 break;
2591 case PKT_CTRL_CMD_STATUS: 2591 case PKT_CTRL_CMD_STATUS:
2592 mutex_lock(&ctl_mutex); 2592 mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING);
2593 pkt_get_status(&ctrl_cmd); 2593 pkt_get_status(&ctrl_cmd);
2594 mutex_unlock(&ctl_mutex); 2594 mutex_unlock(&ctl_mutex);
2595 break; 2595 break;
diff --git a/drivers/block/rd.c b/drivers/block/rd.c
index 3cf246abb5ec..a3f64bfe6b58 100644
--- a/drivers/block/rd.c
+++ b/drivers/block/rd.c
@@ -84,7 +84,7 @@ int rd_size = CONFIG_BLK_DEV_RAM_SIZE; /* Size of the RAM disks */
84 * behaviour. The default is still BLOCK_SIZE (needed by rd_load_image that 84 * behaviour. The default is still BLOCK_SIZE (needed by rd_load_image that
85 * supposes the filesystem in the image uses a BLOCK_SIZE blocksize). 85 * supposes the filesystem in the image uses a BLOCK_SIZE blocksize).
86 */ 86 */
87static int rd_blocksize = BLOCK_SIZE; /* blocksize of the RAM disks */ 87static int rd_blocksize = CONFIG_BLK_DEV_RAM_BLOCKSIZE;
88 88
89/* 89/*
90 * Copyright (C) 2000 Linus Torvalds. 90 * Copyright (C) 2000 Linus Torvalds.
diff --git a/drivers/bluetooth/bcm203x.c b/drivers/bluetooth/bcm203x.c
index 6f67141f4de0..13ba729cdd57 100644
--- a/drivers/bluetooth/bcm203x.c
+++ b/drivers/bluetooth/bcm203x.c
@@ -234,6 +234,7 @@ static int bcm203x_probe(struct usb_interface *intf, const struct usb_device_id
234 data->fw_data = kmalloc(firmware->size, GFP_KERNEL); 234 data->fw_data = kmalloc(firmware->size, GFP_KERNEL);
235 if (!data->fw_data) { 235 if (!data->fw_data) {
236 BT_ERR("Can't allocate memory for firmware image"); 236 BT_ERR("Can't allocate memory for firmware image");
237 release_firmware(firmware);
237 usb_free_urb(data->urb); 238 usb_free_urb(data->urb);
238 kfree(data->buffer); 239 kfree(data->buffer);
239 kfree(data); 240 kfree(data);
diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
index 1994270c16e1..93ba25b7ea32 100644
--- a/drivers/bluetooth/hci_ldisc.c
+++ b/drivers/bluetooth/hci_ldisc.c
@@ -191,7 +191,7 @@ static int hci_uart_flush(struct hci_dev *hdev)
191 191
192 /* Flush any pending characters in the driver and discipline. */ 192 /* Flush any pending characters in the driver and discipline. */
193 tty_ldisc_flush(tty); 193 tty_ldisc_flush(tty);
194 if (tty->driver->flush_buffer) 194 if (tty->driver && tty->driver->flush_buffer)
195 tty->driver->flush_buffer(tty); 195 tty->driver->flush_buffer(tty);
196 196
197 if (test_bit(HCI_UART_PROTO_SET, &hu->flags)) 197 if (test_bit(HCI_UART_PROTO_SET, &hu->flags))
@@ -290,7 +290,7 @@ static int hci_uart_tty_open(struct tty_struct *tty)
290 if (tty->ldisc.flush_buffer) 290 if (tty->ldisc.flush_buffer)
291 tty->ldisc.flush_buffer(tty); 291 tty->ldisc.flush_buffer(tty);
292 292
293 if (tty->driver->flush_buffer) 293 if (tty->driver && tty->driver->flush_buffer)
294 tty->driver->flush_buffer(tty); 294 tty->driver->flush_buffer(tty);
295 295
296 return 0; 296 return 0;
diff --git a/drivers/bluetooth/hci_usb.c b/drivers/bluetooth/hci_usb.c
index 6a0c2230f82f..e2d4beac7420 100644
--- a/drivers/bluetooth/hci_usb.c
+++ b/drivers/bluetooth/hci_usb.c
@@ -67,6 +67,8 @@ static int ignore = 0;
67static int ignore_dga = 0; 67static int ignore_dga = 0;
68static int ignore_csr = 0; 68static int ignore_csr = 0;
69static int ignore_sniffer = 0; 69static int ignore_sniffer = 0;
70static int disable_scofix = 0;
71static int force_scofix = 0;
70static int reset = 0; 72static int reset = 0;
71 73
72#ifdef CONFIG_BT_HCIUSB_SCO 74#ifdef CONFIG_BT_HCIUSB_SCO
@@ -107,9 +109,12 @@ static struct usb_device_id blacklist_ids[] = {
107 { USB_DEVICE(0x0a5c, 0x2033), .driver_info = HCI_IGNORE }, 109 { USB_DEVICE(0x0a5c, 0x2033), .driver_info = HCI_IGNORE },
108 110
109 /* Broadcom BCM2035 */ 111 /* Broadcom BCM2035 */
110 { USB_DEVICE(0x0a5c, 0x200a), .driver_info = HCI_RESET | HCI_BROKEN_ISOC }, 112 { USB_DEVICE(0x0a5c, 0x200a), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
111 { USB_DEVICE(0x0a5c, 0x2009), .driver_info = HCI_BCM92035 }, 113 { USB_DEVICE(0x0a5c, 0x2009), .driver_info = HCI_BCM92035 },
112 114
115 /* IBM/Lenovo ThinkPad with Broadcom chip */
116 { USB_DEVICE(0x0a5c, 0x201e), .driver_info = HCI_WRONG_SCO_MTU },
117
113 /* Microsoft Wireless Transceiver for Bluetooth 2.0 */ 118 /* Microsoft Wireless Transceiver for Bluetooth 2.0 */
114 { USB_DEVICE(0x045e, 0x009c), .driver_info = HCI_RESET }, 119 { USB_DEVICE(0x045e, 0x009c), .driver_info = HCI_RESET },
115 120
@@ -119,11 +124,13 @@ static struct usb_device_id blacklist_ids[] = {
119 /* ISSC Bluetooth Adapter v3.1 */ 124 /* ISSC Bluetooth Adapter v3.1 */
120 { USB_DEVICE(0x1131, 0x1001), .driver_info = HCI_RESET }, 125 { USB_DEVICE(0x1131, 0x1001), .driver_info = HCI_RESET },
121 126
122 /* RTX Telecom based adapter with buggy SCO support */ 127 /* RTX Telecom based adapters with buggy SCO support */
123 { USB_DEVICE(0x0400, 0x0807), .driver_info = HCI_BROKEN_ISOC }, 128 { USB_DEVICE(0x0400, 0x0807), .driver_info = HCI_BROKEN_ISOC },
129 { USB_DEVICE(0x0400, 0x080a), .driver_info = HCI_BROKEN_ISOC },
124 130
125 /* Belkin F8T012 */ 131 /* Belkin F8T012 and F8T013 devices */
126 { USB_DEVICE(0x050d, 0x0012), .driver_info = HCI_WRONG_SCO_MTU }, 132 { USB_DEVICE(0x050d, 0x0012), .driver_info = HCI_WRONG_SCO_MTU },
133 { USB_DEVICE(0x050d, 0x0013), .driver_info = HCI_WRONG_SCO_MTU },
127 134
128 /* Digianswer devices */ 135 /* Digianswer devices */
129 { USB_DEVICE(0x08fd, 0x0001), .driver_info = HCI_DIGIANSWER }, 136 { USB_DEVICE(0x08fd, 0x0001), .driver_info = HCI_DIGIANSWER },
@@ -990,8 +997,10 @@ static int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id
990 if (reset || id->driver_info & HCI_RESET) 997 if (reset || id->driver_info & HCI_RESET)
991 set_bit(HCI_QUIRK_RESET_ON_INIT, &hdev->quirks); 998 set_bit(HCI_QUIRK_RESET_ON_INIT, &hdev->quirks);
992 999
993 if (id->driver_info & HCI_WRONG_SCO_MTU) 1000 if (force_scofix || id->driver_info & HCI_WRONG_SCO_MTU) {
994 set_bit(HCI_QUIRK_FIXUP_BUFFER_SIZE, &hdev->quirks); 1001 if (!disable_scofix)
1002 set_bit(HCI_QUIRK_FIXUP_BUFFER_SIZE, &hdev->quirks);
1003 }
995 1004
996 if (id->driver_info & HCI_SNIFFER) { 1005 if (id->driver_info & HCI_SNIFFER) {
997 if (le16_to_cpu(udev->descriptor.bcdDevice) > 0x997) 1006 if (le16_to_cpu(udev->descriptor.bcdDevice) > 0x997)
@@ -1161,6 +1170,12 @@ MODULE_PARM_DESC(ignore_csr, "Ignore devices with id 0a12:0001");
1161module_param(ignore_sniffer, bool, 0644); 1170module_param(ignore_sniffer, bool, 0644);
1162MODULE_PARM_DESC(ignore_sniffer, "Ignore devices with id 0a12:0002"); 1171MODULE_PARM_DESC(ignore_sniffer, "Ignore devices with id 0a12:0002");
1163 1172
1173module_param(disable_scofix, bool, 0644);
1174MODULE_PARM_DESC(disable_scofix, "Disable fixup of wrong SCO buffer size");
1175
1176module_param(force_scofix, bool, 0644);
1177MODULE_PARM_DESC(force_scofix, "Force fixup of wrong SCO buffers size");
1178
1164module_param(reset, bool, 0644); 1179module_param(reset, bool, 0644);
1165MODULE_PARM_DESC(reset, "Send HCI reset command on initialization"); 1180MODULE_PARM_DESC(reset, "Send HCI reset command on initialization");
1166 1181
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index ca27ee89240b..d239cf8b20bd 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -1837,7 +1837,7 @@ static int dvd_read_bca(struct cdrom_device_info *cdi, dvd_struct *s)
1837 init_cdrom_command(&cgc, buf, sizeof(buf), CGC_DATA_READ); 1837 init_cdrom_command(&cgc, buf, sizeof(buf), CGC_DATA_READ);
1838 cgc.cmd[0] = GPCMD_READ_DVD_STRUCTURE; 1838 cgc.cmd[0] = GPCMD_READ_DVD_STRUCTURE;
1839 cgc.cmd[7] = s->type; 1839 cgc.cmd[7] = s->type;
1840 cgc.cmd[9] = cgc.buflen = 0xff; 1840 cgc.cmd[9] = cgc.buflen & 0xff;
1841 1841
1842 if ((ret = cdo->generic_packet(cdi, &cgc))) 1842 if ((ret = cdo->generic_packet(cdi, &cgc)))
1843 return ret; 1843 return ret;
diff --git a/drivers/char/hvsi.c b/drivers/char/hvsi.c
index 56612a2dca6b..41db8060e8f7 100644
--- a/drivers/char/hvsi.c
+++ b/drivers/char/hvsi.c
@@ -1299,7 +1299,7 @@ static int __init hvsi_console_init(void)
1299 hp->inbuf_end = hp->inbuf; 1299 hp->inbuf_end = hp->inbuf;
1300 hp->state = HVSI_CLOSED; 1300 hp->state = HVSI_CLOSED;
1301 hp->vtermno = *vtermno; 1301 hp->vtermno = *vtermno;
1302 hp->virq = irq_create_mapping(NULL, irq[0], 0); 1302 hp->virq = irq_create_mapping(NULL, irq[0]);
1303 if (hp->virq == NO_IRQ) { 1303 if (hp->virq == NO_IRQ) {
1304 printk(KERN_ERR "%s: couldn't create irq mapping for 0x%x\n", 1304 printk(KERN_ERR "%s: couldn't create irq mapping for 0x%x\n",
1305 __FUNCTION__, irq[0]); 1305 __FUNCTION__, irq[0]);
diff --git a/drivers/char/hw_random/geode-rng.c b/drivers/char/hw_random/geode-rng.c
index be61f22ee7bb..d37ced0d132b 100644
--- a/drivers/char/hw_random/geode-rng.c
+++ b/drivers/char/hw_random/geode-rng.c
@@ -107,10 +107,14 @@ found:
107 if (err) { 107 if (err) {
108 printk(KERN_ERR PFX "RNG registering failed (%d)\n", 108 printk(KERN_ERR PFX "RNG registering failed (%d)\n",
109 err); 109 err);
110 goto out; 110 goto err_unmap;
111 } 111 }
112out: 112out:
113 return err; 113 return err;
114
115err_unmap:
116 iounmap(mem);
117 goto out;
114} 118}
115 119
116static void __exit mod_exit(void) 120static void __exit mod_exit(void)
diff --git a/drivers/char/hw_random/intel-rng.c b/drivers/char/hw_random/intel-rng.c
index 6594bd5645f4..ccd7e7102234 100644
--- a/drivers/char/hw_random/intel-rng.c
+++ b/drivers/char/hw_random/intel-rng.c
@@ -164,7 +164,7 @@ static int __init mod_init(void)
164 if (err) { 164 if (err) {
165 printk(KERN_ERR PFX "RNG registering failed (%d)\n", 165 printk(KERN_ERR PFX "RNG registering failed (%d)\n",
166 err); 166 err);
167 goto out; 167 goto err_unmap;
168 } 168 }
169out: 169out:
170 return err; 170 return err;
diff --git a/drivers/char/ip2/ip2main.c b/drivers/char/ip2/ip2main.c
index 518ece7ac656..7907ae88c2f4 100644
--- a/drivers/char/ip2/ip2main.c
+++ b/drivers/char/ip2/ip2main.c
@@ -3186,3 +3186,10 @@ ip2trace (unsigned short pn, unsigned char cat, unsigned char label, unsigned lo
3186 3186
3187 3187
3188MODULE_LICENSE("GPL"); 3188MODULE_LICENSE("GPL");
3189
3190static struct pci_device_id ip2main_pci_tbl[] __devinitdata = {
3191 { PCI_DEVICE(PCI_VENDOR_ID_COMPUTONE, PCI_DEVICE_ID_COMPUTONE_IP2EX) },
3192 { }
3193};
3194
3195MODULE_DEVICE_TABLE(pci, ip2main_pci_tbl);
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index e97c32ceb796..917b20402664 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -95,7 +95,7 @@ static inline int valid_phys_addr_range(unsigned long addr, size_t count)
95 return 1; 95 return 1;
96} 96}
97 97
98static inline int valid_mmap_phys_addr_range(unsigned long addr, size_t size) 98static inline int valid_mmap_phys_addr_range(unsigned long pfn, size_t size)
99{ 99{
100 return 1; 100 return 1;
101} 101}
@@ -242,7 +242,7 @@ static int mmap_mem(struct file * file, struct vm_area_struct * vma)
242{ 242{
243 size_t size = vma->vm_end - vma->vm_start; 243 size_t size = vma->vm_end - vma->vm_start;
244 244
245 if (!valid_mmap_phys_addr_range(vma->vm_pgoff << PAGE_SHIFT, size)) 245 if (!valid_mmap_phys_addr_range(vma->vm_pgoff, size))
246 return -EINVAL; 246 return -EINVAL;
247 247
248 vma->vm_page_prot = phys_mem_access_prot(file, vma->vm_pgoff, 248 vma->vm_page_prot = phys_mem_access_prot(file, vma->vm_pgoff,
diff --git a/drivers/char/nsc_gpio.c b/drivers/char/nsc_gpio.c
index 5b91e4e25641..7719bd75810b 100644
--- a/drivers/char/nsc_gpio.c
+++ b/drivers/char/nsc_gpio.c
@@ -68,13 +68,11 @@ ssize_t nsc_gpio_write(struct file *file, const char __user *data,
68 amp->gpio_config(m, ~1, 0); 68 amp->gpio_config(m, ~1, 0);
69 break; 69 break;
70 case 'T': 70 case 'T':
71 dev_dbg(dev, "GPIO%d output is push pull\n", 71 dev_dbg(dev, "GPIO%d output is push pull\n", m);
72 m);
73 amp->gpio_config(m, ~2, 2); 72 amp->gpio_config(m, ~2, 2);
74 break; 73 break;
75 case 't': 74 case 't':
76 dev_dbg(dev, "GPIO%d output is open drain\n", 75 dev_dbg(dev, "GPIO%d output is open drain\n", m);
77 m);
78 amp->gpio_config(m, ~2, 0); 76 amp->gpio_config(m, ~2, 0);
79 break; 77 break;
80 case 'P': 78 case 'P':
diff --git a/drivers/char/pc8736x_gpio.c b/drivers/char/pc8736x_gpio.c
index 4005ee0aa11e..84e5a68635f1 100644
--- a/drivers/char/pc8736x_gpio.c
+++ b/drivers/char/pc8736x_gpio.c
@@ -3,18 +3,18 @@
3 National Semiconductor PC8736x GPIO driver. Allows a user space 3 National Semiconductor PC8736x GPIO driver. Allows a user space
4 process to play with the GPIO pins. 4 process to play with the GPIO pins.
5 5
6 Copyright (c) 2005 Jim Cromie <jim.cromie@gmail.com> 6 Copyright (c) 2005,2006 Jim Cromie <jim.cromie@gmail.com>
7 7
8 adapted from linux/drivers/char/scx200_gpio.c 8 adapted from linux/drivers/char/scx200_gpio.c
9 Copyright (c) 2001,2002 Christer Weinigel <wingel@nano-system.com>, 9 Copyright (c) 2001,2002 Christer Weinigel <wingel@nano-system.com>,
10*/ 10*/
11 11
12#include <linux/config.h>
13#include <linux/fs.h> 12#include <linux/fs.h>
14#include <linux/module.h> 13#include <linux/module.h>
15#include <linux/errno.h> 14#include <linux/errno.h>
16#include <linux/kernel.h> 15#include <linux/kernel.h>
17#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/cdev.h>
18#include <linux/io.h> 18#include <linux/io.h>
19#include <linux/ioport.h> 19#include <linux/ioport.h>
20#include <linux/mutex.h> 20#include <linux/mutex.h>
@@ -25,7 +25,7 @@
25#define DEVNAME "pc8736x_gpio" 25#define DEVNAME "pc8736x_gpio"
26 26
27MODULE_AUTHOR("Jim Cromie <jim.cromie@gmail.com>"); 27MODULE_AUTHOR("Jim Cromie <jim.cromie@gmail.com>");
28MODULE_DESCRIPTION("NatSemi PC-8736x GPIO Pin Driver"); 28MODULE_DESCRIPTION("NatSemi/Winbond PC-8736x GPIO Pin Driver");
29MODULE_LICENSE("GPL"); 29MODULE_LICENSE("GPL");
30 30
31static int major; /* default to dynamic major */ 31static int major; /* default to dynamic major */
@@ -38,14 +38,14 @@ static u8 pc8736x_gpio_shadow[4];
38 38
39#define SIO_BASE1 0x2E /* 1st command-reg to check */ 39#define SIO_BASE1 0x2E /* 1st command-reg to check */
40#define SIO_BASE2 0x4E /* alt command-reg to check */ 40#define SIO_BASE2 0x4E /* alt command-reg to check */
41#define SIO_BASE_OFFSET 0x20
42 41
43#define SIO_SID 0x20 /* SuperI/O ID Register */ 42#define SIO_SID 0x20 /* SuperI/O ID Register */
44#define SIO_SID_VALUE 0xe9 /* Expected value in SuperI/O ID Register */ 43#define SIO_SID_VALUE 0xe9 /* Expected value in SuperI/O ID Register */
45 44
46#define SIO_CF1 0x21 /* chip config, bit0 is chip enable */ 45#define SIO_CF1 0x21 /* chip config, bit0 is chip enable */
47 46
48#define PC8736X_GPIO_SIZE 16 47#define PC8736X_GPIO_RANGE 16 /* ioaddr range */
48#define PC8736X_GPIO_CT 32 /* minors matching 4 8 bit ports */
49 49
50#define SIO_UNIT_SEL 0x7 /* unit select reg */ 50#define SIO_UNIT_SEL 0x7 /* unit select reg */
51#define SIO_UNIT_ACT 0x30 /* unit enable */ 51#define SIO_UNIT_ACT 0x30 /* unit enable */
@@ -212,14 +212,12 @@ static void pc8736x_gpio_change(unsigned index)
212 pc8736x_gpio_set(index, !pc8736x_gpio_current(index)); 212 pc8736x_gpio_set(index, !pc8736x_gpio_current(index));
213} 213}
214 214
215static struct nsc_gpio_ops pc8736x_access = { 215static struct nsc_gpio_ops pc8736x_gpio_ops = {
216 .owner = THIS_MODULE, 216 .owner = THIS_MODULE,
217 .gpio_config = pc8736x_gpio_configure, 217 .gpio_config = pc8736x_gpio_configure,
218 .gpio_dump = nsc_gpio_dump, 218 .gpio_dump = nsc_gpio_dump,
219 .gpio_get = pc8736x_gpio_get, 219 .gpio_get = pc8736x_gpio_get,
220 .gpio_set = pc8736x_gpio_set, 220 .gpio_set = pc8736x_gpio_set,
221 .gpio_set_high = pc8736x_gpio_set_high,
222 .gpio_set_low = pc8736x_gpio_set_low,
223 .gpio_change = pc8736x_gpio_change, 221 .gpio_change = pc8736x_gpio_change,
224 .gpio_current = pc8736x_gpio_current 222 .gpio_current = pc8736x_gpio_current
225}; 223};
@@ -227,16 +225,16 @@ static struct nsc_gpio_ops pc8736x_access = {
227static int pc8736x_gpio_open(struct inode *inode, struct file *file) 225static int pc8736x_gpio_open(struct inode *inode, struct file *file)
228{ 226{
229 unsigned m = iminor(inode); 227 unsigned m = iminor(inode);
230 file->private_data = &pc8736x_access; 228 file->private_data = &pc8736x_gpio_ops;
231 229
232 dev_dbg(&pdev->dev, "open %d\n", m); 230 dev_dbg(&pdev->dev, "open %d\n", m);
233 231
234 if (m > 63) 232 if (m >= PC8736X_GPIO_CT)
235 return -EINVAL; 233 return -EINVAL;
236 return nonseekable_open(inode, file); 234 return nonseekable_open(inode, file);
237} 235}
238 236
239static const struct file_operations pc8736x_gpio_fops = { 237static const struct file_operations pc8736x_gpio_fileops = {
240 .owner = THIS_MODULE, 238 .owner = THIS_MODULE,
241 .open = pc8736x_gpio_open, 239 .open = pc8736x_gpio_open,
242 .write = nsc_gpio_write, 240 .write = nsc_gpio_write,
@@ -255,9 +253,12 @@ static void __init pc8736x_init_shadow(void)
255 253
256} 254}
257 255
256static struct cdev pc8736x_gpio_cdev;
257
258static int __init pc8736x_gpio_init(void) 258static int __init pc8736x_gpio_init(void)
259{ 259{
260 int rc = 0; 260 int rc;
261 dev_t devid;
261 262
262 pdev = platform_device_alloc(DEVNAME, 0); 263 pdev = platform_device_alloc(DEVNAME, 0);
263 if (!pdev) 264 if (!pdev)
@@ -275,7 +276,7 @@ static int __init pc8736x_gpio_init(void)
275 dev_err(&pdev->dev, "no device found\n"); 276 dev_err(&pdev->dev, "no device found\n");
276 goto undo_platform_dev_add; 277 goto undo_platform_dev_add;
277 } 278 }
278 pc8736x_access.dev = &pdev->dev; 279 pc8736x_gpio_ops.dev = &pdev->dev;
279 280
280 /* Verify that chip and it's GPIO unit are both enabled. 281 /* Verify that chip and it's GPIO unit are both enabled.
281 My BIOS does this, so I take minimum action here 282 My BIOS does this, so I take minimum action here
@@ -297,7 +298,7 @@ static int __init pc8736x_gpio_init(void)
297 pc8736x_gpio_base = (superio_inb(SIO_BASE_HADDR) << 8 298 pc8736x_gpio_base = (superio_inb(SIO_BASE_HADDR) << 8
298 | superio_inb(SIO_BASE_LADDR)); 299 | superio_inb(SIO_BASE_LADDR));
299 300
300 if (!request_region(pc8736x_gpio_base, 16, DEVNAME)) { 301 if (!request_region(pc8736x_gpio_base, PC8736X_GPIO_RANGE, DEVNAME)) {
301 rc = -ENODEV; 302 rc = -ENODEV;
302 dev_err(&pdev->dev, "GPIO ioport %x busy\n", 303 dev_err(&pdev->dev, "GPIO ioport %x busy\n",
303 pc8736x_gpio_base); 304 pc8736x_gpio_base);
@@ -305,10 +306,17 @@ static int __init pc8736x_gpio_init(void)
305 } 306 }
306 dev_info(&pdev->dev, "GPIO ioport %x reserved\n", pc8736x_gpio_base); 307 dev_info(&pdev->dev, "GPIO ioport %x reserved\n", pc8736x_gpio_base);
307 308
308 rc = register_chrdev(major, DEVNAME, &pc8736x_gpio_fops); 309 if (major) {
310 devid = MKDEV(major, 0);
311 rc = register_chrdev_region(devid, PC8736X_GPIO_CT, DEVNAME);
312 } else {
313 rc = alloc_chrdev_region(&devid, 0, PC8736X_GPIO_CT, DEVNAME);
314 major = MAJOR(devid);
315 }
316
309 if (rc < 0) { 317 if (rc < 0) {
310 dev_err(&pdev->dev, "register-chrdev failed: %d\n", rc); 318 dev_err(&pdev->dev, "register-chrdev failed: %d\n", rc);
311 goto undo_platform_dev_add; 319 goto undo_request_region;
312 } 320 }
313 if (!major) { 321 if (!major) {
314 major = rc; 322 major = rc;
@@ -316,8 +324,15 @@ static int __init pc8736x_gpio_init(void)
316 } 324 }
317 325
318 pc8736x_init_shadow(); 326 pc8736x_init_shadow();
327
328 /* ignore minor errs, and succeed */
329 cdev_init(&pc8736x_gpio_cdev, &pc8736x_gpio_fileops);
330 cdev_add(&pc8736x_gpio_cdev, devid, PC8736X_GPIO_CT);
331
319 return 0; 332 return 0;
320 333
334undo_request_region:
335 release_region(pc8736x_gpio_base, PC8736X_GPIO_RANGE);
321undo_platform_dev_add: 336undo_platform_dev_add:
322 platform_device_del(pdev); 337 platform_device_del(pdev);
323undo_platform_dev_alloc: 338undo_platform_dev_alloc:
@@ -328,14 +343,15 @@ undo_platform_dev_alloc:
328 343
329static void __exit pc8736x_gpio_cleanup(void) 344static void __exit pc8736x_gpio_cleanup(void)
330{ 345{
331 dev_dbg(&pdev->dev, " cleanup\n"); 346 dev_dbg(&pdev->dev, "cleanup\n");
332 347
333 release_region(pc8736x_gpio_base, 16); 348 cdev_del(&pc8736x_gpio_cdev);
349 unregister_chrdev_region(MKDEV(major,0), PC8736X_GPIO_CT);
350 release_region(pc8736x_gpio_base, PC8736X_GPIO_RANGE);
334 351
335 unregister_chrdev(major, DEVNAME); 352 platform_device_del(pdev);
353 platform_device_put(pdev);
336} 354}
337 355
338EXPORT_SYMBOL(pc8736x_access);
339
340module_init(pc8736x_gpio_init); 356module_init(pc8736x_gpio_init);
341module_exit(pc8736x_gpio_cleanup); 357module_exit(pc8736x_gpio_cleanup);
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
index 17bc8abd5df5..00f574cbb0d4 100644
--- a/drivers/char/pcmcia/synclink_cs.c
+++ b/drivers/char/pcmcia/synclink_cs.c
@@ -1174,8 +1174,12 @@ static void dcd_change(MGSLPC_INFO *info)
1174 else 1174 else
1175 info->input_signal_events.dcd_down++; 1175 info->input_signal_events.dcd_down++;
1176#ifdef CONFIG_HDLC 1176#ifdef CONFIG_HDLC
1177 if (info->netcount) 1177 if (info->netcount) {
1178 hdlc_set_carrier(info->serial_signals & SerialSignal_DCD, info->netdev); 1178 if (info->serial_signals & SerialSignal_DCD)
1179 netif_carrier_on(info->netdev);
1180 else
1181 netif_carrier_off(info->netdev);
1182 }
1179#endif 1183#endif
1180 wake_up_interruptible(&info->status_event_wait_q); 1184 wake_up_interruptible(&info->status_event_wait_q);
1181 wake_up_interruptible(&info->event_wait_q); 1185 wake_up_interruptible(&info->event_wait_q);
@@ -4251,8 +4255,10 @@ static int hdlcdev_open(struct net_device *dev)
4251 spin_lock_irqsave(&info->lock, flags); 4255 spin_lock_irqsave(&info->lock, flags);
4252 get_signals(info); 4256 get_signals(info);
4253 spin_unlock_irqrestore(&info->lock, flags); 4257 spin_unlock_irqrestore(&info->lock, flags);
4254 hdlc_set_carrier(info->serial_signals & SerialSignal_DCD, dev); 4258 if (info->serial_signals & SerialSignal_DCD)
4255 4259 netif_carrier_on(dev);
4260 else
4261 netif_carrier_off(dev);
4256 return 0; 4262 return 0;
4257} 4263}
4258 4264
diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c
index cc7bd1a3095b..6e6a7c7a7eff 100644
--- a/drivers/char/rtc.c
+++ b/drivers/char/rtc.c
@@ -46,13 +46,12 @@
46 * 1.11a Daniele Bellucci: Audit create_proc_read_entry in rtc_init 46 * 1.11a Daniele Bellucci: Audit create_proc_read_entry in rtc_init
47 * 1.12 Venkatesh Pallipadi: Hooks for emulating rtc on HPET base-timer 47 * 1.12 Venkatesh Pallipadi: Hooks for emulating rtc on HPET base-timer
48 * CONFIG_HPET_EMULATE_RTC 48 * CONFIG_HPET_EMULATE_RTC
49 * 1.12a Maciej W. Rozycki: Handle memory-mapped chips properly.
49 * 1.12ac Alan Cox: Allow read access to the day of week register 50 * 1.12ac Alan Cox: Allow read access to the day of week register
50 */ 51 */
51 52
52#define RTC_VERSION "1.12ac" 53#define RTC_VERSION "1.12ac"
53 54
54#define RTC_IO_EXTENT 0x8
55
56/* 55/*
57 * Note that *all* calls to CMOS_READ and CMOS_WRITE are done with 56 * Note that *all* calls to CMOS_READ and CMOS_WRITE are done with
58 * interrupts disabled. Due to the index-port/data-port (0x70/0x71) 57 * interrupts disabled. Due to the index-port/data-port (0x70/0x71)
@@ -337,7 +336,15 @@ static ssize_t rtc_read(struct file *file, char __user *buf,
337 if (rtc_has_irq == 0) 336 if (rtc_has_irq == 0)
338 return -EIO; 337 return -EIO;
339 338
340 if (count < sizeof(unsigned)) 339 /*
340 * Historically this function used to assume that sizeof(unsigned long)
341 * is the same in userspace and kernelspace. This lead to problems
342 * for configurations with multiple ABIs such a the MIPS o32 and 64
343 * ABIs supported on the same kernel. So now we support read of both
344 * 4 and 8 bytes and assume that's the sizeof(unsigned long) in the
345 * userspace ABI.
346 */
347 if (count != sizeof(unsigned int) && count != sizeof(unsigned long))
341 return -EINVAL; 348 return -EINVAL;
342 349
343 add_wait_queue(&rtc_wait, &wait); 350 add_wait_queue(&rtc_wait, &wait);
@@ -368,10 +375,12 @@ static ssize_t rtc_read(struct file *file, char __user *buf,
368 schedule(); 375 schedule();
369 } while (1); 376 } while (1);
370 377
371 if (count < sizeof(unsigned long)) 378 if (count == sizeof(unsigned int))
372 retval = put_user(data, (unsigned int __user *)buf) ?: sizeof(int); 379 retval = put_user(data, (unsigned int __user *)buf) ?: sizeof(int);
373 else 380 else
374 retval = put_user(data, (unsigned long __user *)buf) ?: sizeof(long); 381 retval = put_user(data, (unsigned long __user *)buf) ?: sizeof(long);
382 if (!retval)
383 retval = count;
375 out: 384 out:
376 current->state = TASK_RUNNING; 385 current->state = TASK_RUNNING;
377 remove_wait_queue(&rtc_wait, &wait); 386 remove_wait_queue(&rtc_wait, &wait);
@@ -923,6 +932,9 @@ static int __init rtc_init(void)
923 struct sparc_isa_device *isa_dev; 932 struct sparc_isa_device *isa_dev;
924#endif 933#endif
925#endif 934#endif
935#ifndef __sparc__
936 void *r;
937#endif
926 938
927#ifdef __sparc__ 939#ifdef __sparc__
928 for_each_ebus(ebus) { 940 for_each_ebus(ebus) {
@@ -964,8 +976,13 @@ found:
964 } 976 }
965no_irq: 977no_irq:
966#else 978#else
967 if (!request_region(RTC_PORT(0), RTC_IO_EXTENT, "rtc")) { 979 if (RTC_IOMAPPED)
968 printk(KERN_ERR "rtc: I/O port %d is not free.\n", RTC_PORT (0)); 980 r = request_region(RTC_PORT(0), RTC_IO_EXTENT, "rtc");
981 else
982 r = request_mem_region(RTC_PORT(0), RTC_IO_EXTENT, "rtc");
983 if (!r) {
984 printk(KERN_ERR "rtc: I/O resource %lx is not free.\n",
985 (long)(RTC_PORT(0)));
969 return -EIO; 986 return -EIO;
970 } 987 }
971 988
@@ -979,7 +996,10 @@ no_irq:
979 if(request_irq(RTC_IRQ, rtc_int_handler_ptr, IRQF_DISABLED, "rtc", NULL)) { 996 if(request_irq(RTC_IRQ, rtc_int_handler_ptr, IRQF_DISABLED, "rtc", NULL)) {
980 /* Yeah right, seeing as irq 8 doesn't even hit the bus. */ 997 /* Yeah right, seeing as irq 8 doesn't even hit the bus. */
981 printk(KERN_ERR "rtc: IRQ %d is not free.\n", RTC_IRQ); 998 printk(KERN_ERR "rtc: IRQ %d is not free.\n", RTC_IRQ);
982 release_region(RTC_PORT(0), RTC_IO_EXTENT); 999 if (RTC_IOMAPPED)
1000 release_region(RTC_PORT(0), RTC_IO_EXTENT);
1001 else
1002 release_mem_region(RTC_PORT(0), RTC_IO_EXTENT);
983 return -EIO; 1003 return -EIO;
984 } 1004 }
985 hpet_rtc_timer_init(); 1005 hpet_rtc_timer_init();
@@ -1079,7 +1099,10 @@ static void __exit rtc_exit (void)
1079 if (rtc_has_irq) 1099 if (rtc_has_irq)
1080 free_irq (rtc_irq, &rtc_port); 1100 free_irq (rtc_irq, &rtc_port);
1081#else 1101#else
1082 release_region (RTC_PORT (0), RTC_IO_EXTENT); 1102 if (RTC_IOMAPPED)
1103 release_region(RTC_PORT(0), RTC_IO_EXTENT);
1104 else
1105 release_mem_region(RTC_PORT(0), RTC_IO_EXTENT);
1083#ifdef RTC_IRQ 1106#ifdef RTC_IRQ
1084 if (rtc_has_irq) 1107 if (rtc_has_irq)
1085 free_irq (RTC_IRQ, NULL); 1108 free_irq (RTC_IRQ, NULL);
@@ -1222,7 +1245,7 @@ static int rtc_proc_open(struct inode *inode, struct file *file)
1222 1245
1223void rtc_get_rtc_time(struct rtc_time *rtc_tm) 1246void rtc_get_rtc_time(struct rtc_time *rtc_tm)
1224{ 1247{
1225 unsigned long uip_watchdog = jiffies; 1248 unsigned long uip_watchdog = jiffies, flags;
1226 unsigned char ctrl; 1249 unsigned char ctrl;
1227#ifdef CONFIG_MACH_DECSTATION 1250#ifdef CONFIG_MACH_DECSTATION
1228 unsigned int real_year; 1251 unsigned int real_year;
@@ -1249,7 +1272,7 @@ void rtc_get_rtc_time(struct rtc_time *rtc_tm)
1249 * RTC has RTC_DAY_OF_WEEK, we should usually ignore it, as it is 1272 * RTC has RTC_DAY_OF_WEEK, we should usually ignore it, as it is
1250 * only updated by the RTC when initially set to a non-zero value. 1273 * only updated by the RTC when initially set to a non-zero value.
1251 */ 1274 */
1252 spin_lock_irq(&rtc_lock); 1275 spin_lock_irqsave(&rtc_lock, flags);
1253 rtc_tm->tm_sec = CMOS_READ(RTC_SECONDS); 1276 rtc_tm->tm_sec = CMOS_READ(RTC_SECONDS);
1254 rtc_tm->tm_min = CMOS_READ(RTC_MINUTES); 1277 rtc_tm->tm_min = CMOS_READ(RTC_MINUTES);
1255 rtc_tm->tm_hour = CMOS_READ(RTC_HOURS); 1278 rtc_tm->tm_hour = CMOS_READ(RTC_HOURS);
@@ -1263,7 +1286,7 @@ void rtc_get_rtc_time(struct rtc_time *rtc_tm)
1263 real_year = CMOS_READ(RTC_DEC_YEAR); 1286 real_year = CMOS_READ(RTC_DEC_YEAR);
1264#endif 1287#endif
1265 ctrl = CMOS_READ(RTC_CONTROL); 1288 ctrl = CMOS_READ(RTC_CONTROL);
1266 spin_unlock_irq(&rtc_lock); 1289 spin_unlock_irqrestore(&rtc_lock, flags);
1267 1290
1268 if (!(ctrl & RTC_DM_BINARY) || RTC_ALWAYS_BCD) 1291 if (!(ctrl & RTC_DM_BINARY) || RTC_ALWAYS_BCD)
1269 { 1292 {
diff --git a/drivers/char/scx200_gpio.c b/drivers/char/scx200_gpio.c
index 425c58719db6..b956c7babd18 100644
--- a/drivers/char/scx200_gpio.c
+++ b/drivers/char/scx200_gpio.c
@@ -5,7 +5,6 @@
5 5
6 Copyright (c) 2001,2002 Christer Weinigel <wingel@nano-system.com> */ 6 Copyright (c) 2001,2002 Christer Weinigel <wingel@nano-system.com> */
7 7
8#include <linux/config.h>
9#include <linux/device.h> 8#include <linux/device.h>
10#include <linux/fs.h> 9#include <linux/fs.h>
11#include <linux/module.h> 10#include <linux/module.h>
@@ -22,37 +21,37 @@
22#include <linux/scx200_gpio.h> 21#include <linux/scx200_gpio.h>
23#include <linux/nsc_gpio.h> 22#include <linux/nsc_gpio.h>
24 23
25#define NAME "scx200_gpio" 24#define DRVNAME "scx200_gpio"
26#define DEVNAME NAME
27 25
28static struct platform_device *pdev; 26static struct platform_device *pdev;
29 27
30MODULE_AUTHOR("Christer Weinigel <wingel@nano-system.com>"); 28MODULE_AUTHOR("Christer Weinigel <wingel@nano-system.com>");
31MODULE_DESCRIPTION("NatSemi SCx200 GPIO Pin Driver"); 29MODULE_DESCRIPTION("NatSemi/AMD SCx200 GPIO Pin Driver");
32MODULE_LICENSE("GPL"); 30MODULE_LICENSE("GPL");
33 31
34static int major = 0; /* default to dynamic major */ 32static int major = 0; /* default to dynamic major */
35module_param(major, int, 0); 33module_param(major, int, 0);
36MODULE_PARM_DESC(major, "Major device number"); 34MODULE_PARM_DESC(major, "Major device number");
37 35
38struct nsc_gpio_ops scx200_access = { 36#define MAX_PINS 32 /* 64 later, when known ok */
37
38struct nsc_gpio_ops scx200_gpio_ops = {
39 .owner = THIS_MODULE, 39 .owner = THIS_MODULE,
40 .gpio_config = scx200_gpio_configure, 40 .gpio_config = scx200_gpio_configure,
41 .gpio_dump = nsc_gpio_dump, 41 .gpio_dump = nsc_gpio_dump,
42 .gpio_get = scx200_gpio_get, 42 .gpio_get = scx200_gpio_get,
43 .gpio_set = scx200_gpio_set, 43 .gpio_set = scx200_gpio_set,
44 .gpio_set_high = scx200_gpio_set_high,
45 .gpio_set_low = scx200_gpio_set_low,
46 .gpio_change = scx200_gpio_change, 44 .gpio_change = scx200_gpio_change,
47 .gpio_current = scx200_gpio_current 45 .gpio_current = scx200_gpio_current
48}; 46};
47EXPORT_SYMBOL(scx200_gpio_ops);
49 48
50static int scx200_gpio_open(struct inode *inode, struct file *file) 49static int scx200_gpio_open(struct inode *inode, struct file *file)
51{ 50{
52 unsigned m = iminor(inode); 51 unsigned m = iminor(inode);
53 file->private_data = &scx200_access; 52 file->private_data = &scx200_gpio_ops;
54 53
55 if (m > 63) 54 if (m >= MAX_PINS)
56 return -EINVAL; 55 return -EINVAL;
57 return nonseekable_open(inode, file); 56 return nonseekable_open(inode, file);
58} 57}
@@ -62,8 +61,7 @@ static int scx200_gpio_release(struct inode *inode, struct file *file)
62 return 0; 61 return 0;
63} 62}
64 63
65 64static const struct file_operations scx200_gpio_fileops = {
66static const struct file_operations scx200_gpio_fops = {
67 .owner = THIS_MODULE, 65 .owner = THIS_MODULE,
68 .write = nsc_gpio_write, 66 .write = nsc_gpio_write,
69 .read = nsc_gpio_read, 67 .read = nsc_gpio_read,
@@ -71,21 +69,20 @@ static const struct file_operations scx200_gpio_fops = {
71 .release = scx200_gpio_release, 69 .release = scx200_gpio_release,
72}; 70};
73 71
74struct cdev *scx200_devices; 72struct cdev scx200_gpio_cdev; /* use 1 cdev for all pins */
75static int num_pins = 32;
76 73
77static int __init scx200_gpio_init(void) 74static int __init scx200_gpio_init(void)
78{ 75{
79 int rc, i; 76 int rc;
80 dev_t dev = MKDEV(major, 0); 77 dev_t devid;
81 78
82 if (!scx200_gpio_present()) { 79 if (!scx200_gpio_present()) {
83 printk(KERN_ERR NAME ": no SCx200 gpio present\n"); 80 printk(KERN_ERR DRVNAME ": no SCx200 gpio present\n");
84 return -ENODEV; 81 return -ENODEV;
85 } 82 }
86 83
87 /* support dev_dbg() with pdev->dev */ 84 /* support dev_dbg() with pdev->dev */
88 pdev = platform_device_alloc(DEVNAME, 0); 85 pdev = platform_device_alloc(DRVNAME, 0);
89 if (!pdev) 86 if (!pdev)
90 return -ENOMEM; 87 return -ENOMEM;
91 88
@@ -94,37 +91,25 @@ static int __init scx200_gpio_init(void)
94 goto undo_malloc; 91 goto undo_malloc;
95 92
96 /* nsc_gpio uses dev_dbg(), so needs this */ 93 /* nsc_gpio uses dev_dbg(), so needs this */
97 scx200_access.dev = &pdev->dev; 94 scx200_gpio_ops.dev = &pdev->dev;
98 95
99 if (major) 96 if (major) {
100 rc = register_chrdev_region(dev, num_pins, "scx200_gpio"); 97 devid = MKDEV(major, 0);
101 else { 98 rc = register_chrdev_region(devid, MAX_PINS, "scx200_gpio");
102 rc = alloc_chrdev_region(&dev, 0, num_pins, "scx200_gpio"); 99 } else {
103 major = MAJOR(dev); 100 rc = alloc_chrdev_region(&devid, 0, MAX_PINS, "scx200_gpio");
101 major = MAJOR(devid);
104 } 102 }
105 if (rc < 0) { 103 if (rc < 0) {
106 dev_err(&pdev->dev, "SCx200 chrdev_region err: %d\n", rc); 104 dev_err(&pdev->dev, "SCx200 chrdev_region err: %d\n", rc);
107 goto undo_platform_device_add; 105 goto undo_platform_device_add;
108 } 106 }
109 scx200_devices = kzalloc(num_pins * sizeof(struct cdev), GFP_KERNEL); 107
110 if (!scx200_devices) { 108 cdev_init(&scx200_gpio_cdev, &scx200_gpio_fileops);
111 rc = -ENOMEM; 109 cdev_add(&scx200_gpio_cdev, devid, MAX_PINS);
112 goto undo_chrdev_region;
113 }
114 for (i = 0; i < num_pins; i++) {
115 struct cdev *cdev = &scx200_devices[i];
116 cdev_init(cdev, &scx200_gpio_fops);
117 cdev->owner = THIS_MODULE;
118 rc = cdev_add(cdev, MKDEV(major, i), 1);
119 /* tolerate 'minor' errors */
120 if (rc)
121 dev_err(&pdev->dev, "Error %d on minor %d", rc, i);
122 }
123 110
124 return 0; /* succeed */ 111 return 0; /* succeed */
125 112
126undo_chrdev_region:
127 unregister_chrdev_region(dev, num_pins);
128undo_platform_device_add: 113undo_platform_device_add:
129 platform_device_del(pdev); 114 platform_device_del(pdev);
130undo_malloc: 115undo_malloc:
@@ -135,10 +120,11 @@ undo_malloc:
135 120
136static void __exit scx200_gpio_cleanup(void) 121static void __exit scx200_gpio_cleanup(void)
137{ 122{
138 kfree(scx200_devices); 123 cdev_del(&scx200_gpio_cdev);
139 unregister_chrdev_region(MKDEV(major, 0), num_pins); 124 /* cdev_put(&scx200_gpio_cdev); */
125
126 unregister_chrdev_region(MKDEV(major, 0), MAX_PINS);
140 platform_device_unregister(pdev); 127 platform_device_unregister(pdev);
141 /* kfree(pdev); */
142} 128}
143 129
144module_init(scx200_gpio_init); 130module_init(scx200_gpio_init);
diff --git a/drivers/char/snsc.c b/drivers/char/snsc.c
index afc6eda602f7..07e0b75f2338 100644
--- a/drivers/char/snsc.c
+++ b/drivers/char/snsc.c
@@ -374,7 +374,12 @@ scdrv_init(void)
374 struct sysctl_data_s *scd; 374 struct sysctl_data_s *scd;
375 void *salbuf; 375 void *salbuf;
376 dev_t first_dev, dev; 376 dev_t first_dev, dev;
377 nasid_t event_nasid = ia64_sn_get_console_nasid(); 377 nasid_t event_nasid;
378
379 if (!ia64_platform_is("sn2"))
380 return -ENODEV;
381
382 event_nasid = ia64_sn_get_console_nasid();
378 383
379 if (alloc_chrdev_region(&first_dev, 0, num_cnodes, 384 if (alloc_chrdev_region(&first_dev, 0, num_cnodes,
380 SYSCTL_BASENAME) < 0) { 385 SYSCTL_BASENAME) < 0) {
diff --git a/drivers/char/snsc_event.c b/drivers/char/snsc_event.c
index 8b2210b633df..d12d4f629cec 100644
--- a/drivers/char/snsc_event.c
+++ b/drivers/char/snsc_event.c
@@ -220,20 +220,7 @@ scdrv_dispatch_event(char *event, int len)
220 " Sending SIGPWR to init...\n"); 220 " Sending SIGPWR to init...\n");
221 221
222 /* give a SIGPWR signal to init proc */ 222 /* give a SIGPWR signal to init proc */
223 223 kill_proc(1, SIGPWR, 0);
224 /* first find init's task */
225 read_lock(&tasklist_lock);
226 for_each_process(p) {
227 if (p->pid == 1)
228 break;
229 }
230 if (p) {
231 force_sig(SIGPWR, p);
232 } else {
233 printk(KERN_ERR "Failed to signal init!\n");
234 snsc_shutting_down = 0; /* so can try again (?) */
235 }
236 read_unlock(&tasklist_lock);
237 } else { 224 } else {
238 /* print to system log */ 225 /* print to system log */
239 printk("%s|$(0x%x)%s\n", severity, esp_code, desc); 226 printk("%s|$(0x%x)%s\n", severity, esp_code, desc);
diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c
index cb2859249d49..a1d303f9a33d 100644
--- a/drivers/char/specialix.c
+++ b/drivers/char/specialix.c
@@ -2584,6 +2584,12 @@ static void __exit specialix_exit_module(void)
2584 func_exit(); 2584 func_exit();
2585} 2585}
2586 2586
2587static struct pci_device_id specialx_pci_tbl[] __devinitdata = {
2588 { PCI_DEVICE(PCI_VENDOR_ID_SPECIALIX, PCI_DEVICE_ID_SPECIALIX_IO8) },
2589 { }
2590};
2591MODULE_DEVICE_TABLE(pci, specialx_pci_tbl);
2592
2587module_init(specialix_init_module); 2593module_init(specialix_init_module);
2588module_exit(specialix_exit_module); 2594module_exit(specialix_exit_module);
2589 2595
diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c
index df782dd1098c..78b1b1a2732b 100644
--- a/drivers/char/synclink.c
+++ b/drivers/char/synclink.c
@@ -1344,8 +1344,12 @@ static void mgsl_isr_io_pin( struct mgsl_struct *info )
1344 } else 1344 } else
1345 info->input_signal_events.dcd_down++; 1345 info->input_signal_events.dcd_down++;
1346#ifdef CONFIG_HDLC 1346#ifdef CONFIG_HDLC
1347 if (info->netcount) 1347 if (info->netcount) {
1348 hdlc_set_carrier(status & MISCSTATUS_DCD, info->netdev); 1348 if (status & MISCSTATUS_DCD)
1349 netif_carrier_on(info->netdev);
1350 else
1351 netif_carrier_off(info->netdev);
1352 }
1349#endif 1353#endif
1350 } 1354 }
1351 if (status & MISCSTATUS_CTS_LATCHED) 1355 if (status & MISCSTATUS_CTS_LATCHED)
@@ -7844,8 +7848,10 @@ static int hdlcdev_open(struct net_device *dev)
7844 spin_lock_irqsave(&info->irq_spinlock, flags); 7848 spin_lock_irqsave(&info->irq_spinlock, flags);
7845 usc_get_serial_signals(info); 7849 usc_get_serial_signals(info);
7846 spin_unlock_irqrestore(&info->irq_spinlock, flags); 7850 spin_unlock_irqrestore(&info->irq_spinlock, flags);
7847 hdlc_set_carrier(info->serial_signals & SerialSignal_DCD, dev); 7851 if (info->serial_signals & SerialSignal_DCD)
7848 7852 netif_carrier_on(dev);
7853 else
7854 netif_carrier_off(dev);
7849 return 0; 7855 return 0;
7850} 7856}
7851 7857
diff --git a/drivers/char/synclink_gt.c b/drivers/char/synclink_gt.c
index e829594195c1..b2dbbdb1bf81 100644
--- a/drivers/char/synclink_gt.c
+++ b/drivers/char/synclink_gt.c
@@ -1497,8 +1497,10 @@ static int hdlcdev_open(struct net_device *dev)
1497 spin_lock_irqsave(&info->lock, flags); 1497 spin_lock_irqsave(&info->lock, flags);
1498 get_signals(info); 1498 get_signals(info);
1499 spin_unlock_irqrestore(&info->lock, flags); 1499 spin_unlock_irqrestore(&info->lock, flags);
1500 hdlc_set_carrier(info->signals & SerialSignal_DCD, dev); 1500 if (info->signals & SerialSignal_DCD)
1501 1501 netif_carrier_on(dev);
1502 else
1503 netif_carrier_off(dev);
1502 return 0; 1504 return 0;
1503} 1505}
1504 1506
@@ -1997,8 +1999,12 @@ static void dcd_change(struct slgt_info *info)
1997 info->input_signal_events.dcd_down++; 1999 info->input_signal_events.dcd_down++;
1998 } 2000 }
1999#ifdef CONFIG_HDLC 2001#ifdef CONFIG_HDLC
2000 if (info->netcount) 2002 if (info->netcount) {
2001 hdlc_set_carrier(info->signals & SerialSignal_DCD, info->netdev); 2003 if (info->signals & SerialSignal_DCD)
2004 netif_carrier_on(info->netdev);
2005 else
2006 netif_carrier_off(info->netdev);
2007 }
2002#endif 2008#endif
2003 wake_up_interruptible(&info->status_event_wait_q); 2009 wake_up_interruptible(&info->status_event_wait_q);
2004 wake_up_interruptible(&info->event_wait_q); 2010 wake_up_interruptible(&info->event_wait_q);
diff --git a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c
index 1e443a233f51..66f3754fbbdf 100644
--- a/drivers/char/synclinkmp.c
+++ b/drivers/char/synclinkmp.c
@@ -1752,8 +1752,10 @@ static int hdlcdev_open(struct net_device *dev)
1752 spin_lock_irqsave(&info->lock, flags); 1752 spin_lock_irqsave(&info->lock, flags);
1753 get_signals(info); 1753 get_signals(info);
1754 spin_unlock_irqrestore(&info->lock, flags); 1754 spin_unlock_irqrestore(&info->lock, flags);
1755 hdlc_set_carrier(info->serial_signals & SerialSignal_DCD, dev); 1755 if (info->serial_signals & SerialSignal_DCD)
1756 1756 netif_carrier_on(dev);
1757 else
1758 netif_carrier_off(dev);
1757 return 0; 1759 return 0;
1758} 1760}
1759 1761
@@ -2522,8 +2524,12 @@ void isr_io_pin( SLMP_INFO *info, u16 status )
2522 } else 2524 } else
2523 info->input_signal_events.dcd_down++; 2525 info->input_signal_events.dcd_down++;
2524#ifdef CONFIG_HDLC 2526#ifdef CONFIG_HDLC
2525 if (info->netcount) 2527 if (info->netcount) {
2526 hdlc_set_carrier(status & SerialSignal_DCD, info->netdev); 2528 if (status & SerialSignal_DCD)
2529 netif_carrier_on(info->netdev);
2530 else
2531 netif_carrier_off(info->netdev);
2532 }
2527#endif 2533#endif
2528 } 2534 }
2529 if (status & MISCSTATUS_CTS_LATCHED) 2535 if (status & MISCSTATUS_CTS_LATCHED)
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c
index 6889e7db3aff..a082a2e34252 100644
--- a/drivers/char/tpm/tpm.c
+++ b/drivers/char/tpm/tpm.c
@@ -1141,6 +1141,7 @@ struct tpm_chip *tpm_register_hardware(struct device *dev, const struct tpm_vend
1141 put_device(dev); 1141 put_device(dev);
1142 clear_bit(chip->dev_num, dev_mask); 1142 clear_bit(chip->dev_num, dev_mask);
1143 kfree(chip); 1143 kfree(chip);
1144 kfree(devname);
1144 return NULL; 1145 return NULL;
1145 } 1146 }
1146 1147
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
index 3232b1932597..ee7ac6f43c65 100644
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -424,6 +424,7 @@ static irqreturn_t tis_int_handler(int irq, void *dev_id, struct pt_regs *regs)
424 iowrite32(interrupt, 424 iowrite32(interrupt,
425 chip->vendor.iobase + 425 chip->vendor.iobase +
426 TPM_INT_STATUS(chip->vendor.locality)); 426 TPM_INT_STATUS(chip->vendor.locality));
427 ioread32(chip->vendor.iobase + TPM_INT_STATUS(chip->vendor.locality));
427 return IRQ_HANDLED; 428 return IRQ_HANDLED;
428} 429}
429 430
@@ -431,23 +432,19 @@ static int interrupts = 1;
431module_param(interrupts, bool, 0444); 432module_param(interrupts, bool, 0444);
432MODULE_PARM_DESC(interrupts, "Enable interrupts"); 433MODULE_PARM_DESC(interrupts, "Enable interrupts");
433 434
434static int __devinit tpm_tis_pnp_init(struct pnp_dev *pnp_dev, 435static int tpm_tis_init(struct device *dev, resource_size_t start,
435 const struct pnp_device_id *pnp_id) 436 resource_size_t len)
436{ 437{
437 u32 vendor, intfcaps, intmask; 438 u32 vendor, intfcaps, intmask;
438 int rc, i; 439 int rc, i;
439 unsigned long start, len;
440 struct tpm_chip *chip; 440 struct tpm_chip *chip;
441 441
442 start = pnp_mem_start(pnp_dev, 0);
443 len = pnp_mem_len(pnp_dev, 0);
444
445 if (!start) 442 if (!start)
446 start = TIS_MEM_BASE; 443 start = TIS_MEM_BASE;
447 if (!len) 444 if (!len)
448 len = TIS_MEM_LEN; 445 len = TIS_MEM_LEN;
449 446
450 if (!(chip = tpm_register_hardware(&pnp_dev->dev, &tpm_tis))) 447 if (!(chip = tpm_register_hardware(dev, &tpm_tis)))
451 return -ENODEV; 448 return -ENODEV;
452 449
453 chip->vendor.iobase = ioremap(start, len); 450 chip->vendor.iobase = ioremap(start, len);
@@ -464,7 +461,7 @@ static int __devinit tpm_tis_pnp_init(struct pnp_dev *pnp_dev,
464 chip->vendor.timeout_c = msecs_to_jiffies(TIS_SHORT_TIMEOUT); 461 chip->vendor.timeout_c = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
465 chip->vendor.timeout_d = msecs_to_jiffies(TIS_SHORT_TIMEOUT); 462 chip->vendor.timeout_d = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
466 463
467 dev_info(&pnp_dev->dev, 464 dev_info(dev,
468 "1.2 TPM (device-id 0x%X, rev-id %d)\n", 465 "1.2 TPM (device-id 0x%X, rev-id %d)\n",
469 vendor >> 16, ioread8(chip->vendor.iobase + TPM_RID(0))); 466 vendor >> 16, ioread8(chip->vendor.iobase + TPM_RID(0)));
470 467
@@ -472,26 +469,26 @@ static int __devinit tpm_tis_pnp_init(struct pnp_dev *pnp_dev,
472 intfcaps = 469 intfcaps =
473 ioread32(chip->vendor.iobase + 470 ioread32(chip->vendor.iobase +
474 TPM_INTF_CAPS(chip->vendor.locality)); 471 TPM_INTF_CAPS(chip->vendor.locality));
475 dev_dbg(&pnp_dev->dev, "TPM interface capabilities (0x%x):\n", 472 dev_dbg(dev, "TPM interface capabilities (0x%x):\n",
476 intfcaps); 473 intfcaps);
477 if (intfcaps & TPM_INTF_BURST_COUNT_STATIC) 474 if (intfcaps & TPM_INTF_BURST_COUNT_STATIC)
478 dev_dbg(&pnp_dev->dev, "\tBurst Count Static\n"); 475 dev_dbg(dev, "\tBurst Count Static\n");
479 if (intfcaps & TPM_INTF_CMD_READY_INT) 476 if (intfcaps & TPM_INTF_CMD_READY_INT)
480 dev_dbg(&pnp_dev->dev, "\tCommand Ready Int Support\n"); 477 dev_dbg(dev, "\tCommand Ready Int Support\n");
481 if (intfcaps & TPM_INTF_INT_EDGE_FALLING) 478 if (intfcaps & TPM_INTF_INT_EDGE_FALLING)
482 dev_dbg(&pnp_dev->dev, "\tInterrupt Edge Falling\n"); 479 dev_dbg(dev, "\tInterrupt Edge Falling\n");
483 if (intfcaps & TPM_INTF_INT_EDGE_RISING) 480 if (intfcaps & TPM_INTF_INT_EDGE_RISING)
484 dev_dbg(&pnp_dev->dev, "\tInterrupt Edge Rising\n"); 481 dev_dbg(dev, "\tInterrupt Edge Rising\n");
485 if (intfcaps & TPM_INTF_INT_LEVEL_LOW) 482 if (intfcaps & TPM_INTF_INT_LEVEL_LOW)
486 dev_dbg(&pnp_dev->dev, "\tInterrupt Level Low\n"); 483 dev_dbg(dev, "\tInterrupt Level Low\n");
487 if (intfcaps & TPM_INTF_INT_LEVEL_HIGH) 484 if (intfcaps & TPM_INTF_INT_LEVEL_HIGH)
488 dev_dbg(&pnp_dev->dev, "\tInterrupt Level High\n"); 485 dev_dbg(dev, "\tInterrupt Level High\n");
489 if (intfcaps & TPM_INTF_LOCALITY_CHANGE_INT) 486 if (intfcaps & TPM_INTF_LOCALITY_CHANGE_INT)
490 dev_dbg(&pnp_dev->dev, "\tLocality Change Int Support\n"); 487 dev_dbg(dev, "\tLocality Change Int Support\n");
491 if (intfcaps & TPM_INTF_STS_VALID_INT) 488 if (intfcaps & TPM_INTF_STS_VALID_INT)
492 dev_dbg(&pnp_dev->dev, "\tSts Valid Int Support\n"); 489 dev_dbg(dev, "\tSts Valid Int Support\n");
493 if (intfcaps & TPM_INTF_DATA_AVAIL_INT) 490 if (intfcaps & TPM_INTF_DATA_AVAIL_INT)
494 dev_dbg(&pnp_dev->dev, "\tData Avail Int Support\n"); 491 dev_dbg(dev, "\tData Avail Int Support\n");
495 492
496 if (request_locality(chip, 0) != 0) { 493 if (request_locality(chip, 0) != 0) {
497 rc = -ENODEV; 494 rc = -ENODEV;
@@ -594,6 +591,16 @@ out_err:
594 return rc; 591 return rc;
595} 592}
596 593
594static int __devinit tpm_tis_pnp_init(struct pnp_dev *pnp_dev,
595 const struct pnp_device_id *pnp_id)
596{
597 resource_size_t start, len;
598 start = pnp_mem_start(pnp_dev, 0);
599 len = pnp_mem_len(pnp_dev, 0);
600
601 return tpm_tis_init(&pnp_dev->dev, start, len);
602}
603
597static int tpm_tis_pnp_suspend(struct pnp_dev *dev, pm_message_t msg) 604static int tpm_tis_pnp_suspend(struct pnp_dev *dev, pm_message_t msg)
598{ 605{
599 return tpm_pm_suspend(&dev->dev, msg); 606 return tpm_pm_suspend(&dev->dev, msg);
@@ -628,8 +635,36 @@ module_param_string(hid, tpm_pnp_tbl[TIS_HID_USR_IDX].id,
628 sizeof(tpm_pnp_tbl[TIS_HID_USR_IDX].id), 0444); 635 sizeof(tpm_pnp_tbl[TIS_HID_USR_IDX].id), 0444);
629MODULE_PARM_DESC(hid, "Set additional specific HID for this driver to probe"); 636MODULE_PARM_DESC(hid, "Set additional specific HID for this driver to probe");
630 637
638static struct device_driver tis_drv = {
639 .name = "tpm_tis",
640 .bus = &platform_bus_type,
641 .owner = THIS_MODULE,
642 .suspend = tpm_pm_suspend,
643 .resume = tpm_pm_resume,
644};
645
646static struct platform_device *pdev;
647
648static int force;
649module_param(force, bool, 0444);
650MODULE_PARM_DESC(force, "Force device probe rather than using ACPI entry");
631static int __init init_tis(void) 651static int __init init_tis(void)
632{ 652{
653 int rc;
654
655 if (force) {
656 rc = driver_register(&tis_drv);
657 if (rc < 0)
658 return rc;
659 if (IS_ERR(pdev=platform_device_register_simple("tpm_tis", -1, NULL, 0)))
660 return PTR_ERR(pdev);
661 if((rc=tpm_tis_init(&pdev->dev, 0, 0)) != 0) {
662 platform_device_unregister(pdev);
663 driver_unregister(&tis_drv);
664 }
665 return rc;
666 }
667
633 return pnp_register_driver(&tis_pnp_driver); 668 return pnp_register_driver(&tis_pnp_driver);
634} 669}
635 670
@@ -654,7 +689,11 @@ static void __exit cleanup_tis(void)
654 tpm_remove_hardware(chip->dev); 689 tpm_remove_hardware(chip->dev);
655 } 690 }
656 spin_unlock(&tis_lock); 691 spin_unlock(&tis_lock);
657 pnp_unregister_driver(&tis_pnp_driver); 692 if (force) {
693 platform_device_unregister(pdev);
694 driver_unregister(&tis_drv);
695 } else
696 pnp_unregister_driver(&tis_pnp_driver);
658} 697}
659 698
660module_init(init_tis); 699module_init(init_tis);
diff --git a/drivers/char/vr41xx_giu.c b/drivers/char/vr41xx_giu.c
index 1b9b1f1d4c49..8116a47b80f4 100644
--- a/drivers/char/vr41xx_giu.c
+++ b/drivers/char/vr41xx_giu.c
@@ -33,6 +33,7 @@
33#include <asm/cpu.h> 33#include <asm/cpu.h>
34#include <asm/io.h> 34#include <asm/io.h>
35#include <asm/vr41xx/giu.h> 35#include <asm/vr41xx/giu.h>
36#include <asm/vr41xx/irq.h>
36#include <asm/vr41xx/vr41xx.h> 37#include <asm/vr41xx/vr41xx.h>
37 38
38MODULE_AUTHOR("Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>"); 39MODULE_AUTHOR("Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>");
diff --git a/drivers/connector/cn_proc.c b/drivers/connector/cn_proc.c
index 498aa37bca22..3ece69231343 100644
--- a/drivers/connector/cn_proc.c
+++ b/drivers/connector/cn_proc.c
@@ -51,6 +51,7 @@ void proc_fork_connector(struct task_struct *task)
51 struct cn_msg *msg; 51 struct cn_msg *msg;
52 struct proc_event *ev; 52 struct proc_event *ev;
53 __u8 buffer[CN_PROC_MSG_SIZE]; 53 __u8 buffer[CN_PROC_MSG_SIZE];
54 struct timespec ts;
54 55
55 if (atomic_read(&proc_event_num_listeners) < 1) 56 if (atomic_read(&proc_event_num_listeners) < 1)
56 return; 57 return;
@@ -58,7 +59,8 @@ void proc_fork_connector(struct task_struct *task)
58 msg = (struct cn_msg*)buffer; 59 msg = (struct cn_msg*)buffer;
59 ev = (struct proc_event*)msg->data; 60 ev = (struct proc_event*)msg->data;
60 get_seq(&msg->seq, &ev->cpu); 61 get_seq(&msg->seq, &ev->cpu);
61 ktime_get_ts(&ev->timestamp); /* get high res monotonic timestamp */ 62 ktime_get_ts(&ts); /* get high res monotonic timestamp */
63 ev->timestamp_ns = timespec_to_ns(&ts);
62 ev->what = PROC_EVENT_FORK; 64 ev->what = PROC_EVENT_FORK;
63 ev->event_data.fork.parent_pid = task->real_parent->pid; 65 ev->event_data.fork.parent_pid = task->real_parent->pid;
64 ev->event_data.fork.parent_tgid = task->real_parent->tgid; 66 ev->event_data.fork.parent_tgid = task->real_parent->tgid;
@@ -76,6 +78,7 @@ void proc_exec_connector(struct task_struct *task)
76{ 78{
77 struct cn_msg *msg; 79 struct cn_msg *msg;
78 struct proc_event *ev; 80 struct proc_event *ev;
81 struct timespec ts;
79 __u8 buffer[CN_PROC_MSG_SIZE]; 82 __u8 buffer[CN_PROC_MSG_SIZE];
80 83
81 if (atomic_read(&proc_event_num_listeners) < 1) 84 if (atomic_read(&proc_event_num_listeners) < 1)
@@ -84,7 +87,8 @@ void proc_exec_connector(struct task_struct *task)
84 msg = (struct cn_msg*)buffer; 87 msg = (struct cn_msg*)buffer;
85 ev = (struct proc_event*)msg->data; 88 ev = (struct proc_event*)msg->data;
86 get_seq(&msg->seq, &ev->cpu); 89 get_seq(&msg->seq, &ev->cpu);
87 ktime_get_ts(&ev->timestamp); 90 ktime_get_ts(&ts); /* get high res monotonic timestamp */
91 ev->timestamp_ns = timespec_to_ns(&ts);
88 ev->what = PROC_EVENT_EXEC; 92 ev->what = PROC_EVENT_EXEC;
89 ev->event_data.exec.process_pid = task->pid; 93 ev->event_data.exec.process_pid = task->pid;
90 ev->event_data.exec.process_tgid = task->tgid; 94 ev->event_data.exec.process_tgid = task->tgid;
@@ -100,6 +104,7 @@ void proc_id_connector(struct task_struct *task, int which_id)
100 struct cn_msg *msg; 104 struct cn_msg *msg;
101 struct proc_event *ev; 105 struct proc_event *ev;
102 __u8 buffer[CN_PROC_MSG_SIZE]; 106 __u8 buffer[CN_PROC_MSG_SIZE];
107 struct timespec ts;
103 108
104 if (atomic_read(&proc_event_num_listeners) < 1) 109 if (atomic_read(&proc_event_num_listeners) < 1)
105 return; 110 return;
@@ -118,7 +123,8 @@ void proc_id_connector(struct task_struct *task, int which_id)
118 } else 123 } else
119 return; 124 return;
120 get_seq(&msg->seq, &ev->cpu); 125 get_seq(&msg->seq, &ev->cpu);
121 ktime_get_ts(&ev->timestamp); 126 ktime_get_ts(&ts); /* get high res monotonic timestamp */
127 ev->timestamp_ns = timespec_to_ns(&ts);
122 128
123 memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id)); 129 memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id));
124 msg->ack = 0; /* not used */ 130 msg->ack = 0; /* not used */
@@ -131,6 +137,7 @@ void proc_exit_connector(struct task_struct *task)
131 struct cn_msg *msg; 137 struct cn_msg *msg;
132 struct proc_event *ev; 138 struct proc_event *ev;
133 __u8 buffer[CN_PROC_MSG_SIZE]; 139 __u8 buffer[CN_PROC_MSG_SIZE];
140 struct timespec ts;
134 141
135 if (atomic_read(&proc_event_num_listeners) < 1) 142 if (atomic_read(&proc_event_num_listeners) < 1)
136 return; 143 return;
@@ -138,7 +145,8 @@ void proc_exit_connector(struct task_struct *task)
138 msg = (struct cn_msg*)buffer; 145 msg = (struct cn_msg*)buffer;
139 ev = (struct proc_event*)msg->data; 146 ev = (struct proc_event*)msg->data;
140 get_seq(&msg->seq, &ev->cpu); 147 get_seq(&msg->seq, &ev->cpu);
141 ktime_get_ts(&ev->timestamp); 148 ktime_get_ts(&ts); /* get high res monotonic timestamp */
149 ev->timestamp_ns = timespec_to_ns(&ts);
142 ev->what = PROC_EVENT_EXIT; 150 ev->what = PROC_EVENT_EXIT;
143 ev->event_data.exit.process_pid = task->pid; 151 ev->event_data.exit.process_pid = task->pid;
144 ev->event_data.exit.process_tgid = task->tgid; 152 ev->event_data.exit.process_tgid = task->tgid;
@@ -164,6 +172,7 @@ static void cn_proc_ack(int err, int rcvd_seq, int rcvd_ack)
164 struct cn_msg *msg; 172 struct cn_msg *msg;
165 struct proc_event *ev; 173 struct proc_event *ev;
166 __u8 buffer[CN_PROC_MSG_SIZE]; 174 __u8 buffer[CN_PROC_MSG_SIZE];
175 struct timespec ts;
167 176
168 if (atomic_read(&proc_event_num_listeners) < 1) 177 if (atomic_read(&proc_event_num_listeners) < 1)
169 return; 178 return;
@@ -171,7 +180,8 @@ static void cn_proc_ack(int err, int rcvd_seq, int rcvd_ack)
171 msg = (struct cn_msg*)buffer; 180 msg = (struct cn_msg*)buffer;
172 ev = (struct proc_event*)msg->data; 181 ev = (struct proc_event*)msg->data;
173 msg->seq = rcvd_seq; 182 msg->seq = rcvd_seq;
174 ktime_get_ts(&ev->timestamp); 183 ktime_get_ts(&ts); /* get high res monotonic timestamp */
184 ev->timestamp_ns = timespec_to_ns(&ts);
175 ev->cpu = -1; 185 ev->cpu = -1;
176 ev->what = PROC_EVENT_NONE; 186 ev->what = PROC_EVENT_NONE;
177 ev->event_data.ack.err = err; 187 ev->event_data.ack.err = err;
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 1ba4039777e8..b3df613ae4ec 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -284,39 +284,69 @@ EXPORT_SYMBOL_GPL(cpufreq_notify_transition);
284 * SYSFS INTERFACE * 284 * SYSFS INTERFACE *
285 *********************************************************************/ 285 *********************************************************************/
286 286
287static struct cpufreq_governor *__find_governor(const char *str_governor)
288{
289 struct cpufreq_governor *t;
290
291 list_for_each_entry(t, &cpufreq_governor_list, governor_list)
292 if (!strnicmp(str_governor,t->name,CPUFREQ_NAME_LEN))
293 return t;
294
295 return NULL;
296}
297
287/** 298/**
288 * cpufreq_parse_governor - parse a governor string 299 * cpufreq_parse_governor - parse a governor string
289 */ 300 */
290static int cpufreq_parse_governor (char *str_governor, unsigned int *policy, 301static int cpufreq_parse_governor (char *str_governor, unsigned int *policy,
291 struct cpufreq_governor **governor) 302 struct cpufreq_governor **governor)
292{ 303{
304 int err = -EINVAL;
305
293 if (!cpufreq_driver) 306 if (!cpufreq_driver)
294 return -EINVAL; 307 goto out;
308
295 if (cpufreq_driver->setpolicy) { 309 if (cpufreq_driver->setpolicy) {
296 if (!strnicmp(str_governor, "performance", CPUFREQ_NAME_LEN)) { 310 if (!strnicmp(str_governor, "performance", CPUFREQ_NAME_LEN)) {
297 *policy = CPUFREQ_POLICY_PERFORMANCE; 311 *policy = CPUFREQ_POLICY_PERFORMANCE;
298 return 0; 312 err = 0;
299 } else if (!strnicmp(str_governor, "powersave", CPUFREQ_NAME_LEN)) { 313 } else if (!strnicmp(str_governor, "powersave", CPUFREQ_NAME_LEN)) {
300 *policy = CPUFREQ_POLICY_POWERSAVE; 314 *policy = CPUFREQ_POLICY_POWERSAVE;
301 return 0; 315 err = 0;
302 } 316 }
303 return -EINVAL; 317 } else if (cpufreq_driver->target) {
304 } else {
305 struct cpufreq_governor *t; 318 struct cpufreq_governor *t;
319
306 mutex_lock(&cpufreq_governor_mutex); 320 mutex_lock(&cpufreq_governor_mutex);
307 if (!cpufreq_driver || !cpufreq_driver->target) 321
308 goto out; 322 t = __find_governor(str_governor);
309 list_for_each_entry(t, &cpufreq_governor_list, governor_list) { 323
310 if (!strnicmp(str_governor,t->name,CPUFREQ_NAME_LEN)) { 324 if (t == NULL) {
311 *governor = t; 325 char *name = kasprintf(GFP_KERNEL, "cpufreq_%s", str_governor);
326
327 if (name) {
328 int ret;
329
312 mutex_unlock(&cpufreq_governor_mutex); 330 mutex_unlock(&cpufreq_governor_mutex);
313 return 0; 331 ret = request_module(name);
332 mutex_lock(&cpufreq_governor_mutex);
333
334 if (ret == 0)
335 t = __find_governor(str_governor);
314 } 336 }
337
338 kfree(name);
315 } 339 }
316out: 340
341 if (t != NULL) {
342 *governor = t;
343 err = 0;
344 }
345
317 mutex_unlock(&cpufreq_governor_mutex); 346 mutex_unlock(&cpufreq_governor_mutex);
318 } 347 }
319 return -EINVAL; 348 out:
349 return err;
320} 350}
321 351
322 352
@@ -364,10 +394,12 @@ static ssize_t store_##file_name \
364 if (ret != 1) \ 394 if (ret != 1) \
365 return -EINVAL; \ 395 return -EINVAL; \
366 \ 396 \
397 lock_cpu_hotplug(); \
367 mutex_lock(&policy->lock); \ 398 mutex_lock(&policy->lock); \
368 ret = __cpufreq_set_policy(policy, &new_policy); \ 399 ret = __cpufreq_set_policy(policy, &new_policy); \
369 policy->user_policy.object = policy->object; \ 400 policy->user_policy.object = policy->object; \
370 mutex_unlock(&policy->lock); \ 401 mutex_unlock(&policy->lock); \
402 unlock_cpu_hotplug(); \
371 \ 403 \
372 return ret ? ret : count; \ 404 return ret ? ret : count; \
373} 405}
@@ -423,6 +455,8 @@ static ssize_t store_scaling_governor (struct cpufreq_policy * policy,
423 if (cpufreq_parse_governor(str_governor, &new_policy.policy, &new_policy.governor)) 455 if (cpufreq_parse_governor(str_governor, &new_policy.policy, &new_policy.governor))
424 return -EINVAL; 456 return -EINVAL;
425 457
458 lock_cpu_hotplug();
459
426 /* Do not use cpufreq_set_policy here or the user_policy.max 460 /* Do not use cpufreq_set_policy here or the user_policy.max
427 will be wrongly overridden */ 461 will be wrongly overridden */
428 mutex_lock(&policy->lock); 462 mutex_lock(&policy->lock);
@@ -432,6 +466,8 @@ static ssize_t store_scaling_governor (struct cpufreq_policy * policy,
432 policy->user_policy.governor = policy->governor; 466 policy->user_policy.governor = policy->governor;
433 mutex_unlock(&policy->lock); 467 mutex_unlock(&policy->lock);
434 468
469 unlock_cpu_hotplug();
470
435 return ret ? ret : count; 471 return ret ? ret : count;
436} 472}
437 473
@@ -1193,20 +1229,18 @@ EXPORT_SYMBOL(cpufreq_unregister_notifier);
1193 *********************************************************************/ 1229 *********************************************************************/
1194 1230
1195 1231
1232/* Must be called with lock_cpu_hotplug held */
1196int __cpufreq_driver_target(struct cpufreq_policy *policy, 1233int __cpufreq_driver_target(struct cpufreq_policy *policy,
1197 unsigned int target_freq, 1234 unsigned int target_freq,
1198 unsigned int relation) 1235 unsigned int relation)
1199{ 1236{
1200 int retval = -EINVAL; 1237 int retval = -EINVAL;
1201 1238
1202 lock_cpu_hotplug();
1203 dprintk("target for CPU %u: %u kHz, relation %u\n", policy->cpu, 1239 dprintk("target for CPU %u: %u kHz, relation %u\n", policy->cpu,
1204 target_freq, relation); 1240 target_freq, relation);
1205 if (cpu_online(policy->cpu) && cpufreq_driver->target) 1241 if (cpu_online(policy->cpu) && cpufreq_driver->target)
1206 retval = cpufreq_driver->target(policy, target_freq, relation); 1242 retval = cpufreq_driver->target(policy, target_freq, relation);
1207 1243
1208 unlock_cpu_hotplug();
1209
1210 return retval; 1244 return retval;
1211} 1245}
1212EXPORT_SYMBOL_GPL(__cpufreq_driver_target); 1246EXPORT_SYMBOL_GPL(__cpufreq_driver_target);
@@ -1221,17 +1255,23 @@ int cpufreq_driver_target(struct cpufreq_policy *policy,
1221 if (!policy) 1255 if (!policy)
1222 return -EINVAL; 1256 return -EINVAL;
1223 1257
1258 lock_cpu_hotplug();
1224 mutex_lock(&policy->lock); 1259 mutex_lock(&policy->lock);
1225 1260
1226 ret = __cpufreq_driver_target(policy, target_freq, relation); 1261 ret = __cpufreq_driver_target(policy, target_freq, relation);
1227 1262
1228 mutex_unlock(&policy->lock); 1263 mutex_unlock(&policy->lock);
1264 unlock_cpu_hotplug();
1229 1265
1230 cpufreq_cpu_put(policy); 1266 cpufreq_cpu_put(policy);
1231 return ret; 1267 return ret;
1232} 1268}
1233EXPORT_SYMBOL_GPL(cpufreq_driver_target); 1269EXPORT_SYMBOL_GPL(cpufreq_driver_target);
1234 1270
1271/*
1272 * Locking: Must be called with the lock_cpu_hotplug() lock held
1273 * when "event" is CPUFREQ_GOV_LIMITS
1274 */
1235 1275
1236static int __cpufreq_governor(struct cpufreq_policy *policy, unsigned int event) 1276static int __cpufreq_governor(struct cpufreq_policy *policy, unsigned int event)
1237{ 1277{
@@ -1253,43 +1293,23 @@ static int __cpufreq_governor(struct cpufreq_policy *policy, unsigned int event)
1253} 1293}
1254 1294
1255 1295
1256int cpufreq_governor(unsigned int cpu, unsigned int event)
1257{
1258 int ret = 0;
1259 struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
1260
1261 if (!policy)
1262 return -EINVAL;
1263
1264 mutex_lock(&policy->lock);
1265 ret = __cpufreq_governor(policy, event);
1266 mutex_unlock(&policy->lock);
1267
1268 cpufreq_cpu_put(policy);
1269 return ret;
1270}
1271EXPORT_SYMBOL_GPL(cpufreq_governor);
1272
1273
1274int cpufreq_register_governor(struct cpufreq_governor *governor) 1296int cpufreq_register_governor(struct cpufreq_governor *governor)
1275{ 1297{
1276 struct cpufreq_governor *t; 1298 int err;
1277 1299
1278 if (!governor) 1300 if (!governor)
1279 return -EINVAL; 1301 return -EINVAL;
1280 1302
1281 mutex_lock(&cpufreq_governor_mutex); 1303 mutex_lock(&cpufreq_governor_mutex);
1282 1304
1283 list_for_each_entry(t, &cpufreq_governor_list, governor_list) { 1305 err = -EBUSY;
1284 if (!strnicmp(governor->name,t->name,CPUFREQ_NAME_LEN)) { 1306 if (__find_governor(governor->name) == NULL) {
1285 mutex_unlock(&cpufreq_governor_mutex); 1307 err = 0;
1286 return -EBUSY; 1308 list_add(&governor->governor_list, &cpufreq_governor_list);
1287 }
1288 } 1309 }
1289 list_add(&governor->governor_list, &cpufreq_governor_list);
1290 1310
1291 mutex_unlock(&cpufreq_governor_mutex); 1311 mutex_unlock(&cpufreq_governor_mutex);
1292 return 0; 1312 return err;
1293} 1313}
1294EXPORT_SYMBOL_GPL(cpufreq_register_governor); 1314EXPORT_SYMBOL_GPL(cpufreq_register_governor);
1295 1315
@@ -1338,6 +1358,9 @@ int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu)
1338EXPORT_SYMBOL(cpufreq_get_policy); 1358EXPORT_SYMBOL(cpufreq_get_policy);
1339 1359
1340 1360
1361/*
1362 * Locking: Must be called with the lock_cpu_hotplug() lock held
1363 */
1341static int __cpufreq_set_policy(struct cpufreq_policy *data, struct cpufreq_policy *policy) 1364static int __cpufreq_set_policy(struct cpufreq_policy *data, struct cpufreq_policy *policy)
1342{ 1365{
1343 int ret = 0; 1366 int ret = 0;
@@ -1348,6 +1371,11 @@ static int __cpufreq_set_policy(struct cpufreq_policy *data, struct cpufreq_poli
1348 1371
1349 memcpy(&policy->cpuinfo, &data->cpuinfo, sizeof(struct cpufreq_cpuinfo)); 1372 memcpy(&policy->cpuinfo, &data->cpuinfo, sizeof(struct cpufreq_cpuinfo));
1350 1373
1374 if (policy->min > data->min && policy->min > policy->max) {
1375 ret = -EINVAL;
1376 goto error_out;
1377 }
1378
1351 /* verify the cpu speed can be set within this limit */ 1379 /* verify the cpu speed can be set within this limit */
1352 ret = cpufreq_driver->verify(policy); 1380 ret = cpufreq_driver->verify(policy);
1353 if (ret) 1381 if (ret)
@@ -1432,6 +1460,8 @@ int cpufreq_set_policy(struct cpufreq_policy *policy)
1432 if (!data) 1460 if (!data)
1433 return -EINVAL; 1461 return -EINVAL;
1434 1462
1463 lock_cpu_hotplug();
1464
1435 /* lock this CPU */ 1465 /* lock this CPU */
1436 mutex_lock(&data->lock); 1466 mutex_lock(&data->lock);
1437 1467
@@ -1442,6 +1472,8 @@ int cpufreq_set_policy(struct cpufreq_policy *policy)
1442 data->user_policy.governor = data->governor; 1472 data->user_policy.governor = data->governor;
1443 1473
1444 mutex_unlock(&data->lock); 1474 mutex_unlock(&data->lock);
1475
1476 unlock_cpu_hotplug();
1445 cpufreq_cpu_put(data); 1477 cpufreq_cpu_put(data);
1446 1478
1447 return ret; 1479 return ret;
@@ -1465,6 +1497,7 @@ int cpufreq_update_policy(unsigned int cpu)
1465 if (!data) 1497 if (!data)
1466 return -ENODEV; 1498 return -ENODEV;
1467 1499
1500 lock_cpu_hotplug();
1468 mutex_lock(&data->lock); 1501 mutex_lock(&data->lock);
1469 1502
1470 dprintk("updating policy for CPU %u\n", cpu); 1503 dprintk("updating policy for CPU %u\n", cpu);
@@ -1490,7 +1523,7 @@ int cpufreq_update_policy(unsigned int cpu)
1490 ret = __cpufreq_set_policy(data, &policy); 1523 ret = __cpufreq_set_policy(data, &policy);
1491 1524
1492 mutex_unlock(&data->lock); 1525 mutex_unlock(&data->lock);
1493 1526 unlock_cpu_hotplug();
1494 cpufreq_cpu_put(data); 1527 cpufreq_cpu_put(data);
1495 return ret; 1528 return ret;
1496} 1529}
diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c
index b3ebc8f01975..c4c578defabf 100644
--- a/drivers/cpufreq/cpufreq_conservative.c
+++ b/drivers/cpufreq/cpufreq_conservative.c
@@ -525,7 +525,6 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
525 break; 525 break;
526 526
527 case CPUFREQ_GOV_LIMITS: 527 case CPUFREQ_GOV_LIMITS:
528 lock_cpu_hotplug();
529 mutex_lock(&dbs_mutex); 528 mutex_lock(&dbs_mutex);
530 if (policy->max < this_dbs_info->cur_policy->cur) 529 if (policy->max < this_dbs_info->cur_policy->cur)
531 __cpufreq_driver_target( 530 __cpufreq_driver_target(
@@ -536,7 +535,6 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
536 this_dbs_info->cur_policy, 535 this_dbs_info->cur_policy,
537 policy->min, CPUFREQ_RELATION_L); 536 policy->min, CPUFREQ_RELATION_L);
538 mutex_unlock(&dbs_mutex); 537 mutex_unlock(&dbs_mutex);
539 unlock_cpu_hotplug();
540 break; 538 break;
541 } 539 }
542 return 0; 540 return 0;
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
index 87299924e735..52cf1f021825 100644
--- a/drivers/cpufreq/cpufreq_ondemand.c
+++ b/drivers/cpufreq/cpufreq_ondemand.c
@@ -239,6 +239,8 @@ static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info)
239 total_ticks = (unsigned int) cputime64_sub(cur_jiffies, 239 total_ticks = (unsigned int) cputime64_sub(cur_jiffies,
240 this_dbs_info->prev_cpu_wall); 240 this_dbs_info->prev_cpu_wall);
241 this_dbs_info->prev_cpu_wall = cur_jiffies; 241 this_dbs_info->prev_cpu_wall = cur_jiffies;
242 if (!total_ticks)
243 return;
242 /* 244 /*
243 * Every sampling_rate, we check, if current idle time is less 245 * Every sampling_rate, we check, if current idle time is less
244 * than 20% (default), then we try to increase frequency 246 * than 20% (default), then we try to increase frequency
@@ -304,7 +306,12 @@ static void do_dbs_timer(void *data)
304 unsigned int cpu = smp_processor_id(); 306 unsigned int cpu = smp_processor_id();
305 struct cpu_dbs_info_s *dbs_info = &per_cpu(cpu_dbs_info, cpu); 307 struct cpu_dbs_info_s *dbs_info = &per_cpu(cpu_dbs_info, cpu);
306 308
309 if (!dbs_info->enable)
310 return;
311
312 lock_cpu_hotplug();
307 dbs_check_cpu(dbs_info); 313 dbs_check_cpu(dbs_info);
314 unlock_cpu_hotplug();
308 queue_delayed_work_on(cpu, kondemand_wq, &dbs_info->work, 315 queue_delayed_work_on(cpu, kondemand_wq, &dbs_info->work,
309 usecs_to_jiffies(dbs_tuners_ins.sampling_rate)); 316 usecs_to_jiffies(dbs_tuners_ins.sampling_rate));
310} 317}
@@ -319,11 +326,11 @@ static inline void dbs_timer_init(unsigned int cpu)
319 return; 326 return;
320} 327}
321 328
322static inline void dbs_timer_exit(unsigned int cpu) 329static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info)
323{ 330{
324 struct cpu_dbs_info_s *dbs_info = &per_cpu(cpu_dbs_info, cpu); 331 dbs_info->enable = 0;
325 332 cancel_delayed_work(&dbs_info->work);
326 cancel_rearming_delayed_workqueue(kondemand_wq, &dbs_info->work); 333 flush_workqueue(kondemand_wq);
327} 334}
328 335
329static int cpufreq_governor_dbs(struct cpufreq_policy *policy, 336static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
@@ -396,8 +403,7 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
396 403
397 case CPUFREQ_GOV_STOP: 404 case CPUFREQ_GOV_STOP:
398 mutex_lock(&dbs_mutex); 405 mutex_lock(&dbs_mutex);
399 dbs_timer_exit(policy->cpu); 406 dbs_timer_exit(this_dbs_info);
400 this_dbs_info->enable = 0;
401 sysfs_remove_group(&policy->kobj, &dbs_attr_group); 407 sysfs_remove_group(&policy->kobj, &dbs_attr_group);
402 dbs_enable--; 408 dbs_enable--;
403 if (dbs_enable == 0) 409 if (dbs_enable == 0)
@@ -408,7 +414,6 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
408 break; 414 break;
409 415
410 case CPUFREQ_GOV_LIMITS: 416 case CPUFREQ_GOV_LIMITS:
411 lock_cpu_hotplug();
412 mutex_lock(&dbs_mutex); 417 mutex_lock(&dbs_mutex);
413 if (policy->max < this_dbs_info->cur_policy->cur) 418 if (policy->max < this_dbs_info->cur_policy->cur)
414 __cpufreq_driver_target(this_dbs_info->cur_policy, 419 __cpufreq_driver_target(this_dbs_info->cur_policy,
@@ -419,7 +424,6 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
419 policy->min, 424 policy->min,
420 CPUFREQ_RELATION_L); 425 CPUFREQ_RELATION_L);
421 mutex_unlock(&dbs_mutex); 426 mutex_unlock(&dbs_mutex);
422 unlock_cpu_hotplug();
423 break; 427 break;
424 } 428 }
425 return 0; 429 return 0;
diff --git a/drivers/cpufreq/cpufreq_userspace.c b/drivers/cpufreq/cpufreq_userspace.c
index 44ae5e5b94cf..a06c204589cd 100644
--- a/drivers/cpufreq/cpufreq_userspace.c
+++ b/drivers/cpufreq/cpufreq_userspace.c
@@ -18,6 +18,7 @@
18#include <linux/spinlock.h> 18#include <linux/spinlock.h>
19#include <linux/interrupt.h> 19#include <linux/interrupt.h>
20#include <linux/cpufreq.h> 20#include <linux/cpufreq.h>
21#include <linux/cpu.h>
21#include <linux/types.h> 22#include <linux/types.h>
22#include <linux/fs.h> 23#include <linux/fs.h>
23#include <linux/sysfs.h> 24#include <linux/sysfs.h>
@@ -70,6 +71,7 @@ static int cpufreq_set(unsigned int freq, struct cpufreq_policy *policy)
70 71
71 dprintk("cpufreq_set for cpu %u, freq %u kHz\n", policy->cpu, freq); 72 dprintk("cpufreq_set for cpu %u, freq %u kHz\n", policy->cpu, freq);
72 73
74 lock_cpu_hotplug();
73 mutex_lock(&userspace_mutex); 75 mutex_lock(&userspace_mutex);
74 if (!cpu_is_managed[policy->cpu]) 76 if (!cpu_is_managed[policy->cpu])
75 goto err; 77 goto err;
@@ -92,6 +94,7 @@ static int cpufreq_set(unsigned int freq, struct cpufreq_policy *policy)
92 94
93 err: 95 err:
94 mutex_unlock(&userspace_mutex); 96 mutex_unlock(&userspace_mutex);
97 unlock_cpu_hotplug();
95 return ret; 98 return ret;
96} 99}
97 100
diff --git a/drivers/crypto/padlock-aes.c b/drivers/crypto/padlock-aes.c
index 17ee684144f9..b643d71298a9 100644
--- a/drivers/crypto/padlock-aes.c
+++ b/drivers/crypto/padlock-aes.c
@@ -59,6 +59,9 @@
59#define AES_EXTENDED_KEY_SIZE 64 /* in uint32_t units */ 59#define AES_EXTENDED_KEY_SIZE 64 /* in uint32_t units */
60#define AES_EXTENDED_KEY_SIZE_B (AES_EXTENDED_KEY_SIZE * sizeof(uint32_t)) 60#define AES_EXTENDED_KEY_SIZE_B (AES_EXTENDED_KEY_SIZE * sizeof(uint32_t))
61 61
62/* Whenever making any changes to the following
63 * structure *make sure* you keep E, d_data
64 * and cword aligned on 16 Bytes boundaries!!! */
62struct aes_ctx { 65struct aes_ctx {
63 struct { 66 struct {
64 struct cword encrypt; 67 struct cword encrypt;
@@ -66,8 +69,10 @@ struct aes_ctx {
66 } cword; 69 } cword;
67 u32 *D; 70 u32 *D;
68 int key_length; 71 int key_length;
69 u32 E[AES_EXTENDED_KEY_SIZE]; 72 u32 E[AES_EXTENDED_KEY_SIZE]
70 u32 d_data[AES_EXTENDED_KEY_SIZE]; 73 __attribute__ ((__aligned__(PADLOCK_ALIGNMENT)));
74 u32 d_data[AES_EXTENDED_KEY_SIZE]
75 __attribute__ ((__aligned__(PADLOCK_ALIGNMENT)));
71}; 76};
72 77
73/* ====== Key management routines ====== */ 78/* ====== Key management routines ====== */
diff --git a/drivers/dma/ioatdma.c b/drivers/dma/ioatdma.c
index 78bf46d917b7..dbd4d6c3698e 100644
--- a/drivers/dma/ioatdma.c
+++ b/drivers/dma/ioatdma.c
@@ -828,7 +828,7 @@ static int __init ioat_init_module(void)
828 /* if forced, worst case is that rmmod hangs */ 828 /* if forced, worst case is that rmmod hangs */
829 __unsafe(THIS_MODULE); 829 __unsafe(THIS_MODULE);
830 830
831 return pci_module_init(&ioat_pci_drv); 831 return pci_register_driver(&ioat_pci_drv);
832} 832}
833 833
834module_init(ioat_init_module); 834module_init(ioat_init_module);
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
index 3a7cfe88b169..4bde30bb3be7 100644
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * edac_mc kernel module 2 * edac_mc kernel module
3 * (C) 2005 Linux Networx (http://lnxi.com) 3 * (C) 2005, 2006 Linux Networx (http://lnxi.com)
4 * This file may be distributed under the terms of the 4 * This file may be distributed under the terms of the
5 * GNU General Public License. 5 * GNU General Public License.
6 * 6 *
@@ -33,13 +33,8 @@
33#include <asm/edac.h> 33#include <asm/edac.h>
34#include "edac_mc.h" 34#include "edac_mc.h"
35 35
36#define EDAC_MC_VERSION "Ver: 2.0.0 " __DATE__ 36#define EDAC_MC_VERSION "Ver: 2.0.1 " __DATE__
37 37
38/* For now, disable the EDAC sysfs code. The sysfs interface that EDAC
39 * presents to user space needs more thought, and is likely to change
40 * substantially.
41 */
42#define DISABLE_EDAC_SYSFS
43 38
44#ifdef CONFIG_EDAC_DEBUG 39#ifdef CONFIG_EDAC_DEBUG
45/* Values of 0 to 4 will generate output */ 40/* Values of 0 to 4 will generate output */
@@ -64,31 +59,12 @@ static int check_pci_parity = 0; /* default YES check PCI parity */
64static int panic_on_pci_parity; /* default no panic on PCI Parity */ 59static int panic_on_pci_parity; /* default no panic on PCI Parity */
65static atomic_t pci_parity_count = ATOMIC_INIT(0); 60static atomic_t pci_parity_count = ATOMIC_INIT(0);
66 61
67/* Structure of the whitelist and blacklist arrays */
68struct edac_pci_device_list {
69 unsigned int vendor; /* Vendor ID */
70 unsigned int device; /* Deviice ID */
71};
72
73#define MAX_LISTED_PCI_DEVICES 32
74
75/* List of PCI devices (vendor-id:device-id) that should be skipped */
76static struct edac_pci_device_list pci_blacklist[MAX_LISTED_PCI_DEVICES];
77static int pci_blacklist_count;
78
79/* List of PCI devices (vendor-id:device-id) that should be scanned */
80static struct edac_pci_device_list pci_whitelist[MAX_LISTED_PCI_DEVICES];
81static int pci_whitelist_count ;
82
83#ifndef DISABLE_EDAC_SYSFS
84static struct kobject edac_pci_kobj; /* /sys/devices/system/edac/pci */ 62static struct kobject edac_pci_kobj; /* /sys/devices/system/edac/pci */
85static struct completion edac_pci_kobj_complete; 63static struct completion edac_pci_kobj_complete;
86#endif /* DISABLE_EDAC_SYSFS */
87#endif /* CONFIG_PCI */ 64#endif /* CONFIG_PCI */
88 65
89/* START sysfs data and methods */ 66/* START sysfs data and methods */
90 67
91#ifndef DISABLE_EDAC_SYSFS
92 68
93static const char *mem_types[] = { 69static const char *mem_types[] = {
94 [MEM_EMPTY] = "Empty", 70 [MEM_EMPTY] = "Empty",
@@ -147,18 +123,10 @@ static struct completion edac_memctrl_kobj_complete;
147 * /sys/devices/system/edac/mc; 123 * /sys/devices/system/edac/mc;
148 * data structures and methods 124 * data structures and methods
149 */ 125 */
150#if 0
151static ssize_t memctrl_string_show(void *ptr, char *buffer)
152{
153 char *value = (char*) ptr;
154 return sprintf(buffer, "%s\n", value);
155}
156#endif
157
158static ssize_t memctrl_int_show(void *ptr, char *buffer) 126static ssize_t memctrl_int_show(void *ptr, char *buffer)
159{ 127{
160 int *value = (int*) ptr; 128 int *value = (int*) ptr;
161 return sprintf(buffer, "%d\n", *value); 129 return sprintf(buffer, "%u\n", *value);
162} 130}
163 131
164static ssize_t memctrl_int_store(void *ptr, const char *buffer, size_t count) 132static ssize_t memctrl_int_store(void *ptr, const char *buffer, size_t count)
@@ -224,11 +192,6 @@ struct memctrl_dev_attribute attr_##_name = { \
224 .store = _store, \ 192 .store = _store, \
225}; 193};
226 194
227/* cwrow<id> attribute f*/
228#if 0
229MEMCTRL_STRING_ATTR(mc_version,EDAC_MC_VERSION,S_IRUGO,memctrl_string_show,NULL);
230#endif
231
232/* csrow<id> control files */ 195/* csrow<id> control files */
233MEMCTRL_ATTR(panic_on_ue,S_IRUGO|S_IWUSR,memctrl_int_show,memctrl_int_store); 196MEMCTRL_ATTR(panic_on_ue,S_IRUGO|S_IWUSR,memctrl_int_show,memctrl_int_store);
234MEMCTRL_ATTR(log_ue,S_IRUGO|S_IWUSR,memctrl_int_show,memctrl_int_store); 197MEMCTRL_ATTR(log_ue,S_IRUGO|S_IWUSR,memctrl_int_show,memctrl_int_store);
@@ -257,8 +220,6 @@ static struct kobj_type ktype_memctrl = {
257 .default_attrs = (struct attribute **) memctrl_attr, 220 .default_attrs = (struct attribute **) memctrl_attr,
258}; 221};
259 222
260#endif /* DISABLE_EDAC_SYSFS */
261
262/* Initialize the main sysfs entries for edac: 223/* Initialize the main sysfs entries for edac:
263 * /sys/devices/system/edac 224 * /sys/devices/system/edac
264 * 225 *
@@ -268,11 +229,6 @@ static struct kobj_type ktype_memctrl = {
268 * !0 FAILURE 229 * !0 FAILURE
269 */ 230 */
270static int edac_sysfs_memctrl_setup(void) 231static int edac_sysfs_memctrl_setup(void)
271#ifdef DISABLE_EDAC_SYSFS
272{
273 return 0;
274}
275#else
276{ 232{
277 int err=0; 233 int err=0;
278 234
@@ -304,7 +260,6 @@ static int edac_sysfs_memctrl_setup(void)
304 260
305 return err; 261 return err;
306} 262}
307#endif /* DISABLE_EDAC_SYSFS */
308 263
309/* 264/*
310 * MC teardown: 265 * MC teardown:
@@ -312,7 +267,6 @@ static int edac_sysfs_memctrl_setup(void)
312 */ 267 */
313static void edac_sysfs_memctrl_teardown(void) 268static void edac_sysfs_memctrl_teardown(void)
314{ 269{
315#ifndef DISABLE_EDAC_SYSFS
316 debugf0("MC: " __FILE__ ": %s()\n", __func__); 270 debugf0("MC: " __FILE__ ": %s()\n", __func__);
317 271
318 /* Unregister the MC's kobject and wait for reference count to reach 272 /* Unregister the MC's kobject and wait for reference count to reach
@@ -324,144 +278,9 @@ static void edac_sysfs_memctrl_teardown(void)
324 278
325 /* Unregister the 'edac' object */ 279 /* Unregister the 'edac' object */
326 sysdev_class_unregister(&edac_class); 280 sysdev_class_unregister(&edac_class);
327#endif /* DISABLE_EDAC_SYSFS */
328} 281}
329 282
330#ifdef CONFIG_PCI 283#ifdef CONFIG_PCI
331
332#ifndef DISABLE_EDAC_SYSFS
333
334/*
335 * /sys/devices/system/edac/pci;
336 * data structures and methods
337 */
338
339struct list_control {
340 struct edac_pci_device_list *list;
341 int *count;
342};
343
344#if 0
345/* Output the list as: vendor_id:device:id<,vendor_id:device_id> */
346static ssize_t edac_pci_list_string_show(void *ptr, char *buffer)
347{
348 struct list_control *listctl;
349 struct edac_pci_device_list *list;
350 char *p = buffer;
351 int len=0;
352 int i;
353
354 listctl = ptr;
355 list = listctl->list;
356
357 for (i = 0; i < *(listctl->count); i++, list++ ) {
358 if (len > 0)
359 len += snprintf(p + len, (PAGE_SIZE-len), ",");
360
361 len += snprintf(p + len,
362 (PAGE_SIZE-len),
363 "%x:%x",
364 list->vendor,list->device);
365 }
366
367 len += snprintf(p + len,(PAGE_SIZE-len), "\n");
368 return (ssize_t) len;
369}
370
371/**
372 *
373 * Scan string from **s to **e looking for one 'vendor:device' tuple
374 * where each field is a hex value
375 *
376 * return 0 if an entry is NOT found
377 * return 1 if an entry is found
378 * fill in *vendor_id and *device_id with values found
379 *
380 * In both cases, make sure *s has been moved forward toward *e
381 */
382static int parse_one_device(const char **s,const char **e,
383 unsigned int *vendor_id, unsigned int *device_id)
384{
385 const char *runner, *p;
386
387 /* if null byte, we are done */
388 if (!**s) {
389 (*s)++; /* keep *s moving */
390 return 0;
391 }
392
393 /* skip over newlines & whitespace */
394 if ((**s == '\n') || isspace(**s)) {
395 (*s)++;
396 return 0;
397 }
398
399 if (!isxdigit(**s)) {
400 (*s)++;
401 return 0;
402 }
403
404 /* parse vendor_id */
405 runner = *s;
406
407 while (runner < *e) {
408 /* scan for vendor:device delimiter */
409 if (*runner == ':') {
410 *vendor_id = simple_strtol((char*) *s, (char**) &p, 16);
411 runner = p + 1;
412 break;
413 }
414
415 runner++;
416 }
417
418 if (!isxdigit(*runner)) {
419 *s = ++runner;
420 return 0;
421 }
422
423 /* parse device_id */
424 if (runner < *e) {
425 *device_id = simple_strtol((char*)runner, (char**)&p, 16);
426 runner = p;
427 }
428
429 *s = runner;
430 return 1;
431}
432
433static ssize_t edac_pci_list_string_store(void *ptr, const char *buffer,
434 size_t count)
435{
436 struct list_control *listctl;
437 struct edac_pci_device_list *list;
438 unsigned int vendor_id, device_id;
439 const char *s, *e;
440 int *index;
441
442 s = (char*)buffer;
443 e = s + count;
444 listctl = ptr;
445 list = listctl->list;
446 index = listctl->count;
447 *index = 0;
448
449 while (*index < MAX_LISTED_PCI_DEVICES) {
450 if (parse_one_device(&s,&e,&vendor_id,&device_id)) {
451 list[ *index ].vendor = vendor_id;
452 list[ *index ].device = device_id;
453 (*index)++;
454 }
455
456 /* check for all data consume */
457 if (s >= e)
458 break;
459 }
460
461 return count;
462}
463
464#endif
465static ssize_t edac_pci_int_show(void *ptr, char *buffer) 284static ssize_t edac_pci_int_show(void *ptr, char *buffer)
466{ 285{
467 int *value = ptr; 286 int *value = ptr;
@@ -529,31 +348,6 @@ struct edac_pci_dev_attribute edac_pci_attr_##_name = { \
529 .store = _store, \ 348 .store = _store, \
530}; 349};
531 350
532#if 0
533static struct list_control pci_whitelist_control = {
534 .list = pci_whitelist,
535 .count = &pci_whitelist_count
536};
537
538static struct list_control pci_blacklist_control = {
539 .list = pci_blacklist,
540 .count = &pci_blacklist_count
541};
542
543/* whitelist attribute */
544EDAC_PCI_STRING_ATTR(pci_parity_whitelist,
545 &pci_whitelist_control,
546 S_IRUGO|S_IWUSR,
547 edac_pci_list_string_show,
548 edac_pci_list_string_store);
549
550EDAC_PCI_STRING_ATTR(pci_parity_blacklist,
551 &pci_blacklist_control,
552 S_IRUGO|S_IWUSR,
553 edac_pci_list_string_show,
554 edac_pci_list_string_store);
555#endif
556
557/* PCI Parity control files */ 351/* PCI Parity control files */
558EDAC_PCI_ATTR(check_pci_parity, S_IRUGO|S_IWUSR, edac_pci_int_show, 352EDAC_PCI_ATTR(check_pci_parity, S_IRUGO|S_IWUSR, edac_pci_int_show,
559 edac_pci_int_store); 353 edac_pci_int_store);
@@ -582,18 +376,11 @@ static struct kobj_type ktype_edac_pci = {
582 .default_attrs = (struct attribute **) edac_pci_attr, 376 .default_attrs = (struct attribute **) edac_pci_attr,
583}; 377};
584 378
585#endif /* DISABLE_EDAC_SYSFS */
586
587/** 379/**
588 * edac_sysfs_pci_setup() 380 * edac_sysfs_pci_setup()
589 * 381 *
590 */ 382 */
591static int edac_sysfs_pci_setup(void) 383static int edac_sysfs_pci_setup(void)
592#ifdef DISABLE_EDAC_SYSFS
593{
594 return 0;
595}
596#else
597{ 384{
598 int err; 385 int err;
599 386
@@ -617,16 +404,13 @@ static int edac_sysfs_pci_setup(void)
617 404
618 return err; 405 return err;
619} 406}
620#endif /* DISABLE_EDAC_SYSFS */
621 407
622static void edac_sysfs_pci_teardown(void) 408static void edac_sysfs_pci_teardown(void)
623{ 409{
624#ifndef DISABLE_EDAC_SYSFS
625 debugf0("%s()\n", __func__); 410 debugf0("%s()\n", __func__);
626 init_completion(&edac_pci_kobj_complete); 411 init_completion(&edac_pci_kobj_complete);
627 kobject_unregister(&edac_pci_kobj); 412 kobject_unregister(&edac_pci_kobj);
628 wait_for_completion(&edac_pci_kobj_complete); 413 wait_for_completion(&edac_pci_kobj_complete);
629#endif
630} 414}
631 415
632 416
@@ -756,36 +540,6 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
756} 540}
757 541
758/* 542/*
759 * check_dev_on_list: Scan for a PCI device on a white/black list
760 * @list: an EDAC &edac_pci_device_list white/black list pointer
761 * @free_index: index of next free entry on the list
762 * @pci_dev: PCI Device pointer
763 *
764 * see if list contains the device.
765 *
766 * Returns: 0 not found
767 * 1 found on list
768 */
769static int check_dev_on_list(struct edac_pci_device_list *list,
770 int free_index, struct pci_dev *dev)
771{
772 int i;
773 int rc = 0; /* Assume not found */
774 unsigned short vendor=dev->vendor;
775 unsigned short device=dev->device;
776
777 /* Scan the list, looking for a vendor/device match */
778 for (i = 0; i < free_index; i++, list++ ) {
779 if ((list->vendor == vendor ) && (list->device == device )) {
780 rc = 1;
781 break;
782 }
783 }
784
785 return rc;
786}
787
788/*
789 * pci_dev parity list iterator 543 * pci_dev parity list iterator
790 * Scan the PCI device list for one iteration, looking for SERRORs 544 * Scan the PCI device list for one iteration, looking for SERRORs
791 * Master Parity ERRORS or Parity ERRORs on primary or secondary devices 545 * Master Parity ERRORS or Parity ERRORs on primary or secondary devices
@@ -799,22 +553,7 @@ static inline void edac_pci_dev_parity_iterator(pci_parity_check_fn_t fn)
799 * bumped until we are done with it 553 * bumped until we are done with it
800 */ 554 */
801 while((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { 555 while((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
802 /* if whitelist exists then it has priority, so only scan 556 fn(dev);
803 * those devices on the whitelist
804 */
805 if (pci_whitelist_count > 0 ) {
806 if (check_dev_on_list(pci_whitelist,
807 pci_whitelist_count, dev))
808 fn(dev);
809 } else {
810 /*
811 * if no whitelist, then check if this devices is
812 * blacklisted
813 */
814 if (!check_dev_on_list(pci_blacklist,
815 pci_blacklist_count, dev))
816 fn(dev);
817 }
818 } 557 }
819} 558}
820 559
@@ -855,154 +594,101 @@ static inline void clear_pci_parity_errors(void)
855 594
856#else /* CONFIG_PCI */ 595#else /* CONFIG_PCI */
857 596
858static inline void do_pci_parity_check(void) 597/* pre-process these away */
859{ 598#define do_pci_parity_check()
860 /* no-op */ 599#define clear_pci_parity_errors()
861} 600#define edac_sysfs_pci_teardown()
862 601#define edac_sysfs_pci_setup() (0)
863static inline void clear_pci_parity_errors(void)
864{
865 /* no-op */
866}
867
868static void edac_sysfs_pci_teardown(void)
869{
870}
871 602
872static int edac_sysfs_pci_setup(void)
873{
874 return 0;
875}
876#endif /* CONFIG_PCI */ 603#endif /* CONFIG_PCI */
877 604
878#ifndef DISABLE_EDAC_SYSFS 605/* EDAC sysfs CSROW data structures and methods
879 606 */
880/* EDAC sysfs CSROW data structures and methods */
881
882/* Set of more detailed csrow<id> attribute show/store functions */
883static ssize_t csrow_ch0_dimm_label_show(struct csrow_info *csrow, char *data)
884{
885 ssize_t size = 0;
886
887 if (csrow->nr_channels > 0) {
888 size = snprintf(data, EDAC_MC_LABEL_LEN,"%s\n",
889 csrow->channels[0].label);
890 }
891
892 return size;
893}
894 607
895static ssize_t csrow_ch1_dimm_label_show(struct csrow_info *csrow, char *data) 608/* Set of more default csrow<id> attribute show/store functions */
609static ssize_t csrow_ue_count_show(struct csrow_info *csrow, char *data, int private)
896{ 610{
897 ssize_t size = 0; 611 return sprintf(data,"%u\n", csrow->ue_count);
898
899 if (csrow->nr_channels > 0) {
900 size = snprintf(data, EDAC_MC_LABEL_LEN, "%s\n",
901 csrow->channels[1].label);
902 }
903
904 return size;
905} 612}
906 613
907static ssize_t csrow_ch0_dimm_label_store(struct csrow_info *csrow, 614static ssize_t csrow_ce_count_show(struct csrow_info *csrow, char *data, int private)
908 const char *data, size_t size)
909{ 615{
910 ssize_t max_size = 0; 616 return sprintf(data,"%u\n", csrow->ce_count);
911
912 if (csrow->nr_channels > 0) {
913 max_size = min((ssize_t)size,(ssize_t)EDAC_MC_LABEL_LEN-1);
914 strncpy(csrow->channels[0].label, data, max_size);
915 csrow->channels[0].label[max_size] = '\0';
916 }
917
918 return size;
919} 617}
920 618
921static ssize_t csrow_ch1_dimm_label_store(struct csrow_info *csrow, 619static ssize_t csrow_size_show(struct csrow_info *csrow, char *data, int private)
922 const char *data, size_t size)
923{ 620{
924 ssize_t max_size = 0; 621 return sprintf(data,"%u\n", PAGES_TO_MiB(csrow->nr_pages));
925
926 if (csrow->nr_channels > 1) {
927 max_size = min((ssize_t)size,(ssize_t)EDAC_MC_LABEL_LEN-1);
928 strncpy(csrow->channels[1].label, data, max_size);
929 csrow->channels[1].label[max_size] = '\0';
930 }
931
932 return max_size;
933} 622}
934 623
935static ssize_t csrow_ue_count_show(struct csrow_info *csrow, char *data) 624static ssize_t csrow_mem_type_show(struct csrow_info *csrow, char *data, int private)
936{ 625{
937 return sprintf(data,"%u\n", csrow->ue_count); 626 return sprintf(data,"%s\n", mem_types[csrow->mtype]);
938} 627}
939 628
940static ssize_t csrow_ce_count_show(struct csrow_info *csrow, char *data) 629static ssize_t csrow_dev_type_show(struct csrow_info *csrow, char *data, int private)
941{ 630{
942 return sprintf(data,"%u\n", csrow->ce_count); 631 return sprintf(data,"%s\n", dev_types[csrow->dtype]);
943} 632}
944 633
945static ssize_t csrow_ch0_ce_count_show(struct csrow_info *csrow, char *data) 634static ssize_t csrow_edac_mode_show(struct csrow_info *csrow, char *data, int private)
946{ 635{
947 ssize_t size = 0; 636 return sprintf(data,"%s\n", edac_caps[csrow->edac_mode]);
948
949 if (csrow->nr_channels > 0) {
950 size = sprintf(data,"%u\n", csrow->channels[0].ce_count);
951 }
952
953 return size;
954} 637}
955 638
956static ssize_t csrow_ch1_ce_count_show(struct csrow_info *csrow, char *data) 639/* show/store functions for DIMM Label attributes */
640static ssize_t channel_dimm_label_show(struct csrow_info *csrow,
641 char *data, int channel)
957{ 642{
958 ssize_t size = 0; 643 return snprintf(data, EDAC_MC_LABEL_LEN,"%s",
959 644 csrow->channels[channel].label);
960 if (csrow->nr_channels > 1) {
961 size = sprintf(data,"%u\n", csrow->channels[1].ce_count);
962 }
963
964 return size;
965} 645}
966 646
967static ssize_t csrow_size_show(struct csrow_info *csrow, char *data) 647static ssize_t channel_dimm_label_store(struct csrow_info *csrow,
648 const char *data,
649 size_t count,
650 int channel)
968{ 651{
969 return sprintf(data,"%u\n", PAGES_TO_MiB(csrow->nr_pages)); 652 ssize_t max_size = 0;
970}
971 653
972static ssize_t csrow_mem_type_show(struct csrow_info *csrow, char *data) 654 max_size = min((ssize_t)count,(ssize_t)EDAC_MC_LABEL_LEN-1);
973{ 655 strncpy(csrow->channels[channel].label, data, max_size);
974 return sprintf(data,"%s\n", mem_types[csrow->mtype]); 656 csrow->channels[channel].label[max_size] = '\0';
975}
976 657
977static ssize_t csrow_dev_type_show(struct csrow_info *csrow, char *data) 658 return max_size;
978{
979 return sprintf(data,"%s\n", dev_types[csrow->dtype]);
980} 659}
981 660
982static ssize_t csrow_edac_mode_show(struct csrow_info *csrow, char *data) 661/* show function for dynamic chX_ce_count attribute */
662static ssize_t channel_ce_count_show(struct csrow_info *csrow,
663 char *data,
664 int channel)
983{ 665{
984 return sprintf(data,"%s\n", edac_caps[csrow->edac_mode]); 666 return sprintf(data, "%u\n", csrow->channels[channel].ce_count);
985} 667}
986 668
669/* csrow specific attribute structure */
987struct csrowdev_attribute { 670struct csrowdev_attribute {
988 struct attribute attr; 671 struct attribute attr;
989 ssize_t (*show)(struct csrow_info *,char *); 672 ssize_t (*show)(struct csrow_info *,char *,int);
990 ssize_t (*store)(struct csrow_info *, const char *,size_t); 673 ssize_t (*store)(struct csrow_info *, const char *,size_t,int);
674 int private;
991}; 675};
992 676
993#define to_csrow(k) container_of(k, struct csrow_info, kobj) 677#define to_csrow(k) container_of(k, struct csrow_info, kobj)
994#define to_csrowdev_attr(a) container_of(a, struct csrowdev_attribute, attr) 678#define to_csrowdev_attr(a) container_of(a, struct csrowdev_attribute, attr)
995 679
996/* Set of show/store higher level functions for csrow objects */ 680/* Set of show/store higher level functions for default csrow attributes */
997static ssize_t csrowdev_show(struct kobject *kobj, struct attribute *attr, 681static ssize_t csrowdev_show(struct kobject *kobj,
998 char *buffer) 682 struct attribute *attr,
683 char *buffer)
999{ 684{
1000 struct csrow_info *csrow = to_csrow(kobj); 685 struct csrow_info *csrow = to_csrow(kobj);
1001 struct csrowdev_attribute *csrowdev_attr = to_csrowdev_attr(attr); 686 struct csrowdev_attribute *csrowdev_attr = to_csrowdev_attr(attr);
1002 687
1003 if (csrowdev_attr->show) 688 if (csrowdev_attr->show)
1004 return csrowdev_attr->show(csrow, buffer); 689 return csrowdev_attr->show(csrow,
1005 690 buffer,
691 csrowdev_attr->private);
1006 return -EIO; 692 return -EIO;
1007} 693}
1008 694
@@ -1013,8 +699,10 @@ static ssize_t csrowdev_store(struct kobject *kobj, struct attribute *attr,
1013 struct csrowdev_attribute * csrowdev_attr = to_csrowdev_attr(attr); 699 struct csrowdev_attribute * csrowdev_attr = to_csrowdev_attr(attr);
1014 700
1015 if (csrowdev_attr->store) 701 if (csrowdev_attr->store)
1016 return csrowdev_attr->store(csrow, buffer, count); 702 return csrowdev_attr->store(csrow,
1017 703 buffer,
704 count,
705 csrowdev_attr->private);
1018 return -EIO; 706 return -EIO;
1019} 707}
1020 708
@@ -1023,69 +711,157 @@ static struct sysfs_ops csrowfs_ops = {
1023 .store = csrowdev_store 711 .store = csrowdev_store
1024}; 712};
1025 713
1026#define CSROWDEV_ATTR(_name,_mode,_show,_store) \ 714#define CSROWDEV_ATTR(_name,_mode,_show,_store,_private) \
1027struct csrowdev_attribute attr_##_name = { \ 715struct csrowdev_attribute attr_##_name = { \
1028 .attr = {.name = __stringify(_name), .mode = _mode }, \ 716 .attr = {.name = __stringify(_name), .mode = _mode }, \
1029 .show = _show, \ 717 .show = _show, \
1030 .store = _store, \ 718 .store = _store, \
719 .private = _private, \
1031}; 720};
1032 721
1033/* cwrow<id>/attribute files */ 722/* default cwrow<id>/attribute files */
1034CSROWDEV_ATTR(size_mb,S_IRUGO,csrow_size_show,NULL); 723CSROWDEV_ATTR(size_mb,S_IRUGO,csrow_size_show,NULL,0);
1035CSROWDEV_ATTR(dev_type,S_IRUGO,csrow_dev_type_show,NULL); 724CSROWDEV_ATTR(dev_type,S_IRUGO,csrow_dev_type_show,NULL,0);
1036CSROWDEV_ATTR(mem_type,S_IRUGO,csrow_mem_type_show,NULL); 725CSROWDEV_ATTR(mem_type,S_IRUGO,csrow_mem_type_show,NULL,0);
1037CSROWDEV_ATTR(edac_mode,S_IRUGO,csrow_edac_mode_show,NULL); 726CSROWDEV_ATTR(edac_mode,S_IRUGO,csrow_edac_mode_show,NULL,0);
1038CSROWDEV_ATTR(ue_count,S_IRUGO,csrow_ue_count_show,NULL); 727CSROWDEV_ATTR(ue_count,S_IRUGO,csrow_ue_count_show,NULL,0);
1039CSROWDEV_ATTR(ce_count,S_IRUGO,csrow_ce_count_show,NULL); 728CSROWDEV_ATTR(ce_count,S_IRUGO,csrow_ce_count_show,NULL,0);
1040CSROWDEV_ATTR(ch0_ce_count,S_IRUGO,csrow_ch0_ce_count_show,NULL);
1041CSROWDEV_ATTR(ch1_ce_count,S_IRUGO,csrow_ch1_ce_count_show,NULL);
1042
1043/* control/attribute files */
1044CSROWDEV_ATTR(ch0_dimm_label,S_IRUGO|S_IWUSR,
1045 csrow_ch0_dimm_label_show,
1046 csrow_ch0_dimm_label_store);
1047CSROWDEV_ATTR(ch1_dimm_label,S_IRUGO|S_IWUSR,
1048 csrow_ch1_dimm_label_show,
1049 csrow_ch1_dimm_label_store);
1050 729
1051/* Attributes of the CSROW<id> object */ 730/* default attributes of the CSROW<id> object */
1052static struct csrowdev_attribute *csrow_attr[] = { 731static struct csrowdev_attribute *default_csrow_attr[] = {
1053 &attr_dev_type, 732 &attr_dev_type,
1054 &attr_mem_type, 733 &attr_mem_type,
1055 &attr_edac_mode, 734 &attr_edac_mode,
1056 &attr_size_mb, 735 &attr_size_mb,
1057 &attr_ue_count, 736 &attr_ue_count,
1058 &attr_ce_count, 737 &attr_ce_count,
1059 &attr_ch0_ce_count,
1060 &attr_ch1_ce_count,
1061 &attr_ch0_dimm_label,
1062 &attr_ch1_dimm_label,
1063 NULL, 738 NULL,
1064}; 739};
1065 740
1066/* No memory to release */ 741
742/* possible dynamic channel DIMM Label attribute files */
743CSROWDEV_ATTR(ch0_dimm_label,S_IRUGO|S_IWUSR,
744 channel_dimm_label_show,
745 channel_dimm_label_store,
746 0 );
747CSROWDEV_ATTR(ch1_dimm_label,S_IRUGO|S_IWUSR,
748 channel_dimm_label_show,
749 channel_dimm_label_store,
750 1 );
751CSROWDEV_ATTR(ch2_dimm_label,S_IRUGO|S_IWUSR,
752 channel_dimm_label_show,
753 channel_dimm_label_store,
754 2 );
755CSROWDEV_ATTR(ch3_dimm_label,S_IRUGO|S_IWUSR,
756 channel_dimm_label_show,
757 channel_dimm_label_store,
758 3 );
759CSROWDEV_ATTR(ch4_dimm_label,S_IRUGO|S_IWUSR,
760 channel_dimm_label_show,
761 channel_dimm_label_store,
762 4 );
763CSROWDEV_ATTR(ch5_dimm_label,S_IRUGO|S_IWUSR,
764 channel_dimm_label_show,
765 channel_dimm_label_store,
766 5 );
767
768/* Total possible dynamic DIMM Label attribute file table */
769static struct csrowdev_attribute *dynamic_csrow_dimm_attr[] = {
770 &attr_ch0_dimm_label,
771 &attr_ch1_dimm_label,
772 &attr_ch2_dimm_label,
773 &attr_ch3_dimm_label,
774 &attr_ch4_dimm_label,
775 &attr_ch5_dimm_label
776};
777
778/* possible dynamic channel ce_count attribute files */
779CSROWDEV_ATTR(ch0_ce_count,S_IRUGO|S_IWUSR,
780 channel_ce_count_show,
781 NULL,
782 0 );
783CSROWDEV_ATTR(ch1_ce_count,S_IRUGO|S_IWUSR,
784 channel_ce_count_show,
785 NULL,
786 1 );
787CSROWDEV_ATTR(ch2_ce_count,S_IRUGO|S_IWUSR,
788 channel_ce_count_show,
789 NULL,
790 2 );
791CSROWDEV_ATTR(ch3_ce_count,S_IRUGO|S_IWUSR,
792 channel_ce_count_show,
793 NULL,
794 3 );
795CSROWDEV_ATTR(ch4_ce_count,S_IRUGO|S_IWUSR,
796 channel_ce_count_show,
797 NULL,
798 4 );
799CSROWDEV_ATTR(ch5_ce_count,S_IRUGO|S_IWUSR,
800 channel_ce_count_show,
801 NULL,
802 5 );
803
804/* Total possible dynamic ce_count attribute file table */
805static struct csrowdev_attribute *dynamic_csrow_ce_count_attr[] = {
806 &attr_ch0_ce_count,
807 &attr_ch1_ce_count,
808 &attr_ch2_ce_count,
809 &attr_ch3_ce_count,
810 &attr_ch4_ce_count,
811 &attr_ch5_ce_count
812};
813
814
815#define EDAC_NR_CHANNELS 6
816
817/* Create dynamic CHANNEL files, indexed by 'chan', under specifed CSROW */
818static int edac_create_channel_files(struct kobject *kobj, int chan)
819{
820 int err=-ENODEV;
821
822 if (chan >= EDAC_NR_CHANNELS)
823 return err;
824
825 /* create the DIMM label attribute file */
826 err = sysfs_create_file(kobj,
827 (struct attribute *) dynamic_csrow_dimm_attr[chan]);
828
829 if (!err) {
830 /* create the CE Count attribute file */
831 err = sysfs_create_file(kobj,
832 (struct attribute *) dynamic_csrow_ce_count_attr[chan]);
833 } else {
834 debugf1("%s() dimm labels and ce_count files created", __func__);
835 }
836
837 return err;
838}
839
840/* No memory to release for this kobj */
1067static void edac_csrow_instance_release(struct kobject *kobj) 841static void edac_csrow_instance_release(struct kobject *kobj)
1068{ 842{
1069 struct csrow_info *cs; 843 struct csrow_info *cs;
1070 844
1071 debugf1("%s()\n", __func__);
1072 cs = container_of(kobj, struct csrow_info, kobj); 845 cs = container_of(kobj, struct csrow_info, kobj);
1073 complete(&cs->kobj_complete); 846 complete(&cs->kobj_complete);
1074} 847}
1075 848
849/* the kobj_type instance for a CSROW */
1076static struct kobj_type ktype_csrow = { 850static struct kobj_type ktype_csrow = {
1077 .release = edac_csrow_instance_release, 851 .release = edac_csrow_instance_release,
1078 .sysfs_ops = &csrowfs_ops, 852 .sysfs_ops = &csrowfs_ops,
1079 .default_attrs = (struct attribute **) csrow_attr, 853 .default_attrs = (struct attribute **) default_csrow_attr,
1080}; 854};
1081 855
1082/* Create a CSROW object under specifed edac_mc_device */ 856/* Create a CSROW object under specifed edac_mc_device */
1083static int edac_create_csrow_object(struct kobject *edac_mci_kobj, 857static int edac_create_csrow_object(
1084 struct csrow_info *csrow, int index) 858 struct kobject *edac_mci_kobj,
859 struct csrow_info *csrow,
860 int index)
1085{ 861{
1086 int err = 0; 862 int err = 0;
863 int chan;
1087 864
1088 debugf0("%s()\n", __func__);
1089 memset(&csrow->kobj, 0, sizeof(csrow->kobj)); 865 memset(&csrow->kobj, 0, sizeof(csrow->kobj));
1090 866
1091 /* generate ..../edac/mc/mc<id>/csrow<index> */ 867 /* generate ..../edac/mc/mc<id>/csrow<index> */
@@ -1095,21 +871,27 @@ static int edac_create_csrow_object(struct kobject *edac_mci_kobj,
1095 871
1096 /* name this instance of csrow<id> */ 872 /* name this instance of csrow<id> */
1097 err = kobject_set_name(&csrow->kobj,"csrow%d",index); 873 err = kobject_set_name(&csrow->kobj,"csrow%d",index);
874 if (err)
875 goto error_exit;
1098 876
877 /* Instanstiate the csrow object */
878 err = kobject_register(&csrow->kobj);
1099 if (!err) { 879 if (!err) {
1100 /* Instanstiate the csrow object */ 880 /* Create the dyanmic attribute files on this csrow,
1101 err = kobject_register(&csrow->kobj); 881 * namely, the DIMM labels and the channel ce_count
1102 882 */
1103 if (err) 883 for (chan = 0; chan < csrow->nr_channels; chan++) {
1104 debugf0("Failed to register CSROW%d\n",index); 884 err = edac_create_channel_files(&csrow->kobj,chan);
1105 else 885 if (err)
1106 debugf0("Registered CSROW%d\n",index); 886 break;
887 }
1107 } 888 }
1108 889
890error_exit:
1109 return err; 891 return err;
1110} 892}
1111 893
1112/* sysfs data structures and methods for the MCI kobjects */ 894/* default sysfs methods and data structures for the main MCI kobject */
1113 895
1114static ssize_t mci_reset_counters_store(struct mem_ctl_info *mci, 896static ssize_t mci_reset_counters_store(struct mem_ctl_info *mci,
1115 const char *data, size_t count) 897 const char *data, size_t count)
@@ -1135,6 +917,7 @@ static ssize_t mci_reset_counters_store(struct mem_ctl_info *mci,
1135 return count; 917 return count;
1136} 918}
1137 919
920/* default attribute files for the MCI object */
1138static ssize_t mci_ue_count_show(struct mem_ctl_info *mci, char *data) 921static ssize_t mci_ue_count_show(struct mem_ctl_info *mci, char *data)
1139{ 922{
1140 return sprintf(data,"%d\n", mci->ue_count); 923 return sprintf(data,"%d\n", mci->ue_count);
@@ -1160,71 +943,11 @@ static ssize_t mci_seconds_show(struct mem_ctl_info *mci, char *data)
1160 return sprintf(data,"%ld\n", (jiffies - mci->start_time) / HZ); 943 return sprintf(data,"%ld\n", (jiffies - mci->start_time) / HZ);
1161} 944}
1162 945
1163static ssize_t mci_mod_name_show(struct mem_ctl_info *mci, char *data)
1164{
1165 return sprintf(data,"%s %s\n", mci->mod_name, mci->mod_ver);
1166}
1167
1168static ssize_t mci_ctl_name_show(struct mem_ctl_info *mci, char *data) 946static ssize_t mci_ctl_name_show(struct mem_ctl_info *mci, char *data)
1169{ 947{
1170 return sprintf(data,"%s\n", mci->ctl_name); 948 return sprintf(data,"%s\n", mci->ctl_name);
1171} 949}
1172 950
1173static int mci_output_edac_cap(char *buf, unsigned long edac_cap)
1174{
1175 char *p = buf;
1176 int bit_idx;
1177
1178 for (bit_idx = 0; bit_idx < 8 * sizeof(edac_cap); bit_idx++) {
1179 if ((edac_cap >> bit_idx) & 0x1)
1180 p += sprintf(p, "%s ", edac_caps[bit_idx]);
1181 }
1182
1183 return p - buf;
1184}
1185
1186static ssize_t mci_edac_capability_show(struct mem_ctl_info *mci, char *data)
1187{
1188 char *p = data;
1189
1190 p += mci_output_edac_cap(p,mci->edac_ctl_cap);
1191 p += sprintf(p, "\n");
1192 return p - data;
1193}
1194
1195static ssize_t mci_edac_current_capability_show(struct mem_ctl_info *mci,
1196 char *data)
1197{
1198 char *p = data;
1199
1200 p += mci_output_edac_cap(p,mci->edac_cap);
1201 p += sprintf(p, "\n");
1202 return p - data;
1203}
1204
1205static int mci_output_mtype_cap(char *buf, unsigned long mtype_cap)
1206{
1207 char *p = buf;
1208 int bit_idx;
1209
1210 for (bit_idx = 0; bit_idx < 8 * sizeof(mtype_cap); bit_idx++) {
1211 if ((mtype_cap >> bit_idx) & 0x1)
1212 p += sprintf(p, "%s ", mem_types[bit_idx]);
1213 }
1214
1215 return p - buf;
1216}
1217
1218static ssize_t mci_supported_mem_type_show(struct mem_ctl_info *mci,
1219 char *data)
1220{
1221 char *p = data;
1222
1223 p += mci_output_mtype_cap(p,mci->mtype_cap);
1224 p += sprintf(p, "\n");
1225 return p - data;
1226}
1227
1228static ssize_t mci_size_mb_show(struct mem_ctl_info *mci, char *data) 951static ssize_t mci_size_mb_show(struct mem_ctl_info *mci, char *data)
1229{ 952{
1230 int total_pages, csrow_idx; 953 int total_pages, csrow_idx;
@@ -1251,6 +974,7 @@ struct mcidev_attribute {
1251#define to_mci(k) container_of(k, struct mem_ctl_info, edac_mci_kobj) 974#define to_mci(k) container_of(k, struct mem_ctl_info, edac_mci_kobj)
1252#define to_mcidev_attr(a) container_of(a, struct mcidev_attribute, attr) 975#define to_mcidev_attr(a) container_of(a, struct mcidev_attribute, attr)
1253 976
977/* MCI show/store functions for top most object */
1254static ssize_t mcidev_show(struct kobject *kobj, struct attribute *attr, 978static ssize_t mcidev_show(struct kobject *kobj, struct attribute *attr,
1255 char *buffer) 979 char *buffer)
1256{ 980{
@@ -1287,31 +1011,21 @@ struct mcidev_attribute mci_attr_##_name = { \
1287 .store = _store, \ 1011 .store = _store, \
1288}; 1012};
1289 1013
1290/* Control file */ 1014/* default Control file */
1291MCIDEV_ATTR(reset_counters,S_IWUSR,NULL,mci_reset_counters_store); 1015MCIDEV_ATTR(reset_counters,S_IWUSR,NULL,mci_reset_counters_store);
1292 1016
1293/* Attribute files */ 1017/* default Attribute files */
1294MCIDEV_ATTR(mc_name,S_IRUGO,mci_ctl_name_show,NULL); 1018MCIDEV_ATTR(mc_name,S_IRUGO,mci_ctl_name_show,NULL);
1295MCIDEV_ATTR(module_name,S_IRUGO,mci_mod_name_show,NULL);
1296MCIDEV_ATTR(edac_capability,S_IRUGO,mci_edac_capability_show,NULL);
1297MCIDEV_ATTR(size_mb,S_IRUGO,mci_size_mb_show,NULL); 1019MCIDEV_ATTR(size_mb,S_IRUGO,mci_size_mb_show,NULL);
1298MCIDEV_ATTR(seconds_since_reset,S_IRUGO,mci_seconds_show,NULL); 1020MCIDEV_ATTR(seconds_since_reset,S_IRUGO,mci_seconds_show,NULL);
1299MCIDEV_ATTR(ue_noinfo_count,S_IRUGO,mci_ue_noinfo_show,NULL); 1021MCIDEV_ATTR(ue_noinfo_count,S_IRUGO,mci_ue_noinfo_show,NULL);
1300MCIDEV_ATTR(ce_noinfo_count,S_IRUGO,mci_ce_noinfo_show,NULL); 1022MCIDEV_ATTR(ce_noinfo_count,S_IRUGO,mci_ce_noinfo_show,NULL);
1301MCIDEV_ATTR(ue_count,S_IRUGO,mci_ue_count_show,NULL); 1023MCIDEV_ATTR(ue_count,S_IRUGO,mci_ue_count_show,NULL);
1302MCIDEV_ATTR(ce_count,S_IRUGO,mci_ce_count_show,NULL); 1024MCIDEV_ATTR(ce_count,S_IRUGO,mci_ce_count_show,NULL);
1303MCIDEV_ATTR(edac_current_capability,S_IRUGO,
1304 mci_edac_current_capability_show,NULL);
1305MCIDEV_ATTR(supported_mem_type,S_IRUGO,
1306 mci_supported_mem_type_show,NULL);
1307 1025
1308static struct mcidev_attribute *mci_attr[] = { 1026static struct mcidev_attribute *mci_attr[] = {
1309 &mci_attr_reset_counters, 1027 &mci_attr_reset_counters,
1310 &mci_attr_module_name,
1311 &mci_attr_mc_name, 1028 &mci_attr_mc_name,
1312 &mci_attr_edac_capability,
1313 &mci_attr_edac_current_capability,
1314 &mci_attr_supported_mem_type,
1315 &mci_attr_size_mb, 1029 &mci_attr_size_mb,
1316 &mci_attr_seconds_since_reset, 1030 &mci_attr_seconds_since_reset,
1317 &mci_attr_ue_noinfo_count, 1031 &mci_attr_ue_noinfo_count,
@@ -1339,7 +1053,6 @@ static struct kobj_type ktype_mci = {
1339 .default_attrs = (struct attribute **) mci_attr, 1053 .default_attrs = (struct attribute **) mci_attr,
1340}; 1054};
1341 1055
1342#endif /* DISABLE_EDAC_SYSFS */
1343 1056
1344#define EDAC_DEVICE_SYMLINK "device" 1057#define EDAC_DEVICE_SYMLINK "device"
1345 1058
@@ -1352,11 +1065,6 @@ static struct kobj_type ktype_mci = {
1352 * !0 Failure 1065 * !0 Failure
1353 */ 1066 */
1354static int edac_create_sysfs_mci_device(struct mem_ctl_info *mci) 1067static int edac_create_sysfs_mci_device(struct mem_ctl_info *mci)
1355#ifdef DISABLE_EDAC_SYSFS
1356{
1357 return 0;
1358}
1359#else
1360{ 1068{
1361 int i; 1069 int i;
1362 int err; 1070 int err;
@@ -1368,7 +1076,6 @@ static int edac_create_sysfs_mci_device(struct mem_ctl_info *mci)
1368 1076
1369 /* set the name of the mc<id> object */ 1077 /* set the name of the mc<id> object */
1370 err = kobject_set_name(edac_mci_kobj,"mc%d",mci->mc_idx); 1078 err = kobject_set_name(edac_mci_kobj,"mc%d",mci->mc_idx);
1371
1372 if (err) 1079 if (err)
1373 return err; 1080 return err;
1374 1081
@@ -1378,14 +1085,12 @@ static int edac_create_sysfs_mci_device(struct mem_ctl_info *mci)
1378 1085
1379 /* register the mc<id> kobject */ 1086 /* register the mc<id> kobject */
1380 err = kobject_register(edac_mci_kobj); 1087 err = kobject_register(edac_mci_kobj);
1381
1382 if (err) 1088 if (err)
1383 return err; 1089 return err;
1384 1090
1385 /* create a symlink for the device */ 1091 /* create a symlink for the device */
1386 err = sysfs_create_link(edac_mci_kobj, &mci->dev->kobj, 1092 err = sysfs_create_link(edac_mci_kobj, &mci->dev->kobj,
1387 EDAC_DEVICE_SYMLINK); 1093 EDAC_DEVICE_SYMLINK);
1388
1389 if (err) 1094 if (err)
1390 goto fail0; 1095 goto fail0;
1391 1096
@@ -1398,7 +1103,6 @@ static int edac_create_sysfs_mci_device(struct mem_ctl_info *mci)
1398 /* Only expose populated CSROWs */ 1103 /* Only expose populated CSROWs */
1399 if (csrow->nr_pages > 0) { 1104 if (csrow->nr_pages > 0) {
1400 err = edac_create_csrow_object(edac_mci_kobj,csrow,i); 1105 err = edac_create_csrow_object(edac_mci_kobj,csrow,i);
1401
1402 if (err) 1106 if (err)
1403 goto fail1; 1107 goto fail1;
1404 } 1108 }
@@ -1422,14 +1126,12 @@ fail0:
1422 wait_for_completion(&mci->kobj_complete); 1126 wait_for_completion(&mci->kobj_complete);
1423 return err; 1127 return err;
1424} 1128}
1425#endif /* DISABLE_EDAC_SYSFS */
1426 1129
1427/* 1130/*
1428 * remove a Memory Controller instance 1131 * remove a Memory Controller instance
1429 */ 1132 */
1430static void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci) 1133static void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci)
1431{ 1134{
1432#ifndef DISABLE_EDAC_SYSFS
1433 int i; 1135 int i;
1434 1136
1435 debugf0("%s()\n", __func__); 1137 debugf0("%s()\n", __func__);
@@ -1447,7 +1149,6 @@ static void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci)
1447 init_completion(&mci->kobj_complete); 1149 init_completion(&mci->kobj_complete);
1448 kobject_unregister(&mci->edac_mci_kobj); 1150 kobject_unregister(&mci->edac_mci_kobj);
1449 wait_for_completion(&mci->kobj_complete); 1151 wait_for_completion(&mci->kobj_complete);
1450#endif /* DISABLE_EDAC_SYSFS */
1451} 1152}
1452 1153
1453/* END OF sysfs data and methods */ 1154/* END OF sysfs data and methods */
diff --git a/drivers/fc4/fc.c b/drivers/fc4/fc.c
index 66d03f242d3c..1a159e8843ca 100644
--- a/drivers/fc4/fc.c
+++ b/drivers/fc4/fc.c
@@ -429,7 +429,7 @@ static inline void fcp_scsi_receive(fc_channel *fc, int token, int status, fc_hd
429 429
430 if (fcmd->data) { 430 if (fcmd->data) {
431 if (SCpnt->use_sg) 431 if (SCpnt->use_sg)
432 dma_unmap_sg(fc->dev, (struct scatterlist *)SCpnt->buffer, 432 dma_unmap_sg(fc->dev, (struct scatterlist *)SCpnt->request_buffer,
433 SCpnt->use_sg, 433 SCpnt->use_sg,
434 SCpnt->sc_data_direction); 434 SCpnt->sc_data_direction);
435 else 435 else
@@ -810,7 +810,7 @@ static int fcp_scsi_queue_it(fc_channel *fc, Scsi_Cmnd *SCpnt, fcp_cmnd *fcmd, i
810 SCpnt->request_bufflen, 810 SCpnt->request_bufflen,
811 SCpnt->sc_data_direction); 811 SCpnt->sc_data_direction);
812 } else { 812 } else {
813 struct scatterlist *sg = (struct scatterlist *)SCpnt->buffer; 813 struct scatterlist *sg = (struct scatterlist *)SCpnt->request_buffer;
814 int nents; 814 int nents;
815 815
816 FCD(("XXX: Use_sg %d %d\n", SCpnt->use_sg, sg->length)) 816 FCD(("XXX: Use_sg %d %d\n", SCpnt->use_sg, sg->length))
diff --git a/drivers/hwmon/abituguru.c b/drivers/hwmon/abituguru.c
index 59122cc0a50a..cc15c4f2e9ec 100644
--- a/drivers/hwmon/abituguru.c
+++ b/drivers/hwmon/abituguru.c
@@ -142,6 +142,14 @@ static const u8 abituguru_pwm_max[5] = { 0, 255, 255, 75, 75 };
142static int force; 142static int force;
143module_param(force, bool, 0); 143module_param(force, bool, 0);
144MODULE_PARM_DESC(force, "Set to one to force detection."); 144MODULE_PARM_DESC(force, "Set to one to force detection.");
145static int bank1_types[ABIT_UGURU_MAX_BANK1_SENSORS] = { -1, -1, -1, -1, -1,
146 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };
147module_param_array(bank1_types, int, NULL, 0);
148MODULE_PARM_DESC(bank1_types, "Bank1 sensortype autodetection override:\n"
149 " -1 autodetect\n"
150 " 0 volt sensor\n"
151 " 1 temp sensor\n"
152 " 2 not connected");
145static int fan_sensors; 153static int fan_sensors;
146module_param(fan_sensors, int, 0); 154module_param(fan_sensors, int, 0);
147MODULE_PARM_DESC(fan_sensors, "Number of fan sensors on the uGuru " 155MODULE_PARM_DESC(fan_sensors, "Number of fan sensors on the uGuru "
@@ -397,6 +405,15 @@ abituguru_detect_bank1_sensor_type(struct abituguru_data *data,
397 u8 val, buf[3]; 405 u8 val, buf[3];
398 int ret = ABIT_UGURU_NC; 406 int ret = ABIT_UGURU_NC;
399 407
408 /* If overriden by the user return the user selected type */
409 if (bank1_types[sensor_addr] >= ABIT_UGURU_IN_SENSOR &&
410 bank1_types[sensor_addr] <= ABIT_UGURU_NC) {
411 ABIT_UGURU_DEBUG(2, "assuming sensor type %d for bank1 sensor "
412 "%d because of \"bank1_types\" module param\n",
413 bank1_types[sensor_addr], (int)sensor_addr);
414 return bank1_types[sensor_addr];
415 }
416
400 /* First read the sensor and the current settings */ 417 /* First read the sensor and the current settings */
401 if (abituguru_read(data, ABIT_UGURU_SENSOR_BANK1, sensor_addr, &val, 418 if (abituguru_read(data, ABIT_UGURU_SENSOR_BANK1, sensor_addr, &val,
402 1, ABIT_UGURU_MAX_RETRIES) != 1) 419 1, ABIT_UGURU_MAX_RETRIES) != 1)
@@ -514,7 +531,7 @@ abituguru_detect_no_bank2_sensors(struct abituguru_data *data)
514{ 531{
515 int i; 532 int i;
516 533
517 if (fan_sensors) { 534 if (fan_sensors > 0 && fan_sensors <= ABIT_UGURU_MAX_BANK2_SENSORS) {
518 data->bank2_sensors = fan_sensors; 535 data->bank2_sensors = fan_sensors;
519 ABIT_UGURU_DEBUG(2, "assuming %d fan sensors because of " 536 ABIT_UGURU_DEBUG(2, "assuming %d fan sensors because of "
520 "\"fan_sensors\" module param\n", 537 "\"fan_sensors\" module param\n",
@@ -568,7 +585,7 @@ abituguru_detect_no_pwms(struct abituguru_data *data)
568{ 585{
569 int i, j; 586 int i, j;
570 587
571 if (pwms) { 588 if (pwms > 0 && pwms <= ABIT_UGURU_MAX_PWMS) {
572 data->pwms = pwms; 589 data->pwms = pwms;
573 ABIT_UGURU_DEBUG(2, "assuming %d PWM outputs because of " 590 ABIT_UGURU_DEBUG(2, "assuming %d PWM outputs because of "
574 "\"pwms\" module param\n", (int)data->pwms); 591 "\"pwms\" module param\n", (int)data->pwms);
diff --git a/drivers/i2c/algos/i2c-algo-bit.c b/drivers/i2c/algos/i2c-algo-bit.c
index df05df1a0ef6..ab230c033f99 100644
--- a/drivers/i2c/algos/i2c-algo-bit.c
+++ b/drivers/i2c/algos/i2c-algo-bit.c
@@ -372,7 +372,6 @@ static inline int readbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msg)
372 372
373 while (count > 0) { 373 while (count > 0) {
374 inval = i2c_inb(i2c_adap); 374 inval = i2c_inb(i2c_adap);
375/*printk("%#02x ",inval); if ( ! (count % 16) ) printk("\n"); */
376 if (inval>=0) { 375 if (inval>=0) {
377 *temp = inval; 376 *temp = inval;
378 rdcount++; 377 rdcount++;
@@ -544,8 +543,7 @@ int i2c_bit_add_bus(struct i2c_adapter *adap)
544 adap->timeout = 100; /* default values, should */ 543 adap->timeout = 100; /* default values, should */
545 adap->retries = 3; /* be replaced by defines */ 544 adap->retries = 3; /* be replaced by defines */
546 545
547 i2c_add_adapter(adap); 546 return i2c_add_adapter(adap);
548 return 0;
549} 547}
550 548
551 549
diff --git a/drivers/i2c/algos/i2c-algo-ite.c b/drivers/i2c/algos/i2c-algo-ite.c
index 2db7bfc85225..70d8eefb5efc 100644
--- a/drivers/i2c/algos/i2c-algo-ite.c
+++ b/drivers/i2c/algos/i2c-algo-ite.c
@@ -742,10 +742,8 @@ int i2c_iic_add_bus(struct i2c_adapter *adap)
742 adap->retries = 3; /* be replaced by defines */ 742 adap->retries = 3; /* be replaced by defines */
743 adap->flags = 0; 743 adap->flags = 0;
744 744
745 i2c_add_adapter(adap);
746 iic_init(iic_adap); 745 iic_init(iic_adap);
747 746 return i2c_add_adapter(adap);
748 return 0;
749} 747}
750 748
751 749
diff --git a/drivers/i2c/algos/i2c-algo-pca.c b/drivers/i2c/algos/i2c-algo-pca.c
index 82946acab4c7..b88a6fcf7bd0 100644
--- a/drivers/i2c/algos/i2c-algo-pca.c
+++ b/drivers/i2c/algos/i2c-algo-pca.c
@@ -374,10 +374,10 @@ int i2c_pca_add_bus(struct i2c_adapter *adap)
374 adap->timeout = 100; /* default values, should */ 374 adap->timeout = 100; /* default values, should */
375 adap->retries = 3; /* be replaced by defines */ 375 adap->retries = 3; /* be replaced by defines */
376 376
377 rval = pca_init(pca_adap); 377 if ((rval = pca_init(pca_adap)))
378 return rval;
378 379
379 if (!rval) 380 rval = i2c_add_adapter(adap);
380 i2c_add_adapter(adap);
381 381
382 return rval; 382 return rval;
383} 383}
diff --git a/drivers/i2c/algos/i2c-algo-pcf.c b/drivers/i2c/algos/i2c-algo-pcf.c
index 6e498df1f717..5b24930adb5a 100644
--- a/drivers/i2c/algos/i2c-algo-pcf.c
+++ b/drivers/i2c/algos/i2c-algo-pcf.c
@@ -479,9 +479,11 @@ int i2c_pcf_add_bus(struct i2c_adapter *adap)
479 adap->timeout = 100; /* default values, should */ 479 adap->timeout = 100; /* default values, should */
480 adap->retries = 3; /* be replaced by defines */ 480 adap->retries = 3; /* be replaced by defines */
481 481
482 rval = pcf_init_8584(pcf_adap); 482 if ((rval = pcf_init_8584(pcf_adap)))
483 if (!rval) 483 return rval;
484 i2c_add_adapter(adap); 484
485 rval = i2c_add_adapter(adap);
486
485 return rval; 487 return rval;
486} 488}
487 489
diff --git a/drivers/i2c/algos/i2c-algo-sibyte.c b/drivers/i2c/algos/i2c-algo-sibyte.c
index 3df3f09995c2..32d41c6fac0f 100644
--- a/drivers/i2c/algos/i2c-algo-sibyte.c
+++ b/drivers/i2c/algos/i2c-algo-sibyte.c
@@ -173,9 +173,7 @@ int i2c_sibyte_add_bus(struct i2c_adapter *i2c_adap, int speed)
173 printk("\n"); 173 printk("\n");
174 } 174 }
175 175
176 i2c_add_adapter(i2c_adap); 176 return i2c_add_adapter(i2c_adap);
177
178 return 0;
179} 177}
180 178
181 179
diff --git a/drivers/i2c/busses/i2c-iop3xx.c b/drivers/i2c/busses/i2c-iop3xx.c
index aca7e1668605..48c56939c861 100644
--- a/drivers/i2c/busses/i2c-iop3xx.c
+++ b/drivers/i2c/busses/i2c-iop3xx.c
@@ -21,6 +21,9 @@
21 * - Make it work with IXP46x chips 21 * - Make it work with IXP46x chips
22 * - Cleanup function names, coding style, etc 22 * - Cleanup function names, coding style, etc
23 * 23 *
24 * - writing to slave address causes latchup on iop331.
25 * fix: driver refuses to address self.
26 *
24 * This program is free software; you can redistribute it and/or modify 27 * This program is free software; you can redistribute it and/or modify
25 * it under the terms of the GNU General Public License as published by 28 * it under the terms of the GNU General Public License as published by
26 * the Free Software Foundation, version 2. 29 * the Free Software Foundation, version 2.
@@ -73,12 +76,6 @@ iop3xx_i2c_reset(struct i2c_algo_iop3xx_data *iop3xx_adap)
73} 76}
74 77
75static void 78static void
76iop3xx_i2c_set_slave_addr(struct i2c_algo_iop3xx_data *iop3xx_adap)
77{
78 __raw_writel(MYSAR, iop3xx_adap->ioaddr + SAR_OFFSET);
79}
80
81static void
82iop3xx_i2c_enable(struct i2c_algo_iop3xx_data *iop3xx_adap) 79iop3xx_i2c_enable(struct i2c_algo_iop3xx_data *iop3xx_adap)
83{ 80{
84 u32 cr = IOP3XX_ICR_GCD | IOP3XX_ICR_SCLEN | IOP3XX_ICR_UE; 81 u32 cr = IOP3XX_ICR_GCD | IOP3XX_ICR_SCLEN | IOP3XX_ICR_UE;
@@ -248,6 +245,13 @@ iop3xx_i2c_send_target_addr(struct i2c_algo_iop3xx_data *iop3xx_adap,
248 int status; 245 int status;
249 int rc; 246 int rc;
250 247
248 /* avoid writing to my slave address (hangs on 80331),
249 * forbidden in Intel developer manual
250 */
251 if (msg->addr == MYSAR) {
252 return -EBUSY;
253 }
254
251 __raw_writel(iic_cook_addr(msg), iop3xx_adap->ioaddr + DBR_OFFSET); 255 __raw_writel(iic_cook_addr(msg), iop3xx_adap->ioaddr + DBR_OFFSET);
252 256
253 cr &= ~(IOP3XX_ICR_MSTOP | IOP3XX_ICR_NACK); 257 cr &= ~(IOP3XX_ICR_MSTOP | IOP3XX_ICR_NACK);
@@ -498,7 +502,6 @@ iop3xx_i2c_probe(struct platform_device *pdev)
498 spin_lock_init(&adapter_data->lock); 502 spin_lock_init(&adapter_data->lock);
499 503
500 iop3xx_i2c_reset(adapter_data); 504 iop3xx_i2c_reset(adapter_data);
501 iop3xx_i2c_set_slave_addr(adapter_data);
502 iop3xx_i2c_enable(adapter_data); 505 iop3xx_i2c_enable(adapter_data);
503 506
504 platform_set_drvdata(pdev, new_adapter); 507 platform_set_drvdata(pdev, new_adapter);
diff --git a/drivers/i2c/busses/i2c-iop3xx.h b/drivers/i2c/busses/i2c-iop3xx.h
index e46ebaea7b1e..8485861f6a36 100644
--- a/drivers/i2c/busses/i2c-iop3xx.h
+++ b/drivers/i2c/busses/i2c-iop3xx.h
@@ -80,7 +80,7 @@
80#define IOP3XX_GPOD_I2C0 0x00c0 /* clear these bits to enable ch0 */ 80#define IOP3XX_GPOD_I2C0 0x00c0 /* clear these bits to enable ch0 */
81#define IOP3XX_GPOD_I2C1 0x0030 /* clear these bits to enable ch1 */ 81#define IOP3XX_GPOD_I2C1 0x0030 /* clear these bits to enable ch1 */
82 82
83#define MYSAR 0x02 /* SWAG a suitable slave address */ 83#define MYSAR 0 /* default slave address */
84 84
85#define I2C_ERR 321 85#define I2C_ERR 321
86#define I2C_ERR_BERR (I2C_ERR+0) 86#define I2C_ERR_BERR (I2C_ERR+0)
diff --git a/drivers/i2c/busses/i2c-powermac.c b/drivers/i2c/busses/i2c-powermac.c
index 2a0b3be7cdd0..53bb43593863 100644
--- a/drivers/i2c/busses/i2c-powermac.c
+++ b/drivers/i2c/busses/i2c-powermac.c
@@ -148,8 +148,6 @@ static int i2c_powermac_master_xfer( struct i2c_adapter *adap,
148 int read; 148 int read;
149 int addrdir; 149 int addrdir;
150 150
151 if (num != 1)
152 return -EINVAL;
153 if (msgs->flags & I2C_M_TEN) 151 if (msgs->flags & I2C_M_TEN)
154 return -EINVAL; 152 return -EINVAL;
155 read = (msgs->flags & I2C_M_RD) != 0; 153 read = (msgs->flags & I2C_M_RD) != 0;
@@ -166,7 +164,7 @@ static int i2c_powermac_master_xfer( struct i2c_adapter *adap,
166 rc = pmac_i2c_xfer(bus, addrdir, 0, 0, msgs->buf, msgs->len); 164 rc = pmac_i2c_xfer(bus, addrdir, 0, 0, msgs->buf, msgs->len);
167 bail: 165 bail:
168 pmac_i2c_close(bus); 166 pmac_i2c_close(bus);
169 return rc < 0 ? rc : msgs->len; 167 return rc < 0 ? rc : 1;
170} 168}
171 169
172static u32 i2c_powermac_func(struct i2c_adapter * adapter) 170static u32 i2c_powermac_func(struct i2c_adapter * adapter)
diff --git a/drivers/i2c/busses/scx200_acb.c b/drivers/i2c/busses/scx200_acb.c
index 22a3eda04166..ced309ff056f 100644
--- a/drivers/i2c/busses/scx200_acb.c
+++ b/drivers/i2c/busses/scx200_acb.c
@@ -184,21 +184,21 @@ static void scx200_acb_machine(struct scx200_acb_iface *iface, u8 status)
184 break; 184 break;
185 185
186 case state_read: 186 case state_read:
187 /* Set ACK if receiving the last byte */ 187 /* Set ACK if _next_ byte will be the last one */
188 if (iface->len == 1) 188 if (iface->len == 2)
189 outb(inb(ACBCTL1) | ACBCTL1_ACK, ACBCTL1); 189 outb(inb(ACBCTL1) | ACBCTL1_ACK, ACBCTL1);
190 else 190 else
191 outb(inb(ACBCTL1) & ~ACBCTL1_ACK, ACBCTL1); 191 outb(inb(ACBCTL1) & ~ACBCTL1_ACK, ACBCTL1);
192 192
193 *iface->ptr++ = inb(ACBSDA); 193 if (iface->len == 1) {
194 --iface->len;
195
196 if (iface->len == 0) {
197 iface->result = 0; 194 iface->result = 0;
198 iface->state = state_idle; 195 iface->state = state_idle;
199 outb(inb(ACBCTL1) | ACBCTL1_STOP, ACBCTL1); 196 outb(inb(ACBCTL1) | ACBCTL1_STOP, ACBCTL1);
200 } 197 }
201 198
199 *iface->ptr++ = inb(ACBSDA);
200 --iface->len;
201
202 break; 202 break;
203 203
204 case state_write: 204 case state_write:
@@ -307,8 +307,12 @@ static s32 scx200_acb_smbus_xfer(struct i2c_adapter *adapter,
307 buffer = (u8 *)&cur_word; 307 buffer = (u8 *)&cur_word;
308 break; 308 break;
309 309
310 case I2C_SMBUS_BLOCK_DATA: 310 case I2C_SMBUS_I2C_BLOCK_DATA:
311 if (rw == I2C_SMBUS_READ)
312 data->block[0] = I2C_SMBUS_BLOCK_MAX; /* For now */
311 len = data->block[0]; 313 len = data->block[0];
314 if (len == 0 || len > I2C_SMBUS_BLOCK_MAX)
315 return -EINVAL;
312 buffer = &data->block[1]; 316 buffer = &data->block[1];
313 break; 317 break;
314 318
@@ -372,7 +376,7 @@ static u32 scx200_acb_func(struct i2c_adapter *adapter)
372{ 376{
373 return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE | 377 return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
374 I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA | 378 I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA |
375 I2C_FUNC_SMBUS_BLOCK_DATA; 379 I2C_FUNC_SMBUS_I2C_BLOCK;
376} 380}
377 381
378/* For now, we only handle combined mode (smbus) */ 382/* For now, we only handle combined mode (smbus) */
diff --git a/drivers/i2c/chips/pca9539.c b/drivers/i2c/chips/pca9539.c
index 54b6e6a4beed..cb22280cdd27 100644
--- a/drivers/i2c/chips/pca9539.c
+++ b/drivers/i2c/chips/pca9539.c
@@ -134,11 +134,13 @@ static int pca9539_detect(struct i2c_adapter *adapter, int address, int kind)
134 new_client->driver = &pca9539_driver; 134 new_client->driver = &pca9539_driver;
135 new_client->flags = 0; 135 new_client->flags = 0;
136 136
137 /* Detection: the pca9539 only has 8 registers (0-7). 137 if (kind < 0) {
138 A read of 7 should succeed, but a read of 8 should fail. */ 138 /* Detection: the pca9539 only has 8 registers (0-7).
139 if ((i2c_smbus_read_byte_data(new_client, 7) < 0) || 139 A read of 7 should succeed, but a read of 8 should fail. */
140 (i2c_smbus_read_byte_data(new_client, 8) >= 0)) 140 if ((i2c_smbus_read_byte_data(new_client, 7) < 0) ||
141 goto exit_kfree; 141 (i2c_smbus_read_byte_data(new_client, 8) >= 0))
142 goto exit_kfree;
143 }
142 144
143 strlcpy(new_client->name, "pca9539", I2C_NAME_SIZE); 145 strlcpy(new_client->name, "pca9539", I2C_NAME_SIZE);
144 146
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index a45155f799d4..9cb277d6aa48 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -756,9 +756,9 @@ int i2c_probe(struct i2c_adapter *adapter,
756 "parameter for adapter %d, " 756 "parameter for adapter %d, "
757 "addr 0x%02x\n", adap_id, 757 "addr 0x%02x\n", adap_id,
758 address_data->ignore[j + 1]); 758 address_data->ignore[j + 1]);
759 ignore = 1;
760 break;
759 } 761 }
760 ignore = 1;
761 break;
762 } 762 }
763 if (ignore) 763 if (ignore)
764 continue; 764 continue;
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index d1266fe2d1ab..b6fb167e20f6 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -682,6 +682,7 @@ config BLK_DEV_SVWKS
682config BLK_DEV_SGIIOC4 682config BLK_DEV_SGIIOC4
683 tristate "Silicon Graphics IOC4 chipset ATA/ATAPI support" 683 tristate "Silicon Graphics IOC4 chipset ATA/ATAPI support"
684 depends on (IA64_SGI_SN2 || IA64_GENERIC) && SGI_IOC4 684 depends on (IA64_SGI_SN2 || IA64_GENERIC) && SGI_IOC4
685 select IDEPCI_SHARE_IRQ
685 help 686 help
686 This driver adds PIO & MultiMode DMA-2 support for the SGI IOC4 687 This driver adds PIO & MultiMode DMA-2 support for the SGI IOC4
687 chipset, which has one channel and can support two devices. 688 chipset, which has one channel and can support two devices.
@@ -773,20 +774,6 @@ config BLK_DEV_IDEDMA_PMAC
773 to transfer data to and from memory. Saying Y is safe and improves 774 to transfer data to and from memory. Saying Y is safe and improves
774 performance. 775 performance.
775 776
776config BLK_DEV_IDE_PMAC_BLINK
777 bool "Blink laptop LED on drive activity (DEPRECATED)"
778 depends on BLK_DEV_IDE_PMAC && ADB_PMU
779 select ADB_PMU_LED
780 select LEDS_TRIGGERS
781 select LEDS_TRIGGER_IDE_DISK
782 help
783 This option enables the use of the sleep LED as a hard drive
784 activity LED.
785 This option is deprecated, it only selects ADB_PMU_LED and
786 LEDS_TRIGGER_IDE_DISK and changes the code in the new led class
787 device to default to the ide-disk trigger (which should be set
788 from userspace via sysfs).
789
790config BLK_DEV_IDE_SWARM 777config BLK_DEV_IDE_SWARM
791 tristate "IDE for Sibyte evaluation boards" 778 tristate "IDE for Sibyte evaluation boards"
792 depends on SIBYTE_SB1xxx_SOC 779 depends on SIBYTE_SB1xxx_SOC
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index f712e4cfd9dc..7cf3eb023521 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -776,7 +776,7 @@ static void update_ordered(ide_drive_t *drive)
776 * not available so we don't need to recheck that. 776 * not available so we don't need to recheck that.
777 */ 777 */
778 capacity = idedisk_capacity(drive); 778 capacity = idedisk_capacity(drive);
779 barrier = ide_id_has_flush_cache(id) && 779 barrier = ide_id_has_flush_cache(id) && !drive->noflush &&
780 (drive->addressing == 0 || capacity <= (1ULL << 28) || 780 (drive->addressing == 0 || capacity <= (1ULL << 28) ||
781 ide_id_has_flush_cache_ext(id)); 781 ide_id_has_flush_cache_ext(id));
782 782
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index 98918fb6b2ce..7c3a13e1cf64 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -750,7 +750,7 @@ void ide_dma_verbose(ide_drive_t *drive)
750 goto bug_dma_off; 750 goto bug_dma_off;
751 printk(", DMA"); 751 printk(", DMA");
752 } else if (id->field_valid & 1) { 752 } else if (id->field_valid & 1) {
753 printk(", BUG"); 753 goto bug_dma_off;
754 } 754 }
755 return; 755 return;
756bug_dma_off: 756bug_dma_off:
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index 657165297dc7..77703acaec17 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -23,6 +23,7 @@
23#include <linux/hdreg.h> 23#include <linux/hdreg.h>
24#include <linux/ide.h> 24#include <linux/ide.h>
25#include <linux/bitops.h> 25#include <linux/bitops.h>
26#include <linux/nmi.h>
26 27
27#include <asm/byteorder.h> 28#include <asm/byteorder.h>
28#include <asm/irq.h> 29#include <asm/irq.h>
@@ -1243,6 +1244,7 @@ int ide_wait_not_busy(ide_hwif_t *hwif, unsigned long timeout)
1243 if (stat == 0xff) 1244 if (stat == 0xff)
1244 return -ENODEV; 1245 return -ENODEV;
1245 touch_softlockup_watchdog(); 1246 touch_softlockup_watchdog();
1247 touch_nmi_watchdog();
1246 } 1248 }
1247 return -EBUSY; 1249 return -EBUSY;
1248} 1250}
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 05fbd9298db7..defd4b4bd374 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -1539,7 +1539,7 @@ static int __init ide_setup(char *s)
1539 const char *hd_words[] = { 1539 const char *hd_words[] = {
1540 "none", "noprobe", "nowerr", "cdrom", "serialize", 1540 "none", "noprobe", "nowerr", "cdrom", "serialize",
1541 "autotune", "noautotune", "minus8", "swapdata", "bswap", 1541 "autotune", "noautotune", "minus8", "swapdata", "bswap",
1542 "minus11", "remap", "remap63", "scsi", NULL }; 1542 "noflush", "remap", "remap63", "scsi", NULL };
1543 unit = s[2] - 'a'; 1543 unit = s[2] - 'a';
1544 hw = unit / MAX_DRIVES; 1544 hw = unit / MAX_DRIVES;
1545 unit = unit % MAX_DRIVES; 1545 unit = unit % MAX_DRIVES;
@@ -1578,6 +1578,9 @@ static int __init ide_setup(char *s)
1578 case -10: /* "bswap" */ 1578 case -10: /* "bswap" */
1579 drive->bswap = 1; 1579 drive->bswap = 1;
1580 goto done; 1580 goto done;
1581 case -11: /* noflush */
1582 drive->noflush = 1;
1583 goto done;
1581 case -12: /* "remap" */ 1584 case -12: /* "remap" */
1582 drive->remap_0_to_1 = 1; 1585 drive->remap_0_to_1 = 1;
1583 goto done; 1586 goto done;
diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c
index b7e459e4f284..602797a44208 100644
--- a/drivers/ide/legacy/ide-cs.c
+++ b/drivers/ide/legacy/ide-cs.c
@@ -146,16 +146,7 @@ static void ide_detach(struct pcmcia_device *link)
146 kfree(link->priv); 146 kfree(link->priv);
147} /* ide_detach */ 147} /* ide_detach */
148 148
149static void idecs_mmio_fixup(ide_hwif_t *hwif) 149static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq, struct pcmcia_device *handle)
150{
151 default_hwif_mmiops(hwif);
152 hwif->mmio = 2;
153
154 ide_undecoded_slave(hwif);
155}
156
157static int idecs_register(unsigned long io, unsigned long ctl,
158 unsigned long irq, struct pcmcia_device *handle, int is_mmio)
159{ 150{
160 hw_regs_t hw; 151 hw_regs_t hw;
161 memset(&hw, 0, sizeof(hw)); 152 memset(&hw, 0, sizeof(hw));
@@ -163,19 +154,7 @@ static int idecs_register(unsigned long io, unsigned long ctl,
163 hw.irq = irq; 154 hw.irq = irq;
164 hw.chipset = ide_pci; 155 hw.chipset = ide_pci;
165 hw.dev = &handle->dev; 156 hw.dev = &handle->dev;
166 157 return ide_register_hw_with_fixup(&hw, NULL, ide_undecoded_slave);
167 if(is_mmio)
168 return ide_register_hw_with_fixup(&hw, NULL, idecs_mmio_fixup);
169 else
170 return ide_register_hw_with_fixup(&hw, NULL, ide_undecoded_slave);
171}
172
173void outb_io(unsigned char value, unsigned long port) {
174 outb(value, port);
175}
176
177void outb_mem(unsigned char value, unsigned long port) {
178 writeb(value, (void __iomem *) port);
179} 158}
180 159
181/*====================================================================== 160/*======================================================================
@@ -201,8 +180,7 @@ static int ide_config(struct pcmcia_device *link)
201 } *stk = NULL; 180 } *stk = NULL;
202 cistpl_cftable_entry_t *cfg; 181 cistpl_cftable_entry_t *cfg;
203 int i, pass, last_ret = 0, last_fn = 0, hd, is_kme = 0; 182 int i, pass, last_ret = 0, last_fn = 0, hd, is_kme = 0;
204 unsigned long io_base, ctl_base, is_mmio, try_slave; 183 unsigned long io_base, ctl_base;
205 void (*my_outb)(unsigned char, unsigned long);
206 184
207 DEBUG(0, "ide_config(0x%p)\n", link); 185 DEBUG(0, "ide_config(0x%p)\n", link);
208 186
@@ -232,7 +210,7 @@ static int ide_config(struct pcmcia_device *link)
232 /* Not sure if this is right... look up the current Vcc */ 210 /* Not sure if this is right... look up the current Vcc */
233 CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(link, &stk->conf)); 211 CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(link, &stk->conf));
234 212
235 pass = io_base = ctl_base = is_mmio = try_slave = 0; 213 pass = io_base = ctl_base = 0;
236 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 214 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
237 tuple.Attributes = 0; 215 tuple.Attributes = 0;
238 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 216 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
@@ -280,45 +258,11 @@ static int ide_config(struct pcmcia_device *link)
280 goto next_entry; 258 goto next_entry;
281 io_base = link->io.BasePort1; 259 io_base = link->io.BasePort1;
282 ctl_base = link->io.BasePort1 + 0x0e; 260 ctl_base = link->io.BasePort1 + 0x0e;
283
284 if (io->win[0].len >= 0x20)
285 try_slave = 1;
286
287 } else goto next_entry; 261 } else goto next_entry;
288 /* If we've got this far, we're done */ 262 /* If we've got this far, we're done */
289 break; 263 break;
290 } 264 }
291 265
292 if ((cfg->mem.nwin > 0) || (stk->dflt.mem.nwin > 0)) {
293 win_req_t req;
294 memreq_t map;
295 cistpl_mem_t *mem = (cfg->mem.nwin) ? &cfg->mem : &stk->dflt.mem;
296
297 if (mem->win[0].len < 16)
298 goto next_entry;
299
300 req.Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM;
301 req.Attributes |= WIN_ENABLE;
302 req.Base = mem->win[0].host_addr;
303 req.Size = 0;
304
305 req.AccessSpeed = 0;
306 if (pcmcia_request_window(&link, &req, &link->win) != 0)
307 goto next_entry;
308 map.Page = 0; map.CardOffset = mem->win[0].card_addr;
309 if (pcmcia_map_mem_page(link->win, &map) != 0)
310 goto next_entry;
311
312 io_base = (unsigned long) ioremap(req.Base, req.Size);
313 ctl_base = io_base + 0x0e;
314 is_mmio = 1;
315
316 if (mem->win[0].len >= 0x20)
317 try_slave = 1;
318
319 break;
320 }
321
322 next_entry: 266 next_entry:
323 if (cfg->flags & CISTPL_CFTABLE_DEFAULT) 267 if (cfg->flags & CISTPL_CFTABLE_DEFAULT)
324 memcpy(&stk->dflt, cfg, sizeof(stk->dflt)); 268 memcpy(&stk->dflt, cfg, sizeof(stk->dflt));
@@ -334,26 +278,21 @@ static int ide_config(struct pcmcia_device *link)
334 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 278 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
335 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 279 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
336 280
337 if(is_mmio)
338 my_outb = outb_mem;
339 else
340 my_outb = outb_io;
341
342 /* disable drive interrupts during IDE probe */ 281 /* disable drive interrupts during IDE probe */
343 my_outb(0x02, ctl_base); 282 outb(0x02, ctl_base);
344 283
345 /* special setup for KXLC005 card */ 284 /* special setup for KXLC005 card */
346 if (is_kme) 285 if (is_kme)
347 my_outb(0x81, ctl_base+1); 286 outb(0x81, ctl_base+1);
348 287
349 /* retry registration in case device is still spinning up */ 288 /* retry registration in case device is still spinning up */
350 for (hd = -1, i = 0; i < 10; i++) { 289 for (hd = -1, i = 0; i < 10; i++) {
351 hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, link, is_mmio); 290 hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, link);
352 if (hd >= 0) break; 291 if (hd >= 0) break;
353 if (try_slave) { 292 if (link->io.NumPorts1 == 0x20) {
354 my_outb(0x02, ctl_base + 0x10); 293 outb(0x02, ctl_base + 0x10);
355 hd = idecs_register(io_base + 0x10, ctl_base + 0x10, 294 hd = idecs_register(io_base + 0x10, ctl_base + 0x10,
356 link->irq.AssignedIRQ, link, is_mmio); 295 link->irq.AssignedIRQ, link);
357 if (hd >= 0) { 296 if (hd >= 0) {
358 io_base += 0x10; 297 io_base += 0x10;
359 ctl_base += 0x10; 298 ctl_base += 0x10;
diff --git a/drivers/ide/pci/generic.c b/drivers/ide/pci/generic.c
index f82e82109728..2f962cfa3f7f 100644
--- a/drivers/ide/pci/generic.c
+++ b/drivers/ide/pci/generic.c
@@ -212,6 +212,9 @@ static int __devinit generic_init_one(struct pci_dev *dev, const struct pci_devi
212 (!(PCI_FUNC(dev->devfn) & 1))) 212 (!(PCI_FUNC(dev->devfn) & 1)))
213 goto out; 213 goto out;
214 214
215 if (dev->vendor == PCI_VENDOR_ID_JMICRON && PCI_FUNC(dev->devfn) != 1)
216 goto out;
217
215 pci_read_config_word(dev, PCI_COMMAND, &command); 218 pci_read_config_word(dev, PCI_COMMAND, &command);
216 if (!(command & PCI_COMMAND_IO)) { 219 if (!(command & PCI_COMMAND_IO)) {
217 printk(KERN_INFO "Skipping disabled %s IDE controller.\n", d->name); 220 printk(KERN_INFO "Skipping disabled %s IDE controller.\n", d->name);
@@ -239,6 +242,11 @@ static struct pci_device_id generic_pci_tbl[] = {
239 { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 12}, 242 { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 12},
240 { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 13}, 243 { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 13},
241 { PCI_VENDOR_ID_NETCELL,PCI_DEVICE_ID_REVOLUTION, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 14}, 244 { PCI_VENDOR_ID_NETCELL,PCI_DEVICE_ID_REVOLUTION, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 14},
245 { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 15},
246 { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 16},
247 { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 17},
248 { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 18},
249 { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB368, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 19},
242 /* Must come last. If you add entries adjust this table appropriately and the init_one code */ 250 /* Must come last. If you add entries adjust this table appropriately and the init_one code */
243 { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_STORAGE_IDE << 8, 0xFFFFFF00UL, 0}, 251 { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_STORAGE_IDE << 8, 0xFFFFFF00UL, 0},
244 { 0, }, 252 { 0, },
diff --git a/drivers/ide/pci/it821x.c b/drivers/ide/pci/it821x.c
index 3cb04424d351..e9bad185968a 100644
--- a/drivers/ide/pci/it821x.c
+++ b/drivers/ide/pci/it821x.c
@@ -498,9 +498,14 @@ static int config_chipset_for_dma (ide_drive_t *drive)
498{ 498{
499 u8 speed = ide_dma_speed(drive, it821x_ratemask(drive)); 499 u8 speed = ide_dma_speed(drive, it821x_ratemask(drive));
500 500
501 config_it821x_chipset_for_pio(drive, !speed); 501 if (speed) {
502 it821x_tune_chipset(drive, speed); 502 config_it821x_chipset_for_pio(drive, 0);
503 return ide_dma_enable(drive); 503 it821x_tune_chipset(drive, speed);
504
505 return ide_dma_enable(drive);
506 }
507
508 return 0;
504} 509}
505 510
506/** 511/**
diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c
index d294bbc42f09..1205e8027829 100644
--- a/drivers/infiniband/core/addr.c
+++ b/drivers/infiniband/core/addr.c
@@ -35,6 +35,7 @@
35#include <net/arp.h> 35#include <net/arp.h>
36#include <net/neighbour.h> 36#include <net/neighbour.h>
37#include <net/route.h> 37#include <net/route.h>
38#include <net/netevent.h>
38#include <rdma/ib_addr.h> 39#include <rdma/ib_addr.h>
39 40
40MODULE_AUTHOR("Sean Hefty"); 41MODULE_AUTHOR("Sean Hefty");
@@ -326,25 +327,22 @@ void rdma_addr_cancel(struct rdma_dev_addr *addr)
326} 327}
327EXPORT_SYMBOL(rdma_addr_cancel); 328EXPORT_SYMBOL(rdma_addr_cancel);
328 329
329static int addr_arp_recv(struct sk_buff *skb, struct net_device *dev, 330static int netevent_callback(struct notifier_block *self, unsigned long event,
330 struct packet_type *pkt, struct net_device *orig_dev) 331 void *ctx)
331{ 332{
332 struct arphdr *arp_hdr; 333 if (event == NETEVENT_NEIGH_UPDATE) {
334 struct neighbour *neigh = ctx;
333 335
334 arp_hdr = (struct arphdr *) skb->nh.raw; 336 if (neigh->dev->type == ARPHRD_INFINIBAND &&
335 337 (neigh->nud_state & NUD_VALID)) {
336 if (arp_hdr->ar_op == htons(ARPOP_REQUEST) || 338 set_timeout(jiffies);
337 arp_hdr->ar_op == htons(ARPOP_REPLY)) 339 }
338 set_timeout(jiffies); 340 }
339
340 kfree_skb(skb);
341 return 0; 341 return 0;
342} 342}
343 343
344static struct packet_type addr_arp = { 344static struct notifier_block nb = {
345 .type = __constant_htons(ETH_P_ARP), 345 .notifier_call = netevent_callback
346 .func = addr_arp_recv,
347 .af_packet_priv = (void*) 1,
348}; 346};
349 347
350static int addr_init(void) 348static int addr_init(void)
@@ -353,13 +351,13 @@ static int addr_init(void)
353 if (!addr_wq) 351 if (!addr_wq)
354 return -ENOMEM; 352 return -ENOMEM;
355 353
356 dev_add_pack(&addr_arp); 354 register_netevent_notifier(&nb);
357 return 0; 355 return 0;
358} 356}
359 357
360static void addr_cleanup(void) 358static void addr_cleanup(void)
361{ 359{
362 dev_remove_pack(&addr_arp); 360 unregister_netevent_notifier(&nb);
363 destroy_workqueue(addr_wq); 361 destroy_workqueue(addr_wq);
364} 362}
365 363
diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
index 3f6705f3083a..0de335b7bfc2 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -701,7 +701,7 @@ static void cm_reset_to_idle(struct cm_id_private *cm_id_priv)
701 } 701 }
702} 702}
703 703
704void ib_destroy_cm_id(struct ib_cm_id *cm_id) 704static void cm_destroy_id(struct ib_cm_id *cm_id, int err)
705{ 705{
706 struct cm_id_private *cm_id_priv; 706 struct cm_id_private *cm_id_priv;
707 struct cm_work *work; 707 struct cm_work *work;
@@ -735,12 +735,22 @@ retest:
735 sizeof cm_id_priv->av.port->cm_dev->ca_guid, 735 sizeof cm_id_priv->av.port->cm_dev->ca_guid,
736 NULL, 0); 736 NULL, 0);
737 break; 737 break;
738 case IB_CM_REQ_RCVD:
739 if (err == -ENOMEM) {
740 /* Do not reject to allow future retries. */
741 cm_reset_to_idle(cm_id_priv);
742 spin_unlock_irqrestore(&cm_id_priv->lock, flags);
743 } else {
744 spin_unlock_irqrestore(&cm_id_priv->lock, flags);
745 ib_send_cm_rej(cm_id, IB_CM_REJ_CONSUMER_DEFINED,
746 NULL, 0, NULL, 0);
747 }
748 break;
738 case IB_CM_MRA_REQ_RCVD: 749 case IB_CM_MRA_REQ_RCVD:
739 case IB_CM_REP_SENT: 750 case IB_CM_REP_SENT:
740 case IB_CM_MRA_REP_RCVD: 751 case IB_CM_MRA_REP_RCVD:
741 ib_cancel_mad(cm_id_priv->av.port->mad_agent, cm_id_priv->msg); 752 ib_cancel_mad(cm_id_priv->av.port->mad_agent, cm_id_priv->msg);
742 /* Fall through */ 753 /* Fall through */
743 case IB_CM_REQ_RCVD:
744 case IB_CM_MRA_REQ_SENT: 754 case IB_CM_MRA_REQ_SENT:
745 case IB_CM_REP_RCVD: 755 case IB_CM_REP_RCVD:
746 case IB_CM_MRA_REP_SENT: 756 case IB_CM_MRA_REP_SENT:
@@ -775,6 +785,11 @@ retest:
775 kfree(cm_id_priv->private_data); 785 kfree(cm_id_priv->private_data);
776 kfree(cm_id_priv); 786 kfree(cm_id_priv);
777} 787}
788
789void ib_destroy_cm_id(struct ib_cm_id *cm_id)
790{
791 cm_destroy_id(cm_id, 0);
792}
778EXPORT_SYMBOL(ib_destroy_cm_id); 793EXPORT_SYMBOL(ib_destroy_cm_id);
779 794
780int ib_cm_listen(struct ib_cm_id *cm_id, __be64 service_id, __be64 service_mask, 795int ib_cm_listen(struct ib_cm_id *cm_id, __be64 service_id, __be64 service_mask,
@@ -960,8 +975,10 @@ int ib_send_cm_req(struct ib_cm_id *cm_id,
960 975
961 cm_id_priv->timewait_info = cm_create_timewait_info(cm_id_priv-> 976 cm_id_priv->timewait_info = cm_create_timewait_info(cm_id_priv->
962 id.local_id); 977 id.local_id);
963 if (IS_ERR(cm_id_priv->timewait_info)) 978 if (IS_ERR(cm_id_priv->timewait_info)) {
979 ret = PTR_ERR(cm_id_priv->timewait_info);
964 goto out; 980 goto out;
981 }
965 982
966 ret = cm_init_av_by_path(param->primary_path, &cm_id_priv->av); 983 ret = cm_init_av_by_path(param->primary_path, &cm_id_priv->av);
967 if (ret) 984 if (ret)
@@ -1163,7 +1180,7 @@ static void cm_process_work(struct cm_id_private *cm_id_priv,
1163 } 1180 }
1164 cm_deref_id(cm_id_priv); 1181 cm_deref_id(cm_id_priv);
1165 if (ret) 1182 if (ret)
1166 ib_destroy_cm_id(&cm_id_priv->id); 1183 cm_destroy_id(&cm_id_priv->id, ret);
1167} 1184}
1168 1185
1169static void cm_format_mra(struct cm_mra_msg *mra_msg, 1186static void cm_format_mra(struct cm_mra_msg *mra_msg,
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index 863f64befc7c..d6f99d5720fc 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -262,14 +262,14 @@ static void cma_detach_from_dev(struct rdma_id_private *id_priv)
262static int cma_acquire_ib_dev(struct rdma_id_private *id_priv) 262static int cma_acquire_ib_dev(struct rdma_id_private *id_priv)
263{ 263{
264 struct cma_device *cma_dev; 264 struct cma_device *cma_dev;
265 union ib_gid *gid; 265 union ib_gid gid;
266 int ret = -ENODEV; 266 int ret = -ENODEV;
267 267
268 gid = ib_addr_get_sgid(&id_priv->id.route.addr.dev_addr); 268 ib_addr_get_sgid(&id_priv->id.route.addr.dev_addr, &gid),
269 269
270 mutex_lock(&lock); 270 mutex_lock(&lock);
271 list_for_each_entry(cma_dev, &dev_list, list) { 271 list_for_each_entry(cma_dev, &dev_list, list) {
272 ret = ib_find_cached_gid(cma_dev->device, gid, 272 ret = ib_find_cached_gid(cma_dev->device, &gid,
273 &id_priv->id.port_num, NULL); 273 &id_priv->id.port_num, NULL);
274 if (!ret) { 274 if (!ret) {
275 cma_attach_to_dev(id_priv, cma_dev); 275 cma_attach_to_dev(id_priv, cma_dev);
@@ -812,6 +812,7 @@ static int cma_ib_handler(struct ib_cm_id *cm_id, struct ib_cm_event *ib_event)
812 cma_modify_qp_err(&id_priv->id); 812 cma_modify_qp_err(&id_priv->id);
813 status = ib_event->param.rej_rcvd.reason; 813 status = ib_event->param.rej_rcvd.reason;
814 event = RDMA_CM_EVENT_REJECTED; 814 event = RDMA_CM_EVENT_REJECTED;
815 private_data_len = IB_CM_REJ_PRIVATE_DATA_SIZE;
815 break; 816 break;
816 default: 817 default:
817 printk(KERN_ERR "RDMA CMA: unexpected IB CM event: %d", 818 printk(KERN_ERR "RDMA CMA: unexpected IB CM event: %d",
@@ -1134,8 +1135,8 @@ static int cma_query_ib_route(struct rdma_id_private *id_priv, int timeout_ms,
1134 struct ib_sa_path_rec path_rec; 1135 struct ib_sa_path_rec path_rec;
1135 1136
1136 memset(&path_rec, 0, sizeof path_rec); 1137 memset(&path_rec, 0, sizeof path_rec);
1137 path_rec.sgid = *ib_addr_get_sgid(addr); 1138 ib_addr_get_sgid(addr, &path_rec.sgid);
1138 path_rec.dgid = *ib_addr_get_dgid(addr); 1139 ib_addr_get_dgid(addr, &path_rec.dgid);
1139 path_rec.pkey = cpu_to_be16(ib_addr_get_pkey(addr)); 1140 path_rec.pkey = cpu_to_be16(ib_addr_get_pkey(addr));
1140 path_rec.numb_path = 1; 1141 path_rec.numb_path = 1;
1141 1142
@@ -1263,7 +1264,7 @@ static int cma_bind_loopback(struct rdma_id_private *id_priv)
1263{ 1264{
1264 struct cma_device *cma_dev; 1265 struct cma_device *cma_dev;
1265 struct ib_port_attr port_attr; 1266 struct ib_port_attr port_attr;
1266 union ib_gid *gid; 1267 union ib_gid gid;
1267 u16 pkey; 1268 u16 pkey;
1268 int ret; 1269 int ret;
1269 u8 p; 1270 u8 p;
@@ -1284,8 +1285,7 @@ static int cma_bind_loopback(struct rdma_id_private *id_priv)
1284 } 1285 }
1285 1286
1286port_found: 1287port_found:
1287 gid = ib_addr_get_sgid(&id_priv->id.route.addr.dev_addr); 1288 ret = ib_get_cached_gid(cma_dev->device, p, 0, &gid);
1288 ret = ib_get_cached_gid(cma_dev->device, p, 0, gid);
1289 if (ret) 1289 if (ret)
1290 goto out; 1290 goto out;
1291 1291
@@ -1293,6 +1293,7 @@ port_found:
1293 if (ret) 1293 if (ret)
1294 goto out; 1294 goto out;
1295 1295
1296 ib_addr_set_sgid(&id_priv->id.route.addr.dev_addr, &gid);
1296 ib_addr_set_pkey(&id_priv->id.route.addr.dev_addr, pkey); 1297 ib_addr_set_pkey(&id_priv->id.route.addr.dev_addr, pkey);
1297 id_priv->id.port_num = p; 1298 id_priv->id.port_num = p;
1298 cma_attach_to_dev(id_priv, cma_dev); 1299 cma_attach_to_dev(id_priv, cma_dev);
@@ -1339,6 +1340,7 @@ static int cma_resolve_loopback(struct rdma_id_private *id_priv)
1339{ 1340{
1340 struct cma_work *work; 1341 struct cma_work *work;
1341 struct sockaddr_in *src_in, *dst_in; 1342 struct sockaddr_in *src_in, *dst_in;
1343 union ib_gid gid;
1342 int ret; 1344 int ret;
1343 1345
1344 work = kzalloc(sizeof *work, GFP_KERNEL); 1346 work = kzalloc(sizeof *work, GFP_KERNEL);
@@ -1351,8 +1353,8 @@ static int cma_resolve_loopback(struct rdma_id_private *id_priv)
1351 goto err; 1353 goto err;
1352 } 1354 }
1353 1355
1354 ib_addr_set_dgid(&id_priv->id.route.addr.dev_addr, 1356 ib_addr_get_sgid(&id_priv->id.route.addr.dev_addr, &gid);
1355 ib_addr_get_sgid(&id_priv->id.route.addr.dev_addr)); 1357 ib_addr_set_dgid(&id_priv->id.route.addr.dev_addr, &gid);
1356 1358
1357 if (cma_zero_addr(&id_priv->id.route.addr.src_addr)) { 1359 if (cma_zero_addr(&id_priv->id.route.addr.src_addr)) {
1358 src_in = (struct sockaddr_in *)&id_priv->id.route.addr.src_addr; 1360 src_in = (struct sockaddr_in *)&id_priv->id.route.addr.src_addr;
diff --git a/drivers/infiniband/core/fmr_pool.c b/drivers/infiniband/core/fmr_pool.c
index 615fe9cc6c56..86a3b2d401db 100644
--- a/drivers/infiniband/core/fmr_pool.c
+++ b/drivers/infiniband/core/fmr_pool.c
@@ -426,7 +426,7 @@ EXPORT_SYMBOL(ib_flush_fmr_pool);
426struct ib_pool_fmr *ib_fmr_pool_map_phys(struct ib_fmr_pool *pool_handle, 426struct ib_pool_fmr *ib_fmr_pool_map_phys(struct ib_fmr_pool *pool_handle,
427 u64 *page_list, 427 u64 *page_list,
428 int list_len, 428 int list_len,
429 u64 *io_virtual_address) 429 u64 io_virtual_address)
430{ 430{
431 struct ib_fmr_pool *pool = pool_handle; 431 struct ib_fmr_pool *pool = pool_handle;
432 struct ib_pool_fmr *fmr; 432 struct ib_pool_fmr *fmr;
@@ -440,7 +440,7 @@ struct ib_pool_fmr *ib_fmr_pool_map_phys(struct ib_fmr_pool *pool_handle,
440 fmr = ib_fmr_cache_lookup(pool, 440 fmr = ib_fmr_cache_lookup(pool,
441 page_list, 441 page_list,
442 list_len, 442 list_len,
443 *io_virtual_address); 443 io_virtual_address);
444 if (fmr) { 444 if (fmr) {
445 /* found in cache */ 445 /* found in cache */
446 ++fmr->ref_count; 446 ++fmr->ref_count;
@@ -464,7 +464,7 @@ struct ib_pool_fmr *ib_fmr_pool_map_phys(struct ib_fmr_pool *pool_handle,
464 spin_unlock_irqrestore(&pool->pool_lock, flags); 464 spin_unlock_irqrestore(&pool->pool_lock, flags);
465 465
466 result = ib_map_phys_fmr(fmr->fmr, page_list, list_len, 466 result = ib_map_phys_fmr(fmr->fmr, page_list, list_len,
467 *io_virtual_address); 467 io_virtual_address);
468 468
469 if (result) { 469 if (result) {
470 spin_lock_irqsave(&pool->pool_lock, flags); 470 spin_lock_irqsave(&pool->pool_lock, flags);
@@ -481,7 +481,7 @@ struct ib_pool_fmr *ib_fmr_pool_map_phys(struct ib_fmr_pool *pool_handle,
481 fmr->ref_count = 1; 481 fmr->ref_count = 1;
482 482
483 if (pool->cache_bucket) { 483 if (pool->cache_bucket) {
484 fmr->io_virtual_address = *io_virtual_address; 484 fmr->io_virtual_address = io_virtual_address;
485 fmr->page_list_len = list_len; 485 fmr->page_list_len = list_len;
486 memcpy(fmr->page_list, page_list, list_len * sizeof(*page_list)); 486 memcpy(fmr->page_list, page_list, list_len * sizeof(*page_list));
487 487
diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c
index 5ed4dab52a6f..1c3cfbbe6a97 100644
--- a/drivers/infiniband/core/mad.c
+++ b/drivers/infiniband/core/mad.c
@@ -167,6 +167,15 @@ static int is_vendor_method_in_use(
167 return 0; 167 return 0;
168} 168}
169 169
170int ib_response_mad(struct ib_mad *mad)
171{
172 return ((mad->mad_hdr.method & IB_MGMT_METHOD_RESP) ||
173 (mad->mad_hdr.method == IB_MGMT_METHOD_TRAP_REPRESS) ||
174 ((mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_BM) &&
175 (mad->mad_hdr.attr_mod & IB_BM_ATTR_MOD_RESP)));
176}
177EXPORT_SYMBOL(ib_response_mad);
178
170/* 179/*
171 * ib_register_mad_agent - Register to send/receive MADs 180 * ib_register_mad_agent - Register to send/receive MADs
172 */ 181 */
@@ -570,13 +579,6 @@ int ib_unregister_mad_agent(struct ib_mad_agent *mad_agent)
570} 579}
571EXPORT_SYMBOL(ib_unregister_mad_agent); 580EXPORT_SYMBOL(ib_unregister_mad_agent);
572 581
573static inline int response_mad(struct ib_mad *mad)
574{
575 /* Trap represses are responses although response bit is reset */
576 return ((mad->mad_hdr.method == IB_MGMT_METHOD_TRAP_REPRESS) ||
577 (mad->mad_hdr.method & IB_MGMT_METHOD_RESP));
578}
579
580static void dequeue_mad(struct ib_mad_list_head *mad_list) 582static void dequeue_mad(struct ib_mad_list_head *mad_list)
581{ 583{
582 struct ib_mad_queue *mad_queue; 584 struct ib_mad_queue *mad_queue;
@@ -723,7 +725,7 @@ static int handle_outgoing_dr_smp(struct ib_mad_agent_private *mad_agent_priv,
723 switch (ret) 725 switch (ret)
724 { 726 {
725 case IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_REPLY: 727 case IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_REPLY:
726 if (response_mad(&mad_priv->mad.mad) && 728 if (ib_response_mad(&mad_priv->mad.mad) &&
727 mad_agent_priv->agent.recv_handler) { 729 mad_agent_priv->agent.recv_handler) {
728 local->mad_priv = mad_priv; 730 local->mad_priv = mad_priv;
729 local->recv_mad_agent = mad_agent_priv; 731 local->recv_mad_agent = mad_agent_priv;
@@ -1551,7 +1553,7 @@ find_mad_agent(struct ib_mad_port_private *port_priv,
1551 unsigned long flags; 1553 unsigned long flags;
1552 1554
1553 spin_lock_irqsave(&port_priv->reg_lock, flags); 1555 spin_lock_irqsave(&port_priv->reg_lock, flags);
1554 if (response_mad(mad)) { 1556 if (ib_response_mad(mad)) {
1555 u32 hi_tid; 1557 u32 hi_tid;
1556 struct ib_mad_agent_private *entry; 1558 struct ib_mad_agent_private *entry;
1557 1559
@@ -1799,7 +1801,7 @@ static void ib_mad_complete_recv(struct ib_mad_agent_private *mad_agent_priv,
1799 } 1801 }
1800 1802
1801 /* Complete corresponding request */ 1803 /* Complete corresponding request */
1802 if (response_mad(mad_recv_wc->recv_buf.mad)) { 1804 if (ib_response_mad(mad_recv_wc->recv_buf.mad)) {
1803 spin_lock_irqsave(&mad_agent_priv->lock, flags); 1805 spin_lock_irqsave(&mad_agent_priv->lock, flags);
1804 mad_send_wr = ib_find_send_mad(mad_agent_priv, mad_recv_wc); 1806 mad_send_wr = ib_find_send_mad(mad_agent_priv, mad_recv_wc);
1805 if (!mad_send_wr) { 1807 if (!mad_send_wr) {
diff --git a/drivers/infiniband/core/sa_query.c b/drivers/infiniband/core/sa_query.c
index e911c99ff843..aeda484ffd82 100644
--- a/drivers/infiniband/core/sa_query.c
+++ b/drivers/infiniband/core/sa_query.c
@@ -488,13 +488,13 @@ static void init_mad(struct ib_sa_mad *mad, struct ib_mad_agent *agent)
488 spin_unlock_irqrestore(&tid_lock, flags); 488 spin_unlock_irqrestore(&tid_lock, flags);
489} 489}
490 490
491static int send_mad(struct ib_sa_query *query, int timeout_ms) 491static int send_mad(struct ib_sa_query *query, int timeout_ms, gfp_t gfp_mask)
492{ 492{
493 unsigned long flags; 493 unsigned long flags;
494 int ret, id; 494 int ret, id;
495 495
496retry: 496retry:
497 if (!idr_pre_get(&query_idr, GFP_ATOMIC)) 497 if (!idr_pre_get(&query_idr, gfp_mask))
498 return -ENOMEM; 498 return -ENOMEM;
499 spin_lock_irqsave(&idr_lock, flags); 499 spin_lock_irqsave(&idr_lock, flags);
500 ret = idr_get_new(&query_idr, query, &id); 500 ret = idr_get_new(&query_idr, query, &id);
@@ -630,7 +630,7 @@ int ib_sa_path_rec_get(struct ib_device *device, u8 port_num,
630 630
631 *sa_query = &query->sa_query; 631 *sa_query = &query->sa_query;
632 632
633 ret = send_mad(&query->sa_query, timeout_ms); 633 ret = send_mad(&query->sa_query, timeout_ms, gfp_mask);
634 if (ret < 0) 634 if (ret < 0)
635 goto err2; 635 goto err2;
636 636
@@ -752,7 +752,7 @@ int ib_sa_service_rec_query(struct ib_device *device, u8 port_num, u8 method,
752 752
753 *sa_query = &query->sa_query; 753 *sa_query = &query->sa_query;
754 754
755 ret = send_mad(&query->sa_query, timeout_ms); 755 ret = send_mad(&query->sa_query, timeout_ms, gfp_mask);
756 if (ret < 0) 756 if (ret < 0)
757 goto err2; 757 goto err2;
758 758
@@ -844,7 +844,7 @@ int ib_sa_mcmember_rec_query(struct ib_device *device, u8 port_num,
844 844
845 *sa_query = &query->sa_query; 845 *sa_query = &query->sa_query;
846 846
847 ret = send_mad(&query->sa_query, timeout_ms); 847 ret = send_mad(&query->sa_query, timeout_ms, gfp_mask);
848 if (ret < 0) 848 if (ret < 0)
849 goto err2; 849 goto err2;
850 850
diff --git a/drivers/infiniband/core/user_mad.c b/drivers/infiniband/core/user_mad.c
index afe70a549c2f..1273f8807e84 100644
--- a/drivers/infiniband/core/user_mad.c
+++ b/drivers/infiniband/core/user_mad.c
@@ -112,8 +112,10 @@ struct ib_umad_device {
112struct ib_umad_file { 112struct ib_umad_file {
113 struct ib_umad_port *port; 113 struct ib_umad_port *port;
114 struct list_head recv_list; 114 struct list_head recv_list;
115 struct list_head send_list;
115 struct list_head port_list; 116 struct list_head port_list;
116 spinlock_t recv_lock; 117 spinlock_t recv_lock;
118 spinlock_t send_lock;
117 wait_queue_head_t recv_wait; 119 wait_queue_head_t recv_wait;
118 struct ib_mad_agent *agent[IB_UMAD_MAX_AGENTS]; 120 struct ib_mad_agent *agent[IB_UMAD_MAX_AGENTS];
119 int agents_dead; 121 int agents_dead;
@@ -177,12 +179,21 @@ static int queue_packet(struct ib_umad_file *file,
177 return ret; 179 return ret;
178} 180}
179 181
182static void dequeue_send(struct ib_umad_file *file,
183 struct ib_umad_packet *packet)
184 {
185 spin_lock_irq(&file->send_lock);
186 list_del(&packet->list);
187 spin_unlock_irq(&file->send_lock);
188 }
189
180static void send_handler(struct ib_mad_agent *agent, 190static void send_handler(struct ib_mad_agent *agent,
181 struct ib_mad_send_wc *send_wc) 191 struct ib_mad_send_wc *send_wc)
182{ 192{
183 struct ib_umad_file *file = agent->context; 193 struct ib_umad_file *file = agent->context;
184 struct ib_umad_packet *packet = send_wc->send_buf->context[0]; 194 struct ib_umad_packet *packet = send_wc->send_buf->context[0];
185 195
196 dequeue_send(file, packet);
186 ib_destroy_ah(packet->msg->ah); 197 ib_destroy_ah(packet->msg->ah);
187 ib_free_send_mad(packet->msg); 198 ib_free_send_mad(packet->msg);
188 199
@@ -370,6 +381,51 @@ static int copy_rmpp_mad(struct ib_mad_send_buf *msg, const char __user *buf)
370 return 0; 381 return 0;
371} 382}
372 383
384static int same_destination(struct ib_user_mad_hdr *hdr1,
385 struct ib_user_mad_hdr *hdr2)
386{
387 if (!hdr1->grh_present && !hdr2->grh_present)
388 return (hdr1->lid == hdr2->lid);
389
390 if (hdr1->grh_present && hdr2->grh_present)
391 return !memcmp(hdr1->gid, hdr2->gid, 16);
392
393 return 0;
394}
395
396static int is_duplicate(struct ib_umad_file *file,
397 struct ib_umad_packet *packet)
398{
399 struct ib_umad_packet *sent_packet;
400 struct ib_mad_hdr *sent_hdr, *hdr;
401
402 hdr = (struct ib_mad_hdr *) packet->mad.data;
403 list_for_each_entry(sent_packet, &file->send_list, list) {
404 sent_hdr = (struct ib_mad_hdr *) sent_packet->mad.data;
405
406 if ((hdr->tid != sent_hdr->tid) ||
407 (hdr->mgmt_class != sent_hdr->mgmt_class))
408 continue;
409
410 /*
411 * No need to be overly clever here. If two new operations have
412 * the same TID, reject the second as a duplicate. This is more
413 * restrictive than required by the spec.
414 */
415 if (!ib_response_mad((struct ib_mad *) hdr)) {
416 if (!ib_response_mad((struct ib_mad *) sent_hdr))
417 return 1;
418 continue;
419 } else if (!ib_response_mad((struct ib_mad *) sent_hdr))
420 continue;
421
422 if (same_destination(&packet->mad.hdr, &sent_packet->mad.hdr))
423 return 1;
424 }
425
426 return 0;
427}
428
373static ssize_t ib_umad_write(struct file *filp, const char __user *buf, 429static ssize_t ib_umad_write(struct file *filp, const char __user *buf,
374 size_t count, loff_t *pos) 430 size_t count, loff_t *pos)
375{ 431{
@@ -379,7 +435,6 @@ static ssize_t ib_umad_write(struct file *filp, const char __user *buf,
379 struct ib_ah_attr ah_attr; 435 struct ib_ah_attr ah_attr;
380 struct ib_ah *ah; 436 struct ib_ah *ah;
381 struct ib_rmpp_mad *rmpp_mad; 437 struct ib_rmpp_mad *rmpp_mad;
382 u8 method;
383 __be64 *tid; 438 __be64 *tid;
384 int ret, data_len, hdr_len, copy_offset, rmpp_active; 439 int ret, data_len, hdr_len, copy_offset, rmpp_active;
385 440
@@ -473,28 +528,36 @@ static ssize_t ib_umad_write(struct file *filp, const char __user *buf,
473 } 528 }
474 529
475 /* 530 /*
476 * If userspace is generating a request that will generate a 531 * Set the high-order part of the transaction ID to make MADs from
477 * response, we need to make sure the high-order part of the 532 * different agents unique, and allow routing responses back to the
478 * transaction ID matches the agent being used to send the 533 * original requestor.
479 * MAD.
480 */ 534 */
481 method = ((struct ib_mad_hdr *) packet->msg->mad)->method; 535 if (!ib_response_mad(packet->msg->mad)) {
482
483 if (!(method & IB_MGMT_METHOD_RESP) &&
484 method != IB_MGMT_METHOD_TRAP_REPRESS &&
485 method != IB_MGMT_METHOD_SEND) {
486 tid = &((struct ib_mad_hdr *) packet->msg->mad)->tid; 536 tid = &((struct ib_mad_hdr *) packet->msg->mad)->tid;
487 *tid = cpu_to_be64(((u64) agent->hi_tid) << 32 | 537 *tid = cpu_to_be64(((u64) agent->hi_tid) << 32 |
488 (be64_to_cpup(tid) & 0xffffffff)); 538 (be64_to_cpup(tid) & 0xffffffff));
539 rmpp_mad->mad_hdr.tid = *tid;
540 }
541
542 spin_lock_irq(&file->send_lock);
543 ret = is_duplicate(file, packet);
544 if (!ret)
545 list_add_tail(&packet->list, &file->send_list);
546 spin_unlock_irq(&file->send_lock);
547 if (ret) {
548 ret = -EINVAL;
549 goto err_msg;
489 } 550 }
490 551
491 ret = ib_post_send_mad(packet->msg, NULL); 552 ret = ib_post_send_mad(packet->msg, NULL);
492 if (ret) 553 if (ret)
493 goto err_msg; 554 goto err_send;
494 555
495 up_read(&file->port->mutex); 556 up_read(&file->port->mutex);
496 return count; 557 return count;
497 558
559err_send:
560 dequeue_send(file, packet);
498err_msg: 561err_msg:
499 ib_free_send_mad(packet->msg); 562 ib_free_send_mad(packet->msg);
500err_ah: 563err_ah:
@@ -657,7 +720,9 @@ static int ib_umad_open(struct inode *inode, struct file *filp)
657 } 720 }
658 721
659 spin_lock_init(&file->recv_lock); 722 spin_lock_init(&file->recv_lock);
723 spin_lock_init(&file->send_lock);
660 INIT_LIST_HEAD(&file->recv_list); 724 INIT_LIST_HEAD(&file->recv_list);
725 INIT_LIST_HEAD(&file->send_list);
661 init_waitqueue_head(&file->recv_wait); 726 init_waitqueue_head(&file->recv_wait);
662 727
663 file->port = port; 728 file->port = port;
diff --git a/drivers/infiniband/core/uverbs.h b/drivers/infiniband/core/uverbs.h
index bb9bee56a824..102a59c033ff 100644
--- a/drivers/infiniband/core/uverbs.h
+++ b/drivers/infiniband/core/uverbs.h
@@ -42,6 +42,7 @@
42#include <linux/kref.h> 42#include <linux/kref.h>
43#include <linux/idr.h> 43#include <linux/idr.h>
44#include <linux/mutex.h> 44#include <linux/mutex.h>
45#include <linux/completion.h>
45 46
46#include <rdma/ib_verbs.h> 47#include <rdma/ib_verbs.h>
47#include <rdma/ib_user_verbs.h> 48#include <rdma/ib_user_verbs.h>
@@ -69,6 +70,7 @@
69 70
70struct ib_uverbs_device { 71struct ib_uverbs_device {
71 struct kref ref; 72 struct kref ref;
73 struct completion comp;
72 int devnum; 74 int devnum;
73 struct cdev *dev; 75 struct cdev *dev;
74 struct class_device *class_dev; 76 struct class_device *class_dev;
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
index bdf5d5098190..30923eb68ec7 100644
--- a/drivers/infiniband/core/uverbs_cmd.c
+++ b/drivers/infiniband/core/uverbs_cmd.c
@@ -42,6 +42,13 @@
42 42
43#include "uverbs.h" 43#include "uverbs.h"
44 44
45static struct lock_class_key pd_lock_key;
46static struct lock_class_key mr_lock_key;
47static struct lock_class_key cq_lock_key;
48static struct lock_class_key qp_lock_key;
49static struct lock_class_key ah_lock_key;
50static struct lock_class_key srq_lock_key;
51
45#define INIT_UDATA(udata, ibuf, obuf, ilen, olen) \ 52#define INIT_UDATA(udata, ibuf, obuf, ilen, olen) \
46 do { \ 53 do { \
47 (udata)->inbuf = (void __user *) (ibuf); \ 54 (udata)->inbuf = (void __user *) (ibuf); \
@@ -76,12 +83,13 @@
76 */ 83 */
77 84
78static void init_uobj(struct ib_uobject *uobj, u64 user_handle, 85static void init_uobj(struct ib_uobject *uobj, u64 user_handle,
79 struct ib_ucontext *context) 86 struct ib_ucontext *context, struct lock_class_key *key)
80{ 87{
81 uobj->user_handle = user_handle; 88 uobj->user_handle = user_handle;
82 uobj->context = context; 89 uobj->context = context;
83 kref_init(&uobj->ref); 90 kref_init(&uobj->ref);
84 init_rwsem(&uobj->mutex); 91 init_rwsem(&uobj->mutex);
92 lockdep_set_class(&uobj->mutex, key);
85 uobj->live = 0; 93 uobj->live = 0;
86} 94}
87 95
@@ -470,7 +478,7 @@ ssize_t ib_uverbs_alloc_pd(struct ib_uverbs_file *file,
470 if (!uobj) 478 if (!uobj)
471 return -ENOMEM; 479 return -ENOMEM;
472 480
473 init_uobj(uobj, 0, file->ucontext); 481 init_uobj(uobj, 0, file->ucontext, &pd_lock_key);
474 down_write(&uobj->mutex); 482 down_write(&uobj->mutex);
475 483
476 pd = file->device->ib_dev->alloc_pd(file->device->ib_dev, 484 pd = file->device->ib_dev->alloc_pd(file->device->ib_dev,
@@ -591,7 +599,7 @@ ssize_t ib_uverbs_reg_mr(struct ib_uverbs_file *file,
591 if (!obj) 599 if (!obj)
592 return -ENOMEM; 600 return -ENOMEM;
593 601
594 init_uobj(&obj->uobject, 0, file->ucontext); 602 init_uobj(&obj->uobject, 0, file->ucontext, &mr_lock_key);
595 down_write(&obj->uobject.mutex); 603 down_write(&obj->uobject.mutex);
596 604
597 /* 605 /*
@@ -770,7 +778,7 @@ ssize_t ib_uverbs_create_cq(struct ib_uverbs_file *file,
770 if (!obj) 778 if (!obj)
771 return -ENOMEM; 779 return -ENOMEM;
772 780
773 init_uobj(&obj->uobject, cmd.user_handle, file->ucontext); 781 init_uobj(&obj->uobject, cmd.user_handle, file->ucontext, &cq_lock_key);
774 down_write(&obj->uobject.mutex); 782 down_write(&obj->uobject.mutex);
775 783
776 if (cmd.comp_channel >= 0) { 784 if (cmd.comp_channel >= 0) {
@@ -1051,13 +1059,14 @@ ssize_t ib_uverbs_create_qp(struct ib_uverbs_file *file,
1051 if (!obj) 1059 if (!obj)
1052 return -ENOMEM; 1060 return -ENOMEM;
1053 1061
1054 init_uobj(&obj->uevent.uobject, cmd.user_handle, file->ucontext); 1062 init_uobj(&obj->uevent.uobject, cmd.user_handle, file->ucontext, &qp_lock_key);
1055 down_write(&obj->uevent.uobject.mutex); 1063 down_write(&obj->uevent.uobject.mutex);
1056 1064
1065 srq = cmd.is_srq ? idr_read_srq(cmd.srq_handle, file->ucontext) : NULL;
1057 pd = idr_read_pd(cmd.pd_handle, file->ucontext); 1066 pd = idr_read_pd(cmd.pd_handle, file->ucontext);
1058 scq = idr_read_cq(cmd.send_cq_handle, file->ucontext); 1067 scq = idr_read_cq(cmd.send_cq_handle, file->ucontext);
1059 rcq = idr_read_cq(cmd.recv_cq_handle, file->ucontext); 1068 rcq = cmd.recv_cq_handle == cmd.send_cq_handle ?
1060 srq = cmd.is_srq ? idr_read_srq(cmd.srq_handle, file->ucontext) : NULL; 1069 scq : idr_read_cq(cmd.recv_cq_handle, file->ucontext);
1061 1070
1062 if (!pd || !scq || !rcq || (cmd.is_srq && !srq)) { 1071 if (!pd || !scq || !rcq || (cmd.is_srq && !srq)) {
1063 ret = -EINVAL; 1072 ret = -EINVAL;
@@ -1125,7 +1134,8 @@ ssize_t ib_uverbs_create_qp(struct ib_uverbs_file *file,
1125 1134
1126 put_pd_read(pd); 1135 put_pd_read(pd);
1127 put_cq_read(scq); 1136 put_cq_read(scq);
1128 put_cq_read(rcq); 1137 if (rcq != scq)
1138 put_cq_read(rcq);
1129 if (srq) 1139 if (srq)
1130 put_srq_read(srq); 1140 put_srq_read(srq);
1131 1141
@@ -1150,7 +1160,7 @@ err_put:
1150 put_pd_read(pd); 1160 put_pd_read(pd);
1151 if (scq) 1161 if (scq)
1152 put_cq_read(scq); 1162 put_cq_read(scq);
1153 if (rcq) 1163 if (rcq && rcq != scq)
1154 put_cq_read(rcq); 1164 put_cq_read(rcq);
1155 if (srq) 1165 if (srq)
1156 put_srq_read(srq); 1166 put_srq_read(srq);
@@ -1751,7 +1761,7 @@ ssize_t ib_uverbs_create_ah(struct ib_uverbs_file *file,
1751 if (!uobj) 1761 if (!uobj)
1752 return -ENOMEM; 1762 return -ENOMEM;
1753 1763
1754 init_uobj(uobj, cmd.user_handle, file->ucontext); 1764 init_uobj(uobj, cmd.user_handle, file->ucontext, &ah_lock_key);
1755 down_write(&uobj->mutex); 1765 down_write(&uobj->mutex);
1756 1766
1757 pd = idr_read_pd(cmd.pd_handle, file->ucontext); 1767 pd = idr_read_pd(cmd.pd_handle, file->ucontext);
@@ -1775,7 +1785,7 @@ ssize_t ib_uverbs_create_ah(struct ib_uverbs_file *file,
1775 ah = ib_create_ah(pd, &attr); 1785 ah = ib_create_ah(pd, &attr);
1776 if (IS_ERR(ah)) { 1786 if (IS_ERR(ah)) {
1777 ret = PTR_ERR(ah); 1787 ret = PTR_ERR(ah);
1778 goto err; 1788 goto err_put;
1779 } 1789 }
1780 1790
1781 ah->uobject = uobj; 1791 ah->uobject = uobj;
@@ -1811,6 +1821,9 @@ err_copy:
1811err_destroy: 1821err_destroy:
1812 ib_destroy_ah(ah); 1822 ib_destroy_ah(ah);
1813 1823
1824err_put:
1825 put_pd_read(pd);
1826
1814err: 1827err:
1815 put_uobj_write(uobj); 1828 put_uobj_write(uobj);
1816 return ret; 1829 return ret;
@@ -1963,7 +1976,7 @@ ssize_t ib_uverbs_create_srq(struct ib_uverbs_file *file,
1963 if (!obj) 1976 if (!obj)
1964 return -ENOMEM; 1977 return -ENOMEM;
1965 1978
1966 init_uobj(&obj->uobject, cmd.user_handle, file->ucontext); 1979 init_uobj(&obj->uobject, cmd.user_handle, file->ucontext, &srq_lock_key);
1967 down_write(&obj->uobject.mutex); 1980 down_write(&obj->uobject.mutex);
1968 1981
1969 pd = idr_read_pd(cmd.pd_handle, file->ucontext); 1982 pd = idr_read_pd(cmd.pd_handle, file->ucontext);
@@ -1984,7 +1997,7 @@ ssize_t ib_uverbs_create_srq(struct ib_uverbs_file *file,
1984 srq = pd->device->create_srq(pd, &attr, &udata); 1997 srq = pd->device->create_srq(pd, &attr, &udata);
1985 if (IS_ERR(srq)) { 1998 if (IS_ERR(srq)) {
1986 ret = PTR_ERR(srq); 1999 ret = PTR_ERR(srq);
1987 goto err; 2000 goto err_put;
1988 } 2001 }
1989 2002
1990 srq->device = pd->device; 2003 srq->device = pd->device;
@@ -2029,6 +2042,9 @@ err_copy:
2029err_destroy: 2042err_destroy:
2030 ib_destroy_srq(srq); 2043 ib_destroy_srq(srq);
2031 2044
2045err_put:
2046 put_pd_read(pd);
2047
2032err: 2048err:
2033 put_uobj_write(&obj->uobject); 2049 put_uobj_write(&obj->uobject);
2034 return ret; 2050 return ret;
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c
index e725cccc7cde..4e16314e8e6d 100644
--- a/drivers/infiniband/core/uverbs_main.c
+++ b/drivers/infiniband/core/uverbs_main.c
@@ -122,7 +122,7 @@ static void ib_uverbs_release_dev(struct kref *ref)
122 struct ib_uverbs_device *dev = 122 struct ib_uverbs_device *dev =
123 container_of(ref, struct ib_uverbs_device, ref); 123 container_of(ref, struct ib_uverbs_device, ref);
124 124
125 kfree(dev); 125 complete(&dev->comp);
126} 126}
127 127
128void ib_uverbs_release_ucq(struct ib_uverbs_file *file, 128void ib_uverbs_release_ucq(struct ib_uverbs_file *file,
@@ -740,6 +740,7 @@ static void ib_uverbs_add_one(struct ib_device *device)
740 return; 740 return;
741 741
742 kref_init(&uverbs_dev->ref); 742 kref_init(&uverbs_dev->ref);
743 init_completion(&uverbs_dev->comp);
743 744
744 spin_lock(&map_lock); 745 spin_lock(&map_lock);
745 uverbs_dev->devnum = find_first_zero_bit(dev_map, IB_UVERBS_MAX_DEVICES); 746 uverbs_dev->devnum = find_first_zero_bit(dev_map, IB_UVERBS_MAX_DEVICES);
@@ -793,6 +794,8 @@ err_cdev:
793 794
794err: 795err:
795 kref_put(&uverbs_dev->ref, ib_uverbs_release_dev); 796 kref_put(&uverbs_dev->ref, ib_uverbs_release_dev);
797 wait_for_completion(&uverbs_dev->comp);
798 kfree(uverbs_dev);
796 return; 799 return;
797} 800}
798 801
@@ -812,7 +815,10 @@ static void ib_uverbs_remove_one(struct ib_device *device)
812 spin_unlock(&map_lock); 815 spin_unlock(&map_lock);
813 816
814 clear_bit(uverbs_dev->devnum, dev_map); 817 clear_bit(uverbs_dev->devnum, dev_map);
818
815 kref_put(&uverbs_dev->ref, ib_uverbs_release_dev); 819 kref_put(&uverbs_dev->ref, ib_uverbs_release_dev);
820 wait_for_completion(&uverbs_dev->comp);
821 kfree(uverbs_dev);
816} 822}
817 823
818static int uverbs_event_get_sb(struct file_system_type *fs_type, int flags, 824static int uverbs_event_get_sb(struct file_system_type *fs_type, int flags,
diff --git a/drivers/infiniband/hw/ipath/ipath_driver.c b/drivers/infiniband/hw/ipath/ipath_driver.c
index 823131d58b34..f98518d912b5 100644
--- a/drivers/infiniband/hw/ipath/ipath_driver.c
+++ b/drivers/infiniband/hw/ipath/ipath_driver.c
@@ -859,6 +859,38 @@ static void ipath_rcv_layer(struct ipath_devdata *dd, u32 etail,
859 __ipath_layer_rcv_lid(dd, hdr); 859 __ipath_layer_rcv_lid(dd, hdr);
860} 860}
861 861
862static void ipath_rcv_hdrerr(struct ipath_devdata *dd,
863 u32 eflags,
864 u32 l,
865 u32 etail,
866 u64 *rc)
867{
868 char emsg[128];
869 struct ipath_message_header *hdr;
870
871 get_rhf_errstring(eflags, emsg, sizeof emsg);
872 hdr = (struct ipath_message_header *)&rc[1];
873 ipath_cdbg(PKT, "RHFerrs %x hdrqtail=%x typ=%u "
874 "tlen=%x opcode=%x egridx=%x: %s\n",
875 eflags, l,
876 ipath_hdrget_rcv_type((__le32 *) rc),
877 ipath_hdrget_length_in_bytes((__le32 *) rc),
878 be32_to_cpu(hdr->bth[0]) >> 24,
879 etail, emsg);
880
881 /* Count local link integrity errors. */
882 if (eflags & (INFINIPATH_RHF_H_ICRCERR | INFINIPATH_RHF_H_VCRCERR)) {
883 u8 n = (dd->ipath_ibcctrl >>
884 INFINIPATH_IBCC_PHYERRTHRESHOLD_SHIFT) &
885 INFINIPATH_IBCC_PHYERRTHRESHOLD_MASK;
886
887 if (++dd->ipath_lli_counter > n) {
888 dd->ipath_lli_counter = 0;
889 dd->ipath_lli_errors++;
890 }
891 }
892}
893
862/* 894/*
863 * ipath_kreceive - receive a packet 895 * ipath_kreceive - receive a packet
864 * @dd: the infinipath device 896 * @dd: the infinipath device
@@ -875,7 +907,6 @@ void ipath_kreceive(struct ipath_devdata *dd)
875 struct ipath_message_header *hdr; 907 struct ipath_message_header *hdr;
876 u32 eflags, i, etype, tlen, pkttot = 0, updegr=0, reloop=0; 908 u32 eflags, i, etype, tlen, pkttot = 0, updegr=0, reloop=0;
877 static u64 totcalls; /* stats, may eventually remove */ 909 static u64 totcalls; /* stats, may eventually remove */
878 char emsg[128];
879 910
880 if (!dd->ipath_hdrqtailptr) { 911 if (!dd->ipath_hdrqtailptr) {
881 ipath_dev_err(dd, 912 ipath_dev_err(dd,
@@ -938,26 +969,9 @@ reloop:
938 "%x\n", etype); 969 "%x\n", etype);
939 } 970 }
940 971
941 if (eflags & ~(INFINIPATH_RHF_H_TIDERR | 972 if (unlikely(eflags))
942 INFINIPATH_RHF_H_IHDRERR)) { 973 ipath_rcv_hdrerr(dd, eflags, l, etail, rc);
943 get_rhf_errstring(eflags, emsg, sizeof emsg); 974 else if (etype == RCVHQ_RCV_TYPE_NON_KD) {
944 ipath_cdbg(PKT, "RHFerrs %x hdrqtail=%x typ=%u "
945 "tlen=%x opcode=%x egridx=%x: %s\n",
946 eflags, l, etype, tlen, bthbytes[0],
947 ipath_hdrget_index((__le32 *) rc), emsg);
948 /* Count local link integrity errors. */
949 if (eflags & (INFINIPATH_RHF_H_ICRCERR |
950 INFINIPATH_RHF_H_VCRCERR)) {
951 u8 n = (dd->ipath_ibcctrl >>
952 INFINIPATH_IBCC_PHYERRTHRESHOLD_SHIFT) &
953 INFINIPATH_IBCC_PHYERRTHRESHOLD_MASK;
954
955 if (++dd->ipath_lli_counter > n) {
956 dd->ipath_lli_counter = 0;
957 dd->ipath_lli_errors++;
958 }
959 }
960 } else if (etype == RCVHQ_RCV_TYPE_NON_KD) {
961 int ret = __ipath_verbs_rcv(dd, rc + 1, 975 int ret = __ipath_verbs_rcv(dd, rc + 1,
962 ebuf, tlen); 976 ebuf, tlen);
963 if (ret == -ENODEV) 977 if (ret == -ENODEV)
@@ -981,25 +995,7 @@ reloop:
981 else if (etype == RCVHQ_RCV_TYPE_EXPECTED) 995 else if (etype == RCVHQ_RCV_TYPE_EXPECTED)
982 ipath_dbg("Bug: Expected TID, opcode %x; ignored\n", 996 ipath_dbg("Bug: Expected TID, opcode %x; ignored\n",
983 be32_to_cpu(hdr->bth[0]) & 0xff); 997 be32_to_cpu(hdr->bth[0]) & 0xff);
984 else if (eflags & (INFINIPATH_RHF_H_TIDERR | 998 else {
985 INFINIPATH_RHF_H_IHDRERR)) {
986 /*
987 * This is a type 3 packet, only the LRH is in the
988 * rcvhdrq, the rest of the header is in the eager
989 * buffer.
990 */
991 u8 opcode;
992 if (ebuf) {
993 bthbytes = (u8 *) ebuf;
994 opcode = *bthbytes;
995 }
996 else
997 opcode = 0;
998 get_rhf_errstring(eflags, emsg, sizeof emsg);
999 ipath_dbg("Err %x (%s), opcode %x, egrbuf %x, "
1000 "len %x\n", eflags, emsg, opcode, etail,
1001 tlen);
1002 } else {
1003 /* 999 /*
1004 * error packet, type of error unknown. 1000 * error packet, type of error unknown.
1005 * Probably type 3, but we don't know, so don't 1001 * Probably type 3, but we don't know, so don't
diff --git a/drivers/infiniband/hw/ipath/ipath_keys.c b/drivers/infiniband/hw/ipath/ipath_keys.c
index 46773c673a1a..a5ca279370aa 100644
--- a/drivers/infiniband/hw/ipath/ipath_keys.c
+++ b/drivers/infiniband/hw/ipath/ipath_keys.c
@@ -197,6 +197,21 @@ int ipath_rkey_ok(struct ipath_ibdev *dev, struct ipath_sge_state *ss,
197 size_t off; 197 size_t off;
198 int ret; 198 int ret;
199 199
200 /*
201 * We use RKEY == zero for physical addresses
202 * (see ipath_get_dma_mr).
203 */
204 if (rkey == 0) {
205 sge->mr = NULL;
206 sge->vaddr = phys_to_virt(vaddr);
207 sge->length = len;
208 sge->sge_length = len;
209 ss->sg_list = NULL;
210 ss->num_sge = 1;
211 ret = 1;
212 goto bail;
213 }
214
200 mr = rkt->table[(rkey >> (32 - ib_ipath_lkey_table_size))]; 215 mr = rkt->table[(rkey >> (32 - ib_ipath_lkey_table_size))];
201 if (unlikely(mr == NULL || mr->lkey != rkey)) { 216 if (unlikely(mr == NULL || mr->lkey != rkey)) {
202 ret = 0; 217 ret = 0;
diff --git a/drivers/infiniband/hw/ipath/ipath_verbs.c b/drivers/infiniband/hw/ipath/ipath_verbs.c
index 56ac336dd1ec..d70a9b6b5239 100644
--- a/drivers/infiniband/hw/ipath/ipath_verbs.c
+++ b/drivers/infiniband/hw/ipath/ipath_verbs.c
@@ -191,10 +191,6 @@ void ipath_skip_sge(struct ipath_sge_state *ss, u32 length)
191{ 191{
192 struct ipath_sge *sge = &ss->sge; 192 struct ipath_sge *sge = &ss->sge;
193 193
194 while (length > sge->sge_length) {
195 length -= sge->sge_length;
196 ss->sge = *ss->sg_list++;
197 }
198 while (length) { 194 while (length) {
199 u32 len = sge->length; 195 u32 len = sge->length;
200 196
@@ -627,6 +623,7 @@ static int ipath_query_device(struct ib_device *ibdev,
627 props->device_cap_flags = IB_DEVICE_BAD_PKEY_CNTR | 623 props->device_cap_flags = IB_DEVICE_BAD_PKEY_CNTR |
628 IB_DEVICE_BAD_QKEY_CNTR | IB_DEVICE_SHUTDOWN_PORT | 624 IB_DEVICE_BAD_QKEY_CNTR | IB_DEVICE_SHUTDOWN_PORT |
629 IB_DEVICE_SYS_IMAGE_GUID; 625 IB_DEVICE_SYS_IMAGE_GUID;
626 props->page_size_cap = PAGE_SIZE;
630 props->vendor_id = ipath_layer_get_vendorid(dev->dd); 627 props->vendor_id = ipath_layer_get_vendorid(dev->dd);
631 props->vendor_part_id = ipath_layer_get_deviceid(dev->dd); 628 props->vendor_part_id = ipath_layer_get_deviceid(dev->dd);
632 props->hw_ver = ipath_layer_get_pcirev(dev->dd); 629 props->hw_ver = ipath_layer_get_pcirev(dev->dd);
diff --git a/drivers/infiniband/hw/mthca/mthca_allocator.c b/drivers/infiniband/hw/mthca/mthca_allocator.c
index 9ba3211cef7c..25157f57a6d0 100644
--- a/drivers/infiniband/hw/mthca/mthca_allocator.c
+++ b/drivers/infiniband/hw/mthca/mthca_allocator.c
@@ -108,14 +108,15 @@ void mthca_alloc_cleanup(struct mthca_alloc *alloc)
108 * serialize access to the array. 108 * serialize access to the array.
109 */ 109 */
110 110
111#define MTHCA_ARRAY_MASK (PAGE_SIZE / sizeof (void *) - 1)
112
111void *mthca_array_get(struct mthca_array *array, int index) 113void *mthca_array_get(struct mthca_array *array, int index)
112{ 114{
113 int p = (index * sizeof (void *)) >> PAGE_SHIFT; 115 int p = (index * sizeof (void *)) >> PAGE_SHIFT;
114 116
115 if (array->page_list[p].page) { 117 if (array->page_list[p].page)
116 int i = index & (PAGE_SIZE / sizeof (void *) - 1); 118 return array->page_list[p].page[index & MTHCA_ARRAY_MASK];
117 return array->page_list[p].page[i]; 119 else
118 } else
119 return NULL; 120 return NULL;
120} 121}
121 122
@@ -130,8 +131,7 @@ int mthca_array_set(struct mthca_array *array, int index, void *value)
130 if (!array->page_list[p].page) 131 if (!array->page_list[p].page)
131 return -ENOMEM; 132 return -ENOMEM;
132 133
133 array->page_list[p].page[index & (PAGE_SIZE / sizeof (void *) - 1)] = 134 array->page_list[p].page[index & MTHCA_ARRAY_MASK] = value;
134 value;
135 ++array->page_list[p].used; 135 ++array->page_list[p].used;
136 136
137 return 0; 137 return 0;
@@ -144,7 +144,8 @@ void mthca_array_clear(struct mthca_array *array, int index)
144 if (--array->page_list[p].used == 0) { 144 if (--array->page_list[p].used == 0) {
145 free_page((unsigned long) array->page_list[p].page); 145 free_page((unsigned long) array->page_list[p].page);
146 array->page_list[p].page = NULL; 146 array->page_list[p].page = NULL;
147 } 147 } else
148 array->page_list[p].page[index & MTHCA_ARRAY_MASK] = NULL;
148 149
149 if (array->page_list[p].used < 0) 150 if (array->page_list[p].used < 0)
150 pr_debug("Array %p index %d page %d with ref count %d < 0\n", 151 pr_debug("Array %p index %d page %d with ref count %d < 0\n",
diff --git a/drivers/infiniband/hw/mthca/mthca_av.c b/drivers/infiniband/hw/mthca/mthca_av.c
index b12aa03be251..e215041b2db9 100644
--- a/drivers/infiniband/hw/mthca/mthca_av.c
+++ b/drivers/infiniband/hw/mthca/mthca_av.c
@@ -303,9 +303,10 @@ int mthca_ah_query(struct ib_ah *ibah, struct ib_ah_attr *attr)
303 memset(attr, 0, sizeof *attr); 303 memset(attr, 0, sizeof *attr);
304 attr->dlid = be16_to_cpu(ah->av->dlid); 304 attr->dlid = be16_to_cpu(ah->av->dlid);
305 attr->sl = be32_to_cpu(ah->av->sl_tclass_flowlabel) >> 28; 305 attr->sl = be32_to_cpu(ah->av->sl_tclass_flowlabel) >> 28;
306 attr->static_rate = ah->av->msg_sr & 0x7;
307 attr->src_path_bits = ah->av->g_slid & 0x7F;
308 attr->port_num = be32_to_cpu(ah->av->port_pd) >> 24; 306 attr->port_num = be32_to_cpu(ah->av->port_pd) >> 24;
307 attr->static_rate = mthca_rate_to_ib(dev, ah->av->msg_sr & 0x7,
308 attr->port_num);
309 attr->src_path_bits = ah->av->g_slid & 0x7F;
309 attr->ah_flags = mthca_ah_grh_present(ah) ? IB_AH_GRH : 0; 310 attr->ah_flags = mthca_ah_grh_present(ah) ? IB_AH_GRH : 0;
310 311
311 if (attr->ah_flags) { 312 if (attr->ah_flags) {
diff --git a/drivers/infiniband/hw/mthca/mthca_cmd.c b/drivers/infiniband/hw/mthca/mthca_cmd.c
index d0f7731802c9..deabc14b4ea4 100644
--- a/drivers/infiniband/hw/mthca/mthca_cmd.c
+++ b/drivers/infiniband/hw/mthca/mthca_cmd.c
@@ -778,11 +778,12 @@ int mthca_QUERY_FW(struct mthca_dev *dev, u8 *status)
778 ((dev->fw_ver & 0xffff0000ull) >> 16) | 778 ((dev->fw_ver & 0xffff0000ull) >> 16) |
779 ((dev->fw_ver & 0x0000ffffull) << 16); 779 ((dev->fw_ver & 0x0000ffffull) << 16);
780 780
781 MTHCA_GET(lg, outbox, QUERY_FW_MAX_CMD_OFFSET);
782 dev->cmd.max_cmds = 1 << lg;
783
781 mthca_dbg(dev, "FW version %012llx, max commands %d\n", 784 mthca_dbg(dev, "FW version %012llx, max commands %d\n",
782 (unsigned long long) dev->fw_ver, dev->cmd.max_cmds); 785 (unsigned long long) dev->fw_ver, dev->cmd.max_cmds);
783 786
784 MTHCA_GET(lg, outbox, QUERY_FW_MAX_CMD_OFFSET);
785 dev->cmd.max_cmds = 1 << lg;
786 MTHCA_GET(dev->catas_err.addr, outbox, QUERY_FW_ERR_START_OFFSET); 787 MTHCA_GET(dev->catas_err.addr, outbox, QUERY_FW_ERR_START_OFFSET);
787 MTHCA_GET(dev->catas_err.size, outbox, QUERY_FW_ERR_SIZE_OFFSET); 788 MTHCA_GET(dev->catas_err.size, outbox, QUERY_FW_ERR_SIZE_OFFSET);
788 789
diff --git a/drivers/infiniband/hw/mthca/mthca_qp.c b/drivers/infiniband/hw/mthca/mthca_qp.c
index 490fc783bb0c..cd8b6721ac9c 100644
--- a/drivers/infiniband/hw/mthca/mthca_qp.c
+++ b/drivers/infiniband/hw/mthca/mthca_qp.c
@@ -222,9 +222,8 @@ static void *get_send_wqe(struct mthca_qp *qp, int n)
222 (PAGE_SIZE - 1)); 222 (PAGE_SIZE - 1));
223} 223}
224 224
225static void mthca_wq_init(struct mthca_wq *wq) 225static void mthca_wq_reset(struct mthca_wq *wq)
226{ 226{
227 /* mthca_alloc_qp_common() initializes the locks */
228 wq->next_ind = 0; 227 wq->next_ind = 0;
229 wq->last_comp = wq->max - 1; 228 wq->last_comp = wq->max - 1;
230 wq->head = 0; 229 wq->head = 0;
@@ -845,10 +844,10 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask)
845 mthca_cq_clean(dev, to_mcq(qp->ibqp.recv_cq), qp->qpn, 844 mthca_cq_clean(dev, to_mcq(qp->ibqp.recv_cq), qp->qpn,
846 qp->ibqp.srq ? to_msrq(qp->ibqp.srq) : NULL); 845 qp->ibqp.srq ? to_msrq(qp->ibqp.srq) : NULL);
847 846
848 mthca_wq_init(&qp->sq); 847 mthca_wq_reset(&qp->sq);
849 qp->sq.last = get_send_wqe(qp, qp->sq.max - 1); 848 qp->sq.last = get_send_wqe(qp, qp->sq.max - 1);
850 849
851 mthca_wq_init(&qp->rq); 850 mthca_wq_reset(&qp->rq);
852 qp->rq.last = get_recv_wqe(qp, qp->rq.max - 1); 851 qp->rq.last = get_recv_wqe(qp, qp->rq.max - 1);
853 852
854 if (mthca_is_memfree(dev)) { 853 if (mthca_is_memfree(dev)) {
@@ -1112,9 +1111,9 @@ static int mthca_alloc_qp_common(struct mthca_dev *dev,
1112 qp->atomic_rd_en = 0; 1111 qp->atomic_rd_en = 0;
1113 qp->resp_depth = 0; 1112 qp->resp_depth = 0;
1114 qp->sq_policy = send_policy; 1113 qp->sq_policy = send_policy;
1115 mthca_wq_init(&qp->sq); 1114 mthca_wq_reset(&qp->sq);
1116 mthca_wq_init(&qp->rq); 1115 mthca_wq_reset(&qp->rq);
1117 /* these are initialized separately so lockdep can tell them apart */ 1116
1118 spin_lock_init(&qp->sq.lock); 1117 spin_lock_init(&qp->sq.lock);
1119 spin_lock_init(&qp->rq.lock); 1118 spin_lock_init(&qp->rq.lock);
1120 1119
diff --git a/drivers/infiniband/hw/mthca/mthca_srq.c b/drivers/infiniband/hw/mthca/mthca_srq.c
index fab417c5cf43..b60a9d79ae54 100644
--- a/drivers/infiniband/hw/mthca/mthca_srq.c
+++ b/drivers/infiniband/hw/mthca/mthca_srq.c
@@ -370,7 +370,8 @@ int mthca_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr,
370 return -EINVAL; 370 return -EINVAL;
371 371
372 if (attr_mask & IB_SRQ_LIMIT) { 372 if (attr_mask & IB_SRQ_LIMIT) {
373 if (attr->srq_limit > srq->max) 373 u32 max_wr = mthca_is_memfree(dev) ? srq->max - 1 : srq->max;
374 if (attr->srq_limit > max_wr)
374 return -EINVAL; 375 return -EINVAL;
375 376
376 mutex_lock(&srq->mutex); 377 mutex_lock(&srq->mutex);
diff --git a/drivers/infiniband/ulp/ipoib/Kconfig b/drivers/infiniband/ulp/ipoib/Kconfig
index 13d6d01c72c0..d74653d7de1c 100644
--- a/drivers/infiniband/ulp/ipoib/Kconfig
+++ b/drivers/infiniband/ulp/ipoib/Kconfig
@@ -6,8 +6,7 @@ config INFINIBAND_IPOIB
6 transports IP packets over InfiniBand so you can use your IB 6 transports IP packets over InfiniBand so you can use your IB
7 device as a fancy NIC. 7 device as a fancy NIC.
8 8
9 The IPoIB protocol is defined by the IETF ipoib working 9 See Documentation/infiniband/ipoib.txt for more information
10 group: <http://www.ietf.org/html.charters/ipoib-charter.html>.
11 10
12config INFINIBAND_IPOIB_DEBUG 11config INFINIBAND_IPOIB_DEBUG
13 bool "IP-over-InfiniBand debugging" if EMBEDDED 12 bool "IP-over-InfiniBand debugging" if EMBEDDED
diff --git a/drivers/infiniband/ulp/ipoib/ipoib.h b/drivers/infiniband/ulp/ipoib/ipoib.h
index 3f89f5e19036..474aa214ab57 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib.h
+++ b/drivers/infiniband/ulp/ipoib/ipoib.h
@@ -212,6 +212,7 @@ struct ipoib_path {
212 212
213struct ipoib_neigh { 213struct ipoib_neigh {
214 struct ipoib_ah *ah; 214 struct ipoib_ah *ah;
215 union ib_gid dgid;
215 struct sk_buff_head queue; 216 struct sk_buff_head queue;
216 217
217 struct neighbour *neighbour; 218 struct neighbour *neighbour;
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index 1c6ea1c682a5..cf71d2a5515c 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -404,6 +404,8 @@ static void path_rec_completion(int status,
404 list_for_each_entry(neigh, &path->neigh_list, list) { 404 list_for_each_entry(neigh, &path->neigh_list, list) {
405 kref_get(&path->ah->ref); 405 kref_get(&path->ah->ref);
406 neigh->ah = path->ah; 406 neigh->ah = path->ah;
407 memcpy(&neigh->dgid.raw, &path->pathrec.dgid.raw,
408 sizeof(union ib_gid));
407 409
408 while ((skb = __skb_dequeue(&neigh->queue))) 410 while ((skb = __skb_dequeue(&neigh->queue)))
409 __skb_queue_tail(&skqueue, skb); 411 __skb_queue_tail(&skqueue, skb);
@@ -510,6 +512,8 @@ static void neigh_add_path(struct sk_buff *skb, struct net_device *dev)
510 if (path->ah) { 512 if (path->ah) {
511 kref_get(&path->ah->ref); 513 kref_get(&path->ah->ref);
512 neigh->ah = path->ah; 514 neigh->ah = path->ah;
515 memcpy(&neigh->dgid.raw, &path->pathrec.dgid.raw,
516 sizeof(union ib_gid));
513 517
514 ipoib_send(dev, skb, path->ah, 518 ipoib_send(dev, skb, path->ah,
515 be32_to_cpup((__be32 *) skb->dst->neighbour->ha)); 519 be32_to_cpup((__be32 *) skb->dst->neighbour->ha));
@@ -633,6 +637,25 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
633 neigh = *to_ipoib_neigh(skb->dst->neighbour); 637 neigh = *to_ipoib_neigh(skb->dst->neighbour);
634 638
635 if (likely(neigh->ah)) { 639 if (likely(neigh->ah)) {
640 if (unlikely(memcmp(&neigh->dgid.raw,
641 skb->dst->neighbour->ha + 4,
642 sizeof(union ib_gid)))) {
643 spin_lock(&priv->lock);
644 /*
645 * It's safe to call ipoib_put_ah() inside
646 * priv->lock here, because we know that
647 * path->ah will always hold one more reference,
648 * so ipoib_put_ah() will never do more than
649 * decrement the ref count.
650 */
651 ipoib_put_ah(neigh->ah);
652 list_del(&neigh->list);
653 ipoib_neigh_free(neigh);
654 spin_unlock(&priv->lock);
655 ipoib_path_lookup(skb, dev);
656 goto out;
657 }
658
636 ipoib_send(dev, skb, neigh->ah, 659 ipoib_send(dev, skb, neigh->ah,
637 be32_to_cpup((__be32 *) skb->dst->neighbour->ha)); 660 be32_to_cpup((__be32 *) skb->dst->neighbour->ha));
638 goto out; 661 goto out;
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
index ab40488182b3..b5e6a7be603d 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
@@ -264,6 +264,10 @@ static int ipoib_mcast_join_finish(struct ipoib_mcast *mcast,
264 if (!ah) { 264 if (!ah) {
265 ipoib_warn(priv, "ib_address_create failed\n"); 265 ipoib_warn(priv, "ib_address_create failed\n");
266 } else { 266 } else {
267 spin_lock_irq(&priv->lock);
268 mcast->ah = ah;
269 spin_unlock_irq(&priv->lock);
270
267 ipoib_dbg_mcast(priv, "MGID " IPOIB_GID_FMT 271 ipoib_dbg_mcast(priv, "MGID " IPOIB_GID_FMT
268 " AV %p, LID 0x%04x, SL %d\n", 272 " AV %p, LID 0x%04x, SL %d\n",
269 IPOIB_GID_ARG(mcast->mcmember.mgid), 273 IPOIB_GID_ARG(mcast->mcmember.mgid),
@@ -271,10 +275,6 @@ static int ipoib_mcast_join_finish(struct ipoib_mcast *mcast,
271 be16_to_cpu(mcast->mcmember.mlid), 275 be16_to_cpu(mcast->mcmember.mlid),
272 mcast->mcmember.sl); 276 mcast->mcmember.sl);
273 } 277 }
274
275 spin_lock_irq(&priv->lock);
276 mcast->ah = ah;
277 spin_unlock_irq(&priv->lock);
278 } 278 }
279 279
280 /* actually send any queued packets */ 280 /* actually send any queued packets */
diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c
index ff117bbf81b4..72febf1f8ff8 100644
--- a/drivers/infiniband/ulp/iser/iser_verbs.c
+++ b/drivers/infiniband/ulp/iser/iser_verbs.c
@@ -594,7 +594,7 @@ int iser_reg_page_vec(struct iser_conn *ib_conn,
594 mem = ib_fmr_pool_map_phys(ib_conn->fmr_pool, 594 mem = ib_fmr_pool_map_phys(ib_conn->fmr_pool,
595 page_list, 595 page_list,
596 page_vec->length, 596 page_vec->length,
597 &io_addr); 597 io_addr);
598 598
599 if (IS_ERR(mem)) { 599 if (IS_ERR(mem)) {
600 status = (int)PTR_ERR(mem); 600 status = (int)PTR_ERR(mem);
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index 4e22afef7206..8257d5a2c8f8 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -77,6 +77,14 @@ MODULE_PARM_DESC(topspin_workarounds,
77 77
78static const u8 topspin_oui[3] = { 0x00, 0x05, 0xad }; 78static const u8 topspin_oui[3] = { 0x00, 0x05, 0xad };
79 79
80static int mellanox_workarounds = 1;
81
82module_param(mellanox_workarounds, int, 0444);
83MODULE_PARM_DESC(mellanox_workarounds,
84 "Enable workarounds for Mellanox SRP target bugs if != 0");
85
86static const u8 mellanox_oui[3] = { 0x00, 0x02, 0xc9 };
87
80static void srp_add_one(struct ib_device *device); 88static void srp_add_one(struct ib_device *device);
81static void srp_remove_one(struct ib_device *device); 89static void srp_remove_one(struct ib_device *device);
82static void srp_completion(struct ib_cq *cq, void *target_ptr); 90static void srp_completion(struct ib_cq *cq, void *target_ptr);
@@ -526,8 +534,10 @@ static int srp_reconnect_target(struct srp_target_port *target)
526 while (ib_poll_cq(target->cq, 1, &wc) > 0) 534 while (ib_poll_cq(target->cq, 1, &wc) > 0)
527 ; /* nothing */ 535 ; /* nothing */
528 536
537 spin_lock_irq(target->scsi_host->host_lock);
529 list_for_each_entry_safe(req, tmp, &target->req_queue, list) 538 list_for_each_entry_safe(req, tmp, &target->req_queue, list)
530 srp_reset_req(target, req); 539 srp_reset_req(target, req);
540 spin_unlock_irq(target->scsi_host->host_lock);
531 541
532 target->rx_head = 0; 542 target->rx_head = 0;
533 target->tx_head = 0; 543 target->tx_head = 0;
@@ -567,7 +577,7 @@ err:
567 return ret; 577 return ret;
568} 578}
569 579
570static int srp_map_fmr(struct srp_device *dev, struct scatterlist *scat, 580static int srp_map_fmr(struct srp_target_port *target, struct scatterlist *scat,
571 int sg_cnt, struct srp_request *req, 581 int sg_cnt, struct srp_request *req,
572 struct srp_direct_buf *buf) 582 struct srp_direct_buf *buf)
573{ 583{
@@ -577,10 +587,15 @@ static int srp_map_fmr(struct srp_device *dev, struct scatterlist *scat,
577 int page_cnt; 587 int page_cnt;
578 int i, j; 588 int i, j;
579 int ret; 589 int ret;
590 struct srp_device *dev = target->srp_host->dev;
580 591
581 if (!dev->fmr_pool) 592 if (!dev->fmr_pool)
582 return -ENODEV; 593 return -ENODEV;
583 594
595 if ((sg_dma_address(&scat[0]) & ~dev->fmr_page_mask) &&
596 mellanox_workarounds && !memcmp(&target->ioc_guid, mellanox_oui, 3))
597 return -EINVAL;
598
584 len = page_cnt = 0; 599 len = page_cnt = 0;
585 for (i = 0; i < sg_cnt; ++i) { 600 for (i = 0; i < sg_cnt; ++i) {
586 if (sg_dma_address(&scat[i]) & ~dev->fmr_page_mask) { 601 if (sg_dma_address(&scat[i]) & ~dev->fmr_page_mask) {
@@ -615,9 +630,10 @@ static int srp_map_fmr(struct srp_device *dev, struct scatterlist *scat,
615 (sg_dma_address(&scat[i]) & dev->fmr_page_mask) + j; 630 (sg_dma_address(&scat[i]) & dev->fmr_page_mask) + j;
616 631
617 req->fmr = ib_fmr_pool_map_phys(dev->fmr_pool, 632 req->fmr = ib_fmr_pool_map_phys(dev->fmr_pool,
618 dma_pages, page_cnt, &io_addr); 633 dma_pages, page_cnt, io_addr);
619 if (IS_ERR(req->fmr)) { 634 if (IS_ERR(req->fmr)) {
620 ret = PTR_ERR(req->fmr); 635 ret = PTR_ERR(req->fmr);
636 req->fmr = NULL;
621 goto out; 637 goto out;
622 } 638 }
623 639
@@ -682,7 +698,7 @@ static int srp_map_data(struct scsi_cmnd *scmnd, struct srp_target_port *target,
682 buf->va = cpu_to_be64(sg_dma_address(scat)); 698 buf->va = cpu_to_be64(sg_dma_address(scat));
683 buf->key = cpu_to_be32(target->srp_host->dev->mr->rkey); 699 buf->key = cpu_to_be32(target->srp_host->dev->mr->rkey);
684 buf->len = cpu_to_be32(sg_dma_len(scat)); 700 buf->len = cpu_to_be32(sg_dma_len(scat));
685 } else if (srp_map_fmr(target->srp_host->dev, scat, count, req, 701 } else if (srp_map_fmr(target, scat, count, req,
686 (void *) cmd->add_data)) { 702 (void *) cmd->add_data)) {
687 /* 703 /*
688 * FMR mapping failed, and the scatterlist has more 704 * FMR mapping failed, and the scatterlist has more
diff --git a/drivers/isdn/hisax/asuscom.c b/drivers/isdn/hisax/asuscom.c
index a98c5e38bbbc..93ff941c48f1 100644
--- a/drivers/isdn/hisax/asuscom.c
+++ b/drivers/isdn/hisax/asuscom.c
@@ -297,7 +297,7 @@ Asus_card_msg(struct IsdnCardState *cs, int mt, void *arg)
297} 297}
298 298
299#ifdef __ISAPNP__ 299#ifdef __ISAPNP__
300static struct isapnp_device_id asus_ids[] __initdata = { 300static struct isapnp_device_id asus_ids[] __devinitdata = {
301 { ISAPNP_VENDOR('A', 'S', 'U'), ISAPNP_FUNCTION(0x1688), 301 { ISAPNP_VENDOR('A', 'S', 'U'), ISAPNP_FUNCTION(0x1688),
302 ISAPNP_VENDOR('A', 'S', 'U'), ISAPNP_FUNCTION(0x1688), 302 ISAPNP_VENDOR('A', 'S', 'U'), ISAPNP_FUNCTION(0x1688),
303 (unsigned long) "Asus1688 PnP" }, 303 (unsigned long) "Asus1688 PnP" },
@@ -313,11 +313,11 @@ static struct isapnp_device_id asus_ids[] __initdata = {
313 { 0, } 313 { 0, }
314}; 314};
315 315
316static struct isapnp_device_id *ipid __initdata = &asus_ids[0]; 316static struct isapnp_device_id *ipid __devinitdata = &asus_ids[0];
317static struct pnp_card *pnp_c __devinitdata = NULL; 317static struct pnp_card *pnp_c __devinitdata = NULL;
318#endif 318#endif
319 319
320int __init 320int __devinit
321setup_asuscom(struct IsdnCard *card) 321setup_asuscom(struct IsdnCard *card)
322{ 322{
323 int bytecnt; 323 int bytecnt;
diff --git a/drivers/isdn/hisax/avm_a1.c b/drivers/isdn/hisax/avm_a1.c
index 9a8b02557ff9..729e906bdc61 100644
--- a/drivers/isdn/hisax/avm_a1.c
+++ b/drivers/isdn/hisax/avm_a1.c
@@ -178,7 +178,7 @@ AVM_card_msg(struct IsdnCardState *cs, int mt, void *arg)
178 return(0); 178 return(0);
179} 179}
180 180
181int __init 181int __devinit
182setup_avm_a1(struct IsdnCard *card) 182setup_avm_a1(struct IsdnCard *card)
183{ 183{
184 u_char val; 184 u_char val;
diff --git a/drivers/isdn/hisax/avm_pci.c b/drivers/isdn/hisax/avm_pci.c
index 04f5917bf5a1..369afd3a3a4b 100644
--- a/drivers/isdn/hisax/avm_pci.c
+++ b/drivers/isdn/hisax/avm_pci.c
@@ -639,7 +639,7 @@ clear_pending_hdlc_ints(struct IsdnCardState *cs)
639} 639}
640#endif /* 0 */ 640#endif /* 0 */
641 641
642static void __init 642static void
643inithdlc(struct IsdnCardState *cs) 643inithdlc(struct IsdnCardState *cs)
644{ 644{
645 cs->bcs[0].BC_SetStack = setstack_hdlc; 645 cs->bcs[0].BC_SetStack = setstack_hdlc;
@@ -727,13 +727,13 @@ AVM_card_msg(struct IsdnCardState *cs, int mt, void *arg)
727} 727}
728 728
729#ifdef CONFIG_PCI 729#ifdef CONFIG_PCI
730static struct pci_dev *dev_avm __initdata = NULL; 730static struct pci_dev *dev_avm __devinitdata = NULL;
731#endif 731#endif
732#ifdef __ISAPNP__ 732#ifdef __ISAPNP__
733static struct pnp_card *pnp_avm_c __initdata = NULL; 733static struct pnp_card *pnp_avm_c __devinitdata = NULL;
734#endif 734#endif
735 735
736int __init 736int __devinit
737setup_avm_pcipnp(struct IsdnCard *card) 737setup_avm_pcipnp(struct IsdnCard *card)
738{ 738{
739 u_int val, ver; 739 u_int val, ver;
diff --git a/drivers/isdn/hisax/bkm_a4t.c b/drivers/isdn/hisax/bkm_a4t.c
index 3cf1f2421789..87a630128a6c 100644
--- a/drivers/isdn/hisax/bkm_a4t.c
+++ b/drivers/isdn/hisax/bkm_a4t.c
@@ -255,9 +255,9 @@ BKM_card_msg(struct IsdnCardState *cs, int mt, void *arg)
255 return (0); 255 return (0);
256} 256}
257 257
258static struct pci_dev *dev_a4t __initdata = NULL; 258static struct pci_dev *dev_a4t __devinitdata = NULL;
259 259
260int __init 260int __devinit
261setup_bkm_a4t(struct IsdnCard *card) 261setup_bkm_a4t(struct IsdnCard *card)
262{ 262{
263 struct IsdnCardState *cs = card->cs; 263 struct IsdnCardState *cs = card->cs;
diff --git a/drivers/isdn/hisax/bkm_a8.c b/drivers/isdn/hisax/bkm_a8.c
index 15681f3e73b8..dae090a9a489 100644
--- a/drivers/isdn/hisax/bkm_a8.c
+++ b/drivers/isdn/hisax/bkm_a8.c
@@ -260,7 +260,7 @@ BKM_card_msg(struct IsdnCardState *cs, int mt, void *arg)
260 return (0); 260 return (0);
261} 261}
262 262
263static int __init 263static int __devinit
264sct_alloc_io(u_int adr, u_int len) 264sct_alloc_io(u_int adr, u_int len)
265{ 265{
266 if (!request_region(adr, len, "scitel")) { 266 if (!request_region(adr, len, "scitel")) {
@@ -272,16 +272,16 @@ sct_alloc_io(u_int adr, u_int len)
272 return(0); 272 return(0);
273} 273}
274 274
275static struct pci_dev *dev_a8 __initdata = NULL; 275static struct pci_dev *dev_a8 __devinitdata = NULL;
276static u16 sub_vendor_id __initdata = 0; 276static u16 sub_vendor_id __devinitdata = 0;
277static u16 sub_sys_id __initdata = 0; 277static u16 sub_sys_id __devinitdata = 0;
278static u_char pci_bus __initdata = 0; 278static u_char pci_bus __devinitdata = 0;
279static u_char pci_device_fn __initdata = 0; 279static u_char pci_device_fn __devinitdata = 0;
280static u_char pci_irq __initdata = 0; 280static u_char pci_irq __devinitdata = 0;
281 281
282#endif /* CONFIG_PCI */ 282#endif /* CONFIG_PCI */
283 283
284int __init 284int __devinit
285setup_sct_quadro(struct IsdnCard *card) 285setup_sct_quadro(struct IsdnCard *card)
286{ 286{
287#ifdef CONFIG_PCI 287#ifdef CONFIG_PCI
diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c
index 5333be5d2c47..e10350360f2f 100644
--- a/drivers/isdn/hisax/config.c
+++ b/drivers/isdn/hisax/config.c
@@ -1875,7 +1875,7 @@ static void EChannel_proc_rcv(struct hisax_d_if *d_if)
1875#ifdef CONFIG_PCI 1875#ifdef CONFIG_PCI
1876#include <linux/pci.h> 1876#include <linux/pci.h>
1877 1877
1878static struct pci_device_id hisax_pci_tbl[] __initdata = { 1878static struct pci_device_id hisax_pci_tbl[] __devinitdata = {
1879#ifdef CONFIG_HISAX_FRITZPCI 1879#ifdef CONFIG_HISAX_FRITZPCI
1880 {PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_A1, PCI_ANY_ID, PCI_ANY_ID}, 1880 {PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_A1, PCI_ANY_ID, PCI_ANY_ID},
1881#endif 1881#endif
diff --git a/drivers/isdn/hisax/diva.c b/drivers/isdn/hisax/diva.c
index 323a02ef3844..e294fa3918f3 100644
--- a/drivers/isdn/hisax/diva.c
+++ b/drivers/isdn/hisax/diva.c
@@ -887,13 +887,13 @@ Diva_card_msg(struct IsdnCardState *cs, int mt, void *arg)
887 return(0); 887 return(0);
888} 888}
889 889
890static struct pci_dev *dev_diva __initdata = NULL; 890static struct pci_dev *dev_diva __devinitdata = NULL;
891static struct pci_dev *dev_diva_u __initdata = NULL; 891static struct pci_dev *dev_diva_u __devinitdata = NULL;
892static struct pci_dev *dev_diva201 __initdata = NULL; 892static struct pci_dev *dev_diva201 __devinitdata = NULL;
893static struct pci_dev *dev_diva202 __initdata = NULL; 893static struct pci_dev *dev_diva202 __devinitdata = NULL;
894 894
895#ifdef __ISAPNP__ 895#ifdef __ISAPNP__
896static struct isapnp_device_id diva_ids[] __initdata = { 896static struct isapnp_device_id diva_ids[] __devinitdata = {
897 { ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x51), 897 { ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x51),
898 ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x51), 898 ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x51),
899 (unsigned long) "Diva picola" }, 899 (unsigned long) "Diva picola" },
@@ -915,12 +915,12 @@ static struct isapnp_device_id diva_ids[] __initdata = {
915 { 0, } 915 { 0, }
916}; 916};
917 917
918static struct isapnp_device_id *ipid __initdata = &diva_ids[0]; 918static struct isapnp_device_id *ipid __devinitdata = &diva_ids[0];
919static struct pnp_card *pnp_c __devinitdata = NULL; 919static struct pnp_card *pnp_c __devinitdata = NULL;
920#endif 920#endif
921 921
922 922
923int __init 923int __devinit
924setup_diva(struct IsdnCard *card) 924setup_diva(struct IsdnCard *card)
925{ 925{
926 int bytecnt = 8; 926 int bytecnt = 8;
diff --git a/drivers/isdn/hisax/enternow_pci.c b/drivers/isdn/hisax/enternow_pci.c
index 8fcbe2e7d765..76c7d29d1b2f 100644
--- a/drivers/isdn/hisax/enternow_pci.c
+++ b/drivers/isdn/hisax/enternow_pci.c
@@ -301,10 +301,10 @@ enpci_interrupt(int intno, void *dev_id, struct pt_regs *regs)
301} 301}
302 302
303 303
304static struct pci_dev *dev_netjet __initdata = NULL; 304static struct pci_dev *dev_netjet __devinitdata = NULL;
305 305
306/* called by config.c */ 306/* called by config.c */
307int __init 307int __devinit
308setup_enternow_pci(struct IsdnCard *card) 308setup_enternow_pci(struct IsdnCard *card)
309{ 309{
310 int bytecnt; 310 int bytecnt;
diff --git a/drivers/isdn/hisax/gazel.c b/drivers/isdn/hisax/gazel.c
index 3e7d92303582..fe2937267777 100644
--- a/drivers/isdn/hisax/gazel.c
+++ b/drivers/isdn/hisax/gazel.c
@@ -484,7 +484,7 @@ reserve_regions(struct IsdnCard *card, struct IsdnCardState *cs)
484 return 1; 484 return 1;
485} 485}
486 486
487static int __init 487static int __devinit
488setup_gazelisa(struct IsdnCard *card, struct IsdnCardState *cs) 488setup_gazelisa(struct IsdnCard *card, struct IsdnCardState *cs)
489{ 489{
490 printk(KERN_INFO "Gazel: ISA PnP card automatic recognition\n"); 490 printk(KERN_INFO "Gazel: ISA PnP card automatic recognition\n");
@@ -532,9 +532,9 @@ setup_gazelisa(struct IsdnCard *card, struct IsdnCardState *cs)
532 return (0); 532 return (0);
533} 533}
534 534
535static struct pci_dev *dev_tel __initdata = NULL; 535static struct pci_dev *dev_tel __devinitdata = NULL;
536 536
537static int __init 537static int __devinit
538setup_gazelpci(struct IsdnCardState *cs) 538setup_gazelpci(struct IsdnCardState *cs)
539{ 539{
540 u_int pci_ioaddr0 = 0, pci_ioaddr1 = 0; 540 u_int pci_ioaddr0 = 0, pci_ioaddr1 = 0;
@@ -621,7 +621,7 @@ setup_gazelpci(struct IsdnCardState *cs)
621 return (0); 621 return (0);
622} 622}
623 623
624int __init 624int __devinit
625setup_gazel(struct IsdnCard *card) 625setup_gazel(struct IsdnCard *card)
626{ 626{
627 struct IsdnCardState *cs = card->cs; 627 struct IsdnCardState *cs = card->cs;
diff --git a/drivers/isdn/hisax/hfc4s8s_l1.c b/drivers/isdn/hisax/hfc4s8s_l1.c
index 0f967b3df79d..3a5ca8a68fc4 100644
--- a/drivers/isdn/hisax/hfc4s8s_l1.c
+++ b/drivers/isdn/hisax/hfc4s8s_l1.c
@@ -1703,7 +1703,7 @@ hfc4s8s_module_init(void)
1703/* driver module exit : */ 1703/* driver module exit : */
1704/* release the HFC-4s/8s hardware */ 1704/* release the HFC-4s/8s hardware */
1705/*************************************/ 1705/*************************************/
1706static void 1706static void __exit
1707hfc4s8s_module_exit(void) 1707hfc4s8s_module_exit(void)
1708{ 1708{
1709 pci_unregister_driver(&hfc4s8s_driver); 1709 pci_unregister_driver(&hfc4s8s_driver);
diff --git a/drivers/isdn/hisax/hfc_2bds0.c b/drivers/isdn/hisax/hfc_2bds0.c
index 637a261c9312..6360e8214720 100644
--- a/drivers/isdn/hisax/hfc_2bds0.c
+++ b/drivers/isdn/hisax/hfc_2bds0.c
@@ -1015,7 +1015,7 @@ hfc_dbusy_timer(struct IsdnCardState *cs)
1015{ 1015{
1016} 1016}
1017 1017
1018static unsigned int __init 1018static unsigned int
1019*init_send_hfcd(int cnt) 1019*init_send_hfcd(int cnt)
1020{ 1020{
1021 int i, *send; 1021 int i, *send;
@@ -1030,7 +1030,7 @@ static unsigned int __init
1030 return(send); 1030 return(send);
1031} 1031}
1032 1032
1033void __init 1033void
1034init2bds0(struct IsdnCardState *cs) 1034init2bds0(struct IsdnCardState *cs)
1035{ 1035{
1036 cs->setstack_d = setstack_hfcd; 1036 cs->setstack_d = setstack_hfcd;
diff --git a/drivers/isdn/hisax/hfc_2bs0.c b/drivers/isdn/hisax/hfc_2bs0.c
index c964539cc43e..d0520ad30677 100644
--- a/drivers/isdn/hisax/hfc_2bs0.c
+++ b/drivers/isdn/hisax/hfc_2bs0.c
@@ -551,7 +551,7 @@ setstack_hfc(struct PStack *st, struct BCState *bcs)
551 return (0); 551 return (0);
552} 552}
553 553
554static void __init 554static void
555init_send(struct BCState *bcs) 555init_send(struct BCState *bcs)
556{ 556{
557 int i; 557 int i;
@@ -565,7 +565,7 @@ init_send(struct BCState *bcs)
565 bcs->hw.hfc.send[i] = 0x1fff; 565 bcs->hw.hfc.send[i] = 0x1fff;
566} 566}
567 567
568void __init 568void
569inithfc(struct IsdnCardState *cs) 569inithfc(struct IsdnCardState *cs)
570{ 570{
571 init_send(&cs->bcs[0]); 571 init_send(&cs->bcs[0]);
diff --git a/drivers/isdn/hisax/hfc_pci.c b/drivers/isdn/hisax/hfc_pci.c
index 7241e73879ba..1df60ca9481f 100644
--- a/drivers/isdn/hisax/hfc_pci.c
+++ b/drivers/isdn/hisax/hfc_pci.c
@@ -1581,7 +1581,7 @@ hfcpci_bh(struct IsdnCardState *cs)
1581/********************************/ 1581/********************************/
1582/* called for card init message */ 1582/* called for card init message */
1583/********************************/ 1583/********************************/
1584static void __init 1584static void
1585inithfcpci(struct IsdnCardState *cs) 1585inithfcpci(struct IsdnCardState *cs)
1586{ 1586{
1587 cs->bcs[0].BC_SetStack = setstack_2b; 1587 cs->bcs[0].BC_SetStack = setstack_2b;
@@ -1638,11 +1638,11 @@ hfcpci_card_msg(struct IsdnCardState *cs, int mt, void *arg)
1638 1638
1639 1639
1640/* this variable is used as card index when more than one cards are present */ 1640/* this variable is used as card index when more than one cards are present */
1641static struct pci_dev *dev_hfcpci __initdata = NULL; 1641static struct pci_dev *dev_hfcpci __devinitdata = NULL;
1642 1642
1643#endif /* CONFIG_PCI */ 1643#endif /* CONFIG_PCI */
1644 1644
1645int __init 1645int __devinit
1646setup_hfcpci(struct IsdnCard *card) 1646setup_hfcpci(struct IsdnCard *card)
1647{ 1647{
1648 u_long flags; 1648 u_long flags;
diff --git a/drivers/isdn/hisax/hfcscard.c b/drivers/isdn/hisax/hfcscard.c
index 86ab1c13f6b1..4e7f472877e9 100644
--- a/drivers/isdn/hisax/hfcscard.c
+++ b/drivers/isdn/hisax/hfcscard.c
@@ -139,7 +139,7 @@ hfcs_card_msg(struct IsdnCardState *cs, int mt, void *arg)
139} 139}
140 140
141#ifdef __ISAPNP__ 141#ifdef __ISAPNP__
142static struct isapnp_device_id hfc_ids[] __initdata = { 142static struct isapnp_device_id hfc_ids[] __devinitdata = {
143 { ISAPNP_VENDOR('A', 'N', 'X'), ISAPNP_FUNCTION(0x1114), 143 { ISAPNP_VENDOR('A', 'N', 'X'), ISAPNP_FUNCTION(0x1114),
144 ISAPNP_VENDOR('A', 'N', 'X'), ISAPNP_FUNCTION(0x1114), 144 ISAPNP_VENDOR('A', 'N', 'X'), ISAPNP_FUNCTION(0x1114),
145 (unsigned long) "Acer P10" }, 145 (unsigned long) "Acer P10" },
@@ -164,11 +164,11 @@ static struct isapnp_device_id hfc_ids[] __initdata = {
164 { 0, } 164 { 0, }
165}; 165};
166 166
167static struct isapnp_device_id *ipid __initdata = &hfc_ids[0]; 167static struct isapnp_device_id *ipid __devinitdata = &hfc_ids[0];
168static struct pnp_card *pnp_c __devinitdata = NULL; 168static struct pnp_card *pnp_c __devinitdata = NULL;
169#endif 169#endif
170 170
171int __init 171int __devinit
172setup_hfcs(struct IsdnCard *card) 172setup_hfcs(struct IsdnCard *card)
173{ 173{
174 struct IsdnCardState *cs = card->cs; 174 struct IsdnCardState *cs = card->cs;
diff --git a/drivers/isdn/hisax/icc.c b/drivers/isdn/hisax/icc.c
index c615752b96aa..2cf7b665609e 100644
--- a/drivers/isdn/hisax/icc.c
+++ b/drivers/isdn/hisax/icc.c
@@ -24,10 +24,10 @@
24#define DBUSY_TIMER_VALUE 80 24#define DBUSY_TIMER_VALUE 80
25#define ARCOFI_USE 0 25#define ARCOFI_USE 0
26 26
27static char *ICCVer[] __initdata = 27static char *ICCVer[] =
28{"2070 A1/A3", "2070 B1", "2070 B2/B3", "2070 V2.4"}; 28{"2070 A1/A3", "2070 B1", "2070 B2/B3", "2070 V2.4"};
29 29
30void __init 30void
31ICCVersion(struct IsdnCardState *cs, char *s) 31ICCVersion(struct IsdnCardState *cs, char *s)
32{ 32{
33 int val; 33 int val;
@@ -613,7 +613,7 @@ dbusy_timer_handler(struct IsdnCardState *cs)
613 } 613 }
614} 614}
615 615
616void __init 616void
617initicc(struct IsdnCardState *cs) 617initicc(struct IsdnCardState *cs)
618{ 618{
619 cs->setstack_d = setstack_icc; 619 cs->setstack_d = setstack_icc;
@@ -646,7 +646,7 @@ initicc(struct IsdnCardState *cs)
646 ph_command(cs, ICC_CMD_DI); 646 ph_command(cs, ICC_CMD_DI);
647} 647}
648 648
649void __init 649void
650clear_pending_icc_ints(struct IsdnCardState *cs) 650clear_pending_icc_ints(struct IsdnCardState *cs)
651{ 651{
652 int val, eval; 652 int val, eval;
diff --git a/drivers/isdn/hisax/icc.h b/drivers/isdn/hisax/icc.h
index b3bb3d5de532..e7f593967e43 100644
--- a/drivers/isdn/hisax/icc.h
+++ b/drivers/isdn/hisax/icc.h
@@ -65,7 +65,7 @@
65#define ICC_IND_AIL 0xE 65#define ICC_IND_AIL 0xE
66#define ICC_IND_DC 0xF 66#define ICC_IND_DC 0xF
67 67
68extern void __init ICCVersion(struct IsdnCardState *cs, char *s); 68extern void ICCVersion(struct IsdnCardState *cs, char *s);
69extern void initicc(struct IsdnCardState *cs); 69extern void initicc(struct IsdnCardState *cs);
70extern void icc_interrupt(struct IsdnCardState *cs, u_char val); 70extern void icc_interrupt(struct IsdnCardState *cs, u_char val);
71extern void clear_pending_icc_ints(struct IsdnCardState *cs); 71extern void clear_pending_icc_ints(struct IsdnCardState *cs);
diff --git a/drivers/isdn/hisax/ipacx.c b/drivers/isdn/hisax/ipacx.c
index df5fc92a89b2..00afd5538909 100644
--- a/drivers/isdn/hisax/ipacx.c
+++ b/drivers/isdn/hisax/ipacx.c
@@ -38,8 +38,8 @@ static void dbusy_timer_handler(struct IsdnCardState *cs);
38static void dch_empty_fifo(struct IsdnCardState *cs, int count); 38static void dch_empty_fifo(struct IsdnCardState *cs, int count);
39static void dch_fill_fifo(struct IsdnCardState *cs); 39static void dch_fill_fifo(struct IsdnCardState *cs);
40static inline void dch_int(struct IsdnCardState *cs); 40static inline void dch_int(struct IsdnCardState *cs);
41static void __devinit dch_setstack(struct PStack *st, struct IsdnCardState *cs); 41static void dch_setstack(struct PStack *st, struct IsdnCardState *cs);
42static void __devinit dch_init(struct IsdnCardState *cs); 42static void dch_init(struct IsdnCardState *cs);
43static void bch_l2l1(struct PStack *st, int pr, void *arg); 43static void bch_l2l1(struct PStack *st, int pr, void *arg);
44static void bch_empty_fifo(struct BCState *bcs, int count); 44static void bch_empty_fifo(struct BCState *bcs, int count);
45static void bch_fill_fifo(struct BCState *bcs); 45static void bch_fill_fifo(struct BCState *bcs);
@@ -48,8 +48,8 @@ static void bch_mode(struct BCState *bcs, int mode, int bc);
48static void bch_close_state(struct BCState *bcs); 48static void bch_close_state(struct BCState *bcs);
49static int bch_open_state(struct IsdnCardState *cs, struct BCState *bcs); 49static int bch_open_state(struct IsdnCardState *cs, struct BCState *bcs);
50static int bch_setstack(struct PStack *st, struct BCState *bcs); 50static int bch_setstack(struct PStack *st, struct BCState *bcs);
51static void __devinit bch_init(struct IsdnCardState *cs, int hscx); 51static void bch_init(struct IsdnCardState *cs, int hscx);
52static void __init clear_pending_ints(struct IsdnCardState *cs); 52static void clear_pending_ints(struct IsdnCardState *cs);
53 53
54//---------------------------------------------------------- 54//----------------------------------------------------------
55// Issue Layer 1 command to chip 55// Issue Layer 1 command to chip
@@ -408,7 +408,7 @@ dch_int(struct IsdnCardState *cs)
408 408
409//---------------------------------------------------------- 409//----------------------------------------------------------
410//---------------------------------------------------------- 410//----------------------------------------------------------
411static void __devinit 411static void
412dch_setstack(struct PStack *st, struct IsdnCardState *cs) 412dch_setstack(struct PStack *st, struct IsdnCardState *cs)
413{ 413{
414 st->l1.l1hw = dch_l2l1; 414 st->l1.l1hw = dch_l2l1;
@@ -416,7 +416,7 @@ dch_setstack(struct PStack *st, struct IsdnCardState *cs)
416 416
417//---------------------------------------------------------- 417//----------------------------------------------------------
418//---------------------------------------------------------- 418//----------------------------------------------------------
419static void __devinit 419static void
420dch_init(struct IsdnCardState *cs) 420dch_init(struct IsdnCardState *cs)
421{ 421{
422 printk(KERN_INFO "HiSax: IPACX ISDN driver v0.1.0\n"); 422 printk(KERN_INFO "HiSax: IPACX ISDN driver v0.1.0\n");
@@ -823,7 +823,7 @@ bch_setstack(struct PStack *st, struct BCState *bcs)
823 823
824//---------------------------------------------------------- 824//----------------------------------------------------------
825//---------------------------------------------------------- 825//----------------------------------------------------------
826static void __devinit 826static void
827bch_init(struct IsdnCardState *cs, int hscx) 827bch_init(struct IsdnCardState *cs, int hscx)
828{ 828{
829 cs->bcs[hscx].BC_SetStack = bch_setstack; 829 cs->bcs[hscx].BC_SetStack = bch_setstack;
@@ -861,7 +861,7 @@ interrupt_ipacx(struct IsdnCardState *cs)
861//---------------------------------------------------------- 861//----------------------------------------------------------
862// Clears chip interrupt status 862// Clears chip interrupt status
863//---------------------------------------------------------- 863//----------------------------------------------------------
864static void __init 864static void
865clear_pending_ints(struct IsdnCardState *cs) 865clear_pending_ints(struct IsdnCardState *cs)
866{ 866{
867 int ista; 867 int ista;
@@ -883,7 +883,7 @@ clear_pending_ints(struct IsdnCardState *cs)
883// Does chip configuration work 883// Does chip configuration work
884// Work to do depends on bit mask in part 884// Work to do depends on bit mask in part
885//---------------------------------------------------------- 885//----------------------------------------------------------
886void __init 886void
887init_ipacx(struct IsdnCardState *cs, int part) 887init_ipacx(struct IsdnCardState *cs, int part)
888{ 888{
889 if (part &1) { // initialise chip 889 if (part &1) { // initialise chip
diff --git a/drivers/isdn/hisax/isurf.c b/drivers/isdn/hisax/isurf.c
index 33747afc984d..715a1a8cd694 100644
--- a/drivers/isdn/hisax/isurf.c
+++ b/drivers/isdn/hisax/isurf.c
@@ -196,10 +196,10 @@ isurf_auxcmd(struct IsdnCardState *cs, isdn_ctrl *ic) {
196} 196}
197 197
198#ifdef __ISAPNP__ 198#ifdef __ISAPNP__
199static struct pnp_card *pnp_c __initdata = NULL; 199static struct pnp_card *pnp_c __devinitdata = NULL;
200#endif 200#endif
201 201
202int __init 202int __devinit
203setup_isurf(struct IsdnCard *card) 203setup_isurf(struct IsdnCard *card)
204{ 204{
205 int ver; 205 int ver;
diff --git a/drivers/isdn/hisax/ix1_micro.c b/drivers/isdn/hisax/ix1_micro.c
index 908a7e144421..39717506c678 100644
--- a/drivers/isdn/hisax/ix1_micro.c
+++ b/drivers/isdn/hisax/ix1_micro.c
@@ -210,7 +210,7 @@ ix1_card_msg(struct IsdnCardState *cs, int mt, void *arg)
210} 210}
211 211
212#ifdef __ISAPNP__ 212#ifdef __ISAPNP__
213static struct isapnp_device_id itk_ids[] __initdata = { 213static struct isapnp_device_id itk_ids[] __devinitdata = {
214 { ISAPNP_VENDOR('I', 'T', 'K'), ISAPNP_FUNCTION(0x25), 214 { ISAPNP_VENDOR('I', 'T', 'K'), ISAPNP_FUNCTION(0x25),
215 ISAPNP_VENDOR('I', 'T', 'K'), ISAPNP_FUNCTION(0x25), 215 ISAPNP_VENDOR('I', 'T', 'K'), ISAPNP_FUNCTION(0x25),
216 (unsigned long) "ITK micro 2" }, 216 (unsigned long) "ITK micro 2" },
@@ -220,12 +220,12 @@ static struct isapnp_device_id itk_ids[] __initdata = {
220 { 0, } 220 { 0, }
221}; 221};
222 222
223static struct isapnp_device_id *ipid __initdata = &itk_ids[0]; 223static struct isapnp_device_id *ipid __devinitdata = &itk_ids[0];
224static struct pnp_card *pnp_c __devinitdata = NULL; 224static struct pnp_card *pnp_c __devinitdata = NULL;
225#endif 225#endif
226 226
227 227
228int __init 228int __devinit
229setup_ix1micro(struct IsdnCard *card) 229setup_ix1micro(struct IsdnCard *card)
230{ 230{
231 struct IsdnCardState *cs = card->cs; 231 struct IsdnCardState *cs = card->cs;
diff --git a/drivers/isdn/hisax/jade.c b/drivers/isdn/hisax/jade.c
index 2659fecc2674..43d61d1bc5b6 100644
--- a/drivers/isdn/hisax/jade.c
+++ b/drivers/isdn/hisax/jade.c
@@ -19,7 +19,7 @@
19#include <linux/interrupt.h> 19#include <linux/interrupt.h>
20 20
21 21
22int __init 22int
23JadeVersion(struct IsdnCardState *cs, char *s) 23JadeVersion(struct IsdnCardState *cs, char *s)
24{ 24{
25 int ver,i; 25 int ver,i;
@@ -253,7 +253,7 @@ setstack_jade(struct PStack *st, struct BCState *bcs)
253 return (0); 253 return (0);
254} 254}
255 255
256void __init 256void
257clear_pending_jade_ints(struct IsdnCardState *cs) 257clear_pending_jade_ints(struct IsdnCardState *cs)
258{ 258{
259 int val; 259 int val;
@@ -279,7 +279,7 @@ clear_pending_jade_ints(struct IsdnCardState *cs)
279 cs->BC_Write_Reg(cs, 1, jade_HDLC_IMR, 0xF8); 279 cs->BC_Write_Reg(cs, 1, jade_HDLC_IMR, 0xF8);
280} 280}
281 281
282void __init 282void
283initjade(struct IsdnCardState *cs) 283initjade(struct IsdnCardState *cs)
284{ 284{
285 cs->bcs[0].BC_SetStack = setstack_jade; 285 cs->bcs[0].BC_SetStack = setstack_jade;
diff --git a/drivers/isdn/hisax/mic.c b/drivers/isdn/hisax/mic.c
index fe11f226b285..8c82519593a8 100644
--- a/drivers/isdn/hisax/mic.c
+++ b/drivers/isdn/hisax/mic.c
@@ -189,7 +189,7 @@ mic_card_msg(struct IsdnCardState *cs, int mt, void *arg)
189 return(0); 189 return(0);
190} 190}
191 191
192int __init 192int __devinit
193setup_mic(struct IsdnCard *card) 193setup_mic(struct IsdnCard *card)
194{ 194{
195 int bytecnt; 195 int bytecnt;
diff --git a/drivers/isdn/hisax/netjet.c b/drivers/isdn/hisax/netjet.c
index 47a47ef0968b..38f648f9b0ed 100644
--- a/drivers/isdn/hisax/netjet.c
+++ b/drivers/isdn/hisax/netjet.c
@@ -909,7 +909,7 @@ setstack_tiger(struct PStack *st, struct BCState *bcs)
909} 909}
910 910
911 911
912void __init 912void
913inittiger(struct IsdnCardState *cs) 913inittiger(struct IsdnCardState *cs)
914{ 914{
915 if (!(cs->bcs[0].hw.tiger.send = kmalloc(NETJET_DMA_TXSIZE * sizeof(unsigned int), 915 if (!(cs->bcs[0].hw.tiger.send = kmalloc(NETJET_DMA_TXSIZE * sizeof(unsigned int),
diff --git a/drivers/isdn/hisax/niccy.c b/drivers/isdn/hisax/niccy.c
index 79a97b1c3812..489022bdef7b 100644
--- a/drivers/isdn/hisax/niccy.c
+++ b/drivers/isdn/hisax/niccy.c
@@ -232,12 +232,12 @@ niccy_card_msg(struct IsdnCardState *cs, int mt, void *arg)
232 return(0); 232 return(0);
233} 233}
234 234
235static struct pci_dev *niccy_dev __initdata = NULL; 235static struct pci_dev *niccy_dev __devinitdata = NULL;
236#ifdef __ISAPNP__ 236#ifdef __ISAPNP__
237static struct pnp_card *pnp_c __devinitdata = NULL; 237static struct pnp_card *pnp_c __devinitdata = NULL;
238#endif 238#endif
239 239
240int __init 240int __devinit
241setup_niccy(struct IsdnCard *card) 241setup_niccy(struct IsdnCard *card)
242{ 242{
243 struct IsdnCardState *cs = card->cs; 243 struct IsdnCardState *cs = card->cs;
diff --git a/drivers/isdn/hisax/nj_s.c b/drivers/isdn/hisax/nj_s.c
index e5b900a6fa0b..80025fd890f4 100644
--- a/drivers/isdn/hisax/nj_s.c
+++ b/drivers/isdn/hisax/nj_s.c
@@ -148,9 +148,9 @@ NETjet_S_card_msg(struct IsdnCardState *cs, int mt, void *arg)
148 return(0); 148 return(0);
149} 149}
150 150
151static struct pci_dev *dev_netjet __initdata = NULL; 151static struct pci_dev *dev_netjet __devinitdata = NULL;
152 152
153int __init 153int __devinit
154setup_netjet_s(struct IsdnCard *card) 154setup_netjet_s(struct IsdnCard *card)
155{ 155{
156 int bytecnt,cfg; 156 int bytecnt,cfg;
diff --git a/drivers/isdn/hisax/nj_u.c b/drivers/isdn/hisax/nj_u.c
index 7002b09936d4..37497162d539 100644
--- a/drivers/isdn/hisax/nj_u.c
+++ b/drivers/isdn/hisax/nj_u.c
@@ -128,9 +128,9 @@ NETjet_U_card_msg(struct IsdnCardState *cs, int mt, void *arg)
128 return(0); 128 return(0);
129} 129}
130 130
131static struct pci_dev *dev_netjet __initdata = NULL; 131static struct pci_dev *dev_netjet __devinitdata = NULL;
132 132
133int __init 133int __devinit
134setup_netjet_u(struct IsdnCard *card) 134setup_netjet_u(struct IsdnCard *card)
135{ 135{
136 int bytecnt; 136 int bytecnt;
diff --git a/drivers/isdn/hisax/s0box.c b/drivers/isdn/hisax/s0box.c
index 7b63085ea6e5..e76042d323ea 100644
--- a/drivers/isdn/hisax/s0box.c
+++ b/drivers/isdn/hisax/s0box.c
@@ -211,7 +211,7 @@ S0Box_card_msg(struct IsdnCardState *cs, int mt, void *arg)
211 return(0); 211 return(0);
212} 212}
213 213
214int __init 214int __devinit
215setup_s0box(struct IsdnCard *card) 215setup_s0box(struct IsdnCard *card)
216{ 216{
217 struct IsdnCardState *cs = card->cs; 217 struct IsdnCardState *cs = card->cs;
diff --git a/drivers/isdn/hisax/saphir.c b/drivers/isdn/hisax/saphir.c
index 821776e1561a..d943d365890b 100644
--- a/drivers/isdn/hisax/saphir.c
+++ b/drivers/isdn/hisax/saphir.c
@@ -241,7 +241,7 @@ saphir_card_msg(struct IsdnCardState *cs, int mt, void *arg)
241} 241}
242 242
243 243
244int __init 244int __devinit
245setup_saphir(struct IsdnCard *card) 245setup_saphir(struct IsdnCard *card)
246{ 246{
247 struct IsdnCardState *cs = card->cs; 247 struct IsdnCardState *cs = card->cs;
diff --git a/drivers/isdn/hisax/sportster.c b/drivers/isdn/hisax/sportster.c
index cdf35dc564c4..a49b694eb730 100644
--- a/drivers/isdn/hisax/sportster.c
+++ b/drivers/isdn/hisax/sportster.c
@@ -184,7 +184,7 @@ Sportster_card_msg(struct IsdnCardState *cs, int mt, void *arg)
184 return(0); 184 return(0);
185} 185}
186 186
187static int __init 187static int __devinit
188get_io_range(struct IsdnCardState *cs) 188get_io_range(struct IsdnCardState *cs)
189{ 189{
190 int i, j, adr; 190 int i, j, adr;
@@ -209,7 +209,7 @@ get_io_range(struct IsdnCardState *cs)
209 } 209 }
210} 210}
211 211
212int __init 212int __devinit
213setup_sportster(struct IsdnCard *card) 213setup_sportster(struct IsdnCard *card)
214{ 214{
215 struct IsdnCardState *cs = card->cs; 215 struct IsdnCardState *cs = card->cs;
diff --git a/drivers/isdn/hisax/teleint.c b/drivers/isdn/hisax/teleint.c
index a2b1816af37a..e94dc6f5bd62 100644
--- a/drivers/isdn/hisax/teleint.c
+++ b/drivers/isdn/hisax/teleint.c
@@ -261,7 +261,7 @@ TeleInt_card_msg(struct IsdnCardState *cs, int mt, void *arg)
261 return(0); 261 return(0);
262} 262}
263 263
264int __init 264int __devinit
265setup_TeleInt(struct IsdnCard *card) 265setup_TeleInt(struct IsdnCard *card)
266{ 266{
267 struct IsdnCardState *cs = card->cs; 267 struct IsdnCardState *cs = card->cs;
diff --git a/drivers/isdn/hisax/teles0.c b/drivers/isdn/hisax/teles0.c
index 2b7df8f98233..f94af0930a17 100644
--- a/drivers/isdn/hisax/teles0.c
+++ b/drivers/isdn/hisax/teles0.c
@@ -265,7 +265,7 @@ Teles_card_msg(struct IsdnCardState *cs, int mt, void *arg)
265 return(0); 265 return(0);
266} 266}
267 267
268int __init 268int __devinit
269setup_teles0(struct IsdnCard *card) 269setup_teles0(struct IsdnCard *card)
270{ 270{
271 u_char val; 271 u_char val;
diff --git a/drivers/isdn/hisax/telespci.c b/drivers/isdn/hisax/telespci.c
index 9382cdf04d8d..dca446865f24 100644
--- a/drivers/isdn/hisax/telespci.c
+++ b/drivers/isdn/hisax/telespci.c
@@ -284,9 +284,9 @@ TelesPCI_card_msg(struct IsdnCardState *cs, int mt, void *arg)
284 return(0); 284 return(0);
285} 285}
286 286
287static struct pci_dev *dev_tel __initdata = NULL; 287static struct pci_dev *dev_tel __devinitdata = NULL;
288 288
289int __init 289int __devinit
290setup_telespci(struct IsdnCard *card) 290setup_telespci(struct IsdnCard *card)
291{ 291{
292 struct IsdnCardState *cs = card->cs; 292 struct IsdnCardState *cs = card->cs;
diff --git a/drivers/isdn/hisax/w6692.c b/drivers/isdn/hisax/w6692.c
index 6c68419c05ff..0595293b8659 100644
--- a/drivers/isdn/hisax/w6692.c
+++ b/drivers/isdn/hisax/w6692.c
@@ -44,11 +44,11 @@ static const char *w6692_revision = "$Revision: 1.18.2.4 $";
44 44
45#define DBUSY_TIMER_VALUE 80 45#define DBUSY_TIMER_VALUE 80
46 46
47static char *W6692Ver[] __initdata = 47static char *W6692Ver[] =
48{"W6692 V00", "W6692 V01", "W6692 V10", 48{"W6692 V00", "W6692 V01", "W6692 V10",
49 "W6692 V11"}; 49 "W6692 V11"};
50 50
51static void __init 51static void
52W6692Version(struct IsdnCardState *cs, char *s) 52W6692Version(struct IsdnCardState *cs, char *s)
53{ 53{
54 int val; 54 int val;
@@ -897,7 +897,7 @@ static void resetW6692(struct IsdnCardState *cs)
897 } 897 }
898} 898}
899 899
900static void __init initW6692(struct IsdnCardState *cs, int part) 900static void initW6692(struct IsdnCardState *cs, int part)
901{ 901{
902 if (part & 1) { 902 if (part & 1) {
903 cs->setstack_d = setstack_W6692; 903 cs->setstack_d = setstack_W6692;
@@ -992,9 +992,9 @@ w6692_card_msg(struct IsdnCardState *cs, int mt, void *arg)
992 992
993static int id_idx ; 993static int id_idx ;
994 994
995static struct pci_dev *dev_w6692 __initdata = NULL; 995static struct pci_dev *dev_w6692 __devinitdata = NULL;
996 996
997int __init 997int __devinit
998setup_w6692(struct IsdnCard *card) 998setup_w6692(struct IsdnCard *card)
999{ 999{
1000 struct IsdnCardState *cs = card->cs; 1000 struct IsdnCardState *cs = card->cs;
diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c
index 9f6c6375ff75..c3d79eef9e32 100644
--- a/drivers/isdn/i4l/isdn_common.c
+++ b/drivers/isdn/i4l/isdn_common.c
@@ -1059,7 +1059,7 @@ isdn_info_update(void)
1059static ssize_t 1059static ssize_t
1060isdn_read(struct file *file, char __user *buf, size_t count, loff_t * off) 1060isdn_read(struct file *file, char __user *buf, size_t count, loff_t * off)
1061{ 1061{
1062 uint minor = MINOR(file->f_dentry->d_inode->i_rdev); 1062 uint minor = iminor(file->f_dentry->d_inode);
1063 int len = 0; 1063 int len = 0;
1064 int drvidx; 1064 int drvidx;
1065 int chidx; 1065 int chidx;
@@ -1163,7 +1163,7 @@ isdn_read(struct file *file, char __user *buf, size_t count, loff_t * off)
1163static ssize_t 1163static ssize_t
1164isdn_write(struct file *file, const char __user *buf, size_t count, loff_t * off) 1164isdn_write(struct file *file, const char __user *buf, size_t count, loff_t * off)
1165{ 1165{
1166 uint minor = MINOR(file->f_dentry->d_inode->i_rdev); 1166 uint minor = iminor(file->f_dentry->d_inode);
1167 int drvidx; 1167 int drvidx;
1168 int chidx; 1168 int chidx;
1169 int retval; 1169 int retval;
@@ -1225,7 +1225,7 @@ static unsigned int
1225isdn_poll(struct file *file, poll_table * wait) 1225isdn_poll(struct file *file, poll_table * wait)
1226{ 1226{
1227 unsigned int mask = 0; 1227 unsigned int mask = 0;
1228 unsigned int minor = MINOR(file->f_dentry->d_inode->i_rdev); 1228 unsigned int minor = iminor(file->f_dentry->d_inode);
1229 int drvidx = isdn_minor2drv(minor - ISDN_MINOR_CTRL); 1229 int drvidx = isdn_minor2drv(minor - ISDN_MINOR_CTRL);
1230 1230
1231 lock_kernel(); 1231 lock_kernel();
@@ -1266,7 +1266,7 @@ isdn_poll(struct file *file, poll_table * wait)
1266static int 1266static int
1267isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg) 1267isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
1268{ 1268{
1269 uint minor = MINOR(inode->i_rdev); 1269 uint minor = iminor(inode);
1270 isdn_ctrl c; 1270 isdn_ctrl c;
1271 int drvidx; 1271 int drvidx;
1272 int chidx; 1272 int chidx;
@@ -1717,7 +1717,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
1717static int 1717static int
1718isdn_open(struct inode *ino, struct file *filep) 1718isdn_open(struct inode *ino, struct file *filep)
1719{ 1719{
1720 uint minor = MINOR(ino->i_rdev); 1720 uint minor = iminor(ino);
1721 int drvidx; 1721 int drvidx;
1722 int chidx; 1722 int chidx;
1723 int retval = -ENODEV; 1723 int retval = -ENODEV;
@@ -1779,7 +1779,7 @@ isdn_open(struct inode *ino, struct file *filep)
1779static int 1779static int
1780isdn_close(struct inode *ino, struct file *filep) 1780isdn_close(struct inode *ino, struct file *filep)
1781{ 1781{
1782 uint minor = MINOR(ino->i_rdev); 1782 uint minor = iminor(ino);
1783 1783
1784 lock_kernel(); 1784 lock_kernel();
1785 if (minor == ISDN_MINOR_STATUS) { 1785 if (minor == ISDN_MINOR_STATUS) {
diff --git a/drivers/isdn/i4l/isdn_ppp.c b/drivers/isdn/i4l/isdn_ppp.c
index 29e7667ec962..119412d6bd15 100644
--- a/drivers/isdn/i4l/isdn_ppp.c
+++ b/drivers/isdn/i4l/isdn_ppp.c
@@ -667,7 +667,7 @@ isdn_ppp_poll(struct file *file, poll_table * wait)
667 667
668 if (is->debug & 0x2) 668 if (is->debug & 0x2)
669 printk(KERN_DEBUG "isdn_ppp_poll: minor: %d\n", 669 printk(KERN_DEBUG "isdn_ppp_poll: minor: %d\n",
670 MINOR(file->f_dentry->d_inode->i_rdev)); 670 iminor(file->f_dentry->d_inode));
671 671
672 /* just registers wait_queue hook. This doesn't really wait. */ 672 /* just registers wait_queue hook. This doesn't really wait. */
673 poll_wait(file, &is->wq, wait); 673 poll_wait(file, &is->wq, wait);
diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index 96509989e921..9c39b98d5a5b 100644
--- a/drivers/leds/Kconfig
+++ b/drivers/leds/Kconfig
@@ -69,6 +69,13 @@ config LEDS_AMS_DELTA
69 help 69 help
70 This option enables support for the LEDs on Amstrad Delta (E3). 70 This option enables support for the LEDs on Amstrad Delta (E3).
71 71
72config LEDS_NET48XX
73 tristate "LED Support for Soekris net48xx series Error LED"
74 depends on LEDS_CLASS && SCx200_GPIO
75 help
76 This option enables support for the Soekris net4801 and net4826 error
77 LED.
78
72comment "LED Triggers" 79comment "LED Triggers"
73 80
74config LEDS_TRIGGERS 81config LEDS_TRIGGERS
diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
index 88d3b6eaa6a2..6aa2aed7539d 100644
--- a/drivers/leds/Makefile
+++ b/drivers/leds/Makefile
@@ -12,6 +12,7 @@ obj-$(CONFIG_LEDS_IXP4XX) += leds-ixp4xx-gpio.o
12obj-$(CONFIG_LEDS_TOSA) += leds-tosa.o 12obj-$(CONFIG_LEDS_TOSA) += leds-tosa.o
13obj-$(CONFIG_LEDS_S3C24XX) += leds-s3c24xx.o 13obj-$(CONFIG_LEDS_S3C24XX) += leds-s3c24xx.o
14obj-$(CONFIG_LEDS_AMS_DELTA) += leds-ams-delta.o 14obj-$(CONFIG_LEDS_AMS_DELTA) += leds-ams-delta.o
15obj-$(CONFIG_LEDS_NET48XX) += leds-net48xx.o
15 16
16# LED Triggers 17# LED Triggers
17obj-$(CONFIG_LEDS_TRIGGER_TIMER) += ledtrig-timer.o 18obj-$(CONFIG_LEDS_TRIGGER_TIMER) += ledtrig-timer.o
diff --git a/drivers/leds/leds-net48xx.c b/drivers/leds/leds-net48xx.c
new file mode 100644
index 000000000000..713c4a8aa77d
--- /dev/null
+++ b/drivers/leds/leds-net48xx.c
@@ -0,0 +1,116 @@
1/*
2 * LEDs driver for Soekris net48xx
3 *
4 * Copyright (C) 2006 Chris Boot <bootc@bootc.net>
5 *
6 * Based on leds-ams-delta.c
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/platform_device.h>
16#include <linux/leds.h>
17#include <linux/err.h>
18#include <asm/io.h>
19#include <linux/scx200_gpio.h>
20
21#define DRVNAME "net48xx-led"
22#define NET48XX_ERROR_LED_GPIO 20
23
24static struct platform_device *pdev;
25
26static void net48xx_error_led_set(struct led_classdev *led_cdev,
27 enum led_brightness value)
28{
29 if (value)
30 scx200_gpio_set_high(NET48XX_ERROR_LED_GPIO);
31 else
32 scx200_gpio_set_low(NET48XX_ERROR_LED_GPIO);
33}
34
35static struct led_classdev net48xx_error_led = {
36 .name = "net48xx:error",
37 .brightness_set = net48xx_error_led_set,
38};
39
40#ifdef CONFIG_PM
41static int net48xx_led_suspend(struct platform_device *dev,
42 pm_message_t state)
43{
44 led_classdev_suspend(&net48xx_error_led);
45 return 0;
46}
47
48static int net48xx_led_resume(struct platform_device *dev)
49{
50 led_classdev_resume(&net48xx_error_led);
51 return 0;
52}
53#else
54#define net48xx_led_suspend NULL
55#define net48xx_led_resume NULL
56#endif
57
58static int net48xx_led_probe(struct platform_device *pdev)
59{
60 return led_classdev_register(&pdev->dev, &net48xx_error_led);
61}
62
63static int net48xx_led_remove(struct platform_device *pdev)
64{
65 led_classdev_unregister(&net48xx_error_led);
66 return 0;
67}
68
69static struct platform_driver net48xx_led_driver = {
70 .probe = net48xx_led_probe,
71 .remove = net48xx_led_remove,
72 .suspend = net48xx_led_suspend,
73 .resume = net48xx_led_resume,
74 .driver = {
75 .name = DRVNAME,
76 .owner = THIS_MODULE,
77 },
78};
79
80static int __init net48xx_led_init(void)
81{
82 int ret;
83
84 if (!scx200_gpio_present()) {
85 ret = -ENODEV;
86 goto out;
87 }
88
89 ret = platform_driver_register(&net48xx_led_driver);
90 if (ret < 0)
91 goto out;
92
93 pdev = platform_device_register_simple(DRVNAME, -1, NULL, 0);
94 if (IS_ERR(pdev)) {
95 ret = PTR_ERR(pdev);
96 platform_driver_unregister(&net48xx_led_driver);
97 goto out;
98 }
99
100out:
101 return ret;
102}
103
104static void __exit net48xx_led_exit(void)
105{
106 platform_device_unregister(pdev);
107 platform_driver_unregister(&net48xx_led_driver);
108}
109
110module_init(net48xx_led_init);
111module_exit(net48xx_led_exit);
112
113MODULE_AUTHOR("Chris Boot <bootc@bootc.net>");
114MODULE_DESCRIPTION("Soekris net48xx LED driver");
115MODULE_LICENSE("GPL");
116
diff --git a/drivers/macintosh/Kconfig b/drivers/macintosh/Kconfig
index 54f3f6b94efc..d5d649f5ccdb 100644
--- a/drivers/macintosh/Kconfig
+++ b/drivers/macintosh/Kconfig
@@ -90,6 +90,15 @@ config ADB_PMU_LED
90 and the ide-disk LED trigger and configure appropriately through 90 and the ide-disk LED trigger and configure appropriately through
91 sysfs. 91 sysfs.
92 92
93config ADB_PMU_LED_IDE
94 bool "Use front LED as IDE LED by default"
95 depends on ADB_PMU_LED
96 select LEDS_TRIGGERS
97 select LEDS_TRIGGER_IDE_DISK
98 help
99 This option makes the front LED default to the IDE trigger
100 so that it blinks on IDE activity.
101
93config PMAC_SMU 102config PMAC_SMU
94 bool "Support for SMU based PowerMacs" 103 bool "Support for SMU based PowerMacs"
95 depends on PPC_PMAC64 104 depends on PPC_PMAC64
@@ -100,7 +109,7 @@ config PMAC_SMU
100 109
101config PMAC_APM_EMU 110config PMAC_APM_EMU
102 tristate "APM emulation" 111 tristate "APM emulation"
103 depends on PPC_PMAC && PPC32 && PM 112 depends on PPC_PMAC && PPC32 && PM && ADB_PMU
104 113
105config PMAC_MEDIABAY 114config PMAC_MEDIABAY
106 bool "Support PowerBook hotswap media bay" 115 bool "Support PowerBook hotswap media bay"
@@ -113,7 +122,8 @@ config PMAC_MEDIABAY
113 122
114config PMAC_BACKLIGHT 123config PMAC_BACKLIGHT
115 bool "Backlight control for LCD screens" 124 bool "Backlight control for LCD screens"
116 depends on ADB_PMU && (BROKEN || !PPC64) 125 depends on ADB_PMU && FB = y && (BROKEN || !PPC64)
126 select FB_BACKLIGHT
117 help 127 help
118 Say Y here to enable Macintosh specific extensions of the generic 128 Say Y here to enable Macintosh specific extensions of the generic
119 backlight code. With this enabled, the brightness keys on older 129 backlight code. With this enabled, the brightness keys on older
diff --git a/drivers/macintosh/adbhid.c b/drivers/macintosh/adbhid.c
index 545be1ed6927..c69d23bb255e 100644
--- a/drivers/macintosh/adbhid.c
+++ b/drivers/macintosh/adbhid.c
@@ -45,14 +45,11 @@
45#include <linux/pmu.h> 45#include <linux/pmu.h>
46 46
47#include <asm/machdep.h> 47#include <asm/machdep.h>
48#include <asm/backlight.h>
48#ifdef CONFIG_PPC_PMAC 49#ifdef CONFIG_PPC_PMAC
49#include <asm/pmac_feature.h> 50#include <asm/pmac_feature.h>
50#endif 51#endif
51 52
52#ifdef CONFIG_PMAC_BACKLIGHT
53#include <asm/backlight.h>
54#endif
55
56MODULE_AUTHOR("Franz Sirl <Franz.Sirl-kernel@lauterbach.com>"); 53MODULE_AUTHOR("Franz Sirl <Franz.Sirl-kernel@lauterbach.com>");
57 54
58#define KEYB_KEYREG 0 /* register # for key up/down data */ 55#define KEYB_KEYREG 0 /* register # for key up/down data */
@@ -237,11 +234,6 @@ static struct adb_ids keyboard_ids;
237static struct adb_ids mouse_ids; 234static struct adb_ids mouse_ids;
238static struct adb_ids buttons_ids; 235static struct adb_ids buttons_ids;
239 236
240#ifdef CONFIG_PMAC_BACKLIGHT
241/* Exported to via-pmu.c */
242int disable_kernel_backlight = 0;
243#endif /* CONFIG_PMAC_BACKLIGHT */
244
245/* Kind of keyboard, see Apple technote 1152 */ 237/* Kind of keyboard, see Apple technote 1152 */
246#define ADB_KEYBOARD_UNKNOWN 0 238#define ADB_KEYBOARD_UNKNOWN 0
247#define ADB_KEYBOARD_ANSI 0x0100 239#define ADB_KEYBOARD_ANSI 0x0100
@@ -527,7 +519,7 @@ adbhid_buttons_input(unsigned char *data, int nb, struct pt_regs *regs, int auto
527 519
528 case 0xa: /* brightness decrease */ 520 case 0xa: /* brightness decrease */
529#ifdef CONFIG_PMAC_BACKLIGHT 521#ifdef CONFIG_PMAC_BACKLIGHT
530 if (!disable_kernel_backlight && down) 522 if (down)
531 pmac_backlight_key_down(); 523 pmac_backlight_key_down();
532#endif 524#endif
533 input_report_key(adbhid[id]->input, KEY_BRIGHTNESSDOWN, down); 525 input_report_key(adbhid[id]->input, KEY_BRIGHTNESSDOWN, down);
@@ -535,7 +527,7 @@ adbhid_buttons_input(unsigned char *data, int nb, struct pt_regs *regs, int auto
535 527
536 case 0x9: /* brightness increase */ 528 case 0x9: /* brightness increase */
537#ifdef CONFIG_PMAC_BACKLIGHT 529#ifdef CONFIG_PMAC_BACKLIGHT
538 if (!disable_kernel_backlight && down) 530 if (down)
539 pmac_backlight_key_up(); 531 pmac_backlight_key_up();
540#endif 532#endif
541 input_report_key(adbhid[id]->input, KEY_BRIGHTNESSUP, down); 533 input_report_key(adbhid[id]->input, KEY_BRIGHTNESSUP, down);
diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c
index 80c0c665b5f6..82657bc86d19 100644
--- a/drivers/macintosh/macio_asic.c
+++ b/drivers/macintosh/macio_asic.c
@@ -330,7 +330,7 @@ static void macio_create_fixup_irq(struct macio_dev *dev, int index,
330{ 330{
331 unsigned int irq; 331 unsigned int irq;
332 332
333 irq = irq_create_mapping(NULL, line, 0); 333 irq = irq_create_mapping(NULL, line);
334 if (irq != NO_IRQ) { 334 if (irq != NO_IRQ) {
335 dev->interrupt[index].start = irq; 335 dev->interrupt[index].start = irq;
336 dev->interrupt[index].flags = IORESOURCE_IRQ; 336 dev->interrupt[index].flags = IORESOURCE_IRQ;
diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c
index f139a74696fe..00ef46898147 100644
--- a/drivers/macintosh/smu.c
+++ b/drivers/macintosh/smu.c
@@ -75,9 +75,11 @@ struct smu_device {
75 struct of_device *of_dev; 75 struct of_device *of_dev;
76 int doorbell; /* doorbell gpio */ 76 int doorbell; /* doorbell gpio */
77 u32 __iomem *db_buf; /* doorbell buffer */ 77 u32 __iomem *db_buf; /* doorbell buffer */
78 int db_irq; 78 struct device_node *db_node;
79 unsigned int db_irq;
79 int msg; 80 int msg;
80 int msg_irq; 81 struct device_node *msg_node;
82 unsigned int msg_irq;
81 struct smu_cmd_buf *cmd_buf; /* command buffer virtual */ 83 struct smu_cmd_buf *cmd_buf; /* command buffer virtual */
82 u32 cmd_buf_abs; /* command buffer absolute */ 84 u32 cmd_buf_abs; /* command buffer absolute */
83 struct list_head cmd_list; 85 struct list_head cmd_list;
@@ -93,6 +95,7 @@ struct smu_device {
93 */ 95 */
94static struct smu_device *smu; 96static struct smu_device *smu;
95static DEFINE_MUTEX(smu_part_access); 97static DEFINE_MUTEX(smu_part_access);
98static int smu_irq_inited;
96 99
97static void smu_i2c_retry(unsigned long data); 100static void smu_i2c_retry(unsigned long data);
98 101
@@ -257,6 +260,10 @@ int smu_queue_cmd(struct smu_cmd *cmd)
257 smu_start_cmd(); 260 smu_start_cmd();
258 spin_unlock_irqrestore(&smu->lock, flags); 261 spin_unlock_irqrestore(&smu->lock, flags);
259 262
263 /* Workaround for early calls when irq isn't available */
264 if (!smu_irq_inited || smu->db_irq == NO_IRQ)
265 smu_spinwait_cmd(cmd);
266
260 return 0; 267 return 0;
261} 268}
262EXPORT_SYMBOL(smu_queue_cmd); 269EXPORT_SYMBOL(smu_queue_cmd);
@@ -478,14 +485,15 @@ int __init smu_init (void)
478 smu->cmd_buf_abs = (u32)smu_cmdbuf_abs; 485 smu->cmd_buf_abs = (u32)smu_cmdbuf_abs;
479 smu->cmd_buf = (struct smu_cmd_buf *)abs_to_virt(smu_cmdbuf_abs); 486 smu->cmd_buf = (struct smu_cmd_buf *)abs_to_virt(smu_cmdbuf_abs);
480 487
481 np = of_find_node_by_name(NULL, "smu-doorbell"); 488 smu->db_node = of_find_node_by_name(NULL, "smu-doorbell");
482 if (np == NULL) { 489 if (smu->db_node == NULL) {
483 printk(KERN_ERR "SMU: Can't find doorbell GPIO !\n"); 490 printk(KERN_ERR "SMU: Can't find doorbell GPIO !\n");
484 goto fail; 491 goto fail;
485 } 492 }
486 data = (u32 *)get_property(np, "reg", NULL); 493 data = (u32 *)get_property(smu->db_node, "reg", NULL);
487 if (data == NULL) { 494 if (data == NULL) {
488 of_node_put(np); 495 of_node_put(smu->db_node);
496 smu->db_node = NULL;
489 printk(KERN_ERR "SMU: Can't find doorbell GPIO address !\n"); 497 printk(KERN_ERR "SMU: Can't find doorbell GPIO address !\n");
490 goto fail; 498 goto fail;
491 } 499 }
@@ -497,25 +505,21 @@ int __init smu_init (void)
497 smu->doorbell = *data; 505 smu->doorbell = *data;
498 if (smu->doorbell < 0x50) 506 if (smu->doorbell < 0x50)
499 smu->doorbell += 0x50; 507 smu->doorbell += 0x50;
500 smu->db_irq = irq_of_parse_and_map(np, 0);
501
502 of_node_put(np);
503 508
504 /* Now look for the smu-interrupt GPIO */ 509 /* Now look for the smu-interrupt GPIO */
505 do { 510 do {
506 np = of_find_node_by_name(NULL, "smu-interrupt"); 511 smu->msg_node = of_find_node_by_name(NULL, "smu-interrupt");
507 if (np == NULL) 512 if (smu->msg_node == NULL)
508 break; 513 break;
509 data = (u32 *)get_property(np, "reg", NULL); 514 data = (u32 *)get_property(smu->msg_node, "reg", NULL);
510 if (data == NULL) { 515 if (data == NULL) {
511 of_node_put(np); 516 of_node_put(smu->msg_node);
517 smu->msg_node = NULL;
512 break; 518 break;
513 } 519 }
514 smu->msg = *data; 520 smu->msg = *data;
515 if (smu->msg < 0x50) 521 if (smu->msg < 0x50)
516 smu->msg += 0x50; 522 smu->msg += 0x50;
517 smu->msg_irq = irq_of_parse_and_map(np, 0);
518 of_node_put(np);
519 } while(0); 523 } while(0);
520 524
521 /* Doorbell buffer is currently hard-coded, I didn't find a proper 525 /* Doorbell buffer is currently hard-coded, I didn't find a proper
@@ -547,6 +551,19 @@ static int smu_late_init(void)
547 smu->i2c_timer.function = smu_i2c_retry; 551 smu->i2c_timer.function = smu_i2c_retry;
548 smu->i2c_timer.data = (unsigned long)smu; 552 smu->i2c_timer.data = (unsigned long)smu;
549 553
554 if (smu->db_node) {
555 smu->db_irq = irq_of_parse_and_map(smu->db_node, 0);
556 if (smu->db_irq == NO_IRQ)
557 printk(KERN_ERR "smu: failed to map irq for node %s\n",
558 smu->db_node->full_name);
559 }
560 if (smu->msg_node) {
561 smu->msg_irq = irq_of_parse_and_map(smu->msg_node, 0);
562 if (smu->msg_irq == NO_IRQ)
563 printk(KERN_ERR "smu: failed to map irq for node %s\n",
564 smu->msg_node->full_name);
565 }
566
550 /* 567 /*
551 * Try to request the interrupts 568 * Try to request the interrupts
552 */ 569 */
@@ -571,6 +588,7 @@ static int smu_late_init(void)
571 } 588 }
572 } 589 }
573 590
591 smu_irq_inited = 1;
574 return 0; 592 return 0;
575} 593}
576/* This has to be before arch_initcall as the low i2c stuff relies on the 594/* This has to be before arch_initcall as the low i2c stuff relies on the
@@ -742,6 +760,11 @@ static void smu_i2c_low_completion(struct smu_cmd *scmd, void *misc)
742 if (fail && --cmd->retries > 0) { 760 if (fail && --cmd->retries > 0) {
743 DPRINTK("SMU: i2c failure, starting timer...\n"); 761 DPRINTK("SMU: i2c failure, starting timer...\n");
744 BUG_ON(cmd != smu->cmd_i2c_cur); 762 BUG_ON(cmd != smu->cmd_i2c_cur);
763 if (!smu_irq_inited) {
764 mdelay(5);
765 smu_i2c_retry(0);
766 return;
767 }
745 mod_timer(&smu->i2c_timer, jiffies + msecs_to_jiffies(5)); 768 mod_timer(&smu->i2c_timer, jiffies + msecs_to_jiffies(5));
746 return; 769 return;
747 } 770 }
diff --git a/drivers/macintosh/therm_pm72.c b/drivers/macintosh/therm_pm72.c
index c1fe0b368f76..20bf67244e2c 100644
--- a/drivers/macintosh/therm_pm72.c
+++ b/drivers/macintosh/therm_pm72.c
@@ -95,6 +95,17 @@
95 * - Use min/max macros here or there 95 * - Use min/max macros here or there
96 * - Latest darwin updated U3H min fan speed to 20% PWM 96 * - Latest darwin updated U3H min fan speed to 20% PWM
97 * 97 *
98 * July. 06, 2006 : 1.3
99 * - Fix setting of RPM fans on Xserve G5 (they were going too fast)
100 * - Add missing slots fan control loop for Xserve G5
101 * - Lower fixed slots fan speed from 50% to 40% on desktop G5s. We
102 * still can't properly implement the control loop for these, so let's
103 * reduce the noise a little bit, it appears that 40% still gives us
104 * a pretty good air flow
105 * - Add code to "tickle" the FCU regulary so it doesn't think that
106 * we are gone while in fact, the machine just didn't need any fan
107 * speed change lately
108 *
98 */ 109 */
99 110
100#include <linux/types.h> 111#include <linux/types.h>
@@ -121,7 +132,7 @@
121 132
122#include "therm_pm72.h" 133#include "therm_pm72.h"
123 134
124#define VERSION "1.2b2" 135#define VERSION "1.3"
125 136
126#undef DEBUG 137#undef DEBUG
127 138
@@ -146,6 +157,7 @@ static struct basckside_pid_params backside_params;
146static struct backside_pid_state backside_state; 157static struct backside_pid_state backside_state;
147static struct drives_pid_state drives_state; 158static struct drives_pid_state drives_state;
148static struct dimm_pid_state dimms_state; 159static struct dimm_pid_state dimms_state;
160static struct slots_pid_state slots_state;
149static int state; 161static int state;
150static int cpu_count; 162static int cpu_count;
151static int cpu_pid_type; 163static int cpu_pid_type;
@@ -154,7 +166,8 @@ static struct completion ctrl_complete;
154static int critical_state; 166static int critical_state;
155static int rackmac; 167static int rackmac;
156static s32 dimm_output_clamp; 168static s32 dimm_output_clamp;
157 169static int fcu_rpm_shift;
170static int fcu_tickle_ticks;
158static DECLARE_MUTEX(driver_lock); 171static DECLARE_MUTEX(driver_lock);
159 172
160/* 173/*
@@ -495,13 +508,20 @@ static int start_fcu(void)
495 rc = fan_write_reg(0x2e, &buf, 1); 508 rc = fan_write_reg(0x2e, &buf, 1);
496 if (rc < 0) 509 if (rc < 0)
497 return -EIO; 510 return -EIO;
511 rc = fan_read_reg(0, &buf, 1);
512 if (rc < 0)
513 return -EIO;
514 fcu_rpm_shift = (buf == 1) ? 2 : 3;
515 printk(KERN_DEBUG "FCU Initialized, RPM fan shift is %d\n",
516 fcu_rpm_shift);
517
498 return 0; 518 return 0;
499} 519}
500 520
501static int set_rpm_fan(int fan_index, int rpm) 521static int set_rpm_fan(int fan_index, int rpm)
502{ 522{
503 unsigned char buf[2]; 523 unsigned char buf[2];
504 int rc, id; 524 int rc, id, min, max;
505 525
506 if (fcu_fans[fan_index].type != FCU_FAN_RPM) 526 if (fcu_fans[fan_index].type != FCU_FAN_RPM)
507 return -EINVAL; 527 return -EINVAL;
@@ -509,12 +529,15 @@ static int set_rpm_fan(int fan_index, int rpm)
509 if (id == FCU_FAN_ABSENT_ID) 529 if (id == FCU_FAN_ABSENT_ID)
510 return -EINVAL; 530 return -EINVAL;
511 531
512 if (rpm < 300) 532 min = 2400 >> fcu_rpm_shift;
513 rpm = 300; 533 max = 56000 >> fcu_rpm_shift;
514 else if (rpm > 8191) 534
515 rpm = 8191; 535 if (rpm < min)
516 buf[0] = rpm >> 5; 536 rpm = min;
517 buf[1] = rpm << 3; 537 else if (rpm > max)
538 rpm = max;
539 buf[0] = rpm >> (8 - fcu_rpm_shift);
540 buf[1] = rpm << fcu_rpm_shift;
518 rc = fan_write_reg(0x10 + (id * 2), buf, 2); 541 rc = fan_write_reg(0x10 + (id * 2), buf, 2);
519 if (rc < 0) 542 if (rc < 0)
520 return -EIO; 543 return -EIO;
@@ -551,7 +574,7 @@ static int get_rpm_fan(int fan_index, int programmed)
551 if (rc != 2) 574 if (rc != 2)
552 return -EIO; 575 return -EIO;
553 576
554 return (buf[0] << 5) | buf[1] >> 3; 577 return (buf[0] << (8 - fcu_rpm_shift)) | buf[1] >> fcu_rpm_shift;
555} 578}
556 579
557static int set_pwm_fan(int fan_index, int pwm) 580static int set_pwm_fan(int fan_index, int pwm)
@@ -609,6 +632,26 @@ static int get_pwm_fan(int fan_index)
609 return (buf[0] * 1000) / 2559; 632 return (buf[0] * 1000) / 2559;
610} 633}
611 634
635static void tickle_fcu(void)
636{
637 int pwm;
638
639 pwm = get_pwm_fan(SLOTS_FAN_PWM_INDEX);
640
641 DBG("FCU Tickle, slots fan is: %d\n", pwm);
642 if (pwm < 0)
643 pwm = 100;
644
645 if (!rackmac) {
646 pwm = SLOTS_FAN_DEFAULT_PWM;
647 } else if (pwm < SLOTS_PID_OUTPUT_MIN)
648 pwm = SLOTS_PID_OUTPUT_MIN;
649
650 /* That is hopefully enough to make the FCU happy */
651 set_pwm_fan(SLOTS_FAN_PWM_INDEX, pwm);
652}
653
654
612/* 655/*
613 * Utility routine to read the CPU calibration EEPROM data 656 * Utility routine to read the CPU calibration EEPROM data
614 * from the device-tree 657 * from the device-tree
@@ -715,6 +758,9 @@ BUILD_SHOW_FUNC_INT(backside_fan_pwm, backside_state.pwm)
715BUILD_SHOW_FUNC_FIX(drives_temperature, drives_state.last_temp) 758BUILD_SHOW_FUNC_FIX(drives_temperature, drives_state.last_temp)
716BUILD_SHOW_FUNC_INT(drives_fan_rpm, drives_state.rpm) 759BUILD_SHOW_FUNC_INT(drives_fan_rpm, drives_state.rpm)
717 760
761BUILD_SHOW_FUNC_FIX(slots_temperature, slots_state.last_temp)
762BUILD_SHOW_FUNC_INT(slots_fan_pwm, slots_state.pwm)
763
718BUILD_SHOW_FUNC_FIX(dimms_temperature, dimms_state.last_temp) 764BUILD_SHOW_FUNC_FIX(dimms_temperature, dimms_state.last_temp)
719 765
720static DEVICE_ATTR(cpu0_temperature,S_IRUGO,show_cpu0_temperature,NULL); 766static DEVICE_ATTR(cpu0_temperature,S_IRUGO,show_cpu0_temperature,NULL);
@@ -735,6 +781,9 @@ static DEVICE_ATTR(backside_fan_pwm,S_IRUGO,show_backside_fan_pwm,NULL);
735static DEVICE_ATTR(drives_temperature,S_IRUGO,show_drives_temperature,NULL); 781static DEVICE_ATTR(drives_temperature,S_IRUGO,show_drives_temperature,NULL);
736static DEVICE_ATTR(drives_fan_rpm,S_IRUGO,show_drives_fan_rpm,NULL); 782static DEVICE_ATTR(drives_fan_rpm,S_IRUGO,show_drives_fan_rpm,NULL);
737 783
784static DEVICE_ATTR(slots_temperature,S_IRUGO,show_slots_temperature,NULL);
785static DEVICE_ATTR(slots_fan_pwm,S_IRUGO,show_slots_fan_pwm,NULL);
786
738static DEVICE_ATTR(dimms_temperature,S_IRUGO,show_dimms_temperature,NULL); 787static DEVICE_ATTR(dimms_temperature,S_IRUGO,show_dimms_temperature,NULL);
739 788
740/* 789/*
@@ -1076,6 +1125,9 @@ static void do_monitor_cpu_rack(struct cpu_pid_state *state)
1076 fan_min = dimm_output_clamp; 1125 fan_min = dimm_output_clamp;
1077 fan_min = max(fan_min, (int)state->mpu.rminn_intake_fan); 1126 fan_min = max(fan_min, (int)state->mpu.rminn_intake_fan);
1078 1127
1128 DBG(" CPU min mpu = %d, min dimm = %d\n",
1129 state->mpu.rminn_intake_fan, dimm_output_clamp);
1130
1079 state->rpm = max(state->rpm, (int)fan_min); 1131 state->rpm = max(state->rpm, (int)fan_min);
1080 state->rpm = min(state->rpm, (int)state->mpu.rmaxn_intake_fan); 1132 state->rpm = min(state->rpm, (int)state->mpu.rmaxn_intake_fan);
1081 state->intake_rpm = state->rpm; 1133 state->intake_rpm = state->rpm;
@@ -1374,7 +1426,8 @@ static void do_monitor_drives(struct drives_pid_state *state)
1374 DBG(" current rpm: %d\n", state->rpm); 1426 DBG(" current rpm: %d\n", state->rpm);
1375 1427
1376 /* Get some sensor readings */ 1428 /* Get some sensor readings */
1377 temp = le16_to_cpu(i2c_smbus_read_word_data(state->monitor, DS1775_TEMP)) << 8; 1429 temp = le16_to_cpu(i2c_smbus_read_word_data(state->monitor,
1430 DS1775_TEMP)) << 8;
1378 state->last_temp = temp; 1431 state->last_temp = temp;
1379 DBG(" temp: %d.%03d, target: %d.%03d\n", FIX32TOPRINT(temp), 1432 DBG(" temp: %d.%03d, target: %d.%03d\n", FIX32TOPRINT(temp),
1380 FIX32TOPRINT(DRIVES_PID_INPUT_TARGET)); 1433 FIX32TOPRINT(DRIVES_PID_INPUT_TARGET));
@@ -1575,7 +1628,7 @@ static int init_dimms_state(struct dimm_pid_state *state)
1575} 1628}
1576 1629
1577/* 1630/*
1578 * Dispose of the state data for the drives control loop 1631 * Dispose of the state data for the DIMM control loop
1579 */ 1632 */
1580static void dispose_dimms_state(struct dimm_pid_state *state) 1633static void dispose_dimms_state(struct dimm_pid_state *state)
1581{ 1634{
@@ -1588,6 +1641,127 @@ static void dispose_dimms_state(struct dimm_pid_state *state)
1588 state->monitor = NULL; 1641 state->monitor = NULL;
1589} 1642}
1590 1643
1644/*
1645 * Slots fan control loop
1646 */
1647static void do_monitor_slots(struct slots_pid_state *state)
1648{
1649 s32 temp, integral, derivative;
1650 s64 integ_p, deriv_p, prop_p, sum;
1651 int i, rc;
1652
1653 if (--state->ticks != 0)
1654 return;
1655 state->ticks = SLOTS_PID_INTERVAL;
1656
1657 DBG("slots:\n");
1658
1659 /* Check fan status */
1660 rc = get_pwm_fan(SLOTS_FAN_PWM_INDEX);
1661 if (rc < 0) {
1662 printk(KERN_WARNING "Error %d reading slots fan !\n", rc);
1663 /* XXX What do we do now ? */
1664 } else
1665 state->pwm = rc;
1666 DBG(" current pwm: %d\n", state->pwm);
1667
1668 /* Get some sensor readings */
1669 temp = le16_to_cpu(i2c_smbus_read_word_data(state->monitor,
1670 DS1775_TEMP)) << 8;
1671 state->last_temp = temp;
1672 DBG(" temp: %d.%03d, target: %d.%03d\n", FIX32TOPRINT(temp),
1673 FIX32TOPRINT(SLOTS_PID_INPUT_TARGET));
1674
1675 /* Store temperature and error in history array */
1676 state->cur_sample = (state->cur_sample + 1) % SLOTS_PID_HISTORY_SIZE;
1677 state->sample_history[state->cur_sample] = temp;
1678 state->error_history[state->cur_sample] = temp - SLOTS_PID_INPUT_TARGET;
1679
1680 /* If first loop, fill the history table */
1681 if (state->first) {
1682 for (i = 0; i < (SLOTS_PID_HISTORY_SIZE - 1); i++) {
1683 state->cur_sample = (state->cur_sample + 1) %
1684 SLOTS_PID_HISTORY_SIZE;
1685 state->sample_history[state->cur_sample] = temp;
1686 state->error_history[state->cur_sample] =
1687 temp - SLOTS_PID_INPUT_TARGET;
1688 }
1689 state->first = 0;
1690 }
1691
1692 /* Calculate the integral term */
1693 sum = 0;
1694 integral = 0;
1695 for (i = 0; i < SLOTS_PID_HISTORY_SIZE; i++)
1696 integral += state->error_history[i];
1697 integral *= SLOTS_PID_INTERVAL;
1698 DBG(" integral: %08x\n", integral);
1699 integ_p = ((s64)SLOTS_PID_G_r) * (s64)integral;
1700 DBG(" integ_p: %d\n", (int)(integ_p >> 36));
1701 sum += integ_p;
1702
1703 /* Calculate the derivative term */
1704 derivative = state->error_history[state->cur_sample] -
1705 state->error_history[(state->cur_sample + SLOTS_PID_HISTORY_SIZE - 1)
1706 % SLOTS_PID_HISTORY_SIZE];
1707 derivative /= SLOTS_PID_INTERVAL;
1708 deriv_p = ((s64)SLOTS_PID_G_d) * (s64)derivative;
1709 DBG(" deriv_p: %d\n", (int)(deriv_p >> 36));
1710 sum += deriv_p;
1711
1712 /* Calculate the proportional term */
1713 prop_p = ((s64)SLOTS_PID_G_p) * (s64)(state->error_history[state->cur_sample]);
1714 DBG(" prop_p: %d\n", (int)(prop_p >> 36));
1715 sum += prop_p;
1716
1717 /* Scale sum */
1718 sum >>= 36;
1719
1720 DBG(" sum: %d\n", (int)sum);
1721 state->pwm = (s32)sum;
1722
1723 state->pwm = max(state->pwm, SLOTS_PID_OUTPUT_MIN);
1724 state->pwm = min(state->pwm, SLOTS_PID_OUTPUT_MAX);
1725
1726 DBG("** DRIVES PWM: %d\n", (int)state->pwm);
1727 set_pwm_fan(SLOTS_FAN_PWM_INDEX, state->pwm);
1728}
1729
1730/*
1731 * Initialize the state structure for the slots bay fan control loop
1732 */
1733static int init_slots_state(struct slots_pid_state *state)
1734{
1735 state->ticks = 1;
1736 state->first = 1;
1737 state->pwm = 50;
1738
1739 state->monitor = attach_i2c_chip(XSERVE_SLOTS_LM75, "slots_temp");
1740 if (state->monitor == NULL)
1741 return -ENODEV;
1742
1743 device_create_file(&of_dev->dev, &dev_attr_slots_temperature);
1744 device_create_file(&of_dev->dev, &dev_attr_slots_fan_pwm);
1745
1746 return 0;
1747}
1748
1749/*
1750 * Dispose of the state data for the slots control loop
1751 */
1752static void dispose_slots_state(struct slots_pid_state *state)
1753{
1754 if (state->monitor == NULL)
1755 return;
1756
1757 device_remove_file(&of_dev->dev, &dev_attr_slots_temperature);
1758 device_remove_file(&of_dev->dev, &dev_attr_slots_fan_pwm);
1759
1760 detach_i2c_chip(state->monitor);
1761 state->monitor = NULL;
1762}
1763
1764
1591static int call_critical_overtemp(void) 1765static int call_critical_overtemp(void)
1592{ 1766{
1593 char *argv[] = { critical_overtemp_path, NULL }; 1767 char *argv[] = { critical_overtemp_path, NULL };
@@ -1617,14 +1791,17 @@ static int main_control_loop(void *x)
1617 goto out; 1791 goto out;
1618 } 1792 }
1619 1793
1620 /* Set the PCI fan once for now */ 1794 /* Set the PCI fan once for now on non-RackMac */
1621 set_pwm_fan(SLOTS_FAN_PWM_INDEX, SLOTS_FAN_DEFAULT_PWM); 1795 if (!rackmac)
1796 set_pwm_fan(SLOTS_FAN_PWM_INDEX, SLOTS_FAN_DEFAULT_PWM);
1622 1797
1623 /* Initialize ADCs */ 1798 /* Initialize ADCs */
1624 initialize_adc(&cpu_state[0]); 1799 initialize_adc(&cpu_state[0]);
1625 if (cpu_state[1].monitor != NULL) 1800 if (cpu_state[1].monitor != NULL)
1626 initialize_adc(&cpu_state[1]); 1801 initialize_adc(&cpu_state[1]);
1627 1802
1803 fcu_tickle_ticks = FCU_TICKLE_TICKS;
1804
1628 up(&driver_lock); 1805 up(&driver_lock);
1629 1806
1630 while (state == state_attached) { 1807 while (state == state_attached) {
@@ -1634,6 +1811,12 @@ static int main_control_loop(void *x)
1634 1811
1635 down(&driver_lock); 1812 down(&driver_lock);
1636 1813
1814 /* Tickle the FCU just in case */
1815 if (--fcu_tickle_ticks < 0) {
1816 fcu_tickle_ticks = FCU_TICKLE_TICKS;
1817 tickle_fcu();
1818 }
1819
1637 /* First, we always calculate the new DIMMs state on an Xserve */ 1820 /* First, we always calculate the new DIMMs state on an Xserve */
1638 if (rackmac) 1821 if (rackmac)
1639 do_monitor_dimms(&dimms_state); 1822 do_monitor_dimms(&dimms_state);
@@ -1654,7 +1837,9 @@ static int main_control_loop(void *x)
1654 } 1837 }
1655 /* Then, the rest */ 1838 /* Then, the rest */
1656 do_monitor_backside(&backside_state); 1839 do_monitor_backside(&backside_state);
1657 if (!rackmac) 1840 if (rackmac)
1841 do_monitor_slots(&slots_state);
1842 else
1658 do_monitor_drives(&drives_state); 1843 do_monitor_drives(&drives_state);
1659 up(&driver_lock); 1844 up(&driver_lock);
1660 1845
@@ -1696,6 +1881,7 @@ static void dispose_control_loops(void)
1696 dispose_cpu_state(&cpu_state[1]); 1881 dispose_cpu_state(&cpu_state[1]);
1697 dispose_backside_state(&backside_state); 1882 dispose_backside_state(&backside_state);
1698 dispose_drives_state(&drives_state); 1883 dispose_drives_state(&drives_state);
1884 dispose_slots_state(&slots_state);
1699 dispose_dimms_state(&dimms_state); 1885 dispose_dimms_state(&dimms_state);
1700} 1886}
1701 1887
@@ -1745,6 +1931,8 @@ static int create_control_loops(void)
1745 goto fail; 1931 goto fail;
1746 if (rackmac && init_dimms_state(&dimms_state)) 1932 if (rackmac && init_dimms_state(&dimms_state))
1747 goto fail; 1933 goto fail;
1934 if (rackmac && init_slots_state(&slots_state))
1935 goto fail;
1748 if (!rackmac && init_drives_state(&drives_state)) 1936 if (!rackmac && init_drives_state(&drives_state))
1749 goto fail; 1937 goto fail;
1750 1938
diff --git a/drivers/macintosh/therm_pm72.h b/drivers/macintosh/therm_pm72.h
index fc7e9b7ecaf2..393cc9df94e1 100644
--- a/drivers/macintosh/therm_pm72.h
+++ b/drivers/macintosh/therm_pm72.h
@@ -105,6 +105,7 @@ static char * critical_overtemp_path = "/sbin/critical_overtemp";
105#define DRIVES_DALLAS_ID 0x94 105#define DRIVES_DALLAS_ID 0x94
106#define BACKSIDE_MAX_ID 0x98 106#define BACKSIDE_MAX_ID 0x98
107#define XSERVE_DIMMS_LM87 0x25a 107#define XSERVE_DIMMS_LM87 0x25a
108#define XSERVE_SLOTS_LM75 0x290
108 109
109/* 110/*
110 * Some MAX6690, DS1775, LM87 register definitions 111 * Some MAX6690, DS1775, LM87 register definitions
@@ -198,7 +199,7 @@ struct drives_pid_state
198 199
199#define SLOTS_FAN_PWM_DEFAULT_ID 2 200#define SLOTS_FAN_PWM_DEFAULT_ID 2
200#define SLOTS_FAN_PWM_INDEX 2 201#define SLOTS_FAN_PWM_INDEX 2
201#define SLOTS_FAN_DEFAULT_PWM 50 /* Do better here ! */ 202#define SLOTS_FAN_DEFAULT_PWM 40 /* Do better here ! */
202 203
203 204
204/* 205/*
@@ -206,7 +207,7 @@ struct drives_pid_state
206 */ 207 */
207#define DIMM_PID_G_d 0 208#define DIMM_PID_G_d 0
208#define DIMM_PID_G_p 0 209#define DIMM_PID_G_p 0
209#define DIMM_PID_G_r 0x6553600 210#define DIMM_PID_G_r 0x06553600
210#define DIMM_PID_INPUT_TARGET 3276800 211#define DIMM_PID_INPUT_TARGET 3276800
211#define DIMM_PID_INTERVAL 1 212#define DIMM_PID_INTERVAL 1
212#define DIMM_PID_OUTPUT_MAX 14000 213#define DIMM_PID_OUTPUT_MAX 14000
@@ -226,6 +227,31 @@ struct dimm_pid_state
226}; 227};
227 228
228 229
230/*
231 * PID factors for the Xserve Slots control loop
232 */
233#define SLOTS_PID_G_d 0
234#define SLOTS_PID_G_p 0
235#define SLOTS_PID_G_r 0x00100000
236#define SLOTS_PID_INPUT_TARGET 3200000
237#define SLOTS_PID_INTERVAL 1
238#define SLOTS_PID_OUTPUT_MAX 100
239#define SLOTS_PID_OUTPUT_MIN 20
240#define SLOTS_PID_HISTORY_SIZE 20
241
242struct slots_pid_state
243{
244 int ticks;
245 struct i2c_client * monitor;
246 s32 sample_history[SLOTS_PID_HISTORY_SIZE];
247 s32 error_history[SLOTS_PID_HISTORY_SIZE];
248 int cur_sample;
249 s32 last_temp;
250 int first;
251 int pwm;
252};
253
254
229 255
230/* Desktops */ 256/* Desktops */
231 257
@@ -283,6 +309,9 @@ struct cpu_pid_state
283 s32 pump_max; 309 s32 pump_max;
284}; 310};
285 311
312/* Tickle FCU every 10 seconds */
313#define FCU_TICKLE_TICKS 10
314
286/* 315/*
287 * Driver state 316 * Driver state
288 */ 317 */
diff --git a/drivers/macintosh/via-pmu-backlight.c b/drivers/macintosh/via-pmu-backlight.c
index b42d05f2aaff..d3f8d75bcbb4 100644
--- a/drivers/macintosh/via-pmu-backlight.c
+++ b/drivers/macintosh/via-pmu-backlight.c
@@ -15,8 +15,9 @@
15 15
16#define MAX_PMU_LEVEL 0xFF 16#define MAX_PMU_LEVEL 0xFF
17 17
18static struct device_node *vias;
19static struct backlight_properties pmu_backlight_data; 18static struct backlight_properties pmu_backlight_data;
19static spinlock_t pmu_backlight_lock;
20static int sleeping;
20 21
21static int pmu_backlight_get_level_brightness(struct fb_info *info, 22static int pmu_backlight_get_level_brightness(struct fb_info *info,
22 int level) 23 int level)
@@ -40,23 +41,36 @@ static int pmu_backlight_update_status(struct backlight_device *bd)
40{ 41{
41 struct fb_info *info = class_get_devdata(&bd->class_dev); 42 struct fb_info *info = class_get_devdata(&bd->class_dev);
42 struct adb_request req; 43 struct adb_request req;
43 int pmulevel, level = bd->props->brightness; 44 unsigned long flags;
45 int level = bd->props->brightness;
44 46
45 if (vias == NULL) 47 spin_lock_irqsave(&pmu_backlight_lock, flags);
46 return -ENODEV; 48
49 /* Don't update brightness when sleeping */
50 if (sleeping)
51 goto out;
47 52
48 if (bd->props->power != FB_BLANK_UNBLANK || 53 if (bd->props->power != FB_BLANK_UNBLANK ||
49 bd->props->fb_blank != FB_BLANK_UNBLANK) 54 bd->props->fb_blank != FB_BLANK_UNBLANK)
50 level = 0; 55 level = 0;
51 56
52 pmulevel = pmu_backlight_get_level_brightness(info, level); 57 if (level > 0) {
58 int pmulevel = pmu_backlight_get_level_brightness(info, level);
53 59
54 pmu_request(&req, NULL, 2, PMU_BACKLIGHT_BRIGHT, pmulevel); 60 pmu_request(&req, NULL, 2, PMU_BACKLIGHT_BRIGHT, pmulevel);
55 pmu_wait_complete(&req); 61 pmu_wait_complete(&req);
56 62
57 pmu_request(&req, NULL, 2, PMU_POWER_CTRL, 63 pmu_request(&req, NULL, 2, PMU_POWER_CTRL,
58 PMU_POW_BACKLIGHT | (level > 0 ? PMU_POW_ON : PMU_POW_OFF)); 64 PMU_POW_BACKLIGHT | PMU_POW_ON);
59 pmu_wait_complete(&req); 65 pmu_wait_complete(&req);
66 } else {
67 pmu_request(&req, NULL, 2, PMU_POWER_CTRL,
68 PMU_POW_BACKLIGHT | PMU_POW_OFF);
69 pmu_wait_complete(&req);
70 }
71
72out:
73 spin_unlock_irqrestore(&pmu_backlight_lock, flags);
60 74
61 return 0; 75 return 0;
62} 76}
@@ -73,15 +87,39 @@ static struct backlight_properties pmu_backlight_data = {
73 .max_brightness = (FB_BACKLIGHT_LEVELS - 1), 87 .max_brightness = (FB_BACKLIGHT_LEVELS - 1),
74}; 88};
75 89
76void __init pmu_backlight_init(struct device_node *in_vias) 90#ifdef CONFIG_PM
91static int pmu_backlight_sleep_call(struct pmu_sleep_notifier *self, int when)
92{
93 unsigned long flags;
94
95 spin_lock_irqsave(&pmu_backlight_lock, flags);
96
97 switch (when) {
98 case PBOOK_SLEEP_REQUEST:
99 sleeping = 1;
100 break;
101 case PBOOK_WAKE:
102 sleeping = 0;
103 break;
104 }
105
106 spin_unlock_irqrestore(&pmu_backlight_lock, flags);
107
108 return PBOOK_SLEEP_OK;
109}
110
111static struct pmu_sleep_notifier pmu_backlight_sleep_notif = {
112 .notifier_call = pmu_backlight_sleep_call,
113};
114#endif
115
116void __init pmu_backlight_init()
77{ 117{
78 struct backlight_device *bd; 118 struct backlight_device *bd;
79 struct fb_info *info; 119 struct fb_info *info;
80 char name[10]; 120 char name[10];
81 int level, autosave; 121 int level, autosave;
82 122
83 vias = in_vias;
84
85 /* Special case for the old PowerBook since I can't test on it */ 123 /* Special case for the old PowerBook since I can't test on it */
86 autosave = 124 autosave =
87 machine_is_compatible("AAPL,3400/2400") || 125 machine_is_compatible("AAPL,3400/2400") ||
@@ -141,6 +179,10 @@ void __init pmu_backlight_init(struct device_node *in_vias)
141 pmac_backlight = bd; 179 pmac_backlight = bd;
142 mutex_unlock(&pmac_backlight_mutex); 180 mutex_unlock(&pmac_backlight_mutex);
143 181
182#ifdef CONFIG_PM
183 pmu_register_sleep_notifier(&pmu_backlight_sleep_notif);
184#endif
185
144 printk("pmubl: Backlight initialized (%s)\n", name); 186 printk("pmubl: Backlight initialized (%s)\n", name);
145 187
146 return; 188 return;
diff --git a/drivers/macintosh/via-pmu-led.c b/drivers/macintosh/via-pmu-led.c
index af8375ed0f5e..5189d5454b1f 100644
--- a/drivers/macintosh/via-pmu-led.c
+++ b/drivers/macintosh/via-pmu-led.c
@@ -74,7 +74,7 @@ static void pmu_led_set(struct led_classdev *led_cdev,
74 74
75static struct led_classdev pmu_led = { 75static struct led_classdev pmu_led = {
76 .name = "pmu-front-led", 76 .name = "pmu-front-led",
77#ifdef CONFIG_BLK_DEV_IDE_PMAC_BLINK 77#ifdef CONFIG_ADB_PMU_LED_IDE
78 .default_trigger = "ide-disk", 78 .default_trigger = "ide-disk",
79#endif 79#endif
80 .brightness_set = pmu_led_set, 80 .brightness_set = pmu_led_set,
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
index 06ca80bfd6b9..ea386801e215 100644
--- a/drivers/macintosh/via-pmu.c
+++ b/drivers/macintosh/via-pmu.c
@@ -16,7 +16,6 @@
16 * a sleep or a freq. switch 16 * a sleep or a freq. switch
17 * - Move sleep code out of here to pmac_pm, merge into new 17 * - Move sleep code out of here to pmac_pm, merge into new
18 * common PM infrastructure 18 * common PM infrastructure
19 * - Move backlight code out as well
20 * - Save/Restore PCI space properly 19 * - Save/Restore PCI space properly
21 * 20 *
22 */ 21 */
@@ -60,9 +59,7 @@
60#include <asm/mmu_context.h> 59#include <asm/mmu_context.h>
61#include <asm/cputable.h> 60#include <asm/cputable.h>
62#include <asm/time.h> 61#include <asm/time.h>
63#ifdef CONFIG_PMAC_BACKLIGHT
64#include <asm/backlight.h> 62#include <asm/backlight.h>
65#endif
66 63
67#include "via-pmu-event.h" 64#include "via-pmu-event.h"
68 65
@@ -177,10 +174,6 @@ static int query_batt_timer = BATTERY_POLLING_COUNT;
177static struct adb_request batt_req; 174static struct adb_request batt_req;
178static struct proc_dir_entry *proc_pmu_batt[PMU_MAX_BATTERIES]; 175static struct proc_dir_entry *proc_pmu_batt[PMU_MAX_BATTERIES];
179 176
180#if defined(CONFIG_INPUT_ADBHID) && defined(CONFIG_PMAC_BACKLIGHT)
181extern int disable_kernel_backlight;
182#endif /* defined(CONFIG_INPUT_ADBHID) && defined(CONFIG_PMAC_BACKLIGHT) */
183
184int __fake_sleep; 177int __fake_sleep;
185int asleep; 178int asleep;
186BLOCKING_NOTIFIER_HEAD(sleep_notifier_list); 179BLOCKING_NOTIFIER_HEAD(sleep_notifier_list);
@@ -466,7 +459,7 @@ static int __init via_pmu_dev_init(void)
466 459
467#ifdef CONFIG_PMAC_BACKLIGHT 460#ifdef CONFIG_PMAC_BACKLIGHT
468 /* Initialize backlight */ 461 /* Initialize backlight */
469 pmu_backlight_init(vias); 462 pmu_backlight_init();
470#endif 463#endif
471 464
472#ifdef CONFIG_PPC32 465#ifdef CONFIG_PPC32
@@ -1403,11 +1396,8 @@ next:
1403 else if ((1 << pirq) & PMU_INT_SNDBRT) { 1396 else if ((1 << pirq) & PMU_INT_SNDBRT) {
1404#ifdef CONFIG_PMAC_BACKLIGHT 1397#ifdef CONFIG_PMAC_BACKLIGHT
1405 if (len == 3) 1398 if (len == 3)
1406#ifdef CONFIG_INPUT_ADBHID 1399 pmac_backlight_set_legacy_brightness_pmu(data[1] >> 4);
1407 if (!disable_kernel_backlight) 1400#endif
1408#endif /* CONFIG_INPUT_ADBHID */
1409 pmac_backlight_set_legacy_brightness(data[1] >> 4);
1410#endif /* CONFIG_PMAC_BACKLIGHT */
1411 } 1401 }
1412 /* Tick interrupt */ 1402 /* Tick interrupt */
1413 else if ((1 << pirq) & PMU_INT_TICK) { 1403 else if ((1 << pirq) & PMU_INT_TICK) {
@@ -2414,7 +2404,7 @@ struct pmu_private {
2414 spinlock_t lock; 2404 spinlock_t lock;
2415#if defined(CONFIG_INPUT_ADBHID) && defined(CONFIG_PMAC_BACKLIGHT) 2405#if defined(CONFIG_INPUT_ADBHID) && defined(CONFIG_PMAC_BACKLIGHT)
2416 int backlight_locker; 2406 int backlight_locker;
2417#endif /* defined(CONFIG_INPUT_ADBHID) && defined(CONFIG_PMAC_BACKLIGHT) */ 2407#endif
2418}; 2408};
2419 2409
2420static LIST_HEAD(all_pmu_pvt); 2410static LIST_HEAD(all_pmu_pvt);
@@ -2464,7 +2454,7 @@ pmu_open(struct inode *inode, struct file *file)
2464 spin_lock_irqsave(&all_pvt_lock, flags); 2454 spin_lock_irqsave(&all_pvt_lock, flags);
2465#if defined(CONFIG_INPUT_ADBHID) && defined(CONFIG_PMAC_BACKLIGHT) 2455#if defined(CONFIG_INPUT_ADBHID) && defined(CONFIG_PMAC_BACKLIGHT)
2466 pp->backlight_locker = 0; 2456 pp->backlight_locker = 0;
2467#endif /* defined(CONFIG_INPUT_ADBHID) && defined(CONFIG_PMAC_BACKLIGHT) */ 2457#endif
2468 list_add(&pp->list, &all_pmu_pvt); 2458 list_add(&pp->list, &all_pmu_pvt);
2469 spin_unlock_irqrestore(&all_pvt_lock, flags); 2459 spin_unlock_irqrestore(&all_pvt_lock, flags);
2470 file->private_data = pp; 2460 file->private_data = pp;
@@ -2559,13 +2549,12 @@ pmu_release(struct inode *inode, struct file *file)
2559 spin_lock_irqsave(&all_pvt_lock, flags); 2549 spin_lock_irqsave(&all_pvt_lock, flags);
2560 list_del(&pp->list); 2550 list_del(&pp->list);
2561 spin_unlock_irqrestore(&all_pvt_lock, flags); 2551 spin_unlock_irqrestore(&all_pvt_lock, flags);
2552
2562#if defined(CONFIG_INPUT_ADBHID) && defined(CONFIG_PMAC_BACKLIGHT) 2553#if defined(CONFIG_INPUT_ADBHID) && defined(CONFIG_PMAC_BACKLIGHT)
2563 if (pp->backlight_locker) { 2554 if (pp->backlight_locker)
2564 spin_lock_irqsave(&pmu_lock, flags); 2555 pmac_backlight_enable();
2565 disable_kernel_backlight--; 2556#endif
2566 spin_unlock_irqrestore(&pmu_lock, flags); 2557
2567 }
2568#endif /* defined(CONFIG_INPUT_ADBHID) && defined(CONFIG_PMAC_BACKLIGHT) */
2569 kfree(pp); 2558 kfree(pp);
2570 } 2559 }
2571 unlock_kernel(); 2560 unlock_kernel();
@@ -2642,18 +2631,18 @@ pmu_ioctl(struct inode * inode, struct file *filp,
2642#ifdef CONFIG_INPUT_ADBHID 2631#ifdef CONFIG_INPUT_ADBHID
2643 case PMU_IOC_GRAB_BACKLIGHT: { 2632 case PMU_IOC_GRAB_BACKLIGHT: {
2644 struct pmu_private *pp = filp->private_data; 2633 struct pmu_private *pp = filp->private_data;
2645 unsigned long flags;
2646 2634
2647 if (pp->backlight_locker) 2635 if (pp->backlight_locker)
2648 return 0; 2636 return 0;
2637
2649 pp->backlight_locker = 1; 2638 pp->backlight_locker = 1;
2650 spin_lock_irqsave(&pmu_lock, flags); 2639 pmac_backlight_disable();
2651 disable_kernel_backlight++; 2640
2652 spin_unlock_irqrestore(&pmu_lock, flags);
2653 return 0; 2641 return 0;
2654 } 2642 }
2655#endif /* CONFIG_INPUT_ADBHID */ 2643#endif /* CONFIG_INPUT_ADBHID */
2656#endif /* CONFIG_PMAC_BACKLIGHT_LEGACY */ 2644#endif /* CONFIG_PMAC_BACKLIGHT_LEGACY */
2645
2657 case PMU_IOC_GET_MODEL: 2646 case PMU_IOC_GET_MODEL:
2658 return put_user(pmu_kind, argp); 2647 return put_user(pmu_kind, argp);
2659 case PMU_IOC_HAS_ADB: 2648 case PMU_IOC_HAS_ADB:
diff --git a/drivers/md/md.c b/drivers/md/md.c
index e4e161372a3e..b6d16022a53e 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -110,7 +110,7 @@ static ctl_table raid_table[] = {
110 .procname = "speed_limit_min", 110 .procname = "speed_limit_min",
111 .data = &sysctl_speed_limit_min, 111 .data = &sysctl_speed_limit_min,
112 .maxlen = sizeof(int), 112 .maxlen = sizeof(int),
113 .mode = 0644, 113 .mode = S_IRUGO|S_IWUSR,
114 .proc_handler = &proc_dointvec, 114 .proc_handler = &proc_dointvec,
115 }, 115 },
116 { 116 {
@@ -118,7 +118,7 @@ static ctl_table raid_table[] = {
118 .procname = "speed_limit_max", 118 .procname = "speed_limit_max",
119 .data = &sysctl_speed_limit_max, 119 .data = &sysctl_speed_limit_max,
120 .maxlen = sizeof(int), 120 .maxlen = sizeof(int),
121 .mode = 0644, 121 .mode = S_IRUGO|S_IWUSR,
122 .proc_handler = &proc_dointvec, 122 .proc_handler = &proc_dointvec,
123 }, 123 },
124 { .ctl_name = 0 } 124 { .ctl_name = 0 }
@@ -129,7 +129,7 @@ static ctl_table raid_dir_table[] = {
129 .ctl_name = DEV_RAID, 129 .ctl_name = DEV_RAID,
130 .procname = "raid", 130 .procname = "raid",
131 .maxlen = 0, 131 .maxlen = 0,
132 .mode = 0555, 132 .mode = S_IRUGO|S_IXUGO,
133 .child = raid_table, 133 .child = raid_table,
134 }, 134 },
135 { .ctl_name = 0 } 135 { .ctl_name = 0 }
@@ -1062,6 +1062,11 @@ static int super_1_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version)
1062 if (rdev->sb_size & bmask) 1062 if (rdev->sb_size & bmask)
1063 rdev-> sb_size = (rdev->sb_size | bmask)+1; 1063 rdev-> sb_size = (rdev->sb_size | bmask)+1;
1064 1064
1065 if (sb->level == cpu_to_le32(LEVEL_MULTIPATH))
1066 rdev->desc_nr = -1;
1067 else
1068 rdev->desc_nr = le32_to_cpu(sb->dev_number);
1069
1065 if (refdev == 0) 1070 if (refdev == 0)
1066 ret = 1; 1071 ret = 1;
1067 else { 1072 else {
@@ -1171,7 +1176,6 @@ static int super_1_validate(mddev_t *mddev, mdk_rdev_t *rdev)
1171 } 1176 }
1172 if (mddev->level != LEVEL_MULTIPATH) { 1177 if (mddev->level != LEVEL_MULTIPATH) {
1173 int role; 1178 int role;
1174 rdev->desc_nr = le32_to_cpu(sb->dev_number);
1175 role = le16_to_cpu(sb->dev_roles[rdev->desc_nr]); 1179 role = le16_to_cpu(sb->dev_roles[rdev->desc_nr]);
1176 switch(role) { 1180 switch(role) {
1177 case 0xffff: /* spare */ 1181 case 0xffff: /* spare */
@@ -1779,8 +1783,8 @@ state_store(mdk_rdev_t *rdev, const char *buf, size_t len)
1779 } 1783 }
1780 return err ? err : len; 1784 return err ? err : len;
1781} 1785}
1782static struct rdev_sysfs_entry 1786static struct rdev_sysfs_entry rdev_state =
1783rdev_state = __ATTR(state, 0644, state_show, state_store); 1787__ATTR(state, S_IRUGO|S_IWUSR, state_show, state_store);
1784 1788
1785static ssize_t 1789static ssize_t
1786super_show(mdk_rdev_t *rdev, char *page) 1790super_show(mdk_rdev_t *rdev, char *page)
@@ -1811,7 +1815,7 @@ errors_store(mdk_rdev_t *rdev, const char *buf, size_t len)
1811 return -EINVAL; 1815 return -EINVAL;
1812} 1816}
1813static struct rdev_sysfs_entry rdev_errors = 1817static struct rdev_sysfs_entry rdev_errors =
1814__ATTR(errors, 0644, errors_show, errors_store); 1818__ATTR(errors, S_IRUGO|S_IWUSR, errors_show, errors_store);
1815 1819
1816static ssize_t 1820static ssize_t
1817slot_show(mdk_rdev_t *rdev, char *page) 1821slot_show(mdk_rdev_t *rdev, char *page)
@@ -1845,7 +1849,7 @@ slot_store(mdk_rdev_t *rdev, const char *buf, size_t len)
1845 1849
1846 1850
1847static struct rdev_sysfs_entry rdev_slot = 1851static struct rdev_sysfs_entry rdev_slot =
1848__ATTR(slot, 0644, slot_show, slot_store); 1852__ATTR(slot, S_IRUGO|S_IWUSR, slot_show, slot_store);
1849 1853
1850static ssize_t 1854static ssize_t
1851offset_show(mdk_rdev_t *rdev, char *page) 1855offset_show(mdk_rdev_t *rdev, char *page)
@@ -1867,7 +1871,7 @@ offset_store(mdk_rdev_t *rdev, const char *buf, size_t len)
1867} 1871}
1868 1872
1869static struct rdev_sysfs_entry rdev_offset = 1873static struct rdev_sysfs_entry rdev_offset =
1870__ATTR(offset, 0644, offset_show, offset_store); 1874__ATTR(offset, S_IRUGO|S_IWUSR, offset_show, offset_store);
1871 1875
1872static ssize_t 1876static ssize_t
1873rdev_size_show(mdk_rdev_t *rdev, char *page) 1877rdev_size_show(mdk_rdev_t *rdev, char *page)
@@ -1891,7 +1895,7 @@ rdev_size_store(mdk_rdev_t *rdev, const char *buf, size_t len)
1891} 1895}
1892 1896
1893static struct rdev_sysfs_entry rdev_size = 1897static struct rdev_sysfs_entry rdev_size =
1894__ATTR(size, 0644, rdev_size_show, rdev_size_store); 1898__ATTR(size, S_IRUGO|S_IWUSR, rdev_size_show, rdev_size_store);
1895 1899
1896static struct attribute *rdev_default_attrs[] = { 1900static struct attribute *rdev_default_attrs[] = {
1897 &rdev_state.attr, 1901 &rdev_state.attr,
@@ -1922,6 +1926,8 @@ rdev_attr_store(struct kobject *kobj, struct attribute *attr,
1922 1926
1923 if (!entry->store) 1927 if (!entry->store)
1924 return -EIO; 1928 return -EIO;
1929 if (!capable(CAP_SYS_ADMIN))
1930 return -EACCES;
1925 return entry->store(rdev, page, length); 1931 return entry->store(rdev, page, length);
1926} 1932}
1927 1933
@@ -2128,7 +2134,7 @@ safe_delay_store(mddev_t *mddev, const char *cbuf, size_t len)
2128 return len; 2134 return len;
2129} 2135}
2130static struct md_sysfs_entry md_safe_delay = 2136static struct md_sysfs_entry md_safe_delay =
2131__ATTR(safe_mode_delay, 0644,safe_delay_show, safe_delay_store); 2137__ATTR(safe_mode_delay, S_IRUGO|S_IWUSR,safe_delay_show, safe_delay_store);
2132 2138
2133static ssize_t 2139static ssize_t
2134level_show(mddev_t *mddev, char *page) 2140level_show(mddev_t *mddev, char *page)
@@ -2163,7 +2169,7 @@ level_store(mddev_t *mddev, const char *buf, size_t len)
2163} 2169}
2164 2170
2165static struct md_sysfs_entry md_level = 2171static struct md_sysfs_entry md_level =
2166__ATTR(level, 0644, level_show, level_store); 2172__ATTR(level, S_IRUGO|S_IWUSR, level_show, level_store);
2167 2173
2168 2174
2169static ssize_t 2175static ssize_t
@@ -2188,7 +2194,7 @@ layout_store(mddev_t *mddev, const char *buf, size_t len)
2188 return len; 2194 return len;
2189} 2195}
2190static struct md_sysfs_entry md_layout = 2196static struct md_sysfs_entry md_layout =
2191__ATTR(layout, 0655, layout_show, layout_store); 2197__ATTR(layout, S_IRUGO|S_IWUSR, layout_show, layout_store);
2192 2198
2193 2199
2194static ssize_t 2200static ssize_t
@@ -2219,7 +2225,7 @@ raid_disks_store(mddev_t *mddev, const char *buf, size_t len)
2219 return rv ? rv : len; 2225 return rv ? rv : len;
2220} 2226}
2221static struct md_sysfs_entry md_raid_disks = 2227static struct md_sysfs_entry md_raid_disks =
2222__ATTR(raid_disks, 0644, raid_disks_show, raid_disks_store); 2228__ATTR(raid_disks, S_IRUGO|S_IWUSR, raid_disks_show, raid_disks_store);
2223 2229
2224static ssize_t 2230static ssize_t
2225chunk_size_show(mddev_t *mddev, char *page) 2231chunk_size_show(mddev_t *mddev, char *page)
@@ -2243,7 +2249,7 @@ chunk_size_store(mddev_t *mddev, const char *buf, size_t len)
2243 return len; 2249 return len;
2244} 2250}
2245static struct md_sysfs_entry md_chunk_size = 2251static struct md_sysfs_entry md_chunk_size =
2246__ATTR(chunk_size, 0644, chunk_size_show, chunk_size_store); 2252__ATTR(chunk_size, S_IRUGO|S_IWUSR, chunk_size_show, chunk_size_store);
2247 2253
2248static ssize_t 2254static ssize_t
2249resync_start_show(mddev_t *mddev, char *page) 2255resync_start_show(mddev_t *mddev, char *page)
@@ -2267,7 +2273,7 @@ resync_start_store(mddev_t *mddev, const char *buf, size_t len)
2267 return len; 2273 return len;
2268} 2274}
2269static struct md_sysfs_entry md_resync_start = 2275static struct md_sysfs_entry md_resync_start =
2270__ATTR(resync_start, 0644, resync_start_show, resync_start_store); 2276__ATTR(resync_start, S_IRUGO|S_IWUSR, resync_start_show, resync_start_store);
2271 2277
2272/* 2278/*
2273 * The array state can be: 2279 * The array state can be:
@@ -2437,7 +2443,8 @@ array_state_store(mddev_t *mddev, const char *buf, size_t len)
2437 else 2443 else
2438 return len; 2444 return len;
2439} 2445}
2440static struct md_sysfs_entry md_array_state = __ATTR(array_state, 0644, array_state_show, array_state_store); 2446static struct md_sysfs_entry md_array_state =
2447__ATTR(array_state, S_IRUGO|S_IWUSR, array_state_show, array_state_store);
2441 2448
2442static ssize_t 2449static ssize_t
2443null_show(mddev_t *mddev, char *page) 2450null_show(mddev_t *mddev, char *page)
@@ -2497,7 +2504,7 @@ new_dev_store(mddev_t *mddev, const char *buf, size_t len)
2497} 2504}
2498 2505
2499static struct md_sysfs_entry md_new_device = 2506static struct md_sysfs_entry md_new_device =
2500__ATTR(new_dev, 0200, null_show, new_dev_store); 2507__ATTR(new_dev, S_IWUSR, null_show, new_dev_store);
2501 2508
2502static ssize_t 2509static ssize_t
2503size_show(mddev_t *mddev, char *page) 2510size_show(mddev_t *mddev, char *page)
@@ -2535,7 +2542,7 @@ size_store(mddev_t *mddev, const char *buf, size_t len)
2535} 2542}
2536 2543
2537static struct md_sysfs_entry md_size = 2544static struct md_sysfs_entry md_size =
2538__ATTR(component_size, 0644, size_show, size_store); 2545__ATTR(component_size, S_IRUGO|S_IWUSR, size_show, size_store);
2539 2546
2540 2547
2541/* Metdata version. 2548/* Metdata version.
@@ -2583,7 +2590,7 @@ metadata_store(mddev_t *mddev, const char *buf, size_t len)
2583} 2590}
2584 2591
2585static struct md_sysfs_entry md_metadata = 2592static struct md_sysfs_entry md_metadata =
2586__ATTR(metadata_version, 0644, metadata_show, metadata_store); 2593__ATTR(metadata_version, S_IRUGO|S_IWUSR, metadata_show, metadata_store);
2587 2594
2588static ssize_t 2595static ssize_t
2589action_show(mddev_t *mddev, char *page) 2596action_show(mddev_t *mddev, char *page)
@@ -2651,12 +2658,11 @@ mismatch_cnt_show(mddev_t *mddev, char *page)
2651 (unsigned long long) mddev->resync_mismatches); 2658 (unsigned long long) mddev->resync_mismatches);
2652} 2659}
2653 2660
2654static struct md_sysfs_entry 2661static struct md_sysfs_entry md_scan_mode =
2655md_scan_mode = __ATTR(sync_action, S_IRUGO|S_IWUSR, action_show, action_store); 2662__ATTR(sync_action, S_IRUGO|S_IWUSR, action_show, action_store);
2656 2663
2657 2664
2658static struct md_sysfs_entry 2665static struct md_sysfs_entry md_mismatches = __ATTR_RO(mismatch_cnt);
2659md_mismatches = __ATTR_RO(mismatch_cnt);
2660 2666
2661static ssize_t 2667static ssize_t
2662sync_min_show(mddev_t *mddev, char *page) 2668sync_min_show(mddev_t *mddev, char *page)
@@ -2715,15 +2721,14 @@ static ssize_t
2715sync_speed_show(mddev_t *mddev, char *page) 2721sync_speed_show(mddev_t *mddev, char *page)
2716{ 2722{
2717 unsigned long resync, dt, db; 2723 unsigned long resync, dt, db;
2718 resync = (mddev->curr_resync - atomic_read(&mddev->recovery_active)); 2724 resync = (mddev->curr_mark_cnt - atomic_read(&mddev->recovery_active));
2719 dt = ((jiffies - mddev->resync_mark) / HZ); 2725 dt = ((jiffies - mddev->resync_mark) / HZ);
2720 if (!dt) dt++; 2726 if (!dt) dt++;
2721 db = resync - (mddev->resync_mark_cnt); 2727 db = resync - (mddev->resync_mark_cnt);
2722 return sprintf(page, "%ld\n", db/dt/2); /* K/sec */ 2728 return sprintf(page, "%ld\n", db/dt/2); /* K/sec */
2723} 2729}
2724 2730
2725static struct md_sysfs_entry 2731static struct md_sysfs_entry md_sync_speed = __ATTR_RO(sync_speed);
2726md_sync_speed = __ATTR_RO(sync_speed);
2727 2732
2728static ssize_t 2733static ssize_t
2729sync_completed_show(mddev_t *mddev, char *page) 2734sync_completed_show(mddev_t *mddev, char *page)
@@ -2739,8 +2744,7 @@ sync_completed_show(mddev_t *mddev, char *page)
2739 return sprintf(page, "%lu / %lu\n", resync, max_blocks); 2744 return sprintf(page, "%lu / %lu\n", resync, max_blocks);
2740} 2745}
2741 2746
2742static struct md_sysfs_entry 2747static struct md_sysfs_entry md_sync_completed = __ATTR_RO(sync_completed);
2743md_sync_completed = __ATTR_RO(sync_completed);
2744 2748
2745static ssize_t 2749static ssize_t
2746suspend_lo_show(mddev_t *mddev, char *page) 2750suspend_lo_show(mddev_t *mddev, char *page)
@@ -2857,6 +2861,8 @@ md_attr_store(struct kobject *kobj, struct attribute *attr,
2857 2861
2858 if (!entry->store) 2862 if (!entry->store)
2859 return -EIO; 2863 return -EIO;
2864 if (!capable(CAP_SYS_ADMIN))
2865 return -EACCES;
2860 rv = mddev_lock(mddev); 2866 rv = mddev_lock(mddev);
2861 if (!rv) { 2867 if (!rv) {
2862 rv = entry->store(mddev, page, length); 2868 rv = entry->store(mddev, page, length);
@@ -3091,7 +3097,6 @@ static int do_md_run(mddev_t * mddev)
3091 } 3097 }
3092 3098
3093 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); 3099 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
3094 md_wakeup_thread(mddev->thread);
3095 3100
3096 if (mddev->sb_dirty) 3101 if (mddev->sb_dirty)
3097 md_update_sb(mddev); 3102 md_update_sb(mddev);
@@ -3112,7 +3117,7 @@ static int do_md_run(mddev_t * mddev)
3112 * start recovery here. If we leave it to md_check_recovery, 3117 * start recovery here. If we leave it to md_check_recovery,
3113 * it will remove the drives and not do the right thing 3118 * it will remove the drives and not do the right thing
3114 */ 3119 */
3115 if (mddev->degraded) { 3120 if (mddev->degraded && !mddev->sync_thread) {
3116 struct list_head *rtmp; 3121 struct list_head *rtmp;
3117 int spares = 0; 3122 int spares = 0;
3118 ITERATE_RDEV(mddev,rdev,rtmp) 3123 ITERATE_RDEV(mddev,rdev,rtmp)
@@ -3133,10 +3138,11 @@ static int do_md_run(mddev_t * mddev)
3133 mdname(mddev)); 3138 mdname(mddev));
3134 /* leave the spares where they are, it shouldn't hurt */ 3139 /* leave the spares where they are, it shouldn't hurt */
3135 mddev->recovery = 0; 3140 mddev->recovery = 0;
3136 } else 3141 }
3137 md_wakeup_thread(mddev->sync_thread);
3138 } 3142 }
3139 } 3143 }
3144 md_wakeup_thread(mddev->thread);
3145 md_wakeup_thread(mddev->sync_thread); /* possibly kick off a reshape */
3140 3146
3141 mddev->changed = 1; 3147 mddev->changed = 1;
3142 md_new_event(mddev); 3148 md_new_event(mddev);
@@ -4586,6 +4592,8 @@ void md_error(mddev_t *mddev, mdk_rdev_t *rdev)
4586 __builtin_return_address(0),__builtin_return_address(1), 4592 __builtin_return_address(0),__builtin_return_address(1),
4587 __builtin_return_address(2),__builtin_return_address(3)); 4593 __builtin_return_address(2),__builtin_return_address(3));
4588*/ 4594*/
4595 if (!mddev->pers)
4596 return;
4589 if (!mddev->pers->error_handler) 4597 if (!mddev->pers->error_handler)
4590 return; 4598 return;
4591 mddev->pers->error_handler(mddev,rdev); 4599 mddev->pers->error_handler(mddev,rdev);
@@ -4683,12 +4691,13 @@ static void status_resync(struct seq_file *seq, mddev_t * mddev)
4683 */ 4691 */
4684 dt = ((jiffies - mddev->resync_mark) / HZ); 4692 dt = ((jiffies - mddev->resync_mark) / HZ);
4685 if (!dt) dt++; 4693 if (!dt) dt++;
4686 db = resync - (mddev->resync_mark_cnt/2); 4694 db = (mddev->curr_mark_cnt - atomic_read(&mddev->recovery_active))
4687 rt = (dt * ((unsigned long)(max_blocks-resync) / (db/100+1)))/100; 4695 - mddev->resync_mark_cnt;
4696 rt = (dt * ((unsigned long)(max_blocks-resync) / (db/2/100+1)))/100;
4688 4697
4689 seq_printf(seq, " finish=%lu.%lumin", rt / 60, (rt % 60)/6); 4698 seq_printf(seq, " finish=%lu.%lumin", rt / 60, (rt % 60)/6);
4690 4699
4691 seq_printf(seq, " speed=%ldK/sec", db/dt); 4700 seq_printf(seq, " speed=%ldK/sec", db/2/dt);
4692} 4701}
4693 4702
4694static void *md_seq_start(struct seq_file *seq, loff_t *pos) 4703static void *md_seq_start(struct seq_file *seq, loff_t *pos)
@@ -5199,6 +5208,7 @@ void md_do_sync(mddev_t *mddev)
5199 5208
5200 j += sectors; 5209 j += sectors;
5201 if (j>1) mddev->curr_resync = j; 5210 if (j>1) mddev->curr_resync = j;
5211 mddev->curr_mark_cnt = io_sectors;
5202 if (last_check == 0) 5212 if (last_check == 0)
5203 /* this is the earliers that rebuilt will be 5213 /* this is the earliers that rebuilt will be
5204 * visible in /proc/mdstat 5214 * visible in /proc/mdstat
@@ -5645,8 +5655,8 @@ static int set_ro(const char *val, struct kernel_param *kp)
5645 return -EINVAL; 5655 return -EINVAL;
5646} 5656}
5647 5657
5648module_param_call(start_ro, set_ro, get_ro, NULL, 0600); 5658module_param_call(start_ro, set_ro, get_ro, NULL, S_IRUSR|S_IWUSR);
5649module_param(start_dirty_degraded, int, 0644); 5659module_param(start_dirty_degraded, int, S_IRUGO|S_IWUSR);
5650 5660
5651 5661
5652EXPORT_SYMBOL(register_md_personality); 5662EXPORT_SYMBOL(register_md_personality);
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index cead918578a7..1efe22a2d041 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1145,7 +1145,7 @@ static int end_sync_write(struct bio *bio, unsigned int bytes_done, int error)
1145 long sectors_to_go = r1_bio->sectors; 1145 long sectors_to_go = r1_bio->sectors;
1146 /* make sure these bits doesn't get cleared. */ 1146 /* make sure these bits doesn't get cleared. */
1147 do { 1147 do {
1148 bitmap_end_sync(mddev->bitmap, r1_bio->sector, 1148 bitmap_end_sync(mddev->bitmap, s,
1149 &sync_blocks, 1); 1149 &sync_blocks, 1);
1150 s += sync_blocks; 1150 s += sync_blocks;
1151 sectors_to_go -= sync_blocks; 1151 sectors_to_go -= sync_blocks;
@@ -1509,6 +1509,9 @@ static void raid1d(mddev_t *mddev)
1509 s<<9, conf->tmppage, READ) == 0) 1509 s<<9, conf->tmppage, READ) == 0)
1510 /* Well, this device is dead */ 1510 /* Well, this device is dead */
1511 md_error(mddev, rdev); 1511 md_error(mddev, rdev);
1512 else
1513 printk(KERN_INFO "raid1:%s: read error corrected (%d sectors at %llu on %s)\n",
1514 mdname(mddev), s, (unsigned long long)(sect + rdev->data_offset), bdevname(rdev->bdev, b));
1512 } 1515 }
1513 } 1516 }
1514 } else { 1517 } else {
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 7f636283a1ba..016ddb831c9b 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -1492,6 +1492,10 @@ static void raid10d(mddev_t *mddev)
1492 s<<9, conf->tmppage, READ) == 0) 1492 s<<9, conf->tmppage, READ) == 0)
1493 /* Well, this device is dead */ 1493 /* Well, this device is dead */
1494 md_error(mddev, rdev); 1494 md_error(mddev, rdev);
1495 else
1496 printk(KERN_INFO "raid10:%s: read error corrected (%d sectors at %llu on %s)\n",
1497 mdname(mddev), s, (unsigned long long)(sect+rdev->data_offset), bdevname(rdev->bdev, b));
1498
1495 rdev_dec_pending(rdev, mddev); 1499 rdev_dec_pending(rdev, mddev);
1496 rcu_read_lock(); 1500 rcu_read_lock();
1497 } 1501 }
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 7433871f4b3a..450066007160 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -18,6 +18,30 @@
18 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */ 19 */
20 20
21/*
22 * BITMAP UNPLUGGING:
23 *
24 * The sequencing for updating the bitmap reliably is a little
25 * subtle (and I got it wrong the first time) so it deserves some
26 * explanation.
27 *
28 * We group bitmap updates into batches. Each batch has a number.
29 * We may write out several batches at once, but that isn't very important.
30 * conf->bm_write is the number of the last batch successfully written.
31 * conf->bm_flush is the number of the last batch that was closed to
32 * new additions.
33 * When we discover that we will need to write to any block in a stripe
34 * (in add_stripe_bio) we update the in-memory bitmap and record in sh->bm_seq
35 * the number of the batch it will be in. This is bm_flush+1.
36 * When we are ready to do a write, if that batch hasn't been written yet,
37 * we plug the array and queue the stripe for later.
38 * When an unplug happens, we increment bm_flush, thus closing the current
39 * batch.
40 * When we notice that bm_flush > bm_write, we write out all pending updates
41 * to the bitmap, and advance bm_write to where bm_flush was.
42 * This may occasionally write a bit out twice, but is sure never to
43 * miss any bits.
44 */
21 45
22#include <linux/module.h> 46#include <linux/module.h>
23#include <linux/slab.h> 47#include <linux/slab.h>
@@ -88,12 +112,14 @@ static void __release_stripe(raid5_conf_t *conf, struct stripe_head *sh)
88 BUG_ON(!list_empty(&sh->lru)); 112 BUG_ON(!list_empty(&sh->lru));
89 BUG_ON(atomic_read(&conf->active_stripes)==0); 113 BUG_ON(atomic_read(&conf->active_stripes)==0);
90 if (test_bit(STRIPE_HANDLE, &sh->state)) { 114 if (test_bit(STRIPE_HANDLE, &sh->state)) {
91 if (test_bit(STRIPE_DELAYED, &sh->state)) 115 if (test_bit(STRIPE_DELAYED, &sh->state)) {
92 list_add_tail(&sh->lru, &conf->delayed_list); 116 list_add_tail(&sh->lru, &conf->delayed_list);
93 else if (test_bit(STRIPE_BIT_DELAY, &sh->state) && 117 blk_plug_device(conf->mddev->queue);
94 conf->seq_write == sh->bm_seq) 118 } else if (test_bit(STRIPE_BIT_DELAY, &sh->state) &&
119 sh->bm_seq - conf->seq_write > 0) {
95 list_add_tail(&sh->lru, &conf->bitmap_list); 120 list_add_tail(&sh->lru, &conf->bitmap_list);
96 else { 121 blk_plug_device(conf->mddev->queue);
122 } else {
97 clear_bit(STRIPE_BIT_DELAY, &sh->state); 123 clear_bit(STRIPE_BIT_DELAY, &sh->state);
98 list_add_tail(&sh->lru, &conf->handle_list); 124 list_add_tail(&sh->lru, &conf->handle_list);
99 } 125 }
@@ -270,7 +296,7 @@ static struct stripe_head *get_active_stripe(raid5_conf_t *conf, sector_t sector
270 < (conf->max_nr_stripes *3/4) 296 < (conf->max_nr_stripes *3/4)
271 || !conf->inactive_blocked), 297 || !conf->inactive_blocked),
272 conf->device_lock, 298 conf->device_lock,
273 unplug_slaves(conf->mddev) 299 raid5_unplug_device(conf->mddev->queue)
274 ); 300 );
275 conf->inactive_blocked = 0; 301 conf->inactive_blocked = 0;
276 } else 302 } else
@@ -281,7 +307,8 @@ static struct stripe_head *get_active_stripe(raid5_conf_t *conf, sector_t sector
281 } else { 307 } else {
282 if (!test_bit(STRIPE_HANDLE, &sh->state)) 308 if (!test_bit(STRIPE_HANDLE, &sh->state))
283 atomic_inc(&conf->active_stripes); 309 atomic_inc(&conf->active_stripes);
284 if (list_empty(&sh->lru)) 310 if (list_empty(&sh->lru) &&
311 !test_bit(STRIPE_EXPANDING, &sh->state))
285 BUG(); 312 BUG();
286 list_del_init(&sh->lru); 313 list_del_init(&sh->lru);
287 } 314 }
@@ -496,6 +523,8 @@ static int raid5_end_read_request(struct bio * bi, unsigned int bytes_done,
496 raid5_conf_t *conf = sh->raid_conf; 523 raid5_conf_t *conf = sh->raid_conf;
497 int disks = sh->disks, i; 524 int disks = sh->disks, i;
498 int uptodate = test_bit(BIO_UPTODATE, &bi->bi_flags); 525 int uptodate = test_bit(BIO_UPTODATE, &bi->bi_flags);
526 char b[BDEVNAME_SIZE];
527 mdk_rdev_t *rdev;
499 528
500 if (bi->bi_size) 529 if (bi->bi_size)
501 return 1; 530 return 1;
@@ -543,25 +572,39 @@ static int raid5_end_read_request(struct bio * bi, unsigned int bytes_done,
543 set_bit(R5_UPTODATE, &sh->dev[i].flags); 572 set_bit(R5_UPTODATE, &sh->dev[i].flags);
544#endif 573#endif
545 if (test_bit(R5_ReadError, &sh->dev[i].flags)) { 574 if (test_bit(R5_ReadError, &sh->dev[i].flags)) {
546 printk(KERN_INFO "raid5: read error corrected!!\n"); 575 rdev = conf->disks[i].rdev;
576 printk(KERN_INFO "raid5:%s: read error corrected (%lu sectors at %llu on %s)\n",
577 mdname(conf->mddev), STRIPE_SECTORS,
578 (unsigned long long)sh->sector + rdev->data_offset,
579 bdevname(rdev->bdev, b));
547 clear_bit(R5_ReadError, &sh->dev[i].flags); 580 clear_bit(R5_ReadError, &sh->dev[i].flags);
548 clear_bit(R5_ReWrite, &sh->dev[i].flags); 581 clear_bit(R5_ReWrite, &sh->dev[i].flags);
549 } 582 }
550 if (atomic_read(&conf->disks[i].rdev->read_errors)) 583 if (atomic_read(&conf->disks[i].rdev->read_errors))
551 atomic_set(&conf->disks[i].rdev->read_errors, 0); 584 atomic_set(&conf->disks[i].rdev->read_errors, 0);
552 } else { 585 } else {
586 const char *bdn = bdevname(conf->disks[i].rdev->bdev, b);
553 int retry = 0; 587 int retry = 0;
588 rdev = conf->disks[i].rdev;
589
554 clear_bit(R5_UPTODATE, &sh->dev[i].flags); 590 clear_bit(R5_UPTODATE, &sh->dev[i].flags);
555 atomic_inc(&conf->disks[i].rdev->read_errors); 591 atomic_inc(&rdev->read_errors);
556 if (conf->mddev->degraded) 592 if (conf->mddev->degraded)
557 printk(KERN_WARNING "raid5: read error not correctable.\n"); 593 printk(KERN_WARNING "raid5:%s: read error not correctable (sector %llu on %s).\n",
594 mdname(conf->mddev),
595 (unsigned long long)sh->sector + rdev->data_offset,
596 bdn);
558 else if (test_bit(R5_ReWrite, &sh->dev[i].flags)) 597 else if (test_bit(R5_ReWrite, &sh->dev[i].flags))
559 /* Oh, no!!! */ 598 /* Oh, no!!! */
560 printk(KERN_WARNING "raid5: read error NOT corrected!!\n"); 599 printk(KERN_WARNING "raid5:%s: read error NOT corrected!! (sector %llu on %s).\n",
561 else if (atomic_read(&conf->disks[i].rdev->read_errors) 600 mdname(conf->mddev),
601 (unsigned long long)sh->sector + rdev->data_offset,
602 bdn);
603 else if (atomic_read(&rdev->read_errors)
562 > conf->max_nr_stripes) 604 > conf->max_nr_stripes)
563 printk(KERN_WARNING 605 printk(KERN_WARNING
564 "raid5: Too many read errors, failing device.\n"); 606 "raid5:%s: Too many read errors, failing device %s.\n",
607 mdname(conf->mddev), bdn);
565 else 608 else
566 retry = 1; 609 retry = 1;
567 if (retry) 610 if (retry)
@@ -569,7 +612,7 @@ static int raid5_end_read_request(struct bio * bi, unsigned int bytes_done,
569 else { 612 else {
570 clear_bit(R5_ReadError, &sh->dev[i].flags); 613 clear_bit(R5_ReadError, &sh->dev[i].flags);
571 clear_bit(R5_ReWrite, &sh->dev[i].flags); 614 clear_bit(R5_ReWrite, &sh->dev[i].flags);
572 md_error(conf->mddev, conf->disks[i].rdev); 615 md_error(conf->mddev, rdev);
573 } 616 }
574 } 617 }
575 rdev_dec_pending(conf->disks[i].rdev, conf->mddev); 618 rdev_dec_pending(conf->disks[i].rdev, conf->mddev);
@@ -1270,9 +1313,9 @@ static int add_stripe_bio(struct stripe_head *sh, struct bio *bi, int dd_idx, in
1270 (unsigned long long)sh->sector, dd_idx); 1313 (unsigned long long)sh->sector, dd_idx);
1271 1314
1272 if (conf->mddev->bitmap && firstwrite) { 1315 if (conf->mddev->bitmap && firstwrite) {
1273 sh->bm_seq = conf->seq_write;
1274 bitmap_startwrite(conf->mddev->bitmap, sh->sector, 1316 bitmap_startwrite(conf->mddev->bitmap, sh->sector,
1275 STRIPE_SECTORS, 0); 1317 STRIPE_SECTORS, 0);
1318 sh->bm_seq = conf->seq_flush+1;
1276 set_bit(STRIPE_BIT_DELAY, &sh->state); 1319 set_bit(STRIPE_BIT_DELAY, &sh->state);
1277 } 1320 }
1278 1321
@@ -2554,13 +2597,6 @@ static int raid5_issue_flush(request_queue_t *q, struct gendisk *disk,
2554 return ret; 2597 return ret;
2555} 2598}
2556 2599
2557static inline void raid5_plug_device(raid5_conf_t *conf)
2558{
2559 spin_lock_irq(&conf->device_lock);
2560 blk_plug_device(conf->mddev->queue);
2561 spin_unlock_irq(&conf->device_lock);
2562}
2563
2564static int make_request(request_queue_t *q, struct bio * bi) 2600static int make_request(request_queue_t *q, struct bio * bi)
2565{ 2601{
2566 mddev_t *mddev = q->queuedata; 2602 mddev_t *mddev = q->queuedata;
@@ -2670,7 +2706,6 @@ static int make_request(request_queue_t *q, struct bio * bi)
2670 goto retry; 2706 goto retry;
2671 } 2707 }
2672 finish_wait(&conf->wait_for_overlap, &w); 2708 finish_wait(&conf->wait_for_overlap, &w);
2673 raid5_plug_device(conf);
2674 handle_stripe(sh, NULL); 2709 handle_stripe(sh, NULL);
2675 release_stripe(sh); 2710 release_stripe(sh);
2676 } else { 2711 } else {
@@ -2923,7 +2958,7 @@ static void raid5d (mddev_t *mddev)
2923 while (1) { 2958 while (1) {
2924 struct list_head *first; 2959 struct list_head *first;
2925 2960
2926 if (conf->seq_flush - conf->seq_write > 0) { 2961 if (conf->seq_flush != conf->seq_write) {
2927 int seq = conf->seq_flush; 2962 int seq = conf->seq_flush;
2928 spin_unlock_irq(&conf->device_lock); 2963 spin_unlock_irq(&conf->device_lock);
2929 bitmap_unplug(mddev->bitmap); 2964 bitmap_unplug(mddev->bitmap);
@@ -3246,9 +3281,6 @@ static int run(mddev_t *mddev)
3246 set_bit(MD_RECOVERY_RUNNING, &mddev->recovery); 3281 set_bit(MD_RECOVERY_RUNNING, &mddev->recovery);
3247 mddev->sync_thread = md_register_thread(md_do_sync, mddev, 3282 mddev->sync_thread = md_register_thread(md_do_sync, mddev,
3248 "%s_reshape"); 3283 "%s_reshape");
3249 /* FIXME if md_register_thread fails?? */
3250 md_wakeup_thread(mddev->sync_thread);
3251
3252 } 3284 }
3253 3285
3254 /* read-ahead size must cover two whole stripes, which is 3286 /* read-ahead size must cover two whole stripes, which is
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c
index 59ac35ddd51e..57b34cda99f5 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -526,7 +526,9 @@ static int dvb_frontend_thread(void *data)
526 fepriv->delay = 3*HZ; 526 fepriv->delay = 3*HZ;
527 fepriv->status = 0; 527 fepriv->status = 0;
528 fepriv->wakeup = 0; 528 fepriv->wakeup = 0;
529 fepriv->reinitialise = 1; 529 fepriv->reinitialise = 0;
530
531 dvb_frontend_init(fe);
530 532
531 while (1) { 533 while (1) {
532 up(&fepriv->sem); /* is locked when we enter the thread... */ 534 up(&fepriv->sem); /* is locked when we enter the thread... */
@@ -1013,17 +1015,18 @@ static int dvb_frontend_open(struct inode *inode, struct file *file)
1013 return ret; 1015 return ret;
1014 1016
1015 if ((file->f_flags & O_ACCMODE) != O_RDONLY) { 1017 if ((file->f_flags & O_ACCMODE) != O_RDONLY) {
1018
1019 /* normal tune mode when opened R/W */
1020 fepriv->tune_mode_flags &= ~FE_TUNE_MODE_ONESHOT;
1021 fepriv->tone = -1;
1022 fepriv->voltage = -1;
1023
1016 ret = dvb_frontend_start (fe); 1024 ret = dvb_frontend_start (fe);
1017 if (ret) 1025 if (ret)
1018 dvb_generic_release (inode, file); 1026 dvb_generic_release (inode, file);
1019 1027
1020 /* empty event queue */ 1028 /* empty event queue */
1021 fepriv->events.eventr = fepriv->events.eventw = 0; 1029 fepriv->events.eventr = fepriv->events.eventw = 0;
1022
1023 /* normal tune mode when opened R/W */
1024 fepriv->tune_mode_flags &= ~FE_TUNE_MODE_ONESHOT;
1025 fepriv->tone = -1;
1026 fepriv->voltage = -1;
1027 } 1030 }
1028 1031
1029 return ret; 1032 return ret;
diff --git a/drivers/media/dvb/frontends/dvb-pll.c b/drivers/media/dvb/frontends/dvb-pll.c
index a189683454b7..2be33f27c69f 100644
--- a/drivers/media/dvb/frontends/dvb-pll.c
+++ b/drivers/media/dvb/frontends/dvb-pll.c
@@ -194,11 +194,11 @@ struct dvb_pll_desc dvb_pll_tda665x = {
194 { 253834000, 36249333, 166667, 0xca, 0x62 /* 011 0 0 0 10 */ }, 194 { 253834000, 36249333, 166667, 0xca, 0x62 /* 011 0 0 0 10 */ },
195 { 383834000, 36249333, 166667, 0xca, 0xa2 /* 101 0 0 0 10 */ }, 195 { 383834000, 36249333, 166667, 0xca, 0xa2 /* 101 0 0 0 10 */ },
196 { 443834000, 36249333, 166667, 0xca, 0xc2 /* 110 0 0 0 10 */ }, 196 { 443834000, 36249333, 166667, 0xca, 0xc2 /* 110 0 0 0 10 */ },
197 { 444000000, 36249333, 166667, 0xca, 0xc3 /* 110 0 0 0 11 */ }, 197 { 444000000, 36249333, 166667, 0xca, 0xc4 /* 110 0 0 1 00 */ },
198 { 583834000, 36249333, 166667, 0xca, 0x63 /* 011 0 0 0 11 */ }, 198 { 583834000, 36249333, 166667, 0xca, 0x64 /* 011 0 0 1 00 */ },
199 { 793834000, 36249333, 166667, 0xca, 0xa3 /* 101 0 0 0 11 */ }, 199 { 793834000, 36249333, 166667, 0xca, 0xa4 /* 101 0 0 1 00 */ },
200 { 444834000, 36249333, 166667, 0xca, 0xc3 /* 110 0 0 0 11 */ }, 200 { 444834000, 36249333, 166667, 0xca, 0xc4 /* 110 0 0 1 00 */ },
201 { 861000000, 36249333, 166667, 0xca, 0xe3 /* 111 0 0 0 11 */ }, 201 { 861000000, 36249333, 166667, 0xca, 0xe4 /* 111 0 0 1 00 */ },
202 } 202 }
203}; 203};
204EXPORT_SYMBOL(dvb_pll_tda665x); 204EXPORT_SYMBOL(dvb_pll_tda665x);
@@ -613,7 +613,21 @@ static struct dvb_tuner_ops dvb_pll_tuner_ops = {
613 613
614int dvb_pll_attach(struct dvb_frontend *fe, int pll_addr, struct i2c_adapter *i2c, struct dvb_pll_desc *desc) 614int dvb_pll_attach(struct dvb_frontend *fe, int pll_addr, struct i2c_adapter *i2c, struct dvb_pll_desc *desc)
615{ 615{
616 u8 b1 [] = { 0 };
617 struct i2c_msg msg = { .addr = pll_addr, .flags = I2C_M_RD, .buf = b1, .len = 1 };
616 struct dvb_pll_priv *priv = NULL; 618 struct dvb_pll_priv *priv = NULL;
619 int ret;
620
621 if (i2c != NULL) {
622 if (fe->ops.i2c_gate_ctrl)
623 fe->ops.i2c_gate_ctrl(fe, 1);
624
625 ret = i2c_transfer (i2c, &msg, 1);
626 if (ret != 1)
627 return -1;
628 if (fe->ops.i2c_gate_ctrl)
629 fe->ops.i2c_gate_ctrl(fe, 0);
630 }
617 631
618 priv = kzalloc(sizeof(struct dvb_pll_priv), GFP_KERNEL); 632 priv = kzalloc(sizeof(struct dvb_pll_priv), GFP_KERNEL);
619 if (priv == NULL) 633 if (priv == NULL)
diff --git a/drivers/media/dvb/frontends/nxt200x.c b/drivers/media/dvb/frontends/nxt200x.c
index 55671cb5255e..87c286ee6a00 100644
--- a/drivers/media/dvb/frontends/nxt200x.c
+++ b/drivers/media/dvb/frontends/nxt200x.c
@@ -896,9 +896,9 @@ static int nxt2002_init(struct dvb_frontend* fe)
896 } 896 }
897 897
898 ret = nxt2002_load_firmware(fe, fw); 898 ret = nxt2002_load_firmware(fe, fw);
899 release_firmware(fw);
899 if (ret) { 900 if (ret) {
900 printk("nxt2002: Writing firmware to device failed\n"); 901 printk("nxt2002: Writing firmware to device failed\n");
901 release_firmware(fw);
902 return ret; 902 return ret;
903 } 903 }
904 printk("nxt2002: Firmware upload complete\n"); 904 printk("nxt2002: Firmware upload complete\n");
@@ -960,9 +960,9 @@ static int nxt2004_init(struct dvb_frontend* fe)
960 } 960 }
961 961
962 ret = nxt2004_load_firmware(fe, fw); 962 ret = nxt2004_load_firmware(fe, fw);
963 release_firmware(fw);
963 if (ret) { 964 if (ret) {
964 printk("nxt2004: Writing firmware to device failed\n"); 965 printk("nxt2004: Writing firmware to device failed\n");
965 release_firmware(fw);
966 return ret; 966 return ret;
967 } 967 }
968 printk("nxt2004: Firmware upload complete\n"); 968 printk("nxt2004: Firmware upload complete\n");
diff --git a/drivers/media/dvb/frontends/or51211.c b/drivers/media/dvb/frontends/or51211.c
index 26bed616fabe..2bf124b53689 100644
--- a/drivers/media/dvb/frontends/or51211.c
+++ b/drivers/media/dvb/frontends/or51211.c
@@ -437,10 +437,10 @@ static int or51211_init(struct dvb_frontend* fe)
437 } 437 }
438 438
439 ret = or51211_load_firmware(fe, fw); 439 ret = or51211_load_firmware(fe, fw);
440 release_firmware(fw);
440 if (ret) { 441 if (ret) {
441 printk(KERN_WARNING "or51211: Writing firmware to " 442 printk(KERN_WARNING "or51211: Writing firmware to "
442 "device failed!\n"); 443 "device failed!\n");
443 release_firmware(fw);
444 return ret; 444 return ret;
445 } 445 }
446 printk(KERN_INFO "or51211: Firmware upload complete.\n"); 446 printk(KERN_INFO "or51211: Firmware upload complete.\n");
diff --git a/drivers/media/dvb/frontends/sp8870.c b/drivers/media/dvb/frontends/sp8870.c
index 44ec5b9a4695..d98fd5c2e13e 100644
--- a/drivers/media/dvb/frontends/sp8870.c
+++ b/drivers/media/dvb/frontends/sp8870.c
@@ -318,7 +318,6 @@ static int sp8870_init (struct dvb_frontend* fe)
318 printk("sp8870: waiting for firmware upload (%s)...\n", SP8870_DEFAULT_FIRMWARE); 318 printk("sp8870: waiting for firmware upload (%s)...\n", SP8870_DEFAULT_FIRMWARE);
319 if (state->config->request_firmware(fe, &fw, SP8870_DEFAULT_FIRMWARE)) { 319 if (state->config->request_firmware(fe, &fw, SP8870_DEFAULT_FIRMWARE)) {
320 printk("sp8870: no firmware upload (timeout or file not found?)\n"); 320 printk("sp8870: no firmware upload (timeout or file not found?)\n");
321 release_firmware(fw);
322 return -EIO; 321 return -EIO;
323 } 322 }
324 323
@@ -327,6 +326,7 @@ static int sp8870_init (struct dvb_frontend* fe)
327 release_firmware(fw); 326 release_firmware(fw);
328 return -EIO; 327 return -EIO;
329 } 328 }
329 release_firmware(fw);
330 printk("sp8870: firmware upload complete\n"); 330 printk("sp8870: firmware upload complete\n");
331 331
332 /* enable TS output and interface pins */ 332 /* enable TS output and interface pins */
diff --git a/drivers/media/dvb/frontends/sp887x.c b/drivers/media/dvb/frontends/sp887x.c
index b0a2b02f6608..5c2f8f4e0ae5 100644
--- a/drivers/media/dvb/frontends/sp887x.c
+++ b/drivers/media/dvb/frontends/sp887x.c
@@ -520,9 +520,9 @@ static int sp887x_init(struct dvb_frontend* fe)
520 } 520 }
521 521
522 ret = sp887x_initial_setup(fe, fw); 522 ret = sp887x_initial_setup(fe, fw);
523 release_firmware(fw);
523 if (ret) { 524 if (ret) {
524 printk("sp887x: writing firmware to device failed\n"); 525 printk("sp887x: writing firmware to device failed\n");
525 release_firmware(fw);
526 return ret; 526 return ret;
527 } 527 }
528 printk("sp887x: firmware upload complete\n"); 528 printk("sp887x: firmware upload complete\n");
diff --git a/drivers/media/dvb/ttpci/av7110.c b/drivers/media/dvb/ttpci/av7110.c
index 500f15c10aaf..4506165c5de2 100644
--- a/drivers/media/dvb/ttpci/av7110.c
+++ b/drivers/media/dvb/ttpci/av7110.c
@@ -2203,8 +2203,8 @@ static int frontend_init(struct av7110 *av7110)
2203 av7110->fe->ops.tuner_ops.set_params = nexusca_stv0297_tuner_set_params; 2203 av7110->fe->ops.tuner_ops.set_params = nexusca_stv0297_tuner_set_params;
2204 2204
2205 /* set TDA9819 into DVB mode */ 2205 /* set TDA9819 into DVB mode */
2206 saa7146_setgpio(av7110->dev, 1, SAA7146_GPIO_OUTLO); // TDA9198 pin9(STD) 2206 saa7146_setgpio(av7110->dev, 1, SAA7146_GPIO_OUTLO); // TDA9819 pin9(STD)
2207 saa7146_setgpio(av7110->dev, 3, SAA7146_GPIO_OUTLO); // TDA9198 pin30(VIF) 2207 saa7146_setgpio(av7110->dev, 3, SAA7146_GPIO_OUTLO); // TDA9819 pin30(VIF)
2208 2208
2209 /* tuner on this needs a slower i2c bus speed */ 2209 /* tuner on this needs a slower i2c bus speed */
2210 av7110->dev->i2c_bitrate = SAA7146_I2C_BUS_BIT_RATE_240; 2210 av7110->dev->i2c_bitrate = SAA7146_I2C_BUS_BIT_RATE_240;
diff --git a/drivers/media/dvb/ttpci/av7110_v4l.c b/drivers/media/dvb/ttpci/av7110_v4l.c
index 64055461559d..6ffe53fdcf57 100644
--- a/drivers/media/dvb/ttpci/av7110_v4l.c
+++ b/drivers/media/dvb/ttpci/av7110_v4l.c
@@ -272,8 +272,8 @@ static int av7110_dvb_c_switch(struct saa7146_fh *fh)
272 if (ves1820_writereg(dev, 0x09, 0x0f, 0x60)) 272 if (ves1820_writereg(dev, 0x09, 0x0f, 0x60))
273 dprintk(1, "setting band in demodulator failed.\n"); 273 dprintk(1, "setting band in demodulator failed.\n");
274 } else if (av7110->analog_tuner_flags & ANALOG_TUNER_STV0297) { 274 } else if (av7110->analog_tuner_flags & ANALOG_TUNER_STV0297) {
275 saa7146_setgpio(dev, 1, SAA7146_GPIO_OUTHI); // TDA9198 pin9(STD) 275 saa7146_setgpio(dev, 1, SAA7146_GPIO_OUTHI); // TDA9819 pin9(STD)
276 saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTHI); // TDA9198 pin30(VIF) 276 saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTHI); // TDA9819 pin30(VIF)
277 } 277 }
278 if (i2c_writereg(av7110, 0x48, 0x02, 0xd0) != 1) 278 if (i2c_writereg(av7110, 0x48, 0x02, 0xd0) != 1)
279 dprintk(1, "saa7113 write failed @ card %d", av7110->dvb_adapter.num); 279 dprintk(1, "saa7113 write failed @ card %d", av7110->dvb_adapter.num);
@@ -308,8 +308,8 @@ static int av7110_dvb_c_switch(struct saa7146_fh *fh)
308 if (ves1820_writereg(dev, 0x09, 0x0f, 0x20)) 308 if (ves1820_writereg(dev, 0x09, 0x0f, 0x20))
309 dprintk(1, "setting band in demodulator failed.\n"); 309 dprintk(1, "setting band in demodulator failed.\n");
310 } else if (av7110->analog_tuner_flags & ANALOG_TUNER_STV0297) { 310 } else if (av7110->analog_tuner_flags & ANALOG_TUNER_STV0297) {
311 saa7146_setgpio(dev, 1, SAA7146_GPIO_OUTLO); // TDA9198 pin9(STD) 311 saa7146_setgpio(dev, 1, SAA7146_GPIO_OUTLO); // TDA9819 pin9(STD)
312 saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTLO); // TDA9198 pin30(VIF) 312 saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTLO); // TDA9819 pin30(VIF)
313 } 313 }
314 } 314 }
315 315
@@ -750,8 +750,8 @@ int av7110_init_analog_module(struct av7110 *av7110)
750 if (ves1820_writereg(av7110->dev, 0x09, 0x0f, 0x20)) 750 if (ves1820_writereg(av7110->dev, 0x09, 0x0f, 0x20))
751 dprintk(1, "setting band in demodulator failed.\n"); 751 dprintk(1, "setting band in demodulator failed.\n");
752 } else if (av7110->analog_tuner_flags & ANALOG_TUNER_STV0297) { 752 } else if (av7110->analog_tuner_flags & ANALOG_TUNER_STV0297) {
753 saa7146_setgpio(av7110->dev, 1, SAA7146_GPIO_OUTLO); // TDA9198 pin9(STD) 753 saa7146_setgpio(av7110->dev, 1, SAA7146_GPIO_OUTLO); // TDA9819 pin9(STD)
754 saa7146_setgpio(av7110->dev, 3, SAA7146_GPIO_OUTLO); // TDA9198 pin30(VIF) 754 saa7146_setgpio(av7110->dev, 3, SAA7146_GPIO_OUTLO); // TDA9819 pin30(VIF)
755 } 755 }
756 756
757 /* init the saa7113 */ 757 /* init the saa7113 */
diff --git a/drivers/media/dvb/ttpci/budget-av.c b/drivers/media/dvb/ttpci/budget-av.c
index 5f111d407730..2d21fec23b4d 100644
--- a/drivers/media/dvb/ttpci/budget-av.c
+++ b/drivers/media/dvb/ttpci/budget-av.c
@@ -1303,6 +1303,9 @@ static int budget_av_attach(struct saa7146_dev *dev, struct saa7146_pci_extensio
1303 budget_av->budget.dvb_adapter.priv = budget_av; 1303 budget_av->budget.dvb_adapter.priv = budget_av;
1304 frontend_init(budget_av); 1304 frontend_init(budget_av);
1305 ciintf_init(budget_av); 1305 ciintf_init(budget_av);
1306
1307 ttpci_budget_init_hooks(&budget_av->budget);
1308
1306 return 0; 1309 return 0;
1307} 1310}
1308 1311
diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c
index 4b966eea3834..ffbbb3e34be4 100644
--- a/drivers/media/dvb/ttpci/budget-ci.c
+++ b/drivers/media/dvb/ttpci/budget-ci.c
@@ -1101,6 +1101,8 @@ static int budget_ci_attach(struct saa7146_dev *dev, struct saa7146_pci_extensio
1101 budget_ci->budget.dvb_adapter.priv = budget_ci; 1101 budget_ci->budget.dvb_adapter.priv = budget_ci;
1102 frontend_init(budget_ci); 1102 frontend_init(budget_ci);
1103 1103
1104 ttpci_budget_init_hooks(&budget_ci->budget);
1105
1104 return 0; 1106 return 0;
1105} 1107}
1106 1108
diff --git a/drivers/media/dvb/ttpci/budget-core.c b/drivers/media/dvb/ttpci/budget-core.c
index e4cf7775e07f..e15562f81664 100644
--- a/drivers/media/dvb/ttpci/budget-core.c
+++ b/drivers/media/dvb/ttpci/budget-core.c
@@ -63,9 +63,6 @@ static int stop_ts_capture(struct budget *budget)
63{ 63{
64 dprintk(2, "budget: %p\n", budget); 64 dprintk(2, "budget: %p\n", budget);
65 65
66 if (--budget->feeding)
67 return budget->feeding;
68
69 saa7146_write(budget->dev, MC1, MASK_20); // DMA3 off 66 saa7146_write(budget->dev, MC1, MASK_20); // DMA3 off
70 SAA7146_IER_DISABLE(budget->dev, MASK_10); 67 SAA7146_IER_DISABLE(budget->dev, MASK_10);
71 return 0; 68 return 0;
@@ -77,8 +74,8 @@ static int start_ts_capture(struct budget *budget)
77 74
78 dprintk(2, "budget: %p\n", budget); 75 dprintk(2, "budget: %p\n", budget);
79 76
80 if (budget->feeding) 77 if (!budget->feeding || !budget->fe_synced)
81 return ++budget->feeding; 78 return 0;
82 79
83 saa7146_write(dev, MC1, MASK_20); // DMA3 off 80 saa7146_write(dev, MC1, MASK_20); // DMA3 off
84 81
@@ -139,7 +136,33 @@ static int start_ts_capture(struct budget *budget)
139 SAA7146_IER_ENABLE(budget->dev, MASK_10); /* VPE */ 136 SAA7146_IER_ENABLE(budget->dev, MASK_10); /* VPE */
140 saa7146_write(dev, MC1, (MASK_04 | MASK_20)); /* DMA3 on */ 137 saa7146_write(dev, MC1, (MASK_04 | MASK_20)); /* DMA3 on */
141 138
142 return ++budget->feeding; 139 return 0;
140}
141
142static int budget_read_fe_status(struct dvb_frontend *fe, fe_status_t *status)
143{
144 struct budget *budget = (struct budget *) fe->dvb->priv;
145 int synced;
146 int ret;
147
148 if (budget->read_fe_status)
149 ret = budget->read_fe_status(fe, status);
150 else
151 ret = -EINVAL;
152
153 if (!ret) {
154 synced = (*status & FE_HAS_LOCK);
155 if (synced != budget->fe_synced) {
156 budget->fe_synced = synced;
157 spin_lock(&budget->feedlock);
158 if (synced)
159 start_ts_capture(budget);
160 else
161 stop_ts_capture(budget);
162 spin_unlock(&budget->feedlock);
163 }
164 }
165 return ret;
143} 166}
144 167
145static void vpeirq(unsigned long data) 168static void vpeirq(unsigned long data)
@@ -267,7 +290,7 @@ static int budget_start_feed(struct dvb_demux_feed *feed)
267{ 290{
268 struct dvb_demux *demux = feed->demux; 291 struct dvb_demux *demux = feed->demux;
269 struct budget *budget = (struct budget *) demux->priv; 292 struct budget *budget = (struct budget *) demux->priv;
270 int status; 293 int status = 0;
271 294
272 dprintk(2, "budget: %p\n", budget); 295 dprintk(2, "budget: %p\n", budget);
273 296
@@ -276,7 +299,8 @@ static int budget_start_feed(struct dvb_demux_feed *feed)
276 299
277 spin_lock(&budget->feedlock); 300 spin_lock(&budget->feedlock);
278 feed->pusi_seen = 0; /* have a clean section start */ 301 feed->pusi_seen = 0; /* have a clean section start */
279 status = start_ts_capture(budget); 302 if (budget->feeding++ == 0)
303 status = start_ts_capture(budget);
280 spin_unlock(&budget->feedlock); 304 spin_unlock(&budget->feedlock);
281 return status; 305 return status;
282} 306}
@@ -285,12 +309,13 @@ static int budget_stop_feed(struct dvb_demux_feed *feed)
285{ 309{
286 struct dvb_demux *demux = feed->demux; 310 struct dvb_demux *demux = feed->demux;
287 struct budget *budget = (struct budget *) demux->priv; 311 struct budget *budget = (struct budget *) demux->priv;
288 int status; 312 int status = 0;
289 313
290 dprintk(2, "budget: %p\n", budget); 314 dprintk(2, "budget: %p\n", budget);
291 315
292 spin_lock(&budget->feedlock); 316 spin_lock(&budget->feedlock);
293 status = stop_ts_capture(budget); 317 if (--budget->feeding == 0)
318 status = stop_ts_capture(budget);
294 spin_unlock(&budget->feedlock); 319 spin_unlock(&budget->feedlock);
295 return status; 320 return status;
296} 321}
@@ -470,6 +495,14 @@ err:
470 return ret; 495 return ret;
471} 496}
472 497
498void ttpci_budget_init_hooks(struct budget *budget)
499{
500 if (budget->dvb_frontend && !budget->read_fe_status) {
501 budget->read_fe_status = budget->dvb_frontend->ops.read_status;
502 budget->dvb_frontend->ops.read_status = budget_read_fe_status;
503 }
504}
505
473int ttpci_budget_deinit(struct budget *budget) 506int ttpci_budget_deinit(struct budget *budget)
474{ 507{
475 struct saa7146_dev *dev = budget->dev; 508 struct saa7146_dev *dev = budget->dev;
@@ -508,11 +541,8 @@ void ttpci_budget_set_video_port(struct saa7146_dev *dev, int video_port)
508 spin_lock(&budget->feedlock); 541 spin_lock(&budget->feedlock);
509 budget->video_port = video_port; 542 budget->video_port = video_port;
510 if (budget->feeding) { 543 if (budget->feeding) {
511 int oldfeeding = budget->feeding;
512 budget->feeding = 1;
513 stop_ts_capture(budget); 544 stop_ts_capture(budget);
514 start_ts_capture(budget); 545 start_ts_capture(budget);
515 budget->feeding = oldfeeding;
516 } 546 }
517 spin_unlock(&budget->feedlock); 547 spin_unlock(&budget->feedlock);
518} 548}
@@ -520,6 +550,7 @@ void ttpci_budget_set_video_port(struct saa7146_dev *dev, int video_port)
520EXPORT_SYMBOL_GPL(ttpci_budget_debiread); 550EXPORT_SYMBOL_GPL(ttpci_budget_debiread);
521EXPORT_SYMBOL_GPL(ttpci_budget_debiwrite); 551EXPORT_SYMBOL_GPL(ttpci_budget_debiwrite);
522EXPORT_SYMBOL_GPL(ttpci_budget_init); 552EXPORT_SYMBOL_GPL(ttpci_budget_init);
553EXPORT_SYMBOL_GPL(ttpci_budget_init_hooks);
523EXPORT_SYMBOL_GPL(ttpci_budget_deinit); 554EXPORT_SYMBOL_GPL(ttpci_budget_deinit);
524EXPORT_SYMBOL_GPL(ttpci_budget_irq10_handler); 555EXPORT_SYMBOL_GPL(ttpci_budget_irq10_handler);
525EXPORT_SYMBOL_GPL(ttpci_budget_set_video_port); 556EXPORT_SYMBOL_GPL(ttpci_budget_set_video_port);
diff --git a/drivers/media/dvb/ttpci/budget-patch.c b/drivers/media/dvb/ttpci/budget-patch.c
index ee60ce90a400..57227441891e 100644
--- a/drivers/media/dvb/ttpci/budget-patch.c
+++ b/drivers/media/dvb/ttpci/budget-patch.c
@@ -617,6 +617,8 @@ static int budget_patch_attach (struct saa7146_dev* dev, struct saa7146_pci_exte
617 budget->dvb_adapter.priv = budget; 617 budget->dvb_adapter.priv = budget;
618 frontend_init(budget); 618 frontend_init(budget);
619 619
620 ttpci_budget_init_hooks(budget);
621
620 return 0; 622 return 0;
621} 623}
622 624
diff --git a/drivers/media/dvb/ttpci/budget.c b/drivers/media/dvb/ttpci/budget.c
index 35761f13c12b..863dffb4ed8e 100644
--- a/drivers/media/dvb/ttpci/budget.c
+++ b/drivers/media/dvb/ttpci/budget.c
@@ -375,9 +375,6 @@ static void frontend_init(struct budget *budget)
375 if (budget->dvb_frontend) { 375 if (budget->dvb_frontend) {
376 budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params; 376 budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params;
377 budget->dvb_frontend->tuner_priv = &budget->i2c_adap; 377 budget->dvb_frontend->tuner_priv = &budget->i2c_adap;
378 budget->dvb_frontend->ops.diseqc_send_master_cmd = budget_diseqc_send_master_cmd;
379 budget->dvb_frontend->ops.diseqc_send_burst = budget_diseqc_send_burst;
380 budget->dvb_frontend->ops.set_tone = budget_set_tone;
381 break; 378 break;
382 } 379 }
383 break; 380 break;
@@ -474,6 +471,8 @@ static int budget_attach (struct saa7146_dev* dev, struct saa7146_pci_extension_
474 budget->dvb_adapter.priv = budget; 471 budget->dvb_adapter.priv = budget;
475 frontend_init(budget); 472 frontend_init(budget);
476 473
474 ttpci_budget_init_hooks(budget);
475
477 return 0; 476 return 0;
478} 477}
479 478
diff --git a/drivers/media/dvb/ttpci/budget.h b/drivers/media/dvb/ttpci/budget.h
index ecea3a13030e..e8a5c79178e1 100644
--- a/drivers/media/dvb/ttpci/budget.h
+++ b/drivers/media/dvb/ttpci/budget.h
@@ -52,9 +52,6 @@ struct budget {
52 struct dmx_frontend hw_frontend; 52 struct dmx_frontend hw_frontend;
53 struct dmx_frontend mem_frontend; 53 struct dmx_frontend mem_frontend;
54 54
55 int fe_synced;
56 struct mutex pid_mutex;
57
58 int ci_present; 55 int ci_present;
59 int video_port; 56 int video_port;
60 57
@@ -74,6 +71,9 @@ struct budget {
74 71
75 struct dvb_adapter dvb_adapter; 72 struct dvb_adapter dvb_adapter;
76 struct dvb_frontend *dvb_frontend; 73 struct dvb_frontend *dvb_frontend;
74 int (*read_fe_status)(struct dvb_frontend *fe, fe_status_t *status);
75 int fe_synced;
76
77 void *priv; 77 void *priv;
78}; 78};
79 79
@@ -106,6 +106,7 @@ static struct saa7146_pci_extension_data x_var = { \
106extern int ttpci_budget_init(struct budget *budget, struct saa7146_dev *dev, 106extern int ttpci_budget_init(struct budget *budget, struct saa7146_dev *dev,
107 struct saa7146_pci_extension_data *info, 107 struct saa7146_pci_extension_data *info,
108 struct module *owner); 108 struct module *owner);
109extern void ttpci_budget_init_hooks(struct budget *budget);
109extern int ttpci_budget_deinit(struct budget *budget); 110extern int ttpci_budget_deinit(struct budget *budget);
110extern void ttpci_budget_irq10_handler(struct saa7146_dev *dev, u32 * isr); 111extern void ttpci_budget_irq10_handler(struct saa7146_dev *dev, u32 * isr);
111extern void ttpci_budget_set_video_port(struct saa7146_dev *dev, int video_port); 112extern void ttpci_budget_set_video_port(struct saa7146_dev *dev, int video_port);
diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
index 6d532f170ce5..fe56862d51e4 100644
--- a/drivers/media/video/Kconfig
+++ b/drivers/media/video/Kconfig
@@ -145,7 +145,7 @@ config VIDEO_SAA5246A
145 145
146config VIDEO_SAA5249 146config VIDEO_SAA5249
147 tristate "SAA5249 Teletext processor" 147 tristate "SAA5249 Teletext processor"
148 depends on VIDEO_DEV && I2C 148 depends on VIDEO_DEV && I2C && VIDEO_V4L1
149 help 149 help
150 Support for I2C bus based teletext using the SAA5249 chip. At the 150 Support for I2C bus based teletext using the SAA5249 chip. At the
151 moment this is only useful on some European WinTV cards. 151 moment this is only useful on some European WinTV cards.
@@ -155,7 +155,7 @@ config VIDEO_SAA5249
155 155
156config TUNER_3036 156config TUNER_3036
157 tristate "SAB3036 tuner" 157 tristate "SAB3036 tuner"
158 depends on VIDEO_DEV && I2C 158 depends on VIDEO_DEV && I2C && VIDEO_V4L1
159 help 159 help
160 Say Y here to include support for Philips SAB3036 compatible tuners. 160 Say Y here to include support for Philips SAB3036 compatible tuners.
161 If in doubt, say N. 161 If in doubt, say N.
diff --git a/drivers/media/video/bt8xx/Kconfig b/drivers/media/video/bt8xx/Kconfig
index 153f6a4a96c9..cdcf55650714 100644
--- a/drivers/media/video/bt8xx/Kconfig
+++ b/drivers/media/video/bt8xx/Kconfig
@@ -1,6 +1,6 @@
1config VIDEO_BT848 1config VIDEO_BT848
2 tristate "BT848 Video For Linux" 2 tristate "BT848 Video For Linux"
3 depends on VIDEO_DEV && PCI && I2C && VIDEO_V4L2 3 depends on VIDEO_DEV && PCI && I2C && VIDEO_V4L1
4 select I2C_ALGOBIT 4 select I2C_ALGOBIT
5 select FW_LOADER 5 select FW_LOADER
6 select VIDEO_BTCX 6 select VIDEO_BTCX
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
index 5764a89d3562..20dff7c316eb 100644
--- a/drivers/media/video/bt8xx/bttv-driver.c
+++ b/drivers/media/video/bt8xx/bttv-driver.c
@@ -3923,7 +3923,12 @@ static int __devinit bttv_register_video(struct bttv *btv)
3923 goto err; 3923 goto err;
3924 printk(KERN_INFO "bttv%d: registered device video%d\n", 3924 printk(KERN_INFO "bttv%d: registered device video%d\n",
3925 btv->c.nr,btv->video_dev->minor & 0x1f); 3925 btv->c.nr,btv->video_dev->minor & 0x1f);
3926 video_device_create_file(btv->video_dev, &class_device_attr_card); 3926 if (class_device_create_file(&btv->video_dev->class_dev,
3927 &class_device_attr_card)<0) {
3928 printk(KERN_ERR "bttv%d: class_device_create_file 'card' "
3929 "failed\n", btv->c.nr);
3930 goto err;
3931 }
3927 3932
3928 /* vbi */ 3933 /* vbi */
3929 btv->vbi_dev = vdev_init(btv, &bttv_vbi_template, "vbi"); 3934 btv->vbi_dev = vdev_init(btv, &bttv_vbi_template, "vbi");
@@ -4287,6 +4292,8 @@ static struct pci_driver bttv_pci_driver = {
4287 4292
4288static int bttv_init_module(void) 4293static int bttv_init_module(void)
4289{ 4294{
4295 int ret;
4296
4290 bttv_num = 0; 4297 bttv_num = 0;
4291 4298
4292 printk(KERN_INFO "bttv: driver version %d.%d.%d loaded\n", 4299 printk(KERN_INFO "bttv: driver version %d.%d.%d loaded\n",
@@ -4308,7 +4315,11 @@ static int bttv_init_module(void)
4308 4315
4309 bttv_check_chipset(); 4316 bttv_check_chipset();
4310 4317
4311 bus_register(&bttv_sub_bus_type); 4318 ret = bus_register(&bttv_sub_bus_type);
4319 if (ret < 0) {
4320 printk(KERN_WARNING "bttv: bus_register error: %d\n", ret);
4321 return ret;
4322 }
4312 return pci_register_driver(&bttv_pci_driver); 4323 return pci_register_driver(&bttv_pci_driver);
4313} 4324}
4314 4325
diff --git a/drivers/media/video/bt8xx/bttv-vbi.c b/drivers/media/video/bt8xx/bttv-vbi.c
index 8c9f0f7cf467..63676e7bd635 100644
--- a/drivers/media/video/bt8xx/bttv-vbi.c
+++ b/drivers/media/video/bt8xx/bttv-vbi.c
@@ -31,11 +31,16 @@
31#include <asm/io.h> 31#include <asm/io.h>
32#include "bttvp.h" 32#include "bttvp.h"
33 33
34/* Offset from line sync pulse leading edge (0H) in 1 / sampling_rate: 34/* Offset from line sync pulse leading edge (0H) to start of VBI capture,
35 bt8x8 /HRESET pulse starts at 0H and has length 64 / fCLKx1 (E|O_VTC 35 in fCLKx2 pixels. According to the datasheet, VBI capture starts
36 HSFMT = 0). VBI_HDELAY (always 0) is an offset from the trailing edge 36 VBI_HDELAY fCLKx1 pixels from the tailing edgeof /HRESET, and /HRESET
37 of /HRESET in 1 / fCLKx1, and the sampling_rate tvnorm->Fsc is fCLKx2. */ 37 is 64 fCLKx1 pixels wide. VBI_HDELAY is set to 0, so this should be
38#define VBI_OFFSET ((64 + 0) * 2) 38 (64 + 0) * 2 = 128 fCLKx2 pixels. But it's not! The datasheet is
39 Just Plain Wrong. The real value appears to be different for
40 different revisions of the bt8x8 chips, and to be affected by the
41 horizontal scaling factor. Experimentally, the value is measured
42 to be about 244. */
43#define VBI_OFFSET 244
39 44
40#define VBI_DEFLINES 16 45#define VBI_DEFLINES 16
41#define VBI_MAXLINES 32 46#define VBI_MAXLINES 32
diff --git a/drivers/media/video/compat_ioctl32.c b/drivers/media/video/compat_ioctl32.c
index 353d02b67c33..9dddff42ec13 100644
--- a/drivers/media/video/compat_ioctl32.c
+++ b/drivers/media/video/compat_ioctl32.c
@@ -490,6 +490,23 @@ static inline int put_v4l2_input(struct v4l2_input *kp, struct v4l2_input __user
490 return 0; 490 return 0;
491} 491}
492 492
493struct video_code32
494{
495 char loadwhat[16]; /* name or tag of file being passed */
496 compat_int_t datasize;
497 unsigned char *data;
498};
499
500static inline int microcode32(struct video_code *kp, struct video_code32 __user *up)
501{
502 if(!access_ok(VERIFY_READ, up, sizeof(struct video_code32)) ||
503 copy_from_user(kp->loadwhat, up->loadwhat, sizeof (up->loadwhat)) ||
504 get_user(kp->datasize, &up->datasize) ||
505 copy_from_user(kp->data, up->data, up->datasize))
506 return -EFAULT;
507 return 0;
508}
509
493#define VIDIOCGTUNER32 _IOWR('v',4, struct video_tuner32) 510#define VIDIOCGTUNER32 _IOWR('v',4, struct video_tuner32)
494#define VIDIOCSTUNER32 _IOW('v',5, struct video_tuner32) 511#define VIDIOCSTUNER32 _IOW('v',5, struct video_tuner32)
495#define VIDIOCGWIN32 _IOR('v',9, struct video_window32) 512#define VIDIOCGWIN32 _IOR('v',9, struct video_window32)
@@ -498,6 +515,7 @@ static inline int put_v4l2_input(struct v4l2_input *kp, struct v4l2_input __user
498#define VIDIOCSFBUF32 _IOW('v',12, struct video_buffer32) 515#define VIDIOCSFBUF32 _IOW('v',12, struct video_buffer32)
499#define VIDIOCGFREQ32 _IOR('v',14, u32) 516#define VIDIOCGFREQ32 _IOR('v',14, u32)
500#define VIDIOCSFREQ32 _IOW('v',15, u32) 517#define VIDIOCSFREQ32 _IOW('v',15, u32)
518#define VIDIOCSMICROCODE32 _IOW('v',27, struct video_code32)
501 519
502/* VIDIOC_ENUMINPUT32 is VIDIOC_ENUMINPUT minus 4 bytes of padding alignement */ 520/* VIDIOC_ENUMINPUT32 is VIDIOC_ENUMINPUT minus 4 bytes of padding alignement */
503#define VIDIOC_ENUMINPUT32 VIDIOC_ENUMINPUT - _IOC(0, 0, 0, 4) 521#define VIDIOC_ENUMINPUT32 VIDIOC_ENUMINPUT - _IOC(0, 0, 0, 4)
@@ -590,6 +608,7 @@ static int do_video_ioctl(struct file *file, unsigned int cmd, unsigned long arg
590 struct video_tuner vt; 608 struct video_tuner vt;
591 struct video_buffer vb; 609 struct video_buffer vb;
592 struct video_window vw; 610 struct video_window vw;
611 struct video_code vc;
593 struct v4l2_format v2f; 612 struct v4l2_format v2f;
594 struct v4l2_buffer v2b; 613 struct v4l2_buffer v2b;
595 struct v4l2_framebuffer v2fb; 614 struct v4l2_framebuffer v2fb;
@@ -628,6 +647,7 @@ static int do_video_ioctl(struct file *file, unsigned int cmd, unsigned long arg
628 case VIDIOC_G_INPUT32: cmd = VIDIOC_G_INPUT; break; 647 case VIDIOC_G_INPUT32: cmd = VIDIOC_G_INPUT; break;
629 case VIDIOC_S_INPUT32: cmd = VIDIOC_S_INPUT; break; 648 case VIDIOC_S_INPUT32: cmd = VIDIOC_S_INPUT; break;
630 case VIDIOC_TRY_FMT32: cmd = VIDIOC_TRY_FMT; break; 649 case VIDIOC_TRY_FMT32: cmd = VIDIOC_TRY_FMT; break;
650 case VIDIOCSMICROCODE32: cmd = VIDIOCSMICROCODE; break;
631 }; 651 };
632 652
633 switch(cmd) { 653 switch(cmd) {
@@ -703,6 +723,10 @@ static int do_video_ioctl(struct file *file, unsigned int cmd, unsigned long arg
703 case VIDIOC_G_FBUF: 723 case VIDIOC_G_FBUF:
704 case VIDIOC_G_INPUT: 724 case VIDIOC_G_INPUT:
705 compatible_arg = 0; 725 compatible_arg = 0;
726 case VIDIOCSMICROCODE:
727 err = microcode32(&karg.vc, up);
728 compatible_arg = 0;
729 break;
706 }; 730 };
707 731
708 if(err) 732 if(err)
diff --git a/drivers/media/video/cpia2/Kconfig b/drivers/media/video/cpia2/Kconfig
index 513cc0927389..e39a96152004 100644
--- a/drivers/media/video/cpia2/Kconfig
+++ b/drivers/media/video/cpia2/Kconfig
@@ -1,6 +1,6 @@
1config VIDEO_CPIA2 1config VIDEO_CPIA2
2 tristate "CPiA2 Video For Linux" 2 tristate "CPiA2 Video For Linux"
3 depends on VIDEO_DEV && USB 3 depends on VIDEO_DEV && USB && VIDEO_V4L1
4 ---help--- 4 ---help---
5 This is the video4linux driver for cameras based on Vision's CPiA2 5 This is the video4linux driver for cameras based on Vision's CPiA2
6 (Colour Processor Interface ASIC), such as the Digital Blue QX5 6 (Colour Processor Interface ASIC), such as the Digital Blue QX5
diff --git a/drivers/media/video/cx88/cx88-blackbird.c b/drivers/media/video/cx88/cx88-blackbird.c
index 349632b48e93..b60177f173c3 100644
--- a/drivers/media/video/cx88/cx88-blackbird.c
+++ b/drivers/media/video/cx88/cx88-blackbird.c
@@ -453,11 +453,13 @@ static int blackbird_load_firmware(struct cx8802_dev *dev)
453 if (firmware->size != BLACKBIRD_FIRM_IMAGE_SIZE) { 453 if (firmware->size != BLACKBIRD_FIRM_IMAGE_SIZE) {
454 dprintk(0, "ERROR: Firmware size mismatch (have %zd, expected %d)\n", 454 dprintk(0, "ERROR: Firmware size mismatch (have %zd, expected %d)\n",
455 firmware->size, BLACKBIRD_FIRM_IMAGE_SIZE); 455 firmware->size, BLACKBIRD_FIRM_IMAGE_SIZE);
456 release_firmware(firmware);
456 return -1; 457 return -1;
457 } 458 }
458 459
459 if (0 != memcmp(firmware->data, magic, 8)) { 460 if (0 != memcmp(firmware->data, magic, 8)) {
460 dprintk(0, "ERROR: Firmware magic mismatch, wrong file?\n"); 461 dprintk(0, "ERROR: Firmware magic mismatch, wrong file?\n");
462 release_firmware(firmware);
461 return -1; 463 return -1;
462 } 464 }
463 465
@@ -478,6 +480,7 @@ static int blackbird_load_firmware(struct cx8802_dev *dev)
478 } 480 }
479 if (checksum) { 481 if (checksum) {
480 dprintk(0, "ERROR: Firmware load failed (checksum mismatch).\n"); 482 dprintk(0, "ERROR: Firmware load failed (checksum mismatch).\n");
483 release_firmware(firmware);
481 return -1; 484 return -1;
482 } 485 }
483 release_firmware(firmware); 486 release_firmware(firmware);
diff --git a/drivers/media/video/cx88/cx88-input.c b/drivers/media/video/cx88/cx88-input.c
index 72b630a91f41..c25564648993 100644
--- a/drivers/media/video/cx88/cx88-input.c
+++ b/drivers/media/video/cx88/cx88-input.c
@@ -89,7 +89,7 @@ static void cx88_ir_handle_key(struct cx88_IR *ir)
89 89
90 auxgpio = cx_read(MO_GP1_IO); 90 auxgpio = cx_read(MO_GP1_IO);
91 /* Take out the parity part */ 91 /* Take out the parity part */
92 gpio+=(gpio & 0x7fd) + (auxgpio & 0xef); 92 gpio=(gpio & 0x7fd) + (auxgpio & 0xef);
93 } else 93 } else
94 auxgpio = gpio; 94 auxgpio = gpio;
95 95
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
index 2225d4b94140..547cdbdb644d 100644
--- a/drivers/media/video/cx88/cx88-video.c
+++ b/drivers/media/video/cx88/cx88-video.c
@@ -1180,7 +1180,6 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
1180 V4L2_CAP_READWRITE | 1180 V4L2_CAP_READWRITE |
1181 V4L2_CAP_STREAMING | 1181 V4L2_CAP_STREAMING |
1182 V4L2_CAP_VBI_CAPTURE | 1182 V4L2_CAP_VBI_CAPTURE |
1183 V4L2_CAP_VIDEO_OVERLAY |
1184 0; 1183 0;
1185 if (UNSET != core->tuner_type) 1184 if (UNSET != core->tuner_type)
1186 cap->capabilities |= V4L2_CAP_TUNER; 1185 cap->capabilities |= V4L2_CAP_TUNER;
@@ -1226,7 +1225,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
1226 struct v4l2_format *f = arg; 1225 struct v4l2_format *f = arg;
1227 return cx8800_try_fmt(dev,fh,f); 1226 return cx8800_try_fmt(dev,fh,f);
1228 } 1227 }
1229#ifdef HAVE_V4L1 1228#ifdef CONFIG_V4L1_COMPAT
1230 /* --- streaming capture ------------------------------------- */ 1229 /* --- streaming capture ------------------------------------- */
1231 case VIDIOCGMBUF: 1230 case VIDIOCGMBUF:
1232 { 1231 {
@@ -1585,7 +1584,7 @@ static int radio_do_ioctl(struct inode *inode, struct file *file,
1585 *id = 0; 1584 *id = 0;
1586 return 0; 1585 return 0;
1587 } 1586 }
1588#ifdef HAVE_V4L1 1587#ifdef CONFIG_V4L1_COMPAT
1589 case VIDIOCSTUNER: 1588 case VIDIOCSTUNER:
1590 { 1589 {
1591 struct video_tuner *v = arg; 1590 struct video_tuner *v = arg;
diff --git a/drivers/media/video/msp3400-driver.c b/drivers/media/video/msp3400-driver.c
index dbb75a7db199..56246b8578f3 100644
--- a/drivers/media/video/msp3400-driver.c
+++ b/drivers/media/video/msp3400-driver.c
@@ -362,7 +362,7 @@ int msp_sleep(struct msp_state *state, int timeout)
362} 362}
363 363
364/* ------------------------------------------------------------------------ */ 364/* ------------------------------------------------------------------------ */
365 365#ifdef CONFIG_VIDEO_V4L1
366static int msp_mode_v4l2_to_v4l1(int rxsubchans, int audmode) 366static int msp_mode_v4l2_to_v4l1(int rxsubchans, int audmode)
367{ 367{
368 if (rxsubchans == V4L2_TUNER_SUB_MONO) 368 if (rxsubchans == V4L2_TUNER_SUB_MONO)
@@ -384,6 +384,7 @@ static int msp_mode_v4l1_to_v4l2(int mode)
384 return V4L2_TUNER_MODE_LANG1; 384 return V4L2_TUNER_MODE_LANG1;
385 return V4L2_TUNER_MODE_MONO; 385 return V4L2_TUNER_MODE_MONO;
386} 386}
387#endif
387 388
388static int msp_get_ctrl(struct i2c_client *client, struct v4l2_control *ctrl) 389static int msp_get_ctrl(struct i2c_client *client, struct v4l2_control *ctrl)
389{ 390{
@@ -509,6 +510,7 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
509 /* --- v4l ioctls --- */ 510 /* --- v4l ioctls --- */
510 /* take care: bttv does userspace copying, we'll get a 511 /* take care: bttv does userspace copying, we'll get a
511 kernel pointer here... */ 512 kernel pointer here... */
513#ifdef CONFIG_VIDEO_V4L1
512 case VIDIOCGAUDIO: 514 case VIDIOCGAUDIO:
513 { 515 {
514 struct video_audio *va = arg; 516 struct video_audio *va = arg;
@@ -577,6 +579,12 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
577 } 579 }
578 580
579 case VIDIOCSFREQ: 581 case VIDIOCSFREQ:
582 {
583 /* new channel -- kick audio carrier scan */
584 msp_wake_thread(client);
585 break;
586 }
587#endif
580 case VIDIOC_S_FREQUENCY: 588 case VIDIOC_S_FREQUENCY:
581 { 589 {
582 /* new channel -- kick audio carrier scan */ 590 /* new channel -- kick audio carrier scan */
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index 9b48abcf6089..be1e5cc78081 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -852,7 +852,6 @@ unsigned long pvr2_hdw_get_sn(struct pvr2_hdw *hdw)
852 return hdw->serial_number; 852 return hdw->serial_number;
853} 853}
854 854
855
856int pvr2_hdw_get_unit_number(struct pvr2_hdw *hdw) 855int pvr2_hdw_get_unit_number(struct pvr2_hdw *hdw)
857{ 856{
858 return hdw->unit_number; 857 return hdw->unit_number;
@@ -2318,7 +2317,6 @@ void pvr2_hdw_poll_trigger_unlocked(struct pvr2_hdw *hdw)
2318 } 2317 }
2319} 2318}
2320 2319
2321
2322/* Return name for this driver instance */ 2320/* Return name for this driver instance */
2323const char *pvr2_hdw_get_driver_name(struct pvr2_hdw *hdw) 2321const char *pvr2_hdw_get_driver_name(struct pvr2_hdw *hdw)
2324{ 2322{
@@ -2542,6 +2540,10 @@ static void pvr2_ctl_timeout(unsigned long data)
2542} 2540}
2543 2541
2544 2542
2543/* Issue a command and get a response from the device. This extended
2544 version includes a probe flag (which if set means that device errors
2545 should not be logged or treated as fatal) and a timeout in jiffies.
2546 This can be used to non-lethally probe the health of endpoint 1. */
2545static int pvr2_send_request_ex(struct pvr2_hdw *hdw, 2547static int pvr2_send_request_ex(struct pvr2_hdw *hdw,
2546 unsigned int timeout,int probe_fl, 2548 unsigned int timeout,int probe_fl,
2547 void *write_data,unsigned int write_len, 2549 void *write_data,unsigned int write_len,
@@ -2970,6 +2972,7 @@ int pvr2_hdw_cmd_decoder_reset(struct pvr2_hdw *hdw)
2970} 2972}
2971 2973
2972 2974
2975/* Stop / start video stream transport */
2973static int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl) 2976static int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl)
2974{ 2977{
2975 int status; 2978 int status;
@@ -3068,6 +3071,7 @@ int pvr2_hdw_gpio_chg_out(struct pvr2_hdw *hdw,u32 msk,u32 val)
3068} 3071}
3069 3072
3070 3073
3074/* Find I2C address of eeprom */
3071static int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *hdw) 3075static int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *hdw)
3072{ 3076{
3073 int result; 3077 int result;
diff --git a/drivers/media/video/pvrusb2/pvrusb2-io.c b/drivers/media/video/pvrusb2/pvrusb2-io.c
index 681f79c8064e..1e393762546c 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-io.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-io.c
@@ -26,6 +26,8 @@
26#include <linux/slab.h> 26#include <linux/slab.h>
27#include <linux/mutex.h> 27#include <linux/mutex.h>
28 28
29static const char *pvr2_buffer_state_decode(enum pvr2_buffer_state);
30
29#define BUFFER_SIG 0x47653271 31#define BUFFER_SIG 0x47653271
30 32
31// #define SANITY_CHECK_BUFFERS 33// #define SANITY_CHECK_BUFFERS
@@ -515,6 +517,10 @@ void pvr2_stream_set_callback(struct pvr2_stream *sp,
515} 517}
516 518
517/* Query / set the nominal buffer count */ 519/* Query / set the nominal buffer count */
520int pvr2_stream_get_buffer_count(struct pvr2_stream *sp)
521{
522 return sp->buffer_target_count;
523}
518 524
519int pvr2_stream_set_buffer_count(struct pvr2_stream *sp,unsigned int cnt) 525int pvr2_stream_set_buffer_count(struct pvr2_stream *sp,unsigned int cnt)
520{ 526{
@@ -553,7 +559,6 @@ int pvr2_stream_get_ready_count(struct pvr2_stream *sp)
553 return sp->r_count; 559 return sp->r_count;
554} 560}
555 561
556
557void pvr2_stream_kill(struct pvr2_stream *sp) 562void pvr2_stream_kill(struct pvr2_stream *sp)
558{ 563{
559 struct pvr2_buffer *bp; 564 struct pvr2_buffer *bp;
@@ -607,7 +612,6 @@ int pvr2_buffer_queue(struct pvr2_buffer *bp)
607 return ret; 612 return ret;
608} 613}
609 614
610
611int pvr2_buffer_set_buffer(struct pvr2_buffer *bp,void *ptr,unsigned int cnt) 615int pvr2_buffer_set_buffer(struct pvr2_buffer *bp,void *ptr,unsigned int cnt)
612{ 616{
613 int ret = 0; 617 int ret = 0;
@@ -646,7 +650,6 @@ int pvr2_buffer_get_status(struct pvr2_buffer *bp)
646 return bp->status; 650 return bp->status;
647} 651}
648 652
649
650int pvr2_buffer_get_id(struct pvr2_buffer *bp) 653int pvr2_buffer_get_id(struct pvr2_buffer *bp)
651{ 654{
652 return bp->id; 655 return bp->id;
diff --git a/drivers/media/video/pvrusb2/pvrusb2-io.h b/drivers/media/video/pvrusb2/pvrusb2-io.h
index 96285ad234a6..93279cc2a35e 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-io.h
+++ b/drivers/media/video/pvrusb2/pvrusb2-io.h
@@ -47,6 +47,7 @@ void pvr2_stream_set_callback(struct pvr2_stream *,
47 void *data); 47 void *data);
48 48
49/* Query / set the nominal buffer count */ 49/* Query / set the nominal buffer count */
50int pvr2_stream_get_buffer_count(struct pvr2_stream *);
50int pvr2_stream_set_buffer_count(struct pvr2_stream *,unsigned int); 51int pvr2_stream_set_buffer_count(struct pvr2_stream *,unsigned int);
51 52
52/* Get a pointer to a buffer that is either idle, ready, or is specified 53/* Get a pointer to a buffer that is either idle, ready, or is specified
@@ -58,6 +59,7 @@ struct pvr2_buffer *pvr2_stream_get_buffer(struct pvr2_stream *sp,int id);
58/* Find out how many buffers are idle or ready */ 59/* Find out how many buffers are idle or ready */
59int pvr2_stream_get_ready_count(struct pvr2_stream *); 60int pvr2_stream_get_ready_count(struct pvr2_stream *);
60 61
62
61/* Kill all pending buffers and throw away any ready buffers as well */ 63/* Kill all pending buffers and throw away any ready buffers as well */
62void pvr2_stream_kill(struct pvr2_stream *); 64void pvr2_stream_kill(struct pvr2_stream *);
63 65
diff --git a/drivers/media/video/pvrusb2/pvrusb2-ioread.c b/drivers/media/video/pvrusb2/pvrusb2-ioread.c
index f7a2e225a002..b71f9a961f8a 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-ioread.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-ioread.c
@@ -213,7 +213,9 @@ int pvr2_ioread_setup(struct pvr2_ioread *cp,struct pvr2_stream *sp)
213 " pvr2_ioread_setup (tear-down) id=%p",cp); 213 " pvr2_ioread_setup (tear-down) id=%p",cp);
214 pvr2_ioread_stop(cp); 214 pvr2_ioread_stop(cp);
215 pvr2_stream_kill(cp->stream); 215 pvr2_stream_kill(cp->stream);
216 pvr2_stream_set_buffer_count(cp->stream,0); 216 if (pvr2_stream_get_buffer_count(cp->stream)) {
217 pvr2_stream_set_buffer_count(cp->stream,0);
218 }
217 cp->stream = NULL; 219 cp->stream = NULL;
218 } 220 }
219 if (sp) { 221 if (sp) {
@@ -251,7 +253,6 @@ int pvr2_ioread_set_enabled(struct pvr2_ioread *cp,int fl)
251 return ret; 253 return ret;
252} 254}
253 255
254
255static int pvr2_ioread_get_buffer(struct pvr2_ioread *cp) 256static int pvr2_ioread_get_buffer(struct pvr2_ioread *cp)
256{ 257{
257 int stat; 258 int stat;
diff --git a/drivers/media/video/pvrusb2/pvrusb2-sysfs.c b/drivers/media/video/pvrusb2/pvrusb2-sysfs.c
index 6af55a8b6f05..d1dda5caf406 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-sysfs.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-sysfs.c
@@ -44,12 +44,16 @@ struct pvr2_sysfs {
44 struct kobj_type ktype; 44 struct kobj_type ktype;
45 struct class_device_attribute attr_v4l_minor_number; 45 struct class_device_attribute attr_v4l_minor_number;
46 struct class_device_attribute attr_unit_number; 46 struct class_device_attribute attr_unit_number;
47 int v4l_minor_number_created_ok;
48 int unit_number_created_ok;
47}; 49};
48 50
49#ifdef CONFIG_VIDEO_PVRUSB2_DEBUGIFC 51#ifdef CONFIG_VIDEO_PVRUSB2_DEBUGIFC
50struct pvr2_sysfs_debugifc { 52struct pvr2_sysfs_debugifc {
51 struct class_device_attribute attr_debugcmd; 53 struct class_device_attribute attr_debugcmd;
52 struct class_device_attribute attr_debuginfo; 54 struct class_device_attribute attr_debuginfo;
55 int debugcmd_created_ok;
56 int debuginfo_created_ok;
53}; 57};
54#endif /* CONFIG_VIDEO_PVRUSB2_DEBUGIFC */ 58#endif /* CONFIG_VIDEO_PVRUSB2_DEBUGIFC */
55 59
@@ -67,6 +71,7 @@ struct pvr2_sysfs_ctl_item {
67 struct pvr2_sysfs_ctl_item *item_next; 71 struct pvr2_sysfs_ctl_item *item_next;
68 struct attribute *attr_gen[7]; 72 struct attribute *attr_gen[7];
69 struct attribute_group grp; 73 struct attribute_group grp;
74 int created_ok;
70 char name[80]; 75 char name[80];
71}; 76};
72 77
@@ -487,6 +492,7 @@ static void pvr2_sysfs_add_control(struct pvr2_sysfs *sfp,int ctl_id)
487 struct pvr2_sysfs_func_set *fp; 492 struct pvr2_sysfs_func_set *fp;
488 struct pvr2_ctrl *cptr; 493 struct pvr2_ctrl *cptr;
489 unsigned int cnt,acnt; 494 unsigned int cnt,acnt;
495 int ret;
490 496
491 if ((ctl_id < 0) || (ctl_id >= (sizeof(funcs)/sizeof(funcs[0])))) { 497 if ((ctl_id < 0) || (ctl_id >= (sizeof(funcs)/sizeof(funcs[0])))) {
492 return; 498 return;
@@ -589,7 +595,13 @@ static void pvr2_sysfs_add_control(struct pvr2_sysfs *sfp,int ctl_id)
589 cip->grp.name = cip->name; 595 cip->grp.name = cip->name;
590 cip->grp.attrs = cip->attr_gen; 596 cip->grp.attrs = cip->attr_gen;
591 597
592 sysfs_create_group(&sfp->class_dev->kobj,&cip->grp); 598 ret = sysfs_create_group(&sfp->class_dev->kobj,&cip->grp);
599 if (ret) {
600 printk(KERN_WARNING "%s: sysfs_create_group error: %d\n",
601 __FUNCTION__, ret);
602 return;
603 }
604 cip->created_ok = !0;
593} 605}
594 606
595#ifdef CONFIG_VIDEO_PVRUSB2_DEBUGIFC 607#ifdef CONFIG_VIDEO_PVRUSB2_DEBUGIFC
@@ -600,6 +612,8 @@ static ssize_t debugcmd_store(struct class_device *,const char *,size_t count);
600static void pvr2_sysfs_add_debugifc(struct pvr2_sysfs *sfp) 612static void pvr2_sysfs_add_debugifc(struct pvr2_sysfs *sfp)
601{ 613{
602 struct pvr2_sysfs_debugifc *dip; 614 struct pvr2_sysfs_debugifc *dip;
615 int ret;
616
603 dip = kmalloc(sizeof(*dip),GFP_KERNEL); 617 dip = kmalloc(sizeof(*dip),GFP_KERNEL);
604 if (!dip) return; 618 if (!dip) return;
605 memset(dip,0,sizeof(*dip)); 619 memset(dip,0,sizeof(*dip));
@@ -613,17 +627,34 @@ static void pvr2_sysfs_add_debugifc(struct pvr2_sysfs *sfp)
613 dip->attr_debuginfo.attr.mode = S_IRUGO; 627 dip->attr_debuginfo.attr.mode = S_IRUGO;
614 dip->attr_debuginfo.show = debuginfo_show; 628 dip->attr_debuginfo.show = debuginfo_show;
615 sfp->debugifc = dip; 629 sfp->debugifc = dip;
616 class_device_create_file(sfp->class_dev,&dip->attr_debugcmd); 630 ret = class_device_create_file(sfp->class_dev,&dip->attr_debugcmd);
617 class_device_create_file(sfp->class_dev,&dip->attr_debuginfo); 631 if (ret < 0) {
632 printk(KERN_WARNING "%s: class_device_create_file error: %d\n",
633 __FUNCTION__, ret);
634 } else {
635 dip->debugcmd_created_ok = !0;
636 }
637 ret = class_device_create_file(sfp->class_dev,&dip->attr_debuginfo);
638 if (ret < 0) {
639 printk(KERN_WARNING "%s: class_device_create_file error: %d\n",
640 __FUNCTION__, ret);
641 } else {
642 dip->debuginfo_created_ok = !0;
643 }
618} 644}
619 645
620 646
621static void pvr2_sysfs_tear_down_debugifc(struct pvr2_sysfs *sfp) 647static void pvr2_sysfs_tear_down_debugifc(struct pvr2_sysfs *sfp)
622{ 648{
623 if (!sfp->debugifc) return; 649 if (!sfp->debugifc) return;
624 class_device_remove_file(sfp->class_dev, 650 if (sfp->debugifc->debuginfo_created_ok) {
625 &sfp->debugifc->attr_debuginfo); 651 class_device_remove_file(sfp->class_dev,
626 class_device_remove_file(sfp->class_dev,&sfp->debugifc->attr_debugcmd); 652 &sfp->debugifc->attr_debuginfo);
653 }
654 if (sfp->debugifc->debugcmd_created_ok) {
655 class_device_remove_file(sfp->class_dev,
656 &sfp->debugifc->attr_debugcmd);
657 }
627 kfree(sfp->debugifc); 658 kfree(sfp->debugifc);
628 sfp->debugifc = NULL; 659 sfp->debugifc = NULL;
629} 660}
@@ -645,7 +676,9 @@ static void pvr2_sysfs_tear_down_controls(struct pvr2_sysfs *sfp)
645 struct pvr2_sysfs_ctl_item *cip1,*cip2; 676 struct pvr2_sysfs_ctl_item *cip1,*cip2;
646 for (cip1 = sfp->item_first; cip1; cip1 = cip2) { 677 for (cip1 = sfp->item_first; cip1; cip1 = cip2) {
647 cip2 = cip1->item_next; 678 cip2 = cip1->item_next;
648 sysfs_remove_group(&sfp->class_dev->kobj,&cip1->grp); 679 if (cip1->created_ok) {
680 sysfs_remove_group(&sfp->class_dev->kobj,&cip1->grp);
681 }
649 pvr2_sysfs_trace("Destroying pvr2_sysfs_ctl_item id=%p",cip1); 682 pvr2_sysfs_trace("Destroying pvr2_sysfs_ctl_item id=%p",cip1);
650 kfree(cip1); 683 kfree(cip1);
651 } 684 }
@@ -675,8 +708,14 @@ static void class_dev_destroy(struct pvr2_sysfs *sfp)
675 pvr2_sysfs_tear_down_debugifc(sfp); 708 pvr2_sysfs_tear_down_debugifc(sfp);
676#endif /* CONFIG_VIDEO_PVRUSB2_DEBUGIFC */ 709#endif /* CONFIG_VIDEO_PVRUSB2_DEBUGIFC */
677 pvr2_sysfs_tear_down_controls(sfp); 710 pvr2_sysfs_tear_down_controls(sfp);
678 class_device_remove_file(sfp->class_dev,&sfp->attr_v4l_minor_number); 711 if (sfp->v4l_minor_number_created_ok) {
679 class_device_remove_file(sfp->class_dev,&sfp->attr_unit_number); 712 class_device_remove_file(sfp->class_dev,
713 &sfp->attr_v4l_minor_number);
714 }
715 if (sfp->unit_number_created_ok) {
716 class_device_remove_file(sfp->class_dev,
717 &sfp->attr_unit_number);
718 }
680 pvr2_sysfs_trace("Destroying class_dev id=%p",sfp->class_dev); 719 pvr2_sysfs_trace("Destroying class_dev id=%p",sfp->class_dev);
681 sfp->class_dev->class_data = NULL; 720 sfp->class_dev->class_data = NULL;
682 class_device_unregister(sfp->class_dev); 721 class_device_unregister(sfp->class_dev);
@@ -709,6 +748,8 @@ static void class_dev_create(struct pvr2_sysfs *sfp,
709{ 748{
710 struct usb_device *usb_dev; 749 struct usb_device *usb_dev;
711 struct class_device *class_dev; 750 struct class_device *class_dev;
751 int ret;
752
712 usb_dev = pvr2_hdw_get_dev(sfp->channel.hdw); 753 usb_dev = pvr2_hdw_get_dev(sfp->channel.hdw);
713 if (!usb_dev) return; 754 if (!usb_dev) return;
714 class_dev = kmalloc(sizeof(*class_dev),GFP_KERNEL); 755 class_dev = kmalloc(sizeof(*class_dev),GFP_KERNEL);
@@ -733,20 +774,40 @@ static void class_dev_create(struct pvr2_sysfs *sfp,
733 774
734 sfp->class_dev = class_dev; 775 sfp->class_dev = class_dev;
735 class_dev->class_data = sfp; 776 class_dev->class_data = sfp;
736 class_device_register(class_dev); 777 ret = class_device_register(class_dev);
778 if (ret) {
779 printk(KERN_ERR "%s: class_device_register failed\n",
780 __FUNCTION__);
781 kfree(class_dev);
782 return;
783 }
737 784
738 sfp->attr_v4l_minor_number.attr.owner = THIS_MODULE; 785 sfp->attr_v4l_minor_number.attr.owner = THIS_MODULE;
739 sfp->attr_v4l_minor_number.attr.name = "v4l_minor_number"; 786 sfp->attr_v4l_minor_number.attr.name = "v4l_minor_number";
740 sfp->attr_v4l_minor_number.attr.mode = S_IRUGO; 787 sfp->attr_v4l_minor_number.attr.mode = S_IRUGO;
741 sfp->attr_v4l_minor_number.show = v4l_minor_number_show; 788 sfp->attr_v4l_minor_number.show = v4l_minor_number_show;
742 sfp->attr_v4l_minor_number.store = NULL; 789 sfp->attr_v4l_minor_number.store = NULL;
743 class_device_create_file(sfp->class_dev,&sfp->attr_v4l_minor_number); 790 ret = class_device_create_file(sfp->class_dev,
791 &sfp->attr_v4l_minor_number);
792 if (ret < 0) {
793 printk(KERN_WARNING "%s: class_device_create_file error: %d\n",
794 __FUNCTION__, ret);
795 } else {
796 sfp->v4l_minor_number_created_ok = !0;
797 }
798
744 sfp->attr_unit_number.attr.owner = THIS_MODULE; 799 sfp->attr_unit_number.attr.owner = THIS_MODULE;
745 sfp->attr_unit_number.attr.name = "unit_number"; 800 sfp->attr_unit_number.attr.name = "unit_number";
746 sfp->attr_unit_number.attr.mode = S_IRUGO; 801 sfp->attr_unit_number.attr.mode = S_IRUGO;
747 sfp->attr_unit_number.show = unit_number_show; 802 sfp->attr_unit_number.show = unit_number_show;
748 sfp->attr_unit_number.store = NULL; 803 sfp->attr_unit_number.store = NULL;
749 class_device_create_file(sfp->class_dev,&sfp->attr_unit_number); 804 ret = class_device_create_file(sfp->class_dev,&sfp->attr_unit_number);
805 if (ret < 0) {
806 printk(KERN_WARNING "%s: class_device_create_file error: %d\n",
807 __FUNCTION__, ret);
808 } else {
809 sfp->unit_number_created_ok = !0;
810 }
750 811
751 pvr2_sysfs_add_controls(sfp); 812 pvr2_sysfs_add_controls(sfp);
752#ifdef CONFIG_VIDEO_PVRUSB2_DEBUGIFC 813#ifdef CONFIG_VIDEO_PVRUSB2_DEBUGIFC
diff --git a/drivers/media/video/saa7134/saa7134-alsa.c b/drivers/media/video/saa7134/saa7134-alsa.c
index f1fd69e7f119..d73cff1970ae 100644
--- a/drivers/media/video/saa7134/saa7134-alsa.c
+++ b/drivers/media/video/saa7134/saa7134-alsa.c
@@ -997,9 +997,9 @@ static int saa7134_alsa_init(void)
997 struct saa7134_dev *dev = NULL; 997 struct saa7134_dev *dev = NULL;
998 struct list_head *list; 998 struct list_head *list;
999 999
1000 if (!dmasound_init && !dmasound_exit) { 1000 if (!saa7134_dmasound_init && !saa7134_dmasound_exit) {
1001 dmasound_init = alsa_device_init; 1001 saa7134_dmasound_init = alsa_device_init;
1002 dmasound_exit = alsa_device_exit; 1002 saa7134_dmasound_exit = alsa_device_exit;
1003 } else { 1003 } else {
1004 printk(KERN_WARNING "saa7134 ALSA: can't load, DMA sound handler already assigned (probably to OSS)\n"); 1004 printk(KERN_WARNING "saa7134 ALSA: can't load, DMA sound handler already assigned (probably to OSS)\n");
1005 return -EBUSY; 1005 return -EBUSY;
@@ -1036,8 +1036,8 @@ static void saa7134_alsa_exit(void)
1036 snd_card_free(snd_saa7134_cards[idx]); 1036 snd_card_free(snd_saa7134_cards[idx]);
1037 } 1037 }
1038 1038
1039 dmasound_init = NULL; 1039 saa7134_dmasound_init = NULL;
1040 dmasound_exit = NULL; 1040 saa7134_dmasound_exit = NULL;
1041 printk(KERN_INFO "saa7134 ALSA driver for DMA sound unloaded\n"); 1041 printk(KERN_INFO "saa7134 ALSA driver for DMA sound unloaded\n");
1042 1042
1043 return; 1043 return;
diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c
index 6e97cc84ba89..be3a81fc90a2 100644
--- a/drivers/media/video/saa7134/saa7134-core.c
+++ b/drivers/media/video/saa7134/saa7134-core.c
@@ -95,8 +95,8 @@ LIST_HEAD(saa7134_devlist);
95static LIST_HEAD(mops_list); 95static LIST_HEAD(mops_list);
96static unsigned int saa7134_devcount; 96static unsigned int saa7134_devcount;
97 97
98int (*dmasound_init)(struct saa7134_dev *dev); 98int (*saa7134_dmasound_init)(struct saa7134_dev *dev);
99int (*dmasound_exit)(struct saa7134_dev *dev); 99int (*saa7134_dmasound_exit)(struct saa7134_dev *dev);
100 100
101#define dprintk(fmt, arg...) if (core_debug) \ 101#define dprintk(fmt, arg...) if (core_debug) \
102 printk(KERN_DEBUG "%s/core: " fmt, dev->name , ## arg) 102 printk(KERN_DEBUG "%s/core: " fmt, dev->name , ## arg)
@@ -1008,8 +1008,8 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
1008 /* check for signal */ 1008 /* check for signal */
1009 saa7134_irq_video_intl(dev); 1009 saa7134_irq_video_intl(dev);
1010 1010
1011 if (dmasound_init && !dev->dmasound.priv_data) { 1011 if (saa7134_dmasound_init && !dev->dmasound.priv_data) {
1012 dmasound_init(dev); 1012 saa7134_dmasound_init(dev);
1013 } 1013 }
1014 1014
1015 return 0; 1015 return 0;
@@ -1036,8 +1036,8 @@ static void __devexit saa7134_finidev(struct pci_dev *pci_dev)
1036 struct saa7134_mpeg_ops *mops; 1036 struct saa7134_mpeg_ops *mops;
1037 1037
1038 /* Release DMA sound modules if present */ 1038 /* Release DMA sound modules if present */
1039 if (dmasound_exit && dev->dmasound.priv_data) { 1039 if (saa7134_dmasound_exit && dev->dmasound.priv_data) {
1040 dmasound_exit(dev); 1040 saa7134_dmasound_exit(dev);
1041 } 1041 }
1042 1042
1043 /* debugging ... */ 1043 /* debugging ... */
@@ -1169,8 +1169,8 @@ EXPORT_SYMBOL(saa7134_boards);
1169 1169
1170/* ----------------- for the DMA sound modules --------------- */ 1170/* ----------------- for the DMA sound modules --------------- */
1171 1171
1172EXPORT_SYMBOL(dmasound_init); 1172EXPORT_SYMBOL(saa7134_dmasound_init);
1173EXPORT_SYMBOL(dmasound_exit); 1173EXPORT_SYMBOL(saa7134_dmasound_exit);
1174EXPORT_SYMBOL(saa7134_pgtable_free); 1174EXPORT_SYMBOL(saa7134_pgtable_free);
1175EXPORT_SYMBOL(saa7134_pgtable_build); 1175EXPORT_SYMBOL(saa7134_pgtable_build);
1176EXPORT_SYMBOL(saa7134_pgtable_alloc); 1176EXPORT_SYMBOL(saa7134_pgtable_alloc);
diff --git a/drivers/media/video/saa7134/saa7134-oss.c b/drivers/media/video/saa7134/saa7134-oss.c
index 3895d05804ae..2e3ba5f31453 100644
--- a/drivers/media/video/saa7134/saa7134-oss.c
+++ b/drivers/media/video/saa7134/saa7134-oss.c
@@ -993,9 +993,9 @@ static int saa7134_oss_init(void)
993 struct saa7134_dev *dev = NULL; 993 struct saa7134_dev *dev = NULL;
994 struct list_head *list; 994 struct list_head *list;
995 995
996 if (!dmasound_init && !dmasound_exit) { 996 if (!saa7134_dmasound_init && !saa7134_dmasound_exit) {
997 dmasound_init = oss_device_init; 997 saa7134_dmasound_init = oss_device_init;
998 dmasound_exit = oss_device_exit; 998 saa7134_dmasound_exit = oss_device_exit;
999 } else { 999 } else {
1000 printk(KERN_WARNING "saa7134 OSS: can't load, DMA sound handler already assigned (probably to ALSA)\n"); 1000 printk(KERN_WARNING "saa7134 OSS: can't load, DMA sound handler already assigned (probably to ALSA)\n");
1001 return -EBUSY; 1001 return -EBUSY;
@@ -1037,8 +1037,8 @@ static void saa7134_oss_exit(void)
1037 1037
1038 } 1038 }
1039 1039
1040 dmasound_init = NULL; 1040 saa7134_dmasound_init = NULL;
1041 dmasound_exit = NULL; 1041 saa7134_dmasound_exit = NULL;
1042 1042
1043 printk(KERN_INFO "saa7134 OSS driver for DMA sound unloaded\n"); 1043 printk(KERN_INFO "saa7134 OSS driver for DMA sound unloaded\n");
1044 1044
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c
index e4156ec9c6d7..8656f2400e18 100644
--- a/drivers/media/video/saa7134/saa7134-video.c
+++ b/drivers/media/video/saa7134/saa7134-video.c
@@ -40,7 +40,7 @@
40 40
41static unsigned int video_debug = 0; 41static unsigned int video_debug = 0;
42static unsigned int gbuffers = 8; 42static unsigned int gbuffers = 8;
43static unsigned int noninterlaced = 0; 43static unsigned int noninterlaced = 1;
44static unsigned int gbufsize = 720*576*4; 44static unsigned int gbufsize = 720*576*4;
45static unsigned int gbufsize_max = 720*576*4; 45static unsigned int gbufsize_max = 720*576*4;
46module_param(video_debug, int, 0644); 46module_param(video_debug, int, 0644);
@@ -48,7 +48,7 @@ MODULE_PARM_DESC(video_debug,"enable debug messages [video]");
48module_param(gbuffers, int, 0444); 48module_param(gbuffers, int, 0444);
49MODULE_PARM_DESC(gbuffers,"number of capture buffers, range 2-32"); 49MODULE_PARM_DESC(gbuffers,"number of capture buffers, range 2-32");
50module_param(noninterlaced, int, 0644); 50module_param(noninterlaced, int, 0644);
51MODULE_PARM_DESC(noninterlaced,"video input is noninterlaced"); 51MODULE_PARM_DESC(noninterlaced,"capture non interlaced video");
52 52
53#define dprintk(fmt, arg...) if (video_debug) \ 53#define dprintk(fmt, arg...) if (video_debug) \
54 printk(KERN_DEBUG "%s/video: " fmt, dev->name , ## arg) 54 printk(KERN_DEBUG "%s/video: " fmt, dev->name , ## arg)
@@ -2087,7 +2087,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
2087 struct v4l2_format *f = arg; 2087 struct v4l2_format *f = arg;
2088 return saa7134_try_fmt(dev,fh,f); 2088 return saa7134_try_fmt(dev,fh,f);
2089 } 2089 }
2090#ifdef HAVE_V4L1 2090#ifdef CONFIG_V4L1_COMPAT
2091 case VIDIOCGMBUF: 2091 case VIDIOCGMBUF:
2092 { 2092 {
2093 struct video_mbuf *mbuf = arg; 2093 struct video_mbuf *mbuf = arg;
diff --git a/drivers/media/video/saa7134/saa7134.h b/drivers/media/video/saa7134/saa7134.h
index d5ee99c574cc..c04ce6152fd5 100644
--- a/drivers/media/video/saa7134/saa7134.h
+++ b/drivers/media/video/saa7134/saa7134.h
@@ -586,8 +586,8 @@ void saa7134_dma_free(struct videobuf_queue *q,struct saa7134_buf *buf);
586 586
587int saa7134_set_dmabits(struct saa7134_dev *dev); 587int saa7134_set_dmabits(struct saa7134_dev *dev);
588 588
589extern int (*dmasound_init)(struct saa7134_dev *dev); 589extern int (*saa7134_dmasound_init)(struct saa7134_dev *dev);
590extern int (*dmasound_exit)(struct saa7134_dev *dev); 590extern int (*saa7134_dmasound_exit)(struct saa7134_dev *dev);
591 591
592 592
593/* ----------------------------------------------------------- */ 593/* ----------------------------------------------------------- */
diff --git a/drivers/media/video/stradis.c b/drivers/media/video/stradis.c
index b36ba9fa3a28..5686547ba76a 100644
--- a/drivers/media/video/stradis.c
+++ b/drivers/media/video/stradis.c
@@ -2181,7 +2181,6 @@ static struct pci_device_id stradis_pci_tbl[] = {
2181 { 0 } 2181 { 0 }
2182}; 2182};
2183 2183
2184MODULE_DEVICE_TABLE(pci, stradis_pci_tbl);
2185 2184
2186static struct pci_driver stradis_driver = { 2185static struct pci_driver stradis_driver = {
2187 .name = "stradis", 2186 .name = "stradis",
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index f7eb402d5f2b..40590bae5ff7 100644
--- a/drivers/media/video/tuner-core.c
+++ b/drivers/media/video/tuner-core.c
@@ -196,14 +196,6 @@ static void set_type(struct i2c_client *c, unsigned int type,
196 i2c_master_send(c, buffer, 4); 196 i2c_master_send(c, buffer, 4);
197 default_tuner_init(c); 197 default_tuner_init(c);
198 break; 198 break;
199 case TUNER_LG_TDVS_H06XF:
200 /* Set the Auxiliary Byte. */
201 buffer[2] &= ~0x20;
202 buffer[2] |= 0x18;
203 buffer[3] = 0x20;
204 i2c_master_send(c, buffer, 4);
205 default_tuner_init(c);
206 break;
207 case TUNER_PHILIPS_TD1316: 199 case TUNER_PHILIPS_TD1316:
208 buffer[0] = 0x0b; 200 buffer[0] = 0x0b;
209 buffer[1] = 0xdc; 201 buffer[1] = 0xdc;
@@ -598,6 +590,7 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
598 if (t->standby) 590 if (t->standby)
599 t->standby (client); 591 t->standby (client);
600 break; 592 break;
593#ifdef CONFIG_VIDEO_V4L1
601 case VIDIOCSAUDIO: 594 case VIDIOCSAUDIO:
602 if (check_mode(t, "VIDIOCSAUDIO") == EINVAL) 595 if (check_mode(t, "VIDIOCSAUDIO") == EINVAL)
603 return 0; 596 return 0;
@@ -607,17 +600,6 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
607 /* Should be implemented, since bttv calls it */ 600 /* Should be implemented, since bttv calls it */
608 tuner_dbg("VIDIOCSAUDIO not implemented.\n"); 601 tuner_dbg("VIDIOCSAUDIO not implemented.\n");
609 break; 602 break;
610 case TDA9887_SET_CONFIG:
611 if (t->type == TUNER_TDA9887) {
612 int *i = arg;
613
614 t->tda9887_config = *i;
615 set_freq(client, t->tv_freq);
616 }
617 break;
618 /* --- v4l ioctls --- */
619 /* take care: bttv does userspace copying, we'll get a
620 kernel pointer here... */
621 case VIDIOCSCHAN: 603 case VIDIOCSCHAN:
622 { 604 {
623 static const v4l2_std_id map[] = { 605 static const v4l2_std_id map[] = {
@@ -701,7 +683,18 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
701 ? VIDEO_SOUND_STEREO : VIDEO_SOUND_MONO; 683 ? VIDEO_SOUND_STEREO : VIDEO_SOUND_MONO;
702 return 0; 684 return 0;
703 } 685 }
686#endif
687 case TDA9887_SET_CONFIG:
688 if (t->type == TUNER_TDA9887) {
689 int *i = arg;
704 690
691 t->tda9887_config = *i;
692 set_freq(client, t->tv_freq);
693 }
694 break;
695 /* --- v4l ioctls --- */
696 /* take care: bttv does userspace copying, we'll get a
697 kernel pointer here... */
705 case VIDIOC_S_STD: 698 case VIDIOC_S_STD:
706 { 699 {
707 v4l2_std_id *id = arg; 700 v4l2_std_id *id = arg;
diff --git a/drivers/media/video/tuner-simple.c b/drivers/media/video/tuner-simple.c
index d071c5cbf013..abe37cf632c6 100644
--- a/drivers/media/video/tuner-simple.c
+++ b/drivers/media/video/tuner-simple.c
@@ -339,7 +339,20 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)
339 if (4 != (rc = i2c_master_send(c,buffer,4))) 339 if (4 != (rc = i2c_master_send(c,buffer,4)))
340 tuner_warn("i2c i/o error: rc == %d (should be 4)\n",rc); 340 tuner_warn("i2c i/o error: rc == %d (should be 4)\n",rc);
341 341
342 if (t->type == TUNER_MICROTUNE_4042FI5) { 342 switch (t->type) {
343 case TUNER_LG_TDVS_H06XF:
344 /* Set the Auxiliary Byte. */
345 buffer[0] = buffer[2];
346 buffer[0] &= ~0x20;
347 buffer[0] |= 0x18;
348 buffer[1] = 0x20;
349 tuner_dbg("tv 0x%02x 0x%02x\n",buffer[0],buffer[1]);
350
351 if (2 != (rc = i2c_master_send(c,buffer,2)))
352 tuner_warn("i2c i/o error: rc == %d (should be 2)\n",rc);
353 break;
354 case TUNER_MICROTUNE_4042FI5:
355 {
343 // FIXME - this may also work for other tuners 356 // FIXME - this may also work for other tuners
344 unsigned long timeout = jiffies + msecs_to_jiffies(1); 357 unsigned long timeout = jiffies + msecs_to_jiffies(1);
345 u8 status_byte = 0; 358 u8 status_byte = 0;
@@ -364,10 +377,12 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)
364 buffer[2] = config; 377 buffer[2] = config;
365 buffer[3] = cb; 378 buffer[3] = cb;
366 tuner_dbg("tv 0x%02x 0x%02x 0x%02x 0x%02x\n", 379 tuner_dbg("tv 0x%02x 0x%02x 0x%02x 0x%02x\n",
367 buffer[0],buffer[1],buffer[2],buffer[3]); 380 buffer[0],buffer[1],buffer[2],buffer[3]);
368 381
369 if (4 != (rc = i2c_master_send(c,buffer,4))) 382 if (4 != (rc = i2c_master_send(c,buffer,4)))
370 tuner_warn("i2c i/o error: rc == %d (should be 4)\n",rc); 383 tuner_warn("i2c i/o error: rc == %d (should be 4)\n",rc);
384 break;
385 }
371 } 386 }
372} 387}
373 388
diff --git a/drivers/media/video/usbvideo/Kconfig b/drivers/media/video/usbvideo/Kconfig
index 59fb899f31f3..a0fd82b924f2 100644
--- a/drivers/media/video/usbvideo/Kconfig
+++ b/drivers/media/video/usbvideo/Kconfig
@@ -3,7 +3,7 @@ config VIDEO_USBVIDEO
3 3
4config USB_VICAM 4config USB_VICAM
5 tristate "USB 3com HomeConnect (aka vicam) support (EXPERIMENTAL)" 5 tristate "USB 3com HomeConnect (aka vicam) support (EXPERIMENTAL)"
6 depends on USB && VIDEO_V4L1 && EXPERIMENTAL 6 depends on USB && VIDEO_DEV && VIDEO_V4L1 && EXPERIMENTAL
7 select VIDEO_USBVIDEO 7 select VIDEO_USBVIDEO
8 ---help--- 8 ---help---
9 Say Y here if you have 3com homeconnect camera (vicam). 9 Say Y here if you have 3com homeconnect camera (vicam).
@@ -13,7 +13,7 @@ config USB_VICAM
13 13
14config USB_IBMCAM 14config USB_IBMCAM
15 tristate "USB IBM (Xirlink) C-it Camera support" 15 tristate "USB IBM (Xirlink) C-it Camera support"
16 depends on USB && VIDEO_V4L1 16 depends on USB && VIDEO_DEV && VIDEO_V4L1
17 select VIDEO_USBVIDEO 17 select VIDEO_USBVIDEO
18 ---help--- 18 ---help---
19 Say Y here if you want to connect a IBM "C-It" camera, also known as 19 Say Y here if you want to connect a IBM "C-It" camera, also known as
@@ -28,7 +28,7 @@ config USB_IBMCAM
28 28
29config USB_KONICAWC 29config USB_KONICAWC
30 tristate "USB Konica Webcam support" 30 tristate "USB Konica Webcam support"
31 depends on USB && VIDEO_V4L1 31 depends on USB && VIDEO_DEV && VIDEO_V4L1
32 select VIDEO_USBVIDEO 32 select VIDEO_USBVIDEO
33 ---help--- 33 ---help---
34 Say Y here if you want support for webcams based on a Konica 34 Say Y here if you want support for webcams based on a Konica
@@ -39,7 +39,7 @@ config USB_KONICAWC
39 39
40config USB_QUICKCAM_MESSENGER 40config USB_QUICKCAM_MESSENGER
41 tristate "USB Logitech Quickcam Messenger" 41 tristate "USB Logitech Quickcam Messenger"
42 depends on USB && VIDEO_DEV 42 depends on USB && VIDEO_DEV && VIDEO_V4L1
43 select VIDEO_USBVIDEO 43 select VIDEO_USBVIDEO
44 ---help--- 44 ---help---
45 Say Y or M here to enable support for the USB Logitech Quickcam 45 Say Y or M here to enable support for the USB Logitech Quickcam
diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c
index f06dc19e504a..2ecbeffb559e 100644
--- a/drivers/media/video/v4l2-common.c
+++ b/drivers/media/video/v4l2-common.c
@@ -202,7 +202,7 @@ static char *v4l2_memory_names[] = {
202/* ------------------------------------------------------------------ */ 202/* ------------------------------------------------------------------ */
203/* debug help functions */ 203/* debug help functions */
204 204
205#ifdef HAVE_V4L1 205#ifdef CONFIG_V4L1_COMPAT
206static const char *v4l1_ioctls[] = { 206static const char *v4l1_ioctls[] = {
207 [_IOC_NR(VIDIOCGCAP)] = "VIDIOCGCAP", 207 [_IOC_NR(VIDIOCGCAP)] = "VIDIOCGCAP",
208 [_IOC_NR(VIDIOCGCHAN)] = "VIDIOCGCHAN", 208 [_IOC_NR(VIDIOCGCHAN)] = "VIDIOCGCHAN",
@@ -301,7 +301,7 @@ static const char *v4l2_ioctls[] = {
301#define V4L2_IOCTLS ARRAY_SIZE(v4l2_ioctls) 301#define V4L2_IOCTLS ARRAY_SIZE(v4l2_ioctls)
302 302
303static const char *v4l2_int_ioctls[] = { 303static const char *v4l2_int_ioctls[] = {
304#ifdef HAVE_VIDEO_DECODER 304#ifdef CONFIG_V4L1_COMPAT
305 [_IOC_NR(DECODER_GET_CAPABILITIES)] = "DECODER_GET_CAPABILITIES", 305 [_IOC_NR(DECODER_GET_CAPABILITIES)] = "DECODER_GET_CAPABILITIES",
306 [_IOC_NR(DECODER_GET_STATUS)] = "DECODER_GET_STATUS", 306 [_IOC_NR(DECODER_GET_STATUS)] = "DECODER_GET_STATUS",
307 [_IOC_NR(DECODER_SET_NORM)] = "DECODER_SET_NORM", 307 [_IOC_NR(DECODER_SET_NORM)] = "DECODER_SET_NORM",
@@ -367,7 +367,7 @@ void v4l_printk_ioctl(unsigned int cmd)
367 (_IOC_NR(cmd) < V4L2_INT_IOCTLS) ? 367 (_IOC_NR(cmd) < V4L2_INT_IOCTLS) ?
368 v4l2_int_ioctls[_IOC_NR(cmd)] : "UNKNOWN", dir, cmd); 368 v4l2_int_ioctls[_IOC_NR(cmd)] : "UNKNOWN", dir, cmd);
369 break; 369 break;
370#ifdef HAVE_V4L1 370#ifdef CONFIG_V4L1_COMPAT
371 case 'v': 371 case 'v':
372 printk("v4l1 ioctl %s, dir=%s (0x%08x)\n", 372 printk("v4l1 ioctl %s, dir=%s (0x%08x)\n",
373 (_IOC_NR(cmd) < V4L1_IOCTLS) ? 373 (_IOC_NR(cmd) < V4L1_IOCTLS) ?
@@ -414,6 +414,7 @@ void v4l_printk_ioctl_arg(char *s,unsigned int cmd, void *arg)
414 printk ("%s: tuner type=%d\n", s, *p); 414 printk ("%s: tuner type=%d\n", s, *p);
415 break; 415 break;
416 } 416 }
417#ifdef CONFIG_VIDEO_V4L1_COMPAT
417 case DECODER_SET_VBI_BYPASS: 418 case DECODER_SET_VBI_BYPASS:
418 case DECODER_ENABLE_OUTPUT: 419 case DECODER_ENABLE_OUTPUT:
419 case DECODER_GET_STATUS: 420 case DECODER_GET_STATUS:
@@ -424,6 +425,7 @@ void v4l_printk_ioctl_arg(char *s,unsigned int cmd, void *arg)
424 case VIDIOCCAPTURE: 425 case VIDIOCCAPTURE:
425 case VIDIOCSYNC: 426 case VIDIOCSYNC:
426 case VIDIOCSWRITEMODE: 427 case VIDIOCSWRITEMODE:
428#endif
427 case TUNER_SET_TYPE_ADDR: 429 case TUNER_SET_TYPE_ADDR:
428 case TUNER_SET_STANDBY: 430 case TUNER_SET_STANDBY:
429 case TDA9887_SET_CONFIG: 431 case TDA9887_SET_CONFIG:
@@ -755,6 +757,7 @@ void v4l_printk_ioctl_arg(char *s,unsigned int cmd, void *arg)
755 p->afc); 757 p->afc);
756 break; 758 break;
757 } 759 }
760#ifdef CONFIG_VIDEO_V4L1_COMPAT
758 case VIDIOCGVBIFMT: 761 case VIDIOCGVBIFMT:
759 case VIDIOCSVBIFMT: 762 case VIDIOCSVBIFMT:
760 { 763 {
@@ -924,6 +927,14 @@ void v4l_printk_ioctl_arg(char *s,unsigned int cmd, void *arg)
924 p->clipcount); 927 p->clipcount);
925 break; 928 break;
926 } 929 }
930 case VIDIOCGFREQ:
931 case VIDIOCSFREQ:
932 {
933 unsigned long *p=arg;
934 printk ("%s: value=%lu\n", s, *p);
935 break;
936 }
937#endif
927 case VIDIOC_INT_AUDIO_CLOCK_FREQ: 938 case VIDIOC_INT_AUDIO_CLOCK_FREQ:
928 case VIDIOC_INT_I2S_CLOCK_FREQ: 939 case VIDIOC_INT_I2S_CLOCK_FREQ:
929 case VIDIOC_INT_S_STANDBY: 940 case VIDIOC_INT_S_STANDBY:
@@ -933,13 +944,6 @@ void v4l_printk_ioctl_arg(char *s,unsigned int cmd, void *arg)
933 printk ("%s: value=%d\n", s, *p); 944 printk ("%s: value=%d\n", s, *p);
934 break; 945 break;
935 } 946 }
936 case VIDIOCGFREQ:
937 case VIDIOCSFREQ:
938 {
939 unsigned long *p=arg;
940 printk ("%s: value=%lu\n", s, *p);
941 break;
942 }
943 case VIDIOC_G_STD: 947 case VIDIOC_G_STD:
944 case VIDIOC_S_STD: 948 case VIDIOC_S_STD:
945 case VIDIOC_QUERYSTD: 949 case VIDIOC_QUERYSTD:
diff --git a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c
index b26ebaff226f..0fc90cd393f6 100644
--- a/drivers/media/video/videodev.c
+++ b/drivers/media/video/videodev.c
@@ -760,7 +760,7 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
760 ret=vfd->vidioc_overlay(file, fh, *i); 760 ret=vfd->vidioc_overlay(file, fh, *i);
761 break; 761 break;
762 } 762 }
763#ifdef HAVE_V4L1 763#ifdef CONFIG_V4L1_COMPAT
764 /* --- streaming capture ------------------------------------- */ 764 /* --- streaming capture ------------------------------------- */
765 case VIDIOCGMBUF: 765 case VIDIOCGMBUF:
766 { 766 {
@@ -1512,6 +1512,7 @@ int video_register_device(struct video_device *vfd, int type, int nr)
1512 int i=0; 1512 int i=0;
1513 int base; 1513 int base;
1514 int end; 1514 int end;
1515 int ret;
1515 char *name_base; 1516 char *name_base;
1516 1517
1517 switch(type) 1518 switch(type)
@@ -1537,6 +1538,8 @@ int video_register_device(struct video_device *vfd, int type, int nr)
1537 name_base = "radio"; 1538 name_base = "radio";
1538 break; 1539 break;
1539 default: 1540 default:
1541 printk(KERN_ERR "%s called with unknown type: %d\n",
1542 __FUNCTION__, type);
1540 return -1; 1543 return -1;
1541 } 1544 }
1542 1545
@@ -1571,9 +1574,18 @@ int video_register_device(struct video_device *vfd, int type, int nr)
1571 vfd->class_dev.class = &video_class; 1574 vfd->class_dev.class = &video_class;
1572 vfd->class_dev.devt = MKDEV(VIDEO_MAJOR, vfd->minor); 1575 vfd->class_dev.devt = MKDEV(VIDEO_MAJOR, vfd->minor);
1573 sprintf(vfd->class_dev.class_id, "%s%d", name_base, i - base); 1576 sprintf(vfd->class_dev.class_id, "%s%d", name_base, i - base);
1574 class_device_register(&vfd->class_dev); 1577 ret = class_device_register(&vfd->class_dev);
1575 class_device_create_file(&vfd->class_dev, 1578 if (ret < 0) {
1576 &class_device_attr_name); 1579 printk(KERN_ERR "%s: class_device_register failed\n",
1580 __FUNCTION__);
1581 goto fail_minor;
1582 }
1583 ret = class_device_create_file(&vfd->class_dev, &class_device_attr_name);
1584 if (ret < 0) {
1585 printk(KERN_ERR "%s: class_device_create_file 'name' failed\n",
1586 __FUNCTION__);
1587 goto fail_classdev;
1588 }
1577 1589
1578#if 1 1590#if 1
1579 /* needed until all drivers are fixed */ 1591 /* needed until all drivers are fixed */
@@ -1583,6 +1595,15 @@ int video_register_device(struct video_device *vfd, int type, int nr)
1583 "http://lwn.net/Articles/36850/\n", vfd->name); 1595 "http://lwn.net/Articles/36850/\n", vfd->name);
1584#endif 1596#endif
1585 return 0; 1597 return 0;
1598
1599fail_classdev:
1600 class_device_unregister(&vfd->class_dev);
1601fail_minor:
1602 mutex_lock(&videodev_lock);
1603 video_device[vfd->minor] = NULL;
1604 vfd->minor = -1;
1605 mutex_unlock(&videodev_lock);
1606 return ret;
1586} 1607}
1587 1608
1588/** 1609/**
diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c
index 41d23c8acbd8..38bd0c1018c2 100644
--- a/drivers/media/video/vivi.c
+++ b/drivers/media/video/vivi.c
@@ -986,7 +986,7 @@ static int vidioc_dqbuf (struct file *file, void *priv, struct v4l2_buffer *p)
986 file->f_flags & O_NONBLOCK)); 986 file->f_flags & O_NONBLOCK));
987} 987}
988 988
989#ifdef HAVE_V4L1 989#ifdef CONFIG_V4L1_COMPAT
990static int vidiocgmbuf (struct file *file, void *priv, struct video_mbuf *mbuf) 990static int vidiocgmbuf (struct file *file, void *priv, struct video_mbuf *mbuf)
991{ 991{
992 struct vivi_fh *fh=priv; 992 struct vivi_fh *fh=priv;
@@ -1328,7 +1328,7 @@ static struct video_device vivi = {
1328 .vidioc_s_ctrl = vidioc_s_ctrl, 1328 .vidioc_s_ctrl = vidioc_s_ctrl,
1329 .vidioc_streamon = vidioc_streamon, 1329 .vidioc_streamon = vidioc_streamon,
1330 .vidioc_streamoff = vidioc_streamoff, 1330 .vidioc_streamoff = vidioc_streamoff,
1331#ifdef HAVE_V4L1 1331#ifdef CONFIG_V4L1_COMPAT
1332 .vidiocgmbuf = vidiocgmbuf, 1332 .vidiocgmbuf = vidiocgmbuf,
1333#endif 1333#endif
1334 .tvnorms = tvnorms, 1334 .tvnorms = tvnorms,
diff --git a/drivers/message/fusion/Kconfig b/drivers/message/fusion/Kconfig
index bbc229852881..ea31d8470510 100644
--- a/drivers/message/fusion/Kconfig
+++ b/drivers/message/fusion/Kconfig
@@ -48,10 +48,8 @@ config FUSION_SAS
48 List of supported controllers: 48 List of supported controllers:
49 49
50 LSISAS1064 50 LSISAS1064
51 LSISAS1066
52 LSISAS1068 51 LSISAS1068
53 LSISAS1064E 52 LSISAS1064E
54 LSISAS1066E
55 LSISAS1068E 53 LSISAS1068E
56 54
57config FUSION_MAX_SGE 55config FUSION_MAX_SGE
diff --git a/drivers/message/fusion/Makefile b/drivers/message/fusion/Makefile
index b114236f4395..341691390e86 100644
--- a/drivers/message/fusion/Makefile
+++ b/drivers/message/fusion/Makefile
@@ -9,7 +9,6 @@
9#EXTRA_CFLAGS += -DMPT_DEBUG_EXIT 9#EXTRA_CFLAGS += -DMPT_DEBUG_EXIT
10#EXTRA_CFLAGS += -DMPT_DEBUG_FAIL 10#EXTRA_CFLAGS += -DMPT_DEBUG_FAIL
11 11
12
13# 12#
14# driver/module specifics... 13# driver/module specifics...
15# 14#
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index 43308df64623..29d0635cce1d 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -436,8 +436,6 @@ mpt_base_reply(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *reply)
436 */ 436 */
437 if (pEvReply->MsgFlags & MPI_MSGFLAGS_CONTINUATION_REPLY) { 437 if (pEvReply->MsgFlags & MPI_MSGFLAGS_CONTINUATION_REPLY) {
438 freereq = 0; 438 freereq = 0;
439 devtverboseprintk((MYIOC_s_WARN_FMT "EVENT_NOTIFICATION reply %p does not return Request frame\n",
440 ioc->name, pEvReply));
441 } else { 439 } else {
442 devtverboseprintk((MYIOC_s_WARN_FMT "EVENT_NOTIFICATION reply %p returns Request frame\n", 440 devtverboseprintk((MYIOC_s_WARN_FMT "EVENT_NOTIFICATION reply %p returns Request frame\n",
443 ioc->name, pEvReply)); 441 ioc->name, pEvReply));
@@ -678,19 +676,19 @@ int
678mpt_device_driver_register(struct mpt_pci_driver * dd_cbfunc, int cb_idx) 676mpt_device_driver_register(struct mpt_pci_driver * dd_cbfunc, int cb_idx)
679{ 677{
680 MPT_ADAPTER *ioc; 678 MPT_ADAPTER *ioc;
679 const struct pci_device_id *id;
681 680
682 if (cb_idx < 1 || cb_idx >= MPT_MAX_PROTOCOL_DRIVERS) { 681 if (cb_idx < 1 || cb_idx >= MPT_MAX_PROTOCOL_DRIVERS)
683 return -EINVAL; 682 return -EINVAL;
684 }
685 683
686 MptDeviceDriverHandlers[cb_idx] = dd_cbfunc; 684 MptDeviceDriverHandlers[cb_idx] = dd_cbfunc;
687 685
688 /* call per pci device probe entry point */ 686 /* call per pci device probe entry point */
689 list_for_each_entry(ioc, &ioc_list, list) { 687 list_for_each_entry(ioc, &ioc_list, list) {
690 if(dd_cbfunc->probe) { 688 id = ioc->pcidev->driver ?
691 dd_cbfunc->probe(ioc->pcidev, 689 ioc->pcidev->driver->id_table : NULL;
692 ioc->pcidev->driver->id_table); 690 if (dd_cbfunc->probe)
693 } 691 dd_cbfunc->probe(ioc->pcidev, id);
694 } 692 }
695 693
696 return 0; 694 return 0;
@@ -1056,9 +1054,8 @@ mpt_host_page_alloc(MPT_ADAPTER *ioc, pIOCInit_t ioc_init)
1056 1054
1057 dinitprintk((MYIOC_s_INFO_FMT 1055 dinitprintk((MYIOC_s_INFO_FMT
1058 "host_page_buffer @ %p, dma @ %x, sz=%d bytes\n", 1056 "host_page_buffer @ %p, dma @ %x, sz=%d bytes\n",
1059 ioc->name, 1057 ioc->name, ioc->HostPageBuffer,
1060 ioc->HostPageBuffer, 1058 (u32)ioc->HostPageBuffer_dma,
1061 ioc->HostPageBuffer_dma,
1062 host_page_buffer_sz)); 1059 host_page_buffer_sz));
1063 ioc->alloc_total += host_page_buffer_sz; 1060 ioc->alloc_total += host_page_buffer_sz;
1064 ioc->HostPageBuffer_sz = host_page_buffer_sz; 1061 ioc->HostPageBuffer_sz = host_page_buffer_sz;
@@ -1380,6 +1377,7 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
1380 printk(KERN_WARNING MYNAM 1377 printk(KERN_WARNING MYNAM
1381 ": WARNING - %s did not initialize properly! (%d)\n", 1378 ": WARNING - %s did not initialize properly! (%d)\n",
1382 ioc->name, r); 1379 ioc->name, r);
1380
1383 list_del(&ioc->list); 1381 list_del(&ioc->list);
1384 if (ioc->alt_ioc) 1382 if (ioc->alt_ioc)
1385 ioc->alt_ioc->alt_ioc = NULL; 1383 ioc->alt_ioc->alt_ioc = NULL;
@@ -1762,9 +1760,9 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
1762 * chips (mpt_adapter_disable, 1760 * chips (mpt_adapter_disable,
1763 * mpt_diag_reset) 1761 * mpt_diag_reset)
1764 */ 1762 */
1765 ioc->cached_fw = NULL;
1766 ddlprintk((MYIOC_s_INFO_FMT ": mpt_upload: alt_%s has cached_fw=%p \n", 1763 ddlprintk((MYIOC_s_INFO_FMT ": mpt_upload: alt_%s has cached_fw=%p \n",
1767 ioc->name, ioc->alt_ioc->name, ioc->alt_ioc->cached_fw)); 1764 ioc->name, ioc->alt_ioc->name, ioc->alt_ioc->cached_fw));
1765 ioc->alt_ioc->cached_fw = NULL;
1768 } 1766 }
1769 } else { 1767 } else {
1770 printk(KERN_WARNING MYNAM ": firmware upload failure!\n"); 1768 printk(KERN_WARNING MYNAM ": firmware upload failure!\n");
@@ -1885,7 +1883,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
1885 /* FIXME? Examine results here? */ 1883 /* FIXME? Examine results here? */
1886 } 1884 }
1887 1885
1888out: 1886 out:
1889 if ((ret != 0) && irq_allocated) { 1887 if ((ret != 0) && irq_allocated) {
1890 free_irq(ioc->pci_irq, ioc); 1888 free_irq(ioc->pci_irq, ioc);
1891 if (mpt_msi_enable) 1889 if (mpt_msi_enable)
@@ -2670,6 +2668,7 @@ SendIocInit(MPT_ADAPTER *ioc, int sleepFlag)
2670 dinitprintk((MYIOC_s_INFO_FMT "INFO - Wait IOC_OPERATIONAL state (cnt=%d)\n", 2668 dinitprintk((MYIOC_s_INFO_FMT "INFO - Wait IOC_OPERATIONAL state (cnt=%d)\n",
2671 ioc->name, count)); 2669 ioc->name, count));
2672 2670
2671 ioc->aen_event_read_flag=0;
2673 return r; 2672 return r;
2674} 2673}
2675 2674
@@ -2737,6 +2736,8 @@ mpt_alloc_fw_memory(MPT_ADAPTER *ioc, int size)
2737 if (ioc->alt_ioc && ioc->alt_ioc->cached_fw) { 2736 if (ioc->alt_ioc && ioc->alt_ioc->cached_fw) {
2738 ioc->cached_fw = ioc->alt_ioc->cached_fw; /* use alt_ioc's memory */ 2737 ioc->cached_fw = ioc->alt_ioc->cached_fw; /* use alt_ioc's memory */
2739 ioc->cached_fw_dma = ioc->alt_ioc->cached_fw_dma; 2738 ioc->cached_fw_dma = ioc->alt_ioc->cached_fw_dma;
2739 ioc->alloc_total += size;
2740 ioc->alt_ioc->alloc_total -= size;
2740 } else { 2741 } else {
2741 if ( (ioc->cached_fw = pci_alloc_consistent(ioc->pcidev, size, &ioc->cached_fw_dma) ) ) 2742 if ( (ioc->cached_fw = pci_alloc_consistent(ioc->pcidev, size, &ioc->cached_fw_dma) ) )
2742 ioc->alloc_total += size; 2743 ioc->alloc_total += size;
@@ -3166,6 +3167,7 @@ KickStart(MPT_ADAPTER *ioc, int force, int sleepFlag)
3166static int 3167static int
3167mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag) 3168mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag)
3168{ 3169{
3170 MPT_ADAPTER *iocp=NULL;
3169 u32 diag0val; 3171 u32 diag0val;
3170 u32 doorbell; 3172 u32 doorbell;
3171 int hard_reset_done = 0; 3173 int hard_reset_done = 0;
@@ -3301,17 +3303,23 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag)
3301 /* FIXME? Examine results here? */ 3303 /* FIXME? Examine results here? */
3302 } 3304 }
3303 3305
3304 if (ioc->cached_fw) { 3306 if (ioc->cached_fw)
3307 iocp = ioc;
3308 else if (ioc->alt_ioc && ioc->alt_ioc->cached_fw)
3309 iocp = ioc->alt_ioc;
3310 if (iocp) {
3305 /* If the DownloadBoot operation fails, the 3311 /* If the DownloadBoot operation fails, the
3306 * IOC will be left unusable. This is a fatal error 3312 * IOC will be left unusable. This is a fatal error
3307 * case. _diag_reset will return < 0 3313 * case. _diag_reset will return < 0
3308 */ 3314 */
3309 for (count = 0; count < 30; count ++) { 3315 for (count = 0; count < 30; count ++) {
3310 diag0val = CHIPREG_READ32(&ioc->chip->Diagnostic); 3316 diag0val = CHIPREG_READ32(&iocp->chip->Diagnostic);
3311 if (!(diag0val & MPI_DIAG_RESET_ADAPTER)) { 3317 if (!(diag0val & MPI_DIAG_RESET_ADAPTER)) {
3312 break; 3318 break;
3313 } 3319 }
3314 3320
3321 dprintk((MYIOC_s_INFO_FMT "cached_fw: diag0val=%x count=%d\n",
3322 iocp->name, diag0val, count));
3315 /* wait 1 sec */ 3323 /* wait 1 sec */
3316 if (sleepFlag == CAN_SLEEP) { 3324 if (sleepFlag == CAN_SLEEP) {
3317 msleep (1000); 3325 msleep (1000);
@@ -3320,7 +3328,7 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag)
3320 } 3328 }
3321 } 3329 }
3322 if ((count = mpt_downloadboot(ioc, 3330 if ((count = mpt_downloadboot(ioc,
3323 (MpiFwHeader_t *)ioc->cached_fw, sleepFlag)) < 0) { 3331 (MpiFwHeader_t *)iocp->cached_fw, sleepFlag)) < 0) {
3324 printk(KERN_WARNING MYNAM 3332 printk(KERN_WARNING MYNAM
3325 ": firmware downloadboot failure (%d)!\n", count); 3333 ": firmware downloadboot failure (%d)!\n", count);
3326 } 3334 }
@@ -3907,18 +3915,18 @@ WaitForDoorbellAck(MPT_ADAPTER *ioc, int howlong, int sleepFlag)
3907 3915
3908 if (sleepFlag == CAN_SLEEP) { 3916 if (sleepFlag == CAN_SLEEP) {
3909 while (--cntdn) { 3917 while (--cntdn) {
3918 msleep (1);
3910 intstat = CHIPREG_READ32(&ioc->chip->IntStatus); 3919 intstat = CHIPREG_READ32(&ioc->chip->IntStatus);
3911 if (! (intstat & MPI_HIS_IOP_DOORBELL_STATUS)) 3920 if (! (intstat & MPI_HIS_IOP_DOORBELL_STATUS))
3912 break; 3921 break;
3913 msleep (1);
3914 count++; 3922 count++;
3915 } 3923 }
3916 } else { 3924 } else {
3917 while (--cntdn) { 3925 while (--cntdn) {
3926 mdelay (1);
3918 intstat = CHIPREG_READ32(&ioc->chip->IntStatus); 3927 intstat = CHIPREG_READ32(&ioc->chip->IntStatus);
3919 if (! (intstat & MPI_HIS_IOP_DOORBELL_STATUS)) 3928 if (! (intstat & MPI_HIS_IOP_DOORBELL_STATUS))
3920 break; 3929 break;
3921 mdelay (1);
3922 count++; 3930 count++;
3923 } 3931 }
3924 } 3932 }
@@ -4883,6 +4891,7 @@ mpt_read_ioc_pg_4(MPT_ADAPTER *ioc)
4883 pIoc4 = pci_alloc_consistent(ioc->pcidev, iocpage4sz, &ioc4_dma); 4891 pIoc4 = pci_alloc_consistent(ioc->pcidev, iocpage4sz, &ioc4_dma);
4884 if (!pIoc4) 4892 if (!pIoc4)
4885 return; 4893 return;
4894 ioc->alloc_total += iocpage4sz;
4886 } else { 4895 } else {
4887 ioc4_dma = ioc->spi_data.IocPg4_dma; 4896 ioc4_dma = ioc->spi_data.IocPg4_dma;
4888 iocpage4sz = ioc->spi_data.IocPg4Sz; 4897 iocpage4sz = ioc->spi_data.IocPg4Sz;
@@ -4899,6 +4908,7 @@ mpt_read_ioc_pg_4(MPT_ADAPTER *ioc)
4899 } else { 4908 } else {
4900 pci_free_consistent(ioc->pcidev, iocpage4sz, pIoc4, ioc4_dma); 4909 pci_free_consistent(ioc->pcidev, iocpage4sz, pIoc4, ioc4_dma);
4901 ioc->spi_data.pIocPg4 = NULL; 4910 ioc->spi_data.pIocPg4 = NULL;
4911 ioc->alloc_total -= iocpage4sz;
4902 } 4912 }
4903} 4913}
4904 4914
@@ -5030,19 +5040,18 @@ SendEventAck(MPT_ADAPTER *ioc, EventNotificationReply_t *evnp)
5030 EventAck_t *pAck; 5040 EventAck_t *pAck;
5031 5041
5032 if ((pAck = (EventAck_t *) mpt_get_msg_frame(mpt_base_index, ioc)) == NULL) { 5042 if ((pAck = (EventAck_t *) mpt_get_msg_frame(mpt_base_index, ioc)) == NULL) {
5033 printk(MYIOC_s_WARN_FMT "Unable to allocate event ACK " 5043 dfailprintk((MYIOC_s_WARN_FMT "%s, no msg frames!!\n",
5034 "request frame for Event=%x EventContext=%x EventData=%x!\n", 5044 ioc->name,__FUNCTION__));
5035 ioc->name, evnp->Event, le32_to_cpu(evnp->EventContext),
5036 le32_to_cpu(evnp->Data[0]));
5037 return -1; 5045 return -1;
5038 } 5046 }
5039 memset(pAck, 0, sizeof(*pAck));
5040 5047
5041 dprintk((MYIOC_s_INFO_FMT "Sending EventAck\n", ioc->name)); 5048 devtverboseprintk((MYIOC_s_INFO_FMT "Sending EventAck\n", ioc->name));
5042 5049
5043 pAck->Function = MPI_FUNCTION_EVENT_ACK; 5050 pAck->Function = MPI_FUNCTION_EVENT_ACK;
5044 pAck->ChainOffset = 0; 5051 pAck->ChainOffset = 0;
5052 pAck->Reserved[0] = pAck->Reserved[1] = 0;
5045 pAck->MsgFlags = 0; 5053 pAck->MsgFlags = 0;
5054 pAck->Reserved1[0] = pAck->Reserved1[1] = pAck->Reserved1[2] = 0;
5046 pAck->Event = evnp->Event; 5055 pAck->Event = evnp->Event;
5047 pAck->EventContext = evnp->EventContext; 5056 pAck->EventContext = evnp->EventContext;
5048 5057
@@ -5704,9 +5713,9 @@ EventDescriptionStr(u8 event, u32 evData0, char *evStr)
5704 break; 5713 break;
5705 case MPI_EVENT_EVENT_CHANGE: 5714 case MPI_EVENT_EVENT_CHANGE:
5706 if (evData0) 5715 if (evData0)
5707 ds = "Events(ON) Change"; 5716 ds = "Events ON";
5708 else 5717 else
5709 ds = "Events(OFF) Change"; 5718 ds = "Events OFF";
5710 break; 5719 break;
5711 case MPI_EVENT_INTEGRATED_RAID: 5720 case MPI_EVENT_INTEGRATED_RAID:
5712 { 5721 {
@@ -5777,8 +5786,27 @@ EventDescriptionStr(u8 event, u32 evData0, char *evStr)
5777 break; 5786 break;
5778 case MPI_EVENT_SAS_DEV_STAT_RC_NO_PERSIST_ADDED: 5787 case MPI_EVENT_SAS_DEV_STAT_RC_NO_PERSIST_ADDED:
5779 snprintf(evStr, EVENT_DESCR_STR_SZ, 5788 snprintf(evStr, EVENT_DESCR_STR_SZ,
5780 "SAS Device Status Change: No Persistancy " 5789 "SAS Device Status Change: No Persistancy: id=%d", id);
5781 "Added: id=%d", id); 5790 break;
5791 case MPI_EVENT_SAS_DEV_STAT_RC_INTERNAL_DEVICE_RESET:
5792 snprintf(evStr, EVENT_DESCR_STR_SZ,
5793 "SAS Device Status Change: Internal Device Reset : id=%d", id);
5794 break;
5795 case MPI_EVENT_SAS_DEV_STAT_RC_TASK_ABORT_INTERNAL:
5796 snprintf(evStr, EVENT_DESCR_STR_SZ,
5797 "SAS Device Status Change: Internal Task Abort : id=%d", id);
5798 break;
5799 case MPI_EVENT_SAS_DEV_STAT_RC_ABORT_TASK_SET_INTERNAL:
5800 snprintf(evStr, EVENT_DESCR_STR_SZ,
5801 "SAS Device Status Change: Internal Abort Task Set : id=%d", id);
5802 break;
5803 case MPI_EVENT_SAS_DEV_STAT_RC_CLEAR_TASK_SET_INTERNAL:
5804 snprintf(evStr, EVENT_DESCR_STR_SZ,
5805 "SAS Device Status Change: Internal Clear Task Set : id=%d", id);
5806 break;
5807 case MPI_EVENT_SAS_DEV_STAT_RC_QUERY_TASK_INTERNAL:
5808 snprintf(evStr, EVENT_DESCR_STR_SZ,
5809 "SAS Device Status Change: Internal Query Task : id=%d", id);
5782 break; 5810 break;
5783 default: 5811 default:
5784 snprintf(evStr, EVENT_DESCR_STR_SZ, 5812 snprintf(evStr, EVENT_DESCR_STR_SZ,
@@ -6034,7 +6062,7 @@ ProcessEventNotification(MPT_ADAPTER *ioc, EventNotificationReply_t *pEventReply
6034 * @ioc: Pointer to MPT_ADAPTER structure 6062 * @ioc: Pointer to MPT_ADAPTER structure
6035 * @log_info: U32 LogInfo reply word from the IOC 6063 * @log_info: U32 LogInfo reply word from the IOC
6036 * 6064 *
6037 * Refer to lsi/fc_log.h. 6065 * Refer to lsi/mpi_log_fc.h.
6038 */ 6066 */
6039static void 6067static void
6040mpt_fc_log_info(MPT_ADAPTER *ioc, u32 log_info) 6068mpt_fc_log_info(MPT_ADAPTER *ioc, u32 log_info)
@@ -6131,8 +6159,10 @@ mpt_spi_log_info(MPT_ADAPTER *ioc, u32 log_info)
6131 "Invalid SAS Address", /* 01h */ 6159 "Invalid SAS Address", /* 01h */
6132 NULL, /* 02h */ 6160 NULL, /* 02h */
6133 "Invalid Page", /* 03h */ 6161 "Invalid Page", /* 03h */
6134 NULL, /* 04h */ 6162 "Diag Message Error", /* 04h */
6135 "Task Terminated" /* 05h */ 6163 "Task Terminated", /* 05h */
6164 "Enclosure Management", /* 06h */
6165 "Target Mode" /* 07h */
6136 }; 6166 };
6137 static char *pl_code_str[] = { 6167 static char *pl_code_str[] = {
6138 NULL, /* 00h */ 6168 NULL, /* 00h */
@@ -6158,7 +6188,7 @@ mpt_spi_log_info(MPT_ADAPTER *ioc, u32 log_info)
6158 "IO Executed", /* 14h */ 6188 "IO Executed", /* 14h */
6159 "Persistant Reservation Out Not Affiliation Owner", /* 15h */ 6189 "Persistant Reservation Out Not Affiliation Owner", /* 15h */
6160 "Open Transmit DMA Abort", /* 16h */ 6190 "Open Transmit DMA Abort", /* 16h */
6161 NULL, /* 17h */ 6191 "IO Device Missing Delay Retry", /* 17h */
6162 NULL, /* 18h */ 6192 NULL, /* 18h */
6163 NULL, /* 19h */ 6193 NULL, /* 19h */
6164 NULL, /* 1Ah */ 6194 NULL, /* 1Ah */
@@ -6238,7 +6268,7 @@ static void
6238mpt_sp_ioc_info(MPT_ADAPTER *ioc, u32 ioc_status, MPT_FRAME_HDR *mf) 6268mpt_sp_ioc_info(MPT_ADAPTER *ioc, u32 ioc_status, MPT_FRAME_HDR *mf)
6239{ 6269{
6240 u32 status = ioc_status & MPI_IOCSTATUS_MASK; 6270 u32 status = ioc_status & MPI_IOCSTATUS_MASK;
6241 char *desc = ""; 6271 char *desc = NULL;
6242 6272
6243 switch (status) { 6273 switch (status) {
6244 case MPI_IOCSTATUS_INVALID_FUNCTION: /* 0x0001 */ 6274 case MPI_IOCSTATUS_INVALID_FUNCTION: /* 0x0001 */
@@ -6348,7 +6378,7 @@ mpt_sp_ioc_info(MPT_ADAPTER *ioc, u32 ioc_status, MPT_FRAME_HDR *mf)
6348 desc = "Others"; 6378 desc = "Others";
6349 break; 6379 break;
6350 } 6380 }
6351 if (desc != "") 6381 if (desc != NULL)
6352 printk(MYIOC_s_INFO_FMT "IOCStatus(0x%04x): %s\n", ioc->name, status, desc); 6382 printk(MYIOC_s_INFO_FMT "IOCStatus(0x%04x): %s\n", ioc->name, status, desc);
6353} 6383}
6354 6384
@@ -6386,7 +6416,6 @@ EXPORT_SYMBOL(mpt_alloc_fw_memory);
6386EXPORT_SYMBOL(mpt_free_fw_memory); 6416EXPORT_SYMBOL(mpt_free_fw_memory);
6387EXPORT_SYMBOL(mptbase_sas_persist_operation); 6417EXPORT_SYMBOL(mptbase_sas_persist_operation);
6388 6418
6389
6390/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 6419/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
6391/* 6420/*
6392 * fusion_init - Fusion MPT base driver initialization routine. 6421 * fusion_init - Fusion MPT base driver initialization routine.
diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h
index a5ce10b67d02..d4cb144ab402 100644
--- a/drivers/message/fusion/mptbase.h
+++ b/drivers/message/fusion/mptbase.h
@@ -75,8 +75,8 @@
75#define COPYRIGHT "Copyright (c) 1999-2005 " MODULEAUTHOR 75#define COPYRIGHT "Copyright (c) 1999-2005 " MODULEAUTHOR
76#endif 76#endif
77 77
78#define MPT_LINUX_VERSION_COMMON "3.04.00" 78#define MPT_LINUX_VERSION_COMMON "3.04.01"
79#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.04.00" 79#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.04.01"
80#define WHAT_MAGIC_STRING "@" "(" "#" ")" 80#define WHAT_MAGIC_STRING "@" "(" "#" ")"
81 81
82#define show_mptmod_ver(s,ver) \ 82#define show_mptmod_ver(s,ver) \
@@ -307,8 +307,8 @@ typedef struct _SYSIF_REGS
307 u32 HostIndex; /* 50 Host Index register */ 307 u32 HostIndex; /* 50 Host Index register */
308 u32 Reserved4[15]; /* 54-8F */ 308 u32 Reserved4[15]; /* 54-8F */
309 u32 Fubar; /* 90 For Fubar usage */ 309 u32 Fubar; /* 90 For Fubar usage */
310 u32 Reserved5[1050];/* 94-10F8 */ 310 u32 Reserved5[1050];/* 94-10F8 */
311 u32 Reset_1078; /* 10FC Reset 1078 */ 311 u32 Reset_1078; /* 10FC Reset 1078 */
312} SYSIF_REGS; 312} SYSIF_REGS;
313 313
314/* 314/*
@@ -363,6 +363,7 @@ typedef struct _VirtDevice {
363#define MPT_TARGET_FLAGS_VALID_56 0x10 363#define MPT_TARGET_FLAGS_VALID_56 0x10
364#define MPT_TARGET_FLAGS_SAF_TE_ISSUED 0x20 364#define MPT_TARGET_FLAGS_SAF_TE_ISSUED 0x20
365#define MPT_TARGET_FLAGS_RAID_COMPONENT 0x40 365#define MPT_TARGET_FLAGS_RAID_COMPONENT 0x40
366#define MPT_TARGET_FLAGS_LED_ON 0x80
366 367
367/* 368/*
368 * /proc/mpt interface 369 * /proc/mpt interface
@@ -634,7 +635,6 @@ typedef struct _MPT_ADAPTER
634 u16 handle; 635 u16 handle;
635 int sas_index; /* index refrencing */ 636 int sas_index; /* index refrencing */
636 MPT_SAS_MGMT sas_mgmt; 637 MPT_SAS_MGMT sas_mgmt;
637 int num_ports;
638 struct work_struct sas_persist_task; 638 struct work_struct sas_persist_task;
639 639
640 struct work_struct fc_setup_reset_work; 640 struct work_struct fc_setup_reset_work;
@@ -644,7 +644,6 @@ typedef struct _MPT_ADAPTER
644 struct work_struct fc_rescan_work; 644 struct work_struct fc_rescan_work;
645 char fc_rescan_work_q_name[KOBJ_NAME_LEN]; 645 char fc_rescan_work_q_name[KOBJ_NAME_LEN];
646 struct workqueue_struct *fc_rescan_work_q; 646 struct workqueue_struct *fc_rescan_work_q;
647 u8 port_serial_number;
648} MPT_ADAPTER; 647} MPT_ADAPTER;
649 648
650/* 649/*
@@ -982,7 +981,7 @@ typedef struct _MPT_SCSI_HOST {
982 wait_queue_head_t scandv_waitq; 981 wait_queue_head_t scandv_waitq;
983 int scandv_wait_done; 982 int scandv_wait_done;
984 long last_queue_full; 983 long last_queue_full;
985 u8 mpt_pq_filter; 984 u16 tm_iocstatus;
986} MPT_SCSI_HOST; 985} MPT_SCSI_HOST;
987 986
988/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 987/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
diff --git a/drivers/message/fusion/mptctl.c b/drivers/message/fusion/mptctl.c
index b4967bb8a7d6..30975ccd9947 100644
--- a/drivers/message/fusion/mptctl.c
+++ b/drivers/message/fusion/mptctl.c
@@ -2332,7 +2332,7 @@ done_free_mem:
2332} 2332}
2333 2333
2334/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 2334/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
2335/* Prototype Routine for the HP HOST INFO command. 2335/* Prototype Routine for the HOST INFO command.
2336 * 2336 *
2337 * Outputs: None. 2337 * Outputs: None.
2338 * Return: 0 if successful 2338 * Return: 0 if successful
@@ -2568,7 +2568,7 @@ mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size)
2568} 2568}
2569 2569
2570/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 2570/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
2571/* Prototype Routine for the HP TARGET INFO command. 2571/* Prototype Routine for the TARGET INFO command.
2572 * 2572 *
2573 * Outputs: None. 2573 * Outputs: None.
2574 * Return: 0 if successful 2574 * Return: 0 if successful
diff --git a/drivers/message/fusion/mptctl.h b/drivers/message/fusion/mptctl.h
index a2f8a97992e6..043941882c6e 100644
--- a/drivers/message/fusion/mptctl.h
+++ b/drivers/message/fusion/mptctl.h
@@ -354,9 +354,6 @@ struct mpt_ioctl_command32 {
354 354
355 355
356/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 356/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
357/*
358 * HP Specific IOCTL Defines and Structures
359 */
360 357
361#define CPQFCTS_IOC_MAGIC 'Z' 358#define CPQFCTS_IOC_MAGIC 'Z'
362#define HP_IOC_MAGIC 'Z' 359#define HP_IOC_MAGIC 'Z'
@@ -364,8 +361,6 @@ struct mpt_ioctl_command32 {
364#define HP_GETHOSTINFO1 _IOR(HP_IOC_MAGIC, 20, hp_host_info_rev0_t) 361#define HP_GETHOSTINFO1 _IOR(HP_IOC_MAGIC, 20, hp_host_info_rev0_t)
365#define HP_GETTARGETINFO _IOR(HP_IOC_MAGIC, 21, hp_target_info_t) 362#define HP_GETTARGETINFO _IOR(HP_IOC_MAGIC, 21, hp_target_info_t)
366 363
367/* All HP IOCTLs must include this header
368 */
369typedef struct _hp_header { 364typedef struct _hp_header {
370 unsigned int iocnum; 365 unsigned int iocnum;
371 unsigned int host; 366 unsigned int host;
diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c
index a8f2fa985455..90da7d63b08e 100644
--- a/drivers/message/fusion/mptfc.c
+++ b/drivers/message/fusion/mptfc.c
@@ -77,10 +77,6 @@ MODULE_DESCRIPTION(my_NAME);
77MODULE_LICENSE("GPL"); 77MODULE_LICENSE("GPL");
78 78
79/* Command line args */ 79/* Command line args */
80static int mpt_pq_filter = 0;
81module_param(mpt_pq_filter, int, 0);
82MODULE_PARM_DESC(mpt_pq_filter, " Enable peripheral qualifier filter: enable=1 (default=0)");
83
84#define MPTFC_DEV_LOSS_TMO (60) 80#define MPTFC_DEV_LOSS_TMO (60)
85static int mptfc_dev_loss_tmo = MPTFC_DEV_LOSS_TMO; /* reasonable default */ 81static int mptfc_dev_loss_tmo = MPTFC_DEV_LOSS_TMO; /* reasonable default */
86module_param(mptfc_dev_loss_tmo, int, 0); 82module_param(mptfc_dev_loss_tmo, int, 0);
@@ -513,8 +509,7 @@ mptfc_slave_alloc(struct scsi_device *sdev)
513 509
514 if (vtarget->num_luns == 0) { 510 if (vtarget->num_luns == 0) {
515 vtarget->ioc_id = hd->ioc->id; 511 vtarget->ioc_id = hd->ioc->id;
516 vtarget->tflags = MPT_TARGET_FLAGS_Q_YES | 512 vtarget->tflags = MPT_TARGET_FLAGS_Q_YES;
517 MPT_TARGET_FLAGS_VALID_INQUIRY;
518 hd->Targets[sdev->id] = vtarget; 513 hd->Targets[sdev->id] = vtarget;
519 } 514 }
520 515
@@ -1129,13 +1124,6 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1129 hd->timer.data = (unsigned long) hd; 1124 hd->timer.data = (unsigned long) hd;
1130 hd->timer.function = mptscsih_timer_expired; 1125 hd->timer.function = mptscsih_timer_expired;
1131 1126
1132 hd->mpt_pq_filter = mpt_pq_filter;
1133
1134 ddvprintk((MYIOC_s_INFO_FMT
1135 "mpt_pq_filter %x\n",
1136 ioc->name,
1137 mpt_pq_filter));
1138
1139 init_waitqueue_head(&hd->scandv_waitq); 1127 init_waitqueue_head(&hd->scandv_waitq);
1140 hd->scandv_wait_done = 0; 1128 hd->scandv_wait_done = 0;
1141 hd->last_queue_full = 0; 1129 hd->last_queue_full = 0;
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
index f7bd8b11ed3b..f66f2203143a 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -67,20 +67,19 @@
67#define my_VERSION MPT_LINUX_VERSION_COMMON 67#define my_VERSION MPT_LINUX_VERSION_COMMON
68#define MYNAM "mptsas" 68#define MYNAM "mptsas"
69 69
70/*
71 * Reserved channel for integrated raid
72 */
73#define MPTSAS_RAID_CHANNEL 1
74
70MODULE_AUTHOR(MODULEAUTHOR); 75MODULE_AUTHOR(MODULEAUTHOR);
71MODULE_DESCRIPTION(my_NAME); 76MODULE_DESCRIPTION(my_NAME);
72MODULE_LICENSE("GPL"); 77MODULE_LICENSE("GPL");
73 78
74static int mpt_pq_filter;
75module_param(mpt_pq_filter, int, 0);
76MODULE_PARM_DESC(mpt_pq_filter,
77 "Enable peripheral qualifier filter: enable=1 "
78 "(default=0)");
79
80static int mpt_pt_clear; 79static int mpt_pt_clear;
81module_param(mpt_pt_clear, int, 0); 80module_param(mpt_pt_clear, int, 0);
82MODULE_PARM_DESC(mpt_pt_clear, 81MODULE_PARM_DESC(mpt_pt_clear,
83 "Clear persistency table: enable=1 " 82 " Clear persistency table: enable=1 "
84 "(default=MPTSCSIH_PT_CLEAR=0)"); 83 "(default=MPTSCSIH_PT_CLEAR=0)");
85 84
86static int mptsasDoneCtx = -1; 85static int mptsasDoneCtx = -1;
@@ -144,7 +143,6 @@ struct mptsas_devinfo {
144 * Specific details on ports, wide/narrow 143 * Specific details on ports, wide/narrow
145 */ 144 */
146struct mptsas_portinfo_details{ 145struct mptsas_portinfo_details{
147 u8 port_id; /* port number provided to transport */
148 u16 num_phys; /* number of phys belong to this port */ 146 u16 num_phys; /* number of phys belong to this port */
149 u64 phy_bitmask; /* TODO, extend support for 255 phys */ 147 u64 phy_bitmask; /* TODO, extend support for 255 phys */
150 struct sas_rphy *rphy; /* transport layer rphy object */ 148 struct sas_rphy *rphy; /* transport layer rphy object */
@@ -350,10 +348,10 @@ mptsas_port_delete(struct mptsas_portinfo_details * port_details)
350 port_info = port_details->port_info; 348 port_info = port_details->port_info;
351 phy_info = port_info->phy_info; 349 phy_info = port_info->phy_info;
352 350
353 dsaswideprintk((KERN_DEBUG "%s: [%p]: port=%02d num_phys=%02d " 351 dsaswideprintk((KERN_DEBUG "%s: [%p]: num_phys=%02d "
354 "bitmask=0x%016llX\n", 352 "bitmask=0x%016llX\n",
355 __FUNCTION__, port_details, port_details->port_id, 353 __FUNCTION__, port_details, port_details->num_phys,
356 port_details->num_phys, port_details->phy_bitmask)); 354 port_details->phy_bitmask));
357 355
358 for (i = 0; i < port_info->num_phys; i++, phy_info++) { 356 for (i = 0; i < port_info->num_phys; i++, phy_info++) {
359 if(phy_info->port_details != port_details) 357 if(phy_info->port_details != port_details)
@@ -462,9 +460,8 @@ mptsas_setup_wide_ports(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info)
462 * phy be removed by firmware events. 460 * phy be removed by firmware events.
463 */ 461 */
464 dsaswideprintk((KERN_DEBUG 462 dsaswideprintk((KERN_DEBUG
465 "%s: [%p]: port=%d deleting phy = %d\n", 463 "%s: [%p]: deleting phy = %d\n",
466 __FUNCTION__, port_details, 464 __FUNCTION__, port_details, i));
467 port_details->port_id, i));
468 port_details->num_phys--; 465 port_details->num_phys--;
469 port_details->phy_bitmask &= ~ (1 << phy_info->phy_id); 466 port_details->phy_bitmask &= ~ (1 << phy_info->phy_id);
470 memset(&phy_info->attached, 0, sizeof(struct mptsas_devinfo)); 467 memset(&phy_info->attached, 0, sizeof(struct mptsas_devinfo));
@@ -493,7 +490,6 @@ mptsas_setup_wide_ports(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info)
493 goto out; 490 goto out;
494 port_details->num_phys = 1; 491 port_details->num_phys = 1;
495 port_details->port_info = port_info; 492 port_details->port_info = port_info;
496 port_details->port_id = ioc->port_serial_number++;
497 if (phy_info->phy_id < 64 ) 493 if (phy_info->phy_id < 64 )
498 port_details->phy_bitmask |= 494 port_details->phy_bitmask |=
499 (1 << phy_info->phy_id); 495 (1 << phy_info->phy_id);
@@ -525,12 +521,8 @@ mptsas_setup_wide_ports(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info)
525 mptsas_get_port(phy_info_cmp); 521 mptsas_get_port(phy_info_cmp);
526 port_details->starget = 522 port_details->starget =
527 mptsas_get_starget(phy_info_cmp); 523 mptsas_get_starget(phy_info_cmp);
528 port_details->port_id =
529 phy_info_cmp->port_details->port_id;
530 port_details->num_phys = 524 port_details->num_phys =
531 phy_info_cmp->port_details->num_phys; 525 phy_info_cmp->port_details->num_phys;
532// port_info->port_serial_number--;
533 ioc->port_serial_number--;
534 if (!phy_info_cmp->port_details->num_phys) 526 if (!phy_info_cmp->port_details->num_phys)
535 kfree(phy_info_cmp->port_details); 527 kfree(phy_info_cmp->port_details);
536 } else 528 } else
@@ -554,11 +546,11 @@ mptsas_setup_wide_ports(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info)
554 if (!port_details) 546 if (!port_details)
555 continue; 547 continue;
556 dsaswideprintk((KERN_DEBUG 548 dsaswideprintk((KERN_DEBUG
557 "%s: [%p]: phy_id=%02d port_id=%02d num_phys=%02d " 549 "%s: [%p]: phy_id=%02d num_phys=%02d "
558 "bitmask=0x%016llX\n", 550 "bitmask=0x%016llX\n",
559 __FUNCTION__, 551 __FUNCTION__,
560 port_details, i, port_details->port_id, 552 port_details, i, port_details->num_phys,
561 port_details->num_phys, port_details->phy_bitmask)); 553 port_details->phy_bitmask));
562 dsaswideprintk((KERN_DEBUG"\t\tport = %p rphy=%p\n", 554 dsaswideprintk((KERN_DEBUG"\t\tport = %p rphy=%p\n",
563 port_details->port, port_details->rphy)); 555 port_details->port, port_details->rphy));
564 } 556 }
@@ -651,16 +643,13 @@ mptsas_sas_enclosure_pg0(MPT_ADAPTER *ioc, struct mptsas_enclosure *enclosure,
651static int 643static int
652mptsas_slave_configure(struct scsi_device *sdev) 644mptsas_slave_configure(struct scsi_device *sdev)
653{ 645{
654 struct Scsi_Host *host = sdev->host;
655 MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)host->hostdata;
656 646
657 /* 647 if (sdev->channel == MPTSAS_RAID_CHANNEL)
658 * RAID volumes placed beyond the last expected port. 648 goto out;
659 * Ignore sending sas mode pages in that case.. 649
660 */ 650 sas_read_port_mode_page(sdev);
661 if (sdev->channel < hd->ioc->num_ports)
662 sas_read_port_mode_page(sdev);
663 651
652 out:
664 return mptscsih_slave_configure(sdev); 653 return mptscsih_slave_configure(sdev);
665} 654}
666 655
@@ -689,10 +678,7 @@ mptsas_target_alloc(struct scsi_target *starget)
689 678
690 hd->Targets[target_id] = vtarget; 679 hd->Targets[target_id] = vtarget;
691 680
692 /* 681 if (starget->channel == MPTSAS_RAID_CHANNEL)
693 * RAID volumes placed beyond the last expected port.
694 */
695 if (starget->channel == hd->ioc->num_ports)
696 goto out; 682 goto out;
697 683
698 rphy = dev_to_rphy(starget->dev.parent); 684 rphy = dev_to_rphy(starget->dev.parent);
@@ -743,7 +729,7 @@ mptsas_target_destroy(struct scsi_target *starget)
743 if (!starget->hostdata) 729 if (!starget->hostdata)
744 return; 730 return;
745 731
746 if (starget->channel == hd->ioc->num_ports) 732 if (starget->channel == MPTSAS_RAID_CHANNEL)
747 goto out; 733 goto out;
748 734
749 rphy = dev_to_rphy(starget->dev.parent); 735 rphy = dev_to_rphy(starget->dev.parent);
@@ -783,10 +769,7 @@ mptsas_slave_alloc(struct scsi_device *sdev)
783 starget = scsi_target(sdev); 769 starget = scsi_target(sdev);
784 vdev->vtarget = starget->hostdata; 770 vdev->vtarget = starget->hostdata;
785 771
786 /* 772 if (sdev->channel == MPTSAS_RAID_CHANNEL)
787 * RAID volumes placed beyond the last expected port.
788 */
789 if (sdev->channel == hd->ioc->num_ports)
790 goto out; 773 goto out;
791 774
792 rphy = dev_to_rphy(sdev->sdev_target->dev.parent); 775 rphy = dev_to_rphy(sdev->sdev_target->dev.parent);
@@ -1608,11 +1591,7 @@ static int mptsas_probe_one_phy(struct device *dev,
1608 if (phy_info->sas_port_add_phy) { 1591 if (phy_info->sas_port_add_phy) {
1609 1592
1610 if (!port) { 1593 if (!port) {
1611 port = sas_port_alloc(dev, 1594 port = sas_port_alloc_num(dev);
1612 phy_info->port_details->port_id);
1613 dsaswideprintk((KERN_DEBUG
1614 "sas_port_alloc: port=%p dev=%p port_id=%d\n",
1615 port, dev, phy_info->port_details->port_id));
1616 if (!port) { 1595 if (!port) {
1617 error = -ENOMEM; 1596 error = -ENOMEM;
1618 goto out; 1597 goto out;
@@ -1625,6 +1604,9 @@ static int mptsas_probe_one_phy(struct device *dev,
1625 goto out; 1604 goto out;
1626 } 1605 }
1627 mptsas_set_port(phy_info, port); 1606 mptsas_set_port(phy_info, port);
1607 dsaswideprintk((KERN_DEBUG
1608 "sas_port_alloc: port=%p dev=%p port_id=%d\n",
1609 port, dev, port->port_identifier));
1628 } 1610 }
1629 dsaswideprintk((KERN_DEBUG "sas_port_add_phy: phy_id=%d\n", 1611 dsaswideprintk((KERN_DEBUG "sas_port_add_phy: phy_id=%d\n",
1630 phy_info->phy_id)); 1612 phy_info->phy_id));
@@ -1736,7 +1718,6 @@ mptsas_probe_hba_phys(MPT_ADAPTER *ioc)
1736 hba = NULL; 1718 hba = NULL;
1737 } 1719 }
1738 mutex_unlock(&ioc->sas_topology_mutex); 1720 mutex_unlock(&ioc->sas_topology_mutex);
1739 ioc->num_ports = port_info->num_phys;
1740 1721
1741 for (i = 0; i < port_info->num_phys; i++) { 1722 for (i = 0; i < port_info->num_phys; i++) {
1742 mptsas_sas_phy_pg0(ioc, &port_info->phy_info[i], 1723 mptsas_sas_phy_pg0(ioc, &port_info->phy_info[i],
@@ -1939,7 +1920,8 @@ mptsas_delete_expander_phys(MPT_ADAPTER *ioc)
1939 expander_sas_address) 1920 expander_sas_address)
1940 continue; 1921 continue;
1941#ifdef MPT_DEBUG_SAS_WIDE 1922#ifdef MPT_DEBUG_SAS_WIDE
1942 dev_printk(KERN_DEBUG, &port->dev, "delete\n"); 1923 dev_printk(KERN_DEBUG, &port->dev,
1924 "delete port (%d)\n", port->port_identifier);
1943#endif 1925#endif
1944 sas_port_delete(port); 1926 sas_port_delete(port);
1945 mptsas_port_delete(phy_info->port_details); 1927 mptsas_port_delete(phy_info->port_details);
@@ -1984,7 +1966,7 @@ mptsas_scan_sas_topology(MPT_ADAPTER *ioc)
1984 if (!ioc->raid_data.pIocPg2->NumActiveVolumes) 1966 if (!ioc->raid_data.pIocPg2->NumActiveVolumes)
1985 goto out; 1967 goto out;
1986 for (i=0; i<ioc->raid_data.pIocPg2->NumActiveVolumes; i++) { 1968 for (i=0; i<ioc->raid_data.pIocPg2->NumActiveVolumes; i++) {
1987 scsi_add_device(ioc->sh, ioc->num_ports, 1969 scsi_add_device(ioc->sh, MPTSAS_RAID_CHANNEL,
1988 ioc->raid_data.pIocPg2->RaidVolume[i].VolumeID, 0); 1970 ioc->raid_data.pIocPg2->RaidVolume[i].VolumeID, 0);
1989 } 1971 }
1990 out: 1972 out:
@@ -2185,7 +2167,8 @@ mptsas_hotplug_work(void *arg)
2185 ioc->name, ds, ev->channel, ev->id, phy_info->phy_id); 2167 ioc->name, ds, ev->channel, ev->id, phy_info->phy_id);
2186 2168
2187#ifdef MPT_DEBUG_SAS_WIDE 2169#ifdef MPT_DEBUG_SAS_WIDE
2188 dev_printk(KERN_DEBUG, &port->dev, "delete\n"); 2170 dev_printk(KERN_DEBUG, &port->dev,
2171 "delete port (%d)\n", port->port_identifier);
2189#endif 2172#endif
2190 sas_port_delete(port); 2173 sas_port_delete(port);
2191 mptsas_port_delete(phy_info->port_details); 2174 mptsas_port_delete(phy_info->port_details);
@@ -2289,35 +2272,26 @@ mptsas_hotplug_work(void *arg)
2289 mptsas_set_rphy(phy_info, rphy); 2272 mptsas_set_rphy(phy_info, rphy);
2290 break; 2273 break;
2291 case MPTSAS_ADD_RAID: 2274 case MPTSAS_ADD_RAID:
2292 sdev = scsi_device_lookup( 2275 sdev = scsi_device_lookup(ioc->sh, MPTSAS_RAID_CHANNEL,
2293 ioc->sh, 2276 ev->id, 0);
2294 ioc->num_ports,
2295 ev->id,
2296 0);
2297 if (sdev) { 2277 if (sdev) {
2298 scsi_device_put(sdev); 2278 scsi_device_put(sdev);
2299 break; 2279 break;
2300 } 2280 }
2301 printk(MYIOC_s_INFO_FMT 2281 printk(MYIOC_s_INFO_FMT
2302 "attaching raid volume, channel %d, id %d\n", 2282 "attaching raid volume, channel %d, id %d\n",
2303 ioc->name, ioc->num_ports, ev->id); 2283 ioc->name, MPTSAS_RAID_CHANNEL, ev->id);
2304 scsi_add_device(ioc->sh, 2284 scsi_add_device(ioc->sh, MPTSAS_RAID_CHANNEL, ev->id, 0);
2305 ioc->num_ports,
2306 ev->id,
2307 0);
2308 mpt_findImVolumes(ioc); 2285 mpt_findImVolumes(ioc);
2309 break; 2286 break;
2310 case MPTSAS_DEL_RAID: 2287 case MPTSAS_DEL_RAID:
2311 sdev = scsi_device_lookup( 2288 sdev = scsi_device_lookup(ioc->sh, MPTSAS_RAID_CHANNEL,
2312 ioc->sh, 2289 ev->id, 0);
2313 ioc->num_ports,
2314 ev->id,
2315 0);
2316 if (!sdev) 2290 if (!sdev)
2317 break; 2291 break;
2318 printk(MYIOC_s_INFO_FMT 2292 printk(MYIOC_s_INFO_FMT
2319 "removing raid volume, channel %d, id %d\n", 2293 "removing raid volume, channel %d, id %d\n",
2320 ioc->name, ioc->num_ports, ev->id); 2294 ioc->name, MPTSAS_RAID_CHANNEL, ev->id);
2321 vdevice = sdev->hostdata; 2295 vdevice = sdev->hostdata;
2322 vdevice->vtarget->deleted = 1; 2296 vdevice->vtarget->deleted = 1;
2323 mptsas_target_reset(ioc, vdevice->vtarget); 2297 mptsas_target_reset(ioc, vdevice->vtarget);
@@ -2723,7 +2697,6 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id)
2723 hd->timer.data = (unsigned long) hd; 2697 hd->timer.data = (unsigned long) hd;
2724 hd->timer.function = mptscsih_timer_expired; 2698 hd->timer.function = mptscsih_timer_expired;
2725 2699
2726 hd->mpt_pq_filter = mpt_pq_filter;
2727 ioc->sas_data.ptClear = mpt_pt_clear; 2700 ioc->sas_data.ptClear = mpt_pt_clear;
2728 2701
2729 if (ioc->sas_data.ptClear==1) { 2702 if (ioc->sas_data.ptClear==1) {
@@ -2731,12 +2704,6 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id)
2731 ioc, MPI_SAS_OP_CLEAR_ALL_PERSISTENT); 2704 ioc, MPI_SAS_OP_CLEAR_ALL_PERSISTENT);
2732 } 2705 }
2733 2706
2734 ddvprintk((MYIOC_s_INFO_FMT
2735 "mpt_pq_filter %x mpt_pq_filter %x\n",
2736 ioc->name,
2737 mpt_pq_filter,
2738 mpt_pq_filter));
2739
2740 init_waitqueue_head(&hd->scandv_waitq); 2707 init_waitqueue_head(&hd->scandv_waitq);
2741 hd->scandv_wait_done = 0; 2708 hd->scandv_wait_done = 0;
2742 hd->last_queue_full = 0; 2709 hd->last_queue_full = 0;
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c
index 8242b16e3168..30524dc54b16 100644
--- a/drivers/message/fusion/mptscsih.c
+++ b/drivers/message/fusion/mptscsih.c
@@ -66,6 +66,7 @@
66 66
67#include "mptbase.h" 67#include "mptbase.h"
68#include "mptscsih.h" 68#include "mptscsih.h"
69#include "lsi/mpi_log_sas.h"
69 70
70/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 71/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
71#define my_NAME "Fusion MPT SCSI Host driver" 72#define my_NAME "Fusion MPT SCSI Host driver"
@@ -127,7 +128,7 @@ static void mptscsih_freeChainBuffers(MPT_ADAPTER *ioc, int req_idx);
127static void mptscsih_copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR *mf, SCSIIOReply_t *pScsiReply); 128static void mptscsih_copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR *mf, SCSIIOReply_t *pScsiReply);
128static int mptscsih_tm_pending_wait(MPT_SCSI_HOST * hd); 129static int mptscsih_tm_pending_wait(MPT_SCSI_HOST * hd);
129static int mptscsih_tm_wait_for_completion(MPT_SCSI_HOST * hd, ulong timeout ); 130static int mptscsih_tm_wait_for_completion(MPT_SCSI_HOST * hd, ulong timeout );
130static u32 SCPNT_TO_LOOKUP_IDX(struct scsi_cmnd *sc); 131static int SCPNT_TO_LOOKUP_IDX(struct scsi_cmnd *sc);
131 132
132static int mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 target, u8 lun, int ctx2abort, ulong timeout); 133static int mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 target, u8 lun, int ctx2abort, ulong timeout);
133 134
@@ -497,6 +498,34 @@ nextSGEset:
497 return SUCCESS; 498 return SUCCESS;
498} /* mptscsih_AddSGE() */ 499} /* mptscsih_AddSGE() */
499 500
501static void
502mptscsih_issue_sep_command(MPT_ADAPTER *ioc, VirtTarget *vtarget,
503 U32 SlotStatus)
504{
505 MPT_FRAME_HDR *mf;
506 SEPRequest_t *SEPMsg;
507
508 if (ioc->bus_type == FC)
509 return;
510
511 if ((mf = mpt_get_msg_frame(ioc->InternalCtx, ioc)) == NULL) {
512 dfailprintk((MYIOC_s_WARN_FMT "%s: no msg frames!!\n",
513 ioc->name,__FUNCTION__));
514 return;
515 }
516
517 SEPMsg = (SEPRequest_t *)mf;
518 SEPMsg->Function = MPI_FUNCTION_SCSI_ENCLOSURE_PROCESSOR;
519 SEPMsg->Bus = vtarget->bus_id;
520 SEPMsg->TargetID = vtarget->target_id;
521 SEPMsg->Action = MPI_SEP_REQ_ACTION_WRITE_STATUS;
522 SEPMsg->SlotStatus = SlotStatus;
523 devtverboseprintk((MYIOC_s_WARN_FMT
524 "Sending SEP cmd=%x id=%d bus=%d\n",
525 ioc->name, SlotStatus, SEPMsg->TargetID, SEPMsg->Bus));
526 mpt_put_msg_frame(ioc->DoneCtx, ioc, mf);
527}
528
500/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 529/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
501/* 530/*
502 * mptscsih_io_done - Main SCSI IO callback routine registered to 531 * mptscsih_io_done - Main SCSI IO callback routine registered to
@@ -520,6 +549,8 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
520 SCSIIORequest_t *pScsiReq; 549 SCSIIORequest_t *pScsiReq;
521 SCSIIOReply_t *pScsiReply; 550 SCSIIOReply_t *pScsiReply;
522 u16 req_idx, req_idx_MR; 551 u16 req_idx, req_idx_MR;
552 VirtDevice *vdev;
553 VirtTarget *vtarget;
523 554
524 hd = (MPT_SCSI_HOST *) ioc->sh->hostdata; 555 hd = (MPT_SCSI_HOST *) ioc->sh->hostdata;
525 556
@@ -538,6 +569,7 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
538 } 569 }
539 570
540 sc = hd->ScsiLookup[req_idx]; 571 sc = hd->ScsiLookup[req_idx];
572 hd->ScsiLookup[req_idx] = NULL;
541 if (sc == NULL) { 573 if (sc == NULL) {
542 MPIHeader_t *hdr = (MPIHeader_t *)mf; 574 MPIHeader_t *hdr = (MPIHeader_t *)mf;
543 575
@@ -553,6 +585,12 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
553 return 1; 585 return 1;
554 } 586 }
555 587
588 if ((unsigned char *)mf != sc->host_scribble) {
589 mptscsih_freeChainBuffers(ioc, req_idx);
590 return 1;
591 }
592
593 sc->host_scribble = NULL;
556 sc->result = DID_OK << 16; /* Set default reply as OK */ 594 sc->result = DID_OK << 16; /* Set default reply as OK */
557 pScsiReq = (SCSIIORequest_t *) mf; 595 pScsiReq = (SCSIIORequest_t *) mf;
558 pScsiReply = (SCSIIOReply_t *) mr; 596 pScsiReply = (SCSIIOReply_t *) mr;
@@ -640,10 +678,36 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
640 678
641 if (hd->sel_timeout[pScsiReq->TargetID] < 0xFFFF) 679 if (hd->sel_timeout[pScsiReq->TargetID] < 0xFFFF)
642 hd->sel_timeout[pScsiReq->TargetID]++; 680 hd->sel_timeout[pScsiReq->TargetID]++;
681
682 vdev = sc->device->hostdata;
683 if (!vdev)
684 break;
685 vtarget = vdev->vtarget;
686 if (vtarget->tflags & MPT_TARGET_FLAGS_LED_ON) {
687 mptscsih_issue_sep_command(ioc, vtarget,
688 MPI_SEP_REQ_SLOTSTATUS_UNCONFIGURED);
689 vtarget->tflags &= ~MPT_TARGET_FLAGS_LED_ON;
690 }
643 break; 691 break;
644 692
645 case MPI_IOCSTATUS_SCSI_TASK_TERMINATED: /* 0x0048 */
646 case MPI_IOCSTATUS_SCSI_IOC_TERMINATED: /* 0x004B */ 693 case MPI_IOCSTATUS_SCSI_IOC_TERMINATED: /* 0x004B */
694 if ( ioc->bus_type == SAS ) {
695 u16 ioc_status = le16_to_cpu(pScsiReply->IOCStatus);
696 if (ioc_status & MPI_IOCSTATUS_FLAG_LOG_INFO_AVAILABLE) {
697 u32 log_info = le32_to_cpu(mr->u.reply.IOCLogInfo);
698 log_info &=SAS_LOGINFO_MASK;
699 if (log_info == SAS_LOGINFO_NEXUS_LOSS) {
700 sc->result = (DID_BUS_BUSY << 16);
701 break;
702 }
703 }
704 }
705
706 /*
707 * Allow non-SAS & non-NEXUS_LOSS to drop into below code
708 */
709
710 case MPI_IOCSTATUS_SCSI_TASK_TERMINATED: /* 0x0048 */
647 case MPI_IOCSTATUS_SCSI_EXT_TERMINATED: /* 0x004C */ 711 case MPI_IOCSTATUS_SCSI_EXT_TERMINATED: /* 0x004C */
648 /* Linux handles an unsolicited DID_RESET better 712 /* Linux handles an unsolicited DID_RESET better
649 * than an unsolicited DID_ABORT. 713 * than an unsolicited DID_ABORT.
@@ -658,7 +722,7 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
658 sc->result=DID_SOFT_ERROR << 16; 722 sc->result=DID_SOFT_ERROR << 16;
659 else /* Sufficient data transfer occurred */ 723 else /* Sufficient data transfer occurred */
660 sc->result = (DID_OK << 16) | scsi_status; 724 sc->result = (DID_OK << 16) | scsi_status;
661 dreplyprintk((KERN_NOTICE 725 dreplyprintk((KERN_NOTICE
662 "RESIDUAL_MISMATCH: result=%x on id=%d\n", sc->result, sc->device->id)); 726 "RESIDUAL_MISMATCH: result=%x on id=%d\n", sc->result, sc->device->id));
663 break; 727 break;
664 728
@@ -784,8 +848,6 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
784 sc->request_bufflen, sc->sc_data_direction); 848 sc->request_bufflen, sc->sc_data_direction);
785 } 849 }
786 850
787 hd->ScsiLookup[req_idx] = NULL;
788
789 sc->scsi_done(sc); /* Issue the command callback */ 851 sc->scsi_done(sc); /* Issue the command callback */
790 852
791 /* Free Chain buffers */ 853 /* Free Chain buffers */
@@ -827,9 +889,17 @@ mptscsih_flush_running_cmds(MPT_SCSI_HOST *hd)
827 dmfprintk(( "flush: ScsiDone (mf=%p,sc=%p)\n", 889 dmfprintk(( "flush: ScsiDone (mf=%p,sc=%p)\n",
828 mf, SCpnt)); 890 mf, SCpnt));
829 891
892 /* Free Chain buffers */
893 mptscsih_freeChainBuffers(ioc, ii);
894
895 /* Free Message frames */
896 mpt_free_msg_frame(ioc, mf);
897
898 if ((unsigned char *)mf != SCpnt->host_scribble)
899 continue;
900
830 /* Set status, free OS resources (SG DMA buffers) 901 /* Set status, free OS resources (SG DMA buffers)
831 * Do OS callback 902 * Do OS callback
832 * Free driver resources (chain, msg buffers)
833 */ 903 */
834 if (SCpnt->use_sg) { 904 if (SCpnt->use_sg) {
835 pci_unmap_sg(ioc->pcidev, 905 pci_unmap_sg(ioc->pcidev,
@@ -845,12 +915,6 @@ mptscsih_flush_running_cmds(MPT_SCSI_HOST *hd)
845 SCpnt->result = DID_RESET << 16; 915 SCpnt->result = DID_RESET << 16;
846 SCpnt->host_scribble = NULL; 916 SCpnt->host_scribble = NULL;
847 917
848 /* Free Chain buffers */
849 mptscsih_freeChainBuffers(ioc, ii);
850
851 /* Free Message frames */
852 mpt_free_msg_frame(ioc, mf);
853
854 SCpnt->scsi_done(SCpnt); /* Issue the command callback */ 918 SCpnt->scsi_done(SCpnt); /* Issue the command callback */
855 } 919 }
856 } 920 }
@@ -887,10 +951,10 @@ mptscsih_search_running_cmds(MPT_SCSI_HOST *hd, VirtDevice *vdevice)
887 if ((sc = hd->ScsiLookup[ii]) != NULL) { 951 if ((sc = hd->ScsiLookup[ii]) != NULL) {
888 952
889 mf = (SCSIIORequest_t *)MPT_INDEX_2_MFPTR(hd->ioc, ii); 953 mf = (SCSIIORequest_t *)MPT_INDEX_2_MFPTR(hd->ioc, ii);
890 954 if (mf == NULL)
955 continue;
891 dsprintk(( "search_running: found (sc=%p, mf = %p) target %d, lun %d \n", 956 dsprintk(( "search_running: found (sc=%p, mf = %p) target %d, lun %d \n",
892 hd->ScsiLookup[ii], mf, mf->TargetID, mf->LUN[1])); 957 hd->ScsiLookup[ii], mf, mf->TargetID, mf->LUN[1]));
893
894 if ((mf->TargetID != ((u8)vdevice->vtarget->target_id)) || (mf->LUN[1] != ((u8) vdevice->lun))) 958 if ((mf->TargetID != ((u8)vdevice->vtarget->target_id)) || (mf->LUN[1] != ((u8) vdevice->lun)))
895 continue; 959 continue;
896 960
@@ -899,6 +963,8 @@ mptscsih_search_running_cmds(MPT_SCSI_HOST *hd, VirtDevice *vdevice)
899 hd->ScsiLookup[ii] = NULL; 963 hd->ScsiLookup[ii] = NULL;
900 mptscsih_freeChainBuffers(hd->ioc, ii); 964 mptscsih_freeChainBuffers(hd->ioc, ii);
901 mpt_free_msg_frame(hd->ioc, (MPT_FRAME_HDR *)mf); 965 mpt_free_msg_frame(hd->ioc, (MPT_FRAME_HDR *)mf);
966 if ((unsigned char *)mf != sc->host_scribble)
967 continue;
902 if (sc->use_sg) { 968 if (sc->use_sg) {
903 pci_unmap_sg(hd->ioc->pcidev, 969 pci_unmap_sg(hd->ioc->pcidev,
904 (struct scatterlist *) sc->request_buffer, 970 (struct scatterlist *) sc->request_buffer,
@@ -1341,8 +1407,8 @@ mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
1341 goto fail; 1407 goto fail;
1342 } 1408 }
1343 1409
1410 SCpnt->host_scribble = (unsigned char *)mf;
1344 hd->ScsiLookup[my_idx] = SCpnt; 1411 hd->ScsiLookup[my_idx] = SCpnt;
1345 SCpnt->host_scribble = NULL;
1346 1412
1347 mpt_put_msg_frame(hd->ioc->DoneCtx, hd->ioc, mf); 1413 mpt_put_msg_frame(hd->ioc->DoneCtx, hd->ioc, mf);
1348 dmfprintk((MYIOC_s_INFO_FMT "Issued SCSI cmd (%p) mf=%p idx=%d\n", 1414 dmfprintk((MYIOC_s_INFO_FMT "Issued SCSI cmd (%p) mf=%p idx=%d\n",
@@ -1529,6 +1595,12 @@ mptscsih_TMHandler(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 target, u8 lun, in
1529 rc = mpt_HardResetHandler(hd->ioc, CAN_SLEEP); 1595 rc = mpt_HardResetHandler(hd->ioc, CAN_SLEEP);
1530 } 1596 }
1531 1597
1598 /*
1599 * Check IOCStatus from TM reply message
1600 */
1601 if (hd->tm_iocstatus != MPI_IOCSTATUS_SUCCESS)
1602 rc = FAILED;
1603
1532 dtmprintk((MYIOC_s_INFO_FMT "TMHandler rc = %d!\n", hd->ioc->name, rc)); 1604 dtmprintk((MYIOC_s_INFO_FMT "TMHandler rc = %d!\n", hd->ioc->name, rc));
1533 1605
1534 return rc; 1606 return rc;
@@ -1654,6 +1726,7 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)
1654 int scpnt_idx; 1726 int scpnt_idx;
1655 int retval; 1727 int retval;
1656 VirtDevice *vdev; 1728 VirtDevice *vdev;
1729 ulong sn = SCpnt->serial_number;
1657 1730
1658 /* If we can't locate our host adapter structure, return FAILED status. 1731 /* If we can't locate our host adapter structure, return FAILED status.
1659 */ 1732 */
@@ -1707,6 +1780,11 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)
1707 vdev->vtarget->bus_id, vdev->vtarget->target_id, vdev->lun, 1780 vdev->vtarget->bus_id, vdev->vtarget->target_id, vdev->lun,
1708 ctx2abort, mptscsih_get_tm_timeout(hd->ioc)); 1781 ctx2abort, mptscsih_get_tm_timeout(hd->ioc));
1709 1782
1783 if (SCPNT_TO_LOOKUP_IDX(SCpnt) == scpnt_idx &&
1784 SCpnt->serial_number == sn) {
1785 retval = FAILED;
1786 }
1787
1710 printk (KERN_WARNING MYNAM ": %s: task abort: %s (sc=%p)\n", 1788 printk (KERN_WARNING MYNAM ": %s: task abort: %s (sc=%p)\n",
1711 hd->ioc->name, 1789 hd->ioc->name,
1712 ((retval == 0) ? "SUCCESS" : "FAILED" ), SCpnt); 1790 ((retval == 0) ? "SUCCESS" : "FAILED" ), SCpnt);
@@ -2023,6 +2101,7 @@ mptscsih_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *m
2023 DBG_DUMP_TM_REPLY_FRAME((u32 *)pScsiTmReply); 2101 DBG_DUMP_TM_REPLY_FRAME((u32 *)pScsiTmReply);
2024 2102
2025 iocstatus = le16_to_cpu(pScsiTmReply->IOCStatus) & MPI_IOCSTATUS_MASK; 2103 iocstatus = le16_to_cpu(pScsiTmReply->IOCStatus) & MPI_IOCSTATUS_MASK;
2104 hd->tm_iocstatus = iocstatus;
2026 dtmprintk((MYIOC_s_WARN_FMT " SCSI TaskMgmt (%d) IOCStatus=%04x IOCLogInfo=%08x\n", 2105 dtmprintk((MYIOC_s_WARN_FMT " SCSI TaskMgmt (%d) IOCStatus=%04x IOCLogInfo=%08x\n",
2027 ioc->name, tmType, iocstatus, le32_to_cpu(pScsiTmReply->IOCLogInfo))); 2106 ioc->name, tmType, iocstatus, le32_to_cpu(pScsiTmReply->IOCLogInfo)));
2028 /* Error? (anything non-zero?) */ 2107 /* Error? (anything non-zero?) */
@@ -2401,6 +2480,13 @@ mptscsih_copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR
2401 ioc->events[idx].data[1] = (sense_data[13] << 8) || sense_data[12]; 2480 ioc->events[idx].data[1] = (sense_data[13] << 8) || sense_data[12];
2402 2481
2403 ioc->eventContext++; 2482 ioc->eventContext++;
2483 if (hd->ioc->pcidev->vendor ==
2484 PCI_VENDOR_ID_IBM) {
2485 mptscsih_issue_sep_command(hd->ioc,
2486 vdev->vtarget, MPI_SEP_REQ_SLOTSTATUS_PREDICTED_FAULT);
2487 vdev->vtarget->tflags |=
2488 MPT_TARGET_FLAGS_LED_ON;
2489 }
2404 } 2490 }
2405 } 2491 }
2406 } else { 2492 } else {
@@ -2409,7 +2495,7 @@ mptscsih_copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR
2409 } 2495 }
2410} 2496}
2411 2497
2412static u32 2498static int
2413SCPNT_TO_LOOKUP_IDX(struct scsi_cmnd *sc) 2499SCPNT_TO_LOOKUP_IDX(struct scsi_cmnd *sc)
2414{ 2500{
2415 MPT_SCSI_HOST *hd; 2501 MPT_SCSI_HOST *hd;
diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c
index 0a1ff762205f..e4cc3dd5fc9f 100644
--- a/drivers/message/fusion/mptspi.c
+++ b/drivers/message/fusion/mptspi.c
@@ -83,10 +83,6 @@ static int mpt_saf_te = MPTSCSIH_SAF_TE;
83module_param(mpt_saf_te, int, 0); 83module_param(mpt_saf_te, int, 0);
84MODULE_PARM_DESC(mpt_saf_te, " Force enabling SEP Processor: enable=1 (default=MPTSCSIH_SAF_TE=0)"); 84MODULE_PARM_DESC(mpt_saf_te, " Force enabling SEP Processor: enable=1 (default=MPTSCSIH_SAF_TE=0)");
85 85
86static int mpt_pq_filter = 0;
87module_param(mpt_pq_filter, int, 0);
88MODULE_PARM_DESC(mpt_pq_filter, " Enable peripheral qualifier filter: enable=1 (default=0)");
89
90static void mptspi_write_offset(struct scsi_target *, int); 86static void mptspi_write_offset(struct scsi_target *, int);
91static void mptspi_write_width(struct scsi_target *, int); 87static void mptspi_write_width(struct scsi_target *, int);
92static int mptspi_write_spi_device_pg1(struct scsi_target *, 88static int mptspi_write_spi_device_pg1(struct scsi_target *,
@@ -1047,14 +1043,12 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1047 hd->timer.function = mptscsih_timer_expired; 1043 hd->timer.function = mptscsih_timer_expired;
1048 1044
1049 ioc->spi_data.Saf_Te = mpt_saf_te; 1045 ioc->spi_data.Saf_Te = mpt_saf_te;
1050 hd->mpt_pq_filter = mpt_pq_filter;
1051 1046
1052 hd->negoNvram = MPT_SCSICFG_USE_NVRAM; 1047 hd->negoNvram = MPT_SCSICFG_USE_NVRAM;
1053 ddvprintk((MYIOC_s_INFO_FMT 1048 ddvprintk((MYIOC_s_INFO_FMT
1054 "saf_te %x mpt_pq_filter %x\n", 1049 "saf_te %x\n",
1055 ioc->name, 1050 ioc->name,
1056 mpt_saf_te, 1051 mpt_saf_te));
1057 mpt_pq_filter));
1058 ioc->spi_data.noQas = 0; 1052 ioc->spi_data.noQas = 0;
1059 1053
1060 init_waitqueue_head(&hd->scandv_waitq); 1054 init_waitqueue_head(&hd->scandv_waitq);
diff --git a/drivers/message/i2o/core.h b/drivers/message/i2o/core.h
index 184974cc734d..dc388a3ff5e0 100644
--- a/drivers/message/i2o/core.h
+++ b/drivers/message/i2o/core.h
@@ -38,6 +38,9 @@ extern struct device_attribute i2o_device_attrs[];
38extern void i2o_device_remove(struct i2o_device *); 38extern void i2o_device_remove(struct i2o_device *);
39extern int i2o_device_parse_lct(struct i2o_controller *); 39extern int i2o_device_parse_lct(struct i2o_controller *);
40 40
41int i2o_parm_issue(struct i2o_device *i2o_dev, int cmd, void *oplist,
42 int oplen, void *reslist, int reslen);
43
41/* IOP */ 44/* IOP */
42extern struct i2o_controller *i2o_iop_alloc(void); 45extern struct i2o_controller *i2o_iop_alloc(void);
43 46
diff --git a/drivers/message/i2o/i2o_config.c b/drivers/message/i2o/i2o_config.c
index 89daf67b764d..7d23e082bf26 100644
--- a/drivers/message/i2o/i2o_config.c
+++ b/drivers/message/i2o/i2o_config.c
@@ -36,9 +36,9 @@
36 36
37#include <asm/uaccess.h> 37#include <asm/uaccess.h>
38 38
39#define SG_TABLESIZE 30 39#include "core.h"
40 40
41extern int i2o_parm_issue(struct i2o_device *, int, void *, int, void *, int); 41#define SG_TABLESIZE 30
42 42
43static int i2o_cfg_ioctl(struct inode *, struct file *, unsigned int, 43static int i2o_cfg_ioctl(struct inode *, struct file *, unsigned int,
44 unsigned long); 44 unsigned long);
diff --git a/drivers/mfd/ucb1x00-core.c b/drivers/mfd/ucb1x00-core.c
index 632bc218c86a..2bf32721eb53 100644
--- a/drivers/mfd/ucb1x00-core.c
+++ b/drivers/mfd/ucb1x00-core.c
@@ -479,7 +479,7 @@ static int ucb1x00_probe(struct mcp *mcp)
479 mcp_enable(mcp); 479 mcp_enable(mcp);
480 id = mcp_reg_read(mcp, UCB_ID); 480 id = mcp_reg_read(mcp, UCB_ID);
481 481
482 if (id != UCB_ID_1200 && id != UCB_ID_1300) { 482 if (id != UCB_ID_1200 && id != UCB_ID_1300 && id != UCB_ID_TC35143) {
483 printk(KERN_WARNING "UCB1x00 ID not found: %04x\n", id); 483 printk(KERN_WARNING "UCB1x00 ID not found: %04x\n", id);
484 goto err_disable; 484 goto err_disable;
485 } 485 }
diff --git a/drivers/mfd/ucb1x00.h b/drivers/mfd/ucb1x00.h
index 9c9a647d8b7b..ca8df8072d43 100644
--- a/drivers/mfd/ucb1x00.h
+++ b/drivers/mfd/ucb1x00.h
@@ -94,6 +94,7 @@
94#define UCB_ID 0x0c 94#define UCB_ID 0x0c
95#define UCB_ID_1200 0x1004 95#define UCB_ID_1200 0x1004
96#define UCB_ID_1300 0x1005 96#define UCB_ID_1300 0x1005
97#define UCB_ID_TC35143 0x9712
97 98
98#define UCB_MODE 0x0d 99#define UCB_MODE 0x0d
99#define UCB_MODE_DYN_VFLAG_ENA (1 << 12) 100#define UCB_MODE_DYN_VFLAG_ENA (1 << 12)
diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 893319108ba4..4e21b3b9d330 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -565,7 +565,7 @@ static void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd)
565 if (cmd->data) 565 if (cmd->data)
566 flags |= SDHCI_CMD_DATA; 566 flags |= SDHCI_CMD_DATA;
567 567
568 writel(SDHCI_MAKE_CMD(cmd->opcode, flags), 568 writew(SDHCI_MAKE_CMD(cmd->opcode, flags),
569 host->ioaddr + SDHCI_COMMAND); 569 host->ioaddr + SDHCI_COMMAND);
570} 570}
571 571
@@ -1193,10 +1193,8 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot)
1193 version = (version & SDHCI_SPEC_VER_MASK) >> SDHCI_SPEC_VER_SHIFT; 1193 version = (version & SDHCI_SPEC_VER_MASK) >> SDHCI_SPEC_VER_SHIFT;
1194 if (version != 0) { 1194 if (version != 0) {
1195 printk(KERN_ERR "%s: Unknown controller version (%d). " 1195 printk(KERN_ERR "%s: Unknown controller version (%d). "
1196 "Cowardly refusing to continue.\n", host->slot_descr, 1196 "You may experience problems.\n", host->slot_descr,
1197 version); 1197 version);
1198 ret = -ENODEV;
1199 goto unmap;
1200 } 1198 }
1201 1199
1202 caps = readl(host->ioaddr + SDHCI_CAPABILITIES); 1200 caps = readl(host->ioaddr + SDHCI_CAPABILITIES);
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c
index 2819de79442c..80e8ca013e44 100644
--- a/drivers/net/3c59x.c
+++ b/drivers/net/3c59x.c
@@ -17,172 +17,6 @@
17 410 Severn Ave., Suite 210 17 410 Severn Ave., Suite 210
18 Annapolis MD 21403 18 Annapolis MD 21403
19 19
20 Linux Kernel Additions:
21
22 0.99H+lk0.9 - David S. Miller - softnet, PCI DMA updates
23 0.99H+lk1.0 - Jeff Garzik <jgarzik@pobox.com>
24 Remove compatibility defines for kernel versions < 2.2.x.
25 Update for new 2.3.x module interface
26 LK1.1.2 (March 19, 2000)
27 * New PCI interface (jgarzik)
28
29 LK1.1.3 25 April 2000, Andrew Morton <andrewm@uow.edu.au>
30 - Merged with 3c575_cb.c
31 - Don't set RxComplete in boomerang interrupt enable reg
32 - spinlock in vortex_timer to protect mdio functions
33 - disable local interrupts around call to vortex_interrupt in
34 vortex_tx_timeout() (So vortex_interrupt can use spin_lock())
35 - Select window 3 in vortex_timer()'s write to Wn3_MAC_Ctrl
36 - In vortex_start_xmit(), move the lock to _after_ we've altered
37 vp->cur_tx and vp->tx_full. This defeats the race between
38 vortex_start_xmit() and vortex_interrupt which was identified
39 by Bogdan Costescu.
40 - Merged back support for six new cards from various sources
41 - Set vortex_have_pci if pci_module_init returns zero (fixes cardbus
42 insertion oops)
43 - Tell it that 3c905C has NWAY for 100bT autoneg
44 - Fix handling of SetStatusEnd in 'Too much work..' code, as
45 per 2.3.99's 3c575_cb (Dave Hinds).
46 - Split ISR into two for vortex & boomerang
47 - Fix MOD_INC/DEC races
48 - Handle resource allocation failures.
49 - Fix 3CCFE575CT LED polarity
50 - Make tx_interrupt_mitigation the default
51
52 LK1.1.4 25 April 2000, Andrew Morton <andrewm@uow.edu.au>
53 - Add extra TxReset to vortex_up() to fix 575_cb hotplug initialisation probs.
54 - Put vortex_info_tbl into __devinitdata
55 - In the vortex_error StatsFull HACK, disable stats in vp->intr_enable as well
56 as in the hardware.
57 - Increased the loop counter in issue_and_wait from 2,000 to 4,000.
58
59 LK1.1.5 28 April 2000, andrewm
60 - Added powerpc defines (John Daniel <jdaniel@etresoft.com> said these work...)
61 - Some extra diagnostics
62 - In vortex_error(), reset the Tx on maxCollisions. Otherwise most
63 chips usually get a Tx timeout.
64 - Added extra_reset module parm
65 - Replaced some inline timer manip with mod_timer
66 (Franois romieu <Francois.Romieu@nic.fr>)
67 - In vortex_up(), don't make Wn3_config initialisation dependent upon has_nway
68 (this came across from 3c575_cb).
69
70 LK1.1.6 06 Jun 2000, andrewm
71 - Backed out the PPC defines.
72 - Use del_timer_sync(), mod_timer().
73 - Fix wrapped ulong comparison in boomerang_rx()
74 - Add IS_TORNADO, use it to suppress 3c905C checksum error msg
75 (Donald Becker, I Lee Hetherington <ilh@sls.lcs.mit.edu>)
76 - Replace union wn3_config with BFINS/BFEXT manipulation for
77 sparc64 (Pete Zaitcev, Peter Jones)
78 - In vortex_error, do_tx_reset and vortex_tx_timeout(Vortex):
79 do a netif_wake_queue() to better recover from errors. (Anders Pedersen,
80 Donald Becker)
81 - Print a warning on out-of-memory (rate limited to 1 per 10 secs)
82 - Added two more Cardbus 575 NICs: 5b57 and 6564 (Paul Wagland)
83
84 LK1.1.7 2 Jul 2000 andrewm
85 - Better handling of shared IRQs
86 - Reset the transmitter on a Tx reclaim error
87 - Fixed crash under OOM during vortex_open() (Mark Hemment)
88 - Fix Rx cessation problem during OOM (help from Mark Hemment)
89 - The spinlocks around the mdio access were blocking interrupts for 300uS.
90 Fix all this to use spin_lock_bh() within mdio_read/write
91 - Only write to TxFreeThreshold if it's a boomerang - other NICs don't
92 have one.
93 - Added 802.3x MAC-layer flow control support
94
95 LK1.1.8 13 Aug 2000 andrewm
96 - Ignore request_region() return value - already reserved if Cardbus.
97 - Merged some additional Cardbus flags from Don's 0.99Qk
98 - Some fixes for 3c556 (Fred Maciel)
99 - Fix for EISA initialisation (Jan Rekorajski)
100 - Renamed MII_XCVR_PWR and EEPROM_230 to align with 3c575_cb and D. Becker's drivers
101 - Fixed MII_XCVR_PWR for 3CCFE575CT
102 - Added INVERT_LED_PWR, used it.
103 - Backed out the extra_reset stuff
104
105 LK1.1.9 12 Sep 2000 andrewm
106 - Backed out the tx_reset_resume flags. It was a no-op.
107 - In vortex_error, don't reset the Tx on txReclaim errors
108 - In vortex_error, don't reset the Tx on maxCollisions errors.
109 Hence backed out all the DownListPtr logic here.
110 - In vortex_error, give Tornado cards a partial TxReset on
111 maxCollisions (David Hinds). Defined MAX_COLLISION_RESET for this.
112 - Redid some driver flags and device names based on pcmcia_cs-3.1.20.
113 - Fixed a bug where, if vp->tx_full is set when the interface
114 is downed, it remains set when the interface is upped. Bad
115 things happen.
116
117 LK1.1.10 17 Sep 2000 andrewm
118 - Added EEPROM_8BIT for 3c555 (Fred Maciel)
119 - Added experimental support for the 3c556B Laptop Hurricane (Louis Gerbarg)
120 - Add HAS_NWAY to "3c900 Cyclone 10Mbps TPO"
121
122 LK1.1.11 13 Nov 2000 andrewm
123 - Dump MOD_INC/DEC_USE_COUNT, use SET_MODULE_OWNER
124
125 LK1.1.12 1 Jan 2001 andrewm (2.4.0-pre1)
126 - Call pci_enable_device before we request our IRQ (Tobias Ringstrom)
127 - Add 3c590 PCI latency timer hack to vortex_probe1 (from 0.99Ra)
128 - Added extended issue_and_wait for the 3c905CX.
129 - Look for an MII on PHY index 24 first (3c905CX oddity).
130 - Add HAS_NWAY to 3cSOHO100-TX (Brett Frankenberger)
131 - Don't free skbs we don't own on oom path in vortex_open().
132
133 LK1.1.13 27 Jan 2001
134 - Added explicit `medialock' flag so we can truly
135 lock the media type down with `options'.
136 - "check ioremap return and some tidbits" (Arnaldo Carvalho de Melo <acme@conectiva.com.br>)
137 - Added and used EEPROM_NORESET for 3c556B PM resumes.
138 - Fixed leakage of vp->rx_ring.
139 - Break out separate HAS_HWCKSM device capability flag.
140 - Kill vp->tx_full (ANK)
141 - Merge zerocopy fragment handling (ANK?)
142
143 LK1.1.14 15 Feb 2001
144 - Enable WOL. Can be turned on with `enable_wol' module option.
145 - EISA and PCI initialisation fixes (jgarzik, Manfred Spraul)
146 - If a device's internalconfig register reports it has NWAY,
147 use it, even if autoselect is enabled.
148
149 LK1.1.15 6 June 2001 akpm
150 - Prevent double counting of received bytes (Lars Christensen)
151 - Add ethtool support (jgarzik)
152 - Add module parm descriptions (Andrzej M. Krzysztofowicz)
153 - Implemented alloc_etherdev() API
154 - Special-case the 'Tx error 82' message.
155
156 LK1.1.16 18 July 2001 akpm
157 - Make NETIF_F_SG dependent upon nr_free_highpages(), not on CONFIG_HIGHMEM
158 - Lessen verbosity of bootup messages
159 - Fix WOL - use new PM API functions.
160 - Use netif_running() instead of vp->open in suspend/resume.
161 - Don't reset the interface logic on open/close/rmmod. It upsets
162 autonegotiation, and hence DHCP (from 0.99T).
163 - Back out EEPROM_NORESET flag because of the above (we do it for all
164 NICs).
165 - Correct 3c982 identification string
166 - Rename wait_for_completion() to issue_and_wait() to avoid completion.h
167 clash.
168
169 LK1.1.17 18Dec01 akpm
170 - PCI ID 9805 is a Python-T, not a dual-port Cyclone. Apparently.
171 And it has NWAY.
172 - Mask our advertised modes (vp->advertising) with our capabilities
173 (MII reg5) when deciding which duplex mode to use.
174 - Add `global_options' as default for options[]. Ditto global_enable_wol,
175 global_full_duplex.
176
177 LK1.1.18 01Jul02 akpm
178 - Fix for undocumented transceiver power-up bit on some 3c566B's
179 (Donald Becker, Rahul Karnik)
180
181 - See http://www.zip.com.au/~akpm/linux/#3c59x-2.3 for more details.
182 - Also see Documentation/networking/vortex.txt
183
184 LK1.1.19 10Nov02 Marc Zyngier <maz@wild-wind.fr.eu.org>
185 - EISA sysfs integration.
186*/ 20*/
187 21
188/* 22/*
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c
index 1959654cbec8..1428bb7715af 100644
--- a/drivers/net/8139cp.c
+++ b/drivers/net/8139cp.c
@@ -1836,9 +1836,10 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
1836 1836
1837 if (pdev->vendor == PCI_VENDOR_ID_REALTEK && 1837 if (pdev->vendor == PCI_VENDOR_ID_REALTEK &&
1838 pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pci_rev < 0x20) { 1838 pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pci_rev < 0x20) {
1839 printk(KERN_ERR PFX "pci dev %s (id %04x:%04x rev %02x) is not an 8139C+ compatible chip\n", 1839 dev_err(&pdev->dev,
1840 pci_name(pdev), pdev->vendor, pdev->device, pci_rev); 1840 "This (id %04x:%04x rev %02x) is not an 8139C+ compatible chip\n",
1841 printk(KERN_ERR PFX "Try the \"8139too\" driver instead.\n"); 1841 pdev->vendor, pdev->device, pci_rev);
1842 dev_err(&pdev->dev, "Try the \"8139too\" driver instead.\n");
1842 return -ENODEV; 1843 return -ENODEV;
1843 } 1844 }
1844 1845
@@ -1876,14 +1877,13 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
1876 pciaddr = pci_resource_start(pdev, 1); 1877 pciaddr = pci_resource_start(pdev, 1);
1877 if (!pciaddr) { 1878 if (!pciaddr) {
1878 rc = -EIO; 1879 rc = -EIO;
1879 printk(KERN_ERR PFX "no MMIO resource for pci dev %s\n", 1880 dev_err(&pdev->dev, "no MMIO resource\n");
1880 pci_name(pdev));
1881 goto err_out_res; 1881 goto err_out_res;
1882 } 1882 }
1883 if (pci_resource_len(pdev, 1) < CP_REGS_SIZE) { 1883 if (pci_resource_len(pdev, 1) < CP_REGS_SIZE) {
1884 rc = -EIO; 1884 rc = -EIO;
1885 printk(KERN_ERR PFX "MMIO resource (%llx) too small on pci dev %s\n", 1885 dev_err(&pdev->dev, "MMIO resource (%llx) too small\n",
1886 (unsigned long long)pci_resource_len(pdev, 1), pci_name(pdev)); 1886 (unsigned long long)pci_resource_len(pdev, 1));
1887 goto err_out_res; 1887 goto err_out_res;
1888 } 1888 }
1889 1889
@@ -1897,14 +1897,15 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
1897 1897
1898 rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK); 1898 rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
1899 if (rc) { 1899 if (rc) {
1900 printk(KERN_ERR PFX "No usable DMA configuration, " 1900 dev_err(&pdev->dev,
1901 "aborting.\n"); 1901 "No usable DMA configuration, aborting.\n");
1902 goto err_out_res; 1902 goto err_out_res;
1903 } 1903 }
1904 rc = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK); 1904 rc = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
1905 if (rc) { 1905 if (rc) {
1906 printk(KERN_ERR PFX "No usable consistent DMA configuration, " 1906 dev_err(&pdev->dev,
1907 "aborting.\n"); 1907 "No usable consistent DMA configuration, "
1908 "aborting.\n");
1908 goto err_out_res; 1909 goto err_out_res;
1909 } 1910 }
1910 } 1911 }
@@ -1915,9 +1916,9 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
1915 regs = ioremap(pciaddr, CP_REGS_SIZE); 1916 regs = ioremap(pciaddr, CP_REGS_SIZE);
1916 if (!regs) { 1917 if (!regs) {
1917 rc = -EIO; 1918 rc = -EIO;
1918 printk(KERN_ERR PFX "Cannot map PCI MMIO (%llx@%llx) on pci dev %s\n", 1919 dev_err(&pdev->dev, "Cannot map PCI MMIO (%Lx@%Lx)\n",
1919 (unsigned long long)pci_resource_len(pdev, 1), 1920 (unsigned long long)pci_resource_len(pdev, 1),
1920 (unsigned long long)pciaddr, pci_name(pdev)); 1921 (unsigned long long)pciaddr);
1921 goto err_out_res; 1922 goto err_out_res;
1922 } 1923 }
1923 dev->base_addr = (unsigned long) regs; 1924 dev->base_addr = (unsigned long) regs;
@@ -1986,7 +1987,8 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
1986 /* enable busmastering and memory-write-invalidate */ 1987 /* enable busmastering and memory-write-invalidate */
1987 pci_set_master(pdev); 1988 pci_set_master(pdev);
1988 1989
1989 if (cp->wol_enabled) cp_set_d3_state (cp); 1990 if (cp->wol_enabled)
1991 cp_set_d3_state (cp);
1990 1992
1991 return 0; 1993 return 0;
1992 1994
@@ -2011,7 +2013,8 @@ static void cp_remove_one (struct pci_dev *pdev)
2011 BUG_ON(!dev); 2013 BUG_ON(!dev);
2012 unregister_netdev(dev); 2014 unregister_netdev(dev);
2013 iounmap(cp->regs); 2015 iounmap(cp->regs);
2014 if (cp->wol_enabled) pci_set_power_state (pdev, PCI_D0); 2016 if (cp->wol_enabled)
2017 pci_set_power_state (pdev, PCI_D0);
2015 pci_release_regions(pdev); 2018 pci_release_regions(pdev);
2016 pci_clear_mwi(pdev); 2019 pci_clear_mwi(pdev);
2017 pci_disable_device(pdev); 2020 pci_disable_device(pdev);
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c
index 717506b2b13a..e4f4eaff7679 100644
--- a/drivers/net/8139too.c
+++ b/drivers/net/8139too.c
@@ -768,7 +768,7 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
768 /* dev and priv zeroed in alloc_etherdev */ 768 /* dev and priv zeroed in alloc_etherdev */
769 dev = alloc_etherdev (sizeof (*tp)); 769 dev = alloc_etherdev (sizeof (*tp));
770 if (dev == NULL) { 770 if (dev == NULL) {
771 printk (KERN_ERR PFX "%s: Unable to alloc new net device\n", pci_name(pdev)); 771 dev_err(&pdev->dev, "Unable to alloc new net device\n");
772 return -ENOMEM; 772 return -ENOMEM;
773 } 773 }
774 SET_MODULE_OWNER(dev); 774 SET_MODULE_OWNER(dev);
@@ -800,31 +800,31 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
800#ifdef USE_IO_OPS 800#ifdef USE_IO_OPS
801 /* make sure PCI base addr 0 is PIO */ 801 /* make sure PCI base addr 0 is PIO */
802 if (!(pio_flags & IORESOURCE_IO)) { 802 if (!(pio_flags & IORESOURCE_IO)) {
803 printk (KERN_ERR PFX "%s: region #0 not a PIO resource, aborting\n", pci_name(pdev)); 803 dev_err(&pdev->dev, "region #0 not a PIO resource, aborting\n");
804 rc = -ENODEV; 804 rc = -ENODEV;
805 goto err_out; 805 goto err_out;
806 } 806 }
807 /* check for weird/broken PCI region reporting */ 807 /* check for weird/broken PCI region reporting */
808 if (pio_len < RTL_MIN_IO_SIZE) { 808 if (pio_len < RTL_MIN_IO_SIZE) {
809 printk (KERN_ERR PFX "%s: Invalid PCI I/O region size(s), aborting\n", pci_name(pdev)); 809 dev_err(&pdev->dev, "Invalid PCI I/O region size(s), aborting\n");
810 rc = -ENODEV; 810 rc = -ENODEV;
811 goto err_out; 811 goto err_out;
812 } 812 }
813#else 813#else
814 /* make sure PCI base addr 1 is MMIO */ 814 /* make sure PCI base addr 1 is MMIO */
815 if (!(mmio_flags & IORESOURCE_MEM)) { 815 if (!(mmio_flags & IORESOURCE_MEM)) {
816 printk (KERN_ERR PFX "%s: region #1 not an MMIO resource, aborting\n", pci_name(pdev)); 816 dev_err(&pdev->dev, "region #1 not an MMIO resource, aborting\n");
817 rc = -ENODEV; 817 rc = -ENODEV;
818 goto err_out; 818 goto err_out;
819 } 819 }
820 if (mmio_len < RTL_MIN_IO_SIZE) { 820 if (mmio_len < RTL_MIN_IO_SIZE) {
821 printk (KERN_ERR PFX "%s: Invalid PCI mem region size(s), aborting\n", pci_name(pdev)); 821 dev_err(&pdev->dev, "Invalid PCI mem region size(s), aborting\n");
822 rc = -ENODEV; 822 rc = -ENODEV;
823 goto err_out; 823 goto err_out;
824 } 824 }
825#endif 825#endif
826 826
827 rc = pci_request_regions (pdev, "8139too"); 827 rc = pci_request_regions (pdev, DRV_NAME);
828 if (rc) 828 if (rc)
829 goto err_out; 829 goto err_out;
830 disable_dev_on_err = 1; 830 disable_dev_on_err = 1;
@@ -835,7 +835,7 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
835#ifdef USE_IO_OPS 835#ifdef USE_IO_OPS
836 ioaddr = ioport_map(pio_start, pio_len); 836 ioaddr = ioport_map(pio_start, pio_len);
837 if (!ioaddr) { 837 if (!ioaddr) {
838 printk (KERN_ERR PFX "%s: cannot map PIO, aborting\n", pci_name(pdev)); 838 dev_err(&pdev->dev, "cannot map PIO, aborting\n");
839 rc = -EIO; 839 rc = -EIO;
840 goto err_out; 840 goto err_out;
841 } 841 }
@@ -846,7 +846,7 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
846 /* ioremap MMIO region */ 846 /* ioremap MMIO region */
847 ioaddr = pci_iomap(pdev, 1, 0); 847 ioaddr = pci_iomap(pdev, 1, 0);
848 if (ioaddr == NULL) { 848 if (ioaddr == NULL) {
849 printk (KERN_ERR PFX "%s: cannot remap MMIO, aborting\n", pci_name(pdev)); 849 dev_err(&pdev->dev, "cannot remap MMIO, aborting\n");
850 rc = -EIO; 850 rc = -EIO;
851 goto err_out; 851 goto err_out;
852 } 852 }
@@ -860,8 +860,7 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
860 860
861 /* check for missing/broken hardware */ 861 /* check for missing/broken hardware */
862 if (RTL_R32 (TxConfig) == 0xFFFFFFFF) { 862 if (RTL_R32 (TxConfig) == 0xFFFFFFFF) {
863 printk (KERN_ERR PFX "%s: Chip not responding, ignoring board\n", 863 dev_err(&pdev->dev, "Chip not responding, ignoring board\n");
864 pci_name(pdev));
865 rc = -EIO; 864 rc = -EIO;
866 goto err_out; 865 goto err_out;
867 } 866 }
@@ -875,9 +874,10 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
875 } 874 }
876 875
877 /* if unknown chip, assume array element #0, original RTL-8139 in this case */ 876 /* if unknown chip, assume array element #0, original RTL-8139 in this case */
878 printk (KERN_DEBUG PFX "%s: unknown chip version, assuming RTL-8139\n", 877 dev_printk (KERN_DEBUG, &pdev->dev,
879 pci_name(pdev)); 878 "unknown chip version, assuming RTL-8139\n");
880 printk (KERN_DEBUG PFX "%s: TxConfig = 0x%lx\n", pci_name(pdev), RTL_R32 (TxConfig)); 879 dev_printk (KERN_DEBUG, &pdev->dev,
880 "TxConfig = 0x%lx\n", RTL_R32 (TxConfig));
881 tp->chipset = 0; 881 tp->chipset = 0;
882 882
883match: 883match:
@@ -954,9 +954,11 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev,
954 954
955 if (pdev->vendor == PCI_VENDOR_ID_REALTEK && 955 if (pdev->vendor == PCI_VENDOR_ID_REALTEK &&
956 pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pci_rev >= 0x20) { 956 pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pci_rev >= 0x20) {
957 printk(KERN_INFO PFX "pci dev %s (id %04x:%04x rev %02x) is an enhanced 8139C+ chip\n", 957 dev_info(&pdev->dev,
958 pci_name(pdev), pdev->vendor, pdev->device, pci_rev); 958 "This (id %04x:%04x rev %02x) is an enhanced 8139C+ chip\n",
959 printk(KERN_INFO PFX "Use the \"8139cp\" driver for improved performance and stability.\n"); 959 pdev->vendor, pdev->device, pci_rev);
960 dev_info(&pdev->dev,
961 "Use the \"8139cp\" driver for improved performance and stability.\n");
960 } 962 }
961 963
962 i = rtl8139_init_board (pdev, &dev); 964 i = rtl8139_init_board (pdev, &dev);
@@ -1707,6 +1709,7 @@ static int rtl8139_start_xmit (struct sk_buff *skb, struct net_device *dev)
1707 void __iomem *ioaddr = tp->mmio_addr; 1709 void __iomem *ioaddr = tp->mmio_addr;
1708 unsigned int entry; 1710 unsigned int entry;
1709 unsigned int len = skb->len; 1711 unsigned int len = skb->len;
1712 unsigned long flags;
1710 1713
1711 /* Calculate the next Tx descriptor entry. */ 1714 /* Calculate the next Tx descriptor entry. */
1712 entry = tp->cur_tx % NUM_TX_DESC; 1715 entry = tp->cur_tx % NUM_TX_DESC;
@@ -1723,7 +1726,7 @@ static int rtl8139_start_xmit (struct sk_buff *skb, struct net_device *dev)
1723 return 0; 1726 return 0;
1724 } 1727 }
1725 1728
1726 spin_lock_irq(&tp->lock); 1729 spin_lock_irqsave(&tp->lock, flags);
1727 RTL_W32_F (TxStatus0 + (entry * sizeof (u32)), 1730 RTL_W32_F (TxStatus0 + (entry * sizeof (u32)),
1728 tp->tx_flag | max(len, (unsigned int)ETH_ZLEN)); 1731 tp->tx_flag | max(len, (unsigned int)ETH_ZLEN));
1729 1732
@@ -1734,7 +1737,7 @@ static int rtl8139_start_xmit (struct sk_buff *skb, struct net_device *dev)
1734 1737
1735 if ((tp->cur_tx - NUM_TX_DESC) == tp->dirty_tx) 1738 if ((tp->cur_tx - NUM_TX_DESC) == tp->dirty_tx)
1736 netif_stop_queue (dev); 1739 netif_stop_queue (dev);
1737 spin_unlock_irq(&tp->lock); 1740 spin_unlock_irqrestore(&tp->lock, flags);
1738 1741
1739 if (netif_msg_tx_queued(tp)) 1742 if (netif_msg_tx_queued(tp))
1740 printk (KERN_DEBUG "%s: Queued Tx packet size %u to slot %d.\n", 1743 printk (KERN_DEBUG "%s: Queued Tx packet size %u to slot %d.\n",
diff --git a/drivers/net/appletalk/Kconfig b/drivers/net/appletalk/Kconfig
index b14e89004c3a..0a0e0cd81a23 100644
--- a/drivers/net/appletalk/Kconfig
+++ b/drivers/net/appletalk/Kconfig
@@ -29,7 +29,7 @@ config ATALK
29 even politically correct people are allowed to say Y here. 29 even politically correct people are allowed to say Y here.
30 30
31config DEV_APPLETALK 31config DEV_APPLETALK
32 bool "Appletalk interfaces support" 32 tristate "Appletalk interfaces support"
33 depends on ATALK 33 depends on ATALK
34 help 34 help
35 AppleTalk is the protocol that Apple computers can use to communicate 35 AppleTalk is the protocol that Apple computers can use to communicate
diff --git a/drivers/net/b44.c b/drivers/net/b44.c
index cd98d31dee8c..bea0fc0ede2f 100644
--- a/drivers/net/b44.c
+++ b/drivers/net/b44.c
@@ -2120,13 +2120,14 @@ static int __devinit b44_init_one(struct pci_dev *pdev,
2120 2120
2121 err = pci_enable_device(pdev); 2121 err = pci_enable_device(pdev);
2122 if (err) { 2122 if (err) {
2123 printk(KERN_ERR PFX "Cannot enable PCI device, " 2123 dev_err(&pdev->dev, "Cannot enable PCI device, "
2124 "aborting.\n"); 2124 "aborting.\n");
2125 return err; 2125 return err;
2126 } 2126 }
2127 2127
2128 if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) { 2128 if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) {
2129 printk(KERN_ERR PFX "Cannot find proper PCI device " 2129 dev_err(&pdev->dev,
2130 "Cannot find proper PCI device "
2130 "base address, aborting.\n"); 2131 "base address, aborting.\n");
2131 err = -ENODEV; 2132 err = -ENODEV;
2132 goto err_out_disable_pdev; 2133 goto err_out_disable_pdev;
@@ -2134,8 +2135,8 @@ static int __devinit b44_init_one(struct pci_dev *pdev,
2134 2135
2135 err = pci_request_regions(pdev, DRV_MODULE_NAME); 2136 err = pci_request_regions(pdev, DRV_MODULE_NAME);
2136 if (err) { 2137 if (err) {
2137 printk(KERN_ERR PFX "Cannot obtain PCI resources, " 2138 dev_err(&pdev->dev,
2138 "aborting.\n"); 2139 "Cannot obtain PCI resources, aborting.\n");
2139 goto err_out_disable_pdev; 2140 goto err_out_disable_pdev;
2140 } 2141 }
2141 2142
@@ -2143,15 +2144,13 @@ static int __devinit b44_init_one(struct pci_dev *pdev,
2143 2144
2144 err = pci_set_dma_mask(pdev, (u64) B44_DMA_MASK); 2145 err = pci_set_dma_mask(pdev, (u64) B44_DMA_MASK);
2145 if (err) { 2146 if (err) {
2146 printk(KERN_ERR PFX "No usable DMA configuration, " 2147 dev_err(&pdev->dev, "No usable DMA configuration, aborting.\n");
2147 "aborting.\n");
2148 goto err_out_free_res; 2148 goto err_out_free_res;
2149 } 2149 }
2150 2150
2151 err = pci_set_consistent_dma_mask(pdev, (u64) B44_DMA_MASK); 2151 err = pci_set_consistent_dma_mask(pdev, (u64) B44_DMA_MASK);
2152 if (err) { 2152 if (err) {
2153 printk(KERN_ERR PFX "No usable DMA configuration, " 2153 dev_err(&pdev->dev, "No usable DMA configuration, aborting.\n");
2154 "aborting.\n");
2155 goto err_out_free_res; 2154 goto err_out_free_res;
2156 } 2155 }
2157 2156
@@ -2160,7 +2159,7 @@ static int __devinit b44_init_one(struct pci_dev *pdev,
2160 2159
2161 dev = alloc_etherdev(sizeof(*bp)); 2160 dev = alloc_etherdev(sizeof(*bp));
2162 if (!dev) { 2161 if (!dev) {
2163 printk(KERN_ERR PFX "Etherdev alloc failed, aborting.\n"); 2162 dev_err(&pdev->dev, "Etherdev alloc failed, aborting.\n");
2164 err = -ENOMEM; 2163 err = -ENOMEM;
2165 goto err_out_free_res; 2164 goto err_out_free_res;
2166 } 2165 }
@@ -2181,8 +2180,7 @@ static int __devinit b44_init_one(struct pci_dev *pdev,
2181 2180
2182 bp->regs = ioremap(b44reg_base, b44reg_len); 2181 bp->regs = ioremap(b44reg_base, b44reg_len);
2183 if (bp->regs == 0UL) { 2182 if (bp->regs == 0UL) {
2184 printk(KERN_ERR PFX "Cannot map device registers, " 2183 dev_err(&pdev->dev, "Cannot map device registers, aborting.\n");
2185 "aborting.\n");
2186 err = -ENOMEM; 2184 err = -ENOMEM;
2187 goto err_out_free_dev; 2185 goto err_out_free_dev;
2188 } 2186 }
@@ -2212,8 +2210,8 @@ static int __devinit b44_init_one(struct pci_dev *pdev,
2212 2210
2213 err = b44_get_invariants(bp); 2211 err = b44_get_invariants(bp);
2214 if (err) { 2212 if (err) {
2215 printk(KERN_ERR PFX "Problem fetching invariants of chip, " 2213 dev_err(&pdev->dev,
2216 "aborting.\n"); 2214 "Problem fetching invariants of chip, aborting.\n");
2217 goto err_out_iounmap; 2215 goto err_out_iounmap;
2218 } 2216 }
2219 2217
@@ -2233,8 +2231,7 @@ static int __devinit b44_init_one(struct pci_dev *pdev,
2233 2231
2234 err = register_netdev(dev); 2232 err = register_netdev(dev);
2235 if (err) { 2233 if (err) {
2236 printk(KERN_ERR PFX "Cannot register net device, " 2234 dev_err(&pdev->dev, "Cannot register net device, aborting.\n");
2237 "aborting.\n");
2238 goto err_out_iounmap; 2235 goto err_out_iounmap;
2239 } 2236 }
2240 2237
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 4f4db5ae503b..db73de0d2511 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -1639,7 +1639,7 @@ bnx2_tx_int(struct bnx2 *bp)
1639 skb = tx_buf->skb; 1639 skb = tx_buf->skb;
1640#ifdef BCM_TSO 1640#ifdef BCM_TSO
1641 /* partial BD completions possible with TSO packets */ 1641 /* partial BD completions possible with TSO packets */
1642 if (skb_shinfo(skb)->gso_size) { 1642 if (skb_is_gso(skb)) {
1643 u16 last_idx, last_ring_idx; 1643 u16 last_idx, last_ring_idx;
1644 1644
1645 last_idx = sw_cons + 1645 last_idx = sw_cons +
@@ -5575,20 +5575,20 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
5575 /* enable device (incl. PCI PM wakeup), and bus-mastering */ 5575 /* enable device (incl. PCI PM wakeup), and bus-mastering */
5576 rc = pci_enable_device(pdev); 5576 rc = pci_enable_device(pdev);
5577 if (rc) { 5577 if (rc) {
5578 printk(KERN_ERR PFX "Cannot enable PCI device, aborting."); 5578 dev_err(&pdev->dev, "Cannot enable PCI device, aborting.");
5579 goto err_out; 5579 goto err_out;
5580 } 5580 }
5581 5581
5582 if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) { 5582 if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) {
5583 printk(KERN_ERR PFX "Cannot find PCI device base address, " 5583 dev_err(&pdev->dev,
5584 "aborting.\n"); 5584 "Cannot find PCI device base address, aborting.\n");
5585 rc = -ENODEV; 5585 rc = -ENODEV;
5586 goto err_out_disable; 5586 goto err_out_disable;
5587 } 5587 }
5588 5588
5589 rc = pci_request_regions(pdev, DRV_MODULE_NAME); 5589 rc = pci_request_regions(pdev, DRV_MODULE_NAME);
5590 if (rc) { 5590 if (rc) {
5591 printk(KERN_ERR PFX "Cannot obtain PCI resources, aborting.\n"); 5591 dev_err(&pdev->dev, "Cannot obtain PCI resources, aborting.\n");
5592 goto err_out_disable; 5592 goto err_out_disable;
5593 } 5593 }
5594 5594
@@ -5596,15 +5596,15 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
5596 5596
5597 bp->pm_cap = pci_find_capability(pdev, PCI_CAP_ID_PM); 5597 bp->pm_cap = pci_find_capability(pdev, PCI_CAP_ID_PM);
5598 if (bp->pm_cap == 0) { 5598 if (bp->pm_cap == 0) {
5599 printk(KERN_ERR PFX "Cannot find power management capability, " 5599 dev_err(&pdev->dev,
5600 "aborting.\n"); 5600 "Cannot find power management capability, aborting.\n");
5601 rc = -EIO; 5601 rc = -EIO;
5602 goto err_out_release; 5602 goto err_out_release;
5603 } 5603 }
5604 5604
5605 bp->pcix_cap = pci_find_capability(pdev, PCI_CAP_ID_PCIX); 5605 bp->pcix_cap = pci_find_capability(pdev, PCI_CAP_ID_PCIX);
5606 if (bp->pcix_cap == 0) { 5606 if (bp->pcix_cap == 0) {
5607 printk(KERN_ERR PFX "Cannot find PCIX capability, aborting.\n"); 5607 dev_err(&pdev->dev, "Cannot find PCIX capability, aborting.\n");
5608 rc = -EIO; 5608 rc = -EIO;
5609 goto err_out_release; 5609 goto err_out_release;
5610 } 5610 }
@@ -5612,14 +5612,14 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
5612 if (pci_set_dma_mask(pdev, DMA_64BIT_MASK) == 0) { 5612 if (pci_set_dma_mask(pdev, DMA_64BIT_MASK) == 0) {
5613 bp->flags |= USING_DAC_FLAG; 5613 bp->flags |= USING_DAC_FLAG;
5614 if (pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK) != 0) { 5614 if (pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK) != 0) {
5615 printk(KERN_ERR PFX "pci_set_consistent_dma_mask " 5615 dev_err(&pdev->dev,
5616 "failed, aborting.\n"); 5616 "pci_set_consistent_dma_mask failed, aborting.\n");
5617 rc = -EIO; 5617 rc = -EIO;
5618 goto err_out_release; 5618 goto err_out_release;
5619 } 5619 }
5620 } 5620 }
5621 else if (pci_set_dma_mask(pdev, DMA_32BIT_MASK) != 0) { 5621 else if (pci_set_dma_mask(pdev, DMA_32BIT_MASK) != 0) {
5622 printk(KERN_ERR PFX "System does not support DMA, aborting.\n"); 5622 dev_err(&pdev->dev, "System does not support DMA, aborting.\n");
5623 rc = -EIO; 5623 rc = -EIO;
5624 goto err_out_release; 5624 goto err_out_release;
5625 } 5625 }
@@ -5639,7 +5639,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
5639 bp->regview = ioremap_nocache(dev->base_addr, mem_len); 5639 bp->regview = ioremap_nocache(dev->base_addr, mem_len);
5640 5640
5641 if (!bp->regview) { 5641 if (!bp->regview) {
5642 printk(KERN_ERR PFX "Cannot map register space, aborting.\n"); 5642 dev_err(&pdev->dev, "Cannot map register space, aborting.\n");
5643 rc = -ENOMEM; 5643 rc = -ENOMEM;
5644 goto err_out_release; 5644 goto err_out_release;
5645 } 5645 }
@@ -5711,8 +5711,8 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
5711 else if ((CHIP_ID(bp) == CHIP_ID_5706_A1) && 5711 else if ((CHIP_ID(bp) == CHIP_ID_5706_A1) &&
5712 !(bp->flags & PCIX_FLAG)) { 5712 !(bp->flags & PCIX_FLAG)) {
5713 5713
5714 printk(KERN_ERR PFX "5706 A1 can only be used in a PCIX bus, " 5714 dev_err(&pdev->dev,
5715 "aborting.\n"); 5715 "5706 A1 can only be used in a PCIX bus, aborting.\n");
5716 goto err_out_unmap; 5716 goto err_out_unmap;
5717 } 5717 }
5718 5718
@@ -5733,7 +5733,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
5733 5733
5734 if ((reg & BNX2_DEV_INFO_SIGNATURE_MAGIC_MASK) != 5734 if ((reg & BNX2_DEV_INFO_SIGNATURE_MAGIC_MASK) !=
5735 BNX2_DEV_INFO_SIGNATURE_MAGIC) { 5735 BNX2_DEV_INFO_SIGNATURE_MAGIC) {
5736 printk(KERN_ERR PFX "Firmware not running, aborting.\n"); 5736 dev_err(&pdev->dev, "Firmware not running, aborting.\n");
5737 rc = -ENODEV; 5737 rc = -ENODEV;
5738 goto err_out_unmap; 5738 goto err_out_unmap;
5739 } 5739 }
@@ -5895,7 +5895,7 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
5895#endif 5895#endif
5896 5896
5897 if ((rc = register_netdev(dev))) { 5897 if ((rc = register_netdev(dev))) {
5898 printk(KERN_ERR PFX "Cannot register net device\n"); 5898 dev_err(&pdev->dev, "Cannot register net device\n");
5899 if (bp->regview) 5899 if (bp->regview)
5900 iounmap(bp->regview); 5900 iounmap(bp->regview);
5901 pci_release_regions(pdev); 5901 pci_release_regions(pdev);
diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c
index d33130f64700..a31544ccb3c4 100644
--- a/drivers/net/cassini.c
+++ b/drivers/net/cassini.c
@@ -4887,13 +4887,12 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
4887 4887
4888 err = pci_enable_device(pdev); 4888 err = pci_enable_device(pdev);
4889 if (err) { 4889 if (err) {
4890 printk(KERN_ERR PFX "Cannot enable PCI device, " 4890 dev_err(&pdev->dev, "Cannot enable PCI device, aborting.\n");
4891 "aborting.\n");
4892 return err; 4891 return err;
4893 } 4892 }
4894 4893
4895 if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) { 4894 if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) {
4896 printk(KERN_ERR PFX "Cannot find proper PCI device " 4895 dev_err(&pdev->dev, "Cannot find proper PCI device "
4897 "base address, aborting.\n"); 4896 "base address, aborting.\n");
4898 err = -ENODEV; 4897 err = -ENODEV;
4899 goto err_out_disable_pdev; 4898 goto err_out_disable_pdev;
@@ -4901,7 +4900,7 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
4901 4900
4902 dev = alloc_etherdev(sizeof(*cp)); 4901 dev = alloc_etherdev(sizeof(*cp));
4903 if (!dev) { 4902 if (!dev) {
4904 printk(KERN_ERR PFX "Etherdev alloc failed, aborting.\n"); 4903 dev_err(&pdev->dev, "Etherdev alloc failed, aborting.\n");
4905 err = -ENOMEM; 4904 err = -ENOMEM;
4906 goto err_out_disable_pdev; 4905 goto err_out_disable_pdev;
4907 } 4906 }
@@ -4910,8 +4909,7 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
4910 4909
4911 err = pci_request_regions(pdev, dev->name); 4910 err = pci_request_regions(pdev, dev->name);
4912 if (err) { 4911 if (err) {
4913 printk(KERN_ERR PFX "Cannot obtain PCI resources, " 4912 dev_err(&pdev->dev, "Cannot obtain PCI resources, aborting.\n");
4914 "aborting.\n");
4915 goto err_out_free_netdev; 4913 goto err_out_free_netdev;
4916 } 4914 }
4917 pci_set_master(pdev); 4915 pci_set_master(pdev);
@@ -4941,7 +4939,7 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
4941 if (pci_write_config_byte(pdev, 4939 if (pci_write_config_byte(pdev,
4942 PCI_CACHE_LINE_SIZE, 4940 PCI_CACHE_LINE_SIZE,
4943 cas_cacheline_size)) { 4941 cas_cacheline_size)) {
4944 printk(KERN_ERR PFX "Could not set PCI cache " 4942 dev_err(&pdev->dev, "Could not set PCI cache "
4945 "line size\n"); 4943 "line size\n");
4946 goto err_write_cacheline; 4944 goto err_write_cacheline;
4947 } 4945 }
@@ -4955,7 +4953,7 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
4955 err = pci_set_consistent_dma_mask(pdev, 4953 err = pci_set_consistent_dma_mask(pdev,
4956 DMA_64BIT_MASK); 4954 DMA_64BIT_MASK);
4957 if (err < 0) { 4955 if (err < 0) {
4958 printk(KERN_ERR PFX "Unable to obtain 64-bit DMA " 4956 dev_err(&pdev->dev, "Unable to obtain 64-bit DMA "
4959 "for consistent allocations\n"); 4957 "for consistent allocations\n");
4960 goto err_out_free_res; 4958 goto err_out_free_res;
4961 } 4959 }
@@ -4963,7 +4961,7 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
4963 } else { 4961 } else {
4964 err = pci_set_dma_mask(pdev, DMA_32BIT_MASK); 4962 err = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
4965 if (err) { 4963 if (err) {
4966 printk(KERN_ERR PFX "No usable DMA configuration, " 4964 dev_err(&pdev->dev, "No usable DMA configuration, "
4967 "aborting.\n"); 4965 "aborting.\n");
4968 goto err_out_free_res; 4966 goto err_out_free_res;
4969 } 4967 }
@@ -5023,8 +5021,7 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
5023 /* give us access to cassini registers */ 5021 /* give us access to cassini registers */
5024 cp->regs = pci_iomap(pdev, 0, casreg_len); 5022 cp->regs = pci_iomap(pdev, 0, casreg_len);
5025 if (cp->regs == 0UL) { 5023 if (cp->regs == 0UL) {
5026 printk(KERN_ERR PFX "Cannot map device registers, " 5024 dev_err(&pdev->dev, "Cannot map device registers, aborting.\n");
5027 "aborting.\n");
5028 goto err_out_free_res; 5025 goto err_out_free_res;
5029 } 5026 }
5030 cp->casreg_len = casreg_len; 5027 cp->casreg_len = casreg_len;
@@ -5040,8 +5037,7 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
5040 pci_alloc_consistent(pdev, sizeof(struct cas_init_block), 5037 pci_alloc_consistent(pdev, sizeof(struct cas_init_block),
5041 &cp->block_dvma); 5038 &cp->block_dvma);
5042 if (!cp->init_block) { 5039 if (!cp->init_block) {
5043 printk(KERN_ERR PFX "Cannot allocate init block, " 5040 dev_err(&pdev->dev, "Cannot allocate init block, aborting.\n");
5044 "aborting.\n");
5045 goto err_out_iounmap; 5041 goto err_out_iounmap;
5046 } 5042 }
5047 5043
@@ -5085,8 +5081,7 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
5085 dev->features |= NETIF_F_HIGHDMA; 5081 dev->features |= NETIF_F_HIGHDMA;
5086 5082
5087 if (register_netdev(dev)) { 5083 if (register_netdev(dev)) {
5088 printk(KERN_ERR PFX "Cannot register net device, " 5084 dev_err(&pdev->dev, "Cannot register net device, aborting.\n");
5089 "aborting.\n");
5090 goto err_out_free_consistent; 5085 goto err_out_free_consistent;
5091 } 5086 }
5092 5087
diff --git a/drivers/net/chelsio/sge.c b/drivers/net/chelsio/sge.c
index 87f94d939ff8..61b3754f50ff 100644
--- a/drivers/net/chelsio/sge.c
+++ b/drivers/net/chelsio/sge.c
@@ -1417,7 +1417,7 @@ int t1_start_xmit(struct sk_buff *skb, struct net_device *dev)
1417 struct cpl_tx_pkt *cpl; 1417 struct cpl_tx_pkt *cpl;
1418 1418
1419#ifdef NETIF_F_TSO 1419#ifdef NETIF_F_TSO
1420 if (skb_shinfo(skb)->gso_size) { 1420 if (skb_is_gso(skb)) {
1421 int eth_type; 1421 int eth_type;
1422 struct cpl_tx_pkt_lso *hdr; 1422 struct cpl_tx_pkt_lso *hdr;
1423 1423
diff --git a/drivers/net/declance.c b/drivers/net/declance.c
index 2038ca7e49ce..6ad5796121c8 100644
--- a/drivers/net/declance.c
+++ b/drivers/net/declance.c
@@ -703,8 +703,8 @@ static irqreturn_t lance_dma_merr_int(const int irq, void *dev_id,
703 return IRQ_HANDLED; 703 return IRQ_HANDLED;
704} 704}
705 705
706static irqreturn_t 706static irqreturn_t lance_interrupt(const int irq, void *dev_id,
707lance_interrupt(const int irq, void *dev_id, struct pt_regs *regs) 707 struct pt_regs *regs)
708{ 708{
709 struct net_device *dev = (struct net_device *) dev_id; 709 struct net_device *dev = (struct net_device *) dev_id;
710 struct lance_private *lp = netdev_priv(dev); 710 struct lance_private *lp = netdev_priv(dev);
@@ -1253,7 +1253,7 @@ static int __init dec_lance_init(const int type, const int slot)
1253 return 0; 1253 return 0;
1254 1254
1255err_out_free_dev: 1255err_out_free_dev:
1256 kfree(dev); 1256 free_netdev(dev);
1257 1257
1258err_out: 1258err_out:
1259 return ret; 1259 return ret;
@@ -1299,6 +1299,7 @@ static void __exit dec_lance_cleanup(void)
1299 while (root_lance_dev) { 1299 while (root_lance_dev) {
1300 struct net_device *dev = root_lance_dev; 1300 struct net_device *dev = root_lance_dev;
1301 struct lance_private *lp = netdev_priv(dev); 1301 struct lance_private *lp = netdev_priv(dev);
1302
1302 unregister_netdev(dev); 1303 unregister_netdev(dev);
1303#ifdef CONFIG_TC 1304#ifdef CONFIG_TC
1304 if (lp->slot >= 0) 1305 if (lp->slot >= 0)
diff --git a/drivers/net/dl2k.c b/drivers/net/dl2k.c
index 4b6ddb70f921..402961e68c89 100644
--- a/drivers/net/dl2k.c
+++ b/drivers/net/dl2k.c
@@ -9,49 +9,10 @@
9 the Free Software Foundation; either version 2 of the License, or 9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version. 10 (at your option) any later version.
11*/ 11*/
12/*
13 Rev Date Description
14 ==========================================================================
15 0.01 2001/05/03 Created DL2000-based linux driver
16 0.02 2001/05/21 Added VLAN and hardware checksum support.
17 1.00 2001/06/26 Added jumbo frame support.
18 1.01 2001/08/21 Added two parameters, rx_coalesce and rx_timeout.
19 1.02 2001/10/08 Supported fiber media.
20 Added flow control parameters.
21 1.03 2001/10/12 Changed the default media to 1000mbps_fd for
22 the fiber devices.
23 1.04 2001/11/08 Fixed Tx stopped when tx very busy.
24 1.05 2001/11/22 Fixed Tx stopped when unidirectional tx busy.
25 1.06 2001/12/13 Fixed disconnect bug at 10Mbps mode.
26 Fixed tx_full flag incorrect.
27 Added tx_coalesce paramter.
28 1.07 2002/01/03 Fixed miscount of RX frame error.
29 1.08 2002/01/17 Fixed the multicast bug.
30 1.09 2002/03/07 Move rx-poll-now to re-fill loop.
31 Added rio_timer() to watch rx buffers.
32 1.10 2002/04/16 Fixed miscount of carrier error.
33 1.11 2002/05/23 Added ISR schedule scheme
34 Fixed miscount of rx frame error for DGE-550SX.
35 Fixed VLAN bug.
36 1.12 2002/06/13 Lock tx_coalesce=1 on 10/100Mbps mode.
37 1.13 2002/08/13 1. Fix disconnection (many tx:carrier/rx:frame
38 errs) with some mainboards.
39 2. Use definition "DRV_NAME" "DRV_VERSION"
40 "DRV_RELDATE" for flexibility.
41 1.14 2002/08/14 Support ethtool.
42 1.15 2002/08/27 Changed the default media to Auto-Negotiation
43 for the fiber devices.
44 1.16 2002/09/04 More power down time for fiber devices auto-
45 negotiation.
46 Fix disconnect bug after ifup and ifdown.
47 1.17 2002/10/03 Fix RMON statistics overflow.
48 Always use I/O mapping to access eeprom,
49 avoid system freezing with some chipsets.
50 12
51*/
52#define DRV_NAME "D-Link DL2000-based linux driver" 13#define DRV_NAME "D-Link DL2000-based linux driver"
53#define DRV_VERSION "v1.17b" 14#define DRV_VERSION "v1.18"
54#define DRV_RELDATE "2006/03/10" 15#define DRV_RELDATE "2006/06/27"
55#include "dl2k.h" 16#include "dl2k.h"
56#include <linux/dma-mapping.h> 17#include <linux/dma-mapping.h>
57 18
diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c
index 36d511729f71..2146cf74425e 100644
--- a/drivers/net/dummy.c
+++ b/drivers/net/dummy.c
@@ -132,6 +132,7 @@ static int __init dummy_init_module(void)
132 for (i = 0; i < numdummies && !err; i++) 132 for (i = 0; i < numdummies && !err; i++)
133 err = dummy_init_one(i); 133 err = dummy_init_one(i);
134 if (err) { 134 if (err) {
135 i--;
135 while (--i >= 0) 136 while (--i >= 0)
136 dummy_free_one(i); 137 dummy_free_one(i);
137 } 138 }
diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h
index 3042d33e2d4d..d304297c496c 100644
--- a/drivers/net/e1000/e1000.h
+++ b/drivers/net/e1000/e1000.h
@@ -68,7 +68,6 @@
68#ifdef NETIF_F_TSO 68#ifdef NETIF_F_TSO
69#include <net/checksum.h> 69#include <net/checksum.h>
70#endif 70#endif
71#include <linux/workqueue.h>
72#include <linux/mii.h> 71#include <linux/mii.h>
73#include <linux/ethtool.h> 72#include <linux/ethtool.h>
74#include <linux/if_vlan.h> 73#include <linux/if_vlan.h>
@@ -111,6 +110,9 @@ struct e1000_adapter;
111#define E1000_MIN_RXD 80 110#define E1000_MIN_RXD 80
112#define E1000_MAX_82544_RXD 4096 111#define E1000_MAX_82544_RXD 4096
113 112
113/* this is the size past which hardware will drop packets when setting LPE=0 */
114#define MAXIMUM_ETHERNET_VLAN_SIZE 1522
115
114/* Supported Rx Buffer Sizes */ 116/* Supported Rx Buffer Sizes */
115#define E1000_RXBUFFER_128 128 /* Used for packet split */ 117#define E1000_RXBUFFER_128 128 /* Used for packet split */
116#define E1000_RXBUFFER_256 256 /* Used for packet split */ 118#define E1000_RXBUFFER_256 256 /* Used for packet split */
@@ -143,6 +145,7 @@ struct e1000_adapter;
143 145
144#define AUTO_ALL_MODES 0 146#define AUTO_ALL_MODES 0
145#define E1000_EEPROM_82544_APM 0x0004 147#define E1000_EEPROM_82544_APM 0x0004
148#define E1000_EEPROM_ICH8_APME 0x0004
146#define E1000_EEPROM_APME 0x0400 149#define E1000_EEPROM_APME 0x0400
147 150
148#ifndef E1000_MASTER_SLAVE 151#ifndef E1000_MASTER_SLAVE
@@ -254,7 +257,6 @@ struct e1000_adapter {
254 spinlock_t tx_queue_lock; 257 spinlock_t tx_queue_lock;
255#endif 258#endif
256 atomic_t irq_sem; 259 atomic_t irq_sem;
257 struct work_struct watchdog_task;
258 struct work_struct reset_task; 260 struct work_struct reset_task;
259 uint8_t fc_autoneg; 261 uint8_t fc_autoneg;
260 262
@@ -339,8 +341,14 @@ struct e1000_adapter {
339#ifdef NETIF_F_TSO 341#ifdef NETIF_F_TSO
340 boolean_t tso_force; 342 boolean_t tso_force;
341#endif 343#endif
344 boolean_t smart_power_down; /* phy smart power down */
345 unsigned long flags;
342}; 346};
343 347
348enum e1000_state_t {
349 __E1000_DRIVER_TESTING,
350 __E1000_RESETTING,
351};
344 352
345/* e1000_main.c */ 353/* e1000_main.c */
346extern char e1000_driver_name[]; 354extern char e1000_driver_name[];
@@ -348,6 +356,7 @@ extern char e1000_driver_version[];
348int e1000_up(struct e1000_adapter *adapter); 356int e1000_up(struct e1000_adapter *adapter);
349void e1000_down(struct e1000_adapter *adapter); 357void e1000_down(struct e1000_adapter *adapter);
350void e1000_reset(struct e1000_adapter *adapter); 358void e1000_reset(struct e1000_adapter *adapter);
359void e1000_reinit_locked(struct e1000_adapter *adapter);
351int e1000_setup_all_tx_resources(struct e1000_adapter *adapter); 360int e1000_setup_all_tx_resources(struct e1000_adapter *adapter);
352void e1000_free_all_tx_resources(struct e1000_adapter *adapter); 361void e1000_free_all_tx_resources(struct e1000_adapter *adapter);
353int e1000_setup_all_rx_resources(struct e1000_adapter *adapter); 362int e1000_setup_all_rx_resources(struct e1000_adapter *adapter);
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c
index d19664891768..88a82ba88f57 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -109,7 +109,8 @@ e1000_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
109 SUPPORTED_1000baseT_Full| 109 SUPPORTED_1000baseT_Full|
110 SUPPORTED_Autoneg | 110 SUPPORTED_Autoneg |
111 SUPPORTED_TP); 111 SUPPORTED_TP);
112 112 if (hw->phy_type == e1000_phy_ife)
113 ecmd->supported &= ~SUPPORTED_1000baseT_Full;
113 ecmd->advertising = ADVERTISED_TP; 114 ecmd->advertising = ADVERTISED_TP;
114 115
115 if (hw->autoneg == 1) { 116 if (hw->autoneg == 1) {
@@ -203,11 +204,9 @@ e1000_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
203 204
204 /* reset the link */ 205 /* reset the link */
205 206
206 if (netif_running(adapter->netdev)) { 207 if (netif_running(adapter->netdev))
207 e1000_down(adapter); 208 e1000_reinit_locked(adapter);
208 e1000_reset(adapter); 209 else
209 e1000_up(adapter);
210 } else
211 e1000_reset(adapter); 210 e1000_reset(adapter);
212 211
213 return 0; 212 return 0;
@@ -254,10 +253,9 @@ e1000_set_pauseparam(struct net_device *netdev,
254 hw->original_fc = hw->fc; 253 hw->original_fc = hw->fc;
255 254
256 if (adapter->fc_autoneg == AUTONEG_ENABLE) { 255 if (adapter->fc_autoneg == AUTONEG_ENABLE) {
257 if (netif_running(adapter->netdev)) { 256 if (netif_running(adapter->netdev))
258 e1000_down(adapter); 257 e1000_reinit_locked(adapter);
259 e1000_up(adapter); 258 else
260 } else
261 e1000_reset(adapter); 259 e1000_reset(adapter);
262 } else 260 } else
263 return ((hw->media_type == e1000_media_type_fiber) ? 261 return ((hw->media_type == e1000_media_type_fiber) ?
@@ -279,10 +277,9 @@ e1000_set_rx_csum(struct net_device *netdev, uint32_t data)
279 struct e1000_adapter *adapter = netdev_priv(netdev); 277 struct e1000_adapter *adapter = netdev_priv(netdev);
280 adapter->rx_csum = data; 278 adapter->rx_csum = data;
281 279
282 if (netif_running(netdev)) { 280 if (netif_running(netdev))
283 e1000_down(adapter); 281 e1000_reinit_locked(adapter);
284 e1000_up(adapter); 282 else
285 } else
286 e1000_reset(adapter); 283 e1000_reset(adapter);
287 return 0; 284 return 0;
288} 285}
@@ -577,6 +574,7 @@ e1000_get_drvinfo(struct net_device *netdev,
577 case e1000_82572: 574 case e1000_82572:
578 case e1000_82573: 575 case e1000_82573:
579 case e1000_80003es2lan: 576 case e1000_80003es2lan:
577 case e1000_ich8lan:
580 sprintf(firmware_version, "%d.%d-%d", 578 sprintf(firmware_version, "%d.%d-%d",
581 (eeprom_data & 0xF000) >> 12, 579 (eeprom_data & 0xF000) >> 12,
582 (eeprom_data & 0x0FF0) >> 4, 580 (eeprom_data & 0x0FF0) >> 4,
@@ -631,6 +629,9 @@ e1000_set_ringparam(struct net_device *netdev,
631 tx_ring_size = sizeof(struct e1000_tx_ring) * adapter->num_tx_queues; 629 tx_ring_size = sizeof(struct e1000_tx_ring) * adapter->num_tx_queues;
632 rx_ring_size = sizeof(struct e1000_rx_ring) * adapter->num_rx_queues; 630 rx_ring_size = sizeof(struct e1000_rx_ring) * adapter->num_rx_queues;
633 631
632 while (test_and_set_bit(__E1000_RESETTING, &adapter->flags))
633 msleep(1);
634
634 if (netif_running(adapter->netdev)) 635 if (netif_running(adapter->netdev))
635 e1000_down(adapter); 636 e1000_down(adapter);
636 637
@@ -691,9 +692,11 @@ e1000_set_ringparam(struct net_device *netdev,
691 adapter->rx_ring = rx_new; 692 adapter->rx_ring = rx_new;
692 adapter->tx_ring = tx_new; 693 adapter->tx_ring = tx_new;
693 if ((err = e1000_up(adapter))) 694 if ((err = e1000_up(adapter)))
694 return err; 695 goto err_setup;
695 } 696 }
696 697
698 clear_bit(__E1000_RESETTING, &adapter->flags);
699
697 return 0; 700 return 0;
698err_setup_tx: 701err_setup_tx:
699 e1000_free_all_rx_resources(adapter); 702 e1000_free_all_rx_resources(adapter);
@@ -701,6 +704,8 @@ err_setup_rx:
701 adapter->rx_ring = rx_old; 704 adapter->rx_ring = rx_old;
702 adapter->tx_ring = tx_old; 705 adapter->tx_ring = tx_old;
703 e1000_up(adapter); 706 e1000_up(adapter);
707err_setup:
708 clear_bit(__E1000_RESETTING, &adapter->flags);
704 return err; 709 return err;
705} 710}
706 711
@@ -754,6 +759,7 @@ e1000_reg_test(struct e1000_adapter *adapter, uint64_t *data)
754 toggle = 0x7FFFF3FF; 759 toggle = 0x7FFFF3FF;
755 break; 760 break;
756 case e1000_82573: 761 case e1000_82573:
762 case e1000_ich8lan:
757 toggle = 0x7FFFF033; 763 toggle = 0x7FFFF033;
758 break; 764 break;
759 default: 765 default:
@@ -773,11 +779,12 @@ e1000_reg_test(struct e1000_adapter *adapter, uint64_t *data)
773 } 779 }
774 /* restore previous status */ 780 /* restore previous status */
775 E1000_WRITE_REG(&adapter->hw, STATUS, before); 781 E1000_WRITE_REG(&adapter->hw, STATUS, before);
776 782 if (adapter->hw.mac_type != e1000_ich8lan) {
777 REG_PATTERN_TEST(FCAL, 0xFFFFFFFF, 0xFFFFFFFF); 783 REG_PATTERN_TEST(FCAL, 0xFFFFFFFF, 0xFFFFFFFF);
778 REG_PATTERN_TEST(FCAH, 0x0000FFFF, 0xFFFFFFFF); 784 REG_PATTERN_TEST(FCAH, 0x0000FFFF, 0xFFFFFFFF);
779 REG_PATTERN_TEST(FCT, 0x0000FFFF, 0xFFFFFFFF); 785 REG_PATTERN_TEST(FCT, 0x0000FFFF, 0xFFFFFFFF);
780 REG_PATTERN_TEST(VET, 0x0000FFFF, 0xFFFFFFFF); 786 REG_PATTERN_TEST(VET, 0x0000FFFF, 0xFFFFFFFF);
787 }
781 REG_PATTERN_TEST(RDTR, 0x0000FFFF, 0xFFFFFFFF); 788 REG_PATTERN_TEST(RDTR, 0x0000FFFF, 0xFFFFFFFF);
782 REG_PATTERN_TEST(RDBAH, 0xFFFFFFFF, 0xFFFFFFFF); 789 REG_PATTERN_TEST(RDBAH, 0xFFFFFFFF, 0xFFFFFFFF);
783 REG_PATTERN_TEST(RDLEN, 0x000FFF80, 0x000FFFFF); 790 REG_PATTERN_TEST(RDLEN, 0x000FFF80, 0x000FFFFF);
@@ -790,20 +797,22 @@ e1000_reg_test(struct e1000_adapter *adapter, uint64_t *data)
790 REG_PATTERN_TEST(TDLEN, 0x000FFF80, 0x000FFFFF); 797 REG_PATTERN_TEST(TDLEN, 0x000FFF80, 0x000FFFFF);
791 798
792 REG_SET_AND_CHECK(RCTL, 0xFFFFFFFF, 0x00000000); 799 REG_SET_AND_CHECK(RCTL, 0xFFFFFFFF, 0x00000000);
793 REG_SET_AND_CHECK(RCTL, 0x06DFB3FE, 0x003FFFFB); 800 before = (adapter->hw.mac_type == e1000_ich8lan ?
801 0x06C3B33E : 0x06DFB3FE);
802 REG_SET_AND_CHECK(RCTL, before, 0x003FFFFB);
794 REG_SET_AND_CHECK(TCTL, 0xFFFFFFFF, 0x00000000); 803 REG_SET_AND_CHECK(TCTL, 0xFFFFFFFF, 0x00000000);
795 804
796 if (adapter->hw.mac_type >= e1000_82543) { 805 if (adapter->hw.mac_type >= e1000_82543) {
797 806
798 REG_SET_AND_CHECK(RCTL, 0x06DFB3FE, 0xFFFFFFFF); 807 REG_SET_AND_CHECK(RCTL, before, 0xFFFFFFFF);
799 REG_PATTERN_TEST(RDBAL, 0xFFFFFFF0, 0xFFFFFFFF); 808 REG_PATTERN_TEST(RDBAL, 0xFFFFFFF0, 0xFFFFFFFF);
800 REG_PATTERN_TEST(TXCW, 0xC000FFFF, 0x0000FFFF); 809 if (adapter->hw.mac_type != e1000_ich8lan)
810 REG_PATTERN_TEST(TXCW, 0xC000FFFF, 0x0000FFFF);
801 REG_PATTERN_TEST(TDBAL, 0xFFFFFFF0, 0xFFFFFFFF); 811 REG_PATTERN_TEST(TDBAL, 0xFFFFFFF0, 0xFFFFFFFF);
802 REG_PATTERN_TEST(TIDV, 0x0000FFFF, 0x0000FFFF); 812 REG_PATTERN_TEST(TIDV, 0x0000FFFF, 0x0000FFFF);
803 813 value = (adapter->hw.mac_type == e1000_ich8lan ?
804 for (i = 0; i < E1000_RAR_ENTRIES; i++) { 814 E1000_RAR_ENTRIES_ICH8LAN : E1000_RAR_ENTRIES);
805 REG_PATTERN_TEST(RA + ((i << 1) << 2), 0xFFFFFFFF, 815 for (i = 0; i < value; i++) {
806 0xFFFFFFFF);
807 REG_PATTERN_TEST(RA + (((i << 1) + 1) << 2), 0x8003FFFF, 816 REG_PATTERN_TEST(RA + (((i << 1) + 1) << 2), 0x8003FFFF,
808 0xFFFFFFFF); 817 0xFFFFFFFF);
809 } 818 }
@@ -817,7 +826,9 @@ e1000_reg_test(struct e1000_adapter *adapter, uint64_t *data)
817 826
818 } 827 }
819 828
820 for (i = 0; i < E1000_MC_TBL_SIZE; i++) 829 value = (adapter->hw.mac_type == e1000_ich8lan ?
830 E1000_MC_TBL_SIZE_ICH8LAN : E1000_MC_TBL_SIZE);
831 for (i = 0; i < value; i++)
821 REG_PATTERN_TEST(MTA + (i << 2), 0xFFFFFFFF, 0xFFFFFFFF); 832 REG_PATTERN_TEST(MTA + (i << 2), 0xFFFFFFFF, 0xFFFFFFFF);
822 833
823 *data = 0; 834 *data = 0;
@@ -889,6 +900,8 @@ e1000_intr_test(struct e1000_adapter *adapter, uint64_t *data)
889 /* Test each interrupt */ 900 /* Test each interrupt */
890 for (; i < 10; i++) { 901 for (; i < 10; i++) {
891 902
903 if (adapter->hw.mac_type == e1000_ich8lan && i == 8)
904 continue;
892 /* Interrupt to test */ 905 /* Interrupt to test */
893 mask = 1 << i; 906 mask = 1 << i;
894 907
@@ -1246,18 +1259,33 @@ e1000_integrated_phy_loopback(struct e1000_adapter *adapter)
1246 } else if (adapter->hw.phy_type == e1000_phy_gg82563) { 1259 } else if (adapter->hw.phy_type == e1000_phy_gg82563) {
1247 e1000_write_phy_reg(&adapter->hw, 1260 e1000_write_phy_reg(&adapter->hw,
1248 GG82563_PHY_KMRN_MODE_CTRL, 1261 GG82563_PHY_KMRN_MODE_CTRL,
1249 0x1CE); 1262 0x1CC);
1250 } 1263 }
1251 /* force 1000, set loopback */
1252 e1000_write_phy_reg(&adapter->hw, PHY_CTRL, 0x4140);
1253 1264
1254 /* Now set up the MAC to the same speed/duplex as the PHY. */
1255 ctrl_reg = E1000_READ_REG(&adapter->hw, CTRL); 1265 ctrl_reg = E1000_READ_REG(&adapter->hw, CTRL);
1256 ctrl_reg &= ~E1000_CTRL_SPD_SEL; /* Clear the speed sel bits */ 1266
1257 ctrl_reg |= (E1000_CTRL_FRCSPD | /* Set the Force Speed Bit */ 1267 if (adapter->hw.phy_type == e1000_phy_ife) {
1258 E1000_CTRL_FRCDPX | /* Set the Force Duplex Bit */ 1268 /* force 100, set loopback */
1259 E1000_CTRL_SPD_1000 |/* Force Speed to 1000 */ 1269 e1000_write_phy_reg(&adapter->hw, PHY_CTRL, 0x6100);
1260 E1000_CTRL_FD); /* Force Duplex to FULL */ 1270
1271 /* Now set up the MAC to the same speed/duplex as the PHY. */
1272 ctrl_reg &= ~E1000_CTRL_SPD_SEL; /* Clear the speed sel bits */
1273 ctrl_reg |= (E1000_CTRL_FRCSPD | /* Set the Force Speed Bit */
1274 E1000_CTRL_FRCDPX | /* Set the Force Duplex Bit */
1275 E1000_CTRL_SPD_100 |/* Force Speed to 100 */
1276 E1000_CTRL_FD); /* Force Duplex to FULL */
1277 } else {
1278 /* force 1000, set loopback */
1279 e1000_write_phy_reg(&adapter->hw, PHY_CTRL, 0x4140);
1280
1281 /* Now set up the MAC to the same speed/duplex as the PHY. */
1282 ctrl_reg = E1000_READ_REG(&adapter->hw, CTRL);
1283 ctrl_reg &= ~E1000_CTRL_SPD_SEL; /* Clear the speed sel bits */
1284 ctrl_reg |= (E1000_CTRL_FRCSPD | /* Set the Force Speed Bit */
1285 E1000_CTRL_FRCDPX | /* Set the Force Duplex Bit */
1286 E1000_CTRL_SPD_1000 |/* Force Speed to 1000 */
1287 E1000_CTRL_FD); /* Force Duplex to FULL */
1288 }
1261 1289
1262 if (adapter->hw.media_type == e1000_media_type_copper && 1290 if (adapter->hw.media_type == e1000_media_type_copper &&
1263 adapter->hw.phy_type == e1000_phy_m88) { 1291 adapter->hw.phy_type == e1000_phy_m88) {
@@ -1317,6 +1345,7 @@ e1000_set_phy_loopback(struct e1000_adapter *adapter)
1317 case e1000_82572: 1345 case e1000_82572:
1318 case e1000_82573: 1346 case e1000_82573:
1319 case e1000_80003es2lan: 1347 case e1000_80003es2lan:
1348 case e1000_ich8lan:
1320 return e1000_integrated_phy_loopback(adapter); 1349 return e1000_integrated_phy_loopback(adapter);
1321 break; 1350 break;
1322 1351
@@ -1568,6 +1597,7 @@ e1000_diag_test(struct net_device *netdev,
1568 struct e1000_adapter *adapter = netdev_priv(netdev); 1597 struct e1000_adapter *adapter = netdev_priv(netdev);
1569 boolean_t if_running = netif_running(netdev); 1598 boolean_t if_running = netif_running(netdev);
1570 1599
1600 set_bit(__E1000_DRIVER_TESTING, &adapter->flags);
1571 if (eth_test->flags == ETH_TEST_FL_OFFLINE) { 1601 if (eth_test->flags == ETH_TEST_FL_OFFLINE) {
1572 /* Offline tests */ 1602 /* Offline tests */
1573 1603
@@ -1582,7 +1612,8 @@ e1000_diag_test(struct net_device *netdev,
1582 eth_test->flags |= ETH_TEST_FL_FAILED; 1612 eth_test->flags |= ETH_TEST_FL_FAILED;
1583 1613
1584 if (if_running) 1614 if (if_running)
1585 e1000_down(adapter); 1615 /* indicate we're in test mode */
1616 dev_close(netdev);
1586 else 1617 else
1587 e1000_reset(adapter); 1618 e1000_reset(adapter);
1588 1619
@@ -1607,8 +1638,9 @@ e1000_diag_test(struct net_device *netdev,
1607 adapter->hw.autoneg = autoneg; 1638 adapter->hw.autoneg = autoneg;
1608 1639
1609 e1000_reset(adapter); 1640 e1000_reset(adapter);
1641 clear_bit(__E1000_DRIVER_TESTING, &adapter->flags);
1610 if (if_running) 1642 if (if_running)
1611 e1000_up(adapter); 1643 dev_open(netdev);
1612 } else { 1644 } else {
1613 /* Online tests */ 1645 /* Online tests */
1614 if (e1000_link_test(adapter, &data[4])) 1646 if (e1000_link_test(adapter, &data[4]))
@@ -1619,6 +1651,8 @@ e1000_diag_test(struct net_device *netdev,
1619 data[1] = 0; 1651 data[1] = 0;
1620 data[2] = 0; 1652 data[2] = 0;
1621 data[3] = 0; 1653 data[3] = 0;
1654
1655 clear_bit(__E1000_DRIVER_TESTING, &adapter->flags);
1622 } 1656 }
1623 msleep_interruptible(4 * 1000); 1657 msleep_interruptible(4 * 1000);
1624} 1658}
@@ -1778,21 +1812,18 @@ e1000_phys_id(struct net_device *netdev, uint32_t data)
1778 mod_timer(&adapter->blink_timer, jiffies); 1812 mod_timer(&adapter->blink_timer, jiffies);
1779 msleep_interruptible(data * 1000); 1813 msleep_interruptible(data * 1000);
1780 del_timer_sync(&adapter->blink_timer); 1814 del_timer_sync(&adapter->blink_timer);
1781 } else if (adapter->hw.mac_type < e1000_82573) { 1815 } else if (adapter->hw.phy_type == e1000_phy_ife) {
1782 E1000_WRITE_REG(&adapter->hw, LEDCTL, 1816 if (!adapter->blink_timer.function) {
1783 (E1000_LEDCTL_LED2_BLINK_RATE | 1817 init_timer(&adapter->blink_timer);
1784 E1000_LEDCTL_LED0_BLINK | E1000_LEDCTL_LED2_BLINK | 1818 adapter->blink_timer.function = e1000_led_blink_callback;
1785 (E1000_LEDCTL_MODE_LED_ON << E1000_LEDCTL_LED2_MODE_SHIFT) | 1819 adapter->blink_timer.data = (unsigned long) adapter;
1786 (E1000_LEDCTL_MODE_LINK_ACTIVITY << E1000_LEDCTL_LED0_MODE_SHIFT) | 1820 }
1787 (E1000_LEDCTL_MODE_LED_OFF << E1000_LEDCTL_LED1_MODE_SHIFT))); 1821 mod_timer(&adapter->blink_timer, jiffies);
1788 msleep_interruptible(data * 1000); 1822 msleep_interruptible(data * 1000);
1823 del_timer_sync(&adapter->blink_timer);
1824 e1000_write_phy_reg(&(adapter->hw), IFE_PHY_SPECIAL_CONTROL_LED, 0);
1789 } else { 1825 } else {
1790 E1000_WRITE_REG(&adapter->hw, LEDCTL, 1826 e1000_blink_led_start(&adapter->hw);
1791 (E1000_LEDCTL_LED2_BLINK_RATE |
1792 E1000_LEDCTL_LED1_BLINK | E1000_LEDCTL_LED2_BLINK |
1793 (E1000_LEDCTL_MODE_LED_ON << E1000_LEDCTL_LED2_MODE_SHIFT) |
1794 (E1000_LEDCTL_MODE_LINK_ACTIVITY << E1000_LEDCTL_LED1_MODE_SHIFT) |
1795 (E1000_LEDCTL_MODE_LED_OFF << E1000_LEDCTL_LED0_MODE_SHIFT)));
1796 msleep_interruptible(data * 1000); 1827 msleep_interruptible(data * 1000);
1797 } 1828 }
1798 1829
@@ -1807,10 +1838,8 @@ static int
1807e1000_nway_reset(struct net_device *netdev) 1838e1000_nway_reset(struct net_device *netdev)
1808{ 1839{
1809 struct e1000_adapter *adapter = netdev_priv(netdev); 1840 struct e1000_adapter *adapter = netdev_priv(netdev);
1810 if (netif_running(netdev)) { 1841 if (netif_running(netdev))
1811 e1000_down(adapter); 1842 e1000_reinit_locked(adapter);
1812 e1000_up(adapter);
1813 }
1814 return 0; 1843 return 0;
1815} 1844}
1816 1845
diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c
index 3959039b16ec..583518ae49ce 100644
--- a/drivers/net/e1000/e1000_hw.c
+++ b/drivers/net/e1000/e1000_hw.c
@@ -101,7 +101,8 @@ static void e1000_write_reg_io(struct e1000_hw *hw, uint32_t offset,
101 101
102#define E1000_WRITE_REG_IO(a, reg, val) \ 102#define E1000_WRITE_REG_IO(a, reg, val) \
103 e1000_write_reg_io((a), E1000_##reg, val) 103 e1000_write_reg_io((a), E1000_##reg, val)
104static int32_t e1000_configure_kmrn_for_10_100(struct e1000_hw *hw); 104static int32_t e1000_configure_kmrn_for_10_100(struct e1000_hw *hw,
105 uint16_t duplex);
105static int32_t e1000_configure_kmrn_for_1000(struct e1000_hw *hw); 106static int32_t e1000_configure_kmrn_for_1000(struct e1000_hw *hw);
106 107
107/* IGP cable length table */ 108/* IGP cable length table */
@@ -156,6 +157,14 @@ e1000_set_phy_type(struct e1000_hw *hw)
156 hw->phy_type = e1000_phy_igp; 157 hw->phy_type = e1000_phy_igp;
157 break; 158 break;
158 } 159 }
160 case IGP03E1000_E_PHY_ID:
161 hw->phy_type = e1000_phy_igp_3;
162 break;
163 case IFE_E_PHY_ID:
164 case IFE_PLUS_E_PHY_ID:
165 case IFE_C_E_PHY_ID:
166 hw->phy_type = e1000_phy_ife;
167 break;
159 case GG82563_E_PHY_ID: 168 case GG82563_E_PHY_ID:
160 if (hw->mac_type == e1000_80003es2lan) { 169 if (hw->mac_type == e1000_80003es2lan) {
161 hw->phy_type = e1000_phy_gg82563; 170 hw->phy_type = e1000_phy_gg82563;
@@ -332,6 +341,7 @@ e1000_set_mac_type(struct e1000_hw *hw)
332 break; 341 break;
333 case E1000_DEV_ID_82541EI: 342 case E1000_DEV_ID_82541EI:
334 case E1000_DEV_ID_82541EI_MOBILE: 343 case E1000_DEV_ID_82541EI_MOBILE:
344 case E1000_DEV_ID_82541ER_LOM:
335 hw->mac_type = e1000_82541; 345 hw->mac_type = e1000_82541;
336 break; 346 break;
337 case E1000_DEV_ID_82541ER: 347 case E1000_DEV_ID_82541ER:
@@ -341,6 +351,7 @@ e1000_set_mac_type(struct e1000_hw *hw)
341 hw->mac_type = e1000_82541_rev_2; 351 hw->mac_type = e1000_82541_rev_2;
342 break; 352 break;
343 case E1000_DEV_ID_82547EI: 353 case E1000_DEV_ID_82547EI:
354 case E1000_DEV_ID_82547EI_MOBILE:
344 hw->mac_type = e1000_82547; 355 hw->mac_type = e1000_82547;
345 break; 356 break;
346 case E1000_DEV_ID_82547GI: 357 case E1000_DEV_ID_82547GI:
@@ -354,6 +365,7 @@ e1000_set_mac_type(struct e1000_hw *hw)
354 case E1000_DEV_ID_82572EI_COPPER: 365 case E1000_DEV_ID_82572EI_COPPER:
355 case E1000_DEV_ID_82572EI_FIBER: 366 case E1000_DEV_ID_82572EI_FIBER:
356 case E1000_DEV_ID_82572EI_SERDES: 367 case E1000_DEV_ID_82572EI_SERDES:
368 case E1000_DEV_ID_82572EI:
357 hw->mac_type = e1000_82572; 369 hw->mac_type = e1000_82572;
358 break; 370 break;
359 case E1000_DEV_ID_82573E: 371 case E1000_DEV_ID_82573E:
@@ -361,16 +373,29 @@ e1000_set_mac_type(struct e1000_hw *hw)
361 case E1000_DEV_ID_82573L: 373 case E1000_DEV_ID_82573L:
362 hw->mac_type = e1000_82573; 374 hw->mac_type = e1000_82573;
363 break; 375 break;
376 case E1000_DEV_ID_80003ES2LAN_COPPER_SPT:
377 case E1000_DEV_ID_80003ES2LAN_SERDES_SPT:
364 case E1000_DEV_ID_80003ES2LAN_COPPER_DPT: 378 case E1000_DEV_ID_80003ES2LAN_COPPER_DPT:
365 case E1000_DEV_ID_80003ES2LAN_SERDES_DPT: 379 case E1000_DEV_ID_80003ES2LAN_SERDES_DPT:
366 hw->mac_type = e1000_80003es2lan; 380 hw->mac_type = e1000_80003es2lan;
367 break; 381 break;
382 case E1000_DEV_ID_ICH8_IGP_M_AMT:
383 case E1000_DEV_ID_ICH8_IGP_AMT:
384 case E1000_DEV_ID_ICH8_IGP_C:
385 case E1000_DEV_ID_ICH8_IFE:
386 case E1000_DEV_ID_ICH8_IGP_M:
387 hw->mac_type = e1000_ich8lan;
388 break;
368 default: 389 default:
369 /* Should never have loaded on this device */ 390 /* Should never have loaded on this device */
370 return -E1000_ERR_MAC_TYPE; 391 return -E1000_ERR_MAC_TYPE;
371 } 392 }
372 393
373 switch(hw->mac_type) { 394 switch(hw->mac_type) {
395 case e1000_ich8lan:
396 hw->swfwhw_semaphore_present = TRUE;
397 hw->asf_firmware_present = TRUE;
398 break;
374 case e1000_80003es2lan: 399 case e1000_80003es2lan:
375 hw->swfw_sync_present = TRUE; 400 hw->swfw_sync_present = TRUE;
376 /* fall through */ 401 /* fall through */
@@ -423,6 +448,7 @@ e1000_set_media_type(struct e1000_hw *hw)
423 case e1000_82542_rev2_1: 448 case e1000_82542_rev2_1:
424 hw->media_type = e1000_media_type_fiber; 449 hw->media_type = e1000_media_type_fiber;
425 break; 450 break;
451 case e1000_ich8lan:
426 case e1000_82573: 452 case e1000_82573:
427 /* The STATUS_TBIMODE bit is reserved or reused for the this 453 /* The STATUS_TBIMODE bit is reserved or reused for the this
428 * device. 454 * device.
@@ -527,6 +553,14 @@ e1000_reset_hw(struct e1000_hw *hw)
527 } while(timeout); 553 } while(timeout);
528 } 554 }
529 555
556 /* Workaround for ICH8 bit corruption issue in FIFO memory */
557 if (hw->mac_type == e1000_ich8lan) {
558 /* Set Tx and Rx buffer allocation to 8k apiece. */
559 E1000_WRITE_REG(hw, PBA, E1000_PBA_8K);
560 /* Set Packet Buffer Size to 16k. */
561 E1000_WRITE_REG(hw, PBS, E1000_PBS_16K);
562 }
563
530 /* Issue a global reset to the MAC. This will reset the chip's 564 /* Issue a global reset to the MAC. This will reset the chip's
531 * transmit, receive, DMA, and link units. It will not effect 565 * transmit, receive, DMA, and link units. It will not effect
532 * the current PCI configuration. The global reset bit is self- 566 * the current PCI configuration. The global reset bit is self-
@@ -550,6 +584,20 @@ e1000_reset_hw(struct e1000_hw *hw)
550 /* Reset is performed on a shadow of the control register */ 584 /* Reset is performed on a shadow of the control register */
551 E1000_WRITE_REG(hw, CTRL_DUP, (ctrl | E1000_CTRL_RST)); 585 E1000_WRITE_REG(hw, CTRL_DUP, (ctrl | E1000_CTRL_RST));
552 break; 586 break;
587 case e1000_ich8lan:
588 if (!hw->phy_reset_disable &&
589 e1000_check_phy_reset_block(hw) == E1000_SUCCESS) {
590 /* e1000_ich8lan PHY HW reset requires MAC CORE reset
591 * at the same time to make sure the interface between
592 * MAC and the external PHY is reset.
593 */
594 ctrl |= E1000_CTRL_PHY_RST;
595 }
596
597 e1000_get_software_flag(hw);
598 E1000_WRITE_REG(hw, CTRL, (ctrl | E1000_CTRL_RST));
599 msec_delay(5);
600 break;
553 default: 601 default:
554 E1000_WRITE_REG(hw, CTRL, (ctrl | E1000_CTRL_RST)); 602 E1000_WRITE_REG(hw, CTRL, (ctrl | E1000_CTRL_RST));
555 break; 603 break;
@@ -591,6 +639,7 @@ e1000_reset_hw(struct e1000_hw *hw)
591 /* fall through */ 639 /* fall through */
592 case e1000_82571: 640 case e1000_82571:
593 case e1000_82572: 641 case e1000_82572:
642 case e1000_ich8lan:
594 case e1000_80003es2lan: 643 case e1000_80003es2lan:
595 ret_val = e1000_get_auto_rd_done(hw); 644 ret_val = e1000_get_auto_rd_done(hw);
596 if(ret_val) 645 if(ret_val)
@@ -633,6 +682,12 @@ e1000_reset_hw(struct e1000_hw *hw)
633 e1000_pci_set_mwi(hw); 682 e1000_pci_set_mwi(hw);
634 } 683 }
635 684
685 if (hw->mac_type == e1000_ich8lan) {
686 uint32_t kab = E1000_READ_REG(hw, KABGTXD);
687 kab |= E1000_KABGTXD_BGSQLBIAS;
688 E1000_WRITE_REG(hw, KABGTXD, kab);
689 }
690
636 return E1000_SUCCESS; 691 return E1000_SUCCESS;
637} 692}
638 693
@@ -675,9 +730,12 @@ e1000_init_hw(struct e1000_hw *hw)
675 730
676 /* Disabling VLAN filtering. */ 731 /* Disabling VLAN filtering. */
677 DEBUGOUT("Initializing the IEEE VLAN\n"); 732 DEBUGOUT("Initializing the IEEE VLAN\n");
678 if (hw->mac_type < e1000_82545_rev_3) 733 /* VET hardcoded to standard value and VFTA removed in ICH8 LAN */
679 E1000_WRITE_REG(hw, VET, 0); 734 if (hw->mac_type != e1000_ich8lan) {
680 e1000_clear_vfta(hw); 735 if (hw->mac_type < e1000_82545_rev_3)
736 E1000_WRITE_REG(hw, VET, 0);
737 e1000_clear_vfta(hw);
738 }
681 739
682 /* For 82542 (rev 2.0), disable MWI and put the receiver into reset */ 740 /* For 82542 (rev 2.0), disable MWI and put the receiver into reset */
683 if(hw->mac_type == e1000_82542_rev2_0) { 741 if(hw->mac_type == e1000_82542_rev2_0) {
@@ -705,8 +763,14 @@ e1000_init_hw(struct e1000_hw *hw)
705 /* Zero out the Multicast HASH table */ 763 /* Zero out the Multicast HASH table */
706 DEBUGOUT("Zeroing the MTA\n"); 764 DEBUGOUT("Zeroing the MTA\n");
707 mta_size = E1000_MC_TBL_SIZE; 765 mta_size = E1000_MC_TBL_SIZE;
708 for(i = 0; i < mta_size; i++) 766 if (hw->mac_type == e1000_ich8lan)
767 mta_size = E1000_MC_TBL_SIZE_ICH8LAN;
768 for(i = 0; i < mta_size; i++) {
709 E1000_WRITE_REG_ARRAY(hw, MTA, i, 0); 769 E1000_WRITE_REG_ARRAY(hw, MTA, i, 0);
770 /* use write flush to prevent Memory Write Block (MWB) from
771 * occuring when accessing our register space */
772 E1000_WRITE_FLUSH(hw);
773 }
710 774
711 /* Set the PCI priority bit correctly in the CTRL register. This 775 /* Set the PCI priority bit correctly in the CTRL register. This
712 * determines if the adapter gives priority to receives, or if it 776 * determines if the adapter gives priority to receives, or if it
@@ -744,6 +808,10 @@ e1000_init_hw(struct e1000_hw *hw)
744 break; 808 break;
745 } 809 }
746 810
811 /* More time needed for PHY to initialize */
812 if (hw->mac_type == e1000_ich8lan)
813 msec_delay(15);
814
747 /* Call a subroutine to configure the link and setup flow control. */ 815 /* Call a subroutine to configure the link and setup flow control. */
748 ret_val = e1000_setup_link(hw); 816 ret_val = e1000_setup_link(hw);
749 817
@@ -757,6 +825,7 @@ e1000_init_hw(struct e1000_hw *hw)
757 case e1000_82571: 825 case e1000_82571:
758 case e1000_82572: 826 case e1000_82572:
759 case e1000_82573: 827 case e1000_82573:
828 case e1000_ich8lan:
760 case e1000_80003es2lan: 829 case e1000_80003es2lan:
761 ctrl |= E1000_TXDCTL_COUNT_DESC; 830 ctrl |= E1000_TXDCTL_COUNT_DESC;
762 break; 831 break;
@@ -795,6 +864,7 @@ e1000_init_hw(struct e1000_hw *hw)
795 /* Fall through */ 864 /* Fall through */
796 case e1000_82571: 865 case e1000_82571:
797 case e1000_82572: 866 case e1000_82572:
867 case e1000_ich8lan:
798 ctrl = E1000_READ_REG(hw, TXDCTL1); 868 ctrl = E1000_READ_REG(hw, TXDCTL1);
799 ctrl = (ctrl & ~E1000_TXDCTL_WTHRESH) | E1000_TXDCTL_FULL_TX_DESC_WB; 869 ctrl = (ctrl & ~E1000_TXDCTL_WTHRESH) | E1000_TXDCTL_FULL_TX_DESC_WB;
800 if(hw->mac_type >= e1000_82571) 870 if(hw->mac_type >= e1000_82571)
@@ -818,6 +888,11 @@ e1000_init_hw(struct e1000_hw *hw)
818 */ 888 */
819 e1000_clear_hw_cntrs(hw); 889 e1000_clear_hw_cntrs(hw);
820 890
891 /* ICH8 No-snoop bits are opposite polarity.
892 * Set to snoop by default after reset. */
893 if (hw->mac_type == e1000_ich8lan)
894 e1000_set_pci_ex_no_snoop(hw, PCI_EX_82566_SNOOP_ALL);
895
821 if (hw->device_id == E1000_DEV_ID_82546GB_QUAD_COPPER || 896 if (hw->device_id == E1000_DEV_ID_82546GB_QUAD_COPPER ||
822 hw->device_id == E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3) { 897 hw->device_id == E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3) {
823 ctrl_ext = E1000_READ_REG(hw, CTRL_EXT); 898 ctrl_ext = E1000_READ_REG(hw, CTRL_EXT);
@@ -905,6 +980,7 @@ e1000_setup_link(struct e1000_hw *hw)
905 */ 980 */
906 if (hw->fc == e1000_fc_default) { 981 if (hw->fc == e1000_fc_default) {
907 switch (hw->mac_type) { 982 switch (hw->mac_type) {
983 case e1000_ich8lan:
908 case e1000_82573: 984 case e1000_82573:
909 hw->fc = e1000_fc_full; 985 hw->fc = e1000_fc_full;
910 break; 986 break;
@@ -971,9 +1047,12 @@ e1000_setup_link(struct e1000_hw *hw)
971 */ 1047 */
972 DEBUGOUT("Initializing the Flow Control address, type and timer regs\n"); 1048 DEBUGOUT("Initializing the Flow Control address, type and timer regs\n");
973 1049
974 E1000_WRITE_REG(hw, FCAL, FLOW_CONTROL_ADDRESS_LOW); 1050 /* FCAL/H and FCT are hardcoded to standard values in e1000_ich8lan. */
975 E1000_WRITE_REG(hw, FCAH, FLOW_CONTROL_ADDRESS_HIGH); 1051 if (hw->mac_type != e1000_ich8lan) {
976 E1000_WRITE_REG(hw, FCT, FLOW_CONTROL_TYPE); 1052 E1000_WRITE_REG(hw, FCT, FLOW_CONTROL_TYPE);
1053 E1000_WRITE_REG(hw, FCAH, FLOW_CONTROL_ADDRESS_HIGH);
1054 E1000_WRITE_REG(hw, FCAL, FLOW_CONTROL_ADDRESS_LOW);
1055 }
977 1056
978 E1000_WRITE_REG(hw, FCTTV, hw->fc_pause_time); 1057 E1000_WRITE_REG(hw, FCTTV, hw->fc_pause_time);
979 1058
@@ -1237,12 +1316,13 @@ e1000_copper_link_igp_setup(struct e1000_hw *hw)
1237 1316
1238 /* Wait 10ms for MAC to configure PHY from eeprom settings */ 1317 /* Wait 10ms for MAC to configure PHY from eeprom settings */
1239 msec_delay(15); 1318 msec_delay(15);
1240 1319 if (hw->mac_type != e1000_ich8lan) {
1241 /* Configure activity LED after PHY reset */ 1320 /* Configure activity LED after PHY reset */
1242 led_ctrl = E1000_READ_REG(hw, LEDCTL); 1321 led_ctrl = E1000_READ_REG(hw, LEDCTL);
1243 led_ctrl &= IGP_ACTIVITY_LED_MASK; 1322 led_ctrl &= IGP_ACTIVITY_LED_MASK;
1244 led_ctrl |= (IGP_ACTIVITY_LED_ENABLE | IGP_LED3_MODE); 1323 led_ctrl |= (IGP_ACTIVITY_LED_ENABLE | IGP_LED3_MODE);
1245 E1000_WRITE_REG(hw, LEDCTL, led_ctrl); 1324 E1000_WRITE_REG(hw, LEDCTL, led_ctrl);
1325 }
1246 1326
1247 /* disable lplu d3 during driver init */ 1327 /* disable lplu d3 during driver init */
1248 ret_val = e1000_set_d3_lplu_state(hw, FALSE); 1328 ret_val = e1000_set_d3_lplu_state(hw, FALSE);
@@ -1478,8 +1558,7 @@ e1000_copper_link_ggp_setup(struct e1000_hw *hw)
1478 if (ret_val) 1558 if (ret_val)
1479 return ret_val; 1559 return ret_val;
1480 1560
1481 /* Enable Pass False Carrier on the PHY */ 1561 phy_data &= ~GG82563_KMCR_PASS_FALSE_CARRIER;
1482 phy_data |= GG82563_KMCR_PASS_FALSE_CARRIER;
1483 1562
1484 ret_val = e1000_write_phy_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, 1563 ret_val = e1000_write_phy_reg(hw, GG82563_PHY_KMRN_MODE_CTRL,
1485 phy_data); 1564 phy_data);
@@ -1561,28 +1640,40 @@ e1000_copper_link_mgp_setup(struct e1000_hw *hw)
1561 phy_data &= ~M88E1000_PSCR_POLARITY_REVERSAL; 1640 phy_data &= ~M88E1000_PSCR_POLARITY_REVERSAL;
1562 if(hw->disable_polarity_correction == 1) 1641 if(hw->disable_polarity_correction == 1)
1563 phy_data |= M88E1000_PSCR_POLARITY_REVERSAL; 1642 phy_data |= M88E1000_PSCR_POLARITY_REVERSAL;
1564 ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_SPEC_CTRL, phy_data); 1643 ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_SPEC_CTRL, phy_data);
1565 if(ret_val) 1644 if (ret_val)
1566 return ret_val;
1567
1568 /* Force TX_CLK in the Extended PHY Specific Control Register
1569 * to 25MHz clock.
1570 */
1571 ret_val = e1000_read_phy_reg(hw, M88E1000_EXT_PHY_SPEC_CTRL, &phy_data);
1572 if(ret_val)
1573 return ret_val; 1645 return ret_val;
1574 1646
1575 phy_data |= M88E1000_EPSCR_TX_CLK_25;
1576
1577 if (hw->phy_revision < M88E1011_I_REV_4) { 1647 if (hw->phy_revision < M88E1011_I_REV_4) {
1578 /* Configure Master and Slave downshift values */ 1648 /* Force TX_CLK in the Extended PHY Specific Control Register
1579 phy_data &= ~(M88E1000_EPSCR_MASTER_DOWNSHIFT_MASK | 1649 * to 25MHz clock.
1650 */
1651 ret_val = e1000_read_phy_reg(hw, M88E1000_EXT_PHY_SPEC_CTRL, &phy_data);
1652 if (ret_val)
1653 return ret_val;
1654
1655 phy_data |= M88E1000_EPSCR_TX_CLK_25;
1656
1657 if ((hw->phy_revision == E1000_REVISION_2) &&
1658 (hw->phy_id == M88E1111_I_PHY_ID)) {
1659 /* Vidalia Phy, set the downshift counter to 5x */
1660 phy_data &= ~(M88EC018_EPSCR_DOWNSHIFT_COUNTER_MASK);
1661 phy_data |= M88EC018_EPSCR_DOWNSHIFT_COUNTER_5X;
1662 ret_val = e1000_write_phy_reg(hw,
1663 M88E1000_EXT_PHY_SPEC_CTRL, phy_data);
1664 if (ret_val)
1665 return ret_val;
1666 } else {
1667 /* Configure Master and Slave downshift values */
1668 phy_data &= ~(M88E1000_EPSCR_MASTER_DOWNSHIFT_MASK |
1580 M88E1000_EPSCR_SLAVE_DOWNSHIFT_MASK); 1669 M88E1000_EPSCR_SLAVE_DOWNSHIFT_MASK);
1581 phy_data |= (M88E1000_EPSCR_MASTER_DOWNSHIFT_1X | 1670 phy_data |= (M88E1000_EPSCR_MASTER_DOWNSHIFT_1X |
1582 M88E1000_EPSCR_SLAVE_DOWNSHIFT_1X); 1671 M88E1000_EPSCR_SLAVE_DOWNSHIFT_1X);
1583 ret_val = e1000_write_phy_reg(hw, M88E1000_EXT_PHY_SPEC_CTRL, phy_data); 1672 ret_val = e1000_write_phy_reg(hw,
1584 if(ret_val) 1673 M88E1000_EXT_PHY_SPEC_CTRL, phy_data);
1585 return ret_val; 1674 if (ret_val)
1675 return ret_val;
1676 }
1586 } 1677 }
1587 1678
1588 /* SW Reset the PHY so all changes take effect */ 1679 /* SW Reset the PHY so all changes take effect */
@@ -1620,6 +1711,10 @@ e1000_copper_link_autoneg(struct e1000_hw *hw)
1620 if(hw->autoneg_advertised == 0) 1711 if(hw->autoneg_advertised == 0)
1621 hw->autoneg_advertised = AUTONEG_ADVERTISE_SPEED_DEFAULT; 1712 hw->autoneg_advertised = AUTONEG_ADVERTISE_SPEED_DEFAULT;
1622 1713
1714 /* IFE phy only supports 10/100 */
1715 if (hw->phy_type == e1000_phy_ife)
1716 hw->autoneg_advertised &= AUTONEG_ADVERTISE_10_100_ALL;
1717
1623 DEBUGOUT("Reconfiguring auto-neg advertisement params\n"); 1718 DEBUGOUT("Reconfiguring auto-neg advertisement params\n");
1624 ret_val = e1000_phy_setup_autoneg(hw); 1719 ret_val = e1000_phy_setup_autoneg(hw);
1625 if(ret_val) { 1720 if(ret_val) {
@@ -1717,6 +1812,26 @@ e1000_setup_copper_link(struct e1000_hw *hw)
1717 1812
1718 DEBUGFUNC("e1000_setup_copper_link"); 1813 DEBUGFUNC("e1000_setup_copper_link");
1719 1814
1815 switch (hw->mac_type) {
1816 case e1000_80003es2lan:
1817 case e1000_ich8lan:
1818 /* Set the mac to wait the maximum time between each
1819 * iteration and increase the max iterations when
1820 * polling the phy; this fixes erroneous timeouts at 10Mbps. */
1821 ret_val = e1000_write_kmrn_reg(hw, GG82563_REG(0x34, 4), 0xFFFF);
1822 if (ret_val)
1823 return ret_val;
1824 ret_val = e1000_read_kmrn_reg(hw, GG82563_REG(0x34, 9), &reg_data);
1825 if (ret_val)
1826 return ret_val;
1827 reg_data |= 0x3F;
1828 ret_val = e1000_write_kmrn_reg(hw, GG82563_REG(0x34, 9), reg_data);
1829 if (ret_val)
1830 return ret_val;
1831 default:
1832 break;
1833 }
1834
1720 /* Check if it is a valid PHY and set PHY mode if necessary. */ 1835 /* Check if it is a valid PHY and set PHY mode if necessary. */
1721 ret_val = e1000_copper_link_preconfig(hw); 1836 ret_val = e1000_copper_link_preconfig(hw);
1722 if(ret_val) 1837 if(ret_val)
@@ -1724,10 +1839,8 @@ e1000_setup_copper_link(struct e1000_hw *hw)
1724 1839
1725 switch (hw->mac_type) { 1840 switch (hw->mac_type) {
1726 case e1000_80003es2lan: 1841 case e1000_80003es2lan:
1727 ret_val = e1000_read_kmrn_reg(hw, E1000_KUMCTRLSTA_OFFSET_INB_CTRL, 1842 /* Kumeran registers are written-only */
1728 &reg_data); 1843 reg_data = E1000_KUMCTRLSTA_INB_CTRL_LINK_STATUS_TX_TIMEOUT_DEFAULT;
1729 if (ret_val)
1730 return ret_val;
1731 reg_data |= E1000_KUMCTRLSTA_INB_CTRL_DIS_PADDING; 1844 reg_data |= E1000_KUMCTRLSTA_INB_CTRL_DIS_PADDING;
1732 ret_val = e1000_write_kmrn_reg(hw, E1000_KUMCTRLSTA_OFFSET_INB_CTRL, 1845 ret_val = e1000_write_kmrn_reg(hw, E1000_KUMCTRLSTA_OFFSET_INB_CTRL,
1733 reg_data); 1846 reg_data);
@@ -1739,6 +1852,7 @@ e1000_setup_copper_link(struct e1000_hw *hw)
1739 } 1852 }
1740 1853
1741 if (hw->phy_type == e1000_phy_igp || 1854 if (hw->phy_type == e1000_phy_igp ||
1855 hw->phy_type == e1000_phy_igp_3 ||
1742 hw->phy_type == e1000_phy_igp_2) { 1856 hw->phy_type == e1000_phy_igp_2) {
1743 ret_val = e1000_copper_link_igp_setup(hw); 1857 ret_val = e1000_copper_link_igp_setup(hw);
1744 if(ret_val) 1858 if(ret_val)
@@ -1803,7 +1917,7 @@ e1000_setup_copper_link(struct e1000_hw *hw)
1803* hw - Struct containing variables accessed by shared code 1917* hw - Struct containing variables accessed by shared code
1804******************************************************************************/ 1918******************************************************************************/
1805static int32_t 1919static int32_t
1806e1000_configure_kmrn_for_10_100(struct e1000_hw *hw) 1920e1000_configure_kmrn_for_10_100(struct e1000_hw *hw, uint16_t duplex)
1807{ 1921{
1808 int32_t ret_val = E1000_SUCCESS; 1922 int32_t ret_val = E1000_SUCCESS;
1809 uint32_t tipg; 1923 uint32_t tipg;
@@ -1823,6 +1937,18 @@ e1000_configure_kmrn_for_10_100(struct e1000_hw *hw)
1823 tipg |= DEFAULT_80003ES2LAN_TIPG_IPGT_10_100; 1937 tipg |= DEFAULT_80003ES2LAN_TIPG_IPGT_10_100;
1824 E1000_WRITE_REG(hw, TIPG, tipg); 1938 E1000_WRITE_REG(hw, TIPG, tipg);
1825 1939
1940 ret_val = e1000_read_phy_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, &reg_data);
1941
1942 if (ret_val)
1943 return ret_val;
1944
1945 if (duplex == HALF_DUPLEX)
1946 reg_data |= GG82563_KMCR_PASS_FALSE_CARRIER;
1947 else
1948 reg_data &= ~GG82563_KMCR_PASS_FALSE_CARRIER;
1949
1950 ret_val = e1000_write_phy_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, reg_data);
1951
1826 return ret_val; 1952 return ret_val;
1827} 1953}
1828 1954
@@ -1847,6 +1973,14 @@ e1000_configure_kmrn_for_1000(struct e1000_hw *hw)
1847 tipg |= DEFAULT_80003ES2LAN_TIPG_IPGT_1000; 1973 tipg |= DEFAULT_80003ES2LAN_TIPG_IPGT_1000;
1848 E1000_WRITE_REG(hw, TIPG, tipg); 1974 E1000_WRITE_REG(hw, TIPG, tipg);
1849 1975
1976 ret_val = e1000_read_phy_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, &reg_data);
1977
1978 if (ret_val)
1979 return ret_val;
1980
1981 reg_data &= ~GG82563_KMCR_PASS_FALSE_CARRIER;
1982 ret_val = e1000_write_phy_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, reg_data);
1983
1850 return ret_val; 1984 return ret_val;
1851} 1985}
1852 1986
@@ -1869,10 +2003,13 @@ e1000_phy_setup_autoneg(struct e1000_hw *hw)
1869 if(ret_val) 2003 if(ret_val)
1870 return ret_val; 2004 return ret_val;
1871 2005
1872 /* Read the MII 1000Base-T Control Register (Address 9). */ 2006 if (hw->phy_type != e1000_phy_ife) {
1873 ret_val = e1000_read_phy_reg(hw, PHY_1000T_CTRL, &mii_1000t_ctrl_reg); 2007 /* Read the MII 1000Base-T Control Register (Address 9). */
1874 if(ret_val) 2008 ret_val = e1000_read_phy_reg(hw, PHY_1000T_CTRL, &mii_1000t_ctrl_reg);
1875 return ret_val; 2009 if (ret_val)
2010 return ret_val;
2011 } else
2012 mii_1000t_ctrl_reg=0;
1876 2013
1877 /* Need to parse both autoneg_advertised and fc and set up 2014 /* Need to parse both autoneg_advertised and fc and set up
1878 * the appropriate PHY registers. First we will parse for 2015 * the appropriate PHY registers. First we will parse for
@@ -1923,6 +2060,9 @@ e1000_phy_setup_autoneg(struct e1000_hw *hw)
1923 if(hw->autoneg_advertised & ADVERTISE_1000_FULL) { 2060 if(hw->autoneg_advertised & ADVERTISE_1000_FULL) {
1924 DEBUGOUT("Advertise 1000mb Full duplex\n"); 2061 DEBUGOUT("Advertise 1000mb Full duplex\n");
1925 mii_1000t_ctrl_reg |= CR_1000T_FD_CAPS; 2062 mii_1000t_ctrl_reg |= CR_1000T_FD_CAPS;
2063 if (hw->phy_type == e1000_phy_ife) {
2064 DEBUGOUT("e1000_phy_ife is a 10/100 PHY. Gigabit speed is not supported.\n");
2065 }
1926 } 2066 }
1927 2067
1928 /* Check for a software override of the flow control settings, and 2068 /* Check for a software override of the flow control settings, and
@@ -1984,9 +2124,11 @@ e1000_phy_setup_autoneg(struct e1000_hw *hw)
1984 2124
1985 DEBUGOUT1("Auto-Neg Advertising %x\n", mii_autoneg_adv_reg); 2125 DEBUGOUT1("Auto-Neg Advertising %x\n", mii_autoneg_adv_reg);
1986 2126
1987 ret_val = e1000_write_phy_reg(hw, PHY_1000T_CTRL, mii_1000t_ctrl_reg); 2127 if (hw->phy_type != e1000_phy_ife) {
1988 if(ret_val) 2128 ret_val = e1000_write_phy_reg(hw, PHY_1000T_CTRL, mii_1000t_ctrl_reg);
1989 return ret_val; 2129 if (ret_val)
2130 return ret_val;
2131 }
1990 2132
1991 return E1000_SUCCESS; 2133 return E1000_SUCCESS;
1992} 2134}
@@ -2089,6 +2231,18 @@ e1000_phy_force_speed_duplex(struct e1000_hw *hw)
2089 2231
2090 /* Need to reset the PHY or these changes will be ignored */ 2232 /* Need to reset the PHY or these changes will be ignored */
2091 mii_ctrl_reg |= MII_CR_RESET; 2233 mii_ctrl_reg |= MII_CR_RESET;
2234 /* Disable MDI-X support for 10/100 */
2235 } else if (hw->phy_type == e1000_phy_ife) {
2236 ret_val = e1000_read_phy_reg(hw, IFE_PHY_MDIX_CONTROL, &phy_data);
2237 if (ret_val)
2238 return ret_val;
2239
2240 phy_data &= ~IFE_PMC_AUTO_MDIX;
2241 phy_data &= ~IFE_PMC_FORCE_MDIX;
2242
2243 ret_val = e1000_write_phy_reg(hw, IFE_PHY_MDIX_CONTROL, phy_data);
2244 if (ret_val)
2245 return ret_val;
2092 } else { 2246 } else {
2093 /* Clear Auto-Crossover to force MDI manually. IGP requires MDI 2247 /* Clear Auto-Crossover to force MDI manually. IGP requires MDI
2094 * forced whenever speed or duplex are forced. 2248 * forced whenever speed or duplex are forced.
@@ -2721,8 +2875,12 @@ e1000_check_for_link(struct e1000_hw *hw)
2721 */ 2875 */
2722 if(hw->tbi_compatibility_en) { 2876 if(hw->tbi_compatibility_en) {
2723 uint16_t speed, duplex; 2877 uint16_t speed, duplex;
2724 e1000_get_speed_and_duplex(hw, &speed, &duplex); 2878 ret_val = e1000_get_speed_and_duplex(hw, &speed, &duplex);
2725 if(speed != SPEED_1000) { 2879 if (ret_val) {
2880 DEBUGOUT("Error getting link speed and duplex\n");
2881 return ret_val;
2882 }
2883 if (speed != SPEED_1000) {
2726 /* If link speed is not set to gigabit speed, we do not need 2884 /* If link speed is not set to gigabit speed, we do not need
2727 * to enable TBI compatibility. 2885 * to enable TBI compatibility.
2728 */ 2886 */
@@ -2889,7 +3047,13 @@ e1000_get_speed_and_duplex(struct e1000_hw *hw,
2889 if (*speed == SPEED_1000) 3047 if (*speed == SPEED_1000)
2890 ret_val = e1000_configure_kmrn_for_1000(hw); 3048 ret_val = e1000_configure_kmrn_for_1000(hw);
2891 else 3049 else
2892 ret_val = e1000_configure_kmrn_for_10_100(hw); 3050 ret_val = e1000_configure_kmrn_for_10_100(hw, *duplex);
3051 if (ret_val)
3052 return ret_val;
3053 }
3054
3055 if ((hw->phy_type == e1000_phy_igp_3) && (*speed == SPEED_1000)) {
3056 ret_val = e1000_kumeran_lock_loss_workaround(hw);
2893 if (ret_val) 3057 if (ret_val)
2894 return ret_val; 3058 return ret_val;
2895 } 3059 }
@@ -3079,6 +3243,9 @@ e1000_swfw_sync_acquire(struct e1000_hw *hw, uint16_t mask)
3079 3243
3080 DEBUGFUNC("e1000_swfw_sync_acquire"); 3244 DEBUGFUNC("e1000_swfw_sync_acquire");
3081 3245
3246 if (hw->swfwhw_semaphore_present)
3247 return e1000_get_software_flag(hw);
3248
3082 if (!hw->swfw_sync_present) 3249 if (!hw->swfw_sync_present)
3083 return e1000_get_hw_eeprom_semaphore(hw); 3250 return e1000_get_hw_eeprom_semaphore(hw);
3084 3251
@@ -3118,6 +3285,11 @@ e1000_swfw_sync_release(struct e1000_hw *hw, uint16_t mask)
3118 3285
3119 DEBUGFUNC("e1000_swfw_sync_release"); 3286 DEBUGFUNC("e1000_swfw_sync_release");
3120 3287
3288 if (hw->swfwhw_semaphore_present) {
3289 e1000_release_software_flag(hw);
3290 return;
3291 }
3292
3121 if (!hw->swfw_sync_present) { 3293 if (!hw->swfw_sync_present) {
3122 e1000_put_hw_eeprom_semaphore(hw); 3294 e1000_put_hw_eeprom_semaphore(hw);
3123 return; 3295 return;
@@ -3160,7 +3332,8 @@ e1000_read_phy_reg(struct e1000_hw *hw,
3160 if (e1000_swfw_sync_acquire(hw, swfw)) 3332 if (e1000_swfw_sync_acquire(hw, swfw))
3161 return -E1000_ERR_SWFW_SYNC; 3333 return -E1000_ERR_SWFW_SYNC;
3162 3334
3163 if((hw->phy_type == e1000_phy_igp || 3335 if ((hw->phy_type == e1000_phy_igp ||
3336 hw->phy_type == e1000_phy_igp_3 ||
3164 hw->phy_type == e1000_phy_igp_2) && 3337 hw->phy_type == e1000_phy_igp_2) &&
3165 (reg_addr > MAX_PHY_MULTI_PAGE_REG)) { 3338 (reg_addr > MAX_PHY_MULTI_PAGE_REG)) {
3166 ret_val = e1000_write_phy_reg_ex(hw, IGP01E1000_PHY_PAGE_SELECT, 3339 ret_val = e1000_write_phy_reg_ex(hw, IGP01E1000_PHY_PAGE_SELECT,
@@ -3299,7 +3472,8 @@ e1000_write_phy_reg(struct e1000_hw *hw,
3299 if (e1000_swfw_sync_acquire(hw, swfw)) 3472 if (e1000_swfw_sync_acquire(hw, swfw))
3300 return -E1000_ERR_SWFW_SYNC; 3473 return -E1000_ERR_SWFW_SYNC;
3301 3474
3302 if((hw->phy_type == e1000_phy_igp || 3475 if ((hw->phy_type == e1000_phy_igp ||
3476 hw->phy_type == e1000_phy_igp_3 ||
3303 hw->phy_type == e1000_phy_igp_2) && 3477 hw->phy_type == e1000_phy_igp_2) &&
3304 (reg_addr > MAX_PHY_MULTI_PAGE_REG)) { 3478 (reg_addr > MAX_PHY_MULTI_PAGE_REG)) {
3305 ret_val = e1000_write_phy_reg_ex(hw, IGP01E1000_PHY_PAGE_SELECT, 3479 ret_val = e1000_write_phy_reg_ex(hw, IGP01E1000_PHY_PAGE_SELECT,
@@ -3514,7 +3688,7 @@ e1000_phy_hw_reset(struct e1000_hw *hw)
3514 E1000_WRITE_FLUSH(hw); 3688 E1000_WRITE_FLUSH(hw);
3515 3689
3516 if (hw->mac_type >= e1000_82571) 3690 if (hw->mac_type >= e1000_82571)
3517 msec_delay(10); 3691 msec_delay_irq(10);
3518 e1000_swfw_sync_release(hw, swfw); 3692 e1000_swfw_sync_release(hw, swfw);
3519 } else { 3693 } else {
3520 /* Read the Extended Device Control Register, assert the PHY_RESET_DIR 3694 /* Read the Extended Device Control Register, assert the PHY_RESET_DIR
@@ -3544,6 +3718,12 @@ e1000_phy_hw_reset(struct e1000_hw *hw)
3544 ret_val = e1000_get_phy_cfg_done(hw); 3718 ret_val = e1000_get_phy_cfg_done(hw);
3545 e1000_release_software_semaphore(hw); 3719 e1000_release_software_semaphore(hw);
3546 3720
3721 if ((hw->mac_type == e1000_ich8lan) &&
3722 (hw->phy_type == e1000_phy_igp_3)) {
3723 ret_val = e1000_init_lcd_from_nvm(hw);
3724 if (ret_val)
3725 return ret_val;
3726 }
3547 return ret_val; 3727 return ret_val;
3548} 3728}
3549 3729
@@ -3572,9 +3752,11 @@ e1000_phy_reset(struct e1000_hw *hw)
3572 case e1000_82541_rev_2: 3752 case e1000_82541_rev_2:
3573 case e1000_82571: 3753 case e1000_82571:
3574 case e1000_82572: 3754 case e1000_82572:
3755 case e1000_ich8lan:
3575 ret_val = e1000_phy_hw_reset(hw); 3756 ret_val = e1000_phy_hw_reset(hw);
3576 if(ret_val) 3757 if(ret_val)
3577 return ret_val; 3758 return ret_val;
3759
3578 break; 3760 break;
3579 default: 3761 default:
3580 ret_val = e1000_read_phy_reg(hw, PHY_CTRL, &phy_data); 3762 ret_val = e1000_read_phy_reg(hw, PHY_CTRL, &phy_data);
@@ -3597,11 +3779,120 @@ e1000_phy_reset(struct e1000_hw *hw)
3597} 3779}
3598 3780
3599/****************************************************************************** 3781/******************************************************************************
3782* Work-around for 82566 power-down: on D3 entry-
3783* 1) disable gigabit link
3784* 2) write VR power-down enable
3785* 3) read it back
3786* if successful continue, else issue LCD reset and repeat
3787*
3788* hw - struct containing variables accessed by shared code
3789******************************************************************************/
3790void
3791e1000_phy_powerdown_workaround(struct e1000_hw *hw)
3792{
3793 int32_t reg;
3794 uint16_t phy_data;
3795 int32_t retry = 0;
3796
3797 DEBUGFUNC("e1000_phy_powerdown_workaround");
3798
3799 if (hw->phy_type != e1000_phy_igp_3)
3800 return;
3801
3802 do {
3803 /* Disable link */
3804 reg = E1000_READ_REG(hw, PHY_CTRL);
3805 E1000_WRITE_REG(hw, PHY_CTRL, reg | E1000_PHY_CTRL_GBE_DISABLE |
3806 E1000_PHY_CTRL_NOND0A_GBE_DISABLE);
3807
3808 /* Write VR power-down enable */
3809 e1000_read_phy_reg(hw, IGP3_VR_CTRL, &phy_data);
3810 e1000_write_phy_reg(hw, IGP3_VR_CTRL, phy_data |
3811 IGP3_VR_CTRL_MODE_SHUT);
3812
3813 /* Read it back and test */
3814 e1000_read_phy_reg(hw, IGP3_VR_CTRL, &phy_data);
3815 if ((phy_data & IGP3_VR_CTRL_MODE_SHUT) || retry)
3816 break;
3817
3818 /* Issue PHY reset and repeat at most one more time */
3819 reg = E1000_READ_REG(hw, CTRL);
3820 E1000_WRITE_REG(hw, CTRL, reg | E1000_CTRL_PHY_RST);
3821 retry++;
3822 } while (retry);
3823
3824 return;
3825
3826}
3827
3828/******************************************************************************
3829* Work-around for 82566 Kumeran PCS lock loss:
3830* On link status change (i.e. PCI reset, speed change) and link is up and
3831* speed is gigabit-
3832* 0) if workaround is optionally disabled do nothing
3833* 1) wait 1ms for Kumeran link to come up
3834* 2) check Kumeran Diagnostic register PCS lock loss bit
3835* 3) if not set the link is locked (all is good), otherwise...
3836* 4) reset the PHY
3837* 5) repeat up to 10 times
3838* Note: this is only called for IGP3 copper when speed is 1gb.
3839*
3840* hw - struct containing variables accessed by shared code
3841******************************************************************************/
3842int32_t
3843e1000_kumeran_lock_loss_workaround(struct e1000_hw *hw)
3844{
3845 int32_t ret_val;
3846 int32_t reg;
3847 int32_t cnt;
3848 uint16_t phy_data;
3849
3850 if (hw->kmrn_lock_loss_workaround_disabled)
3851 return E1000_SUCCESS;
3852
3853 /* Make sure link is up before proceeding. If not just return.
3854 * Attempting this while link is negotiating fouls up link
3855 * stability */
3856 ret_val = e1000_read_phy_reg(hw, PHY_STATUS, &phy_data);
3857 ret_val = e1000_read_phy_reg(hw, PHY_STATUS, &phy_data);
3858
3859 if (phy_data & MII_SR_LINK_STATUS) {
3860 for (cnt = 0; cnt < 10; cnt++) {
3861 /* read once to clear */
3862 ret_val = e1000_read_phy_reg(hw, IGP3_KMRN_DIAG, &phy_data);
3863 if (ret_val)
3864 return ret_val;
3865 /* and again to get new status */
3866 ret_val = e1000_read_phy_reg(hw, IGP3_KMRN_DIAG, &phy_data);
3867 if (ret_val)
3868 return ret_val;
3869
3870 /* check for PCS lock */
3871 if (!(phy_data & IGP3_KMRN_DIAG_PCS_LOCK_LOSS))
3872 return E1000_SUCCESS;
3873
3874 /* Issue PHY reset */
3875 e1000_phy_hw_reset(hw);
3876 msec_delay_irq(5);
3877 }
3878 /* Disable GigE link negotiation */
3879 reg = E1000_READ_REG(hw, PHY_CTRL);
3880 E1000_WRITE_REG(hw, PHY_CTRL, reg | E1000_PHY_CTRL_GBE_DISABLE |
3881 E1000_PHY_CTRL_NOND0A_GBE_DISABLE);
3882
3883 /* unable to acquire PCS lock */
3884 return E1000_ERR_PHY;
3885 }
3886
3887 return E1000_SUCCESS;
3888}
3889
3890/******************************************************************************
3600* Probes the expected PHY address for known PHY IDs 3891* Probes the expected PHY address for known PHY IDs
3601* 3892*
3602* hw - Struct containing variables accessed by shared code 3893* hw - Struct containing variables accessed by shared code
3603******************************************************************************/ 3894******************************************************************************/
3604static int32_t 3895int32_t
3605e1000_detect_gig_phy(struct e1000_hw *hw) 3896e1000_detect_gig_phy(struct e1000_hw *hw)
3606{ 3897{
3607 int32_t phy_init_status, ret_val; 3898 int32_t phy_init_status, ret_val;
@@ -3613,8 +3904,8 @@ e1000_detect_gig_phy(struct e1000_hw *hw)
3613 /* The 82571 firmware may still be configuring the PHY. In this 3904 /* The 82571 firmware may still be configuring the PHY. In this
3614 * case, we cannot access the PHY until the configuration is done. So 3905 * case, we cannot access the PHY until the configuration is done. So
3615 * we explicitly set the PHY values. */ 3906 * we explicitly set the PHY values. */
3616 if(hw->mac_type == e1000_82571 || 3907 if (hw->mac_type == e1000_82571 ||
3617 hw->mac_type == e1000_82572) { 3908 hw->mac_type == e1000_82572) {
3618 hw->phy_id = IGP01E1000_I_PHY_ID; 3909 hw->phy_id = IGP01E1000_I_PHY_ID;
3619 hw->phy_type = e1000_phy_igp_2; 3910 hw->phy_type = e1000_phy_igp_2;
3620 return E1000_SUCCESS; 3911 return E1000_SUCCESS;
@@ -3631,7 +3922,7 @@ e1000_detect_gig_phy(struct e1000_hw *hw)
3631 3922
3632 /* Read the PHY ID Registers to identify which PHY is onboard. */ 3923 /* Read the PHY ID Registers to identify which PHY is onboard. */
3633 ret_val = e1000_read_phy_reg(hw, PHY_ID1, &phy_id_high); 3924 ret_val = e1000_read_phy_reg(hw, PHY_ID1, &phy_id_high);
3634 if(ret_val) 3925 if (ret_val)
3635 return ret_val; 3926 return ret_val;
3636 3927
3637 hw->phy_id = (uint32_t) (phy_id_high << 16); 3928 hw->phy_id = (uint32_t) (phy_id_high << 16);
@@ -3669,6 +3960,12 @@ e1000_detect_gig_phy(struct e1000_hw *hw)
3669 case e1000_80003es2lan: 3960 case e1000_80003es2lan:
3670 if (hw->phy_id == GG82563_E_PHY_ID) match = TRUE; 3961 if (hw->phy_id == GG82563_E_PHY_ID) match = TRUE;
3671 break; 3962 break;
3963 case e1000_ich8lan:
3964 if (hw->phy_id == IGP03E1000_E_PHY_ID) match = TRUE;
3965 if (hw->phy_id == IFE_E_PHY_ID) match = TRUE;
3966 if (hw->phy_id == IFE_PLUS_E_PHY_ID) match = TRUE;
3967 if (hw->phy_id == IFE_C_E_PHY_ID) match = TRUE;
3968 break;
3672 default: 3969 default:
3673 DEBUGOUT1("Invalid MAC type %d\n", hw->mac_type); 3970 DEBUGOUT1("Invalid MAC type %d\n", hw->mac_type);
3674 return -E1000_ERR_CONFIG; 3971 return -E1000_ERR_CONFIG;
@@ -3784,6 +4081,53 @@ e1000_phy_igp_get_info(struct e1000_hw *hw,
3784} 4081}
3785 4082
3786/****************************************************************************** 4083/******************************************************************************
4084* Get PHY information from various PHY registers for ife PHY only.
4085*
4086* hw - Struct containing variables accessed by shared code
4087* phy_info - PHY information structure
4088******************************************************************************/
4089int32_t
4090e1000_phy_ife_get_info(struct e1000_hw *hw,
4091 struct e1000_phy_info *phy_info)
4092{
4093 int32_t ret_val;
4094 uint16_t phy_data, polarity;
4095
4096 DEBUGFUNC("e1000_phy_ife_get_info");
4097
4098 phy_info->downshift = (e1000_downshift)hw->speed_downgraded;
4099 phy_info->extended_10bt_distance = e1000_10bt_ext_dist_enable_normal;
4100
4101 ret_val = e1000_read_phy_reg(hw, IFE_PHY_SPECIAL_CONTROL, &phy_data);
4102 if (ret_val)
4103 return ret_val;
4104 phy_info->polarity_correction =
4105 (phy_data & IFE_PSC_AUTO_POLARITY_DISABLE) >>
4106 IFE_PSC_AUTO_POLARITY_DISABLE_SHIFT;
4107
4108 if (phy_info->polarity_correction == e1000_polarity_reversal_enabled) {
4109 ret_val = e1000_check_polarity(hw, &polarity);
4110 if (ret_val)
4111 return ret_val;
4112 } else {
4113 /* Polarity is forced. */
4114 polarity = (phy_data & IFE_PSC_FORCE_POLARITY) >>
4115 IFE_PSC_FORCE_POLARITY_SHIFT;
4116 }
4117 phy_info->cable_polarity = polarity;
4118
4119 ret_val = e1000_read_phy_reg(hw, IFE_PHY_MDIX_CONTROL, &phy_data);
4120 if (ret_val)
4121 return ret_val;
4122
4123 phy_info->mdix_mode =
4124 (phy_data & (IFE_PMC_AUTO_MDIX | IFE_PMC_FORCE_MDIX)) >>
4125 IFE_PMC_MDIX_MODE_SHIFT;
4126
4127 return E1000_SUCCESS;
4128}
4129
4130/******************************************************************************
3787* Get PHY information from various PHY registers fot m88 PHY only. 4131* Get PHY information from various PHY registers fot m88 PHY only.
3788* 4132*
3789* hw - Struct containing variables accessed by shared code 4133* hw - Struct containing variables accessed by shared code
@@ -3898,9 +4242,12 @@ e1000_phy_get_info(struct e1000_hw *hw,
3898 return -E1000_ERR_CONFIG; 4242 return -E1000_ERR_CONFIG;
3899 } 4243 }
3900 4244
3901 if(hw->phy_type == e1000_phy_igp || 4245 if (hw->phy_type == e1000_phy_igp ||
4246 hw->phy_type == e1000_phy_igp_3 ||
3902 hw->phy_type == e1000_phy_igp_2) 4247 hw->phy_type == e1000_phy_igp_2)
3903 return e1000_phy_igp_get_info(hw, phy_info); 4248 return e1000_phy_igp_get_info(hw, phy_info);
4249 else if (hw->phy_type == e1000_phy_ife)
4250 return e1000_phy_ife_get_info(hw, phy_info);
3904 else 4251 else
3905 return e1000_phy_m88_get_info(hw, phy_info); 4252 return e1000_phy_m88_get_info(hw, phy_info);
3906} 4253}
@@ -4049,6 +4396,35 @@ e1000_init_eeprom_params(struct e1000_hw *hw)
4049 eeprom->use_eerd = TRUE; 4396 eeprom->use_eerd = TRUE;
4050 eeprom->use_eewr = FALSE; 4397 eeprom->use_eewr = FALSE;
4051 break; 4398 break;
4399 case e1000_ich8lan:
4400 {
4401 int32_t i = 0;
4402 uint32_t flash_size = E1000_READ_ICH8_REG(hw, ICH8_FLASH_GFPREG);
4403
4404 eeprom->type = e1000_eeprom_ich8;
4405 eeprom->use_eerd = FALSE;
4406 eeprom->use_eewr = FALSE;
4407 eeprom->word_size = E1000_SHADOW_RAM_WORDS;
4408
4409 /* Zero the shadow RAM structure. But don't load it from NVM
4410 * so as to save time for driver init */
4411 if (hw->eeprom_shadow_ram != NULL) {
4412 for (i = 0; i < E1000_SHADOW_RAM_WORDS; i++) {
4413 hw->eeprom_shadow_ram[i].modified = FALSE;
4414 hw->eeprom_shadow_ram[i].eeprom_word = 0xFFFF;
4415 }
4416 }
4417
4418 hw->flash_base_addr = (flash_size & ICH8_GFPREG_BASE_MASK) *
4419 ICH8_FLASH_SECTOR_SIZE;
4420
4421 hw->flash_bank_size = ((flash_size >> 16) & ICH8_GFPREG_BASE_MASK) + 1;
4422 hw->flash_bank_size -= (flash_size & ICH8_GFPREG_BASE_MASK);
4423 hw->flash_bank_size *= ICH8_FLASH_SECTOR_SIZE;
4424 hw->flash_bank_size /= 2 * sizeof(uint16_t);
4425
4426 break;
4427 }
4052 default: 4428 default:
4053 break; 4429 break;
4054 } 4430 }
@@ -4469,7 +4845,10 @@ e1000_read_eeprom(struct e1000_hw *hw,
4469 return ret_val; 4845 return ret_val;
4470 } 4846 }
4471 4847
4472 if(eeprom->type == e1000_eeprom_spi) { 4848 if (eeprom->type == e1000_eeprom_ich8)
4849 return e1000_read_eeprom_ich8(hw, offset, words, data);
4850
4851 if (eeprom->type == e1000_eeprom_spi) {
4473 uint16_t word_in; 4852 uint16_t word_in;
4474 uint8_t read_opcode = EEPROM_READ_OPCODE_SPI; 4853 uint8_t read_opcode = EEPROM_READ_OPCODE_SPI;
4475 4854
@@ -4636,7 +5015,10 @@ e1000_is_onboard_nvm_eeprom(struct e1000_hw *hw)
4636 5015
4637 DEBUGFUNC("e1000_is_onboard_nvm_eeprom"); 5016 DEBUGFUNC("e1000_is_onboard_nvm_eeprom");
4638 5017
4639 if(hw->mac_type == e1000_82573) { 5018 if (hw->mac_type == e1000_ich8lan)
5019 return FALSE;
5020
5021 if (hw->mac_type == e1000_82573) {
4640 eecd = E1000_READ_REG(hw, EECD); 5022 eecd = E1000_READ_REG(hw, EECD);
4641 5023
4642 /* Isolate bits 15 & 16 */ 5024 /* Isolate bits 15 & 16 */
@@ -4686,8 +5068,22 @@ e1000_validate_eeprom_checksum(struct e1000_hw *hw)
4686 } 5068 }
4687 } 5069 }
4688 5070
4689 for(i = 0; i < (EEPROM_CHECKSUM_REG + 1); i++) { 5071 if (hw->mac_type == e1000_ich8lan) {
4690 if(e1000_read_eeprom(hw, i, 1, &eeprom_data) < 0) { 5072 /* Drivers must allocate the shadow ram structure for the
5073 * EEPROM checksum to be updated. Otherwise, this bit as well
5074 * as the checksum must both be set correctly for this
5075 * validation to pass.
5076 */
5077 e1000_read_eeprom(hw, 0x19, 1, &eeprom_data);
5078 if ((eeprom_data & 0x40) == 0) {
5079 eeprom_data |= 0x40;
5080 e1000_write_eeprom(hw, 0x19, 1, &eeprom_data);
5081 e1000_update_eeprom_checksum(hw);
5082 }
5083 }
5084
5085 for (i = 0; i < (EEPROM_CHECKSUM_REG + 1); i++) {
5086 if (e1000_read_eeprom(hw, i, 1, &eeprom_data) < 0) {
4691 DEBUGOUT("EEPROM Read Error\n"); 5087 DEBUGOUT("EEPROM Read Error\n");
4692 return -E1000_ERR_EEPROM; 5088 return -E1000_ERR_EEPROM;
4693 } 5089 }
@@ -4713,6 +5109,7 @@ e1000_validate_eeprom_checksum(struct e1000_hw *hw)
4713int32_t 5109int32_t
4714e1000_update_eeprom_checksum(struct e1000_hw *hw) 5110e1000_update_eeprom_checksum(struct e1000_hw *hw)
4715{ 5111{
5112 uint32_t ctrl_ext;
4716 uint16_t checksum = 0; 5113 uint16_t checksum = 0;
4717 uint16_t i, eeprom_data; 5114 uint16_t i, eeprom_data;
4718 5115
@@ -4731,6 +5128,14 @@ e1000_update_eeprom_checksum(struct e1000_hw *hw)
4731 return -E1000_ERR_EEPROM; 5128 return -E1000_ERR_EEPROM;
4732 } else if (hw->eeprom.type == e1000_eeprom_flash) { 5129 } else if (hw->eeprom.type == e1000_eeprom_flash) {
4733 e1000_commit_shadow_ram(hw); 5130 e1000_commit_shadow_ram(hw);
5131 } else if (hw->eeprom.type == e1000_eeprom_ich8) {
5132 e1000_commit_shadow_ram(hw);
5133 /* Reload the EEPROM, or else modifications will not appear
5134 * until after next adapter reset. */
5135 ctrl_ext = E1000_READ_REG(hw, CTRL_EXT);
5136 ctrl_ext |= E1000_CTRL_EXT_EE_RST;
5137 E1000_WRITE_REG(hw, CTRL_EXT, ctrl_ext);
5138 msec_delay(10);
4734 } 5139 }
4735 return E1000_SUCCESS; 5140 return E1000_SUCCESS;
4736} 5141}
@@ -4770,6 +5175,9 @@ e1000_write_eeprom(struct e1000_hw *hw,
4770 if(eeprom->use_eewr == TRUE) 5175 if(eeprom->use_eewr == TRUE)
4771 return e1000_write_eeprom_eewr(hw, offset, words, data); 5176 return e1000_write_eeprom_eewr(hw, offset, words, data);
4772 5177
5178 if (eeprom->type == e1000_eeprom_ich8)
5179 return e1000_write_eeprom_ich8(hw, offset, words, data);
5180
4773 /* Prepare the EEPROM for writing */ 5181 /* Prepare the EEPROM for writing */
4774 if (e1000_acquire_eeprom(hw) != E1000_SUCCESS) 5182 if (e1000_acquire_eeprom(hw) != E1000_SUCCESS)
4775 return -E1000_ERR_EEPROM; 5183 return -E1000_ERR_EEPROM;
@@ -4957,11 +5365,17 @@ e1000_commit_shadow_ram(struct e1000_hw *hw)
4957 uint32_t flop = 0; 5365 uint32_t flop = 0;
4958 uint32_t i = 0; 5366 uint32_t i = 0;
4959 int32_t error = E1000_SUCCESS; 5367 int32_t error = E1000_SUCCESS;
4960 5368 uint32_t old_bank_offset = 0;
4961 /* The flop register will be used to determine if flash type is STM */ 5369 uint32_t new_bank_offset = 0;
4962 flop = E1000_READ_REG(hw, FLOP); 5370 uint32_t sector_retries = 0;
5371 uint8_t low_byte = 0;
5372 uint8_t high_byte = 0;
5373 uint8_t temp_byte = 0;
5374 boolean_t sector_write_failed = FALSE;
4963 5375
4964 if (hw->mac_type == e1000_82573) { 5376 if (hw->mac_type == e1000_82573) {
5377 /* The flop register will be used to determine if flash type is STM */
5378 flop = E1000_READ_REG(hw, FLOP);
4965 for (i=0; i < attempts; i++) { 5379 for (i=0; i < attempts; i++) {
4966 eecd = E1000_READ_REG(hw, EECD); 5380 eecd = E1000_READ_REG(hw, EECD);
4967 if ((eecd & E1000_EECD_FLUPD) == 0) { 5381 if ((eecd & E1000_EECD_FLUPD) == 0) {
@@ -4995,6 +5409,106 @@ e1000_commit_shadow_ram(struct e1000_hw *hw)
4995 } 5409 }
4996 } 5410 }
4997 5411
5412 if (hw->mac_type == e1000_ich8lan && hw->eeprom_shadow_ram != NULL) {
5413 /* We're writing to the opposite bank so if we're on bank 1,
5414 * write to bank 0 etc. We also need to erase the segment that
5415 * is going to be written */
5416 if (!(E1000_READ_REG(hw, EECD) & E1000_EECD_SEC1VAL)) {
5417 new_bank_offset = hw->flash_bank_size * 2;
5418 old_bank_offset = 0;
5419 e1000_erase_ich8_4k_segment(hw, 1);
5420 } else {
5421 old_bank_offset = hw->flash_bank_size * 2;
5422 new_bank_offset = 0;
5423 e1000_erase_ich8_4k_segment(hw, 0);
5424 }
5425
5426 do {
5427 sector_write_failed = FALSE;
5428 /* Loop for every byte in the shadow RAM,
5429 * which is in units of words. */
5430 for (i = 0; i < E1000_SHADOW_RAM_WORDS; i++) {
5431 /* Determine whether to write the value stored
5432 * in the other NVM bank or a modified value stored
5433 * in the shadow RAM */
5434 if (hw->eeprom_shadow_ram[i].modified == TRUE) {
5435 low_byte = (uint8_t)hw->eeprom_shadow_ram[i].eeprom_word;
5436 e1000_read_ich8_byte(hw, (i << 1) + old_bank_offset,
5437 &temp_byte);
5438 udelay(100);
5439 error = e1000_verify_write_ich8_byte(hw,
5440 (i << 1) + new_bank_offset,
5441 low_byte);
5442 if (error != E1000_SUCCESS)
5443 sector_write_failed = TRUE;
5444 high_byte =
5445 (uint8_t)(hw->eeprom_shadow_ram[i].eeprom_word >> 8);
5446 e1000_read_ich8_byte(hw, (i << 1) + old_bank_offset + 1,
5447 &temp_byte);
5448 udelay(100);
5449 } else {
5450 e1000_read_ich8_byte(hw, (i << 1) + old_bank_offset,
5451 &low_byte);
5452 udelay(100);
5453 error = e1000_verify_write_ich8_byte(hw,
5454 (i << 1) + new_bank_offset, low_byte);
5455 if (error != E1000_SUCCESS)
5456 sector_write_failed = TRUE;
5457 e1000_read_ich8_byte(hw, (i << 1) + old_bank_offset + 1,
5458 &high_byte);
5459 }
5460
5461 /* If the word is 0x13, then make sure the signature bits
5462 * (15:14) are 11b until the commit has completed.
5463 * This will allow us to write 10b which indicates the
5464 * signature is valid. We want to do this after the write
5465 * has completed so that we don't mark the segment valid
5466 * while the write is still in progress */
5467 if (i == E1000_ICH8_NVM_SIG_WORD)
5468 high_byte = E1000_ICH8_NVM_SIG_MASK | high_byte;
5469
5470 error = e1000_verify_write_ich8_byte(hw,
5471 (i << 1) + new_bank_offset + 1, high_byte);
5472 if (error != E1000_SUCCESS)
5473 sector_write_failed = TRUE;
5474
5475 if (sector_write_failed == FALSE) {
5476 /* Clear the now not used entry in the cache */
5477 hw->eeprom_shadow_ram[i].modified = FALSE;
5478 hw->eeprom_shadow_ram[i].eeprom_word = 0xFFFF;
5479 }
5480 }
5481
5482 /* Don't bother writing the segment valid bits if sector
5483 * programming failed. */
5484 if (sector_write_failed == FALSE) {
5485 /* Finally validate the new segment by setting bit 15:14
5486 * to 10b in word 0x13 , this can be done without an
5487 * erase as well since these bits are 11 to start with
5488 * and we need to change bit 14 to 0b */
5489 e1000_read_ich8_byte(hw,
5490 E1000_ICH8_NVM_SIG_WORD * 2 + 1 + new_bank_offset,
5491 &high_byte);
5492 high_byte &= 0xBF;
5493 error = e1000_verify_write_ich8_byte(hw,
5494 E1000_ICH8_NVM_SIG_WORD * 2 + 1 + new_bank_offset,
5495 high_byte);
5496 if (error != E1000_SUCCESS)
5497 sector_write_failed = TRUE;
5498
5499 /* And invalidate the previously valid segment by setting
5500 * its signature word (0x13) high_byte to 0b. This can be
5501 * done without an erase because flash erase sets all bits
5502 * to 1's. We can write 1's to 0's without an erase */
5503 error = e1000_verify_write_ich8_byte(hw,
5504 E1000_ICH8_NVM_SIG_WORD * 2 + 1 + old_bank_offset,
5505 0);
5506 if (error != E1000_SUCCESS)
5507 sector_write_failed = TRUE;
5508 }
5509 } while (++sector_retries < 10 && sector_write_failed == TRUE);
5510 }
5511
4998 return error; 5512 return error;
4999} 5513}
5000 5514
@@ -5102,15 +5616,19 @@ e1000_init_rx_addrs(struct e1000_hw *hw)
5102 * the other port. */ 5616 * the other port. */
5103 if ((hw->mac_type == e1000_82571) && (hw->laa_is_present == TRUE)) 5617 if ((hw->mac_type == e1000_82571) && (hw->laa_is_present == TRUE))
5104 rar_num -= 1; 5618 rar_num -= 1;
5619 if (hw->mac_type == e1000_ich8lan)
5620 rar_num = E1000_RAR_ENTRIES_ICH8LAN;
5621
5105 /* Zero out the other 15 receive addresses. */ 5622 /* Zero out the other 15 receive addresses. */
5106 DEBUGOUT("Clearing RAR[1-15]\n"); 5623 DEBUGOUT("Clearing RAR[1-15]\n");
5107 for(i = 1; i < rar_num; i++) { 5624 for(i = 1; i < rar_num; i++) {
5108 E1000_WRITE_REG_ARRAY(hw, RA, (i << 1), 0); 5625 E1000_WRITE_REG_ARRAY(hw, RA, (i << 1), 0);
5626 E1000_WRITE_FLUSH(hw);
5109 E1000_WRITE_REG_ARRAY(hw, RA, ((i << 1) + 1), 0); 5627 E1000_WRITE_REG_ARRAY(hw, RA, ((i << 1) + 1), 0);
5628 E1000_WRITE_FLUSH(hw);
5110 } 5629 }
5111} 5630}
5112 5631
5113#if 0
5114/****************************************************************************** 5632/******************************************************************************
5115 * Updates the MAC's list of multicast addresses. 5633 * Updates the MAC's list of multicast addresses.
5116 * 5634 *
@@ -5145,6 +5663,8 @@ e1000_mc_addr_list_update(struct e1000_hw *hw,
5145 /* Clear RAR[1-15] */ 5663 /* Clear RAR[1-15] */
5146 DEBUGOUT(" Clearing RAR[1-15]\n"); 5664 DEBUGOUT(" Clearing RAR[1-15]\n");
5147 num_rar_entry = E1000_RAR_ENTRIES; 5665 num_rar_entry = E1000_RAR_ENTRIES;
5666 if (hw->mac_type == e1000_ich8lan)
5667 num_rar_entry = E1000_RAR_ENTRIES_ICH8LAN;
5148 /* Reserve a spot for the Locally Administered Address to work around 5668 /* Reserve a spot for the Locally Administered Address to work around
5149 * an 82571 issue in which a reset on one port will reload the MAC on 5669 * an 82571 issue in which a reset on one port will reload the MAC on
5150 * the other port. */ 5670 * the other port. */
@@ -5153,14 +5673,19 @@ e1000_mc_addr_list_update(struct e1000_hw *hw,
5153 5673
5154 for(i = rar_used_count; i < num_rar_entry; i++) { 5674 for(i = rar_used_count; i < num_rar_entry; i++) {
5155 E1000_WRITE_REG_ARRAY(hw, RA, (i << 1), 0); 5675 E1000_WRITE_REG_ARRAY(hw, RA, (i << 1), 0);
5676 E1000_WRITE_FLUSH(hw);
5156 E1000_WRITE_REG_ARRAY(hw, RA, ((i << 1) + 1), 0); 5677 E1000_WRITE_REG_ARRAY(hw, RA, ((i << 1) + 1), 0);
5678 E1000_WRITE_FLUSH(hw);
5157 } 5679 }
5158 5680
5159 /* Clear the MTA */ 5681 /* Clear the MTA */
5160 DEBUGOUT(" Clearing MTA\n"); 5682 DEBUGOUT(" Clearing MTA\n");
5161 num_mta_entry = E1000_NUM_MTA_REGISTERS; 5683 num_mta_entry = E1000_NUM_MTA_REGISTERS;
5684 if (hw->mac_type == e1000_ich8lan)
5685 num_mta_entry = E1000_NUM_MTA_REGISTERS_ICH8LAN;
5162 for(i = 0; i < num_mta_entry; i++) { 5686 for(i = 0; i < num_mta_entry; i++) {
5163 E1000_WRITE_REG_ARRAY(hw, MTA, i, 0); 5687 E1000_WRITE_REG_ARRAY(hw, MTA, i, 0);
5688 E1000_WRITE_FLUSH(hw);
5164 } 5689 }
5165 5690
5166 /* Add the new addresses */ 5691 /* Add the new addresses */
@@ -5194,7 +5719,6 @@ e1000_mc_addr_list_update(struct e1000_hw *hw,
5194 } 5719 }
5195 DEBUGOUT("MC Update Complete\n"); 5720 DEBUGOUT("MC Update Complete\n");
5196} 5721}
5197#endif /* 0 */
5198 5722
5199/****************************************************************************** 5723/******************************************************************************
5200 * Hashes an address to determine its location in the multicast table 5724 * Hashes an address to determine its location in the multicast table
@@ -5217,24 +5741,46 @@ e1000_hash_mc_addr(struct e1000_hw *hw,
5217 * LSB MSB 5741 * LSB MSB
5218 */ 5742 */
5219 case 0: 5743 case 0:
5220 /* [47:36] i.e. 0x563 for above example address */ 5744 if (hw->mac_type == e1000_ich8lan) {
5221 hash_value = ((mc_addr[4] >> 4) | (((uint16_t) mc_addr[5]) << 4)); 5745 /* [47:38] i.e. 0x158 for above example address */
5746 hash_value = ((mc_addr[4] >> 6) | (((uint16_t) mc_addr[5]) << 2));
5747 } else {
5748 /* [47:36] i.e. 0x563 for above example address */
5749 hash_value = ((mc_addr[4] >> 4) | (((uint16_t) mc_addr[5]) << 4));
5750 }
5222 break; 5751 break;
5223 case 1: 5752 case 1:
5224 /* [46:35] i.e. 0xAC6 for above example address */ 5753 if (hw->mac_type == e1000_ich8lan) {
5225 hash_value = ((mc_addr[4] >> 3) | (((uint16_t) mc_addr[5]) << 5)); 5754 /* [46:37] i.e. 0x2B1 for above example address */
5755 hash_value = ((mc_addr[4] >> 5) | (((uint16_t) mc_addr[5]) << 3));
5756 } else {
5757 /* [46:35] i.e. 0xAC6 for above example address */
5758 hash_value = ((mc_addr[4] >> 3) | (((uint16_t) mc_addr[5]) << 5));
5759 }
5226 break; 5760 break;
5227 case 2: 5761 case 2:
5228 /* [45:34] i.e. 0x5D8 for above example address */ 5762 if (hw->mac_type == e1000_ich8lan) {
5229 hash_value = ((mc_addr[4] >> 2) | (((uint16_t) mc_addr[5]) << 6)); 5763 /*[45:36] i.e. 0x163 for above example address */
5764 hash_value = ((mc_addr[4] >> 4) | (((uint16_t) mc_addr[5]) << 4));
5765 } else {
5766 /* [45:34] i.e. 0x5D8 for above example address */
5767 hash_value = ((mc_addr[4] >> 2) | (((uint16_t) mc_addr[5]) << 6));
5768 }
5230 break; 5769 break;
5231 case 3: 5770 case 3:
5232 /* [43:32] i.e. 0x634 for above example address */ 5771 if (hw->mac_type == e1000_ich8lan) {
5233 hash_value = ((mc_addr[4]) | (((uint16_t) mc_addr[5]) << 8)); 5772 /* [43:34] i.e. 0x18D for above example address */
5773 hash_value = ((mc_addr[4] >> 2) | (((uint16_t) mc_addr[5]) << 6));
5774 } else {
5775 /* [43:32] i.e. 0x634 for above example address */
5776 hash_value = ((mc_addr[4]) | (((uint16_t) mc_addr[5]) << 8));
5777 }
5234 break; 5778 break;
5235 } 5779 }
5236 5780
5237 hash_value &= 0xFFF; 5781 hash_value &= 0xFFF;
5782 if (hw->mac_type == e1000_ich8lan)
5783 hash_value &= 0x3FF;
5238 5784
5239 return hash_value; 5785 return hash_value;
5240} 5786}
@@ -5262,6 +5808,8 @@ e1000_mta_set(struct e1000_hw *hw,
5262 * register are determined by the lower 5 bits of the value. 5808 * register are determined by the lower 5 bits of the value.
5263 */ 5809 */
5264 hash_reg = (hash_value >> 5) & 0x7F; 5810 hash_reg = (hash_value >> 5) & 0x7F;
5811 if (hw->mac_type == e1000_ich8lan)
5812 hash_reg &= 0x1F;
5265 hash_bit = hash_value & 0x1F; 5813 hash_bit = hash_value & 0x1F;
5266 5814
5267 mta = E1000_READ_REG_ARRAY(hw, MTA, hash_reg); 5815 mta = E1000_READ_REG_ARRAY(hw, MTA, hash_reg);
@@ -5275,9 +5823,12 @@ e1000_mta_set(struct e1000_hw *hw,
5275 if((hw->mac_type == e1000_82544) && ((hash_reg & 0x1) == 1)) { 5823 if((hw->mac_type == e1000_82544) && ((hash_reg & 0x1) == 1)) {
5276 temp = E1000_READ_REG_ARRAY(hw, MTA, (hash_reg - 1)); 5824 temp = E1000_READ_REG_ARRAY(hw, MTA, (hash_reg - 1));
5277 E1000_WRITE_REG_ARRAY(hw, MTA, hash_reg, mta); 5825 E1000_WRITE_REG_ARRAY(hw, MTA, hash_reg, mta);
5826 E1000_WRITE_FLUSH(hw);
5278 E1000_WRITE_REG_ARRAY(hw, MTA, (hash_reg - 1), temp); 5827 E1000_WRITE_REG_ARRAY(hw, MTA, (hash_reg - 1), temp);
5828 E1000_WRITE_FLUSH(hw);
5279 } else { 5829 } else {
5280 E1000_WRITE_REG_ARRAY(hw, MTA, hash_reg, mta); 5830 E1000_WRITE_REG_ARRAY(hw, MTA, hash_reg, mta);
5831 E1000_WRITE_FLUSH(hw);
5281 } 5832 }
5282} 5833}
5283 5834
@@ -5334,7 +5885,9 @@ e1000_rar_set(struct e1000_hw *hw,
5334 } 5885 }
5335 5886
5336 E1000_WRITE_REG_ARRAY(hw, RA, (index << 1), rar_low); 5887 E1000_WRITE_REG_ARRAY(hw, RA, (index << 1), rar_low);
5888 E1000_WRITE_FLUSH(hw);
5337 E1000_WRITE_REG_ARRAY(hw, RA, ((index << 1) + 1), rar_high); 5889 E1000_WRITE_REG_ARRAY(hw, RA, ((index << 1) + 1), rar_high);
5890 E1000_WRITE_FLUSH(hw);
5338} 5891}
5339 5892
5340/****************************************************************************** 5893/******************************************************************************
@@ -5351,12 +5904,18 @@ e1000_write_vfta(struct e1000_hw *hw,
5351{ 5904{
5352 uint32_t temp; 5905 uint32_t temp;
5353 5906
5354 if((hw->mac_type == e1000_82544) && ((offset & 0x1) == 1)) { 5907 if (hw->mac_type == e1000_ich8lan)
5908 return;
5909
5910 if ((hw->mac_type == e1000_82544) && ((offset & 0x1) == 1)) {
5355 temp = E1000_READ_REG_ARRAY(hw, VFTA, (offset - 1)); 5911 temp = E1000_READ_REG_ARRAY(hw, VFTA, (offset - 1));
5356 E1000_WRITE_REG_ARRAY(hw, VFTA, offset, value); 5912 E1000_WRITE_REG_ARRAY(hw, VFTA, offset, value);
5913 E1000_WRITE_FLUSH(hw);
5357 E1000_WRITE_REG_ARRAY(hw, VFTA, (offset - 1), temp); 5914 E1000_WRITE_REG_ARRAY(hw, VFTA, (offset - 1), temp);
5915 E1000_WRITE_FLUSH(hw);
5358 } else { 5916 } else {
5359 E1000_WRITE_REG_ARRAY(hw, VFTA, offset, value); 5917 E1000_WRITE_REG_ARRAY(hw, VFTA, offset, value);
5918 E1000_WRITE_FLUSH(hw);
5360 } 5919 }
5361} 5920}
5362 5921
@@ -5373,6 +5932,9 @@ e1000_clear_vfta(struct e1000_hw *hw)
5373 uint32_t vfta_offset = 0; 5932 uint32_t vfta_offset = 0;
5374 uint32_t vfta_bit_in_reg = 0; 5933 uint32_t vfta_bit_in_reg = 0;
5375 5934
5935 if (hw->mac_type == e1000_ich8lan)
5936 return;
5937
5376 if (hw->mac_type == e1000_82573) { 5938 if (hw->mac_type == e1000_82573) {
5377 if (hw->mng_cookie.vlan_id != 0) { 5939 if (hw->mng_cookie.vlan_id != 0) {
5378 /* The VFTA is a 4096b bit-field, each identifying a single VLAN 5940 /* The VFTA is a 4096b bit-field, each identifying a single VLAN
@@ -5392,6 +5954,7 @@ e1000_clear_vfta(struct e1000_hw *hw)
5392 * manageability unit */ 5954 * manageability unit */
5393 vfta_value = (offset == vfta_offset) ? vfta_bit_in_reg : 0; 5955 vfta_value = (offset == vfta_offset) ? vfta_bit_in_reg : 0;
5394 E1000_WRITE_REG_ARRAY(hw, VFTA, offset, vfta_value); 5956 E1000_WRITE_REG_ARRAY(hw, VFTA, offset, vfta_value);
5957 E1000_WRITE_FLUSH(hw);
5395 } 5958 }
5396} 5959}
5397 5960
@@ -5421,9 +5984,18 @@ e1000_id_led_init(struct e1000_hw * hw)
5421 DEBUGOUT("EEPROM Read Error\n"); 5984 DEBUGOUT("EEPROM Read Error\n");
5422 return -E1000_ERR_EEPROM; 5985 return -E1000_ERR_EEPROM;
5423 } 5986 }
5424 if((eeprom_data== ID_LED_RESERVED_0000) || 5987
5425 (eeprom_data == ID_LED_RESERVED_FFFF)) eeprom_data = ID_LED_DEFAULT; 5988 if ((hw->mac_type == e1000_82573) &&
5426 for(i = 0; i < 4; i++) { 5989 (eeprom_data == ID_LED_RESERVED_82573))
5990 eeprom_data = ID_LED_DEFAULT_82573;
5991 else if ((eeprom_data == ID_LED_RESERVED_0000) ||
5992 (eeprom_data == ID_LED_RESERVED_FFFF)) {
5993 if (hw->mac_type == e1000_ich8lan)
5994 eeprom_data = ID_LED_DEFAULT_ICH8LAN;
5995 else
5996 eeprom_data = ID_LED_DEFAULT;
5997 }
5998 for (i = 0; i < 4; i++) {
5427 temp = (eeprom_data >> (i << 2)) & led_mask; 5999 temp = (eeprom_data >> (i << 2)) & led_mask;
5428 switch(temp) { 6000 switch(temp) {
5429 case ID_LED_ON1_DEF2: 6001 case ID_LED_ON1_DEF2:
@@ -5519,6 +6091,44 @@ e1000_setup_led(struct e1000_hw *hw)
5519} 6091}
5520 6092
5521/****************************************************************************** 6093/******************************************************************************
6094 * Used on 82571 and later Si that has LED blink bits.
6095 * Callers must use their own timer and should have already called
6096 * e1000_id_led_init()
6097 * Call e1000_cleanup led() to stop blinking
6098 *
6099 * hw - Struct containing variables accessed by shared code
6100 *****************************************************************************/
6101int32_t
6102e1000_blink_led_start(struct e1000_hw *hw)
6103{
6104 int16_t i;
6105 uint32_t ledctl_blink = 0;
6106
6107 DEBUGFUNC("e1000_id_led_blink_on");
6108
6109 if (hw->mac_type < e1000_82571) {
6110 /* Nothing to do */
6111 return E1000_SUCCESS;
6112 }
6113 if (hw->media_type == e1000_media_type_fiber) {
6114 /* always blink LED0 for PCI-E fiber */
6115 ledctl_blink = E1000_LEDCTL_LED0_BLINK |
6116 (E1000_LEDCTL_MODE_LED_ON << E1000_LEDCTL_LED0_MODE_SHIFT);
6117 } else {
6118 /* set the blink bit for each LED that's "on" (0x0E) in ledctl_mode2 */
6119 ledctl_blink = hw->ledctl_mode2;
6120 for (i=0; i < 4; i++)
6121 if (((hw->ledctl_mode2 >> (i * 8)) & 0xFF) ==
6122 E1000_LEDCTL_MODE_LED_ON)
6123 ledctl_blink |= (E1000_LEDCTL_LED0_BLINK << (i * 8));
6124 }
6125
6126 E1000_WRITE_REG(hw, LEDCTL, ledctl_blink);
6127
6128 return E1000_SUCCESS;
6129}
6130
6131/******************************************************************************
5522 * Restores the saved state of the SW controlable LED. 6132 * Restores the saved state of the SW controlable LED.
5523 * 6133 *
5524 * hw - Struct containing variables accessed by shared code 6134 * hw - Struct containing variables accessed by shared code
@@ -5548,6 +6158,10 @@ e1000_cleanup_led(struct e1000_hw *hw)
5548 return ret_val; 6158 return ret_val;
5549 /* Fall Through */ 6159 /* Fall Through */
5550 default: 6160 default:
6161 if (hw->phy_type == e1000_phy_ife) {
6162 e1000_write_phy_reg(hw, IFE_PHY_SPECIAL_CONTROL_LED, 0);
6163 break;
6164 }
5551 /* Restore LEDCTL settings */ 6165 /* Restore LEDCTL settings */
5552 E1000_WRITE_REG(hw, LEDCTL, hw->ledctl_default); 6166 E1000_WRITE_REG(hw, LEDCTL, hw->ledctl_default);
5553 break; 6167 break;
@@ -5592,7 +6206,10 @@ e1000_led_on(struct e1000_hw *hw)
5592 /* Clear SW Defineable Pin 0 to turn on the LED */ 6206 /* Clear SW Defineable Pin 0 to turn on the LED */
5593 ctrl &= ~E1000_CTRL_SWDPIN0; 6207 ctrl &= ~E1000_CTRL_SWDPIN0;
5594 ctrl |= E1000_CTRL_SWDPIO0; 6208 ctrl |= E1000_CTRL_SWDPIO0;
5595 } else if(hw->media_type == e1000_media_type_copper) { 6209 } else if (hw->phy_type == e1000_phy_ife) {
6210 e1000_write_phy_reg(hw, IFE_PHY_SPECIAL_CONTROL_LED,
6211 (IFE_PSCL_PROBE_MODE | IFE_PSCL_PROBE_LEDS_ON));
6212 } else if (hw->media_type == e1000_media_type_copper) {
5596 E1000_WRITE_REG(hw, LEDCTL, hw->ledctl_mode2); 6213 E1000_WRITE_REG(hw, LEDCTL, hw->ledctl_mode2);
5597 return E1000_SUCCESS; 6214 return E1000_SUCCESS;
5598 } 6215 }
@@ -5640,7 +6257,10 @@ e1000_led_off(struct e1000_hw *hw)
5640 /* Set SW Defineable Pin 0 to turn off the LED */ 6257 /* Set SW Defineable Pin 0 to turn off the LED */
5641 ctrl |= E1000_CTRL_SWDPIN0; 6258 ctrl |= E1000_CTRL_SWDPIN0;
5642 ctrl |= E1000_CTRL_SWDPIO0; 6259 ctrl |= E1000_CTRL_SWDPIO0;
5643 } else if(hw->media_type == e1000_media_type_copper) { 6260 } else if (hw->phy_type == e1000_phy_ife) {
6261 e1000_write_phy_reg(hw, IFE_PHY_SPECIAL_CONTROL_LED,
6262 (IFE_PSCL_PROBE_MODE | IFE_PSCL_PROBE_LEDS_OFF));
6263 } else if (hw->media_type == e1000_media_type_copper) {
5644 E1000_WRITE_REG(hw, LEDCTL, hw->ledctl_mode1); 6264 E1000_WRITE_REG(hw, LEDCTL, hw->ledctl_mode1);
5645 return E1000_SUCCESS; 6265 return E1000_SUCCESS;
5646 } 6266 }
@@ -5678,12 +6298,16 @@ e1000_clear_hw_cntrs(struct e1000_hw *hw)
5678 temp = E1000_READ_REG(hw, XOFFRXC); 6298 temp = E1000_READ_REG(hw, XOFFRXC);
5679 temp = E1000_READ_REG(hw, XOFFTXC); 6299 temp = E1000_READ_REG(hw, XOFFTXC);
5680 temp = E1000_READ_REG(hw, FCRUC); 6300 temp = E1000_READ_REG(hw, FCRUC);
6301
6302 if (hw->mac_type != e1000_ich8lan) {
5681 temp = E1000_READ_REG(hw, PRC64); 6303 temp = E1000_READ_REG(hw, PRC64);
5682 temp = E1000_READ_REG(hw, PRC127); 6304 temp = E1000_READ_REG(hw, PRC127);
5683 temp = E1000_READ_REG(hw, PRC255); 6305 temp = E1000_READ_REG(hw, PRC255);
5684 temp = E1000_READ_REG(hw, PRC511); 6306 temp = E1000_READ_REG(hw, PRC511);
5685 temp = E1000_READ_REG(hw, PRC1023); 6307 temp = E1000_READ_REG(hw, PRC1023);
5686 temp = E1000_READ_REG(hw, PRC1522); 6308 temp = E1000_READ_REG(hw, PRC1522);
6309 }
6310
5687 temp = E1000_READ_REG(hw, GPRC); 6311 temp = E1000_READ_REG(hw, GPRC);
5688 temp = E1000_READ_REG(hw, BPRC); 6312 temp = E1000_READ_REG(hw, BPRC);
5689 temp = E1000_READ_REG(hw, MPRC); 6313 temp = E1000_READ_REG(hw, MPRC);
@@ -5703,12 +6327,16 @@ e1000_clear_hw_cntrs(struct e1000_hw *hw)
5703 temp = E1000_READ_REG(hw, TOTH); 6327 temp = E1000_READ_REG(hw, TOTH);
5704 temp = E1000_READ_REG(hw, TPR); 6328 temp = E1000_READ_REG(hw, TPR);
5705 temp = E1000_READ_REG(hw, TPT); 6329 temp = E1000_READ_REG(hw, TPT);
6330
6331 if (hw->mac_type != e1000_ich8lan) {
5706 temp = E1000_READ_REG(hw, PTC64); 6332 temp = E1000_READ_REG(hw, PTC64);
5707 temp = E1000_READ_REG(hw, PTC127); 6333 temp = E1000_READ_REG(hw, PTC127);
5708 temp = E1000_READ_REG(hw, PTC255); 6334 temp = E1000_READ_REG(hw, PTC255);
5709 temp = E1000_READ_REG(hw, PTC511); 6335 temp = E1000_READ_REG(hw, PTC511);
5710 temp = E1000_READ_REG(hw, PTC1023); 6336 temp = E1000_READ_REG(hw, PTC1023);
5711 temp = E1000_READ_REG(hw, PTC1522); 6337 temp = E1000_READ_REG(hw, PTC1522);
6338 }
6339
5712 temp = E1000_READ_REG(hw, MPTC); 6340 temp = E1000_READ_REG(hw, MPTC);
5713 temp = E1000_READ_REG(hw, BPTC); 6341 temp = E1000_READ_REG(hw, BPTC);
5714 6342
@@ -5731,6 +6359,9 @@ e1000_clear_hw_cntrs(struct e1000_hw *hw)
5731 6359
5732 temp = E1000_READ_REG(hw, IAC); 6360 temp = E1000_READ_REG(hw, IAC);
5733 temp = E1000_READ_REG(hw, ICRXOC); 6361 temp = E1000_READ_REG(hw, ICRXOC);
6362
6363 if (hw->mac_type == e1000_ich8lan) return;
6364
5734 temp = E1000_READ_REG(hw, ICRXPTC); 6365 temp = E1000_READ_REG(hw, ICRXPTC);
5735 temp = E1000_READ_REG(hw, ICRXATC); 6366 temp = E1000_READ_REG(hw, ICRXATC);
5736 temp = E1000_READ_REG(hw, ICTXPTC); 6367 temp = E1000_READ_REG(hw, ICTXPTC);
@@ -5911,6 +6542,7 @@ e1000_get_bus_info(struct e1000_hw *hw)
5911 hw->bus_width = e1000_bus_width_pciex_1; 6542 hw->bus_width = e1000_bus_width_pciex_1;
5912 break; 6543 break;
5913 case e1000_82571: 6544 case e1000_82571:
6545 case e1000_ich8lan:
5914 case e1000_80003es2lan: 6546 case e1000_80003es2lan:
5915 hw->bus_type = e1000_bus_type_pci_express; 6547 hw->bus_type = e1000_bus_type_pci_express;
5916 hw->bus_speed = e1000_bus_speed_2500; 6548 hw->bus_speed = e1000_bus_speed_2500;
@@ -5948,8 +6580,6 @@ e1000_get_bus_info(struct e1000_hw *hw)
5948 break; 6580 break;
5949 } 6581 }
5950} 6582}
5951
5952#if 0
5953/****************************************************************************** 6583/******************************************************************************
5954 * Reads a value from one of the devices registers using port I/O (as opposed 6584 * Reads a value from one of the devices registers using port I/O (as opposed
5955 * memory mapped I/O). Only 82544 and newer devices support port I/O. 6585 * memory mapped I/O). Only 82544 and newer devices support port I/O.
@@ -5967,7 +6597,6 @@ e1000_read_reg_io(struct e1000_hw *hw,
5967 e1000_io_write(hw, io_addr, offset); 6597 e1000_io_write(hw, io_addr, offset);
5968 return e1000_io_read(hw, io_data); 6598 return e1000_io_read(hw, io_data);
5969} 6599}
5970#endif /* 0 */
5971 6600
5972/****************************************************************************** 6601/******************************************************************************
5973 * Writes a value to one of the devices registers using port I/O (as opposed to 6602 * Writes a value to one of the devices registers using port I/O (as opposed to
@@ -6012,8 +6641,6 @@ e1000_get_cable_length(struct e1000_hw *hw,
6012{ 6641{
6013 int32_t ret_val; 6642 int32_t ret_val;
6014 uint16_t agc_value = 0; 6643 uint16_t agc_value = 0;
6015 uint16_t cur_agc, min_agc = IGP01E1000_AGC_LENGTH_TABLE_SIZE;
6016 uint16_t max_agc = 0;
6017 uint16_t i, phy_data; 6644 uint16_t i, phy_data;
6018 uint16_t cable_length; 6645 uint16_t cable_length;
6019 6646
@@ -6086,6 +6713,8 @@ e1000_get_cable_length(struct e1000_hw *hw,
6086 break; 6713 break;
6087 } 6714 }
6088 } else if(hw->phy_type == e1000_phy_igp) { /* For IGP PHY */ 6715 } else if(hw->phy_type == e1000_phy_igp) { /* For IGP PHY */
6716 uint16_t cur_agc_value;
6717 uint16_t min_agc_value = IGP01E1000_AGC_LENGTH_TABLE_SIZE;
6089 uint16_t agc_reg_array[IGP01E1000_PHY_CHANNEL_NUM] = 6718 uint16_t agc_reg_array[IGP01E1000_PHY_CHANNEL_NUM] =
6090 {IGP01E1000_PHY_AGC_A, 6719 {IGP01E1000_PHY_AGC_A,
6091 IGP01E1000_PHY_AGC_B, 6720 IGP01E1000_PHY_AGC_B,
@@ -6098,23 +6727,23 @@ e1000_get_cable_length(struct e1000_hw *hw,
6098 if(ret_val) 6727 if(ret_val)
6099 return ret_val; 6728 return ret_val;
6100 6729
6101 cur_agc = phy_data >> IGP01E1000_AGC_LENGTH_SHIFT; 6730 cur_agc_value = phy_data >> IGP01E1000_AGC_LENGTH_SHIFT;
6102 6731
6103 /* Array bound check. */ 6732 /* Value bound check. */
6104 if((cur_agc >= IGP01E1000_AGC_LENGTH_TABLE_SIZE - 1) || 6733 if ((cur_agc_value >= IGP01E1000_AGC_LENGTH_TABLE_SIZE - 1) ||
6105 (cur_agc == 0)) 6734 (cur_agc_value == 0))
6106 return -E1000_ERR_PHY; 6735 return -E1000_ERR_PHY;
6107 6736
6108 agc_value += cur_agc; 6737 agc_value += cur_agc_value;
6109 6738
6110 /* Update minimal AGC value. */ 6739 /* Update minimal AGC value. */
6111 if(min_agc > cur_agc) 6740 if (min_agc_value > cur_agc_value)
6112 min_agc = cur_agc; 6741 min_agc_value = cur_agc_value;
6113 } 6742 }
6114 6743
6115 /* Remove the minimal AGC result for length < 50m */ 6744 /* Remove the minimal AGC result for length < 50m */
6116 if(agc_value < IGP01E1000_PHY_CHANNEL_NUM * e1000_igp_cable_length_50) { 6745 if (agc_value < IGP01E1000_PHY_CHANNEL_NUM * e1000_igp_cable_length_50) {
6117 agc_value -= min_agc; 6746 agc_value -= min_agc_value;
6118 6747
6119 /* Get the average length of the remaining 3 channels */ 6748 /* Get the average length of the remaining 3 channels */
6120 agc_value /= (IGP01E1000_PHY_CHANNEL_NUM - 1); 6749 agc_value /= (IGP01E1000_PHY_CHANNEL_NUM - 1);
@@ -6130,7 +6759,10 @@ e1000_get_cable_length(struct e1000_hw *hw,
6130 IGP01E1000_AGC_RANGE) : 0; 6759 IGP01E1000_AGC_RANGE) : 0;
6131 *max_length = e1000_igp_cable_length_table[agc_value] + 6760 *max_length = e1000_igp_cable_length_table[agc_value] +
6132 IGP01E1000_AGC_RANGE; 6761 IGP01E1000_AGC_RANGE;
6133 } else if (hw->phy_type == e1000_phy_igp_2) { 6762 } else if (hw->phy_type == e1000_phy_igp_2 ||
6763 hw->phy_type == e1000_phy_igp_3) {
6764 uint16_t cur_agc_index, max_agc_index = 0;
6765 uint16_t min_agc_index = IGP02E1000_AGC_LENGTH_TABLE_SIZE - 1;
6134 uint16_t agc_reg_array[IGP02E1000_PHY_CHANNEL_NUM] = 6766 uint16_t agc_reg_array[IGP02E1000_PHY_CHANNEL_NUM] =
6135 {IGP02E1000_PHY_AGC_A, 6767 {IGP02E1000_PHY_AGC_A,
6136 IGP02E1000_PHY_AGC_B, 6768 IGP02E1000_PHY_AGC_B,
@@ -6145,19 +6777,27 @@ e1000_get_cable_length(struct e1000_hw *hw,
6145 /* Getting bits 15:9, which represent the combination of course and 6777 /* Getting bits 15:9, which represent the combination of course and
6146 * fine gain values. The result is a number that can be put into 6778 * fine gain values. The result is a number that can be put into
6147 * the lookup table to obtain the approximate cable length. */ 6779 * the lookup table to obtain the approximate cable length. */
6148 cur_agc = (phy_data >> IGP02E1000_AGC_LENGTH_SHIFT) & 6780 cur_agc_index = (phy_data >> IGP02E1000_AGC_LENGTH_SHIFT) &
6149 IGP02E1000_AGC_LENGTH_MASK; 6781 IGP02E1000_AGC_LENGTH_MASK;
6150 6782
6151 /* Remove min & max AGC values from calculation. */ 6783 /* Array index bound check. */
6152 if (e1000_igp_2_cable_length_table[min_agc] > e1000_igp_2_cable_length_table[cur_agc]) 6784 if ((cur_agc_index >= IGP02E1000_AGC_LENGTH_TABLE_SIZE) ||
6153 min_agc = cur_agc; 6785 (cur_agc_index == 0))
6154 if (e1000_igp_2_cable_length_table[max_agc] < e1000_igp_2_cable_length_table[cur_agc]) 6786 return -E1000_ERR_PHY;
6155 max_agc = cur_agc;
6156 6787
6157 agc_value += e1000_igp_2_cable_length_table[cur_agc]; 6788 /* Remove min & max AGC values from calculation. */
6789 if (e1000_igp_2_cable_length_table[min_agc_index] >
6790 e1000_igp_2_cable_length_table[cur_agc_index])
6791 min_agc_index = cur_agc_index;
6792 if (e1000_igp_2_cable_length_table[max_agc_index] <
6793 e1000_igp_2_cable_length_table[cur_agc_index])
6794 max_agc_index = cur_agc_index;
6795
6796 agc_value += e1000_igp_2_cable_length_table[cur_agc_index];
6158 } 6797 }
6159 6798
6160 agc_value -= (e1000_igp_2_cable_length_table[min_agc] + e1000_igp_2_cable_length_table[max_agc]); 6799 agc_value -= (e1000_igp_2_cable_length_table[min_agc_index] +
6800 e1000_igp_2_cable_length_table[max_agc_index]);
6161 agc_value /= (IGP02E1000_PHY_CHANNEL_NUM - 2); 6801 agc_value /= (IGP02E1000_PHY_CHANNEL_NUM - 2);
6162 6802
6163 /* Calculate cable length with the error range of +/- 10 meters. */ 6803 /* Calculate cable length with the error range of +/- 10 meters. */
@@ -6203,7 +6843,8 @@ e1000_check_polarity(struct e1000_hw *hw,
6203 return ret_val; 6843 return ret_val;
6204 *polarity = (phy_data & M88E1000_PSSR_REV_POLARITY) >> 6844 *polarity = (phy_data & M88E1000_PSSR_REV_POLARITY) >>
6205 M88E1000_PSSR_REV_POLARITY_SHIFT; 6845 M88E1000_PSSR_REV_POLARITY_SHIFT;
6206 } else if(hw->phy_type == e1000_phy_igp || 6846 } else if (hw->phy_type == e1000_phy_igp ||
6847 hw->phy_type == e1000_phy_igp_3 ||
6207 hw->phy_type == e1000_phy_igp_2) { 6848 hw->phy_type == e1000_phy_igp_2) {
6208 /* Read the Status register to check the speed */ 6849 /* Read the Status register to check the speed */
6209 ret_val = e1000_read_phy_reg(hw, IGP01E1000_PHY_PORT_STATUS, 6850 ret_val = e1000_read_phy_reg(hw, IGP01E1000_PHY_PORT_STATUS,
@@ -6229,6 +6870,13 @@ e1000_check_polarity(struct e1000_hw *hw,
6229 * 100 Mbps this bit is always 0) */ 6870 * 100 Mbps this bit is always 0) */
6230 *polarity = phy_data & IGP01E1000_PSSR_POLARITY_REVERSED; 6871 *polarity = phy_data & IGP01E1000_PSSR_POLARITY_REVERSED;
6231 } 6872 }
6873 } else if (hw->phy_type == e1000_phy_ife) {
6874 ret_val = e1000_read_phy_reg(hw, IFE_PHY_EXTENDED_STATUS_CONTROL,
6875 &phy_data);
6876 if (ret_val)
6877 return ret_val;
6878 *polarity = (phy_data & IFE_PESC_POLARITY_REVERSED) >>
6879 IFE_PESC_POLARITY_REVERSED_SHIFT;
6232 } 6880 }
6233 return E1000_SUCCESS; 6881 return E1000_SUCCESS;
6234} 6882}
@@ -6256,7 +6904,8 @@ e1000_check_downshift(struct e1000_hw *hw)
6256 6904
6257 DEBUGFUNC("e1000_check_downshift"); 6905 DEBUGFUNC("e1000_check_downshift");
6258 6906
6259 if(hw->phy_type == e1000_phy_igp || 6907 if (hw->phy_type == e1000_phy_igp ||
6908 hw->phy_type == e1000_phy_igp_3 ||
6260 hw->phy_type == e1000_phy_igp_2) { 6909 hw->phy_type == e1000_phy_igp_2) {
6261 ret_val = e1000_read_phy_reg(hw, IGP01E1000_PHY_LINK_HEALTH, 6910 ret_val = e1000_read_phy_reg(hw, IGP01E1000_PHY_LINK_HEALTH,
6262 &phy_data); 6911 &phy_data);
@@ -6273,6 +6922,9 @@ e1000_check_downshift(struct e1000_hw *hw)
6273 6922
6274 hw->speed_downgraded = (phy_data & M88E1000_PSSR_DOWNSHIFT) >> 6923 hw->speed_downgraded = (phy_data & M88E1000_PSSR_DOWNSHIFT) >>
6275 M88E1000_PSSR_DOWNSHIFT_SHIFT; 6924 M88E1000_PSSR_DOWNSHIFT_SHIFT;
6925 } else if (hw->phy_type == e1000_phy_ife) {
6926 /* e1000_phy_ife supports 10/100 speed only */
6927 hw->speed_downgraded = FALSE;
6276 } 6928 }
6277 6929
6278 return E1000_SUCCESS; 6930 return E1000_SUCCESS;
@@ -6317,7 +6969,9 @@ e1000_config_dsp_after_link_change(struct e1000_hw *hw,
6317 6969
6318 if(speed == SPEED_1000) { 6970 if(speed == SPEED_1000) {
6319 6971
6320 e1000_get_cable_length(hw, &min_length, &max_length); 6972 ret_val = e1000_get_cable_length(hw, &min_length, &max_length);
6973 if (ret_val)
6974 return ret_val;
6321 6975
6322 if((hw->dsp_config_state == e1000_dsp_config_enabled) && 6976 if((hw->dsp_config_state == e1000_dsp_config_enabled) &&
6323 min_length >= e1000_igp_cable_length_50) { 6977 min_length >= e1000_igp_cable_length_50) {
@@ -6525,20 +7179,27 @@ static int32_t
6525e1000_set_d3_lplu_state(struct e1000_hw *hw, 7179e1000_set_d3_lplu_state(struct e1000_hw *hw,
6526 boolean_t active) 7180 boolean_t active)
6527{ 7181{
7182 uint32_t phy_ctrl = 0;
6528 int32_t ret_val; 7183 int32_t ret_val;
6529 uint16_t phy_data; 7184 uint16_t phy_data;
6530 DEBUGFUNC("e1000_set_d3_lplu_state"); 7185 DEBUGFUNC("e1000_set_d3_lplu_state");
6531 7186
6532 if(hw->phy_type != e1000_phy_igp && hw->phy_type != e1000_phy_igp_2) 7187 if (hw->phy_type != e1000_phy_igp && hw->phy_type != e1000_phy_igp_2
7188 && hw->phy_type != e1000_phy_igp_3)
6533 return E1000_SUCCESS; 7189 return E1000_SUCCESS;
6534 7190
6535 /* During driver activity LPLU should not be used or it will attain link 7191 /* During driver activity LPLU should not be used or it will attain link
6536 * from the lowest speeds starting from 10Mbps. The capability is used for 7192 * from the lowest speeds starting from 10Mbps. The capability is used for
6537 * Dx transitions and states */ 7193 * Dx transitions and states */
6538 if(hw->mac_type == e1000_82541_rev_2 || hw->mac_type == e1000_82547_rev_2) { 7194 if (hw->mac_type == e1000_82541_rev_2 || hw->mac_type == e1000_82547_rev_2) {
6539 ret_val = e1000_read_phy_reg(hw, IGP01E1000_GMII_FIFO, &phy_data); 7195 ret_val = e1000_read_phy_reg(hw, IGP01E1000_GMII_FIFO, &phy_data);
6540 if(ret_val) 7196 if (ret_val)
6541 return ret_val; 7197 return ret_val;
7198 } else if (hw->mac_type == e1000_ich8lan) {
7199 /* MAC writes into PHY register based on the state transition
7200 * and start auto-negotiation. SW driver can overwrite the settings
7201 * in CSR PHY power control E1000_PHY_CTRL register. */
7202 phy_ctrl = E1000_READ_REG(hw, PHY_CTRL);
6542 } else { 7203 } else {
6543 ret_val = e1000_read_phy_reg(hw, IGP02E1000_PHY_POWER_MGMT, &phy_data); 7204 ret_val = e1000_read_phy_reg(hw, IGP02E1000_PHY_POWER_MGMT, &phy_data);
6544 if(ret_val) 7205 if(ret_val)
@@ -6553,11 +7214,16 @@ e1000_set_d3_lplu_state(struct e1000_hw *hw,
6553 if(ret_val) 7214 if(ret_val)
6554 return ret_val; 7215 return ret_val;
6555 } else { 7216 } else {
7217 if (hw->mac_type == e1000_ich8lan) {
7218 phy_ctrl &= ~E1000_PHY_CTRL_NOND0A_LPLU;
7219 E1000_WRITE_REG(hw, PHY_CTRL, phy_ctrl);
7220 } else {
6556 phy_data &= ~IGP02E1000_PM_D3_LPLU; 7221 phy_data &= ~IGP02E1000_PM_D3_LPLU;
6557 ret_val = e1000_write_phy_reg(hw, IGP02E1000_PHY_POWER_MGMT, 7222 ret_val = e1000_write_phy_reg(hw, IGP02E1000_PHY_POWER_MGMT,
6558 phy_data); 7223 phy_data);
6559 if (ret_val) 7224 if (ret_val)
6560 return ret_val; 7225 return ret_val;
7226 }
6561 } 7227 }
6562 7228
6563 /* LPLU and SmartSpeed are mutually exclusive. LPLU is used during 7229 /* LPLU and SmartSpeed are mutually exclusive. LPLU is used during
@@ -6593,17 +7259,22 @@ e1000_set_d3_lplu_state(struct e1000_hw *hw,
6593 (hw->autoneg_advertised == AUTONEG_ADVERTISE_10_100_ALL)) { 7259 (hw->autoneg_advertised == AUTONEG_ADVERTISE_10_100_ALL)) {
6594 7260
6595 if(hw->mac_type == e1000_82541_rev_2 || 7261 if(hw->mac_type == e1000_82541_rev_2 ||
6596 hw->mac_type == e1000_82547_rev_2) { 7262 hw->mac_type == e1000_82547_rev_2) {
6597 phy_data |= IGP01E1000_GMII_FLEX_SPD; 7263 phy_data |= IGP01E1000_GMII_FLEX_SPD;
6598 ret_val = e1000_write_phy_reg(hw, IGP01E1000_GMII_FIFO, phy_data); 7264 ret_val = e1000_write_phy_reg(hw, IGP01E1000_GMII_FIFO, phy_data);
6599 if(ret_val) 7265 if(ret_val)
6600 return ret_val; 7266 return ret_val;
6601 } else { 7267 } else {
7268 if (hw->mac_type == e1000_ich8lan) {
7269 phy_ctrl |= E1000_PHY_CTRL_NOND0A_LPLU;
7270 E1000_WRITE_REG(hw, PHY_CTRL, phy_ctrl);
7271 } else {
6602 phy_data |= IGP02E1000_PM_D3_LPLU; 7272 phy_data |= IGP02E1000_PM_D3_LPLU;
6603 ret_val = e1000_write_phy_reg(hw, IGP02E1000_PHY_POWER_MGMT, 7273 ret_val = e1000_write_phy_reg(hw, IGP02E1000_PHY_POWER_MGMT,
6604 phy_data); 7274 phy_data);
6605 if (ret_val) 7275 if (ret_val)
6606 return ret_val; 7276 return ret_val;
7277 }
6607 } 7278 }
6608 7279
6609 /* When LPLU is enabled we should disable SmartSpeed */ 7280 /* When LPLU is enabled we should disable SmartSpeed */
@@ -6638,6 +7309,7 @@ static int32_t
6638e1000_set_d0_lplu_state(struct e1000_hw *hw, 7309e1000_set_d0_lplu_state(struct e1000_hw *hw,
6639 boolean_t active) 7310 boolean_t active)
6640{ 7311{
7312 uint32_t phy_ctrl = 0;
6641 int32_t ret_val; 7313 int32_t ret_val;
6642 uint16_t phy_data; 7314 uint16_t phy_data;
6643 DEBUGFUNC("e1000_set_d0_lplu_state"); 7315 DEBUGFUNC("e1000_set_d0_lplu_state");
@@ -6645,15 +7317,24 @@ e1000_set_d0_lplu_state(struct e1000_hw *hw,
6645 if(hw->mac_type <= e1000_82547_rev_2) 7317 if(hw->mac_type <= e1000_82547_rev_2)
6646 return E1000_SUCCESS; 7318 return E1000_SUCCESS;
6647 7319
7320 if (hw->mac_type == e1000_ich8lan) {
7321 phy_ctrl = E1000_READ_REG(hw, PHY_CTRL);
7322 } else {
6648 ret_val = e1000_read_phy_reg(hw, IGP02E1000_PHY_POWER_MGMT, &phy_data); 7323 ret_val = e1000_read_phy_reg(hw, IGP02E1000_PHY_POWER_MGMT, &phy_data);
6649 if(ret_val) 7324 if(ret_val)
6650 return ret_val; 7325 return ret_val;
7326 }
6651 7327
6652 if (!active) { 7328 if (!active) {
7329 if (hw->mac_type == e1000_ich8lan) {
7330 phy_ctrl &= ~E1000_PHY_CTRL_D0A_LPLU;
7331 E1000_WRITE_REG(hw, PHY_CTRL, phy_ctrl);
7332 } else {
6653 phy_data &= ~IGP02E1000_PM_D0_LPLU; 7333 phy_data &= ~IGP02E1000_PM_D0_LPLU;
6654 ret_val = e1000_write_phy_reg(hw, IGP02E1000_PHY_POWER_MGMT, phy_data); 7334 ret_val = e1000_write_phy_reg(hw, IGP02E1000_PHY_POWER_MGMT, phy_data);
6655 if (ret_val) 7335 if (ret_val)
6656 return ret_val; 7336 return ret_val;
7337 }
6657 7338
6658 /* LPLU and SmartSpeed are mutually exclusive. LPLU is used during 7339 /* LPLU and SmartSpeed are mutually exclusive. LPLU is used during
6659 * Dx states where the power conservation is most important. During 7340 * Dx states where the power conservation is most important. During
@@ -6686,10 +7367,15 @@ e1000_set_d0_lplu_state(struct e1000_hw *hw,
6686 7367
6687 } else { 7368 } else {
6688 7369
7370 if (hw->mac_type == e1000_ich8lan) {
7371 phy_ctrl |= E1000_PHY_CTRL_D0A_LPLU;
7372 E1000_WRITE_REG(hw, PHY_CTRL, phy_ctrl);
7373 } else {
6689 phy_data |= IGP02E1000_PM_D0_LPLU; 7374 phy_data |= IGP02E1000_PM_D0_LPLU;
6690 ret_val = e1000_write_phy_reg(hw, IGP02E1000_PHY_POWER_MGMT, phy_data); 7375 ret_val = e1000_write_phy_reg(hw, IGP02E1000_PHY_POWER_MGMT, phy_data);
6691 if (ret_val) 7376 if (ret_val)
6692 return ret_val; 7377 return ret_val;
7378 }
6693 7379
6694 /* When LPLU is enabled we should disable SmartSpeed */ 7380 /* When LPLU is enabled we should disable SmartSpeed */
6695 ret_val = e1000_read_phy_reg(hw, IGP01E1000_PHY_PORT_CONFIG, &phy_data); 7381 ret_val = e1000_read_phy_reg(hw, IGP01E1000_PHY_PORT_CONFIG, &phy_data);
@@ -6928,8 +7614,10 @@ e1000_mng_write_cmd_header(struct e1000_hw * hw,
6928 7614
6929 length >>= 2; 7615 length >>= 2;
6930 /* The device driver writes the relevant command block into the ram area. */ 7616 /* The device driver writes the relevant command block into the ram area. */
6931 for (i = 0; i < length; i++) 7617 for (i = 0; i < length; i++) {
6932 E1000_WRITE_REG_ARRAY_DWORD(hw, HOST_IF, i, *((uint32_t *) hdr + i)); 7618 E1000_WRITE_REG_ARRAY_DWORD(hw, HOST_IF, i, *((uint32_t *) hdr + i));
7619 E1000_WRITE_FLUSH(hw);
7620 }
6933 7621
6934 return E1000_SUCCESS; 7622 return E1000_SUCCESS;
6935} 7623}
@@ -6961,15 +7649,18 @@ e1000_mng_write_commit(
6961 * returns - TRUE when the mode is IAMT or FALSE. 7649 * returns - TRUE when the mode is IAMT or FALSE.
6962 ****************************************************************************/ 7650 ****************************************************************************/
6963boolean_t 7651boolean_t
6964e1000_check_mng_mode( 7652e1000_check_mng_mode(struct e1000_hw *hw)
6965 struct e1000_hw *hw)
6966{ 7653{
6967 uint32_t fwsm; 7654 uint32_t fwsm;
6968 7655
6969 fwsm = E1000_READ_REG(hw, FWSM); 7656 fwsm = E1000_READ_REG(hw, FWSM);
6970 7657
6971 if((fwsm & E1000_FWSM_MODE_MASK) == 7658 if (hw->mac_type == e1000_ich8lan) {
6972 (E1000_MNG_IAMT_MODE << E1000_FWSM_MODE_SHIFT)) 7659 if ((fwsm & E1000_FWSM_MODE_MASK) ==
7660 (E1000_MNG_ICH_IAMT_MODE << E1000_FWSM_MODE_SHIFT))
7661 return TRUE;
7662 } else if ((fwsm & E1000_FWSM_MODE_MASK) ==
7663 (E1000_MNG_IAMT_MODE << E1000_FWSM_MODE_SHIFT))
6973 return TRUE; 7664 return TRUE;
6974 7665
6975 return FALSE; 7666 return FALSE;
@@ -7209,7 +7900,6 @@ e1000_set_pci_express_master_disable(struct e1000_hw *hw)
7209 E1000_WRITE_REG(hw, CTRL, ctrl); 7900 E1000_WRITE_REG(hw, CTRL, ctrl);
7210} 7901}
7211 7902
7212#if 0
7213/*************************************************************************** 7903/***************************************************************************
7214 * 7904 *
7215 * Enables PCI-Express master access. 7905 * Enables PCI-Express master access.
@@ -7233,7 +7923,6 @@ e1000_enable_pciex_master(struct e1000_hw *hw)
7233 ctrl &= ~E1000_CTRL_GIO_MASTER_DISABLE; 7923 ctrl &= ~E1000_CTRL_GIO_MASTER_DISABLE;
7234 E1000_WRITE_REG(hw, CTRL, ctrl); 7924 E1000_WRITE_REG(hw, CTRL, ctrl);
7235} 7925}
7236#endif /* 0 */
7237 7926
7238/******************************************************************************* 7927/*******************************************************************************
7239 * 7928 *
@@ -7299,8 +7988,10 @@ e1000_get_auto_rd_done(struct e1000_hw *hw)
7299 case e1000_82572: 7988 case e1000_82572:
7300 case e1000_82573: 7989 case e1000_82573:
7301 case e1000_80003es2lan: 7990 case e1000_80003es2lan:
7302 while(timeout) { 7991 case e1000_ich8lan:
7303 if (E1000_READ_REG(hw, EECD) & E1000_EECD_AUTO_RD) break; 7992 while (timeout) {
7993 if (E1000_READ_REG(hw, EECD) & E1000_EECD_AUTO_RD)
7994 break;
7304 else msec_delay(1); 7995 else msec_delay(1);
7305 timeout--; 7996 timeout--;
7306 } 7997 }
@@ -7340,7 +8031,7 @@ e1000_get_phy_cfg_done(struct e1000_hw *hw)
7340 8031
7341 switch (hw->mac_type) { 8032 switch (hw->mac_type) {
7342 default: 8033 default:
7343 msec_delay(10); 8034 msec_delay_irq(10);
7344 break; 8035 break;
7345 case e1000_80003es2lan: 8036 case e1000_80003es2lan:
7346 /* Separate *_CFG_DONE_* bit for each port */ 8037 /* Separate *_CFG_DONE_* bit for each port */
@@ -7523,6 +8214,13 @@ int32_t
7523e1000_check_phy_reset_block(struct e1000_hw *hw) 8214e1000_check_phy_reset_block(struct e1000_hw *hw)
7524{ 8215{
7525 uint32_t manc = 0; 8216 uint32_t manc = 0;
8217 uint32_t fwsm = 0;
8218
8219 if (hw->mac_type == e1000_ich8lan) {
8220 fwsm = E1000_READ_REG(hw, FWSM);
8221 return (fwsm & E1000_FWSM_RSPCIPHY) ? E1000_SUCCESS
8222 : E1000_BLK_PHY_RESET;
8223 }
7526 8224
7527 if (hw->mac_type > e1000_82547_rev_2) 8225 if (hw->mac_type > e1000_82547_rev_2)
7528 manc = E1000_READ_REG(hw, MANC); 8226 manc = E1000_READ_REG(hw, MANC);
@@ -7549,6 +8247,8 @@ e1000_arc_subsystem_valid(struct e1000_hw *hw)
7549 if((fwsm & E1000_FWSM_MODE_MASK) != 0) 8247 if((fwsm & E1000_FWSM_MODE_MASK) != 0)
7550 return TRUE; 8248 return TRUE;
7551 break; 8249 break;
8250 case e1000_ich8lan:
8251 return TRUE;
7552 default: 8252 default:
7553 break; 8253 break;
7554 } 8254 }
@@ -7556,4 +8256,846 @@ e1000_arc_subsystem_valid(struct e1000_hw *hw)
7556} 8256}
7557 8257
7558 8258
8259/******************************************************************************
8260 * Configure PCI-Ex no-snoop
8261 *
8262 * hw - Struct containing variables accessed by shared code.
8263 * no_snoop - Bitmap of no-snoop events.
8264 *
8265 * returns: E1000_SUCCESS
8266 *
8267 *****************************************************************************/
8268int32_t
8269e1000_set_pci_ex_no_snoop(struct e1000_hw *hw, uint32_t no_snoop)
8270{
8271 uint32_t gcr_reg = 0;
8272
8273 DEBUGFUNC("e1000_set_pci_ex_no_snoop");
8274
8275 if (hw->bus_type == e1000_bus_type_unknown)
8276 e1000_get_bus_info(hw);
8277
8278 if (hw->bus_type != e1000_bus_type_pci_express)
8279 return E1000_SUCCESS;
8280
8281 if (no_snoop) {
8282 gcr_reg = E1000_READ_REG(hw, GCR);
8283 gcr_reg &= ~(PCI_EX_NO_SNOOP_ALL);
8284 gcr_reg |= no_snoop;
8285 E1000_WRITE_REG(hw, GCR, gcr_reg);
8286 }
8287 if (hw->mac_type == e1000_ich8lan) {
8288 uint32_t ctrl_ext;
8289
8290 E1000_WRITE_REG(hw, GCR, PCI_EX_82566_SNOOP_ALL);
8291
8292 ctrl_ext = E1000_READ_REG(hw, CTRL_EXT);
8293 ctrl_ext |= E1000_CTRL_EXT_RO_DIS;
8294 E1000_WRITE_REG(hw, CTRL_EXT, ctrl_ext);
8295 }
8296
8297 return E1000_SUCCESS;
8298}
8299
8300/***************************************************************************
8301 *
8302 * Get software semaphore FLAG bit (SWFLAG).
8303 * SWFLAG is used to synchronize the access to all shared resource between
8304 * SW, FW and HW.
8305 *
8306 * hw: Struct containing variables accessed by shared code
8307 *
8308 ***************************************************************************/
8309int32_t
8310e1000_get_software_flag(struct e1000_hw *hw)
8311{
8312 int32_t timeout = PHY_CFG_TIMEOUT;
8313 uint32_t extcnf_ctrl;
8314
8315 DEBUGFUNC("e1000_get_software_flag");
8316
8317 if (hw->mac_type == e1000_ich8lan) {
8318 while (timeout) {
8319 extcnf_ctrl = E1000_READ_REG(hw, EXTCNF_CTRL);
8320 extcnf_ctrl |= E1000_EXTCNF_CTRL_SWFLAG;
8321 E1000_WRITE_REG(hw, EXTCNF_CTRL, extcnf_ctrl);
8322
8323 extcnf_ctrl = E1000_READ_REG(hw, EXTCNF_CTRL);
8324 if (extcnf_ctrl & E1000_EXTCNF_CTRL_SWFLAG)
8325 break;
8326 msec_delay_irq(1);
8327 timeout--;
8328 }
8329
8330 if (!timeout) {
8331 DEBUGOUT("FW or HW locks the resource too long.\n");
8332 return -E1000_ERR_CONFIG;
8333 }
8334 }
8335
8336 return E1000_SUCCESS;
8337}
8338
8339/***************************************************************************
8340 *
8341 * Release software semaphore FLAG bit (SWFLAG).
8342 * SWFLAG is used to synchronize the access to all shared resource between
8343 * SW, FW and HW.
8344 *
8345 * hw: Struct containing variables accessed by shared code
8346 *
8347 ***************************************************************************/
8348void
8349e1000_release_software_flag(struct e1000_hw *hw)
8350{
8351 uint32_t extcnf_ctrl;
8352
8353 DEBUGFUNC("e1000_release_software_flag");
8354
8355 if (hw->mac_type == e1000_ich8lan) {
8356 extcnf_ctrl= E1000_READ_REG(hw, EXTCNF_CTRL);
8357 extcnf_ctrl &= ~E1000_EXTCNF_CTRL_SWFLAG;
8358 E1000_WRITE_REG(hw, EXTCNF_CTRL, extcnf_ctrl);
8359 }
8360
8361 return;
8362}
8363
8364/***************************************************************************
8365 *
8366 * Disable dynamic power down mode in ife PHY.
8367 * It can be used to workaround band-gap problem.
8368 *
8369 * hw: Struct containing variables accessed by shared code
8370 *
8371 ***************************************************************************/
8372int32_t
8373e1000_ife_disable_dynamic_power_down(struct e1000_hw *hw)
8374{
8375 uint16_t phy_data;
8376 int32_t ret_val = E1000_SUCCESS;
8377
8378 DEBUGFUNC("e1000_ife_disable_dynamic_power_down");
8379
8380 if (hw->phy_type == e1000_phy_ife) {
8381 ret_val = e1000_read_phy_reg(hw, IFE_PHY_SPECIAL_CONTROL, &phy_data);
8382 if (ret_val)
8383 return ret_val;
8384
8385 phy_data |= IFE_PSC_DISABLE_DYNAMIC_POWER_DOWN;
8386 ret_val = e1000_write_phy_reg(hw, IFE_PHY_SPECIAL_CONTROL, phy_data);
8387 }
8388
8389 return ret_val;
8390}
8391
8392/***************************************************************************
8393 *
8394 * Enable dynamic power down mode in ife PHY.
8395 * It can be used to workaround band-gap problem.
8396 *
8397 * hw: Struct containing variables accessed by shared code
8398 *
8399 ***************************************************************************/
8400int32_t
8401e1000_ife_enable_dynamic_power_down(struct e1000_hw *hw)
8402{
8403 uint16_t phy_data;
8404 int32_t ret_val = E1000_SUCCESS;
8405
8406 DEBUGFUNC("e1000_ife_enable_dynamic_power_down");
8407
8408 if (hw->phy_type == e1000_phy_ife) {
8409 ret_val = e1000_read_phy_reg(hw, IFE_PHY_SPECIAL_CONTROL, &phy_data);
8410 if (ret_val)
8411 return ret_val;
8412
8413 phy_data &= ~IFE_PSC_DISABLE_DYNAMIC_POWER_DOWN;
8414 ret_val = e1000_write_phy_reg(hw, IFE_PHY_SPECIAL_CONTROL, phy_data);
8415 }
8416
8417 return ret_val;
8418}
8419
8420/******************************************************************************
8421 * Reads a 16 bit word or words from the EEPROM using the ICH8's flash access
8422 * register.
8423 *
8424 * hw - Struct containing variables accessed by shared code
8425 * offset - offset of word in the EEPROM to read
8426 * data - word read from the EEPROM
8427 * words - number of words to read
8428 *****************************************************************************/
8429int32_t
8430e1000_read_eeprom_ich8(struct e1000_hw *hw, uint16_t offset, uint16_t words,
8431 uint16_t *data)
8432{
8433 int32_t error = E1000_SUCCESS;
8434 uint32_t flash_bank = 0;
8435 uint32_t act_offset = 0;
8436 uint32_t bank_offset = 0;
8437 uint16_t word = 0;
8438 uint16_t i = 0;
8439
8440 /* We need to know which is the valid flash bank. In the event
8441 * that we didn't allocate eeprom_shadow_ram, we may not be
8442 * managing flash_bank. So it cannot be trusted and needs
8443 * to be updated with each read.
8444 */
8445 /* Value of bit 22 corresponds to the flash bank we're on. */
8446 flash_bank = (E1000_READ_REG(hw, EECD) & E1000_EECD_SEC1VAL) ? 1 : 0;
8447
8448 /* Adjust offset appropriately if we're on bank 1 - adjust for word size */
8449 bank_offset = flash_bank * (hw->flash_bank_size * 2);
8450
8451 error = e1000_get_software_flag(hw);
8452 if (error != E1000_SUCCESS)
8453 return error;
8454
8455 for (i = 0; i < words; i++) {
8456 if (hw->eeprom_shadow_ram != NULL &&
8457 hw->eeprom_shadow_ram[offset+i].modified == TRUE) {
8458 data[i] = hw->eeprom_shadow_ram[offset+i].eeprom_word;
8459 } else {
8460 /* The NVM part needs a byte offset, hence * 2 */
8461 act_offset = bank_offset + ((offset + i) * 2);
8462 error = e1000_read_ich8_word(hw, act_offset, &word);
8463 if (error != E1000_SUCCESS)
8464 break;
8465 data[i] = word;
8466 }
8467 }
8468
8469 e1000_release_software_flag(hw);
8470
8471 return error;
8472}
8473
8474/******************************************************************************
8475 * Writes a 16 bit word or words to the EEPROM using the ICH8's flash access
8476 * register. Actually, writes are written to the shadow ram cache in the hw
8477 * structure hw->e1000_shadow_ram. e1000_commit_shadow_ram flushes this to
8478 * the NVM, which occurs when the NVM checksum is updated.
8479 *
8480 * hw - Struct containing variables accessed by shared code
8481 * offset - offset of word in the EEPROM to write
8482 * words - number of words to write
8483 * data - words to write to the EEPROM
8484 *****************************************************************************/
8485int32_t
8486e1000_write_eeprom_ich8(struct e1000_hw *hw, uint16_t offset, uint16_t words,
8487 uint16_t *data)
8488{
8489 uint32_t i = 0;
8490 int32_t error = E1000_SUCCESS;
8491
8492 error = e1000_get_software_flag(hw);
8493 if (error != E1000_SUCCESS)
8494 return error;
8495
8496 /* A driver can write to the NVM only if it has eeprom_shadow_ram
8497 * allocated. Subsequent reads to the modified words are read from
8498 * this cached structure as well. Writes will only go into this
8499 * cached structure unless it's followed by a call to
8500 * e1000_update_eeprom_checksum() where it will commit the changes
8501 * and clear the "modified" field.
8502 */
8503 if (hw->eeprom_shadow_ram != NULL) {
8504 for (i = 0; i < words; i++) {
8505 if ((offset + i) < E1000_SHADOW_RAM_WORDS) {
8506 hw->eeprom_shadow_ram[offset+i].modified = TRUE;
8507 hw->eeprom_shadow_ram[offset+i].eeprom_word = data[i];
8508 } else {
8509 error = -E1000_ERR_EEPROM;
8510 break;
8511 }
8512 }
8513 } else {
8514 /* Drivers have the option to not allocate eeprom_shadow_ram as long
8515 * as they don't perform any NVM writes. An attempt in doing so
8516 * will result in this error.
8517 */
8518 error = -E1000_ERR_EEPROM;
8519 }
8520
8521 e1000_release_software_flag(hw);
8522
8523 return error;
8524}
8525
8526/******************************************************************************
8527 * This function does initial flash setup so that a new read/write/erase cycle
8528 * can be started.
8529 *
8530 * hw - The pointer to the hw structure
8531 ****************************************************************************/
8532int32_t
8533e1000_ich8_cycle_init(struct e1000_hw *hw)
8534{
8535 union ich8_hws_flash_status hsfsts;
8536 int32_t error = E1000_ERR_EEPROM;
8537 int32_t i = 0;
8538
8539 DEBUGFUNC("e1000_ich8_cycle_init");
8540
8541 hsfsts.regval = E1000_READ_ICH8_REG16(hw, ICH8_FLASH_HSFSTS);
8542
8543 /* May be check the Flash Des Valid bit in Hw status */
8544 if (hsfsts.hsf_status.fldesvalid == 0) {
8545 DEBUGOUT("Flash descriptor invalid. SW Sequencing must be used.");
8546 return error;
8547 }
8548
8549 /* Clear FCERR in Hw status by writing 1 */
8550 /* Clear DAEL in Hw status by writing a 1 */
8551 hsfsts.hsf_status.flcerr = 1;
8552 hsfsts.hsf_status.dael = 1;
8553
8554 E1000_WRITE_ICH8_REG16(hw, ICH8_FLASH_HSFSTS, hsfsts.regval);
8555
8556 /* Either we should have a hardware SPI cycle in progress bit to check
8557 * against, in order to start a new cycle or FDONE bit should be changed
8558 * in the hardware so that it is 1 after harware reset, which can then be
8559 * used as an indication whether a cycle is in progress or has been
8560 * completed .. we should also have some software semaphore mechanism to
8561 * guard FDONE or the cycle in progress bit so that two threads access to
8562 * those bits can be sequentiallized or a way so that 2 threads dont
8563 * start the cycle at the same time */
8564
8565 if (hsfsts.hsf_status.flcinprog == 0) {
8566 /* There is no cycle running at present, so we can start a cycle */
8567 /* Begin by setting Flash Cycle Done. */
8568 hsfsts.hsf_status.flcdone = 1;
8569 E1000_WRITE_ICH8_REG16(hw, ICH8_FLASH_HSFSTS, hsfsts.regval);
8570 error = E1000_SUCCESS;
8571 } else {
8572 /* otherwise poll for sometime so the current cycle has a chance
8573 * to end before giving up. */
8574 for (i = 0; i < ICH8_FLASH_COMMAND_TIMEOUT; i++) {
8575 hsfsts.regval = E1000_READ_ICH8_REG16(hw, ICH8_FLASH_HSFSTS);
8576 if (hsfsts.hsf_status.flcinprog == 0) {
8577 error = E1000_SUCCESS;
8578 break;
8579 }
8580 udelay(1);
8581 }
8582 if (error == E1000_SUCCESS) {
8583 /* Successful in waiting for previous cycle to timeout,
8584 * now set the Flash Cycle Done. */
8585 hsfsts.hsf_status.flcdone = 1;
8586 E1000_WRITE_ICH8_REG16(hw, ICH8_FLASH_HSFSTS, hsfsts.regval);
8587 } else {
8588 DEBUGOUT("Flash controller busy, cannot get access");
8589 }
8590 }
8591 return error;
8592}
8593
8594/******************************************************************************
8595 * This function starts a flash cycle and waits for its completion
8596 *
8597 * hw - The pointer to the hw structure
8598 ****************************************************************************/
8599int32_t
8600e1000_ich8_flash_cycle(struct e1000_hw *hw, uint32_t timeout)
8601{
8602 union ich8_hws_flash_ctrl hsflctl;
8603 union ich8_hws_flash_status hsfsts;
8604 int32_t error = E1000_ERR_EEPROM;
8605 uint32_t i = 0;
8606
8607 /* Start a cycle by writing 1 in Flash Cycle Go in Hw Flash Control */
8608 hsflctl.regval = E1000_READ_ICH8_REG16(hw, ICH8_FLASH_HSFCTL);
8609 hsflctl.hsf_ctrl.flcgo = 1;
8610 E1000_WRITE_ICH8_REG16(hw, ICH8_FLASH_HSFCTL, hsflctl.regval);
8611
8612 /* wait till FDONE bit is set to 1 */
8613 do {
8614 hsfsts.regval = E1000_READ_ICH8_REG16(hw, ICH8_FLASH_HSFSTS);
8615 if (hsfsts.hsf_status.flcdone == 1)
8616 break;
8617 udelay(1);
8618 i++;
8619 } while (i < timeout);
8620 if (hsfsts.hsf_status.flcdone == 1 && hsfsts.hsf_status.flcerr == 0) {
8621 error = E1000_SUCCESS;
8622 }
8623 return error;
8624}
8625
8626/******************************************************************************
8627 * Reads a byte or word from the NVM using the ICH8 flash access registers.
8628 *
8629 * hw - The pointer to the hw structure
8630 * index - The index of the byte or word to read.
8631 * size - Size of data to read, 1=byte 2=word
8632 * data - Pointer to the word to store the value read.
8633 *****************************************************************************/
8634int32_t
8635e1000_read_ich8_data(struct e1000_hw *hw, uint32_t index,
8636 uint32_t size, uint16_t* data)
8637{
8638 union ich8_hws_flash_status hsfsts;
8639 union ich8_hws_flash_ctrl hsflctl;
8640 uint32_t flash_linear_address;
8641 uint32_t flash_data = 0;
8642 int32_t error = -E1000_ERR_EEPROM;
8643 int32_t count = 0;
8644
8645 DEBUGFUNC("e1000_read_ich8_data");
8646
8647 if (size < 1 || size > 2 || data == 0x0 ||
8648 index > ICH8_FLASH_LINEAR_ADDR_MASK)
8649 return error;
8650
8651 flash_linear_address = (ICH8_FLASH_LINEAR_ADDR_MASK & index) +
8652 hw->flash_base_addr;
8653
8654 do {
8655 udelay(1);
8656 /* Steps */
8657 error = e1000_ich8_cycle_init(hw);
8658 if (error != E1000_SUCCESS)
8659 break;
8660
8661 hsflctl.regval = E1000_READ_ICH8_REG16(hw, ICH8_FLASH_HSFCTL);
8662 /* 0b/1b corresponds to 1 or 2 byte size, respectively. */
8663 hsflctl.hsf_ctrl.fldbcount = size - 1;
8664 hsflctl.hsf_ctrl.flcycle = ICH8_CYCLE_READ;
8665 E1000_WRITE_ICH8_REG16(hw, ICH8_FLASH_HSFCTL, hsflctl.regval);
8666
8667 /* Write the last 24 bits of index into Flash Linear address field in
8668 * Flash Address */
8669 /* TODO: TBD maybe check the index against the size of flash */
8670
8671 E1000_WRITE_ICH8_REG(hw, ICH8_FLASH_FADDR, flash_linear_address);
8672
8673 error = e1000_ich8_flash_cycle(hw, ICH8_FLASH_COMMAND_TIMEOUT);
8674
8675 /* Check if FCERR is set to 1, if set to 1, clear it and try the whole
8676 * sequence a few more times, else read in (shift in) the Flash Data0,
8677 * the order is least significant byte first msb to lsb */
8678 if (error == E1000_SUCCESS) {
8679 flash_data = E1000_READ_ICH8_REG(hw, ICH8_FLASH_FDATA0);
8680 if (size == 1) {
8681 *data = (uint8_t)(flash_data & 0x000000FF);
8682 } else if (size == 2) {
8683 *data = (uint16_t)(flash_data & 0x0000FFFF);
8684 }
8685 break;
8686 } else {
8687 /* If we've gotten here, then things are probably completely hosed,
8688 * but if the error condition is detected, it won't hurt to give
8689 * it another try...ICH8_FLASH_CYCLE_REPEAT_COUNT times.
8690 */
8691 hsfsts.regval = E1000_READ_ICH8_REG16(hw, ICH8_FLASH_HSFSTS);
8692 if (hsfsts.hsf_status.flcerr == 1) {
8693 /* Repeat for some time before giving up. */
8694 continue;
8695 } else if (hsfsts.hsf_status.flcdone == 0) {
8696 DEBUGOUT("Timeout error - flash cycle did not complete.");
8697 break;
8698 }
8699 }
8700 } while (count++ < ICH8_FLASH_CYCLE_REPEAT_COUNT);
8701
8702 return error;
8703}
8704
8705/******************************************************************************
8706 * Writes One /two bytes to the NVM using the ICH8 flash access registers.
8707 *
8708 * hw - The pointer to the hw structure
8709 * index - The index of the byte/word to read.
8710 * size - Size of data to read, 1=byte 2=word
8711 * data - The byte(s) to write to the NVM.
8712 *****************************************************************************/
8713int32_t
8714e1000_write_ich8_data(struct e1000_hw *hw, uint32_t index, uint32_t size,
8715 uint16_t data)
8716{
8717 union ich8_hws_flash_status hsfsts;
8718 union ich8_hws_flash_ctrl hsflctl;
8719 uint32_t flash_linear_address;
8720 uint32_t flash_data = 0;
8721 int32_t error = -E1000_ERR_EEPROM;
8722 int32_t count = 0;
8723
8724 DEBUGFUNC("e1000_write_ich8_data");
8725
8726 if (size < 1 || size > 2 || data > size * 0xff ||
8727 index > ICH8_FLASH_LINEAR_ADDR_MASK)
8728 return error;
8729
8730 flash_linear_address = (ICH8_FLASH_LINEAR_ADDR_MASK & index) +
8731 hw->flash_base_addr;
8732
8733 do {
8734 udelay(1);
8735 /* Steps */
8736 error = e1000_ich8_cycle_init(hw);
8737 if (error != E1000_SUCCESS)
8738 break;
8739
8740 hsflctl.regval = E1000_READ_ICH8_REG16(hw, ICH8_FLASH_HSFCTL);
8741 /* 0b/1b corresponds to 1 or 2 byte size, respectively. */
8742 hsflctl.hsf_ctrl.fldbcount = size -1;
8743 hsflctl.hsf_ctrl.flcycle = ICH8_CYCLE_WRITE;
8744 E1000_WRITE_ICH8_REG16(hw, ICH8_FLASH_HSFCTL, hsflctl.regval);
8745
8746 /* Write the last 24 bits of index into Flash Linear address field in
8747 * Flash Address */
8748 E1000_WRITE_ICH8_REG(hw, ICH8_FLASH_FADDR, flash_linear_address);
8749
8750 if (size == 1)
8751 flash_data = (uint32_t)data & 0x00FF;
8752 else
8753 flash_data = (uint32_t)data;
8754
8755 E1000_WRITE_ICH8_REG(hw, ICH8_FLASH_FDATA0, flash_data);
8756
8757 /* check if FCERR is set to 1 , if set to 1, clear it and try the whole
8758 * sequence a few more times else done */
8759 error = e1000_ich8_flash_cycle(hw, ICH8_FLASH_COMMAND_TIMEOUT);
8760 if (error == E1000_SUCCESS) {
8761 break;
8762 } else {
8763 /* If we're here, then things are most likely completely hosed,
8764 * but if the error condition is detected, it won't hurt to give
8765 * it another try...ICH8_FLASH_CYCLE_REPEAT_COUNT times.
8766 */
8767 hsfsts.regval = E1000_READ_ICH8_REG16(hw, ICH8_FLASH_HSFSTS);
8768 if (hsfsts.hsf_status.flcerr == 1) {
8769 /* Repeat for some time before giving up. */
8770 continue;
8771 } else if (hsfsts.hsf_status.flcdone == 0) {
8772 DEBUGOUT("Timeout error - flash cycle did not complete.");
8773 break;
8774 }
8775 }
8776 } while (count++ < ICH8_FLASH_CYCLE_REPEAT_COUNT);
8777
8778 return error;
8779}
8780
8781/******************************************************************************
8782 * Reads a single byte from the NVM using the ICH8 flash access registers.
8783 *
8784 * hw - pointer to e1000_hw structure
8785 * index - The index of the byte to read.
8786 * data - Pointer to a byte to store the value read.
8787 *****************************************************************************/
8788int32_t
8789e1000_read_ich8_byte(struct e1000_hw *hw, uint32_t index, uint8_t* data)
8790{
8791 int32_t status = E1000_SUCCESS;
8792 uint16_t word = 0;
8793
8794 status = e1000_read_ich8_data(hw, index, 1, &word);
8795 if (status == E1000_SUCCESS) {
8796 *data = (uint8_t)word;
8797 }
8798
8799 return status;
8800}
8801
8802/******************************************************************************
8803 * Writes a single byte to the NVM using the ICH8 flash access registers.
8804 * Performs verification by reading back the value and then going through
8805 * a retry algorithm before giving up.
8806 *
8807 * hw - pointer to e1000_hw structure
8808 * index - The index of the byte to write.
8809 * byte - The byte to write to the NVM.
8810 *****************************************************************************/
8811int32_t
8812e1000_verify_write_ich8_byte(struct e1000_hw *hw, uint32_t index, uint8_t byte)
8813{
8814 int32_t error = E1000_SUCCESS;
8815 int32_t program_retries;
8816 uint8_t temp_byte;
8817
8818 e1000_write_ich8_byte(hw, index, byte);
8819 udelay(100);
8820
8821 for (program_retries = 0; program_retries < 100; program_retries++) {
8822 e1000_read_ich8_byte(hw, index, &temp_byte);
8823 if (temp_byte == byte)
8824 break;
8825 udelay(10);
8826 e1000_write_ich8_byte(hw, index, byte);
8827 udelay(100);
8828 }
8829 if (program_retries == 100)
8830 error = E1000_ERR_EEPROM;
8831
8832 return error;
8833}
8834
8835/******************************************************************************
8836 * Writes a single byte to the NVM using the ICH8 flash access registers.
8837 *
8838 * hw - pointer to e1000_hw structure
8839 * index - The index of the byte to read.
8840 * data - The byte to write to the NVM.
8841 *****************************************************************************/
8842int32_t
8843e1000_write_ich8_byte(struct e1000_hw *hw, uint32_t index, uint8_t data)
8844{
8845 int32_t status = E1000_SUCCESS;
8846 uint16_t word = (uint16_t)data;
8847
8848 status = e1000_write_ich8_data(hw, index, 1, word);
8849
8850 return status;
8851}
8852
8853/******************************************************************************
8854 * Reads a word from the NVM using the ICH8 flash access registers.
8855 *
8856 * hw - pointer to e1000_hw structure
8857 * index - The starting byte index of the word to read.
8858 * data - Pointer to a word to store the value read.
8859 *****************************************************************************/
8860int32_t
8861e1000_read_ich8_word(struct e1000_hw *hw, uint32_t index, uint16_t *data)
8862{
8863 int32_t status = E1000_SUCCESS;
8864 status = e1000_read_ich8_data(hw, index, 2, data);
8865 return status;
8866}
8867
8868/******************************************************************************
8869 * Writes a word to the NVM using the ICH8 flash access registers.
8870 *
8871 * hw - pointer to e1000_hw structure
8872 * index - The starting byte index of the word to read.
8873 * data - The word to write to the NVM.
8874 *****************************************************************************/
8875int32_t
8876e1000_write_ich8_word(struct e1000_hw *hw, uint32_t index, uint16_t data)
8877{
8878 int32_t status = E1000_SUCCESS;
8879 status = e1000_write_ich8_data(hw, index, 2, data);
8880 return status;
8881}
8882
8883/******************************************************************************
8884 * Erases the bank specified. Each bank is a 4k block. Segments are 0 based.
8885 * segment N is 4096 * N + flash_reg_addr.
8886 *
8887 * hw - pointer to e1000_hw structure
8888 * segment - 0 for first segment, 1 for second segment, etc.
8889 *****************************************************************************/
8890int32_t
8891e1000_erase_ich8_4k_segment(struct e1000_hw *hw, uint32_t segment)
8892{
8893 union ich8_hws_flash_status hsfsts;
8894 union ich8_hws_flash_ctrl hsflctl;
8895 uint32_t flash_linear_address;
8896 int32_t count = 0;
8897 int32_t error = E1000_ERR_EEPROM;
8898 int32_t iteration, seg_size;
8899 int32_t sector_size;
8900 int32_t j = 0;
8901 int32_t error_flag = 0;
8902
8903 hsfsts.regval = E1000_READ_ICH8_REG16(hw, ICH8_FLASH_HSFSTS);
8904
8905 /* Determine HW Sector size: Read BERASE bits of Hw flash Status register */
8906 /* 00: The Hw sector is 256 bytes, hence we need to erase 16
8907 * consecutive sectors. The start index for the nth Hw sector can be
8908 * calculated as = segment * 4096 + n * 256
8909 * 01: The Hw sector is 4K bytes, hence we need to erase 1 sector.
8910 * The start index for the nth Hw sector can be calculated
8911 * as = segment * 4096
8912 * 10: Error condition
8913 * 11: The Hw sector size is much bigger than the size asked to
8914 * erase...error condition */
8915 if (hsfsts.hsf_status.berasesz == 0x0) {
8916 /* Hw sector size 256 */
8917 sector_size = seg_size = ICH8_FLASH_SEG_SIZE_256;
8918 iteration = ICH8_FLASH_SECTOR_SIZE / ICH8_FLASH_SEG_SIZE_256;
8919 } else if (hsfsts.hsf_status.berasesz == 0x1) {
8920 sector_size = seg_size = ICH8_FLASH_SEG_SIZE_4K;
8921 iteration = 1;
8922 } else if (hsfsts.hsf_status.berasesz == 0x3) {
8923 sector_size = seg_size = ICH8_FLASH_SEG_SIZE_64K;
8924 iteration = 1;
8925 } else {
8926 return error;
8927 }
8928
8929 for (j = 0; j < iteration ; j++) {
8930 do {
8931 count++;
8932 /* Steps */
8933 error = e1000_ich8_cycle_init(hw);
8934 if (error != E1000_SUCCESS) {
8935 error_flag = 1;
8936 break;
8937 }
8938
8939 /* Write a value 11 (block Erase) in Flash Cycle field in Hw flash
8940 * Control */
8941 hsflctl.regval = E1000_READ_ICH8_REG16(hw, ICH8_FLASH_HSFCTL);
8942 hsflctl.hsf_ctrl.flcycle = ICH8_CYCLE_ERASE;
8943 E1000_WRITE_ICH8_REG16(hw, ICH8_FLASH_HSFCTL, hsflctl.regval);
8944
8945 /* Write the last 24 bits of an index within the block into Flash
8946 * Linear address field in Flash Address. This probably needs to
8947 * be calculated here based off the on-chip segment size and the
8948 * software segment size assumed (4K) */
8949 /* TBD */
8950 flash_linear_address = segment * sector_size + j * seg_size;
8951 flash_linear_address &= ICH8_FLASH_LINEAR_ADDR_MASK;
8952 flash_linear_address += hw->flash_base_addr;
8953
8954 E1000_WRITE_ICH8_REG(hw, ICH8_FLASH_FADDR, flash_linear_address);
8955
8956 error = e1000_ich8_flash_cycle(hw, 1000000);
8957 /* Check if FCERR is set to 1. If 1, clear it and try the whole
8958 * sequence a few more times else Done */
8959 if (error == E1000_SUCCESS) {
8960 break;
8961 } else {
8962 hsfsts.regval = E1000_READ_ICH8_REG16(hw, ICH8_FLASH_HSFSTS);
8963 if (hsfsts.hsf_status.flcerr == 1) {
8964 /* repeat for some time before giving up */
8965 continue;
8966 } else if (hsfsts.hsf_status.flcdone == 0) {
8967 error_flag = 1;
8968 break;
8969 }
8970 }
8971 } while ((count < ICH8_FLASH_CYCLE_REPEAT_COUNT) && !error_flag);
8972 if (error_flag == 1)
8973 break;
8974 }
8975 if (error_flag != 1)
8976 error = E1000_SUCCESS;
8977 return error;
8978}
8979
8980/******************************************************************************
8981 *
8982 * Reverse duplex setting without breaking the link.
8983 *
8984 * hw: Struct containing variables accessed by shared code
8985 *
8986 *****************************************************************************/
8987int32_t
8988e1000_duplex_reversal(struct e1000_hw *hw)
8989{
8990 int32_t ret_val;
8991 uint16_t phy_data;
8992
8993 if (hw->phy_type != e1000_phy_igp_3)
8994 return E1000_SUCCESS;
8995
8996 ret_val = e1000_read_phy_reg(hw, PHY_CTRL, &phy_data);
8997 if (ret_val)
8998 return ret_val;
8999
9000 phy_data ^= MII_CR_FULL_DUPLEX;
9001
9002 ret_val = e1000_write_phy_reg(hw, PHY_CTRL, phy_data);
9003 if (ret_val)
9004 return ret_val;
9005
9006 ret_val = e1000_read_phy_reg(hw, IGP3E1000_PHY_MISC_CTRL, &phy_data);
9007 if (ret_val)
9008 return ret_val;
9009
9010 phy_data |= IGP3_PHY_MISC_DUPLEX_MANUAL_SET;
9011 ret_val = e1000_write_phy_reg(hw, IGP3E1000_PHY_MISC_CTRL, phy_data);
9012
9013 return ret_val;
9014}
9015
9016int32_t
9017e1000_init_lcd_from_nvm_config_region(struct e1000_hw *hw,
9018 uint32_t cnf_base_addr, uint32_t cnf_size)
9019{
9020 uint32_t ret_val = E1000_SUCCESS;
9021 uint16_t word_addr, reg_data, reg_addr;
9022 uint16_t i;
9023
9024 /* cnf_base_addr is in DWORD */
9025 word_addr = (uint16_t)(cnf_base_addr << 1);
9026
9027 /* cnf_size is returned in size of dwords */
9028 for (i = 0; i < cnf_size; i++) {
9029 ret_val = e1000_read_eeprom(hw, (word_addr + i*2), 1, &reg_data);
9030 if (ret_val)
9031 return ret_val;
9032
9033 ret_val = e1000_read_eeprom(hw, (word_addr + i*2 + 1), 1, &reg_addr);
9034 if (ret_val)
9035 return ret_val;
9036
9037 ret_val = e1000_get_software_flag(hw);
9038 if (ret_val != E1000_SUCCESS)
9039 return ret_val;
9040
9041 ret_val = e1000_write_phy_reg_ex(hw, (uint32_t)reg_addr, reg_data);
9042
9043 e1000_release_software_flag(hw);
9044 }
9045
9046 return ret_val;
9047}
9048
9049
9050int32_t
9051e1000_init_lcd_from_nvm(struct e1000_hw *hw)
9052{
9053 uint32_t reg_data, cnf_base_addr, cnf_size, ret_val, loop;
9054
9055 if (hw->phy_type != e1000_phy_igp_3)
9056 return E1000_SUCCESS;
9057
9058 /* Check if SW needs configure the PHY */
9059 reg_data = E1000_READ_REG(hw, FEXTNVM);
9060 if (!(reg_data & FEXTNVM_SW_CONFIG))
9061 return E1000_SUCCESS;
9062
9063 /* Wait for basic configuration completes before proceeding*/
9064 loop = 0;
9065 do {
9066 reg_data = E1000_READ_REG(hw, STATUS) & E1000_STATUS_LAN_INIT_DONE;
9067 udelay(100);
9068 loop++;
9069 } while ((!reg_data) && (loop < 50));
9070
9071 /* Clear the Init Done bit for the next init event */
9072 reg_data = E1000_READ_REG(hw, STATUS);
9073 reg_data &= ~E1000_STATUS_LAN_INIT_DONE;
9074 E1000_WRITE_REG(hw, STATUS, reg_data);
9075
9076 /* Make sure HW does not configure LCD from PHY extended configuration
9077 before SW configuration */
9078 reg_data = E1000_READ_REG(hw, EXTCNF_CTRL);
9079 if ((reg_data & E1000_EXTCNF_CTRL_LCD_WRITE_ENABLE) == 0x0000) {
9080 reg_data = E1000_READ_REG(hw, EXTCNF_SIZE);
9081 cnf_size = reg_data & E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH;
9082 cnf_size >>= 16;
9083 if (cnf_size) {
9084 reg_data = E1000_READ_REG(hw, EXTCNF_CTRL);
9085 cnf_base_addr = reg_data & E1000_EXTCNF_CTRL_EXT_CNF_POINTER;
9086 /* cnf_base_addr is in DWORD */
9087 cnf_base_addr >>= 16;
9088
9089 /* Configure LCD from extended configuration region. */
9090 ret_val = e1000_init_lcd_from_nvm_config_region(hw, cnf_base_addr,
9091 cnf_size);
9092 if (ret_val)
9093 return ret_val;
9094 }
9095 }
9096
9097 return E1000_SUCCESS;
9098}
9099
9100
7559 9101
diff --git a/drivers/net/e1000/e1000_hw.h b/drivers/net/e1000/e1000_hw.h
index 467c9ed944f8..f9341e3276b3 100644
--- a/drivers/net/e1000/e1000_hw.h
+++ b/drivers/net/e1000/e1000_hw.h
@@ -62,6 +62,7 @@ typedef enum {
62 e1000_82572, 62 e1000_82572,
63 e1000_82573, 63 e1000_82573,
64 e1000_80003es2lan, 64 e1000_80003es2lan,
65 e1000_ich8lan,
65 e1000_num_macs 66 e1000_num_macs
66} e1000_mac_type; 67} e1000_mac_type;
67 68
@@ -70,6 +71,7 @@ typedef enum {
70 e1000_eeprom_spi, 71 e1000_eeprom_spi,
71 e1000_eeprom_microwire, 72 e1000_eeprom_microwire,
72 e1000_eeprom_flash, 73 e1000_eeprom_flash,
74 e1000_eeprom_ich8,
73 e1000_eeprom_none, /* No NVM support */ 75 e1000_eeprom_none, /* No NVM support */
74 e1000_num_eeprom_types 76 e1000_num_eeprom_types
75} e1000_eeprom_type; 77} e1000_eeprom_type;
@@ -98,6 +100,11 @@ typedef enum {
98 e1000_fc_default = 0xFF 100 e1000_fc_default = 0xFF
99} e1000_fc_type; 101} e1000_fc_type;
100 102
103struct e1000_shadow_ram {
104 uint16_t eeprom_word;
105 boolean_t modified;
106};
107
101/* PCI bus types */ 108/* PCI bus types */
102typedef enum { 109typedef enum {
103 e1000_bus_type_unknown = 0, 110 e1000_bus_type_unknown = 0,
@@ -218,6 +225,8 @@ typedef enum {
218 e1000_phy_igp, 225 e1000_phy_igp,
219 e1000_phy_igp_2, 226 e1000_phy_igp_2,
220 e1000_phy_gg82563, 227 e1000_phy_gg82563,
228 e1000_phy_igp_3,
229 e1000_phy_ife,
221 e1000_phy_undefined = 0xFF 230 e1000_phy_undefined = 0xFF
222} e1000_phy_type; 231} e1000_phy_type;
223 232
@@ -313,6 +322,10 @@ int32_t e1000_read_phy_reg(struct e1000_hw *hw, uint32_t reg_addr, uint16_t *phy
313int32_t e1000_write_phy_reg(struct e1000_hw *hw, uint32_t reg_addr, uint16_t data); 322int32_t e1000_write_phy_reg(struct e1000_hw *hw, uint32_t reg_addr, uint16_t data);
314int32_t e1000_phy_hw_reset(struct e1000_hw *hw); 323int32_t e1000_phy_hw_reset(struct e1000_hw *hw);
315int32_t e1000_phy_reset(struct e1000_hw *hw); 324int32_t e1000_phy_reset(struct e1000_hw *hw);
325void e1000_phy_powerdown_workaround(struct e1000_hw *hw);
326int32_t e1000_kumeran_lock_loss_workaround(struct e1000_hw *hw);
327int32_t e1000_init_lcd_from_nvm_config_region(struct e1000_hw *hw, uint32_t cnf_base_addr, uint32_t cnf_size);
328int32_t e1000_init_lcd_from_nvm(struct e1000_hw *hw);
316int32_t e1000_phy_get_info(struct e1000_hw *hw, struct e1000_phy_info *phy_info); 329int32_t e1000_phy_get_info(struct e1000_hw *hw, struct e1000_phy_info *phy_info);
317int32_t e1000_validate_mdi_setting(struct e1000_hw *hw); 330int32_t e1000_validate_mdi_setting(struct e1000_hw *hw);
318int32_t e1000_read_kmrn_reg(struct e1000_hw *hw, uint32_t reg_addr, uint16_t *data); 331int32_t e1000_read_kmrn_reg(struct e1000_hw *hw, uint32_t reg_addr, uint16_t *data);
@@ -331,6 +344,7 @@ uint32_t e1000_enable_mng_pass_thru(struct e1000_hw *hw);
331#define E1000_MNG_DHCP_COOKIE_OFFSET 0x6F0 /* Cookie offset */ 344#define E1000_MNG_DHCP_COOKIE_OFFSET 0x6F0 /* Cookie offset */
332#define E1000_MNG_DHCP_COOKIE_LENGTH 0x10 /* Cookie length */ 345#define E1000_MNG_DHCP_COOKIE_LENGTH 0x10 /* Cookie length */
333#define E1000_MNG_IAMT_MODE 0x3 346#define E1000_MNG_IAMT_MODE 0x3
347#define E1000_MNG_ICH_IAMT_MODE 0x2
334#define E1000_IAMT_SIGNATURE 0x544D4149 /* Intel(R) Active Management Technology signature */ 348#define E1000_IAMT_SIGNATURE 0x544D4149 /* Intel(R) Active Management Technology signature */
335 349
336#define E1000_MNG_DHCP_COOKIE_STATUS_PARSING_SUPPORT 0x1 /* DHCP parsing enabled */ 350#define E1000_MNG_DHCP_COOKIE_STATUS_PARSING_SUPPORT 0x1 /* DHCP parsing enabled */
@@ -388,6 +402,8 @@ int32_t e1000_read_part_num(struct e1000_hw *hw, uint32_t * part_num);
388int32_t e1000_read_mac_addr(struct e1000_hw * hw); 402int32_t e1000_read_mac_addr(struct e1000_hw * hw);
389int32_t e1000_swfw_sync_acquire(struct e1000_hw *hw, uint16_t mask); 403int32_t e1000_swfw_sync_acquire(struct e1000_hw *hw, uint16_t mask);
390void e1000_swfw_sync_release(struct e1000_hw *hw, uint16_t mask); 404void e1000_swfw_sync_release(struct e1000_hw *hw, uint16_t mask);
405void e1000_release_software_flag(struct e1000_hw *hw);
406int32_t e1000_get_software_flag(struct e1000_hw *hw);
391 407
392/* Filters (multicast, vlan, receive) */ 408/* Filters (multicast, vlan, receive) */
393void e1000_mc_addr_list_update(struct e1000_hw *hw, uint8_t * mc_addr_list, uint32_t mc_addr_count, uint32_t pad, uint32_t rar_used_count); 409void e1000_mc_addr_list_update(struct e1000_hw *hw, uint8_t * mc_addr_list, uint32_t mc_addr_count, uint32_t pad, uint32_t rar_used_count);
@@ -401,6 +417,7 @@ int32_t e1000_setup_led(struct e1000_hw *hw);
401int32_t e1000_cleanup_led(struct e1000_hw *hw); 417int32_t e1000_cleanup_led(struct e1000_hw *hw);
402int32_t e1000_led_on(struct e1000_hw *hw); 418int32_t e1000_led_on(struct e1000_hw *hw);
403int32_t e1000_led_off(struct e1000_hw *hw); 419int32_t e1000_led_off(struct e1000_hw *hw);
420int32_t e1000_blink_led_start(struct e1000_hw *hw);
404 421
405/* Adaptive IFS Functions */ 422/* Adaptive IFS Functions */
406 423
@@ -422,6 +439,29 @@ int32_t e1000_disable_pciex_master(struct e1000_hw *hw);
422int32_t e1000_get_software_semaphore(struct e1000_hw *hw); 439int32_t e1000_get_software_semaphore(struct e1000_hw *hw);
423void e1000_release_software_semaphore(struct e1000_hw *hw); 440void e1000_release_software_semaphore(struct e1000_hw *hw);
424int32_t e1000_check_phy_reset_block(struct e1000_hw *hw); 441int32_t e1000_check_phy_reset_block(struct e1000_hw *hw);
442int32_t e1000_set_pci_ex_no_snoop(struct e1000_hw *hw, uint32_t no_snoop);
443
444int32_t e1000_read_ich8_byte(struct e1000_hw *hw, uint32_t index,
445 uint8_t *data);
446int32_t e1000_verify_write_ich8_byte(struct e1000_hw *hw, uint32_t index,
447 uint8_t byte);
448int32_t e1000_write_ich8_byte(struct e1000_hw *hw, uint32_t index,
449 uint8_t byte);
450int32_t e1000_read_ich8_word(struct e1000_hw *hw, uint32_t index,
451 uint16_t *data);
452int32_t e1000_read_ich8_data(struct e1000_hw *hw, uint32_t index,
453 uint32_t size, uint16_t *data);
454int32_t e1000_read_eeprom_ich8(struct e1000_hw *hw, uint16_t offset,
455 uint16_t words, uint16_t *data);
456int32_t e1000_write_eeprom_ich8(struct e1000_hw *hw, uint16_t offset,
457 uint16_t words, uint16_t *data);
458int32_t e1000_erase_ich8_4k_segment(struct e1000_hw *hw, uint32_t segment);
459
460
461#define E1000_READ_REG_IO(a, reg) \
462 e1000_read_reg_io((a), E1000_##reg)
463#define E1000_WRITE_REG_IO(a, reg, val) \
464 e1000_write_reg_io((a), E1000_##reg, val)
425 465
426/* PCI Device IDs */ 466/* PCI Device IDs */
427#define E1000_DEV_ID_82542 0x1000 467#define E1000_DEV_ID_82542 0x1000
@@ -446,6 +486,7 @@ int32_t e1000_check_phy_reset_block(struct e1000_hw *hw);
446#define E1000_DEV_ID_82546EB_QUAD_COPPER 0x101D 486#define E1000_DEV_ID_82546EB_QUAD_COPPER 0x101D
447#define E1000_DEV_ID_82541EI 0x1013 487#define E1000_DEV_ID_82541EI 0x1013
448#define E1000_DEV_ID_82541EI_MOBILE 0x1018 488#define E1000_DEV_ID_82541EI_MOBILE 0x1018
489#define E1000_DEV_ID_82541ER_LOM 0x1014
449#define E1000_DEV_ID_82541ER 0x1078 490#define E1000_DEV_ID_82541ER 0x1078
450#define E1000_DEV_ID_82547GI 0x1075 491#define E1000_DEV_ID_82547GI 0x1075
451#define E1000_DEV_ID_82541GI 0x1076 492#define E1000_DEV_ID_82541GI 0x1076
@@ -457,18 +498,28 @@ int32_t e1000_check_phy_reset_block(struct e1000_hw *hw);
457#define E1000_DEV_ID_82546GB_PCIE 0x108A 498#define E1000_DEV_ID_82546GB_PCIE 0x108A
458#define E1000_DEV_ID_82546GB_QUAD_COPPER 0x1099 499#define E1000_DEV_ID_82546GB_QUAD_COPPER 0x1099
459#define E1000_DEV_ID_82547EI 0x1019 500#define E1000_DEV_ID_82547EI 0x1019
501#define E1000_DEV_ID_82547EI_MOBILE 0x101A
460#define E1000_DEV_ID_82571EB_COPPER 0x105E 502#define E1000_DEV_ID_82571EB_COPPER 0x105E
461#define E1000_DEV_ID_82571EB_FIBER 0x105F 503#define E1000_DEV_ID_82571EB_FIBER 0x105F
462#define E1000_DEV_ID_82571EB_SERDES 0x1060 504#define E1000_DEV_ID_82571EB_SERDES 0x1060
463#define E1000_DEV_ID_82572EI_COPPER 0x107D 505#define E1000_DEV_ID_82572EI_COPPER 0x107D
464#define E1000_DEV_ID_82572EI_FIBER 0x107E 506#define E1000_DEV_ID_82572EI_FIBER 0x107E
465#define E1000_DEV_ID_82572EI_SERDES 0x107F 507#define E1000_DEV_ID_82572EI_SERDES 0x107F
508#define E1000_DEV_ID_82572EI 0x10B9
466#define E1000_DEV_ID_82573E 0x108B 509#define E1000_DEV_ID_82573E 0x108B
467#define E1000_DEV_ID_82573E_IAMT 0x108C 510#define E1000_DEV_ID_82573E_IAMT 0x108C
468#define E1000_DEV_ID_82573L 0x109A 511#define E1000_DEV_ID_82573L 0x109A
469#define E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3 0x10B5 512#define E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3 0x10B5
470#define E1000_DEV_ID_80003ES2LAN_COPPER_DPT 0x1096 513#define E1000_DEV_ID_80003ES2LAN_COPPER_DPT 0x1096
471#define E1000_DEV_ID_80003ES2LAN_SERDES_DPT 0x1098 514#define E1000_DEV_ID_80003ES2LAN_SERDES_DPT 0x1098
515#define E1000_DEV_ID_80003ES2LAN_COPPER_SPT 0x10BA
516#define E1000_DEV_ID_80003ES2LAN_SERDES_SPT 0x10BB
517
518#define E1000_DEV_ID_ICH8_IGP_M_AMT 0x1049
519#define E1000_DEV_ID_ICH8_IGP_AMT 0x104A
520#define E1000_DEV_ID_ICH8_IGP_C 0x104B
521#define E1000_DEV_ID_ICH8_IFE 0x104C
522#define E1000_DEV_ID_ICH8_IGP_M 0x104D
472 523
473 524
474#define NODE_ADDRESS_SIZE 6 525#define NODE_ADDRESS_SIZE 6
@@ -539,6 +590,14 @@ int32_t e1000_check_phy_reset_block(struct e1000_hw *hw);
539 E1000_IMS_RXSEQ | \ 590 E1000_IMS_RXSEQ | \
540 E1000_IMS_LSC) 591 E1000_IMS_LSC)
541 592
593/* Additional interrupts need to be handled for e1000_ich8lan:
594 DSW = The FW changed the status of the DISSW bit in FWSM
595 PHYINT = The LAN connected device generates an interrupt
596 EPRST = Manageability reset event */
597#define IMS_ICH8LAN_ENABLE_MASK (\
598 E1000_IMS_DSW | \
599 E1000_IMS_PHYINT | \
600 E1000_IMS_EPRST)
542 601
543/* Number of high/low register pairs in the RAR. The RAR (Receive Address 602/* Number of high/low register pairs in the RAR. The RAR (Receive Address
544 * Registers) holds the directed and multicast addresses that we monitor. We 603 * Registers) holds the directed and multicast addresses that we monitor. We
@@ -546,6 +605,7 @@ int32_t e1000_check_phy_reset_block(struct e1000_hw *hw);
546 * E1000_RAR_ENTRIES - 1 multicast addresses. 605 * E1000_RAR_ENTRIES - 1 multicast addresses.
547 */ 606 */
548#define E1000_RAR_ENTRIES 15 607#define E1000_RAR_ENTRIES 15
608#define E1000_RAR_ENTRIES_ICH8LAN 7
549 609
550#define MIN_NUMBER_OF_DESCRIPTORS 8 610#define MIN_NUMBER_OF_DESCRIPTORS 8
551#define MAX_NUMBER_OF_DESCRIPTORS 0xFFF8 611#define MAX_NUMBER_OF_DESCRIPTORS 0xFFF8
@@ -767,6 +827,9 @@ struct e1000_data_desc {
767#define E1000_MC_TBL_SIZE 128 /* Multicast Filter Table (4096 bits) */ 827#define E1000_MC_TBL_SIZE 128 /* Multicast Filter Table (4096 bits) */
768#define E1000_VLAN_FILTER_TBL_SIZE 128 /* VLAN Filter Table (4096 bits) */ 828#define E1000_VLAN_FILTER_TBL_SIZE 128 /* VLAN Filter Table (4096 bits) */
769 829
830#define E1000_NUM_UNICAST_ICH8LAN 7
831#define E1000_MC_TBL_SIZE_ICH8LAN 32
832
770 833
771/* Receive Address Register */ 834/* Receive Address Register */
772struct e1000_rar { 835struct e1000_rar {
@@ -776,6 +839,7 @@ struct e1000_rar {
776 839
777/* Number of entries in the Multicast Table Array (MTA). */ 840/* Number of entries in the Multicast Table Array (MTA). */
778#define E1000_NUM_MTA_REGISTERS 128 841#define E1000_NUM_MTA_REGISTERS 128
842#define E1000_NUM_MTA_REGISTERS_ICH8LAN 32
779 843
780/* IPv4 Address Table Entry */ 844/* IPv4 Address Table Entry */
781struct e1000_ipv4_at_entry { 845struct e1000_ipv4_at_entry {
@@ -786,6 +850,7 @@ struct e1000_ipv4_at_entry {
786/* Four wakeup IP addresses are supported */ 850/* Four wakeup IP addresses are supported */
787#define E1000_WAKEUP_IP_ADDRESS_COUNT_MAX 4 851#define E1000_WAKEUP_IP_ADDRESS_COUNT_MAX 4
788#define E1000_IP4AT_SIZE E1000_WAKEUP_IP_ADDRESS_COUNT_MAX 852#define E1000_IP4AT_SIZE E1000_WAKEUP_IP_ADDRESS_COUNT_MAX
853#define E1000_IP4AT_SIZE_ICH8LAN 3
789#define E1000_IP6AT_SIZE 1 854#define E1000_IP6AT_SIZE 1
790 855
791/* IPv6 Address Table Entry */ 856/* IPv6 Address Table Entry */
@@ -844,6 +909,7 @@ struct e1000_ffvt_entry {
844#define E1000_FLA 0x0001C /* Flash Access - RW */ 909#define E1000_FLA 0x0001C /* Flash Access - RW */
845#define E1000_MDIC 0x00020 /* MDI Control - RW */ 910#define E1000_MDIC 0x00020 /* MDI Control - RW */
846#define E1000_SCTL 0x00024 /* SerDes Control - RW */ 911#define E1000_SCTL 0x00024 /* SerDes Control - RW */
912#define E1000_FEXTNVM 0x00028 /* Future Extended NVM register */
847#define E1000_FCAL 0x00028 /* Flow Control Address Low - RW */ 913#define E1000_FCAL 0x00028 /* Flow Control Address Low - RW */
848#define E1000_FCAH 0x0002C /* Flow Control Address High -RW */ 914#define E1000_FCAH 0x0002C /* Flow Control Address High -RW */
849#define E1000_FCT 0x00030 /* Flow Control Type - RW */ 915#define E1000_FCT 0x00030 /* Flow Control Type - RW */
@@ -872,6 +938,8 @@ struct e1000_ffvt_entry {
872#define E1000_LEDCTL 0x00E00 /* LED Control - RW */ 938#define E1000_LEDCTL 0x00E00 /* LED Control - RW */
873#define E1000_EXTCNF_CTRL 0x00F00 /* Extended Configuration Control */ 939#define E1000_EXTCNF_CTRL 0x00F00 /* Extended Configuration Control */
874#define E1000_EXTCNF_SIZE 0x00F08 /* Extended Configuration Size */ 940#define E1000_EXTCNF_SIZE 0x00F08 /* Extended Configuration Size */
941#define E1000_PHY_CTRL 0x00F10 /* PHY Control Register in CSR */
942#define FEXTNVM_SW_CONFIG 0x0001
875#define E1000_PBA 0x01000 /* Packet Buffer Allocation - RW */ 943#define E1000_PBA 0x01000 /* Packet Buffer Allocation - RW */
876#define E1000_PBS 0x01008 /* Packet Buffer Size */ 944#define E1000_PBS 0x01008 /* Packet Buffer Size */
877#define E1000_EEMNGCTL 0x01010 /* MNG EEprom Control */ 945#define E1000_EEMNGCTL 0x01010 /* MNG EEprom Control */
@@ -899,11 +967,13 @@ struct e1000_ffvt_entry {
899#define E1000_RDH0 E1000_RDH /* RX Desc Head (0) - RW */ 967#define E1000_RDH0 E1000_RDH /* RX Desc Head (0) - RW */
900#define E1000_RDT0 E1000_RDT /* RX Desc Tail (0) - RW */ 968#define E1000_RDT0 E1000_RDT /* RX Desc Tail (0) - RW */
901#define E1000_RDTR0 E1000_RDTR /* RX Delay Timer (0) - RW */ 969#define E1000_RDTR0 E1000_RDTR /* RX Delay Timer (0) - RW */
902#define E1000_RXDCTL 0x02828 /* RX Descriptor Control - RW */ 970#define E1000_RXDCTL 0x02828 /* RX Descriptor Control queue 0 - RW */
971#define E1000_RXDCTL1 0x02928 /* RX Descriptor Control queue 1 - RW */
903#define E1000_RADV 0x0282C /* RX Interrupt Absolute Delay Timer - RW */ 972#define E1000_RADV 0x0282C /* RX Interrupt Absolute Delay Timer - RW */
904#define E1000_RSRPD 0x02C00 /* RX Small Packet Detect - RW */ 973#define E1000_RSRPD 0x02C00 /* RX Small Packet Detect - RW */
905#define E1000_RAID 0x02C08 /* Receive Ack Interrupt Delay - RW */ 974#define E1000_RAID 0x02C08 /* Receive Ack Interrupt Delay - RW */
906#define E1000_TXDMAC 0x03000 /* TX DMA Control - RW */ 975#define E1000_TXDMAC 0x03000 /* TX DMA Control - RW */
976#define E1000_KABGTXD 0x03004 /* AFE Band Gap Transmit Ref Data */
907#define E1000_TDFH 0x03410 /* TX Data FIFO Head - RW */ 977#define E1000_TDFH 0x03410 /* TX Data FIFO Head - RW */
908#define E1000_TDFT 0x03418 /* TX Data FIFO Tail - RW */ 978#define E1000_TDFT 0x03418 /* TX Data FIFO Tail - RW */
909#define E1000_TDFHS 0x03420 /* TX Data FIFO Head Saved - RW */ 979#define E1000_TDFHS 0x03420 /* TX Data FIFO Head Saved - RW */
@@ -1050,6 +1120,7 @@ struct e1000_ffvt_entry {
1050#define E1000_82542_FLA E1000_FLA 1120#define E1000_82542_FLA E1000_FLA
1051#define E1000_82542_MDIC E1000_MDIC 1121#define E1000_82542_MDIC E1000_MDIC
1052#define E1000_82542_SCTL E1000_SCTL 1122#define E1000_82542_SCTL E1000_SCTL
1123#define E1000_82542_FEXTNVM E1000_FEXTNVM
1053#define E1000_82542_FCAL E1000_FCAL 1124#define E1000_82542_FCAL E1000_FCAL
1054#define E1000_82542_FCAH E1000_FCAH 1125#define E1000_82542_FCAH E1000_FCAH
1055#define E1000_82542_FCT E1000_FCT 1126#define E1000_82542_FCT E1000_FCT
@@ -1073,6 +1144,19 @@ struct e1000_ffvt_entry {
1073#define E1000_82542_RDLEN0 E1000_82542_RDLEN 1144#define E1000_82542_RDLEN0 E1000_82542_RDLEN
1074#define E1000_82542_RDH0 E1000_82542_RDH 1145#define E1000_82542_RDH0 E1000_82542_RDH
1075#define E1000_82542_RDT0 E1000_82542_RDT 1146#define E1000_82542_RDT0 E1000_82542_RDT
1147#define E1000_82542_SRRCTL(_n) (0x280C + ((_n) << 8)) /* Split and Replication
1148 * RX Control - RW */
1149#define E1000_82542_DCA_RXCTRL(_n) (0x02814 + ((_n) << 8))
1150#define E1000_82542_RDBAH3 0x02B04 /* RX Desc Base High Queue 3 - RW */
1151#define E1000_82542_RDBAL3 0x02B00 /* RX Desc Low Queue 3 - RW */
1152#define E1000_82542_RDLEN3 0x02B08 /* RX Desc Length Queue 3 - RW */
1153#define E1000_82542_RDH3 0x02B10 /* RX Desc Head Queue 3 - RW */
1154#define E1000_82542_RDT3 0x02B18 /* RX Desc Tail Queue 3 - RW */
1155#define E1000_82542_RDBAL2 0x02A00 /* RX Desc Base Low Queue 2 - RW */
1156#define E1000_82542_RDBAH2 0x02A04 /* RX Desc Base High Queue 2 - RW */
1157#define E1000_82542_RDLEN2 0x02A08 /* RX Desc Length Queue 2 - RW */
1158#define E1000_82542_RDH2 0x02A10 /* RX Desc Head Queue 2 - RW */
1159#define E1000_82542_RDT2 0x02A18 /* RX Desc Tail Queue 2 - RW */
1076#define E1000_82542_RDTR1 0x00130 1160#define E1000_82542_RDTR1 0x00130
1077#define E1000_82542_RDBAL1 0x00138 1161#define E1000_82542_RDBAL1 0x00138
1078#define E1000_82542_RDBAH1 0x0013C 1162#define E1000_82542_RDBAH1 0x0013C
@@ -1110,11 +1194,14 @@ struct e1000_ffvt_entry {
1110#define E1000_82542_FLOP E1000_FLOP 1194#define E1000_82542_FLOP E1000_FLOP
1111#define E1000_82542_EXTCNF_CTRL E1000_EXTCNF_CTRL 1195#define E1000_82542_EXTCNF_CTRL E1000_EXTCNF_CTRL
1112#define E1000_82542_EXTCNF_SIZE E1000_EXTCNF_SIZE 1196#define E1000_82542_EXTCNF_SIZE E1000_EXTCNF_SIZE
1197#define E1000_82542_PHY_CTRL E1000_PHY_CTRL
1113#define E1000_82542_ERT E1000_ERT 1198#define E1000_82542_ERT E1000_ERT
1114#define E1000_82542_RXDCTL E1000_RXDCTL 1199#define E1000_82542_RXDCTL E1000_RXDCTL
1200#define E1000_82542_RXDCTL1 E1000_RXDCTL1
1115#define E1000_82542_RADV E1000_RADV 1201#define E1000_82542_RADV E1000_RADV
1116#define E1000_82542_RSRPD E1000_RSRPD 1202#define E1000_82542_RSRPD E1000_RSRPD
1117#define E1000_82542_TXDMAC E1000_TXDMAC 1203#define E1000_82542_TXDMAC E1000_TXDMAC
1204#define E1000_82542_KABGTXD E1000_KABGTXD
1118#define E1000_82542_TDFHS E1000_TDFHS 1205#define E1000_82542_TDFHS E1000_TDFHS
1119#define E1000_82542_TDFTS E1000_TDFTS 1206#define E1000_82542_TDFTS E1000_TDFTS
1120#define E1000_82542_TDFPC E1000_TDFPC 1207#define E1000_82542_TDFPC E1000_TDFPC
@@ -1310,13 +1397,16 @@ struct e1000_hw_stats {
1310 1397
1311/* Structure containing variables used by the shared code (e1000_hw.c) */ 1398/* Structure containing variables used by the shared code (e1000_hw.c) */
1312struct e1000_hw { 1399struct e1000_hw {
1313 uint8_t __iomem *hw_addr; 1400 uint8_t *hw_addr;
1314 uint8_t *flash_address; 1401 uint8_t *flash_address;
1315 e1000_mac_type mac_type; 1402 e1000_mac_type mac_type;
1316 e1000_phy_type phy_type; 1403 e1000_phy_type phy_type;
1317 uint32_t phy_init_script; 1404 uint32_t phy_init_script;
1318 e1000_media_type media_type; 1405 e1000_media_type media_type;
1319 void *back; 1406 void *back;
1407 struct e1000_shadow_ram *eeprom_shadow_ram;
1408 uint32_t flash_bank_size;
1409 uint32_t flash_base_addr;
1320 e1000_fc_type fc; 1410 e1000_fc_type fc;
1321 e1000_bus_speed bus_speed; 1411 e1000_bus_speed bus_speed;
1322 e1000_bus_width bus_width; 1412 e1000_bus_width bus_width;
@@ -1328,6 +1418,7 @@ struct e1000_hw {
1328 uint32_t asf_firmware_present; 1418 uint32_t asf_firmware_present;
1329 uint32_t eeprom_semaphore_present; 1419 uint32_t eeprom_semaphore_present;
1330 uint32_t swfw_sync_present; 1420 uint32_t swfw_sync_present;
1421 uint32_t swfwhw_semaphore_present;
1331 unsigned long io_base; 1422 unsigned long io_base;
1332 uint32_t phy_id; 1423 uint32_t phy_id;
1333 uint32_t phy_revision; 1424 uint32_t phy_revision;
@@ -1387,6 +1478,7 @@ struct e1000_hw {
1387 boolean_t in_ifs_mode; 1478 boolean_t in_ifs_mode;
1388 boolean_t mng_reg_access_disabled; 1479 boolean_t mng_reg_access_disabled;
1389 boolean_t leave_av_bit_off; 1480 boolean_t leave_av_bit_off;
1481 boolean_t kmrn_lock_loss_workaround_disabled;
1390}; 1482};
1391 1483
1392 1484
@@ -1435,6 +1527,7 @@ struct e1000_hw {
1435#define E1000_CTRL_RTE 0x20000000 /* Routing tag enable */ 1527#define E1000_CTRL_RTE 0x20000000 /* Routing tag enable */
1436#define E1000_CTRL_VME 0x40000000 /* IEEE VLAN mode enable */ 1528#define E1000_CTRL_VME 0x40000000 /* IEEE VLAN mode enable */
1437#define E1000_CTRL_PHY_RST 0x80000000 /* PHY Reset */ 1529#define E1000_CTRL_PHY_RST 0x80000000 /* PHY Reset */
1530#define E1000_CTRL_SW2FW_INT 0x02000000 /* Initiate an interrupt to manageability engine */
1438 1531
1439/* Device Status */ 1532/* Device Status */
1440#define E1000_STATUS_FD 0x00000001 /* Full duplex.0=half,1=full */ 1533#define E1000_STATUS_FD 0x00000001 /* Full duplex.0=half,1=full */
@@ -1449,6 +1542,8 @@ struct e1000_hw {
1449#define E1000_STATUS_SPEED_10 0x00000000 /* Speed 10Mb/s */ 1542#define E1000_STATUS_SPEED_10 0x00000000 /* Speed 10Mb/s */
1450#define E1000_STATUS_SPEED_100 0x00000040 /* Speed 100Mb/s */ 1543#define E1000_STATUS_SPEED_100 0x00000040 /* Speed 100Mb/s */
1451#define E1000_STATUS_SPEED_1000 0x00000080 /* Speed 1000Mb/s */ 1544#define E1000_STATUS_SPEED_1000 0x00000080 /* Speed 1000Mb/s */
1545#define E1000_STATUS_LAN_INIT_DONE 0x00000200 /* Lan Init Completion
1546 by EEPROM/Flash */
1452#define E1000_STATUS_ASDV 0x00000300 /* Auto speed detect value */ 1547#define E1000_STATUS_ASDV 0x00000300 /* Auto speed detect value */
1453#define E1000_STATUS_DOCK_CI 0x00000800 /* Change in Dock/Undock state. Clear on write '0'. */ 1548#define E1000_STATUS_DOCK_CI 0x00000800 /* Change in Dock/Undock state. Clear on write '0'. */
1454#define E1000_STATUS_GIO_MASTER_ENABLE 0x00080000 /* Status of Master requests. */ 1549#define E1000_STATUS_GIO_MASTER_ENABLE 0x00080000 /* Status of Master requests. */
@@ -1506,6 +1601,10 @@ struct e1000_hw {
1506#define E1000_STM_OPCODE 0xDB00 1601#define E1000_STM_OPCODE 0xDB00
1507#define E1000_HICR_FW_RESET 0xC0 1602#define E1000_HICR_FW_RESET 0xC0
1508 1603
1604#define E1000_SHADOW_RAM_WORDS 2048
1605#define E1000_ICH8_NVM_SIG_WORD 0x13
1606#define E1000_ICH8_NVM_SIG_MASK 0xC0
1607
1509/* EEPROM Read */ 1608/* EEPROM Read */
1510#define E1000_EERD_START 0x00000001 /* Start Read */ 1609#define E1000_EERD_START 0x00000001 /* Start Read */
1511#define E1000_EERD_DONE 0x00000010 /* Read Done */ 1610#define E1000_EERD_DONE 0x00000010 /* Read Done */
@@ -1551,7 +1650,6 @@ struct e1000_hw {
1551#define E1000_CTRL_EXT_WR_WMARK_320 0x01000000 1650#define E1000_CTRL_EXT_WR_WMARK_320 0x01000000
1552#define E1000_CTRL_EXT_WR_WMARK_384 0x02000000 1651#define E1000_CTRL_EXT_WR_WMARK_384 0x02000000
1553#define E1000_CTRL_EXT_WR_WMARK_448 0x03000000 1652#define E1000_CTRL_EXT_WR_WMARK_448 0x03000000
1554#define E1000_CTRL_EXT_CANC 0x04000000 /* Interrupt delay cancellation */
1555#define E1000_CTRL_EXT_DRV_LOAD 0x10000000 /* Driver loaded bit for FW */ 1653#define E1000_CTRL_EXT_DRV_LOAD 0x10000000 /* Driver loaded bit for FW */
1556#define E1000_CTRL_EXT_IAME 0x08000000 /* Interrupt acknowledge Auto-mask */ 1654#define E1000_CTRL_EXT_IAME 0x08000000 /* Interrupt acknowledge Auto-mask */
1557#define E1000_CTRL_EXT_INT_TIMER_CLR 0x20000000 /* Clear Interrupt timers after IMS clear */ 1655#define E1000_CTRL_EXT_INT_TIMER_CLR 0x20000000 /* Clear Interrupt timers after IMS clear */
@@ -1591,12 +1689,31 @@ struct e1000_hw {
1591#define E1000_KUMCTRLSTA_FIFO_CTRL_TX_BYPASS 0x00000800 1689#define E1000_KUMCTRLSTA_FIFO_CTRL_TX_BYPASS 0x00000800
1592 1690
1593/* In-Band Control */ 1691/* In-Band Control */
1692#define E1000_KUMCTRLSTA_INB_CTRL_LINK_STATUS_TX_TIMEOUT_DEFAULT 0x00000500
1594#define E1000_KUMCTRLSTA_INB_CTRL_DIS_PADDING 0x00000010 1693#define E1000_KUMCTRLSTA_INB_CTRL_DIS_PADDING 0x00000010
1595 1694
1596/* Half-Duplex Control */ 1695/* Half-Duplex Control */
1597#define E1000_KUMCTRLSTA_HD_CTRL_10_100_DEFAULT 0x00000004 1696#define E1000_KUMCTRLSTA_HD_CTRL_10_100_DEFAULT 0x00000004
1598#define E1000_KUMCTRLSTA_HD_CTRL_1000_DEFAULT 0x00000000 1697#define E1000_KUMCTRLSTA_HD_CTRL_1000_DEFAULT 0x00000000
1599 1698
1699#define E1000_KUMCTRLSTA_OFFSET_K0S_CTRL 0x0000001E
1700
1701#define E1000_KUMCTRLSTA_DIAG_FELPBK 0x2000
1702#define E1000_KUMCTRLSTA_DIAG_NELPBK 0x1000
1703
1704#define E1000_KUMCTRLSTA_K0S_100_EN 0x2000
1705#define E1000_KUMCTRLSTA_K0S_GBE_EN 0x1000
1706#define E1000_KUMCTRLSTA_K0S_ENTRY_LATENCY_MASK 0x0003
1707
1708#define E1000_KABGTXD_BGSQLBIAS 0x00050000
1709
1710#define E1000_PHY_CTRL_SPD_EN 0x00000001
1711#define E1000_PHY_CTRL_D0A_LPLU 0x00000002
1712#define E1000_PHY_CTRL_NOND0A_LPLU 0x00000004
1713#define E1000_PHY_CTRL_NOND0A_GBE_DISABLE 0x00000008
1714#define E1000_PHY_CTRL_GBE_DISABLE 0x00000040
1715#define E1000_PHY_CTRL_B2B_EN 0x00000080
1716
1600/* LED Control */ 1717/* LED Control */
1601#define E1000_LEDCTL_LED0_MODE_MASK 0x0000000F 1718#define E1000_LEDCTL_LED0_MODE_MASK 0x0000000F
1602#define E1000_LEDCTL_LED0_MODE_SHIFT 0 1719#define E1000_LEDCTL_LED0_MODE_SHIFT 0
@@ -1666,6 +1783,9 @@ struct e1000_hw {
1666#define E1000_ICR_RXD_FIFO_PAR1 0x01000000 /* queue 1 Rx descriptor FIFO parity error */ 1783#define E1000_ICR_RXD_FIFO_PAR1 0x01000000 /* queue 1 Rx descriptor FIFO parity error */
1667#define E1000_ICR_TXD_FIFO_PAR1 0x02000000 /* queue 1 Tx descriptor FIFO parity error */ 1784#define E1000_ICR_TXD_FIFO_PAR1 0x02000000 /* queue 1 Tx descriptor FIFO parity error */
1668#define E1000_ICR_ALL_PARITY 0x03F00000 /* all parity error bits */ 1785#define E1000_ICR_ALL_PARITY 0x03F00000 /* all parity error bits */
1786#define E1000_ICR_DSW 0x00000020 /* FW changed the status of DISSW bit in the FWSM */
1787#define E1000_ICR_PHYINT 0x00001000 /* LAN connected device generates an interrupt */
1788#define E1000_ICR_EPRST 0x00100000 /* ME handware reset occurs */
1669 1789
1670/* Interrupt Cause Set */ 1790/* Interrupt Cause Set */
1671#define E1000_ICS_TXDW E1000_ICR_TXDW /* Transmit desc written back */ 1791#define E1000_ICS_TXDW E1000_ICR_TXDW /* Transmit desc written back */
@@ -1692,6 +1812,9 @@ struct e1000_hw {
1692#define E1000_ICS_PB_PAR E1000_ICR_PB_PAR /* packet buffer parity error */ 1812#define E1000_ICS_PB_PAR E1000_ICR_PB_PAR /* packet buffer parity error */
1693#define E1000_ICS_RXD_FIFO_PAR1 E1000_ICR_RXD_FIFO_PAR1 /* queue 1 Rx descriptor FIFO parity error */ 1813#define E1000_ICS_RXD_FIFO_PAR1 E1000_ICR_RXD_FIFO_PAR1 /* queue 1 Rx descriptor FIFO parity error */
1694#define E1000_ICS_TXD_FIFO_PAR1 E1000_ICR_TXD_FIFO_PAR1 /* queue 1 Tx descriptor FIFO parity error */ 1814#define E1000_ICS_TXD_FIFO_PAR1 E1000_ICR_TXD_FIFO_PAR1 /* queue 1 Tx descriptor FIFO parity error */
1815#define E1000_ICS_DSW E1000_ICR_DSW
1816#define E1000_ICS_PHYINT E1000_ICR_PHYINT
1817#define E1000_ICS_EPRST E1000_ICR_EPRST
1695 1818
1696/* Interrupt Mask Set */ 1819/* Interrupt Mask Set */
1697#define E1000_IMS_TXDW E1000_ICR_TXDW /* Transmit desc written back */ 1820#define E1000_IMS_TXDW E1000_ICR_TXDW /* Transmit desc written back */
@@ -1718,6 +1841,9 @@ struct e1000_hw {
1718#define E1000_IMS_PB_PAR E1000_ICR_PB_PAR /* packet buffer parity error */ 1841#define E1000_IMS_PB_PAR E1000_ICR_PB_PAR /* packet buffer parity error */
1719#define E1000_IMS_RXD_FIFO_PAR1 E1000_ICR_RXD_FIFO_PAR1 /* queue 1 Rx descriptor FIFO parity error */ 1842#define E1000_IMS_RXD_FIFO_PAR1 E1000_ICR_RXD_FIFO_PAR1 /* queue 1 Rx descriptor FIFO parity error */
1720#define E1000_IMS_TXD_FIFO_PAR1 E1000_ICR_TXD_FIFO_PAR1 /* queue 1 Tx descriptor FIFO parity error */ 1843#define E1000_IMS_TXD_FIFO_PAR1 E1000_ICR_TXD_FIFO_PAR1 /* queue 1 Tx descriptor FIFO parity error */
1844#define E1000_IMS_DSW E1000_ICR_DSW
1845#define E1000_IMS_PHYINT E1000_ICR_PHYINT
1846#define E1000_IMS_EPRST E1000_ICR_EPRST
1721 1847
1722/* Interrupt Mask Clear */ 1848/* Interrupt Mask Clear */
1723#define E1000_IMC_TXDW E1000_ICR_TXDW /* Transmit desc written back */ 1849#define E1000_IMC_TXDW E1000_ICR_TXDW /* Transmit desc written back */
@@ -1744,6 +1870,9 @@ struct e1000_hw {
1744#define E1000_IMC_PB_PAR E1000_ICR_PB_PAR /* packet buffer parity error */ 1870#define E1000_IMC_PB_PAR E1000_ICR_PB_PAR /* packet buffer parity error */
1745#define E1000_IMC_RXD_FIFO_PAR1 E1000_ICR_RXD_FIFO_PAR1 /* queue 1 Rx descriptor FIFO parity error */ 1871#define E1000_IMC_RXD_FIFO_PAR1 E1000_ICR_RXD_FIFO_PAR1 /* queue 1 Rx descriptor FIFO parity error */
1746#define E1000_IMC_TXD_FIFO_PAR1 E1000_ICR_TXD_FIFO_PAR1 /* queue 1 Tx descriptor FIFO parity error */ 1872#define E1000_IMC_TXD_FIFO_PAR1 E1000_ICR_TXD_FIFO_PAR1 /* queue 1 Tx descriptor FIFO parity error */
1873#define E1000_IMC_DSW E1000_ICR_DSW
1874#define E1000_IMC_PHYINT E1000_ICR_PHYINT
1875#define E1000_IMC_EPRST E1000_ICR_EPRST
1747 1876
1748/* Receive Control */ 1877/* Receive Control */
1749#define E1000_RCTL_RST 0x00000001 /* Software reset */ 1878#define E1000_RCTL_RST 0x00000001 /* Software reset */
@@ -1918,9 +2047,10 @@ struct e1000_hw {
1918#define E1000_MRQC_RSS_FIELD_MASK 0xFFFF0000 2047#define E1000_MRQC_RSS_FIELD_MASK 0xFFFF0000
1919#define E1000_MRQC_RSS_FIELD_IPV4_TCP 0x00010000 2048#define E1000_MRQC_RSS_FIELD_IPV4_TCP 0x00010000
1920#define E1000_MRQC_RSS_FIELD_IPV4 0x00020000 2049#define E1000_MRQC_RSS_FIELD_IPV4 0x00020000
1921#define E1000_MRQC_RSS_FIELD_IPV6_TCP 0x00040000 2050#define E1000_MRQC_RSS_FIELD_IPV6_TCP_EX 0x00040000
1922#define E1000_MRQC_RSS_FIELD_IPV6_EX 0x00080000 2051#define E1000_MRQC_RSS_FIELD_IPV6_EX 0x00080000
1923#define E1000_MRQC_RSS_FIELD_IPV6 0x00100000 2052#define E1000_MRQC_RSS_FIELD_IPV6 0x00100000
2053#define E1000_MRQC_RSS_FIELD_IPV6_TCP 0x00200000
1924 2054
1925/* Definitions for power management and wakeup registers */ 2055/* Definitions for power management and wakeup registers */
1926/* Wake Up Control */ 2056/* Wake Up Control */
@@ -2010,6 +2140,15 @@ struct e1000_hw {
2010#define E1000_FWSM_MODE_SHIFT 1 2140#define E1000_FWSM_MODE_SHIFT 1
2011#define E1000_FWSM_FW_VALID 0x00008000 /* FW established a valid mode */ 2141#define E1000_FWSM_FW_VALID 0x00008000 /* FW established a valid mode */
2012 2142
2143#define E1000_FWSM_RSPCIPHY 0x00000040 /* Reset PHY on PCI reset */
2144#define E1000_FWSM_DISSW 0x10000000 /* FW disable SW Write Access */
2145#define E1000_FWSM_SKUSEL_MASK 0x60000000 /* LAN SKU select */
2146#define E1000_FWSM_SKUEL_SHIFT 29
2147#define E1000_FWSM_SKUSEL_EMB 0x0 /* Embedded SKU */
2148#define E1000_FWSM_SKUSEL_CONS 0x1 /* Consumer SKU */
2149#define E1000_FWSM_SKUSEL_PERF_100 0x2 /* Perf & Corp 10/100 SKU */
2150#define E1000_FWSM_SKUSEL_PERF_GBE 0x3 /* Perf & Copr GbE SKU */
2151
2013/* FFLT Debug Register */ 2152/* FFLT Debug Register */
2014#define E1000_FFLT_DBG_INVC 0x00100000 /* Invalid /C/ code handling */ 2153#define E1000_FFLT_DBG_INVC 0x00100000 /* Invalid /C/ code handling */
2015 2154
@@ -2082,6 +2221,8 @@ struct e1000_host_command_info {
2082 E1000_GCR_TXDSCW_NO_SNOOP | \ 2221 E1000_GCR_TXDSCW_NO_SNOOP | \
2083 E1000_GCR_TXDSCR_NO_SNOOP) 2222 E1000_GCR_TXDSCR_NO_SNOOP)
2084 2223
2224#define PCI_EX_82566_SNOOP_ALL PCI_EX_NO_SNOOP_ALL
2225
2085#define E1000_GCR_L1_ACT_WITHOUT_L0S_RX 0x08000000 2226#define E1000_GCR_L1_ACT_WITHOUT_L0S_RX 0x08000000
2086/* Function Active and Power State to MNG */ 2227/* Function Active and Power State to MNG */
2087#define E1000_FACTPS_FUNC0_POWER_STATE_MASK 0x00000003 2228#define E1000_FACTPS_FUNC0_POWER_STATE_MASK 0x00000003
@@ -2140,8 +2281,10 @@ struct e1000_host_command_info {
2140#define EEPROM_PHY_CLASS_WORD 0x0007 2281#define EEPROM_PHY_CLASS_WORD 0x0007
2141#define EEPROM_INIT_CONTROL1_REG 0x000A 2282#define EEPROM_INIT_CONTROL1_REG 0x000A
2142#define EEPROM_INIT_CONTROL2_REG 0x000F 2283#define EEPROM_INIT_CONTROL2_REG 0x000F
2284#define EEPROM_SWDEF_PINS_CTRL_PORT_1 0x0010
2143#define EEPROM_INIT_CONTROL3_PORT_B 0x0014 2285#define EEPROM_INIT_CONTROL3_PORT_B 0x0014
2144#define EEPROM_INIT_3GIO_3 0x001A 2286#define EEPROM_INIT_3GIO_3 0x001A
2287#define EEPROM_SWDEF_PINS_CTRL_PORT_0 0x0020
2145#define EEPROM_INIT_CONTROL3_PORT_A 0x0024 2288#define EEPROM_INIT_CONTROL3_PORT_A 0x0024
2146#define EEPROM_CFG 0x0012 2289#define EEPROM_CFG 0x0012
2147#define EEPROM_FLASH_VERSION 0x0032 2290#define EEPROM_FLASH_VERSION 0x0032
@@ -2153,10 +2296,16 @@ struct e1000_host_command_info {
2153/* Word definitions for ID LED Settings */ 2296/* Word definitions for ID LED Settings */
2154#define ID_LED_RESERVED_0000 0x0000 2297#define ID_LED_RESERVED_0000 0x0000
2155#define ID_LED_RESERVED_FFFF 0xFFFF 2298#define ID_LED_RESERVED_FFFF 0xFFFF
2299#define ID_LED_RESERVED_82573 0xF746
2300#define ID_LED_DEFAULT_82573 0x1811
2156#define ID_LED_DEFAULT ((ID_LED_OFF1_ON2 << 12) | \ 2301#define ID_LED_DEFAULT ((ID_LED_OFF1_ON2 << 12) | \
2157 (ID_LED_OFF1_OFF2 << 8) | \ 2302 (ID_LED_OFF1_OFF2 << 8) | \
2158 (ID_LED_DEF1_DEF2 << 4) | \ 2303 (ID_LED_DEF1_DEF2 << 4) | \
2159 (ID_LED_DEF1_DEF2)) 2304 (ID_LED_DEF1_DEF2))
2305#define ID_LED_DEFAULT_ICH8LAN ((ID_LED_DEF1_DEF2 << 12) | \
2306 (ID_LED_DEF1_OFF2 << 8) | \
2307 (ID_LED_DEF1_ON2 << 4) | \
2308 (ID_LED_DEF1_DEF2))
2160#define ID_LED_DEF1_DEF2 0x1 2309#define ID_LED_DEF1_DEF2 0x1
2161#define ID_LED_DEF1_ON2 0x2 2310#define ID_LED_DEF1_ON2 0x2
2162#define ID_LED_DEF1_OFF2 0x3 2311#define ID_LED_DEF1_OFF2 0x3
@@ -2191,6 +2340,11 @@ struct e1000_host_command_info {
2191#define EEPROM_WORD0F_ASM_DIR 0x2000 2340#define EEPROM_WORD0F_ASM_DIR 0x2000
2192#define EEPROM_WORD0F_ANE 0x0800 2341#define EEPROM_WORD0F_ANE 0x0800
2193#define EEPROM_WORD0F_SWPDIO_EXT 0x00F0 2342#define EEPROM_WORD0F_SWPDIO_EXT 0x00F0
2343#define EEPROM_WORD0F_LPLU 0x0001
2344
2345/* Mask bits for fields in Word 0x10/0x20 of the EEPROM */
2346#define EEPROM_WORD1020_GIGA_DISABLE 0x0010
2347#define EEPROM_WORD1020_GIGA_DISABLE_NON_D0A 0x0008
2194 2348
2195/* Mask bits for fields in Word 0x1a of the EEPROM */ 2349/* Mask bits for fields in Word 0x1a of the EEPROM */
2196#define EEPROM_WORD1A_ASPM_MASK 0x000C 2350#define EEPROM_WORD1A_ASPM_MASK 0x000C
@@ -2265,23 +2419,29 @@ struct e1000_host_command_info {
2265#define E1000_EXTCNF_CTRL_D_UD_OWNER 0x00000010 2419#define E1000_EXTCNF_CTRL_D_UD_OWNER 0x00000010
2266#define E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP 0x00000020 2420#define E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP 0x00000020
2267#define E1000_EXTCNF_CTRL_MDIO_HW_OWNERSHIP 0x00000040 2421#define E1000_EXTCNF_CTRL_MDIO_HW_OWNERSHIP 0x00000040
2268#define E1000_EXTCNF_CTRL_EXT_CNF_POINTER 0x1FFF0000 2422#define E1000_EXTCNF_CTRL_EXT_CNF_POINTER 0x0FFF0000
2269 2423
2270#define E1000_EXTCNF_SIZE_EXT_PHY_LENGTH 0x000000FF 2424#define E1000_EXTCNF_SIZE_EXT_PHY_LENGTH 0x000000FF
2271#define E1000_EXTCNF_SIZE_EXT_DOCK_LENGTH 0x0000FF00 2425#define E1000_EXTCNF_SIZE_EXT_DOCK_LENGTH 0x0000FF00
2272#define E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH 0x00FF0000 2426#define E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH 0x00FF0000
2427#define E1000_EXTCNF_CTRL_LCD_WRITE_ENABLE 0x00000001
2428#define E1000_EXTCNF_CTRL_SWFLAG 0x00000020
2273 2429
2274/* PBA constants */ 2430/* PBA constants */
2431#define E1000_PBA_8K 0x0008 /* 8KB, default Rx allocation */
2275#define E1000_PBA_12K 0x000C /* 12KB, default Rx allocation */ 2432#define E1000_PBA_12K 0x000C /* 12KB, default Rx allocation */
2276#define E1000_PBA_16K 0x0010 /* 16KB, default TX allocation */ 2433#define E1000_PBA_16K 0x0010 /* 16KB, default TX allocation */
2277#define E1000_PBA_22K 0x0016 2434#define E1000_PBA_22K 0x0016
2278#define E1000_PBA_24K 0x0018 2435#define E1000_PBA_24K 0x0018
2279#define E1000_PBA_30K 0x001E 2436#define E1000_PBA_30K 0x001E
2280#define E1000_PBA_32K 0x0020 2437#define E1000_PBA_32K 0x0020
2438#define E1000_PBA_34K 0x0022
2281#define E1000_PBA_38K 0x0026 2439#define E1000_PBA_38K 0x0026
2282#define E1000_PBA_40K 0x0028 2440#define E1000_PBA_40K 0x0028
2283#define E1000_PBA_48K 0x0030 /* 48KB, default RX allocation */ 2441#define E1000_PBA_48K 0x0030 /* 48KB, default RX allocation */
2284 2442
2443#define E1000_PBS_16K E1000_PBA_16K
2444
2285/* Flow Control Constants */ 2445/* Flow Control Constants */
2286#define FLOW_CONTROL_ADDRESS_LOW 0x00C28001 2446#define FLOW_CONTROL_ADDRESS_LOW 0x00C28001
2287#define FLOW_CONTROL_ADDRESS_HIGH 0x00000100 2447#define FLOW_CONTROL_ADDRESS_HIGH 0x00000100
@@ -2336,7 +2496,7 @@ struct e1000_host_command_info {
2336/* Number of milliseconds we wait for Eeprom auto read bit done after MAC reset */ 2496/* Number of milliseconds we wait for Eeprom auto read bit done after MAC reset */
2337#define AUTO_READ_DONE_TIMEOUT 10 2497#define AUTO_READ_DONE_TIMEOUT 10
2338/* Number of milliseconds we wait for PHY configuration done after MAC reset */ 2498/* Number of milliseconds we wait for PHY configuration done after MAC reset */
2339#define PHY_CFG_TIMEOUT 40 2499#define PHY_CFG_TIMEOUT 100
2340 2500
2341#define E1000_TX_BUFFER_SIZE ((uint32_t)1514) 2501#define E1000_TX_BUFFER_SIZE ((uint32_t)1514)
2342 2502
@@ -2764,6 +2924,17 @@ struct e1000_host_command_info {
2764#define M88E1000_EPSCR_TX_CLK_25 0x0070 /* 25 MHz TX_CLK */ 2924#define M88E1000_EPSCR_TX_CLK_25 0x0070 /* 25 MHz TX_CLK */
2765#define M88E1000_EPSCR_TX_CLK_0 0x0000 /* NO TX_CLK */ 2925#define M88E1000_EPSCR_TX_CLK_0 0x0000 /* NO TX_CLK */
2766 2926
2927/* M88EC018 Rev 2 specific DownShift settings */
2928#define M88EC018_EPSCR_DOWNSHIFT_COUNTER_MASK 0x0E00
2929#define M88EC018_EPSCR_DOWNSHIFT_COUNTER_1X 0x0000
2930#define M88EC018_EPSCR_DOWNSHIFT_COUNTER_2X 0x0200
2931#define M88EC018_EPSCR_DOWNSHIFT_COUNTER_3X 0x0400
2932#define M88EC018_EPSCR_DOWNSHIFT_COUNTER_4X 0x0600
2933#define M88EC018_EPSCR_DOWNSHIFT_COUNTER_5X 0x0800
2934#define M88EC018_EPSCR_DOWNSHIFT_COUNTER_6X 0x0A00
2935#define M88EC018_EPSCR_DOWNSHIFT_COUNTER_7X 0x0C00
2936#define M88EC018_EPSCR_DOWNSHIFT_COUNTER_8X 0x0E00
2937
2767/* IGP01E1000 Specific Port Config Register - R/W */ 2938/* IGP01E1000 Specific Port Config Register - R/W */
2768#define IGP01E1000_PSCFR_AUTO_MDIX_PAR_DETECT 0x0010 2939#define IGP01E1000_PSCFR_AUTO_MDIX_PAR_DETECT 0x0010
2769#define IGP01E1000_PSCFR_PRE_EN 0x0020 2940#define IGP01E1000_PSCFR_PRE_EN 0x0020
@@ -2990,6 +3161,221 @@ struct e1000_host_command_info {
2990#define L1LXT971A_PHY_ID 0x001378E0 3161#define L1LXT971A_PHY_ID 0x001378E0
2991#define GG82563_E_PHY_ID 0x01410CA0 3162#define GG82563_E_PHY_ID 0x01410CA0
2992 3163
3164
3165/* Bits...
3166 * 15-5: page
3167 * 4-0: register offset
3168 */
3169#define PHY_PAGE_SHIFT 5
3170#define PHY_REG(page, reg) \
3171 (((page) << PHY_PAGE_SHIFT) | ((reg) & MAX_PHY_REG_ADDRESS))
3172
3173#define IGP3_PHY_PORT_CTRL \
3174 PHY_REG(769, 17) /* Port General Configuration */
3175#define IGP3_PHY_RATE_ADAPT_CTRL \
3176 PHY_REG(769, 25) /* Rate Adapter Control Register */
3177
3178#define IGP3_KMRN_FIFO_CTRL_STATS \
3179 PHY_REG(770, 16) /* KMRN FIFO's control/status register */
3180#define IGP3_KMRN_POWER_MNG_CTRL \
3181 PHY_REG(770, 17) /* KMRN Power Management Control Register */
3182#define IGP3_KMRN_INBAND_CTRL \
3183 PHY_REG(770, 18) /* KMRN Inband Control Register */
3184#define IGP3_KMRN_DIAG \
3185 PHY_REG(770, 19) /* KMRN Diagnostic register */
3186#define IGP3_KMRN_DIAG_PCS_LOCK_LOSS 0x0002 /* RX PCS is not synced */
3187#define IGP3_KMRN_ACK_TIMEOUT \
3188 PHY_REG(770, 20) /* KMRN Acknowledge Timeouts register */
3189
3190#define IGP3_VR_CTRL \
3191 PHY_REG(776, 18) /* Voltage regulator control register */
3192#define IGP3_VR_CTRL_MODE_SHUT 0x0200 /* Enter powerdown, shutdown VRs */
3193
3194#define IGP3_CAPABILITY \
3195 PHY_REG(776, 19) /* IGP3 Capability Register */
3196
3197/* Capabilities for SKU Control */
3198#define IGP3_CAP_INITIATE_TEAM 0x0001 /* Able to initiate a team */
3199#define IGP3_CAP_WFM 0x0002 /* Support WoL and PXE */
3200#define IGP3_CAP_ASF 0x0004 /* Support ASF */
3201#define IGP3_CAP_LPLU 0x0008 /* Support Low Power Link Up */
3202#define IGP3_CAP_DC_AUTO_SPEED 0x0010 /* Support AC/DC Auto Link Speed */
3203#define IGP3_CAP_SPD 0x0020 /* Support Smart Power Down */
3204#define IGP3_CAP_MULT_QUEUE 0x0040 /* Support 2 tx & 2 rx queues */
3205#define IGP3_CAP_RSS 0x0080 /* Support RSS */
3206#define IGP3_CAP_8021PQ 0x0100 /* Support 802.1Q & 802.1p */
3207#define IGP3_CAP_AMT_CB 0x0200 /* Support active manageability and circuit breaker */
3208
3209#define IGP3_PPC_JORDAN_EN 0x0001
3210#define IGP3_PPC_JORDAN_GIGA_SPEED 0x0002
3211
3212#define IGP3_KMRN_PMC_EE_IDLE_LINK_DIS 0x0001
3213#define IGP3_KMRN_PMC_K0S_ENTRY_LATENCY_MASK 0x001E
3214#define IGP3_KMRN_PMC_K0S_MODE1_EN_GIGA 0x0020
3215#define IGP3_KMRN_PMC_K0S_MODE1_EN_100 0x0040
3216
3217#define IGP3E1000_PHY_MISC_CTRL 0x1B /* Misc. Ctrl register */
3218#define IGP3_PHY_MISC_DUPLEX_MANUAL_SET 0x1000 /* Duplex Manual Set */
3219
3220#define IGP3_KMRN_EXT_CTRL PHY_REG(770, 18)
3221#define IGP3_KMRN_EC_DIS_INBAND 0x0080
3222
3223#define IGP03E1000_E_PHY_ID 0x02A80390
3224#define IFE_E_PHY_ID 0x02A80330 /* 10/100 PHY */
3225#define IFE_PLUS_E_PHY_ID 0x02A80320
3226#define IFE_C_E_PHY_ID 0x02A80310
3227
3228#define IFE_PHY_EXTENDED_STATUS_CONTROL 0x10 /* 100BaseTx Extended Status, Control and Address */
3229#define IFE_PHY_SPECIAL_CONTROL 0x11 /* 100BaseTx PHY special control register */
3230#define IFE_PHY_RCV_FALSE_CARRIER 0x13 /* 100BaseTx Receive False Carrier Counter */
3231#define IFE_PHY_RCV_DISCONNECT 0x14 /* 100BaseTx Receive Disconnet Counter */
3232#define IFE_PHY_RCV_ERROT_FRAME 0x15 /* 100BaseTx Receive Error Frame Counter */
3233#define IFE_PHY_RCV_SYMBOL_ERR 0x16 /* Receive Symbol Error Counter */
3234#define IFE_PHY_PREM_EOF_ERR 0x17 /* 100BaseTx Receive Premature End Of Frame Error Counter */
3235#define IFE_PHY_RCV_EOF_ERR 0x18 /* 10BaseT Receive End Of Frame Error Counter */
3236#define IFE_PHY_TX_JABBER_DETECT 0x19 /* 10BaseT Transmit Jabber Detect Counter */
3237#define IFE_PHY_EQUALIZER 0x1A /* PHY Equalizer Control and Status */
3238#define IFE_PHY_SPECIAL_CONTROL_LED 0x1B /* PHY special control and LED configuration */
3239#define IFE_PHY_MDIX_CONTROL 0x1C /* MDI/MDI-X Control register */
3240#define IFE_PHY_HWI_CONTROL 0x1D /* Hardware Integrity Control (HWI) */
3241
3242#define IFE_PESC_REDUCED_POWER_DOWN_DISABLE 0x2000 /* Defaut 1 = Disable auto reduced power down */
3243#define IFE_PESC_100BTX_POWER_DOWN 0x0400 /* Indicates the power state of 100BASE-TX */
3244#define IFE_PESC_10BTX_POWER_DOWN 0x0200 /* Indicates the power state of 10BASE-T */
3245#define IFE_PESC_POLARITY_REVERSED 0x0100 /* Indicates 10BASE-T polarity */
3246#define IFE_PESC_PHY_ADDR_MASK 0x007C /* Bit 6:2 for sampled PHY address */
3247#define IFE_PESC_SPEED 0x0002 /* Auto-negotiation speed result 1=100Mbs, 0=10Mbs */
3248#define IFE_PESC_DUPLEX 0x0001 /* Auto-negotiation duplex result 1=Full, 0=Half */
3249#define IFE_PESC_POLARITY_REVERSED_SHIFT 8
3250
3251#define IFE_PSC_DISABLE_DYNAMIC_POWER_DOWN 0x0100 /* 1 = Dyanmic Power Down disabled */
3252#define IFE_PSC_FORCE_POLARITY 0x0020 /* 1=Reversed Polarity, 0=Normal */
3253#define IFE_PSC_AUTO_POLARITY_DISABLE 0x0010 /* 1=Auto Polarity Disabled, 0=Enabled */
3254#define IFE_PSC_JABBER_FUNC_DISABLE 0x0001 /* 1=Jabber Disabled, 0=Normal Jabber Operation */
3255#define IFE_PSC_FORCE_POLARITY_SHIFT 5
3256#define IFE_PSC_AUTO_POLARITY_DISABLE_SHIFT 4
3257
3258#define IFE_PMC_AUTO_MDIX 0x0080 /* 1=enable MDI/MDI-X feature, default 0=disabled */
3259#define IFE_PMC_FORCE_MDIX 0x0040 /* 1=force MDIX-X, 0=force MDI */
3260#define IFE_PMC_MDIX_STATUS 0x0020 /* 1=MDI-X, 0=MDI */
3261#define IFE_PMC_AUTO_MDIX_COMPLETE 0x0010 /* Resolution algorthm is completed */
3262#define IFE_PMC_MDIX_MODE_SHIFT 6
3263#define IFE_PHC_MDIX_RESET_ALL_MASK 0x0000 /* Disable auto MDI-X */
3264
3265#define IFE_PHC_HWI_ENABLE 0x8000 /* Enable the HWI feature */
3266#define IFE_PHC_ABILITY_CHECK 0x4000 /* 1= Test Passed, 0=failed */
3267#define IFE_PHC_TEST_EXEC 0x2000 /* PHY launch test pulses on the wire */
3268#define IFE_PHC_HIGHZ 0x0200 /* 1 = Open Circuit */
3269#define IFE_PHC_LOWZ 0x0400 /* 1 = Short Circuit */
3270#define IFE_PHC_LOW_HIGH_Z_MASK 0x0600 /* Mask for indication type of problem on the line */
3271#define IFE_PHC_DISTANCE_MASK 0x01FF /* Mask for distance to the cable problem, in 80cm granularity */
3272#define IFE_PHC_RESET_ALL_MASK 0x0000 /* Disable HWI */
3273#define IFE_PSCL_PROBE_MODE 0x0020 /* LED Probe mode */
3274#define IFE_PSCL_PROBE_LEDS_OFF 0x0006 /* Force LEDs 0 and 2 off */
3275#define IFE_PSCL_PROBE_LEDS_ON 0x0007 /* Force LEDs 0 and 2 on */
3276
3277#define ICH8_FLASH_COMMAND_TIMEOUT 500 /* 500 ms , should be adjusted */
3278#define ICH8_FLASH_CYCLE_REPEAT_COUNT 10 /* 10 cycles , should be adjusted */
3279#define ICH8_FLASH_SEG_SIZE_256 256
3280#define ICH8_FLASH_SEG_SIZE_4K 4096
3281#define ICH8_FLASH_SEG_SIZE_64K 65536
3282
3283#define ICH8_CYCLE_READ 0x0
3284#define ICH8_CYCLE_RESERVED 0x1
3285#define ICH8_CYCLE_WRITE 0x2
3286#define ICH8_CYCLE_ERASE 0x3
3287
3288#define ICH8_FLASH_GFPREG 0x0000
3289#define ICH8_FLASH_HSFSTS 0x0004
3290#define ICH8_FLASH_HSFCTL 0x0006
3291#define ICH8_FLASH_FADDR 0x0008
3292#define ICH8_FLASH_FDATA0 0x0010
3293#define ICH8_FLASH_FRACC 0x0050
3294#define ICH8_FLASH_FREG0 0x0054
3295#define ICH8_FLASH_FREG1 0x0058
3296#define ICH8_FLASH_FREG2 0x005C
3297#define ICH8_FLASH_FREG3 0x0060
3298#define ICH8_FLASH_FPR0 0x0074
3299#define ICH8_FLASH_FPR1 0x0078
3300#define ICH8_FLASH_SSFSTS 0x0090
3301#define ICH8_FLASH_SSFCTL 0x0092
3302#define ICH8_FLASH_PREOP 0x0094
3303#define ICH8_FLASH_OPTYPE 0x0096
3304#define ICH8_FLASH_OPMENU 0x0098
3305
3306#define ICH8_FLASH_REG_MAPSIZE 0x00A0
3307#define ICH8_FLASH_SECTOR_SIZE 4096
3308#define ICH8_GFPREG_BASE_MASK 0x1FFF
3309#define ICH8_FLASH_LINEAR_ADDR_MASK 0x00FFFFFF
3310
3311/* ICH8 GbE Flash Hardware Sequencing Flash Status Register bit breakdown */
3312/* Offset 04h HSFSTS */
3313union ich8_hws_flash_status {
3314 struct ich8_hsfsts {
3315#ifdef E1000_BIG_ENDIAN
3316 uint16_t reserved2 :6;
3317 uint16_t fldesvalid :1;
3318 uint16_t flockdn :1;
3319 uint16_t flcdone :1;
3320 uint16_t flcerr :1;
3321 uint16_t dael :1;
3322 uint16_t berasesz :2;
3323 uint16_t flcinprog :1;
3324 uint16_t reserved1 :2;
3325#else
3326 uint16_t flcdone :1; /* bit 0 Flash Cycle Done */
3327 uint16_t flcerr :1; /* bit 1 Flash Cycle Error */
3328 uint16_t dael :1; /* bit 2 Direct Access error Log */
3329 uint16_t berasesz :2; /* bit 4:3 Block/Sector Erase Size */
3330 uint16_t flcinprog :1; /* bit 5 flash SPI cycle in Progress */
3331 uint16_t reserved1 :2; /* bit 13:6 Reserved */
3332 uint16_t reserved2 :6; /* bit 13:6 Reserved */
3333 uint16_t fldesvalid :1; /* bit 14 Flash Descriptor Valid */
3334 uint16_t flockdn :1; /* bit 15 Flash Configuration Lock-Down */
3335#endif
3336 } hsf_status;
3337 uint16_t regval;
3338};
3339
3340/* ICH8 GbE Flash Hardware Sequencing Flash control Register bit breakdown */
3341/* Offset 06h FLCTL */
3342union ich8_hws_flash_ctrl {
3343 struct ich8_hsflctl {
3344#ifdef E1000_BIG_ENDIAN
3345 uint16_t fldbcount :2;
3346 uint16_t flockdn :6;
3347 uint16_t flcgo :1;
3348 uint16_t flcycle :2;
3349 uint16_t reserved :5;
3350#else
3351 uint16_t flcgo :1; /* 0 Flash Cycle Go */
3352 uint16_t flcycle :2; /* 2:1 Flash Cycle */
3353 uint16_t reserved :5; /* 7:3 Reserved */
3354 uint16_t fldbcount :2; /* 9:8 Flash Data Byte Count */
3355 uint16_t flockdn :6; /* 15:10 Reserved */
3356#endif
3357 } hsf_ctrl;
3358 uint16_t regval;
3359};
3360
3361/* ICH8 Flash Region Access Permissions */
3362union ich8_hws_flash_regacc {
3363 struct ich8_flracc {
3364#ifdef E1000_BIG_ENDIAN
3365 uint32_t gmwag :8;
3366 uint32_t gmrag :8;
3367 uint32_t grwa :8;
3368 uint32_t grra :8;
3369#else
3370 uint32_t grra :8; /* 0:7 GbE region Read Access */
3371 uint32_t grwa :8; /* 8:15 GbE region Write Access */
3372 uint32_t gmrag :8; /* 23:16 GbE Master Read Access Grant */
3373 uint32_t gmwag :8; /* 31:24 GbE Master Write Access Grant */
3374#endif
3375 } hsf_flregacc;
3376 uint16_t regval;
3377};
3378
2993/* Miscellaneous PHY bit definitions. */ 3379/* Miscellaneous PHY bit definitions. */
2994#define PHY_PREAMBLE 0xFFFFFFFF 3380#define PHY_PREAMBLE 0xFFFFFFFF
2995#define PHY_SOF 0x01 3381#define PHY_SOF 0x01
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index f77624f5f17b..627f224d78bc 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -36,7 +36,7 @@ static char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver";
36#else 36#else
37#define DRIVERNAPI "-NAPI" 37#define DRIVERNAPI "-NAPI"
38#endif 38#endif
39#define DRV_VERSION "7.0.38-k4"DRIVERNAPI 39#define DRV_VERSION "7.1.9-k4"DRIVERNAPI
40char e1000_driver_version[] = DRV_VERSION; 40char e1000_driver_version[] = DRV_VERSION;
41static char e1000_copyright[] = "Copyright (c) 1999-2006 Intel Corporation."; 41static char e1000_copyright[] = "Copyright (c) 1999-2006 Intel Corporation.";
42 42
@@ -73,6 +73,11 @@ static struct pci_device_id e1000_pci_tbl[] = {
73 INTEL_E1000_ETHERNET_DEVICE(0x1026), 73 INTEL_E1000_ETHERNET_DEVICE(0x1026),
74 INTEL_E1000_ETHERNET_DEVICE(0x1027), 74 INTEL_E1000_ETHERNET_DEVICE(0x1027),
75 INTEL_E1000_ETHERNET_DEVICE(0x1028), 75 INTEL_E1000_ETHERNET_DEVICE(0x1028),
76 INTEL_E1000_ETHERNET_DEVICE(0x1049),
77 INTEL_E1000_ETHERNET_DEVICE(0x104A),
78 INTEL_E1000_ETHERNET_DEVICE(0x104B),
79 INTEL_E1000_ETHERNET_DEVICE(0x104C),
80 INTEL_E1000_ETHERNET_DEVICE(0x104D),
76 INTEL_E1000_ETHERNET_DEVICE(0x105E), 81 INTEL_E1000_ETHERNET_DEVICE(0x105E),
77 INTEL_E1000_ETHERNET_DEVICE(0x105F), 82 INTEL_E1000_ETHERNET_DEVICE(0x105F),
78 INTEL_E1000_ETHERNET_DEVICE(0x1060), 83 INTEL_E1000_ETHERNET_DEVICE(0x1060),
@@ -96,6 +101,8 @@ static struct pci_device_id e1000_pci_tbl[] = {
96 INTEL_E1000_ETHERNET_DEVICE(0x109A), 101 INTEL_E1000_ETHERNET_DEVICE(0x109A),
97 INTEL_E1000_ETHERNET_DEVICE(0x10B5), 102 INTEL_E1000_ETHERNET_DEVICE(0x10B5),
98 INTEL_E1000_ETHERNET_DEVICE(0x10B9), 103 INTEL_E1000_ETHERNET_DEVICE(0x10B9),
104 INTEL_E1000_ETHERNET_DEVICE(0x10BA),
105 INTEL_E1000_ETHERNET_DEVICE(0x10BB),
99 /* required last entry */ 106 /* required last entry */
100 {0,} 107 {0,}
101}; 108};
@@ -133,7 +140,6 @@ static void e1000_clean_rx_ring(struct e1000_adapter *adapter,
133static void e1000_set_multi(struct net_device *netdev); 140static void e1000_set_multi(struct net_device *netdev);
134static void e1000_update_phy_info(unsigned long data); 141static void e1000_update_phy_info(unsigned long data);
135static void e1000_watchdog(unsigned long data); 142static void e1000_watchdog(unsigned long data);
136static void e1000_watchdog_task(struct e1000_adapter *adapter);
137static void e1000_82547_tx_fifo_stall(unsigned long data); 143static void e1000_82547_tx_fifo_stall(unsigned long data);
138static int e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev); 144static int e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev);
139static struct net_device_stats * e1000_get_stats(struct net_device *netdev); 145static struct net_device_stats * e1000_get_stats(struct net_device *netdev);
@@ -178,8 +184,8 @@ static void e1000_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid);
178static void e1000_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid); 184static void e1000_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid);
179static void e1000_restore_vlan(struct e1000_adapter *adapter); 185static void e1000_restore_vlan(struct e1000_adapter *adapter);
180 186
181#ifdef CONFIG_PM
182static int e1000_suspend(struct pci_dev *pdev, pm_message_t state); 187static int e1000_suspend(struct pci_dev *pdev, pm_message_t state);
188#ifdef CONFIG_PM
183static int e1000_resume(struct pci_dev *pdev); 189static int e1000_resume(struct pci_dev *pdev);
184#endif 190#endif
185static void e1000_shutdown(struct pci_dev *pdev); 191static void e1000_shutdown(struct pci_dev *pdev);
@@ -206,8 +212,8 @@ static struct pci_driver e1000_driver = {
206 .probe = e1000_probe, 212 .probe = e1000_probe,
207 .remove = __devexit_p(e1000_remove), 213 .remove = __devexit_p(e1000_remove),
208 /* Power Managment Hooks */ 214 /* Power Managment Hooks */
209#ifdef CONFIG_PM
210 .suspend = e1000_suspend, 215 .suspend = e1000_suspend,
216#ifdef CONFIG_PM
211 .resume = e1000_resume, 217 .resume = e1000_resume,
212#endif 218#endif
213 .shutdown = e1000_shutdown, 219 .shutdown = e1000_shutdown,
@@ -261,6 +267,44 @@ e1000_exit_module(void)
261 267
262module_exit(e1000_exit_module); 268module_exit(e1000_exit_module);
263 269
270static int e1000_request_irq(struct e1000_adapter *adapter)
271{
272 struct net_device *netdev = adapter->netdev;
273 int flags, err = 0;
274
275 flags = IRQF_SHARED;
276#ifdef CONFIG_PCI_MSI
277 if (adapter->hw.mac_type > e1000_82547_rev_2) {
278 adapter->have_msi = TRUE;
279 if ((err = pci_enable_msi(adapter->pdev))) {
280 DPRINTK(PROBE, ERR,
281 "Unable to allocate MSI interrupt Error: %d\n", err);
282 adapter->have_msi = FALSE;
283 }
284 }
285 if (adapter->have_msi)
286 flags &= ~IRQF_SHARED;
287#endif
288 if ((err = request_irq(adapter->pdev->irq, &e1000_intr, flags,
289 netdev->name, netdev)))
290 DPRINTK(PROBE, ERR,
291 "Unable to allocate interrupt Error: %d\n", err);
292
293 return err;
294}
295
296static void e1000_free_irq(struct e1000_adapter *adapter)
297{
298 struct net_device *netdev = adapter->netdev;
299
300 free_irq(adapter->pdev->irq, netdev);
301
302#ifdef CONFIG_PCI_MSI
303 if (adapter->have_msi)
304 pci_disable_msi(adapter->pdev);
305#endif
306}
307
264/** 308/**
265 * e1000_irq_disable - Mask off interrupt generation on the NIC 309 * e1000_irq_disable - Mask off interrupt generation on the NIC
266 * @adapter: board private structure 310 * @adapter: board private structure
@@ -329,6 +373,7 @@ e1000_release_hw_control(struct e1000_adapter *adapter)
329{ 373{
330 uint32_t ctrl_ext; 374 uint32_t ctrl_ext;
331 uint32_t swsm; 375 uint32_t swsm;
376 uint32_t extcnf;
332 377
333 /* Let firmware taken over control of h/w */ 378 /* Let firmware taken over control of h/w */
334 switch (adapter->hw.mac_type) { 379 switch (adapter->hw.mac_type) {
@@ -343,6 +388,11 @@ e1000_release_hw_control(struct e1000_adapter *adapter)
343 swsm = E1000_READ_REG(&adapter->hw, SWSM); 388 swsm = E1000_READ_REG(&adapter->hw, SWSM);
344 E1000_WRITE_REG(&adapter->hw, SWSM, 389 E1000_WRITE_REG(&adapter->hw, SWSM,
345 swsm & ~E1000_SWSM_DRV_LOAD); 390 swsm & ~E1000_SWSM_DRV_LOAD);
391 case e1000_ich8lan:
392 extcnf = E1000_READ_REG(&adapter->hw, CTRL_EXT);
393 E1000_WRITE_REG(&adapter->hw, CTRL_EXT,
394 extcnf & ~E1000_CTRL_EXT_DRV_LOAD);
395 break;
346 default: 396 default:
347 break; 397 break;
348 } 398 }
@@ -364,6 +414,7 @@ e1000_get_hw_control(struct e1000_adapter *adapter)
364{ 414{
365 uint32_t ctrl_ext; 415 uint32_t ctrl_ext;
366 uint32_t swsm; 416 uint32_t swsm;
417 uint32_t extcnf;
367 /* Let firmware know the driver has taken over */ 418 /* Let firmware know the driver has taken over */
368 switch (adapter->hw.mac_type) { 419 switch (adapter->hw.mac_type) {
369 case e1000_82571: 420 case e1000_82571:
@@ -378,6 +429,11 @@ e1000_get_hw_control(struct e1000_adapter *adapter)
378 E1000_WRITE_REG(&adapter->hw, SWSM, 429 E1000_WRITE_REG(&adapter->hw, SWSM,
379 swsm | E1000_SWSM_DRV_LOAD); 430 swsm | E1000_SWSM_DRV_LOAD);
380 break; 431 break;
432 case e1000_ich8lan:
433 extcnf = E1000_READ_REG(&adapter->hw, EXTCNF_CTRL);
434 E1000_WRITE_REG(&adapter->hw, EXTCNF_CTRL,
435 extcnf | E1000_EXTCNF_CTRL_SWFLAG);
436 break;
381 default: 437 default:
382 break; 438 break;
383 } 439 }
@@ -387,18 +443,10 @@ int
387e1000_up(struct e1000_adapter *adapter) 443e1000_up(struct e1000_adapter *adapter)
388{ 444{
389 struct net_device *netdev = adapter->netdev; 445 struct net_device *netdev = adapter->netdev;
390 int i, err; 446 int i;
391 447
392 /* hardware has been reset, we need to reload some things */ 448 /* hardware has been reset, we need to reload some things */
393 449
394 /* Reset the PHY if it was previously powered down */
395 if (adapter->hw.media_type == e1000_media_type_copper) {
396 uint16_t mii_reg;
397 e1000_read_phy_reg(&adapter->hw, PHY_CTRL, &mii_reg);
398 if (mii_reg & MII_CR_POWER_DOWN)
399 e1000_phy_hw_reset(&adapter->hw);
400 }
401
402 e1000_set_multi(netdev); 450 e1000_set_multi(netdev);
403 451
404 e1000_restore_vlan(adapter); 452 e1000_restore_vlan(adapter);
@@ -415,24 +463,6 @@ e1000_up(struct e1000_adapter *adapter)
415 E1000_DESC_UNUSED(ring)); 463 E1000_DESC_UNUSED(ring));
416 } 464 }
417 465
418#ifdef CONFIG_PCI_MSI
419 if (adapter->hw.mac_type > e1000_82547_rev_2) {
420 adapter->have_msi = TRUE;
421 if ((err = pci_enable_msi(adapter->pdev))) {
422 DPRINTK(PROBE, ERR,
423 "Unable to allocate MSI interrupt Error: %d\n", err);
424 adapter->have_msi = FALSE;
425 }
426 }
427#endif
428 if ((err = request_irq(adapter->pdev->irq, &e1000_intr,
429 IRQF_SHARED | IRQF_SAMPLE_RANDOM,
430 netdev->name, netdev))) {
431 DPRINTK(PROBE, ERR,
432 "Unable to allocate interrupt Error: %d\n", err);
433 return err;
434 }
435
436 adapter->tx_queue_len = netdev->tx_queue_len; 466 adapter->tx_queue_len = netdev->tx_queue_len;
437 467
438 mod_timer(&adapter->watchdog_timer, jiffies); 468 mod_timer(&adapter->watchdog_timer, jiffies);
@@ -445,21 +475,60 @@ e1000_up(struct e1000_adapter *adapter)
445 return 0; 475 return 0;
446} 476}
447 477
478/**
479 * e1000_power_up_phy - restore link in case the phy was powered down
480 * @adapter: address of board private structure
481 *
482 * The phy may be powered down to save power and turn off link when the
483 * driver is unloaded and wake on lan is not enabled (among others)
484 * *** this routine MUST be followed by a call to e1000_reset ***
485 *
486 **/
487
488static void e1000_power_up_phy(struct e1000_adapter *adapter)
489{
490 uint16_t mii_reg = 0;
491
492 /* Just clear the power down bit to wake the phy back up */
493 if (adapter->hw.media_type == e1000_media_type_copper) {
494 /* according to the manual, the phy will retain its
495 * settings across a power-down/up cycle */
496 e1000_read_phy_reg(&adapter->hw, PHY_CTRL, &mii_reg);
497 mii_reg &= ~MII_CR_POWER_DOWN;
498 e1000_write_phy_reg(&adapter->hw, PHY_CTRL, mii_reg);
499 }
500}
501
502static void e1000_power_down_phy(struct e1000_adapter *adapter)
503{
504 boolean_t mng_mode_enabled = (adapter->hw.mac_type >= e1000_82571) &&
505 e1000_check_mng_mode(&adapter->hw);
506 /* Power down the PHY so no link is implied when interface is down
507 * The PHY cannot be powered down if any of the following is TRUE
508 * (a) WoL is enabled
509 * (b) AMT is active
510 * (c) SoL/IDER session is active */
511 if (!adapter->wol && adapter->hw.mac_type >= e1000_82540 &&
512 adapter->hw.mac_type != e1000_ich8lan &&
513 adapter->hw.media_type == e1000_media_type_copper &&
514 !(E1000_READ_REG(&adapter->hw, MANC) & E1000_MANC_SMBUS_EN) &&
515 !mng_mode_enabled &&
516 !e1000_check_phy_reset_block(&adapter->hw)) {
517 uint16_t mii_reg = 0;
518 e1000_read_phy_reg(&adapter->hw, PHY_CTRL, &mii_reg);
519 mii_reg |= MII_CR_POWER_DOWN;
520 e1000_write_phy_reg(&adapter->hw, PHY_CTRL, mii_reg);
521 mdelay(1);
522 }
523}
524
448void 525void
449e1000_down(struct e1000_adapter *adapter) 526e1000_down(struct e1000_adapter *adapter)
450{ 527{
451 struct net_device *netdev = adapter->netdev; 528 struct net_device *netdev = adapter->netdev;
452 boolean_t mng_mode_enabled = (adapter->hw.mac_type >= e1000_82571) &&
453 e1000_check_mng_mode(&adapter->hw);
454 529
455 e1000_irq_disable(adapter); 530 e1000_irq_disable(adapter);
456 531
457 free_irq(adapter->pdev->irq, netdev);
458#ifdef CONFIG_PCI_MSI
459 if (adapter->hw.mac_type > e1000_82547_rev_2 &&
460 adapter->have_msi == TRUE)
461 pci_disable_msi(adapter->pdev);
462#endif
463 del_timer_sync(&adapter->tx_fifo_stall_timer); 532 del_timer_sync(&adapter->tx_fifo_stall_timer);
464 del_timer_sync(&adapter->watchdog_timer); 533 del_timer_sync(&adapter->watchdog_timer);
465 del_timer_sync(&adapter->phy_info_timer); 534 del_timer_sync(&adapter->phy_info_timer);
@@ -476,23 +545,17 @@ e1000_down(struct e1000_adapter *adapter)
476 e1000_reset(adapter); 545 e1000_reset(adapter);
477 e1000_clean_all_tx_rings(adapter); 546 e1000_clean_all_tx_rings(adapter);
478 e1000_clean_all_rx_rings(adapter); 547 e1000_clean_all_rx_rings(adapter);
548}
479 549
480 /* Power down the PHY so no link is implied when interface is down * 550void
481 * The PHY cannot be powered down if any of the following is TRUE * 551e1000_reinit_locked(struct e1000_adapter *adapter)
482 * (a) WoL is enabled 552{
483 * (b) AMT is active 553 WARN_ON(in_interrupt());
484 * (c) SoL/IDER session is active */ 554 while (test_and_set_bit(__E1000_RESETTING, &adapter->flags))
485 if (!adapter->wol && adapter->hw.mac_type >= e1000_82540 && 555 msleep(1);
486 adapter->hw.media_type == e1000_media_type_copper && 556 e1000_down(adapter);
487 !(E1000_READ_REG(&adapter->hw, MANC) & E1000_MANC_SMBUS_EN) && 557 e1000_up(adapter);
488 !mng_mode_enabled && 558 clear_bit(__E1000_RESETTING, &adapter->flags);
489 !e1000_check_phy_reset_block(&adapter->hw)) {
490 uint16_t mii_reg;
491 e1000_read_phy_reg(&adapter->hw, PHY_CTRL, &mii_reg);
492 mii_reg |= MII_CR_POWER_DOWN;
493 e1000_write_phy_reg(&adapter->hw, PHY_CTRL, mii_reg);
494 mdelay(1);
495 }
496} 559}
497 560
498void 561void
@@ -518,6 +581,9 @@ e1000_reset(struct e1000_adapter *adapter)
518 case e1000_82573: 581 case e1000_82573:
519 pba = E1000_PBA_12K; 582 pba = E1000_PBA_12K;
520 break; 583 break;
584 case e1000_ich8lan:
585 pba = E1000_PBA_8K;
586 break;
521 default: 587 default:
522 pba = E1000_PBA_48K; 588 pba = E1000_PBA_48K;
523 break; 589 break;
@@ -542,6 +608,12 @@ e1000_reset(struct e1000_adapter *adapter)
542 /* Set the FC high water mark to 90% of the FIFO size. 608 /* Set the FC high water mark to 90% of the FIFO size.
543 * Required to clear last 3 LSB */ 609 * Required to clear last 3 LSB */
544 fc_high_water_mark = ((pba * 9216)/10) & 0xFFF8; 610 fc_high_water_mark = ((pba * 9216)/10) & 0xFFF8;
611 /* We can't use 90% on small FIFOs because the remainder
612 * would be less than 1 full frame. In this case, we size
613 * it to allow at least a full frame above the high water
614 * mark. */
615 if (pba < E1000_PBA_16K)
616 fc_high_water_mark = (pba * 1024) - 1600;
545 617
546 adapter->hw.fc_high_water = fc_high_water_mark; 618 adapter->hw.fc_high_water = fc_high_water_mark;
547 adapter->hw.fc_low_water = fc_high_water_mark - 8; 619 adapter->hw.fc_low_water = fc_high_water_mark - 8;
@@ -564,6 +636,23 @@ e1000_reset(struct e1000_adapter *adapter)
564 636
565 e1000_reset_adaptive(&adapter->hw); 637 e1000_reset_adaptive(&adapter->hw);
566 e1000_phy_get_info(&adapter->hw, &adapter->phy_info); 638 e1000_phy_get_info(&adapter->hw, &adapter->phy_info);
639
640 if (!adapter->smart_power_down &&
641 (adapter->hw.mac_type == e1000_82571 ||
642 adapter->hw.mac_type == e1000_82572)) {
643 uint16_t phy_data = 0;
644 /* speed up time to link by disabling smart power down, ignore
645 * the return value of this function because there is nothing
646 * different we would do if it failed */
647 e1000_read_phy_reg(&adapter->hw, IGP02E1000_PHY_POWER_MGMT,
648 &phy_data);
649 phy_data &= ~IGP02E1000_PM_SPD;
650 e1000_write_phy_reg(&adapter->hw, IGP02E1000_PHY_POWER_MGMT,
651 phy_data);
652 }
653
654 if (adapter->hw.mac_type < e1000_ich8lan)
655 /* FIXME: this code is duplicate and wrong for PCI Express */
567 if (adapter->en_mng_pt) { 656 if (adapter->en_mng_pt) {
568 manc = E1000_READ_REG(&adapter->hw, MANC); 657 manc = E1000_READ_REG(&adapter->hw, MANC);
569 manc |= (E1000_MANC_ARP_EN | E1000_MANC_EN_MNG2HOST); 658 manc |= (E1000_MANC_ARP_EN | E1000_MANC_EN_MNG2HOST);
@@ -590,6 +679,7 @@ e1000_probe(struct pci_dev *pdev,
590 struct net_device *netdev; 679 struct net_device *netdev;
591 struct e1000_adapter *adapter; 680 struct e1000_adapter *adapter;
592 unsigned long mmio_start, mmio_len; 681 unsigned long mmio_start, mmio_len;
682 unsigned long flash_start, flash_len;
593 683
594 static int cards_found = 0; 684 static int cards_found = 0;
595 static int e1000_ksp3_port_a = 0; /* global ksp3 port a indication */ 685 static int e1000_ksp3_port_a = 0; /* global ksp3 port a indication */
@@ -599,10 +689,12 @@ e1000_probe(struct pci_dev *pdev,
599 if ((err = pci_enable_device(pdev))) 689 if ((err = pci_enable_device(pdev)))
600 return err; 690 return err;
601 691
602 if (!(err = pci_set_dma_mask(pdev, DMA_64BIT_MASK))) { 692 if (!(err = pci_set_dma_mask(pdev, DMA_64BIT_MASK)) &&
693 !(err = pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK))) {
603 pci_using_dac = 1; 694 pci_using_dac = 1;
604 } else { 695 } else {
605 if ((err = pci_set_dma_mask(pdev, DMA_32BIT_MASK))) { 696 if ((err = pci_set_dma_mask(pdev, DMA_32BIT_MASK)) &&
697 (err = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK))) {
606 E1000_ERR("No usable DMA configuration, aborting\n"); 698 E1000_ERR("No usable DMA configuration, aborting\n");
607 return err; 699 return err;
608 } 700 }
@@ -682,6 +774,19 @@ e1000_probe(struct pci_dev *pdev,
682 if ((err = e1000_sw_init(adapter))) 774 if ((err = e1000_sw_init(adapter)))
683 goto err_sw_init; 775 goto err_sw_init;
684 776
777 /* Flash BAR mapping must happen after e1000_sw_init
778 * because it depends on mac_type */
779 if ((adapter->hw.mac_type == e1000_ich8lan) &&
780 (pci_resource_flags(pdev, 1) & IORESOURCE_MEM)) {
781 flash_start = pci_resource_start(pdev, 1);
782 flash_len = pci_resource_len(pdev, 1);
783 adapter->hw.flash_address = ioremap(flash_start, flash_len);
784 if (!adapter->hw.flash_address) {
785 err = -EIO;
786 goto err_flashmap;
787 }
788 }
789
685 if ((err = e1000_check_phy_reset_block(&adapter->hw))) 790 if ((err = e1000_check_phy_reset_block(&adapter->hw)))
686 DPRINTK(PROBE, INFO, "PHY reset is blocked due to SOL/IDER session.\n"); 791 DPRINTK(PROBE, INFO, "PHY reset is blocked due to SOL/IDER session.\n");
687 792
@@ -700,6 +805,8 @@ e1000_probe(struct pci_dev *pdev,
700 NETIF_F_HW_VLAN_TX | 805 NETIF_F_HW_VLAN_TX |
701 NETIF_F_HW_VLAN_RX | 806 NETIF_F_HW_VLAN_RX |
702 NETIF_F_HW_VLAN_FILTER; 807 NETIF_F_HW_VLAN_FILTER;
808 if (adapter->hw.mac_type == e1000_ich8lan)
809 netdev->features &= ~NETIF_F_HW_VLAN_FILTER;
703 } 810 }
704 811
705#ifdef NETIF_F_TSO 812#ifdef NETIF_F_TSO
@@ -715,11 +822,17 @@ e1000_probe(struct pci_dev *pdev,
715 if (pci_using_dac) 822 if (pci_using_dac)
716 netdev->features |= NETIF_F_HIGHDMA; 823 netdev->features |= NETIF_F_HIGHDMA;
717 824
718 /* hard_start_xmit is safe against parallel locking */
719 netdev->features |= NETIF_F_LLTX; 825 netdev->features |= NETIF_F_LLTX;
720 826
721 adapter->en_mng_pt = e1000_enable_mng_pass_thru(&adapter->hw); 827 adapter->en_mng_pt = e1000_enable_mng_pass_thru(&adapter->hw);
722 828
829 /* initialize eeprom parameters */
830
831 if (e1000_init_eeprom_params(&adapter->hw)) {
832 E1000_ERR("EEPROM initialization failed\n");
833 return -EIO;
834 }
835
723 /* before reading the EEPROM, reset the controller to 836 /* before reading the EEPROM, reset the controller to
724 * put the device in a known good starting state */ 837 * put the device in a known good starting state */
725 838
@@ -758,9 +871,6 @@ e1000_probe(struct pci_dev *pdev,
758 adapter->watchdog_timer.function = &e1000_watchdog; 871 adapter->watchdog_timer.function = &e1000_watchdog;
759 adapter->watchdog_timer.data = (unsigned long) adapter; 872 adapter->watchdog_timer.data = (unsigned long) adapter;
760 873
761 INIT_WORK(&adapter->watchdog_task,
762 (void (*)(void *))e1000_watchdog_task, adapter);
763
764 init_timer(&adapter->phy_info_timer); 874 init_timer(&adapter->phy_info_timer);
765 adapter->phy_info_timer.function = &e1000_update_phy_info; 875 adapter->phy_info_timer.function = &e1000_update_phy_info;
766 adapter->phy_info_timer.data = (unsigned long) adapter; 876 adapter->phy_info_timer.data = (unsigned long) adapter;
@@ -790,6 +900,11 @@ e1000_probe(struct pci_dev *pdev,
790 EEPROM_INIT_CONTROL2_REG, 1, &eeprom_data); 900 EEPROM_INIT_CONTROL2_REG, 1, &eeprom_data);
791 eeprom_apme_mask = E1000_EEPROM_82544_APM; 901 eeprom_apme_mask = E1000_EEPROM_82544_APM;
792 break; 902 break;
903 case e1000_ich8lan:
904 e1000_read_eeprom(&adapter->hw,
905 EEPROM_INIT_CONTROL1_REG, 1, &eeprom_data);
906 eeprom_apme_mask = E1000_EEPROM_ICH8_APME;
907 break;
793 case e1000_82546: 908 case e1000_82546:
794 case e1000_82546_rev_3: 909 case e1000_82546_rev_3:
795 case e1000_82571: 910 case e1000_82571:
@@ -849,6 +964,9 @@ e1000_probe(struct pci_dev *pdev,
849 return 0; 964 return 0;
850 965
851err_register: 966err_register:
967 if (adapter->hw.flash_address)
968 iounmap(adapter->hw.flash_address);
969err_flashmap:
852err_sw_init: 970err_sw_init:
853err_eeprom: 971err_eeprom:
854 iounmap(adapter->hw.hw_addr); 972 iounmap(adapter->hw.hw_addr);
@@ -882,6 +1000,7 @@ e1000_remove(struct pci_dev *pdev)
882 flush_scheduled_work(); 1000 flush_scheduled_work();
883 1001
884 if (adapter->hw.mac_type >= e1000_82540 && 1002 if (adapter->hw.mac_type >= e1000_82540 &&
1003 adapter->hw.mac_type != e1000_ich8lan &&
885 adapter->hw.media_type == e1000_media_type_copper) { 1004 adapter->hw.media_type == e1000_media_type_copper) {
886 manc = E1000_READ_REG(&adapter->hw, MANC); 1005 manc = E1000_READ_REG(&adapter->hw, MANC);
887 if (manc & E1000_MANC_SMBUS_EN) { 1006 if (manc & E1000_MANC_SMBUS_EN) {
@@ -910,6 +1029,8 @@ e1000_remove(struct pci_dev *pdev)
910#endif 1029#endif
911 1030
912 iounmap(adapter->hw.hw_addr); 1031 iounmap(adapter->hw.hw_addr);
1032 if (adapter->hw.flash_address)
1033 iounmap(adapter->hw.flash_address);
913 pci_release_regions(pdev); 1034 pci_release_regions(pdev);
914 1035
915 free_netdev(netdev); 1036 free_netdev(netdev);
@@ -947,7 +1068,7 @@ e1000_sw_init(struct e1000_adapter *adapter)
947 1068
948 pci_read_config_word(pdev, PCI_COMMAND, &hw->pci_cmd_word); 1069 pci_read_config_word(pdev, PCI_COMMAND, &hw->pci_cmd_word);
949 1070
950 adapter->rx_buffer_len = MAXIMUM_ETHERNET_FRAME_SIZE; 1071 adapter->rx_buffer_len = MAXIMUM_ETHERNET_VLAN_SIZE;
951 adapter->rx_ps_bsize0 = E1000_RXBUFFER_128; 1072 adapter->rx_ps_bsize0 = E1000_RXBUFFER_128;
952 hw->max_frame_size = netdev->mtu + 1073 hw->max_frame_size = netdev->mtu +
953 ENET_HEADER_SIZE + ETHERNET_FCS_SIZE; 1074 ENET_HEADER_SIZE + ETHERNET_FCS_SIZE;
@@ -960,13 +1081,6 @@ e1000_sw_init(struct e1000_adapter *adapter)
960 return -EIO; 1081 return -EIO;
961 } 1082 }
962 1083
963 /* initialize eeprom parameters */
964
965 if (e1000_init_eeprom_params(hw)) {
966 E1000_ERR("EEPROM initialization failed\n");
967 return -EIO;
968 }
969
970 switch (hw->mac_type) { 1084 switch (hw->mac_type) {
971 default: 1085 default:
972 break; 1086 break;
@@ -1078,6 +1192,10 @@ e1000_open(struct net_device *netdev)
1078 struct e1000_adapter *adapter = netdev_priv(netdev); 1192 struct e1000_adapter *adapter = netdev_priv(netdev);
1079 int err; 1193 int err;
1080 1194
1195 /* disallow open during test */
1196 if (test_bit(__E1000_DRIVER_TESTING, &adapter->flags))
1197 return -EBUSY;
1198
1081 /* allocate transmit descriptors */ 1199 /* allocate transmit descriptors */
1082 1200
1083 if ((err = e1000_setup_all_tx_resources(adapter))) 1201 if ((err = e1000_setup_all_tx_resources(adapter)))
@@ -1088,6 +1206,12 @@ e1000_open(struct net_device *netdev)
1088 if ((err = e1000_setup_all_rx_resources(adapter))) 1206 if ((err = e1000_setup_all_rx_resources(adapter)))
1089 goto err_setup_rx; 1207 goto err_setup_rx;
1090 1208
1209 err = e1000_request_irq(adapter);
1210 if (err)
1211 goto err_up;
1212
1213 e1000_power_up_phy(adapter);
1214
1091 if ((err = e1000_up(adapter))) 1215 if ((err = e1000_up(adapter)))
1092 goto err_up; 1216 goto err_up;
1093 adapter->mng_vlan_id = E1000_MNG_VLAN_NONE; 1217 adapter->mng_vlan_id = E1000_MNG_VLAN_NONE;
@@ -1131,7 +1255,10 @@ e1000_close(struct net_device *netdev)
1131{ 1255{
1132 struct e1000_adapter *adapter = netdev_priv(netdev); 1256 struct e1000_adapter *adapter = netdev_priv(netdev);
1133 1257
1258 WARN_ON(test_bit(__E1000_RESETTING, &adapter->flags));
1134 e1000_down(adapter); 1259 e1000_down(adapter);
1260 e1000_power_down_phy(adapter);
1261 e1000_free_irq(adapter);
1135 1262
1136 e1000_free_all_tx_resources(adapter); 1263 e1000_free_all_tx_resources(adapter);
1137 e1000_free_all_rx_resources(adapter); 1264 e1000_free_all_rx_resources(adapter);
@@ -1189,8 +1316,7 @@ e1000_setup_tx_resources(struct e1000_adapter *adapter,
1189 int size; 1316 int size;
1190 1317
1191 size = sizeof(struct e1000_buffer) * txdr->count; 1318 size = sizeof(struct e1000_buffer) * txdr->count;
1192 1319 txdr->buffer_info = vmalloc(size);
1193 txdr->buffer_info = vmalloc_node(size, pcibus_to_node(pdev->bus));
1194 if (!txdr->buffer_info) { 1320 if (!txdr->buffer_info) {
1195 DPRINTK(PROBE, ERR, 1321 DPRINTK(PROBE, ERR,
1196 "Unable to allocate memory for the transmit descriptor ring\n"); 1322 "Unable to allocate memory for the transmit descriptor ring\n");
@@ -1302,11 +1428,11 @@ e1000_configure_tx(struct e1000_adapter *adapter)
1302 tdba = adapter->tx_ring[0].dma; 1428 tdba = adapter->tx_ring[0].dma;
1303 tdlen = adapter->tx_ring[0].count * 1429 tdlen = adapter->tx_ring[0].count *
1304 sizeof(struct e1000_tx_desc); 1430 sizeof(struct e1000_tx_desc);
1305 E1000_WRITE_REG(hw, TDBAL, (tdba & 0x00000000ffffffffULL));
1306 E1000_WRITE_REG(hw, TDBAH, (tdba >> 32));
1307 E1000_WRITE_REG(hw, TDLEN, tdlen); 1431 E1000_WRITE_REG(hw, TDLEN, tdlen);
1308 E1000_WRITE_REG(hw, TDH, 0); 1432 E1000_WRITE_REG(hw, TDBAH, (tdba >> 32));
1433 E1000_WRITE_REG(hw, TDBAL, (tdba & 0x00000000ffffffffULL));
1309 E1000_WRITE_REG(hw, TDT, 0); 1434 E1000_WRITE_REG(hw, TDT, 0);
1435 E1000_WRITE_REG(hw, TDH, 0);
1310 adapter->tx_ring[0].tdh = E1000_TDH; 1436 adapter->tx_ring[0].tdh = E1000_TDH;
1311 adapter->tx_ring[0].tdt = E1000_TDT; 1437 adapter->tx_ring[0].tdt = E1000_TDT;
1312 break; 1438 break;
@@ -1418,7 +1544,7 @@ e1000_setup_rx_resources(struct e1000_adapter *adapter,
1418 int size, desc_len; 1544 int size, desc_len;
1419 1545
1420 size = sizeof(struct e1000_buffer) * rxdr->count; 1546 size = sizeof(struct e1000_buffer) * rxdr->count;
1421 rxdr->buffer_info = vmalloc_node(size, pcibus_to_node(pdev->bus)); 1547 rxdr->buffer_info = vmalloc(size);
1422 if (!rxdr->buffer_info) { 1548 if (!rxdr->buffer_info) {
1423 DPRINTK(PROBE, ERR, 1549 DPRINTK(PROBE, ERR,
1424 "Unable to allocate memory for the receive descriptor ring\n"); 1550 "Unable to allocate memory for the receive descriptor ring\n");
@@ -1560,9 +1686,6 @@ e1000_setup_rctl(struct e1000_adapter *adapter)
1560 E1000_RCTL_LBM_NO | E1000_RCTL_RDMTS_HALF | 1686 E1000_RCTL_LBM_NO | E1000_RCTL_RDMTS_HALF |
1561 (adapter->hw.mc_filter_type << E1000_RCTL_MO_SHIFT); 1687 (adapter->hw.mc_filter_type << E1000_RCTL_MO_SHIFT);
1562 1688
1563 if (adapter->hw.mac_type > e1000_82543)
1564 rctl |= E1000_RCTL_SECRC;
1565
1566 if (adapter->hw.tbi_compatibility_on == 1) 1689 if (adapter->hw.tbi_compatibility_on == 1)
1567 rctl |= E1000_RCTL_SBP; 1690 rctl |= E1000_RCTL_SBP;
1568 else 1691 else
@@ -1628,7 +1751,7 @@ e1000_setup_rctl(struct e1000_adapter *adapter)
1628 rfctl |= E1000_RFCTL_IPV6_DIS; 1751 rfctl |= E1000_RFCTL_IPV6_DIS;
1629 E1000_WRITE_REG(&adapter->hw, RFCTL, rfctl); 1752 E1000_WRITE_REG(&adapter->hw, RFCTL, rfctl);
1630 1753
1631 rctl |= E1000_RCTL_DTYP_PS | E1000_RCTL_SECRC; 1754 rctl |= E1000_RCTL_DTYP_PS;
1632 1755
1633 psrctl |= adapter->rx_ps_bsize0 >> 1756 psrctl |= adapter->rx_ps_bsize0 >>
1634 E1000_PSRCTL_BSIZE0_SHIFT; 1757 E1000_PSRCTL_BSIZE0_SHIFT;
@@ -1712,11 +1835,11 @@ e1000_configure_rx(struct e1000_adapter *adapter)
1712 case 1: 1835 case 1:
1713 default: 1836 default:
1714 rdba = adapter->rx_ring[0].dma; 1837 rdba = adapter->rx_ring[0].dma;
1715 E1000_WRITE_REG(hw, RDBAL, (rdba & 0x00000000ffffffffULL));
1716 E1000_WRITE_REG(hw, RDBAH, (rdba >> 32));
1717 E1000_WRITE_REG(hw, RDLEN, rdlen); 1838 E1000_WRITE_REG(hw, RDLEN, rdlen);
1718 E1000_WRITE_REG(hw, RDH, 0); 1839 E1000_WRITE_REG(hw, RDBAH, (rdba >> 32));
1840 E1000_WRITE_REG(hw, RDBAL, (rdba & 0x00000000ffffffffULL));
1719 E1000_WRITE_REG(hw, RDT, 0); 1841 E1000_WRITE_REG(hw, RDT, 0);
1842 E1000_WRITE_REG(hw, RDH, 0);
1720 adapter->rx_ring[0].rdh = E1000_RDH; 1843 adapter->rx_ring[0].rdh = E1000_RDH;
1721 adapter->rx_ring[0].rdt = E1000_RDT; 1844 adapter->rx_ring[0].rdt = E1000_RDT;
1722 break; 1845 break;
@@ -1741,9 +1864,6 @@ e1000_configure_rx(struct e1000_adapter *adapter)
1741 E1000_WRITE_REG(hw, RXCSUM, rxcsum); 1864 E1000_WRITE_REG(hw, RXCSUM, rxcsum);
1742 } 1865 }
1743 1866
1744 if (hw->mac_type == e1000_82573)
1745 E1000_WRITE_REG(hw, ERT, 0x0100);
1746
1747 /* Enable Receives */ 1867 /* Enable Receives */
1748 E1000_WRITE_REG(hw, RCTL, rctl); 1868 E1000_WRITE_REG(hw, RCTL, rctl);
1749} 1869}
@@ -2083,6 +2203,12 @@ e1000_set_multi(struct net_device *netdev)
2083 uint32_t rctl; 2203 uint32_t rctl;
2084 uint32_t hash_value; 2204 uint32_t hash_value;
2085 int i, rar_entries = E1000_RAR_ENTRIES; 2205 int i, rar_entries = E1000_RAR_ENTRIES;
2206 int mta_reg_count = (hw->mac_type == e1000_ich8lan) ?
2207 E1000_NUM_MTA_REGISTERS_ICH8LAN :
2208 E1000_NUM_MTA_REGISTERS;
2209
2210 if (adapter->hw.mac_type == e1000_ich8lan)
2211 rar_entries = E1000_RAR_ENTRIES_ICH8LAN;
2086 2212
2087 /* reserve RAR[14] for LAA over-write work-around */ 2213 /* reserve RAR[14] for LAA over-write work-around */
2088 if (adapter->hw.mac_type == e1000_82571) 2214 if (adapter->hw.mac_type == e1000_82571)
@@ -2121,14 +2247,18 @@ e1000_set_multi(struct net_device *netdev)
2121 mc_ptr = mc_ptr->next; 2247 mc_ptr = mc_ptr->next;
2122 } else { 2248 } else {
2123 E1000_WRITE_REG_ARRAY(hw, RA, i << 1, 0); 2249 E1000_WRITE_REG_ARRAY(hw, RA, i << 1, 0);
2250 E1000_WRITE_FLUSH(hw);
2124 E1000_WRITE_REG_ARRAY(hw, RA, (i << 1) + 1, 0); 2251 E1000_WRITE_REG_ARRAY(hw, RA, (i << 1) + 1, 0);
2252 E1000_WRITE_FLUSH(hw);
2125 } 2253 }
2126 } 2254 }
2127 2255
2128 /* clear the old settings from the multicast hash table */ 2256 /* clear the old settings from the multicast hash table */
2129 2257
2130 for (i = 0; i < E1000_NUM_MTA_REGISTERS; i++) 2258 for (i = 0; i < mta_reg_count; i++) {
2131 E1000_WRITE_REG_ARRAY(hw, MTA, i, 0); 2259 E1000_WRITE_REG_ARRAY(hw, MTA, i, 0);
2260 E1000_WRITE_FLUSH(hw);
2261 }
2132 2262
2133 /* load any remaining addresses into the hash table */ 2263 /* load any remaining addresses into the hash table */
2134 2264
@@ -2201,19 +2331,19 @@ static void
2201e1000_watchdog(unsigned long data) 2331e1000_watchdog(unsigned long data)
2202{ 2332{
2203 struct e1000_adapter *adapter = (struct e1000_adapter *) data; 2333 struct e1000_adapter *adapter = (struct e1000_adapter *) data;
2204
2205 /* Do the rest outside of interrupt context */
2206 schedule_work(&adapter->watchdog_task);
2207}
2208
2209static void
2210e1000_watchdog_task(struct e1000_adapter *adapter)
2211{
2212 struct net_device *netdev = adapter->netdev; 2334 struct net_device *netdev = adapter->netdev;
2213 struct e1000_tx_ring *txdr = adapter->tx_ring; 2335 struct e1000_tx_ring *txdr = adapter->tx_ring;
2214 uint32_t link, tctl; 2336 uint32_t link, tctl;
2215 2337 int32_t ret_val;
2216 e1000_check_for_link(&adapter->hw); 2338
2339 ret_val = e1000_check_for_link(&adapter->hw);
2340 if ((ret_val == E1000_ERR_PHY) &&
2341 (adapter->hw.phy_type == e1000_phy_igp_3) &&
2342 (E1000_READ_REG(&adapter->hw, CTRL) & E1000_PHY_CTRL_GBE_DISABLE)) {
2343 /* See e1000_kumeran_lock_loss_workaround() */
2344 DPRINTK(LINK, INFO,
2345 "Gigabit has been disabled, downgrading speed\n");
2346 }
2217 if (adapter->hw.mac_type == e1000_82573) { 2347 if (adapter->hw.mac_type == e1000_82573) {
2218 e1000_enable_tx_pkt_filtering(&adapter->hw); 2348 e1000_enable_tx_pkt_filtering(&adapter->hw);
2219 if (adapter->mng_vlan_id != adapter->hw.mng_cookie.vlan_id) 2349 if (adapter->mng_vlan_id != adapter->hw.mng_cookie.vlan_id)
@@ -2394,7 +2524,7 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
2394 uint8_t ipcss, ipcso, tucss, tucso, hdr_len; 2524 uint8_t ipcss, ipcso, tucss, tucso, hdr_len;
2395 int err; 2525 int err;
2396 2526
2397 if (skb_shinfo(skb)->gso_size) { 2527 if (skb_is_gso(skb)) {
2398 if (skb_header_cloned(skb)) { 2528 if (skb_header_cloned(skb)) {
2399 err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC); 2529 err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC);
2400 if (err) 2530 if (err)
@@ -2519,7 +2649,7 @@ e1000_tx_map(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
2519 * tso gets written back prematurely before the data is fully 2649 * tso gets written back prematurely before the data is fully
2520 * DMA'd to the controller */ 2650 * DMA'd to the controller */
2521 if (!skb->data_len && tx_ring->last_tx_tso && 2651 if (!skb->data_len && tx_ring->last_tx_tso &&
2522 !skb_shinfo(skb)->gso_size) { 2652 !skb_is_gso(skb)) {
2523 tx_ring->last_tx_tso = 0; 2653 tx_ring->last_tx_tso = 0;
2524 size -= 4; 2654 size -= 4;
2525 } 2655 }
@@ -2779,9 +2909,10 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
2779 case e1000_82571: 2909 case e1000_82571:
2780 case e1000_82572: 2910 case e1000_82572:
2781 case e1000_82573: 2911 case e1000_82573:
2912 case e1000_ich8lan:
2782 pull_size = min((unsigned int)4, skb->data_len); 2913 pull_size = min((unsigned int)4, skb->data_len);
2783 if (!__pskb_pull_tail(skb, pull_size)) { 2914 if (!__pskb_pull_tail(skb, pull_size)) {
2784 printk(KERN_ERR 2915 DPRINTK(DRV, ERR,
2785 "__pskb_pull_tail failed.\n"); 2916 "__pskb_pull_tail failed.\n");
2786 dev_kfree_skb_any(skb); 2917 dev_kfree_skb_any(skb);
2787 return NETDEV_TX_OK; 2918 return NETDEV_TX_OK;
@@ -2806,8 +2937,7 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
2806 2937
2807#ifdef NETIF_F_TSO 2938#ifdef NETIF_F_TSO
2808 /* Controller Erratum workaround */ 2939 /* Controller Erratum workaround */
2809 if (!skb->data_len && tx_ring->last_tx_tso && 2940 if (!skb->data_len && tx_ring->last_tx_tso && !skb_is_gso(skb))
2810 !skb_shinfo(skb)->gso_size)
2811 count++; 2941 count++;
2812#endif 2942#endif
2813 2943
@@ -2919,8 +3049,7 @@ e1000_reset_task(struct net_device *netdev)
2919{ 3049{
2920 struct e1000_adapter *adapter = netdev_priv(netdev); 3050 struct e1000_adapter *adapter = netdev_priv(netdev);
2921 3051
2922 e1000_down(adapter); 3052 e1000_reinit_locked(adapter);
2923 e1000_up(adapter);
2924} 3053}
2925 3054
2926/** 3055/**
@@ -2964,6 +3093,7 @@ e1000_change_mtu(struct net_device *netdev, int new_mtu)
2964 /* Adapter-specific max frame size limits. */ 3093 /* Adapter-specific max frame size limits. */
2965 switch (adapter->hw.mac_type) { 3094 switch (adapter->hw.mac_type) {
2966 case e1000_undefined ... e1000_82542_rev2_1: 3095 case e1000_undefined ... e1000_82542_rev2_1:
3096 case e1000_ich8lan:
2967 if (max_frame > MAXIMUM_ETHERNET_FRAME_SIZE) { 3097 if (max_frame > MAXIMUM_ETHERNET_FRAME_SIZE) {
2968 DPRINTK(PROBE, ERR, "Jumbo Frames not supported.\n"); 3098 DPRINTK(PROBE, ERR, "Jumbo Frames not supported.\n");
2969 return -EINVAL; 3099 return -EINVAL;
@@ -2997,7 +3127,7 @@ e1000_change_mtu(struct net_device *netdev, int new_mtu)
2997 break; 3127 break;
2998 } 3128 }
2999 3129
3000 /* NOTE: dev_alloc_skb reserves 16 bytes, and typically NET_IP_ALIGN 3130 /* NOTE: netdev_alloc_skb reserves 16 bytes, and typically NET_IP_ALIGN
3001 * means we reserve 2 more, this pushes us to allocate from the next 3131 * means we reserve 2 more, this pushes us to allocate from the next
3002 * larger slab size 3132 * larger slab size
3003 * i.e. RXBUFFER_2048 --> size-4096 slab */ 3133 * i.e. RXBUFFER_2048 --> size-4096 slab */
@@ -3018,7 +3148,6 @@ e1000_change_mtu(struct net_device *netdev, int new_mtu)
3018 adapter->rx_buffer_len = E1000_RXBUFFER_16384; 3148 adapter->rx_buffer_len = E1000_RXBUFFER_16384;
3019 3149
3020 /* adjust allocation if LPE protects us, and we aren't using SBP */ 3150 /* adjust allocation if LPE protects us, and we aren't using SBP */
3021#define MAXIMUM_ETHERNET_VLAN_SIZE 1522
3022 if (!adapter->hw.tbi_compatibility_on && 3151 if (!adapter->hw.tbi_compatibility_on &&
3023 ((max_frame == MAXIMUM_ETHERNET_FRAME_SIZE) || 3152 ((max_frame == MAXIMUM_ETHERNET_FRAME_SIZE) ||
3024 (max_frame == MAXIMUM_ETHERNET_VLAN_SIZE))) 3153 (max_frame == MAXIMUM_ETHERNET_VLAN_SIZE)))
@@ -3026,10 +3155,8 @@ e1000_change_mtu(struct net_device *netdev, int new_mtu)
3026 3155
3027 netdev->mtu = new_mtu; 3156 netdev->mtu = new_mtu;
3028 3157
3029 if (netif_running(netdev)) { 3158 if (netif_running(netdev))
3030 e1000_down(adapter); 3159 e1000_reinit_locked(adapter);
3031 e1000_up(adapter);
3032 }
3033 3160
3034 adapter->hw.max_frame_size = max_frame; 3161 adapter->hw.max_frame_size = max_frame;
3035 3162
@@ -3074,12 +3201,15 @@ e1000_update_stats(struct e1000_adapter *adapter)
3074 adapter->stats.bprc += E1000_READ_REG(hw, BPRC); 3201 adapter->stats.bprc += E1000_READ_REG(hw, BPRC);
3075 adapter->stats.mprc += E1000_READ_REG(hw, MPRC); 3202 adapter->stats.mprc += E1000_READ_REG(hw, MPRC);
3076 adapter->stats.roc += E1000_READ_REG(hw, ROC); 3203 adapter->stats.roc += E1000_READ_REG(hw, ROC);
3204
3205 if (adapter->hw.mac_type != e1000_ich8lan) {
3077 adapter->stats.prc64 += E1000_READ_REG(hw, PRC64); 3206 adapter->stats.prc64 += E1000_READ_REG(hw, PRC64);
3078 adapter->stats.prc127 += E1000_READ_REG(hw, PRC127); 3207 adapter->stats.prc127 += E1000_READ_REG(hw, PRC127);
3079 adapter->stats.prc255 += E1000_READ_REG(hw, PRC255); 3208 adapter->stats.prc255 += E1000_READ_REG(hw, PRC255);
3080 adapter->stats.prc511 += E1000_READ_REG(hw, PRC511); 3209 adapter->stats.prc511 += E1000_READ_REG(hw, PRC511);
3081 adapter->stats.prc1023 += E1000_READ_REG(hw, PRC1023); 3210 adapter->stats.prc1023 += E1000_READ_REG(hw, PRC1023);
3082 adapter->stats.prc1522 += E1000_READ_REG(hw, PRC1522); 3211 adapter->stats.prc1522 += E1000_READ_REG(hw, PRC1522);
3212 }
3083 3213
3084 adapter->stats.symerrs += E1000_READ_REG(hw, SYMERRS); 3214 adapter->stats.symerrs += E1000_READ_REG(hw, SYMERRS);
3085 adapter->stats.mpc += E1000_READ_REG(hw, MPC); 3215 adapter->stats.mpc += E1000_READ_REG(hw, MPC);
@@ -3107,12 +3237,16 @@ e1000_update_stats(struct e1000_adapter *adapter)
3107 adapter->stats.totl += E1000_READ_REG(hw, TOTL); 3237 adapter->stats.totl += E1000_READ_REG(hw, TOTL);
3108 adapter->stats.toth += E1000_READ_REG(hw, TOTH); 3238 adapter->stats.toth += E1000_READ_REG(hw, TOTH);
3109 adapter->stats.tpr += E1000_READ_REG(hw, TPR); 3239 adapter->stats.tpr += E1000_READ_REG(hw, TPR);
3240
3241 if (adapter->hw.mac_type != e1000_ich8lan) {
3110 adapter->stats.ptc64 += E1000_READ_REG(hw, PTC64); 3242 adapter->stats.ptc64 += E1000_READ_REG(hw, PTC64);
3111 adapter->stats.ptc127 += E1000_READ_REG(hw, PTC127); 3243 adapter->stats.ptc127 += E1000_READ_REG(hw, PTC127);
3112 adapter->stats.ptc255 += E1000_READ_REG(hw, PTC255); 3244 adapter->stats.ptc255 += E1000_READ_REG(hw, PTC255);
3113 adapter->stats.ptc511 += E1000_READ_REG(hw, PTC511); 3245 adapter->stats.ptc511 += E1000_READ_REG(hw, PTC511);
3114 adapter->stats.ptc1023 += E1000_READ_REG(hw, PTC1023); 3246 adapter->stats.ptc1023 += E1000_READ_REG(hw, PTC1023);
3115 adapter->stats.ptc1522 += E1000_READ_REG(hw, PTC1522); 3247 adapter->stats.ptc1522 += E1000_READ_REG(hw, PTC1522);
3248 }
3249
3116 adapter->stats.mptc += E1000_READ_REG(hw, MPTC); 3250 adapter->stats.mptc += E1000_READ_REG(hw, MPTC);
3117 adapter->stats.bptc += E1000_READ_REG(hw, BPTC); 3251 adapter->stats.bptc += E1000_READ_REG(hw, BPTC);
3118 3252
@@ -3134,6 +3268,8 @@ e1000_update_stats(struct e1000_adapter *adapter)
3134 if (hw->mac_type > e1000_82547_rev_2) { 3268 if (hw->mac_type > e1000_82547_rev_2) {
3135 adapter->stats.iac += E1000_READ_REG(hw, IAC); 3269 adapter->stats.iac += E1000_READ_REG(hw, IAC);
3136 adapter->stats.icrxoc += E1000_READ_REG(hw, ICRXOC); 3270 adapter->stats.icrxoc += E1000_READ_REG(hw, ICRXOC);
3271
3272 if (adapter->hw.mac_type != e1000_ich8lan) {
3137 adapter->stats.icrxptc += E1000_READ_REG(hw, ICRXPTC); 3273 adapter->stats.icrxptc += E1000_READ_REG(hw, ICRXPTC);
3138 adapter->stats.icrxatc += E1000_READ_REG(hw, ICRXATC); 3274 adapter->stats.icrxatc += E1000_READ_REG(hw, ICRXATC);
3139 adapter->stats.ictxptc += E1000_READ_REG(hw, ICTXPTC); 3275 adapter->stats.ictxptc += E1000_READ_REG(hw, ICTXPTC);
@@ -3141,6 +3277,7 @@ e1000_update_stats(struct e1000_adapter *adapter)
3141 adapter->stats.ictxqec += E1000_READ_REG(hw, ICTXQEC); 3277 adapter->stats.ictxqec += E1000_READ_REG(hw, ICTXQEC);
3142 adapter->stats.ictxqmtc += E1000_READ_REG(hw, ICTXQMTC); 3278 adapter->stats.ictxqmtc += E1000_READ_REG(hw, ICTXQMTC);
3143 adapter->stats.icrxdmtc += E1000_READ_REG(hw, ICRXDMTC); 3279 adapter->stats.icrxdmtc += E1000_READ_REG(hw, ICRXDMTC);
3280 }
3144 } 3281 }
3145 3282
3146 /* Fill out the OS statistics structure */ 3283 /* Fill out the OS statistics structure */
@@ -3249,8 +3386,8 @@ e1000_intr(int irq, void *data, struct pt_regs *regs)
3249 E1000_WRITE_REG(hw, IMC, ~0); 3386 E1000_WRITE_REG(hw, IMC, ~0);
3250 E1000_WRITE_FLUSH(hw); 3387 E1000_WRITE_FLUSH(hw);
3251 } 3388 }
3252 if (likely(netif_rx_schedule_prep(&adapter->polling_netdev[0]))) 3389 if (likely(netif_rx_schedule_prep(netdev)))
3253 __netif_rx_schedule(&adapter->polling_netdev[0]); 3390 __netif_rx_schedule(netdev);
3254 else 3391 else
3255 e1000_irq_enable(adapter); 3392 e1000_irq_enable(adapter);
3256#else 3393#else
@@ -3293,34 +3430,26 @@ e1000_clean(struct net_device *poll_dev, int *budget)
3293{ 3430{
3294 struct e1000_adapter *adapter; 3431 struct e1000_adapter *adapter;
3295 int work_to_do = min(*budget, poll_dev->quota); 3432 int work_to_do = min(*budget, poll_dev->quota);
3296 int tx_cleaned = 0, i = 0, work_done = 0; 3433 int tx_cleaned = 0, work_done = 0;
3297 3434
3298 /* Must NOT use netdev_priv macro here. */ 3435 /* Must NOT use netdev_priv macro here. */
3299 adapter = poll_dev->priv; 3436 adapter = poll_dev->priv;
3300 3437
3301 /* Keep link state information with original netdev */ 3438 /* Keep link state information with original netdev */
3302 if (!netif_carrier_ok(adapter->netdev)) 3439 if (!netif_carrier_ok(poll_dev))
3303 goto quit_polling; 3440 goto quit_polling;
3304 3441
3305 while (poll_dev != &adapter->polling_netdev[i]) { 3442 /* e1000_clean is called per-cpu. This lock protects
3306 i++; 3443 * tx_ring[0] from being cleaned by multiple cpus
3307 BUG_ON(i == adapter->num_rx_queues); 3444 * simultaneously. A failure obtaining the lock means
3445 * tx_ring[0] is currently being cleaned anyway. */
3446 if (spin_trylock(&adapter->tx_queue_lock)) {
3447 tx_cleaned = e1000_clean_tx_irq(adapter,
3448 &adapter->tx_ring[0]);
3449 spin_unlock(&adapter->tx_queue_lock);
3308 } 3450 }
3309 3451
3310 if (likely(adapter->num_tx_queues == 1)) { 3452 adapter->clean_rx(adapter, &adapter->rx_ring[0],
3311 /* e1000_clean is called per-cpu. This lock protects
3312 * tx_ring[0] from being cleaned by multiple cpus
3313 * simultaneously. A failure obtaining the lock means
3314 * tx_ring[0] is currently being cleaned anyway. */
3315 if (spin_trylock(&adapter->tx_queue_lock)) {
3316 tx_cleaned = e1000_clean_tx_irq(adapter,
3317 &adapter->tx_ring[0]);
3318 spin_unlock(&adapter->tx_queue_lock);
3319 }
3320 } else
3321 tx_cleaned = e1000_clean_tx_irq(adapter, &adapter->tx_ring[i]);
3322
3323 adapter->clean_rx(adapter, &adapter->rx_ring[i],
3324 &work_done, work_to_do); 3453 &work_done, work_to_do);
3325 3454
3326 *budget -= work_done; 3455 *budget -= work_done;
@@ -3328,7 +3457,7 @@ e1000_clean(struct net_device *poll_dev, int *budget)
3328 3457
3329 /* If no Tx and not enough Rx work done, exit the polling mode */ 3458 /* If no Tx and not enough Rx work done, exit the polling mode */
3330 if ((!tx_cleaned && (work_done == 0)) || 3459 if ((!tx_cleaned && (work_done == 0)) ||
3331 !netif_running(adapter->netdev)) { 3460 !netif_running(poll_dev)) {
3332quit_polling: 3461quit_polling:
3333 netif_rx_complete(poll_dev); 3462 netif_rx_complete(poll_dev);
3334 e1000_irq_enable(adapter); 3463 e1000_irq_enable(adapter);
@@ -3543,11 +3672,15 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter,
3543 3672
3544 length = le16_to_cpu(rx_desc->length); 3673 length = le16_to_cpu(rx_desc->length);
3545 3674
3675 /* adjust length to remove Ethernet CRC */
3676 length -= 4;
3677
3546 if (unlikely(!(status & E1000_RXD_STAT_EOP))) { 3678 if (unlikely(!(status & E1000_RXD_STAT_EOP))) {
3547 /* All receives must fit into a single buffer */ 3679 /* All receives must fit into a single buffer */
3548 E1000_DBG("%s: Receive packet consumed multiple" 3680 E1000_DBG("%s: Receive packet consumed multiple"
3549 " buffers\n", netdev->name); 3681 " buffers\n", netdev->name);
3550 dev_kfree_skb_irq(skb); 3682 /* recycle */
3683 buffer_info-> skb = skb;
3551 goto next_desc; 3684 goto next_desc;
3552 } 3685 }
3553 3686
@@ -3575,7 +3708,7 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter,
3575#define E1000_CB_LENGTH 256 3708#define E1000_CB_LENGTH 256
3576 if (length < E1000_CB_LENGTH) { 3709 if (length < E1000_CB_LENGTH) {
3577 struct sk_buff *new_skb = 3710 struct sk_buff *new_skb =
3578 dev_alloc_skb(length + NET_IP_ALIGN); 3711 netdev_alloc_skb(netdev, length + NET_IP_ALIGN);
3579 if (new_skb) { 3712 if (new_skb) {
3580 skb_reserve(new_skb, NET_IP_ALIGN); 3713 skb_reserve(new_skb, NET_IP_ALIGN);
3581 new_skb->dev = netdev; 3714 new_skb->dev = netdev;
@@ -3675,7 +3808,6 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
3675 buffer_info = &rx_ring->buffer_info[i]; 3808 buffer_info = &rx_ring->buffer_info[i];
3676 3809
3677 while (staterr & E1000_RXD_STAT_DD) { 3810 while (staterr & E1000_RXD_STAT_DD) {
3678 buffer_info = &rx_ring->buffer_info[i];
3679 ps_page = &rx_ring->ps_page[i]; 3811 ps_page = &rx_ring->ps_page[i];
3680 ps_page_dma = &rx_ring->ps_page_dma[i]; 3812 ps_page_dma = &rx_ring->ps_page_dma[i];
3681#ifdef CONFIG_E1000_NAPI 3813#ifdef CONFIG_E1000_NAPI
@@ -3747,8 +3879,9 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
3747 pci_dma_sync_single_for_device(pdev, 3879 pci_dma_sync_single_for_device(pdev,
3748 ps_page_dma->ps_page_dma[0], 3880 ps_page_dma->ps_page_dma[0],
3749 PAGE_SIZE, PCI_DMA_FROMDEVICE); 3881 PAGE_SIZE, PCI_DMA_FROMDEVICE);
3882 /* remove the CRC */
3883 l1 -= 4;
3750 skb_put(skb, l1); 3884 skb_put(skb, l1);
3751 length += l1;
3752 goto copydone; 3885 goto copydone;
3753 } /* if */ 3886 } /* if */
3754 } 3887 }
@@ -3767,6 +3900,10 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
3767 skb->truesize += length; 3900 skb->truesize += length;
3768 } 3901 }
3769 3902
3903 /* strip the ethernet crc, problem is we're using pages now so
3904 * this whole operation can get a little cpu intensive */
3905 pskb_trim(skb, skb->len - 4);
3906
3770copydone: 3907copydone:
3771 e1000_rx_checksum(adapter, staterr, 3908 e1000_rx_checksum(adapter, staterr,
3772 le16_to_cpu(rx_desc->wb.lower.hi_dword.csum_ip.csum), skb); 3909 le16_to_cpu(rx_desc->wb.lower.hi_dword.csum_ip.csum), skb);
@@ -3842,7 +3979,7 @@ e1000_alloc_rx_buffers(struct e1000_adapter *adapter,
3842 3979
3843 while (cleaned_count--) { 3980 while (cleaned_count--) {
3844 if (!(skb = buffer_info->skb)) 3981 if (!(skb = buffer_info->skb))
3845 skb = dev_alloc_skb(bufsz); 3982 skb = netdev_alloc_skb(netdev, bufsz);
3846 else { 3983 else {
3847 skb_trim(skb, 0); 3984 skb_trim(skb, 0);
3848 goto map_skb; 3985 goto map_skb;
@@ -3860,7 +3997,7 @@ e1000_alloc_rx_buffers(struct e1000_adapter *adapter,
3860 DPRINTK(RX_ERR, ERR, "skb align check failed: %u bytes " 3997 DPRINTK(RX_ERR, ERR, "skb align check failed: %u bytes "
3861 "at %p\n", bufsz, skb->data); 3998 "at %p\n", bufsz, skb->data);
3862 /* Try again, without freeing the previous */ 3999 /* Try again, without freeing the previous */
3863 skb = dev_alloc_skb(bufsz); 4000 skb = netdev_alloc_skb(netdev, bufsz);
3864 /* Failed allocation, critical failure */ 4001 /* Failed allocation, critical failure */
3865 if (!skb) { 4002 if (!skb) {
3866 dev_kfree_skb(oldskb); 4003 dev_kfree_skb(oldskb);
@@ -3984,7 +4121,8 @@ e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,
3984 rx_desc->read.buffer_addr[j+1] = ~0; 4121 rx_desc->read.buffer_addr[j+1] = ~0;
3985 } 4122 }
3986 4123
3987 skb = dev_alloc_skb(adapter->rx_ps_bsize0 + NET_IP_ALIGN); 4124 skb = netdev_alloc_skb(netdev,
4125 adapter->rx_ps_bsize0 + NET_IP_ALIGN);
3988 4126
3989 if (unlikely(!skb)) { 4127 if (unlikely(!skb)) {
3990 adapter->alloc_rx_buff_failed++; 4128 adapter->alloc_rx_buff_failed++;
@@ -4180,10 +4318,9 @@ e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
4180 return retval; 4318 return retval;
4181 } 4319 }
4182 } 4320 }
4183 if (netif_running(adapter->netdev)) { 4321 if (netif_running(adapter->netdev))
4184 e1000_down(adapter); 4322 e1000_reinit_locked(adapter);
4185 e1000_up(adapter); 4323 else
4186 } else
4187 e1000_reset(adapter); 4324 e1000_reset(adapter);
4188 break; 4325 break;
4189 case M88E1000_PHY_SPEC_CTRL: 4326 case M88E1000_PHY_SPEC_CTRL:
@@ -4200,10 +4337,9 @@ e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
4200 case PHY_CTRL: 4337 case PHY_CTRL:
4201 if (mii_reg & MII_CR_POWER_DOWN) 4338 if (mii_reg & MII_CR_POWER_DOWN)
4202 break; 4339 break;
4203 if (netif_running(adapter->netdev)) { 4340 if (netif_running(adapter->netdev))
4204 e1000_down(adapter); 4341 e1000_reinit_locked(adapter);
4205 e1000_up(adapter); 4342 else
4206 } else
4207 e1000_reset(adapter); 4343 e1000_reset(adapter);
4208 break; 4344 break;
4209 } 4345 }
@@ -4277,18 +4413,21 @@ e1000_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp)
4277 ctrl |= E1000_CTRL_VME; 4413 ctrl |= E1000_CTRL_VME;
4278 E1000_WRITE_REG(&adapter->hw, CTRL, ctrl); 4414 E1000_WRITE_REG(&adapter->hw, CTRL, ctrl);
4279 4415
4416 if (adapter->hw.mac_type != e1000_ich8lan) {
4280 /* enable VLAN receive filtering */ 4417 /* enable VLAN receive filtering */
4281 rctl = E1000_READ_REG(&adapter->hw, RCTL); 4418 rctl = E1000_READ_REG(&adapter->hw, RCTL);
4282 rctl |= E1000_RCTL_VFE; 4419 rctl |= E1000_RCTL_VFE;
4283 rctl &= ~E1000_RCTL_CFIEN; 4420 rctl &= ~E1000_RCTL_CFIEN;
4284 E1000_WRITE_REG(&adapter->hw, RCTL, rctl); 4421 E1000_WRITE_REG(&adapter->hw, RCTL, rctl);
4285 e1000_update_mng_vlan(adapter); 4422 e1000_update_mng_vlan(adapter);
4423 }
4286 } else { 4424 } else {
4287 /* disable VLAN tag insert/strip */ 4425 /* disable VLAN tag insert/strip */
4288 ctrl = E1000_READ_REG(&adapter->hw, CTRL); 4426 ctrl = E1000_READ_REG(&adapter->hw, CTRL);
4289 ctrl &= ~E1000_CTRL_VME; 4427 ctrl &= ~E1000_CTRL_VME;
4290 E1000_WRITE_REG(&adapter->hw, CTRL, ctrl); 4428 E1000_WRITE_REG(&adapter->hw, CTRL, ctrl);
4291 4429
4430 if (adapter->hw.mac_type != e1000_ich8lan) {
4292 /* disable VLAN filtering */ 4431 /* disable VLAN filtering */
4293 rctl = E1000_READ_REG(&adapter->hw, RCTL); 4432 rctl = E1000_READ_REG(&adapter->hw, RCTL);
4294 rctl &= ~E1000_RCTL_VFE; 4433 rctl &= ~E1000_RCTL_VFE;
@@ -4297,6 +4436,7 @@ e1000_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp)
4297 e1000_vlan_rx_kill_vid(netdev, adapter->mng_vlan_id); 4436 e1000_vlan_rx_kill_vid(netdev, adapter->mng_vlan_id);
4298 adapter->mng_vlan_id = E1000_MNG_VLAN_NONE; 4437 adapter->mng_vlan_id = E1000_MNG_VLAN_NONE;
4299 } 4438 }
4439 }
4300 } 4440 }
4301 4441
4302 e1000_irq_enable(adapter); 4442 e1000_irq_enable(adapter);
@@ -4458,12 +4598,16 @@ e1000_suspend(struct pci_dev *pdev, pm_message_t state)
4458 struct e1000_adapter *adapter = netdev_priv(netdev); 4598 struct e1000_adapter *adapter = netdev_priv(netdev);
4459 uint32_t ctrl, ctrl_ext, rctl, manc, status; 4599 uint32_t ctrl, ctrl_ext, rctl, manc, status;
4460 uint32_t wufc = adapter->wol; 4600 uint32_t wufc = adapter->wol;
4601#ifdef CONFIG_PM
4461 int retval = 0; 4602 int retval = 0;
4603#endif
4462 4604
4463 netif_device_detach(netdev); 4605 netif_device_detach(netdev);
4464 4606
4465 if (netif_running(netdev)) 4607 if (netif_running(netdev)) {
4608 WARN_ON(test_bit(__E1000_RESETTING, &adapter->flags));
4466 e1000_down(adapter); 4609 e1000_down(adapter);
4610 }
4467 4611
4468#ifdef CONFIG_PM 4612#ifdef CONFIG_PM
4469 /* Implement our own version of pci_save_state(pdev) because pci- 4613 /* Implement our own version of pci_save_state(pdev) because pci-
@@ -4521,7 +4665,9 @@ e1000_suspend(struct pci_dev *pdev, pm_message_t state)
4521 pci_enable_wake(pdev, PCI_D3cold, 0); 4665 pci_enable_wake(pdev, PCI_D3cold, 0);
4522 } 4666 }
4523 4667
4668 /* FIXME: this code is incorrect for PCI Express */
4524 if (adapter->hw.mac_type >= e1000_82540 && 4669 if (adapter->hw.mac_type >= e1000_82540 &&
4670 adapter->hw.mac_type != e1000_ich8lan &&
4525 adapter->hw.media_type == e1000_media_type_copper) { 4671 adapter->hw.media_type == e1000_media_type_copper) {
4526 manc = E1000_READ_REG(&adapter->hw, MANC); 4672 manc = E1000_READ_REG(&adapter->hw, MANC);
4527 if (manc & E1000_MANC_SMBUS_EN) { 4673 if (manc & E1000_MANC_SMBUS_EN) {
@@ -4532,6 +4678,9 @@ e1000_suspend(struct pci_dev *pdev, pm_message_t state)
4532 } 4678 }
4533 } 4679 }
4534 4680
4681 if (adapter->hw.phy_type == e1000_phy_igp_3)
4682 e1000_phy_powerdown_workaround(&adapter->hw);
4683
4535 /* Release control of h/w to f/w. If f/w is AMT enabled, this 4684 /* Release control of h/w to f/w. If f/w is AMT enabled, this
4536 * would have already happened in close and is redundant. */ 4685 * would have already happened in close and is redundant. */
4537 e1000_release_hw_control(adapter); 4686 e1000_release_hw_control(adapter);
@@ -4567,7 +4716,9 @@ e1000_resume(struct pci_dev *pdev)
4567 4716
4568 netif_device_attach(netdev); 4717 netif_device_attach(netdev);
4569 4718
4719 /* FIXME: this code is incorrect for PCI Express */
4570 if (adapter->hw.mac_type >= e1000_82540 && 4720 if (adapter->hw.mac_type >= e1000_82540 &&
4721 adapter->hw.mac_type != e1000_ich8lan &&
4571 adapter->hw.media_type == e1000_media_type_copper) { 4722 adapter->hw.media_type == e1000_media_type_copper) {
4572 manc = E1000_READ_REG(&adapter->hw, MANC); 4723 manc = E1000_READ_REG(&adapter->hw, MANC);
4573 manc &= ~(E1000_MANC_ARP_EN); 4724 manc &= ~(E1000_MANC_ARP_EN);
@@ -4601,6 +4752,7 @@ static void
4601e1000_netpoll(struct net_device *netdev) 4752e1000_netpoll(struct net_device *netdev)
4602{ 4753{
4603 struct e1000_adapter *adapter = netdev_priv(netdev); 4754 struct e1000_adapter *adapter = netdev_priv(netdev);
4755
4604 disable_irq(adapter->pdev->irq); 4756 disable_irq(adapter->pdev->irq);
4605 e1000_intr(adapter->pdev->irq, netdev, NULL); 4757 e1000_intr(adapter->pdev->irq, netdev, NULL);
4606 e1000_clean_tx_irq(adapter, adapter->tx_ring); 4758 e1000_clean_tx_irq(adapter, adapter->tx_ring);
diff --git a/drivers/net/e1000/e1000_osdep.h b/drivers/net/e1000/e1000_osdep.h
index 048d052be29d..2d3e8b06cab0 100644
--- a/drivers/net/e1000/e1000_osdep.h
+++ b/drivers/net/e1000/e1000_osdep.h
@@ -127,4 +127,17 @@ typedef enum {
127 127
128#define E1000_WRITE_FLUSH(a) E1000_READ_REG(a, STATUS) 128#define E1000_WRITE_FLUSH(a) E1000_READ_REG(a, STATUS)
129 129
130#define E1000_WRITE_ICH8_REG(a, reg, value) ( \
131 writel((value), ((a)->flash_address + reg)))
132
133#define E1000_READ_ICH8_REG(a, reg) ( \
134 readl((a)->flash_address + reg))
135
136#define E1000_WRITE_ICH8_REG16(a, reg, value) ( \
137 writew((value), ((a)->flash_address + reg)))
138
139#define E1000_READ_ICH8_REG16(a, reg) ( \
140 readw((a)->flash_address + reg))
141
142
130#endif /* _E1000_OSDEP_H_ */ 143#endif /* _E1000_OSDEP_H_ */
diff --git a/drivers/net/e1000/e1000_param.c b/drivers/net/e1000/e1000_param.c
index e55f8969a0fb..0ef413172c68 100644
--- a/drivers/net/e1000/e1000_param.c
+++ b/drivers/net/e1000/e1000_param.c
@@ -45,6 +45,16 @@
45 */ 45 */
46 46
47#define E1000_PARAM_INIT { [0 ... E1000_MAX_NIC] = OPTION_UNSET } 47#define E1000_PARAM_INIT { [0 ... E1000_MAX_NIC] = OPTION_UNSET }
48/* Module Parameters are always initialized to -1, so that the driver
49 * can tell the difference between no user specified value or the
50 * user asking for the default value.
51 * The true default values are loaded in when e1000_check_options is called.
52 *
53 * This is a GCC extension to ANSI C.
54 * See the item "Labeled Elements in Initializers" in the section
55 * "Extensions to the C Language Family" of the GCC documentation.
56 */
57
48#define E1000_PARAM(X, desc) \ 58#define E1000_PARAM(X, desc) \
49 static int __devinitdata X[E1000_MAX_NIC+1] = E1000_PARAM_INIT; \ 59 static int __devinitdata X[E1000_MAX_NIC+1] = E1000_PARAM_INIT; \
50 static int num_##X = 0; \ 60 static int num_##X = 0; \
@@ -183,6 +193,24 @@ E1000_PARAM(RxAbsIntDelay, "Receive Absolute Interrupt Delay");
183 193
184E1000_PARAM(InterruptThrottleRate, "Interrupt Throttling Rate"); 194E1000_PARAM(InterruptThrottleRate, "Interrupt Throttling Rate");
185 195
196/* Enable Smart Power Down of the PHY
197 *
198 * Valid Range: 0, 1
199 *
200 * Default Value: 0 (disabled)
201 */
202
203E1000_PARAM(SmartPowerDownEnable, "Enable PHY smart power down");
204
205/* Enable Kumeran Lock Loss workaround
206 *
207 * Valid Range: 0, 1
208 *
209 * Default Value: 1 (enabled)
210 */
211
212E1000_PARAM(KumeranLockLoss, "Enable Kumeran lock loss workaround");
213
186#define AUTONEG_ADV_DEFAULT 0x2F 214#define AUTONEG_ADV_DEFAULT 0x2F
187#define AUTONEG_ADV_MASK 0x2F 215#define AUTONEG_ADV_MASK 0x2F
188#define FLOW_CONTROL_DEFAULT FLOW_CONTROL_FULL 216#define FLOW_CONTROL_DEFAULT FLOW_CONTROL_FULL
@@ -296,6 +324,7 @@ e1000_check_options(struct e1000_adapter *adapter)
296 DPRINTK(PROBE, NOTICE, 324 DPRINTK(PROBE, NOTICE,
297 "Warning: no configuration for board #%i\n", bd); 325 "Warning: no configuration for board #%i\n", bd);
298 DPRINTK(PROBE, NOTICE, "Using defaults for all values\n"); 326 DPRINTK(PROBE, NOTICE, "Using defaults for all values\n");
327 bd = E1000_MAX_NIC;
299 } 328 }
300 329
301 { /* Transmit Descriptor Count */ 330 { /* Transmit Descriptor Count */
@@ -313,14 +342,9 @@ e1000_check_options(struct e1000_adapter *adapter)
313 opt.arg.r.max = mac_type < e1000_82544 ? 342 opt.arg.r.max = mac_type < e1000_82544 ?
314 E1000_MAX_TXD : E1000_MAX_82544_TXD; 343 E1000_MAX_TXD : E1000_MAX_82544_TXD;
315 344
316 if (num_TxDescriptors > bd) { 345 tx_ring->count = TxDescriptors[bd];
317 tx_ring->count = TxDescriptors[bd]; 346 e1000_validate_option(&tx_ring->count, &opt, adapter);
318 e1000_validate_option(&tx_ring->count, &opt, adapter); 347 E1000_ROUNDUP(tx_ring->count, REQ_TX_DESCRIPTOR_MULTIPLE);
319 E1000_ROUNDUP(tx_ring->count,
320 REQ_TX_DESCRIPTOR_MULTIPLE);
321 } else {
322 tx_ring->count = opt.def;
323 }
324 for (i = 0; i < adapter->num_tx_queues; i++) 348 for (i = 0; i < adapter->num_tx_queues; i++)
325 tx_ring[i].count = tx_ring->count; 349 tx_ring[i].count = tx_ring->count;
326 } 350 }
@@ -339,14 +363,9 @@ e1000_check_options(struct e1000_adapter *adapter)
339 opt.arg.r.max = mac_type < e1000_82544 ? E1000_MAX_RXD : 363 opt.arg.r.max = mac_type < e1000_82544 ? E1000_MAX_RXD :
340 E1000_MAX_82544_RXD; 364 E1000_MAX_82544_RXD;
341 365
342 if (num_RxDescriptors > bd) { 366 rx_ring->count = RxDescriptors[bd];
343 rx_ring->count = RxDescriptors[bd]; 367 e1000_validate_option(&rx_ring->count, &opt, adapter);
344 e1000_validate_option(&rx_ring->count, &opt, adapter); 368 E1000_ROUNDUP(rx_ring->count, REQ_RX_DESCRIPTOR_MULTIPLE);
345 E1000_ROUNDUP(rx_ring->count,
346 REQ_RX_DESCRIPTOR_MULTIPLE);
347 } else {
348 rx_ring->count = opt.def;
349 }
350 for (i = 0; i < adapter->num_rx_queues; i++) 369 for (i = 0; i < adapter->num_rx_queues; i++)
351 rx_ring[i].count = rx_ring->count; 370 rx_ring[i].count = rx_ring->count;
352 } 371 }
@@ -358,13 +377,9 @@ e1000_check_options(struct e1000_adapter *adapter)
358 .def = OPTION_ENABLED 377 .def = OPTION_ENABLED
359 }; 378 };
360 379
361 if (num_XsumRX > bd) { 380 int rx_csum = XsumRX[bd];
362 int rx_csum = XsumRX[bd]; 381 e1000_validate_option(&rx_csum, &opt, adapter);
363 e1000_validate_option(&rx_csum, &opt, adapter); 382 adapter->rx_csum = rx_csum;
364 adapter->rx_csum = rx_csum;
365 } else {
366 adapter->rx_csum = opt.def;
367 }
368 } 383 }
369 { /* Flow Control */ 384 { /* Flow Control */
370 385
@@ -384,13 +399,9 @@ e1000_check_options(struct e1000_adapter *adapter)
384 .p = fc_list }} 399 .p = fc_list }}
385 }; 400 };
386 401
387 if (num_FlowControl > bd) { 402 int fc = FlowControl[bd];
388 int fc = FlowControl[bd]; 403 e1000_validate_option(&fc, &opt, adapter);
389 e1000_validate_option(&fc, &opt, adapter); 404 adapter->hw.fc = adapter->hw.original_fc = fc;
390 adapter->hw.fc = adapter->hw.original_fc = fc;
391 } else {
392 adapter->hw.fc = adapter->hw.original_fc = opt.def;
393 }
394 } 405 }
395 { /* Transmit Interrupt Delay */ 406 { /* Transmit Interrupt Delay */
396 struct e1000_option opt = { 407 struct e1000_option opt = {
@@ -402,13 +413,8 @@ e1000_check_options(struct e1000_adapter *adapter)
402 .max = MAX_TXDELAY }} 413 .max = MAX_TXDELAY }}
403 }; 414 };
404 415
405 if (num_TxIntDelay > bd) { 416 adapter->tx_int_delay = TxIntDelay[bd];
406 adapter->tx_int_delay = TxIntDelay[bd]; 417 e1000_validate_option(&adapter->tx_int_delay, &opt, adapter);
407 e1000_validate_option(&adapter->tx_int_delay, &opt,
408 adapter);
409 } else {
410 adapter->tx_int_delay = opt.def;
411 }
412 } 418 }
413 { /* Transmit Absolute Interrupt Delay */ 419 { /* Transmit Absolute Interrupt Delay */
414 struct e1000_option opt = { 420 struct e1000_option opt = {
@@ -420,13 +426,9 @@ e1000_check_options(struct e1000_adapter *adapter)
420 .max = MAX_TXABSDELAY }} 426 .max = MAX_TXABSDELAY }}
421 }; 427 };
422 428
423 if (num_TxAbsIntDelay > bd) { 429 adapter->tx_abs_int_delay = TxAbsIntDelay[bd];
424 adapter->tx_abs_int_delay = TxAbsIntDelay[bd]; 430 e1000_validate_option(&adapter->tx_abs_int_delay, &opt,
425 e1000_validate_option(&adapter->tx_abs_int_delay, &opt, 431 adapter);
426 adapter);
427 } else {
428 adapter->tx_abs_int_delay = opt.def;
429 }
430 } 432 }
431 { /* Receive Interrupt Delay */ 433 { /* Receive Interrupt Delay */
432 struct e1000_option opt = { 434 struct e1000_option opt = {
@@ -438,13 +440,8 @@ e1000_check_options(struct e1000_adapter *adapter)
438 .max = MAX_RXDELAY }} 440 .max = MAX_RXDELAY }}
439 }; 441 };
440 442
441 if (num_RxIntDelay > bd) { 443 adapter->rx_int_delay = RxIntDelay[bd];
442 adapter->rx_int_delay = RxIntDelay[bd]; 444 e1000_validate_option(&adapter->rx_int_delay, &opt, adapter);
443 e1000_validate_option(&adapter->rx_int_delay, &opt,
444 adapter);
445 } else {
446 adapter->rx_int_delay = opt.def;
447 }
448 } 445 }
449 { /* Receive Absolute Interrupt Delay */ 446 { /* Receive Absolute Interrupt Delay */
450 struct e1000_option opt = { 447 struct e1000_option opt = {
@@ -456,13 +453,9 @@ e1000_check_options(struct e1000_adapter *adapter)
456 .max = MAX_RXABSDELAY }} 453 .max = MAX_RXABSDELAY }}
457 }; 454 };
458 455
459 if (num_RxAbsIntDelay > bd) { 456 adapter->rx_abs_int_delay = RxAbsIntDelay[bd];
460 adapter->rx_abs_int_delay = RxAbsIntDelay[bd]; 457 e1000_validate_option(&adapter->rx_abs_int_delay, &opt,
461 e1000_validate_option(&adapter->rx_abs_int_delay, &opt, 458 adapter);
462 adapter);
463 } else {
464 adapter->rx_abs_int_delay = opt.def;
465 }
466 } 459 }
467 { /* Interrupt Throttling Rate */ 460 { /* Interrupt Throttling Rate */
468 struct e1000_option opt = { 461 struct e1000_option opt = {
@@ -474,26 +467,44 @@ e1000_check_options(struct e1000_adapter *adapter)
474 .max = MAX_ITR }} 467 .max = MAX_ITR }}
475 }; 468 };
476 469
477 if (num_InterruptThrottleRate > bd) { 470 adapter->itr = InterruptThrottleRate[bd];
478 adapter->itr = InterruptThrottleRate[bd]; 471 switch (adapter->itr) {
479 switch (adapter->itr) { 472 case 0:
480 case 0: 473 DPRINTK(PROBE, INFO, "%s turned off\n", opt.name);
481 DPRINTK(PROBE, INFO, "%s turned off\n", 474 break;
482 opt.name); 475 case 1:
483 break; 476 DPRINTK(PROBE, INFO, "%s set to dynamic mode\n",
484 case 1: 477 opt.name);
485 DPRINTK(PROBE, INFO, "%s set to dynamic mode\n", 478 break;
486 opt.name); 479 default:
487 break; 480 e1000_validate_option(&adapter->itr, &opt, adapter);
488 default: 481 break;
489 e1000_validate_option(&adapter->itr, &opt,
490 adapter);
491 break;
492 }
493 } else {
494 adapter->itr = opt.def;
495 } 482 }
496 } 483 }
484 { /* Smart Power Down */
485 struct e1000_option opt = {
486 .type = enable_option,
487 .name = "PHY Smart Power Down",
488 .err = "defaulting to Disabled",
489 .def = OPTION_DISABLED
490 };
491
492 int spd = SmartPowerDownEnable[bd];
493 e1000_validate_option(&spd, &opt, adapter);
494 adapter->smart_power_down = spd;
495 }
496 { /* Kumeran Lock Loss Workaround */
497 struct e1000_option opt = {
498 .type = enable_option,
499 .name = "Kumeran Lock Loss Workaround",
500 .err = "defaulting to Enabled",
501 .def = OPTION_ENABLED
502 };
503
504 int kmrn_lock_loss = KumeranLockLoss[bd];
505 e1000_validate_option(&kmrn_lock_loss, &opt, adapter);
506 adapter->hw.kmrn_lock_loss_workaround_disabled = !kmrn_lock_loss;
507 }
497 508
498 switch (adapter->hw.media_type) { 509 switch (adapter->hw.media_type) {
499 case e1000_media_type_fiber: 510 case e1000_media_type_fiber:
@@ -519,17 +530,18 @@ static void __devinit
519e1000_check_fiber_options(struct e1000_adapter *adapter) 530e1000_check_fiber_options(struct e1000_adapter *adapter)
520{ 531{
521 int bd = adapter->bd_number; 532 int bd = adapter->bd_number;
522 if (num_Speed > bd) { 533 bd = bd > E1000_MAX_NIC ? E1000_MAX_NIC : bd;
534 if ((Speed[bd] != OPTION_UNSET)) {
523 DPRINTK(PROBE, INFO, "Speed not valid for fiber adapters, " 535 DPRINTK(PROBE, INFO, "Speed not valid for fiber adapters, "
524 "parameter ignored\n"); 536 "parameter ignored\n");
525 } 537 }
526 538
527 if (num_Duplex > bd) { 539 if ((Duplex[bd] != OPTION_UNSET)) {
528 DPRINTK(PROBE, INFO, "Duplex not valid for fiber adapters, " 540 DPRINTK(PROBE, INFO, "Duplex not valid for fiber adapters, "
529 "parameter ignored\n"); 541 "parameter ignored\n");
530 } 542 }
531 543
532 if ((num_AutoNeg > bd) && (AutoNeg[bd] != 0x20)) { 544 if ((AutoNeg[bd] != OPTION_UNSET) && (AutoNeg[bd] != 0x20)) {
533 DPRINTK(PROBE, INFO, "AutoNeg other than 1000/Full is " 545 DPRINTK(PROBE, INFO, "AutoNeg other than 1000/Full is "
534 "not valid for fiber adapters, " 546 "not valid for fiber adapters, "
535 "parameter ignored\n"); 547 "parameter ignored\n");
@@ -548,6 +560,7 @@ e1000_check_copper_options(struct e1000_adapter *adapter)
548{ 560{
549 int speed, dplx, an; 561 int speed, dplx, an;
550 int bd = adapter->bd_number; 562 int bd = adapter->bd_number;
563 bd = bd > E1000_MAX_NIC ? E1000_MAX_NIC : bd;
551 564
552 { /* Speed */ 565 { /* Speed */
553 struct e1000_opt_list speed_list[] = {{ 0, "" }, 566 struct e1000_opt_list speed_list[] = {{ 0, "" },
@@ -564,12 +577,8 @@ e1000_check_copper_options(struct e1000_adapter *adapter)
564 .p = speed_list }} 577 .p = speed_list }}
565 }; 578 };
566 579
567 if (num_Speed > bd) { 580 speed = Speed[bd];
568 speed = Speed[bd]; 581 e1000_validate_option(&speed, &opt, adapter);
569 e1000_validate_option(&speed, &opt, adapter);
570 } else {
571 speed = opt.def;
572 }
573 } 582 }
574 { /* Duplex */ 583 { /* Duplex */
575 struct e1000_opt_list dplx_list[] = {{ 0, "" }, 584 struct e1000_opt_list dplx_list[] = {{ 0, "" },
@@ -591,15 +600,11 @@ e1000_check_copper_options(struct e1000_adapter *adapter)
591 "Speed/Duplex/AutoNeg parameter ignored.\n"); 600 "Speed/Duplex/AutoNeg parameter ignored.\n");
592 return; 601 return;
593 } 602 }
594 if (num_Duplex > bd) { 603 dplx = Duplex[bd];
595 dplx = Duplex[bd]; 604 e1000_validate_option(&dplx, &opt, adapter);
596 e1000_validate_option(&dplx, &opt, adapter);
597 } else {
598 dplx = opt.def;
599 }
600 } 605 }
601 606
602 if ((num_AutoNeg > bd) && (speed != 0 || dplx != 0)) { 607 if (AutoNeg[bd] != OPTION_UNSET && (speed != 0 || dplx != 0)) {
603 DPRINTK(PROBE, INFO, 608 DPRINTK(PROBE, INFO,
604 "AutoNeg specified along with Speed or Duplex, " 609 "AutoNeg specified along with Speed or Duplex, "
605 "parameter ignored\n"); 610 "parameter ignored\n");
@@ -648,19 +653,15 @@ e1000_check_copper_options(struct e1000_adapter *adapter)
648 .p = an_list }} 653 .p = an_list }}
649 }; 654 };
650 655
651 if (num_AutoNeg > bd) { 656 an = AutoNeg[bd];
652 an = AutoNeg[bd]; 657 e1000_validate_option(&an, &opt, adapter);
653 e1000_validate_option(&an, &opt, adapter);
654 } else {
655 an = opt.def;
656 }
657 adapter->hw.autoneg_advertised = an; 658 adapter->hw.autoneg_advertised = an;
658 } 659 }
659 660
660 switch (speed + dplx) { 661 switch (speed + dplx) {
661 case 0: 662 case 0:
662 adapter->hw.autoneg = adapter->fc_autoneg = 1; 663 adapter->hw.autoneg = adapter->fc_autoneg = 1;
663 if ((num_Speed > bd) && (speed != 0 || dplx != 0)) 664 if (Speed[bd] != OPTION_UNSET || Duplex[bd] != OPTION_UNSET)
664 DPRINTK(PROBE, INFO, 665 DPRINTK(PROBE, INFO,
665 "Speed and duplex autonegotiation enabled\n"); 666 "Speed and duplex autonegotiation enabled\n");
666 break; 667 break;
diff --git a/drivers/net/eepro100.c b/drivers/net/eepro100.c
index 2ad327542927..e445988c92ee 100644
--- a/drivers/net/eepro100.c
+++ b/drivers/net/eepro100.c
@@ -555,12 +555,12 @@ static int __devinit eepro100_init_one (struct pci_dev *pdev,
555 555
556 if (!request_region(pci_resource_start(pdev, 1), 556 if (!request_region(pci_resource_start(pdev, 1),
557 pci_resource_len(pdev, 1), "eepro100")) { 557 pci_resource_len(pdev, 1), "eepro100")) {
558 printk (KERN_ERR "eepro100: cannot reserve I/O ports\n"); 558 dev_err(&pdev->dev, "eepro100: cannot reserve I/O ports\n");
559 goto err_out_none; 559 goto err_out_none;
560 } 560 }
561 if (!request_mem_region(pci_resource_start(pdev, 0), 561 if (!request_mem_region(pci_resource_start(pdev, 0),
562 pci_resource_len(pdev, 0), "eepro100")) { 562 pci_resource_len(pdev, 0), "eepro100")) {
563 printk (KERN_ERR "eepro100: cannot reserve MMIO region\n"); 563 dev_err(&pdev->dev, "eepro100: cannot reserve MMIO region\n");
564 goto err_out_free_pio_region; 564 goto err_out_free_pio_region;
565 } 565 }
566 566
@@ -573,7 +573,7 @@ static int __devinit eepro100_init_one (struct pci_dev *pdev,
573 573
574 ioaddr = pci_iomap(pdev, pci_bar, 0); 574 ioaddr = pci_iomap(pdev, pci_bar, 0);
575 if (!ioaddr) { 575 if (!ioaddr) {
576 printk (KERN_ERR "eepro100: cannot remap IO\n"); 576 dev_err(&pdev->dev, "eepro100: cannot remap IO\n");
577 goto err_out_free_mmio_region; 577 goto err_out_free_mmio_region;
578 } 578 }
579 579
diff --git a/drivers/net/epic100.c b/drivers/net/epic100.c
index 9f3e09a3d88c..a67650ccf084 100644
--- a/drivers/net/epic100.c
+++ b/drivers/net/epic100.c
@@ -19,62 +19,15 @@
19 19
20 Information and updates available at 20 Information and updates available at
21 http://www.scyld.com/network/epic100.html 21 http://www.scyld.com/network/epic100.html
22 [this link no longer provides anything useful -jgarzik]
22 23
23 --------------------------------------------------------------------- 24 ---------------------------------------------------------------------
24 25
25 Linux kernel-specific changes:
26
27 LK1.1.2 (jgarzik):
28 * Merge becker version 1.09 (4/08/2000)
29
30 LK1.1.3:
31 * Major bugfix to 1.09 driver (Francis Romieu)
32
33 LK1.1.4 (jgarzik):
34 * Merge becker test version 1.09 (5/29/2000)
35
36 LK1.1.5:
37 * Fix locking (jgarzik)
38 * Limit 83c175 probe to ethernet-class PCI devices (rgooch)
39
40 LK1.1.6:
41 * Merge becker version 1.11
42 * Move pci_enable_device before any PCI BAR len checks
43
44 LK1.1.7:
45 * { fill me in }
46
47 LK1.1.8:
48 * ethtool driver info support (jgarzik)
49
50 LK1.1.9:
51 * ethtool media get/set support (jgarzik)
52
53 LK1.1.10:
54 * revert MII transceiver init change (jgarzik)
55
56 LK1.1.11:
57 * implement ETHTOOL_[GS]SET, _NWAY_RST, _[GS]MSGLVL, _GLINK (jgarzik)
58 * replace some MII-related magic numbers with constants
59
60 LK1.1.12:
61 * fix power-up sequence
62
63 LK1.1.13:
64 * revert version 1.1.12, power-up sequence "fix"
65
66 LK1.1.14 (Kryzsztof Halasa):
67 * fix spurious bad initializations
68 * pound phy a la SMSC's app note on the subject
69
70 AC1.1.14ac
71 * fix power up/down for ethtool that broke in 1.11
72
73*/ 26*/
74 27
75#define DRV_NAME "epic100" 28#define DRV_NAME "epic100"
76#define DRV_VERSION "1.11+LK1.1.14+AC1.1.14" 29#define DRV_VERSION "2.0"
77#define DRV_RELDATE "June 2, 2004" 30#define DRV_RELDATE "June 27, 2006"
78 31
79/* The user-configurable values. 32/* The user-configurable values.
80 These may be modified when a driver module is loaded.*/ 33 These may be modified when a driver module is loaded.*/
@@ -204,19 +157,15 @@ typedef enum {
204 157
205struct epic_chip_info { 158struct epic_chip_info {
206 const char *name; 159 const char *name;
207 int io_size; /* Needed for I/O region check or ioremap(). */
208 int drv_flags; /* Driver use, intended as capability flags. */ 160 int drv_flags; /* Driver use, intended as capability flags. */
209}; 161};
210 162
211 163
212/* indexed by chip_t */ 164/* indexed by chip_t */
213static const struct epic_chip_info pci_id_tbl[] = { 165static const struct epic_chip_info pci_id_tbl[] = {
214 { "SMSC EPIC/100 83c170", 166 { "SMSC EPIC/100 83c170", TYPE2_INTR | NO_MII | MII_PWRDWN },
215 EPIC_TOTAL_SIZE, TYPE2_INTR | NO_MII | MII_PWRDWN }, 167 { "SMSC EPIC/100 83c170", TYPE2_INTR },
216 { "SMSC EPIC/100 83c170", 168 { "SMSC EPIC/C 83c175", TYPE2_INTR | MII_PWRDWN },
217 EPIC_TOTAL_SIZE, TYPE2_INTR },
218 { "SMSC EPIC/C 83c175",
219 EPIC_TOTAL_SIZE, TYPE2_INTR | MII_PWRDWN },
220}; 169};
221 170
222 171
@@ -385,8 +334,8 @@ static int __devinit epic_init_one (struct pci_dev *pdev,
385 goto out; 334 goto out;
386 irq = pdev->irq; 335 irq = pdev->irq;
387 336
388 if (pci_resource_len(pdev, 0) < pci_id_tbl[chip_idx].io_size) { 337 if (pci_resource_len(pdev, 0) < EPIC_TOTAL_SIZE) {
389 printk (KERN_ERR "card %d: no PCI region space\n", card_idx); 338 dev_err(&pdev->dev, "no PCI region space\n");
390 ret = -ENODEV; 339 ret = -ENODEV;
391 goto err_out_disable; 340 goto err_out_disable;
392 } 341 }
@@ -401,7 +350,7 @@ static int __devinit epic_init_one (struct pci_dev *pdev,
401 350
402 dev = alloc_etherdev(sizeof (*ep)); 351 dev = alloc_etherdev(sizeof (*ep));
403 if (!dev) { 352 if (!dev) {
404 printk (KERN_ERR "card %d: no memory for eth device\n", card_idx); 353 dev_err(&pdev->dev, "no memory for eth device\n");
405 goto err_out_free_res; 354 goto err_out_free_res;
406 } 355 }
407 SET_MODULE_OWNER(dev); 356 SET_MODULE_OWNER(dev);
@@ -413,7 +362,7 @@ static int __devinit epic_init_one (struct pci_dev *pdev,
413 ioaddr = pci_resource_start (pdev, 1); 362 ioaddr = pci_resource_start (pdev, 1);
414 ioaddr = (long) ioremap (ioaddr, pci_resource_len (pdev, 1)); 363 ioaddr = (long) ioremap (ioaddr, pci_resource_len (pdev, 1));
415 if (!ioaddr) { 364 if (!ioaddr) {
416 printk (KERN_ERR DRV_NAME " %d: ioremap failed\n", card_idx); 365 dev_err(&pdev->dev, "ioremap failed\n");
417 goto err_out_free_netdev; 366 goto err_out_free_netdev;
418 } 367 }
419#endif 368#endif
@@ -473,8 +422,7 @@ static int __devinit epic_init_one (struct pci_dev *pdev,
473 ((u16 *)dev->dev_addr)[i] = le16_to_cpu(inw(ioaddr + LAN0 + i*4)); 422 ((u16 *)dev->dev_addr)[i] = le16_to_cpu(inw(ioaddr + LAN0 + i*4));
474 423
475 if (debug > 2) { 424 if (debug > 2) {
476 printk(KERN_DEBUG DRV_NAME "(%s): EEPROM contents\n", 425 dev_printk(KERN_DEBUG, &pdev->dev, "EEPROM contents:\n");
477 pci_name(pdev));
478 for (i = 0; i < 64; i++) 426 for (i = 0; i < 64; i++)
479 printk(" %4.4x%s", read_eeprom(ioaddr, i), 427 printk(" %4.4x%s", read_eeprom(ioaddr, i),
480 i % 16 == 15 ? "\n" : ""); 428 i % 16 == 15 ? "\n" : "");
@@ -496,21 +444,23 @@ static int __devinit epic_init_one (struct pci_dev *pdev,
496 int mii_status = mdio_read(dev, phy, MII_BMSR); 444 int mii_status = mdio_read(dev, phy, MII_BMSR);
497 if (mii_status != 0xffff && mii_status != 0x0000) { 445 if (mii_status != 0xffff && mii_status != 0x0000) {
498 ep->phys[phy_idx++] = phy; 446 ep->phys[phy_idx++] = phy;
499 printk(KERN_INFO DRV_NAME "(%s): MII transceiver #%d control " 447 dev_info(&pdev->dev,
500 "%4.4x status %4.4x.\n", 448 "MII transceiver #%d control "
501 pci_name(pdev), phy, mdio_read(dev, phy, 0), mii_status); 449 "%4.4x status %4.4x.\n",
450 phy, mdio_read(dev, phy, 0), mii_status);
502 } 451 }
503 } 452 }
504 ep->mii_phy_cnt = phy_idx; 453 ep->mii_phy_cnt = phy_idx;
505 if (phy_idx != 0) { 454 if (phy_idx != 0) {
506 phy = ep->phys[0]; 455 phy = ep->phys[0];
507 ep->mii.advertising = mdio_read(dev, phy, MII_ADVERTISE); 456 ep->mii.advertising = mdio_read(dev, phy, MII_ADVERTISE);
508 printk(KERN_INFO DRV_NAME "(%s): Autonegotiation advertising %4.4x link " 457 dev_info(&pdev->dev,
458 "Autonegotiation advertising %4.4x link "
509 "partner %4.4x.\n", 459 "partner %4.4x.\n",
510 pci_name(pdev), ep->mii.advertising, mdio_read(dev, phy, 5)); 460 ep->mii.advertising, mdio_read(dev, phy, 5));
511 } else if ( ! (ep->chip_flags & NO_MII)) { 461 } else if ( ! (ep->chip_flags & NO_MII)) {
512 printk(KERN_WARNING DRV_NAME "(%s): ***WARNING***: No MII transceiver found!\n", 462 dev_warn(&pdev->dev,
513 pci_name(pdev)); 463 "***WARNING***: No MII transceiver found!\n");
514 /* Use the known PHY address of the EPII. */ 464 /* Use the known PHY address of the EPII. */
515 ep->phys[0] = 3; 465 ep->phys[0] = 3;
516 } 466 }
@@ -525,8 +475,7 @@ static int __devinit epic_init_one (struct pci_dev *pdev,
525 /* The lower four bits are the media type. */ 475 /* The lower four bits are the media type. */
526 if (duplex) { 476 if (duplex) {
527 ep->mii.force_media = ep->mii.full_duplex = 1; 477 ep->mii.force_media = ep->mii.full_duplex = 1;
528 printk(KERN_INFO DRV_NAME "(%s): Forced full duplex operation requested.\n", 478 dev_info(&pdev->dev, "Forced full duplex requested.\n");
529 pci_name(pdev));
530 } 479 }
531 dev->if_port = ep->default_port = option; 480 dev->if_port = ep->default_port = option;
532 481
diff --git a/drivers/net/fealnx.c b/drivers/net/fealnx.c
index c701951dcd6f..97d34fee8c1f 100644
--- a/drivers/net/fealnx.c
+++ b/drivers/net/fealnx.c
@@ -124,7 +124,9 @@ MODULE_PARM_DESC(multicast_filter_limit, "fealnx maximum number of filtered mult
124MODULE_PARM_DESC(options, "fealnx: Bits 0-3: media type, bit 17: full duplex"); 124MODULE_PARM_DESC(options, "fealnx: Bits 0-3: media type, bit 17: full duplex");
125MODULE_PARM_DESC(full_duplex, "fealnx full duplex setting(s) (1)"); 125MODULE_PARM_DESC(full_duplex, "fealnx full duplex setting(s) (1)");
126 126
127#define MIN_REGION_SIZE 136 127enum {
128 MIN_REGION_SIZE = 136,
129};
128 130
129/* A chip capabilities table, matching the entries in pci_tbl[] above. */ 131/* A chip capabilities table, matching the entries in pci_tbl[] above. */
130enum chip_capability_flags { 132enum chip_capability_flags {
@@ -146,14 +148,13 @@ enum phy_type_flags {
146 148
147struct chip_info { 149struct chip_info {
148 char *chip_name; 150 char *chip_name;
149 int io_size;
150 int flags; 151 int flags;
151}; 152};
152 153
153static const struct chip_info skel_netdrv_tbl[] = { 154static const struct chip_info skel_netdrv_tbl[] __devinitdata = {
154 {"100/10M Ethernet PCI Adapter", 136, HAS_MII_XCVR}, 155 { "100/10M Ethernet PCI Adapter", HAS_MII_XCVR },
155 {"100/10M Ethernet PCI Adapter", 136, HAS_CHIP_XCVR}, 156 { "100/10M Ethernet PCI Adapter", HAS_CHIP_XCVR },
156 {"1000/100/10M Ethernet PCI Adapter", 136, HAS_MII_XCVR}, 157 { "1000/100/10M Ethernet PCI Adapter", HAS_MII_XCVR },
157}; 158};
158 159
159/* Offsets to the Command and Status Registers. */ 160/* Offsets to the Command and Status Registers. */
@@ -504,13 +505,14 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev,
504 505
505 len = pci_resource_len(pdev, bar); 506 len = pci_resource_len(pdev, bar);
506 if (len < MIN_REGION_SIZE) { 507 if (len < MIN_REGION_SIZE) {
507 printk(KERN_ERR "%s: region size %ld too small, aborting\n", 508 dev_err(&pdev->dev,
508 boardname, len); 509 "region size %ld too small, aborting\n", len);
509 return -ENODEV; 510 return -ENODEV;
510 } 511 }
511 512
512 i = pci_request_regions(pdev, boardname); 513 i = pci_request_regions(pdev, boardname);
513 if (i) return i; 514 if (i)
515 return i;
514 516
515 irq = pdev->irq; 517 irq = pdev->irq;
516 518
@@ -576,9 +578,9 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev,
576 578
577 if (mii_status != 0xffff && mii_status != 0x0000) { 579 if (mii_status != 0xffff && mii_status != 0x0000) {
578 np->phys[phy_idx++] = phy; 580 np->phys[phy_idx++] = phy;
579 printk(KERN_INFO 581 dev_info(&pdev->dev,
580 "%s: MII PHY found at address %d, status " 582 "MII PHY found at address %d, status "
581 "0x%4.4x.\n", dev->name, phy, mii_status); 583 "0x%4.4x.\n", phy, mii_status);
582 /* get phy type */ 584 /* get phy type */
583 { 585 {
584 unsigned int data; 586 unsigned int data;
@@ -601,10 +603,10 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev,
601 } 603 }
602 604
603 np->mii_cnt = phy_idx; 605 np->mii_cnt = phy_idx;
604 if (phy_idx == 0) { 606 if (phy_idx == 0)
605 printk(KERN_WARNING "%s: MII PHY not found -- this device may " 607 dev_warn(&pdev->dev,
606 "not operate correctly.\n", dev->name); 608 "MII PHY not found -- this device may "
607 } 609 "not operate correctly.\n");
608 } else { 610 } else {
609 np->phys[0] = 32; 611 np->phys[0] = 32;
610/* 89/6/23 add, (begin) */ 612/* 89/6/23 add, (begin) */
@@ -630,7 +632,7 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev,
630 np->mii.full_duplex = full_duplex[card_idx]; 632 np->mii.full_duplex = full_duplex[card_idx];
631 633
632 if (np->mii.full_duplex) { 634 if (np->mii.full_duplex) {
633 printk(KERN_INFO "%s: Media type forced to Full Duplex.\n", dev->name); 635 dev_info(&pdev->dev, "Media type forced to Full Duplex.\n");
634/* 89/6/13 add, (begin) */ 636/* 89/6/13 add, (begin) */
635// if (np->PHYType==MarvellPHY) 637// if (np->PHYType==MarvellPHY)
636 if ((np->PHYType == MarvellPHY) || (np->PHYType == LevelOnePHY)) { 638 if ((np->PHYType == MarvellPHY) || (np->PHYType == LevelOnePHY)) {
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 037d870712ff..11b8f1b43dd5 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -240,10 +240,12 @@ enum {
240#define NVREG_RNDSEED_FORCE2 0x2d00 240#define NVREG_RNDSEED_FORCE2 0x2d00
241#define NVREG_RNDSEED_FORCE3 0x7400 241#define NVREG_RNDSEED_FORCE3 0x7400
242 242
243 NvRegUnknownSetupReg1 = 0xA0, 243 NvRegTxDeferral = 0xA0,
244#define NVREG_UNKSETUP1_VAL 0x16070f 244#define NVREG_TX_DEFERRAL_DEFAULT 0x15050f
245 NvRegUnknownSetupReg2 = 0xA4, 245#define NVREG_TX_DEFERRAL_RGMII_10_100 0x16070f
246#define NVREG_UNKSETUP2_VAL 0x16 246#define NVREG_TX_DEFERRAL_RGMII_1000 0x14050f
247 NvRegRxDeferral = 0xA4,
248#define NVREG_RX_DEFERRAL_DEFAULT 0x16
247 NvRegMacAddrA = 0xA8, 249 NvRegMacAddrA = 0xA8,
248 NvRegMacAddrB = 0xAC, 250 NvRegMacAddrB = 0xAC,
249 NvRegMulticastAddrA = 0xB0, 251 NvRegMulticastAddrA = 0xB0,
@@ -269,8 +271,10 @@ enum {
269#define NVREG_LINKSPEED_MASK (0xFFF) 271#define NVREG_LINKSPEED_MASK (0xFFF)
270 NvRegUnknownSetupReg5 = 0x130, 272 NvRegUnknownSetupReg5 = 0x130,
271#define NVREG_UNKSETUP5_BIT31 (1<<31) 273#define NVREG_UNKSETUP5_BIT31 (1<<31)
272 NvRegUnknownSetupReg3 = 0x13c, 274 NvRegTxWatermark = 0x13c,
273#define NVREG_UNKSETUP3_VAL1 0x200010 275#define NVREG_TX_WM_DESC1_DEFAULT 0x0200010
276#define NVREG_TX_WM_DESC2_3_DEFAULT 0x1e08000
277#define NVREG_TX_WM_DESC2_3_1000 0xfe08000
274 NvRegTxRxControl = 0x144, 278 NvRegTxRxControl = 0x144,
275#define NVREG_TXRXCTL_KICK 0x0001 279#define NVREG_TXRXCTL_KICK 0x0001
276#define NVREG_TXRXCTL_BIT1 0x0002 280#define NVREG_TXRXCTL_BIT1 0x0002
@@ -658,7 +662,7 @@ static const struct register_test nv_registers_test[] = {
658 { NvRegMisc1, 0x03c }, 662 { NvRegMisc1, 0x03c },
659 { NvRegOffloadConfig, 0x03ff }, 663 { NvRegOffloadConfig, 0x03ff },
660 { NvRegMulticastAddrA, 0xffffffff }, 664 { NvRegMulticastAddrA, 0xffffffff },
661 { NvRegUnknownSetupReg3, 0x0ff }, 665 { NvRegTxWatermark, 0x0ff },
662 { NvRegWakeUpFlags, 0x07777 }, 666 { NvRegWakeUpFlags, 0x07777 },
663 { 0,0 } 667 { 0,0 }
664}; 668};
@@ -1495,7 +1499,7 @@ static int nv_start_xmit(struct sk_buff *skb, struct net_device *dev)
1495 np->tx_skbuff[nr] = skb; 1499 np->tx_skbuff[nr] = skb;
1496 1500
1497#ifdef NETIF_F_TSO 1501#ifdef NETIF_F_TSO
1498 if (skb_shinfo(skb)->gso_size) 1502 if (skb_is_gso(skb))
1499 tx_flags_extra = NV_TX2_TSO | (skb_shinfo(skb)->gso_size << NV_TX2_TSO_SHIFT); 1503 tx_flags_extra = NV_TX2_TSO | (skb_shinfo(skb)->gso_size << NV_TX2_TSO_SHIFT);
1500 else 1504 else
1501#endif 1505#endif
@@ -2127,7 +2131,7 @@ static int nv_update_linkspeed(struct net_device *dev)
2127 int newdup = np->duplex; 2131 int newdup = np->duplex;
2128 int mii_status; 2132 int mii_status;
2129 int retval = 0; 2133 int retval = 0;
2130 u32 control_1000, status_1000, phyreg, pause_flags; 2134 u32 control_1000, status_1000, phyreg, pause_flags, txreg;
2131 2135
2132 /* BMSR_LSTATUS is latched, read it twice: 2136 /* BMSR_LSTATUS is latched, read it twice:
2133 * we want the current value. 2137 * we want the current value.
@@ -2245,6 +2249,26 @@ set_speed:
2245 phyreg |= PHY_1000; 2249 phyreg |= PHY_1000;
2246 writel(phyreg, base + NvRegPhyInterface); 2250 writel(phyreg, base + NvRegPhyInterface);
2247 2251
2252 if (phyreg & PHY_RGMII) {
2253 if ((np->linkspeed & NVREG_LINKSPEED_MASK) == NVREG_LINKSPEED_1000)
2254 txreg = NVREG_TX_DEFERRAL_RGMII_1000;
2255 else
2256 txreg = NVREG_TX_DEFERRAL_RGMII_10_100;
2257 } else {
2258 txreg = NVREG_TX_DEFERRAL_DEFAULT;
2259 }
2260 writel(txreg, base + NvRegTxDeferral);
2261
2262 if (np->desc_ver == DESC_VER_1) {
2263 txreg = NVREG_TX_WM_DESC1_DEFAULT;
2264 } else {
2265 if ((np->linkspeed & NVREG_LINKSPEED_MASK) == NVREG_LINKSPEED_1000)
2266 txreg = NVREG_TX_WM_DESC2_3_1000;
2267 else
2268 txreg = NVREG_TX_WM_DESC2_3_DEFAULT;
2269 }
2270 writel(txreg, base + NvRegTxWatermark);
2271
2248 writel(NVREG_MISC1_FORCE | ( np->duplex ? 0 : NVREG_MISC1_HD), 2272 writel(NVREG_MISC1_FORCE | ( np->duplex ? 0 : NVREG_MISC1_HD),
2249 base + NvRegMisc1); 2273 base + NvRegMisc1);
2250 pci_push(base); 2274 pci_push(base);
@@ -3910,7 +3934,10 @@ static int nv_open(struct net_device *dev)
3910 3934
3911 /* 5) continue setup */ 3935 /* 5) continue setup */
3912 writel(np->linkspeed, base + NvRegLinkSpeed); 3936 writel(np->linkspeed, base + NvRegLinkSpeed);
3913 writel(NVREG_UNKSETUP3_VAL1, base + NvRegUnknownSetupReg3); 3937 if (np->desc_ver == DESC_VER_1)
3938 writel(NVREG_TX_WM_DESC1_DEFAULT, base + NvRegTxWatermark);
3939 else
3940 writel(NVREG_TX_WM_DESC2_3_DEFAULT, base + NvRegTxWatermark);
3914 writel(np->txrxctl_bits, base + NvRegTxRxControl); 3941 writel(np->txrxctl_bits, base + NvRegTxRxControl);
3915 writel(np->vlanctl_bits, base + NvRegVlanControl); 3942 writel(np->vlanctl_bits, base + NvRegVlanControl);
3916 pci_push(base); 3943 pci_push(base);
@@ -3932,8 +3959,8 @@ static int nv_open(struct net_device *dev)
3932 writel(readl(base + NvRegReceiverStatus), base + NvRegReceiverStatus); 3959 writel(readl(base + NvRegReceiverStatus), base + NvRegReceiverStatus);
3933 get_random_bytes(&i, sizeof(i)); 3960 get_random_bytes(&i, sizeof(i));
3934 writel(NVREG_RNDSEED_FORCE | (i&NVREG_RNDSEED_MASK), base + NvRegRandomSeed); 3961 writel(NVREG_RNDSEED_FORCE | (i&NVREG_RNDSEED_MASK), base + NvRegRandomSeed);
3935 writel(NVREG_UNKSETUP1_VAL, base + NvRegUnknownSetupReg1); 3962 writel(NVREG_TX_DEFERRAL_DEFAULT, base + NvRegTxDeferral);
3936 writel(NVREG_UNKSETUP2_VAL, base + NvRegUnknownSetupReg2); 3963 writel(NVREG_RX_DEFERRAL_DEFAULT, base + NvRegRxDeferral);
3937 if (poll_interval == -1) { 3964 if (poll_interval == -1) {
3938 if (optimization_mode == NV_OPTIMIZATION_MODE_THROUGHPUT) 3965 if (optimization_mode == NV_OPTIMIZATION_MODE_THROUGHPUT)
3939 writel(NVREG_POLL_DEFAULT_THROUGHPUT, base + NvRegPollingInterval); 3966 writel(NVREG_POLL_DEFAULT_THROUGHPUT, base + NvRegPollingInterval);
diff --git a/drivers/net/gt96100eth.c b/drivers/net/gt96100eth.c
index 49dacc6e35aa..2b4db7414475 100644
--- a/drivers/net/gt96100eth.c
+++ b/drivers/net/gt96100eth.c
@@ -699,7 +699,6 @@ static int __init gt96100_probe1(struct pci_dev *pci, int port_num)
699 memset(gp, 0, sizeof(*gp)); // clear it 699 memset(gp, 0, sizeof(*gp)); // clear it
700 700
701 gp->port_num = port_num; 701 gp->port_num = port_num;
702 gp->io_size = GT96100_ETH_IO_SIZE;
703 gp->port_offset = port_num * GT96100_ETH_IO_SIZE; 702 gp->port_offset = port_num * GT96100_ETH_IO_SIZE;
704 gp->phy_addr = phy_addr; 703 gp->phy_addr = phy_addr;
705 gp->chip_rev = chip_rev; 704 gp->chip_rev = chip_rev;
@@ -1531,7 +1530,7 @@ static void gt96100_cleanup_module(void)
1531 + sizeof(gt96100_td_t) * TX_RING_SIZE, 1530 + sizeof(gt96100_td_t) * TX_RING_SIZE,
1532 gp->rx_ring); 1531 gp->rx_ring);
1533 free_netdev(gtif->dev); 1532 free_netdev(gtif->dev);
1534 release_region(gtif->iobase, gp->io_size); 1533 release_region(gtif->iobase, GT96100_ETH_IO_SIZE);
1535 } 1534 }
1536 } 1535 }
1537} 1536}
diff --git a/drivers/net/gt96100eth.h b/drivers/net/gt96100eth.h
index 2a8331938b84..3b62a87c7d7f 100644
--- a/drivers/net/gt96100eth.h
+++ b/drivers/net/gt96100eth.h
@@ -331,7 +331,6 @@ struct gt96100_private {
331 mib_counters_t mib; 331 mib_counters_t mib;
332 struct net_device_stats stats; 332 struct net_device_stats stats;
333 333
334 int io_size;
335 int port_num; // 0 or 1 334 int port_num; // 0 or 1
336 int chip_rev; 335 int chip_rev;
337 u32 port_offset; 336 u32 port_offset;
@@ -340,7 +339,6 @@ struct gt96100_private {
340 u32 last_psr; // last value of the port status register 339 u32 last_psr; // last value of the port status register
341 340
342 int options; /* User-settable misc. driver options. */ 341 int options; /* User-settable misc. driver options. */
343 int drv_flags;
344 struct timer_list timer; 342 struct timer_list timer;
345 spinlock_t lock; /* Serialise access to device */ 343 spinlock_t lock; /* Serialise access to device */
346}; 344};
diff --git a/drivers/net/hamachi.c b/drivers/net/hamachi.c
index 7bcd939c6edd..409c6aab0411 100644
--- a/drivers/net/hamachi.c
+++ b/drivers/net/hamachi.c
@@ -20,22 +20,15 @@
20 20
21 Support and updates available at 21 Support and updates available at
22 http://www.scyld.com/network/hamachi.html 22 http://www.scyld.com/network/hamachi.html
23 [link no longer provides useful info -jgarzik]
23 or 24 or
24 http://www.parl.clemson.edu/~keithu/hamachi.html 25 http://www.parl.clemson.edu/~keithu/hamachi.html
25 26
26
27
28 Linux kernel changelog:
29
30 LK1.0.1:
31 - fix lack of pci_dev<->dev association
32 - ethtool support (jgarzik)
33
34*/ 27*/
35 28
36#define DRV_NAME "hamachi" 29#define DRV_NAME "hamachi"
37#define DRV_VERSION "1.01+LK1.0.1" 30#define DRV_VERSION "2.0"
38#define DRV_RELDATE "5/18/2001" 31#define DRV_RELDATE "June 27, 2006"
39 32
40 33
41/* A few user-configurable values. */ 34/* A few user-configurable values. */
@@ -608,7 +601,8 @@ static int __devinit hamachi_init_one (struct pci_dev *pdev,
608 pci_set_master(pdev); 601 pci_set_master(pdev);
609 602
610 i = pci_request_regions(pdev, DRV_NAME); 603 i = pci_request_regions(pdev, DRV_NAME);
611 if (i) return i; 604 if (i)
605 return i;
612 606
613 irq = pdev->irq; 607 irq = pdev->irq;
614 ioaddr = ioremap(base, 0x400); 608 ioaddr = ioremap(base, 0x400);
diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c
index 0641f54fc638..889f338132fa 100644
--- a/drivers/net/hamradio/bpqether.c
+++ b/drivers/net/hamradio/bpqether.c
@@ -122,6 +122,12 @@ struct bpqdev {
122 122
123static LIST_HEAD(bpq_devices); 123static LIST_HEAD(bpq_devices);
124 124
125/*
126 * bpqether network devices are paired with ethernet devices below them, so
127 * form a special "super class" of normal ethernet devices; split their locks
128 * off into a separate class since they always nest.
129 */
130static struct lock_class_key bpq_netdev_xmit_lock_key;
125 131
126/* ------------------------------------------------------------------------ */ 132/* ------------------------------------------------------------------------ */
127 133
@@ -528,6 +534,7 @@ static int bpq_new_device(struct net_device *edev)
528 err = register_netdevice(ndev); 534 err = register_netdevice(ndev);
529 if (err) 535 if (err)
530 goto error; 536 goto error;
537 lockdep_set_class(&ndev->_xmit_lock, &bpq_netdev_xmit_lock_key);
531 538
532 /* List protected by RTNL */ 539 /* List protected by RTNL */
533 list_add_rcu(&bpq->bpq_list, &bpq_devices); 540 list_add_rcu(&bpq->bpq_list, &bpq_devices);
diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c
index 3a42afab5036..43e3f33ed5e2 100644
--- a/drivers/net/ifb.c
+++ b/drivers/net/ifb.c
@@ -271,6 +271,7 @@ static int __init ifb_init_module(void)
271 for (i = 0; i < numifbs && !err; i++) 271 for (i = 0; i < numifbs && !err; i++)
272 err = ifb_init_one(i); 272 err = ifb_init_one(i);
273 if (err) { 273 if (err) {
274 i--;
274 while (--i >= 0) 275 while (--i >= 0)
275 ifb_free_one(i); 276 ifb_free_one(i);
276 } 277 }
diff --git a/drivers/net/irda/ali-ircc.c b/drivers/net/irda/ali-ircc.c
index bf1fca5a3fa0..e3c8cd5eca67 100644
--- a/drivers/net/irda/ali-ircc.c
+++ b/drivers/net/irda/ali-ircc.c
@@ -146,7 +146,7 @@ static int __init ali_ircc_init(void)
146{ 146{
147 ali_chip_t *chip; 147 ali_chip_t *chip;
148 chipio_t info; 148 chipio_t info;
149 int ret = -ENODEV; 149 int ret;
150 int cfg, cfg_base; 150 int cfg, cfg_base;
151 int reg, revision; 151 int reg, revision;
152 int i = 0; 152 int i = 0;
@@ -160,6 +160,7 @@ static int __init ali_ircc_init(void)
160 return ret; 160 return ret;
161 } 161 }
162 162
163 ret = -ENODEV;
163 164
164 /* Probe for all the ALi chipsets we know about */ 165 /* Probe for all the ALi chipsets we know about */
165 for (chip= chips; chip->name; chip++, i++) 166 for (chip= chips; chip->name; chip++, i++)
diff --git a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c
index a4674044bd6f..2eff45bedc7c 100644
--- a/drivers/net/irda/smsc-ircc2.c
+++ b/drivers/net/irda/smsc-ircc2.c
@@ -2353,7 +2353,7 @@ static int __init smsc_superio_lpc(unsigned short cfg_base)
2353#ifdef CONFIG_PCI 2353#ifdef CONFIG_PCI
2354#define PCIID_VENDOR_INTEL 0x8086 2354#define PCIID_VENDOR_INTEL 0x8086
2355#define PCIID_VENDOR_ALI 0x10b9 2355#define PCIID_VENDOR_ALI 0x10b9
2356static struct smsc_ircc_subsystem_configuration subsystem_configurations[] __devinitdata = { 2356static struct smsc_ircc_subsystem_configuration subsystem_configurations[] __initdata = {
2357 { 2357 {
2358 .vendor = PCIID_VENDOR_INTEL, /* Intel 82801DBM LPC bridge */ 2358 .vendor = PCIID_VENDOR_INTEL, /* Intel 82801DBM LPC bridge */
2359 .device = 0x24cc, 2359 .device = 0x24cc,
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index b91e082483f6..7bbd447289b5 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -1173,7 +1173,7 @@ ixgb_tso(struct ixgb_adapter *adapter, struct sk_buff *skb)
1173 uint16_t ipcse, tucse, mss; 1173 uint16_t ipcse, tucse, mss;
1174 int err; 1174 int err;
1175 1175
1176 if(likely(skb_shinfo(skb)->gso_size)) { 1176 if (likely(skb_is_gso(skb))) {
1177 if (skb_header_cloned(skb)) { 1177 if (skb_header_cloned(skb)) {
1178 err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC); 1178 err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC);
1179 if (err) 1179 if (err)
@@ -1281,7 +1281,7 @@ ixgb_tx_map(struct ixgb_adapter *adapter, struct sk_buff *skb,
1281 1281
1282 while(len) { 1282 while(len) {
1283 buffer_info = &tx_ring->buffer_info[i]; 1283 buffer_info = &tx_ring->buffer_info[i];
1284 size = min(len, IXGB_MAX_JUMBO_FRAME_SIZE); 1284 size = min(len, IXGB_MAX_DATA_PER_TXD);
1285 buffer_info->length = size; 1285 buffer_info->length = size;
1286 buffer_info->dma = 1286 buffer_info->dma =
1287 pci_map_single(adapter->pdev, 1287 pci_map_single(adapter->pdev,
@@ -1306,7 +1306,7 @@ ixgb_tx_map(struct ixgb_adapter *adapter, struct sk_buff *skb,
1306 1306
1307 while(len) { 1307 while(len) {
1308 buffer_info = &tx_ring->buffer_info[i]; 1308 buffer_info = &tx_ring->buffer_info[i];
1309 size = min(len, IXGB_MAX_JUMBO_FRAME_SIZE); 1309 size = min(len, IXGB_MAX_DATA_PER_TXD);
1310 buffer_info->length = size; 1310 buffer_info->length = size;
1311 buffer_info->dma = 1311 buffer_info->dma =
1312 pci_map_page(adapter->pdev, 1312 pci_map_page(adapter->pdev,
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
index 43fef7de8cb9..997cbce9af6e 100644
--- a/drivers/net/loopback.c
+++ b/drivers/net/loopback.c
@@ -139,7 +139,7 @@ static int loopback_xmit(struct sk_buff *skb, struct net_device *dev)
139#endif 139#endif
140 140
141#ifdef LOOPBACK_TSO 141#ifdef LOOPBACK_TSO
142 if (skb_shinfo(skb)->gso_size) { 142 if (skb_is_gso(skb)) {
143 BUG_ON(skb->protocol != htons(ETH_P_IP)); 143 BUG_ON(skb->protocol != htons(ETH_P_IP));
144 BUG_ON(skb->nh.iph->protocol != IPPROTO_TCP); 144 BUG_ON(skb->nh.iph->protocol != IPPROTO_TCP);
145 145
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index 72aad42db7b4..06440a86baef 100644
--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -177,6 +177,7 @@ struct myri10ge_priv {
177 struct work_struct watchdog_work; 177 struct work_struct watchdog_work;
178 struct timer_list watchdog_timer; 178 struct timer_list watchdog_timer;
179 int watchdog_tx_done; 179 int watchdog_tx_done;
180 int watchdog_tx_req;
180 int watchdog_resets; 181 int watchdog_resets;
181 int tx_linearized; 182 int tx_linearized;
182 int pause; 183 int pause;
@@ -188,7 +189,6 @@ struct myri10ge_priv {
188 int vendor_specific_offset; 189 int vendor_specific_offset;
189 u32 devctl; 190 u32 devctl;
190 u16 msi_flags; 191 u16 msi_flags;
191 u32 pm_state[16];
192 u32 read_dma; 192 u32 read_dma;
193 u32 write_dma; 193 u32 write_dma;
194 u32 read_write_dma; 194 u32 read_write_dma;
@@ -449,6 +449,7 @@ static int myri10ge_load_hotplug_firmware(struct myri10ge_priv *mgp, u32 * size)
449 struct mcp_gen_header *hdr; 449 struct mcp_gen_header *hdr;
450 size_t hdr_offset; 450 size_t hdr_offset;
451 int status; 451 int status;
452 unsigned i;
452 453
453 if ((status = request_firmware(&fw, mgp->fw_name, dev)) < 0) { 454 if ((status = request_firmware(&fw, mgp->fw_name, dev)) < 0) {
454 dev_err(dev, "Unable to load %s firmware image via hotplug\n", 455 dev_err(dev, "Unable to load %s firmware image via hotplug\n",
@@ -480,18 +481,12 @@ static int myri10ge_load_hotplug_firmware(struct myri10ge_priv *mgp, u32 * size)
480 goto abort_with_fw; 481 goto abort_with_fw;
481 482
482 crc = crc32(~0, fw->data, fw->size); 483 crc = crc32(~0, fw->data, fw->size);
483 if (mgp->tx.boundary == 2048) { 484 for (i = 0; i < fw->size; i += 256) {
484 /* Avoid PCI burst on chipset with unaligned completions. */ 485 myri10ge_pio_copy(mgp->sram + MYRI10GE_FW_OFFSET + i,
485 int i; 486 fw->data + i,
486 __iomem u32 *ptr = (__iomem u32 *) (mgp->sram + 487 min(256U, (unsigned)(fw->size - i)));
487 MYRI10GE_FW_OFFSET); 488 mb();
488 for (i = 0; i < fw->size / 4; i++) { 489 readb(mgp->sram);
489 __raw_writel(((u32 *) fw->data)[i], ptr + i);
490 wmb();
491 }
492 } else {
493 myri10ge_pio_copy(mgp->sram + MYRI10GE_FW_OFFSET, fw->data,
494 fw->size);
495 } 490 }
496 /* corruption checking is good for parity recovery and buggy chipset */ 491 /* corruption checking is good for parity recovery and buggy chipset */
497 memcpy_fromio(fw->data, mgp->sram + MYRI10GE_FW_OFFSET, fw->size); 492 memcpy_fromio(fw->data, mgp->sram + MYRI10GE_FW_OFFSET, fw->size);
@@ -621,7 +616,7 @@ static int myri10ge_load_firmware(struct myri10ge_priv *mgp)
621 return -ENXIO; 616 return -ENXIO;
622 } 617 }
623 dev_info(&mgp->pdev->dev, "handoff confirmed\n"); 618 dev_info(&mgp->pdev->dev, "handoff confirmed\n");
624 myri10ge_dummy_rdma(mgp, mgp->tx.boundary != 4096); 619 myri10ge_dummy_rdma(mgp, 1);
625 620
626 return 0; 621 return 0;
627} 622}
@@ -1289,6 +1284,7 @@ static const char myri10ge_gstrings_stats[][ETH_GSTRING_LEN] = {
1289 "tx_aborted_errors", "tx_carrier_errors", "tx_fifo_errors", 1284 "tx_aborted_errors", "tx_carrier_errors", "tx_fifo_errors",
1290 "tx_heartbeat_errors", "tx_window_errors", 1285 "tx_heartbeat_errors", "tx_window_errors",
1291 /* device-specific stats */ 1286 /* device-specific stats */
1287 "tx_boundary", "WC", "irq", "MSI",
1292 "read_dma_bw_MBs", "write_dma_bw_MBs", "read_write_dma_bw_MBs", 1288 "read_dma_bw_MBs", "write_dma_bw_MBs", "read_write_dma_bw_MBs",
1293 "serial_number", "tx_pkt_start", "tx_pkt_done", 1289 "serial_number", "tx_pkt_start", "tx_pkt_done",
1294 "tx_req", "tx_done", "rx_small_cnt", "rx_big_cnt", 1290 "tx_req", "tx_done", "rx_small_cnt", "rx_big_cnt",
@@ -1327,6 +1323,10 @@ myri10ge_get_ethtool_stats(struct net_device *netdev,
1327 for (i = 0; i < MYRI10GE_NET_STATS_LEN; i++) 1323 for (i = 0; i < MYRI10GE_NET_STATS_LEN; i++)
1328 data[i] = ((unsigned long *)&mgp->stats)[i]; 1324 data[i] = ((unsigned long *)&mgp->stats)[i];
1329 1325
1326 data[i++] = (unsigned int)mgp->tx.boundary;
1327 data[i++] = (unsigned int)(mgp->mtrr >= 0);
1328 data[i++] = (unsigned int)mgp->pdev->irq;
1329 data[i++] = (unsigned int)mgp->msi_enabled;
1330 data[i++] = (unsigned int)mgp->read_dma; 1330 data[i++] = (unsigned int)mgp->read_dma;
1331 data[i++] = (unsigned int)mgp->write_dma; 1331 data[i++] = (unsigned int)mgp->write_dma;
1332 data[i++] = (unsigned int)mgp->read_write_dma; 1332 data[i++] = (unsigned int)mgp->read_write_dma;
@@ -2112,7 +2112,7 @@ abort_linearize:
2112 } 2112 }
2113 idx = (idx + 1) & tx->mask; 2113 idx = (idx + 1) & tx->mask;
2114 } while (idx != last_idx); 2114 } while (idx != last_idx);
2115 if (skb_shinfo(skb)->gso_size) { 2115 if (skb_is_gso(skb)) {
2116 printk(KERN_ERR 2116 printk(KERN_ERR
2117 "myri10ge: %s: TSO but wanted to linearize?!?!?\n", 2117 "myri10ge: %s: TSO but wanted to linearize?!?!?\n",
2118 mgp->dev->name); 2118 mgp->dev->name);
@@ -2197,8 +2197,6 @@ static int myri10ge_change_mtu(struct net_device *dev, int new_mtu)
2197 * any other device, except if forced with myri10ge_ecrc_enable > 1. 2197 * any other device, except if forced with myri10ge_ecrc_enable > 1.
2198 */ 2198 */
2199 2199
2200#define PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_PCIE 0x005d
2201
2202static void myri10ge_enable_ecrc(struct myri10ge_priv *mgp) 2200static void myri10ge_enable_ecrc(struct myri10ge_priv *mgp)
2203{ 2201{
2204 struct pci_dev *bridge = mgp->pdev->bus->self; 2202 struct pci_dev *bridge = mgp->pdev->bus->self;
@@ -2410,14 +2408,20 @@ static int myri10ge_resume(struct pci_dev *pdev)
2410 return -EIO; 2408 return -EIO;
2411 } 2409 }
2412 myri10ge_restore_state(mgp); 2410 myri10ge_restore_state(mgp);
2413 pci_enable_device(pdev); 2411
2412 status = pci_enable_device(pdev);
2413 if (status < 0) {
2414 dev_err(&pdev->dev, "failed to enable device\n");
2415 return -EIO;
2416 }
2417
2414 pci_set_master(pdev); 2418 pci_set_master(pdev);
2415 2419
2416 status = request_irq(pdev->irq, myri10ge_intr, IRQF_SHARED, 2420 status = request_irq(pdev->irq, myri10ge_intr, IRQF_SHARED,
2417 netdev->name, mgp); 2421 netdev->name, mgp);
2418 if (status != 0) { 2422 if (status != 0) {
2419 dev_err(&pdev->dev, "failed to allocate IRQ\n"); 2423 dev_err(&pdev->dev, "failed to allocate IRQ\n");
2420 goto abort_with_msi; 2424 goto abort_with_enabled;
2421 } 2425 }
2422 2426
2423 myri10ge_reset(mgp); 2427 myri10ge_reset(mgp);
@@ -2436,7 +2440,8 @@ static int myri10ge_resume(struct pci_dev *pdev)
2436 2440
2437 return 0; 2441 return 0;
2438 2442
2439abort_with_msi: 2443abort_with_enabled:
2444 pci_disable_device(pdev);
2440 return -EIO; 2445 return -EIO;
2441 2446
2442} 2447}
@@ -2538,7 +2543,8 @@ static void myri10ge_watchdog_timer(unsigned long arg)
2538 2543
2539 mgp = (struct myri10ge_priv *)arg; 2544 mgp = (struct myri10ge_priv *)arg;
2540 if (mgp->tx.req != mgp->tx.done && 2545 if (mgp->tx.req != mgp->tx.done &&
2541 mgp->tx.done == mgp->watchdog_tx_done) 2546 mgp->tx.done == mgp->watchdog_tx_done &&
2547 mgp->watchdog_tx_req != mgp->watchdog_tx_done)
2542 /* nic seems like it might be stuck.. */ 2548 /* nic seems like it might be stuck.. */
2543 schedule_work(&mgp->watchdog_work); 2549 schedule_work(&mgp->watchdog_work);
2544 else 2550 else
@@ -2547,6 +2553,7 @@ static void myri10ge_watchdog_timer(unsigned long arg)
2547 jiffies + myri10ge_watchdog_timeout * HZ); 2553 jiffies + myri10ge_watchdog_timeout * HZ);
2548 2554
2549 mgp->watchdog_tx_done = mgp->tx.done; 2555 mgp->watchdog_tx_done = mgp->tx.done;
2556 mgp->watchdog_tx_req = mgp->tx.req;
2550} 2557}
2551 2558
2552static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) 2559static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
@@ -2737,11 +2744,10 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2737 dev_err(&pdev->dev, "register_netdev failed: %d\n", status); 2744 dev_err(&pdev->dev, "register_netdev failed: %d\n", status);
2738 goto abort_with_irq; 2745 goto abort_with_irq;
2739 } 2746 }
2740 2747 dev_info(dev, "%s IRQ %d, tx bndry %d, fw %s, WC %s\n",
2741 printk(KERN_INFO "myri10ge: %s: %s IRQ %d, tx bndry %d, fw %s, WC %s\n", 2748 (mgp->msi_enabled ? "MSI" : "xPIC"),
2742 netdev->name, (mgp->msi_enabled ? "MSI" : "xPIC"), 2749 pdev->irq, mgp->tx.boundary, mgp->fw_name,
2743 pdev->irq, mgp->tx.boundary, mgp->fw_name, 2750 (mgp->mtrr >= 0 ? "Enabled" : "Disabled"));
2744 (mgp->mtrr >= 0 ? "Enabled" : "Disabled"));
2745 2751
2746 return 0; 2752 return 0;
2747 2753
diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c
index 9df2628be1e7..db0475a1102f 100644
--- a/drivers/net/natsemi.c
+++ b/drivers/net/natsemi.c
@@ -20,120 +20,9 @@
20 20
21 Support information and updates available at 21 Support information and updates available at
22 http://www.scyld.com/network/netsemi.html 22 http://www.scyld.com/network/netsemi.html
23 [link no longer provides useful info -jgarzik]
23 24
24 25
25 Linux kernel modifications:
26
27 Version 1.0.1:
28 - Spinlock fixes
29 - Bug fixes and better intr performance (Tjeerd)
30 Version 1.0.2:
31 - Now reads correct MAC address from eeprom
32 Version 1.0.3:
33 - Eliminate redundant priv->tx_full flag
34 - Call netif_start_queue from dev->tx_timeout
35 - wmb() in start_tx() to flush data
36 - Update Tx locking
37 - Clean up PCI enable (davej)
38 Version 1.0.4:
39 - Merge Donald Becker's natsemi.c version 1.07
40 Version 1.0.5:
41 - { fill me in }
42 Version 1.0.6:
43 * ethtool support (jgarzik)
44 * Proper initialization of the card (which sometimes
45 fails to occur and leaves the card in a non-functional
46 state). (uzi)
47
48 * Some documented register settings to optimize some
49 of the 100Mbit autodetection circuitry in rev C cards. (uzi)
50
51 * Polling of the PHY intr for stuff like link state
52 change and auto- negotiation to finally work properly. (uzi)
53
54 * One-liner removal of a duplicate declaration of
55 netdev_error(). (uzi)
56
57 Version 1.0.7: (Manfred Spraul)
58 * pci dma
59 * SMP locking update
60 * full reset added into tx_timeout
61 * correct multicast hash generation (both big and little endian)
62 [copied from a natsemi driver version
63 from Myrio Corporation, Greg Smith]
64 * suspend/resume
65
66 version 1.0.8 (Tim Hockin <thockin@sun.com>)
67 * ETHTOOL_* support
68 * Wake on lan support (Erik Gilling)
69 * MXDMA fixes for serverworks
70 * EEPROM reload
71
72 version 1.0.9 (Manfred Spraul)
73 * Main change: fix lack of synchronize
74 netif_close/netif_suspend against a last interrupt
75 or packet.
76 * do not enable superflous interrupts (e.g. the
77 drivers relies on TxDone - TxIntr not needed)
78 * wait that the hardware has really stopped in close
79 and suspend.
80 * workaround for the (at least) gcc-2.95.1 compiler
81 problem. Also simplifies the code a bit.
82 * disable_irq() in tx_timeout - needed to protect
83 against rx interrupts.
84 * stop the nic before switching into silent rx mode
85 for wol (required according to docu).
86
87 version 1.0.10:
88 * use long for ee_addr (various)
89 * print pointers properly (DaveM)
90 * include asm/irq.h (?)
91
92 version 1.0.11:
93 * check and reset if PHY errors appear (Adrian Sun)
94 * WoL cleanup (Tim Hockin)
95 * Magic number cleanup (Tim Hockin)
96 * Don't reload EEPROM on every reset (Tim Hockin)
97 * Save and restore EEPROM state across reset (Tim Hockin)
98 * MDIO Cleanup (Tim Hockin)
99 * Reformat register offsets/bits (jgarzik)
100
101 version 1.0.12:
102 * ETHTOOL_* further support (Tim Hockin)
103
104 version 1.0.13:
105 * ETHTOOL_[G]EEPROM support (Tim Hockin)
106
107 version 1.0.13:
108 * crc cleanup (Matt Domsch <Matt_Domsch@dell.com>)
109
110 version 1.0.14:
111 * Cleanup some messages and autoneg in ethtool (Tim Hockin)
112
113 version 1.0.15:
114 * Get rid of cable_magic flag
115 * use new (National provided) solution for cable magic issue
116
117 version 1.0.16:
118 * call netdev_rx() for RxErrors (Manfred Spraul)
119 * formatting and cleanups
120 * change options and full_duplex arrays to be zero
121 initialized
122 * enable only the WoL and PHY interrupts in wol mode
123
124 version 1.0.17:
125 * only do cable_magic on 83815 and early 83816 (Tim Hockin)
126 * create a function for rx refill (Manfred Spraul)
127 * combine drain_ring and init_ring (Manfred Spraul)
128 * oom handling (Manfred Spraul)
129 * hands_off instead of playing with netif_device_{de,a}ttach
130 (Manfred Spraul)
131 * be sure to write the MAC back to the chip (Manfred Spraul)
132 * lengthen EEPROM timeout, and always warn about timeouts
133 (Manfred Spraul)
134 * comments update (Manfred)
135 * do the right thing on a phy-reset (Manfred and Tim)
136
137 TODO: 26 TODO:
138 * big endian support with CFG:BEM instead of cpu_to_le32 27 * big endian support with CFG:BEM instead of cpu_to_le32
139*/ 28*/
@@ -165,8 +54,8 @@
165#include <asm/uaccess.h> 54#include <asm/uaccess.h>
166 55
167#define DRV_NAME "natsemi" 56#define DRV_NAME "natsemi"
168#define DRV_VERSION "1.07+LK1.0.17" 57#define DRV_VERSION "2.0"
169#define DRV_RELDATE "Sep 27, 2002" 58#define DRV_RELDATE "June 27, 2006"
170 59
171#define RX_OFFSET 2 60#define RX_OFFSET 2
172 61
diff --git a/drivers/net/ne2k-pci.c b/drivers/net/ne2k-pci.c
index fa50eb889408..34bdba9eec79 100644
--- a/drivers/net/ne2k-pci.c
+++ b/drivers/net/ne2k-pci.c
@@ -231,12 +231,12 @@ static int __devinit ne2k_pci_init_one (struct pci_dev *pdev,
231 irq = pdev->irq; 231 irq = pdev->irq;
232 232
233 if (!ioaddr || ((pci_resource_flags (pdev, 0) & IORESOURCE_IO) == 0)) { 233 if (!ioaddr || ((pci_resource_flags (pdev, 0) & IORESOURCE_IO) == 0)) {
234 printk (KERN_ERR PFX "no I/O resource at PCI BAR #0\n"); 234 dev_err(&pdev->dev, "no I/O resource at PCI BAR #0\n");
235 return -ENODEV; 235 return -ENODEV;
236 } 236 }
237 237
238 if (request_region (ioaddr, NE_IO_EXTENT, DRV_NAME) == NULL) { 238 if (request_region (ioaddr, NE_IO_EXTENT, DRV_NAME) == NULL) {
239 printk (KERN_ERR PFX "I/O resource 0x%x @ 0x%lx busy\n", 239 dev_err(&pdev->dev, "I/O resource 0x%x @ 0x%lx busy\n",
240 NE_IO_EXTENT, ioaddr); 240 NE_IO_EXTENT, ioaddr);
241 return -EBUSY; 241 return -EBUSY;
242 } 242 }
@@ -263,7 +263,7 @@ static int __devinit ne2k_pci_init_one (struct pci_dev *pdev,
263 /* Allocate net_device, dev->priv; fill in 8390 specific dev fields. */ 263 /* Allocate net_device, dev->priv; fill in 8390 specific dev fields. */
264 dev = alloc_ei_netdev(); 264 dev = alloc_ei_netdev();
265 if (!dev) { 265 if (!dev) {
266 printk (KERN_ERR PFX "cannot allocate ethernet device\n"); 266 dev_err(&pdev->dev, "cannot allocate ethernet device\n");
267 goto err_out_free_res; 267 goto err_out_free_res;
268 } 268 }
269 SET_MODULE_OWNER(dev); 269 SET_MODULE_OWNER(dev);
@@ -281,7 +281,8 @@ static int __devinit ne2k_pci_init_one (struct pci_dev *pdev,
281 while ((inb(ioaddr + EN0_ISR) & ENISR_RESET) == 0) 281 while ((inb(ioaddr + EN0_ISR) & ENISR_RESET) == 0)
282 /* Limit wait: '2' avoids jiffy roll-over. */ 282 /* Limit wait: '2' avoids jiffy roll-over. */
283 if (jiffies - reset_start_time > 2) { 283 if (jiffies - reset_start_time > 2) {
284 printk(KERN_ERR PFX "Card failure (no reset ack).\n"); 284 dev_err(&pdev->dev,
285 "Card failure (no reset ack).\n");
285 goto err_out_free_netdev; 286 goto err_out_free_netdev;
286 } 287 }
287 288
diff --git a/drivers/net/ni5010.c b/drivers/net/ni5010.c
index a68bf474f6ed..d4be207d321a 100644
--- a/drivers/net/ni5010.c
+++ b/drivers/net/ni5010.c
@@ -1,17 +1,12 @@
1/* ni5010.c: A network driver for the MiCom-Interlan NI5010 ethercard. 1/* ni5010.c: A network driver for the MiCom-Interlan NI5010 ethercard.
2 * 2 *
3 * Copyright 1996,1997 Jan-Pascal van Best and Andreas Mohr. 3 * Copyright 1996,1997,2006 Jan-Pascal van Best and Andreas Mohr.
4 * 4 *
5 * This software may be used and distributed according to the terms 5 * This software may be used and distributed according to the terms
6 * of the GNU General Public License, incorporated herein by reference. 6 * of the GNU General Public License, incorporated herein by reference.
7 * 7 *
8 * The authors may be reached as: 8 * The authors may be reached as:
9 * jvbest@wi.leidenuniv.nl a.mohr@mailto.de 9 * janpascal@vanbest.org andi@lisas.de
10 * or by snail mail as
11 * Jan-Pascal van Best Andreas Mohr
12 * Klikspaanweg 58-4 Stauferstr. 6
13 * 2324 LZ Leiden D-71272 Renningen
14 * The Netherlands Germany
15 * 10 *
16 * Sources: 11 * Sources:
17 * Donald Becker's "skeleton.c" 12 * Donald Becker's "skeleton.c"
@@ -27,8 +22,9 @@
27 * 970503 v0.93: Fixed auto-irq failure on warm reboot (JB) 22 * 970503 v0.93: Fixed auto-irq failure on warm reboot (JB)
28 * 970623 v1.00: First kernel version (AM) 23 * 970623 v1.00: First kernel version (AM)
29 * 970814 v1.01: Added detection of onboard receive buffer size (AM) 24 * 970814 v1.01: Added detection of onboard receive buffer size (AM)
25 * 060611 v1.02: slight cleanup: email addresses, driver modernization.
30 * Bugs: 26 * Bugs:
31 * - None known... 27 * - not SMP-safe (no locking of I/O accesses)
32 * - Note that you have to patch ifconfig for the new /proc/net/dev 28 * - Note that you have to patch ifconfig for the new /proc/net/dev
33 * format. It gives incorrect stats otherwise. 29 * format. It gives incorrect stats otherwise.
34 * 30 *
@@ -39,7 +35,7 @@
39 * Complete merge with Andreas' driver 35 * Complete merge with Andreas' driver
40 * Implement ring buffers (Is this useful? You can't squeeze 36 * Implement ring buffers (Is this useful? You can't squeeze
41 * too many packet in a 2k buffer!) 37 * too many packet in a 2k buffer!)
42 * Implement DMA (Again, is this useful? Some docs says DMA is 38 * Implement DMA (Again, is this useful? Some docs say DMA is
43 * slower than programmed I/O) 39 * slower than programmed I/O)
44 * 40 *
45 * Compile with: 41 * Compile with:
@@ -47,7 +43,7 @@
47 * -DMODULE -c ni5010.c 43 * -DMODULE -c ni5010.c
48 * 44 *
49 * Insert with e.g.: 45 * Insert with e.g.:
50 * insmod ni5010.o io=0x300 irq=5 46 * insmod ni5010.ko io=0x300 irq=5
51 */ 47 */
52 48
53#include <linux/module.h> 49#include <linux/module.h>
@@ -69,15 +65,15 @@
69 65
70#include "ni5010.h" 66#include "ni5010.h"
71 67
72static const char *boardname = "NI5010"; 68static const char boardname[] = "NI5010";
73static char *version = 69static char version[] __initdata =
74 "ni5010.c: v1.00 06/23/97 Jan-Pascal van Best and Andreas Mohr\n"; 70 "ni5010.c: v1.02 20060611 Jan-Pascal van Best and Andreas Mohr\n";
75 71
76/* bufsize_rcv == 0 means autoprobing */ 72/* bufsize_rcv == 0 means autoprobing */
77static unsigned int bufsize_rcv; 73static unsigned int bufsize_rcv;
78 74
79#define jumpered_interrupts /* IRQ line jumpered on board */ 75#define JUMPERED_INTERRUPTS /* IRQ line jumpered on board */
80#undef jumpered_dma /* No DMA used */ 76#undef JUMPERED_DMA /* No DMA used */
81#undef FULL_IODETECT /* Only detect in portlist */ 77#undef FULL_IODETECT /* Only detect in portlist */
82 78
83#ifndef FULL_IODETECT 79#ifndef FULL_IODETECT
@@ -281,7 +277,7 @@ static int __init ni5010_probe1(struct net_device *dev, int ioaddr)
281 277
282 PRINTK2((KERN_DEBUG "%s: I/O #4 passed!\n", dev->name)); 278 PRINTK2((KERN_DEBUG "%s: I/O #4 passed!\n", dev->name));
283 279
284#ifdef jumpered_interrupts 280#ifdef JUMPERED_INTERRUPTS
285 if (dev->irq == 0xff) 281 if (dev->irq == 0xff)
286 ; 282 ;
287 else if (dev->irq < 2) { 283 else if (dev->irq < 2) {
@@ -305,7 +301,7 @@ static int __init ni5010_probe1(struct net_device *dev, int ioaddr)
305 } else if (dev->irq == 2) { 301 } else if (dev->irq == 2) {
306 dev->irq = 9; 302 dev->irq = 9;
307 } 303 }
308#endif /* jumpered_irq */ 304#endif /* JUMPERED_INTERRUPTS */
309 PRINTK2((KERN_DEBUG "%s: I/O #9 passed!\n", dev->name)); 305 PRINTK2((KERN_DEBUG "%s: I/O #9 passed!\n", dev->name));
310 306
311 /* DMA is not supported (yet?), so no use detecting it */ 307 /* DMA is not supported (yet?), so no use detecting it */
@@ -334,7 +330,7 @@ static int __init ni5010_probe1(struct net_device *dev, int ioaddr)
334 outw(0, IE_GP); /* Point GP at start of packet */ 330 outw(0, IE_GP); /* Point GP at start of packet */
335 outb(0, IE_RBUF); /* set buffer byte 0 to 0 again */ 331 outb(0, IE_RBUF); /* set buffer byte 0 to 0 again */
336 } 332 }
337 printk("// bufsize rcv/xmt=%d/%d\n", bufsize_rcv, NI5010_BUFSIZE); 333 printk("-> bufsize rcv/xmt=%d/%d\n", bufsize_rcv, NI5010_BUFSIZE);
338 memset(dev->priv, 0, sizeof(struct ni5010_local)); 334 memset(dev->priv, 0, sizeof(struct ni5010_local));
339 335
340 dev->open = ni5010_open; 336 dev->open = ni5010_open;
@@ -354,11 +350,9 @@ static int __init ni5010_probe1(struct net_device *dev, int ioaddr)
354 outb(0xff, EDLC_XCLR); /* Kill all pending xmt interrupts */ 350 outb(0xff, EDLC_XCLR); /* Kill all pending xmt interrupts */
355 351
356 printk(KERN_INFO "%s: NI5010 found at 0x%x, using IRQ %d", dev->name, ioaddr, dev->irq); 352 printk(KERN_INFO "%s: NI5010 found at 0x%x, using IRQ %d", dev->name, ioaddr, dev->irq);
357 if (dev->dma) printk(" & DMA %d", dev->dma); 353 if (dev->dma)
354 printk(" & DMA %d", dev->dma);
358 printk(".\n"); 355 printk(".\n");
359
360 printk(KERN_INFO "Join the NI5010 driver development team!\n");
361 printk(KERN_INFO "Mail to a.mohr@mailto.de or jvbest@wi.leidenuniv.nl\n");
362 return 0; 356 return 0;
363out: 357out:
364 release_region(dev->base_addr, NI5010_IO_EXTENT); 358 release_region(dev->base_addr, NI5010_IO_EXTENT);
@@ -371,7 +365,7 @@ out:
371 * 365 *
372 * This routine should set everything up anew at each open, even 366 * This routine should set everything up anew at each open, even
373 * registers that "should" only need to be set once at boot, so that 367 * registers that "should" only need to be set once at boot, so that
374 * there is non-reboot way to recover if something goes wrong. 368 * there is a non-reboot way to recover if something goes wrong.
375 */ 369 */
376 370
377static int ni5010_open(struct net_device *dev) 371static int ni5010_open(struct net_device *dev)
@@ -390,13 +384,13 @@ static int ni5010_open(struct net_device *dev)
390 * Always allocate the DMA channel after the IRQ, 384 * Always allocate the DMA channel after the IRQ,
391 * and clean up on failure. 385 * and clean up on failure.
392 */ 386 */
393#ifdef jumpered_dma 387#ifdef JUMPERED_DMA
394 if (request_dma(dev->dma, cardname)) { 388 if (request_dma(dev->dma, cardname)) {
395 printk(KERN_WARNING "%s: Cannot get dma %#2x\n", dev->name, dev->dma); 389 printk(KERN_WARNING "%s: Cannot get dma %#2x\n", dev->name, dev->dma);
396 free_irq(dev->irq, NULL); 390 free_irq(dev->irq, NULL);
397 return -EAGAIN; 391 return -EAGAIN;
398 } 392 }
399#endif /* jumpered_dma */ 393#endif /* JUMPERED_DMA */
400 394
401 PRINTK3((KERN_DEBUG "%s: passed open() #2\n", dev->name)); 395 PRINTK3((KERN_DEBUG "%s: passed open() #2\n", dev->name));
402 /* Reset the hardware here. Don't forget to set the station address. */ 396 /* Reset the hardware here. Don't forget to set the station address. */
@@ -633,7 +627,7 @@ static int ni5010_close(struct net_device *dev)
633 int ioaddr = dev->base_addr; 627 int ioaddr = dev->base_addr;
634 628
635 PRINTK2((KERN_DEBUG "%s: entering ni5010_close\n", dev->name)); 629 PRINTK2((KERN_DEBUG "%s: entering ni5010_close\n", dev->name));
636#ifdef jumpered_interrupts 630#ifdef JUMPERED_INTERRUPTS
637 free_irq(dev->irq, NULL); 631 free_irq(dev->irq, NULL);
638#endif 632#endif
639 /* Put card in held-RESET state */ 633 /* Put card in held-RESET state */
@@ -771,7 +765,7 @@ module_param(irq, int, 0);
771MODULE_PARM_DESC(io, "ni5010 I/O base address"); 765MODULE_PARM_DESC(io, "ni5010 I/O base address");
772MODULE_PARM_DESC(irq, "ni5010 IRQ number"); 766MODULE_PARM_DESC(irq, "ni5010 IRQ number");
773 767
774int init_module(void) 768static int __init ni5010_init_module(void)
775{ 769{
776 PRINTK2((KERN_DEBUG "%s: entering init_module\n", boardname)); 770 PRINTK2((KERN_DEBUG "%s: entering init_module\n", boardname));
777 /* 771 /*
@@ -792,13 +786,15 @@ int init_module(void)
792 return 0; 786 return 0;
793} 787}
794 788
795void cleanup_module(void) 789static void __exit ni5010_cleanup_module(void)
796{ 790{
797 PRINTK2((KERN_DEBUG "%s: entering cleanup_module\n", boardname)); 791 PRINTK2((KERN_DEBUG "%s: entering cleanup_module\n", boardname));
798 unregister_netdev(dev_ni5010); 792 unregister_netdev(dev_ni5010);
799 release_region(dev_ni5010->base_addr, NI5010_IO_EXTENT); 793 release_region(dev_ni5010->base_addr, NI5010_IO_EXTENT);
800 free_netdev(dev_ni5010); 794 free_netdev(dev_ni5010);
801} 795}
796module_init(ni5010_init_module);
797module_exit(ni5010_cleanup_module);
802#endif /* MODULE */ 798#endif /* MODULE */
803MODULE_LICENSE("GPL"); 799MODULE_LICENSE("GPL");
804 800
diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c
index 70429108c40d..0e76859c90a2 100644
--- a/drivers/net/ns83820.c
+++ b/drivers/net/ns83820.c
@@ -803,7 +803,7 @@ static int ns83820_setup_rx(struct net_device *ndev)
803 803
804 writel(dev->IMR_cache, dev->base + IMR); 804 writel(dev->IMR_cache, dev->base + IMR);
805 writel(1, dev->base + IER); 805 writel(1, dev->base + IER);
806 spin_unlock_irq(&dev->misc_lock); 806 spin_unlock(&dev->misc_lock);
807 807
808 kick_rx(ndev); 808 kick_rx(ndev);
809 809
@@ -1012,8 +1012,6 @@ static void do_tx_done(struct net_device *ndev)
1012 struct ns83820 *dev = PRIV(ndev); 1012 struct ns83820 *dev = PRIV(ndev);
1013 u32 cmdsts, tx_done_idx, *desc; 1013 u32 cmdsts, tx_done_idx, *desc;
1014 1014
1015 spin_lock_irq(&dev->tx_lock);
1016
1017 dprintk("do_tx_done(%p)\n", ndev); 1015 dprintk("do_tx_done(%p)\n", ndev);
1018 tx_done_idx = dev->tx_done_idx; 1016 tx_done_idx = dev->tx_done_idx;
1019 desc = dev->tx_descs + (tx_done_idx * DESC_SIZE); 1017 desc = dev->tx_descs + (tx_done_idx * DESC_SIZE);
@@ -1069,7 +1067,6 @@ static void do_tx_done(struct net_device *ndev)
1069 netif_start_queue(ndev); 1067 netif_start_queue(ndev);
1070 netif_wake_queue(ndev); 1068 netif_wake_queue(ndev);
1071 } 1069 }
1072 spin_unlock_irq(&dev->tx_lock);
1073} 1070}
1074 1071
1075static void ns83820_cleanup_tx(struct ns83820 *dev) 1072static void ns83820_cleanup_tx(struct ns83820 *dev)
@@ -1281,11 +1278,13 @@ static struct ethtool_ops ops = {
1281 .get_link = ns83820_get_link 1278 .get_link = ns83820_get_link
1282}; 1279};
1283 1280
1281/* this function is called in irq context from the ISR */
1284static void ns83820_mib_isr(struct ns83820 *dev) 1282static void ns83820_mib_isr(struct ns83820 *dev)
1285{ 1283{
1286 spin_lock(&dev->misc_lock); 1284 unsigned long flags;
1285 spin_lock_irqsave(&dev->misc_lock, flags);
1287 ns83820_update_stats(dev); 1286 ns83820_update_stats(dev);
1288 spin_unlock(&dev->misc_lock); 1287 spin_unlock_irqrestore(&dev->misc_lock, flags);
1289} 1288}
1290 1289
1291static void ns83820_do_isr(struct net_device *ndev, u32 isr); 1290static void ns83820_do_isr(struct net_device *ndev, u32 isr);
@@ -1307,6 +1306,8 @@ static irqreturn_t ns83820_irq(int foo, void *data, struct pt_regs *regs)
1307static void ns83820_do_isr(struct net_device *ndev, u32 isr) 1306static void ns83820_do_isr(struct net_device *ndev, u32 isr)
1308{ 1307{
1309 struct ns83820 *dev = PRIV(ndev); 1308 struct ns83820 *dev = PRIV(ndev);
1309 unsigned long flags;
1310
1310#ifdef DEBUG 1311#ifdef DEBUG
1311 if (isr & ~(ISR_PHY | ISR_RXDESC | ISR_RXEARLY | ISR_RXOK | ISR_RXERR | ISR_TXIDLE | ISR_TXOK | ISR_TXDESC)) 1312 if (isr & ~(ISR_PHY | ISR_RXDESC | ISR_RXEARLY | ISR_RXOK | ISR_RXERR | ISR_TXIDLE | ISR_TXOK | ISR_TXDESC))
1312 Dprintk("odd isr? 0x%08x\n", isr); 1313 Dprintk("odd isr? 0x%08x\n", isr);
@@ -1321,10 +1322,10 @@ static void ns83820_do_isr(struct net_device *ndev, u32 isr)
1321 if ((ISR_RXDESC | ISR_RXOK) & isr) { 1322 if ((ISR_RXDESC | ISR_RXOK) & isr) {
1322 prefetch(dev->rx_info.next_rx_desc); 1323 prefetch(dev->rx_info.next_rx_desc);
1323 1324
1324 spin_lock_irq(&dev->misc_lock); 1325 spin_lock_irqsave(&dev->misc_lock, flags);
1325 dev->IMR_cache &= ~(ISR_RXDESC | ISR_RXOK); 1326 dev->IMR_cache &= ~(ISR_RXDESC | ISR_RXOK);
1326 writel(dev->IMR_cache, dev->base + IMR); 1327 writel(dev->IMR_cache, dev->base + IMR);
1327 spin_unlock_irq(&dev->misc_lock); 1328 spin_unlock_irqrestore(&dev->misc_lock, flags);
1328 1329
1329 tasklet_schedule(&dev->rx_tasklet); 1330 tasklet_schedule(&dev->rx_tasklet);
1330 //rx_irq(ndev); 1331 //rx_irq(ndev);
@@ -1370,16 +1371,18 @@ static void ns83820_do_isr(struct net_device *ndev, u32 isr)
1370 * work has accumulated 1371 * work has accumulated
1371 */ 1372 */
1372 if ((ISR_TXDESC | ISR_TXIDLE | ISR_TXOK | ISR_TXERR) & isr) { 1373 if ((ISR_TXDESC | ISR_TXIDLE | ISR_TXOK | ISR_TXERR) & isr) {
1374 spin_lock_irqsave(&dev->tx_lock, flags);
1373 do_tx_done(ndev); 1375 do_tx_done(ndev);
1376 spin_unlock_irqrestore(&dev->tx_lock, flags);
1374 1377
1375 /* Disable TxOk if there are no outstanding tx packets. 1378 /* Disable TxOk if there are no outstanding tx packets.
1376 */ 1379 */
1377 if ((dev->tx_done_idx == dev->tx_free_idx) && 1380 if ((dev->tx_done_idx == dev->tx_free_idx) &&
1378 (dev->IMR_cache & ISR_TXOK)) { 1381 (dev->IMR_cache & ISR_TXOK)) {
1379 spin_lock_irq(&dev->misc_lock); 1382 spin_lock_irqsave(&dev->misc_lock, flags);
1380 dev->IMR_cache &= ~ISR_TXOK; 1383 dev->IMR_cache &= ~ISR_TXOK;
1381 writel(dev->IMR_cache, dev->base + IMR); 1384 writel(dev->IMR_cache, dev->base + IMR);
1382 spin_unlock_irq(&dev->misc_lock); 1385 spin_unlock_irqrestore(&dev->misc_lock, flags);
1383 } 1386 }
1384 } 1387 }
1385 1388
@@ -1390,10 +1393,10 @@ static void ns83820_do_isr(struct net_device *ndev, u32 isr)
1390 * nature are expected, we must enable TxOk. 1393 * nature are expected, we must enable TxOk.
1391 */ 1394 */
1392 if ((ISR_TXIDLE & isr) && (dev->tx_done_idx != dev->tx_free_idx)) { 1395 if ((ISR_TXIDLE & isr) && (dev->tx_done_idx != dev->tx_free_idx)) {
1393 spin_lock_irq(&dev->misc_lock); 1396 spin_lock_irqsave(&dev->misc_lock, flags);
1394 dev->IMR_cache |= ISR_TXOK; 1397 dev->IMR_cache |= ISR_TXOK;
1395 writel(dev->IMR_cache, dev->base + IMR); 1398 writel(dev->IMR_cache, dev->base + IMR);
1396 spin_unlock_irq(&dev->misc_lock); 1399 spin_unlock_irqrestore(&dev->misc_lock, flags);
1397 } 1400 }
1398 1401
1399 /* MIB interrupt: one of the statistics counters is about to overflow */ 1402 /* MIB interrupt: one of the statistics counters is about to overflow */
@@ -1455,7 +1458,7 @@ static void ns83820_tx_timeout(struct net_device *ndev)
1455 u32 tx_done_idx, *desc; 1458 u32 tx_done_idx, *desc;
1456 unsigned long flags; 1459 unsigned long flags;
1457 1460
1458 local_irq_save(flags); 1461 spin_lock_irqsave(&dev->tx_lock, flags);
1459 1462
1460 tx_done_idx = dev->tx_done_idx; 1463 tx_done_idx = dev->tx_done_idx;
1461 desc = dev->tx_descs + (tx_done_idx * DESC_SIZE); 1464 desc = dev->tx_descs + (tx_done_idx * DESC_SIZE);
@@ -1482,7 +1485,7 @@ static void ns83820_tx_timeout(struct net_device *ndev)
1482 ndev->name, 1485 ndev->name,
1483 tx_done_idx, dev->tx_free_idx, le32_to_cpu(desc[DESC_CMDSTS])); 1486 tx_done_idx, dev->tx_free_idx, le32_to_cpu(desc[DESC_CMDSTS]));
1484 1487
1485 local_irq_restore(flags); 1488 spin_unlock_irqrestore(&dev->tx_lock, flags);
1486} 1489}
1487 1490
1488static void ns83820_tx_watch(unsigned long data) 1491static void ns83820_tx_watch(unsigned long data)
@@ -1832,7 +1835,7 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
1832 } else if (!pci_set_dma_mask(pci_dev, DMA_32BIT_MASK)) { 1835 } else if (!pci_set_dma_mask(pci_dev, DMA_32BIT_MASK)) {
1833 using_dac = 0; 1836 using_dac = 0;
1834 } else { 1837 } else {
1835 printk(KERN_WARNING "ns83820.c: pci_set_dma_mask failed!\n"); 1838 dev_warn(&pci_dev->dev, "pci_set_dma_mask failed!\n");
1836 return -ENODEV; 1839 return -ENODEV;
1837 } 1840 }
1838 1841
@@ -1855,7 +1858,7 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
1855 1858
1856 err = pci_enable_device(pci_dev); 1859 err = pci_enable_device(pci_dev);
1857 if (err) { 1860 if (err) {
1858 printk(KERN_INFO "ns83820: pci_enable_dev failed: %d\n", err); 1861 dev_info(&pci_dev->dev, "pci_enable_dev failed: %d\n", err);
1859 goto out_free; 1862 goto out_free;
1860 } 1863 }
1861 1864
@@ -1884,8 +1887,8 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
1884 err = request_irq(pci_dev->irq, ns83820_irq, IRQF_SHARED, 1887 err = request_irq(pci_dev->irq, ns83820_irq, IRQF_SHARED,
1885 DRV_NAME, ndev); 1888 DRV_NAME, ndev);
1886 if (err) { 1889 if (err) {
1887 printk(KERN_INFO "ns83820: unable to register irq %d\n", 1890 dev_info(&pci_dev->dev, "unable to register irq %d, err %d\n",
1888 pci_dev->irq); 1891 pci_dev->irq, err);
1889 goto out_disable; 1892 goto out_disable;
1890 } 1893 }
1891 1894
@@ -1899,7 +1902,7 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
1899 rtnl_lock(); 1902 rtnl_lock();
1900 err = dev_alloc_name(ndev, ndev->name); 1903 err = dev_alloc_name(ndev, ndev->name);
1901 if (err < 0) { 1904 if (err < 0) {
1902 printk(KERN_INFO "ns83820: unable to get netdev name: %d\n", err); 1905 dev_info(&pci_dev->dev, "unable to get netdev name: %d\n", err);
1903 goto out_free_irq; 1906 goto out_free_irq;
1904 } 1907 }
1905 1908
diff --git a/drivers/net/pci-skeleton.c b/drivers/net/pci-skeleton.c
index 3388ee1313ea..e0e293964042 100644
--- a/drivers/net/pci-skeleton.c
+++ b/drivers/net/pci-skeleton.c
@@ -601,7 +601,7 @@ static int __devinit netdrv_init_board (struct pci_dev *pdev,
601 /* dev zeroed in alloc_etherdev */ 601 /* dev zeroed in alloc_etherdev */
602 dev = alloc_etherdev (sizeof (*tp)); 602 dev = alloc_etherdev (sizeof (*tp));
603 if (dev == NULL) { 603 if (dev == NULL) {
604 printk (KERN_ERR PFX "unable to alloc new ethernet\n"); 604 dev_err(&pdev->dev, "unable to alloc new ethernet\n");
605 DPRINTK ("EXIT, returning -ENOMEM\n"); 605 DPRINTK ("EXIT, returning -ENOMEM\n");
606 return -ENOMEM; 606 return -ENOMEM;
607 } 607 }
@@ -631,14 +631,14 @@ static int __devinit netdrv_init_board (struct pci_dev *pdev,
631 631
632 /* make sure PCI base addr 0 is PIO */ 632 /* make sure PCI base addr 0 is PIO */
633 if (!(pio_flags & IORESOURCE_IO)) { 633 if (!(pio_flags & IORESOURCE_IO)) {
634 printk (KERN_ERR PFX "region #0 not a PIO resource, aborting\n"); 634 dev_err(&pdev->dev, "region #0 not a PIO resource, aborting\n");
635 rc = -ENODEV; 635 rc = -ENODEV;
636 goto err_out; 636 goto err_out;
637 } 637 }
638 638
639 /* make sure PCI base addr 1 is MMIO */ 639 /* make sure PCI base addr 1 is MMIO */
640 if (!(mmio_flags & IORESOURCE_MEM)) { 640 if (!(mmio_flags & IORESOURCE_MEM)) {
641 printk (KERN_ERR PFX "region #1 not an MMIO resource, aborting\n"); 641 dev_err(&pdev->dev, "region #1 not an MMIO resource, aborting\n");
642 rc = -ENODEV; 642 rc = -ENODEV;
643 goto err_out; 643 goto err_out;
644 } 644 }
@@ -646,12 +646,12 @@ static int __devinit netdrv_init_board (struct pci_dev *pdev,
646 /* check for weird/broken PCI region reporting */ 646 /* check for weird/broken PCI region reporting */
647 if ((pio_len < NETDRV_MIN_IO_SIZE) || 647 if ((pio_len < NETDRV_MIN_IO_SIZE) ||
648 (mmio_len < NETDRV_MIN_IO_SIZE)) { 648 (mmio_len < NETDRV_MIN_IO_SIZE)) {
649 printk (KERN_ERR PFX "Invalid PCI region size(s), aborting\n"); 649 dev_err(&pdev->dev, "Invalid PCI region size(s), aborting\n");
650 rc = -ENODEV; 650 rc = -ENODEV;
651 goto err_out; 651 goto err_out;
652 } 652 }
653 653
654 rc = pci_request_regions (pdev, "pci-skeleton"); 654 rc = pci_request_regions (pdev, MODNAME);
655 if (rc) 655 if (rc)
656 goto err_out; 656 goto err_out;
657 657
@@ -663,7 +663,7 @@ static int __devinit netdrv_init_board (struct pci_dev *pdev,
663 /* ioremap MMIO region */ 663 /* ioremap MMIO region */
664 ioaddr = ioremap (mmio_start, mmio_len); 664 ioaddr = ioremap (mmio_start, mmio_len);
665 if (ioaddr == NULL) { 665 if (ioaddr == NULL) {
666 printk (KERN_ERR PFX "cannot remap MMIO, aborting\n"); 666 dev_err(&pdev->dev, "cannot remap MMIO, aborting\n");
667 rc = -EIO; 667 rc = -EIO;
668 goto err_out_free_res; 668 goto err_out_free_res;
669 } 669 }
@@ -699,9 +699,10 @@ static int __devinit netdrv_init_board (struct pci_dev *pdev,
699 } 699 }
700 700
701 /* if unknown chip, assume array element #0, original RTL-8139 in this case */ 701 /* if unknown chip, assume array element #0, original RTL-8139 in this case */
702 printk (KERN_DEBUG PFX "PCI device %s: unknown chip version, assuming RTL-8139\n", 702 dev_printk (KERN_DEBUG, &pdev->dev,
703 pci_name(pdev)); 703 "unknown chip version, assuming RTL-8139\n");
704 printk (KERN_DEBUG PFX "PCI device %s: TxConfig = 0x%lx\n", pci_name(pdev), NETDRV_R32 (TxConfig)); 704 dev_printk (KERN_DEBUG, &pdev->dev, "TxConfig = 0x%lx\n",
705 NETDRV_R32 (TxConfig));
705 tp->chipset = 0; 706 tp->chipset = 0;
706 707
707match: 708match:
diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c
index d768f3d1ac28..4daafe303358 100644
--- a/drivers/net/pcnet32.c
+++ b/drivers/net/pcnet32.c
@@ -58,18 +58,15 @@ static const char *const version =
58 * PCI device identifiers for "new style" Linux PCI Device Drivers 58 * PCI device identifiers for "new style" Linux PCI Device Drivers
59 */ 59 */
60static struct pci_device_id pcnet32_pci_tbl[] = { 60static struct pci_device_id pcnet32_pci_tbl[] = {
61 { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_LANCE_HOME, 61 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_LANCE_HOME), },
62 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 62 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_LANCE), },
63 { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_LANCE,
64 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
65 63
66 /* 64 /*
67 * Adapters that were sold with IBM's RS/6000 or pSeries hardware have 65 * Adapters that were sold with IBM's RS/6000 or pSeries hardware have
68 * the incorrect vendor id. 66 * the incorrect vendor id.
69 */ 67 */
70 { PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_AMD_LANCE, 68 { PCI_DEVICE(PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_AMD_LANCE),
71 PCI_ANY_ID, PCI_ANY_ID, 69 .class = (PCI_CLASS_NETWORK_ETHERNET << 8), .class_mask = 0xffff00, },
72 PCI_CLASS_NETWORK_ETHERNET << 8, 0xffff00, 0},
73 70
74 { } /* terminate list */ 71 { } /* terminate list */
75}; 72};
@@ -188,6 +185,23 @@ static int homepna[MAX_UNITS];
188 185
189#define PCNET32_TOTAL_SIZE 0x20 186#define PCNET32_TOTAL_SIZE 0x20
190 187
188#define CSR0 0
189#define CSR0_INIT 0x1
190#define CSR0_START 0x2
191#define CSR0_STOP 0x4
192#define CSR0_TXPOLL 0x8
193#define CSR0_INTEN 0x40
194#define CSR0_IDON 0x0100
195#define CSR0_NORMAL (CSR0_START | CSR0_INTEN)
196#define PCNET32_INIT_LOW 1
197#define PCNET32_INIT_HIGH 2
198#define CSR3 3
199#define CSR4 4
200#define CSR5 5
201#define CSR5_SUSPEND 0x0001
202#define CSR15 15
203#define PCNET32_MC_FILTER 8
204
191/* The PCNET32 Rx and Tx ring descriptors. */ 205/* The PCNET32 Rx and Tx ring descriptors. */
192struct pcnet32_rx_head { 206struct pcnet32_rx_head {
193 u32 base; 207 u32 base;
@@ -277,7 +291,6 @@ struct pcnet32_private {
277 u32 phymask; 291 u32 phymask;
278}; 292};
279 293
280static void pcnet32_probe_vlbus(void);
281static int pcnet32_probe_pci(struct pci_dev *, const struct pci_device_id *); 294static int pcnet32_probe_pci(struct pci_dev *, const struct pci_device_id *);
282static int pcnet32_probe1(unsigned long, int, struct pci_dev *); 295static int pcnet32_probe1(unsigned long, int, struct pci_dev *);
283static int pcnet32_open(struct net_device *); 296static int pcnet32_open(struct net_device *);
@@ -419,6 +432,238 @@ static struct pcnet32_access pcnet32_dwio = {
419 .reset = pcnet32_dwio_reset 432 .reset = pcnet32_dwio_reset
420}; 433};
421 434
435static void pcnet32_netif_stop(struct net_device *dev)
436{
437 dev->trans_start = jiffies;
438 netif_poll_disable(dev);
439 netif_tx_disable(dev);
440}
441
442static void pcnet32_netif_start(struct net_device *dev)
443{
444 netif_wake_queue(dev);
445 netif_poll_enable(dev);
446}
447
448/*
449 * Allocate space for the new sized tx ring.
450 * Free old resources
451 * Save new resources.
452 * Any failure keeps old resources.
453 * Must be called with lp->lock held.
454 */
455static void pcnet32_realloc_tx_ring(struct net_device *dev,
456 struct pcnet32_private *lp,
457 unsigned int size)
458{
459 dma_addr_t new_ring_dma_addr;
460 dma_addr_t *new_dma_addr_list;
461 struct pcnet32_tx_head *new_tx_ring;
462 struct sk_buff **new_skb_list;
463
464 pcnet32_purge_tx_ring(dev);
465
466 new_tx_ring = pci_alloc_consistent(lp->pci_dev,
467 sizeof(struct pcnet32_tx_head) *
468 (1 << size),
469 &new_ring_dma_addr);
470 if (new_tx_ring == NULL) {
471 if (netif_msg_drv(lp))
472 printk("\n" KERN_ERR
473 "%s: Consistent memory allocation failed.\n",
474 dev->name);
475 return;
476 }
477 memset(new_tx_ring, 0, sizeof(struct pcnet32_tx_head) * (1 << size));
478
479 new_dma_addr_list = kcalloc((1 << size), sizeof(dma_addr_t),
480 GFP_ATOMIC);
481 if (!new_dma_addr_list) {
482 if (netif_msg_drv(lp))
483 printk("\n" KERN_ERR
484 "%s: Memory allocation failed.\n", dev->name);
485 goto free_new_tx_ring;
486 }
487
488 new_skb_list = kcalloc((1 << size), sizeof(struct sk_buff *),
489 GFP_ATOMIC);
490 if (!new_skb_list) {
491 if (netif_msg_drv(lp))
492 printk("\n" KERN_ERR
493 "%s: Memory allocation failed.\n", dev->name);
494 goto free_new_lists;
495 }
496
497 kfree(lp->tx_skbuff);
498 kfree(lp->tx_dma_addr);
499 pci_free_consistent(lp->pci_dev,
500 sizeof(struct pcnet32_tx_head) *
501 lp->tx_ring_size, lp->tx_ring,
502 lp->tx_ring_dma_addr);
503
504 lp->tx_ring_size = (1 << size);
505 lp->tx_mod_mask = lp->tx_ring_size - 1;
506 lp->tx_len_bits = (size << 12);
507 lp->tx_ring = new_tx_ring;
508 lp->tx_ring_dma_addr = new_ring_dma_addr;
509 lp->tx_dma_addr = new_dma_addr_list;
510 lp->tx_skbuff = new_skb_list;
511 return;
512
513 free_new_lists:
514 kfree(new_dma_addr_list);
515 free_new_tx_ring:
516 pci_free_consistent(lp->pci_dev,
517 sizeof(struct pcnet32_tx_head) *
518 (1 << size),
519 new_tx_ring,
520 new_ring_dma_addr);
521 return;
522}
523
524/*
525 * Allocate space for the new sized rx ring.
526 * Re-use old receive buffers.
527 * alloc extra buffers
528 * free unneeded buffers
529 * free unneeded buffers
530 * Save new resources.
531 * Any failure keeps old resources.
532 * Must be called with lp->lock held.
533 */
534static void pcnet32_realloc_rx_ring(struct net_device *dev,
535 struct pcnet32_private *lp,
536 unsigned int size)
537{
538 dma_addr_t new_ring_dma_addr;
539 dma_addr_t *new_dma_addr_list;
540 struct pcnet32_rx_head *new_rx_ring;
541 struct sk_buff **new_skb_list;
542 int new, overlap;
543
544 new_rx_ring = pci_alloc_consistent(lp->pci_dev,
545 sizeof(struct pcnet32_rx_head) *
546 (1 << size),
547 &new_ring_dma_addr);
548 if (new_rx_ring == NULL) {
549 if (netif_msg_drv(lp))
550 printk("\n" KERN_ERR
551 "%s: Consistent memory allocation failed.\n",
552 dev->name);
553 return;
554 }
555 memset(new_rx_ring, 0, sizeof(struct pcnet32_rx_head) * (1 << size));
556
557 new_dma_addr_list = kcalloc((1 << size), sizeof(dma_addr_t),
558 GFP_ATOMIC);
559 if (!new_dma_addr_list) {
560 if (netif_msg_drv(lp))
561 printk("\n" KERN_ERR
562 "%s: Memory allocation failed.\n", dev->name);
563 goto free_new_rx_ring;
564 }
565
566 new_skb_list = kcalloc((1 << size), sizeof(struct sk_buff *),
567 GFP_ATOMIC);
568 if (!new_skb_list) {
569 if (netif_msg_drv(lp))
570 printk("\n" KERN_ERR
571 "%s: Memory allocation failed.\n", dev->name);
572 goto free_new_lists;
573 }
574
575 /* first copy the current receive buffers */
576 overlap = min(size, lp->rx_ring_size);
577 for (new = 0; new < overlap; new++) {
578 new_rx_ring[new] = lp->rx_ring[new];
579 new_dma_addr_list[new] = lp->rx_dma_addr[new];
580 new_skb_list[new] = lp->rx_skbuff[new];
581 }
582 /* now allocate any new buffers needed */
583 for (; new < size; new++ ) {
584 struct sk_buff *rx_skbuff;
585 new_skb_list[new] = dev_alloc_skb(PKT_BUF_SZ);
586 if (!(rx_skbuff = new_skb_list[new])) {
587 /* keep the original lists and buffers */
588 if (netif_msg_drv(lp))
589 printk(KERN_ERR
590 "%s: pcnet32_realloc_rx_ring dev_alloc_skb failed.\n",
591 dev->name);
592 goto free_all_new;
593 }
594 skb_reserve(rx_skbuff, 2);
595
596 new_dma_addr_list[new] =
597 pci_map_single(lp->pci_dev, rx_skbuff->data,
598 PKT_BUF_SZ - 2, PCI_DMA_FROMDEVICE);
599 new_rx_ring[new].base = (u32) le32_to_cpu(new_dma_addr_list[new]);
600 new_rx_ring[new].buf_length = le16_to_cpu(2 - PKT_BUF_SZ);
601 new_rx_ring[new].status = le16_to_cpu(0x8000);
602 }
603 /* and free any unneeded buffers */
604 for (; new < lp->rx_ring_size; new++) {
605 if (lp->rx_skbuff[new]) {
606 pci_unmap_single(lp->pci_dev, lp->rx_dma_addr[new],
607 PKT_BUF_SZ - 2, PCI_DMA_FROMDEVICE);
608 dev_kfree_skb(lp->rx_skbuff[new]);
609 }
610 }
611
612 kfree(lp->rx_skbuff);
613 kfree(lp->rx_dma_addr);
614 pci_free_consistent(lp->pci_dev,
615 sizeof(struct pcnet32_rx_head) *
616 lp->rx_ring_size, lp->rx_ring,
617 lp->rx_ring_dma_addr);
618
619 lp->rx_ring_size = (1 << size);
620 lp->rx_mod_mask = lp->rx_ring_size - 1;
621 lp->rx_len_bits = (size << 4);
622 lp->rx_ring = new_rx_ring;
623 lp->rx_ring_dma_addr = new_ring_dma_addr;
624 lp->rx_dma_addr = new_dma_addr_list;
625 lp->rx_skbuff = new_skb_list;
626 return;
627
628 free_all_new:
629 for (; --new >= lp->rx_ring_size; ) {
630 if (new_skb_list[new]) {
631 pci_unmap_single(lp->pci_dev, new_dma_addr_list[new],
632 PKT_BUF_SZ - 2, PCI_DMA_FROMDEVICE);
633 dev_kfree_skb(new_skb_list[new]);
634 }
635 }
636 kfree(new_skb_list);
637 free_new_lists:
638 kfree(new_dma_addr_list);
639 free_new_rx_ring:
640 pci_free_consistent(lp->pci_dev,
641 sizeof(struct pcnet32_rx_head) *
642 (1 << size),
643 new_rx_ring,
644 new_ring_dma_addr);
645 return;
646}
647
648static void pcnet32_purge_rx_ring(struct net_device *dev)
649{
650 struct pcnet32_private *lp = dev->priv;
651 int i;
652
653 /* free all allocated skbuffs */
654 for (i = 0; i < lp->rx_ring_size; i++) {
655 lp->rx_ring[i].status = 0; /* CPU owns buffer */
656 wmb(); /* Make sure adapter sees owner change */
657 if (lp->rx_skbuff[i]) {
658 pci_unmap_single(lp->pci_dev, lp->rx_dma_addr[i],
659 PKT_BUF_SZ - 2, PCI_DMA_FROMDEVICE);
660 dev_kfree_skb_any(lp->rx_skbuff[i]);
661 }
662 lp->rx_skbuff[i] = NULL;
663 lp->rx_dma_addr[i] = 0;
664 }
665}
666
422#ifdef CONFIG_NET_POLL_CONTROLLER 667#ifdef CONFIG_NET_POLL_CONTROLLER
423static void pcnet32_poll_controller(struct net_device *dev) 668static void pcnet32_poll_controller(struct net_device *dev)
424{ 669{
@@ -519,10 +764,10 @@ static void pcnet32_get_ringparam(struct net_device *dev,
519{ 764{
520 struct pcnet32_private *lp = dev->priv; 765 struct pcnet32_private *lp = dev->priv;
521 766
522 ering->tx_max_pending = TX_MAX_RING_SIZE - 1; 767 ering->tx_max_pending = TX_MAX_RING_SIZE;
523 ering->tx_pending = lp->tx_ring_size - 1; 768 ering->tx_pending = lp->tx_ring_size;
524 ering->rx_max_pending = RX_MAX_RING_SIZE - 1; 769 ering->rx_max_pending = RX_MAX_RING_SIZE;
525 ering->rx_pending = lp->rx_ring_size - 1; 770 ering->rx_pending = lp->rx_ring_size;
526} 771}
527 772
528static int pcnet32_set_ringparam(struct net_device *dev, 773static int pcnet32_set_ringparam(struct net_device *dev,
@@ -530,56 +775,53 @@ static int pcnet32_set_ringparam(struct net_device *dev,
530{ 775{
531 struct pcnet32_private *lp = dev->priv; 776 struct pcnet32_private *lp = dev->priv;
532 unsigned long flags; 777 unsigned long flags;
778 unsigned int size;
779 ulong ioaddr = dev->base_addr;
533 int i; 780 int i;
534 781
535 if (ering->rx_mini_pending || ering->rx_jumbo_pending) 782 if (ering->rx_mini_pending || ering->rx_jumbo_pending)
536 return -EINVAL; 783 return -EINVAL;
537 784
538 if (netif_running(dev)) 785 if (netif_running(dev))
539 pcnet32_close(dev); 786 pcnet32_netif_stop(dev);
540 787
541 spin_lock_irqsave(&lp->lock, flags); 788 spin_lock_irqsave(&lp->lock, flags);
542 pcnet32_free_ring(dev); 789 lp->a.write_csr(ioaddr, CSR0, CSR0_STOP); /* stop the chip */
543 lp->tx_ring_size = 790
544 min(ering->tx_pending, (unsigned int)TX_MAX_RING_SIZE); 791 size = min(ering->tx_pending, (unsigned int)TX_MAX_RING_SIZE);
545 lp->rx_ring_size =
546 min(ering->rx_pending, (unsigned int)RX_MAX_RING_SIZE);
547 792
548 /* set the minimum ring size to 4, to allow the loopback test to work 793 /* set the minimum ring size to 4, to allow the loopback test to work
549 * unchanged. 794 * unchanged.
550 */ 795 */
551 for (i = 2; i <= PCNET32_LOG_MAX_TX_BUFFERS; i++) { 796 for (i = 2; i <= PCNET32_LOG_MAX_TX_BUFFERS; i++) {
552 if (lp->tx_ring_size <= (1 << i)) 797 if (size <= (1 << i))
553 break; 798 break;
554 } 799 }
555 lp->tx_ring_size = (1 << i); 800 if ((1 << i) != lp->tx_ring_size)
556 lp->tx_mod_mask = lp->tx_ring_size - 1; 801 pcnet32_realloc_tx_ring(dev, lp, i);
557 lp->tx_len_bits = (i << 12); 802
558 803 size = min(ering->rx_pending, (unsigned int)RX_MAX_RING_SIZE);
559 for (i = 2; i <= PCNET32_LOG_MAX_RX_BUFFERS; i++) { 804 for (i = 2; i <= PCNET32_LOG_MAX_RX_BUFFERS; i++) {
560 if (lp->rx_ring_size <= (1 << i)) 805 if (size <= (1 << i))
561 break; 806 break;
562 } 807 }
563 lp->rx_ring_size = (1 << i); 808 if ((1 << i) != lp->rx_ring_size)
564 lp->rx_mod_mask = lp->rx_ring_size - 1; 809 pcnet32_realloc_rx_ring(dev, lp, i);
565 lp->rx_len_bits = (i << 4); 810
811 dev->weight = lp->rx_ring_size / 2;
566 812
567 if (pcnet32_alloc_ring(dev, dev->name)) { 813 if (netif_running(dev)) {
568 pcnet32_free_ring(dev); 814 pcnet32_netif_start(dev);
569 spin_unlock_irqrestore(&lp->lock, flags); 815 pcnet32_restart(dev, CSR0_NORMAL);
570 return -ENOMEM;
571 } 816 }
572 817
573 spin_unlock_irqrestore(&lp->lock, flags); 818 spin_unlock_irqrestore(&lp->lock, flags);
574 819
575 if (pcnet32_debug & NETIF_MSG_DRV) 820 if (netif_msg_drv(lp))
576 printk(KERN_INFO PFX 821 printk(KERN_INFO
577 "%s: Ring Param Settings: RX: %d, TX: %d\n", dev->name, 822 "%s: Ring Param Settings: RX: %d, TX: %d\n", dev->name,
578 lp->rx_ring_size, lp->tx_ring_size); 823 lp->rx_ring_size, lp->tx_ring_size);
579 824
580 if (netif_running(dev))
581 pcnet32_open(dev);
582
583 return 0; 825 return 0;
584} 826}
585 827
@@ -633,29 +875,27 @@ static int pcnet32_loopback_test(struct net_device *dev, uint64_t * data1)
633 unsigned long flags; 875 unsigned long flags;
634 unsigned long ticks; 876 unsigned long ticks;
635 877
636 *data1 = 1; /* status of test, default to fail */
637 rc = 1; /* default to fail */ 878 rc = 1; /* default to fail */
638 879
639 if (netif_running(dev)) 880 if (netif_running(dev))
640 pcnet32_close(dev); 881 pcnet32_close(dev);
641 882
642 spin_lock_irqsave(&lp->lock, flags); 883 spin_lock_irqsave(&lp->lock, flags);
884 lp->a.write_csr(ioaddr, CSR0, CSR0_STOP); /* stop the chip */
885
886 numbuffs = min(numbuffs, (int)min(lp->rx_ring_size, lp->tx_ring_size));
643 887
644 /* Reset the PCNET32 */ 888 /* Reset the PCNET32 */
645 lp->a.reset(ioaddr); 889 lp->a.reset(ioaddr);
890 lp->a.write_csr(ioaddr, CSR4, 0x0915);
646 891
647 /* switch pcnet32 to 32bit mode */ 892 /* switch pcnet32 to 32bit mode */
648 lp->a.write_bcr(ioaddr, 20, 2); 893 lp->a.write_bcr(ioaddr, 20, 2);
649 894
650 lp->init_block.mode =
651 le16_to_cpu((lp->options & PCNET32_PORT_PORTSEL) << 7);
652 lp->init_block.filter[0] = 0;
653 lp->init_block.filter[1] = 0;
654
655 /* purge & init rings but don't actually restart */ 895 /* purge & init rings but don't actually restart */
656 pcnet32_restart(dev, 0x0000); 896 pcnet32_restart(dev, 0x0000);
657 897
658 lp->a.write_csr(ioaddr, 0, 0x0004); /* Set STOP bit */ 898 lp->a.write_csr(ioaddr, CSR0, CSR0_STOP); /* Set STOP bit */
659 899
660 /* Initialize Transmit buffers. */ 900 /* Initialize Transmit buffers. */
661 size = data_len + 15; 901 size = data_len + 15;
@@ -697,14 +937,15 @@ static int pcnet32_loopback_test(struct net_device *dev, uint64_t * data1)
697 } 937 }
698 } 938 }
699 939
700 x = a->read_bcr(ioaddr, 32); /* set internal loopback in BSR32 */ 940 x = a->read_bcr(ioaddr, 32); /* set internal loopback in BCR32 */
701 x = x | 0x0002; 941 a->write_bcr(ioaddr, 32, x | 0x0002);
702 a->write_bcr(ioaddr, 32, x);
703 942
704 lp->a.write_csr(ioaddr, 15, 0x0044); /* set int loopback in CSR15 */ 943 /* set int loopback in CSR15 */
944 x = a->read_csr(ioaddr, CSR15) & 0xfffc;
945 lp->a.write_csr(ioaddr, CSR15, x | 0x0044);
705 946
706 teststatus = le16_to_cpu(0x8000); 947 teststatus = le16_to_cpu(0x8000);
707 lp->a.write_csr(ioaddr, 0, 0x0002); /* Set STRT bit */ 948 lp->a.write_csr(ioaddr, CSR0, CSR0_START); /* Set STRT bit */
708 949
709 /* Check status of descriptors */ 950 /* Check status of descriptors */
710 for (x = 0; x < numbuffs; x++) { 951 for (x = 0; x < numbuffs; x++) {
@@ -712,7 +953,7 @@ static int pcnet32_loopback_test(struct net_device *dev, uint64_t * data1)
712 rmb(); 953 rmb();
713 while ((lp->rx_ring[x].status & teststatus) && (ticks < 200)) { 954 while ((lp->rx_ring[x].status & teststatus) && (ticks < 200)) {
714 spin_unlock_irqrestore(&lp->lock, flags); 955 spin_unlock_irqrestore(&lp->lock, flags);
715 mdelay(1); 956 msleep(1);
716 spin_lock_irqsave(&lp->lock, flags); 957 spin_lock_irqsave(&lp->lock, flags);
717 rmb(); 958 rmb();
718 ticks++; 959 ticks++;
@@ -725,7 +966,7 @@ static int pcnet32_loopback_test(struct net_device *dev, uint64_t * data1)
725 } 966 }
726 } 967 }
727 968
728 lp->a.write_csr(ioaddr, 0, 0x0004); /* Set STOP bit */ 969 lp->a.write_csr(ioaddr, CSR0, CSR0_STOP); /* Set STOP bit */
729 wmb(); 970 wmb();
730 if (netif_msg_hw(lp) && netif_msg_pktdata(lp)) { 971 if (netif_msg_hw(lp) && netif_msg_pktdata(lp)) {
731 printk(KERN_DEBUG "%s: RX loopback packets:\n", dev->name); 972 printk(KERN_DEBUG "%s: RX loopback packets:\n", dev->name);
@@ -758,25 +999,24 @@ static int pcnet32_loopback_test(struct net_device *dev, uint64_t * data1)
758 } 999 }
759 x++; 1000 x++;
760 } 1001 }
761 if (!rc) {
762 *data1 = 0;
763 }
764 1002
765 clean_up: 1003 clean_up:
1004 *data1 = rc;
766 pcnet32_purge_tx_ring(dev); 1005 pcnet32_purge_tx_ring(dev);
767 x = a->read_csr(ioaddr, 15) & 0xFFFF;
768 a->write_csr(ioaddr, 15, (x & ~0x0044)); /* reset bits 6 and 2 */
769 1006
770 x = a->read_bcr(ioaddr, 32); /* reset internal loopback */ 1007 x = a->read_csr(ioaddr, CSR15);
771 x = x & ~0x0002; 1008 a->write_csr(ioaddr, CSR15, (x & ~0x0044)); /* reset bits 6 and 2 */
772 a->write_bcr(ioaddr, 32, x);
773 1009
774 spin_unlock_irqrestore(&lp->lock, flags); 1010 x = a->read_bcr(ioaddr, 32); /* reset internal loopback */
1011 a->write_bcr(ioaddr, 32, (x & ~0x0002));
775 1012
776 if (netif_running(dev)) { 1013 if (netif_running(dev)) {
1014 spin_unlock_irqrestore(&lp->lock, flags);
777 pcnet32_open(dev); 1015 pcnet32_open(dev);
778 } else { 1016 } else {
1017 pcnet32_purge_rx_ring(dev);
779 lp->a.write_bcr(ioaddr, 20, 4); /* return to 16bit mode */ 1018 lp->a.write_bcr(ioaddr, 20, 4); /* return to 16bit mode */
1019 spin_unlock_irqrestore(&lp->lock, flags);
780 } 1020 }
781 1021
782 return (rc); 1022 return (rc);
@@ -839,6 +1079,43 @@ static int pcnet32_phys_id(struct net_device *dev, u32 data)
839 return 0; 1079 return 0;
840} 1080}
841 1081
1082/*
1083 * lp->lock must be held.
1084 */
1085static int pcnet32_suspend(struct net_device *dev, unsigned long *flags,
1086 int can_sleep)
1087{
1088 int csr5;
1089 struct pcnet32_private *lp = dev->priv;
1090 struct pcnet32_access *a = &lp->a;
1091 ulong ioaddr = dev->base_addr;
1092 int ticks;
1093
1094 /* set SUSPEND (SPND) - CSR5 bit 0 */
1095 csr5 = a->read_csr(ioaddr, CSR5);
1096 a->write_csr(ioaddr, CSR5, csr5 | CSR5_SUSPEND);
1097
1098 /* poll waiting for bit to be set */
1099 ticks = 0;
1100 while (!(a->read_csr(ioaddr, CSR5) & CSR5_SUSPEND)) {
1101 spin_unlock_irqrestore(&lp->lock, *flags);
1102 if (can_sleep)
1103 msleep(1);
1104 else
1105 mdelay(1);
1106 spin_lock_irqsave(&lp->lock, *flags);
1107 ticks++;
1108 if (ticks > 200) {
1109 if (netif_msg_hw(lp))
1110 printk(KERN_DEBUG
1111 "%s: Error getting into suspend!\n",
1112 dev->name);
1113 return 0;
1114 }
1115 }
1116 return 1;
1117}
1118
842#define PCNET32_REGS_PER_PHY 32 1119#define PCNET32_REGS_PER_PHY 32
843#define PCNET32_MAX_PHYS 32 1120#define PCNET32_MAX_PHYS 32
844static int pcnet32_get_regs_len(struct net_device *dev) 1121static int pcnet32_get_regs_len(struct net_device *dev)
@@ -857,32 +1134,13 @@ static void pcnet32_get_regs(struct net_device *dev, struct ethtool_regs *regs,
857 struct pcnet32_private *lp = dev->priv; 1134 struct pcnet32_private *lp = dev->priv;
858 struct pcnet32_access *a = &lp->a; 1135 struct pcnet32_access *a = &lp->a;
859 ulong ioaddr = dev->base_addr; 1136 ulong ioaddr = dev->base_addr;
860 int ticks;
861 unsigned long flags; 1137 unsigned long flags;
862 1138
863 spin_lock_irqsave(&lp->lock, flags); 1139 spin_lock_irqsave(&lp->lock, flags);
864 1140
865 csr0 = a->read_csr(ioaddr, 0); 1141 csr0 = a->read_csr(ioaddr, CSR0);
866 if (!(csr0 & 0x0004)) { /* If not stopped */ 1142 if (!(csr0 & CSR0_STOP)) /* If not stopped */
867 /* set SUSPEND (SPND) - CSR5 bit 0 */ 1143 pcnet32_suspend(dev, &flags, 1);
868 a->write_csr(ioaddr, 5, 0x0001);
869
870 /* poll waiting for bit to be set */
871 ticks = 0;
872 while (!(a->read_csr(ioaddr, 5) & 0x0001)) {
873 spin_unlock_irqrestore(&lp->lock, flags);
874 mdelay(1);
875 spin_lock_irqsave(&lp->lock, flags);
876 ticks++;
877 if (ticks > 200) {
878 if (netif_msg_hw(lp))
879 printk(KERN_DEBUG
880 "%s: Error getting into suspend!\n",
881 dev->name);
882 break;
883 }
884 }
885 }
886 1144
887 /* read address PROM */ 1145 /* read address PROM */
888 for (i = 0; i < 16; i += 2) 1146 for (i = 0; i < 16; i += 2)
@@ -919,9 +1177,12 @@ static void pcnet32_get_regs(struct net_device *dev, struct ethtool_regs *regs,
919 } 1177 }
920 } 1178 }
921 1179
922 if (!(csr0 & 0x0004)) { /* If not stopped */ 1180 if (!(csr0 & CSR0_STOP)) { /* If not stopped */
1181 int csr5;
1182
923 /* clear SUSPEND (SPND) - CSR5 bit 0 */ 1183 /* clear SUSPEND (SPND) - CSR5 bit 0 */
924 a->write_csr(ioaddr, 5, 0x0000); 1184 csr5 = a->read_csr(ioaddr, CSR5);
1185 a->write_csr(ioaddr, CSR5, csr5 & (~CSR5_SUSPEND));
925 } 1186 }
926 1187
927 spin_unlock_irqrestore(&lp->lock, flags); 1188 spin_unlock_irqrestore(&lp->lock, flags);
@@ -952,7 +1213,7 @@ static struct ethtool_ops pcnet32_ethtool_ops = {
952/* only probes for non-PCI devices, the rest are handled by 1213/* only probes for non-PCI devices, the rest are handled by
953 * pci_register_driver via pcnet32_probe_pci */ 1214 * pci_register_driver via pcnet32_probe_pci */
954 1215
955static void __devinit pcnet32_probe_vlbus(void) 1216static void __devinit pcnet32_probe_vlbus(unsigned int *pcnet32_portlist)
956{ 1217{
957 unsigned int *port, ioaddr; 1218 unsigned int *port, ioaddr;
958 1219
@@ -1436,7 +1697,7 @@ static int pcnet32_alloc_ring(struct net_device *dev, char *name)
1436 lp->tx_ring_size, 1697 lp->tx_ring_size,
1437 &lp->tx_ring_dma_addr); 1698 &lp->tx_ring_dma_addr);
1438 if (lp->tx_ring == NULL) { 1699 if (lp->tx_ring == NULL) {
1439 if (pcnet32_debug & NETIF_MSG_DRV) 1700 if (netif_msg_drv(lp))
1440 printk("\n" KERN_ERR PFX 1701 printk("\n" KERN_ERR PFX
1441 "%s: Consistent memory allocation failed.\n", 1702 "%s: Consistent memory allocation failed.\n",
1442 name); 1703 name);
@@ -1448,52 +1709,48 @@ static int pcnet32_alloc_ring(struct net_device *dev, char *name)
1448 lp->rx_ring_size, 1709 lp->rx_ring_size,
1449 &lp->rx_ring_dma_addr); 1710 &lp->rx_ring_dma_addr);
1450 if (lp->rx_ring == NULL) { 1711 if (lp->rx_ring == NULL) {
1451 if (pcnet32_debug & NETIF_MSG_DRV) 1712 if (netif_msg_drv(lp))
1452 printk("\n" KERN_ERR PFX 1713 printk("\n" KERN_ERR PFX
1453 "%s: Consistent memory allocation failed.\n", 1714 "%s: Consistent memory allocation failed.\n",
1454 name); 1715 name);
1455 return -ENOMEM; 1716 return -ENOMEM;
1456 } 1717 }
1457 1718
1458 lp->tx_dma_addr = kmalloc(sizeof(dma_addr_t) * lp->tx_ring_size, 1719 lp->tx_dma_addr = kcalloc(lp->tx_ring_size, sizeof(dma_addr_t),
1459 GFP_ATOMIC); 1720 GFP_ATOMIC);
1460 if (!lp->tx_dma_addr) { 1721 if (!lp->tx_dma_addr) {
1461 if (pcnet32_debug & NETIF_MSG_DRV) 1722 if (netif_msg_drv(lp))
1462 printk("\n" KERN_ERR PFX 1723 printk("\n" KERN_ERR PFX
1463 "%s: Memory allocation failed.\n", name); 1724 "%s: Memory allocation failed.\n", name);
1464 return -ENOMEM; 1725 return -ENOMEM;
1465 } 1726 }
1466 memset(lp->tx_dma_addr, 0, sizeof(dma_addr_t) * lp->tx_ring_size);
1467 1727
1468 lp->rx_dma_addr = kmalloc(sizeof(dma_addr_t) * lp->rx_ring_size, 1728 lp->rx_dma_addr = kcalloc(lp->rx_ring_size, sizeof(dma_addr_t),
1469 GFP_ATOMIC); 1729 GFP_ATOMIC);
1470 if (!lp->rx_dma_addr) { 1730 if (!lp->rx_dma_addr) {
1471 if (pcnet32_debug & NETIF_MSG_DRV) 1731 if (netif_msg_drv(lp))
1472 printk("\n" KERN_ERR PFX 1732 printk("\n" KERN_ERR PFX
1473 "%s: Memory allocation failed.\n", name); 1733 "%s: Memory allocation failed.\n", name);
1474 return -ENOMEM; 1734 return -ENOMEM;
1475 } 1735 }
1476 memset(lp->rx_dma_addr, 0, sizeof(dma_addr_t) * lp->rx_ring_size);
1477 1736
1478 lp->tx_skbuff = kmalloc(sizeof(struct sk_buff *) * lp->tx_ring_size, 1737 lp->tx_skbuff = kcalloc(lp->tx_ring_size, sizeof(struct sk_buff *),
1479 GFP_ATOMIC); 1738 GFP_ATOMIC);
1480 if (!lp->tx_skbuff) { 1739 if (!lp->tx_skbuff) {
1481 if (pcnet32_debug & NETIF_MSG_DRV) 1740 if (netif_msg_drv(lp))
1482 printk("\n" KERN_ERR PFX 1741 printk("\n" KERN_ERR PFX
1483 "%s: Memory allocation failed.\n", name); 1742 "%s: Memory allocation failed.\n", name);
1484 return -ENOMEM; 1743 return -ENOMEM;
1485 } 1744 }
1486 memset(lp->tx_skbuff, 0, sizeof(struct sk_buff *) * lp->tx_ring_size);
1487 1745
1488 lp->rx_skbuff = kmalloc(sizeof(struct sk_buff *) * lp->rx_ring_size, 1746 lp->rx_skbuff = kcalloc(lp->rx_ring_size, sizeof(struct sk_buff *),
1489 GFP_ATOMIC); 1747 GFP_ATOMIC);
1490 if (!lp->rx_skbuff) { 1748 if (!lp->rx_skbuff) {
1491 if (pcnet32_debug & NETIF_MSG_DRV) 1749 if (netif_msg_drv(lp))
1492 printk("\n" KERN_ERR PFX 1750 printk("\n" KERN_ERR PFX
1493 "%s: Memory allocation failed.\n", name); 1751 "%s: Memory allocation failed.\n", name);
1494 return -ENOMEM; 1752 return -ENOMEM;
1495 } 1753 }
1496 memset(lp->rx_skbuff, 0, sizeof(struct sk_buff *) * lp->rx_ring_size);
1497 1754
1498 return 0; 1755 return 0;
1499} 1756}
@@ -1757,16 +2014,7 @@ static int pcnet32_open(struct net_device *dev)
1757 2014
1758 err_free_ring: 2015 err_free_ring:
1759 /* free any allocated skbuffs */ 2016 /* free any allocated skbuffs */
1760 for (i = 0; i < lp->rx_ring_size; i++) { 2017 pcnet32_purge_rx_ring(dev);
1761 lp->rx_ring[i].status = 0;
1762 if (lp->rx_skbuff[i]) {
1763 pci_unmap_single(lp->pci_dev, lp->rx_dma_addr[i],
1764 PKT_BUF_SZ - 2, PCI_DMA_FROMDEVICE);
1765 dev_kfree_skb(lp->rx_skbuff[i]);
1766 }
1767 lp->rx_skbuff[i] = NULL;
1768 lp->rx_dma_addr[i] = 0;
1769 }
1770 2018
1771 /* 2019 /*
1772 * Switch back to 16bit mode to avoid problems with dumb 2020 * Switch back to 16bit mode to avoid problems with dumb
@@ -2348,7 +2596,6 @@ static int pcnet32_close(struct net_device *dev)
2348{ 2596{
2349 unsigned long ioaddr = dev->base_addr; 2597 unsigned long ioaddr = dev->base_addr;
2350 struct pcnet32_private *lp = dev->priv; 2598 struct pcnet32_private *lp = dev->priv;
2351 int i;
2352 unsigned long flags; 2599 unsigned long flags;
2353 2600
2354 del_timer_sync(&lp->watchdog_timer); 2601 del_timer_sync(&lp->watchdog_timer);
@@ -2379,31 +2626,8 @@ static int pcnet32_close(struct net_device *dev)
2379 2626
2380 spin_lock_irqsave(&lp->lock, flags); 2627 spin_lock_irqsave(&lp->lock, flags);
2381 2628
2382 /* free all allocated skbuffs */ 2629 pcnet32_purge_rx_ring(dev);
2383 for (i = 0; i < lp->rx_ring_size; i++) { 2630 pcnet32_purge_tx_ring(dev);
2384 lp->rx_ring[i].status = 0;
2385 wmb(); /* Make sure adapter sees owner change */
2386 if (lp->rx_skbuff[i]) {
2387 pci_unmap_single(lp->pci_dev, lp->rx_dma_addr[i],
2388 PKT_BUF_SZ - 2, PCI_DMA_FROMDEVICE);
2389 dev_kfree_skb(lp->rx_skbuff[i]);
2390 }
2391 lp->rx_skbuff[i] = NULL;
2392 lp->rx_dma_addr[i] = 0;
2393 }
2394
2395 for (i = 0; i < lp->tx_ring_size; i++) {
2396 lp->tx_ring[i].status = 0; /* CPU owns buffer */
2397 wmb(); /* Make sure adapter sees owner change */
2398 if (lp->tx_skbuff[i]) {
2399 pci_unmap_single(lp->pci_dev, lp->tx_dma_addr[i],
2400 lp->tx_skbuff[i]->len,
2401 PCI_DMA_TODEVICE);
2402 dev_kfree_skb(lp->tx_skbuff[i]);
2403 }
2404 lp->tx_skbuff[i] = NULL;
2405 lp->tx_dma_addr[i] = 0;
2406 }
2407 2631
2408 spin_unlock_irqrestore(&lp->lock, flags); 2632 spin_unlock_irqrestore(&lp->lock, flags);
2409 2633
@@ -2433,6 +2657,7 @@ static void pcnet32_load_multicast(struct net_device *dev)
2433 volatile struct pcnet32_init_block *ib = &lp->init_block; 2657 volatile struct pcnet32_init_block *ib = &lp->init_block;
2434 volatile u16 *mcast_table = (u16 *) & ib->filter; 2658 volatile u16 *mcast_table = (u16 *) & ib->filter;
2435 struct dev_mc_list *dmi = dev->mc_list; 2659 struct dev_mc_list *dmi = dev->mc_list;
2660 unsigned long ioaddr = dev->base_addr;
2436 char *addrs; 2661 char *addrs;
2437 int i; 2662 int i;
2438 u32 crc; 2663 u32 crc;
@@ -2441,6 +2666,10 @@ static void pcnet32_load_multicast(struct net_device *dev)
2441 if (dev->flags & IFF_ALLMULTI) { 2666 if (dev->flags & IFF_ALLMULTI) {
2442 ib->filter[0] = 0xffffffff; 2667 ib->filter[0] = 0xffffffff;
2443 ib->filter[1] = 0xffffffff; 2668 ib->filter[1] = 0xffffffff;
2669 lp->a.write_csr(ioaddr, PCNET32_MC_FILTER, 0xffff);
2670 lp->a.write_csr(ioaddr, PCNET32_MC_FILTER+1, 0xffff);
2671 lp->a.write_csr(ioaddr, PCNET32_MC_FILTER+2, 0xffff);
2672 lp->a.write_csr(ioaddr, PCNET32_MC_FILTER+3, 0xffff);
2444 return; 2673 return;
2445 } 2674 }
2446 /* clear the multicast filter */ 2675 /* clear the multicast filter */
@@ -2462,6 +2691,9 @@ static void pcnet32_load_multicast(struct net_device *dev)
2462 le16_to_cpu(le16_to_cpu(mcast_table[crc >> 4]) | 2691 le16_to_cpu(le16_to_cpu(mcast_table[crc >> 4]) |
2463 (1 << (crc & 0xf))); 2692 (1 << (crc & 0xf)));
2464 } 2693 }
2694 for (i = 0; i < 4; i++)
2695 lp->a.write_csr(ioaddr, PCNET32_MC_FILTER + i,
2696 le16_to_cpu(mcast_table[i]));
2465 return; 2697 return;
2466} 2698}
2467 2699
@@ -2472,8 +2704,11 @@ static void pcnet32_set_multicast_list(struct net_device *dev)
2472{ 2704{
2473 unsigned long ioaddr = dev->base_addr, flags; 2705 unsigned long ioaddr = dev->base_addr, flags;
2474 struct pcnet32_private *lp = dev->priv; 2706 struct pcnet32_private *lp = dev->priv;
2707 int csr15, suspended;
2475 2708
2476 spin_lock_irqsave(&lp->lock, flags); 2709 spin_lock_irqsave(&lp->lock, flags);
2710 suspended = pcnet32_suspend(dev, &flags, 0);
2711 csr15 = lp->a.read_csr(ioaddr, CSR15);
2477 if (dev->flags & IFF_PROMISC) { 2712 if (dev->flags & IFF_PROMISC) {
2478 /* Log any net taps. */ 2713 /* Log any net taps. */
2479 if (netif_msg_hw(lp)) 2714 if (netif_msg_hw(lp))
@@ -2482,15 +2717,24 @@ static void pcnet32_set_multicast_list(struct net_device *dev)
2482 lp->init_block.mode = 2717 lp->init_block.mode =
2483 le16_to_cpu(0x8000 | (lp->options & PCNET32_PORT_PORTSEL) << 2718 le16_to_cpu(0x8000 | (lp->options & PCNET32_PORT_PORTSEL) <<
2484 7); 2719 7);
2720 lp->a.write_csr(ioaddr, CSR15, csr15 | 0x8000);
2485 } else { 2721 } else {
2486 lp->init_block.mode = 2722 lp->init_block.mode =
2487 le16_to_cpu((lp->options & PCNET32_PORT_PORTSEL) << 7); 2723 le16_to_cpu((lp->options & PCNET32_PORT_PORTSEL) << 7);
2724 lp->a.write_csr(ioaddr, CSR15, csr15 & 0x7fff);
2488 pcnet32_load_multicast(dev); 2725 pcnet32_load_multicast(dev);
2489 } 2726 }
2490 2727
2491 lp->a.write_csr(ioaddr, 0, 0x0004); /* Temporarily stop the lance. */ 2728 if (suspended) {
2492 pcnet32_restart(dev, 0x0042); /* Resume normal operation */ 2729 int csr5;
2493 netif_wake_queue(dev); 2730 /* clear SUSPEND (SPND) - CSR5 bit 0 */
2731 csr5 = lp->a.read_csr(ioaddr, CSR5);
2732 lp->a.write_csr(ioaddr, CSR5, csr5 & (~CSR5_SUSPEND));
2733 } else {
2734 lp->a.write_csr(ioaddr, CSR0, CSR0_STOP);
2735 pcnet32_restart(dev, CSR0_NORMAL);
2736 netif_wake_queue(dev);
2737 }
2494 2738
2495 spin_unlock_irqrestore(&lp->lock, flags); 2739 spin_unlock_irqrestore(&lp->lock, flags);
2496} 2740}
@@ -2730,7 +2974,7 @@ static int __init pcnet32_init_module(void)
2730 2974
2731 /* should we find any remaining VLbus devices ? */ 2975 /* should we find any remaining VLbus devices ? */
2732 if (pcnet32vlb) 2976 if (pcnet32vlb)
2733 pcnet32_probe_vlbus(); 2977 pcnet32_probe_vlbus(pcnet32_portlist);
2734 2978
2735 if (cards_found && (pcnet32_debug & NETIF_MSG_PROBE)) 2979 if (cards_found && (pcnet32_debug & NETIF_MSG_PROBE))
2736 printk(KERN_INFO PFX "%d cards_found.\n", cards_found); 2980 printk(KERN_INFO PFX "%d cards_found.\n", cards_found);
diff --git a/drivers/net/phy/cicada.c b/drivers/net/phy/cicada.c
index 3efb715c28dc..ae60e6e4107c 100644
--- a/drivers/net/phy/cicada.c
+++ b/drivers/net/phy/cicada.c
@@ -103,7 +103,22 @@ static int cis820x_config_intr(struct phy_device *phydev)
103 return err; 103 return err;
104} 104}
105 105
106/* Cicada 820x */ 106/* Cicada 8201, a.k.a Vitesse VSC8201 */
107static struct phy_driver cis8201_driver = {
108 .phy_id = 0x000fc410,
109 .name = "Cicada Cis8201",
110 .phy_id_mask = 0x000ffff0,
111 .features = PHY_GBIT_FEATURES,
112 .flags = PHY_HAS_INTERRUPT,
113 .config_init = &cis820x_config_init,
114 .config_aneg = &genphy_config_aneg,
115 .read_status = &genphy_read_status,
116 .ack_interrupt = &cis820x_ack_interrupt,
117 .config_intr = &cis820x_config_intr,
118 .driver = { .owner = THIS_MODULE,},
119};
120
121/* Cicada 8204 */
107static struct phy_driver cis8204_driver = { 122static struct phy_driver cis8204_driver = {
108 .phy_id = 0x000fc440, 123 .phy_id = 0x000fc440,
109 .name = "Cicada Cis8204", 124 .name = "Cicada Cis8204",
@@ -118,15 +133,30 @@ static struct phy_driver cis8204_driver = {
118 .driver = { .owner = THIS_MODULE,}, 133 .driver = { .owner = THIS_MODULE,},
119}; 134};
120 135
121static int __init cis8204_init(void) 136static int __init cicada_init(void)
122{ 137{
123 return phy_driver_register(&cis8204_driver); 138 int ret;
139
140 ret = phy_driver_register(&cis8204_driver);
141 if (ret)
142 goto err1;
143
144 ret = phy_driver_register(&cis8201_driver);
145 if (ret)
146 goto err2;
147 return 0;
148
149err2:
150 phy_driver_unregister(&cis8204_driver);
151err1:
152 return ret;
124} 153}
125 154
126static void __exit cis8204_exit(void) 155static void __exit cicada_exit(void)
127{ 156{
128 phy_driver_unregister(&cis8204_driver); 157 phy_driver_unregister(&cis8204_driver);
158 phy_driver_unregister(&cis8201_driver);
129} 159}
130 160
131module_init(cis8204_init); 161module_init(cicada_init);
132module_exit(cis8204_exit); 162module_exit(cicada_exit);
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 7d5c2233c252..f5aad77288f9 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -419,9 +419,8 @@ void phy_start_machine(struct phy_device *phydev,
419 419
420/* phy_stop_machine 420/* phy_stop_machine
421 * 421 *
422 * description: Stops the state machine timer, sets the state to 422 * description: Stops the state machine timer, sets the state to UP
423 * UP (unless it wasn't up yet), and then frees the interrupt, 423 * (unless it wasn't up yet). This function must be called BEFORE
424 * if it is in use. This function must be called BEFORE
425 * phy_detach. 424 * phy_detach.
426 */ 425 */
427void phy_stop_machine(struct phy_device *phydev) 426void phy_stop_machine(struct phy_device *phydev)
@@ -433,9 +432,6 @@ void phy_stop_machine(struct phy_device *phydev)
433 phydev->state = PHY_UP; 432 phydev->state = PHY_UP;
434 spin_unlock(&phydev->lock); 433 spin_unlock(&phydev->lock);
435 434
436 if (phydev->irq != PHY_POLL)
437 phy_stop_interrupts(phydev);
438
439 phydev->adjust_state = NULL; 435 phydev->adjust_state = NULL;
440} 436}
441 437
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 16a0ef1b1369..4c2f575faad7 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -1406,7 +1406,7 @@ rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out,
1406 dev = alloc_etherdev(sizeof (*tp)); 1406 dev = alloc_etherdev(sizeof (*tp));
1407 if (dev == NULL) { 1407 if (dev == NULL) {
1408 if (netif_msg_drv(&debug)) 1408 if (netif_msg_drv(&debug))
1409 printk(KERN_ERR PFX "unable to alloc new ethernet\n"); 1409 dev_err(&pdev->dev, "unable to alloc new ethernet\n");
1410 goto err_out; 1410 goto err_out;
1411 } 1411 }
1412 1412
@@ -1418,10 +1418,8 @@ rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out,
1418 /* enable device (incl. PCI PM wakeup and hotplug setup) */ 1418 /* enable device (incl. PCI PM wakeup and hotplug setup) */
1419 rc = pci_enable_device(pdev); 1419 rc = pci_enable_device(pdev);
1420 if (rc < 0) { 1420 if (rc < 0) {
1421 if (netif_msg_probe(tp)) { 1421 if (netif_msg_probe(tp))
1422 printk(KERN_ERR PFX "%s: enable failure\n", 1422 dev_err(&pdev->dev, "enable failure\n");
1423 pci_name(pdev));
1424 }
1425 goto err_out_free_dev; 1423 goto err_out_free_dev;
1426 } 1424 }
1427 1425
@@ -1437,37 +1435,32 @@ rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out,
1437 pci_read_config_word(pdev, pm_cap + PCI_PM_CTRL, &pwr_command); 1435 pci_read_config_word(pdev, pm_cap + PCI_PM_CTRL, &pwr_command);
1438 acpi_idle_state = pwr_command & PCI_PM_CTRL_STATE_MASK; 1436 acpi_idle_state = pwr_command & PCI_PM_CTRL_STATE_MASK;
1439 } else { 1437 } else {
1440 if (netif_msg_probe(tp)) { 1438 if (netif_msg_probe(tp))
1441 printk(KERN_ERR PFX 1439 dev_err(&pdev->dev,
1442 "PowerManagement capability not found.\n"); 1440 "PowerManagement capability not found.\n");
1443 }
1444 } 1441 }
1445 1442
1446 /* make sure PCI base addr 1 is MMIO */ 1443 /* make sure PCI base addr 1 is MMIO */
1447 if (!(pci_resource_flags(pdev, 1) & IORESOURCE_MEM)) { 1444 if (!(pci_resource_flags(pdev, 1) & IORESOURCE_MEM)) {
1448 if (netif_msg_probe(tp)) { 1445 if (netif_msg_probe(tp))
1449 printk(KERN_ERR PFX 1446 dev_err(&pdev->dev,
1450 "region #1 not an MMIO resource, aborting\n"); 1447 "region #1 not an MMIO resource, aborting\n");
1451 }
1452 rc = -ENODEV; 1448 rc = -ENODEV;
1453 goto err_out_mwi; 1449 goto err_out_mwi;
1454 } 1450 }
1455 /* check for weird/broken PCI region reporting */ 1451 /* check for weird/broken PCI region reporting */
1456 if (pci_resource_len(pdev, 1) < R8169_REGS_SIZE) { 1452 if (pci_resource_len(pdev, 1) < R8169_REGS_SIZE) {
1457 if (netif_msg_probe(tp)) { 1453 if (netif_msg_probe(tp))
1458 printk(KERN_ERR PFX 1454 dev_err(&pdev->dev,
1459 "Invalid PCI region size(s), aborting\n"); 1455 "Invalid PCI region size(s), aborting\n");
1460 }
1461 rc = -ENODEV; 1456 rc = -ENODEV;
1462 goto err_out_mwi; 1457 goto err_out_mwi;
1463 } 1458 }
1464 1459
1465 rc = pci_request_regions(pdev, MODULENAME); 1460 rc = pci_request_regions(pdev, MODULENAME);
1466 if (rc < 0) { 1461 if (rc < 0) {
1467 if (netif_msg_probe(tp)) { 1462 if (netif_msg_probe(tp))
1468 printk(KERN_ERR PFX "%s: could not request regions.\n", 1463 dev_err(&pdev->dev, "could not request regions.\n");
1469 pci_name(pdev));
1470 }
1471 goto err_out_mwi; 1464 goto err_out_mwi;
1472 } 1465 }
1473 1466
@@ -1480,10 +1473,9 @@ rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out,
1480 } else { 1473 } else {
1481 rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK); 1474 rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
1482 if (rc < 0) { 1475 if (rc < 0) {
1483 if (netif_msg_probe(tp)) { 1476 if (netif_msg_probe(tp))
1484 printk(KERN_ERR PFX 1477 dev_err(&pdev->dev,
1485 "DMA configuration failed.\n"); 1478 "DMA configuration failed.\n");
1486 }
1487 goto err_out_free_res; 1479 goto err_out_free_res;
1488 } 1480 }
1489 } 1481 }
@@ -1494,7 +1486,7 @@ rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out,
1494 ioaddr = ioremap(pci_resource_start(pdev, 1), R8169_REGS_SIZE); 1486 ioaddr = ioremap(pci_resource_start(pdev, 1), R8169_REGS_SIZE);
1495 if (ioaddr == NULL) { 1487 if (ioaddr == NULL) {
1496 if (netif_msg_probe(tp)) 1488 if (netif_msg_probe(tp))
1497 printk(KERN_ERR PFX "cannot remap MMIO, aborting\n"); 1489 dev_err(&pdev->dev, "cannot remap MMIO, aborting\n");
1498 rc = -EIO; 1490 rc = -EIO;
1499 goto err_out_free_res; 1491 goto err_out_free_res;
1500 } 1492 }
@@ -1526,9 +1518,9 @@ rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out,
1526 if (i < 0) { 1518 if (i < 0) {
1527 /* Unknown chip: assume array element #0, original RTL-8169 */ 1519 /* Unknown chip: assume array element #0, original RTL-8169 */
1528 if (netif_msg_probe(tp)) { 1520 if (netif_msg_probe(tp)) {
1529 printk(KERN_DEBUG PFX "PCI device %s: " 1521 dev_printk(KERN_DEBUG, &pdev->dev,
1530 "unknown chip version, assuming %s\n", 1522 "unknown chip version, assuming %s\n",
1531 pci_name(pdev), rtl_chip_info[0].name); 1523 rtl_chip_info[0].name);
1532 } 1524 }
1533 i++; 1525 i++;
1534 } 1526 }
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index c6b77acb35ef..132ed32bce1a 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -76,7 +76,7 @@
76#include "s2io.h" 76#include "s2io.h"
77#include "s2io-regs.h" 77#include "s2io-regs.h"
78 78
79#define DRV_VERSION "2.0.14.2" 79#define DRV_VERSION "2.0.15.2"
80 80
81/* S2io Driver name & version. */ 81/* S2io Driver name & version. */
82static char s2io_driver_name[] = "Neterion"; 82static char s2io_driver_name[] = "Neterion";
@@ -370,38 +370,50 @@ static const u64 fix_mac[] = {
370 END_SIGN 370 END_SIGN
371}; 371};
372 372
373MODULE_AUTHOR("Raghavendra Koushik <raghavendra.koushik@neterion.com>");
374MODULE_LICENSE("GPL");
375MODULE_VERSION(DRV_VERSION);
376
377
373/* Module Loadable parameters. */ 378/* Module Loadable parameters. */
374static unsigned int tx_fifo_num = 1; 379S2IO_PARM_INT(tx_fifo_num, 1);
375static unsigned int tx_fifo_len[MAX_TX_FIFOS] = 380S2IO_PARM_INT(rx_ring_num, 1);
376 {DEFAULT_FIFO_0_LEN, [1 ...(MAX_TX_FIFOS - 1)] = DEFAULT_FIFO_1_7_LEN}; 381
377static unsigned int rx_ring_num = 1; 382
378static unsigned int rx_ring_sz[MAX_RX_RINGS] = 383S2IO_PARM_INT(rx_ring_mode, 1);
379 {[0 ...(MAX_RX_RINGS - 1)] = SMALL_BLK_CNT}; 384S2IO_PARM_INT(use_continuous_tx_intrs, 1);
380static unsigned int rts_frm_len[MAX_RX_RINGS] = 385S2IO_PARM_INT(rmac_pause_time, 0x100);
381 {[0 ...(MAX_RX_RINGS - 1)] = 0 }; 386S2IO_PARM_INT(mc_pause_threshold_q0q3, 187);
382static unsigned int rx_ring_mode = 1; 387S2IO_PARM_INT(mc_pause_threshold_q4q7, 187);
383static unsigned int use_continuous_tx_intrs = 1; 388S2IO_PARM_INT(shared_splits, 0);
384static unsigned int rmac_pause_time = 0x100; 389S2IO_PARM_INT(tmac_util_period, 5);
385static unsigned int mc_pause_threshold_q0q3 = 187; 390S2IO_PARM_INT(rmac_util_period, 5);
386static unsigned int mc_pause_threshold_q4q7 = 187; 391S2IO_PARM_INT(bimodal, 0);
387static unsigned int shared_splits; 392S2IO_PARM_INT(l3l4hdr_size, 128);
388static unsigned int tmac_util_period = 5;
389static unsigned int rmac_util_period = 5;
390static unsigned int bimodal = 0;
391static unsigned int l3l4hdr_size = 128;
392#ifndef CONFIG_S2IO_NAPI
393static unsigned int indicate_max_pkts;
394#endif
395/* Frequency of Rx desc syncs expressed as power of 2 */ 393/* Frequency of Rx desc syncs expressed as power of 2 */
396static unsigned int rxsync_frequency = 3; 394S2IO_PARM_INT(rxsync_frequency, 3);
397/* Interrupt type. Values can be 0(INTA), 1(MSI), 2(MSI_X) */ 395/* Interrupt type. Values can be 0(INTA), 1(MSI), 2(MSI_X) */
398static unsigned int intr_type = 0; 396S2IO_PARM_INT(intr_type, 0);
399/* Large receive offload feature */ 397/* Large receive offload feature */
400static unsigned int lro = 0; 398S2IO_PARM_INT(lro, 0);
401/* Max pkts to be aggregated by LRO at one time. If not specified, 399/* Max pkts to be aggregated by LRO at one time. If not specified,
402 * aggregation happens until we hit max IP pkt size(64K) 400 * aggregation happens until we hit max IP pkt size(64K)
403 */ 401 */
404static unsigned int lro_max_pkts = 0xFFFF; 402S2IO_PARM_INT(lro_max_pkts, 0xFFFF);
403#ifndef CONFIG_S2IO_NAPI
404S2IO_PARM_INT(indicate_max_pkts, 0);
405#endif
406
407static unsigned int tx_fifo_len[MAX_TX_FIFOS] =
408 {DEFAULT_FIFO_0_LEN, [1 ...(MAX_TX_FIFOS - 1)] = DEFAULT_FIFO_1_7_LEN};
409static unsigned int rx_ring_sz[MAX_RX_RINGS] =
410 {[0 ...(MAX_RX_RINGS - 1)] = SMALL_BLK_CNT};
411static unsigned int rts_frm_len[MAX_RX_RINGS] =
412 {[0 ...(MAX_RX_RINGS - 1)] = 0 };
413
414module_param_array(tx_fifo_len, uint, NULL, 0);
415module_param_array(rx_ring_sz, uint, NULL, 0);
416module_param_array(rts_frm_len, uint, NULL, 0);
405 417
406/* 418/*
407 * S2IO device table. 419 * S2IO device table.
@@ -464,10 +476,9 @@ static int init_shared_mem(struct s2io_nic *nic)
464 size += config->tx_cfg[i].fifo_len; 476 size += config->tx_cfg[i].fifo_len;
465 } 477 }
466 if (size > MAX_AVAILABLE_TXDS) { 478 if (size > MAX_AVAILABLE_TXDS) {
467 DBG_PRINT(ERR_DBG, "%s: Requested TxDs too high, ", 479 DBG_PRINT(ERR_DBG, "s2io: Requested TxDs too high, ");
468 __FUNCTION__);
469 DBG_PRINT(ERR_DBG, "Requested: %d, max supported: 8192\n", size); 480 DBG_PRINT(ERR_DBG, "Requested: %d, max supported: 8192\n", size);
470 return FAILURE; 481 return -EINVAL;
471 } 482 }
472 483
473 lst_size = (sizeof(TxD_t) * config->max_txds); 484 lst_size = (sizeof(TxD_t) * config->max_txds);
@@ -547,6 +558,7 @@ static int init_shared_mem(struct s2io_nic *nic)
547 nic->ufo_in_band_v = kmalloc((sizeof(u64) * size), GFP_KERNEL); 558 nic->ufo_in_band_v = kmalloc((sizeof(u64) * size), GFP_KERNEL);
548 if (!nic->ufo_in_band_v) 559 if (!nic->ufo_in_band_v)
549 return -ENOMEM; 560 return -ENOMEM;
561 memset(nic->ufo_in_band_v, 0, size);
550 562
551 /* Allocation and initialization of RXDs in Rings */ 563 /* Allocation and initialization of RXDs in Rings */
552 size = 0; 564 size = 0;
@@ -1213,7 +1225,7 @@ static int init_nic(struct s2io_nic *nic)
1213 break; 1225 break;
1214 } 1226 }
1215 1227
1216 /* Enable Tx FIFO partition 0. */ 1228 /* Enable all configured Tx FIFO partitions */
1217 val64 = readq(&bar0->tx_fifo_partition_0); 1229 val64 = readq(&bar0->tx_fifo_partition_0);
1218 val64 |= (TX_FIFO_PARTITION_EN); 1230 val64 |= (TX_FIFO_PARTITION_EN);
1219 writeq(val64, &bar0->tx_fifo_partition_0); 1231 writeq(val64, &bar0->tx_fifo_partition_0);
@@ -1650,7 +1662,7 @@ static void en_dis_able_nic_intrs(struct s2io_nic *nic, u16 mask, int flag)
1650 writeq(temp64, &bar0->general_int_mask); 1662 writeq(temp64, &bar0->general_int_mask);
1651 /* 1663 /*
1652 * If Hercules adapter enable GPIO otherwise 1664 * If Hercules adapter enable GPIO otherwise
1653 * disabled all PCIX, Flash, MDIO, IIC and GPIO 1665 * disable all PCIX, Flash, MDIO, IIC and GPIO
1654 * interrupts for now. 1666 * interrupts for now.
1655 * TODO 1667 * TODO
1656 */ 1668 */
@@ -1976,7 +1988,6 @@ static int start_nic(struct s2io_nic *nic)
1976 XENA_dev_config_t __iomem *bar0 = nic->bar0; 1988 XENA_dev_config_t __iomem *bar0 = nic->bar0;
1977 struct net_device *dev = nic->dev; 1989 struct net_device *dev = nic->dev;
1978 register u64 val64 = 0; 1990 register u64 val64 = 0;
1979 u16 interruptible;
1980 u16 subid, i; 1991 u16 subid, i;
1981 mac_info_t *mac_control; 1992 mac_info_t *mac_control;
1982 struct config_param *config; 1993 struct config_param *config;
@@ -2047,16 +2058,6 @@ static int start_nic(struct s2io_nic *nic)
2047 return FAILURE; 2058 return FAILURE;
2048 } 2059 }
2049 2060
2050 /* Enable select interrupts */
2051 if (nic->intr_type != INTA)
2052 en_dis_able_nic_intrs(nic, ENA_ALL_INTRS, DISABLE_INTRS);
2053 else {
2054 interruptible = TX_TRAFFIC_INTR | RX_TRAFFIC_INTR;
2055 interruptible |= TX_PIC_INTR | RX_PIC_INTR;
2056 interruptible |= TX_MAC_INTR | RX_MAC_INTR;
2057 en_dis_able_nic_intrs(nic, interruptible, ENABLE_INTRS);
2058 }
2059
2060 /* 2061 /*
2061 * With some switches, link might be already up at this point. 2062 * With some switches, link might be already up at this point.
2062 * Because of this weird behavior, when we enable laser, 2063 * Because of this weird behavior, when we enable laser,
@@ -2130,7 +2131,7 @@ static struct sk_buff *s2io_txdl_getskb(fifo_info_t *fifo_data, TxD_t *txdlp, in
2130 frag->size, PCI_DMA_TODEVICE); 2131 frag->size, PCI_DMA_TODEVICE);
2131 } 2132 }
2132 } 2133 }
2133 txdlp->Host_Control = 0; 2134 memset(txdlp,0, (sizeof(TxD_t) * fifo_data->max_txds));
2134 return(skb); 2135 return(skb);
2135} 2136}
2136 2137
@@ -2382,9 +2383,14 @@ static int fill_rx_buffers(struct s2io_nic *nic, int ring_no)
2382 skb->data = (void *) (unsigned long)tmp; 2383 skb->data = (void *) (unsigned long)tmp;
2383 skb->tail = (void *) (unsigned long)tmp; 2384 skb->tail = (void *) (unsigned long)tmp;
2384 2385
2385 ((RxD3_t*)rxdp)->Buffer0_ptr = 2386 if (!(((RxD3_t*)rxdp)->Buffer0_ptr))
2386 pci_map_single(nic->pdev, ba->ba_0, BUF0_LEN, 2387 ((RxD3_t*)rxdp)->Buffer0_ptr =
2388 pci_map_single(nic->pdev, ba->ba_0, BUF0_LEN,
2387 PCI_DMA_FROMDEVICE); 2389 PCI_DMA_FROMDEVICE);
2390 else
2391 pci_dma_sync_single_for_device(nic->pdev,
2392 (dma_addr_t) ((RxD3_t*)rxdp)->Buffer0_ptr,
2393 BUF0_LEN, PCI_DMA_FROMDEVICE);
2388 rxdp->Control_2 = SET_BUFFER0_SIZE_3(BUF0_LEN); 2394 rxdp->Control_2 = SET_BUFFER0_SIZE_3(BUF0_LEN);
2389 if (nic->rxd_mode == RXD_MODE_3B) { 2395 if (nic->rxd_mode == RXD_MODE_3B) {
2390 /* Two buffer mode */ 2396 /* Two buffer mode */
@@ -2397,10 +2403,13 @@ static int fill_rx_buffers(struct s2io_nic *nic, int ring_no)
2397 (nic->pdev, skb->data, dev->mtu + 4, 2403 (nic->pdev, skb->data, dev->mtu + 4,
2398 PCI_DMA_FROMDEVICE); 2404 PCI_DMA_FROMDEVICE);
2399 2405
2400 /* Buffer-1 will be dummy buffer not used */ 2406 /* Buffer-1 will be dummy buffer. Not used */
2401 ((RxD3_t*)rxdp)->Buffer1_ptr = 2407 if (!(((RxD3_t*)rxdp)->Buffer1_ptr)) {
2402 pci_map_single(nic->pdev, ba->ba_1, BUF1_LEN, 2408 ((RxD3_t*)rxdp)->Buffer1_ptr =
2403 PCI_DMA_FROMDEVICE); 2409 pci_map_single(nic->pdev,
2410 ba->ba_1, BUF1_LEN,
2411 PCI_DMA_FROMDEVICE);
2412 }
2404 rxdp->Control_2 |= SET_BUFFER1_SIZE_3(1); 2413 rxdp->Control_2 |= SET_BUFFER1_SIZE_3(1);
2405 rxdp->Control_2 |= SET_BUFFER2_SIZE_3 2414 rxdp->Control_2 |= SET_BUFFER2_SIZE_3
2406 (dev->mtu + 4); 2415 (dev->mtu + 4);
@@ -2625,23 +2634,23 @@ no_rx:
2625} 2634}
2626#endif 2635#endif
2627 2636
2637#ifdef CONFIG_NET_POLL_CONTROLLER
2628/** 2638/**
2629 * s2io_netpoll - Rx interrupt service handler for netpoll support 2639 * s2io_netpoll - netpoll event handler entry point
2630 * @dev : pointer to the device structure. 2640 * @dev : pointer to the device structure.
2631 * Description: 2641 * Description:
2632 * Polling 'interrupt' - used by things like netconsole to send skbs 2642 * This function will be called by upper layer to check for events on the
2633 * without having to re-enable interrupts. It's not called while 2643 * interface in situations where interrupts are disabled. It is used for
2634 * the interrupt routine is executing. 2644 * specific in-kernel networking tasks, such as remote consoles and kernel
2645 * debugging over the network (example netdump in RedHat).
2635 */ 2646 */
2636
2637#ifdef CONFIG_NET_POLL_CONTROLLER
2638static void s2io_netpoll(struct net_device *dev) 2647static void s2io_netpoll(struct net_device *dev)
2639{ 2648{
2640 nic_t *nic = dev->priv; 2649 nic_t *nic = dev->priv;
2641 mac_info_t *mac_control; 2650 mac_info_t *mac_control;
2642 struct config_param *config; 2651 struct config_param *config;
2643 XENA_dev_config_t __iomem *bar0 = nic->bar0; 2652 XENA_dev_config_t __iomem *bar0 = nic->bar0;
2644 u64 val64; 2653 u64 val64 = 0xFFFFFFFFFFFFFFFFULL;
2645 int i; 2654 int i;
2646 2655
2647 disable_irq(dev->irq); 2656 disable_irq(dev->irq);
@@ -2650,9 +2659,17 @@ static void s2io_netpoll(struct net_device *dev)
2650 mac_control = &nic->mac_control; 2659 mac_control = &nic->mac_control;
2651 config = &nic->config; 2660 config = &nic->config;
2652 2661
2653 val64 = readq(&bar0->rx_traffic_int);
2654 writeq(val64, &bar0->rx_traffic_int); 2662 writeq(val64, &bar0->rx_traffic_int);
2663 writeq(val64, &bar0->tx_traffic_int);
2655 2664
2665 /* we need to free up the transmitted skbufs or else netpoll will
2666 * run out of skbs and will fail and eventually netpoll application such
2667 * as netdump will fail.
2668 */
2669 for (i = 0; i < config->tx_fifo_num; i++)
2670 tx_intr_handler(&mac_control->fifos[i]);
2671
2672 /* check for received packet and indicate up to network */
2656 for (i = 0; i < config->rx_ring_num; i++) 2673 for (i = 0; i < config->rx_ring_num; i++)
2657 rx_intr_handler(&mac_control->rings[i]); 2674 rx_intr_handler(&mac_control->rings[i]);
2658 2675
@@ -2719,7 +2736,7 @@ static void rx_intr_handler(ring_info_t *ring_data)
2719 /* If your are next to put index then it's FIFO full condition */ 2736 /* If your are next to put index then it's FIFO full condition */
2720 if ((get_block == put_block) && 2737 if ((get_block == put_block) &&
2721 (get_info.offset + 1) == put_info.offset) { 2738 (get_info.offset + 1) == put_info.offset) {
2722 DBG_PRINT(ERR_DBG, "%s: Ring Full\n",dev->name); 2739 DBG_PRINT(INTR_DBG, "%s: Ring Full\n",dev->name);
2723 break; 2740 break;
2724 } 2741 }
2725 skb = (struct sk_buff *) ((unsigned long)rxdp->Host_Control); 2742 skb = (struct sk_buff *) ((unsigned long)rxdp->Host_Control);
@@ -2739,18 +2756,15 @@ static void rx_intr_handler(ring_info_t *ring_data)
2739 HEADER_SNAP_SIZE, 2756 HEADER_SNAP_SIZE,
2740 PCI_DMA_FROMDEVICE); 2757 PCI_DMA_FROMDEVICE);
2741 } else if (nic->rxd_mode == RXD_MODE_3B) { 2758 } else if (nic->rxd_mode == RXD_MODE_3B) {
2742 pci_unmap_single(nic->pdev, (dma_addr_t) 2759 pci_dma_sync_single_for_cpu(nic->pdev, (dma_addr_t)
2743 ((RxD3_t*)rxdp)->Buffer0_ptr, 2760 ((RxD3_t*)rxdp)->Buffer0_ptr,
2744 BUF0_LEN, PCI_DMA_FROMDEVICE); 2761 BUF0_LEN, PCI_DMA_FROMDEVICE);
2745 pci_unmap_single(nic->pdev, (dma_addr_t) 2762 pci_unmap_single(nic->pdev, (dma_addr_t)
2746 ((RxD3_t*)rxdp)->Buffer1_ptr,
2747 BUF1_LEN, PCI_DMA_FROMDEVICE);
2748 pci_unmap_single(nic->pdev, (dma_addr_t)
2749 ((RxD3_t*)rxdp)->Buffer2_ptr, 2763 ((RxD3_t*)rxdp)->Buffer2_ptr,
2750 dev->mtu + 4, 2764 dev->mtu + 4,
2751 PCI_DMA_FROMDEVICE); 2765 PCI_DMA_FROMDEVICE);
2752 } else { 2766 } else {
2753 pci_unmap_single(nic->pdev, (dma_addr_t) 2767 pci_dma_sync_single_for_cpu(nic->pdev, (dma_addr_t)
2754 ((RxD3_t*)rxdp)->Buffer0_ptr, BUF0_LEN, 2768 ((RxD3_t*)rxdp)->Buffer0_ptr, BUF0_LEN,
2755 PCI_DMA_FROMDEVICE); 2769 PCI_DMA_FROMDEVICE);
2756 pci_unmap_single(nic->pdev, (dma_addr_t) 2770 pci_unmap_single(nic->pdev, (dma_addr_t)
@@ -3338,7 +3352,7 @@ static void s2io_reset(nic_t * sp)
3338 3352
3339 /* Clear certain PCI/PCI-X fields after reset */ 3353 /* Clear certain PCI/PCI-X fields after reset */
3340 if (sp->device_type == XFRAME_II_DEVICE) { 3354 if (sp->device_type == XFRAME_II_DEVICE) {
3341 /* Clear parity err detect bit */ 3355 /* Clear "detected parity error" bit */
3342 pci_write_config_word(sp->pdev, PCI_STATUS, 0x8000); 3356 pci_write_config_word(sp->pdev, PCI_STATUS, 0x8000);
3343 3357
3344 /* Clearing PCIX Ecc status register */ 3358 /* Clearing PCIX Ecc status register */
@@ -3539,7 +3553,7 @@ static void restore_xmsi_data(nic_t *nic)
3539 u64 val64; 3553 u64 val64;
3540 int i; 3554 int i;
3541 3555
3542 for (i=0; i< nic->avail_msix_vectors; i++) { 3556 for (i=0; i < MAX_REQUESTED_MSI_X; i++) {
3543 writeq(nic->msix_info[i].addr, &bar0->xmsi_address); 3557 writeq(nic->msix_info[i].addr, &bar0->xmsi_address);
3544 writeq(nic->msix_info[i].data, &bar0->xmsi_data); 3558 writeq(nic->msix_info[i].data, &bar0->xmsi_data);
3545 val64 = (BIT(7) | BIT(15) | vBIT(i, 26, 6)); 3559 val64 = (BIT(7) | BIT(15) | vBIT(i, 26, 6));
@@ -3558,7 +3572,7 @@ static void store_xmsi_data(nic_t *nic)
3558 int i; 3572 int i;
3559 3573
3560 /* Store and display */ 3574 /* Store and display */
3561 for (i=0; i< nic->avail_msix_vectors; i++) { 3575 for (i=0; i < MAX_REQUESTED_MSI_X; i++) {
3562 val64 = (BIT(15) | vBIT(i, 26, 6)); 3576 val64 = (BIT(15) | vBIT(i, 26, 6));
3563 writeq(val64, &bar0->xmsi_access); 3577 writeq(val64, &bar0->xmsi_access);
3564 if (wait_for_msix_trans(nic, i)) { 3578 if (wait_for_msix_trans(nic, i)) {
@@ -3749,101 +3763,19 @@ static int s2io_open(struct net_device *dev)
3749 if (err) { 3763 if (err) {
3750 DBG_PRINT(ERR_DBG, "%s: H/W initialization failed\n", 3764 DBG_PRINT(ERR_DBG, "%s: H/W initialization failed\n",
3751 dev->name); 3765 dev->name);
3752 if (err == -ENODEV) 3766 goto hw_init_failed;
3753 goto hw_init_failed;
3754 else
3755 goto hw_enable_failed;
3756 }
3757
3758 /* Store the values of the MSIX table in the nic_t structure */
3759 store_xmsi_data(sp);
3760
3761 /* After proper initialization of H/W, register ISR */
3762 if (sp->intr_type == MSI) {
3763 err = request_irq((int) sp->pdev->irq, s2io_msi_handle,
3764 IRQF_SHARED, sp->name, dev);
3765 if (err) {
3766 DBG_PRINT(ERR_DBG, "%s: MSI registration \
3767failed\n", dev->name);
3768 goto isr_registration_failed;
3769 }
3770 }
3771 if (sp->intr_type == MSI_X) {
3772 int i;
3773
3774 for (i=1; (sp->s2io_entries[i].in_use == MSIX_FLG); i++) {
3775 if (sp->s2io_entries[i].type == MSIX_FIFO_TYPE) {
3776 sprintf(sp->desc1, "%s:MSI-X-%d-TX",
3777 dev->name, i);
3778 err = request_irq(sp->entries[i].vector,
3779 s2io_msix_fifo_handle, 0, sp->desc1,
3780 sp->s2io_entries[i].arg);
3781 DBG_PRINT(ERR_DBG, "%s @ 0x%llx\n", sp->desc1,
3782 (unsigned long long)sp->msix_info[i].addr);
3783 } else {
3784 sprintf(sp->desc2, "%s:MSI-X-%d-RX",
3785 dev->name, i);
3786 err = request_irq(sp->entries[i].vector,
3787 s2io_msix_ring_handle, 0, sp->desc2,
3788 sp->s2io_entries[i].arg);
3789 DBG_PRINT(ERR_DBG, "%s @ 0x%llx\n", sp->desc2,
3790 (unsigned long long)sp->msix_info[i].addr);
3791 }
3792 if (err) {
3793 DBG_PRINT(ERR_DBG, "%s: MSI-X-%d registration \
3794failed\n", dev->name, i);
3795 DBG_PRINT(ERR_DBG, "Returned: %d\n", err);
3796 goto isr_registration_failed;
3797 }
3798 sp->s2io_entries[i].in_use = MSIX_REGISTERED_SUCCESS;
3799 }
3800 }
3801 if (sp->intr_type == INTA) {
3802 err = request_irq((int) sp->pdev->irq, s2io_isr, IRQF_SHARED,
3803 sp->name, dev);
3804 if (err) {
3805 DBG_PRINT(ERR_DBG, "%s: ISR registration failed\n",
3806 dev->name);
3807 goto isr_registration_failed;
3808 }
3809 } 3767 }
3810 3768
3811 if (s2io_set_mac_addr(dev, dev->dev_addr) == FAILURE) { 3769 if (s2io_set_mac_addr(dev, dev->dev_addr) == FAILURE) {
3812 DBG_PRINT(ERR_DBG, "Set Mac Address Failed\n"); 3770 DBG_PRINT(ERR_DBG, "Set Mac Address Failed\n");
3771 s2io_card_down(sp);
3813 err = -ENODEV; 3772 err = -ENODEV;
3814 goto setting_mac_address_failed; 3773 goto hw_init_failed;
3815 } 3774 }
3816 3775
3817 netif_start_queue(dev); 3776 netif_start_queue(dev);
3818 return 0; 3777 return 0;
3819 3778
3820setting_mac_address_failed:
3821 if (sp->intr_type != MSI_X)
3822 free_irq(sp->pdev->irq, dev);
3823isr_registration_failed:
3824 del_timer_sync(&sp->alarm_timer);
3825 if (sp->intr_type == MSI_X) {
3826 int i;
3827 u16 msi_control; /* Temp variable */
3828
3829 for (i=1; (sp->s2io_entries[i].in_use ==
3830 MSIX_REGISTERED_SUCCESS); i++) {
3831 int vector = sp->entries[i].vector;
3832 void *arg = sp->s2io_entries[i].arg;
3833
3834 free_irq(vector, arg);
3835 }
3836 pci_disable_msix(sp->pdev);
3837
3838 /* Temp */
3839 pci_read_config_word(sp->pdev, 0x42, &msi_control);
3840 msi_control &= 0xFFFE; /* Disable MSI */
3841 pci_write_config_word(sp->pdev, 0x42, msi_control);
3842 }
3843 else if (sp->intr_type == MSI)
3844 pci_disable_msi(sp->pdev);
3845hw_enable_failed:
3846 s2io_reset(sp);
3847hw_init_failed: 3779hw_init_failed:
3848 if (sp->intr_type == MSI_X) { 3780 if (sp->intr_type == MSI_X) {
3849 if (sp->entries) 3781 if (sp->entries)
@@ -3874,7 +3806,7 @@ static int s2io_close(struct net_device *dev)
3874 flush_scheduled_work(); 3806 flush_scheduled_work();
3875 netif_stop_queue(dev); 3807 netif_stop_queue(dev);
3876 /* Reset card, kill tasklet and free Tx and Rx buffers. */ 3808 /* Reset card, kill tasklet and free Tx and Rx buffers. */
3877 s2io_card_down(sp, 1); 3809 s2io_card_down(sp);
3878 3810
3879 sp->device_close_flag = TRUE; /* Device is shut down. */ 3811 sp->device_close_flag = TRUE; /* Device is shut down. */
3880 return 0; 3812 return 0;
@@ -3901,13 +3833,11 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev)
3901 TxD_t *txdp; 3833 TxD_t *txdp;
3902 TxFIFO_element_t __iomem *tx_fifo; 3834 TxFIFO_element_t __iomem *tx_fifo;
3903 unsigned long flags; 3835 unsigned long flags;
3904#ifdef NETIF_F_TSO
3905 int mss;
3906#endif
3907 u16 vlan_tag = 0; 3836 u16 vlan_tag = 0;
3908 int vlan_priority = 0; 3837 int vlan_priority = 0;
3909 mac_info_t *mac_control; 3838 mac_info_t *mac_control;
3910 struct config_param *config; 3839 struct config_param *config;
3840 int offload_type;
3911 3841
3912 mac_control = &sp->mac_control; 3842 mac_control = &sp->mac_control;
3913 config = &sp->config; 3843 config = &sp->config;
@@ -3955,13 +3885,11 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev)
3955 return 0; 3885 return 0;
3956 } 3886 }
3957 3887
3958 txdp->Control_1 = 0; 3888 offload_type = s2io_offload_type(skb);
3959 txdp->Control_2 = 0;
3960#ifdef NETIF_F_TSO 3889#ifdef NETIF_F_TSO
3961 mss = skb_shinfo(skb)->gso_size; 3890 if (offload_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6)) {
3962 if (skb_shinfo(skb)->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6)) {
3963 txdp->Control_1 |= TXD_TCP_LSO_EN; 3891 txdp->Control_1 |= TXD_TCP_LSO_EN;
3964 txdp->Control_1 |= TXD_TCP_LSO_MSS(mss); 3892 txdp->Control_1 |= TXD_TCP_LSO_MSS(s2io_tcp_mss(skb));
3965 } 3893 }
3966#endif 3894#endif
3967 if (skb->ip_summed == CHECKSUM_HW) { 3895 if (skb->ip_summed == CHECKSUM_HW) {
@@ -3979,10 +3907,10 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev)
3979 } 3907 }
3980 3908
3981 frg_len = skb->len - skb->data_len; 3909 frg_len = skb->len - skb->data_len;
3982 if (skb_shinfo(skb)->gso_type == SKB_GSO_UDP) { 3910 if (offload_type == SKB_GSO_UDP) {
3983 int ufo_size; 3911 int ufo_size;
3984 3912
3985 ufo_size = skb_shinfo(skb)->gso_size; 3913 ufo_size = s2io_udp_mss(skb);
3986 ufo_size &= ~7; 3914 ufo_size &= ~7;
3987 txdp->Control_1 |= TXD_UFO_EN; 3915 txdp->Control_1 |= TXD_UFO_EN;
3988 txdp->Control_1 |= TXD_UFO_MSS(ufo_size); 3916 txdp->Control_1 |= TXD_UFO_MSS(ufo_size);
@@ -3999,16 +3927,13 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev)
3999 sp->ufo_in_band_v, 3927 sp->ufo_in_band_v,
4000 sizeof(u64), PCI_DMA_TODEVICE); 3928 sizeof(u64), PCI_DMA_TODEVICE);
4001 txdp++; 3929 txdp++;
4002 txdp->Control_1 = 0;
4003 txdp->Control_2 = 0;
4004 } 3930 }
4005 3931
4006 txdp->Buffer_Pointer = pci_map_single 3932 txdp->Buffer_Pointer = pci_map_single
4007 (sp->pdev, skb->data, frg_len, PCI_DMA_TODEVICE); 3933 (sp->pdev, skb->data, frg_len, PCI_DMA_TODEVICE);
4008 txdp->Host_Control = (unsigned long) skb; 3934 txdp->Host_Control = (unsigned long) skb;
4009 txdp->Control_1 |= TXD_BUFFER0_SIZE(frg_len); 3935 txdp->Control_1 |= TXD_BUFFER0_SIZE(frg_len);
4010 3936 if (offload_type == SKB_GSO_UDP)
4011 if (skb_shinfo(skb)->gso_type == SKB_GSO_UDP)
4012 txdp->Control_1 |= TXD_UFO_EN; 3937 txdp->Control_1 |= TXD_UFO_EN;
4013 3938
4014 frg_cnt = skb_shinfo(skb)->nr_frags; 3939 frg_cnt = skb_shinfo(skb)->nr_frags;
@@ -4023,12 +3948,12 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev)
4023 (sp->pdev, frag->page, frag->page_offset, 3948 (sp->pdev, frag->page, frag->page_offset,
4024 frag->size, PCI_DMA_TODEVICE); 3949 frag->size, PCI_DMA_TODEVICE);
4025 txdp->Control_1 = TXD_BUFFER0_SIZE(frag->size); 3950 txdp->Control_1 = TXD_BUFFER0_SIZE(frag->size);
4026 if (skb_shinfo(skb)->gso_type == SKB_GSO_UDP) 3951 if (offload_type == SKB_GSO_UDP)
4027 txdp->Control_1 |= TXD_UFO_EN; 3952 txdp->Control_1 |= TXD_UFO_EN;
4028 } 3953 }
4029 txdp->Control_1 |= TXD_GATHER_CODE_LAST; 3954 txdp->Control_1 |= TXD_GATHER_CODE_LAST;
4030 3955
4031 if (skb_shinfo(skb)->gso_type == SKB_GSO_UDP) 3956 if (offload_type == SKB_GSO_UDP)
4032 frg_cnt++; /* as Txd0 was used for inband header */ 3957 frg_cnt++; /* as Txd0 was used for inband header */
4033 3958
4034 tx_fifo = mac_control->tx_FIFO_start[queue]; 3959 tx_fifo = mac_control->tx_FIFO_start[queue];
@@ -4037,13 +3962,9 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev)
4037 3962
4038 val64 = (TX_FIFO_LAST_TXD_NUM(frg_cnt) | TX_FIFO_FIRST_LIST | 3963 val64 = (TX_FIFO_LAST_TXD_NUM(frg_cnt) | TX_FIFO_FIRST_LIST |
4039 TX_FIFO_LAST_LIST); 3964 TX_FIFO_LAST_LIST);
4040 3965 if (offload_type)
4041#ifdef NETIF_F_TSO
4042 if (mss)
4043 val64 |= TX_FIFO_SPECIAL_FUNC;
4044#endif
4045 if (skb_shinfo(skb)->gso_type == SKB_GSO_UDP)
4046 val64 |= TX_FIFO_SPECIAL_FUNC; 3966 val64 |= TX_FIFO_SPECIAL_FUNC;
3967
4047 writeq(val64, &tx_fifo->List_Control); 3968 writeq(val64, &tx_fifo->List_Control);
4048 3969
4049 mmiowb(); 3970 mmiowb();
@@ -4077,13 +3998,41 @@ s2io_alarm_handle(unsigned long data)
4077 mod_timer(&sp->alarm_timer, jiffies + HZ / 2); 3998 mod_timer(&sp->alarm_timer, jiffies + HZ / 2);
4078} 3999}
4079 4000
4001static int s2io_chk_rx_buffers(nic_t *sp, int rng_n)
4002{
4003 int rxb_size, level;
4004
4005 if (!sp->lro) {
4006 rxb_size = atomic_read(&sp->rx_bufs_left[rng_n]);
4007 level = rx_buffer_level(sp, rxb_size, rng_n);
4008
4009 if ((level == PANIC) && (!TASKLET_IN_USE)) {
4010 int ret;
4011 DBG_PRINT(INTR_DBG, "%s: Rx BD hit ", __FUNCTION__);
4012 DBG_PRINT(INTR_DBG, "PANIC levels\n");
4013 if ((ret = fill_rx_buffers(sp, rng_n)) == -ENOMEM) {
4014 DBG_PRINT(ERR_DBG, "Out of memory in %s",
4015 __FUNCTION__);
4016 clear_bit(0, (&sp->tasklet_status));
4017 return -1;
4018 }
4019 clear_bit(0, (&sp->tasklet_status));
4020 } else if (level == LOW)
4021 tasklet_schedule(&sp->task);
4022
4023 } else if (fill_rx_buffers(sp, rng_n) == -ENOMEM) {
4024 DBG_PRINT(ERR_DBG, "%s:Out of memory", sp->dev->name);
4025 DBG_PRINT(ERR_DBG, " in Rx Intr!!\n");
4026 }
4027 return 0;
4028}
4029
4080static irqreturn_t 4030static irqreturn_t
4081s2io_msi_handle(int irq, void *dev_id, struct pt_regs *regs) 4031s2io_msi_handle(int irq, void *dev_id, struct pt_regs *regs)
4082{ 4032{
4083 struct net_device *dev = (struct net_device *) dev_id; 4033 struct net_device *dev = (struct net_device *) dev_id;
4084 nic_t *sp = dev->priv; 4034 nic_t *sp = dev->priv;
4085 int i; 4035 int i;
4086 int ret;
4087 mac_info_t *mac_control; 4036 mac_info_t *mac_control;
4088 struct config_param *config; 4037 struct config_param *config;
4089 4038
@@ -4105,35 +4054,8 @@ s2io_msi_handle(int irq, void *dev_id, struct pt_regs *regs)
4105 * reallocate the buffers from the interrupt handler itself, 4054 * reallocate the buffers from the interrupt handler itself,
4106 * else schedule a tasklet to reallocate the buffers. 4055 * else schedule a tasklet to reallocate the buffers.
4107 */ 4056 */
4108 for (i = 0; i < config->rx_ring_num; i++) { 4057 for (i = 0; i < config->rx_ring_num; i++)
4109 if (!sp->lro) { 4058 s2io_chk_rx_buffers(sp, i);
4110 int rxb_size = atomic_read(&sp->rx_bufs_left[i]);
4111 int level = rx_buffer_level(sp, rxb_size, i);
4112
4113 if ((level == PANIC) && (!TASKLET_IN_USE)) {
4114 DBG_PRINT(INTR_DBG, "%s: Rx BD hit ",
4115 dev->name);
4116 DBG_PRINT(INTR_DBG, "PANIC levels\n");
4117 if ((ret = fill_rx_buffers(sp, i)) == -ENOMEM) {
4118 DBG_PRINT(ERR_DBG, "%s:Out of memory",
4119 dev->name);
4120 DBG_PRINT(ERR_DBG, " in ISR!!\n");
4121 clear_bit(0, (&sp->tasklet_status));
4122 atomic_dec(&sp->isr_cnt);
4123 return IRQ_HANDLED;
4124 }
4125 clear_bit(0, (&sp->tasklet_status));
4126 } else if (level == LOW) {
4127 tasklet_schedule(&sp->task);
4128 }
4129 }
4130 else if (fill_rx_buffers(sp, i) == -ENOMEM) {
4131 DBG_PRINT(ERR_DBG, "%s:Out of memory",
4132 dev->name);
4133 DBG_PRINT(ERR_DBG, " in Rx Intr!!\n");
4134 break;
4135 }
4136 }
4137 4059
4138 atomic_dec(&sp->isr_cnt); 4060 atomic_dec(&sp->isr_cnt);
4139 return IRQ_HANDLED; 4061 return IRQ_HANDLED;
@@ -4144,39 +4066,13 @@ s2io_msix_ring_handle(int irq, void *dev_id, struct pt_regs *regs)
4144{ 4066{
4145 ring_info_t *ring = (ring_info_t *)dev_id; 4067 ring_info_t *ring = (ring_info_t *)dev_id;
4146 nic_t *sp = ring->nic; 4068 nic_t *sp = ring->nic;
4147 struct net_device *dev = (struct net_device *) dev_id;
4148 int rxb_size, level, rng_n;
4149 4069
4150 atomic_inc(&sp->isr_cnt); 4070 atomic_inc(&sp->isr_cnt);
4151 rx_intr_handler(ring);
4152 4071
4153 rng_n = ring->ring_no; 4072 rx_intr_handler(ring);
4154 if (!sp->lro) { 4073 s2io_chk_rx_buffers(sp, ring->ring_no);
4155 rxb_size = atomic_read(&sp->rx_bufs_left[rng_n]);
4156 level = rx_buffer_level(sp, rxb_size, rng_n);
4157
4158 if ((level == PANIC) && (!TASKLET_IN_USE)) {
4159 int ret;
4160 DBG_PRINT(INTR_DBG, "%s: Rx BD hit ", __FUNCTION__);
4161 DBG_PRINT(INTR_DBG, "PANIC levels\n");
4162 if ((ret = fill_rx_buffers(sp, rng_n)) == -ENOMEM) {
4163 DBG_PRINT(ERR_DBG, "Out of memory in %s",
4164 __FUNCTION__);
4165 clear_bit(0, (&sp->tasklet_status));
4166 return IRQ_HANDLED;
4167 }
4168 clear_bit(0, (&sp->tasklet_status));
4169 } else if (level == LOW) {
4170 tasklet_schedule(&sp->task);
4171 }
4172 }
4173 else if (fill_rx_buffers(sp, rng_n) == -ENOMEM) {
4174 DBG_PRINT(ERR_DBG, "%s:Out of memory", dev->name);
4175 DBG_PRINT(ERR_DBG, " in Rx Intr!!\n");
4176 }
4177 4074
4178 atomic_dec(&sp->isr_cnt); 4075 atomic_dec(&sp->isr_cnt);
4179
4180 return IRQ_HANDLED; 4076 return IRQ_HANDLED;
4181} 4077}
4182 4078
@@ -4341,37 +4237,8 @@ static irqreturn_t s2io_isr(int irq, void *dev_id, struct pt_regs *regs)
4341 * else schedule a tasklet to reallocate the buffers. 4237 * else schedule a tasklet to reallocate the buffers.
4342 */ 4238 */
4343#ifndef CONFIG_S2IO_NAPI 4239#ifndef CONFIG_S2IO_NAPI
4344 for (i = 0; i < config->rx_ring_num; i++) { 4240 for (i = 0; i < config->rx_ring_num; i++)
4345 if (!sp->lro) { 4241 s2io_chk_rx_buffers(sp, i);
4346 int ret;
4347 int rxb_size = atomic_read(&sp->rx_bufs_left[i]);
4348 int level = rx_buffer_level(sp, rxb_size, i);
4349
4350 if ((level == PANIC) && (!TASKLET_IN_USE)) {
4351 DBG_PRINT(INTR_DBG, "%s: Rx BD hit ",
4352 dev->name);
4353 DBG_PRINT(INTR_DBG, "PANIC levels\n");
4354 if ((ret = fill_rx_buffers(sp, i)) == -ENOMEM) {
4355 DBG_PRINT(ERR_DBG, "%s:Out of memory",
4356 dev->name);
4357 DBG_PRINT(ERR_DBG, " in ISR!!\n");
4358 clear_bit(0, (&sp->tasklet_status));
4359 atomic_dec(&sp->isr_cnt);
4360 writeq(org_mask, &bar0->general_int_mask);
4361 return IRQ_HANDLED;
4362 }
4363 clear_bit(0, (&sp->tasklet_status));
4364 } else if (level == LOW) {
4365 tasklet_schedule(&sp->task);
4366 }
4367 }
4368 else if (fill_rx_buffers(sp, i) == -ENOMEM) {
4369 DBG_PRINT(ERR_DBG, "%s:Out of memory",
4370 dev->name);
4371 DBG_PRINT(ERR_DBG, " in Rx intr!!\n");
4372 break;
4373 }
4374 }
4375#endif 4242#endif
4376 writeq(org_mask, &bar0->general_int_mask); 4243 writeq(org_mask, &bar0->general_int_mask);
4377 atomic_dec(&sp->isr_cnt); 4244 atomic_dec(&sp->isr_cnt);
@@ -4401,6 +4268,8 @@ static void s2io_updt_stats(nic_t *sp)
4401 if (cnt == 5) 4268 if (cnt == 5)
4402 break; /* Updt failed */ 4269 break; /* Updt failed */
4403 } while(1); 4270 } while(1);
4271 } else {
4272 memset(sp->mac_control.stats_info, 0, sizeof(StatInfo_t));
4404 } 4273 }
4405} 4274}
4406 4275
@@ -5035,7 +4904,8 @@ static int write_eeprom(nic_t * sp, int off, u64 data, int cnt)
5035} 4904}
5036static void s2io_vpd_read(nic_t *nic) 4905static void s2io_vpd_read(nic_t *nic)
5037{ 4906{
5038 u8 vpd_data[256],data; 4907 u8 *vpd_data;
4908 u8 data;
5039 int i=0, cnt, fail = 0; 4909 int i=0, cnt, fail = 0;
5040 int vpd_addr = 0x80; 4910 int vpd_addr = 0x80;
5041 4911
@@ -5048,6 +4918,10 @@ static void s2io_vpd_read(nic_t *nic)
5048 vpd_addr = 0x50; 4918 vpd_addr = 0x50;
5049 } 4919 }
5050 4920
4921 vpd_data = kmalloc(256, GFP_KERNEL);
4922 if (!vpd_data)
4923 return;
4924
5051 for (i = 0; i < 256; i +=4 ) { 4925 for (i = 0; i < 256; i +=4 ) {
5052 pci_write_config_byte(nic->pdev, (vpd_addr + 2), i); 4926 pci_write_config_byte(nic->pdev, (vpd_addr + 2), i);
5053 pci_read_config_byte(nic->pdev, (vpd_addr + 2), &data); 4927 pci_read_config_byte(nic->pdev, (vpd_addr + 2), &data);
@@ -5070,6 +4944,7 @@ static void s2io_vpd_read(nic_t *nic)
5070 memset(nic->product_name, 0, vpd_data[1]); 4944 memset(nic->product_name, 0, vpd_data[1]);
5071 memcpy(nic->product_name, &vpd_data[3], vpd_data[1]); 4945 memcpy(nic->product_name, &vpd_data[3], vpd_data[1]);
5072 } 4946 }
4947 kfree(vpd_data);
5073} 4948}
5074 4949
5075/** 4950/**
@@ -5388,7 +5263,7 @@ static int s2io_link_test(nic_t * sp, uint64_t * data)
5388 else 5263 else
5389 *data = 0; 5264 *data = 0;
5390 5265
5391 return 0; 5266 return *data;
5392} 5267}
5393 5268
5394/** 5269/**
@@ -5846,6 +5721,19 @@ static int s2io_ethtool_op_set_tx_csum(struct net_device *dev, u32 data)
5846 return 0; 5721 return 0;
5847} 5722}
5848 5723
5724static u32 s2io_ethtool_op_get_tso(struct net_device *dev)
5725{
5726 return (dev->features & NETIF_F_TSO) != 0;
5727}
5728static int s2io_ethtool_op_set_tso(struct net_device *dev, u32 data)
5729{
5730 if (data)
5731 dev->features |= (NETIF_F_TSO | NETIF_F_TSO6);
5732 else
5733 dev->features &= ~(NETIF_F_TSO | NETIF_F_TSO6);
5734
5735 return 0;
5736}
5849 5737
5850static struct ethtool_ops netdev_ethtool_ops = { 5738static struct ethtool_ops netdev_ethtool_ops = {
5851 .get_settings = s2io_ethtool_gset, 5739 .get_settings = s2io_ethtool_gset,
@@ -5866,8 +5754,8 @@ static struct ethtool_ops netdev_ethtool_ops = {
5866 .get_sg = ethtool_op_get_sg, 5754 .get_sg = ethtool_op_get_sg,
5867 .set_sg = ethtool_op_set_sg, 5755 .set_sg = ethtool_op_set_sg,
5868#ifdef NETIF_F_TSO 5756#ifdef NETIF_F_TSO
5869 .get_tso = ethtool_op_get_tso, 5757 .get_tso = s2io_ethtool_op_get_tso,
5870 .set_tso = ethtool_op_set_tso, 5758 .set_tso = s2io_ethtool_op_set_tso,
5871#endif 5759#endif
5872 .get_ufo = ethtool_op_get_ufo, 5760 .get_ufo = ethtool_op_get_ufo,
5873 .set_ufo = ethtool_op_set_ufo, 5761 .set_ufo = ethtool_op_set_ufo,
@@ -5919,7 +5807,7 @@ static int s2io_change_mtu(struct net_device *dev, int new_mtu)
5919 5807
5920 dev->mtu = new_mtu; 5808 dev->mtu = new_mtu;
5921 if (netif_running(dev)) { 5809 if (netif_running(dev)) {
5922 s2io_card_down(sp, 0); 5810 s2io_card_down(sp);
5923 netif_stop_queue(dev); 5811 netif_stop_queue(dev);
5924 if (s2io_card_up(sp)) { 5812 if (s2io_card_up(sp)) {
5925 DBG_PRINT(ERR_DBG, "%s: Device bring up failed\n", 5813 DBG_PRINT(ERR_DBG, "%s: Device bring up failed\n",
@@ -6216,43 +6104,106 @@ static int rxd_owner_bit_reset(nic_t *sp)
6216 6104
6217} 6105}
6218 6106
6219static void s2io_card_down(nic_t * sp, int flag) 6107static int s2io_add_isr(nic_t * sp)
6220{ 6108{
6221 int cnt = 0; 6109 int ret = 0;
6222 XENA_dev_config_t __iomem *bar0 = sp->bar0;
6223 unsigned long flags;
6224 register u64 val64 = 0;
6225 struct net_device *dev = sp->dev; 6110 struct net_device *dev = sp->dev;
6111 int err = 0;
6226 6112
6227 del_timer_sync(&sp->alarm_timer); 6113 if (sp->intr_type == MSI)
6228 /* If s2io_set_link task is executing, wait till it completes. */ 6114 ret = s2io_enable_msi(sp);
6229 while (test_and_set_bit(0, &(sp->link_state))) { 6115 else if (sp->intr_type == MSI_X)
6230 msleep(50); 6116 ret = s2io_enable_msi_x(sp);
6117 if (ret) {
6118 DBG_PRINT(ERR_DBG, "%s: Defaulting to INTA\n", dev->name);
6119 sp->intr_type = INTA;
6231 } 6120 }
6232 atomic_set(&sp->card_state, CARD_DOWN);
6233 6121
6234 /* disable Tx and Rx traffic on the NIC */ 6122 /* Store the values of the MSIX table in the nic_t structure */
6235 stop_nic(sp); 6123 store_xmsi_data(sp);
6236 if (flag) {
6237 if (sp->intr_type == MSI_X) {
6238 int i;
6239 u16 msi_control;
6240 6124
6241 for (i=1; (sp->s2io_entries[i].in_use == 6125 /* After proper initialization of H/W, register ISR */
6242 MSIX_REGISTERED_SUCCESS); i++) { 6126 if (sp->intr_type == MSI) {
6243 int vector = sp->entries[i].vector; 6127 err = request_irq((int) sp->pdev->irq, s2io_msi_handle,
6244 void *arg = sp->s2io_entries[i].arg; 6128 IRQF_SHARED, sp->name, dev);
6129 if (err) {
6130 pci_disable_msi(sp->pdev);
6131 DBG_PRINT(ERR_DBG, "%s: MSI registration failed\n",
6132 dev->name);
6133 return -1;
6134 }
6135 }
6136 if (sp->intr_type == MSI_X) {
6137 int i;
6245 6138
6246 free_irq(vector, arg); 6139 for (i=1; (sp->s2io_entries[i].in_use == MSIX_FLG); i++) {
6140 if (sp->s2io_entries[i].type == MSIX_FIFO_TYPE) {
6141 sprintf(sp->desc[i], "%s:MSI-X-%d-TX",
6142 dev->name, i);
6143 err = request_irq(sp->entries[i].vector,
6144 s2io_msix_fifo_handle, 0, sp->desc[i],
6145 sp->s2io_entries[i].arg);
6146 DBG_PRINT(ERR_DBG, "%s @ 0x%llx\n", sp->desc[i],
6147 (unsigned long long)sp->msix_info[i].addr);
6148 } else {
6149 sprintf(sp->desc[i], "%s:MSI-X-%d-RX",
6150 dev->name, i);
6151 err = request_irq(sp->entries[i].vector,
6152 s2io_msix_ring_handle, 0, sp->desc[i],
6153 sp->s2io_entries[i].arg);
6154 DBG_PRINT(ERR_DBG, "%s @ 0x%llx\n", sp->desc[i],
6155 (unsigned long long)sp->msix_info[i].addr);
6247 } 6156 }
6248 pci_read_config_word(sp->pdev, 0x42, &msi_control); 6157 if (err) {
6249 msi_control &= 0xFFFE; /* Disable MSI */ 6158 DBG_PRINT(ERR_DBG,"%s:MSI-X-%d registration "
6250 pci_write_config_word(sp->pdev, 0x42, msi_control); 6159 "failed\n", dev->name, i);
6251 pci_disable_msix(sp->pdev); 6160 DBG_PRINT(ERR_DBG, "Returned: %d\n", err);
6252 } else { 6161 return -1;
6253 free_irq(sp->pdev->irq, dev); 6162 }
6254 if (sp->intr_type == MSI) 6163 sp->s2io_entries[i].in_use = MSIX_REGISTERED_SUCCESS;
6255 pci_disable_msi(sp->pdev); 6164 }
6165 }
6166 if (sp->intr_type == INTA) {
6167 err = request_irq((int) sp->pdev->irq, s2io_isr, IRQF_SHARED,
6168 sp->name, dev);
6169 if (err) {
6170 DBG_PRINT(ERR_DBG, "%s: ISR registration failed\n",
6171 dev->name);
6172 return -1;
6173 }
6174 }
6175 return 0;
6176}
6177static void s2io_rem_isr(nic_t * sp)
6178{
6179 int cnt = 0;
6180 struct net_device *dev = sp->dev;
6181
6182 if (sp->intr_type == MSI_X) {
6183 int i;
6184 u16 msi_control;
6185
6186 for (i=1; (sp->s2io_entries[i].in_use ==
6187 MSIX_REGISTERED_SUCCESS); i++) {
6188 int vector = sp->entries[i].vector;
6189 void *arg = sp->s2io_entries[i].arg;
6190
6191 free_irq(vector, arg);
6192 }
6193 pci_read_config_word(sp->pdev, 0x42, &msi_control);
6194 msi_control &= 0xFFFE; /* Disable MSI */
6195 pci_write_config_word(sp->pdev, 0x42, msi_control);
6196
6197 pci_disable_msix(sp->pdev);
6198 } else {
6199 free_irq(sp->pdev->irq, dev);
6200 if (sp->intr_type == MSI) {
6201 u16 val;
6202
6203 pci_disable_msi(sp->pdev);
6204 pci_read_config_word(sp->pdev, 0x4c, &val);
6205 val ^= 0x1;
6206 pci_write_config_word(sp->pdev, 0x4c, val);
6256 } 6207 }
6257 } 6208 }
6258 /* Waiting till all Interrupt handlers are complete */ 6209 /* Waiting till all Interrupt handlers are complete */
@@ -6263,6 +6214,26 @@ static void s2io_card_down(nic_t * sp, int flag)
6263 break; 6214 break;
6264 cnt++; 6215 cnt++;
6265 } while(cnt < 5); 6216 } while(cnt < 5);
6217}
6218
6219static void s2io_card_down(nic_t * sp)
6220{
6221 int cnt = 0;
6222 XENA_dev_config_t __iomem *bar0 = sp->bar0;
6223 unsigned long flags;
6224 register u64 val64 = 0;
6225
6226 del_timer_sync(&sp->alarm_timer);
6227 /* If s2io_set_link task is executing, wait till it completes. */
6228 while (test_and_set_bit(0, &(sp->link_state))) {
6229 msleep(50);
6230 }
6231 atomic_set(&sp->card_state, CARD_DOWN);
6232
6233 /* disable Tx and Rx traffic on the NIC */
6234 stop_nic(sp);
6235
6236 s2io_rem_isr(sp);
6266 6237
6267 /* Kill tasklet. */ 6238 /* Kill tasklet. */
6268 tasklet_kill(&sp->task); 6239 tasklet_kill(&sp->task);
@@ -6314,23 +6285,16 @@ static int s2io_card_up(nic_t * sp)
6314 mac_info_t *mac_control; 6285 mac_info_t *mac_control;
6315 struct config_param *config; 6286 struct config_param *config;
6316 struct net_device *dev = (struct net_device *) sp->dev; 6287 struct net_device *dev = (struct net_device *) sp->dev;
6288 u16 interruptible;
6317 6289
6318 /* Initialize the H/W I/O registers */ 6290 /* Initialize the H/W I/O registers */
6319 if (init_nic(sp) != 0) { 6291 if (init_nic(sp) != 0) {
6320 DBG_PRINT(ERR_DBG, "%s: H/W initialization failed\n", 6292 DBG_PRINT(ERR_DBG, "%s: H/W initialization failed\n",
6321 dev->name); 6293 dev->name);
6294 s2io_reset(sp);
6322 return -ENODEV; 6295 return -ENODEV;
6323 } 6296 }
6324 6297
6325 if (sp->intr_type == MSI)
6326 ret = s2io_enable_msi(sp);
6327 else if (sp->intr_type == MSI_X)
6328 ret = s2io_enable_msi_x(sp);
6329 if (ret) {
6330 DBG_PRINT(ERR_DBG, "%s: Defaulting to INTA\n", dev->name);
6331 sp->intr_type = INTA;
6332 }
6333
6334 /* 6298 /*
6335 * Initializing the Rx buffers. For now we are considering only 1 6299 * Initializing the Rx buffers. For now we are considering only 1
6336 * Rx ring and initializing buffers into 30 Rx blocks 6300 * Rx ring and initializing buffers into 30 Rx blocks
@@ -6354,28 +6318,46 @@ static int s2io_card_up(nic_t * sp)
6354 s2io_set_multicast(dev); 6318 s2io_set_multicast(dev);
6355 6319
6356 if (sp->lro) { 6320 if (sp->lro) {
6357 /* Initialize max aggregatable pkts based on MTU */ 6321 /* Initialize max aggregatable pkts per session based on MTU */
6358 sp->lro_max_aggr_per_sess = ((1<<16) - 1) / dev->mtu; 6322 sp->lro_max_aggr_per_sess = ((1<<16) - 1) / dev->mtu;
6359 /* Check if we can use(if specified) user provided value */ 6323 /* Check if we can use(if specified) user provided value */
6360 if (lro_max_pkts < sp->lro_max_aggr_per_sess) 6324 if (lro_max_pkts < sp->lro_max_aggr_per_sess)
6361 sp->lro_max_aggr_per_sess = lro_max_pkts; 6325 sp->lro_max_aggr_per_sess = lro_max_pkts;
6362 } 6326 }
6363 6327
6364 /* Enable tasklet for the device */
6365 tasklet_init(&sp->task, s2io_tasklet, (unsigned long) dev);
6366
6367 /* Enable Rx Traffic and interrupts on the NIC */ 6328 /* Enable Rx Traffic and interrupts on the NIC */
6368 if (start_nic(sp)) { 6329 if (start_nic(sp)) {
6369 DBG_PRINT(ERR_DBG, "%s: Starting NIC failed\n", dev->name); 6330 DBG_PRINT(ERR_DBG, "%s: Starting NIC failed\n", dev->name);
6370 tasklet_kill(&sp->task);
6371 s2io_reset(sp); 6331 s2io_reset(sp);
6372 free_irq(dev->irq, dev); 6332 free_rx_buffers(sp);
6333 return -ENODEV;
6334 }
6335
6336 /* Add interrupt service routine */
6337 if (s2io_add_isr(sp) != 0) {
6338 if (sp->intr_type == MSI_X)
6339 s2io_rem_isr(sp);
6340 s2io_reset(sp);
6373 free_rx_buffers(sp); 6341 free_rx_buffers(sp);
6374 return -ENODEV; 6342 return -ENODEV;
6375 } 6343 }
6376 6344
6377 S2IO_TIMER_CONF(sp->alarm_timer, s2io_alarm_handle, sp, (HZ/2)); 6345 S2IO_TIMER_CONF(sp->alarm_timer, s2io_alarm_handle, sp, (HZ/2));
6378 6346
6347 /* Enable tasklet for the device */
6348 tasklet_init(&sp->task, s2io_tasklet, (unsigned long) dev);
6349
6350 /* Enable select interrupts */
6351 if (sp->intr_type != INTA)
6352 en_dis_able_nic_intrs(sp, ENA_ALL_INTRS, DISABLE_INTRS);
6353 else {
6354 interruptible = TX_TRAFFIC_INTR | RX_TRAFFIC_INTR;
6355 interruptible |= TX_PIC_INTR | RX_PIC_INTR;
6356 interruptible |= TX_MAC_INTR | RX_MAC_INTR;
6357 en_dis_able_nic_intrs(sp, interruptible, ENABLE_INTRS);
6358 }
6359
6360
6379 atomic_set(&sp->card_state, CARD_UP); 6361 atomic_set(&sp->card_state, CARD_UP);
6380 return 0; 6362 return 0;
6381} 6363}
@@ -6395,7 +6377,7 @@ static void s2io_restart_nic(unsigned long data)
6395 struct net_device *dev = (struct net_device *) data; 6377 struct net_device *dev = (struct net_device *) data;
6396 nic_t *sp = dev->priv; 6378 nic_t *sp = dev->priv;
6397 6379
6398 s2io_card_down(sp, 0); 6380 s2io_card_down(sp);
6399 if (s2io_card_up(sp)) { 6381 if (s2io_card_up(sp)) {
6400 DBG_PRINT(ERR_DBG, "%s: Device bring up failed\n", 6382 DBG_PRINT(ERR_DBG, "%s: Device bring up failed\n",
6401 dev->name); 6383 dev->name);
@@ -6437,7 +6419,7 @@ static void s2io_tx_watchdog(struct net_device *dev)
6437 * @cksum : FCS checksum of the frame. 6419 * @cksum : FCS checksum of the frame.
6438 * @ring_no : the ring from which this RxD was extracted. 6420 * @ring_no : the ring from which this RxD was extracted.
6439 * Description: 6421 * Description:
6440 * This function is called by the Tx interrupt serivce routine to perform 6422 * This function is called by the Rx interrupt serivce routine to perform
6441 * some OS related operations on the SKB before passing it to the upper 6423 * some OS related operations on the SKB before passing it to the upper
6442 * layers. It mainly checks if the checksum is OK, if so adds it to the 6424 * layers. It mainly checks if the checksum is OK, if so adds it to the
6443 * SKBs cksum variable, increments the Rx packet count and passes the SKB 6425 * SKBs cksum variable, increments the Rx packet count and passes the SKB
@@ -6697,33 +6679,6 @@ static void s2io_init_pci(nic_t * sp)
6697 pci_read_config_word(sp->pdev, PCI_COMMAND, &pci_cmd); 6679 pci_read_config_word(sp->pdev, PCI_COMMAND, &pci_cmd);
6698} 6680}
6699 6681
6700MODULE_AUTHOR("Raghavendra Koushik <raghavendra.koushik@neterion.com>");
6701MODULE_LICENSE("GPL");
6702MODULE_VERSION(DRV_VERSION);
6703
6704module_param(tx_fifo_num, int, 0);
6705module_param(rx_ring_num, int, 0);
6706module_param(rx_ring_mode, int, 0);
6707module_param_array(tx_fifo_len, uint, NULL, 0);
6708module_param_array(rx_ring_sz, uint, NULL, 0);
6709module_param_array(rts_frm_len, uint, NULL, 0);
6710module_param(use_continuous_tx_intrs, int, 1);
6711module_param(rmac_pause_time, int, 0);
6712module_param(mc_pause_threshold_q0q3, int, 0);
6713module_param(mc_pause_threshold_q4q7, int, 0);
6714module_param(shared_splits, int, 0);
6715module_param(tmac_util_period, int, 0);
6716module_param(rmac_util_period, int, 0);
6717module_param(bimodal, bool, 0);
6718module_param(l3l4hdr_size, int , 0);
6719#ifndef CONFIG_S2IO_NAPI
6720module_param(indicate_max_pkts, int, 0);
6721#endif
6722module_param(rxsync_frequency, int, 0);
6723module_param(intr_type, int, 0);
6724module_param(lro, int, 0);
6725module_param(lro_max_pkts, int, 0);
6726
6727static int s2io_verify_parm(struct pci_dev *pdev, u8 *dev_intr_type) 6682static int s2io_verify_parm(struct pci_dev *pdev, u8 *dev_intr_type)
6728{ 6683{
6729 if ( tx_fifo_num > 8) { 6684 if ( tx_fifo_num > 8) {
@@ -6831,8 +6786,8 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
6831 } 6786 }
6832 if (dev_intr_type != MSI_X) { 6787 if (dev_intr_type != MSI_X) {
6833 if (pci_request_regions(pdev, s2io_driver_name)) { 6788 if (pci_request_regions(pdev, s2io_driver_name)) {
6834 DBG_PRINT(ERR_DBG, "Request Regions failed\n"), 6789 DBG_PRINT(ERR_DBG, "Request Regions failed\n");
6835 pci_disable_device(pdev); 6790 pci_disable_device(pdev);
6836 return -ENODEV; 6791 return -ENODEV;
6837 } 6792 }
6838 } 6793 }
@@ -6956,7 +6911,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
6956 /* initialize the shared memory used by the NIC and the host */ 6911 /* initialize the shared memory used by the NIC and the host */
6957 if (init_shared_mem(sp)) { 6912 if (init_shared_mem(sp)) {
6958 DBG_PRINT(ERR_DBG, "%s: Memory allocation failed\n", 6913 DBG_PRINT(ERR_DBG, "%s: Memory allocation failed\n",
6959 __FUNCTION__); 6914 dev->name);
6960 ret = -ENOMEM; 6915 ret = -ENOMEM;
6961 goto mem_alloc_failed; 6916 goto mem_alloc_failed;
6962 } 6917 }
@@ -7093,6 +7048,9 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
7093 dev->addr_len = ETH_ALEN; 7048 dev->addr_len = ETH_ALEN;
7094 memcpy(dev->dev_addr, sp->def_mac_addr, ETH_ALEN); 7049 memcpy(dev->dev_addr, sp->def_mac_addr, ETH_ALEN);
7095 7050
7051 /* reset Nic and bring it to known state */
7052 s2io_reset(sp);
7053
7096 /* 7054 /*
7097 * Initialize the tasklet status and link state flags 7055 * Initialize the tasklet status and link state flags
7098 * and the card state parameter 7056 * and the card state parameter
@@ -7130,11 +7088,11 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
7130 goto register_failed; 7088 goto register_failed;
7131 } 7089 }
7132 s2io_vpd_read(sp); 7090 s2io_vpd_read(sp);
7133 DBG_PRINT(ERR_DBG, "%s: Neterion %s",dev->name, sp->product_name);
7134 DBG_PRINT(ERR_DBG, "(rev %d), Driver version %s\n",
7135 get_xena_rev_id(sp->pdev),
7136 s2io_driver_version);
7137 DBG_PRINT(ERR_DBG, "Copyright(c) 2002-2005 Neterion Inc.\n"); 7091 DBG_PRINT(ERR_DBG, "Copyright(c) 2002-2005 Neterion Inc.\n");
7092 DBG_PRINT(ERR_DBG, "%s: Neterion %s (rev %d)\n",dev->name,
7093 sp->product_name, get_xena_rev_id(sp->pdev));
7094 DBG_PRINT(ERR_DBG, "%s: Driver version %s\n", dev->name,
7095 s2io_driver_version);
7138 DBG_PRINT(ERR_DBG, "%s: MAC ADDR: " 7096 DBG_PRINT(ERR_DBG, "%s: MAC ADDR: "
7139 "%02x:%02x:%02x:%02x:%02x:%02x\n", dev->name, 7097 "%02x:%02x:%02x:%02x:%02x:%02x\n", dev->name,
7140 sp->def_mac_addr[0].mac_addr[0], 7098 sp->def_mac_addr[0].mac_addr[0],
@@ -7435,8 +7393,13 @@ static int verify_l3_l4_lro_capable(lro_t *l_lro, struct iphdr *ip,
7435 if (ip->ihl != 5) /* IP has options */ 7393 if (ip->ihl != 5) /* IP has options */
7436 return -1; 7394 return -1;
7437 7395
7396 /* If we see CE codepoint in IP header, packet is not mergeable */
7397 if (INET_ECN_is_ce(ipv4_get_dsfield(ip)))
7398 return -1;
7399
7400 /* If we see ECE or CWR flags in TCP header, packet is not mergeable */
7438 if (tcp->urg || tcp->psh || tcp->rst || tcp->syn || tcp->fin || 7401 if (tcp->urg || tcp->psh || tcp->rst || tcp->syn || tcp->fin ||
7439 !tcp->ack) { 7402 tcp->ece || tcp->cwr || !tcp->ack) {
7440 /* 7403 /*
7441 * Currently recognize only the ack control word and 7404 * Currently recognize only the ack control word and
7442 * any other control field being set would result in 7405 * any other control field being set would result in
@@ -7590,18 +7553,16 @@ static void queue_rx_frame(struct sk_buff *skb)
7590static void lro_append_pkt(nic_t *sp, lro_t *lro, struct sk_buff *skb, 7553static void lro_append_pkt(nic_t *sp, lro_t *lro, struct sk_buff *skb,
7591 u32 tcp_len) 7554 u32 tcp_len)
7592{ 7555{
7593 struct sk_buff *tmp, *first = lro->parent; 7556 struct sk_buff *first = lro->parent;
7594 7557
7595 first->len += tcp_len; 7558 first->len += tcp_len;
7596 first->data_len = lro->frags_len; 7559 first->data_len = lro->frags_len;
7597 skb_pull(skb, (skb->len - tcp_len)); 7560 skb_pull(skb, (skb->len - tcp_len));
7598 if ((tmp = skb_shinfo(first)->frag_list)) { 7561 if (skb_shinfo(first)->frag_list)
7599 while (tmp->next) 7562 lro->last_frag->next = skb;
7600 tmp = tmp->next;
7601 tmp->next = skb;
7602 }
7603 else 7563 else
7604 skb_shinfo(first)->frag_list = skb; 7564 skb_shinfo(first)->frag_list = skb;
7565 lro->last_frag = skb;
7605 sp->mac_control.stats_info->sw_stat.clubbed_frms_cnt++; 7566 sp->mac_control.stats_info->sw_stat.clubbed_frms_cnt++;
7606 return; 7567 return;
7607} 7568}
diff --git a/drivers/net/s2io.h b/drivers/net/s2io.h
index c43f52179708..5ed49c3be1e9 100644
--- a/drivers/net/s2io.h
+++ b/drivers/net/s2io.h
@@ -719,6 +719,7 @@ struct msix_info_st {
719/* Data structure to represent a LRO session */ 719/* Data structure to represent a LRO session */
720typedef struct lro { 720typedef struct lro {
721 struct sk_buff *parent; 721 struct sk_buff *parent;
722 struct sk_buff *last_frag;
722 u8 *l2h; 723 u8 *l2h;
723 struct iphdr *iph; 724 struct iphdr *iph;
724 struct tcphdr *tcph; 725 struct tcphdr *tcph;
@@ -829,8 +830,7 @@ struct s2io_nic {
829#define MSIX_FLG 0xA5 830#define MSIX_FLG 0xA5
830 struct msix_entry *entries; 831 struct msix_entry *entries;
831 struct s2io_msix_entry *s2io_entries; 832 struct s2io_msix_entry *s2io_entries;
832 char desc1[35]; 833 char desc[MAX_REQUESTED_MSI_X][25];
833 char desc2[35];
834 834
835 int avail_msix_vectors; /* No. of MSI-X vectors granted by system */ 835 int avail_msix_vectors; /* No. of MSI-X vectors granted by system */
836 836
@@ -1002,7 +1002,7 @@ static int verify_xena_quiescence(nic_t *sp, u64 val64, int flag);
1002static struct ethtool_ops netdev_ethtool_ops; 1002static struct ethtool_ops netdev_ethtool_ops;
1003static void s2io_set_link(unsigned long data); 1003static void s2io_set_link(unsigned long data);
1004static int s2io_set_swapper(nic_t * sp); 1004static int s2io_set_swapper(nic_t * sp);
1005static void s2io_card_down(nic_t *nic, int flag); 1005static void s2io_card_down(nic_t *nic);
1006static int s2io_card_up(nic_t *nic); 1006static int s2io_card_up(nic_t *nic);
1007static int get_xena_rev_id(struct pci_dev *pdev); 1007static int get_xena_rev_id(struct pci_dev *pdev);
1008static void restore_xmsi_data(nic_t *nic); 1008static void restore_xmsi_data(nic_t *nic);
@@ -1012,4 +1012,13 @@ static void clear_lro_session(lro_t *lro);
1012static void queue_rx_frame(struct sk_buff *skb); 1012static void queue_rx_frame(struct sk_buff *skb);
1013static void update_L3L4_header(nic_t *sp, lro_t *lro); 1013static void update_L3L4_header(nic_t *sp, lro_t *lro);
1014static void lro_append_pkt(nic_t *sp, lro_t *lro, struct sk_buff *skb, u32 tcp_len); 1014static void lro_append_pkt(nic_t *sp, lro_t *lro, struct sk_buff *skb, u32 tcp_len);
1015
1016#define s2io_tcp_mss(skb) skb_shinfo(skb)->gso_size
1017#define s2io_udp_mss(skb) skb_shinfo(skb)->gso_size
1018#define s2io_offload_type(skb) skb_shinfo(skb)->gso_type
1019
1020#define S2IO_PARM_INT(X, def_val) \
1021 static unsigned int X = def_val;\
1022 module_param(X , uint, 0);
1023
1015#endif /* _S2IO_H */ 1024#endif /* _S2IO_H */
diff --git a/drivers/net/sk98lin/h/xmac_ii.h b/drivers/net/sk98lin/h/xmac_ii.h
index 2b19f8ad0318..7f8e6d0084c7 100644
--- a/drivers/net/sk98lin/h/xmac_ii.h
+++ b/drivers/net/sk98lin/h/xmac_ii.h
@@ -1473,7 +1473,7 @@ extern "C" {
1473#define GM_TXCR_FORCE_JAM (1<<15) /* Bit 15: Force Jam / Flow-Control */ 1473#define GM_TXCR_FORCE_JAM (1<<15) /* Bit 15: Force Jam / Flow-Control */
1474#define GM_TXCR_CRC_DIS (1<<14) /* Bit 14: Disable insertion of CRC */ 1474#define GM_TXCR_CRC_DIS (1<<14) /* Bit 14: Disable insertion of CRC */
1475#define GM_TXCR_PAD_DIS (1<<13) /* Bit 13: Disable padding of packets */ 1475#define GM_TXCR_PAD_DIS (1<<13) /* Bit 13: Disable padding of packets */
1476#define GM_TXCR_COL_THR_MSK (1<<10) /* Bit 12..10: Collision Threshold */ 1476#define GM_TXCR_COL_THR_MSK (7<<10) /* Bit 12..10: Collision Threshold */
1477 1477
1478#define TX_COL_THR(x) (SHIFT10(x) & GM_TXCR_COL_THR_MSK) 1478#define TX_COL_THR(x) (SHIFT10(x) & GM_TXCR_COL_THR_MSK)
1479 1479
diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index 82200bfaa8ed..7de9a07b2ac2 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -516,10 +516,7 @@ static int skge_set_pauseparam(struct net_device *dev,
516/* Chip internal frequency for clock calculations */ 516/* Chip internal frequency for clock calculations */
517static inline u32 hwkhz(const struct skge_hw *hw) 517static inline u32 hwkhz(const struct skge_hw *hw)
518{ 518{
519 if (hw->chip_id == CHIP_ID_GENESIS) 519 return (hw->chip_id == CHIP_ID_GENESIS) ? 53125 : 78125;
520 return 53215; /* or: 53.125 MHz */
521 else
522 return 78215; /* or: 78.125 MHz */
523} 520}
524 521
525/* Chip HZ to microseconds */ 522/* Chip HZ to microseconds */
diff --git a/drivers/net/skge.h b/drivers/net/skge.h
index ed19ff47ce11..593387b3c0dd 100644
--- a/drivers/net/skge.h
+++ b/drivers/net/skge.h
@@ -1734,11 +1734,11 @@ enum {
1734 GM_TXCR_FORCE_JAM = 1<<15, /* Bit 15: Force Jam / Flow-Control */ 1734 GM_TXCR_FORCE_JAM = 1<<15, /* Bit 15: Force Jam / Flow-Control */
1735 GM_TXCR_CRC_DIS = 1<<14, /* Bit 14: Disable insertion of CRC */ 1735 GM_TXCR_CRC_DIS = 1<<14, /* Bit 14: Disable insertion of CRC */
1736 GM_TXCR_PAD_DIS = 1<<13, /* Bit 13: Disable padding of packets */ 1736 GM_TXCR_PAD_DIS = 1<<13, /* Bit 13: Disable padding of packets */
1737 GM_TXCR_COL_THR_MSK = 1<<10, /* Bit 12..10: Collision Threshold */ 1737 GM_TXCR_COL_THR_MSK = 7<<10, /* Bit 12..10: Collision Threshold */
1738}; 1738};
1739 1739
1740#define TX_COL_THR(x) (((x)<<10) & GM_TXCR_COL_THR_MSK) 1740#define TX_COL_THR(x) (((x)<<10) & GM_TXCR_COL_THR_MSK)
1741#define TX_COL_DEF 0x04 1741#define TX_COL_DEF 0x04 /* late collision after 64 byte */
1742 1742
1743/* GM_RX_CTRL 16 bit r/w Receive Control Register */ 1743/* GM_RX_CTRL 16 bit r/w Receive Control Register */
1744enum { 1744enum {
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 418f169a6a31..de91609ca112 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -50,7 +50,7 @@
50#include "sky2.h" 50#include "sky2.h"
51 51
52#define DRV_NAME "sky2" 52#define DRV_NAME "sky2"
53#define DRV_VERSION "1.4" 53#define DRV_VERSION "1.5"
54#define PFX DRV_NAME " " 54#define PFX DRV_NAME " "
55 55
56/* 56/*
@@ -65,6 +65,7 @@
65#define RX_MAX_PENDING (RX_LE_SIZE/2 - 2) 65#define RX_MAX_PENDING (RX_LE_SIZE/2 - 2)
66#define RX_DEF_PENDING RX_MAX_PENDING 66#define RX_DEF_PENDING RX_MAX_PENDING
67#define RX_SKB_ALIGN 8 67#define RX_SKB_ALIGN 8
68#define RX_BUF_WRITE 16
68 69
69#define TX_RING_SIZE 512 70#define TX_RING_SIZE 512
70#define TX_DEF_PENDING (TX_RING_SIZE - 1) 71#define TX_DEF_PENDING (TX_RING_SIZE - 1)
@@ -234,7 +235,6 @@ static void sky2_set_power_state(struct sky2_hw *hw, pci_power_t state)
234 } 235 }
235 236
236 if (hw->chip_id == CHIP_ID_YUKON_EC_U) { 237 if (hw->chip_id == CHIP_ID_YUKON_EC_U) {
237 sky2_write16(hw, B0_CTST, Y2_HW_WOL_ON);
238 sky2_pci_write32(hw, PCI_DEV_REG3, 0); 238 sky2_pci_write32(hw, PCI_DEV_REG3, 0);
239 reg1 = sky2_pci_read32(hw, PCI_DEV_REG4); 239 reg1 = sky2_pci_read32(hw, PCI_DEV_REG4);
240 reg1 &= P_ASPM_CONTROL_MSK; 240 reg1 &= P_ASPM_CONTROL_MSK;
@@ -243,6 +243,7 @@ static void sky2_set_power_state(struct sky2_hw *hw, pci_power_t state)
243 } 243 }
244 244
245 sky2_pci_write32(hw, PCI_DEV_REG1, reg1); 245 sky2_pci_write32(hw, PCI_DEV_REG1, reg1);
246 udelay(100);
246 247
247 break; 248 break;
248 249
@@ -255,6 +256,7 @@ static void sky2_set_power_state(struct sky2_hw *hw, pci_power_t state)
255 else 256 else
256 reg1 |= (PCI_Y2_PHY1_POWD | PCI_Y2_PHY2_POWD); 257 reg1 |= (PCI_Y2_PHY1_POWD | PCI_Y2_PHY2_POWD);
257 sky2_pci_write32(hw, PCI_DEV_REG1, reg1); 258 sky2_pci_write32(hw, PCI_DEV_REG1, reg1);
259 udelay(100);
258 260
259 if (hw->chip_id == CHIP_ID_YUKON_XL && hw->chip_rev > 1) 261 if (hw->chip_id == CHIP_ID_YUKON_XL && hw->chip_rev > 1)
260 sky2_write8(hw, B2_Y2_CLK_GATE, 0); 262 sky2_write8(hw, B2_Y2_CLK_GATE, 0);
@@ -1159,7 +1161,7 @@ static unsigned tx_le_req(const struct sk_buff *skb)
1159 count = sizeof(dma_addr_t) / sizeof(u32); 1161 count = sizeof(dma_addr_t) / sizeof(u32);
1160 count += skb_shinfo(skb)->nr_frags * count; 1162 count += skb_shinfo(skb)->nr_frags * count;
1161 1163
1162 if (skb_shinfo(skb)->gso_size) 1164 if (skb_is_gso(skb))
1163 ++count; 1165 ++count;
1164 1166
1165 if (skb->ip_summed == CHECKSUM_HW) 1167 if (skb->ip_summed == CHECKSUM_HW)
@@ -1389,7 +1391,7 @@ static void sky2_tx_complete(struct sky2_port *sky2, u16 done)
1389 } 1391 }
1390 1392
1391 sky2->tx_cons = put; 1393 sky2->tx_cons = put;
1392 if (tx_avail(sky2) > MAX_SKB_TX_LE) 1394 if (tx_avail(sky2) > MAX_SKB_TX_LE + 4)
1393 netif_wake_queue(dev); 1395 netif_wake_queue(dev);
1394} 1396}
1395 1397
@@ -1888,9 +1890,6 @@ resubmit:
1888 re->skb->ip_summed = CHECKSUM_NONE; 1890 re->skb->ip_summed = CHECKSUM_NONE;
1889 sky2_rx_add(sky2, re->mapaddr); 1891 sky2_rx_add(sky2, re->mapaddr);
1890 1892
1891 /* Tell receiver about new buffers. */
1892 sky2_put_idx(sky2->hw, rxqaddr[sky2->port], sky2->rx_put);
1893
1894 return skb; 1893 return skb;
1895 1894
1896oversize: 1895oversize:
@@ -1937,7 +1936,9 @@ static inline int sky2_more_work(const struct sky2_hw *hw)
1937/* Process status response ring */ 1936/* Process status response ring */
1938static int sky2_status_intr(struct sky2_hw *hw, int to_do) 1937static int sky2_status_intr(struct sky2_hw *hw, int to_do)
1939{ 1938{
1939 struct sky2_port *sky2;
1940 int work_done = 0; 1940 int work_done = 0;
1941 unsigned buf_write[2] = { 0, 0 };
1941 u16 hwidx = sky2_read16(hw, STAT_PUT_IDX); 1942 u16 hwidx = sky2_read16(hw, STAT_PUT_IDX);
1942 1943
1943 rmb(); 1944 rmb();
@@ -1945,7 +1946,6 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do)
1945 while (hw->st_idx != hwidx) { 1946 while (hw->st_idx != hwidx) {
1946 struct sky2_status_le *le = hw->st_le + hw->st_idx; 1947 struct sky2_status_le *le = hw->st_le + hw->st_idx;
1947 struct net_device *dev; 1948 struct net_device *dev;
1948 struct sky2_port *sky2;
1949 struct sk_buff *skb; 1949 struct sk_buff *skb;
1950 u32 status; 1950 u32 status;
1951 u16 length; 1951 u16 length;
@@ -1978,6 +1978,14 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do)
1978#endif 1978#endif
1979 netif_receive_skb(skb); 1979 netif_receive_skb(skb);
1980 1980
1981 /* Update receiver after 16 frames */
1982 if (++buf_write[le->link] == RX_BUF_WRITE) {
1983 sky2_put_idx(hw, rxqaddr[le->link],
1984 sky2->rx_put);
1985 buf_write[le->link] = 0;
1986 }
1987
1988 /* Stop after net poll weight */
1981 if (++work_done >= to_do) 1989 if (++work_done >= to_do)
1982 goto exit_loop; 1990 goto exit_loop;
1983 break; 1991 break;
@@ -2016,6 +2024,16 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do)
2016 } 2024 }
2017 2025
2018exit_loop: 2026exit_loop:
2027 if (buf_write[0]) {
2028 sky2 = netdev_priv(hw->dev[0]);
2029 sky2_put_idx(hw, Q_R1, sky2->rx_put);
2030 }
2031
2032 if (buf_write[1]) {
2033 sky2 = netdev_priv(hw->dev[1]);
2034 sky2_put_idx(hw, Q_R2, sky2->rx_put);
2035 }
2036
2019 return work_done; 2037 return work_done;
2020} 2038}
2021 2039
@@ -2186,9 +2204,6 @@ static int sky2_poll(struct net_device *dev0, int *budget)
2186 int work_done = 0; 2204 int work_done = 0;
2187 u32 status = sky2_read32(hw, B0_Y2_SP_EISR); 2205 u32 status = sky2_read32(hw, B0_Y2_SP_EISR);
2188 2206
2189 if (!~status)
2190 goto out;
2191
2192 if (status & Y2_IS_HW_ERR) 2207 if (status & Y2_IS_HW_ERR)
2193 sky2_hw_intr(hw); 2208 sky2_hw_intr(hw);
2194 2209
@@ -2225,7 +2240,7 @@ static int sky2_poll(struct net_device *dev0, int *budget)
2225 2240
2226 if (sky2_more_work(hw)) 2241 if (sky2_more_work(hw))
2227 return 1; 2242 return 1;
2228out: 2243
2229 netif_rx_complete(dev0); 2244 netif_rx_complete(dev0);
2230 2245
2231 sky2_read32(hw, B0_Y2_SP_LISR); 2246 sky2_read32(hw, B0_Y2_SP_LISR);
@@ -2286,7 +2301,7 @@ static inline u32 sky2_clk2us(const struct sky2_hw *hw, u32 clk)
2286} 2301}
2287 2302
2288 2303
2289static int __devinit sky2_reset(struct sky2_hw *hw) 2304static int sky2_reset(struct sky2_hw *hw)
2290{ 2305{
2291 u16 status; 2306 u16 status;
2292 u8 t8, pmd_type; 2307 u8 t8, pmd_type;
@@ -3437,17 +3452,14 @@ static int sky2_suspend(struct pci_dev *pdev, pm_message_t state)
3437 return -EINVAL; 3452 return -EINVAL;
3438 3453
3439 del_timer_sync(&hw->idle_timer); 3454 del_timer_sync(&hw->idle_timer);
3455 netif_poll_disable(hw->dev[0]);
3440 3456
3441 for (i = 0; i < hw->ports; i++) { 3457 for (i = 0; i < hw->ports; i++) {
3442 struct net_device *dev = hw->dev[i]; 3458 struct net_device *dev = hw->dev[i];
3443 3459
3444 if (dev) { 3460 if (netif_running(dev)) {
3445 if (!netif_running(dev))
3446 continue;
3447
3448 sky2_down(dev); 3461 sky2_down(dev);
3449 netif_device_detach(dev); 3462 netif_device_detach(dev);
3450 netif_poll_disable(dev);
3451 } 3463 }
3452 } 3464 }
3453 3465
@@ -3474,9 +3486,8 @@ static int sky2_resume(struct pci_dev *pdev)
3474 3486
3475 for (i = 0; i < hw->ports; i++) { 3487 for (i = 0; i < hw->ports; i++) {
3476 struct net_device *dev = hw->dev[i]; 3488 struct net_device *dev = hw->dev[i];
3477 if (dev && netif_running(dev)) { 3489 if (netif_running(dev)) {
3478 netif_device_attach(dev); 3490 netif_device_attach(dev);
3479 netif_poll_enable(dev);
3480 3491
3481 err = sky2_up(dev); 3492 err = sky2_up(dev);
3482 if (err) { 3493 if (err) {
@@ -3488,6 +3499,7 @@ static int sky2_resume(struct pci_dev *pdev)
3488 } 3499 }
3489 } 3500 }
3490 3501
3502 netif_poll_enable(hw->dev[0]);
3491 sky2_idle_start(hw); 3503 sky2_idle_start(hw);
3492out: 3504out:
3493 return err; 3505 return err;
diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h
index 8a0bc5525f0a..2db8d19b22d1 100644
--- a/drivers/net/sky2.h
+++ b/drivers/net/sky2.h
@@ -1480,7 +1480,7 @@ enum {
1480 GM_TXCR_FORCE_JAM = 1<<15, /* Bit 15: Force Jam / Flow-Control */ 1480 GM_TXCR_FORCE_JAM = 1<<15, /* Bit 15: Force Jam / Flow-Control */
1481 GM_TXCR_CRC_DIS = 1<<14, /* Bit 14: Disable insertion of CRC */ 1481 GM_TXCR_CRC_DIS = 1<<14, /* Bit 14: Disable insertion of CRC */
1482 GM_TXCR_PAD_DIS = 1<<13, /* Bit 13: Disable padding of packets */ 1482 GM_TXCR_PAD_DIS = 1<<13, /* Bit 13: Disable padding of packets */
1483 GM_TXCR_COL_THR_MSK = 1<<10, /* Bit 12..10: Collision Threshold */ 1483 GM_TXCR_COL_THR_MSK = 7<<10, /* Bit 12..10: Collision Threshold */
1484}; 1484};
1485 1485
1486#define TX_COL_THR(x) (((x)<<10) & GM_TXCR_COL_THR_MSK) 1486#define TX_COL_THR(x) (((x)<<10) & GM_TXCR_COL_THR_MSK)
diff --git a/drivers/net/smc91x.h b/drivers/net/smc91x.h
index b4028049ed76..4ec4b4d23ae5 100644
--- a/drivers/net/smc91x.h
+++ b/drivers/net/smc91x.h
@@ -354,6 +354,24 @@ static inline void LPD7_SMC_outsw (unsigned char* a, int r,
354 354
355#define SMC_IRQ_FLAGS (0) 355#define SMC_IRQ_FLAGS (0)
356 356
357#elif defined(CONFIG_ARCH_VERSATILE)
358
359#define SMC_CAN_USE_8BIT 1
360#define SMC_CAN_USE_16BIT 1
361#define SMC_CAN_USE_32BIT 1
362#define SMC_NOWAIT 1
363
364#define SMC_inb(a, r) readb((a) + (r))
365#define SMC_inw(a, r) readw((a) + (r))
366#define SMC_inl(a, r) readl((a) + (r))
367#define SMC_outb(v, a, r) writeb(v, (a) + (r))
368#define SMC_outw(v, a, r) writew(v, (a) + (r))
369#define SMC_outl(v, a, r) writel(v, (a) + (r))
370#define SMC_insl(a, r, p, l) readsl((a) + (r), p, l)
371#define SMC_outsl(a, r, p, l) writesl((a) + (r), p, l)
372
373#define SMC_IRQ_FLAGS (0)
374
357#else 375#else
358 376
359#define SMC_CAN_USE_8BIT 1 377#define SMC_CAN_USE_8BIT 1
diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c
index fb1d5a8a45cf..647f62e9707d 100644
--- a/drivers/net/spider_net.c
+++ b/drivers/net/spider_net.c
@@ -84,7 +84,7 @@ MODULE_DEVICE_TABLE(pci, spider_net_pci_tbl);
84 * 84 *
85 * returns the content of the specified SMMIO register. 85 * returns the content of the specified SMMIO register.
86 */ 86 */
87static u32 87static inline u32
88spider_net_read_reg(struct spider_net_card *card, u32 reg) 88spider_net_read_reg(struct spider_net_card *card, u32 reg)
89{ 89{
90 u32 value; 90 u32 value;
@@ -101,7 +101,7 @@ spider_net_read_reg(struct spider_net_card *card, u32 reg)
101 * @reg: register to write to 101 * @reg: register to write to
102 * @value: value to write into the specified SMMIO register 102 * @value: value to write into the specified SMMIO register
103 */ 103 */
104static void 104static inline void
105spider_net_write_reg(struct spider_net_card *card, u32 reg, u32 value) 105spider_net_write_reg(struct spider_net_card *card, u32 reg, u32 value)
106{ 106{
107 value = cpu_to_le32(value); 107 value = cpu_to_le32(value);
@@ -259,39 +259,10 @@ spider_net_get_mac_address(struct net_device *netdev)
259 * 259 *
260 * returns the status as in the dmac_cmd_status field of the descriptor 260 * returns the status as in the dmac_cmd_status field of the descriptor
261 */ 261 */
262static enum spider_net_descr_status 262static inline int
263spider_net_get_descr_status(struct spider_net_descr *descr) 263spider_net_get_descr_status(struct spider_net_descr *descr)
264{ 264{
265 u32 cmd_status; 265 return descr->dmac_cmd_status & SPIDER_NET_DESCR_IND_PROC_MASK;
266
267 cmd_status = descr->dmac_cmd_status;
268 cmd_status >>= SPIDER_NET_DESCR_IND_PROC_SHIFT;
269 /* no need to mask out any bits, as cmd_status is 32 bits wide only
270 * (and unsigned) */
271 return cmd_status;
272}
273
274/**
275 * spider_net_set_descr_status -- sets the status of a descriptor
276 * @descr: descriptor to change
277 * @status: status to set in the descriptor
278 *
279 * changes the status to the specified value. Doesn't change other bits
280 * in the status
281 */
282static void
283spider_net_set_descr_status(struct spider_net_descr *descr,
284 enum spider_net_descr_status status)
285{
286 u32 cmd_status;
287 /* read the status */
288 cmd_status = descr->dmac_cmd_status;
289 /* clean the upper 4 bits */
290 cmd_status &= SPIDER_NET_DESCR_IND_PROC_MASKO;
291 /* add the status to it */
292 cmd_status |= ((u32)status)<<SPIDER_NET_DESCR_IND_PROC_SHIFT;
293 /* and write it back */
294 descr->dmac_cmd_status = cmd_status;
295} 266}
296 267
297/** 268/**
@@ -328,24 +299,23 @@ spider_net_free_chain(struct spider_net_card *card,
328static int 299static int
329spider_net_init_chain(struct spider_net_card *card, 300spider_net_init_chain(struct spider_net_card *card,
330 struct spider_net_descr_chain *chain, 301 struct spider_net_descr_chain *chain,
331 struct spider_net_descr *start_descr, int no) 302 struct spider_net_descr *start_descr,
303 int direction, int no)
332{ 304{
333 int i; 305 int i;
334 struct spider_net_descr *descr; 306 struct spider_net_descr *descr;
335 dma_addr_t buf; 307 dma_addr_t buf;
336 308
337 atomic_set(&card->rx_chain_refill,0);
338
339 descr = start_descr; 309 descr = start_descr;
340 memset(descr, 0, sizeof(*descr) * no); 310 memset(descr, 0, sizeof(*descr) * no);
341 311
342 /* set up the hardware pointers in each descriptor */ 312 /* set up the hardware pointers in each descriptor */
343 for (i=0; i<no; i++, descr++) { 313 for (i=0; i<no; i++, descr++) {
344 spider_net_set_descr_status(descr, SPIDER_NET_DESCR_NOT_IN_USE); 314 descr->dmac_cmd_status = SPIDER_NET_DESCR_NOT_IN_USE;
345 315
346 buf = pci_map_single(card->pdev, descr, 316 buf = pci_map_single(card->pdev, descr,
347 SPIDER_NET_DESCR_SIZE, 317 SPIDER_NET_DESCR_SIZE,
348 PCI_DMA_BIDIRECTIONAL); 318 direction);
349 319
350 if (buf == DMA_ERROR_CODE) 320 if (buf == DMA_ERROR_CODE)
351 goto iommu_error; 321 goto iommu_error;
@@ -360,10 +330,11 @@ spider_net_init_chain(struct spider_net_card *card,
360 start_descr->prev = descr-1; 330 start_descr->prev = descr-1;
361 331
362 descr = start_descr; 332 descr = start_descr;
363 for (i=0; i < no; i++, descr++) { 333 if (direction == PCI_DMA_FROMDEVICE)
364 descr->next_descr_addr = descr->next->bus_addr; 334 for (i=0; i < no; i++, descr++)
365 } 335 descr->next_descr_addr = descr->next->bus_addr;
366 336
337 spin_lock_init(&chain->lock);
367 chain->head = start_descr; 338 chain->head = start_descr;
368 chain->tail = start_descr; 339 chain->tail = start_descr;
369 340
@@ -375,7 +346,7 @@ iommu_error:
375 if (descr->bus_addr) 346 if (descr->bus_addr)
376 pci_unmap_single(card->pdev, descr->bus_addr, 347 pci_unmap_single(card->pdev, descr->bus_addr,
377 SPIDER_NET_DESCR_SIZE, 348 SPIDER_NET_DESCR_SIZE,
378 PCI_DMA_BIDIRECTIONAL); 349 direction);
379 return -ENOMEM; 350 return -ENOMEM;
380} 351}
381 352
@@ -396,7 +367,7 @@ spider_net_free_rx_chain_contents(struct spider_net_card *card)
396 dev_kfree_skb(descr->skb); 367 dev_kfree_skb(descr->skb);
397 pci_unmap_single(card->pdev, descr->buf_addr, 368 pci_unmap_single(card->pdev, descr->buf_addr,
398 SPIDER_NET_MAX_FRAME, 369 SPIDER_NET_MAX_FRAME,
399 PCI_DMA_BIDIRECTIONAL); 370 PCI_DMA_FROMDEVICE);
400 } 371 }
401 descr = descr->next; 372 descr = descr->next;
402 } 373 }
@@ -446,15 +417,16 @@ spider_net_prepare_rx_descr(struct spider_net_card *card,
446 skb_reserve(descr->skb, SPIDER_NET_RXBUF_ALIGN - offset); 417 skb_reserve(descr->skb, SPIDER_NET_RXBUF_ALIGN - offset);
447 /* io-mmu-map the skb */ 418 /* io-mmu-map the skb */
448 buf = pci_map_single(card->pdev, descr->skb->data, 419 buf = pci_map_single(card->pdev, descr->skb->data,
449 SPIDER_NET_MAX_FRAME, PCI_DMA_BIDIRECTIONAL); 420 SPIDER_NET_MAX_FRAME, PCI_DMA_FROMDEVICE);
450 descr->buf_addr = buf; 421 descr->buf_addr = buf;
451 if (buf == DMA_ERROR_CODE) { 422 if (buf == DMA_ERROR_CODE) {
452 dev_kfree_skb_any(descr->skb); 423 dev_kfree_skb_any(descr->skb);
453 if (netif_msg_rx_err(card) && net_ratelimit()) 424 if (netif_msg_rx_err(card) && net_ratelimit())
454 pr_err("Could not iommu-map rx buffer\n"); 425 pr_err("Could not iommu-map rx buffer\n");
455 spider_net_set_descr_status(descr, SPIDER_NET_DESCR_NOT_IN_USE); 426 descr->dmac_cmd_status = SPIDER_NET_DESCR_NOT_IN_USE;
456 } else { 427 } else {
457 descr->dmac_cmd_status = SPIDER_NET_DMAC_RX_CARDOWNED; 428 descr->dmac_cmd_status = SPIDER_NET_DESCR_CARDOWNED |
429 SPIDER_NET_DMAC_NOINTR_COMPLETE;
458 } 430 }
459 431
460 return error; 432 return error;
@@ -468,7 +440,7 @@ spider_net_prepare_rx_descr(struct spider_net_card *card,
468 * chip by writing to the appropriate register. DMA is enabled in 440 * chip by writing to the appropriate register. DMA is enabled in
469 * spider_net_enable_rxdmac. 441 * spider_net_enable_rxdmac.
470 */ 442 */
471static void 443static inline void
472spider_net_enable_rxchtails(struct spider_net_card *card) 444spider_net_enable_rxchtails(struct spider_net_card *card)
473{ 445{
474 /* assume chain is aligned correctly */ 446 /* assume chain is aligned correctly */
@@ -483,7 +455,7 @@ spider_net_enable_rxchtails(struct spider_net_card *card)
483 * spider_net_enable_rxdmac enables the DMA controller by setting RX_DMA_EN 455 * spider_net_enable_rxdmac enables the DMA controller by setting RX_DMA_EN
484 * in the GDADMACCNTR register 456 * in the GDADMACCNTR register
485 */ 457 */
486static void 458static inline void
487spider_net_enable_rxdmac(struct spider_net_card *card) 459spider_net_enable_rxdmac(struct spider_net_card *card)
488{ 460{
489 wmb(); 461 wmb();
@@ -500,23 +472,24 @@ spider_net_enable_rxdmac(struct spider_net_card *card)
500static void 472static void
501spider_net_refill_rx_chain(struct spider_net_card *card) 473spider_net_refill_rx_chain(struct spider_net_card *card)
502{ 474{
503 struct spider_net_descr_chain *chain; 475 struct spider_net_descr_chain *chain = &card->rx_chain;
504 476 unsigned long flags;
505 chain = &card->rx_chain;
506 477
507 /* one context doing the refill (and a second context seeing that 478 /* one context doing the refill (and a second context seeing that
508 * and omitting it) is ok. If called by NAPI, we'll be called again 479 * and omitting it) is ok. If called by NAPI, we'll be called again
509 * as spider_net_decode_one_descr is called several times. If some 480 * as spider_net_decode_one_descr is called several times. If some
510 * interrupt calls us, the NAPI is about to clean up anyway. */ 481 * interrupt calls us, the NAPI is about to clean up anyway. */
511 if (atomic_inc_return(&card->rx_chain_refill) == 1) 482 if (!spin_trylock_irqsave(&chain->lock, flags))
512 while (spider_net_get_descr_status(chain->head) == 483 return;
513 SPIDER_NET_DESCR_NOT_IN_USE) { 484
514 if (spider_net_prepare_rx_descr(card, chain->head)) 485 while (spider_net_get_descr_status(chain->head) ==
515 break; 486 SPIDER_NET_DESCR_NOT_IN_USE) {
516 chain->head = chain->head->next; 487 if (spider_net_prepare_rx_descr(card, chain->head))
517 } 488 break;
489 chain->head = chain->head->next;
490 }
518 491
519 atomic_dec(&card->rx_chain_refill); 492 spin_unlock_irqrestore(&chain->lock, flags);
520} 493}
521 494
522/** 495/**
@@ -554,111 +527,6 @@ error:
554} 527}
555 528
556/** 529/**
557 * spider_net_release_tx_descr - processes a used tx descriptor
558 * @card: card structure
559 * @descr: descriptor to release
560 *
561 * releases a used tx descriptor (unmapping, freeing of skb)
562 */
563static void
564spider_net_release_tx_descr(struct spider_net_card *card,
565 struct spider_net_descr *descr)
566{
567 struct sk_buff *skb;
568
569 /* unmap the skb */
570 skb = descr->skb;
571 pci_unmap_single(card->pdev, descr->buf_addr, skb->len,
572 PCI_DMA_BIDIRECTIONAL);
573
574 dev_kfree_skb_any(skb);
575
576 /* set status to not used */
577 spider_net_set_descr_status(descr, SPIDER_NET_DESCR_NOT_IN_USE);
578}
579
580/**
581 * spider_net_release_tx_chain - processes sent tx descriptors
582 * @card: adapter structure
583 * @brutal: if set, don't care about whether descriptor seems to be in use
584 *
585 * returns 0 if the tx ring is empty, otherwise 1.
586 *
587 * spider_net_release_tx_chain releases the tx descriptors that spider has
588 * finished with (if non-brutal) or simply release tx descriptors (if brutal).
589 * If some other context is calling this function, we return 1 so that we're
590 * scheduled again (if we were scheduled) and will not loose initiative.
591 */
592static int
593spider_net_release_tx_chain(struct spider_net_card *card, int brutal)
594{
595 struct spider_net_descr_chain *tx_chain = &card->tx_chain;
596 enum spider_net_descr_status status;
597
598 if (atomic_inc_return(&card->tx_chain_release) != 1) {
599 atomic_dec(&card->tx_chain_release);
600 return 1;
601 }
602
603 for (;;) {
604 status = spider_net_get_descr_status(tx_chain->tail);
605 switch (status) {
606 case SPIDER_NET_DESCR_CARDOWNED:
607 if (!brutal)
608 goto out;
609 /* fallthrough, if we release the descriptors
610 * brutally (then we don't care about
611 * SPIDER_NET_DESCR_CARDOWNED) */
612 case SPIDER_NET_DESCR_RESPONSE_ERROR:
613 case SPIDER_NET_DESCR_PROTECTION_ERROR:
614 case SPIDER_NET_DESCR_FORCE_END:
615 if (netif_msg_tx_err(card))
616 pr_err("%s: forcing end of tx descriptor "
617 "with status x%02x\n",
618 card->netdev->name, status);
619 card->netdev_stats.tx_dropped++;
620 break;
621
622 case SPIDER_NET_DESCR_COMPLETE:
623 card->netdev_stats.tx_packets++;
624 card->netdev_stats.tx_bytes +=
625 tx_chain->tail->skb->len;
626 break;
627
628 default: /* any other value (== SPIDER_NET_DESCR_NOT_IN_USE) */
629 goto out;
630 }
631 spider_net_release_tx_descr(card, tx_chain->tail);
632 tx_chain->tail = tx_chain->tail->next;
633 }
634out:
635 atomic_dec(&card->tx_chain_release);
636
637 netif_wake_queue(card->netdev);
638
639 if (status == SPIDER_NET_DESCR_CARDOWNED)
640 return 1;
641 return 0;
642}
643
644/**
645 * spider_net_cleanup_tx_ring - cleans up the TX ring
646 * @card: card structure
647 *
648 * spider_net_cleanup_tx_ring is called by the tx_timer (as we don't use
649 * interrupts to cleanup our TX ring) and returns sent packets to the stack
650 * by freeing them
651 */
652static void
653spider_net_cleanup_tx_ring(struct spider_net_card *card)
654{
655 if ( (spider_net_release_tx_chain(card, 0)) &&
656 (card->netdev->flags & IFF_UP) ) {
657 mod_timer(&card->tx_timer, jiffies + SPIDER_NET_TX_TIMER);
658 }
659}
660
661/**
662 * spider_net_get_multicast_hash - generates hash for multicast filter table 530 * spider_net_get_multicast_hash - generates hash for multicast filter table
663 * @addr: multicast address 531 * @addr: multicast address
664 * 532 *
@@ -761,97 +629,6 @@ spider_net_disable_rxdmac(struct spider_net_card *card)
761} 629}
762 630
763/** 631/**
764 * spider_net_stop - called upon ifconfig down
765 * @netdev: interface device structure
766 *
767 * always returns 0
768 */
769int
770spider_net_stop(struct net_device *netdev)
771{
772 struct spider_net_card *card = netdev_priv(netdev);
773
774 tasklet_kill(&card->rxram_full_tl);
775 netif_poll_disable(netdev);
776 netif_carrier_off(netdev);
777 netif_stop_queue(netdev);
778 del_timer_sync(&card->tx_timer);
779
780 /* disable/mask all interrupts */
781 spider_net_write_reg(card, SPIDER_NET_GHIINT0MSK, 0);
782 spider_net_write_reg(card, SPIDER_NET_GHIINT1MSK, 0);
783 spider_net_write_reg(card, SPIDER_NET_GHIINT2MSK, 0);
784
785 /* free_irq(netdev->irq, netdev);*/
786 free_irq(to_pci_dev(netdev->class_dev.dev)->irq, netdev);
787
788 spider_net_write_reg(card, SPIDER_NET_GDTDMACCNTR,
789 SPIDER_NET_DMA_TX_FEND_VALUE);
790
791 /* turn off DMA, force end */
792 spider_net_disable_rxdmac(card);
793
794 /* release chains */
795 spider_net_release_tx_chain(card, 1);
796
797 spider_net_free_chain(card, &card->tx_chain);
798 spider_net_free_chain(card, &card->rx_chain);
799
800 return 0;
801}
802
803/**
804 * spider_net_get_next_tx_descr - returns the next available tx descriptor
805 * @card: device structure to get descriptor from
806 *
807 * returns the address of the next descriptor, or NULL if not available.
808 */
809static struct spider_net_descr *
810spider_net_get_next_tx_descr(struct spider_net_card *card)
811{
812 /* check, if head points to not-in-use descr */
813 if ( spider_net_get_descr_status(card->tx_chain.head) ==
814 SPIDER_NET_DESCR_NOT_IN_USE ) {
815 return card->tx_chain.head;
816 } else {
817 return NULL;
818 }
819}
820
821/**
822 * spider_net_set_txdescr_cmdstat - sets the tx descriptor command field
823 * @descr: descriptor structure to fill out
824 * @skb: packet to consider
825 *
826 * fills out the command and status field of the descriptor structure,
827 * depending on hardware checksum settings.
828 */
829static void
830spider_net_set_txdescr_cmdstat(struct spider_net_descr *descr,
831 struct sk_buff *skb)
832{
833 /* make sure the other fields in the descriptor are written */
834 wmb();
835
836 if (skb->ip_summed != CHECKSUM_HW) {
837 descr->dmac_cmd_status = SPIDER_NET_DMAC_CMDSTAT_NOCS;
838 return;
839 }
840
841 /* is packet ip?
842 * if yes: tcp? udp? */
843 if (skb->protocol == htons(ETH_P_IP)) {
844 if (skb->nh.iph->protocol == IPPROTO_TCP)
845 descr->dmac_cmd_status = SPIDER_NET_DMAC_CMDSTAT_TCPCS;
846 else if (skb->nh.iph->protocol == IPPROTO_UDP)
847 descr->dmac_cmd_status = SPIDER_NET_DMAC_CMDSTAT_UDPCS;
848 else /* the stack should checksum non-tcp and non-udp
849 packets on his own: NETIF_F_IP_CSUM */
850 descr->dmac_cmd_status = SPIDER_NET_DMAC_CMDSTAT_NOCS;
851 }
852}
853
854/**
855 * spider_net_prepare_tx_descr - fill tx descriptor with skb data 632 * spider_net_prepare_tx_descr - fill tx descriptor with skb data
856 * @card: card structure 633 * @card: card structure
857 * @descr: descriptor structure to fill out 634 * @descr: descriptor structure to fill out
@@ -864,13 +641,12 @@ spider_net_set_txdescr_cmdstat(struct spider_net_descr *descr,
864 */ 641 */
865static int 642static int
866spider_net_prepare_tx_descr(struct spider_net_card *card, 643spider_net_prepare_tx_descr(struct spider_net_card *card,
867 struct spider_net_descr *descr,
868 struct sk_buff *skb) 644 struct sk_buff *skb)
869{ 645{
646 struct spider_net_descr *descr = card->tx_chain.head;
870 dma_addr_t buf; 647 dma_addr_t buf;
871 648
872 buf = pci_map_single(card->pdev, skb->data, 649 buf = pci_map_single(card->pdev, skb->data, skb->len, PCI_DMA_TODEVICE);
873 skb->len, PCI_DMA_BIDIRECTIONAL);
874 if (buf == DMA_ERROR_CODE) { 650 if (buf == DMA_ERROR_CODE) {
875 if (netif_msg_tx_err(card) && net_ratelimit()) 651 if (netif_msg_tx_err(card) && net_ratelimit())
876 pr_err("could not iommu-map packet (%p, %i). " 652 pr_err("could not iommu-map packet (%p, %i). "
@@ -880,10 +656,101 @@ spider_net_prepare_tx_descr(struct spider_net_card *card,
880 656
881 descr->buf_addr = buf; 657 descr->buf_addr = buf;
882 descr->buf_size = skb->len; 658 descr->buf_size = skb->len;
659 descr->next_descr_addr = 0;
883 descr->skb = skb; 660 descr->skb = skb;
884 descr->data_status = 0; 661 descr->data_status = 0;
885 662
886 spider_net_set_txdescr_cmdstat(descr,skb); 663 descr->dmac_cmd_status =
664 SPIDER_NET_DESCR_CARDOWNED | SPIDER_NET_DMAC_NOCS;
665 if (skb->protocol == htons(ETH_P_IP))
666 switch (skb->nh.iph->protocol) {
667 case IPPROTO_TCP:
668 descr->dmac_cmd_status |= SPIDER_NET_DMAC_TCP;
669 break;
670 case IPPROTO_UDP:
671 descr->dmac_cmd_status |= SPIDER_NET_DMAC_UDP;
672 break;
673 }
674
675 descr->prev->next_descr_addr = descr->bus_addr;
676
677 return 0;
678}
679
680/**
681 * spider_net_release_tx_descr - processes a used tx descriptor
682 * @card: card structure
683 * @descr: descriptor to release
684 *
685 * releases a used tx descriptor (unmapping, freeing of skb)
686 */
687static inline void
688spider_net_release_tx_descr(struct spider_net_card *card)
689{
690 struct spider_net_descr *descr = card->tx_chain.tail;
691 struct sk_buff *skb;
692
693 card->tx_chain.tail = card->tx_chain.tail->next;
694 descr->dmac_cmd_status |= SPIDER_NET_DESCR_NOT_IN_USE;
695
696 /* unmap the skb */
697 skb = descr->skb;
698 pci_unmap_single(card->pdev, descr->buf_addr, skb->len,
699 PCI_DMA_TODEVICE);
700 dev_kfree_skb_any(skb);
701}
702
703/**
704 * spider_net_release_tx_chain - processes sent tx descriptors
705 * @card: adapter structure
706 * @brutal: if set, don't care about whether descriptor seems to be in use
707 *
708 * returns 0 if the tx ring is empty, otherwise 1.
709 *
710 * spider_net_release_tx_chain releases the tx descriptors that spider has
711 * finished with (if non-brutal) or simply release tx descriptors (if brutal).
712 * If some other context is calling this function, we return 1 so that we're
713 * scheduled again (if we were scheduled) and will not loose initiative.
714 */
715static int
716spider_net_release_tx_chain(struct spider_net_card *card, int brutal)
717{
718 struct spider_net_descr_chain *chain = &card->tx_chain;
719 int status;
720
721 spider_net_read_reg(card, SPIDER_NET_GDTDMACCNTR);
722
723 while (chain->tail != chain->head) {
724 status = spider_net_get_descr_status(chain->tail);
725 switch (status) {
726 case SPIDER_NET_DESCR_COMPLETE:
727 card->netdev_stats.tx_packets++;
728 card->netdev_stats.tx_bytes += chain->tail->skb->len;
729 break;
730
731 case SPIDER_NET_DESCR_CARDOWNED:
732 if (!brutal)
733 return 1;
734 /* fallthrough, if we release the descriptors
735 * brutally (then we don't care about
736 * SPIDER_NET_DESCR_CARDOWNED) */
737
738 case SPIDER_NET_DESCR_RESPONSE_ERROR:
739 case SPIDER_NET_DESCR_PROTECTION_ERROR:
740 case SPIDER_NET_DESCR_FORCE_END:
741 if (netif_msg_tx_err(card))
742 pr_err("%s: forcing end of tx descriptor "
743 "with status x%02x\n",
744 card->netdev->name, status);
745 card->netdev_stats.tx_errors++;
746 break;
747
748 default:
749 card->netdev_stats.tx_dropped++;
750 return 1;
751 }
752 spider_net_release_tx_descr(card);
753 }
887 754
888 return 0; 755 return 0;
889} 756}
@@ -896,18 +763,32 @@ spider_net_prepare_tx_descr(struct spider_net_card *card,
896 * spider_net_kick_tx_dma writes the current tx chain head as start address 763 * spider_net_kick_tx_dma writes the current tx chain head as start address
897 * of the tx descriptor chain and enables the transmission DMA engine 764 * of the tx descriptor chain and enables the transmission DMA engine
898 */ 765 */
899static void 766static inline void
900spider_net_kick_tx_dma(struct spider_net_card *card, 767spider_net_kick_tx_dma(struct spider_net_card *card)
901 struct spider_net_descr *descr)
902{ 768{
903 /* this is the only descriptor in the output chain. 769 struct spider_net_descr *descr;
904 * Enable TX DMA */
905 770
906 spider_net_write_reg(card, SPIDER_NET_GDTDCHA, 771 if (spider_net_read_reg(card, SPIDER_NET_GDTDMACCNTR) &
907 descr->bus_addr); 772 SPIDER_NET_TX_DMA_EN)
773 goto out;
908 774
909 spider_net_write_reg(card, SPIDER_NET_GDTDMACCNTR, 775 descr = card->tx_chain.tail;
910 SPIDER_NET_DMA_TX_VALUE); 776 for (;;) {
777 if (spider_net_get_descr_status(descr) ==
778 SPIDER_NET_DESCR_CARDOWNED) {
779 spider_net_write_reg(card, SPIDER_NET_GDTDCHA,
780 descr->bus_addr);
781 spider_net_write_reg(card, SPIDER_NET_GDTDMACCNTR,
782 SPIDER_NET_DMA_TX_VALUE);
783 break;
784 }
785 if (descr == card->tx_chain.head)
786 break;
787 descr = descr->next;
788 }
789
790out:
791 mod_timer(&card->tx_timer, jiffies + SPIDER_NET_TX_TIMER);
911} 792}
912 793
913/** 794/**
@@ -915,47 +796,69 @@ spider_net_kick_tx_dma(struct spider_net_card *card,
915 * @skb: packet to send out 796 * @skb: packet to send out
916 * @netdev: interface device structure 797 * @netdev: interface device structure
917 * 798 *
918 * returns 0 on success, <0 on failure 799 * returns 0 on success, !0 on failure
919 */ 800 */
920static int 801static int
921spider_net_xmit(struct sk_buff *skb, struct net_device *netdev) 802spider_net_xmit(struct sk_buff *skb, struct net_device *netdev)
922{ 803{
923 struct spider_net_card *card = netdev_priv(netdev); 804 struct spider_net_card *card = netdev_priv(netdev);
924 struct spider_net_descr *descr; 805 struct spider_net_descr_chain *chain = &card->tx_chain;
806 struct spider_net_descr *descr = chain->head;
807 unsigned long flags;
925 int result; 808 int result;
926 809
810 spin_lock_irqsave(&chain->lock, flags);
811
927 spider_net_release_tx_chain(card, 0); 812 spider_net_release_tx_chain(card, 0);
928 813
929 descr = spider_net_get_next_tx_descr(card); 814 if (chain->head->next == chain->tail->prev) {
815 card->netdev_stats.tx_dropped++;
816 result = NETDEV_TX_LOCKED;
817 goto out;
818 }
930 819
931 if (!descr) 820 if (spider_net_get_descr_status(descr) != SPIDER_NET_DESCR_NOT_IN_USE) {
932 goto error; 821 result = NETDEV_TX_LOCKED;
822 goto out;
823 }
933 824
934 result = spider_net_prepare_tx_descr(card, descr, skb); 825 if (spider_net_prepare_tx_descr(card, skb) != 0) {
935 if (result) 826 card->netdev_stats.tx_dropped++;
936 goto error; 827 result = NETDEV_TX_BUSY;
828 goto out;
829 }
830
831 result = NETDEV_TX_OK;
937 832
833 spider_net_kick_tx_dma(card);
938 card->tx_chain.head = card->tx_chain.head->next; 834 card->tx_chain.head = card->tx_chain.head->next;
939 835
940 if (spider_net_get_descr_status(descr->prev) != 836out:
941 SPIDER_NET_DESCR_CARDOWNED) { 837 spin_unlock_irqrestore(&chain->lock, flags);
942 /* make sure the current descriptor is in memory. Then 838 netif_wake_queue(netdev);
943 * kicking it on again makes sense, if the previous is not 839 return result;
944 * card-owned anymore. Check the previous descriptor twice 840}
945 * to omit an mb() in heavy traffic cases */
946 mb();
947 if (spider_net_get_descr_status(descr->prev) !=
948 SPIDER_NET_DESCR_CARDOWNED)
949 spider_net_kick_tx_dma(card, descr);
950 }
951 841
952 mod_timer(&card->tx_timer, jiffies + SPIDER_NET_TX_TIMER); 842/**
843 * spider_net_cleanup_tx_ring - cleans up the TX ring
844 * @card: card structure
845 *
846 * spider_net_cleanup_tx_ring is called by the tx_timer (as we don't use
847 * interrupts to cleanup our TX ring) and returns sent packets to the stack
848 * by freeing them
849 */
850static void
851spider_net_cleanup_tx_ring(struct spider_net_card *card)
852{
853 unsigned long flags;
953 854
954 return NETDEV_TX_OK; 855 spin_lock_irqsave(&card->tx_chain.lock, flags);
955 856
956error: 857 if ((spider_net_release_tx_chain(card, 0) != 0) &&
957 card->netdev_stats.tx_dropped++; 858 (card->netdev->flags & IFF_UP))
958 return NETDEV_TX_BUSY; 859 spider_net_kick_tx_dma(card);
860
861 spin_unlock_irqrestore(&card->tx_chain.lock, flags);
959} 862}
960 863
961/** 864/**
@@ -1002,7 +905,7 @@ spider_net_pass_skb_up(struct spider_net_descr *descr,
1002 905
1003 /* unmap descriptor */ 906 /* unmap descriptor */
1004 pci_unmap_single(card->pdev, descr->buf_addr, SPIDER_NET_MAX_FRAME, 907 pci_unmap_single(card->pdev, descr->buf_addr, SPIDER_NET_MAX_FRAME,
1005 PCI_DMA_BIDIRECTIONAL); 908 PCI_DMA_FROMDEVICE);
1006 909
1007 /* the cases we'll throw away the packet immediately */ 910 /* the cases we'll throw away the packet immediately */
1008 if (data_error & SPIDER_NET_DESTROY_RX_FLAGS) { 911 if (data_error & SPIDER_NET_DESTROY_RX_FLAGS) {
@@ -1067,14 +970,11 @@ spider_net_pass_skb_up(struct spider_net_descr *descr,
1067static int 970static int
1068spider_net_decode_one_descr(struct spider_net_card *card, int napi) 971spider_net_decode_one_descr(struct spider_net_card *card, int napi)
1069{ 972{
1070 enum spider_net_descr_status status; 973 struct spider_net_descr_chain *chain = &card->rx_chain;
1071 struct spider_net_descr *descr; 974 struct spider_net_descr *descr = chain->tail;
1072 struct spider_net_descr_chain *chain; 975 int status;
1073 int result; 976 int result;
1074 977
1075 chain = &card->rx_chain;
1076 descr = chain->tail;
1077
1078 status = spider_net_get_descr_status(descr); 978 status = spider_net_get_descr_status(descr);
1079 979
1080 if (status == SPIDER_NET_DESCR_CARDOWNED) { 980 if (status == SPIDER_NET_DESCR_CARDOWNED) {
@@ -1103,7 +1003,7 @@ spider_net_decode_one_descr(struct spider_net_card *card, int napi)
1103 card->netdev->name, status); 1003 card->netdev->name, status);
1104 card->netdev_stats.rx_dropped++; 1004 card->netdev_stats.rx_dropped++;
1105 pci_unmap_single(card->pdev, descr->buf_addr, 1005 pci_unmap_single(card->pdev, descr->buf_addr,
1106 SPIDER_NET_MAX_FRAME, PCI_DMA_BIDIRECTIONAL); 1006 SPIDER_NET_MAX_FRAME, PCI_DMA_FROMDEVICE);
1107 dev_kfree_skb_irq(descr->skb); 1007 dev_kfree_skb_irq(descr->skb);
1108 goto refill; 1008 goto refill;
1109 } 1009 }
@@ -1119,7 +1019,7 @@ spider_net_decode_one_descr(struct spider_net_card *card, int napi)
1119 /* ok, we've got a packet in descr */ 1019 /* ok, we've got a packet in descr */
1120 result = spider_net_pass_skb_up(descr, card, napi); 1020 result = spider_net_pass_skb_up(descr, card, napi);
1121refill: 1021refill:
1122 spider_net_set_descr_status(descr, SPIDER_NET_DESCR_NOT_IN_USE); 1022 descr->dmac_cmd_status = SPIDER_NET_DESCR_NOT_IN_USE;
1123 /* change the descriptor state: */ 1023 /* change the descriptor state: */
1124 if (!napi) 1024 if (!napi)
1125 spider_net_refill_rx_chain(card); 1025 spider_net_refill_rx_chain(card);
@@ -1291,21 +1191,6 @@ spider_net_set_mac(struct net_device *netdev, void *p)
1291} 1191}
1292 1192
1293/** 1193/**
1294 * spider_net_enable_txdmac - enables a TX DMA controller
1295 * @card: card structure
1296 *
1297 * spider_net_enable_txdmac enables the TX DMA controller by setting the
1298 * descriptor chain tail address
1299 */
1300static void
1301spider_net_enable_txdmac(struct spider_net_card *card)
1302{
1303 /* assume chain is aligned correctly */
1304 spider_net_write_reg(card, SPIDER_NET_GDTDCHA,
1305 card->tx_chain.tail->bus_addr);
1306}
1307
1308/**
1309 * spider_net_handle_rxram_full - cleans up RX ring upon RX RAM full interrupt 1194 * spider_net_handle_rxram_full - cleans up RX ring upon RX RAM full interrupt
1310 * @card: card structure 1195 * @card: card structure
1311 * 1196 *
@@ -1653,7 +1538,6 @@ spider_net_enable_card(struct spider_net_card *card)
1653 { SPIDER_NET_GMRWOLCTRL, 0 }, 1538 { SPIDER_NET_GMRWOLCTRL, 0 },
1654 { SPIDER_NET_GTESTMD, 0x10000000 }, 1539 { SPIDER_NET_GTESTMD, 0x10000000 },
1655 { SPIDER_NET_GTTQMSK, 0x00400040 }, 1540 { SPIDER_NET_GTTQMSK, 0x00400040 },
1656 { SPIDER_NET_GTESTMD, 0 },
1657 1541
1658 { SPIDER_NET_GMACINTEN, 0 }, 1542 { SPIDER_NET_GMACINTEN, 0 },
1659 1543
@@ -1692,9 +1576,6 @@ spider_net_enable_card(struct spider_net_card *card)
1692 1576
1693 spider_net_write_reg(card, SPIDER_NET_GRXDMAEN, SPIDER_NET_WOL_VALUE); 1577 spider_net_write_reg(card, SPIDER_NET_GRXDMAEN, SPIDER_NET_WOL_VALUE);
1694 1578
1695 /* set chain tail adress for TX chain */
1696 spider_net_enable_txdmac(card);
1697
1698 spider_net_write_reg(card, SPIDER_NET_GMACLENLMT, 1579 spider_net_write_reg(card, SPIDER_NET_GMACLENLMT,
1699 SPIDER_NET_LENLMT_VALUE); 1580 SPIDER_NET_LENLMT_VALUE);
1700 spider_net_write_reg(card, SPIDER_NET_GMACMODE, 1581 spider_net_write_reg(card, SPIDER_NET_GMACMODE,
@@ -1709,6 +1590,9 @@ spider_net_enable_card(struct spider_net_card *card)
1709 SPIDER_NET_INT1_MASK_VALUE); 1590 SPIDER_NET_INT1_MASK_VALUE);
1710 spider_net_write_reg(card, SPIDER_NET_GHIINT2MSK, 1591 spider_net_write_reg(card, SPIDER_NET_GHIINT2MSK,
1711 SPIDER_NET_INT2_MASK_VALUE); 1592 SPIDER_NET_INT2_MASK_VALUE);
1593
1594 spider_net_write_reg(card, SPIDER_NET_GDTDMACCNTR,
1595 SPIDER_NET_GDTDCEIDIS);
1712} 1596}
1713 1597
1714/** 1598/**
@@ -1728,10 +1612,12 @@ spider_net_open(struct net_device *netdev)
1728 1612
1729 result = -ENOMEM; 1613 result = -ENOMEM;
1730 if (spider_net_init_chain(card, &card->tx_chain, 1614 if (spider_net_init_chain(card, &card->tx_chain,
1731 card->descr, tx_descriptors)) 1615 card->descr,
1616 PCI_DMA_TODEVICE, tx_descriptors))
1732 goto alloc_tx_failed; 1617 goto alloc_tx_failed;
1733 if (spider_net_init_chain(card, &card->rx_chain, 1618 if (spider_net_init_chain(card, &card->rx_chain,
1734 card->descr + tx_descriptors, rx_descriptors)) 1619 card->descr + tx_descriptors,
1620 PCI_DMA_FROMDEVICE, rx_descriptors))
1735 goto alloc_rx_failed; 1621 goto alloc_rx_failed;
1736 1622
1737 /* allocate rx skbs */ 1623 /* allocate rx skbs */
@@ -1938,7 +1824,7 @@ spider_net_workaround_rxramfull(struct spider_net_card *card)
1938 /* empty sequencer data */ 1824 /* empty sequencer data */
1939 for (sequencer = 0; sequencer < SPIDER_NET_FIRMWARE_SEQS; 1825 for (sequencer = 0; sequencer < SPIDER_NET_FIRMWARE_SEQS;
1940 sequencer++) { 1826 sequencer++) {
1941 spider_net_write_reg(card, SPIDER_NET_GSnPRGDAT + 1827 spider_net_write_reg(card, SPIDER_NET_GSnPRGADR +
1942 sequencer * 8, 0x0); 1828 sequencer * 8, 0x0);
1943 for (i = 0; i < SPIDER_NET_FIRMWARE_SEQWORDS; i++) { 1829 for (i = 0; i < SPIDER_NET_FIRMWARE_SEQWORDS; i++) {
1944 spider_net_write_reg(card, SPIDER_NET_GSnPRGDAT + 1830 spider_net_write_reg(card, SPIDER_NET_GSnPRGDAT +
@@ -1955,6 +1841,49 @@ spider_net_workaround_rxramfull(struct spider_net_card *card)
1955} 1841}
1956 1842
1957/** 1843/**
1844 * spider_net_stop - called upon ifconfig down
1845 * @netdev: interface device structure
1846 *
1847 * always returns 0
1848 */
1849int
1850spider_net_stop(struct net_device *netdev)
1851{
1852 struct spider_net_card *card = netdev_priv(netdev);
1853
1854 tasklet_kill(&card->rxram_full_tl);
1855 netif_poll_disable(netdev);
1856 netif_carrier_off(netdev);
1857 netif_stop_queue(netdev);
1858 del_timer_sync(&card->tx_timer);
1859
1860 /* disable/mask all interrupts */
1861 spider_net_write_reg(card, SPIDER_NET_GHIINT0MSK, 0);
1862 spider_net_write_reg(card, SPIDER_NET_GHIINT1MSK, 0);
1863 spider_net_write_reg(card, SPIDER_NET_GHIINT2MSK, 0);
1864
1865 /* free_irq(netdev->irq, netdev);*/
1866 free_irq(to_pci_dev(netdev->class_dev.dev)->irq, netdev);
1867
1868 spider_net_write_reg(card, SPIDER_NET_GDTDMACCNTR,
1869 SPIDER_NET_DMA_TX_FEND_VALUE);
1870
1871 /* turn off DMA, force end */
1872 spider_net_disable_rxdmac(card);
1873
1874 /* release chains */
1875 if (spin_trylock(&card->tx_chain.lock)) {
1876 spider_net_release_tx_chain(card, 1);
1877 spin_unlock(&card->tx_chain.lock);
1878 }
1879
1880 spider_net_free_chain(card, &card->tx_chain);
1881 spider_net_free_chain(card, &card->rx_chain);
1882
1883 return 0;
1884}
1885
1886/**
1958 * spider_net_tx_timeout_task - task scheduled by the watchdog timeout 1887 * spider_net_tx_timeout_task - task scheduled by the watchdog timeout
1959 * function (to be called not under interrupt status) 1888 * function (to be called not under interrupt status)
1960 * @data: data, is interface device structure 1889 * @data: data, is interface device structure
@@ -1982,7 +1911,7 @@ spider_net_tx_timeout_task(void *data)
1982 goto out; 1911 goto out;
1983 1912
1984 spider_net_open(netdev); 1913 spider_net_open(netdev);
1985 spider_net_kick_tx_dma(card, card->tx_chain.head); 1914 spider_net_kick_tx_dma(card);
1986 netif_device_attach(netdev); 1915 netif_device_attach(netdev);
1987 1916
1988out: 1917out:
@@ -2065,7 +1994,6 @@ spider_net_setup_netdev(struct spider_net_card *card)
2065 1994
2066 pci_set_drvdata(card->pdev, netdev); 1995 pci_set_drvdata(card->pdev, netdev);
2067 1996
2068 atomic_set(&card->tx_chain_release,0);
2069 card->rxram_full_tl.data = (unsigned long) card; 1997 card->rxram_full_tl.data = (unsigned long) card;
2070 card->rxram_full_tl.func = 1998 card->rxram_full_tl.func =
2071 (void (*)(unsigned long)) spider_net_handle_rxram_full; 1999 (void (*)(unsigned long)) spider_net_handle_rxram_full;
@@ -2079,7 +2007,7 @@ spider_net_setup_netdev(struct spider_net_card *card)
2079 2007
2080 spider_net_setup_netdev_ops(netdev); 2008 spider_net_setup_netdev_ops(netdev);
2081 2009
2082 netdev->features = NETIF_F_HW_CSUM; 2010 netdev->features = NETIF_F_HW_CSUM | NETIF_F_LLTX;
2083 /* some time: NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX | 2011 /* some time: NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX |
2084 * NETIF_F_HW_VLAN_FILTER */ 2012 * NETIF_F_HW_VLAN_FILTER */
2085 2013
diff --git a/drivers/net/spider_net.h b/drivers/net/spider_net.h
index 3b8d951cf73c..f6dcf180ae3d 100644
--- a/drivers/net/spider_net.h
+++ b/drivers/net/spider_net.h
@@ -208,7 +208,10 @@ extern char spider_net_driver_name[];
208#define SPIDER_NET_DMA_RX_VALUE 0x80000000 208#define SPIDER_NET_DMA_RX_VALUE 0x80000000
209#define SPIDER_NET_DMA_RX_FEND_VALUE 0x00030003 209#define SPIDER_NET_DMA_RX_FEND_VALUE 0x00030003
210/* to set TX_DMA_EN */ 210/* to set TX_DMA_EN */
211#define SPIDER_NET_DMA_TX_VALUE 0x80000000 211#define SPIDER_NET_TX_DMA_EN 0x80000000
212#define SPIDER_NET_GDTDCEIDIS 0x00000002
213#define SPIDER_NET_DMA_TX_VALUE SPIDER_NET_TX_DMA_EN | \
214 SPIDER_NET_GDTDCEIDIS
212#define SPIDER_NET_DMA_TX_FEND_VALUE 0x00030003 215#define SPIDER_NET_DMA_TX_FEND_VALUE 0x00030003
213 216
214/* SPIDER_NET_UA_DESCR_VALUE is OR'ed with the unicast address */ 217/* SPIDER_NET_UA_DESCR_VALUE is OR'ed with the unicast address */
@@ -329,55 +332,23 @@ enum spider_net_int2_status {
329 (~SPIDER_NET_TXINT) & \ 332 (~SPIDER_NET_TXINT) & \
330 (~SPIDER_NET_RXINT) ) 333 (~SPIDER_NET_RXINT) )
331 334
332#define SPIDER_NET_GPREXEC 0x80000000 335#define SPIDER_NET_GPREXEC 0x80000000
333#define SPIDER_NET_GPRDAT_MASK 0x0000ffff 336#define SPIDER_NET_GPRDAT_MASK 0x0000ffff
334 337
335/* descriptor bits 338#define SPIDER_NET_DMAC_NOINTR_COMPLETE 0x00800000
336 * 339#define SPIDER_NET_DMAC_NOCS 0x00040000
337 * 1010 descriptor ready 340#define SPIDER_NET_DMAC_TCP 0x00020000
338 * 0 descr in middle of chain 341#define SPIDER_NET_DMAC_UDP 0x00030000
339 * 000 fixed to 0 342#define SPIDER_NET_TXDCEST 0x08000000
340 * 343
341 * 0 no interrupt on completion 344#define SPIDER_NET_DESCR_IND_PROC_MASK 0xF0000000
342 * 000 fixed to 0 345#define SPIDER_NET_DESCR_COMPLETE 0x00000000 /* used in rx and tx */
343 * 1 no ipsec processing 346#define SPIDER_NET_DESCR_RESPONSE_ERROR 0x10000000 /* used in rx and tx */
344 * 1 last descriptor for this frame 347#define SPIDER_NET_DESCR_PROTECTION_ERROR 0x20000000 /* used in rx and tx */
345 * 00 no checksum 348#define SPIDER_NET_DESCR_FRAME_END 0x40000000 /* used in rx */
346 * 10 tcp checksum 349#define SPIDER_NET_DESCR_FORCE_END 0x50000000 /* used in rx and tx */
347 * 11 udp checksum 350#define SPIDER_NET_DESCR_CARDOWNED 0xA0000000 /* used in rx and tx */
348 * 351#define SPIDER_NET_DESCR_NOT_IN_USE 0xF0000000
349 * 00 fixed to 0
350 * 0 fixed to 0
351 * 0 no interrupt on response errors
352 * 0 no interrupt on invalid descr
353 * 0 no interrupt on dma process termination
354 * 0 no interrupt on descr chain end
355 * 0 no interrupt on descr complete
356 *
357 * 000 fixed to 0
358 * 0 response error interrupt status
359 * 0 invalid descr status
360 * 0 dma termination status
361 * 0 descr chain end status
362 * 0 descr complete status */
363#define SPIDER_NET_DMAC_CMDSTAT_NOCS 0xa00c0000
364#define SPIDER_NET_DMAC_CMDSTAT_TCPCS 0xa00e0000
365#define SPIDER_NET_DMAC_CMDSTAT_UDPCS 0xa00f0000
366#define SPIDER_NET_DESCR_IND_PROC_SHIFT 28
367#define SPIDER_NET_DESCR_IND_PROC_MASKO 0x0fffffff
368
369/* descr ready, descr is in middle of chain, get interrupt on completion */
370#define SPIDER_NET_DMAC_RX_CARDOWNED 0xa0800000
371
372enum spider_net_descr_status {
373 SPIDER_NET_DESCR_COMPLETE = 0x00, /* used in rx and tx */
374 SPIDER_NET_DESCR_RESPONSE_ERROR = 0x01, /* used in rx and tx */
375 SPIDER_NET_DESCR_PROTECTION_ERROR = 0x02, /* used in rx and tx */
376 SPIDER_NET_DESCR_FRAME_END = 0x04, /* used in rx */
377 SPIDER_NET_DESCR_FORCE_END = 0x05, /* used in rx and tx */
378 SPIDER_NET_DESCR_CARDOWNED = 0x0a, /* used in rx and tx */
379 SPIDER_NET_DESCR_NOT_IN_USE /* any other value */
380};
381 352
382struct spider_net_descr { 353struct spider_net_descr {
383 /* as defined by the hardware */ 354 /* as defined by the hardware */
@@ -398,7 +369,7 @@ struct spider_net_descr {
398} __attribute__((aligned(32))); 369} __attribute__((aligned(32)));
399 370
400struct spider_net_descr_chain { 371struct spider_net_descr_chain {
401 /* we walk from tail to head */ 372 spinlock_t lock;
402 struct spider_net_descr *head; 373 struct spider_net_descr *head;
403 struct spider_net_descr *tail; 374 struct spider_net_descr *tail;
404}; 375};
@@ -453,8 +424,6 @@ struct spider_net_card {
453 424
454 struct spider_net_descr_chain tx_chain; 425 struct spider_net_descr_chain tx_chain;
455 struct spider_net_descr_chain rx_chain; 426 struct spider_net_descr_chain rx_chain;
456 atomic_t rx_chain_refill;
457 atomic_t tx_chain_release;
458 427
459 struct net_device_stats netdev_stats; 428 struct net_device_stats netdev_stats;
460 429
diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c
index ed1f59901ff4..c0a62b00ffc8 100644
--- a/drivers/net/starfire.c
+++ b/drivers/net/starfire.c
@@ -22,129 +22,13 @@
22 22
23 Support and updates available at 23 Support and updates available at
24 http://www.scyld.com/network/starfire.html 24 http://www.scyld.com/network/starfire.html
25 [link no longer provides useful info -jgarzik]
25 26
26 -----------------------------------------------------------
27
28 Linux kernel-specific changes:
29
30 LK1.1.1 (jgarzik):
31 - Use PCI driver interface
32 - Fix MOD_xxx races
33 - softnet fixups
34
35 LK1.1.2 (jgarzik):
36 - Merge Becker version 0.15
37
38 LK1.1.3 (Andrew Morton)
39 - Timer cleanups
40
41 LK1.1.4 (jgarzik):
42 - Merge Becker version 1.03
43
44 LK1.2.1 (Ion Badulescu <ionut@cs.columbia.edu>)
45 - Support hardware Rx/Tx checksumming
46 - Use the GFP firmware taken from Adaptec's Netware driver
47
48 LK1.2.2 (Ion Badulescu)
49 - Backported to 2.2.x
50
51 LK1.2.3 (Ion Badulescu)
52 - Fix the flaky mdio interface
53 - More compat clean-ups
54
55 LK1.2.4 (Ion Badulescu)
56 - More 2.2.x initialization fixes
57
58 LK1.2.5 (Ion Badulescu)
59 - Several fixes from Manfred Spraul
60
61 LK1.2.6 (Ion Badulescu)
62 - Fixed ifup/ifdown/ifup problem in 2.4.x
63
64 LK1.2.7 (Ion Badulescu)
65 - Removed unused code
66 - Made more functions static and __init
67
68 LK1.2.8 (Ion Badulescu)
69 - Quell bogus error messages, inform about the Tx threshold
70 - Removed #ifdef CONFIG_PCI, this driver is PCI only
71
72 LK1.2.9 (Ion Badulescu)
73 - Merged Jeff Garzik's changes from 2.4.4-pre5
74 - Added 2.2.x compatibility stuff required by the above changes
75
76 LK1.2.9a (Ion Badulescu)
77 - More updates from Jeff Garzik
78
79 LK1.3.0 (Ion Badulescu)
80 - Merged zerocopy support
81
82 LK1.3.1 (Ion Badulescu)
83 - Added ethtool support
84 - Added GPIO (media change) interrupt support
85
86 LK1.3.2 (Ion Badulescu)
87 - Fixed 2.2.x compatibility issues introduced in 1.3.1
88 - Fixed ethtool ioctl returning uninitialized memory
89
90 LK1.3.3 (Ion Badulescu)
91 - Initialize the TxMode register properly
92 - Don't dereference dev->priv after freeing it
93
94 LK1.3.4 (Ion Badulescu)
95 - Fixed initialization timing problems
96 - Fixed interrupt mask definitions
97
98 LK1.3.5 (jgarzik)
99 - ethtool NWAY_RST, GLINK, [GS]MSGLVL support
100
101 LK1.3.6:
102 - Sparc64 support and fixes (Ion Badulescu)
103 - Better stats and error handling (Ion Badulescu)
104 - Use new pci_set_mwi() PCI API function (jgarzik)
105
106 LK1.3.7 (Ion Badulescu)
107 - minimal implementation of tx_timeout()
108 - correctly shutdown the Rx/Tx engines in netdev_close()
109 - added calls to netif_carrier_on/off
110 (patch from Stefan Rompf <srompf@isg.de>)
111 - VLAN support
112
113 LK1.3.8 (Ion Badulescu)
114 - adjust DMA burst size on sparc64
115 - 64-bit support
116 - reworked zerocopy support for 64-bit buffers
117 - working and usable interrupt mitigation/latency
118 - reduced Tx interrupt frequency for lower interrupt overhead
119
120 LK1.3.9 (Ion Badulescu)
121 - bugfix for mcast filter
122 - enable the right kind of Tx interrupts (TxDMADone, not TxDone)
123
124 LK1.4.0 (Ion Badulescu)
125 - NAPI support
126
127 LK1.4.1 (Ion Badulescu)
128 - flush PCI posting buffers after disabling Rx interrupts
129 - put the chip to a D3 slumber on driver unload
130 - added config option to enable/disable NAPI
131
132 LK1.4.2 (Ion Badulescu)
133 - finally added firmware (GPL'ed by Adaptec)
134 - removed compatibility code for 2.2.x
135
136 LK1.4.2.1 (Ion Badulescu)
137 - fixed 32/64 bit issues on i386 + CONFIG_HIGHMEM
138 - added 32-bit padding to outgoing skb's, removed previous workaround
139
140TODO: - fix forced speed/duplexing code (broken a long time ago, when
141 somebody converted the driver to use the generic MII code)
142 - fix VLAN support
143*/ 27*/
144 28
145#define DRV_NAME "starfire" 29#define DRV_NAME "starfire"
146#define DRV_VERSION "1.03+LK1.4.2.1" 30#define DRV_VERSION "2.0"
147#define DRV_RELDATE "October 3, 2005" 31#define DRV_RELDATE "June 27, 2006"
148 32
149#include <linux/module.h> 33#include <linux/module.h>
150#include <linux/kernel.h> 34#include <linux/kernel.h>
@@ -846,7 +730,6 @@ static int __devinit starfire_init_one(struct pci_dev *pdev,
846 goto err_out_free_netdev; 730 goto err_out_free_netdev;
847 } 731 }
848 732
849 /* ioremap is borken in Linux-2.2.x/sparc64 */
850 base = ioremap(ioaddr, io_size); 733 base = ioremap(ioaddr, io_size);
851 if (!base) { 734 if (!base) {
852 printk(KERN_ERR DRV_NAME " %d: cannot remap %#x @ %#lx, aborting\n", 735 printk(KERN_ERR DRV_NAME " %d: cannot remap %#x @ %#lx, aborting\n",
diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c
index 643fceae3db5..ac17377b3e9f 100644
--- a/drivers/net/sundance.c
+++ b/drivers/net/sundance.c
@@ -16,91 +16,13 @@
16 16
17 Support and updates available at 17 Support and updates available at
18 http://www.scyld.com/network/sundance.html 18 http://www.scyld.com/network/sundance.html
19 [link no longer provides useful info -jgarzik]
19 20
20
21 Version LK1.01a (jgarzik):
22 - Replace some MII-related magic numbers with constants
23
24 Version LK1.02 (D-Link):
25 - Add new board to PCI ID list
26 - Fix multicast bug
27
28 Version LK1.03 (D-Link):
29 - New Rx scheme, reduce Rx congestion
30 - Option to disable flow control
31
32 Version LK1.04 (D-Link):
33 - Tx timeout recovery
34 - More support for ethtool.
35
36 Version LK1.04a:
37 - Remove unused/constant members from struct pci_id_info
38 (which then allows removal of 'drv_flags' from private struct)
39 (jgarzik)
40 - If no phy is found, fail to load that board (jgarzik)
41 - Always start phy id scan at id 1 to avoid problems (Donald Becker)
42 - Autodetect where mii_preable_required is needed,
43 default to not needed. (Donald Becker)
44
45 Version LK1.04b:
46 - Remove mii_preamble_required module parameter (Donald Becker)
47 - Add per-interface mii_preamble_required (setting is autodetected)
48 (Donald Becker)
49 - Remove unnecessary cast from void pointer (jgarzik)
50 - Re-align comments in private struct (jgarzik)
51
52 Version LK1.04c (jgarzik):
53 - Support bitmapped message levels (NETIF_MSG_xxx), and the
54 two ethtool ioctls that get/set them
55 - Don't hand-code MII ethtool support, use standard API/lib
56
57 Version LK1.04d:
58 - Merge from Donald Becker's sundance.c: (Jason Lunz)
59 * proper support for variably-sized MTUs
60 * default to PIO, to fix chip bugs
61 - Add missing unregister_netdev (Jason Lunz)
62 - Add CONFIG_SUNDANCE_MMIO config option (jgarzik)
63 - Better rx buf size calculation (Donald Becker)
64
65 Version LK1.05 (D-Link):
66 - Fix DFE-580TX packet drop issue (for DL10050C)
67 - Fix reset_tx logic
68
69 Version LK1.06 (D-Link):
70 - Fix crash while unloading driver
71
72 Versin LK1.06b (D-Link):
73 - New tx scheme, adaptive tx_coalesce
74
75 Version LK1.07 (D-Link):
76 - Fix tx bugs in big-endian machines
77 - Remove unused max_interrupt_work module parameter, the new
78 NAPI-like rx scheme doesn't need it.
79 - Remove redundancy get_stats() in intr_handler(), those
80 I/O access could affect performance in ARM-based system
81 - Add Linux software VLAN support
82
83 Version LK1.08 (Philippe De Muyter phdm@macqel.be):
84 - Fix bug of custom mac address
85 (StationAddr register only accept word write)
86
87 Version LK1.09 (D-Link):
88 - Fix the flowctrl bug.
89 - Set Pause bit in MII ANAR if flow control enabled.
90
91 Version LK1.09a (ICPlus):
92 - Add the delay time in reading the contents of EEPROM
93
94 Version LK1.10 (Philippe De Muyter phdm@macqel.be):
95 - Make 'unblock interface after Tx underrun' work
96
97 Version LK1.11 (Pedro Alejandro Lopez-Valencia palopezv at gmail.com):
98 - Add support for IC Plus Corporation IP100A chipset
99*/ 21*/
100 22
101#define DRV_NAME "sundance" 23#define DRV_NAME "sundance"
102#define DRV_VERSION "1.01+LK1.11" 24#define DRV_VERSION "1.1"
103#define DRV_RELDATE "14-Jun-2006" 25#define DRV_RELDATE "27-Jun-2006"
104 26
105 27
106/* The user-configurable values. 28/* The user-configurable values.
@@ -282,15 +204,15 @@ IVc. Errata
282#define USE_IO_OPS 1 204#define USE_IO_OPS 1
283#endif 205#endif
284 206
285static struct pci_device_id sundance_pci_tbl[] = { 207static const struct pci_device_id sundance_pci_tbl[] = {
286 {0x1186, 0x1002, 0x1186, 0x1002, 0, 0, 0}, 208 { 0x1186, 0x1002, 0x1186, 0x1002, 0, 0, 0 },
287 {0x1186, 0x1002, 0x1186, 0x1003, 0, 0, 1}, 209 { 0x1186, 0x1002, 0x1186, 0x1003, 0, 0, 1 },
288 {0x1186, 0x1002, 0x1186, 0x1012, 0, 0, 2}, 210 { 0x1186, 0x1002, 0x1186, 0x1012, 0, 0, 2 },
289 {0x1186, 0x1002, 0x1186, 0x1040, 0, 0, 3}, 211 { 0x1186, 0x1002, 0x1186, 0x1040, 0, 0, 3 },
290 {0x1186, 0x1002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4}, 212 { 0x1186, 0x1002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4 },
291 {0x13F0, 0x0201, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 5}, 213 { 0x13F0, 0x0201, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 5 },
292 {0x13F0, 0x0200, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 6}, 214 { 0x13F0, 0x0200, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 6 },
293 {0,} 215 { }
294}; 216};
295MODULE_DEVICE_TABLE(pci, sundance_pci_tbl); 217MODULE_DEVICE_TABLE(pci, sundance_pci_tbl);
296 218
@@ -301,7 +223,7 @@ enum {
301struct pci_id_info { 223struct pci_id_info {
302 const char *name; 224 const char *name;
303}; 225};
304static const struct pci_id_info pci_id_tbl[] = { 226static const struct pci_id_info pci_id_tbl[] __devinitdata = {
305 {"D-Link DFE-550TX FAST Ethernet Adapter"}, 227 {"D-Link DFE-550TX FAST Ethernet Adapter"},
306 {"D-Link DFE-550FX 100Mbps Fiber-optics Adapter"}, 228 {"D-Link DFE-550FX 100Mbps Fiber-optics Adapter"},
307 {"D-Link DFE-580TX 4 port Server Adapter"}, 229 {"D-Link DFE-580TX 4 port Server Adapter"},
@@ -309,7 +231,7 @@ static const struct pci_id_info pci_id_tbl[] = {
309 {"D-Link DL10050-based FAST Ethernet Adapter"}, 231 {"D-Link DL10050-based FAST Ethernet Adapter"},
310 {"Sundance Technology Alta"}, 232 {"Sundance Technology Alta"},
311 {"IC Plus Corporation IP100A FAST Ethernet Adapter"}, 233 {"IC Plus Corporation IP100A FAST Ethernet Adapter"},
312 {NULL,}, /* 0 terminated list. */ 234 { } /* terminate list. */
313}; 235};
314 236
315/* This driver was written to use PCI memory space, however x86-oriented 237/* This driver was written to use PCI memory space, however x86-oriented
diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c
index 8673fd4c08c7..c6f5bc3c042f 100644
--- a/drivers/net/sunhme.c
+++ b/drivers/net/sunhme.c
@@ -3255,12 +3255,7 @@ static void __devexit happy_meal_pci_remove(struct pci_dev *pdev)
3255} 3255}
3256 3256
3257static struct pci_device_id happymeal_pci_ids[] = { 3257static struct pci_device_id happymeal_pci_ids[] = {
3258 { 3258 { PCI_DEVICE(PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_HAPPYMEAL) },
3259 .vendor = PCI_VENDOR_ID_SUN,
3260 .device = PCI_DEVICE_ID_SUN_HAPPYMEAL,
3261 .subvendor = PCI_ANY_ID,
3262 .subdevice = PCI_ANY_ID,
3263 },
3264 { } /* Terminating entry */ 3259 { } /* Terminating entry */
3265}; 3260};
3266 3261
@@ -3275,7 +3270,7 @@ static struct pci_driver hme_pci_driver = {
3275 3270
3276static int __init happy_meal_pci_init(void) 3271static int __init happy_meal_pci_init(void)
3277{ 3272{
3278 return pci_module_init(&hme_pci_driver); 3273 return pci_register_driver(&hme_pci_driver);
3279} 3274}
3280 3275
3281static void happy_meal_pci_exit(void) 3276static void happy_meal_pci_exit(void)
diff --git a/drivers/net/sunlance.c b/drivers/net/sunlance.c
index 1ef9fd39a79a..0e3fdf7c6dd3 100644
--- a/drivers/net/sunlance.c
+++ b/drivers/net/sunlance.c
@@ -1537,7 +1537,7 @@ static int __init sparc_lance_init(void)
1537{ 1537{
1538 if ((idprom->id_machtype == (SM_SUN4|SM_4_330)) || 1538 if ((idprom->id_machtype == (SM_SUN4|SM_4_330)) ||
1539 (idprom->id_machtype == (SM_SUN4|SM_4_470))) { 1539 (idprom->id_machtype == (SM_SUN4|SM_4_470))) {
1540 memset(&sun4_sdev, 0, sizeof(sdev)); 1540 memset(&sun4_sdev, 0, sizeof(struct sbus_dev));
1541 sun4_sdev.reg_addrs[0].phys_addr = sun4_eth_physaddr; 1541 sun4_sdev.reg_addrs[0].phys_addr = sun4_eth_physaddr;
1542 sun4_sdev.irqs[0] = 6; 1542 sun4_sdev.irqs[0] = 6;
1543 return sparc_lance_probe_one(&sun4_sdev, NULL, NULL); 1543 return sparc_lance_probe_one(&sun4_sdev, NULL, NULL);
@@ -1547,16 +1547,16 @@ static int __init sparc_lance_init(void)
1547 1547
1548static int __exit sunlance_sun4_remove(void) 1548static int __exit sunlance_sun4_remove(void)
1549{ 1549{
1550 struct lance_private *lp = dev_get_drvdata(&sun4_sdev->dev); 1550 struct lance_private *lp = dev_get_drvdata(&sun4_sdev.ofdev.dev);
1551 struct net_device *net_dev = lp->dev; 1551 struct net_device *net_dev = lp->dev;
1552 1552
1553 unregister_netdevice(net_dev); 1553 unregister_netdevice(net_dev);
1554 1554
1555 lance_free_hwresources(root_lance_dev); 1555 lance_free_hwresources(lp);
1556 1556
1557 free_netdev(net_dev); 1557 free_netdev(net_dev);
1558 1558
1559 dev_set_drvdata(&sun4_sdev->dev, NULL); 1559 dev_set_drvdata(&sun4_sdev.ofdev.dev, NULL);
1560 1560
1561 return 0; 1561 return 0;
1562} 1562}
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index f645921aff8b..6f97962dd06b 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -68,8 +68,8 @@
68 68
69#define DRV_MODULE_NAME "tg3" 69#define DRV_MODULE_NAME "tg3"
70#define PFX DRV_MODULE_NAME ": " 70#define PFX DRV_MODULE_NAME ": "
71#define DRV_MODULE_VERSION "3.62" 71#define DRV_MODULE_VERSION "3.64"
72#define DRV_MODULE_RELDATE "June 30, 2006" 72#define DRV_MODULE_RELDATE "July 31, 2006"
73 73
74#define TG3_DEF_MAC_MODE 0 74#define TG3_DEF_MAC_MODE 0
75#define TG3_DEF_RX_MODE 0 75#define TG3_DEF_RX_MODE 0
@@ -3097,7 +3097,7 @@ static int tg3_alloc_rx_skb(struct tg3 *tp, u32 opaque_key,
3097 * Callers depend upon this behavior and assume that 3097 * Callers depend upon this behavior and assume that
3098 * we leave everything unchanged if we fail. 3098 * we leave everything unchanged if we fail.
3099 */ 3099 */
3100 skb = dev_alloc_skb(skb_size); 3100 skb = netdev_alloc_skb(tp->dev, skb_size);
3101 if (skb == NULL) 3101 if (skb == NULL)
3102 return -ENOMEM; 3102 return -ENOMEM;
3103 3103
@@ -3270,7 +3270,7 @@ static int tg3_rx(struct tg3 *tp, int budget)
3270 tg3_recycle_rx(tp, opaque_key, 3270 tg3_recycle_rx(tp, opaque_key,
3271 desc_idx, *post_ptr); 3271 desc_idx, *post_ptr);
3272 3272
3273 copy_skb = dev_alloc_skb(len + 2); 3273 copy_skb = netdev_alloc_skb(tp->dev, len + 2);
3274 if (copy_skb == NULL) 3274 if (copy_skb == NULL)
3275 goto drop_it_no_recycle; 3275 goto drop_it_no_recycle;
3276 3276
@@ -3590,6 +3590,28 @@ static irqreturn_t tg3_test_isr(int irq, void *dev_id,
3590static int tg3_init_hw(struct tg3 *, int); 3590static int tg3_init_hw(struct tg3 *, int);
3591static int tg3_halt(struct tg3 *, int, int); 3591static int tg3_halt(struct tg3 *, int, int);
3592 3592
3593/* Restart hardware after configuration changes, self-test, etc.
3594 * Invoked with tp->lock held.
3595 */
3596static int tg3_restart_hw(struct tg3 *tp, int reset_phy)
3597{
3598 int err;
3599
3600 err = tg3_init_hw(tp, reset_phy);
3601 if (err) {
3602 printk(KERN_ERR PFX "%s: Failed to re-initialize device, "
3603 "aborting.\n", tp->dev->name);
3604 tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
3605 tg3_full_unlock(tp);
3606 del_timer_sync(&tp->timer);
3607 tp->irq_sync = 0;
3608 netif_poll_enable(tp->dev);
3609 dev_close(tp->dev);
3610 tg3_full_lock(tp, 0);
3611 }
3612 return err;
3613}
3614
3593#ifdef CONFIG_NET_POLL_CONTROLLER 3615#ifdef CONFIG_NET_POLL_CONTROLLER
3594static void tg3_poll_controller(struct net_device *dev) 3616static void tg3_poll_controller(struct net_device *dev)
3595{ 3617{
@@ -3630,13 +3652,15 @@ static void tg3_reset_task(void *_data)
3630 } 3652 }
3631 3653
3632 tg3_halt(tp, RESET_KIND_SHUTDOWN, 0); 3654 tg3_halt(tp, RESET_KIND_SHUTDOWN, 0);
3633 tg3_init_hw(tp, 1); 3655 if (tg3_init_hw(tp, 1))
3656 goto out;
3634 3657
3635 tg3_netif_start(tp); 3658 tg3_netif_start(tp);
3636 3659
3637 if (restart_timer) 3660 if (restart_timer)
3638 mod_timer(&tp->timer, jiffies + 1); 3661 mod_timer(&tp->timer, jiffies + 1);
3639 3662
3663out:
3640 tp->tg3_flags &= ~TG3_FLAG_IN_RESET_TASK; 3664 tp->tg3_flags &= ~TG3_FLAG_IN_RESET_TASK;
3641 3665
3642 tg3_full_unlock(tp); 3666 tg3_full_unlock(tp);
@@ -4124,6 +4148,7 @@ static inline void tg3_set_mtu(struct net_device *dev, struct tg3 *tp,
4124static int tg3_change_mtu(struct net_device *dev, int new_mtu) 4148static int tg3_change_mtu(struct net_device *dev, int new_mtu)
4125{ 4149{
4126 struct tg3 *tp = netdev_priv(dev); 4150 struct tg3 *tp = netdev_priv(dev);
4151 int err;
4127 4152
4128 if (new_mtu < TG3_MIN_MTU || new_mtu > TG3_MAX_MTU(tp)) 4153 if (new_mtu < TG3_MIN_MTU || new_mtu > TG3_MAX_MTU(tp))
4129 return -EINVAL; 4154 return -EINVAL;
@@ -4144,13 +4169,14 @@ static int tg3_change_mtu(struct net_device *dev, int new_mtu)
4144 4169
4145 tg3_set_mtu(dev, tp, new_mtu); 4170 tg3_set_mtu(dev, tp, new_mtu);
4146 4171
4147 tg3_init_hw(tp, 0); 4172 err = tg3_restart_hw(tp, 0);
4148 4173
4149 tg3_netif_start(tp); 4174 if (!err)
4175 tg3_netif_start(tp);
4150 4176
4151 tg3_full_unlock(tp); 4177 tg3_full_unlock(tp);
4152 4178
4153 return 0; 4179 return err;
4154} 4180}
4155 4181
4156/* Free up pending packets in all rx/tx rings. 4182/* Free up pending packets in all rx/tx rings.
@@ -4232,7 +4258,7 @@ static void tg3_free_rings(struct tg3 *tp)
4232 * end up in the driver. tp->{tx,}lock are held and thus 4258 * end up in the driver. tp->{tx,}lock are held and thus
4233 * we may not sleep. 4259 * we may not sleep.
4234 */ 4260 */
4235static void tg3_init_rings(struct tg3 *tp) 4261static int tg3_init_rings(struct tg3 *tp)
4236{ 4262{
4237 u32 i; 4263 u32 i;
4238 4264
@@ -4281,18 +4307,38 @@ static void tg3_init_rings(struct tg3 *tp)
4281 4307
4282 /* Now allocate fresh SKBs for each rx ring. */ 4308 /* Now allocate fresh SKBs for each rx ring. */
4283 for (i = 0; i < tp->rx_pending; i++) { 4309 for (i = 0; i < tp->rx_pending; i++) {
4284 if (tg3_alloc_rx_skb(tp, RXD_OPAQUE_RING_STD, 4310 if (tg3_alloc_rx_skb(tp, RXD_OPAQUE_RING_STD, -1, i) < 0) {
4285 -1, i) < 0) 4311 printk(KERN_WARNING PFX
4312 "%s: Using a smaller RX standard ring, "
4313 "only %d out of %d buffers were allocated "
4314 "successfully.\n",
4315 tp->dev->name, i, tp->rx_pending);
4316 if (i == 0)
4317 return -ENOMEM;
4318 tp->rx_pending = i;
4286 break; 4319 break;
4320 }
4287 } 4321 }
4288 4322
4289 if (tp->tg3_flags & TG3_FLAG_JUMBO_RING_ENABLE) { 4323 if (tp->tg3_flags & TG3_FLAG_JUMBO_RING_ENABLE) {
4290 for (i = 0; i < tp->rx_jumbo_pending; i++) { 4324 for (i = 0; i < tp->rx_jumbo_pending; i++) {
4291 if (tg3_alloc_rx_skb(tp, RXD_OPAQUE_RING_JUMBO, 4325 if (tg3_alloc_rx_skb(tp, RXD_OPAQUE_RING_JUMBO,
4292 -1, i) < 0) 4326 -1, i) < 0) {
4327 printk(KERN_WARNING PFX
4328 "%s: Using a smaller RX jumbo ring, "
4329 "only %d out of %d buffers were "
4330 "allocated successfully.\n",
4331 tp->dev->name, i, tp->rx_jumbo_pending);
4332 if (i == 0) {
4333 tg3_free_rings(tp);
4334 return -ENOMEM;
4335 }
4336 tp->rx_jumbo_pending = i;
4293 break; 4337 break;
4338 }
4294 } 4339 }
4295 } 4340 }
4341 return 0;
4296} 4342}
4297 4343
4298/* 4344/*
@@ -5815,6 +5861,7 @@ static int tg3_set_mac_addr(struct net_device *dev, void *p)
5815{ 5861{
5816 struct tg3 *tp = netdev_priv(dev); 5862 struct tg3 *tp = netdev_priv(dev);
5817 struct sockaddr *addr = p; 5863 struct sockaddr *addr = p;
5864 int err = 0;
5818 5865
5819 if (!is_valid_ether_addr(addr->sa_data)) 5866 if (!is_valid_ether_addr(addr->sa_data))
5820 return -EINVAL; 5867 return -EINVAL;
@@ -5832,9 +5879,9 @@ static int tg3_set_mac_addr(struct net_device *dev, void *p)
5832 tg3_full_lock(tp, 1); 5879 tg3_full_lock(tp, 1);
5833 5880
5834 tg3_halt(tp, RESET_KIND_SHUTDOWN, 1); 5881 tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
5835 tg3_init_hw(tp, 0); 5882 err = tg3_restart_hw(tp, 0);
5836 5883 if (!err)
5837 tg3_netif_start(tp); 5884 tg3_netif_start(tp);
5838 tg3_full_unlock(tp); 5885 tg3_full_unlock(tp);
5839 } else { 5886 } else {
5840 spin_lock_bh(&tp->lock); 5887 spin_lock_bh(&tp->lock);
@@ -5842,7 +5889,7 @@ static int tg3_set_mac_addr(struct net_device *dev, void *p)
5842 spin_unlock_bh(&tp->lock); 5889 spin_unlock_bh(&tp->lock);
5843 } 5890 }
5844 5891
5845 return 0; 5892 return err;
5846} 5893}
5847 5894
5848/* tp->lock is held. */ 5895/* tp->lock is held. */
@@ -5942,7 +5989,9 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
5942 * can only do this after the hardware has been 5989 * can only do this after the hardware has been
5943 * successfully reset. 5990 * successfully reset.
5944 */ 5991 */
5945 tg3_init_rings(tp); 5992 err = tg3_init_rings(tp);
5993 if (err)
5994 return err;
5946 5995
5947 /* This value is determined during the probe time DMA 5996 /* This value is determined during the probe time DMA
5948 * engine test, tg3_test_dma. 5997 * engine test, tg3_test_dma.
@@ -7956,7 +8005,7 @@ static void tg3_get_ringparam(struct net_device *dev, struct ethtool_ringparam *
7956static int tg3_set_ringparam(struct net_device *dev, struct ethtool_ringparam *ering) 8005static int tg3_set_ringparam(struct net_device *dev, struct ethtool_ringparam *ering)
7957{ 8006{
7958 struct tg3 *tp = netdev_priv(dev); 8007 struct tg3 *tp = netdev_priv(dev);
7959 int irq_sync = 0; 8008 int irq_sync = 0, err = 0;
7960 8009
7961 if ((ering->rx_pending > TG3_RX_RING_SIZE - 1) || 8010 if ((ering->rx_pending > TG3_RX_RING_SIZE - 1) ||
7962 (ering->rx_jumbo_pending > TG3_RX_JUMBO_RING_SIZE - 1) || 8011 (ering->rx_jumbo_pending > TG3_RX_JUMBO_RING_SIZE - 1) ||
@@ -7980,13 +8029,14 @@ static int tg3_set_ringparam(struct net_device *dev, struct ethtool_ringparam *e
7980 8029
7981 if (netif_running(dev)) { 8030 if (netif_running(dev)) {
7982 tg3_halt(tp, RESET_KIND_SHUTDOWN, 1); 8031 tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
7983 tg3_init_hw(tp, 1); 8032 err = tg3_restart_hw(tp, 1);
7984 tg3_netif_start(tp); 8033 if (!err)
8034 tg3_netif_start(tp);
7985 } 8035 }
7986 8036
7987 tg3_full_unlock(tp); 8037 tg3_full_unlock(tp);
7988 8038
7989 return 0; 8039 return err;
7990} 8040}
7991 8041
7992static void tg3_get_pauseparam(struct net_device *dev, struct ethtool_pauseparam *epause) 8042static void tg3_get_pauseparam(struct net_device *dev, struct ethtool_pauseparam *epause)
@@ -8001,7 +8051,7 @@ static void tg3_get_pauseparam(struct net_device *dev, struct ethtool_pauseparam
8001static int tg3_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam *epause) 8051static int tg3_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam *epause)
8002{ 8052{
8003 struct tg3 *tp = netdev_priv(dev); 8053 struct tg3 *tp = netdev_priv(dev);
8004 int irq_sync = 0; 8054 int irq_sync = 0, err = 0;
8005 8055
8006 if (netif_running(dev)) { 8056 if (netif_running(dev)) {
8007 tg3_netif_stop(tp); 8057 tg3_netif_stop(tp);
@@ -8025,13 +8075,14 @@ static int tg3_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam
8025 8075
8026 if (netif_running(dev)) { 8076 if (netif_running(dev)) {
8027 tg3_halt(tp, RESET_KIND_SHUTDOWN, 1); 8077 tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
8028 tg3_init_hw(tp, 1); 8078 err = tg3_restart_hw(tp, 1);
8029 tg3_netif_start(tp); 8079 if (!err)
8080 tg3_netif_start(tp);
8030 } 8081 }
8031 8082
8032 tg3_full_unlock(tp); 8083 tg3_full_unlock(tp);
8033 8084
8034 return 0; 8085 return err;
8035} 8086}
8036 8087
8037static u32 tg3_get_rx_csum(struct net_device *dev) 8088static u32 tg3_get_rx_csum(struct net_device *dev)
@@ -8567,7 +8618,7 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)
8567 err = -EIO; 8618 err = -EIO;
8568 8619
8569 tx_len = 1514; 8620 tx_len = 1514;
8570 skb = dev_alloc_skb(tx_len); 8621 skb = netdev_alloc_skb(tp->dev, tx_len);
8571 if (!skb) 8622 if (!skb)
8572 return -ENOMEM; 8623 return -ENOMEM;
8573 8624
@@ -8666,7 +8717,9 @@ static int tg3_test_loopback(struct tg3 *tp)
8666 if (!netif_running(tp->dev)) 8717 if (!netif_running(tp->dev))
8667 return TG3_LOOPBACK_FAILED; 8718 return TG3_LOOPBACK_FAILED;
8668 8719
8669 tg3_reset_hw(tp, 1); 8720 err = tg3_reset_hw(tp, 1);
8721 if (err)
8722 return TG3_LOOPBACK_FAILED;
8670 8723
8671 if (tg3_run_loopback(tp, TG3_MAC_LOOPBACK)) 8724 if (tg3_run_loopback(tp, TG3_MAC_LOOPBACK))
8672 err |= TG3_MAC_LOOPBACK_FAILED; 8725 err |= TG3_MAC_LOOPBACK_FAILED;
@@ -8740,8 +8793,8 @@ static void tg3_self_test(struct net_device *dev, struct ethtool_test *etest,
8740 tg3_halt(tp, RESET_KIND_SHUTDOWN, 1); 8793 tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
8741 if (netif_running(dev)) { 8794 if (netif_running(dev)) {
8742 tp->tg3_flags |= TG3_FLAG_INIT_COMPLETE; 8795 tp->tg3_flags |= TG3_FLAG_INIT_COMPLETE;
8743 tg3_init_hw(tp, 1); 8796 if (!tg3_restart_hw(tp, 1))
8744 tg3_netif_start(tp); 8797 tg3_netif_start(tp);
8745 } 8798 }
8746 8799
8747 tg3_full_unlock(tp); 8800 tg3_full_unlock(tp);
@@ -10078,6 +10131,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
10078 static struct pci_device_id write_reorder_chipsets[] = { 10131 static struct pci_device_id write_reorder_chipsets[] = {
10079 { PCI_DEVICE(PCI_VENDOR_ID_AMD, 10132 { PCI_DEVICE(PCI_VENDOR_ID_AMD,
10080 PCI_DEVICE_ID_AMD_FE_GATE_700C) }, 10133 PCI_DEVICE_ID_AMD_FE_GATE_700C) },
10134 { PCI_DEVICE(PCI_VENDOR_ID_AMD,
10135 PCI_DEVICE_ID_AMD_8131_BRIDGE) },
10081 { PCI_DEVICE(PCI_VENDOR_ID_VIA, 10136 { PCI_DEVICE(PCI_VENDOR_ID_VIA,
10082 PCI_DEVICE_ID_VIA_8385_0) }, 10137 PCI_DEVICE_ID_VIA_8385_0) },
10083 { }, 10138 { },
@@ -11697,7 +11752,8 @@ static int tg3_suspend(struct pci_dev *pdev, pm_message_t state)
11697 tg3_full_lock(tp, 0); 11752 tg3_full_lock(tp, 0);
11698 11753
11699 tp->tg3_flags |= TG3_FLAG_INIT_COMPLETE; 11754 tp->tg3_flags |= TG3_FLAG_INIT_COMPLETE;
11700 tg3_init_hw(tp, 1); 11755 if (tg3_restart_hw(tp, 1))
11756 goto out;
11701 11757
11702 tp->timer.expires = jiffies + tp->timer_offset; 11758 tp->timer.expires = jiffies + tp->timer_offset;
11703 add_timer(&tp->timer); 11759 add_timer(&tp->timer);
@@ -11705,6 +11761,7 @@ static int tg3_suspend(struct pci_dev *pdev, pm_message_t state)
11705 netif_device_attach(dev); 11761 netif_device_attach(dev);
11706 tg3_netif_start(tp); 11762 tg3_netif_start(tp);
11707 11763
11764out:
11708 tg3_full_unlock(tp); 11765 tg3_full_unlock(tp);
11709 } 11766 }
11710 11767
@@ -11731,16 +11788,19 @@ static int tg3_resume(struct pci_dev *pdev)
11731 tg3_full_lock(tp, 0); 11788 tg3_full_lock(tp, 0);
11732 11789
11733 tp->tg3_flags |= TG3_FLAG_INIT_COMPLETE; 11790 tp->tg3_flags |= TG3_FLAG_INIT_COMPLETE;
11734 tg3_init_hw(tp, 1); 11791 err = tg3_restart_hw(tp, 1);
11792 if (err)
11793 goto out;
11735 11794
11736 tp->timer.expires = jiffies + tp->timer_offset; 11795 tp->timer.expires = jiffies + tp->timer_offset;
11737 add_timer(&tp->timer); 11796 add_timer(&tp->timer);
11738 11797
11739 tg3_netif_start(tp); 11798 tg3_netif_start(tp);
11740 11799
11800out:
11741 tg3_full_unlock(tp); 11801 tg3_full_unlock(tp);
11742 11802
11743 return 0; 11803 return err;
11744} 11804}
11745 11805
11746static struct pci_driver tg3_driver = { 11806static struct pci_driver tg3_driver = {
diff --git a/drivers/net/tulip/winbond-840.c b/drivers/net/tulip/winbond-840.c
index b4c0d101a7d7..7f414815cc62 100644
--- a/drivers/net/tulip/winbond-840.c
+++ b/drivers/net/tulip/winbond-840.c
@@ -224,24 +224,21 @@ static const struct pci_device_id w840_pci_tbl[] = {
224}; 224};
225MODULE_DEVICE_TABLE(pci, w840_pci_tbl); 225MODULE_DEVICE_TABLE(pci, w840_pci_tbl);
226 226
227enum {
228 netdev_res_size = 128, /* size of PCI BAR resource */
229};
230
227struct pci_id_info { 231struct pci_id_info {
228 const char *name; 232 const char *name;
229 struct match_info { 233 int drv_flags; /* Driver use, intended as capability flags. */
230 int pci, pci_mask, subsystem, subsystem_mask;
231 int revision, revision_mask; /* Only 8 bits. */
232 } id;
233 int io_size; /* Needed for I/O region check or ioremap(). */
234 int drv_flags; /* Driver use, intended as capability flags. */
235}; 234};
236static struct pci_id_info pci_id_tbl[] = { 235
237 {"Winbond W89c840", /* Sometime a Level-One switch card. */ 236static const struct pci_id_info pci_id_tbl[] __devinitdata = {
238 { 0x08401050, 0xffffffff, 0x81530000, 0xffff0000 }, 237 { /* Sometime a Level-One switch card. */
239 128, CanHaveMII | HasBrokenTx | FDXOnNoMII}, 238 "Winbond W89c840", CanHaveMII | HasBrokenTx | FDXOnNoMII},
240 {"Winbond W89c840", { 0x08401050, 0xffffffff, }, 239 { "Winbond W89c840", CanHaveMII | HasBrokenTx},
241 128, CanHaveMII | HasBrokenTx}, 240 { "Compex RL100-ATX", CanHaveMII | HasBrokenTx},
242 {"Compex RL100-ATX", { 0x201111F6, 0xffffffff,}, 241 { } /* terminate list. */
243 128, CanHaveMII | HasBrokenTx},
244 {NULL,}, /* 0 terminated list. */
245}; 242};
246 243
247/* This driver was written to use PCI memory space, however some x86 systems 244/* This driver was written to use PCI memory space, however some x86 systems
@@ -399,7 +396,7 @@ static int __devinit w840_probe1 (struct pci_dev *pdev,
399#ifdef USE_IO_OPS 396#ifdef USE_IO_OPS
400 bar = 0; 397 bar = 0;
401#endif 398#endif
402 ioaddr = pci_iomap(pdev, bar, pci_id_tbl[chip_idx].io_size); 399 ioaddr = pci_iomap(pdev, bar, netdev_res_size);
403 if (!ioaddr) 400 if (!ioaddr)
404 goto err_out_free_res; 401 goto err_out_free_res;
405 402
diff --git a/drivers/net/tulip/xircom_tulip_cb.c b/drivers/net/tulip/xircom_tulip_cb.c
index 091ebb7a62f6..17ca7dc42e6f 100644
--- a/drivers/net/tulip/xircom_tulip_cb.c
+++ b/drivers/net/tulip/xircom_tulip_cb.c
@@ -10,26 +10,11 @@
10 410 Severn Ave., Suite 210 10 410 Severn Ave., Suite 210
11 Annapolis MD 21403 11 Annapolis MD 21403
12 12
13 -----------------------------------------------------------
14
15 Linux kernel-specific changes:
16
17 LK1.0 (Ion Badulescu)
18 - Major cleanup
19 - Use 2.4 PCI API
20 - Support ethtool
21 - Rewrite perfect filter/hash code
22 - Use interrupts for media changes
23
24 LK1.1 (Ion Badulescu)
25 - Disallow negotiation of unsupported full-duplex modes
26*/ 13*/
27 14
28#define DRV_NAME "xircom_tulip_cb" 15#define DRV_NAME "xircom_tulip_cb"
29#define DRV_VERSION "0.91+LK1.1" 16#define DRV_VERSION "0.92"
30#define DRV_RELDATE "October 11, 2001" 17#define DRV_RELDATE "June 27, 2006"
31
32#define CARDBUS 1
33 18
34/* A few user-configurable values. */ 19/* A few user-configurable values. */
35 20
@@ -306,10 +291,10 @@ struct xircom_private {
306 struct xircom_tx_desc tx_ring[TX_RING_SIZE]; 291 struct xircom_tx_desc tx_ring[TX_RING_SIZE];
307 /* The saved address of a sent-in-place packet/buffer, for skfree(). */ 292 /* The saved address of a sent-in-place packet/buffer, for skfree(). */
308 struct sk_buff* tx_skbuff[TX_RING_SIZE]; 293 struct sk_buff* tx_skbuff[TX_RING_SIZE];
309#ifdef CARDBUS 294
310 /* The X3201-3 requires 4-byte aligned tx bufs */ 295 /* The X3201-3 requires 4-byte aligned tx bufs */
311 struct sk_buff* tx_aligned_skbuff[TX_RING_SIZE]; 296 struct sk_buff* tx_aligned_skbuff[TX_RING_SIZE];
312#endif 297
313 /* The addresses of receive-in-place skbuffs. */ 298 /* The addresses of receive-in-place skbuffs. */
314 struct sk_buff* rx_skbuff[RX_RING_SIZE]; 299 struct sk_buff* rx_skbuff[RX_RING_SIZE];
315 u16 setup_frame[PKT_SETUP_SZ / sizeof(u16)]; /* Pseudo-Tx frame to init address table. */ 300 u16 setup_frame[PKT_SETUP_SZ / sizeof(u16)]; /* Pseudo-Tx frame to init address table. */
@@ -908,10 +893,8 @@ static void xircom_init_ring(struct net_device *dev)
908 tp->tx_skbuff[i] = NULL; 893 tp->tx_skbuff[i] = NULL;
909 tp->tx_ring[i].status = 0; 894 tp->tx_ring[i].status = 0;
910 tp->tx_ring[i].buffer2 = virt_to_bus(&tp->tx_ring[i+1]); 895 tp->tx_ring[i].buffer2 = virt_to_bus(&tp->tx_ring[i+1]);
911#ifdef CARDBUS
912 if (tp->chip_id == X3201_3) 896 if (tp->chip_id == X3201_3)
913 tp->tx_aligned_skbuff[i] = dev_alloc_skb(PKT_BUF_SZ); 897 tp->tx_aligned_skbuff[i] = dev_alloc_skb(PKT_BUF_SZ);
914#endif /* CARDBUS */
915 } 898 }
916 tp->tx_ring[i-1].buffer2 = virt_to_bus(&tp->tx_ring[0]); 899 tp->tx_ring[i-1].buffer2 = virt_to_bus(&tp->tx_ring[0]);
917} 900}
@@ -931,12 +914,10 @@ xircom_start_xmit(struct sk_buff *skb, struct net_device *dev)
931 entry = tp->cur_tx % TX_RING_SIZE; 914 entry = tp->cur_tx % TX_RING_SIZE;
932 915
933 tp->tx_skbuff[entry] = skb; 916 tp->tx_skbuff[entry] = skb;
934#ifdef CARDBUS
935 if (tp->chip_id == X3201_3) { 917 if (tp->chip_id == X3201_3) {
936 memcpy(tp->tx_aligned_skbuff[entry]->data,skb->data,skb->len); 918 memcpy(tp->tx_aligned_skbuff[entry]->data,skb->data,skb->len);
937 tp->tx_ring[entry].buffer1 = virt_to_bus(tp->tx_aligned_skbuff[entry]->data); 919 tp->tx_ring[entry].buffer1 = virt_to_bus(tp->tx_aligned_skbuff[entry]->data);
938 } else 920 } else
939#endif
940 tp->tx_ring[entry].buffer1 = virt_to_bus(skb->data); 921 tp->tx_ring[entry].buffer1 = virt_to_bus(skb->data);
941 922
942 if (tp->cur_tx - tp->dirty_tx < TX_RING_SIZE/2) {/* Typical path */ 923 if (tp->cur_tx - tp->dirty_tx < TX_RING_SIZE/2) {/* Typical path */
diff --git a/drivers/net/typhoon.c b/drivers/net/typhoon.c
index 063816f2b11e..4103c37172f9 100644
--- a/drivers/net/typhoon.c
+++ b/drivers/net/typhoon.c
@@ -805,7 +805,7 @@ typhoon_start_tx(struct sk_buff *skb, struct net_device *dev)
805 * If problems develop with TSO, check this first. 805 * If problems develop with TSO, check this first.
806 */ 806 */
807 numDesc = skb_shinfo(skb)->nr_frags + 1; 807 numDesc = skb_shinfo(skb)->nr_frags + 1;
808 if(skb_tso_size(skb)) 808 if (skb_is_gso(skb))
809 numDesc++; 809 numDesc++;
810 810
811 /* When checking for free space in the ring, we need to also 811 /* When checking for free space in the ring, we need to also
@@ -845,7 +845,7 @@ typhoon_start_tx(struct sk_buff *skb, struct net_device *dev)
845 TYPHOON_TX_PF_VLAN_TAG_SHIFT); 845 TYPHOON_TX_PF_VLAN_TAG_SHIFT);
846 } 846 }
847 847
848 if(skb_tso_size(skb)) { 848 if (skb_is_gso(skb)) {
849 first_txd->processFlags |= TYPHOON_TX_PF_TCP_SEGMENT; 849 first_txd->processFlags |= TYPHOON_TX_PF_TCP_SEGMENT;
850 first_txd->numDesc++; 850 first_txd->numDesc++;
851 851
diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c
index 98b6f3207d3d..d3d0ec970318 100644
--- a/drivers/net/via-rhine.c
+++ b/drivers/net/via-rhine.c
@@ -25,117 +25,13 @@
25 version. He may or may not be interested in bug reports on this 25 version. He may or may not be interested in bug reports on this
26 code. You can find his versions at: 26 code. You can find his versions at:
27 http://www.scyld.com/network/via-rhine.html 27 http://www.scyld.com/network/via-rhine.html
28 28 [link no longer provides useful info -jgarzik]
29
30 Linux kernel version history:
31
32 LK1.1.0:
33 - Jeff Garzik: softnet 'n stuff
34
35 LK1.1.1:
36 - Justin Guyett: softnet and locking fixes
37 - Jeff Garzik: use PCI interface
38
39 LK1.1.2:
40 - Urban Widmark: minor cleanups, merges from Becker 1.03a/1.04 versions
41
42 LK1.1.3:
43 - Urban Widmark: use PCI DMA interface (with thanks to the eepro100.c
44 code) update "Theory of Operation" with
45 softnet/locking changes
46 - Dave Miller: PCI DMA and endian fixups
47 - Jeff Garzik: MOD_xxx race fixes, updated PCI resource allocation
48
49 LK1.1.4:
50 - Urban Widmark: fix gcc 2.95.2 problem and
51 remove writel's to fixed address 0x7c
52
53 LK1.1.5:
54 - Urban Widmark: mdio locking, bounce buffer changes
55 merges from Beckers 1.05 version
56 added netif_running_on/off support
57
58 LK1.1.6:
59 - Urban Widmark: merges from Beckers 1.08b version (VT6102 + mdio)
60 set netif_running_on/off on startup, del_timer_sync
61
62 LK1.1.7:
63 - Manfred Spraul: added reset into tx_timeout
64
65 LK1.1.9:
66 - Urban Widmark: merges from Beckers 1.10 version
67 (media selection + eeprom reload)
68 - David Vrabel: merges from D-Link "1.11" version
69 (disable WOL and PME on startup)
70
71 LK1.1.10:
72 - Manfred Spraul: use "singlecopy" for unaligned buffers
73 don't allocate bounce buffers for !ReqTxAlign cards
74
75 LK1.1.11:
76 - David Woodhouse: Set dev->base_addr before the first time we call
77 wait_for_reset(). It's a lot happier that way.
78 Free np->tx_bufs only if we actually allocated it.
79
80 LK1.1.12:
81 - Martin Eriksson: Allow Memory-Mapped IO to be enabled.
82
83 LK1.1.13 (jgarzik):
84 - Add ethtool support
85 - Replace some MII-related magic numbers with constants
86
87 LK1.1.14 (Ivan G.):
88 - fixes comments for Rhine-III
89 - removes W_MAX_TIMEOUT (unused)
90 - adds HasDavicomPhy for Rhine-I (basis: linuxfet driver; my card
91 is R-I and has Davicom chip, flag is referenced in kernel driver)
92 - sends chip_id as a parameter to wait_for_reset since np is not
93 initialized on first call
94 - changes mmio "else if (chip_id==VT6102)" to "else" so it will work
95 for Rhine-III's (documentation says same bit is correct)
96 - transmit frame queue message is off by one - fixed
97 - adds IntrNormalSummary to "Something Wicked" exclusion list
98 so normal interrupts will not trigger the message (src: Donald Becker)
99 (Roger Luethi)
100 - show confused chip where to continue after Tx error
101 - location of collision counter is chip specific
102 - allow selecting backoff algorithm (module parameter)
103
104 LK1.1.15 (jgarzik):
105 - Use new MII lib helper generic_mii_ioctl
106
107 LK1.1.16 (Roger Luethi)
108 - Etherleak fix
109 - Handle Tx buffer underrun
110 - Fix bugs in full duplex handling
111 - New reset code uses "force reset" cmd on Rhine-II
112 - Various clean ups
113
114 LK1.1.17 (Roger Luethi)
115 - Fix race in via_rhine_start_tx()
116 - On errors, wait for Tx engine to turn off before scavenging
117 - Handle Tx descriptor write-back race on Rhine-II
118 - Force flushing for PCI posted writes
119 - More reset code changes
120
121 LK1.1.18 (Roger Luethi)
122 - No filtering multicast in promisc mode (Edward Peng)
123 - Fix for Rhine-I Tx timeouts
124
125 LK1.1.19 (Roger Luethi)
126 - Increase Tx threshold for unspecified errors
127
128 LK1.2.0-2.6 (Roger Luethi)
129 - Massive clean-up
130 - Rewrite PHY, media handling (remove options, full_duplex, backoff)
131 - Fix Tx engine race for good
132 - Craig Brind: Zero padded aligned buffers for short packets.
133 29
134*/ 30*/
135 31
136#define DRV_NAME "via-rhine" 32#define DRV_NAME "via-rhine"
137#define DRV_VERSION "1.2.0-2.6" 33#define DRV_VERSION "1.4.0"
138#define DRV_RELDATE "June-10-2004" 34#define DRV_RELDATE "June-27-2006"
139 35
140 36
141/* A few user-configurable values. 37/* A few user-configurable values.
@@ -356,12 +252,11 @@ enum rhine_quirks {
356/* Beware of PCI posted writes */ 252/* Beware of PCI posted writes */
357#define IOSYNC do { ioread8(ioaddr + StationAddr); } while (0) 253#define IOSYNC do { ioread8(ioaddr + StationAddr); } while (0)
358 254
359static struct pci_device_id rhine_pci_tbl[] = 255static const struct pci_device_id rhine_pci_tbl[] = {
360{ 256 { 0x1106, 0x3043, PCI_ANY_ID, PCI_ANY_ID, }, /* VT86C100A */
361 {0x1106, 0x3043, PCI_ANY_ID, PCI_ANY_ID, 0, 0, }, /* VT86C100A */ 257 { 0x1106, 0x3065, PCI_ANY_ID, PCI_ANY_ID, }, /* VT6102 */
362 {0x1106, 0x3065, PCI_ANY_ID, PCI_ANY_ID, 0, 0, }, /* VT6102 */ 258 { 0x1106, 0x3106, PCI_ANY_ID, PCI_ANY_ID, }, /* 6105{,L,LOM} */
363 {0x1106, 0x3106, PCI_ANY_ID, PCI_ANY_ID, 0, 0, }, /* 6105{,L,LOM} */ 259 { 0x1106, 0x3053, PCI_ANY_ID, PCI_ANY_ID, }, /* VT6105M */
364 {0x1106, 0x3053, PCI_ANY_ID, PCI_ANY_ID, 0, 0, }, /* VT6105M */
365 { } /* terminate list */ 260 { } /* terminate list */
366}; 261};
367MODULE_DEVICE_TABLE(pci, rhine_pci_tbl); 262MODULE_DEVICE_TABLE(pci, rhine_pci_tbl);
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
index ba2972ba3757..aa9cd92f46b2 100644
--- a/drivers/net/via-velocity.c
+++ b/drivers/net/via-velocity.c
@@ -229,7 +229,8 @@ static int rx_copybreak = 200;
229module_param(rx_copybreak, int, 0644); 229module_param(rx_copybreak, int, 0644);
230MODULE_PARM_DESC(rx_copybreak, "Copy breakpoint for copy-only-tiny-frames"); 230MODULE_PARM_DESC(rx_copybreak, "Copy breakpoint for copy-only-tiny-frames");
231 231
232static void velocity_init_info(struct pci_dev *pdev, struct velocity_info *vptr, struct velocity_info_tbl *info); 232static void velocity_init_info(struct pci_dev *pdev, struct velocity_info *vptr,
233 const struct velocity_info_tbl *info);
233static int velocity_get_pci_info(struct velocity_info *, struct pci_dev *pdev); 234static int velocity_get_pci_info(struct velocity_info *, struct pci_dev *pdev);
234static void velocity_print_info(struct velocity_info *vptr); 235static void velocity_print_info(struct velocity_info *vptr);
235static int velocity_open(struct net_device *dev); 236static int velocity_open(struct net_device *dev);
@@ -294,9 +295,9 @@ static void velocity_unregister_notifier(void)
294 * Internal board variants. At the moment we have only one 295 * Internal board variants. At the moment we have only one
295 */ 296 */
296 297
297static struct velocity_info_tbl chip_info_table[] = { 298static const struct velocity_info_tbl chip_info_table[] __devinitdata = {
298 {CHIP_TYPE_VT6110, "VIA Networking Velocity Family Gigabit Ethernet Adapter", 256, 1, 0x00FFFFFFUL}, 299 {CHIP_TYPE_VT6110, "VIA Networking Velocity Family Gigabit Ethernet Adapter", 1, 0x00FFFFFFUL},
299 {0, NULL} 300 { }
300}; 301};
301 302
302/* 303/*
@@ -304,10 +305,9 @@ static struct velocity_info_tbl chip_info_table[] = {
304 * device driver. Used for hotplug autoloading. 305 * device driver. Used for hotplug autoloading.
305 */ 306 */
306 307
307static struct pci_device_id velocity_id_table[] __devinitdata = { 308static const struct pci_device_id velocity_id_table[] __devinitdata = {
308 {PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_612X, 309 { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_612X) },
309 PCI_ANY_ID, PCI_ANY_ID, 0, 0, (unsigned long) chip_info_table}, 310 { }
310 {0, }
311}; 311};
312 312
313MODULE_DEVICE_TABLE(pci, velocity_id_table); 313MODULE_DEVICE_TABLE(pci, velocity_id_table);
@@ -341,7 +341,7 @@ static char __devinit *get_chip_name(enum chip_type chip_id)
341static void __devexit velocity_remove1(struct pci_dev *pdev) 341static void __devexit velocity_remove1(struct pci_dev *pdev)
342{ 342{
343 struct net_device *dev = pci_get_drvdata(pdev); 343 struct net_device *dev = pci_get_drvdata(pdev);
344 struct velocity_info *vptr = dev->priv; 344 struct velocity_info *vptr = netdev_priv(dev);
345 345
346#ifdef CONFIG_PM 346#ifdef CONFIG_PM
347 unsigned long flags; 347 unsigned long flags;
@@ -686,21 +686,23 @@ static int __devinit velocity_found1(struct pci_dev *pdev, const struct pci_devi
686 static int first = 1; 686 static int first = 1;
687 struct net_device *dev; 687 struct net_device *dev;
688 int i; 688 int i;
689 struct velocity_info_tbl *info = (struct velocity_info_tbl *) ent->driver_data; 689 const struct velocity_info_tbl *info = &chip_info_table[ent->driver_data];
690 struct velocity_info *vptr; 690 struct velocity_info *vptr;
691 struct mac_regs __iomem * regs; 691 struct mac_regs __iomem * regs;
692 int ret = -ENOMEM; 692 int ret = -ENOMEM;
693 693
694 /* FIXME: this driver, like almost all other ethernet drivers,
695 * can support more than MAX_UNITS.
696 */
694 if (velocity_nics >= MAX_UNITS) { 697 if (velocity_nics >= MAX_UNITS) {
695 printk(KERN_NOTICE VELOCITY_NAME ": already found %d NICs.\n", 698 dev_notice(&pdev->dev, "already found %d NICs.\n",
696 velocity_nics); 699 velocity_nics);
697 return -ENODEV; 700 return -ENODEV;
698 } 701 }
699 702
700 dev = alloc_etherdev(sizeof(struct velocity_info)); 703 dev = alloc_etherdev(sizeof(struct velocity_info));
701 704 if (!dev) {
702 if (dev == NULL) { 705 dev_err(&pdev->dev, "allocate net device failed.\n");
703 printk(KERN_ERR VELOCITY_NAME ": allocate net device failed.\n");
704 goto out; 706 goto out;
705 } 707 }
706 708
@@ -708,7 +710,7 @@ static int __devinit velocity_found1(struct pci_dev *pdev, const struct pci_devi
708 710
709 SET_MODULE_OWNER(dev); 711 SET_MODULE_OWNER(dev);
710 SET_NETDEV_DEV(dev, &pdev->dev); 712 SET_NETDEV_DEV(dev, &pdev->dev);
711 vptr = dev->priv; 713 vptr = netdev_priv(dev);
712 714
713 715
714 if (first) { 716 if (first) {
@@ -731,17 +733,17 @@ static int __devinit velocity_found1(struct pci_dev *pdev, const struct pci_devi
731 733
732 ret = velocity_get_pci_info(vptr, pdev); 734 ret = velocity_get_pci_info(vptr, pdev);
733 if (ret < 0) { 735 if (ret < 0) {
734 printk(KERN_ERR VELOCITY_NAME ": Failed to find PCI device.\n"); 736 /* error message already printed */
735 goto err_disable; 737 goto err_disable;
736 } 738 }
737 739
738 ret = pci_request_regions(pdev, VELOCITY_NAME); 740 ret = pci_request_regions(pdev, VELOCITY_NAME);
739 if (ret < 0) { 741 if (ret < 0) {
740 printk(KERN_ERR VELOCITY_NAME ": Failed to find PCI device.\n"); 742 dev_err(&pdev->dev, "No PCI resources.\n");
741 goto err_disable; 743 goto err_disable;
742 } 744 }
743 745
744 regs = ioremap(vptr->memaddr, vptr->io_size); 746 regs = ioremap(vptr->memaddr, VELOCITY_IO_SIZE);
745 if (regs == NULL) { 747 if (regs == NULL) {
746 ret = -EIO; 748 ret = -EIO;
747 goto err_release_res; 749 goto err_release_res;
@@ -859,13 +861,14 @@ static void __devinit velocity_print_info(struct velocity_info *vptr)
859 * discovered. 861 * discovered.
860 */ 862 */
861 863
862static void __devinit velocity_init_info(struct pci_dev *pdev, struct velocity_info *vptr, struct velocity_info_tbl *info) 864static void __devinit velocity_init_info(struct pci_dev *pdev,
865 struct velocity_info *vptr,
866 const struct velocity_info_tbl *info)
863{ 867{
864 memset(vptr, 0, sizeof(struct velocity_info)); 868 memset(vptr, 0, sizeof(struct velocity_info));
865 869
866 vptr->pdev = pdev; 870 vptr->pdev = pdev;
867 vptr->chip_id = info->chip_id; 871 vptr->chip_id = info->chip_id;
868 vptr->io_size = info->io_size;
869 vptr->num_txq = info->txqueue; 872 vptr->num_txq = info->txqueue;
870 vptr->multicast_limit = MCAM_SIZE; 873 vptr->multicast_limit = MCAM_SIZE;
871 spin_lock_init(&vptr->lock); 874 spin_lock_init(&vptr->lock);
@@ -883,8 +886,7 @@ static void __devinit velocity_init_info(struct pci_dev *pdev, struct velocity_i
883 886
884static int __devinit velocity_get_pci_info(struct velocity_info *vptr, struct pci_dev *pdev) 887static int __devinit velocity_get_pci_info(struct velocity_info *vptr, struct pci_dev *pdev)
885{ 888{
886 889 if (pci_read_config_byte(pdev, PCI_REVISION_ID, &vptr->rev_id) < 0)
887 if(pci_read_config_byte(pdev, PCI_REVISION_ID, &vptr->rev_id) < 0)
888 return -EIO; 890 return -EIO;
889 891
890 pci_set_master(pdev); 892 pci_set_master(pdev);
@@ -892,24 +894,20 @@ static int __devinit velocity_get_pci_info(struct velocity_info *vptr, struct pc
892 vptr->ioaddr = pci_resource_start(pdev, 0); 894 vptr->ioaddr = pci_resource_start(pdev, 0);
893 vptr->memaddr = pci_resource_start(pdev, 1); 895 vptr->memaddr = pci_resource_start(pdev, 1);
894 896
895 if(!(pci_resource_flags(pdev, 0) & IORESOURCE_IO)) 897 if (!(pci_resource_flags(pdev, 0) & IORESOURCE_IO)) {
896 { 898 dev_err(&pdev->dev,
897 printk(KERN_ERR "%s: region #0 is not an I/O resource, aborting.\n", 899 "region #0 is not an I/O resource, aborting.\n");
898 pci_name(pdev));
899 return -EINVAL; 900 return -EINVAL;
900 } 901 }
901 902
902 if((pci_resource_flags(pdev, 1) & IORESOURCE_IO)) 903 if ((pci_resource_flags(pdev, 1) & IORESOURCE_IO)) {
903 { 904 dev_err(&pdev->dev,
904 printk(KERN_ERR "%s: region #1 is an I/O resource, aborting.\n", 905 "region #1 is an I/O resource, aborting.\n");
905 pci_name(pdev));
906 return -EINVAL; 906 return -EINVAL;
907 } 907 }
908 908
909 if(pci_resource_len(pdev, 1) < 256) 909 if (pci_resource_len(pdev, 1) < VELOCITY_IO_SIZE) {
910 { 910 dev_err(&pdev->dev, "region #1 is too small.\n");
911 printk(KERN_ERR "%s: region #1 is too small.\n",
912 pci_name(pdev));
913 return -EINVAL; 911 return -EINVAL;
914 } 912 }
915 vptr->pdev = pdev; 913 vptr->pdev = pdev;
@@ -1728,7 +1726,7 @@ static void velocity_free_tx_buf(struct velocity_info *vptr, struct velocity_td_
1728 1726
1729static int velocity_open(struct net_device *dev) 1727static int velocity_open(struct net_device *dev)
1730{ 1728{
1731 struct velocity_info *vptr = dev->priv; 1729 struct velocity_info *vptr = netdev_priv(dev);
1732 int ret; 1730 int ret;
1733 1731
1734 vptr->rx_buf_sz = (dev->mtu <= 1504 ? PKT_BUF_SZ : dev->mtu + 32); 1732 vptr->rx_buf_sz = (dev->mtu <= 1504 ? PKT_BUF_SZ : dev->mtu + 32);
@@ -1785,7 +1783,7 @@ err_free_desc_rings:
1785 1783
1786static int velocity_change_mtu(struct net_device *dev, int new_mtu) 1784static int velocity_change_mtu(struct net_device *dev, int new_mtu)
1787{ 1785{
1788 struct velocity_info *vptr = dev->priv; 1786 struct velocity_info *vptr = netdev_priv(dev);
1789 unsigned long flags; 1787 unsigned long flags;
1790 int oldmtu = dev->mtu; 1788 int oldmtu = dev->mtu;
1791 int ret = 0; 1789 int ret = 0;
@@ -1861,7 +1859,7 @@ static void velocity_shutdown(struct velocity_info *vptr)
1861 1859
1862static int velocity_close(struct net_device *dev) 1860static int velocity_close(struct net_device *dev)
1863{ 1861{
1864 struct velocity_info *vptr = dev->priv; 1862 struct velocity_info *vptr = netdev_priv(dev);
1865 1863
1866 netif_stop_queue(dev); 1864 netif_stop_queue(dev);
1867 velocity_shutdown(vptr); 1865 velocity_shutdown(vptr);
@@ -1894,7 +1892,7 @@ static int velocity_close(struct net_device *dev)
1894 1892
1895static int velocity_xmit(struct sk_buff *skb, struct net_device *dev) 1893static int velocity_xmit(struct sk_buff *skb, struct net_device *dev)
1896{ 1894{
1897 struct velocity_info *vptr = dev->priv; 1895 struct velocity_info *vptr = netdev_priv(dev);
1898 int qnum = 0; 1896 int qnum = 0;
1899 struct tx_desc *td_ptr; 1897 struct tx_desc *td_ptr;
1900 struct velocity_td_info *tdinfo; 1898 struct velocity_td_info *tdinfo;
@@ -2049,7 +2047,7 @@ static int velocity_xmit(struct sk_buff *skb, struct net_device *dev)
2049static int velocity_intr(int irq, void *dev_instance, struct pt_regs *regs) 2047static int velocity_intr(int irq, void *dev_instance, struct pt_regs *regs)
2050{ 2048{
2051 struct net_device *dev = dev_instance; 2049 struct net_device *dev = dev_instance;
2052 struct velocity_info *vptr = dev->priv; 2050 struct velocity_info *vptr = netdev_priv(dev);
2053 u32 isr_status; 2051 u32 isr_status;
2054 int max_count = 0; 2052 int max_count = 0;
2055 2053
@@ -2104,7 +2102,7 @@ static int velocity_intr(int irq, void *dev_instance, struct pt_regs *regs)
2104 2102
2105static void velocity_set_multi(struct net_device *dev) 2103static void velocity_set_multi(struct net_device *dev)
2106{ 2104{
2107 struct velocity_info *vptr = dev->priv; 2105 struct velocity_info *vptr = netdev_priv(dev);
2108 struct mac_regs __iomem * regs = vptr->mac_regs; 2106 struct mac_regs __iomem * regs = vptr->mac_regs;
2109 u8 rx_mode; 2107 u8 rx_mode;
2110 int i; 2108 int i;
@@ -2153,7 +2151,7 @@ static void velocity_set_multi(struct net_device *dev)
2153 2151
2154static struct net_device_stats *velocity_get_stats(struct net_device *dev) 2152static struct net_device_stats *velocity_get_stats(struct net_device *dev)
2155{ 2153{
2156 struct velocity_info *vptr = dev->priv; 2154 struct velocity_info *vptr = netdev_priv(dev);
2157 2155
2158 /* If the hardware is down, don't touch MII */ 2156 /* If the hardware is down, don't touch MII */
2159 if(!netif_running(dev)) 2157 if(!netif_running(dev))
@@ -2196,7 +2194,7 @@ static struct net_device_stats *velocity_get_stats(struct net_device *dev)
2196 2194
2197static int velocity_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) 2195static int velocity_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
2198{ 2196{
2199 struct velocity_info *vptr = dev->priv; 2197 struct velocity_info *vptr = netdev_priv(dev);
2200 int ret; 2198 int ret;
2201 2199
2202 /* If we are asked for information and the device is power 2200 /* If we are asked for information and the device is power
@@ -2744,7 +2742,7 @@ static u32 check_connection_type(struct mac_regs __iomem * regs)
2744 2742
2745 if (PHYSR0 & PHYSR0_SPDG) 2743 if (PHYSR0 & PHYSR0_SPDG)
2746 status |= VELOCITY_SPEED_1000; 2744 status |= VELOCITY_SPEED_1000;
2747 if (PHYSR0 & PHYSR0_SPD10) 2745 else if (PHYSR0 & PHYSR0_SPD10)
2748 status |= VELOCITY_SPEED_10; 2746 status |= VELOCITY_SPEED_10;
2749 else 2747 else
2750 status |= VELOCITY_SPEED_100; 2748 status |= VELOCITY_SPEED_100;
@@ -2825,7 +2823,7 @@ static void enable_flow_control_ability(struct velocity_info *vptr)
2825 2823
2826static int velocity_ethtool_up(struct net_device *dev) 2824static int velocity_ethtool_up(struct net_device *dev)
2827{ 2825{
2828 struct velocity_info *vptr = dev->priv; 2826 struct velocity_info *vptr = netdev_priv(dev);
2829 if (!netif_running(dev)) 2827 if (!netif_running(dev))
2830 pci_set_power_state(vptr->pdev, PCI_D0); 2828 pci_set_power_state(vptr->pdev, PCI_D0);
2831 return 0; 2829 return 0;
@@ -2841,20 +2839,29 @@ static int velocity_ethtool_up(struct net_device *dev)
2841 2839
2842static void velocity_ethtool_down(struct net_device *dev) 2840static void velocity_ethtool_down(struct net_device *dev)
2843{ 2841{
2844 struct velocity_info *vptr = dev->priv; 2842 struct velocity_info *vptr = netdev_priv(dev);
2845 if (!netif_running(dev)) 2843 if (!netif_running(dev))
2846 pci_set_power_state(vptr->pdev, PCI_D3hot); 2844 pci_set_power_state(vptr->pdev, PCI_D3hot);
2847} 2845}
2848 2846
2849static int velocity_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) 2847static int velocity_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
2850{ 2848{
2851 struct velocity_info *vptr = dev->priv; 2849 struct velocity_info *vptr = netdev_priv(dev);
2852 struct mac_regs __iomem * regs = vptr->mac_regs; 2850 struct mac_regs __iomem * regs = vptr->mac_regs;
2853 u32 status; 2851 u32 status;
2854 status = check_connection_type(vptr->mac_regs); 2852 status = check_connection_type(vptr->mac_regs);
2855 2853
2856 cmd->supported = SUPPORTED_TP | SUPPORTED_Autoneg | SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full | SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full | SUPPORTED_1000baseT_Half | SUPPORTED_1000baseT_Full; 2854 cmd->supported = SUPPORTED_TP |
2857 if (status & VELOCITY_SPEED_100) 2855 SUPPORTED_Autoneg |
2856 SUPPORTED_10baseT_Half |
2857 SUPPORTED_10baseT_Full |
2858 SUPPORTED_100baseT_Half |
2859 SUPPORTED_100baseT_Full |
2860 SUPPORTED_1000baseT_Half |
2861 SUPPORTED_1000baseT_Full;
2862 if (status & VELOCITY_SPEED_1000)
2863 cmd->speed = SPEED_1000;
2864 else if (status & VELOCITY_SPEED_100)
2858 cmd->speed = SPEED_100; 2865 cmd->speed = SPEED_100;
2859 else 2866 else
2860 cmd->speed = SPEED_10; 2867 cmd->speed = SPEED_10;
@@ -2873,7 +2880,7 @@ static int velocity_get_settings(struct net_device *dev, struct ethtool_cmd *cmd
2873 2880
2874static int velocity_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) 2881static int velocity_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
2875{ 2882{
2876 struct velocity_info *vptr = dev->priv; 2883 struct velocity_info *vptr = netdev_priv(dev);
2877 u32 curr_status; 2884 u32 curr_status;
2878 u32 new_status = 0; 2885 u32 new_status = 0;
2879 int ret = 0; 2886 int ret = 0;
@@ -2896,14 +2903,14 @@ static int velocity_set_settings(struct net_device *dev, struct ethtool_cmd *cmd
2896 2903
2897static u32 velocity_get_link(struct net_device *dev) 2904static u32 velocity_get_link(struct net_device *dev)
2898{ 2905{
2899 struct velocity_info *vptr = dev->priv; 2906 struct velocity_info *vptr = netdev_priv(dev);
2900 struct mac_regs __iomem * regs = vptr->mac_regs; 2907 struct mac_regs __iomem * regs = vptr->mac_regs;
2901 return BYTE_REG_BITS_IS_ON(PHYSR0_LINKGD, &regs->PHYSR0) ? 0 : 1; 2908 return BYTE_REG_BITS_IS_ON(PHYSR0_LINKGD, &regs->PHYSR0) ? 1 : 0;
2902} 2909}
2903 2910
2904static void velocity_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) 2911static void velocity_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
2905{ 2912{
2906 struct velocity_info *vptr = dev->priv; 2913 struct velocity_info *vptr = netdev_priv(dev);
2907 strcpy(info->driver, VELOCITY_NAME); 2914 strcpy(info->driver, VELOCITY_NAME);
2908 strcpy(info->version, VELOCITY_VERSION); 2915 strcpy(info->version, VELOCITY_VERSION);
2909 strcpy(info->bus_info, pci_name(vptr->pdev)); 2916 strcpy(info->bus_info, pci_name(vptr->pdev));
@@ -2911,7 +2918,7 @@ static void velocity_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo
2911 2918
2912static void velocity_ethtool_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) 2919static void velocity_ethtool_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
2913{ 2920{
2914 struct velocity_info *vptr = dev->priv; 2921 struct velocity_info *vptr = netdev_priv(dev);
2915 wol->supported = WAKE_PHY | WAKE_MAGIC | WAKE_UCAST | WAKE_ARP; 2922 wol->supported = WAKE_PHY | WAKE_MAGIC | WAKE_UCAST | WAKE_ARP;
2916 wol->wolopts |= WAKE_MAGIC; 2923 wol->wolopts |= WAKE_MAGIC;
2917 /* 2924 /*
@@ -2927,7 +2934,7 @@ static void velocity_ethtool_get_wol(struct net_device *dev, struct ethtool_woli
2927 2934
2928static int velocity_ethtool_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) 2935static int velocity_ethtool_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
2929{ 2936{
2930 struct velocity_info *vptr = dev->priv; 2937 struct velocity_info *vptr = netdev_priv(dev);
2931 2938
2932 if (!(wol->wolopts & (WAKE_PHY | WAKE_MAGIC | WAKE_UCAST | WAKE_ARP))) 2939 if (!(wol->wolopts & (WAKE_PHY | WAKE_MAGIC | WAKE_UCAST | WAKE_ARP)))
2933 return -EFAULT; 2940 return -EFAULT;
@@ -2992,7 +2999,7 @@ static struct ethtool_ops velocity_ethtool_ops = {
2992 2999
2993static int velocity_mii_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) 3000static int velocity_mii_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
2994{ 3001{
2995 struct velocity_info *vptr = dev->priv; 3002 struct velocity_info *vptr = netdev_priv(dev);
2996 struct mac_regs __iomem * regs = vptr->mac_regs; 3003 struct mac_regs __iomem * regs = vptr->mac_regs;
2997 unsigned long flags; 3004 unsigned long flags;
2998 struct mii_ioctl_data *miidata = if_mii(ifr); 3005 struct mii_ioctl_data *miidata = if_mii(ifr);
diff --git a/drivers/net/via-velocity.h b/drivers/net/via-velocity.h
index f1b2640ebdc6..496c3d597444 100644
--- a/drivers/net/via-velocity.h
+++ b/drivers/net/via-velocity.h
@@ -31,6 +31,8 @@
31#define VELOCITY_FULL_DRV_NAM "VIA Networking Velocity Family Gigabit Ethernet Adapter Driver" 31#define VELOCITY_FULL_DRV_NAM "VIA Networking Velocity Family Gigabit Ethernet Adapter Driver"
32#define VELOCITY_VERSION "1.13" 32#define VELOCITY_VERSION "1.13"
33 33
34#define VELOCITY_IO_SIZE 256
35
34#define PKT_BUF_SZ 1540 36#define PKT_BUF_SZ 1540
35 37
36#define MAX_UNITS 8 38#define MAX_UNITS 8
@@ -1191,7 +1193,6 @@ enum chip_type {
1191struct velocity_info_tbl { 1193struct velocity_info_tbl {
1192 enum chip_type chip_id; 1194 enum chip_type chip_id;
1193 char *name; 1195 char *name;
1194 int io_size;
1195 int txqueue; 1196 int txqueue;
1196 u32 flags; 1197 u32 flags;
1197}; 1198};
@@ -1751,7 +1752,6 @@ struct velocity_info {
1751 struct mac_regs __iomem * mac_regs; 1752 struct mac_regs __iomem * mac_regs;
1752 unsigned long memaddr; 1753 unsigned long memaddr;
1753 unsigned long ioaddr; 1754 unsigned long ioaddr;
1754 u32 io_size;
1755 1755
1756 u8 rev_id; 1756 u8 rev_id;
1757 1757
diff --git a/drivers/net/wan/Kconfig b/drivers/net/wan/Kconfig
index b5328b0ff927..54b8e492ef97 100644
--- a/drivers/net/wan/Kconfig
+++ b/drivers/net/wan/Kconfig
@@ -134,18 +134,6 @@ config SEALEVEL_4021
134 The driver will be compiled as a module: the 134 The driver will be compiled as a module: the
135 module will be called sealevel. 135 module will be called sealevel.
136 136
137config SYNCLINK_SYNCPPP
138 tristate "SyncLink HDLC/SYNCPPP support"
139 depends on WAN
140 help
141 Enables HDLC/SYNCPPP support for the SyncLink WAN driver.
142
143 Normally the SyncLink WAN driver works with the main PPP driver
144 <file:drivers/net/ppp_generic.c> and pppd program.
145 HDLC/SYNCPPP support allows use of the Cisco HDLC/PPP driver
146 <file:drivers/net/wan/syncppp.c>. The SyncLink WAN driver (in
147 character devices) must also be enabled.
148
149# Generic HDLC 137# Generic HDLC
150config HDLC 138config HDLC
151 tristate "Generic HDLC layer" 139 tristate "Generic HDLC layer"
diff --git a/drivers/net/wan/Makefile b/drivers/net/wan/Makefile
index 823c6d5ab90d..316ca6869d5e 100644
--- a/drivers/net/wan/Makefile
+++ b/drivers/net/wan/Makefile
@@ -28,7 +28,6 @@ obj-$(CONFIG_COSA) += syncppp.o cosa.o
28obj-$(CONFIG_FARSYNC) += syncppp.o farsync.o 28obj-$(CONFIG_FARSYNC) += syncppp.o farsync.o
29obj-$(CONFIG_DSCC4) += dscc4.o 29obj-$(CONFIG_DSCC4) += dscc4.o
30obj-$(CONFIG_LANMEDIA) += syncppp.o 30obj-$(CONFIG_LANMEDIA) += syncppp.o
31obj-$(CONFIG_SYNCLINK_SYNCPPP) += syncppp.o
32obj-$(CONFIG_X25_ASY) += x25_asy.o 31obj-$(CONFIG_X25_ASY) += x25_asy.o
33 32
34obj-$(CONFIG_LANMEDIA) += lmc/ 33obj-$(CONFIG_LANMEDIA) += lmc/
diff --git a/drivers/net/wan/c101.c b/drivers/net/wan/c101.c
index c92ac9fde083..435e91ec4620 100644
--- a/drivers/net/wan/c101.c
+++ b/drivers/net/wan/c101.c
@@ -116,27 +116,33 @@ static inline void openwin(card_t *card, u8 page)
116#include "hd6457x.c" 116#include "hd6457x.c"
117 117
118 118
119static inline void set_carrier(port_t *port)
120{
121 if (!sca_in(MSCI1_OFFSET + ST3, port) & ST3_DCD)
122 netif_carrier_on(port_to_dev(port));
123 else
124 netif_carrier_off(port_to_dev(port));
125}
126
127
119static void sca_msci_intr(port_t *port) 128static void sca_msci_intr(port_t *port)
120{ 129{
121 struct net_device *dev = port_to_dev(port); 130 u8 stat = sca_in(MSCI1_OFFSET + ST1, port); /* read MSCI ST1 status */
122 card_t* card = port_to_card(port);
123 u8 stat = sca_in(MSCI1_OFFSET + ST1, card); /* read MSCI ST1 status */
124 131
125 /* Reset MSCI TX underrun status bit */ 132 /* Reset MSCI TX underrun status bit */
126 sca_out(stat & ST1_UDRN, MSCI0_OFFSET + ST1, card); 133 sca_out(stat & ST1_UDRN, MSCI0_OFFSET + ST1, port);
127 134
128 if (stat & ST1_UDRN) { 135 if (stat & ST1_UDRN) {
129 struct net_device_stats *stats = hdlc_stats(dev); 136 struct net_device_stats *stats = hdlc_stats(port_to_dev(port));
130 stats->tx_errors++; /* TX Underrun error detected */ 137 stats->tx_errors++; /* TX Underrun error detected */
131 stats->tx_fifo_errors++; 138 stats->tx_fifo_errors++;
132 } 139 }
133 140
134 /* Reset MSCI CDCD status bit - uses ch#2 DCD input */ 141 /* Reset MSCI CDCD status bit - uses ch#2 DCD input */
135 sca_out(stat & ST1_CDCD, MSCI1_OFFSET + ST1, card); 142 sca_out(stat & ST1_CDCD, MSCI1_OFFSET + ST1, port);
136 143
137 if (stat & ST1_CDCD) 144 if (stat & ST1_CDCD)
138 hdlc_set_carrier(!(sca_in(MSCI1_OFFSET + ST3, card) & ST3_DCD), 145 set_carrier(port);
139 dev);
140} 146}
141 147
142 148
@@ -190,8 +196,7 @@ static int c101_open(struct net_device *dev)
190 sca_out(IE1_UDRN, MSCI0_OFFSET + IE1, port); 196 sca_out(IE1_UDRN, MSCI0_OFFSET + IE1, port);
191 sca_out(IE0_TXINT, MSCI0_OFFSET + IE0, port); 197 sca_out(IE0_TXINT, MSCI0_OFFSET + IE0, port);
192 198
193 hdlc_set_carrier(!(sca_in(MSCI1_OFFSET + ST3, port) & ST3_DCD), dev); 199 set_carrier(port);
194 printk(KERN_DEBUG "0x%X\n", sca_in(MSCI1_OFFSET + ST3, port));
195 200
196 /* enable MSCI1 CDCD interrupt */ 201 /* enable MSCI1 CDCD interrupt */
197 sca_out(IE1_CDCD, MSCI1_OFFSET + IE1, port); 202 sca_out(IE1_CDCD, MSCI1_OFFSET + IE1, port);
@@ -378,7 +383,7 @@ static int __init c101_run(unsigned long irq, unsigned long winbase)
378 } 383 }
379 384
380 sca_init_sync_port(card); /* Set up C101 memory */ 385 sca_init_sync_port(card); /* Set up C101 memory */
381 hdlc_set_carrier(!(sca_in(MSCI1_OFFSET + ST3, card) & ST3_DCD), dev); 386 set_carrier(card);
382 387
383 printk(KERN_INFO "%s: Moxa C101 on IRQ%u," 388 printk(KERN_INFO "%s: Moxa C101 on IRQ%u,"
384 " using %u TX + %u RX packets rings\n", 389 " using %u TX + %u RX packets rings\n",
@@ -443,4 +448,5 @@ module_exit(c101_cleanup);
443MODULE_AUTHOR("Krzysztof Halasa <khc@pm.waw.pl>"); 448MODULE_AUTHOR("Krzysztof Halasa <khc@pm.waw.pl>");
444MODULE_DESCRIPTION("Moxa C101 serial port driver"); 449MODULE_DESCRIPTION("Moxa C101 serial port driver");
445MODULE_LICENSE("GPL v2"); 450MODULE_LICENSE("GPL v2");
446module_param(hw, charp, 0444); /* hw=irq,ram:irq,... */ 451module_param(hw, charp, 0444);
452MODULE_PARM_DESC(hw, "irq,ram:irq,...");
diff --git a/drivers/net/wan/hd6457x.c b/drivers/net/wan/hd6457x.c
index d3743321a977..dce2bb317b82 100644
--- a/drivers/net/wan/hd6457x.c
+++ b/drivers/net/wan/hd6457x.c
@@ -168,6 +168,23 @@ static inline u32 buffer_offset(port_t *port, u16 desc, int transmit)
168} 168}
169 169
170 170
171static inline void sca_set_carrier(port_t *port)
172{
173 if (!(sca_in(get_msci(port) + ST3, port_to_card(port)) & ST3_DCD)) {
174#ifdef DEBUG_LINK
175 printk(KERN_DEBUG "%s: sca_set_carrier on\n",
176 port_to_dev(port)->name);
177#endif
178 netif_carrier_on(port_to_dev(port));
179 } else {
180#ifdef DEBUG_LINK
181 printk(KERN_DEBUG "%s: sca_set_carrier off\n",
182 port_to_dev(port)->name);
183#endif
184 netif_carrier_off(port_to_dev(port));
185 }
186}
187
171 188
172static void sca_init_sync_port(port_t *port) 189static void sca_init_sync_port(port_t *port)
173{ 190{
@@ -237,9 +254,7 @@ static void sca_init_sync_port(port_t *port)
237 sca_out(DIR_BOFE, DIR_TX(phy_node(port)), card); 254 sca_out(DIR_BOFE, DIR_TX(phy_node(port)), card);
238 } 255 }
239 } 256 }
240 257 sca_set_carrier(port);
241 hdlc_set_carrier(!(sca_in(get_msci(port) + ST3, card) & ST3_DCD),
242 port_to_dev(port));
243} 258}
244 259
245 260
@@ -262,8 +277,7 @@ static inline void sca_msci_intr(port_t *port)
262 } 277 }
263 278
264 if (stat & ST1_CDCD) 279 if (stat & ST1_CDCD)
265 hdlc_set_carrier(!(sca_in(msci + ST3, card) & ST3_DCD), 280 sca_set_carrier(port);
266 port_to_dev(port));
267} 281}
268#endif 282#endif
269 283
@@ -566,7 +580,7 @@ static void sca_open(struct net_device *dev)
566 - all DMA interrupts 580 - all DMA interrupts
567*/ 581*/
568 582
569 hdlc_set_carrier(!(sca_in(msci + ST3, card) & ST3_DCD), dev); 583 sca_set_carrier(port);
570 584
571#ifdef __HD64570_H 585#ifdef __HD64570_H
572 /* MSCI TX INT and RX INT A IRQ enable */ 586 /* MSCI TX INT and RX INT A IRQ enable */
diff --git a/drivers/net/wan/hdlc_cisco.c b/drivers/net/wan/hdlc_cisco.c
index 1fd04662c4fc..f289daba0c7b 100644
--- a/drivers/net/wan/hdlc_cisco.c
+++ b/drivers/net/wan/hdlc_cisco.c
@@ -192,9 +192,7 @@ static int cisco_rx(struct sk_buff *skb)
192 "uptime %ud%uh%um%us)\n", 192 "uptime %ud%uh%um%us)\n",
193 dev->name, days, hrs, 193 dev->name, days, hrs,
194 min, sec); 194 min, sec);
195#if 0 195 netif_dormant_off(dev);
196 netif_carrier_on(dev);
197#endif
198 hdlc->state.cisco.up = 1; 196 hdlc->state.cisco.up = 1;
199 } 197 }
200 } 198 }
@@ -227,9 +225,7 @@ static void cisco_timer(unsigned long arg)
227 hdlc->state.cisco.settings.timeout * HZ)) { 225 hdlc->state.cisco.settings.timeout * HZ)) {
228 hdlc->state.cisco.up = 0; 226 hdlc->state.cisco.up = 0;
229 printk(KERN_INFO "%s: Link down\n", dev->name); 227 printk(KERN_INFO "%s: Link down\n", dev->name);
230#if 0 228 netif_dormant_on(dev);
231 netif_carrier_off(dev);
232#endif
233 } 229 }
234 230
235 cisco_keepalive_send(dev, CISCO_KEEPALIVE_REQ, 231 cisco_keepalive_send(dev, CISCO_KEEPALIVE_REQ,
@@ -265,10 +261,7 @@ static void cisco_stop(struct net_device *dev)
265{ 261{
266 hdlc_device *hdlc = dev_to_hdlc(dev); 262 hdlc_device *hdlc = dev_to_hdlc(dev);
267 del_timer_sync(&hdlc->state.cisco.timer); 263 del_timer_sync(&hdlc->state.cisco.timer);
268#if 0 264 netif_dormant_on(dev);
269 if (netif_carrier_ok(dev))
270 netif_carrier_off(dev);
271#endif
272 hdlc->state.cisco.up = 0; 265 hdlc->state.cisco.up = 0;
273 hdlc->state.cisco.request_sent = 0; 266 hdlc->state.cisco.request_sent = 0;
274} 267}
@@ -328,6 +321,7 @@ int hdlc_cisco_ioctl(struct net_device *dev, struct ifreq *ifr)
328 dev->type = ARPHRD_CISCO; 321 dev->type = ARPHRD_CISCO;
329 dev->flags = IFF_POINTOPOINT | IFF_NOARP; 322 dev->flags = IFF_POINTOPOINT | IFF_NOARP;
330 dev->addr_len = 0; 323 dev->addr_len = 0;
324 netif_dormant_on(dev);
331 return 0; 325 return 0;
332 } 326 }
333 327
diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/net/wan/hdlc_fr.c
index 523afe17564e..7bb737bbdeb9 100644
--- a/drivers/net/wan/hdlc_fr.c
+++ b/drivers/net/wan/hdlc_fr.c
@@ -301,7 +301,7 @@ static int pvc_open(struct net_device *dev)
301 if (pvc->open_count++ == 0) { 301 if (pvc->open_count++ == 0) {
302 hdlc_device *hdlc = dev_to_hdlc(pvc->master); 302 hdlc_device *hdlc = dev_to_hdlc(pvc->master);
303 if (hdlc->state.fr.settings.lmi == LMI_NONE) 303 if (hdlc->state.fr.settings.lmi == LMI_NONE)
304 pvc->state.active = hdlc->carrier; 304 pvc->state.active = netif_carrier_ok(pvc->master);
305 305
306 pvc_carrier(pvc->state.active, pvc); 306 pvc_carrier(pvc->state.active, pvc);
307 hdlc->state.fr.dce_changed = 1; 307 hdlc->state.fr.dce_changed = 1;
@@ -545,11 +545,7 @@ static void fr_set_link_state(int reliable, struct net_device *dev)
545 545
546 hdlc->state.fr.reliable = reliable; 546 hdlc->state.fr.reliable = reliable;
547 if (reliable) { 547 if (reliable) {
548#if 0 548 netif_dormant_off(dev);
549 if (!netif_carrier_ok(dev))
550 netif_carrier_on(dev);
551#endif
552
553 hdlc->state.fr.n391cnt = 0; /* Request full status */ 549 hdlc->state.fr.n391cnt = 0; /* Request full status */
554 hdlc->state.fr.dce_changed = 1; 550 hdlc->state.fr.dce_changed = 1;
555 551
@@ -562,11 +558,7 @@ static void fr_set_link_state(int reliable, struct net_device *dev)
562 } 558 }
563 } 559 }
564 } else { 560 } else {
565#if 0 561 netif_dormant_on(dev);
566 if (netif_carrier_ok(dev))
567 netif_carrier_off(dev);
568#endif
569
570 while (pvc) { /* Deactivate all PVCs */ 562 while (pvc) { /* Deactivate all PVCs */
571 pvc_carrier(0, pvc); 563 pvc_carrier(0, pvc);
572 pvc->state.exist = pvc->state.active = 0; 564 pvc->state.exist = pvc->state.active = 0;
diff --git a/drivers/net/wan/hdlc_generic.c b/drivers/net/wan/hdlc_generic.c
index b7da55140fbd..04ca1f7b6424 100644
--- a/drivers/net/wan/hdlc_generic.c
+++ b/drivers/net/wan/hdlc_generic.c
@@ -34,10 +34,11 @@
34#include <linux/inetdevice.h> 34#include <linux/inetdevice.h>
35#include <linux/lapb.h> 35#include <linux/lapb.h>
36#include <linux/rtnetlink.h> 36#include <linux/rtnetlink.h>
37#include <linux/notifier.h>
37#include <linux/hdlc.h> 38#include <linux/hdlc.h>
38 39
39 40
40static const char* version = "HDLC support module revision 1.18"; 41static const char* version = "HDLC support module revision 1.19";
41 42
42#undef DEBUG_LINK 43#undef DEBUG_LINK
43 44
@@ -73,57 +74,51 @@ static int hdlc_rcv(struct sk_buff *skb, struct net_device *dev,
73 74
74 75
75 76
76static void __hdlc_set_carrier_on(struct net_device *dev) 77static inline void hdlc_proto_start(struct net_device *dev)
77{ 78{
78 hdlc_device *hdlc = dev_to_hdlc(dev); 79 hdlc_device *hdlc = dev_to_hdlc(dev);
79 if (hdlc->proto.start) 80 if (hdlc->proto.start)
80 return hdlc->proto.start(dev); 81 return hdlc->proto.start(dev);
81#if 0
82#ifdef DEBUG_LINK
83 if (netif_carrier_ok(dev))
84 printk(KERN_ERR "hdlc_set_carrier_on(): already on\n");
85#endif
86 netif_carrier_on(dev);
87#endif
88} 82}
89 83
90 84
91 85
92static void __hdlc_set_carrier_off(struct net_device *dev) 86static inline void hdlc_proto_stop(struct net_device *dev)
93{ 87{
94 hdlc_device *hdlc = dev_to_hdlc(dev); 88 hdlc_device *hdlc = dev_to_hdlc(dev);
95 if (hdlc->proto.stop) 89 if (hdlc->proto.stop)
96 return hdlc->proto.stop(dev); 90 return hdlc->proto.stop(dev);
97
98#if 0
99#ifdef DEBUG_LINK
100 if (!netif_carrier_ok(dev))
101 printk(KERN_ERR "hdlc_set_carrier_off(): already off\n");
102#endif
103 netif_carrier_off(dev);
104#endif
105} 91}
106 92
107 93
108 94
109void hdlc_set_carrier(int on, struct net_device *dev) 95static int hdlc_device_event(struct notifier_block *this, unsigned long event,
96 void *ptr)
110{ 97{
111 hdlc_device *hdlc = dev_to_hdlc(dev); 98 struct net_device *dev = ptr;
99 hdlc_device *hdlc;
112 unsigned long flags; 100 unsigned long flags;
113 on = on ? 1 : 0; 101 int on;
102
103 if (dev->get_stats != hdlc_get_stats)
104 return NOTIFY_DONE; /* not an HDLC device */
105
106 if (event != NETDEV_CHANGE)
107 return NOTIFY_DONE; /* Only interrested in carrier changes */
108
109 on = netif_carrier_ok(dev);
114 110
115#ifdef DEBUG_LINK 111#ifdef DEBUG_LINK
116 printk(KERN_DEBUG "hdlc_set_carrier %i\n", on); 112 printk(KERN_DEBUG "%s: hdlc_device_event NETDEV_CHANGE, carrier %i\n",
113 dev->name, on);
117#endif 114#endif
118 115
116 hdlc = dev_to_hdlc(dev);
119 spin_lock_irqsave(&hdlc->state_lock, flags); 117 spin_lock_irqsave(&hdlc->state_lock, flags);
120 118
121 if (hdlc->carrier == on) 119 if (hdlc->carrier == on)
122 goto carrier_exit; /* no change in DCD line level */ 120 goto carrier_exit; /* no change in DCD line level */
123 121
124#ifdef DEBUG_LINK
125 printk(KERN_INFO "%s: carrier %s\n", dev->name, on ? "ON" : "off");
126#endif
127 hdlc->carrier = on; 122 hdlc->carrier = on;
128 123
129 if (!hdlc->open) 124 if (!hdlc->open)
@@ -131,14 +126,15 @@ void hdlc_set_carrier(int on, struct net_device *dev)
131 126
132 if (hdlc->carrier) { 127 if (hdlc->carrier) {
133 printk(KERN_INFO "%s: Carrier detected\n", dev->name); 128 printk(KERN_INFO "%s: Carrier detected\n", dev->name);
134 __hdlc_set_carrier_on(dev); 129 hdlc_proto_start(dev);
135 } else { 130 } else {
136 printk(KERN_INFO "%s: Carrier lost\n", dev->name); 131 printk(KERN_INFO "%s: Carrier lost\n", dev->name);
137 __hdlc_set_carrier_off(dev); 132 hdlc_proto_stop(dev);
138 } 133 }
139 134
140carrier_exit: 135carrier_exit:
141 spin_unlock_irqrestore(&hdlc->state_lock, flags); 136 spin_unlock_irqrestore(&hdlc->state_lock, flags);
137 return NOTIFY_DONE;
142} 138}
143 139
144 140
@@ -165,7 +161,7 @@ int hdlc_open(struct net_device *dev)
165 161
166 if (hdlc->carrier) { 162 if (hdlc->carrier) {
167 printk(KERN_INFO "%s: Carrier detected\n", dev->name); 163 printk(KERN_INFO "%s: Carrier detected\n", dev->name);
168 __hdlc_set_carrier_on(dev); 164 hdlc_proto_start(dev);
169 } else 165 } else
170 printk(KERN_INFO "%s: No carrier\n", dev->name); 166 printk(KERN_INFO "%s: No carrier\n", dev->name);
171 167
@@ -190,7 +186,7 @@ void hdlc_close(struct net_device *dev)
190 186
191 hdlc->open = 0; 187 hdlc->open = 0;
192 if (hdlc->carrier) 188 if (hdlc->carrier)
193 __hdlc_set_carrier_off(dev); 189 hdlc_proto_stop(dev);
194 190
195 spin_unlock_irq(&hdlc->state_lock); 191 spin_unlock_irq(&hdlc->state_lock);
196 192
@@ -303,7 +299,6 @@ MODULE_LICENSE("GPL v2");
303 299
304EXPORT_SYMBOL(hdlc_open); 300EXPORT_SYMBOL(hdlc_open);
305EXPORT_SYMBOL(hdlc_close); 301EXPORT_SYMBOL(hdlc_close);
306EXPORT_SYMBOL(hdlc_set_carrier);
307EXPORT_SYMBOL(hdlc_ioctl); 302EXPORT_SYMBOL(hdlc_ioctl);
308EXPORT_SYMBOL(hdlc_setup); 303EXPORT_SYMBOL(hdlc_setup);
309EXPORT_SYMBOL(alloc_hdlcdev); 304EXPORT_SYMBOL(alloc_hdlcdev);
@@ -315,9 +310,18 @@ static struct packet_type hdlc_packet_type = {
315}; 310};
316 311
317 312
313static struct notifier_block hdlc_notifier = {
314 .notifier_call = hdlc_device_event,
315};
316
317
318static int __init hdlc_module_init(void) 318static int __init hdlc_module_init(void)
319{ 319{
320 int result;
321
320 printk(KERN_INFO "%s\n", version); 322 printk(KERN_INFO "%s\n", version);
323 if ((result = register_netdevice_notifier(&hdlc_notifier)) != 0)
324 return result;
321 dev_add_pack(&hdlc_packet_type); 325 dev_add_pack(&hdlc_packet_type);
322 return 0; 326 return 0;
323} 327}
@@ -327,6 +331,7 @@ static int __init hdlc_module_init(void)
327static void __exit hdlc_module_exit(void) 331static void __exit hdlc_module_exit(void)
328{ 332{
329 dev_remove_pack(&hdlc_packet_type); 333 dev_remove_pack(&hdlc_packet_type);
334 unregister_netdevice_notifier(&hdlc_notifier);
330} 335}
331 336
332 337
diff --git a/drivers/net/wan/hdlc_ppp.c b/drivers/net/wan/hdlc_ppp.c
index b81263eaede0..fbaab5bf71eb 100644
--- a/drivers/net/wan/hdlc_ppp.c
+++ b/drivers/net/wan/hdlc_ppp.c
@@ -107,6 +107,7 @@ int hdlc_ppp_ioctl(struct net_device *dev, struct ifreq *ifr)
107 dev->hard_header = NULL; 107 dev->hard_header = NULL;
108 dev->type = ARPHRD_PPP; 108 dev->type = ARPHRD_PPP;
109 dev->addr_len = 0; 109 dev->addr_len = 0;
110 netif_dormant_off(dev);
110 return 0; 111 return 0;
111 } 112 }
112 113
diff --git a/drivers/net/wan/hdlc_raw.c b/drivers/net/wan/hdlc_raw.c
index 9456d31cb1c1..f15aa6ba77f1 100644
--- a/drivers/net/wan/hdlc_raw.c
+++ b/drivers/net/wan/hdlc_raw.c
@@ -82,6 +82,7 @@ int hdlc_raw_ioctl(struct net_device *dev, struct ifreq *ifr)
82 dev->type = ARPHRD_RAWHDLC; 82 dev->type = ARPHRD_RAWHDLC;
83 dev->flags = IFF_POINTOPOINT | IFF_NOARP; 83 dev->flags = IFF_POINTOPOINT | IFF_NOARP;
84 dev->addr_len = 0; 84 dev->addr_len = 0;
85 netif_dormant_off(dev);
85 return 0; 86 return 0;
86 } 87 }
87 88
diff --git a/drivers/net/wan/hdlc_raw_eth.c b/drivers/net/wan/hdlc_raw_eth.c
index b1285cc8fee6..d1884987f94e 100644
--- a/drivers/net/wan/hdlc_raw_eth.c
+++ b/drivers/net/wan/hdlc_raw_eth.c
@@ -100,6 +100,7 @@ int hdlc_raw_eth_ioctl(struct net_device *dev, struct ifreq *ifr)
100 dev->tx_queue_len = old_qlen; 100 dev->tx_queue_len = old_qlen;
101 memcpy(dev->dev_addr, "\x00\x01", 2); 101 memcpy(dev->dev_addr, "\x00\x01", 2);
102 get_random_bytes(dev->dev_addr + 2, ETH_ALEN - 2); 102 get_random_bytes(dev->dev_addr + 2, ETH_ALEN - 2);
103 netif_dormant_off(dev);
103 return 0; 104 return 0;
104 } 105 }
105 106
diff --git a/drivers/net/wan/hdlc_x25.c b/drivers/net/wan/hdlc_x25.c
index 07e5eef1fe0f..a867fb411f89 100644
--- a/drivers/net/wan/hdlc_x25.c
+++ b/drivers/net/wan/hdlc_x25.c
@@ -212,6 +212,7 @@ int hdlc_x25_ioctl(struct net_device *dev, struct ifreq *ifr)
212 dev->hard_header = NULL; 212 dev->hard_header = NULL;
213 dev->type = ARPHRD_X25; 213 dev->type = ARPHRD_X25;
214 dev->addr_len = 0; 214 dev->addr_len = 0;
215 netif_dormant_off(dev);
215 return 0; 216 return 0;
216 } 217 }
217 218
diff --git a/drivers/net/wan/n2.c b/drivers/net/wan/n2.c
index e013b817cab8..dcf46add3adf 100644
--- a/drivers/net/wan/n2.c
+++ b/drivers/net/wan/n2.c
@@ -564,4 +564,5 @@ module_exit(n2_cleanup);
564MODULE_AUTHOR("Krzysztof Halasa <khc@pm.waw.pl>"); 564MODULE_AUTHOR("Krzysztof Halasa <khc@pm.waw.pl>");
565MODULE_DESCRIPTION("RISCom/N2 serial port driver"); 565MODULE_DESCRIPTION("RISCom/N2 serial port driver");
566MODULE_LICENSE("GPL v2"); 566MODULE_LICENSE("GPL v2");
567module_param(hw, charp, 0444); /* hw=io,irq,ram,ports:io,irq,... */ 567module_param(hw, charp, 0444);
568MODULE_PARM_DESC(hw, "io,irq,ram,ports:io,irq,...");
diff --git a/drivers/net/wan/wanxl.c b/drivers/net/wan/wanxl.c
index d564224cdca9..b2031dfc4bb1 100644
--- a/drivers/net/wan/wanxl.c
+++ b/drivers/net/wan/wanxl.c
@@ -149,7 +149,10 @@ static inline void wanxl_cable_intr(port_t *port)
149 printk(KERN_INFO "%s: %s%s module, %s cable%s%s\n", 149 printk(KERN_INFO "%s: %s%s module, %s cable%s%s\n",
150 port->dev->name, pm, dte, cable, dsr, dcd); 150 port->dev->name, pm, dte, cable, dsr, dcd);
151 151
152 hdlc_set_carrier(value & STATUS_CABLE_DCD, port->dev); 152 if (value & STATUS_CABLE_DCD)
153 netif_carrier_on(port->dev);
154 else
155 netif_carrier_off(port->dev);
153} 156}
154 157
155 158
diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
index 30ec235e6935..2e8ac995d56f 100644
--- a/drivers/net/wireless/Kconfig
+++ b/drivers/net/wireless/Kconfig
@@ -447,6 +447,7 @@ config AIRO_CS
447 tristate "Cisco/Aironet 34X/35X/4500/4800 PCMCIA cards" 447 tristate "Cisco/Aironet 34X/35X/4500/4800 PCMCIA cards"
448 depends on NET_RADIO && PCMCIA && (BROKEN || !M32R) 448 depends on NET_RADIO && PCMCIA && (BROKEN || !M32R)
449 select CRYPTO 449 select CRYPTO
450 select CRYPTO_AES
450 ---help--- 451 ---help---
451 This is the standard Linux driver to support Cisco/Aironet PCMCIA 452 This is the standard Linux driver to support Cisco/Aironet PCMCIA
452 802.11 wireless cards. This driver is the same as the Aironet 453 802.11 wireless cards. This driver is the same as the Aironet
@@ -550,6 +551,7 @@ config USB_ZD1201
550 551
551source "drivers/net/wireless/hostap/Kconfig" 552source "drivers/net/wireless/hostap/Kconfig"
552source "drivers/net/wireless/bcm43xx/Kconfig" 553source "drivers/net/wireless/bcm43xx/Kconfig"
554source "drivers/net/wireless/zd1211rw/Kconfig"
553 555
554# yes, this works even when no drivers are selected 556# yes, this works even when no drivers are selected
555config NET_WIRELESS 557config NET_WIRELESS
diff --git a/drivers/net/wireless/Makefile b/drivers/net/wireless/Makefile
index 512603de309a..c613af17a159 100644
--- a/drivers/net/wireless/Makefile
+++ b/drivers/net/wireless/Makefile
@@ -36,6 +36,7 @@ obj-$(CONFIG_PRISM54) += prism54/
36 36
37obj-$(CONFIG_HOSTAP) += hostap/ 37obj-$(CONFIG_HOSTAP) += hostap/
38obj-$(CONFIG_BCM43XX) += bcm43xx/ 38obj-$(CONFIG_BCM43XX) += bcm43xx/
39obj-$(CONFIG_ZD1211RW) += zd1211rw/
39 40
40# 16-bit wireless PCMCIA client drivers 41# 16-bit wireless PCMCIA client drivers
41obj-$(CONFIG_PCMCIA_RAYCS) += ray_cs.o 42obj-$(CONFIG_PCMCIA_RAYCS) += ray_cs.o
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.c b/drivers/net/wireless/bcm43xx/bcm43xx_main.c
index d8f5600578b4..df317c1e12a8 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_main.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.c
@@ -1547,7 +1547,7 @@ static void handle_irq_noise(struct bcm43xx_private *bcm)
1547 goto generate_new; 1547 goto generate_new;
1548 1548
1549 /* Get the noise samples. */ 1549 /* Get the noise samples. */
1550 assert(bcm->noisecalc.nr_samples <= 8); 1550 assert(bcm->noisecalc.nr_samples < 8);
1551 i = bcm->noisecalc.nr_samples; 1551 i = bcm->noisecalc.nr_samples;
1552 noise[0] = limit_value(noise[0], 0, ARRAY_SIZE(radio->nrssi_lt) - 1); 1552 noise[0] = limit_value(noise[0], 0, ARRAY_SIZE(radio->nrssi_lt) - 1);
1553 noise[1] = limit_value(noise[1], 0, ARRAY_SIZE(radio->nrssi_lt) - 1); 1553 noise[1] = limit_value(noise[1], 0, ARRAY_SIZE(radio->nrssi_lt) - 1);
@@ -1885,6 +1885,15 @@ static irqreturn_t bcm43xx_interrupt_handler(int irq, void *dev_id, struct pt_re
1885 1885
1886 spin_lock(&bcm->irq_lock); 1886 spin_lock(&bcm->irq_lock);
1887 1887
1888 /* Only accept IRQs, if we are initialized properly.
1889 * This avoids an RX race while initializing.
1890 * We should probably not enable IRQs before we are initialized
1891 * completely, but some careful work is needed to fix this. I think it
1892 * is best to stay with this cheap workaround for now... .
1893 */
1894 if (unlikely(bcm43xx_status(bcm) != BCM43xx_STAT_INITIALIZED))
1895 goto out;
1896
1888 reason = bcm43xx_read32(bcm, BCM43xx_MMIO_GEN_IRQ_REASON); 1897 reason = bcm43xx_read32(bcm, BCM43xx_MMIO_GEN_IRQ_REASON);
1889 if (reason == 0xffffffff) { 1898 if (reason == 0xffffffff) {
1890 /* irq not for us (shared irq) */ 1899 /* irq not for us (shared irq) */
@@ -1906,19 +1915,11 @@ static irqreturn_t bcm43xx_interrupt_handler(int irq, void *dev_id, struct pt_re
1906 1915
1907 bcm43xx_interrupt_ack(bcm, reason); 1916 bcm43xx_interrupt_ack(bcm, reason);
1908 1917
1909 /* Only accept IRQs, if we are initialized properly. 1918 /* disable all IRQs. They are enabled again in the bottom half. */
1910 * This avoids an RX race while initializing. 1919 bcm->irq_savedstate = bcm43xx_interrupt_disable(bcm, BCM43xx_IRQ_ALL);
1911 * We should probably not enable IRQs before we are initialized 1920 /* save the reason code and call our bottom half. */
1912 * completely, but some careful work is needed to fix this. I think it 1921 bcm->irq_reason = reason;
1913 * is best to stay with this cheap workaround for now... . 1922 tasklet_schedule(&bcm->isr_tasklet);
1914 */
1915 if (likely(bcm43xx_status(bcm) == BCM43xx_STAT_INITIALIZED)) {
1916 /* disable all IRQs. They are enabled again in the bottom half. */
1917 bcm->irq_savedstate = bcm43xx_interrupt_disable(bcm, BCM43xx_IRQ_ALL);
1918 /* save the reason code and call our bottom half. */
1919 bcm->irq_reason = reason;
1920 tasklet_schedule(&bcm->isr_tasklet);
1921 }
1922 1923
1923out: 1924out:
1924 mmiowb(); 1925 mmiowb();
@@ -3698,6 +3699,10 @@ static void bcm43xx_ieee80211_set_security(struct net_device *net_dev,
3698 secinfo->encrypt = sec->encrypt; 3699 secinfo->encrypt = sec->encrypt;
3699 dprintk(", .encrypt = %d", sec->encrypt); 3700 dprintk(", .encrypt = %d", sec->encrypt);
3700 } 3701 }
3702 if (sec->flags & SEC_AUTH_MODE) {
3703 secinfo->auth_mode = sec->auth_mode;
3704 dprintk(", .auth_mode = %d", sec->auth_mode);
3705 }
3701 dprintk("\n"); 3706 dprintk("\n");
3702 if (bcm43xx_status(bcm) == BCM43xx_STAT_INITIALIZED && 3707 if (bcm43xx_status(bcm) == BCM43xx_STAT_INITIALIZED &&
3703 !bcm->ieee->host_encrypt) { 3708 !bcm->ieee->host_encrypt) {
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.h b/drivers/net/wireless/bcm43xx/bcm43xx_main.h
index 30a202b258b5..116493671f88 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_main.h
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.h
@@ -112,30 +112,6 @@ int bcm43xx_channel_to_freq(struct bcm43xx_private *bcm,
112 return bcm43xx_channel_to_freq_bg(channel); 112 return bcm43xx_channel_to_freq_bg(channel);
113} 113}
114 114
115/* Lightweight function to check if a channel number is valid.
116 * Note that this does _NOT_ check for geographical restrictions!
117 */
118static inline
119int bcm43xx_is_valid_channel_a(u8 channel)
120{
121 return (channel >= IEEE80211_52GHZ_MIN_CHANNEL
122 && channel <= IEEE80211_52GHZ_MAX_CHANNEL);
123}
124static inline
125int bcm43xx_is_valid_channel_bg(u8 channel)
126{
127 return (channel >= IEEE80211_24GHZ_MIN_CHANNEL
128 && channel <= IEEE80211_24GHZ_MAX_CHANNEL);
129}
130static inline
131int bcm43xx_is_valid_channel(struct bcm43xx_private *bcm,
132 u8 channel)
133{
134 if (bcm43xx_current_phy(bcm)->type == BCM43xx_PHYTYPE_A)
135 return bcm43xx_is_valid_channel_a(channel);
136 return bcm43xx_is_valid_channel_bg(channel);
137}
138
139void bcm43xx_tsf_read(struct bcm43xx_private *bcm, u64 *tsf); 115void bcm43xx_tsf_read(struct bcm43xx_private *bcm, u64 *tsf);
140void bcm43xx_tsf_write(struct bcm43xx_private *bcm, u64 tsf); 116void bcm43xx_tsf_write(struct bcm43xx_private *bcm, u64 tsf);
141 117
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_radio.c b/drivers/net/wireless/bcm43xx/bcm43xx_radio.c
index af5c0bff1696..bb9c484d7e19 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_radio.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_radio.c
@@ -1594,11 +1594,11 @@ int bcm43xx_radio_selectchannel(struct bcm43xx_private *bcm,
1594 u16 r8, tmp; 1594 u16 r8, tmp;
1595 u16 freq; 1595 u16 freq;
1596 1596
1597 if (!ieee80211_is_valid_channel(bcm->ieee, channel))
1598 return -EINVAL;
1597 if ((radio->manufact == 0x17F) && 1599 if ((radio->manufact == 0x17F) &&
1598 (radio->version == 0x2060) && 1600 (radio->version == 0x2060) &&
1599 (radio->revision == 1)) { 1601 (radio->revision == 1)) {
1600 if (channel > 200)
1601 return -EINVAL;
1602 freq = channel2freq_a(channel); 1602 freq = channel2freq_a(channel);
1603 1603
1604 r8 = bcm43xx_radio_read16(bcm, 0x0008); 1604 r8 = bcm43xx_radio_read16(bcm, 0x0008);
@@ -1651,9 +1651,6 @@ int bcm43xx_radio_selectchannel(struct bcm43xx_private *bcm,
1651 TODO(); //TODO: TSSI2dbm workaround 1651 TODO(); //TODO: TSSI2dbm workaround
1652 bcm43xx_phy_xmitpower(bcm);//FIXME correct? 1652 bcm43xx_phy_xmitpower(bcm);//FIXME correct?
1653 } else { 1653 } else {
1654 if ((channel < 1) || (channel > 14))
1655 return -EINVAL;
1656
1657 if (synthetic_pu_workaround) 1654 if (synthetic_pu_workaround)
1658 bcm43xx_synth_pu_workaround(bcm, channel); 1655 bcm43xx_synth_pu_workaround(bcm, channel);
1659 1656
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_wx.c b/drivers/net/wireless/bcm43xx/bcm43xx_wx.c
index c35cb3a0777e..5c36e29efff7 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_wx.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_wx.c
@@ -119,7 +119,7 @@ static int bcm43xx_wx_set_channelfreq(struct net_device *net_dev,
119 channel = bcm43xx_freq_to_channel(bcm, data->freq.m); 119 channel = bcm43xx_freq_to_channel(bcm, data->freq.m);
120 freq = data->freq.m; 120 freq = data->freq.m;
121 } 121 }
122 if (!bcm43xx_is_valid_channel(bcm, channel)) 122 if (!ieee80211_is_valid_channel(bcm->ieee, channel))
123 goto out_unlock; 123 goto out_unlock;
124 if (bcm43xx_status(bcm) == BCM43xx_STAT_INITIALIZED) { 124 if (bcm43xx_status(bcm) == BCM43xx_STAT_INITIALIZED) {
125 //ieee80211softmac_disassoc(softmac, $REASON); 125 //ieee80211softmac_disassoc(softmac, $REASON);
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_xmit.c b/drivers/net/wireless/bcm43xx/bcm43xx_xmit.c
index d8ece28c079f..6dbd855b3647 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_xmit.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_xmit.c
@@ -296,11 +296,14 @@ void bcm43xx_generate_txhdr(struct bcm43xx_private *bcm,
296 u16 control = 0; 296 u16 control = 0;
297 u16 wsec_rate = 0; 297 u16 wsec_rate = 0;
298 u16 encrypt_frame; 298 u16 encrypt_frame;
299 const u16 ftype = WLAN_FC_GET_TYPE(le16_to_cpu(wireless_header->frame_ctl));
300 const int is_mgt = (ftype == IEEE80211_FTYPE_MGMT);
299 301
300 /* Now construct the TX header. */ 302 /* Now construct the TX header. */
301 memset(txhdr, 0, sizeof(*txhdr)); 303 memset(txhdr, 0, sizeof(*txhdr));
302 304
303 bitrate = bcm->softmac->txrates.default_rate; 305 bitrate = ieee80211softmac_suggest_txrate(bcm->softmac,
306 is_multicast_ether_addr(wireless_header->addr1), is_mgt);
304 ofdm_modulation = !(ieee80211_is_cck_rate(bitrate)); 307 ofdm_modulation = !(ieee80211_is_cck_rate(bitrate));
305 fallback_bitrate = bcm43xx_calc_fallback_rate(bitrate); 308 fallback_bitrate = bcm43xx_calc_fallback_rate(bitrate);
306 fallback_ofdm_modulation = !(ieee80211_is_cck_rate(fallback_bitrate)); 309 fallback_ofdm_modulation = !(ieee80211_is_cck_rate(fallback_bitrate));
diff --git a/drivers/net/wireless/hostap/hostap_plx.c b/drivers/net/wireless/hostap/hostap_plx.c
index 49860fa61c30..6dfa041be66d 100644
--- a/drivers/net/wireless/hostap/hostap_plx.c
+++ b/drivers/net/wireless/hostap/hostap_plx.c
@@ -66,10 +66,12 @@ static struct pci_device_id prism2_plx_id_table[] __devinitdata = {
66 PLXDEV(0x10b7, 0x7770, "3Com AirConnect PCI 777A"), 66 PLXDEV(0x10b7, 0x7770, "3Com AirConnect PCI 777A"),
67 PLXDEV(0x111a, 0x1023, "Siemens SpeedStream SS1023"), 67 PLXDEV(0x111a, 0x1023, "Siemens SpeedStream SS1023"),
68 PLXDEV(0x126c, 0x8030, "Nortel emobility"), 68 PLXDEV(0x126c, 0x8030, "Nortel emobility"),
69 PLXDEV(0x1562, 0x0001, "Symbol LA-4123"),
69 PLXDEV(0x1385, 0x4100, "Netgear MA301"), 70 PLXDEV(0x1385, 0x4100, "Netgear MA301"),
70 PLXDEV(0x15e8, 0x0130, "National Datacomm NCP130 (PLX9052)"), 71 PLXDEV(0x15e8, 0x0130, "National Datacomm NCP130 (PLX9052)"),
71 PLXDEV(0x15e8, 0x0131, "National Datacomm NCP130 (TMD7160)"), 72 PLXDEV(0x15e8, 0x0131, "National Datacomm NCP130 (TMD7160)"),
72 PLXDEV(0x1638, 0x1100, "Eumitcom WL11000"), 73 PLXDEV(0x1638, 0x1100, "Eumitcom WL11000"),
74 PLXDEV(0x16ab, 0x1100, "Global Sun Tech GL24110P"),
73 PLXDEV(0x16ab, 0x1101, "Global Sun Tech GL24110P (?)"), 75 PLXDEV(0x16ab, 0x1101, "Global Sun Tech GL24110P (?)"),
74 PLXDEV(0x16ab, 0x1102, "Linksys WPC11 with WDT11"), 76 PLXDEV(0x16ab, 0x1102, "Linksys WPC11 with WDT11"),
75 PLXDEV(0x16ab, 0x1103, "Longshine 8031"), 77 PLXDEV(0x16ab, 0x1103, "Longshine 8031"),
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c
index d6ed5781b93a..317ace7f9aae 100644
--- a/drivers/net/wireless/orinoco.c
+++ b/drivers/net/wireless/orinoco.c
@@ -2875,7 +2875,7 @@ static int orinoco_ioctl_setiwencode(struct net_device *dev,
2875 if (orinoco_lock(priv, &flags) != 0) 2875 if (orinoco_lock(priv, &flags) != 0)
2876 return -EBUSY; 2876 return -EBUSY;
2877 2877
2878 if (erq->pointer) { 2878 if (erq->length > 0) {
2879 if ((index < 0) || (index >= ORINOCO_MAX_KEYS)) 2879 if ((index < 0) || (index >= ORINOCO_MAX_KEYS))
2880 index = priv->tx_key; 2880 index = priv->tx_key;
2881 2881
@@ -2918,7 +2918,7 @@ static int orinoco_ioctl_setiwencode(struct net_device *dev,
2918 if (erq->flags & IW_ENCODE_RESTRICTED) 2918 if (erq->flags & IW_ENCODE_RESTRICTED)
2919 restricted = 1; 2919 restricted = 1;
2920 2920
2921 if (erq->pointer) { 2921 if (erq->pointer && erq->length > 0) {
2922 priv->keys[index].len = cpu_to_le16(xlen); 2922 priv->keys[index].len = cpu_to_le16(xlen);
2923 memset(priv->keys[index].data, 0, 2923 memset(priv->keys[index].data, 0,
2924 sizeof(priv->keys[index].data)); 2924 sizeof(priv->keys[index].data));
diff --git a/drivers/net/wireless/spectrum_cs.c b/drivers/net/wireless/spectrum_cs.c
index 15465278c789..7f78b7801fb3 100644
--- a/drivers/net/wireless/spectrum_cs.c
+++ b/drivers/net/wireless/spectrum_cs.c
@@ -34,8 +34,6 @@
34 34
35#include "orinoco.h" 35#include "orinoco.h"
36 36
37static unsigned char *primsym;
38static unsigned char *secsym;
39static const char primary_fw_name[] = "symbol_sp24t_prim_fw"; 37static const char primary_fw_name[] = "symbol_sp24t_prim_fw";
40static const char secondary_fw_name[] = "symbol_sp24t_sec_fw"; 38static const char secondary_fw_name[] = "symbol_sp24t_sec_fw";
41 39
@@ -440,7 +438,7 @@ spectrum_load_blocks(hermes_t *hw, const struct dblock *first_block)
440 */ 438 */
441static int 439static int
442spectrum_dl_image(hermes_t *hw, struct pcmcia_device *link, 440spectrum_dl_image(hermes_t *hw, struct pcmcia_device *link,
443 const unsigned char *image) 441 const unsigned char *image, int secondary)
444{ 442{
445 int ret; 443 int ret;
446 const unsigned char *ptr; 444 const unsigned char *ptr;
@@ -455,7 +453,7 @@ spectrum_dl_image(hermes_t *hw, struct pcmcia_device *link,
455 first_block = (const struct dblock *) ptr; 453 first_block = (const struct dblock *) ptr;
456 454
457 /* Read the PDA */ 455 /* Read the PDA */
458 if (image != primsym) { 456 if (secondary) {
459 ret = spectrum_read_pda(hw, pda, sizeof(pda)); 457 ret = spectrum_read_pda(hw, pda, sizeof(pda));
460 if (ret) 458 if (ret)
461 return ret; 459 return ret;
@@ -472,7 +470,7 @@ spectrum_dl_image(hermes_t *hw, struct pcmcia_device *link,
472 return ret; 470 return ret;
473 471
474 /* Write the PDA to the adapter */ 472 /* Write the PDA to the adapter */
475 if (image != primsym) { 473 if (secondary) {
476 ret = spectrum_apply_pda(hw, first_block, pda); 474 ret = spectrum_apply_pda(hw, first_block, pda);
477 if (ret) 475 if (ret)
478 return ret; 476 return ret;
@@ -487,7 +485,7 @@ spectrum_dl_image(hermes_t *hw, struct pcmcia_device *link,
487 ret = hermes_init(hw); 485 ret = hermes_init(hw);
488 486
489 /* hermes_reset() should return 0 with the secondary firmware */ 487 /* hermes_reset() should return 0 with the secondary firmware */
490 if (image != primsym && ret != 0) 488 if (secondary && ret != 0)
491 return -ENODEV; 489 return -ENODEV;
492 490
493 /* And this should work with any firmware */ 491 /* And this should work with any firmware */
@@ -509,33 +507,30 @@ spectrum_dl_firmware(hermes_t *hw, struct pcmcia_device *link)
509 const struct firmware *fw_entry; 507 const struct firmware *fw_entry;
510 508
511 if (request_firmware(&fw_entry, primary_fw_name, 509 if (request_firmware(&fw_entry, primary_fw_name,
512 &handle_to_dev(link)) == 0) { 510 &handle_to_dev(link)) != 0) {
513 primsym = fw_entry->data;
514 } else {
515 printk(KERN_ERR PFX "Cannot find firmware: %s\n", 511 printk(KERN_ERR PFX "Cannot find firmware: %s\n",
516 primary_fw_name); 512 primary_fw_name);
517 return -ENOENT; 513 return -ENOENT;
518 } 514 }
519 515
520 if (request_firmware(&fw_entry, secondary_fw_name,
521 &handle_to_dev(link)) == 0) {
522 secsym = fw_entry->data;
523 } else {
524 printk(KERN_ERR PFX "Cannot find firmware: %s\n",
525 secondary_fw_name);
526 return -ENOENT;
527 }
528
529 /* Load primary firmware */ 516 /* Load primary firmware */
530 ret = spectrum_dl_image(hw, link, primsym); 517 ret = spectrum_dl_image(hw, link, fw_entry->data, 0);
518 release_firmware(fw_entry);
531 if (ret) { 519 if (ret) {
532 printk(KERN_ERR PFX "Primary firmware download failed\n"); 520 printk(KERN_ERR PFX "Primary firmware download failed\n");
533 return ret; 521 return ret;
534 } 522 }
535 523
536 /* Load secondary firmware */ 524 if (request_firmware(&fw_entry, secondary_fw_name,
537 ret = spectrum_dl_image(hw, link, secsym); 525 &handle_to_dev(link)) != 0) {
526 printk(KERN_ERR PFX "Cannot find firmware: %s\n",
527 secondary_fw_name);
528 return -ENOENT;
529 }
538 530
531 /* Load secondary firmware */
532 ret = spectrum_dl_image(hw, link, fw_entry->data, 1);
533 release_firmware(fw_entry);
539 if (ret) { 534 if (ret) {
540 printk(KERN_ERR PFX "Secondary firmware download failed\n"); 535 printk(KERN_ERR PFX "Secondary firmware download failed\n");
541 } 536 }
diff --git a/drivers/net/wireless/zd1201.c b/drivers/net/wireless/zd1201.c
index 662ecc8a33ff..c52e9bcf8d02 100644
--- a/drivers/net/wireless/zd1201.c
+++ b/drivers/net/wireless/zd1201.c
@@ -1820,6 +1820,8 @@ static int zd1201_probe(struct usb_interface *interface,
1820 zd->dev->name); 1820 zd->dev->name);
1821 1821
1822 usb_set_intfdata(interface, zd); 1822 usb_set_intfdata(interface, zd);
1823 zd1201_enable(zd); /* zd1201 likes to startup enabled, */
1824 zd1201_disable(zd); /* interfering with all the wifis in range */
1823 return 0; 1825 return 0;
1824 1826
1825err_net: 1827err_net:
diff --git a/drivers/net/wireless/zd1211rw/Kconfig b/drivers/net/wireless/zd1211rw/Kconfig
new file mode 100644
index 000000000000..66ed55bc5460
--- /dev/null
+++ b/drivers/net/wireless/zd1211rw/Kconfig
@@ -0,0 +1,19 @@
1config ZD1211RW
2 tristate "ZyDAS ZD1211/ZD1211B USB-wireless support"
3 depends on USB && IEEE80211 && IEEE80211_SOFTMAC && NET_RADIO && EXPERIMENTAL
4 select FW_LOADER
5 ---help---
6 This is an experimental driver for the ZyDAS ZD1211/ZD1211B wireless
7 chip, present in many USB-wireless adapters.
8
9 Device firmware is required alongside this driver. You can download the
10 firmware distribution from http://zd1211.ath.cx/get-firmware
11
12config ZD1211RW_DEBUG
13 bool "ZyDAS ZD1211 debugging"
14 depends on ZD1211RW
15 ---help---
16 ZD1211 debugging messages. Choosing Y will result in additional debug
17 messages being saved to your kernel logs, which may help debug any
18 problems.
19
diff --git a/drivers/net/wireless/zd1211rw/Makefile b/drivers/net/wireless/zd1211rw/Makefile
new file mode 100644
index 000000000000..500314fc74d2
--- /dev/null
+++ b/drivers/net/wireless/zd1211rw/Makefile
@@ -0,0 +1,11 @@
1obj-$(CONFIG_ZD1211RW) += zd1211rw.o
2
3zd1211rw-objs := zd_chip.o zd_ieee80211.o \
4 zd_mac.o zd_netdev.o \
5 zd_rf_al2230.o zd_rf_rf2959.o \
6 zd_rf.o zd_usb.o zd_util.o
7
8ifeq ($(CONFIG_ZD1211RW_DEBUG),y)
9EXTRA_CFLAGS += -DDEBUG
10endif
11
diff --git a/drivers/net/wireless/zd1211rw/zd_chip.c b/drivers/net/wireless/zd1211rw/zd_chip.c
new file mode 100644
index 000000000000..da9d06bdb818
--- /dev/null
+++ b/drivers/net/wireless/zd1211rw/zd_chip.c
@@ -0,0 +1,1615 @@
1/* zd_chip.c
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 */
17
18/* This file implements all the hardware specific functions for the ZD1211
19 * and ZD1211B chips. Support for the ZD1211B was possible after Timothy
20 * Legge sent me a ZD1211B device. Thank you Tim. -- Uli
21 */
22
23#include <linux/kernel.h>
24#include <linux/errno.h>
25
26#include "zd_def.h"
27#include "zd_chip.h"
28#include "zd_ieee80211.h"
29#include "zd_mac.h"
30#include "zd_rf.h"
31#include "zd_util.h"
32
33void zd_chip_init(struct zd_chip *chip,
34 struct net_device *netdev,
35 struct usb_interface *intf)
36{
37 memset(chip, 0, sizeof(*chip));
38 mutex_init(&chip->mutex);
39 zd_usb_init(&chip->usb, netdev, intf);
40 zd_rf_init(&chip->rf);
41}
42
43void zd_chip_clear(struct zd_chip *chip)
44{
45 mutex_lock(&chip->mutex);
46 zd_usb_clear(&chip->usb);
47 zd_rf_clear(&chip->rf);
48 mutex_unlock(&chip->mutex);
49 mutex_destroy(&chip->mutex);
50 memset(chip, 0, sizeof(*chip));
51}
52
53static int scnprint_mac_oui(const u8 *addr, char *buffer, size_t size)
54{
55 return scnprintf(buffer, size, "%02x-%02x-%02x",
56 addr[0], addr[1], addr[2]);
57}
58
59/* Prints an identifier line, which will support debugging. */
60static int scnprint_id(struct zd_chip *chip, char *buffer, size_t size)
61{
62 int i = 0;
63
64 i = scnprintf(buffer, size, "zd1211%s chip ",
65 chip->is_zd1211b ? "b" : "");
66 i += zd_usb_scnprint_id(&chip->usb, buffer+i, size-i);
67 i += scnprintf(buffer+i, size-i, " ");
68 i += scnprint_mac_oui(chip->e2p_mac, buffer+i, size-i);
69 i += scnprintf(buffer+i, size-i, " ");
70 i += zd_rf_scnprint_id(&chip->rf, buffer+i, size-i);
71 i += scnprintf(buffer+i, size-i, " pa%1x %c%c%c", chip->pa_type,
72 chip->patch_cck_gain ? 'g' : '-',
73 chip->patch_cr157 ? '7' : '-',
74 chip->patch_6m_band_edge ? '6' : '-');
75 return i;
76}
77
78static void print_id(struct zd_chip *chip)
79{
80 char buffer[80];
81
82 scnprint_id(chip, buffer, sizeof(buffer));
83 buffer[sizeof(buffer)-1] = 0;
84 dev_info(zd_chip_dev(chip), "%s\n", buffer);
85}
86
87/* Read a variable number of 32-bit values. Parameter count is not allowed to
88 * exceed USB_MAX_IOREAD32_COUNT.
89 */
90int zd_ioread32v_locked(struct zd_chip *chip, u32 *values, const zd_addr_t *addr,
91 unsigned int count)
92{
93 int r;
94 int i;
95 zd_addr_t *a16 = (zd_addr_t *)NULL;
96 u16 *v16;
97 unsigned int count16;
98
99 if (count > USB_MAX_IOREAD32_COUNT)
100 return -EINVAL;
101
102 /* Allocate a single memory block for values and addresses. */
103 count16 = 2*count;
104 a16 = (zd_addr_t *)kmalloc(count16 * (sizeof(zd_addr_t) + sizeof(u16)),
105 GFP_NOFS);
106 if (!a16) {
107 dev_dbg_f(zd_chip_dev(chip),
108 "error ENOMEM in allocation of a16\n");
109 r = -ENOMEM;
110 goto out;
111 }
112 v16 = (u16 *)(a16 + count16);
113
114 for (i = 0; i < count; i++) {
115 int j = 2*i;
116 /* We read the high word always first. */
117 a16[j] = zd_inc_word(addr[i]);
118 a16[j+1] = addr[i];
119 }
120
121 r = zd_ioread16v_locked(chip, v16, a16, count16);
122 if (r) {
123 dev_dbg_f(zd_chip_dev(chip),
124 "error: zd_ioread16v_locked. Error number %d\n", r);
125 goto out;
126 }
127
128 for (i = 0; i < count; i++) {
129 int j = 2*i;
130 values[i] = (v16[j] << 16) | v16[j+1];
131 }
132
133out:
134 kfree((void *)a16);
135 return r;
136}
137
138int _zd_iowrite32v_locked(struct zd_chip *chip, const struct zd_ioreq32 *ioreqs,
139 unsigned int count)
140{
141 int i, j, r;
142 struct zd_ioreq16 *ioreqs16;
143 unsigned int count16;
144
145 ZD_ASSERT(mutex_is_locked(&chip->mutex));
146
147 if (count == 0)
148 return 0;
149 if (count > USB_MAX_IOWRITE32_COUNT)
150 return -EINVAL;
151
152 /* Allocate a single memory block for values and addresses. */
153 count16 = 2*count;
154 ioreqs16 = kmalloc(count16 * sizeof(struct zd_ioreq16), GFP_NOFS);
155 if (!ioreqs16) {
156 r = -ENOMEM;
157 dev_dbg_f(zd_chip_dev(chip),
158 "error %d in ioreqs16 allocation\n", r);
159 goto out;
160 }
161
162 for (i = 0; i < count; i++) {
163 j = 2*i;
164 /* We write the high word always first. */
165 ioreqs16[j].value = ioreqs[i].value >> 16;
166 ioreqs16[j].addr = zd_inc_word(ioreqs[i].addr);
167 ioreqs16[j+1].value = ioreqs[i].value;
168 ioreqs16[j+1].addr = ioreqs[i].addr;
169 }
170
171 r = zd_usb_iowrite16v(&chip->usb, ioreqs16, count16);
172#ifdef DEBUG
173 if (r) {
174 dev_dbg_f(zd_chip_dev(chip),
175 "error %d in zd_usb_write16v\n", r);
176 }
177#endif /* DEBUG */
178out:
179 kfree(ioreqs16);
180 return r;
181}
182
183int zd_iowrite16a_locked(struct zd_chip *chip,
184 const struct zd_ioreq16 *ioreqs, unsigned int count)
185{
186 int r;
187 unsigned int i, j, t, max;
188
189 ZD_ASSERT(mutex_is_locked(&chip->mutex));
190 for (i = 0; i < count; i += j + t) {
191 t = 0;
192 max = count-i;
193 if (max > USB_MAX_IOWRITE16_COUNT)
194 max = USB_MAX_IOWRITE16_COUNT;
195 for (j = 0; j < max; j++) {
196 if (!ioreqs[i+j].addr) {
197 t = 1;
198 break;
199 }
200 }
201
202 r = zd_usb_iowrite16v(&chip->usb, &ioreqs[i], j);
203 if (r) {
204 dev_dbg_f(zd_chip_dev(chip),
205 "error zd_usb_iowrite16v. Error number %d\n",
206 r);
207 return r;
208 }
209 }
210
211 return 0;
212}
213
214/* Writes a variable number of 32 bit registers. The functions will split
215 * that in several USB requests. A split can be forced by inserting an IO
216 * request with an zero address field.
217 */
218int zd_iowrite32a_locked(struct zd_chip *chip,
219 const struct zd_ioreq32 *ioreqs, unsigned int count)
220{
221 int r;
222 unsigned int i, j, t, max;
223
224 for (i = 0; i < count; i += j + t) {
225 t = 0;
226 max = count-i;
227 if (max > USB_MAX_IOWRITE32_COUNT)
228 max = USB_MAX_IOWRITE32_COUNT;
229 for (j = 0; j < max; j++) {
230 if (!ioreqs[i+j].addr) {
231 t = 1;
232 break;
233 }
234 }
235
236 r = _zd_iowrite32v_locked(chip, &ioreqs[i], j);
237 if (r) {
238 dev_dbg_f(zd_chip_dev(chip),
239 "error _zd_iowrite32v_locked."
240 " Error number %d\n", r);
241 return r;
242 }
243 }
244
245 return 0;
246}
247
248int zd_ioread16(struct zd_chip *chip, zd_addr_t addr, u16 *value)
249{
250 int r;
251
252 ZD_ASSERT(!mutex_is_locked(&chip->mutex));
253 mutex_lock(&chip->mutex);
254 r = zd_ioread16_locked(chip, value, addr);
255 mutex_unlock(&chip->mutex);
256 return r;
257}
258
259int zd_ioread32(struct zd_chip *chip, zd_addr_t addr, u32 *value)
260{
261 int r;
262
263 ZD_ASSERT(!mutex_is_locked(&chip->mutex));
264 mutex_lock(&chip->mutex);
265 r = zd_ioread32_locked(chip, value, addr);
266 mutex_unlock(&chip->mutex);
267 return r;
268}
269
270int zd_iowrite16(struct zd_chip *chip, zd_addr_t addr, u16 value)
271{
272 int r;
273
274 ZD_ASSERT(!mutex_is_locked(&chip->mutex));
275 mutex_lock(&chip->mutex);
276 r = zd_iowrite16_locked(chip, value, addr);
277 mutex_unlock(&chip->mutex);
278 return r;
279}
280
281int zd_iowrite32(struct zd_chip *chip, zd_addr_t addr, u32 value)
282{
283 int r;
284
285 ZD_ASSERT(!mutex_is_locked(&chip->mutex));
286 mutex_lock(&chip->mutex);
287 r = zd_iowrite32_locked(chip, value, addr);
288 mutex_unlock(&chip->mutex);
289 return r;
290}
291
292int zd_ioread32v(struct zd_chip *chip, const zd_addr_t *addresses,
293 u32 *values, unsigned int count)
294{
295 int r;
296
297 ZD_ASSERT(!mutex_is_locked(&chip->mutex));
298 mutex_lock(&chip->mutex);
299 r = zd_ioread32v_locked(chip, values, addresses, count);
300 mutex_unlock(&chip->mutex);
301 return r;
302}
303
304int zd_iowrite32a(struct zd_chip *chip, const struct zd_ioreq32 *ioreqs,
305 unsigned int count)
306{
307 int r;
308
309 ZD_ASSERT(!mutex_is_locked(&chip->mutex));
310 mutex_lock(&chip->mutex);
311 r = zd_iowrite32a_locked(chip, ioreqs, count);
312 mutex_unlock(&chip->mutex);
313 return r;
314}
315
316static int read_pod(struct zd_chip *chip, u8 *rf_type)
317{
318 int r;
319 u32 value;
320
321 ZD_ASSERT(mutex_is_locked(&chip->mutex));
322 r = zd_ioread32_locked(chip, &value, E2P_POD);
323 if (r)
324 goto error;
325 dev_dbg_f(zd_chip_dev(chip), "E2P_POD %#010x\n", value);
326
327 /* FIXME: AL2230 handling (Bit 7 in POD) */
328 *rf_type = value & 0x0f;
329 chip->pa_type = (value >> 16) & 0x0f;
330 chip->patch_cck_gain = (value >> 8) & 0x1;
331 chip->patch_cr157 = (value >> 13) & 0x1;
332 chip->patch_6m_band_edge = (value >> 21) & 0x1;
333
334 dev_dbg_f(zd_chip_dev(chip),
335 "RF %s %#01x PA type %#01x patch CCK %d patch CR157 %d "
336 "patch 6M %d\n",
337 zd_rf_name(*rf_type), *rf_type,
338 chip->pa_type, chip->patch_cck_gain,
339 chip->patch_cr157, chip->patch_6m_band_edge);
340 return 0;
341error:
342 *rf_type = 0;
343 chip->pa_type = 0;
344 chip->patch_cck_gain = 0;
345 chip->patch_cr157 = 0;
346 chip->patch_6m_band_edge = 0;
347 return r;
348}
349
350static int _read_mac_addr(struct zd_chip *chip, u8 *mac_addr,
351 const zd_addr_t *addr)
352{
353 int r;
354 u32 parts[2];
355
356 r = zd_ioread32v_locked(chip, parts, (const zd_addr_t *)addr, 2);
357 if (r) {
358 dev_dbg_f(zd_chip_dev(chip),
359 "error: couldn't read e2p macs. Error number %d\n", r);
360 return r;
361 }
362
363 mac_addr[0] = parts[0];
364 mac_addr[1] = parts[0] >> 8;
365 mac_addr[2] = parts[0] >> 16;
366 mac_addr[3] = parts[0] >> 24;
367 mac_addr[4] = parts[1];
368 mac_addr[5] = parts[1] >> 8;
369
370 return 0;
371}
372
373static int read_e2p_mac_addr(struct zd_chip *chip)
374{
375 static const zd_addr_t addr[2] = { E2P_MAC_ADDR_P1, E2P_MAC_ADDR_P2 };
376
377 ZD_ASSERT(mutex_is_locked(&chip->mutex));
378 return _read_mac_addr(chip, chip->e2p_mac, (const zd_addr_t *)addr);
379}
380
381/* MAC address: if custom mac addresses are to to be used CR_MAC_ADDR_P1 and
382 * CR_MAC_ADDR_P2 must be overwritten
383 */
384void zd_get_e2p_mac_addr(struct zd_chip *chip, u8 *mac_addr)
385{
386 mutex_lock(&chip->mutex);
387 memcpy(mac_addr, chip->e2p_mac, ETH_ALEN);
388 mutex_unlock(&chip->mutex);
389}
390
391static int read_mac_addr(struct zd_chip *chip, u8 *mac_addr)
392{
393 static const zd_addr_t addr[2] = { CR_MAC_ADDR_P1, CR_MAC_ADDR_P2 };
394 return _read_mac_addr(chip, mac_addr, (const zd_addr_t *)addr);
395}
396
397int zd_read_mac_addr(struct zd_chip *chip, u8 *mac_addr)
398{
399 int r;
400
401 dev_dbg_f(zd_chip_dev(chip), "\n");
402 mutex_lock(&chip->mutex);
403 r = read_mac_addr(chip, mac_addr);
404 mutex_unlock(&chip->mutex);
405 return r;
406}
407
408int zd_write_mac_addr(struct zd_chip *chip, const u8 *mac_addr)
409{
410 int r;
411 struct zd_ioreq32 reqs[2] = {
412 [0] = { .addr = CR_MAC_ADDR_P1 },
413 [1] = { .addr = CR_MAC_ADDR_P2 },
414 };
415
416 reqs[0].value = (mac_addr[3] << 24)
417 | (mac_addr[2] << 16)
418 | (mac_addr[1] << 8)
419 | mac_addr[0];
420 reqs[1].value = (mac_addr[5] << 8)
421 | mac_addr[4];
422
423 dev_dbg_f(zd_chip_dev(chip),
424 "mac addr " MAC_FMT "\n", MAC_ARG(mac_addr));
425
426 mutex_lock(&chip->mutex);
427 r = zd_iowrite32a_locked(chip, reqs, ARRAY_SIZE(reqs));
428#ifdef DEBUG
429 {
430 u8 tmp[ETH_ALEN];
431 read_mac_addr(chip, tmp);
432 }
433#endif /* DEBUG */
434 mutex_unlock(&chip->mutex);
435 return r;
436}
437
438int zd_read_regdomain(struct zd_chip *chip, u8 *regdomain)
439{
440 int r;
441 u32 value;
442
443 mutex_lock(&chip->mutex);
444 r = zd_ioread32_locked(chip, &value, E2P_SUBID);
445 mutex_unlock(&chip->mutex);
446 if (r)
447 return r;
448
449 *regdomain = value >> 16;
450 dev_dbg_f(zd_chip_dev(chip), "regdomain: %#04x\n", *regdomain);
451
452 return 0;
453}
454
455static int read_values(struct zd_chip *chip, u8 *values, size_t count,
456 zd_addr_t e2p_addr, u32 guard)
457{
458 int r;
459 int i;
460 u32 v;
461
462 ZD_ASSERT(mutex_is_locked(&chip->mutex));
463 for (i = 0;;) {
464 r = zd_ioread32_locked(chip, &v, e2p_addr+i/2);
465 if (r)
466 return r;
467 v -= guard;
468 if (i+4 < count) {
469 values[i++] = v;
470 values[i++] = v >> 8;
471 values[i++] = v >> 16;
472 values[i++] = v >> 24;
473 continue;
474 }
475 for (;i < count; i++)
476 values[i] = v >> (8*(i%3));
477 return 0;
478 }
479}
480
481static int read_pwr_cal_values(struct zd_chip *chip)
482{
483 return read_values(chip, chip->pwr_cal_values,
484 E2P_CHANNEL_COUNT, E2P_PWR_CAL_VALUE1,
485 0);
486}
487
488static int read_pwr_int_values(struct zd_chip *chip)
489{
490 return read_values(chip, chip->pwr_int_values,
491 E2P_CHANNEL_COUNT, E2P_PWR_INT_VALUE1,
492 E2P_PWR_INT_GUARD);
493}
494
495static int read_ofdm_cal_values(struct zd_chip *chip)
496{
497 int r;
498 int i;
499 static const zd_addr_t addresses[] = {
500 E2P_36M_CAL_VALUE1,
501 E2P_48M_CAL_VALUE1,
502 E2P_54M_CAL_VALUE1,
503 };
504
505 for (i = 0; i < 3; i++) {
506 r = read_values(chip, chip->ofdm_cal_values[i],
507 E2P_CHANNEL_COUNT, addresses[i], 0);
508 if (r)
509 return r;
510 }
511 return 0;
512}
513
514static int read_cal_int_tables(struct zd_chip *chip)
515{
516 int r;
517
518 r = read_pwr_cal_values(chip);
519 if (r)
520 return r;
521 r = read_pwr_int_values(chip);
522 if (r)
523 return r;
524 r = read_ofdm_cal_values(chip);
525 if (r)
526 return r;
527 return 0;
528}
529
530/* phy means physical registers */
531int zd_chip_lock_phy_regs(struct zd_chip *chip)
532{
533 int r;
534 u32 tmp;
535
536 ZD_ASSERT(mutex_is_locked(&chip->mutex));
537 r = zd_ioread32_locked(chip, &tmp, CR_REG1);
538 if (r) {
539 dev_err(zd_chip_dev(chip), "error ioread32(CR_REG1): %d\n", r);
540 return r;
541 }
542
543 dev_dbg_f(zd_chip_dev(chip),
544 "CR_REG1: 0x%02x -> 0x%02x\n", tmp, tmp & ~UNLOCK_PHY_REGS);
545 tmp &= ~UNLOCK_PHY_REGS;
546
547 r = zd_iowrite32_locked(chip, tmp, CR_REG1);
548 if (r)
549 dev_err(zd_chip_dev(chip), "error iowrite32(CR_REG1): %d\n", r);
550 return r;
551}
552
553int zd_chip_unlock_phy_regs(struct zd_chip *chip)
554{
555 int r;
556 u32 tmp;
557
558 ZD_ASSERT(mutex_is_locked(&chip->mutex));
559 r = zd_ioread32_locked(chip, &tmp, CR_REG1);
560 if (r) {
561 dev_err(zd_chip_dev(chip),
562 "error ioread32(CR_REG1): %d\n", r);
563 return r;
564 }
565
566 dev_dbg_f(zd_chip_dev(chip),
567 "CR_REG1: 0x%02x -> 0x%02x\n", tmp, tmp | UNLOCK_PHY_REGS);
568 tmp |= UNLOCK_PHY_REGS;
569
570 r = zd_iowrite32_locked(chip, tmp, CR_REG1);
571 if (r)
572 dev_err(zd_chip_dev(chip), "error iowrite32(CR_REG1): %d\n", r);
573 return r;
574}
575
576/* CR157 can be optionally patched by the EEPROM */
577static int patch_cr157(struct zd_chip *chip)
578{
579 int r;
580 u32 value;
581
582 if (!chip->patch_cr157)
583 return 0;
584
585 r = zd_ioread32_locked(chip, &value, E2P_PHY_REG);
586 if (r)
587 return r;
588
589 dev_dbg_f(zd_chip_dev(chip), "patching value %x\n", value >> 8);
590 return zd_iowrite32_locked(chip, value >> 8, CR157);
591}
592
593/*
594 * 6M band edge can be optionally overwritten for certain RF's
595 * Vendor driver says: for FCC regulation, enabled per HWFeature 6M band edge
596 * bit (for AL2230, AL2230S)
597 */
598static int patch_6m_band_edge(struct zd_chip *chip, int channel)
599{
600 struct zd_ioreq16 ioreqs[] = {
601 { CR128, 0x14 }, { CR129, 0x12 }, { CR130, 0x10 },
602 { CR47, 0x1e },
603 };
604
605 if (!chip->patch_6m_band_edge || !chip->rf.patch_6m_band_edge)
606 return 0;
607
608 /* FIXME: Channel 11 is not the edge for all regulatory domains. */
609 if (channel == 1 || channel == 11)
610 ioreqs[0].value = 0x12;
611
612 dev_dbg_f(zd_chip_dev(chip), "patching for channel %d\n", channel);
613 return zd_iowrite16a_locked(chip, ioreqs, ARRAY_SIZE(ioreqs));
614}
615
616static int zd1211_hw_reset_phy(struct zd_chip *chip)
617{
618 static const struct zd_ioreq16 ioreqs[] = {
619 { CR0, 0x0a }, { CR1, 0x06 }, { CR2, 0x26 },
620 { CR3, 0x38 }, { CR4, 0x80 }, { CR9, 0xa0 },
621 { CR10, 0x81 }, { CR11, 0x00 }, { CR12, 0x7f },
622 { CR13, 0x8c }, { CR14, 0x80 }, { CR15, 0x3d },
623 { CR16, 0x20 }, { CR17, 0x1e }, { CR18, 0x0a },
624 { CR19, 0x48 }, { CR20, 0x0c }, { CR21, 0x0c },
625 { CR22, 0x23 }, { CR23, 0x90 }, { CR24, 0x14 },
626 { CR25, 0x40 }, { CR26, 0x10 }, { CR27, 0x19 },
627 { CR28, 0x7f }, { CR29, 0x80 }, { CR30, 0x4b },
628 { CR31, 0x60 }, { CR32, 0x43 }, { CR33, 0x08 },
629 { CR34, 0x06 }, { CR35, 0x0a }, { CR36, 0x00 },
630 { CR37, 0x00 }, { CR38, 0x38 }, { CR39, 0x0c },
631 { CR40, 0x84 }, { CR41, 0x2a }, { CR42, 0x80 },
632 { CR43, 0x10 }, { CR44, 0x12 }, { CR46, 0xff },
633 { CR47, 0x1E }, { CR48, 0x26 }, { CR49, 0x5b },
634 { CR64, 0xd0 }, { CR65, 0x04 }, { CR66, 0x58 },
635 { CR67, 0xc9 }, { CR68, 0x88 }, { CR69, 0x41 },
636 { CR70, 0x23 }, { CR71, 0x10 }, { CR72, 0xff },
637 { CR73, 0x32 }, { CR74, 0x30 }, { CR75, 0x65 },
638 { CR76, 0x41 }, { CR77, 0x1b }, { CR78, 0x30 },
639 { CR79, 0x68 }, { CR80, 0x64 }, { CR81, 0x64 },
640 { CR82, 0x00 }, { CR83, 0x00 }, { CR84, 0x00 },
641 { CR85, 0x02 }, { CR86, 0x00 }, { CR87, 0x00 },
642 { CR88, 0xff }, { CR89, 0xfc }, { CR90, 0x00 },
643 { CR91, 0x00 }, { CR92, 0x00 }, { CR93, 0x08 },
644 { CR94, 0x00 }, { CR95, 0x00 }, { CR96, 0xff },
645 { CR97, 0xe7 }, { CR98, 0x00 }, { CR99, 0x00 },
646 { CR100, 0x00 }, { CR101, 0xae }, { CR102, 0x02 },
647 { CR103, 0x00 }, { CR104, 0x03 }, { CR105, 0x65 },
648 { CR106, 0x04 }, { CR107, 0x00 }, { CR108, 0x0a },
649 { CR109, 0xaa }, { CR110, 0xaa }, { CR111, 0x25 },
650 { CR112, 0x25 }, { CR113, 0x00 }, { CR119, 0x1e },
651 { CR125, 0x90 }, { CR126, 0x00 }, { CR127, 0x00 },
652 { },
653 { CR5, 0x00 }, { CR6, 0x00 }, { CR7, 0x00 },
654 { CR8, 0x00 }, { CR9, 0x20 }, { CR12, 0xf0 },
655 { CR20, 0x0e }, { CR21, 0x0e }, { CR27, 0x10 },
656 { CR44, 0x33 }, { CR47, 0x1E }, { CR83, 0x24 },
657 { CR84, 0x04 }, { CR85, 0x00 }, { CR86, 0x0C },
658 { CR87, 0x12 }, { CR88, 0x0C }, { CR89, 0x00 },
659 { CR90, 0x10 }, { CR91, 0x08 }, { CR93, 0x00 },
660 { CR94, 0x01 }, { CR95, 0x00 }, { CR96, 0x50 },
661 { CR97, 0x37 }, { CR98, 0x35 }, { CR101, 0x13 },
662 { CR102, 0x27 }, { CR103, 0x27 }, { CR104, 0x18 },
663 { CR105, 0x12 }, { CR109, 0x27 }, { CR110, 0x27 },
664 { CR111, 0x27 }, { CR112, 0x27 }, { CR113, 0x27 },
665 { CR114, 0x27 }, { CR115, 0x26 }, { CR116, 0x24 },
666 { CR117, 0xfc }, { CR118, 0xfa }, { CR120, 0x4f },
667 { CR123, 0x27 }, { CR125, 0xaa }, { CR127, 0x03 },
668 { CR128, 0x14 }, { CR129, 0x12 }, { CR130, 0x10 },
669 { CR131, 0x0C }, { CR136, 0xdf }, { CR137, 0x40 },
670 { CR138, 0xa0 }, { CR139, 0xb0 }, { CR140, 0x99 },
671 { CR141, 0x82 }, { CR142, 0x54 }, { CR143, 0x1c },
672 { CR144, 0x6c }, { CR147, 0x07 }, { CR148, 0x4c },
673 { CR149, 0x50 }, { CR150, 0x0e }, { CR151, 0x18 },
674 { CR160, 0xfe }, { CR161, 0xee }, { CR162, 0xaa },
675 { CR163, 0xfa }, { CR164, 0xfa }, { CR165, 0xea },
676 { CR166, 0xbe }, { CR167, 0xbe }, { CR168, 0x6a },
677 { CR169, 0xba }, { CR170, 0xba }, { CR171, 0xba },
678 /* Note: CR204 must lead the CR203 */
679 { CR204, 0x7d },
680 { },
681 { CR203, 0x30 },
682 };
683
684 int r, t;
685
686 dev_dbg_f(zd_chip_dev(chip), "\n");
687
688 r = zd_chip_lock_phy_regs(chip);
689 if (r)
690 goto out;
691
692 r = zd_iowrite16a_locked(chip, ioreqs, ARRAY_SIZE(ioreqs));
693 if (r)
694 goto unlock;
695
696 r = patch_cr157(chip);
697unlock:
698 t = zd_chip_unlock_phy_regs(chip);
699 if (t && !r)
700 r = t;
701out:
702 return r;
703}
704
705static int zd1211b_hw_reset_phy(struct zd_chip *chip)
706{
707 static const struct zd_ioreq16 ioreqs[] = {
708 { CR0, 0x14 }, { CR1, 0x06 }, { CR2, 0x26 },
709 { CR3, 0x38 }, { CR4, 0x80 }, { CR9, 0xe0 },
710 { CR10, 0x81 },
711 /* power control { { CR11, 1 << 6 }, */
712 { CR11, 0x00 },
713 { CR12, 0xf0 }, { CR13, 0x8c }, { CR14, 0x80 },
714 { CR15, 0x3d }, { CR16, 0x20 }, { CR17, 0x1e },
715 { CR18, 0x0a }, { CR19, 0x48 },
716 { CR20, 0x10 }, /* Org:0x0E, ComTrend:RalLink AP */
717 { CR21, 0x0e }, { CR22, 0x23 }, { CR23, 0x90 },
718 { CR24, 0x14 }, { CR25, 0x40 }, { CR26, 0x10 },
719 { CR27, 0x10 }, { CR28, 0x7f }, { CR29, 0x80 },
720 { CR30, 0x49 }, /* jointly decoder, no ASIC */
721 { CR31, 0x60 }, { CR32, 0x43 }, { CR33, 0x08 },
722 { CR34, 0x06 }, { CR35, 0x0a }, { CR36, 0x00 },
723 { CR37, 0x00 }, { CR38, 0x38 }, { CR39, 0x0c },
724 { CR40, 0x84 }, { CR41, 0x2a }, { CR42, 0x80 },
725 { CR43, 0x10 }, { CR44, 0x33 }, { CR46, 0xff },
726 { CR47, 0x1E }, { CR48, 0x26 }, { CR49, 0x5b },
727 { CR64, 0xd0 }, { CR65, 0x04 }, { CR66, 0x58 },
728 { CR67, 0xc9 }, { CR68, 0x88 }, { CR69, 0x41 },
729 { CR70, 0x23 }, { CR71, 0x10 }, { CR72, 0xff },
730 { CR73, 0x32 }, { CR74, 0x30 }, { CR75, 0x65 },
731 { CR76, 0x41 }, { CR77, 0x1b }, { CR78, 0x30 },
732 { CR79, 0xf0 }, { CR80, 0x64 }, { CR81, 0x64 },
733 { CR82, 0x00 }, { CR83, 0x24 }, { CR84, 0x04 },
734 { CR85, 0x00 }, { CR86, 0x0c }, { CR87, 0x12 },
735 { CR88, 0x0c }, { CR89, 0x00 }, { CR90, 0x58 },
736 { CR91, 0x04 }, { CR92, 0x00 }, { CR93, 0x00 },
737 { CR94, 0x01 },
738 { CR95, 0x20 }, /* ZD1211B */
739 { CR96, 0x50 }, { CR97, 0x37 }, { CR98, 0x35 },
740 { CR99, 0x00 }, { CR100, 0x01 }, { CR101, 0x13 },
741 { CR102, 0x27 }, { CR103, 0x27 }, { CR104, 0x18 },
742 { CR105, 0x12 }, { CR106, 0x04 }, { CR107, 0x00 },
743 { CR108, 0x0a }, { CR109, 0x27 }, { CR110, 0x27 },
744 { CR111, 0x27 }, { CR112, 0x27 }, { CR113, 0x27 },
745 { CR114, 0x27 }, { CR115, 0x26 }, { CR116, 0x24 },
746 { CR117, 0xfc }, { CR118, 0xfa }, { CR119, 0x1e },
747 { CR125, 0x90 }, { CR126, 0x00 }, { CR127, 0x00 },
748 { CR128, 0x14 }, { CR129, 0x12 }, { CR130, 0x10 },
749 { CR131, 0x0c }, { CR136, 0xdf }, { CR137, 0xa0 },
750 { CR138, 0xa8 }, { CR139, 0xb4 }, { CR140, 0x98 },
751 { CR141, 0x82 }, { CR142, 0x53 }, { CR143, 0x1c },
752 { CR144, 0x6c }, { CR147, 0x07 }, { CR148, 0x40 },
753 { CR149, 0x40 }, /* Org:0x50 ComTrend:RalLink AP */
754 { CR150, 0x14 }, /* Org:0x0E ComTrend:RalLink AP */
755 { CR151, 0x18 }, { CR159, 0x70 }, { CR160, 0xfe },
756 { CR161, 0xee }, { CR162, 0xaa }, { CR163, 0xfa },
757 { CR164, 0xfa }, { CR165, 0xea }, { CR166, 0xbe },
758 { CR167, 0xbe }, { CR168, 0x6a }, { CR169, 0xba },
759 { CR170, 0xba }, { CR171, 0xba },
760 /* Note: CR204 must lead the CR203 */
761 { CR204, 0x7d },
762 {},
763 { CR203, 0x30 },
764 };
765
766 int r, t;
767
768 dev_dbg_f(zd_chip_dev(chip), "\n");
769
770 r = zd_chip_lock_phy_regs(chip);
771 if (r)
772 goto out;
773
774 r = zd_iowrite16a_locked(chip, ioreqs, ARRAY_SIZE(ioreqs));
775 if (r)
776 goto unlock;
777
778 r = patch_cr157(chip);
779unlock:
780 t = zd_chip_unlock_phy_regs(chip);
781 if (t && !r)
782 r = t;
783out:
784 return r;
785}
786
787static int hw_reset_phy(struct zd_chip *chip)
788{
789 return chip->is_zd1211b ? zd1211b_hw_reset_phy(chip) :
790 zd1211_hw_reset_phy(chip);
791}
792
793static int zd1211_hw_init_hmac(struct zd_chip *chip)
794{
795 static const struct zd_ioreq32 ioreqs[] = {
796 { CR_ACK_TIMEOUT_EXT, 0x20 },
797 { CR_ADDA_MBIAS_WARMTIME, 0x30000808 },
798 { CR_ZD1211_RETRY_MAX, 0x2 },
799 { CR_SNIFFER_ON, 0 },
800 { CR_RX_FILTER, STA_RX_FILTER },
801 { CR_GROUP_HASH_P1, 0x00 },
802 { CR_GROUP_HASH_P2, 0x80000000 },
803 { CR_REG1, 0xa4 },
804 { CR_ADDA_PWR_DWN, 0x7f },
805 { CR_BCN_PLCP_CFG, 0x00f00401 },
806 { CR_PHY_DELAY, 0x00 },
807 { CR_ACK_TIMEOUT_EXT, 0x80 },
808 { CR_ADDA_PWR_DWN, 0x00 },
809 { CR_ACK_TIME_80211, 0x100 },
810 { CR_IFS_VALUE, 0x547c032 },
811 { CR_RX_PE_DELAY, 0x70 },
812 { CR_PS_CTRL, 0x10000000 },
813 { CR_RTS_CTS_RATE, 0x02030203 },
814 { CR_RX_THRESHOLD, 0x000c0640 },
815 { CR_AFTER_PNP, 0x1 },
816 { CR_WEP_PROTECT, 0x114 },
817 };
818
819 int r;
820
821 dev_dbg_f(zd_chip_dev(chip), "\n");
822 ZD_ASSERT(mutex_is_locked(&chip->mutex));
823 r = zd_iowrite32a_locked(chip, ioreqs, ARRAY_SIZE(ioreqs));
824#ifdef DEBUG
825 if (r) {
826 dev_err(zd_chip_dev(chip),
827 "error in zd_iowrite32a_locked. Error number %d\n", r);
828 }
829#endif /* DEBUG */
830 return r;
831}
832
833static int zd1211b_hw_init_hmac(struct zd_chip *chip)
834{
835 static const struct zd_ioreq32 ioreqs[] = {
836 { CR_ACK_TIMEOUT_EXT, 0x20 },
837 { CR_ADDA_MBIAS_WARMTIME, 0x30000808 },
838 { CR_ZD1211B_RETRY_MAX, 0x02020202 },
839 { CR_ZD1211B_TX_PWR_CTL4, 0x007f003f },
840 { CR_ZD1211B_TX_PWR_CTL3, 0x007f003f },
841 { CR_ZD1211B_TX_PWR_CTL2, 0x003f001f },
842 { CR_ZD1211B_TX_PWR_CTL1, 0x001f000f },
843 { CR_ZD1211B_AIFS_CTL1, 0x00280028 },
844 { CR_ZD1211B_AIFS_CTL2, 0x008C003C },
845 { CR_ZD1211B_TXOP, 0x01800824 },
846 { CR_SNIFFER_ON, 0 },
847 { CR_RX_FILTER, STA_RX_FILTER },
848 { CR_GROUP_HASH_P1, 0x00 },
849 { CR_GROUP_HASH_P2, 0x80000000 },
850 { CR_REG1, 0xa4 },
851 { CR_ADDA_PWR_DWN, 0x7f },
852 { CR_BCN_PLCP_CFG, 0x00f00401 },
853 { CR_PHY_DELAY, 0x00 },
854 { CR_ACK_TIMEOUT_EXT, 0x80 },
855 { CR_ADDA_PWR_DWN, 0x00 },
856 { CR_ACK_TIME_80211, 0x100 },
857 { CR_IFS_VALUE, 0x547c032 },
858 { CR_RX_PE_DELAY, 0x70 },
859 { CR_PS_CTRL, 0x10000000 },
860 { CR_RTS_CTS_RATE, 0x02030203 },
861 { CR_RX_THRESHOLD, 0x000c0640 },
862 { CR_AFTER_PNP, 0x1 },
863 { CR_WEP_PROTECT, 0x114 },
864 };
865
866 int r;
867
868 dev_dbg_f(zd_chip_dev(chip), "\n");
869 ZD_ASSERT(mutex_is_locked(&chip->mutex));
870 r = zd_iowrite32a_locked(chip, ioreqs, ARRAY_SIZE(ioreqs));
871 if (r) {
872 dev_dbg_f(zd_chip_dev(chip),
873 "error in zd_iowrite32a_locked. Error number %d\n", r);
874 }
875 return r;
876}
877
878static int hw_init_hmac(struct zd_chip *chip)
879{
880 return chip->is_zd1211b ?
881 zd1211b_hw_init_hmac(chip) : zd1211_hw_init_hmac(chip);
882}
883
884struct aw_pt_bi {
885 u32 atim_wnd_period;
886 u32 pre_tbtt;
887 u32 beacon_interval;
888};
889
890static int get_aw_pt_bi(struct zd_chip *chip, struct aw_pt_bi *s)
891{
892 int r;
893 static const zd_addr_t aw_pt_bi_addr[] =
894 { CR_ATIM_WND_PERIOD, CR_PRE_TBTT, CR_BCN_INTERVAL };
895 u32 values[3];
896
897 r = zd_ioread32v_locked(chip, values, (const zd_addr_t *)aw_pt_bi_addr,
898 ARRAY_SIZE(aw_pt_bi_addr));
899 if (r) {
900 memset(s, 0, sizeof(*s));
901 return r;
902 }
903
904 s->atim_wnd_period = values[0];
905 s->pre_tbtt = values[1];
906 s->beacon_interval = values[2];
907 dev_dbg_f(zd_chip_dev(chip), "aw %u pt %u bi %u\n",
908 s->atim_wnd_period, s->pre_tbtt, s->beacon_interval);
909 return 0;
910}
911
912static int set_aw_pt_bi(struct zd_chip *chip, struct aw_pt_bi *s)
913{
914 struct zd_ioreq32 reqs[3];
915
916 if (s->beacon_interval <= 5)
917 s->beacon_interval = 5;
918 if (s->pre_tbtt < 4 || s->pre_tbtt >= s->beacon_interval)
919 s->pre_tbtt = s->beacon_interval - 1;
920 if (s->atim_wnd_period >= s->pre_tbtt)
921 s->atim_wnd_period = s->pre_tbtt - 1;
922
923 reqs[0].addr = CR_ATIM_WND_PERIOD;
924 reqs[0].value = s->atim_wnd_period;
925 reqs[1].addr = CR_PRE_TBTT;
926 reqs[1].value = s->pre_tbtt;
927 reqs[2].addr = CR_BCN_INTERVAL;
928 reqs[2].value = s->beacon_interval;
929
930 dev_dbg_f(zd_chip_dev(chip),
931 "aw %u pt %u bi %u\n", s->atim_wnd_period, s->pre_tbtt,
932 s->beacon_interval);
933 return zd_iowrite32a_locked(chip, reqs, ARRAY_SIZE(reqs));
934}
935
936
937static int set_beacon_interval(struct zd_chip *chip, u32 interval)
938{
939 int r;
940 struct aw_pt_bi s;
941
942 ZD_ASSERT(mutex_is_locked(&chip->mutex));
943 r = get_aw_pt_bi(chip, &s);
944 if (r)
945 return r;
946 s.beacon_interval = interval;
947 return set_aw_pt_bi(chip, &s);
948}
949
950int zd_set_beacon_interval(struct zd_chip *chip, u32 interval)
951{
952 int r;
953
954 mutex_lock(&chip->mutex);
955 r = set_beacon_interval(chip, interval);
956 mutex_unlock(&chip->mutex);
957 return r;
958}
959
960static int hw_init(struct zd_chip *chip)
961{
962 int r;
963
964 dev_dbg_f(zd_chip_dev(chip), "\n");
965 ZD_ASSERT(mutex_is_locked(&chip->mutex));
966 r = hw_reset_phy(chip);
967 if (r)
968 return r;
969
970 r = hw_init_hmac(chip);
971 if (r)
972 return r;
973 r = set_beacon_interval(chip, 100);
974 if (r)
975 return r;
976 return 0;
977}
978
979#ifdef DEBUG
980static int dump_cr(struct zd_chip *chip, const zd_addr_t addr,
981 const char *addr_string)
982{
983 int r;
984 u32 value;
985
986 r = zd_ioread32_locked(chip, &value, addr);
987 if (r) {
988 dev_dbg_f(zd_chip_dev(chip),
989 "error reading %s. Error number %d\n", addr_string, r);
990 return r;
991 }
992
993 dev_dbg_f(zd_chip_dev(chip), "%s %#010x\n",
994 addr_string, (unsigned int)value);
995 return 0;
996}
997
998static int test_init(struct zd_chip *chip)
999{
1000 int r;
1001
1002 r = dump_cr(chip, CR_AFTER_PNP, "CR_AFTER_PNP");
1003 if (r)
1004 return r;
1005 r = dump_cr(chip, CR_GPI_EN, "CR_GPI_EN");
1006 if (r)
1007 return r;
1008 return dump_cr(chip, CR_INTERRUPT, "CR_INTERRUPT");
1009}
1010
1011static void dump_fw_registers(struct zd_chip *chip)
1012{
1013 static const zd_addr_t addr[4] = {
1014 FW_FIRMWARE_VER, FW_USB_SPEED, FW_FIX_TX_RATE,
1015 FW_LINK_STATUS
1016 };
1017
1018 int r;
1019 u16 values[4];
1020
1021 r = zd_ioread16v_locked(chip, values, (const zd_addr_t*)addr,
1022 ARRAY_SIZE(addr));
1023 if (r) {
1024 dev_dbg_f(zd_chip_dev(chip), "error %d zd_ioread16v_locked\n",
1025 r);
1026 return;
1027 }
1028
1029 dev_dbg_f(zd_chip_dev(chip), "FW_FIRMWARE_VER %#06hx\n", values[0]);
1030 dev_dbg_f(zd_chip_dev(chip), "FW_USB_SPEED %#06hx\n", values[1]);
1031 dev_dbg_f(zd_chip_dev(chip), "FW_FIX_TX_RATE %#06hx\n", values[2]);
1032 dev_dbg_f(zd_chip_dev(chip), "FW_LINK_STATUS %#06hx\n", values[3]);
1033}
1034#endif /* DEBUG */
1035
1036static int print_fw_version(struct zd_chip *chip)
1037{
1038 int r;
1039 u16 version;
1040
1041 r = zd_ioread16_locked(chip, &version, FW_FIRMWARE_VER);
1042 if (r)
1043 return r;
1044
1045 dev_info(zd_chip_dev(chip),"firmware version %04hx\n", version);
1046 return 0;
1047}
1048
1049static int set_mandatory_rates(struct zd_chip *chip, enum ieee80211_std std)
1050{
1051 u32 rates;
1052 ZD_ASSERT(mutex_is_locked(&chip->mutex));
1053 /* This sets the mandatory rates, which only depend from the standard
1054 * that the device is supporting. Until further notice we should try
1055 * to support 802.11g also for full speed USB.
1056 */
1057 switch (std) {
1058 case IEEE80211B:
1059 rates = CR_RATE_1M|CR_RATE_2M|CR_RATE_5_5M|CR_RATE_11M;
1060 break;
1061 case IEEE80211G:
1062 rates = CR_RATE_1M|CR_RATE_2M|CR_RATE_5_5M|CR_RATE_11M|
1063 CR_RATE_6M|CR_RATE_12M|CR_RATE_24M;
1064 break;
1065 default:
1066 return -EINVAL;
1067 }
1068 return zd_iowrite32_locked(chip, rates, CR_MANDATORY_RATE_TBL);
1069}
1070
1071int zd_chip_enable_hwint(struct zd_chip *chip)
1072{
1073 int r;
1074
1075 mutex_lock(&chip->mutex);
1076 r = zd_iowrite32_locked(chip, HWINT_ENABLED, CR_INTERRUPT);
1077 mutex_unlock(&chip->mutex);
1078 return r;
1079}
1080
1081static int disable_hwint(struct zd_chip *chip)
1082{
1083 return zd_iowrite32_locked(chip, HWINT_DISABLED, CR_INTERRUPT);
1084}
1085
1086int zd_chip_disable_hwint(struct zd_chip *chip)
1087{
1088 int r;
1089
1090 mutex_lock(&chip->mutex);
1091 r = disable_hwint(chip);
1092 mutex_unlock(&chip->mutex);
1093 return r;
1094}
1095
1096int zd_chip_init_hw(struct zd_chip *chip, u8 device_type)
1097{
1098 int r;
1099 u8 rf_type;
1100
1101 dev_dbg_f(zd_chip_dev(chip), "\n");
1102
1103 mutex_lock(&chip->mutex);
1104 chip->is_zd1211b = (device_type == DEVICE_ZD1211B) != 0;
1105
1106#ifdef DEBUG
1107 r = test_init(chip);
1108 if (r)
1109 goto out;
1110#endif
1111 r = zd_iowrite32_locked(chip, 1, CR_AFTER_PNP);
1112 if (r)
1113 goto out;
1114
1115 r = zd_usb_init_hw(&chip->usb);
1116 if (r)
1117 goto out;
1118
1119 /* GPI is always disabled, also in the other driver.
1120 */
1121 r = zd_iowrite32_locked(chip, 0, CR_GPI_EN);
1122 if (r)
1123 goto out;
1124 r = zd_iowrite32_locked(chip, CWIN_SIZE, CR_CWMIN_CWMAX);
1125 if (r)
1126 goto out;
1127 /* Currently we support IEEE 802.11g for full and high speed USB.
1128 * It might be discussed, whether we should suppport pure b mode for
1129 * full speed USB.
1130 */
1131 r = set_mandatory_rates(chip, IEEE80211G);
1132 if (r)
1133 goto out;
1134 /* Disabling interrupts is certainly a smart thing here.
1135 */
1136 r = disable_hwint(chip);
1137 if (r)
1138 goto out;
1139 r = read_pod(chip, &rf_type);
1140 if (r)
1141 goto out;
1142 r = hw_init(chip);
1143 if (r)
1144 goto out;
1145 r = zd_rf_init_hw(&chip->rf, rf_type);
1146 if (r)
1147 goto out;
1148
1149 r = print_fw_version(chip);
1150 if (r)
1151 goto out;
1152
1153#ifdef DEBUG
1154 dump_fw_registers(chip);
1155 r = test_init(chip);
1156 if (r)
1157 goto out;
1158#endif /* DEBUG */
1159
1160 r = read_e2p_mac_addr(chip);
1161 if (r)
1162 goto out;
1163
1164 r = read_cal_int_tables(chip);
1165 if (r)
1166 goto out;
1167
1168 print_id(chip);
1169out:
1170 mutex_unlock(&chip->mutex);
1171 return r;
1172}
1173
1174static int update_pwr_int(struct zd_chip *chip, u8 channel)
1175{
1176 u8 value = chip->pwr_int_values[channel - 1];
1177 dev_dbg_f(zd_chip_dev(chip), "channel %d pwr_int %#04x\n",
1178 channel, value);
1179 return zd_iowrite32_locked(chip, value, CR31);
1180}
1181
1182static int update_pwr_cal(struct zd_chip *chip, u8 channel)
1183{
1184 u8 value = chip->pwr_cal_values[channel-1];
1185 dev_dbg_f(zd_chip_dev(chip), "channel %d pwr_cal %#04x\n",
1186 channel, value);
1187 return zd_iowrite32_locked(chip, value, CR68);
1188}
1189
1190static int update_ofdm_cal(struct zd_chip *chip, u8 channel)
1191{
1192 struct zd_ioreq32 ioreqs[3];
1193
1194 ioreqs[0].addr = CR67;
1195 ioreqs[0].value = chip->ofdm_cal_values[OFDM_36M_INDEX][channel-1];
1196 ioreqs[1].addr = CR66;
1197 ioreqs[1].value = chip->ofdm_cal_values[OFDM_48M_INDEX][channel-1];
1198 ioreqs[2].addr = CR65;
1199 ioreqs[2].value = chip->ofdm_cal_values[OFDM_54M_INDEX][channel-1];
1200
1201 dev_dbg_f(zd_chip_dev(chip),
1202 "channel %d ofdm_cal 36M %#04x 48M %#04x 54M %#04x\n",
1203 channel, ioreqs[0].value, ioreqs[1].value, ioreqs[2].value);
1204 return zd_iowrite32a_locked(chip, ioreqs, ARRAY_SIZE(ioreqs));
1205}
1206
1207static int update_channel_integration_and_calibration(struct zd_chip *chip,
1208 u8 channel)
1209{
1210 int r;
1211
1212 r = update_pwr_int(chip, channel);
1213 if (r)
1214 return r;
1215 if (chip->is_zd1211b) {
1216 static const struct zd_ioreq32 ioreqs[] = {
1217 { CR69, 0x28 },
1218 {},
1219 { CR69, 0x2a },
1220 };
1221
1222 r = update_ofdm_cal(chip, channel);
1223 if (r)
1224 return r;
1225 r = update_pwr_cal(chip, channel);
1226 if (r)
1227 return r;
1228 r = zd_iowrite32a_locked(chip, ioreqs, ARRAY_SIZE(ioreqs));
1229 if (r)
1230 return r;
1231 }
1232
1233 return 0;
1234}
1235
1236/* The CCK baseband gain can be optionally patched by the EEPROM */
1237static int patch_cck_gain(struct zd_chip *chip)
1238{
1239 int r;
1240 u32 value;
1241
1242 if (!chip->patch_cck_gain)
1243 return 0;
1244
1245 ZD_ASSERT(mutex_is_locked(&chip->mutex));
1246 r = zd_ioread32_locked(chip, &value, E2P_PHY_REG);
1247 if (r)
1248 return r;
1249 dev_dbg_f(zd_chip_dev(chip), "patching value %x\n", value & 0xff);
1250 return zd_iowrite32_locked(chip, value & 0xff, CR47);
1251}
1252
1253int zd_chip_set_channel(struct zd_chip *chip, u8 channel)
1254{
1255 int r, t;
1256
1257 mutex_lock(&chip->mutex);
1258 r = zd_chip_lock_phy_regs(chip);
1259 if (r)
1260 goto out;
1261 r = zd_rf_set_channel(&chip->rf, channel);
1262 if (r)
1263 goto unlock;
1264 r = update_channel_integration_and_calibration(chip, channel);
1265 if (r)
1266 goto unlock;
1267 r = patch_cck_gain(chip);
1268 if (r)
1269 goto unlock;
1270 r = patch_6m_band_edge(chip, channel);
1271 if (r)
1272 goto unlock;
1273 r = zd_iowrite32_locked(chip, 0, CR_CONFIG_PHILIPS);
1274unlock:
1275 t = zd_chip_unlock_phy_regs(chip);
1276 if (t && !r)
1277 r = t;
1278out:
1279 mutex_unlock(&chip->mutex);
1280 return r;
1281}
1282
1283u8 zd_chip_get_channel(struct zd_chip *chip)
1284{
1285 u8 channel;
1286
1287 mutex_lock(&chip->mutex);
1288 channel = chip->rf.channel;
1289 mutex_unlock(&chip->mutex);
1290 return channel;
1291}
1292
1293static u16 led_mask(int led)
1294{
1295 switch (led) {
1296 case 1:
1297 return LED1;
1298 case 2:
1299 return LED2;
1300 default:
1301 return 0;
1302 }
1303}
1304
1305static int read_led_reg(struct zd_chip *chip, u16 *status)
1306{
1307 ZD_ASSERT(mutex_is_locked(&chip->mutex));
1308 return zd_ioread16_locked(chip, status, CR_LED);
1309}
1310
1311static int write_led_reg(struct zd_chip *chip, u16 status)
1312{
1313 ZD_ASSERT(mutex_is_locked(&chip->mutex));
1314 return zd_iowrite16_locked(chip, status, CR_LED);
1315}
1316
1317int zd_chip_led_status(struct zd_chip *chip, int led, enum led_status status)
1318{
1319 int r, ret;
1320 u16 mask = led_mask(led);
1321 u16 reg;
1322
1323 if (!mask)
1324 return -EINVAL;
1325 mutex_lock(&chip->mutex);
1326 r = read_led_reg(chip, &reg);
1327 if (r)
1328 return r;
1329 switch (status) {
1330 case LED_STATUS:
1331 return (reg & mask) ? LED_ON : LED_OFF;
1332 case LED_OFF:
1333 reg &= ~mask;
1334 ret = LED_OFF;
1335 break;
1336 case LED_FLIP:
1337 reg ^= mask;
1338 ret = (reg&mask) ? LED_ON : LED_OFF;
1339 break;
1340 case LED_ON:
1341 reg |= mask;
1342 ret = LED_ON;
1343 break;
1344 default:
1345 return -EINVAL;
1346 }
1347 r = write_led_reg(chip, reg);
1348 if (r) {
1349 ret = r;
1350 goto out;
1351 }
1352out:
1353 mutex_unlock(&chip->mutex);
1354 return r;
1355}
1356
1357int zd_chip_led_flip(struct zd_chip *chip, int led,
1358 const unsigned int *phases_msecs, unsigned int count)
1359{
1360 int i, r;
1361 enum led_status status;
1362
1363 r = zd_chip_led_status(chip, led, LED_STATUS);
1364 if (r)
1365 return r;
1366 status = r;
1367 for (i = 0; i < count; i++) {
1368 r = zd_chip_led_status(chip, led, LED_FLIP);
1369 if (r < 0)
1370 goto out;
1371 msleep(phases_msecs[i]);
1372 }
1373
1374out:
1375 zd_chip_led_status(chip, led, status);
1376 return r;
1377}
1378
1379int zd_chip_set_basic_rates(struct zd_chip *chip, u16 cr_rates)
1380{
1381 int r;
1382
1383 if (cr_rates & ~(CR_RATES_80211B|CR_RATES_80211G))
1384 return -EINVAL;
1385
1386 mutex_lock(&chip->mutex);
1387 r = zd_iowrite32_locked(chip, cr_rates, CR_BASIC_RATE_TBL);
1388 mutex_unlock(&chip->mutex);
1389 return r;
1390}
1391
1392static int ofdm_qual_db(u8 status_quality, u8 rate, unsigned int size)
1393{
1394 static const u16 constants[] = {
1395 715, 655, 585, 540, 470, 410, 360, 315,
1396 270, 235, 205, 175, 150, 125, 105, 85,
1397 65, 50, 40, 25, 15
1398 };
1399
1400 int i;
1401 u32 x;
1402
1403 /* It seems that their quality parameter is somehow per signal
1404 * and is now transferred per bit.
1405 */
1406 switch (rate) {
1407 case ZD_OFDM_RATE_6M:
1408 case ZD_OFDM_RATE_12M:
1409 case ZD_OFDM_RATE_24M:
1410 size *= 2;
1411 break;
1412 case ZD_OFDM_RATE_9M:
1413 case ZD_OFDM_RATE_18M:
1414 case ZD_OFDM_RATE_36M:
1415 case ZD_OFDM_RATE_54M:
1416 size *= 4;
1417 size /= 3;
1418 break;
1419 case ZD_OFDM_RATE_48M:
1420 size *= 3;
1421 size /= 2;
1422 break;
1423 default:
1424 return -EINVAL;
1425 }
1426
1427 x = (10000 * status_quality)/size;
1428 for (i = 0; i < ARRAY_SIZE(constants); i++) {
1429 if (x > constants[i])
1430 break;
1431 }
1432
1433 return i;
1434}
1435
1436static unsigned int log10times100(unsigned int x)
1437{
1438 static const u8 log10[] = {
1439 0,
1440 0, 30, 47, 60, 69, 77, 84, 90, 95, 100,
1441 104, 107, 111, 114, 117, 120, 123, 125, 127, 130,
1442 132, 134, 136, 138, 139, 141, 143, 144, 146, 147,
1443 149, 150, 151, 153, 154, 155, 156, 157, 159, 160,
1444 161, 162, 163, 164, 165, 166, 167, 168, 169, 169,
1445 170, 171, 172, 173, 174, 174, 175, 176, 177, 177,
1446 178, 179, 179, 180, 181, 181, 182, 183, 183, 184,
1447 185, 185, 186, 186, 187, 188, 188, 189, 189, 190,
1448 190, 191, 191, 192, 192, 193, 193, 194, 194, 195,
1449 195, 196, 196, 197, 197, 198, 198, 199, 199, 200,
1450 200, 200, 201, 201, 202, 202, 202, 203, 203, 204,
1451 204, 204, 205, 205, 206, 206, 206, 207, 207, 207,
1452 208, 208, 208, 209, 209, 210, 210, 210, 211, 211,
1453 211, 212, 212, 212, 213, 213, 213, 213, 214, 214,
1454 214, 215, 215, 215, 216, 216, 216, 217, 217, 217,
1455 217, 218, 218, 218, 219, 219, 219, 219, 220, 220,
1456 220, 220, 221, 221, 221, 222, 222, 222, 222, 223,
1457 223, 223, 223, 224, 224, 224, 224,
1458 };
1459
1460 return x < ARRAY_SIZE(log10) ? log10[x] : 225;
1461}
1462
1463enum {
1464 MAX_CCK_EVM_DB = 45,
1465};
1466
1467static int cck_evm_db(u8 status_quality)
1468{
1469 return (20 * log10times100(status_quality)) / 100;
1470}
1471
1472static int cck_snr_db(u8 status_quality)
1473{
1474 int r = MAX_CCK_EVM_DB - cck_evm_db(status_quality);
1475 ZD_ASSERT(r >= 0);
1476 return r;
1477}
1478
1479static int rx_qual_db(const void *rx_frame, unsigned int size,
1480 const struct rx_status *status)
1481{
1482 return (status->frame_status&ZD_RX_OFDM) ?
1483 ofdm_qual_db(status->signal_quality_ofdm,
1484 zd_ofdm_plcp_header_rate(rx_frame),
1485 size) :
1486 cck_snr_db(status->signal_quality_cck);
1487}
1488
1489u8 zd_rx_qual_percent(const void *rx_frame, unsigned int size,
1490 const struct rx_status *status)
1491{
1492 int r = rx_qual_db(rx_frame, size, status);
1493 if (r < 0)
1494 r = 0;
1495 r = (r * 100) / 14;
1496 if (r > 100)
1497 r = 100;
1498 return r;
1499}
1500
1501u8 zd_rx_strength_percent(u8 rssi)
1502{
1503 int r = (rssi*100) / 30;
1504 if (r > 100)
1505 r = 100;
1506 return (u8) r;
1507}
1508
1509u16 zd_rx_rate(const void *rx_frame, const struct rx_status *status)
1510{
1511 static const u16 ofdm_rates[] = {
1512 [ZD_OFDM_RATE_6M] = 60,
1513 [ZD_OFDM_RATE_9M] = 90,
1514 [ZD_OFDM_RATE_12M] = 120,
1515 [ZD_OFDM_RATE_18M] = 180,
1516 [ZD_OFDM_RATE_24M] = 240,
1517 [ZD_OFDM_RATE_36M] = 360,
1518 [ZD_OFDM_RATE_48M] = 480,
1519 [ZD_OFDM_RATE_54M] = 540,
1520 };
1521 u16 rate;
1522 if (status->frame_status & ZD_RX_OFDM) {
1523 u8 ofdm_rate = zd_ofdm_plcp_header_rate(rx_frame);
1524 rate = ofdm_rates[ofdm_rate & 0xf];
1525 } else {
1526 u8 cck_rate = zd_cck_plcp_header_rate(rx_frame);
1527 switch (cck_rate) {
1528 case ZD_CCK_SIGNAL_1M:
1529 rate = 10;
1530 break;
1531 case ZD_CCK_SIGNAL_2M:
1532 rate = 20;
1533 break;
1534 case ZD_CCK_SIGNAL_5M5:
1535 rate = 55;
1536 break;
1537 case ZD_CCK_SIGNAL_11M:
1538 rate = 110;
1539 break;
1540 default:
1541 rate = 0;
1542 }
1543 }
1544
1545 return rate;
1546}
1547
1548int zd_chip_switch_radio_on(struct zd_chip *chip)
1549{
1550 int r;
1551
1552 mutex_lock(&chip->mutex);
1553 r = zd_switch_radio_on(&chip->rf);
1554 mutex_unlock(&chip->mutex);
1555 return r;
1556}
1557
1558int zd_chip_switch_radio_off(struct zd_chip *chip)
1559{
1560 int r;
1561
1562 mutex_lock(&chip->mutex);
1563 r = zd_switch_radio_off(&chip->rf);
1564 mutex_unlock(&chip->mutex);
1565 return r;
1566}
1567
1568int zd_chip_enable_int(struct zd_chip *chip)
1569{
1570 int r;
1571
1572 mutex_lock(&chip->mutex);
1573 r = zd_usb_enable_int(&chip->usb);
1574 mutex_unlock(&chip->mutex);
1575 return r;
1576}
1577
1578void zd_chip_disable_int(struct zd_chip *chip)
1579{
1580 mutex_lock(&chip->mutex);
1581 zd_usb_disable_int(&chip->usb);
1582 mutex_unlock(&chip->mutex);
1583}
1584
1585int zd_chip_enable_rx(struct zd_chip *chip)
1586{
1587 int r;
1588
1589 mutex_lock(&chip->mutex);
1590 r = zd_usb_enable_rx(&chip->usb);
1591 mutex_unlock(&chip->mutex);
1592 return r;
1593}
1594
1595void zd_chip_disable_rx(struct zd_chip *chip)
1596{
1597 mutex_lock(&chip->mutex);
1598 zd_usb_disable_rx(&chip->usb);
1599 mutex_unlock(&chip->mutex);
1600}
1601
1602int zd_rfwritev_locked(struct zd_chip *chip,
1603 const u32* values, unsigned int count, u8 bits)
1604{
1605 int r;
1606 unsigned int i;
1607
1608 for (i = 0; i < count; i++) {
1609 r = zd_rfwrite_locked(chip, values[i], bits);
1610 if (r)
1611 return r;
1612 }
1613
1614 return 0;
1615}
diff --git a/drivers/net/wireless/zd1211rw/zd_chip.h b/drivers/net/wireless/zd1211rw/zd_chip.h
new file mode 100644
index 000000000000..069d2b467339
--- /dev/null
+++ b/drivers/net/wireless/zd1211rw/zd_chip.h
@@ -0,0 +1,827 @@
1/* zd_chip.h
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 */
17
18#ifndef _ZD_CHIP_H
19#define _ZD_CHIP_H
20
21#include "zd_types.h"
22#include "zd_rf.h"
23#include "zd_usb.h"
24
25/* Header for the Media Access Controller (MAC) and the Baseband Processor
26 * (BBP). It appears that the ZD1211 wraps the old ZD1205 with USB glue and
27 * adds a processor for handling the USB protocol.
28 */
29
30/* 8-bit hardware registers */
31#define CR0 CTL_REG(0x0000)
32#define CR1 CTL_REG(0x0004)
33#define CR2 CTL_REG(0x0008)
34#define CR3 CTL_REG(0x000C)
35
36#define CR5 CTL_REG(0x0010)
37/* bit 5: if set short preamble used
38 * bit 6: filter band - Japan channel 14 on, else off
39 */
40#define CR6 CTL_REG(0x0014)
41#define CR7 CTL_REG(0x0018)
42#define CR8 CTL_REG(0x001C)
43
44#define CR4 CTL_REG(0x0020)
45
46#define CR9 CTL_REG(0x0024)
47/* bit 2: antenna switch (together with CR10) */
48#define CR10 CTL_REG(0x0028)
49/* bit 1: antenna switch (together with CR9)
50 * RF2959 controls with CR11 radion on and off
51 */
52#define CR11 CTL_REG(0x002C)
53/* bit 6: TX power control for OFDM
54 * RF2959 controls with CR10 radio on and off
55 */
56#define CR12 CTL_REG(0x0030)
57#define CR13 CTL_REG(0x0034)
58#define CR14 CTL_REG(0x0038)
59#define CR15 CTL_REG(0x003C)
60#define CR16 CTL_REG(0x0040)
61#define CR17 CTL_REG(0x0044)
62#define CR18 CTL_REG(0x0048)
63#define CR19 CTL_REG(0x004C)
64#define CR20 CTL_REG(0x0050)
65#define CR21 CTL_REG(0x0054)
66#define CR22 CTL_REG(0x0058)
67#define CR23 CTL_REG(0x005C)
68#define CR24 CTL_REG(0x0060) /* CCA threshold */
69#define CR25 CTL_REG(0x0064)
70#define CR26 CTL_REG(0x0068)
71#define CR27 CTL_REG(0x006C)
72#define CR28 CTL_REG(0x0070)
73#define CR29 CTL_REG(0x0074)
74#define CR30 CTL_REG(0x0078)
75#define CR31 CTL_REG(0x007C) /* TX power control for RF in CCK mode */
76#define CR32 CTL_REG(0x0080)
77#define CR33 CTL_REG(0x0084)
78#define CR34 CTL_REG(0x0088)
79#define CR35 CTL_REG(0x008C)
80#define CR36 CTL_REG(0x0090)
81#define CR37 CTL_REG(0x0094)
82#define CR38 CTL_REG(0x0098)
83#define CR39 CTL_REG(0x009C)
84#define CR40 CTL_REG(0x00A0)
85#define CR41 CTL_REG(0x00A4)
86#define CR42 CTL_REG(0x00A8)
87#define CR43 CTL_REG(0x00AC)
88#define CR44 CTL_REG(0x00B0)
89#define CR45 CTL_REG(0x00B4)
90#define CR46 CTL_REG(0x00B8)
91#define CR47 CTL_REG(0x00BC) /* CCK baseband gain
92 * (patch value might be in EEPROM)
93 */
94#define CR48 CTL_REG(0x00C0)
95#define CR49 CTL_REG(0x00C4)
96#define CR50 CTL_REG(0x00C8)
97#define CR51 CTL_REG(0x00CC) /* TX power control for RF in 6-36M modes */
98#define CR52 CTL_REG(0x00D0) /* TX power control for RF in 48M mode */
99#define CR53 CTL_REG(0x00D4) /* TX power control for RF in 54M mode */
100#define CR54 CTL_REG(0x00D8)
101#define CR55 CTL_REG(0x00DC)
102#define CR56 CTL_REG(0x00E0)
103#define CR57 CTL_REG(0x00E4)
104#define CR58 CTL_REG(0x00E8)
105#define CR59 CTL_REG(0x00EC)
106#define CR60 CTL_REG(0x00F0)
107#define CR61 CTL_REG(0x00F4)
108#define CR62 CTL_REG(0x00F8)
109#define CR63 CTL_REG(0x00FC)
110#define CR64 CTL_REG(0x0100)
111#define CR65 CTL_REG(0x0104) /* OFDM 54M calibration */
112#define CR66 CTL_REG(0x0108) /* OFDM 48M calibration */
113#define CR67 CTL_REG(0x010C) /* OFDM 36M calibration */
114#define CR68 CTL_REG(0x0110) /* CCK calibration */
115#define CR69 CTL_REG(0x0114)
116#define CR70 CTL_REG(0x0118)
117#define CR71 CTL_REG(0x011C)
118#define CR72 CTL_REG(0x0120)
119#define CR73 CTL_REG(0x0124)
120#define CR74 CTL_REG(0x0128)
121#define CR75 CTL_REG(0x012C)
122#define CR76 CTL_REG(0x0130)
123#define CR77 CTL_REG(0x0134)
124#define CR78 CTL_REG(0x0138)
125#define CR79 CTL_REG(0x013C)
126#define CR80 CTL_REG(0x0140)
127#define CR81 CTL_REG(0x0144)
128#define CR82 CTL_REG(0x0148)
129#define CR83 CTL_REG(0x014C)
130#define CR84 CTL_REG(0x0150)
131#define CR85 CTL_REG(0x0154)
132#define CR86 CTL_REG(0x0158)
133#define CR87 CTL_REG(0x015C)
134#define CR88 CTL_REG(0x0160)
135#define CR89 CTL_REG(0x0164)
136#define CR90 CTL_REG(0x0168)
137#define CR91 CTL_REG(0x016C)
138#define CR92 CTL_REG(0x0170)
139#define CR93 CTL_REG(0x0174)
140#define CR94 CTL_REG(0x0178)
141#define CR95 CTL_REG(0x017C)
142#define CR96 CTL_REG(0x0180)
143#define CR97 CTL_REG(0x0184)
144#define CR98 CTL_REG(0x0188)
145#define CR99 CTL_REG(0x018C)
146#define CR100 CTL_REG(0x0190)
147#define CR101 CTL_REG(0x0194)
148#define CR102 CTL_REG(0x0198)
149#define CR103 CTL_REG(0x019C)
150#define CR104 CTL_REG(0x01A0)
151#define CR105 CTL_REG(0x01A4)
152#define CR106 CTL_REG(0x01A8)
153#define CR107 CTL_REG(0x01AC)
154#define CR108 CTL_REG(0x01B0)
155#define CR109 CTL_REG(0x01B4)
156#define CR110 CTL_REG(0x01B8)
157#define CR111 CTL_REG(0x01BC)
158#define CR112 CTL_REG(0x01C0)
159#define CR113 CTL_REG(0x01C4)
160#define CR114 CTL_REG(0x01C8)
161#define CR115 CTL_REG(0x01CC)
162#define CR116 CTL_REG(0x01D0)
163#define CR117 CTL_REG(0x01D4)
164#define CR118 CTL_REG(0x01D8)
165#define CR119 CTL_REG(0x01DC)
166#define CR120 CTL_REG(0x01E0)
167#define CR121 CTL_REG(0x01E4)
168#define CR122 CTL_REG(0x01E8)
169#define CR123 CTL_REG(0x01EC)
170#define CR124 CTL_REG(0x01F0)
171#define CR125 CTL_REG(0x01F4)
172#define CR126 CTL_REG(0x01F8)
173#define CR127 CTL_REG(0x01FC)
174#define CR128 CTL_REG(0x0200)
175#define CR129 CTL_REG(0x0204)
176#define CR130 CTL_REG(0x0208)
177#define CR131 CTL_REG(0x020C)
178#define CR132 CTL_REG(0x0210)
179#define CR133 CTL_REG(0x0214)
180#define CR134 CTL_REG(0x0218)
181#define CR135 CTL_REG(0x021C)
182#define CR136 CTL_REG(0x0220)
183#define CR137 CTL_REG(0x0224)
184#define CR138 CTL_REG(0x0228)
185#define CR139 CTL_REG(0x022C)
186#define CR140 CTL_REG(0x0230)
187#define CR141 CTL_REG(0x0234)
188#define CR142 CTL_REG(0x0238)
189#define CR143 CTL_REG(0x023C)
190#define CR144 CTL_REG(0x0240)
191#define CR145 CTL_REG(0x0244)
192#define CR146 CTL_REG(0x0248)
193#define CR147 CTL_REG(0x024C)
194#define CR148 CTL_REG(0x0250)
195#define CR149 CTL_REG(0x0254)
196#define CR150 CTL_REG(0x0258)
197#define CR151 CTL_REG(0x025C)
198#define CR152 CTL_REG(0x0260)
199#define CR153 CTL_REG(0x0264)
200#define CR154 CTL_REG(0x0268)
201#define CR155 CTL_REG(0x026C)
202#define CR156 CTL_REG(0x0270)
203#define CR157 CTL_REG(0x0274)
204#define CR158 CTL_REG(0x0278)
205#define CR159 CTL_REG(0x027C)
206#define CR160 CTL_REG(0x0280)
207#define CR161 CTL_REG(0x0284)
208#define CR162 CTL_REG(0x0288)
209#define CR163 CTL_REG(0x028C)
210#define CR164 CTL_REG(0x0290)
211#define CR165 CTL_REG(0x0294)
212#define CR166 CTL_REG(0x0298)
213#define CR167 CTL_REG(0x029C)
214#define CR168 CTL_REG(0x02A0)
215#define CR169 CTL_REG(0x02A4)
216#define CR170 CTL_REG(0x02A8)
217#define CR171 CTL_REG(0x02AC)
218#define CR172 CTL_REG(0x02B0)
219#define CR173 CTL_REG(0x02B4)
220#define CR174 CTL_REG(0x02B8)
221#define CR175 CTL_REG(0x02BC)
222#define CR176 CTL_REG(0x02C0)
223#define CR177 CTL_REG(0x02C4)
224#define CR178 CTL_REG(0x02C8)
225#define CR179 CTL_REG(0x02CC)
226#define CR180 CTL_REG(0x02D0)
227#define CR181 CTL_REG(0x02D4)
228#define CR182 CTL_REG(0x02D8)
229#define CR183 CTL_REG(0x02DC)
230#define CR184 CTL_REG(0x02E0)
231#define CR185 CTL_REG(0x02E4)
232#define CR186 CTL_REG(0x02E8)
233#define CR187 CTL_REG(0x02EC)
234#define CR188 CTL_REG(0x02F0)
235#define CR189 CTL_REG(0x02F4)
236#define CR190 CTL_REG(0x02F8)
237#define CR191 CTL_REG(0x02FC)
238#define CR192 CTL_REG(0x0300)
239#define CR193 CTL_REG(0x0304)
240#define CR194 CTL_REG(0x0308)
241#define CR195 CTL_REG(0x030C)
242#define CR196 CTL_REG(0x0310)
243#define CR197 CTL_REG(0x0314)
244#define CR198 CTL_REG(0x0318)
245#define CR199 CTL_REG(0x031C)
246#define CR200 CTL_REG(0x0320)
247#define CR201 CTL_REG(0x0324)
248#define CR202 CTL_REG(0x0328)
249#define CR203 CTL_REG(0x032C) /* I2C bus template value & flash control */
250#define CR204 CTL_REG(0x0330)
251#define CR205 CTL_REG(0x0334)
252#define CR206 CTL_REG(0x0338)
253#define CR207 CTL_REG(0x033C)
254#define CR208 CTL_REG(0x0340)
255#define CR209 CTL_REG(0x0344)
256#define CR210 CTL_REG(0x0348)
257#define CR211 CTL_REG(0x034C)
258#define CR212 CTL_REG(0x0350)
259#define CR213 CTL_REG(0x0354)
260#define CR214 CTL_REG(0x0358)
261#define CR215 CTL_REG(0x035C)
262#define CR216 CTL_REG(0x0360)
263#define CR217 CTL_REG(0x0364)
264#define CR218 CTL_REG(0x0368)
265#define CR219 CTL_REG(0x036C)
266#define CR220 CTL_REG(0x0370)
267#define CR221 CTL_REG(0x0374)
268#define CR222 CTL_REG(0x0378)
269#define CR223 CTL_REG(0x037C)
270#define CR224 CTL_REG(0x0380)
271#define CR225 CTL_REG(0x0384)
272#define CR226 CTL_REG(0x0388)
273#define CR227 CTL_REG(0x038C)
274#define CR228 CTL_REG(0x0390)
275#define CR229 CTL_REG(0x0394)
276#define CR230 CTL_REG(0x0398)
277#define CR231 CTL_REG(0x039C)
278#define CR232 CTL_REG(0x03A0)
279#define CR233 CTL_REG(0x03A4)
280#define CR234 CTL_REG(0x03A8)
281#define CR235 CTL_REG(0x03AC)
282#define CR236 CTL_REG(0x03B0)
283
284#define CR240 CTL_REG(0x03C0)
285/* bit 7: host-controlled RF register writes
286 * CR241-CR245: for hardware controlled writing of RF bits, not needed for
287 * USB
288 */
289#define CR241 CTL_REG(0x03C4)
290#define CR242 CTL_REG(0x03C8)
291#define CR243 CTL_REG(0x03CC)
292#define CR244 CTL_REG(0x03D0)
293#define CR245 CTL_REG(0x03D4)
294
295#define CR251 CTL_REG(0x03EC) /* only used for activation and deactivation of
296 * Airoha RFs AL2230 and AL7230B
297 */
298#define CR252 CTL_REG(0x03F0)
299#define CR253 CTL_REG(0x03F4)
300#define CR254 CTL_REG(0x03F8)
301#define CR255 CTL_REG(0x03FC)
302
303#define CR_MAX_PHY_REG 255
304
305/* Taken from the ZYDAS driver, not all of them are relevant for the ZSD1211
306 * driver.
307 */
308
309#define CR_RF_IF_CLK CTL_REG(0x0400)
310#define CR_RF_IF_DATA CTL_REG(0x0404)
311#define CR_PE1_PE2 CTL_REG(0x0408)
312#define CR_PE2_DLY CTL_REG(0x040C)
313#define CR_LE1 CTL_REG(0x0410)
314#define CR_LE2 CTL_REG(0x0414)
315/* Seems to enable/disable GPI (General Purpose IO?) */
316#define CR_GPI_EN CTL_REG(0x0418)
317#define CR_RADIO_PD CTL_REG(0x042C)
318#define CR_RF2948_PD CTL_REG(0x042C)
319#define CR_ENABLE_PS_MANUAL_AGC CTL_REG(0x043C)
320#define CR_CONFIG_PHILIPS CTL_REG(0x0440)
321#define CR_SA2400_SER_AP CTL_REG(0x0444)
322#define CR_I2C_WRITE CTL_REG(0x0444)
323#define CR_SA2400_SER_RP CTL_REG(0x0448)
324#define CR_RADIO_PE CTL_REG(0x0458)
325#define CR_RST_BUS_MASTER CTL_REG(0x045C)
326#define CR_RFCFG CTL_REG(0x0464)
327#define CR_HSTSCHG CTL_REG(0x046C)
328#define CR_PHY_ON CTL_REG(0x0474)
329#define CR_RX_DELAY CTL_REG(0x0478)
330#define CR_RX_PE_DELAY CTL_REG(0x047C)
331#define CR_GPIO_1 CTL_REG(0x0490)
332#define CR_GPIO_2 CTL_REG(0x0494)
333#define CR_EncryBufMux CTL_REG(0x04A8)
334#define CR_PS_CTRL CTL_REG(0x0500)
335#define CR_ADDA_PWR_DWN CTL_REG(0x0504)
336#define CR_ADDA_MBIAS_WARMTIME CTL_REG(0x0508)
337#define CR_MAC_PS_STATE CTL_REG(0x050C)
338
339#define CR_INTERRUPT CTL_REG(0x0510)
340#define INT_TX_COMPLETE 0x00000001
341#define INT_RX_COMPLETE 0x00000002
342#define INT_RETRY_FAIL 0x00000004
343#define INT_WAKEUP 0x00000008
344#define INT_DTIM_NOTIFY 0x00000020
345#define INT_CFG_NEXT_BCN 0x00000040
346#define INT_BUS_ABORT 0x00000080
347#define INT_TX_FIFO_READY 0x00000100
348#define INT_UART 0x00000200
349#define INT_TX_COMPLETE_EN 0x00010000
350#define INT_RX_COMPLETE_EN 0x00020000
351#define INT_RETRY_FAIL_EN 0x00040000
352#define INT_WAKEUP_EN 0x00080000
353#define INT_DTIM_NOTIFY_EN 0x00200000
354#define INT_CFG_NEXT_BCN_EN 0x00400000
355#define INT_BUS_ABORT_EN 0x00800000
356#define INT_TX_FIFO_READY_EN 0x01000000
357#define INT_UART_EN 0x02000000
358
359#define CR_TSF_LOW_PART CTL_REG(0x0514)
360#define CR_TSF_HIGH_PART CTL_REG(0x0518)
361
362/* Following three values are in time units (1024us)
363 * Following condition must be met:
364 * atim < tbtt < bcn
365 */
366#define CR_ATIM_WND_PERIOD CTL_REG(0x051C)
367#define CR_BCN_INTERVAL CTL_REG(0x0520)
368#define CR_PRE_TBTT CTL_REG(0x0524)
369/* in units of TU(1024us) */
370
371/* for UART support */
372#define CR_UART_RBR_THR_DLL CTL_REG(0x0540)
373#define CR_UART_DLM_IER CTL_REG(0x0544)
374#define CR_UART_IIR_FCR CTL_REG(0x0548)
375#define CR_UART_LCR CTL_REG(0x054c)
376#define CR_UART_MCR CTL_REG(0x0550)
377#define CR_UART_LSR CTL_REG(0x0554)
378#define CR_UART_MSR CTL_REG(0x0558)
379#define CR_UART_ECR CTL_REG(0x055c)
380#define CR_UART_STATUS CTL_REG(0x0560)
381
382#define CR_PCI_TX_ADDR_P1 CTL_REG(0x0600)
383#define CR_PCI_TX_AddR_P2 CTL_REG(0x0604)
384#define CR_PCI_RX_AddR_P1 CTL_REG(0x0608)
385#define CR_PCI_RX_AddR_P2 CTL_REG(0x060C)
386
387/* must be overwritten if custom MAC address will be used */
388#define CR_MAC_ADDR_P1 CTL_REG(0x0610)
389#define CR_MAC_ADDR_P2 CTL_REG(0x0614)
390#define CR_BSSID_P1 CTL_REG(0x0618)
391#define CR_BSSID_P2 CTL_REG(0x061C)
392#define CR_BCN_PLCP_CFG CTL_REG(0x0620)
393#define CR_GROUP_HASH_P1 CTL_REG(0x0624)
394#define CR_GROUP_HASH_P2 CTL_REG(0x0628)
395#define CR_RX_TIMEOUT CTL_REG(0x062C)
396
397/* Basic rates supported by the BSS. When producing ACK or CTS messages, the
398 * device will use a rate in this table that is less than or equal to the rate
399 * of the incoming frame which prompted the response */
400#define CR_BASIC_RATE_TBL CTL_REG(0x0630)
401#define CR_RATE_1M 0x0001 /* 802.11b */
402#define CR_RATE_2M 0x0002 /* 802.11b */
403#define CR_RATE_5_5M 0x0004 /* 802.11b */
404#define CR_RATE_11M 0x0008 /* 802.11b */
405#define CR_RATE_6M 0x0100 /* 802.11g */
406#define CR_RATE_9M 0x0200 /* 802.11g */
407#define CR_RATE_12M 0x0400 /* 802.11g */
408#define CR_RATE_18M 0x0800 /* 802.11g */
409#define CR_RATE_24M 0x1000 /* 802.11g */
410#define CR_RATE_36M 0x2000 /* 802.11g */
411#define CR_RATE_48M 0x4000 /* 802.11g */
412#define CR_RATE_54M 0x8000 /* 802.11g */
413#define CR_RATES_80211G 0xff00
414#define CR_RATES_80211B 0x000f
415
416/* Mandatory rates required in the BSS. When producing ACK or CTS messages, if
417 * the device could not find an appropriate rate in CR_BASIC_RATE_TBL, it will
418 * look for a rate in this table that is less than or equal to the rate of
419 * the incoming frame. */
420#define CR_MANDATORY_RATE_TBL CTL_REG(0x0634)
421#define CR_RTS_CTS_RATE CTL_REG(0x0638)
422
423#define CR_WEP_PROTECT CTL_REG(0x063C)
424#define CR_RX_THRESHOLD CTL_REG(0x0640)
425
426/* register for controlling the LEDS */
427#define CR_LED CTL_REG(0x0644)
428/* masks for controlling LEDs */
429#define LED1 0x0100
430#define LED2 0x0200
431
432/* Seems to indicate that the configuration is over.
433 */
434#define CR_AFTER_PNP CTL_REG(0x0648)
435#define CR_ACK_TIME_80211 CTL_REG(0x0658)
436
437#define CR_RX_OFFSET CTL_REG(0x065c)
438
439#define CR_PHY_DELAY CTL_REG(0x066C)
440#define CR_BCN_FIFO CTL_REG(0x0670)
441#define CR_SNIFFER_ON CTL_REG(0x0674)
442
443#define CR_ENCRYPTION_TYPE CTL_REG(0x0678)
444#define NO_WEP 0
445#define WEP64 1
446#define WEP128 5
447#define WEP256 6
448#define ENC_SNIFFER 8
449
450#define CR_ZD1211_RETRY_MAX CTL_REG(0x067C)
451
452#define CR_REG1 CTL_REG(0x0680)
453/* Setting the bit UNLOCK_PHY_REGS disallows the write access to physical
454 * registers, so one could argue it is a LOCK bit. But calling it
455 * LOCK_PHY_REGS makes it confusing.
456 */
457#define UNLOCK_PHY_REGS 0x0080
458
459#define CR_DEVICE_STATE CTL_REG(0x0684)
460#define CR_UNDERRUN_CNT CTL_REG(0x0688)
461
462#define CR_RX_FILTER CTL_REG(0x068c)
463#define RX_FILTER_ASSOC_RESPONSE 0x0002
464#define RX_FILTER_REASSOC_RESPONSE 0x0008
465#define RX_FILTER_PROBE_RESPONSE 0x0020
466#define RX_FILTER_BEACON 0x0100
467#define RX_FILTER_DISASSOC 0x0400
468#define RX_FILTER_AUTH 0x0800
469#define AP_RX_FILTER 0x0400feff
470#define STA_RX_FILTER 0x0000ffff
471
472/* Monitor mode sets filter to 0xfffff */
473
474#define CR_ACK_TIMEOUT_EXT CTL_REG(0x0690)
475#define CR_BCN_FIFO_SEMAPHORE CTL_REG(0x0694)
476#define CR_IFS_VALUE CTL_REG(0x0698)
477#define CR_RX_TIME_OUT CTL_REG(0x069C)
478#define CR_TOTAL_RX_FRM CTL_REG(0x06A0)
479#define CR_CRC32_CNT CTL_REG(0x06A4)
480#define CR_CRC16_CNT CTL_REG(0x06A8)
481#define CR_DECRYPTION_ERR_UNI CTL_REG(0x06AC)
482#define CR_RX_FIFO_OVERRUN CTL_REG(0x06B0)
483
484#define CR_DECRYPTION_ERR_MUL CTL_REG(0x06BC)
485
486#define CR_NAV_CNT CTL_REG(0x06C4)
487#define CR_NAV_CCA CTL_REG(0x06C8)
488#define CR_RETRY_CNT CTL_REG(0x06CC)
489
490#define CR_READ_TCB_ADDR CTL_REG(0x06E8)
491#define CR_READ_RFD_ADDR CTL_REG(0x06EC)
492#define CR_CWMIN_CWMAX CTL_REG(0x06F0)
493#define CR_TOTAL_TX_FRM CTL_REG(0x06F4)
494
495/* CAM: Continuous Access Mode (power management) */
496#define CR_CAM_MODE CTL_REG(0x0700)
497#define CR_CAM_ROLL_TB_LOW CTL_REG(0x0704)
498#define CR_CAM_ROLL_TB_HIGH CTL_REG(0x0708)
499#define CR_CAM_ADDRESS CTL_REG(0x070C)
500#define CR_CAM_DATA CTL_REG(0x0710)
501
502#define CR_ROMDIR CTL_REG(0x0714)
503
504#define CR_DECRY_ERR_FLG_LOW CTL_REG(0x0714)
505#define CR_DECRY_ERR_FLG_HIGH CTL_REG(0x0718)
506
507#define CR_WEPKEY0 CTL_REG(0x0720)
508#define CR_WEPKEY1 CTL_REG(0x0724)
509#define CR_WEPKEY2 CTL_REG(0x0728)
510#define CR_WEPKEY3 CTL_REG(0x072C)
511#define CR_WEPKEY4 CTL_REG(0x0730)
512#define CR_WEPKEY5 CTL_REG(0x0734)
513#define CR_WEPKEY6 CTL_REG(0x0738)
514#define CR_WEPKEY7 CTL_REG(0x073C)
515#define CR_WEPKEY8 CTL_REG(0x0740)
516#define CR_WEPKEY9 CTL_REG(0x0744)
517#define CR_WEPKEY10 CTL_REG(0x0748)
518#define CR_WEPKEY11 CTL_REG(0x074C)
519#define CR_WEPKEY12 CTL_REG(0x0750)
520#define CR_WEPKEY13 CTL_REG(0x0754)
521#define CR_WEPKEY14 CTL_REG(0x0758)
522#define CR_WEPKEY15 CTL_REG(0x075c)
523#define CR_TKIP_MODE CTL_REG(0x0760)
524
525#define CR_EEPROM_PROTECT0 CTL_REG(0x0758)
526#define CR_EEPROM_PROTECT1 CTL_REG(0x075C)
527
528#define CR_DBG_FIFO_RD CTL_REG(0x0800)
529#define CR_DBG_SELECT CTL_REG(0x0804)
530#define CR_FIFO_Length CTL_REG(0x0808)
531
532
533#define CR_RSSI_MGC CTL_REG(0x0810)
534
535#define CR_PON CTL_REG(0x0818)
536#define CR_RX_ON CTL_REG(0x081C)
537#define CR_TX_ON CTL_REG(0x0820)
538#define CR_CHIP_EN CTL_REG(0x0824)
539#define CR_LO_SW CTL_REG(0x0828)
540#define CR_TXRX_SW CTL_REG(0x082C)
541#define CR_S_MD CTL_REG(0x0830)
542
543#define CR_USB_DEBUG_PORT CTL_REG(0x0888)
544
545#define CR_ZD1211B_TX_PWR_CTL1 CTL_REG(0x0b00)
546#define CR_ZD1211B_TX_PWR_CTL2 CTL_REG(0x0b04)
547#define CR_ZD1211B_TX_PWR_CTL3 CTL_REG(0x0b08)
548#define CR_ZD1211B_TX_PWR_CTL4 CTL_REG(0x0b0c)
549#define CR_ZD1211B_AIFS_CTL1 CTL_REG(0x0b10)
550#define CR_ZD1211B_AIFS_CTL2 CTL_REG(0x0b14)
551#define CR_ZD1211B_TXOP CTL_REG(0x0b20)
552#define CR_ZD1211B_RETRY_MAX CTL_REG(0x0b28)
553
554#define CWIN_SIZE 0x007f043f
555
556
557#define HWINT_ENABLED 0x004f0000
558#define HWINT_DISABLED 0
559
560#define E2P_PWR_INT_GUARD 8
561#define E2P_CHANNEL_COUNT 14
562
563/* If you compare this addresses with the ZYDAS orignal driver, please notify
564 * that we use word mapping for the EEPROM.
565 */
566
567/*
568 * Upper 16 bit contains the regulatory domain.
569 */
570#define E2P_SUBID E2P_REG(0x00)
571#define E2P_POD E2P_REG(0x02)
572#define E2P_MAC_ADDR_P1 E2P_REG(0x04)
573#define E2P_MAC_ADDR_P2 E2P_REG(0x06)
574#define E2P_PWR_CAL_VALUE1 E2P_REG(0x08)
575#define E2P_PWR_CAL_VALUE2 E2P_REG(0x0a)
576#define E2P_PWR_CAL_VALUE3 E2P_REG(0x0c)
577#define E2P_PWR_CAL_VALUE4 E2P_REG(0x0e)
578#define E2P_PWR_INT_VALUE1 E2P_REG(0x10)
579#define E2P_PWR_INT_VALUE2 E2P_REG(0x12)
580#define E2P_PWR_INT_VALUE3 E2P_REG(0x14)
581#define E2P_PWR_INT_VALUE4 E2P_REG(0x16)
582
583/* Contains a bit for each allowed channel. It gives for Europe (ETSI 0x30)
584 * also only 11 channels. */
585#define E2P_ALLOWED_CHANNEL E2P_REG(0x18)
586
587#define E2P_PHY_REG E2P_REG(0x1a)
588#define E2P_DEVICE_VER E2P_REG(0x20)
589#define E2P_36M_CAL_VALUE1 E2P_REG(0x28)
590#define E2P_36M_CAL_VALUE2 E2P_REG(0x2a)
591#define E2P_36M_CAL_VALUE3 E2P_REG(0x2c)
592#define E2P_36M_CAL_VALUE4 E2P_REG(0x2e)
593#define E2P_11A_INT_VALUE1 E2P_REG(0x30)
594#define E2P_11A_INT_VALUE2 E2P_REG(0x32)
595#define E2P_11A_INT_VALUE3 E2P_REG(0x34)
596#define E2P_11A_INT_VALUE4 E2P_REG(0x36)
597#define E2P_48M_CAL_VALUE1 E2P_REG(0x38)
598#define E2P_48M_CAL_VALUE2 E2P_REG(0x3a)
599#define E2P_48M_CAL_VALUE3 E2P_REG(0x3c)
600#define E2P_48M_CAL_VALUE4 E2P_REG(0x3e)
601#define E2P_48M_INT_VALUE1 E2P_REG(0x40)
602#define E2P_48M_INT_VALUE2 E2P_REG(0x42)
603#define E2P_48M_INT_VALUE3 E2P_REG(0x44)
604#define E2P_48M_INT_VALUE4 E2P_REG(0x46)
605#define E2P_54M_CAL_VALUE1 E2P_REG(0x48) /* ??? */
606#define E2P_54M_CAL_VALUE2 E2P_REG(0x4a)
607#define E2P_54M_CAL_VALUE3 E2P_REG(0x4c)
608#define E2P_54M_CAL_VALUE4 E2P_REG(0x4e)
609#define E2P_54M_INT_VALUE1 E2P_REG(0x50)
610#define E2P_54M_INT_VALUE2 E2P_REG(0x52)
611#define E2P_54M_INT_VALUE3 E2P_REG(0x54)
612#define E2P_54M_INT_VALUE4 E2P_REG(0x56)
613
614/* All 16 bit values */
615#define FW_FIRMWARE_VER FW_REG(0)
616/* non-zero if USB high speed connection */
617#define FW_USB_SPEED FW_REG(1)
618#define FW_FIX_TX_RATE FW_REG(2)
619/* Seems to be able to control LEDs over the firmware */
620#define FW_LINK_STATUS FW_REG(3)
621#define FW_SOFT_RESET FW_REG(4)
622#define FW_FLASH_CHK FW_REG(5)
623
624enum {
625 CR_BASE_OFFSET = 0x9000,
626 FW_START_OFFSET = 0xee00,
627 FW_BASE_ADDR_OFFSET = FW_START_OFFSET + 0x1d,
628 EEPROM_START_OFFSET = 0xf800,
629 EEPROM_SIZE = 0x800, /* words */
630 LOAD_CODE_SIZE = 0xe, /* words */
631 LOAD_VECT_SIZE = 0x10000 - 0xfff7, /* words */
632 EEPROM_REGS_OFFSET = LOAD_CODE_SIZE + LOAD_VECT_SIZE,
633 E2P_BASE_OFFSET = EEPROM_START_OFFSET +
634 EEPROM_REGS_OFFSET,
635};
636
637#define FW_REG_TABLE_ADDR USB_ADDR(FW_START_OFFSET + 0x1d)
638
639enum {
640 /* indices for ofdm_cal_values */
641 OFDM_36M_INDEX = 0,
642 OFDM_48M_INDEX = 1,
643 OFDM_54M_INDEX = 2,
644};
645
646struct zd_chip {
647 struct zd_usb usb;
648 struct zd_rf rf;
649 struct mutex mutex;
650 u8 e2p_mac[ETH_ALEN];
651 /* EepSetPoint in the vendor driver */
652 u8 pwr_cal_values[E2P_CHANNEL_COUNT];
653 /* integration values in the vendor driver */
654 u8 pwr_int_values[E2P_CHANNEL_COUNT];
655 /* SetPointOFDM in the vendor driver */
656 u8 ofdm_cal_values[3][E2P_CHANNEL_COUNT];
657 u8 pa_type:4, patch_cck_gain:1, patch_cr157:1, patch_6m_band_edge:1,
658 is_zd1211b:1;
659};
660
661static inline struct zd_chip *zd_usb_to_chip(struct zd_usb *usb)
662{
663 return container_of(usb, struct zd_chip, usb);
664}
665
666static inline struct zd_chip *zd_rf_to_chip(struct zd_rf *rf)
667{
668 return container_of(rf, struct zd_chip, rf);
669}
670
671#define zd_chip_dev(chip) (&(chip)->usb.intf->dev)
672
673void zd_chip_init(struct zd_chip *chip,
674 struct net_device *netdev,
675 struct usb_interface *intf);
676void zd_chip_clear(struct zd_chip *chip);
677int zd_chip_init_hw(struct zd_chip *chip, u8 device_type);
678int zd_chip_reset(struct zd_chip *chip);
679
680static inline int zd_ioread16v_locked(struct zd_chip *chip, u16 *values,
681 const zd_addr_t *addresses,
682 unsigned int count)
683{
684 ZD_ASSERT(mutex_is_locked(&chip->mutex));
685 return zd_usb_ioread16v(&chip->usb, values, addresses, count);
686}
687
688static inline int zd_ioread16_locked(struct zd_chip *chip, u16 *value,
689 const zd_addr_t addr)
690{
691 ZD_ASSERT(mutex_is_locked(&chip->mutex));
692 return zd_usb_ioread16(&chip->usb, value, addr);
693}
694
695int zd_ioread32v_locked(struct zd_chip *chip, u32 *values,
696 const zd_addr_t *addresses, unsigned int count);
697
698static inline int zd_ioread32_locked(struct zd_chip *chip, u32 *value,
699 const zd_addr_t addr)
700{
701 return zd_ioread32v_locked(chip, value, (const zd_addr_t *)&addr, 1);
702}
703
704static inline int zd_iowrite16_locked(struct zd_chip *chip, u16 value,
705 zd_addr_t addr)
706{
707 struct zd_ioreq16 ioreq;
708
709 ZD_ASSERT(mutex_is_locked(&chip->mutex));
710 ioreq.addr = addr;
711 ioreq.value = value;
712
713 return zd_usb_iowrite16v(&chip->usb, &ioreq, 1);
714}
715
716int zd_iowrite16a_locked(struct zd_chip *chip,
717 const struct zd_ioreq16 *ioreqs, unsigned int count);
718
719int _zd_iowrite32v_locked(struct zd_chip *chip, const struct zd_ioreq32 *ioreqs,
720 unsigned int count);
721
722static inline int zd_iowrite32_locked(struct zd_chip *chip, u32 value,
723 zd_addr_t addr)
724{
725 struct zd_ioreq32 ioreq;
726
727 ioreq.addr = addr;
728 ioreq.value = value;
729
730 return _zd_iowrite32v_locked(chip, &ioreq, 1);
731}
732
733int zd_iowrite32a_locked(struct zd_chip *chip,
734 const struct zd_ioreq32 *ioreqs, unsigned int count);
735
736static inline int zd_rfwrite_locked(struct zd_chip *chip, u32 value, u8 bits)
737{
738 ZD_ASSERT(mutex_is_locked(&chip->mutex));
739 return zd_usb_rfwrite(&chip->usb, value, bits);
740}
741
742int zd_rfwritev_locked(struct zd_chip *chip,
743 const u32* values, unsigned int count, u8 bits);
744
745/* Locking functions for reading and writing registers.
746 * The different parameters are intentional.
747 */
748int zd_ioread16(struct zd_chip *chip, zd_addr_t addr, u16 *value);
749int zd_iowrite16(struct zd_chip *chip, zd_addr_t addr, u16 value);
750int zd_ioread32(struct zd_chip *chip, zd_addr_t addr, u32 *value);
751int zd_iowrite32(struct zd_chip *chip, zd_addr_t addr, u32 value);
752int zd_ioread32v(struct zd_chip *chip, const zd_addr_t *addresses,
753 u32 *values, unsigned int count);
754int zd_iowrite32a(struct zd_chip *chip, const struct zd_ioreq32 *ioreqs,
755 unsigned int count);
756
757int zd_chip_set_channel(struct zd_chip *chip, u8 channel);
758static inline u8 _zd_chip_get_channel(struct zd_chip *chip)
759{
760 return chip->rf.channel;
761}
762u8 zd_chip_get_channel(struct zd_chip *chip);
763int zd_read_regdomain(struct zd_chip *chip, u8 *regdomain);
764void zd_get_e2p_mac_addr(struct zd_chip *chip, u8 *mac_addr);
765int zd_read_mac_addr(struct zd_chip *chip, u8 *mac_addr);
766int zd_write_mac_addr(struct zd_chip *chip, const u8 *mac_addr);
767int zd_chip_switch_radio_on(struct zd_chip *chip);
768int zd_chip_switch_radio_off(struct zd_chip *chip);
769int zd_chip_enable_int(struct zd_chip *chip);
770void zd_chip_disable_int(struct zd_chip *chip);
771int zd_chip_enable_rx(struct zd_chip *chip);
772void zd_chip_disable_rx(struct zd_chip *chip);
773int zd_chip_enable_hwint(struct zd_chip *chip);
774int zd_chip_disable_hwint(struct zd_chip *chip);
775
776static inline int zd_get_encryption_type(struct zd_chip *chip, u32 *type)
777{
778 return zd_ioread32(chip, CR_ENCRYPTION_TYPE, type);
779}
780
781static inline int zd_set_encryption_type(struct zd_chip *chip, u32 type)
782{
783 return zd_iowrite32(chip, CR_ENCRYPTION_TYPE, type);
784}
785
786static inline int zd_chip_get_basic_rates(struct zd_chip *chip, u16 *cr_rates)
787{
788 return zd_ioread16(chip, CR_BASIC_RATE_TBL, cr_rates);
789}
790
791int zd_chip_set_basic_rates(struct zd_chip *chip, u16 cr_rates);
792
793static inline int zd_chip_set_rx_filter(struct zd_chip *chip, u32 filter)
794{
795 return zd_iowrite32(chip, CR_RX_FILTER, filter);
796}
797
798int zd_chip_lock_phy_regs(struct zd_chip *chip);
799int zd_chip_unlock_phy_regs(struct zd_chip *chip);
800
801enum led_status {
802 LED_OFF = 0,
803 LED_ON = 1,
804 LED_FLIP = 2,
805 LED_STATUS = 3,
806};
807
808int zd_chip_led_status(struct zd_chip *chip, int led, enum led_status status);
809int zd_chip_led_flip(struct zd_chip *chip, int led,
810 const unsigned int *phases_msecs, unsigned int count);
811
812int zd_set_beacon_interval(struct zd_chip *chip, u32 interval);
813
814static inline int zd_get_beacon_interval(struct zd_chip *chip, u32 *interval)
815{
816 return zd_ioread32(chip, CR_BCN_INTERVAL, interval);
817}
818
819struct rx_status;
820
821u8 zd_rx_qual_percent(const void *rx_frame, unsigned int size,
822 const struct rx_status *status);
823u8 zd_rx_strength_percent(u8 rssi);
824
825u16 zd_rx_rate(const void *rx_frame, const struct rx_status *status);
826
827#endif /* _ZD_CHIP_H */
diff --git a/drivers/net/wireless/zd1211rw/zd_def.h b/drivers/net/wireless/zd1211rw/zd_def.h
new file mode 100644
index 000000000000..465906812fc4
--- /dev/null
+++ b/drivers/net/wireless/zd1211rw/zd_def.h
@@ -0,0 +1,48 @@
1/* zd_def.h
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 */
17
18#ifndef _ZD_DEF_H
19#define _ZD_DEF_H
20
21#include <linux/kernel.h>
22#include <linux/stringify.h>
23#include <linux/device.h>
24#include <linux/kernel.h>
25
26#define dev_printk_f(level, dev, fmt, args...) \
27 dev_printk(level, dev, "%s() " fmt, __func__, ##args)
28
29#ifdef DEBUG
30# define dev_dbg_f(dev, fmt, args...) \
31 dev_printk_f(KERN_DEBUG, dev, fmt, ## args)
32#else
33# define dev_dbg_f(dev, fmt, args...) do { (void)(dev); } while (0)
34#endif /* DEBUG */
35
36#ifdef DEBUG
37# define ZD_ASSERT(x) \
38do { \
39 if (!(x)) { \
40 pr_debug("%s:%d ASSERT %s VIOLATED!\n", \
41 __FILE__, __LINE__, __stringify(x)); \
42 } \
43} while (0)
44#else
45# define ZD_ASSERT(x) do { } while (0)
46#endif
47
48#endif /* _ZD_DEF_H */
diff --git a/drivers/net/wireless/zd1211rw/zd_ieee80211.c b/drivers/net/wireless/zd1211rw/zd_ieee80211.c
new file mode 100644
index 000000000000..66905f7b61ff
--- /dev/null
+++ b/drivers/net/wireless/zd1211rw/zd_ieee80211.c
@@ -0,0 +1,191 @@
1/* zd_ieee80211.c
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 */
17
18/*
19 * A lot of this code is generic and should be moved into the upper layers
20 * at some point.
21 */
22
23#include <linux/errno.h>
24#include <linux/wireless.h>
25#include <linux/kernel.h>
26#include <net/ieee80211.h>
27
28#include "zd_def.h"
29#include "zd_ieee80211.h"
30#include "zd_mac.h"
31
32static const struct channel_range channel_ranges[] = {
33 [0] = { 0, 0},
34 [ZD_REGDOMAIN_FCC] = { 1, 12},
35 [ZD_REGDOMAIN_IC] = { 1, 12},
36 [ZD_REGDOMAIN_ETSI] = { 1, 14},
37 [ZD_REGDOMAIN_JAPAN] = { 1, 14},
38 [ZD_REGDOMAIN_SPAIN] = { 1, 14},
39 [ZD_REGDOMAIN_FRANCE] = { 1, 14},
40 [ZD_REGDOMAIN_JAPAN_ADD] = {14, 15},
41};
42
43const struct channel_range *zd_channel_range(u8 regdomain)
44{
45 if (regdomain >= ARRAY_SIZE(channel_ranges))
46 regdomain = 0;
47 return &channel_ranges[regdomain];
48}
49
50int zd_regdomain_supports_channel(u8 regdomain, u8 channel)
51{
52 const struct channel_range *range = zd_channel_range(regdomain);
53 return range->start <= channel && channel < range->end;
54}
55
56int zd_regdomain_supported(u8 regdomain)
57{
58 const struct channel_range *range = zd_channel_range(regdomain);
59 return range->start != 0;
60}
61
62/* Stores channel frequencies in MHz. */
63static const u16 channel_frequencies[] = {
64 2412, 2417, 2422, 2427, 2432, 2437, 2442, 2447,
65 2452, 2457, 2462, 2467, 2472, 2484,
66};
67
68#define NUM_CHANNELS ARRAY_SIZE(channel_frequencies)
69
70static int compute_freq(struct iw_freq *freq, u32 mhz, u32 hz)
71{
72 u32 factor;
73
74 freq->e = 0;
75 if (mhz >= 1000000000U) {
76 pr_debug("zd1211 mhz %u to large\n", mhz);
77 freq->m = 0;
78 return -EINVAL;
79 }
80
81 factor = 1000;
82 while (mhz >= factor) {
83
84 freq->e += 1;
85 factor *= 10;
86 }
87
88 factor /= 1000U;
89 freq->m = mhz * (1000000U/factor) + hz/factor;
90
91 return 0;
92}
93
94int zd_channel_to_freq(struct iw_freq *freq, u8 channel)
95{
96 if (channel > NUM_CHANNELS) {
97 freq->m = 0;
98 freq->e = 0;
99 return -EINVAL;
100 }
101 if (!channel) {
102 freq->m = 0;
103 freq->e = 0;
104 return -EINVAL;
105 }
106 return compute_freq(freq, channel_frequencies[channel-1], 0);
107}
108
109static int freq_to_mhz(const struct iw_freq *freq)
110{
111 u32 factor;
112 int e;
113
114 /* Such high frequencies are not supported. */
115 if (freq->e > 6)
116 return -EINVAL;
117
118 factor = 1;
119 for (e = freq->e; e > 0; --e) {
120 factor *= 10;
121 }
122 factor = 1000000U / factor;
123
124 if (freq->m % factor) {
125 return -EINVAL;
126 }
127
128 return freq->m / factor;
129}
130
131int zd_find_channel(u8 *channel, const struct iw_freq *freq)
132{
133 int i, r;
134 u32 mhz;
135
136 if (!(freq->flags & IW_FREQ_FIXED))
137 return 0;
138
139 if (freq->m < 1000) {
140 if (freq->m > NUM_CHANNELS || freq->m == 0)
141 return -EINVAL;
142 *channel = freq->m;
143 return 1;
144 }
145
146 r = freq_to_mhz(freq);
147 if (r < 0)
148 return r;
149 mhz = r;
150
151 for (i = 0; i < NUM_CHANNELS; i++) {
152 if (mhz == channel_frequencies[i]) {
153 *channel = i+1;
154 return 1;
155 }
156 }
157
158 return -EINVAL;
159}
160
161int zd_geo_init(struct ieee80211_device *ieee, u8 regdomain)
162{
163 struct ieee80211_geo geo;
164 const struct channel_range *range;
165 int i;
166 u8 channel;
167
168 dev_dbg(zd_mac_dev(zd_netdev_mac(ieee->dev)),
169 "regdomain %#04x\n", regdomain);
170
171 range = zd_channel_range(regdomain);
172 if (range->start == 0) {
173 dev_err(zd_mac_dev(zd_netdev_mac(ieee->dev)),
174 "zd1211 regdomain %#04x not supported\n",
175 regdomain);
176 return -EINVAL;
177 }
178
179 memset(&geo, 0, sizeof(geo));
180
181 for (i = 0, channel = range->start; channel < range->end; channel++) {
182 struct ieee80211_channel *chan = &geo.bg[i++];
183 chan->freq = channel_frequencies[channel - 1];
184 chan->channel = channel;
185 }
186
187 geo.bg_channels = i;
188 memcpy(geo.name, "XX ", 4);
189 ieee80211_set_geo(ieee, &geo);
190 return 0;
191}
diff --git a/drivers/net/wireless/zd1211rw/zd_ieee80211.h b/drivers/net/wireless/zd1211rw/zd_ieee80211.h
new file mode 100644
index 000000000000..36329890dfec
--- /dev/null
+++ b/drivers/net/wireless/zd1211rw/zd_ieee80211.h
@@ -0,0 +1,85 @@
1#ifndef _ZD_IEEE80211_H
2#define _ZD_IEEE80211_H
3
4#include <net/ieee80211.h>
5#include "zd_types.h"
6
7/* Additional definitions from the standards.
8 */
9
10#define ZD_REGDOMAIN_FCC 0x10
11#define ZD_REGDOMAIN_IC 0x20
12#define ZD_REGDOMAIN_ETSI 0x30
13#define ZD_REGDOMAIN_SPAIN 0x31
14#define ZD_REGDOMAIN_FRANCE 0x32
15#define ZD_REGDOMAIN_JAPAN_ADD 0x40
16#define ZD_REGDOMAIN_JAPAN 0x41
17
18enum {
19 MIN_CHANNEL24 = 1,
20 MAX_CHANNEL24 = 14,
21};
22
23struct channel_range {
24 u8 start;
25 u8 end; /* exclusive (channel must be less than end) */
26};
27
28struct iw_freq;
29
30int zd_geo_init(struct ieee80211_device *ieee, u8 regdomain);
31
32const struct channel_range *zd_channel_range(u8 regdomain);
33int zd_regdomain_supports_channel(u8 regdomain, u8 channel);
34int zd_regdomain_supported(u8 regdomain);
35
36/* for 2.4 GHz band */
37int zd_channel_to_freq(struct iw_freq *freq, u8 channel);
38int zd_find_channel(u8 *channel, const struct iw_freq *freq);
39
40#define ZD_PLCP_SERVICE_LENGTH_EXTENSION 0x80
41
42struct ofdm_plcp_header {
43 u8 prefix[3];
44 __le16 service;
45} __attribute__((packed));
46
47static inline u8 zd_ofdm_plcp_header_rate(
48 const struct ofdm_plcp_header *header)
49{
50 return header->prefix[0] & 0xf;
51}
52
53#define ZD_OFDM_RATE_6M 0xb
54#define ZD_OFDM_RATE_9M 0xf
55#define ZD_OFDM_RATE_12M 0xa
56#define ZD_OFDM_RATE_18M 0xe
57#define ZD_OFDM_RATE_24M 0x9
58#define ZD_OFDM_RATE_36M 0xd
59#define ZD_OFDM_RATE_48M 0x8
60#define ZD_OFDM_RATE_54M 0xc
61
62struct cck_plcp_header {
63 u8 signal;
64 u8 service;
65 __le16 length;
66 __le16 crc16;
67} __attribute__((packed));
68
69static inline u8 zd_cck_plcp_header_rate(const struct cck_plcp_header *header)
70{
71 return header->signal;
72}
73
74#define ZD_CCK_SIGNAL_1M 0x0a
75#define ZD_CCK_SIGNAL_2M 0x14
76#define ZD_CCK_SIGNAL_5M5 0x37
77#define ZD_CCK_SIGNAL_11M 0x6e
78
79enum ieee80211_std {
80 IEEE80211B = 0x01,
81 IEEE80211A = 0x02,
82 IEEE80211G = 0x04,
83};
84
85#endif /* _ZD_IEEE80211_H */
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c
new file mode 100644
index 000000000000..d6f3e02a0b54
--- /dev/null
+++ b/drivers/net/wireless/zd1211rw/zd_mac.c
@@ -0,0 +1,1057 @@
1/* zd_mac.c
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 */
17
18#include <linux/netdevice.h>
19#include <linux/etherdevice.h>
20#include <linux/wireless.h>
21#include <linux/usb.h>
22#include <linux/jiffies.h>
23#include <net/ieee80211_radiotap.h>
24
25#include "zd_def.h"
26#include "zd_chip.h"
27#include "zd_mac.h"
28#include "zd_ieee80211.h"
29#include "zd_netdev.h"
30#include "zd_rf.h"
31#include "zd_util.h"
32
33static void ieee_init(struct ieee80211_device *ieee);
34static void softmac_init(struct ieee80211softmac_device *sm);
35
36int zd_mac_init(struct zd_mac *mac,
37 struct net_device *netdev,
38 struct usb_interface *intf)
39{
40 struct ieee80211_device *ieee = zd_netdev_ieee80211(netdev);
41
42 memset(mac, 0, sizeof(*mac));
43 spin_lock_init(&mac->lock);
44 mac->netdev = netdev;
45
46 ieee_init(ieee);
47 softmac_init(ieee80211_priv(netdev));
48 zd_chip_init(&mac->chip, netdev, intf);
49 return 0;
50}
51
52static int reset_channel(struct zd_mac *mac)
53{
54 int r;
55 unsigned long flags;
56 const struct channel_range *range;
57
58 spin_lock_irqsave(&mac->lock, flags);
59 range = zd_channel_range(mac->regdomain);
60 if (!range->start) {
61 r = -EINVAL;
62 goto out;
63 }
64 mac->requested_channel = range->start;
65 r = 0;
66out:
67 spin_unlock_irqrestore(&mac->lock, flags);
68 return r;
69}
70
71int zd_mac_init_hw(struct zd_mac *mac, u8 device_type)
72{
73 int r;
74 struct zd_chip *chip = &mac->chip;
75 u8 addr[ETH_ALEN];
76 u8 default_regdomain;
77
78 r = zd_chip_enable_int(chip);
79 if (r)
80 goto out;
81 r = zd_chip_init_hw(chip, device_type);
82 if (r)
83 goto disable_int;
84
85 zd_get_e2p_mac_addr(chip, addr);
86 r = zd_write_mac_addr(chip, addr);
87 if (r)
88 goto disable_int;
89 ZD_ASSERT(!irqs_disabled());
90 spin_lock_irq(&mac->lock);
91 memcpy(mac->netdev->dev_addr, addr, ETH_ALEN);
92 spin_unlock_irq(&mac->lock);
93
94 r = zd_read_regdomain(chip, &default_regdomain);
95 if (r)
96 goto disable_int;
97 if (!zd_regdomain_supported(default_regdomain)) {
98 dev_dbg_f(zd_mac_dev(mac),
99 "Regulatory Domain %#04x is not supported.\n",
100 default_regdomain);
101 r = -EINVAL;
102 goto disable_int;
103 }
104 spin_lock_irq(&mac->lock);
105 mac->regdomain = mac->default_regdomain = default_regdomain;
106 spin_unlock_irq(&mac->lock);
107 r = reset_channel(mac);
108 if (r)
109 goto disable_int;
110
111 /* We must inform the device that we are doing encryption/decryption in
112 * software at the moment. */
113 r = zd_set_encryption_type(chip, ENC_SNIFFER);
114 if (r)
115 goto disable_int;
116
117 r = zd_geo_init(zd_mac_to_ieee80211(mac), mac->regdomain);
118 if (r)
119 goto disable_int;
120
121 r = 0;
122disable_int:
123 zd_chip_disable_int(chip);
124out:
125 return r;
126}
127
128void zd_mac_clear(struct zd_mac *mac)
129{
130 /* Aquire the lock. */
131 spin_lock(&mac->lock);
132 spin_unlock(&mac->lock);
133 zd_chip_clear(&mac->chip);
134 memset(mac, 0, sizeof(*mac));
135}
136
137static int reset_mode(struct zd_mac *mac)
138{
139 struct ieee80211_device *ieee = zd_mac_to_ieee80211(mac);
140 struct zd_ioreq32 ioreqs[3] = {
141 { CR_RX_FILTER, STA_RX_FILTER },
142 { CR_SNIFFER_ON, 0U },
143 };
144
145 if (ieee->iw_mode == IW_MODE_MONITOR) {
146 ioreqs[0].value = 0xffffffff;
147 ioreqs[1].value = 0x1;
148 ioreqs[2].value = ENC_SNIFFER;
149 }
150
151 return zd_iowrite32a(&mac->chip, ioreqs, 3);
152}
153
154int zd_mac_open(struct net_device *netdev)
155{
156 struct zd_mac *mac = zd_netdev_mac(netdev);
157 struct zd_chip *chip = &mac->chip;
158 int r;
159
160 r = zd_chip_enable_int(chip);
161 if (r < 0)
162 goto out;
163
164 r = zd_chip_set_basic_rates(chip, CR_RATES_80211B | CR_RATES_80211G);
165 if (r < 0)
166 goto disable_int;
167 r = reset_mode(mac);
168 if (r)
169 goto disable_int;
170 r = zd_chip_switch_radio_on(chip);
171 if (r < 0)
172 goto disable_int;
173 r = zd_chip_set_channel(chip, mac->requested_channel);
174 if (r < 0)
175 goto disable_radio;
176 r = zd_chip_enable_rx(chip);
177 if (r < 0)
178 goto disable_radio;
179 r = zd_chip_enable_hwint(chip);
180 if (r < 0)
181 goto disable_rx;
182
183 ieee80211softmac_start(netdev);
184 return 0;
185disable_rx:
186 zd_chip_disable_rx(chip);
187disable_radio:
188 zd_chip_switch_radio_off(chip);
189disable_int:
190 zd_chip_disable_int(chip);
191out:
192 return r;
193}
194
195int zd_mac_stop(struct net_device *netdev)
196{
197 struct zd_mac *mac = zd_netdev_mac(netdev);
198 struct zd_chip *chip = &mac->chip;
199
200 netif_stop_queue(netdev);
201
202 /*
203 * The order here deliberately is a little different from the open()
204 * method, since we need to make sure there is no opportunity for RX
205 * frames to be processed by softmac after we have stopped it.
206 */
207
208 zd_chip_disable_rx(chip);
209 ieee80211softmac_stop(netdev);
210
211 zd_chip_disable_hwint(chip);
212 zd_chip_switch_radio_off(chip);
213 zd_chip_disable_int(chip);
214
215 return 0;
216}
217
218int zd_mac_set_mac_address(struct net_device *netdev, void *p)
219{
220 int r;
221 unsigned long flags;
222 struct sockaddr *addr = p;
223 struct zd_mac *mac = zd_netdev_mac(netdev);
224 struct zd_chip *chip = &mac->chip;
225
226 if (!is_valid_ether_addr(addr->sa_data))
227 return -EADDRNOTAVAIL;
228
229 dev_dbg_f(zd_mac_dev(mac),
230 "Setting MAC to " MAC_FMT "\n", MAC_ARG(addr->sa_data));
231
232 r = zd_write_mac_addr(chip, addr->sa_data);
233 if (r)
234 return r;
235
236 spin_lock_irqsave(&mac->lock, flags);
237 memcpy(netdev->dev_addr, addr->sa_data, ETH_ALEN);
238 spin_unlock_irqrestore(&mac->lock, flags);
239
240 return 0;
241}
242
243int zd_mac_set_regdomain(struct zd_mac *mac, u8 regdomain)
244{
245 int r;
246 u8 channel;
247
248 ZD_ASSERT(!irqs_disabled());
249 spin_lock_irq(&mac->lock);
250 if (regdomain == 0) {
251 regdomain = mac->default_regdomain;
252 }
253 if (!zd_regdomain_supported(regdomain)) {
254 spin_unlock_irq(&mac->lock);
255 return -EINVAL;
256 }
257 mac->regdomain = regdomain;
258 channel = mac->requested_channel;
259 spin_unlock_irq(&mac->lock);
260
261 r = zd_geo_init(zd_mac_to_ieee80211(mac), regdomain);
262 if (r)
263 return r;
264 if (!zd_regdomain_supports_channel(regdomain, channel)) {
265 r = reset_channel(mac);
266 if (r)
267 return r;
268 }
269
270 return 0;
271}
272
273u8 zd_mac_get_regdomain(struct zd_mac *mac)
274{
275 unsigned long flags;
276 u8 regdomain;
277
278 spin_lock_irqsave(&mac->lock, flags);
279 regdomain = mac->regdomain;
280 spin_unlock_irqrestore(&mac->lock, flags);
281 return regdomain;
282}
283
284static void set_channel(struct net_device *netdev, u8 channel)
285{
286 struct zd_mac *mac = zd_netdev_mac(netdev);
287
288 dev_dbg_f(zd_mac_dev(mac), "channel %d\n", channel);
289
290 zd_chip_set_channel(&mac->chip, channel);
291}
292
293/* TODO: Should not work in Managed mode. */
294int zd_mac_request_channel(struct zd_mac *mac, u8 channel)
295{
296 unsigned long lock_flags;
297 struct ieee80211_device *ieee = zd_mac_to_ieee80211(mac);
298
299 if (ieee->iw_mode == IW_MODE_INFRA)
300 return -EPERM;
301
302 spin_lock_irqsave(&mac->lock, lock_flags);
303 if (!zd_regdomain_supports_channel(mac->regdomain, channel)) {
304 spin_unlock_irqrestore(&mac->lock, lock_flags);
305 return -EINVAL;
306 }
307 mac->requested_channel = channel;
308 spin_unlock_irqrestore(&mac->lock, lock_flags);
309 if (netif_running(mac->netdev))
310 return zd_chip_set_channel(&mac->chip, channel);
311 else
312 return 0;
313}
314
315int zd_mac_get_channel(struct zd_mac *mac, u8 *channel, u8 *flags)
316{
317 struct ieee80211_device *ieee = zd_mac_to_ieee80211(mac);
318
319 *channel = zd_chip_get_channel(&mac->chip);
320 if (ieee->iw_mode != IW_MODE_INFRA) {
321 spin_lock_irq(&mac->lock);
322 *flags = *channel == mac->requested_channel ?
323 MAC_FIXED_CHANNEL : 0;
324 spin_unlock(&mac->lock);
325 } else {
326 *flags = 0;
327 }
328 dev_dbg_f(zd_mac_dev(mac), "channel %u flags %u\n", *channel, *flags);
329 return 0;
330}
331
332/* If wrong rate is given, we are falling back to the slowest rate: 1MBit/s */
333static u8 cs_typed_rate(u8 cs_rate)
334{
335 static const u8 typed_rates[16] = {
336 [ZD_CS_CCK_RATE_1M] = ZD_CS_CCK|ZD_CS_CCK_RATE_1M,
337 [ZD_CS_CCK_RATE_2M] = ZD_CS_CCK|ZD_CS_CCK_RATE_2M,
338 [ZD_CS_CCK_RATE_5_5M] = ZD_CS_CCK|ZD_CS_CCK_RATE_5_5M,
339 [ZD_CS_CCK_RATE_11M] = ZD_CS_CCK|ZD_CS_CCK_RATE_11M,
340 [ZD_OFDM_RATE_6M] = ZD_CS_OFDM|ZD_OFDM_RATE_6M,
341 [ZD_OFDM_RATE_9M] = ZD_CS_OFDM|ZD_OFDM_RATE_9M,
342 [ZD_OFDM_RATE_12M] = ZD_CS_OFDM|ZD_OFDM_RATE_12M,
343 [ZD_OFDM_RATE_18M] = ZD_CS_OFDM|ZD_OFDM_RATE_18M,
344 [ZD_OFDM_RATE_24M] = ZD_CS_OFDM|ZD_OFDM_RATE_24M,
345 [ZD_OFDM_RATE_36M] = ZD_CS_OFDM|ZD_OFDM_RATE_36M,
346 [ZD_OFDM_RATE_48M] = ZD_CS_OFDM|ZD_OFDM_RATE_48M,
347 [ZD_OFDM_RATE_54M] = ZD_CS_OFDM|ZD_OFDM_RATE_54M,
348 };
349
350 ZD_ASSERT(ZD_CS_RATE_MASK == 0x0f);
351 return typed_rates[cs_rate & ZD_CS_RATE_MASK];
352}
353
354/* Fallback to lowest rate, if rate is unknown. */
355static u8 rate_to_cs_rate(u8 rate)
356{
357 switch (rate) {
358 case IEEE80211_CCK_RATE_2MB:
359 return ZD_CS_CCK_RATE_2M;
360 case IEEE80211_CCK_RATE_5MB:
361 return ZD_CS_CCK_RATE_5_5M;
362 case IEEE80211_CCK_RATE_11MB:
363 return ZD_CS_CCK_RATE_11M;
364 case IEEE80211_OFDM_RATE_6MB:
365 return ZD_OFDM_RATE_6M;
366 case IEEE80211_OFDM_RATE_9MB:
367 return ZD_OFDM_RATE_9M;
368 case IEEE80211_OFDM_RATE_12MB:
369 return ZD_OFDM_RATE_12M;
370 case IEEE80211_OFDM_RATE_18MB:
371 return ZD_OFDM_RATE_18M;
372 case IEEE80211_OFDM_RATE_24MB:
373 return ZD_OFDM_RATE_24M;
374 case IEEE80211_OFDM_RATE_36MB:
375 return ZD_OFDM_RATE_36M;
376 case IEEE80211_OFDM_RATE_48MB:
377 return ZD_OFDM_RATE_48M;
378 case IEEE80211_OFDM_RATE_54MB:
379 return ZD_OFDM_RATE_54M;
380 }
381 return ZD_CS_CCK_RATE_1M;
382}
383
384int zd_mac_set_mode(struct zd_mac *mac, u32 mode)
385{
386 struct ieee80211_device *ieee;
387
388 switch (mode) {
389 case IW_MODE_AUTO:
390 case IW_MODE_ADHOC:
391 case IW_MODE_INFRA:
392 mac->netdev->type = ARPHRD_ETHER;
393 break;
394 case IW_MODE_MONITOR:
395 mac->netdev->type = ARPHRD_IEEE80211_RADIOTAP;
396 break;
397 default:
398 dev_dbg_f(zd_mac_dev(mac), "wrong mode %u\n", mode);
399 return -EINVAL;
400 }
401
402 ieee = zd_mac_to_ieee80211(mac);
403 ZD_ASSERT(!irqs_disabled());
404 spin_lock_irq(&ieee->lock);
405 ieee->iw_mode = mode;
406 spin_unlock_irq(&ieee->lock);
407
408 if (netif_running(mac->netdev))
409 return reset_mode(mac);
410
411 return 0;
412}
413
414int zd_mac_get_mode(struct zd_mac *mac, u32 *mode)
415{
416 unsigned long flags;
417 struct ieee80211_device *ieee;
418
419 ieee = zd_mac_to_ieee80211(mac);
420 spin_lock_irqsave(&ieee->lock, flags);
421 *mode = ieee->iw_mode;
422 spin_unlock_irqrestore(&ieee->lock, flags);
423 return 0;
424}
425
426int zd_mac_get_range(struct zd_mac *mac, struct iw_range *range)
427{
428 int i;
429 const struct channel_range *channel_range;
430 u8 regdomain;
431
432 memset(range, 0, sizeof(*range));
433
434 /* FIXME: Not so important and depends on the mode. For 802.11g
435 * usually this value is used. It seems to be that Bit/s number is
436 * given here.
437 */
438 range->throughput = 27 * 1000 * 1000;
439
440 range->max_qual.qual = 100;
441 range->max_qual.level = 100;
442
443 /* FIXME: Needs still to be tuned. */
444 range->avg_qual.qual = 71;
445 range->avg_qual.level = 80;
446
447 /* FIXME: depends on standard? */
448 range->min_rts = 256;
449 range->max_rts = 2346;
450
451 range->min_frag = MIN_FRAG_THRESHOLD;
452 range->max_frag = MAX_FRAG_THRESHOLD;
453
454 range->max_encoding_tokens = WEP_KEYS;
455 range->num_encoding_sizes = 2;
456 range->encoding_size[0] = 5;
457 range->encoding_size[1] = WEP_KEY_LEN;
458
459 range->we_version_compiled = WIRELESS_EXT;
460 range->we_version_source = 20;
461
462 ZD_ASSERT(!irqs_disabled());
463 spin_lock_irq(&mac->lock);
464 regdomain = mac->regdomain;
465 spin_unlock_irq(&mac->lock);
466 channel_range = zd_channel_range(regdomain);
467
468 range->num_channels = channel_range->end - channel_range->start;
469 range->old_num_channels = range->num_channels;
470 range->num_frequency = range->num_channels;
471 range->old_num_frequency = range->num_frequency;
472
473 for (i = 0; i < range->num_frequency; i++) {
474 struct iw_freq *freq = &range->freq[i];
475 freq->i = channel_range->start + i;
476 zd_channel_to_freq(freq, freq->i);
477 }
478
479 return 0;
480}
481
482static int zd_calc_tx_length_us(u8 *service, u8 cs_rate, u16 tx_length)
483{
484 static const u8 rate_divisor[] = {
485 [ZD_CS_CCK_RATE_1M] = 1,
486 [ZD_CS_CCK_RATE_2M] = 2,
487 [ZD_CS_CCK_RATE_5_5M] = 11, /* bits must be doubled */
488 [ZD_CS_CCK_RATE_11M] = 11,
489 [ZD_OFDM_RATE_6M] = 6,
490 [ZD_OFDM_RATE_9M] = 9,
491 [ZD_OFDM_RATE_12M] = 12,
492 [ZD_OFDM_RATE_18M] = 18,
493 [ZD_OFDM_RATE_24M] = 24,
494 [ZD_OFDM_RATE_36M] = 36,
495 [ZD_OFDM_RATE_48M] = 48,
496 [ZD_OFDM_RATE_54M] = 54,
497 };
498
499 u32 bits = (u32)tx_length * 8;
500 u32 divisor;
501
502 divisor = rate_divisor[cs_rate];
503 if (divisor == 0)
504 return -EINVAL;
505
506 switch (cs_rate) {
507 case ZD_CS_CCK_RATE_5_5M:
508 bits = (2*bits) + 10; /* round up to the next integer */
509 break;
510 case ZD_CS_CCK_RATE_11M:
511 if (service) {
512 u32 t = bits % 11;
513 *service &= ~ZD_PLCP_SERVICE_LENGTH_EXTENSION;
514 if (0 < t && t <= 3) {
515 *service |= ZD_PLCP_SERVICE_LENGTH_EXTENSION;
516 }
517 }
518 bits += 10; /* round up to the next integer */
519 break;
520 }
521
522 return bits/divisor;
523}
524
525enum {
526 R2M_SHORT_PREAMBLE = 0x01,
527 R2M_11A = 0x02,
528};
529
530static u8 cs_rate_to_modulation(u8 cs_rate, int flags)
531{
532 u8 modulation;
533
534 modulation = cs_typed_rate(cs_rate);
535 if (flags & R2M_SHORT_PREAMBLE) {
536 switch (ZD_CS_RATE(modulation)) {
537 case ZD_CS_CCK_RATE_2M:
538 case ZD_CS_CCK_RATE_5_5M:
539 case ZD_CS_CCK_RATE_11M:
540 modulation |= ZD_CS_CCK_PREA_SHORT;
541 return modulation;
542 }
543 }
544 if (flags & R2M_11A) {
545 if (ZD_CS_TYPE(modulation) == ZD_CS_OFDM)
546 modulation |= ZD_CS_OFDM_MODE_11A;
547 }
548 return modulation;
549}
550
551static void cs_set_modulation(struct zd_mac *mac, struct zd_ctrlset *cs,
552 struct ieee80211_hdr_4addr *hdr)
553{
554 struct ieee80211softmac_device *softmac = ieee80211_priv(mac->netdev);
555 u16 ftype = WLAN_FC_GET_TYPE(le16_to_cpu(hdr->frame_ctl));
556 u8 rate, cs_rate;
557 int is_mgt = (ftype == IEEE80211_FTYPE_MGMT) != 0;
558
559 /* FIXME: 802.11a? short preamble? */
560 rate = ieee80211softmac_suggest_txrate(softmac,
561 is_multicast_ether_addr(hdr->addr1), is_mgt);
562
563 cs_rate = rate_to_cs_rate(rate);
564 cs->modulation = cs_rate_to_modulation(cs_rate, 0);
565}
566
567static void cs_set_control(struct zd_mac *mac, struct zd_ctrlset *cs,
568 struct ieee80211_hdr_4addr *header)
569{
570 unsigned int tx_length = le16_to_cpu(cs->tx_length);
571 u16 fctl = le16_to_cpu(header->frame_ctl);
572 u16 ftype = WLAN_FC_GET_TYPE(fctl);
573 u16 stype = WLAN_FC_GET_STYPE(fctl);
574
575 /*
576 * CONTROL:
577 * - start at 0x00
578 * - if fragment 0, enable bit 0
579 * - if backoff needed, enable bit 0
580 * - if burst (backoff not needed) disable bit 0
581 * - if multicast, enable bit 1
582 * - if PS-POLL frame, enable bit 2
583 * - if in INDEPENDENT_BSS mode and zd1205_DestPowerSave, then enable
584 * bit 4 (FIXME: wtf)
585 * - if frag_len > RTS threshold, set bit 5 as long if it isnt
586 * multicast or mgt
587 * - if bit 5 is set, and we are in OFDM mode, unset bit 5 and set bit
588 * 7
589 */
590
591 cs->control = 0;
592
593 /* First fragment */
594 if (WLAN_GET_SEQ_FRAG(le16_to_cpu(header->seq_ctl)) == 0)
595 cs->control |= ZD_CS_NEED_RANDOM_BACKOFF;
596
597 /* Multicast */
598 if (is_multicast_ether_addr(header->addr1))
599 cs->control |= ZD_CS_MULTICAST;
600
601 /* PS-POLL */
602 if (stype == IEEE80211_STYPE_PSPOLL)
603 cs->control |= ZD_CS_PS_POLL_FRAME;
604
605 if (!is_multicast_ether_addr(header->addr1) &&
606 ftype != IEEE80211_FTYPE_MGMT &&
607 tx_length > zd_netdev_ieee80211(mac->netdev)->rts)
608 {
609 /* FIXME: check the logic */
610 if (ZD_CS_TYPE(cs->modulation) == ZD_CS_OFDM) {
611 /* 802.11g */
612 cs->control |= ZD_CS_SELF_CTS;
613 } else { /* 802.11b */
614 cs->control |= ZD_CS_RTS;
615 }
616 }
617
618 /* FIXME: Management frame? */
619}
620
621static int fill_ctrlset(struct zd_mac *mac,
622 struct ieee80211_txb *txb,
623 int frag_num)
624{
625 int r;
626 struct sk_buff *skb = txb->fragments[frag_num];
627 struct ieee80211_hdr_4addr *hdr =
628 (struct ieee80211_hdr_4addr *) skb->data;
629 unsigned int frag_len = skb->len + IEEE80211_FCS_LEN;
630 unsigned int next_frag_len;
631 unsigned int packet_length;
632 struct zd_ctrlset *cs = (struct zd_ctrlset *)
633 skb_push(skb, sizeof(struct zd_ctrlset));
634
635 if (frag_num+1 < txb->nr_frags) {
636 next_frag_len = txb->fragments[frag_num+1]->len +
637 IEEE80211_FCS_LEN;
638 } else {
639 next_frag_len = 0;
640 }
641 ZD_ASSERT(frag_len <= 0xffff);
642 ZD_ASSERT(next_frag_len <= 0xffff);
643
644 cs_set_modulation(mac, cs, hdr);
645
646 cs->tx_length = cpu_to_le16(frag_len);
647
648 cs_set_control(mac, cs, hdr);
649
650 packet_length = frag_len + sizeof(struct zd_ctrlset) + 10;
651 ZD_ASSERT(packet_length <= 0xffff);
652 /* ZD1211B: Computing the length difference this way, gives us
653 * flexibility to compute the packet length.
654 */
655 cs->packet_length = cpu_to_le16(mac->chip.is_zd1211b ?
656 packet_length - frag_len : packet_length);
657
658 /*
659 * CURRENT LENGTH:
660 * - transmit frame length in microseconds
661 * - seems to be derived from frame length
662 * - see Cal_Us_Service() in zdinlinef.h
663 * - if macp->bTxBurstEnable is enabled, then multiply by 4
664 * - bTxBurstEnable is never set in the vendor driver
665 *
666 * SERVICE:
667 * - "for PLCP configuration"
668 * - always 0 except in some situations at 802.11b 11M
669 * - see line 53 of zdinlinef.h
670 */
671 cs->service = 0;
672 r = zd_calc_tx_length_us(&cs->service, ZD_CS_RATE(cs->modulation),
673 le16_to_cpu(cs->tx_length));
674 if (r < 0)
675 return r;
676 cs->current_length = cpu_to_le16(r);
677
678 if (next_frag_len == 0) {
679 cs->next_frame_length = 0;
680 } else {
681 r = zd_calc_tx_length_us(NULL, ZD_CS_RATE(cs->modulation),
682 next_frag_len);
683 if (r < 0)
684 return r;
685 cs->next_frame_length = cpu_to_le16(r);
686 }
687
688 return 0;
689}
690
691static int zd_mac_tx(struct zd_mac *mac, struct ieee80211_txb *txb, int pri)
692{
693 int i, r;
694
695 for (i = 0; i < txb->nr_frags; i++) {
696 struct sk_buff *skb = txb->fragments[i];
697
698 r = fill_ctrlset(mac, txb, i);
699 if (r)
700 return r;
701 r = zd_usb_tx(&mac->chip.usb, skb->data, skb->len);
702 if (r)
703 return r;
704 }
705
706 /* FIXME: shouldn't this be handled by the upper layers? */
707 mac->netdev->trans_start = jiffies;
708
709 ieee80211_txb_free(txb);
710 return 0;
711}
712
713struct zd_rt_hdr {
714 struct ieee80211_radiotap_header rt_hdr;
715 u8 rt_flags;
716 u8 rt_rate;
717 u16 rt_channel;
718 u16 rt_chbitmask;
719} __attribute__((packed));
720
721static void fill_rt_header(void *buffer, struct zd_mac *mac,
722 const struct ieee80211_rx_stats *stats,
723 const struct rx_status *status)
724{
725 struct zd_rt_hdr *hdr = buffer;
726
727 hdr->rt_hdr.it_version = PKTHDR_RADIOTAP_VERSION;
728 hdr->rt_hdr.it_pad = 0;
729 hdr->rt_hdr.it_len = cpu_to_le16(sizeof(struct zd_rt_hdr));
730 hdr->rt_hdr.it_present = cpu_to_le32((1 << IEEE80211_RADIOTAP_FLAGS) |
731 (1 << IEEE80211_RADIOTAP_CHANNEL) |
732 (1 << IEEE80211_RADIOTAP_RATE));
733
734 hdr->rt_flags = 0;
735 if (status->decryption_type & (ZD_RX_WEP64|ZD_RX_WEP128|ZD_RX_WEP256))
736 hdr->rt_flags |= IEEE80211_RADIOTAP_F_WEP;
737
738 hdr->rt_rate = stats->rate / 5;
739
740 /* FIXME: 802.11a */
741 hdr->rt_channel = cpu_to_le16(ieee80211chan2mhz(
742 _zd_chip_get_channel(&mac->chip)));
743 hdr->rt_chbitmask = cpu_to_le16(IEEE80211_CHAN_2GHZ |
744 ((status->frame_status & ZD_RX_FRAME_MODULATION_MASK) ==
745 ZD_RX_OFDM ? IEEE80211_CHAN_OFDM : IEEE80211_CHAN_CCK));
746}
747
748/* Returns 1 if the data packet is for us and 0 otherwise. */
749static int is_data_packet_for_us(struct ieee80211_device *ieee,
750 struct ieee80211_hdr_4addr *hdr)
751{
752 struct net_device *netdev = ieee->dev;
753 u16 fc = le16_to_cpu(hdr->frame_ctl);
754
755 ZD_ASSERT(WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_DATA);
756
757 switch (ieee->iw_mode) {
758 case IW_MODE_ADHOC:
759 if ((fc & (IEEE80211_FCTL_TODS|IEEE80211_FCTL_FROMDS)) != 0 ||
760 memcmp(hdr->addr3, ieee->bssid, ETH_ALEN) != 0)
761 return 0;
762 break;
763 case IW_MODE_AUTO:
764 case IW_MODE_INFRA:
765 if ((fc & (IEEE80211_FCTL_TODS|IEEE80211_FCTL_FROMDS)) !=
766 IEEE80211_FCTL_FROMDS ||
767 memcmp(hdr->addr2, ieee->bssid, ETH_ALEN) != 0)
768 return 0;
769 break;
770 default:
771 ZD_ASSERT(ieee->iw_mode != IW_MODE_MONITOR);
772 return 0;
773 }
774
775 return memcmp(hdr->addr1, netdev->dev_addr, ETH_ALEN) == 0 ||
776 is_multicast_ether_addr(hdr->addr1) ||
777 (netdev->flags & IFF_PROMISC);
778}
779
780/* Filters receiving packets. If it returns 1 send it to ieee80211_rx, if 0
781 * return. If an error is detected -EINVAL is returned. ieee80211_rx_mgt() is
782 * called here.
783 *
784 * It has been based on ieee80211_rx_any.
785 */
786static int filter_rx(struct ieee80211_device *ieee,
787 const u8 *buffer, unsigned int length,
788 struct ieee80211_rx_stats *stats)
789{
790 struct ieee80211_hdr_4addr *hdr;
791 u16 fc;
792
793 if (ieee->iw_mode == IW_MODE_MONITOR)
794 return 1;
795
796 hdr = (struct ieee80211_hdr_4addr *)buffer;
797 fc = le16_to_cpu(hdr->frame_ctl);
798 if ((fc & IEEE80211_FCTL_VERS) != 0)
799 return -EINVAL;
800
801 switch (WLAN_FC_GET_TYPE(fc)) {
802 case IEEE80211_FTYPE_MGMT:
803 if (length < sizeof(struct ieee80211_hdr_3addr))
804 return -EINVAL;
805 ieee80211_rx_mgt(ieee, hdr, stats);
806 return 0;
807 case IEEE80211_FTYPE_CTL:
808 /* Ignore invalid short buffers */
809 return 0;
810 case IEEE80211_FTYPE_DATA:
811 if (length < sizeof(struct ieee80211_hdr_3addr))
812 return -EINVAL;
813 return is_data_packet_for_us(ieee, hdr);
814 }
815
816 return -EINVAL;
817}
818
819static void update_qual_rssi(struct zd_mac *mac, u8 qual_percent, u8 rssi)
820{
821 unsigned long flags;
822
823 spin_lock_irqsave(&mac->lock, flags);
824 mac->qual_average = (7 * mac->qual_average + qual_percent) / 8;
825 mac->rssi_average = (7 * mac->rssi_average + rssi) / 8;
826 spin_unlock_irqrestore(&mac->lock, flags);
827}
828
829static int fill_rx_stats(struct ieee80211_rx_stats *stats,
830 const struct rx_status **pstatus,
831 struct zd_mac *mac,
832 const u8 *buffer, unsigned int length)
833{
834 const struct rx_status *status;
835
836 *pstatus = status = zd_tail(buffer, length, sizeof(struct rx_status));
837 if (status->frame_status & ZD_RX_ERROR) {
838 /* FIXME: update? */
839 return -EINVAL;
840 }
841 memset(stats, 0, sizeof(struct ieee80211_rx_stats));
842 stats->len = length - (ZD_PLCP_HEADER_SIZE + IEEE80211_FCS_LEN +
843 + sizeof(struct rx_status));
844 /* FIXME: 802.11a */
845 stats->freq = IEEE80211_24GHZ_BAND;
846 stats->received_channel = _zd_chip_get_channel(&mac->chip);
847 stats->rssi = zd_rx_strength_percent(status->signal_strength);
848 stats->signal = zd_rx_qual_percent(buffer,
849 length - sizeof(struct rx_status),
850 status);
851 stats->mask = IEEE80211_STATMASK_RSSI | IEEE80211_STATMASK_SIGNAL;
852 stats->rate = zd_rx_rate(buffer, status);
853 if (stats->rate)
854 stats->mask |= IEEE80211_STATMASK_RATE;
855
856 update_qual_rssi(mac, stats->signal, stats->rssi);
857 return 0;
858}
859
860int zd_mac_rx(struct zd_mac *mac, const u8 *buffer, unsigned int length)
861{
862 int r;
863 struct ieee80211_device *ieee = zd_mac_to_ieee80211(mac);
864 struct ieee80211_rx_stats stats;
865 const struct rx_status *status;
866 struct sk_buff *skb;
867
868 if (length < ZD_PLCP_HEADER_SIZE + IEEE80211_1ADDR_LEN +
869 IEEE80211_FCS_LEN + sizeof(struct rx_status))
870 return -EINVAL;
871
872 r = fill_rx_stats(&stats, &status, mac, buffer, length);
873 if (r)
874 return r;
875
876 length -= ZD_PLCP_HEADER_SIZE+IEEE80211_FCS_LEN+
877 sizeof(struct rx_status);
878 buffer += ZD_PLCP_HEADER_SIZE;
879
880 r = filter_rx(ieee, buffer, length, &stats);
881 if (r <= 0)
882 return r;
883
884 skb = dev_alloc_skb(sizeof(struct zd_rt_hdr) + length);
885 if (!skb)
886 return -ENOMEM;
887 if (ieee->iw_mode == IW_MODE_MONITOR)
888 fill_rt_header(skb_put(skb, sizeof(struct zd_rt_hdr)), mac,
889 &stats, status);
890 memcpy(skb_put(skb, length), buffer, length);
891
892 r = ieee80211_rx(ieee, skb, &stats);
893 if (!r) {
894 ZD_ASSERT(in_irq());
895 dev_kfree_skb_irq(skb);
896 }
897 return 0;
898}
899
900static int netdev_tx(struct ieee80211_txb *txb, struct net_device *netdev,
901 int pri)
902{
903 return zd_mac_tx(zd_netdev_mac(netdev), txb, pri);
904}
905
906static void set_security(struct net_device *netdev,
907 struct ieee80211_security *sec)
908{
909 struct ieee80211_device *ieee = zd_netdev_ieee80211(netdev);
910 struct ieee80211_security *secinfo = &ieee->sec;
911 int keyidx;
912
913 dev_dbg_f(zd_mac_dev(zd_netdev_mac(netdev)), "\n");
914
915 for (keyidx = 0; keyidx<WEP_KEYS; keyidx++)
916 if (sec->flags & (1<<keyidx)) {
917 secinfo->encode_alg[keyidx] = sec->encode_alg[keyidx];
918 secinfo->key_sizes[keyidx] = sec->key_sizes[keyidx];
919 memcpy(secinfo->keys[keyidx], sec->keys[keyidx],
920 SCM_KEY_LEN);
921 }
922
923 if (sec->flags & SEC_ACTIVE_KEY) {
924 secinfo->active_key = sec->active_key;
925 dev_dbg_f(zd_mac_dev(zd_netdev_mac(netdev)),
926 " .active_key = %d\n", sec->active_key);
927 }
928 if (sec->flags & SEC_UNICAST_GROUP) {
929 secinfo->unicast_uses_group = sec->unicast_uses_group;
930 dev_dbg_f(zd_mac_dev(zd_netdev_mac(netdev)),
931 " .unicast_uses_group = %d\n",
932 sec->unicast_uses_group);
933 }
934 if (sec->flags & SEC_LEVEL) {
935 secinfo->level = sec->level;
936 dev_dbg_f(zd_mac_dev(zd_netdev_mac(netdev)),
937 " .level = %d\n", sec->level);
938 }
939 if (sec->flags & SEC_ENABLED) {
940 secinfo->enabled = sec->enabled;
941 dev_dbg_f(zd_mac_dev(zd_netdev_mac(netdev)),
942 " .enabled = %d\n", sec->enabled);
943 }
944 if (sec->flags & SEC_ENCRYPT) {
945 secinfo->encrypt = sec->encrypt;
946 dev_dbg_f(zd_mac_dev(zd_netdev_mac(netdev)),
947 " .encrypt = %d\n", sec->encrypt);
948 }
949 if (sec->flags & SEC_AUTH_MODE) {
950 secinfo->auth_mode = sec->auth_mode;
951 dev_dbg_f(zd_mac_dev(zd_netdev_mac(netdev)),
952 " .auth_mode = %d\n", sec->auth_mode);
953 }
954}
955
956static void ieee_init(struct ieee80211_device *ieee)
957{
958 ieee->mode = IEEE_B | IEEE_G;
959 ieee->freq_band = IEEE80211_24GHZ_BAND;
960 ieee->modulation = IEEE80211_OFDM_MODULATION | IEEE80211_CCK_MODULATION;
961 ieee->tx_headroom = sizeof(struct zd_ctrlset);
962 ieee->set_security = set_security;
963 ieee->hard_start_xmit = netdev_tx;
964
965 /* Software encryption/decryption for now */
966 ieee->host_build_iv = 0;
967 ieee->host_encrypt = 1;
968 ieee->host_decrypt = 1;
969
970 /* FIXME: default to managed mode, until ieee80211 and zd1211rw can
971 * correctly support AUTO */
972 ieee->iw_mode = IW_MODE_INFRA;
973}
974
975static void softmac_init(struct ieee80211softmac_device *sm)
976{
977 sm->set_channel = set_channel;
978}
979
980struct iw_statistics *zd_mac_get_wireless_stats(struct net_device *ndev)
981{
982 struct zd_mac *mac = zd_netdev_mac(ndev);
983 struct iw_statistics *iw_stats = &mac->iw_stats;
984
985 memset(iw_stats, 0, sizeof(struct iw_statistics));
986 /* We are not setting the status, because ieee->state is not updated
987 * at all and this driver doesn't track authentication state.
988 */
989 spin_lock_irq(&mac->lock);
990 iw_stats->qual.qual = mac->qual_average;
991 iw_stats->qual.level = mac->rssi_average;
992 iw_stats->qual.updated = IW_QUAL_QUAL_UPDATED|IW_QUAL_LEVEL_UPDATED|
993 IW_QUAL_NOISE_INVALID;
994 spin_unlock_irq(&mac->lock);
995 /* TODO: update counter */
996 return iw_stats;
997}
998
999#ifdef DEBUG
1000static const char* decryption_types[] = {
1001 [ZD_RX_NO_WEP] = "none",
1002 [ZD_RX_WEP64] = "WEP64",
1003 [ZD_RX_TKIP] = "TKIP",
1004 [ZD_RX_AES] = "AES",
1005 [ZD_RX_WEP128] = "WEP128",
1006 [ZD_RX_WEP256] = "WEP256",
1007};
1008
1009static const char *decryption_type_string(u8 type)
1010{
1011 const char *s;
1012
1013 if (type < ARRAY_SIZE(decryption_types)) {
1014 s = decryption_types[type];
1015 } else {
1016 s = NULL;
1017 }
1018 return s ? s : "unknown";
1019}
1020
1021static int is_ofdm(u8 frame_status)
1022{
1023 return (frame_status & ZD_RX_OFDM);
1024}
1025
1026void zd_dump_rx_status(const struct rx_status *status)
1027{
1028 const char* modulation;
1029 u8 quality;
1030
1031 if (is_ofdm(status->frame_status)) {
1032 modulation = "ofdm";
1033 quality = status->signal_quality_ofdm;
1034 } else {
1035 modulation = "cck";
1036 quality = status->signal_quality_cck;
1037 }
1038 pr_debug("rx status %s strength %#04x qual %#04x decryption %s\n",
1039 modulation, status->signal_strength, quality,
1040 decryption_type_string(status->decryption_type));
1041 if (status->frame_status & ZD_RX_ERROR) {
1042 pr_debug("rx error %s%s%s%s%s%s\n",
1043 (status->frame_status & ZD_RX_TIMEOUT_ERROR) ?
1044 "timeout " : "",
1045 (status->frame_status & ZD_RX_FIFO_OVERRUN_ERROR) ?
1046 "fifo " : "",
1047 (status->frame_status & ZD_RX_DECRYPTION_ERROR) ?
1048 "decryption " : "",
1049 (status->frame_status & ZD_RX_CRC32_ERROR) ?
1050 "crc32 " : "",
1051 (status->frame_status & ZD_RX_NO_ADDR1_MATCH_ERROR) ?
1052 "addr1 " : "",
1053 (status->frame_status & ZD_RX_CRC16_ERROR) ?
1054 "crc16" : "");
1055 }
1056}
1057#endif /* DEBUG */
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.h b/drivers/net/wireless/zd1211rw/zd_mac.h
new file mode 100644
index 000000000000..71e382c589ee
--- /dev/null
+++ b/drivers/net/wireless/zd1211rw/zd_mac.h
@@ -0,0 +1,190 @@
1/* zd_mac.c
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 */
17
18#ifndef _ZD_MAC_H
19#define _ZD_MAC_H
20
21#include <linux/wireless.h>
22#include <linux/kernel.h>
23#include <net/ieee80211.h>
24#include <net/ieee80211softmac.h>
25
26#include "zd_chip.h"
27#include "zd_netdev.h"
28
29struct zd_ctrlset {
30 u8 modulation;
31 __le16 tx_length;
32 u8 control;
33 /* stores only the difference to tx_length on ZD1211B */
34 __le16 packet_length;
35 __le16 current_length;
36 u8 service;
37 __le16 next_frame_length;
38} __attribute__((packed));
39
40#define ZD_CS_RESERVED_SIZE 25
41
42/* zd_crtlset field modulation */
43#define ZD_CS_RATE_MASK 0x0f
44#define ZD_CS_TYPE_MASK 0x10
45#define ZD_CS_RATE(modulation) ((modulation) & ZD_CS_RATE_MASK)
46#define ZD_CS_TYPE(modulation) ((modulation) & ZD_CS_TYPE_MASK)
47
48#define ZD_CS_CCK 0x00
49#define ZD_CS_OFDM 0x10
50
51#define ZD_CS_CCK_RATE_1M 0x00
52#define ZD_CS_CCK_RATE_2M 0x01
53#define ZD_CS_CCK_RATE_5_5M 0x02
54#define ZD_CS_CCK_RATE_11M 0x03
55/* The rates for OFDM are encoded as in the PLCP header. Use ZD_OFDM_RATE_*.
56 */
57
58/* bit 5 is preamble (when in CCK mode), or a/g selection (when in OFDM mode) */
59#define ZD_CS_CCK_PREA_LONG 0x00
60#define ZD_CS_CCK_PREA_SHORT 0x20
61#define ZD_CS_OFDM_MODE_11G 0x00
62#define ZD_CS_OFDM_MODE_11A 0x20
63
64/* zd_ctrlset control field */
65#define ZD_CS_NEED_RANDOM_BACKOFF 0x01
66#define ZD_CS_MULTICAST 0x02
67
68#define ZD_CS_FRAME_TYPE_MASK 0x0c
69#define ZD_CS_DATA_FRAME 0x00
70#define ZD_CS_PS_POLL_FRAME 0x04
71#define ZD_CS_MANAGEMENT_FRAME 0x08
72#define ZD_CS_NO_SEQUENCE_CTL_FRAME 0x0c
73
74#define ZD_CS_WAKE_DESTINATION 0x10
75#define ZD_CS_RTS 0x20
76#define ZD_CS_ENCRYPT 0x40
77#define ZD_CS_SELF_CTS 0x80
78
79/* Incoming frames are prepended by a PLCP header */
80#define ZD_PLCP_HEADER_SIZE 5
81
82struct rx_length_info {
83 __le16 length[3];
84 __le16 tag;
85} __attribute__((packed));
86
87#define RX_LENGTH_INFO_TAG 0x697e
88
89struct rx_status {
90 /* rssi */
91 u8 signal_strength;
92 u8 signal_quality_cck;
93 u8 signal_quality_ofdm;
94 u8 decryption_type;
95 u8 frame_status;
96} __attribute__((packed));
97
98/* rx_status field decryption_type */
99#define ZD_RX_NO_WEP 0
100#define ZD_RX_WEP64 1
101#define ZD_RX_TKIP 2
102#define ZD_RX_AES 4
103#define ZD_RX_WEP128 5
104#define ZD_RX_WEP256 6
105
106/* rx_status field frame_status */
107#define ZD_RX_FRAME_MODULATION_MASK 0x01
108#define ZD_RX_CCK 0x00
109#define ZD_RX_OFDM 0x01
110
111#define ZD_RX_TIMEOUT_ERROR 0x02
112#define ZD_RX_FIFO_OVERRUN_ERROR 0x04
113#define ZD_RX_DECRYPTION_ERROR 0x08
114#define ZD_RX_CRC32_ERROR 0x10
115#define ZD_RX_NO_ADDR1_MATCH_ERROR 0x20
116#define ZD_RX_CRC16_ERROR 0x40
117#define ZD_RX_ERROR 0x80
118
119enum mac_flags {
120 MAC_FIXED_CHANNEL = 0x01,
121};
122
123struct zd_mac {
124 struct net_device *netdev;
125 struct zd_chip chip;
126 spinlock_t lock;
127 /* Unlocked reading possible */
128 struct iw_statistics iw_stats;
129 u8 qual_average;
130 u8 rssi_average;
131 u8 regdomain;
132 u8 default_regdomain;
133 u8 requested_channel;
134};
135
136static inline struct ieee80211_device *zd_mac_to_ieee80211(struct zd_mac *mac)
137{
138 return zd_netdev_ieee80211(mac->netdev);
139}
140
141static inline struct zd_mac *zd_netdev_mac(struct net_device *netdev)
142{
143 return ieee80211softmac_priv(netdev);
144}
145
146static inline struct zd_mac *zd_chip_to_mac(struct zd_chip *chip)
147{
148 return container_of(chip, struct zd_mac, chip);
149}
150
151static inline struct zd_mac *zd_usb_to_mac(struct zd_usb *usb)
152{
153 return zd_chip_to_mac(zd_usb_to_chip(usb));
154}
155
156#define zd_mac_dev(mac) (zd_chip_dev(&(mac)->chip))
157
158int zd_mac_init(struct zd_mac *mac,
159 struct net_device *netdev,
160 struct usb_interface *intf);
161void zd_mac_clear(struct zd_mac *mac);
162
163int zd_mac_init_hw(struct zd_mac *mac, u8 device_type);
164
165int zd_mac_open(struct net_device *netdev);
166int zd_mac_stop(struct net_device *netdev);
167int zd_mac_set_mac_address(struct net_device *dev, void *p);
168
169int zd_mac_rx(struct zd_mac *mac, const u8 *buffer, unsigned int length);
170
171int zd_mac_set_regdomain(struct zd_mac *zd_mac, u8 regdomain);
172u8 zd_mac_get_regdomain(struct zd_mac *zd_mac);
173
174int zd_mac_request_channel(struct zd_mac *mac, u8 channel);
175int zd_mac_get_channel(struct zd_mac *mac, u8 *channel, u8 *flags);
176
177int zd_mac_set_mode(struct zd_mac *mac, u32 mode);
178int zd_mac_get_mode(struct zd_mac *mac, u32 *mode);
179
180int zd_mac_get_range(struct zd_mac *mac, struct iw_range *range);
181
182struct iw_statistics *zd_mac_get_wireless_stats(struct net_device *ndev);
183
184#ifdef DEBUG
185void zd_dump_rx_status(const struct rx_status *status);
186#else
187#define zd_dump_rx_status(status)
188#endif /* DEBUG */
189
190#endif /* _ZD_MAC_H */
diff --git a/drivers/net/wireless/zd1211rw/zd_netdev.c b/drivers/net/wireless/zd1211rw/zd_netdev.c
new file mode 100644
index 000000000000..9df232c2c863
--- /dev/null
+++ b/drivers/net/wireless/zd1211rw/zd_netdev.c
@@ -0,0 +1,267 @@
1/* zd_netdev.c
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 */
17
18#include <linux/netdevice.h>
19#include <linux/etherdevice.h>
20#include <linux/skbuff.h>
21#include <net/ieee80211.h>
22#include <net/ieee80211softmac.h>
23#include <net/ieee80211softmac_wx.h>
24#include <net/iw_handler.h>
25
26#include "zd_def.h"
27#include "zd_netdev.h"
28#include "zd_mac.h"
29#include "zd_ieee80211.h"
30
31/* Region 0 means reset regdomain to default. */
32static int zd_set_regdomain(struct net_device *netdev,
33 struct iw_request_info *info,
34 union iwreq_data *req, char *extra)
35{
36 const u8 *regdomain = (u8 *)req;
37 return zd_mac_set_regdomain(zd_netdev_mac(netdev), *regdomain);
38}
39
40static int zd_get_regdomain(struct net_device *netdev,
41 struct iw_request_info *info,
42 union iwreq_data *req, char *extra)
43{
44 u8 *regdomain = (u8 *)req;
45 if (!regdomain)
46 return -EINVAL;
47 *regdomain = zd_mac_get_regdomain(zd_netdev_mac(netdev));
48 return 0;
49}
50
51static const struct iw_priv_args zd_priv_args[] = {
52 {
53 .cmd = ZD_PRIV_SET_REGDOMAIN,
54 .set_args = IW_PRIV_TYPE_BYTE | IW_PRIV_SIZE_FIXED | 1,
55 .name = "set_regdomain",
56 },
57 {
58 .cmd = ZD_PRIV_GET_REGDOMAIN,
59 .get_args = IW_PRIV_TYPE_BYTE | IW_PRIV_SIZE_FIXED | 1,
60 .name = "get_regdomain",
61 },
62};
63
64#define PRIV_OFFSET(x) [(x)-SIOCIWFIRSTPRIV]
65
66static const iw_handler zd_priv_handler[] = {
67 PRIV_OFFSET(ZD_PRIV_SET_REGDOMAIN) = zd_set_regdomain,
68 PRIV_OFFSET(ZD_PRIV_GET_REGDOMAIN) = zd_get_regdomain,
69};
70
71static int iw_get_name(struct net_device *netdev,
72 struct iw_request_info *info,
73 union iwreq_data *req, char *extra)
74{
75 /* FIXME: check whether 802.11a will also supported, add also
76 * zd1211B, if we support it.
77 */
78 strlcpy(req->name, "802.11g zd1211", IFNAMSIZ);
79 return 0;
80}
81
82static int iw_set_freq(struct net_device *netdev,
83 struct iw_request_info *info,
84 union iwreq_data *req, char *extra)
85{
86 int r;
87 struct zd_mac *mac = zd_netdev_mac(netdev);
88 struct iw_freq *freq = &req->freq;
89 u8 channel;
90
91 r = zd_find_channel(&channel, freq);
92 if (r < 0)
93 return r;
94 r = zd_mac_request_channel(mac, channel);
95 return r;
96}
97
98static int iw_get_freq(struct net_device *netdev,
99 struct iw_request_info *info,
100 union iwreq_data *req, char *extra)
101{
102 int r;
103 struct zd_mac *mac = zd_netdev_mac(netdev);
104 struct iw_freq *freq = &req->freq;
105 u8 channel;
106 u8 flags;
107
108 r = zd_mac_get_channel(mac, &channel, &flags);
109 if (r)
110 return r;
111
112 freq->flags = (flags & MAC_FIXED_CHANNEL) ?
113 IW_FREQ_FIXED : IW_FREQ_AUTO;
114 dev_dbg_f(zd_mac_dev(mac), "channel %s\n",
115 (flags & MAC_FIXED_CHANNEL) ? "fixed" : "auto");
116 return zd_channel_to_freq(freq, channel);
117}
118
119static int iw_set_mode(struct net_device *netdev,
120 struct iw_request_info *info,
121 union iwreq_data *req, char *extra)
122{
123 return zd_mac_set_mode(zd_netdev_mac(netdev), req->mode);
124}
125
126static int iw_get_mode(struct net_device *netdev,
127 struct iw_request_info *info,
128 union iwreq_data *req, char *extra)
129{
130 return zd_mac_get_mode(zd_netdev_mac(netdev), &req->mode);
131}
132
133static int iw_get_range(struct net_device *netdev,
134 struct iw_request_info *info,
135 union iwreq_data *req, char *extra)
136{
137 struct iw_range *range = (struct iw_range *)extra;
138
139 dev_dbg_f(zd_mac_dev(zd_netdev_mac(netdev)), "\n");
140 req->data.length = sizeof(*range);
141 return zd_mac_get_range(zd_netdev_mac(netdev), range);
142}
143
144static int iw_set_encode(struct net_device *netdev,
145 struct iw_request_info *info,
146 union iwreq_data *data,
147 char *extra)
148{
149 return ieee80211_wx_set_encode(zd_netdev_ieee80211(netdev), info,
150 data, extra);
151}
152
153static int iw_get_encode(struct net_device *netdev,
154 struct iw_request_info *info,
155 union iwreq_data *data,
156 char *extra)
157{
158 return ieee80211_wx_get_encode(zd_netdev_ieee80211(netdev), info,
159 data, extra);
160}
161
162static int iw_set_encodeext(struct net_device *netdev,
163 struct iw_request_info *info,
164 union iwreq_data *data,
165 char *extra)
166{
167 return ieee80211_wx_set_encodeext(zd_netdev_ieee80211(netdev), info,
168 data, extra);
169}
170
171static int iw_get_encodeext(struct net_device *netdev,
172 struct iw_request_info *info,
173 union iwreq_data *data,
174 char *extra)
175{
176 return ieee80211_wx_get_encodeext(zd_netdev_ieee80211(netdev), info,
177 data, extra);
178}
179
180#define WX(x) [(x)-SIOCIWFIRST]
181
182static const iw_handler zd_standard_iw_handlers[] = {
183 WX(SIOCGIWNAME) = iw_get_name,
184 WX(SIOCSIWFREQ) = iw_set_freq,
185 WX(SIOCGIWFREQ) = iw_get_freq,
186 WX(SIOCSIWMODE) = iw_set_mode,
187 WX(SIOCGIWMODE) = iw_get_mode,
188 WX(SIOCGIWRANGE) = iw_get_range,
189 WX(SIOCSIWENCODE) = iw_set_encode,
190 WX(SIOCGIWENCODE) = iw_get_encode,
191 WX(SIOCSIWENCODEEXT) = iw_set_encodeext,
192 WX(SIOCGIWENCODEEXT) = iw_get_encodeext,
193 WX(SIOCSIWAUTH) = ieee80211_wx_set_auth,
194 WX(SIOCGIWAUTH) = ieee80211_wx_get_auth,
195 WX(SIOCSIWSCAN) = ieee80211softmac_wx_trigger_scan,
196 WX(SIOCGIWSCAN) = ieee80211softmac_wx_get_scan_results,
197 WX(SIOCSIWESSID) = ieee80211softmac_wx_set_essid,
198 WX(SIOCGIWESSID) = ieee80211softmac_wx_get_essid,
199 WX(SIOCSIWAP) = ieee80211softmac_wx_set_wap,
200 WX(SIOCGIWAP) = ieee80211softmac_wx_get_wap,
201 WX(SIOCSIWRATE) = ieee80211softmac_wx_set_rate,
202 WX(SIOCGIWRATE) = ieee80211softmac_wx_get_rate,
203 WX(SIOCSIWGENIE) = ieee80211softmac_wx_set_genie,
204 WX(SIOCGIWGENIE) = ieee80211softmac_wx_get_genie,
205 WX(SIOCSIWMLME) = ieee80211softmac_wx_set_mlme,
206};
207
208static const struct iw_handler_def iw_handler_def = {
209 .standard = zd_standard_iw_handlers,
210 .num_standard = ARRAY_SIZE(zd_standard_iw_handlers),
211 .private = zd_priv_handler,
212 .num_private = ARRAY_SIZE(zd_priv_handler),
213 .private_args = zd_priv_args,
214 .num_private_args = ARRAY_SIZE(zd_priv_args),
215 .get_wireless_stats = zd_mac_get_wireless_stats,
216};
217
218struct net_device *zd_netdev_alloc(struct usb_interface *intf)
219{
220 int r;
221 struct net_device *netdev;
222 struct zd_mac *mac;
223
224 netdev = alloc_ieee80211softmac(sizeof(struct zd_mac));
225 if (!netdev) {
226 dev_dbg_f(&intf->dev, "out of memory\n");
227 return NULL;
228 }
229
230 mac = zd_netdev_mac(netdev);
231 r = zd_mac_init(mac, netdev, intf);
232 if (r) {
233 usb_set_intfdata(intf, NULL);
234 free_ieee80211(netdev);
235 return NULL;
236 }
237
238 SET_MODULE_OWNER(netdev);
239 SET_NETDEV_DEV(netdev, &intf->dev);
240
241 dev_dbg_f(&intf->dev, "netdev->flags %#06hx\n", netdev->flags);
242 dev_dbg_f(&intf->dev, "netdev->features %#010lx\n", netdev->features);
243
244 netdev->open = zd_mac_open;
245 netdev->stop = zd_mac_stop;
246 /* netdev->get_stats = */
247 /* netdev->set_multicast_list = */
248 netdev->set_mac_address = zd_mac_set_mac_address;
249 netdev->wireless_handlers = &iw_handler_def;
250 /* netdev->ethtool_ops = */
251
252 return netdev;
253}
254
255void zd_netdev_free(struct net_device *netdev)
256{
257 if (!netdev)
258 return;
259
260 zd_mac_clear(zd_netdev_mac(netdev));
261 free_ieee80211(netdev);
262}
263
264void zd_netdev_disconnect(struct net_device *netdev)
265{
266 unregister_netdev(netdev);
267}
diff --git a/drivers/net/wireless/zd1211rw/zd_netdev.h b/drivers/net/wireless/zd1211rw/zd_netdev.h
new file mode 100644
index 000000000000..374a957073c1
--- /dev/null
+++ b/drivers/net/wireless/zd1211rw/zd_netdev.h
@@ -0,0 +1,45 @@
1/* zd_netdev.h: Header for net device related functions.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 */
17
18#ifndef _ZD_NETDEV_H
19#define _ZD_NETDEV_H
20
21#include <linux/usb.h>
22#include <linux/netdevice.h>
23#include <net/ieee80211.h>
24
25#define ZD_PRIV_SET_REGDOMAIN (SIOCIWFIRSTPRIV)
26#define ZD_PRIV_GET_REGDOMAIN (SIOCIWFIRSTPRIV+1)
27
28static inline struct ieee80211_device *zd_netdev_ieee80211(
29 struct net_device *ndev)
30{
31 return netdev_priv(ndev);
32}
33
34static inline struct net_device *zd_ieee80211_to_netdev(
35 struct ieee80211_device *ieee)
36{
37 return ieee->dev;
38}
39
40struct net_device *zd_netdev_alloc(struct usb_interface *intf);
41void zd_netdev_free(struct net_device *netdev);
42
43void zd_netdev_disconnect(struct net_device *netdev);
44
45#endif /* _ZD_NETDEV_H */
diff --git a/drivers/net/wireless/zd1211rw/zd_rf.c b/drivers/net/wireless/zd1211rw/zd_rf.c
new file mode 100644
index 000000000000..d3770d2c61bc
--- /dev/null
+++ b/drivers/net/wireless/zd1211rw/zd_rf.c
@@ -0,0 +1,151 @@
1/* zd_rf.c
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 */
17
18#include <linux/errno.h>
19#include <linux/string.h>
20
21#include "zd_def.h"
22#include "zd_rf.h"
23#include "zd_ieee80211.h"
24#include "zd_chip.h"
25
26static const char *rfs[] = {
27 [0] = "unknown RF0",
28 [1] = "unknown RF1",
29 [UW2451_RF] = "UW2451_RF",
30 [UCHIP_RF] = "UCHIP_RF",
31 [AL2230_RF] = "AL2230_RF",
32 [AL7230B_RF] = "AL7230B_RF",
33 [THETA_RF] = "THETA_RF",
34 [AL2210_RF] = "AL2210_RF",
35 [MAXIM_NEW_RF] = "MAXIM_NEW_RF",
36 [UW2453_RF] = "UW2453_RF",
37 [AL2230S_RF] = "AL2230S_RF",
38 [RALINK_RF] = "RALINK_RF",
39 [INTERSIL_RF] = "INTERSIL_RF",
40 [RF2959_RF] = "RF2959_RF",
41 [MAXIM_NEW2_RF] = "MAXIM_NEW2_RF",
42 [PHILIPS_RF] = "PHILIPS_RF",
43};
44
45const char *zd_rf_name(u8 type)
46{
47 if (type & 0xf0)
48 type = 0;
49 return rfs[type];
50}
51
52void zd_rf_init(struct zd_rf *rf)
53{
54 memset(rf, 0, sizeof(*rf));
55}
56
57void zd_rf_clear(struct zd_rf *rf)
58{
59 memset(rf, 0, sizeof(*rf));
60}
61
62int zd_rf_init_hw(struct zd_rf *rf, u8 type)
63{
64 int r, t;
65 struct zd_chip *chip = zd_rf_to_chip(rf);
66
67 ZD_ASSERT(mutex_is_locked(&chip->mutex));
68 switch (type) {
69 case RF2959_RF:
70 r = zd_rf_init_rf2959(rf);
71 if (r)
72 return r;
73 break;
74 case AL2230_RF:
75 r = zd_rf_init_al2230(rf);
76 if (r)
77 return r;
78 break;
79 default:
80 dev_err(zd_chip_dev(chip),
81 "RF %s %#x is not supported\n", zd_rf_name(type), type);
82 rf->type = 0;
83 return -ENODEV;
84 }
85
86 rf->type = type;
87
88 r = zd_chip_lock_phy_regs(chip);
89 if (r)
90 return r;
91 t = rf->init_hw(rf);
92 r = zd_chip_unlock_phy_regs(chip);
93 if (t)
94 r = t;
95 return r;
96}
97
98int zd_rf_scnprint_id(struct zd_rf *rf, char *buffer, size_t size)
99{
100 return scnprintf(buffer, size, "%s", zd_rf_name(rf->type));
101}
102
103int zd_rf_set_channel(struct zd_rf *rf, u8 channel)
104{
105 int r;
106
107 ZD_ASSERT(mutex_is_locked(&zd_rf_to_chip(rf)->mutex));
108 if (channel < MIN_CHANNEL24)
109 return -EINVAL;
110 if (channel > MAX_CHANNEL24)
111 return -EINVAL;
112 dev_dbg_f(zd_chip_dev(zd_rf_to_chip(rf)), "channel: %d\n", channel);
113
114 r = rf->set_channel(rf, channel);
115 if (r >= 0)
116 rf->channel = channel;
117 return r;
118}
119
120int zd_switch_radio_on(struct zd_rf *rf)
121{
122 int r, t;
123 struct zd_chip *chip = zd_rf_to_chip(rf);
124
125 ZD_ASSERT(mutex_is_locked(&chip->mutex));
126 r = zd_chip_lock_phy_regs(chip);
127 if (r)
128 return r;
129 t = rf->switch_radio_on(rf);
130 r = zd_chip_unlock_phy_regs(chip);
131 if (t)
132 r = t;
133 return r;
134}
135
136int zd_switch_radio_off(struct zd_rf *rf)
137{
138 int r, t;
139 struct zd_chip *chip = zd_rf_to_chip(rf);
140
141 /* TODO: move phy regs handling to zd_chip */
142 ZD_ASSERT(mutex_is_locked(&chip->mutex));
143 r = zd_chip_lock_phy_regs(chip);
144 if (r)
145 return r;
146 t = rf->switch_radio_off(rf);
147 r = zd_chip_unlock_phy_regs(chip);
148 if (t)
149 r = t;
150 return r;
151}
diff --git a/drivers/net/wireless/zd1211rw/zd_rf.h b/drivers/net/wireless/zd1211rw/zd_rf.h
new file mode 100644
index 000000000000..ea30f693fcc8
--- /dev/null
+++ b/drivers/net/wireless/zd1211rw/zd_rf.h
@@ -0,0 +1,82 @@
1/* zd_rf.h
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 */
17
18#ifndef _ZD_RF_H
19#define _ZD_RF_H
20
21#include "zd_types.h"
22
23#define UW2451_RF 0x2
24#define UCHIP_RF 0x3
25#define AL2230_RF 0x4
26#define AL7230B_RF 0x5 /* a,b,g */
27#define THETA_RF 0x6
28#define AL2210_RF 0x7
29#define MAXIM_NEW_RF 0x8
30#define UW2453_RF 0x9
31#define AL2230S_RF 0xa
32#define RALINK_RF 0xb
33#define INTERSIL_RF 0xc
34#define RF2959_RF 0xd
35#define MAXIM_NEW2_RF 0xe
36#define PHILIPS_RF 0xf
37
38#define RF_CHANNEL(ch) [(ch)-1]
39
40/* Provides functions of the RF transceiver. */
41
42enum {
43 RF_REG_BITS = 6,
44 RF_VALUE_BITS = 18,
45 RF_RV_BITS = RF_REG_BITS + RF_VALUE_BITS,
46};
47
48struct zd_rf {
49 u8 type;
50
51 u8 channel;
52 /*
53 * Whether this RF should patch the 6M band edge
54 * (assuming E2P_POD agrees)
55 */
56 u8 patch_6m_band_edge:1;
57
58 /* RF-specific functions */
59 int (*init_hw)(struct zd_rf *rf);
60 int (*set_channel)(struct zd_rf *rf, u8 channel);
61 int (*switch_radio_on)(struct zd_rf *rf);
62 int (*switch_radio_off)(struct zd_rf *rf);
63};
64
65const char *zd_rf_name(u8 type);
66void zd_rf_init(struct zd_rf *rf);
67void zd_rf_clear(struct zd_rf *rf);
68int zd_rf_init_hw(struct zd_rf *rf, u8 type);
69
70int zd_rf_scnprint_id(struct zd_rf *rf, char *buffer, size_t size);
71
72int zd_rf_set_channel(struct zd_rf *rf, u8 channel);
73
74int zd_switch_radio_on(struct zd_rf *rf);
75int zd_switch_radio_off(struct zd_rf *rf);
76
77/* Functions for individual RF chips */
78
79int zd_rf_init_rf2959(struct zd_rf *rf);
80int zd_rf_init_al2230(struct zd_rf *rf);
81
82#endif /* _ZD_RF_H */
diff --git a/drivers/net/wireless/zd1211rw/zd_rf_al2230.c b/drivers/net/wireless/zd1211rw/zd_rf_al2230.c
new file mode 100644
index 000000000000..0948b25f660d
--- /dev/null
+++ b/drivers/net/wireless/zd1211rw/zd_rf_al2230.c
@@ -0,0 +1,308 @@
1/* zd_rf_al2230.c: Functions for the AL2230 RF controller
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 */
17
18#include <linux/kernel.h>
19
20#include "zd_rf.h"
21#include "zd_usb.h"
22#include "zd_chip.h"
23
24static const u32 al2230_table[][3] = {
25 RF_CHANNEL( 1) = { 0x03f790, 0x033331, 0x00000d, },
26 RF_CHANNEL( 2) = { 0x03f790, 0x0b3331, 0x00000d, },
27 RF_CHANNEL( 3) = { 0x03e790, 0x033331, 0x00000d, },
28 RF_CHANNEL( 4) = { 0x03e790, 0x0b3331, 0x00000d, },
29 RF_CHANNEL( 5) = { 0x03f7a0, 0x033331, 0x00000d, },
30 RF_CHANNEL( 6) = { 0x03f7a0, 0x0b3331, 0x00000d, },
31 RF_CHANNEL( 7) = { 0x03e7a0, 0x033331, 0x00000d, },
32 RF_CHANNEL( 8) = { 0x03e7a0, 0x0b3331, 0x00000d, },
33 RF_CHANNEL( 9) = { 0x03f7b0, 0x033331, 0x00000d, },
34 RF_CHANNEL(10) = { 0x03f7b0, 0x0b3331, 0x00000d, },
35 RF_CHANNEL(11) = { 0x03e7b0, 0x033331, 0x00000d, },
36 RF_CHANNEL(12) = { 0x03e7b0, 0x0b3331, 0x00000d, },
37 RF_CHANNEL(13) = { 0x03f7c0, 0x033331, 0x00000d, },
38 RF_CHANNEL(14) = { 0x03e7c0, 0x066661, 0x00000d, },
39};
40
41static int zd1211_al2230_init_hw(struct zd_rf *rf)
42{
43 int r;
44 struct zd_chip *chip = zd_rf_to_chip(rf);
45
46 static const struct zd_ioreq16 ioreqs[] = {
47 { CR15, 0x20 }, { CR23, 0x40 }, { CR24, 0x20 },
48 { CR26, 0x11 }, { CR28, 0x3e }, { CR29, 0x00 },
49 { CR44, 0x33 }, { CR106, 0x2a }, { CR107, 0x1a },
50 { CR109, 0x09 }, { CR110, 0x27 }, { CR111, 0x2b },
51 { CR112, 0x2b }, { CR119, 0x0a }, { CR10, 0x89 },
52 /* for newest (3rd cut) AL2300 */
53 { CR17, 0x28 },
54 { CR26, 0x93 }, { CR34, 0x30 },
55 /* for newest (3rd cut) AL2300 */
56 { CR35, 0x3e },
57 { CR41, 0x24 }, { CR44, 0x32 },
58 /* for newest (3rd cut) AL2300 */
59 { CR46, 0x96 },
60 { CR47, 0x1e }, { CR79, 0x58 }, { CR80, 0x30 },
61 { CR81, 0x30 }, { CR87, 0x0a }, { CR89, 0x04 },
62 { CR92, 0x0a }, { CR99, 0x28 }, { CR100, 0x00 },
63 { CR101, 0x13 }, { CR102, 0x27 }, { CR106, 0x24 },
64 { CR107, 0x2a }, { CR109, 0x09 }, { CR110, 0x13 },
65 { CR111, 0x1f }, { CR112, 0x1f }, { CR113, 0x27 },
66 { CR114, 0x27 },
67 /* for newest (3rd cut) AL2300 */
68 { CR115, 0x24 },
69 { CR116, 0x24 }, { CR117, 0xf4 }, { CR118, 0xfc },
70 { CR119, 0x10 }, { CR120, 0x4f }, { CR121, 0x77 },
71 { CR122, 0xe0 }, { CR137, 0x88 }, { CR252, 0xff },
72 { CR253, 0xff },
73
74 /* These following happen separately in the vendor driver */
75 { },
76
77 /* shdnb(PLL_ON)=0 */
78 { CR251, 0x2f },
79 /* shdnb(PLL_ON)=1 */
80 { CR251, 0x3f },
81 { CR138, 0x28 }, { CR203, 0x06 },
82 };
83
84 static const u32 rv[] = {
85 /* Channel 1 */
86 0x03f790,
87 0x033331,
88 0x00000d,
89
90 0x0b3331,
91 0x03b812,
92 0x00fff3,
93 0x000da4,
94 0x0f4dc5, /* fix freq shift, 0x04edc5 */
95 0x0805b6,
96 0x011687,
97 0x000688,
98 0x0403b9, /* external control TX power (CR31) */
99 0x00dbba,
100 0x00099b,
101 0x0bdffc,
102 0x00000d,
103 0x00500f,
104
105 /* These writes happen separately in the vendor driver */
106 0x00d00f,
107 0x004c0f,
108 0x00540f,
109 0x00700f,
110 0x00500f,
111 };
112
113 r = zd_iowrite16a_locked(chip, ioreqs, ARRAY_SIZE(ioreqs));
114 if (r)
115 return r;
116
117 r = zd_rfwritev_locked(chip, rv, ARRAY_SIZE(rv), RF_RV_BITS);
118 if (r)
119 return r;
120
121 return 0;
122}
123
124static int zd1211b_al2230_init_hw(struct zd_rf *rf)
125{
126 int r;
127 struct zd_chip *chip = zd_rf_to_chip(rf);
128
129 static const struct zd_ioreq16 ioreqs1[] = {
130 { CR10, 0x89 }, { CR15, 0x20 },
131 { CR17, 0x2B }, /* for newest(3rd cut) AL2230 */
132 { CR23, 0x40 }, { CR24, 0x20 }, { CR26, 0x93 },
133 { CR28, 0x3e }, { CR29, 0x00 },
134 { CR33, 0x28 }, /* 5621 */
135 { CR34, 0x30 },
136 { CR35, 0x3e }, /* for newest(3rd cut) AL2230 */
137 { CR41, 0x24 }, { CR44, 0x32 },
138 { CR46, 0x99 }, /* for newest(3rd cut) AL2230 */
139 { CR47, 0x1e },
140
141 /* ZD1211B 05.06.10 */
142 { CR48, 0x00 }, { CR49, 0x00 }, { CR51, 0x01 },
143 { CR52, 0x80 }, { CR53, 0x7e }, { CR65, 0x00 },
144 { CR66, 0x00 }, { CR67, 0x00 }, { CR68, 0x00 },
145 { CR69, 0x28 },
146
147 { CR79, 0x58 }, { CR80, 0x30 }, { CR81, 0x30 },
148 { CR87, 0x0a }, { CR89, 0x04 },
149 { CR91, 0x00 }, /* 5621 */
150 { CR92, 0x0a },
151 { CR98, 0x8d }, /* 4804, for 1212 new algorithm */
152 { CR99, 0x00 }, /* 5621 */
153 { CR101, 0x13 }, { CR102, 0x27 },
154 { CR106, 0x24 }, /* for newest(3rd cut) AL2230 */
155 { CR107, 0x2a },
156 { CR109, 0x13 }, /* 4804, for 1212 new algorithm */
157 { CR110, 0x1f }, /* 4804, for 1212 new algorithm */
158 { CR111, 0x1f }, { CR112, 0x1f }, { CR113, 0x27 },
159 { CR114, 0x27 },
160 { CR115, 0x26 }, /* 24->26 at 4902 for newest(3rd cut) AL2230 */
161 { CR116, 0x24 },
162 { CR117, 0xfa }, /* for 1211b */
163 { CR118, 0xfa }, /* for 1211b */
164 { CR119, 0x10 },
165 { CR120, 0x4f },
166 { CR121, 0x6c }, /* for 1211b */
167 { CR122, 0xfc }, /* E0->FC at 4902 */
168 { CR123, 0x57 }, /* 5623 */
169 { CR125, 0xad }, /* 4804, for 1212 new algorithm */
170 { CR126, 0x6c }, /* 5614 */
171 { CR127, 0x03 }, /* 4804, for 1212 new algorithm */
172 { CR137, 0x50 }, /* 5614 */
173 { CR138, 0xa8 },
174 { CR144, 0xac }, /* 5621 */
175 { CR150, 0x0d }, { CR252, 0x00 }, { CR253, 0x00 },
176 };
177
178 static const u32 rv1[] = {
179 /* channel 1 */
180 0x03f790,
181 0x033331,
182 0x00000d,
183
184 0x0b3331,
185 0x03b812,
186 0x00fff3,
187 0x0005a4,
188 0x0f4dc5, /* fix freq shift 0x044dc5 */
189 0x0805b6,
190 0x0146c7,
191 0x000688,
192 0x0403b9, /* External control TX power (CR31) */
193 0x00dbba,
194 0x00099b,
195 0x0bdffc,
196 0x00000d,
197 0x00580f,
198 };
199
200 static const struct zd_ioreq16 ioreqs2[] = {
201 { CR47, 0x1e }, { CR_RFCFG, 0x03 },
202 };
203
204 static const u32 rv2[] = {
205 0x00880f,
206 0x00080f,
207 };
208
209 static const struct zd_ioreq16 ioreqs3[] = {
210 { CR_RFCFG, 0x00 }, { CR47, 0x1e }, { CR251, 0x7f },
211 };
212
213 static const u32 rv3[] = {
214 0x00d80f,
215 0x00780f,
216 0x00580f,
217 };
218
219 static const struct zd_ioreq16 ioreqs4[] = {
220 { CR138, 0x28 }, { CR203, 0x06 },
221 };
222
223 r = zd_iowrite16a_locked(chip, ioreqs1, ARRAY_SIZE(ioreqs1));
224 if (r)
225 return r;
226 r = zd_rfwritev_locked(chip, rv1, ARRAY_SIZE(rv1), RF_RV_BITS);
227 if (r)
228 return r;
229 r = zd_iowrite16a_locked(chip, ioreqs2, ARRAY_SIZE(ioreqs2));
230 if (r)
231 return r;
232 r = zd_rfwritev_locked(chip, rv2, ARRAY_SIZE(rv2), RF_RV_BITS);
233 if (r)
234 return r;
235 r = zd_iowrite16a_locked(chip, ioreqs3, ARRAY_SIZE(ioreqs3));
236 if (r)
237 return r;
238 r = zd_rfwritev_locked(chip, rv3, ARRAY_SIZE(rv3), RF_RV_BITS);
239 if (r)
240 return r;
241 return zd_iowrite16a_locked(chip, ioreqs4, ARRAY_SIZE(ioreqs4));
242}
243
244static int al2230_set_channel(struct zd_rf *rf, u8 channel)
245{
246 int r;
247 const u32 *rv = al2230_table[channel-1];
248 struct zd_chip *chip = zd_rf_to_chip(rf);
249 static const struct zd_ioreq16 ioreqs[] = {
250 { CR138, 0x28 },
251 { CR203, 0x06 },
252 };
253
254 r = zd_rfwritev_locked(chip, rv, 3, RF_RV_BITS);
255 if (r)
256 return r;
257 return zd_iowrite16a_locked(chip, ioreqs, ARRAY_SIZE(ioreqs));
258}
259
260static int zd1211_al2230_switch_radio_on(struct zd_rf *rf)
261{
262 struct zd_chip *chip = zd_rf_to_chip(rf);
263 static const struct zd_ioreq16 ioreqs[] = {
264 { CR11, 0x00 },
265 { CR251, 0x3f },
266 };
267
268 return zd_iowrite16a_locked(chip, ioreqs, ARRAY_SIZE(ioreqs));
269}
270
271static int zd1211b_al2230_switch_radio_on(struct zd_rf *rf)
272{
273 struct zd_chip *chip = zd_rf_to_chip(rf);
274 static const struct zd_ioreq16 ioreqs[] = {
275 { CR11, 0x00 },
276 { CR251, 0x7f },
277 };
278
279 return zd_iowrite16a_locked(chip, ioreqs, ARRAY_SIZE(ioreqs));
280}
281
282static int al2230_switch_radio_off(struct zd_rf *rf)
283{
284 struct zd_chip *chip = zd_rf_to_chip(rf);
285 static const struct zd_ioreq16 ioreqs[] = {
286 { CR11, 0x04 },
287 { CR251, 0x2f },
288 };
289
290 return zd_iowrite16a_locked(chip, ioreqs, ARRAY_SIZE(ioreqs));
291}
292
293int zd_rf_init_al2230(struct zd_rf *rf)
294{
295 struct zd_chip *chip = zd_rf_to_chip(rf);
296
297 rf->set_channel = al2230_set_channel;
298 rf->switch_radio_off = al2230_switch_radio_off;
299 if (chip->is_zd1211b) {
300 rf->init_hw = zd1211b_al2230_init_hw;
301 rf->switch_radio_on = zd1211b_al2230_switch_radio_on;
302 } else {
303 rf->init_hw = zd1211_al2230_init_hw;
304 rf->switch_radio_on = zd1211_al2230_switch_radio_on;
305 }
306 rf->patch_6m_band_edge = 1;
307 return 0;
308}
diff --git a/drivers/net/wireless/zd1211rw/zd_rf_rf2959.c b/drivers/net/wireless/zd1211rw/zd_rf_rf2959.c
new file mode 100644
index 000000000000..58247271cc24
--- /dev/null
+++ b/drivers/net/wireless/zd1211rw/zd_rf_rf2959.c
@@ -0,0 +1,279 @@
1/* zd_rf_rfmd.c: Functions for the RFMD RF controller
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 */
17
18#include <linux/kernel.h>
19
20#include "zd_rf.h"
21#include "zd_usb.h"
22#include "zd_chip.h"
23
24static u32 rf2959_table[][2] = {
25 RF_CHANNEL( 1) = { 0x181979, 0x1e6666 },
26 RF_CHANNEL( 2) = { 0x181989, 0x1e6666 },
27 RF_CHANNEL( 3) = { 0x181999, 0x1e6666 },
28 RF_CHANNEL( 4) = { 0x1819a9, 0x1e6666 },
29 RF_CHANNEL( 5) = { 0x1819b9, 0x1e6666 },
30 RF_CHANNEL( 6) = { 0x1819c9, 0x1e6666 },
31 RF_CHANNEL( 7) = { 0x1819d9, 0x1e6666 },
32 RF_CHANNEL( 8) = { 0x1819e9, 0x1e6666 },
33 RF_CHANNEL( 9) = { 0x1819f9, 0x1e6666 },
34 RF_CHANNEL(10) = { 0x181a09, 0x1e6666 },
35 RF_CHANNEL(11) = { 0x181a19, 0x1e6666 },
36 RF_CHANNEL(12) = { 0x181a29, 0x1e6666 },
37 RF_CHANNEL(13) = { 0x181a39, 0x1e6666 },
38 RF_CHANNEL(14) = { 0x181a60, 0x1c0000 },
39};
40
41#if 0
42static int bits(u32 rw, int from, int to)
43{
44 rw &= ~(0xffffffffU << (to+1));
45 rw >>= from;
46 return rw;
47}
48
49static int bit(u32 rw, int bit)
50{
51 return bits(rw, bit, bit);
52}
53
54static void dump_regwrite(u32 rw)
55{
56 int reg = bits(rw, 18, 22);
57 int rw_flag = bits(rw, 23, 23);
58 PDEBUG("rf2959 %#010x reg %d rw %d", rw, reg, rw_flag);
59
60 switch (reg) {
61 case 0:
62 PDEBUG("reg0 CFG1 ref_sel %d hybernate %d rf_vco_reg_en %d"
63 " if_vco_reg_en %d if_vga_en %d",
64 bits(rw, 14, 15), bit(rw, 3), bit(rw, 2), bit(rw, 1),
65 bit(rw, 0));
66 break;
67 case 1:
68 PDEBUG("reg1 IFPLL1 pll_en1 %d kv_en1 %d vtc_en1 %d lpf1 %d"
69 " cpl1 %d pdp1 %d autocal_en1 %d ld_en1 %d ifloopr %d"
70 " ifloopc %d dac1 %d",
71 bit(rw, 17), bit(rw, 16), bit(rw, 15), bit(rw, 14),
72 bit(rw, 13), bit(rw, 12), bit(rw, 11), bit(rw, 10),
73 bits(rw, 7, 9), bits(rw, 4, 6), bits(rw, 0, 3));
74 break;
75 case 2:
76 PDEBUG("reg2 IFPLL2 n1 %d num1 %d",
77 bits(rw, 6, 17), bits(rw, 0, 5));
78 break;
79 case 3:
80 PDEBUG("reg3 IFPLL3 num %d", bits(rw, 0, 17));
81 break;
82 case 4:
83 PDEBUG("reg4 IFPLL4 dn1 %#04x ct_def1 %d kv_def1 %d",
84 bits(rw, 8, 16), bits(rw, 4, 7), bits(rw, 0, 3));
85 break;
86 case 5:
87 PDEBUG("reg5 RFPLL1 pll_en %d kv_en %d vtc_en %d lpf %d cpl %d"
88 " pdp %d autocal_en %d ld_en %d rfloopr %d rfloopc %d"
89 " dac %d",
90 bit(rw, 17), bit(rw, 16), bit(rw, 15), bit(rw, 14),
91 bit(rw, 13), bit(rw, 12), bit(rw, 11), bit(rw, 10),
92 bits(rw, 7, 9), bits(rw, 4, 6), bits(rw, 0,3));
93 break;
94 case 6:
95 PDEBUG("reg6 RFPLL2 n %d num %d",
96 bits(rw, 6, 17), bits(rw, 0, 5));
97 break;
98 case 7:
99 PDEBUG("reg7 RFPLL3 num2 %d", bits(rw, 0, 17));
100 break;
101 case 8:
102 PDEBUG("reg8 RFPLL4 dn %#06x ct_def %d kv_def %d",
103 bits(rw, 8, 16), bits(rw, 4, 7), bits(rw, 0, 3));
104 break;
105 case 9:
106 PDEBUG("reg9 CAL1 tvco %d tlock %d m_ct_value %d ld_window %d",
107 bits(rw, 13, 17), bits(rw, 8, 12), bits(rw, 3, 7),
108 bits(rw, 0, 2));
109 break;
110 case 10:
111 PDEBUG("reg10 TXRX1 rxdcfbbyps %d pcontrol %d txvgc %d"
112 " rxlpfbw %d txlpfbw %d txdiffmode %d txenmode %d"
113 " intbiasen %d tybypass %d",
114 bit(rw, 17), bits(rw, 15, 16), bits(rw, 10, 14),
115 bits(rw, 7, 9), bits(rw, 4, 6), bit(rw, 3), bit(rw, 2),
116 bit(rw, 1), bit(rw, 0));
117 break;
118 case 11:
119 PDEBUG("reg11 PCNT1 mid_bias %d p_desired %d pc_offset %d"
120 " tx_delay %d",
121 bits(rw, 15, 17), bits(rw, 9, 14), bits(rw, 3, 8),
122 bits(rw, 0, 2));
123 break;
124 case 12:
125 PDEBUG("reg12 PCNT2 max_power %d mid_power %d min_power %d",
126 bits(rw, 12, 17), bits(rw, 6, 11), bits(rw, 0, 5));
127 break;
128 case 13:
129 PDEBUG("reg13 VCOT1 rfpll vco comp %d ifpll vco comp %d"
130 " lobias %d if_biasbuf %d if_biasvco %d rf_biasbuf %d"
131 " rf_biasvco %d",
132 bit(rw, 17), bit(rw, 16), bit(rw, 15),
133 bits(rw, 8, 9), bits(rw, 5, 7), bits(rw, 3, 4),
134 bits(rw, 0, 2));
135 break;
136 case 14:
137 PDEBUG("reg14 IQCAL rx_acal %d rx_pcal %d"
138 " tx_acal %d tx_pcal %d",
139 bits(rw, 13, 17), bits(rw, 9, 12), bits(rw, 4, 8),
140 bits(rw, 0, 3));
141 break;
142 }
143}
144#endif /* 0 */
145
146static int rf2959_init_hw(struct zd_rf *rf)
147{
148 int r;
149 struct zd_chip *chip = zd_rf_to_chip(rf);
150
151 static const struct zd_ioreq16 ioreqs[] = {
152 { CR2, 0x1E }, { CR9, 0x20 }, { CR10, 0x89 },
153 { CR11, 0x00 }, { CR15, 0xD0 }, { CR17, 0x68 },
154 { CR19, 0x4a }, { CR20, 0x0c }, { CR21, 0x0E },
155 { CR23, 0x48 },
156 /* normal size for cca threshold */
157 { CR24, 0x14 },
158 /* { CR24, 0x20 }, */
159 { CR26, 0x90 }, { CR27, 0x30 }, { CR29, 0x20 },
160 { CR31, 0xb2 }, { CR32, 0x43 }, { CR33, 0x28 },
161 { CR38, 0x30 }, { CR34, 0x0f }, { CR35, 0xF0 },
162 { CR41, 0x2a }, { CR46, 0x7F }, { CR47, 0x1E },
163 { CR51, 0xc5 }, { CR52, 0xc5 }, { CR53, 0xc5 },
164 { CR79, 0x58 }, { CR80, 0x30 }, { CR81, 0x30 },
165 { CR82, 0x00 }, { CR83, 0x24 }, { CR84, 0x04 },
166 { CR85, 0x00 }, { CR86, 0x10 }, { CR87, 0x2A },
167 { CR88, 0x10 }, { CR89, 0x24 }, { CR90, 0x18 },
168 /* { CR91, 0x18 }, */
169 /* should solve continous CTS frame problems */
170 { CR91, 0x00 },
171 { CR92, 0x0a }, { CR93, 0x00 }, { CR94, 0x01 },
172 { CR95, 0x00 }, { CR96, 0x40 }, { CR97, 0x37 },
173 { CR98, 0x05 }, { CR99, 0x28 }, { CR100, 0x00 },
174 { CR101, 0x13 }, { CR102, 0x27 }, { CR103, 0x27 },
175 { CR104, 0x18 }, { CR105, 0x12 },
176 /* normal size */
177 { CR106, 0x1a },
178 /* { CR106, 0x22 }, */
179 { CR107, 0x24 }, { CR108, 0x0a }, { CR109, 0x13 },
180 { CR110, 0x2F }, { CR111, 0x27 }, { CR112, 0x27 },
181 { CR113, 0x27 }, { CR114, 0x27 }, { CR115, 0x40 },
182 { CR116, 0x40 }, { CR117, 0xF0 }, { CR118, 0xF0 },
183 { CR119, 0x16 },
184 /* no TX continuation */
185 { CR122, 0x00 },
186 /* { CR122, 0xff }, */
187 { CR127, 0x03 }, { CR131, 0x08 }, { CR138, 0x28 },
188 { CR148, 0x44 }, { CR150, 0x10 }, { CR169, 0xBB },
189 { CR170, 0xBB },
190 };
191
192 static const u32 rv[] = {
193 0x000007, /* REG0(CFG1) */
194 0x07dd43, /* REG1(IFPLL1) */
195 0x080959, /* REG2(IFPLL2) */
196 0x0e6666,
197 0x116a57, /* REG4 */
198 0x17dd43, /* REG5 */
199 0x1819f9, /* REG6 */
200 0x1e6666,
201 0x214554,
202 0x25e7fa,
203 0x27fffa,
204 /* The Zydas driver somehow forgets to set this value. It's
205 * only set for Japan. We are using internal power control
206 * for now.
207 */
208 0x294128, /* internal power */
209 /* 0x28252c, */ /* External control TX power */
210 /* CR31_CCK, CR51_6-36M, CR52_48M, CR53_54M */
211 0x2c0000,
212 0x300000,
213 0x340000, /* REG13(0xD) */
214 0x381e0f, /* REG14(0xE) */
215 /* Bogus, RF2959's data sheet doesn't know register 27, which is
216 * actually referenced here. The commented 0x11 is 17.
217 */
218 0x6c180f, /* REG27(0x11) */
219 };
220
221 r = zd_iowrite16a_locked(chip, ioreqs, ARRAY_SIZE(ioreqs));
222 if (r)
223 return r;
224
225 return zd_rfwritev_locked(chip, rv, ARRAY_SIZE(rv), RF_RV_BITS);
226}
227
228static int rf2959_set_channel(struct zd_rf *rf, u8 channel)
229{
230 int i, r;
231 u32 *rv = rf2959_table[channel-1];
232 struct zd_chip *chip = zd_rf_to_chip(rf);
233
234 for (i = 0; i < 2; i++) {
235 r = zd_rfwrite_locked(chip, rv[i], RF_RV_BITS);
236 if (r)
237 return r;
238 }
239 return 0;
240}
241
242static int rf2959_switch_radio_on(struct zd_rf *rf)
243{
244 static const struct zd_ioreq16 ioreqs[] = {
245 { CR10, 0x89 },
246 { CR11, 0x00 },
247 };
248 struct zd_chip *chip = zd_rf_to_chip(rf);
249
250 return zd_iowrite16a_locked(chip, ioreqs, ARRAY_SIZE(ioreqs));
251}
252
253static int rf2959_switch_radio_off(struct zd_rf *rf)
254{
255 static const struct zd_ioreq16 ioreqs[] = {
256 { CR10, 0x15 },
257 { CR11, 0x81 },
258 };
259 struct zd_chip *chip = zd_rf_to_chip(rf);
260
261 return zd_iowrite16a_locked(chip, ioreqs, ARRAY_SIZE(ioreqs));
262}
263
264int zd_rf_init_rf2959(struct zd_rf *rf)
265{
266 struct zd_chip *chip = zd_rf_to_chip(rf);
267
268 if (chip->is_zd1211b) {
269 dev_err(zd_chip_dev(chip),
270 "RF2959 is currently not supported for ZD1211B"
271 " devices\n");
272 return -ENODEV;
273 }
274 rf->init_hw = rf2959_init_hw;
275 rf->set_channel = rf2959_set_channel;
276 rf->switch_radio_on = rf2959_switch_radio_on;
277 rf->switch_radio_off = rf2959_switch_radio_off;
278 return 0;
279}
diff --git a/drivers/net/wireless/zd1211rw/zd_types.h b/drivers/net/wireless/zd1211rw/zd_types.h
new file mode 100644
index 000000000000..0155a1584ed3
--- /dev/null
+++ b/drivers/net/wireless/zd1211rw/zd_types.h
@@ -0,0 +1,71 @@
1/* zd_types.h
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 */
17
18#ifndef _ZD_TYPES_H
19#define _ZD_TYPES_H
20
21#include <linux/types.h>
22
23/* We have three register spaces mapped into the overall USB address space of
24 * 64K words (16-bit values). There is the control register space of
25 * double-word registers, the eeprom register space and the firmware register
26 * space. The control register space is byte mapped, the others are word
27 * mapped.
28 *
29 * For that reason, we are using byte offsets for control registers and word
30 * offsets for everything else.
31 */
32
33typedef u32 __nocast zd_addr_t;
34
35enum {
36 ADDR_BASE_MASK = 0xff000000,
37 ADDR_OFFSET_MASK = 0x0000ffff,
38 ADDR_ZERO_MASK = 0x00ff0000,
39 NULL_BASE = 0x00000000,
40 USB_BASE = 0x01000000,
41 CR_BASE = 0x02000000,
42 CR_MAX_OFFSET = 0x0b30,
43 E2P_BASE = 0x03000000,
44 E2P_MAX_OFFSET = 0x007e,
45 FW_BASE = 0x04000000,
46 FW_MAX_OFFSET = 0x0005,
47};
48
49#define ZD_ADDR_BASE(addr) ((u32)(addr) & ADDR_BASE_MASK)
50#define ZD_OFFSET(addr) ((u32)(addr) & ADDR_OFFSET_MASK)
51
52#define ZD_ADDR(base, offset) \
53 ((zd_addr_t)(((base) & ADDR_BASE_MASK) | ((offset) & ADDR_OFFSET_MASK)))
54
55#define ZD_NULL_ADDR ((zd_addr_t)0)
56#define USB_REG(offset) ZD_ADDR(USB_BASE, offset) /* word addressing */
57#define CTL_REG(offset) ZD_ADDR(CR_BASE, offset) /* byte addressing */
58#define E2P_REG(offset) ZD_ADDR(E2P_BASE, offset) /* word addressing */
59#define FW_REG(offset) ZD_ADDR(FW_BASE, offset) /* word addressing */
60
61static inline zd_addr_t zd_inc_word(zd_addr_t addr)
62{
63 u32 base = ZD_ADDR_BASE(addr);
64 u32 offset = ZD_OFFSET(addr);
65
66 offset += base == CR_BASE ? 2 : 1;
67
68 return base | offset;
69}
70
71#endif /* _ZD_TYPES_H */
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c
new file mode 100644
index 000000000000..6320984126c7
--- /dev/null
+++ b/drivers/net/wireless/zd1211rw/zd_usb.c
@@ -0,0 +1,1309 @@
1/* zd_usb.c
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 */
17
18#include <asm/unaligned.h>
19#include <linux/init.h>
20#include <linux/module.h>
21#include <linux/firmware.h>
22#include <linux/device.h>
23#include <linux/errno.h>
24#include <linux/skbuff.h>
25#include <linux/usb.h>
26#include <net/ieee80211.h>
27
28#include "zd_def.h"
29#include "zd_netdev.h"
30#include "zd_mac.h"
31#include "zd_usb.h"
32#include "zd_util.h"
33
34static struct usb_device_id usb_ids[] = {
35 /* ZD1211 */
36 { USB_DEVICE(0x0ace, 0x1211), .driver_info = DEVICE_ZD1211 },
37 { USB_DEVICE(0x07b8, 0x6001), .driver_info = DEVICE_ZD1211 },
38 { USB_DEVICE(0x126f, 0xa006), .driver_info = DEVICE_ZD1211 },
39 { USB_DEVICE(0x6891, 0xa727), .driver_info = DEVICE_ZD1211 },
40 { USB_DEVICE(0x0df6, 0x9071), .driver_info = DEVICE_ZD1211 },
41 { USB_DEVICE(0x157e, 0x300b), .driver_info = DEVICE_ZD1211 },
42 /* ZD1211B */
43 { USB_DEVICE(0x0ace, 0x1215), .driver_info = DEVICE_ZD1211B },
44 { USB_DEVICE(0x157e, 0x300d), .driver_info = DEVICE_ZD1211B },
45 {}
46};
47
48MODULE_LICENSE("GPL");
49MODULE_DESCRIPTION("USB driver for devices with the ZD1211 chip.");
50MODULE_AUTHOR("Ulrich Kunitz");
51MODULE_AUTHOR("Daniel Drake");
52MODULE_VERSION("1.0");
53MODULE_DEVICE_TABLE(usb, usb_ids);
54
55#define FW_ZD1211_PREFIX "zd1211/zd1211_"
56#define FW_ZD1211B_PREFIX "zd1211/zd1211b_"
57
58/* register address handling */
59
60#ifdef DEBUG
61static int check_addr(struct zd_usb *usb, zd_addr_t addr)
62{
63 u32 base = ZD_ADDR_BASE(addr);
64 u32 offset = ZD_OFFSET(addr);
65
66 if ((u32)addr & ADDR_ZERO_MASK)
67 goto invalid_address;
68 switch (base) {
69 case USB_BASE:
70 break;
71 case CR_BASE:
72 if (offset > CR_MAX_OFFSET) {
73 dev_dbg(zd_usb_dev(usb),
74 "CR offset %#010x larger than"
75 " CR_MAX_OFFSET %#10x\n",
76 offset, CR_MAX_OFFSET);
77 goto invalid_address;
78 }
79 if (offset & 1) {
80 dev_dbg(zd_usb_dev(usb),
81 "CR offset %#010x is not a multiple of 2\n",
82 offset);
83 goto invalid_address;
84 }
85 break;
86 case E2P_BASE:
87 if (offset > E2P_MAX_OFFSET) {
88 dev_dbg(zd_usb_dev(usb),
89 "E2P offset %#010x larger than"
90 " E2P_MAX_OFFSET %#010x\n",
91 offset, E2P_MAX_OFFSET);
92 goto invalid_address;
93 }
94 break;
95 case FW_BASE:
96 if (!usb->fw_base_offset) {
97 dev_dbg(zd_usb_dev(usb),
98 "ERROR: fw base offset has not been set\n");
99 return -EAGAIN;
100 }
101 if (offset > FW_MAX_OFFSET) {
102 dev_dbg(zd_usb_dev(usb),
103 "FW offset %#10x is larger than"
104 " FW_MAX_OFFSET %#010x\n",
105 offset, FW_MAX_OFFSET);
106 goto invalid_address;
107 }
108 break;
109 default:
110 dev_dbg(zd_usb_dev(usb),
111 "address has unsupported base %#010x\n", addr);
112 goto invalid_address;
113 }
114
115 return 0;
116invalid_address:
117 dev_dbg(zd_usb_dev(usb),
118 "ERROR: invalid address: %#010x\n", addr);
119 return -EINVAL;
120}
121#endif /* DEBUG */
122
123static u16 usb_addr(struct zd_usb *usb, zd_addr_t addr)
124{
125 u32 base;
126 u16 offset;
127
128 base = ZD_ADDR_BASE(addr);
129 offset = ZD_OFFSET(addr);
130
131 ZD_ASSERT(check_addr(usb, addr) == 0);
132
133 switch (base) {
134 case CR_BASE:
135 offset += CR_BASE_OFFSET;
136 break;
137 case E2P_BASE:
138 offset += E2P_BASE_OFFSET;
139 break;
140 case FW_BASE:
141 offset += usb->fw_base_offset;
142 break;
143 }
144
145 return offset;
146}
147
148/* USB device initialization */
149
150static int request_fw_file(
151 const struct firmware **fw, const char *name, struct device *device)
152{
153 int r;
154
155 dev_dbg_f(device, "fw name %s\n", name);
156
157 r = request_firmware(fw, name, device);
158 if (r)
159 dev_err(device,
160 "Could not load firmware file %s. Error number %d\n",
161 name, r);
162 return r;
163}
164
165static inline u16 get_bcdDevice(const struct usb_device *udev)
166{
167 return le16_to_cpu(udev->descriptor.bcdDevice);
168}
169
170enum upload_code_flags {
171 REBOOT = 1,
172};
173
174/* Ensures that MAX_TRANSFER_SIZE is even. */
175#define MAX_TRANSFER_SIZE (USB_MAX_TRANSFER_SIZE & ~1)
176
177static int upload_code(struct usb_device *udev,
178 const u8 *data, size_t size, u16 code_offset, int flags)
179{
180 u8 *p;
181 int r;
182
183 /* USB request blocks need "kmalloced" buffers.
184 */
185 p = kmalloc(MAX_TRANSFER_SIZE, GFP_KERNEL);
186 if (!p) {
187 dev_err(&udev->dev, "out of memory\n");
188 r = -ENOMEM;
189 goto error;
190 }
191
192 size &= ~1;
193 while (size > 0) {
194 size_t transfer_size = size <= MAX_TRANSFER_SIZE ?
195 size : MAX_TRANSFER_SIZE;
196
197 dev_dbg_f(&udev->dev, "transfer size %zu\n", transfer_size);
198
199 memcpy(p, data, transfer_size);
200 r = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
201 USB_REQ_FIRMWARE_DOWNLOAD,
202 USB_DIR_OUT | USB_TYPE_VENDOR,
203 code_offset, 0, p, transfer_size, 1000 /* ms */);
204 if (r < 0) {
205 dev_err(&udev->dev,
206 "USB control request for firmware upload"
207 " failed. Error number %d\n", r);
208 goto error;
209 }
210 transfer_size = r & ~1;
211
212 size -= transfer_size;
213 data += transfer_size;
214 code_offset += transfer_size/sizeof(u16);
215 }
216
217 if (flags & REBOOT) {
218 u8 ret;
219
220 r = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
221 USB_REQ_FIRMWARE_CONFIRM,
222 USB_DIR_IN | USB_TYPE_VENDOR,
223 0, 0, &ret, sizeof(ret), 5000 /* ms */);
224 if (r != sizeof(ret)) {
225 dev_err(&udev->dev,
226 "control request firmeware confirmation failed."
227 " Return value %d\n", r);
228 if (r >= 0)
229 r = -ENODEV;
230 goto error;
231 }
232 if (ret & 0x80) {
233 dev_err(&udev->dev,
234 "Internal error while downloading."
235 " Firmware confirm return value %#04x\n",
236 (unsigned int)ret);
237 r = -ENODEV;
238 goto error;
239 }
240 dev_dbg_f(&udev->dev, "firmware confirm return value %#04x\n",
241 (unsigned int)ret);
242 }
243
244 r = 0;
245error:
246 kfree(p);
247 return r;
248}
249
250static u16 get_word(const void *data, u16 offset)
251{
252 const __le16 *p = data;
253 return le16_to_cpu(p[offset]);
254}
255
256static char *get_fw_name(char *buffer, size_t size, u8 device_type,
257 const char* postfix)
258{
259 scnprintf(buffer, size, "%s%s",
260 device_type == DEVICE_ZD1211B ?
261 FW_ZD1211B_PREFIX : FW_ZD1211_PREFIX,
262 postfix);
263 return buffer;
264}
265
266static int upload_firmware(struct usb_device *udev, u8 device_type)
267{
268 int r;
269 u16 fw_bcdDevice;
270 u16 bcdDevice;
271 const struct firmware *ub_fw = NULL;
272 const struct firmware *uph_fw = NULL;
273 char fw_name[128];
274
275 bcdDevice = get_bcdDevice(udev);
276
277 r = request_fw_file(&ub_fw,
278 get_fw_name(fw_name, sizeof(fw_name), device_type, "ub"),
279 &udev->dev);
280 if (r)
281 goto error;
282
283 fw_bcdDevice = get_word(ub_fw->data, EEPROM_REGS_OFFSET);
284
285 /* FIXME: do we have any reason to perform the kludge that the vendor
286 * driver does when there is a version mismatch? (their driver uploads
287 * different firmwares and stuff)
288 */
289 if (fw_bcdDevice != bcdDevice) {
290 dev_info(&udev->dev,
291 "firmware device id %#06x and actual device id "
292 "%#06x differ, continuing anyway\n",
293 fw_bcdDevice, bcdDevice);
294 } else {
295 dev_dbg_f(&udev->dev,
296 "firmware device id %#06x is equal to the "
297 "actual device id\n", fw_bcdDevice);
298 }
299
300
301 r = request_fw_file(&uph_fw,
302 get_fw_name(fw_name, sizeof(fw_name), device_type, "uphr"),
303 &udev->dev);
304 if (r)
305 goto error;
306
307 r = upload_code(udev, uph_fw->data, uph_fw->size, FW_START_OFFSET,
308 REBOOT);
309 if (r) {
310 dev_err(&udev->dev,
311 "Could not upload firmware code uph. Error number %d\n",
312 r);
313 }
314
315 /* FALL-THROUGH */
316error:
317 release_firmware(ub_fw);
318 release_firmware(uph_fw);
319 return r;
320}
321
322static void disable_read_regs_int(struct zd_usb *usb)
323{
324 struct zd_usb_interrupt *intr = &usb->intr;
325
326 spin_lock(&intr->lock);
327 intr->read_regs_enabled = 0;
328 spin_unlock(&intr->lock);
329}
330
331#define urb_dev(urb) (&(urb)->dev->dev)
332
333static inline void handle_regs_int(struct urb *urb)
334{
335 struct zd_usb *usb = urb->context;
336 struct zd_usb_interrupt *intr = &usb->intr;
337 int len;
338
339 ZD_ASSERT(in_interrupt());
340 spin_lock(&intr->lock);
341
342 if (intr->read_regs_enabled) {
343 intr->read_regs.length = len = urb->actual_length;
344
345 if (len > sizeof(intr->read_regs.buffer))
346 len = sizeof(intr->read_regs.buffer);
347 memcpy(intr->read_regs.buffer, urb->transfer_buffer, len);
348 intr->read_regs_enabled = 0;
349 complete(&intr->read_regs.completion);
350 goto out;
351 }
352
353 dev_dbg_f(urb_dev(urb), "regs interrupt ignored\n");
354out:
355 spin_unlock(&intr->lock);
356}
357
358static inline void handle_retry_failed_int(struct urb *urb)
359{
360 dev_dbg_f(urb_dev(urb), "retry failed interrupt\n");
361}
362
363
364static void int_urb_complete(struct urb *urb, struct pt_regs *pt_regs)
365{
366 int r;
367 struct usb_int_header *hdr;
368
369 switch (urb->status) {
370 case 0:
371 break;
372 case -ESHUTDOWN:
373 case -EINVAL:
374 case -ENODEV:
375 case -ENOENT:
376 case -ECONNRESET:
377 case -EPIPE:
378 goto kfree;
379 default:
380 goto resubmit;
381 }
382
383 if (urb->actual_length < sizeof(hdr)) {
384 dev_dbg_f(urb_dev(urb), "error: urb %p to small\n", urb);
385 goto resubmit;
386 }
387
388 hdr = urb->transfer_buffer;
389 if (hdr->type != USB_INT_TYPE) {
390 dev_dbg_f(urb_dev(urb), "error: urb %p wrong type\n", urb);
391 goto resubmit;
392 }
393
394 switch (hdr->id) {
395 case USB_INT_ID_REGS:
396 handle_regs_int(urb);
397 break;
398 case USB_INT_ID_RETRY_FAILED:
399 handle_retry_failed_int(urb);
400 break;
401 default:
402 dev_dbg_f(urb_dev(urb), "error: urb %p unknown id %x\n", urb,
403 (unsigned int)hdr->id);
404 goto resubmit;
405 }
406
407resubmit:
408 r = usb_submit_urb(urb, GFP_ATOMIC);
409 if (r) {
410 dev_dbg_f(urb_dev(urb), "resubmit urb %p\n", urb);
411 goto kfree;
412 }
413 return;
414kfree:
415 kfree(urb->transfer_buffer);
416}
417
418static inline int int_urb_interval(struct usb_device *udev)
419{
420 switch (udev->speed) {
421 case USB_SPEED_HIGH:
422 return 4;
423 case USB_SPEED_LOW:
424 return 10;
425 case USB_SPEED_FULL:
426 default:
427 return 1;
428 }
429}
430
431static inline int usb_int_enabled(struct zd_usb *usb)
432{
433 unsigned long flags;
434 struct zd_usb_interrupt *intr = &usb->intr;
435 struct urb *urb;
436
437 spin_lock_irqsave(&intr->lock, flags);
438 urb = intr->urb;
439 spin_unlock_irqrestore(&intr->lock, flags);
440 return urb != NULL;
441}
442
443int zd_usb_enable_int(struct zd_usb *usb)
444{
445 int r;
446 struct usb_device *udev;
447 struct zd_usb_interrupt *intr = &usb->intr;
448 void *transfer_buffer = NULL;
449 struct urb *urb;
450
451 dev_dbg_f(zd_usb_dev(usb), "\n");
452
453 urb = usb_alloc_urb(0, GFP_NOFS);
454 if (!urb) {
455 r = -ENOMEM;
456 goto out;
457 }
458
459 ZD_ASSERT(!irqs_disabled());
460 spin_lock_irq(&intr->lock);
461 if (intr->urb) {
462 spin_unlock_irq(&intr->lock);
463 r = 0;
464 goto error_free_urb;
465 }
466 intr->urb = urb;
467 spin_unlock_irq(&intr->lock);
468
469 /* TODO: make it a DMA buffer */
470 r = -ENOMEM;
471 transfer_buffer = kmalloc(USB_MAX_EP_INT_BUFFER, GFP_NOFS);
472 if (!transfer_buffer) {
473 dev_dbg_f(zd_usb_dev(usb),
474 "couldn't allocate transfer_buffer\n");
475 goto error_set_urb_null;
476 }
477
478 udev = zd_usb_to_usbdev(usb);
479 usb_fill_int_urb(urb, udev, usb_rcvintpipe(udev, EP_INT_IN),
480 transfer_buffer, USB_MAX_EP_INT_BUFFER,
481 int_urb_complete, usb,
482 intr->interval);
483
484 dev_dbg_f(zd_usb_dev(usb), "submit urb %p\n", intr->urb);
485 r = usb_submit_urb(urb, GFP_NOFS);
486 if (r) {
487 dev_dbg_f(zd_usb_dev(usb),
488 "Couldn't submit urb. Error number %d\n", r);
489 goto error;
490 }
491
492 return 0;
493error:
494 kfree(transfer_buffer);
495error_set_urb_null:
496 spin_lock_irq(&intr->lock);
497 intr->urb = NULL;
498 spin_unlock_irq(&intr->lock);
499error_free_urb:
500 usb_free_urb(urb);
501out:
502 return r;
503}
504
505void zd_usb_disable_int(struct zd_usb *usb)
506{
507 unsigned long flags;
508 struct zd_usb_interrupt *intr = &usb->intr;
509 struct urb *urb;
510
511 spin_lock_irqsave(&intr->lock, flags);
512 urb = intr->urb;
513 if (!urb) {
514 spin_unlock_irqrestore(&intr->lock, flags);
515 return;
516 }
517 intr->urb = NULL;
518 spin_unlock_irqrestore(&intr->lock, flags);
519
520 usb_kill_urb(urb);
521 dev_dbg_f(zd_usb_dev(usb), "urb %p killed\n", urb);
522 usb_free_urb(urb);
523}
524
525static void handle_rx_packet(struct zd_usb *usb, const u8 *buffer,
526 unsigned int length)
527{
528 int i;
529 struct zd_mac *mac = zd_usb_to_mac(usb);
530 const struct rx_length_info *length_info;
531
532 if (length < sizeof(struct rx_length_info)) {
533 /* It's not a complete packet anyhow. */
534 return;
535 }
536 length_info = (struct rx_length_info *)
537 (buffer + length - sizeof(struct rx_length_info));
538
539 /* It might be that three frames are merged into a single URB
540 * transaction. We have to check for the length info tag.
541 *
542 * While testing we discovered that length_info might be unaligned,
543 * because if USB transactions are merged, the last packet will not
544 * be padded. Unaligned access might also happen if the length_info
545 * structure is not present.
546 */
547 if (get_unaligned(&length_info->tag) == cpu_to_le16(RX_LENGTH_INFO_TAG))
548 {
549 unsigned int l, k, n;
550 for (i = 0, l = 0;; i++) {
551 k = le16_to_cpu(get_unaligned(&length_info->length[i]));
552 n = l+k;
553 if (n > length)
554 return;
555 zd_mac_rx(mac, buffer+l, k);
556 if (i >= 2)
557 return;
558 l = (n+3) & ~3;
559 }
560 } else {
561 zd_mac_rx(mac, buffer, length);
562 }
563}
564
565static void rx_urb_complete(struct urb *urb, struct pt_regs *pt_regs)
566{
567 struct zd_usb *usb;
568 struct zd_usb_rx *rx;
569 const u8 *buffer;
570 unsigned int length;
571
572 switch (urb->status) {
573 case 0:
574 break;
575 case -ESHUTDOWN:
576 case -EINVAL:
577 case -ENODEV:
578 case -ENOENT:
579 case -ECONNRESET:
580 case -EPIPE:
581 return;
582 default:
583 dev_dbg_f(urb_dev(urb), "urb %p error %d\n", urb, urb->status);
584 goto resubmit;
585 }
586
587 buffer = urb->transfer_buffer;
588 length = urb->actual_length;
589 usb = urb->context;
590 rx = &usb->rx;
591
592 if (length%rx->usb_packet_size > rx->usb_packet_size-4) {
593 /* If there is an old first fragment, we don't care. */
594 dev_dbg_f(urb_dev(urb), "*** first fragment ***\n");
595 ZD_ASSERT(length <= ARRAY_SIZE(rx->fragment));
596 spin_lock(&rx->lock);
597 memcpy(rx->fragment, buffer, length);
598 rx->fragment_length = length;
599 spin_unlock(&rx->lock);
600 goto resubmit;
601 }
602
603 spin_lock(&rx->lock);
604 if (rx->fragment_length > 0) {
605 /* We are on a second fragment, we believe */
606 ZD_ASSERT(length + rx->fragment_length <=
607 ARRAY_SIZE(rx->fragment));
608 dev_dbg_f(urb_dev(urb), "*** second fragment ***\n");
609 memcpy(rx->fragment+rx->fragment_length, buffer, length);
610 handle_rx_packet(usb, rx->fragment,
611 rx->fragment_length + length);
612 rx->fragment_length = 0;
613 spin_unlock(&rx->lock);
614 } else {
615 spin_unlock(&rx->lock);
616 handle_rx_packet(usb, buffer, length);
617 }
618
619resubmit:
620 usb_submit_urb(urb, GFP_ATOMIC);
621}
622
623struct urb *alloc_urb(struct zd_usb *usb)
624{
625 struct usb_device *udev = zd_usb_to_usbdev(usb);
626 struct urb *urb;
627 void *buffer;
628
629 urb = usb_alloc_urb(0, GFP_NOFS);
630 if (!urb)
631 return NULL;
632 buffer = usb_buffer_alloc(udev, USB_MAX_RX_SIZE, GFP_NOFS,
633 &urb->transfer_dma);
634 if (!buffer) {
635 usb_free_urb(urb);
636 return NULL;
637 }
638
639 usb_fill_bulk_urb(urb, udev, usb_rcvbulkpipe(udev, EP_DATA_IN),
640 buffer, USB_MAX_RX_SIZE,
641 rx_urb_complete, usb);
642 urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
643
644 return urb;
645}
646
647void free_urb(struct urb *urb)
648{
649 if (!urb)
650 return;
651 usb_buffer_free(urb->dev, urb->transfer_buffer_length,
652 urb->transfer_buffer, urb->transfer_dma);
653 usb_free_urb(urb);
654}
655
656int zd_usb_enable_rx(struct zd_usb *usb)
657{
658 int i, r;
659 struct zd_usb_rx *rx = &usb->rx;
660 struct urb **urbs;
661
662 dev_dbg_f(zd_usb_dev(usb), "\n");
663
664 r = -ENOMEM;
665 urbs = kcalloc(URBS_COUNT, sizeof(struct urb *), GFP_NOFS);
666 if (!urbs)
667 goto error;
668 for (i = 0; i < URBS_COUNT; i++) {
669 urbs[i] = alloc_urb(usb);
670 if (!urbs[i])
671 goto error;
672 }
673
674 ZD_ASSERT(!irqs_disabled());
675 spin_lock_irq(&rx->lock);
676 if (rx->urbs) {
677 spin_unlock_irq(&rx->lock);
678 r = 0;
679 goto error;
680 }
681 rx->urbs = urbs;
682 rx->urbs_count = URBS_COUNT;
683 spin_unlock_irq(&rx->lock);
684
685 for (i = 0; i < URBS_COUNT; i++) {
686 r = usb_submit_urb(urbs[i], GFP_NOFS);
687 if (r)
688 goto error_submit;
689 }
690
691 return 0;
692error_submit:
693 for (i = 0; i < URBS_COUNT; i++) {
694 usb_kill_urb(urbs[i]);
695 }
696 spin_lock_irq(&rx->lock);
697 rx->urbs = NULL;
698 rx->urbs_count = 0;
699 spin_unlock_irq(&rx->lock);
700error:
701 if (urbs) {
702 for (i = 0; i < URBS_COUNT; i++)
703 free_urb(urbs[i]);
704 }
705 return r;
706}
707
708void zd_usb_disable_rx(struct zd_usb *usb)
709{
710 int i;
711 unsigned long flags;
712 struct urb **urbs;
713 unsigned int count;
714 struct zd_usb_rx *rx = &usb->rx;
715
716 spin_lock_irqsave(&rx->lock, flags);
717 urbs = rx->urbs;
718 count = rx->urbs_count;
719 spin_unlock_irqrestore(&rx->lock, flags);
720 if (!urbs)
721 return;
722
723 for (i = 0; i < count; i++) {
724 usb_kill_urb(urbs[i]);
725 free_urb(urbs[i]);
726 }
727 kfree(urbs);
728
729 spin_lock_irqsave(&rx->lock, flags);
730 rx->urbs = NULL;
731 rx->urbs_count = 0;
732 spin_unlock_irqrestore(&rx->lock, flags);
733}
734
735static void tx_urb_complete(struct urb *urb, struct pt_regs *pt_regs)
736{
737 int r;
738
739 switch (urb->status) {
740 case 0:
741 break;
742 case -ESHUTDOWN:
743 case -EINVAL:
744 case -ENODEV:
745 case -ENOENT:
746 case -ECONNRESET:
747 case -EPIPE:
748 dev_dbg_f(urb_dev(urb), "urb %p error %d\n", urb, urb->status);
749 break;
750 default:
751 dev_dbg_f(urb_dev(urb), "urb %p error %d\n", urb, urb->status);
752 goto resubmit;
753 }
754free_urb:
755 usb_buffer_free(urb->dev, urb->transfer_buffer_length,
756 urb->transfer_buffer, urb->transfer_dma);
757 usb_free_urb(urb);
758 return;
759resubmit:
760 r = usb_submit_urb(urb, GFP_ATOMIC);
761 if (r) {
762 dev_dbg_f(urb_dev(urb), "error resubmit urb %p %d\n", urb, r);
763 goto free_urb;
764 }
765}
766
767/* Puts the frame on the USB endpoint. It doesn't wait for
768 * completion. The frame must contain the control set.
769 */
770int zd_usb_tx(struct zd_usb *usb, const u8 *frame, unsigned int length)
771{
772 int r;
773 struct usb_device *udev = zd_usb_to_usbdev(usb);
774 struct urb *urb;
775 void *buffer;
776
777 urb = usb_alloc_urb(0, GFP_ATOMIC);
778 if (!urb) {
779 r = -ENOMEM;
780 goto out;
781 }
782
783 buffer = usb_buffer_alloc(zd_usb_to_usbdev(usb), length, GFP_ATOMIC,
784 &urb->transfer_dma);
785 if (!buffer) {
786 r = -ENOMEM;
787 goto error_free_urb;
788 }
789 memcpy(buffer, frame, length);
790
791 usb_fill_bulk_urb(urb, udev, usb_sndbulkpipe(udev, EP_DATA_OUT),
792 buffer, length, tx_urb_complete, NULL);
793 urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
794
795 r = usb_submit_urb(urb, GFP_ATOMIC);
796 if (r)
797 goto error;
798 return 0;
799error:
800 usb_buffer_free(zd_usb_to_usbdev(usb), length, buffer,
801 urb->transfer_dma);
802error_free_urb:
803 usb_free_urb(urb);
804out:
805 return r;
806}
807
808static inline void init_usb_interrupt(struct zd_usb *usb)
809{
810 struct zd_usb_interrupt *intr = &usb->intr;
811
812 spin_lock_init(&intr->lock);
813 intr->interval = int_urb_interval(zd_usb_to_usbdev(usb));
814 init_completion(&intr->read_regs.completion);
815 intr->read_regs.cr_int_addr = cpu_to_le16(usb_addr(usb, CR_INTERRUPT));
816}
817
818static inline void init_usb_rx(struct zd_usb *usb)
819{
820 struct zd_usb_rx *rx = &usb->rx;
821 spin_lock_init(&rx->lock);
822 if (interface_to_usbdev(usb->intf)->speed == USB_SPEED_HIGH) {
823 rx->usb_packet_size = 512;
824 } else {
825 rx->usb_packet_size = 64;
826 }
827 ZD_ASSERT(rx->fragment_length == 0);
828}
829
830static inline void init_usb_tx(struct zd_usb *usb)
831{
832 /* FIXME: at this point we will allocate a fixed number of urb's for
833 * use in a cyclic scheme */
834}
835
836void zd_usb_init(struct zd_usb *usb, struct net_device *netdev,
837 struct usb_interface *intf)
838{
839 memset(usb, 0, sizeof(*usb));
840 usb->intf = usb_get_intf(intf);
841 usb_set_intfdata(usb->intf, netdev);
842 init_usb_interrupt(usb);
843 init_usb_tx(usb);
844 init_usb_rx(usb);
845}
846
847int zd_usb_init_hw(struct zd_usb *usb)
848{
849 int r;
850 struct zd_chip *chip = zd_usb_to_chip(usb);
851
852 ZD_ASSERT(mutex_is_locked(&chip->mutex));
853 r = zd_ioread16_locked(chip, &usb->fw_base_offset,
854 USB_REG((u16)FW_BASE_ADDR_OFFSET));
855 if (r)
856 return r;
857 dev_dbg_f(zd_usb_dev(usb), "fw_base_offset: %#06hx\n",
858 usb->fw_base_offset);
859
860 return 0;
861}
862
863void zd_usb_clear(struct zd_usb *usb)
864{
865 usb_set_intfdata(usb->intf, NULL);
866 usb_put_intf(usb->intf);
867 memset(usb, 0, sizeof(*usb));
868 /* FIXME: usb_interrupt, usb_tx, usb_rx? */
869}
870
871static const char *speed(enum usb_device_speed speed)
872{
873 switch (speed) {
874 case USB_SPEED_LOW:
875 return "low";
876 case USB_SPEED_FULL:
877 return "full";
878 case USB_SPEED_HIGH:
879 return "high";
880 default:
881 return "unknown speed";
882 }
883}
884
885static int scnprint_id(struct usb_device *udev, char *buffer, size_t size)
886{
887 return scnprintf(buffer, size, "%04hx:%04hx v%04hx %s",
888 le16_to_cpu(udev->descriptor.idVendor),
889 le16_to_cpu(udev->descriptor.idProduct),
890 get_bcdDevice(udev),
891 speed(udev->speed));
892}
893
894int zd_usb_scnprint_id(struct zd_usb *usb, char *buffer, size_t size)
895{
896 struct usb_device *udev = interface_to_usbdev(usb->intf);
897 return scnprint_id(udev, buffer, size);
898}
899
900#ifdef DEBUG
901static void print_id(struct usb_device *udev)
902{
903 char buffer[40];
904
905 scnprint_id(udev, buffer, sizeof(buffer));
906 buffer[sizeof(buffer)-1] = 0;
907 dev_dbg_f(&udev->dev, "%s\n", buffer);
908}
909#else
910#define print_id(udev) do { } while (0)
911#endif
912
913static int probe(struct usb_interface *intf, const struct usb_device_id *id)
914{
915 int r;
916 struct usb_device *udev = interface_to_usbdev(intf);
917 struct net_device *netdev = NULL;
918
919 print_id(udev);
920
921 switch (udev->speed) {
922 case USB_SPEED_LOW:
923 case USB_SPEED_FULL:
924 case USB_SPEED_HIGH:
925 break;
926 default:
927 dev_dbg_f(&intf->dev, "Unknown USB speed\n");
928 r = -ENODEV;
929 goto error;
930 }
931
932 netdev = zd_netdev_alloc(intf);
933 if (netdev == NULL) {
934 r = -ENOMEM;
935 goto error;
936 }
937
938 r = upload_firmware(udev, id->driver_info);
939 if (r) {
940 dev_err(&intf->dev,
941 "couldn't load firmware. Error number %d\n", r);
942 goto error;
943 }
944
945 r = usb_reset_configuration(udev);
946 if (r) {
947 dev_dbg_f(&intf->dev,
948 "couldn't reset configuration. Error number %d\n", r);
949 goto error;
950 }
951
952 /* At this point the interrupt endpoint is not generally enabled. We
953 * save the USB bandwidth until the network device is opened. But
954 * notify that the initialization of the MAC will require the
955 * interrupts to be temporary enabled.
956 */
957 r = zd_mac_init_hw(zd_netdev_mac(netdev), id->driver_info);
958 if (r) {
959 dev_dbg_f(&intf->dev,
960 "couldn't initialize mac. Error number %d\n", r);
961 goto error;
962 }
963
964 r = register_netdev(netdev);
965 if (r) {
966 dev_dbg_f(&intf->dev,
967 "couldn't register netdev. Error number %d\n", r);
968 goto error;
969 }
970
971 dev_dbg_f(&intf->dev, "successful\n");
972 dev_info(&intf->dev,"%s\n", netdev->name);
973 return 0;
974error:
975 usb_reset_device(interface_to_usbdev(intf));
976 zd_netdev_free(netdev);
977 return r;
978}
979
980static void disconnect(struct usb_interface *intf)
981{
982 struct net_device *netdev = zd_intf_to_netdev(intf);
983 struct zd_mac *mac = zd_netdev_mac(netdev);
984 struct zd_usb *usb = &mac->chip.usb;
985
986 dev_dbg_f(zd_usb_dev(usb), "\n");
987
988 zd_netdev_disconnect(netdev);
989
990 /* Just in case something has gone wrong! */
991 zd_usb_disable_rx(usb);
992 zd_usb_disable_int(usb);
993
994 /* If the disconnect has been caused by a removal of the
995 * driver module, the reset allows reloading of the driver. If the
996 * reset will not be executed here, the upload of the firmware in the
997 * probe function caused by the reloading of the driver will fail.
998 */
999 usb_reset_device(interface_to_usbdev(intf));
1000
1001 /* If somebody still waits on this lock now, this is an error. */
1002 zd_netdev_free(netdev);
1003 dev_dbg(&intf->dev, "disconnected\n");
1004}
1005
1006static struct usb_driver driver = {
1007 .name = "zd1211rw",
1008 .id_table = usb_ids,
1009 .probe = probe,
1010 .disconnect = disconnect,
1011};
1012
1013static int __init usb_init(void)
1014{
1015 int r;
1016
1017 pr_debug("usb_init()\n");
1018
1019 r = usb_register(&driver);
1020 if (r) {
1021 printk(KERN_ERR "usb_register() failed. Error number %d\n", r);
1022 return r;
1023 }
1024
1025 pr_debug("zd1211rw initialized\n");
1026 return 0;
1027}
1028
1029static void __exit usb_exit(void)
1030{
1031 pr_debug("usb_exit()\n");
1032 usb_deregister(&driver);
1033}
1034
1035module_init(usb_init);
1036module_exit(usb_exit);
1037
1038static int usb_int_regs_length(unsigned int count)
1039{
1040 return sizeof(struct usb_int_regs) + count * sizeof(struct reg_data);
1041}
1042
1043static void prepare_read_regs_int(struct zd_usb *usb)
1044{
1045 struct zd_usb_interrupt *intr = &usb->intr;
1046
1047 spin_lock(&intr->lock);
1048 intr->read_regs_enabled = 1;
1049 INIT_COMPLETION(intr->read_regs.completion);
1050 spin_unlock(&intr->lock);
1051}
1052
1053static int get_results(struct zd_usb *usb, u16 *values,
1054 struct usb_req_read_regs *req, unsigned int count)
1055{
1056 int r;
1057 int i;
1058 struct zd_usb_interrupt *intr = &usb->intr;
1059 struct read_regs_int *rr = &intr->read_regs;
1060 struct usb_int_regs *regs = (struct usb_int_regs *)rr->buffer;
1061
1062 spin_lock(&intr->lock);
1063
1064 r = -EIO;
1065 /* The created block size seems to be larger than expected.
1066 * However results appear to be correct.
1067 */
1068 if (rr->length < usb_int_regs_length(count)) {
1069 dev_dbg_f(zd_usb_dev(usb),
1070 "error: actual length %d less than expected %d\n",
1071 rr->length, usb_int_regs_length(count));
1072 goto error_unlock;
1073 }
1074 if (rr->length > sizeof(rr->buffer)) {
1075 dev_dbg_f(zd_usb_dev(usb),
1076 "error: actual length %d exceeds buffer size %zu\n",
1077 rr->length, sizeof(rr->buffer));
1078 goto error_unlock;
1079 }
1080
1081 for (i = 0; i < count; i++) {
1082 struct reg_data *rd = &regs->regs[i];
1083 if (rd->addr != req->addr[i]) {
1084 dev_dbg_f(zd_usb_dev(usb),
1085 "rd[%d] addr %#06hx expected %#06hx\n", i,
1086 le16_to_cpu(rd->addr),
1087 le16_to_cpu(req->addr[i]));
1088 goto error_unlock;
1089 }
1090 values[i] = le16_to_cpu(rd->value);
1091 }
1092
1093 r = 0;
1094error_unlock:
1095 spin_unlock(&intr->lock);
1096 return r;
1097}
1098
1099int zd_usb_ioread16v(struct zd_usb *usb, u16 *values,
1100 const zd_addr_t *addresses, unsigned int count)
1101{
1102 int r;
1103 int i, req_len, actual_req_len;
1104 struct usb_device *udev;
1105 struct usb_req_read_regs *req = NULL;
1106 unsigned long timeout;
1107
1108 if (count < 1) {
1109 dev_dbg_f(zd_usb_dev(usb), "error: count is zero\n");
1110 return -EINVAL;
1111 }
1112 if (count > USB_MAX_IOREAD16_COUNT) {
1113 dev_dbg_f(zd_usb_dev(usb),
1114 "error: count %u exceeds possible max %u\n",
1115 count, USB_MAX_IOREAD16_COUNT);
1116 return -EINVAL;
1117 }
1118 if (in_atomic()) {
1119 dev_dbg_f(zd_usb_dev(usb),
1120 "error: io in atomic context not supported\n");
1121 return -EWOULDBLOCK;
1122 }
1123 if (!usb_int_enabled(usb)) {
1124 dev_dbg_f(zd_usb_dev(usb),
1125 "error: usb interrupt not enabled\n");
1126 return -EWOULDBLOCK;
1127 }
1128
1129 req_len = sizeof(struct usb_req_read_regs) + count * sizeof(__le16);
1130 req = kmalloc(req_len, GFP_NOFS);
1131 if (!req)
1132 return -ENOMEM;
1133 req->id = cpu_to_le16(USB_REQ_READ_REGS);
1134 for (i = 0; i < count; i++)
1135 req->addr[i] = cpu_to_le16(usb_addr(usb, addresses[i]));
1136
1137 udev = zd_usb_to_usbdev(usb);
1138 prepare_read_regs_int(usb);
1139 r = usb_bulk_msg(udev, usb_sndbulkpipe(udev, EP_REGS_OUT),
1140 req, req_len, &actual_req_len, 1000 /* ms */);
1141 if (r) {
1142 dev_dbg_f(zd_usb_dev(usb),
1143 "error in usb_bulk_msg(). Error number %d\n", r);
1144 goto error;
1145 }
1146 if (req_len != actual_req_len) {
1147 dev_dbg_f(zd_usb_dev(usb), "error in usb_bulk_msg()\n"
1148 " req_len %d != actual_req_len %d\n",
1149 req_len, actual_req_len);
1150 r = -EIO;
1151 goto error;
1152 }
1153
1154 timeout = wait_for_completion_timeout(&usb->intr.read_regs.completion,
1155 msecs_to_jiffies(1000));
1156 if (!timeout) {
1157 disable_read_regs_int(usb);
1158 dev_dbg_f(zd_usb_dev(usb), "read timed out\n");
1159 r = -ETIMEDOUT;
1160 goto error;
1161 }
1162
1163 r = get_results(usb, values, req, count);
1164error:
1165 kfree(req);
1166 return r;
1167}
1168
1169int zd_usb_iowrite16v(struct zd_usb *usb, const struct zd_ioreq16 *ioreqs,
1170 unsigned int count)
1171{
1172 int r;
1173 struct usb_device *udev;
1174 struct usb_req_write_regs *req = NULL;
1175 int i, req_len, actual_req_len;
1176
1177 if (count == 0)
1178 return 0;
1179 if (count > USB_MAX_IOWRITE16_COUNT) {
1180 dev_dbg_f(zd_usb_dev(usb),
1181 "error: count %u exceeds possible max %u\n",
1182 count, USB_MAX_IOWRITE16_COUNT);
1183 return -EINVAL;
1184 }
1185 if (in_atomic()) {
1186 dev_dbg_f(zd_usb_dev(usb),
1187 "error: io in atomic context not supported\n");
1188 return -EWOULDBLOCK;
1189 }
1190
1191 req_len = sizeof(struct usb_req_write_regs) +
1192 count * sizeof(struct reg_data);
1193 req = kmalloc(req_len, GFP_NOFS);
1194 if (!req)
1195 return -ENOMEM;
1196
1197 req->id = cpu_to_le16(USB_REQ_WRITE_REGS);
1198 for (i = 0; i < count; i++) {
1199 struct reg_data *rw = &req->reg_writes[i];
1200 rw->addr = cpu_to_le16(usb_addr(usb, ioreqs[i].addr));
1201 rw->value = cpu_to_le16(ioreqs[i].value);
1202 }
1203
1204 udev = zd_usb_to_usbdev(usb);
1205 r = usb_bulk_msg(udev, usb_sndbulkpipe(udev, EP_REGS_OUT),
1206 req, req_len, &actual_req_len, 1000 /* ms */);
1207 if (r) {
1208 dev_dbg_f(zd_usb_dev(usb),
1209 "error in usb_bulk_msg(). Error number %d\n", r);
1210 goto error;
1211 }
1212 if (req_len != actual_req_len) {
1213 dev_dbg_f(zd_usb_dev(usb),
1214 "error in usb_bulk_msg()"
1215 " req_len %d != actual_req_len %d\n",
1216 req_len, actual_req_len);
1217 r = -EIO;
1218 goto error;
1219 }
1220
1221 /* FALL-THROUGH with r == 0 */
1222error:
1223 kfree(req);
1224 return r;
1225}
1226
1227int zd_usb_rfwrite(struct zd_usb *usb, u32 value, u8 bits)
1228{
1229 int r;
1230 struct usb_device *udev;
1231 struct usb_req_rfwrite *req = NULL;
1232 int i, req_len, actual_req_len;
1233 u16 bit_value_template;
1234
1235 if (in_atomic()) {
1236 dev_dbg_f(zd_usb_dev(usb),
1237 "error: io in atomic context not supported\n");
1238 return -EWOULDBLOCK;
1239 }
1240 if (bits < USB_MIN_RFWRITE_BIT_COUNT) {
1241 dev_dbg_f(zd_usb_dev(usb),
1242 "error: bits %d are smaller than"
1243 " USB_MIN_RFWRITE_BIT_COUNT %d\n",
1244 bits, USB_MIN_RFWRITE_BIT_COUNT);
1245 return -EINVAL;
1246 }
1247 if (bits > USB_MAX_RFWRITE_BIT_COUNT) {
1248 dev_dbg_f(zd_usb_dev(usb),
1249 "error: bits %d exceed USB_MAX_RFWRITE_BIT_COUNT %d\n",
1250 bits, USB_MAX_RFWRITE_BIT_COUNT);
1251 return -EINVAL;
1252 }
1253#ifdef DEBUG
1254 if (value & (~0UL << bits)) {
1255 dev_dbg_f(zd_usb_dev(usb),
1256 "error: value %#09x has bits >= %d set\n",
1257 value, bits);
1258 return -EINVAL;
1259 }
1260#endif /* DEBUG */
1261
1262 dev_dbg_f(zd_usb_dev(usb), "value %#09x bits %d\n", value, bits);
1263
1264 r = zd_usb_ioread16(usb, &bit_value_template, CR203);
1265 if (r) {
1266 dev_dbg_f(zd_usb_dev(usb),
1267 "error %d: Couldn't read CR203\n", r);
1268 goto out;
1269 }
1270 bit_value_template &= ~(RF_IF_LE|RF_CLK|RF_DATA);
1271
1272 req_len = sizeof(struct usb_req_rfwrite) + bits * sizeof(__le16);
1273 req = kmalloc(req_len, GFP_NOFS);
1274 if (!req)
1275 return -ENOMEM;
1276
1277 req->id = cpu_to_le16(USB_REQ_WRITE_RF);
1278 /* 1: 3683a, but not used in ZYDAS driver */
1279 req->value = cpu_to_le16(2);
1280 req->bits = cpu_to_le16(bits);
1281
1282 for (i = 0; i < bits; i++) {
1283 u16 bv = bit_value_template;
1284 if (value & (1 << (bits-1-i)))
1285 bv |= RF_DATA;
1286 req->bit_values[i] = cpu_to_le16(bv);
1287 }
1288
1289 udev = zd_usb_to_usbdev(usb);
1290 r = usb_bulk_msg(udev, usb_sndbulkpipe(udev, EP_REGS_OUT),
1291 req, req_len, &actual_req_len, 1000 /* ms */);
1292 if (r) {
1293 dev_dbg_f(zd_usb_dev(usb),
1294 "error in usb_bulk_msg(). Error number %d\n", r);
1295 goto out;
1296 }
1297 if (req_len != actual_req_len) {
1298 dev_dbg_f(zd_usb_dev(usb), "error in usb_bulk_msg()"
1299 " req_len %d != actual_req_len %d\n",
1300 req_len, actual_req_len);
1301 r = -EIO;
1302 goto out;
1303 }
1304
1305 /* FALL-THROUGH with r == 0 */
1306out:
1307 kfree(req);
1308 return r;
1309}
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.h b/drivers/net/wireless/zd1211rw/zd_usb.h
new file mode 100644
index 000000000000..d6420283bd5a
--- /dev/null
+++ b/drivers/net/wireless/zd1211rw/zd_usb.h
@@ -0,0 +1,240 @@
1/* zd_usb.h: Header for USB interface implemented by ZD1211 chip
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 */
17
18#ifndef _ZD_USB_H
19#define _ZD_USB_H
20
21#include <linux/completion.h>
22#include <linux/netdevice.h>
23#include <linux/spinlock.h>
24#include <linux/skbuff.h>
25#include <linux/usb.h>
26
27#include "zd_def.h"
28#include "zd_types.h"
29
30enum devicetype {
31 DEVICE_ZD1211 = 0,
32 DEVICE_ZD1211B = 1,
33};
34
35enum endpoints {
36 EP_CTRL = 0,
37 EP_DATA_OUT = 1,
38 EP_DATA_IN = 2,
39 EP_INT_IN = 3,
40 EP_REGS_OUT = 4,
41};
42
43enum {
44 USB_MAX_TRANSFER_SIZE = 4096, /* bytes */
45 /* FIXME: The original driver uses this value. We have to check,
46 * whether the MAX_TRANSFER_SIZE is sufficient and this needs only be
47 * used if one combined frame is split over two USB transactions.
48 */
49 USB_MAX_RX_SIZE = 4800, /* bytes */
50 USB_MAX_IOWRITE16_COUNT = 15,
51 USB_MAX_IOWRITE32_COUNT = USB_MAX_IOWRITE16_COUNT/2,
52 USB_MAX_IOREAD16_COUNT = 15,
53 USB_MAX_IOREAD32_COUNT = USB_MAX_IOREAD16_COUNT/2,
54 USB_MIN_RFWRITE_BIT_COUNT = 16,
55 USB_MAX_RFWRITE_BIT_COUNT = 28,
56 USB_MAX_EP_INT_BUFFER = 64,
57 USB_ZD1211B_BCD_DEVICE = 0x4810,
58};
59
60enum control_requests {
61 USB_REQ_WRITE_REGS = 0x21,
62 USB_REQ_READ_REGS = 0x22,
63 USB_REQ_WRITE_RF = 0x23,
64 USB_REQ_PROG_FLASH = 0x24,
65 USB_REQ_EEPROM_START = 0x0128, /* ? request is a byte */
66 USB_REQ_EEPROM_MID = 0x28,
67 USB_REQ_EEPROM_END = 0x0228, /* ? request is a byte */
68 USB_REQ_FIRMWARE_DOWNLOAD = 0x30,
69 USB_REQ_FIRMWARE_CONFIRM = 0x31,
70 USB_REQ_FIRMWARE_READ_DATA = 0x32,
71};
72
73struct usb_req_read_regs {
74 __le16 id;
75 __le16 addr[0];
76} __attribute__((packed));
77
78struct reg_data {
79 __le16 addr;
80 __le16 value;
81} __attribute__((packed));
82
83struct usb_req_write_regs {
84 __le16 id;
85 struct reg_data reg_writes[0];
86} __attribute__((packed));
87
88enum {
89 RF_IF_LE = 0x02,
90 RF_CLK = 0x04,
91 RF_DATA = 0x08,
92};
93
94struct usb_req_rfwrite {
95 __le16 id;
96 __le16 value;
97 /* 1: 3683a */
98 /* 2: other (default) */
99 __le16 bits;
100 /* RF2595: 24 */
101 __le16 bit_values[0];
102 /* (CR203 & ~(RF_IF_LE | RF_CLK | RF_DATA)) | (bit ? RF_DATA : 0) */
103} __attribute__((packed));
104
105/* USB interrupt */
106
107enum usb_int_id {
108 USB_INT_TYPE = 0x01,
109 USB_INT_ID_REGS = 0x90,
110 USB_INT_ID_RETRY_FAILED = 0xa0,
111};
112
113enum usb_int_flags {
114 USB_INT_READ_REGS_EN = 0x01,
115};
116
117struct usb_int_header {
118 u8 type; /* must always be 1 */
119 u8 id;
120} __attribute__((packed));
121
122struct usb_int_regs {
123 struct usb_int_header hdr;
124 struct reg_data regs[0];
125} __attribute__((packed));
126
127struct usb_int_retry_fail {
128 struct usb_int_header hdr;
129 u8 new_rate;
130 u8 _dummy;
131 u8 addr[ETH_ALEN];
132 u8 ibss_wakeup_dest;
133} __attribute__((packed));
134
135struct read_regs_int {
136 struct completion completion;
137 /* Stores the USB int structure and contains the USB address of the
138 * first requested register before request.
139 */
140 u8 buffer[USB_MAX_EP_INT_BUFFER];
141 int length;
142 __le16 cr_int_addr;
143};
144
145struct zd_ioreq16 {
146 zd_addr_t addr;
147 u16 value;
148};
149
150struct zd_ioreq32 {
151 zd_addr_t addr;
152 u32 value;
153};
154
155struct zd_usb_interrupt {
156 struct read_regs_int read_regs;
157 spinlock_t lock;
158 struct urb *urb;
159 int interval;
160 u8 read_regs_enabled:1;
161};
162
163static inline struct usb_int_regs *get_read_regs(struct zd_usb_interrupt *intr)
164{
165 return (struct usb_int_regs *)intr->read_regs.buffer;
166}
167
168#define URBS_COUNT 5
169
170struct zd_usb_rx {
171 spinlock_t lock;
172 u8 fragment[2*USB_MAX_RX_SIZE];
173 unsigned int fragment_length;
174 unsigned int usb_packet_size;
175 struct urb **urbs;
176 int urbs_count;
177};
178
179struct zd_usb_tx {
180 spinlock_t lock;
181};
182
183/* Contains the usb parts. The structure doesn't require a lock, because intf
184 * and fw_base_offset, will not be changed after initialization.
185 */
186struct zd_usb {
187 struct zd_usb_interrupt intr;
188 struct zd_usb_rx rx;
189 struct zd_usb_tx tx;
190 struct usb_interface *intf;
191 u16 fw_base_offset;
192};
193
194#define zd_usb_dev(usb) (&usb->intf->dev)
195
196static inline struct usb_device *zd_usb_to_usbdev(struct zd_usb *usb)
197{
198 return interface_to_usbdev(usb->intf);
199}
200
201static inline struct net_device *zd_intf_to_netdev(struct usb_interface *intf)
202{
203 return usb_get_intfdata(intf);
204}
205
206static inline struct net_device *zd_usb_to_netdev(struct zd_usb *usb)
207{
208 return zd_intf_to_netdev(usb->intf);
209}
210
211void zd_usb_init(struct zd_usb *usb, struct net_device *netdev,
212 struct usb_interface *intf);
213int zd_usb_init_hw(struct zd_usb *usb);
214void zd_usb_clear(struct zd_usb *usb);
215
216int zd_usb_scnprint_id(struct zd_usb *usb, char *buffer, size_t size);
217
218int zd_usb_enable_int(struct zd_usb *usb);
219void zd_usb_disable_int(struct zd_usb *usb);
220
221int zd_usb_enable_rx(struct zd_usb *usb);
222void zd_usb_disable_rx(struct zd_usb *usb);
223
224int zd_usb_tx(struct zd_usb *usb, const u8 *frame, unsigned int length);
225
226int zd_usb_ioread16v(struct zd_usb *usb, u16 *values,
227 const zd_addr_t *addresses, unsigned int count);
228
229static inline int zd_usb_ioread16(struct zd_usb *usb, u16 *value,
230 const zd_addr_t addr)
231{
232 return zd_usb_ioread16v(usb, value, (const zd_addr_t *)&addr, 1);
233}
234
235int zd_usb_iowrite16v(struct zd_usb *usb, const struct zd_ioreq16 *ioreqs,
236 unsigned int count);
237
238int zd_usb_rfwrite(struct zd_usb *usb, u32 value, u8 bits);
239
240#endif /* _ZD_USB_H */
diff --git a/drivers/net/wireless/zd1211rw/zd_util.c b/drivers/net/wireless/zd1211rw/zd_util.c
new file mode 100644
index 000000000000..d20036c15d11
--- /dev/null
+++ b/drivers/net/wireless/zd1211rw/zd_util.c
@@ -0,0 +1,82 @@
1/* zd_util.c
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Utility program
18 */
19
20#include "zd_def.h"
21#include "zd_util.h"
22
23#ifdef DEBUG
24static char hex(u8 v)
25{
26 v &= 0xf;
27 return (v < 10 ? '0' : 'a' - 10) + v;
28}
29
30static char hex_print(u8 c)
31{
32 return (0x20 <= c && c < 0x7f) ? c : '.';
33}
34
35static void dump_line(const u8 *bytes, size_t size)
36{
37 char c;
38 size_t i;
39
40 size = size <= 8 ? size : 8;
41 printk(KERN_DEBUG "zd1211 %p ", bytes);
42 for (i = 0; i < 8; i++) {
43 switch (i) {
44 case 1:
45 case 5:
46 c = '.';
47 break;
48 case 3:
49 c = ':';
50 break;
51 default:
52 c = ' ';
53 }
54 if (i < size) {
55 printk("%c%c%c", hex(bytes[i] >> 4), hex(bytes[i]), c);
56 } else {
57 printk(" %c", c);
58 }
59 }
60
61 for (i = 0; i < size; i++)
62 printk("%c", hex_print(bytes[i]));
63 printk("\n");
64}
65
66void zd_hexdump(const void *bytes, size_t size)
67{
68 size_t i = 0;
69
70 do {
71 dump_line((u8 *)bytes + i, size-i);
72 i += 8;
73 } while (i < size);
74}
75#endif /* DEBUG */
76
77void *zd_tail(const void *buffer, size_t buffer_size, size_t tail_size)
78{
79 if (buffer_size < tail_size)
80 return NULL;
81 return (u8 *)buffer + (buffer_size - tail_size);
82}
diff --git a/drivers/w1/w1_io.h b/drivers/net/wireless/zd1211rw/zd_util.h
index 9a76d2ad69c5..ce26f7adea92 100644
--- a/drivers/w1/w1_io.h
+++ b/drivers/net/wireless/zd1211rw/zd_util.h
@@ -1,8 +1,4 @@
1/* 1/* zd_util.h
2 * w1_io.h
3 *
4 * Copyright (c) 2004 Evgeniy Polyakov <johnpol@2ka.mipt.ru>
5 *
6 * 2 *
7 * This program is free software; you can redistribute it and/or modify 3 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 4 * it under the terms of the GNU General Public License as published by
@@ -19,18 +15,15 @@
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */ 16 */
21 17
22#ifndef __W1_IO_H 18#ifndef _ZD_UTIL_H
23#define __W1_IO_H 19#define _ZD_UTIL_H
24 20
25#include "w1.h" 21void *zd_tail(const void *buffer, size_t buffer_size, size_t tail_size);
26 22
27u8 w1_triplet(struct w1_master *dev, int bdir); 23#ifdef DEBUG
28void w1_write_8(struct w1_master *, u8); 24void zd_hexdump(const void *bytes, size_t size);
29int w1_reset_bus(struct w1_master *); 25#else
30u8 w1_calc_crc8(u8 *, int); 26#define zd_hexdump(bytes, size)
31void w1_write_block(struct w1_master *, const u8 *, int); 27#endif /* DEBUG */
32u8 w1_read_block(struct w1_master *, u8 *, int);
33void w1_search_devices(struct w1_master *dev, w1_slave_found_callback cb);
34int w1_reset_select_slave(struct w1_slave *sl);
35 28
36#endif /* __W1_IO_H */ 29#endif /* _ZD_UTIL_H */
diff --git a/drivers/net/yellowfin.c b/drivers/net/yellowfin.c
index bbbf7e274a2a..8459a18254a4 100644
--- a/drivers/net/yellowfin.c
+++ b/drivers/net/yellowfin.c
@@ -19,37 +19,13 @@
19 19
20 Support and updates available at 20 Support and updates available at
21 http://www.scyld.com/network/yellowfin.html 21 http://www.scyld.com/network/yellowfin.html
22 [link no longer provides useful info -jgarzik]
22 23
23
24 Linux kernel changelog:
25 -----------------------
26
27 LK1.1.1 (jgarzik): Port to 2.4 kernel
28
29 LK1.1.2 (jgarzik):
30 * Merge in becker version 1.05
31
32 LK1.1.3 (jgarzik):
33 * Various cleanups
34 * Update yellowfin_timer to correctly calculate duplex.
35 (suggested by Manfred Spraul)
36
37 LK1.1.4 (val@nmt.edu):
38 * Fix three endian-ness bugs
39 * Support dual function SYM53C885E ethernet chip
40
41 LK1.1.5 (val@nmt.edu):
42 * Fix forced full-duplex bug I introduced
43
44 LK1.1.6 (val@nmt.edu):
45 * Only print warning on truly "oversized" packets
46 * Fix theoretical bug on gigabit cards - return to 1.1.3 behavior
47
48*/ 24*/
49 25
50#define DRV_NAME "yellowfin" 26#define DRV_NAME "yellowfin"
51#define DRV_VERSION "1.05+LK1.1.6" 27#define DRV_VERSION "2.0"
52#define DRV_RELDATE "Feb 11, 2002" 28#define DRV_RELDATE "Jun 27, 2006"
53 29
54#define PFX DRV_NAME ": " 30#define PFX DRV_NAME ": "
55 31
@@ -239,8 +215,11 @@ enum capability_flags {
239 HasMACAddrBug=32, /* Only on early revs. */ 215 HasMACAddrBug=32, /* Only on early revs. */
240 DontUseEeprom=64, /* Don't read the MAC from the EEPROm. */ 216 DontUseEeprom=64, /* Don't read the MAC from the EEPROm. */
241}; 217};
218
242/* The PCI I/O space extent. */ 219/* The PCI I/O space extent. */
243#define YELLOWFIN_SIZE 0x100 220enum {
221 YELLOWFIN_SIZE = 0x100,
222};
244 223
245struct pci_id_info { 224struct pci_id_info {
246 const char *name; 225 const char *name;
@@ -248,16 +227,14 @@ struct pci_id_info {
248 int pci, pci_mask, subsystem, subsystem_mask; 227 int pci, pci_mask, subsystem, subsystem_mask;
249 int revision, revision_mask; /* Only 8 bits. */ 228 int revision, revision_mask; /* Only 8 bits. */
250 } id; 229 } id;
251 int io_size; /* Needed for I/O region check or ioremap(). */
252 int drv_flags; /* Driver use, intended as capability flags. */ 230 int drv_flags; /* Driver use, intended as capability flags. */
253}; 231};
254 232
255static const struct pci_id_info pci_id_tbl[] = { 233static const struct pci_id_info pci_id_tbl[] = {
256 {"Yellowfin G-NIC Gigabit Ethernet", { 0x07021000, 0xffffffff}, 234 {"Yellowfin G-NIC Gigabit Ethernet", { 0x07021000, 0xffffffff},
257 YELLOWFIN_SIZE,
258 FullTxStatus | IsGigabit | HasMulticastBug | HasMACAddrBug | DontUseEeprom}, 235 FullTxStatus | IsGigabit | HasMulticastBug | HasMACAddrBug | DontUseEeprom},
259 {"Symbios SYM83C885", { 0x07011000, 0xffffffff}, 236 {"Symbios SYM83C885", { 0x07011000, 0xffffffff},
260 YELLOWFIN_SIZE, HasMII | DontUseEeprom }, 237 HasMII | DontUseEeprom },
261 { } 238 { }
262}; 239};
263 240
diff --git a/drivers/pci/hotplug/Kconfig b/drivers/pci/hotplug/Kconfig
index 222a1cc4aa28..3fae77ffb2fa 100644
--- a/drivers/pci/hotplug/Kconfig
+++ b/drivers/pci/hotplug/Kconfig
@@ -6,8 +6,7 @@ menu "PCI Hotplug Support"
6 6
7config HOTPLUG_PCI 7config HOTPLUG_PCI
8 tristate "Support for PCI Hotplug (EXPERIMENTAL)" 8 tristate "Support for PCI Hotplug (EXPERIMENTAL)"
9 depends on PCI && EXPERIMENTAL 9 depends on PCI && EXPERIMENTAL && HOTPLUG
10 select HOTPLUG
11 ---help--- 10 ---help---
12 Say Y here if you have a motherboard with a PCI Hotplug controller. 11 Say Y here if you have a motherboard with a PCI Hotplug controller.
13 This allows you to add and remove PCI cards while the machine is 12 This allows you to add and remove PCI cards while the machine is
@@ -77,7 +76,7 @@ config HOTPLUG_PCI_IBM
77 76
78config HOTPLUG_PCI_ACPI 77config HOTPLUG_PCI_ACPI
79 tristate "ACPI PCI Hotplug driver" 78 tristate "ACPI PCI Hotplug driver"
80 depends on ACPI && HOTPLUG_PCI 79 depends on ACPI_DOCK && HOTPLUG_PCI
81 help 80 help
82 Say Y here if you have a system that supports PCI Hotplug using 81 Say Y here if you have a system that supports PCI Hotplug using
83 ACPI. 82 ACPI.
diff --git a/drivers/pci/hotplug/acpiphp_core.c b/drivers/pci/hotplug/acpiphp_core.c
index 34de5697983d..e2fef60c2d06 100644
--- a/drivers/pci/hotplug/acpiphp_core.c
+++ b/drivers/pci/hotplug/acpiphp_core.c
@@ -27,8 +27,7 @@
27 * along with this program; if not, write to the Free Software 27 * along with this program; if not, write to the Free Software
28 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 28 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 * 29 *
30 * Send feedback to <gregkh@us.ibm.com>, 30 * Send feedback to <kristen.c.accardi@intel.com>
31 * <t-kochi@bq.jp.nec.com>
32 * 31 *
33 */ 32 */
34 33
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index ef95d12fb32c..ae67a8f55ba1 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -26,7 +26,7 @@
26 * along with this program; if not, write to the Free Software 26 * along with this program; if not, write to the Free Software
27 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 27 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 * 28 *
29 * Send feedback to <t-kochi@bq.jp.nec.com> 29 * Send feedback to <kristen.c.accardi@intel.com>
30 * 30 *
31 */ 31 */
32 32
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 36bc7c415af7..a83c1f5735d6 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -47,13 +47,13 @@ msi_register(struct msi_ops *ops)
47 47
48static void msi_cache_ctor(void *p, kmem_cache_t *cache, unsigned long flags) 48static void msi_cache_ctor(void *p, kmem_cache_t *cache, unsigned long flags)
49{ 49{
50 memset(p, 0, NR_IRQS * sizeof(struct msi_desc)); 50 memset(p, 0, sizeof(struct msi_desc));
51} 51}
52 52
53static int msi_cache_init(void) 53static int msi_cache_init(void)
54{ 54{
55 msi_cachep = kmem_cache_create("msi_cache", 55 msi_cachep = kmem_cache_create("msi_cache",
56 NR_IRQS * sizeof(struct msi_desc), 56 sizeof(struct msi_desc),
57 0, SLAB_HWCACHE_ALIGN, msi_cache_ctor, NULL); 57 0, SLAB_HWCACHE_ALIGN, msi_cache_ctor, NULL);
58 if (!msi_cachep) 58 if (!msi_cachep)
59 return -ENOMEM; 59 return -ENOMEM;
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index cf57d7de3765..9f79dd6d51ab 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -19,6 +19,7 @@
19#include <asm/dma.h> /* isa_dma_bridge_buggy */ 19#include <asm/dma.h> /* isa_dma_bridge_buggy */
20#include "pci.h" 20#include "pci.h"
21 21
22unsigned int pci_pm_d3_delay = 10;
22 23
23/** 24/**
24 * pci_bus_max_busnr - returns maximum PCI bus number of given bus' children 25 * pci_bus_max_busnr - returns maximum PCI bus number of given bus' children
@@ -313,6 +314,14 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state)
313 } else if (dev->current_state == state) 314 } else if (dev->current_state == state)
314 return 0; /* we're already there */ 315 return 0; /* we're already there */
315 316
317 /*
318 * If the device or the parent bridge can't support PCI PM, ignore
319 * the request if we're doing anything besides putting it into D0
320 * (which would only happen on boot).
321 */
322 if ((state == PCI_D1 || state == PCI_D2) && pci_no_d1d2(dev))
323 return 0;
324
316 /* find PCI PM capability in list */ 325 /* find PCI PM capability in list */
317 pm = pci_find_capability(dev, PCI_CAP_ID_PM); 326 pm = pci_find_capability(dev, PCI_CAP_ID_PM);
318 327
@@ -363,7 +372,7 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state)
363 /* Mandatory power management transition delays */ 372 /* Mandatory power management transition delays */
364 /* see PCI PM 1.1 5.6.1 table 18 */ 373 /* see PCI PM 1.1 5.6.1 table 18 */
365 if (state == PCI_D3hot || dev->current_state == PCI_D3hot) 374 if (state == PCI_D3hot || dev->current_state == PCI_D3hot)
366 msleep(10); 375 msleep(pci_pm_d3_delay);
367 else if (state == PCI_D2 || dev->current_state == PCI_D2) 376 else if (state == PCI_D2 || dev->current_state == PCI_D2)
368 udelay(200); 377 udelay(200);
369 378
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 9cc842b666eb..08d58fc78ee1 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -47,7 +47,7 @@ extern int pci_msi_quirk;
47#else 47#else
48#define pci_msi_quirk 0 48#define pci_msi_quirk 0
49#endif 49#endif
50 50extern unsigned int pci_pm_d3_delay;
51#ifdef CONFIG_PCI_MSI 51#ifdef CONFIG_PCI_MSI
52void disable_msi_mode(struct pci_dev *dev, int pos, int type); 52void disable_msi_mode(struct pci_dev *dev, int pos, int type);
53void pci_no_msi(void); 53void pci_no_msi(void);
@@ -66,7 +66,15 @@ static inline int pci_save_msix_state(struct pci_dev *dev) { return 0; }
66static inline void pci_restore_msi_state(struct pci_dev *dev) {} 66static inline void pci_restore_msi_state(struct pci_dev *dev) {}
67static inline void pci_restore_msix_state(struct pci_dev *dev) {} 67static inline void pci_restore_msix_state(struct pci_dev *dev) {}
68#endif 68#endif
69static inline int pci_no_d1d2(struct pci_dev *dev)
70{
71 unsigned int parent_dstates = 0;
69 72
73 if (dev->bus->self)
74 parent_dstates = dev->bus->self->no_d1d2;
75 return (dev->no_d1d2 || parent_dstates);
76
77}
70extern int pcie_mch_quirk; 78extern int pcie_mch_quirk;
71extern struct device_attribute pci_dev_attrs[]; 79extern struct device_attribute pci_dev_attrs[];
72extern struct class_device_attribute class_device_attr_cpuaffinity; 80extern struct class_device_attribute class_device_attr_cpuaffinity;
diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c
index 50bfc1b2f3bf..478d0d28f7ad 100644
--- a/drivers/pci/pcie/portdrv_pci.c
+++ b/drivers/pci/pcie/portdrv_pci.c
@@ -30,23 +30,6 @@ MODULE_LICENSE("GPL");
30/* global data */ 30/* global data */
31static const char device_name[] = "pcieport-driver"; 31static const char device_name[] = "pcieport-driver";
32 32
33static int pcie_portdrv_save_config(struct pci_dev *dev)
34{
35 return pci_save_state(dev);
36}
37
38static int pcie_portdrv_restore_config(struct pci_dev *dev)
39{
40 int retval;
41
42 pci_restore_state(dev);
43 retval = pci_enable_device(dev);
44 if (retval)
45 return retval;
46 pci_set_master(dev);
47 return 0;
48}
49
50/* 33/*
51 * pcie_portdrv_probe - Probe PCI-Express port devices 34 * pcie_portdrv_probe - Probe PCI-Express port devices
52 * @dev: PCI-Express port device being probed 35 * @dev: PCI-Express port device being probed
@@ -73,8 +56,10 @@ static int __devinit pcie_portdrv_probe (struct pci_dev *dev,
73 "%s->Dev[%04x:%04x] has invalid IRQ. Check vendor BIOS\n", 56 "%s->Dev[%04x:%04x] has invalid IRQ. Check vendor BIOS\n",
74 __FUNCTION__, dev->device, dev->vendor); 57 __FUNCTION__, dev->device, dev->vendor);
75 } 58 }
76 if (pcie_port_device_register(dev)) 59 if (pcie_port_device_register(dev)) {
60 pci_disable_device(dev);
77 return -ENOMEM; 61 return -ENOMEM;
62 }
78 63
79 return 0; 64 return 0;
80} 65}
@@ -86,6 +71,23 @@ static void pcie_portdrv_remove (struct pci_dev *dev)
86} 71}
87 72
88#ifdef CONFIG_PM 73#ifdef CONFIG_PM
74static int pcie_portdrv_save_config(struct pci_dev *dev)
75{
76 return pci_save_state(dev);
77}
78
79static int pcie_portdrv_restore_config(struct pci_dev *dev)
80{
81 int retval;
82
83 pci_restore_state(dev);
84 retval = pci_enable_device(dev);
85 if (retval)
86 return retval;
87 pci_set_master(dev);
88 return 0;
89}
90
89static int pcie_portdrv_suspend (struct pci_dev *dev, pm_message_t state) 91static int pcie_portdrv_suspend (struct pci_dev *dev, pm_message_t state)
90{ 92{
91 int ret = pcie_port_device_suspend(dev, state); 93 int ret = pcie_port_device_suspend(dev, state);
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index f89dbc3738b7..c5a58d1c6c1c 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -815,6 +815,7 @@ pci_scan_device(struct pci_bus *bus, int devfn)
815 dev->vendor = l & 0xffff; 815 dev->vendor = l & 0xffff;
816 dev->device = (l >> 16) & 0xffff; 816 dev->device = (l >> 16) & 0xffff;
817 dev->cfg_size = pci_cfg_space_size(dev); 817 dev->cfg_size = pci_cfg_space_size(dev);
818 dev->error_state = pci_channel_io_normal;
818 819
819 /* Assume 32-bit PCI; let 64-bit PCI cards (which are far rarer) 820 /* Assume 32-bit PCI; let 64-bit PCI cards (which are far rarer)
820 set this higher, assuming the system even supports it. */ 821 set this higher, assuming the system even supports it. */
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index d1d7333bb71b..fb08bc951ac0 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -400,6 +400,7 @@ static void __devinit quirk_piix4_acpi(struct pci_dev *dev)
400 piix4_io_quirk(dev, "PIIX4 devres J", 0x7c, 1 << 20); 400 piix4_io_quirk(dev, "PIIX4 devres J", 0x7c, 1 << 20);
401} 401}
402DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3, quirk_piix4_acpi ); 402DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3, quirk_piix4_acpi );
403DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443MX_3, quirk_piix4_acpi );
403 404
404/* 405/*
405 * ICH4, ICH4-M, ICH5, ICH5-M ACPI: Three IO regions pointed to by longwords at 406 * ICH4, ICH4-M, ICH5, ICH5-M ACPI: Three IO regions pointed to by longwords at
@@ -682,6 +683,33 @@ static void __devinit quirk_vt82c598_id(struct pci_dev *dev)
682} 683}
683DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C597_0, quirk_vt82c598_id ); 684DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C597_0, quirk_vt82c598_id );
684 685
686#ifdef CONFIG_ACPI_SLEEP
687
688/*
689 * Some VIA systems boot with the abnormal status flag set. This can cause
690 * the BIOS to re-POST the system on resume rather than passing control
691 * back to the OS. Clear the flag on boot
692 */
693static void __devinit quirk_via_abnormal_poweroff(struct pci_dev *dev)
694{
695 u32 reg;
696
697 acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK, ACPI_REGISTER_PM1_STATUS,
698 &reg);
699
700 if (reg & 0x800) {
701 printk("Clearing abnormal poweroff flag\n");
702 acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK,
703 ACPI_REGISTER_PM1_STATUS,
704 (u16)0x800);
705 }
706}
707
708DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8235, quirk_via_abnormal_poweroff);
709DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237, quirk_via_abnormal_poweroff);
710
711#endif
712
685/* 713/*
686 * CardBus controllers have a legacy base address that enables them 714 * CardBus controllers have a legacy base address that enables them
687 * to respond as i82365 pcmcia controllers. We don't want them to 715 * to respond as i82365 pcmcia controllers. We don't want them to
@@ -962,6 +990,11 @@ static void __init asus_hides_smbus_hostbridge(struct pci_dev *dev)
962 case 0x8070: /* P4G8X Deluxe */ 990 case 0x8070: /* P4G8X Deluxe */
963 asus_hides_smbus = 1; 991 asus_hides_smbus = 1;
964 } 992 }
993 if (dev->device == PCI_DEVICE_ID_INTEL_E7501_MCH)
994 switch (dev->subsystem_device) {
995 case 0x80c9: /* PU-DLS */
996 asus_hides_smbus = 1;
997 }
965 if (dev->device == PCI_DEVICE_ID_INTEL_82855GM_HB) 998 if (dev->device == PCI_DEVICE_ID_INTEL_82855GM_HB)
966 switch (dev->subsystem_device) { 999 switch (dev->subsystem_device) {
967 case 0x1751: /* M2N notebook */ 1000 case 0x1751: /* M2N notebook */
@@ -1030,6 +1063,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82845G_HB, asu
1030DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82850_HB, asus_hides_smbus_hostbridge ); 1063DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82850_HB, asus_hides_smbus_hostbridge );
1031DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82865_HB, asus_hides_smbus_hostbridge ); 1064DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82865_HB, asus_hides_smbus_hostbridge );
1032DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_7205_0, asus_hides_smbus_hostbridge ); 1065DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_7205_0, asus_hides_smbus_hostbridge );
1066DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7501_MCH, asus_hides_smbus_hostbridge );
1033DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82855PM_HB, asus_hides_smbus_hostbridge ); 1067DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82855PM_HB, asus_hides_smbus_hostbridge );
1034DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82855GM_HB, asus_hides_smbus_hostbridge ); 1068DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82855GM_HB, asus_hides_smbus_hostbridge );
1035DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82915GM_HB, asus_hides_smbus_hostbridge ); 1069DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82915GM_HB, asus_hides_smbus_hostbridge );
@@ -1053,6 +1087,7 @@ static void __init asus_hides_smbus_lpc(struct pci_dev *dev)
1053} 1087}
1054DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_0, asus_hides_smbus_lpc ); 1088DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_0, asus_hides_smbus_lpc );
1055DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_0, asus_hides_smbus_lpc ); 1089DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_0, asus_hides_smbus_lpc );
1090DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_0, asus_hides_smbus_lpc );
1056DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_12, asus_hides_smbus_lpc ); 1091DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_12, asus_hides_smbus_lpc );
1057DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_12, asus_hides_smbus_lpc ); 1092DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_12, asus_hides_smbus_lpc );
1058DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0, asus_hides_smbus_lpc ); 1093DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0, asus_hides_smbus_lpc );
@@ -1174,6 +1209,55 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_962, quirk_sis_96x_
1174DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_963, quirk_sis_96x_smbus ); 1209DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_963, quirk_sis_96x_smbus );
1175DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_LPC, quirk_sis_96x_smbus ); 1210DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_LPC, quirk_sis_96x_smbus );
1176 1211
1212#if defined(CONFIG_SCSI_SATA) || defined(CONFIG_SCSI_SATA_MODULE)
1213
1214/*
1215 * If we are using libata we can drive this chip properly but must
1216 * do this early on to make the additional device appear during
1217 * the PCI scanning.
1218 */
1219
1220static void __devinit quirk_jmicron_dualfn(struct pci_dev *pdev)
1221{
1222 u32 conf;
1223 u8 hdr;
1224
1225 /* Only poke fn 0 */
1226 if (PCI_FUNC(pdev->devfn))
1227 return;
1228
1229 switch(pdev->device) {
1230 case PCI_DEVICE_ID_JMICRON_JMB365:
1231 case PCI_DEVICE_ID_JMICRON_JMB366:
1232 /* Redirect IDE second PATA port to the right spot */
1233 pci_read_config_dword(pdev, 0x80, &conf);
1234 conf |= (1 << 24);
1235 /* Fall through */
1236 pci_write_config_dword(pdev, 0x80, conf);
1237 case PCI_DEVICE_ID_JMICRON_JMB361:
1238 case PCI_DEVICE_ID_JMICRON_JMB363:
1239 pci_read_config_dword(pdev, 0x40, &conf);
1240 /* Enable dual function mode, AHCI on fn 0, IDE fn1 */
1241 /* Set the class codes correctly and then direct IDE 0 */
1242 conf &= ~0x000F0200; /* Clear bit 9 and 16-19 */
1243 conf |= 0x00C20002; /* Set bit 1, 17, 22, 23 */
1244 pci_write_config_dword(pdev, 0x40, conf);
1245
1246 /* Reconfigure so that the PCI scanner discovers the
1247 device is now multifunction */
1248
1249 pci_read_config_byte(pdev, PCI_HEADER_TYPE, &hdr);
1250 pdev->hdr_type = hdr & 0x7f;
1251 pdev->multifunction = !!(hdr & 0x80);
1252
1253 break;
1254 }
1255}
1256
1257DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, quirk_jmicron_dualfn);
1258
1259#endif
1260
1177#ifdef CONFIG_X86_IO_APIC 1261#ifdef CONFIG_X86_IO_APIC
1178static void __init quirk_alder_ioapic(struct pci_dev *pdev) 1262static void __init quirk_alder_ioapic(struct pci_dev *pdev)
1179{ 1263{
@@ -1341,6 +1425,37 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_0, quirk_pc
1341DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_1, quirk_pcie_pxh); 1425DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_1, quirk_pcie_pxh);
1342DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXHV, quirk_pcie_pxh); 1426DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXHV, quirk_pcie_pxh);
1343 1427
1428/*
1429 * Some Intel PCI Express chipsets have trouble with downstream
1430 * device power management.
1431 */
1432static void quirk_intel_pcie_pm(struct pci_dev * dev)
1433{
1434 pci_pm_d3_delay = 120;
1435 dev->no_d1d2 = 1;
1436}
1437
1438DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e2, quirk_intel_pcie_pm);
1439DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e3, quirk_intel_pcie_pm);
1440DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e4, quirk_intel_pcie_pm);
1441DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e5, quirk_intel_pcie_pm);
1442DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e6, quirk_intel_pcie_pm);
1443DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e7, quirk_intel_pcie_pm);
1444DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25f7, quirk_intel_pcie_pm);
1445DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25f8, quirk_intel_pcie_pm);
1446DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25f9, quirk_intel_pcie_pm);
1447DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25fa, quirk_intel_pcie_pm);
1448DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2601, quirk_intel_pcie_pm);
1449DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2602, quirk_intel_pcie_pm);
1450DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2603, quirk_intel_pcie_pm);
1451DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2604, quirk_intel_pcie_pm);
1452DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2605, quirk_intel_pcie_pm);
1453DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2606, quirk_intel_pcie_pm);
1454DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2607, quirk_intel_pcie_pm);
1455DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2608, quirk_intel_pcie_pm);
1456DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2609, quirk_intel_pcie_pm);
1457DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x260a, quirk_intel_pcie_pm);
1458DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x260b, quirk_intel_pcie_pm);
1344 1459
1345/* 1460/*
1346 * Fixup the cardbus bridges on the IBM Dock II docking station 1461 * Fixup the cardbus bridges on the IBM Dock II docking station
diff --git a/drivers/pci/search.c b/drivers/pci/search.c
index 622b3f8ba820..d529462d1b53 100644
--- a/drivers/pci/search.c
+++ b/drivers/pci/search.c
@@ -41,7 +41,7 @@ pci_do_find_bus(struct pci_bus* bus, unsigned char busnr)
41 * in the global list of PCI buses. If the bus is found, a pointer to its 41 * in the global list of PCI buses. If the bus is found, a pointer to its
42 * data structure is returned. If no bus is found, %NULL is returned. 42 * data structure is returned. If no bus is found, %NULL is returned.
43 */ 43 */
44struct pci_bus * __devinit pci_find_bus(int domain, int busnr) 44struct pci_bus * pci_find_bus(int domain, int busnr)
45{ 45{
46 struct pci_bus *bus = NULL; 46 struct pci_bus *bus = NULL;
47 struct pci_bus *tmp_bus; 47 struct pci_bus *tmp_bus;
@@ -61,7 +61,7 @@ struct pci_bus * __devinit pci_find_bus(int domain, int busnr)
61 * @from: Previous PCI bus found, or %NULL for new search. 61 * @from: Previous PCI bus found, or %NULL for new search.
62 * 62 *
63 * Iterates through the list of known PCI busses. A new search is 63 * Iterates through the list of known PCI busses. A new search is
64 * initiated by passing %NULL to the @from argument. Otherwise if 64 * initiated by passing %NULL as the @from argument. Otherwise if
65 * @from is not %NULL, searches continue from next device on the 65 * @from is not %NULL, searches continue from next device on the
66 * global list. 66 * global list.
67 */ 67 */
@@ -148,13 +148,14 @@ struct pci_dev * pci_get_slot(struct pci_bus *bus, unsigned int devfn)
148 * @from: Previous PCI device found in search, or %NULL for new search. 148 * @from: Previous PCI device found in search, or %NULL for new search.
149 * 149 *
150 * Iterates through the list of known PCI devices. If a PCI device is 150 * Iterates through the list of known PCI devices. If a PCI device is
151 * found with a matching @vendor, @device, @ss_vendor and @ss_device, a pointer to its 151 * found with a matching @vendor, @device, @ss_vendor and @ss_device, a
152 * device structure is returned. Otherwise, %NULL is returned. 152 * pointer to its device structure is returned. Otherwise, %NULL is returned.
153 * A new search is initiated by passing %NULL to the @from argument. 153 * A new search is initiated by passing %NULL as the @from argument.
154 * Otherwise if @from is not %NULL, searches continue from next device on the global list. 154 * Otherwise if @from is not %NULL, searches continue from next device
155 * on the global list.
155 * 156 *
156 * NOTE: Do not use this function anymore, use pci_get_subsys() instead, as 157 * NOTE: Do not use this function any more; use pci_get_subsys() instead, as
157 * the pci device returned by this function can disappear at any moment in 158 * the PCI device returned by this function can disappear at any moment in
158 * time. 159 * time.
159 */ 160 */
160static struct pci_dev * pci_find_subsys(unsigned int vendor, 161static struct pci_dev * pci_find_subsys(unsigned int vendor,
@@ -191,14 +192,15 @@ exit:
191 * @device: PCI device id to match, or %PCI_ANY_ID to match all device ids 192 * @device: PCI device id to match, or %PCI_ANY_ID to match all device ids
192 * @from: Previous PCI device found in search, or %NULL for new search. 193 * @from: Previous PCI device found in search, or %NULL for new search.
193 * 194 *
194 * Iterates through the list of known PCI devices. If a PCI device is 195 * Iterates through the list of known PCI devices. If a PCI device is found
195 * found with a matching @vendor and @device, a pointer to its device structure is 196 * with a matching @vendor and @device, a pointer to its device structure is
196 * returned. Otherwise, %NULL is returned. 197 * returned. Otherwise, %NULL is returned.
197 * A new search is initiated by passing %NULL to the @from argument. 198 * A new search is initiated by passing %NULL as the @from argument.
198 * Otherwise if @from is not %NULL, searches continue from next device on the global list. 199 * Otherwise if @from is not %NULL, searches continue from next device
200 * on the global list.
199 * 201 *
200 * NOTE: Do not use this function anymore, use pci_get_device() instead, as 202 * NOTE: Do not use this function any more; use pci_get_device() instead, as
201 * the pci device returned by this function can disappear at any moment in 203 * the PCI device returned by this function can disappear at any moment in
202 * time. 204 * time.
203 */ 205 */
204struct pci_dev * 206struct pci_dev *
@@ -215,11 +217,11 @@ pci_find_device(unsigned int vendor, unsigned int device, const struct pci_dev *
215 * @ss_device: PCI subsystem device id to match, or %PCI_ANY_ID to match all device ids 217 * @ss_device: PCI subsystem device id to match, or %PCI_ANY_ID to match all device ids
216 * @from: Previous PCI device found in search, or %NULL for new search. 218 * @from: Previous PCI device found in search, or %NULL for new search.
217 * 219 *
218 * Iterates through the list of known PCI devices. If a PCI device is 220 * Iterates through the list of known PCI devices. If a PCI device is found
219 * found with a matching @vendor, @device, @ss_vendor and @ss_device, a pointer to its 221 * with a matching @vendor, @device, @ss_vendor and @ss_device, a pointer to its
220 * device structure is returned, and the reference count to the device is 222 * device structure is returned, and the reference count to the device is
221 * incremented. Otherwise, %NULL is returned. A new search is initiated by 223 * incremented. Otherwise, %NULL is returned. A new search is initiated by
222 * passing %NULL to the @from argument. Otherwise if @from is not %NULL, 224 * passing %NULL as the @from argument. Otherwise if @from is not %NULL,
223 * searches continue from next device on the global list. 225 * searches continue from next device on the global list.
224 * The reference count for @from is always decremented if it is not %NULL. 226 * The reference count for @from is always decremented if it is not %NULL.
225 */ 227 */
@@ -262,7 +264,7 @@ exit:
262 * found with a matching @vendor and @device, the reference count to the 264 * found with a matching @vendor and @device, the reference count to the
263 * device is incremented and a pointer to its device structure is returned. 265 * device is incremented and a pointer to its device structure is returned.
264 * Otherwise, %NULL is returned. A new search is initiated by passing %NULL 266 * Otherwise, %NULL is returned. A new search is initiated by passing %NULL
265 * to the @from argument. Otherwise if @from is not %NULL, searches continue 267 * as the @from argument. Otherwise if @from is not %NULL, searches continue
266 * from next device on the global list. The reference count for @from is 268 * from next device on the global list. The reference count for @from is
267 * always decremented if it is not %NULL. 269 * always decremented if it is not %NULL.
268 */ 270 */
@@ -279,11 +281,13 @@ pci_get_device(unsigned int vendor, unsigned int device, struct pci_dev *from)
279 * @device: PCI device id to match, or %PCI_ANY_ID to match all device ids 281 * @device: PCI device id to match, or %PCI_ANY_ID to match all device ids
280 * @from: Previous PCI device found in search, or %NULL for new search. 282 * @from: Previous PCI device found in search, or %NULL for new search.
281 * 283 *
282 * Iterates through the list of known PCI devices in the reverse order of pci_find_device(). 284 * Iterates through the list of known PCI devices in the reverse order of
285 * pci_find_device().
283 * If a PCI device is found with a matching @vendor and @device, a pointer to 286 * If a PCI device is found with a matching @vendor and @device, a pointer to
284 * its device structure is returned. Otherwise, %NULL is returned. 287 * its device structure is returned. Otherwise, %NULL is returned.
285 * A new search is initiated by passing %NULL to the @from argument. 288 * A new search is initiated by passing %NULL as the @from argument.
286 * Otherwise if @from is not %NULL, searches continue from previous device on the global list. 289 * Otherwise if @from is not %NULL, searches continue from previous device
290 * on the global list.
287 */ 291 */
288struct pci_dev * 292struct pci_dev *
289pci_find_device_reverse(unsigned int vendor, unsigned int device, const struct pci_dev *from) 293pci_find_device_reverse(unsigned int vendor, unsigned int device, const struct pci_dev *from)
@@ -317,7 +321,7 @@ exit:
317 * found with a matching @class, the reference count to the device is 321 * found with a matching @class, the reference count to the device is
318 * incremented and a pointer to its device structure is returned. 322 * incremented and a pointer to its device structure is returned.
319 * Otherwise, %NULL is returned. 323 * Otherwise, %NULL is returned.
320 * A new search is initiated by passing %NULL to the @from argument. 324 * A new search is initiated by passing %NULL as the @from argument.
321 * Otherwise if @from is not %NULL, searches continue from next device 325 * Otherwise if @from is not %NULL, searches continue from next device
322 * on the global list. The reference count for @from is always decremented 326 * on the global list. The reference count for @from is always decremented
323 * if it is not %NULL. 327 * if it is not %NULL.
diff --git a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig
index 61cb4b29f55c..35f88649d3b7 100644
--- a/drivers/pcmcia/Kconfig
+++ b/drivers/pcmcia/Kconfig
@@ -6,7 +6,7 @@ menu "PCCARD (PCMCIA/CardBus) support"
6 6
7config PCCARD 7config PCCARD
8 tristate "PCCard (PCMCIA/CardBus) support" 8 tristate "PCCard (PCMCIA/CardBus) support"
9 select HOTPLUG 9 depends on HOTPLUG
10 ---help--- 10 ---help---
11 Say Y here if you want to attach PCMCIA- or PC-cards to your Linux 11 Say Y here if you want to attach PCMCIA- or PC-cards to your Linux
12 computer. These are credit-card size devices such as network cards, 12 computer. These are credit-card size devices such as network cards,
diff --git a/drivers/pcmcia/pcmcia_ioctl.c b/drivers/pcmcia/pcmcia_ioctl.c
index 738b1ef595a3..9ad18e62658d 100644
--- a/drivers/pcmcia/pcmcia_ioctl.c
+++ b/drivers/pcmcia/pcmcia_ioctl.c
@@ -601,12 +601,8 @@ static int ds_ioctl(struct inode * inode, struct file * file,
601 ret = CS_BAD_ARGS; 601 ret = CS_BAD_ARGS;
602 else { 602 else {
603 struct pcmcia_device *p_dev = get_pcmcia_device(s, buf->config.Function); 603 struct pcmcia_device *p_dev = get_pcmcia_device(s, buf->config.Function);
604 if (p_dev == NULL) 604 ret = pccard_get_configuration_info(s, p_dev, &buf->config);
605 ret = CS_BAD_ARGS; 605 pcmcia_put_dev(p_dev);
606 else {
607 ret = pccard_get_configuration_info(s, p_dev, &buf->config);
608 pcmcia_put_dev(p_dev);
609 }
610 } 606 }
611 break; 607 break;
612 case DS_GET_FIRST_TUPLE: 608 case DS_GET_FIRST_TUPLE:
@@ -636,12 +632,8 @@ static int ds_ioctl(struct inode * inode, struct file * file,
636 ret = CS_BAD_ARGS; 632 ret = CS_BAD_ARGS;
637 else { 633 else {
638 struct pcmcia_device *p_dev = get_pcmcia_device(s, buf->status.Function); 634 struct pcmcia_device *p_dev = get_pcmcia_device(s, buf->status.Function);
639 if (p_dev == NULL) 635 ret = pccard_get_status(s, p_dev, &buf->status);
640 ret = CS_BAD_ARGS; 636 pcmcia_put_dev(p_dev);
641 else {
642 ret = pccard_get_status(s, p_dev, &buf->status);
643 pcmcia_put_dev(p_dev);
644 }
645 } 637 }
646 break; 638 break;
647 case DS_VALIDATE_CIS: 639 case DS_VALIDATE_CIS:
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index 7bf25b88ea31..c8323399e9e4 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -245,10 +245,17 @@ int pccard_get_configuration_info(struct pcmcia_socket *s,
245 return CS_SUCCESS; 245 return CS_SUCCESS;
246 } 246 }
247 247
248 /* !!! This is a hack !!! */ 248 config->Attributes = c->Attributes | CONF_VALID_CLIENT;
249 memcpy(&config->Attributes, &c->Attributes, sizeof(config_t)); 249 config->Vcc = s->socket.Vcc;
250 config->Attributes |= CONF_VALID_CLIENT; 250 config->Vpp1 = config->Vpp2 = s->socket.Vpp;
251 config->CardValues = c->CardValues; 251 config->IntType = c->IntType;
252 config->ConfigBase = c->ConfigBase;
253 config->Status = c->Status;
254 config->Pin = c->Pin;
255 config->Copy = c->Copy;
256 config->Option = c->Option;
257 config->ExtStatus = c->ExtStatus;
258 config->Present = config->CardValues = c->CardValues;
252 config->IRQAttributes = c->irq.Attributes; 259 config->IRQAttributes = c->irq.Attributes;
253 config->AssignedIRQ = s->irq.AssignedIRQ; 260 config->AssignedIRQ = s->irq.AssignedIRQ;
254 config->BasePort1 = c->io.BasePort1; 261 config->BasePort1 = c->io.BasePort1;
diff --git a/drivers/pnp/interface.c b/drivers/pnp/interface.c
index 3163e3d73da1..9d8b415eca79 100644
--- a/drivers/pnp/interface.c
+++ b/drivers/pnp/interface.c
@@ -265,8 +265,8 @@ static ssize_t pnp_show_current_resources(struct device *dmdev, struct device_at
265 pnp_printf(buffer," disabled\n"); 265 pnp_printf(buffer," disabled\n");
266 else 266 else
267 pnp_printf(buffer," 0x%llx-0x%llx\n", 267 pnp_printf(buffer," 0x%llx-0x%llx\n",
268 pnp_port_start(dev, i), 268 (unsigned long long)pnp_port_start(dev, i),
269 pnp_port_end(dev, i)); 269 (unsigned long long)pnp_port_end(dev, i));
270 } 270 }
271 } 271 }
272 for (i = 0; i < PNP_MAX_MEM; i++) { 272 for (i = 0; i < PNP_MAX_MEM; i++) {
@@ -276,8 +276,8 @@ static ssize_t pnp_show_current_resources(struct device *dmdev, struct device_at
276 pnp_printf(buffer," disabled\n"); 276 pnp_printf(buffer," disabled\n");
277 else 277 else
278 pnp_printf(buffer," 0x%llx-0x%llx\n", 278 pnp_printf(buffer," 0x%llx-0x%llx\n",
279 pnp_mem_start(dev, i), 279 (unsigned long long)pnp_mem_start(dev, i),
280 pnp_mem_end(dev, i)); 280 (unsigned long long)pnp_mem_end(dev, i));
281 } 281 }
282 } 282 }
283 for (i = 0; i < PNP_MAX_IRQ; i++) { 283 for (i = 0; i < PNP_MAX_IRQ; i++) {
@@ -287,7 +287,7 @@ static ssize_t pnp_show_current_resources(struct device *dmdev, struct device_at
287 pnp_printf(buffer," disabled\n"); 287 pnp_printf(buffer," disabled\n");
288 else 288 else
289 pnp_printf(buffer," %lld\n", 289 pnp_printf(buffer," %lld\n",
290 pnp_irq(dev, i)); 290 (unsigned long long)pnp_irq(dev, i));
291 } 291 }
292 } 292 }
293 for (i = 0; i < PNP_MAX_DMA; i++) { 293 for (i = 0; i < PNP_MAX_DMA; i++) {
@@ -297,7 +297,7 @@ static ssize_t pnp_show_current_resources(struct device *dmdev, struct device_at
297 pnp_printf(buffer," disabled\n"); 297 pnp_printf(buffer," disabled\n");
298 else 298 else
299 pnp_printf(buffer," %lld\n", 299 pnp_printf(buffer," %lld\n",
300 pnp_dma(dev, i)); 300 (unsigned long long)pnp_dma(dev, i));
301 } 301 }
302 } 302 }
303 ret = (buffer->curr - buf); 303 ret = (buffer->curr - buf);
diff --git a/drivers/pnp/pnpbios/core.c b/drivers/pnp/pnpbios/core.c
index b154b3f52cbe..551f58e29810 100644
--- a/drivers/pnp/pnpbios/core.c
+++ b/drivers/pnp/pnpbios/core.c
@@ -346,7 +346,7 @@ static int insert_device(struct pnp_dev *dev, struct pnp_bios_node * node)
346 dev->flags = node->flags; 346 dev->flags = node->flags;
347 if (!(dev->flags & PNPBIOS_NO_CONFIG)) 347 if (!(dev->flags & PNPBIOS_NO_CONFIG))
348 dev->capabilities |= PNP_CONFIGURABLE; 348 dev->capabilities |= PNP_CONFIGURABLE;
349 if (!(dev->flags & PNPBIOS_NO_DISABLE)) 349 if (!(dev->flags & PNPBIOS_NO_DISABLE) && pnpbios_is_dynamic(dev))
350 dev->capabilities |= PNP_DISABLE; 350 dev->capabilities |= PNP_DISABLE;
351 dev->capabilities |= PNP_READ; 351 dev->capabilities |= PNP_READ;
352 if (pnpbios_is_dynamic(dev)) 352 if (pnpbios_is_dynamic(dev))
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index f5b9f187a930..7ff1d88094b6 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -121,6 +121,16 @@ config RTC_DRV_DS1553
121 This driver can also be built as a module. If so, the module 121 This driver can also be built as a module. If so, the module
122 will be called rtc-ds1553. 122 will be called rtc-ds1553.
123 123
124config RTC_DRV_ISL1208
125 tristate "Intersil 1208"
126 depends on RTC_CLASS && I2C
127 help
128 If you say yes here you get support for the
129 Intersil 1208 RTC chip.
130
131 This driver can also be built as a module. If so, the module
132 will be called rtc-isl1208.
133
124config RTC_DRV_DS1672 134config RTC_DRV_DS1672
125 tristate "Dallas/Maxim DS1672" 135 tristate "Dallas/Maxim DS1672"
126 depends on RTC_CLASS && I2C 136 depends on RTC_CLASS && I2C
diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile
index 54220714ff49..bbcfb09d81d9 100644
--- a/drivers/rtc/Makefile
+++ b/drivers/rtc/Makefile
@@ -12,6 +12,7 @@ obj-$(CONFIG_RTC_INTF_PROC) += rtc-proc.o
12obj-$(CONFIG_RTC_INTF_DEV) += rtc-dev.o 12obj-$(CONFIG_RTC_INTF_DEV) += rtc-dev.o
13 13
14obj-$(CONFIG_RTC_DRV_X1205) += rtc-x1205.o 14obj-$(CONFIG_RTC_DRV_X1205) += rtc-x1205.o
15obj-$(CONFIG_RTC_DRV_ISL1208) += rtc-isl1208.o
15obj-$(CONFIG_RTC_DRV_TEST) += rtc-test.o 16obj-$(CONFIG_RTC_DRV_TEST) += rtc-test.o
16obj-$(CONFIG_RTC_DRV_DS1307) += rtc-ds1307.o 17obj-$(CONFIG_RTC_DRV_DS1307) += rtc-ds1307.o
17obj-$(CONFIG_RTC_DRV_DS1672) += rtc-ds1672.o 18obj-$(CONFIG_RTC_DRV_DS1672) += rtc-ds1672.o
diff --git a/drivers/rtc/rtc-isl1208.c b/drivers/rtc/rtc-isl1208.c
new file mode 100644
index 000000000000..f324d0a635d4
--- /dev/null
+++ b/drivers/rtc/rtc-isl1208.c
@@ -0,0 +1,591 @@
1/*
2 * Intersil ISL1208 rtc class driver
3 *
4 * Copyright 2005,2006 Hebert Valerio Riedel <hvr@gnu.org>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 *
11 */
12
13#include <linux/module.h>
14#include <linux/i2c.h>
15#include <linux/bcd.h>
16#include <linux/rtc.h>
17
18#define DRV_NAME "isl1208"
19#define DRV_VERSION "0.2"
20
21/* Register map */
22/* rtc section */
23#define ISL1208_REG_SC 0x00
24#define ISL1208_REG_MN 0x01
25#define ISL1208_REG_HR 0x02
26#define ISL1208_REG_HR_MIL (1<<7) /* 24h/12h mode */
27#define ISL1208_REG_HR_PM (1<<5) /* PM/AM bit in 12h mode */
28#define ISL1208_REG_DT 0x03
29#define ISL1208_REG_MO 0x04
30#define ISL1208_REG_YR 0x05
31#define ISL1208_REG_DW 0x06
32#define ISL1208_RTC_SECTION_LEN 7
33
34/* control/status section */
35#define ISL1208_REG_SR 0x07
36#define ISL1208_REG_SR_ARST (1<<7) /* auto reset */
37#define ISL1208_REG_SR_XTOSCB (1<<6) /* crystal oscillator */
38#define ISL1208_REG_SR_WRTC (1<<4) /* write rtc */
39#define ISL1208_REG_SR_ALM (1<<2) /* alarm */
40#define ISL1208_REG_SR_BAT (1<<1) /* battery */
41#define ISL1208_REG_SR_RTCF (1<<0) /* rtc fail */
42#define ISL1208_REG_INT 0x08
43#define ISL1208_REG_09 0x09 /* reserved */
44#define ISL1208_REG_ATR 0x0a
45#define ISL1208_REG_DTR 0x0b
46
47/* alarm section */
48#define ISL1208_REG_SCA 0x0c
49#define ISL1208_REG_MNA 0x0d
50#define ISL1208_REG_HRA 0x0e
51#define ISL1208_REG_DTA 0x0f
52#define ISL1208_REG_MOA 0x10
53#define ISL1208_REG_DWA 0x11
54#define ISL1208_ALARM_SECTION_LEN 6
55
56/* user section */
57#define ISL1208_REG_USR1 0x12
58#define ISL1208_REG_USR2 0x13
59#define ISL1208_USR_SECTION_LEN 2
60
61/* i2c configuration */
62#define ISL1208_I2C_ADDR 0xde
63
64static unsigned short normal_i2c[] = {
65 ISL1208_I2C_ADDR>>1, I2C_CLIENT_END
66};
67I2C_CLIENT_INSMOD; /* defines addr_data */
68
69static int isl1208_attach_adapter(struct i2c_adapter *adapter);
70static int isl1208_detach_client(struct i2c_client *client);
71
72static struct i2c_driver isl1208_driver = {
73 .driver = {
74 .name = DRV_NAME,
75 },
76 .id = I2C_DRIVERID_ISL1208,
77 .attach_adapter = &isl1208_attach_adapter,
78 .detach_client = &isl1208_detach_client,
79};
80
81/* block read */
82static int
83isl1208_i2c_read_regs(struct i2c_client *client, u8 reg, u8 buf[],
84 unsigned len)
85{
86 u8 reg_addr[1] = { reg };
87 struct i2c_msg msgs[2] = {
88 { client->addr, client->flags, sizeof(reg_addr), reg_addr },
89 { client->addr, client->flags | I2C_M_RD, len, buf }
90 };
91 int ret;
92
93 BUG_ON(len == 0);
94 BUG_ON(reg > ISL1208_REG_USR2);
95 BUG_ON(reg + len > ISL1208_REG_USR2 + 1);
96
97 ret = i2c_transfer(client->adapter, msgs, 2);
98 if (ret > 0)
99 ret = 0;
100 return ret;
101}
102
103/* block write */
104static int
105isl1208_i2c_set_regs(struct i2c_client *client, u8 reg, u8 const buf[],
106 unsigned len)
107{
108 u8 i2c_buf[ISL1208_REG_USR2 + 2];
109 struct i2c_msg msgs[1] = {
110 { client->addr, client->flags, len + 1, i2c_buf }
111 };
112 int ret;
113
114 BUG_ON(len == 0);
115 BUG_ON(reg > ISL1208_REG_USR2);
116 BUG_ON(reg + len > ISL1208_REG_USR2 + 1);
117
118 i2c_buf[0] = reg;
119 memcpy(&i2c_buf[1], &buf[0], len);
120
121 ret = i2c_transfer(client->adapter, msgs, 1);
122 if (ret > 0)
123 ret = 0;
124 return ret;
125}
126
127/* simple check to see wether we have a isl1208 */
128static int isl1208_i2c_validate_client(struct i2c_client *client)
129{
130 u8 regs[ISL1208_RTC_SECTION_LEN] = { 0, };
131 u8 zero_mask[ISL1208_RTC_SECTION_LEN] = {
132 0x80, 0x80, 0x40, 0xc0, 0xe0, 0x00, 0xf8
133 };
134 int i;
135 int ret;
136
137 ret = isl1208_i2c_read_regs(client, 0, regs, ISL1208_RTC_SECTION_LEN);
138 if (ret < 0)
139 return ret;
140
141 for (i = 0; i < ISL1208_RTC_SECTION_LEN; ++i) {
142 if (regs[i] & zero_mask[i]) /* check if bits are cleared */
143 return -ENODEV;
144 }
145
146 return 0;
147}
148
149static int isl1208_i2c_get_sr(struct i2c_client *client)
150{
151 return i2c_smbus_read_byte_data(client, ISL1208_REG_SR) == -1 ? -EIO:0;
152}
153
154static int isl1208_i2c_get_atr(struct i2c_client *client)
155{
156 int atr = i2c_smbus_read_byte_data(client, ISL1208_REG_ATR);
157
158 if (atr < 0)
159 return -EIO;
160
161 /* The 6bit value in the ATR register controls the load
162 * capacitance C_load * in steps of 0.25pF
163 *
164 * bit (1<<5) of the ATR register is inverted
165 *
166 * C_load(ATR=0x20) = 4.50pF
167 * C_load(ATR=0x00) = 12.50pF
168 * C_load(ATR=0x1f) = 20.25pF
169 *
170 */
171
172 atr &= 0x3f; /* mask out lsb */
173 atr ^= 1<<5; /* invert 6th bit */
174 atr += 2*9; /* add offset of 4.5pF; unit[atr] = 0.25pF */
175
176 return atr;
177}
178
179static int isl1208_i2c_get_dtr(struct i2c_client *client)
180{
181 int dtr = i2c_smbus_read_byte_data(client, ISL1208_REG_DTR);
182
183 if (dtr < 0)
184 return -EIO;
185
186 /* dtr encodes adjustments of {-60,-40,-20,0,20,40,60} ppm */
187 dtr = ((dtr & 0x3) * 20) * (dtr & (1<<2) ? -1 : 1);
188
189 return dtr;
190}
191
192static int isl1208_i2c_get_usr(struct i2c_client *client)
193{
194 u8 buf[ISL1208_USR_SECTION_LEN] = { 0, };
195 int ret;
196
197 ret = isl1208_i2c_read_regs (client, ISL1208_REG_USR1, buf,
198 ISL1208_USR_SECTION_LEN);
199 if (ret < 0)
200 return ret;
201
202 return (buf[1] << 8) | buf[0];
203}
204
205static int isl1208_i2c_set_usr(struct i2c_client *client, u16 usr)
206{
207 u8 buf[ISL1208_USR_SECTION_LEN];
208
209 buf[0] = usr & 0xff;
210 buf[1] = (usr >> 8) & 0xff;
211
212 return isl1208_i2c_set_regs (client, ISL1208_REG_USR1, buf,
213 ISL1208_USR_SECTION_LEN);
214}
215
216static int isl1208_rtc_proc(struct device *dev, struct seq_file *seq)
217{
218 struct i2c_client *const client = to_i2c_client(dev);
219 int sr, dtr, atr, usr;
220
221 sr = isl1208_i2c_get_sr(client);
222 if (sr < 0) {
223 dev_err(&client->dev, "%s: reading SR failed\n", __func__);
224 return sr;
225 }
226
227 seq_printf(seq, "status_reg\t:%s%s%s%s%s%s (0x%.2x)\n",
228 (sr & ISL1208_REG_SR_RTCF) ? " RTCF" : "",
229 (sr & ISL1208_REG_SR_BAT) ? " BAT" : "",
230 (sr & ISL1208_REG_SR_ALM) ? " ALM" : "",
231 (sr & ISL1208_REG_SR_WRTC) ? " WRTC" : "",
232 (sr & ISL1208_REG_SR_XTOSCB) ? " XTOSCB" : "",
233 (sr & ISL1208_REG_SR_ARST) ? " ARST" : "",
234 sr);
235
236 seq_printf(seq, "batt_status\t: %s\n",
237 (sr & ISL1208_REG_SR_RTCF) ? "bad" : "okay");
238
239 dtr = isl1208_i2c_get_dtr(client);
240 if (dtr >= 0 -1)
241 seq_printf(seq, "digital_trim\t: %d ppm\n", dtr);
242
243 atr = isl1208_i2c_get_atr(client);
244 if (atr >= 0)
245 seq_printf(seq, "analog_trim\t: %d.%.2d pF\n",
246 atr>>2, (atr&0x3)*25);
247
248 usr = isl1208_i2c_get_usr(client);
249 if (usr >= 0)
250 seq_printf(seq, "user_data\t: 0x%.4x\n", usr);
251
252 return 0;
253}
254
255
256static int isl1208_i2c_read_time(struct i2c_client *client,
257 struct rtc_time *tm)
258{
259 int sr;
260 u8 regs[ISL1208_RTC_SECTION_LEN] = { 0, };
261
262 sr = isl1208_i2c_get_sr(client);
263 if (sr < 0) {
264 dev_err(&client->dev, "%s: reading SR failed\n", __func__);
265 return -EIO;
266 }
267
268 sr = isl1208_i2c_read_regs(client, 0, regs, ISL1208_RTC_SECTION_LEN);
269 if (sr < 0) {
270 dev_err(&client->dev, "%s: reading RTC section failed\n",
271 __func__);
272 return sr;
273 }
274
275 tm->tm_sec = BCD2BIN(regs[ISL1208_REG_SC]);
276 tm->tm_min = BCD2BIN(regs[ISL1208_REG_MN]);
277 { /* HR field has a more complex interpretation */
278 const u8 _hr = regs[ISL1208_REG_HR];
279 if (_hr & ISL1208_REG_HR_MIL) /* 24h format */
280 tm->tm_hour = BCD2BIN(_hr & 0x3f);
281 else { // 12h format
282 tm->tm_hour = BCD2BIN(_hr & 0x1f);
283 if (_hr & ISL1208_REG_HR_PM) /* PM flag set */
284 tm->tm_hour += 12;
285 }
286 }
287
288 tm->tm_mday = BCD2BIN(regs[ISL1208_REG_DT]);
289 tm->tm_mon = BCD2BIN(regs[ISL1208_REG_MO]) - 1; /* rtc starts at 1 */
290 tm->tm_year = BCD2BIN(regs[ISL1208_REG_YR]) + 100;
291 tm->tm_wday = BCD2BIN(regs[ISL1208_REG_DW]);
292
293 return 0;
294}
295
296static int isl1208_i2c_read_alarm(struct i2c_client *client,
297 struct rtc_wkalrm *alarm)
298{
299 struct rtc_time *const tm = &alarm->time;
300 u8 regs[ISL1208_ALARM_SECTION_LEN] = { 0, };
301 int sr;
302
303 sr = isl1208_i2c_get_sr(client);
304 if (sr < 0) {
305 dev_err(&client->dev, "%s: reading SR failed\n", __func__);
306 return sr;
307 }
308
309 sr = isl1208_i2c_read_regs(client, ISL1208_REG_SCA, regs,
310 ISL1208_ALARM_SECTION_LEN);
311 if (sr < 0) {
312 dev_err(&client->dev, "%s: reading alarm section failed\n",
313 __func__);
314 return sr;
315 }
316
317 /* MSB of each alarm register is an enable bit */
318 tm->tm_sec = BCD2BIN(regs[ISL1208_REG_SCA-ISL1208_REG_SCA] & 0x7f);
319 tm->tm_min = BCD2BIN(regs[ISL1208_REG_MNA-ISL1208_REG_SCA] & 0x7f);
320 tm->tm_hour = BCD2BIN(regs[ISL1208_REG_HRA-ISL1208_REG_SCA] & 0x3f);
321 tm->tm_mday = BCD2BIN(regs[ISL1208_REG_DTA-ISL1208_REG_SCA] & 0x3f);
322 tm->tm_mon = BCD2BIN(regs[ISL1208_REG_MOA-ISL1208_REG_SCA] & 0x1f)-1;
323 tm->tm_wday = BCD2BIN(regs[ISL1208_REG_DWA-ISL1208_REG_SCA] & 0x03);
324
325 return 0;
326}
327
328static int isl1208_rtc_read_time(struct device *dev, struct rtc_time *tm)
329{
330 return isl1208_i2c_read_time(to_i2c_client(dev), tm);
331}
332
333static int isl1208_i2c_set_time(struct i2c_client *client,
334 struct rtc_time const *tm)
335{
336 int sr;
337 u8 regs[ISL1208_RTC_SECTION_LEN] = { 0, };
338
339 regs[ISL1208_REG_SC] = BIN2BCD(tm->tm_sec);
340 regs[ISL1208_REG_MN] = BIN2BCD(tm->tm_min);
341 regs[ISL1208_REG_HR] = BIN2BCD(tm->tm_hour) | ISL1208_REG_HR_MIL;
342
343 regs[ISL1208_REG_DT] = BIN2BCD(tm->tm_mday);
344 regs[ISL1208_REG_MO] = BIN2BCD(tm->tm_mon + 1);
345 regs[ISL1208_REG_YR] = BIN2BCD(tm->tm_year - 100);
346
347 regs[ISL1208_REG_DW] = BIN2BCD(tm->tm_wday & 7);
348
349 sr = isl1208_i2c_get_sr(client);
350 if (sr < 0) {
351 dev_err(&client->dev, "%s: reading SR failed\n", __func__);
352 return sr;
353 }
354
355 /* set WRTC */
356 sr = i2c_smbus_write_byte_data (client, ISL1208_REG_SR,
357 sr | ISL1208_REG_SR_WRTC);
358 if (sr < 0) {
359 dev_err(&client->dev, "%s: writing SR failed\n", __func__);
360 return sr;
361 }
362
363 /* write RTC registers */
364 sr = isl1208_i2c_set_regs(client, 0, regs, ISL1208_RTC_SECTION_LEN);
365 if (sr < 0) {
366 dev_err(&client->dev, "%s: writing RTC section failed\n",
367 __func__);
368 return sr;
369 }
370
371 /* clear WRTC again */
372 sr = i2c_smbus_write_byte_data (client, ISL1208_REG_SR,
373 sr & ~ISL1208_REG_SR_WRTC);
374 if (sr < 0) {
375 dev_err(&client->dev, "%s: writing SR failed\n", __func__);
376 return sr;
377 }
378
379 return 0;
380}
381
382
383static int isl1208_rtc_set_time(struct device *dev, struct rtc_time *tm)
384{
385 return isl1208_i2c_set_time(to_i2c_client(dev), tm);
386}
387
388static int isl1208_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm)
389{
390 return isl1208_i2c_read_alarm(to_i2c_client(dev), alarm);
391}
392
393static struct rtc_class_ops isl1208_rtc_ops = {
394 .proc = isl1208_rtc_proc,
395 .read_time = isl1208_rtc_read_time,
396 .set_time = isl1208_rtc_set_time,
397 .read_alarm = isl1208_rtc_read_alarm,
398 //.set_alarm = isl1208_rtc_set_alarm,
399};
400
401/* sysfs interface */
402
403static ssize_t isl1208_sysfs_show_atrim(struct device *dev,
404 struct device_attribute *attr,
405 char *buf)
406{
407 int atr;
408
409 atr = isl1208_i2c_get_atr(to_i2c_client(dev));
410 if (atr < 0)
411 return atr;
412
413 return sprintf(buf, "%d.%.2d pF\n", atr>>2, (atr&0x3)*25);
414}
415static DEVICE_ATTR(atrim, S_IRUGO, isl1208_sysfs_show_atrim, NULL);
416
417static ssize_t isl1208_sysfs_show_dtrim(struct device *dev,
418 struct device_attribute *attr,
419 char *buf)
420{
421 int dtr;
422
423 dtr = isl1208_i2c_get_dtr(to_i2c_client(dev));
424 if (dtr < 0)
425 return dtr;
426
427 return sprintf(buf, "%d ppm\n", dtr);
428}
429static DEVICE_ATTR(dtrim, S_IRUGO, isl1208_sysfs_show_dtrim, NULL);
430
431static ssize_t isl1208_sysfs_show_usr(struct device *dev,
432 struct device_attribute *attr,
433 char *buf)
434{
435 int usr;
436
437 usr = isl1208_i2c_get_usr(to_i2c_client(dev));
438 if (usr < 0)
439 return usr;
440
441 return sprintf(buf, "0x%.4x\n", usr);
442}
443
444static ssize_t isl1208_sysfs_store_usr(struct device *dev,
445 struct device_attribute *attr,
446 const char *buf, size_t count)
447{
448 int usr = -1;
449
450 if (buf[0] == '0' && (buf[1] == 'x' || buf[1] == 'X')) {
451 if (sscanf(buf, "%x", &usr) != 1)
452 return -EINVAL;
453 } else {
454 if (sscanf(buf, "%d", &usr) != 1)
455 return -EINVAL;
456 }
457
458 if (usr < 0 || usr > 0xffff)
459 return -EINVAL;
460
461 return isl1208_i2c_set_usr(to_i2c_client(dev), usr) ? -EIO : count;
462}
463static DEVICE_ATTR(usr, S_IRUGO | S_IWUSR, isl1208_sysfs_show_usr,
464 isl1208_sysfs_store_usr);
465
466static int
467isl1208_probe(struct i2c_adapter *adapter, int addr, int kind)
468{
469 int rc = 0;
470 struct i2c_client *new_client = NULL;
471 struct rtc_device *rtc = NULL;
472
473 if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) {
474 rc = -ENODEV;
475 goto failout;
476 }
477
478 new_client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
479 if (new_client == NULL) {
480 rc = -ENOMEM;
481 goto failout;
482 }
483
484 new_client->addr = addr;
485 new_client->adapter = adapter;
486 new_client->driver = &isl1208_driver;
487 new_client->flags = 0;
488 strcpy(new_client->name, DRV_NAME);
489
490 if (kind < 0) {
491 rc = isl1208_i2c_validate_client(new_client);
492 if (rc < 0)
493 goto failout;
494 }
495
496 rc = i2c_attach_client(new_client);
497 if (rc < 0)
498 goto failout;
499
500 dev_info(&new_client->dev,
501 "chip found, driver version " DRV_VERSION "\n");
502
503 rtc = rtc_device_register(isl1208_driver.driver.name,
504 &new_client->dev,
505 &isl1208_rtc_ops, THIS_MODULE);
506
507 if (IS_ERR(rtc)) {
508 rc = PTR_ERR(rtc);
509 goto failout_detach;
510 }
511
512 i2c_set_clientdata(new_client, rtc);
513
514 rc = isl1208_i2c_get_sr(new_client);
515 if (rc < 0) {
516 dev_err(&new_client->dev, "reading status failed\n");
517 goto failout_unregister;
518 }
519
520 if (rc & ISL1208_REG_SR_RTCF)
521 dev_warn(&new_client->dev, "rtc power failure detected, "
522 "please set clock.\n");
523
524 rc = device_create_file(&new_client->dev, &dev_attr_atrim);
525 if (rc < 0)
526 goto failout_unregister;
527 rc = device_create_file(&new_client->dev, &dev_attr_dtrim);
528 if (rc < 0)
529 goto failout_atrim;
530 rc = device_create_file(&new_client->dev, &dev_attr_usr);
531 if (rc < 0)
532 goto failout_dtrim;
533
534 return 0;
535
536 failout_dtrim:
537 device_remove_file(&new_client->dev, &dev_attr_dtrim);
538 failout_atrim:
539 device_remove_file(&new_client->dev, &dev_attr_atrim);
540 failout_unregister:
541 rtc_device_unregister(rtc);
542 failout_detach:
543 i2c_detach_client(new_client);
544 failout:
545 kfree(new_client);
546 return rc;
547}
548
549static int
550isl1208_attach_adapter (struct i2c_adapter *adapter)
551{
552 return i2c_probe(adapter, &addr_data, isl1208_probe);
553}
554
555static int
556isl1208_detach_client(struct i2c_client *client)
557{
558 int rc;
559 struct rtc_device *const rtc = i2c_get_clientdata(client);
560
561 if (rtc)
562 rtc_device_unregister(rtc); /* do we need to kfree? */
563
564 rc = i2c_detach_client(client);
565 if (rc)
566 return rc;
567
568 kfree(client);
569
570 return 0;
571}
572
573/* module management */
574
575static int __init isl1208_init(void)
576{
577 return i2c_add_driver(&isl1208_driver);
578}
579
580static void __exit isl1208_exit(void)
581{
582 i2c_del_driver(&isl1208_driver);
583}
584
585MODULE_AUTHOR("Herbert Valerio Riedel <hvr@gnu.org>");
586MODULE_DESCRIPTION("Intersil ISL1208 RTC driver");
587MODULE_LICENSE("GPL");
588MODULE_VERSION(DRV_VERSION);
589
590module_init(isl1208_init);
591module_exit(isl1208_exit);
diff --git a/drivers/rtc/rtc-vr41xx.c b/drivers/rtc/rtc-vr41xx.c
index bb6d5ff24fd0..596764fd29f5 100644
--- a/drivers/rtc/rtc-vr41xx.c
+++ b/drivers/rtc/rtc-vr41xx.c
@@ -30,7 +30,7 @@
30#include <asm/div64.h> 30#include <asm/div64.h>
31#include <asm/io.h> 31#include <asm/io.h>
32#include <asm/uaccess.h> 32#include <asm/uaccess.h>
33#include <asm/vr41xx/vr41xx.h> 33#include <asm/vr41xx/irq.h>
34 34
35MODULE_AUTHOR("Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>"); 35MODULE_AUTHOR("Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>");
36MODULE_DESCRIPTION("NEC VR4100 series RTC driver"); 36MODULE_DESCRIPTION("NEC VR4100 series RTC driver");
diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c
index d7295386821c..7f6fdac74706 100644
--- a/drivers/s390/block/dasd_devmap.c
+++ b/drivers/s390/block/dasd_devmap.c
@@ -394,7 +394,7 @@ dasd_add_busid(char *bus_id, int features)
394 if (!new) 394 if (!new)
395 return ERR_PTR(-ENOMEM); 395 return ERR_PTR(-ENOMEM);
396 spin_lock(&dasd_devmap_lock); 396 spin_lock(&dasd_devmap_lock);
397 devmap = 0; 397 devmap = NULL;
398 hash = dasd_hash_busid(bus_id); 398 hash = dasd_hash_busid(bus_id);
399 list_for_each_entry(tmp, &dasd_hashlists[hash], list) 399 list_for_each_entry(tmp, &dasd_hashlists[hash], list)
400 if (strncmp(tmp->bus_id, bus_id, BUS_ID_SIZE) == 0) { 400 if (strncmp(tmp->bus_id, bus_id, BUS_ID_SIZE) == 0) {
@@ -406,10 +406,10 @@ dasd_add_busid(char *bus_id, int features)
406 new->devindex = dasd_max_devindex++; 406 new->devindex = dasd_max_devindex++;
407 strncpy(new->bus_id, bus_id, BUS_ID_SIZE); 407 strncpy(new->bus_id, bus_id, BUS_ID_SIZE);
408 new->features = features; 408 new->features = features;
409 new->device = 0; 409 new->device = NULL;
410 list_add(&new->list, &dasd_hashlists[hash]); 410 list_add(&new->list, &dasd_hashlists[hash]);
411 devmap = new; 411 devmap = new;
412 new = 0; 412 new = NULL;
413 } 413 }
414 spin_unlock(&dasd_devmap_lock); 414 spin_unlock(&dasd_devmap_lock);
415 kfree(new); 415 kfree(new);
@@ -479,7 +479,7 @@ dasd_device_from_devindex(int devindex)
479 int i; 479 int i;
480 480
481 spin_lock(&dasd_devmap_lock); 481 spin_lock(&dasd_devmap_lock);
482 devmap = 0; 482 devmap = NULL;
483 for (i = 0; (i < 256) && !devmap; i++) 483 for (i = 0; (i < 256) && !devmap; i++)
484 list_for_each_entry(tmp, &dasd_hashlists[i], list) 484 list_for_each_entry(tmp, &dasd_hashlists[i], list)
485 if (tmp->devindex == devindex) { 485 if (tmp->devindex == devindex) {
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
index 2e655f466743..39c2281371b5 100644
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
@@ -65,16 +65,16 @@ struct dasd_eckd_private {
65/* The ccw bus type uses this table to find devices that it sends to 65/* The ccw bus type uses this table to find devices that it sends to
66 * dasd_eckd_probe */ 66 * dasd_eckd_probe */
67static struct ccw_device_id dasd_eckd_ids[] = { 67static struct ccw_device_id dasd_eckd_ids[] = {
68 { CCW_DEVICE_DEVTYPE (0x3990, 0, 0x3390, 0), driver_info: 0x1}, 68 { CCW_DEVICE_DEVTYPE (0x3990, 0, 0x3390, 0), .driver_info = 0x1},
69 { CCW_DEVICE_DEVTYPE (0x2105, 0, 0x3390, 0), driver_info: 0x2}, 69 { CCW_DEVICE_DEVTYPE (0x2105, 0, 0x3390, 0), .driver_info = 0x2},
70 { CCW_DEVICE_DEVTYPE (0x3880, 0, 0x3390, 0), driver_info: 0x3}, 70 { CCW_DEVICE_DEVTYPE (0x3880, 0, 0x3390, 0), .driver_info = 0x3},
71 { CCW_DEVICE_DEVTYPE (0x3990, 0, 0x3380, 0), driver_info: 0x4}, 71 { CCW_DEVICE_DEVTYPE (0x3990, 0, 0x3380, 0), .driver_info = 0x4},
72 { CCW_DEVICE_DEVTYPE (0x2105, 0, 0x3380, 0), driver_info: 0x5}, 72 { CCW_DEVICE_DEVTYPE (0x2105, 0, 0x3380, 0), .driver_info = 0x5},
73 { CCW_DEVICE_DEVTYPE (0x9343, 0, 0x9345, 0), driver_info: 0x6}, 73 { CCW_DEVICE_DEVTYPE (0x9343, 0, 0x9345, 0), .driver_info = 0x6},
74 { CCW_DEVICE_DEVTYPE (0x2107, 0, 0x3390, 0), driver_info: 0x7}, 74 { CCW_DEVICE_DEVTYPE (0x2107, 0, 0x3390, 0), .driver_info = 0x7},
75 { CCW_DEVICE_DEVTYPE (0x2107, 0, 0x3380, 0), driver_info: 0x8}, 75 { CCW_DEVICE_DEVTYPE (0x2107, 0, 0x3380, 0), .driver_info = 0x8},
76 { CCW_DEVICE_DEVTYPE (0x1750, 0, 0x3390, 0), driver_info: 0x9}, 76 { CCW_DEVICE_DEVTYPE (0x1750, 0, 0x3390, 0), .driver_info = 0x9},
77 { CCW_DEVICE_DEVTYPE (0x1750, 0, 0x3380, 0), driver_info: 0xa}, 77 { CCW_DEVICE_DEVTYPE (0x1750, 0, 0x3380, 0), .driver_info = 0xa},
78 { /* end of list */ }, 78 { /* end of list */ },
79}; 79};
80 80
diff --git a/drivers/s390/block/dasd_fba.c b/drivers/s390/block/dasd_fba.c
index 808434d38526..e85015be109b 100644
--- a/drivers/s390/block/dasd_fba.c
+++ b/drivers/s390/block/dasd_fba.c
@@ -44,8 +44,8 @@ struct dasd_fba_private {
44}; 44};
45 45
46static struct ccw_device_id dasd_fba_ids[] = { 46static struct ccw_device_id dasd_fba_ids[] = {
47 { CCW_DEVICE_DEVTYPE (0x6310, 0, 0x9336, 0), driver_info: 0x1}, 47 { CCW_DEVICE_DEVTYPE (0x6310, 0, 0x9336, 0), .driver_info = 0x1},
48 { CCW_DEVICE_DEVTYPE (0x3880, 0, 0x3370, 0), driver_info: 0x2}, 48 { CCW_DEVICE_DEVTYPE (0x3880, 0, 0x3370, 0), .driver_info = 0x2},
49 { /* end of list */ }, 49 { /* end of list */ },
50}; 50};
51 51
diff --git a/drivers/s390/block/dasd_genhd.c b/drivers/s390/block/dasd_genhd.c
index 12c7d296eaa8..4c272b70f41a 100644
--- a/drivers/s390/block/dasd_genhd.c
+++ b/drivers/s390/block/dasd_genhd.c
@@ -84,9 +84,9 @@ void
84dasd_gendisk_free(struct dasd_device *device) 84dasd_gendisk_free(struct dasd_device *device)
85{ 85{
86 del_gendisk(device->gdp); 86 del_gendisk(device->gdp);
87 device->gdp->queue = 0; 87 device->gdp->queue = NULL;
88 put_disk(device->gdp); 88 put_disk(device->gdp);
89 device->gdp = 0; 89 device->gdp = NULL;
90} 90}
91 91
92/* 92/*
@@ -136,7 +136,7 @@ dasd_destroy_partitions(struct dasd_device * device)
136 * device->bdev to lower the offline open_count limit again. 136 * device->bdev to lower the offline open_count limit again.
137 */ 137 */
138 bdev = device->bdev; 138 bdev = device->bdev;
139 device->bdev = 0; 139 device->bdev = NULL;
140 140
141 /* 141 /*
142 * See fs/partition/check.c:delete_partition 142 * See fs/partition/check.c:delete_partition
@@ -145,7 +145,7 @@ dasd_destroy_partitions(struct dasd_device * device)
145 */ 145 */
146 memset(&bpart, 0, sizeof(struct blkpg_partition)); 146 memset(&bpart, 0, sizeof(struct blkpg_partition));
147 memset(&barg, 0, sizeof(struct blkpg_ioctl_arg)); 147 memset(&barg, 0, sizeof(struct blkpg_ioctl_arg));
148 barg.data = &bpart; 148 barg.data = (void __user *) &bpart;
149 barg.op = BLKPG_DEL_PARTITION; 149 barg.op = BLKPG_DEL_PARTITION;
150 for (bpart.pno = device->gdp->minors - 1; bpart.pno > 0; bpart.pno--) 150 for (bpart.pno = device->gdp->minors - 1; bpart.pno > 0; bpart.pno--)
151 ioctl_by_bdev(bdev, BLKPG, (unsigned long) &barg); 151 ioctl_by_bdev(bdev, BLKPG, (unsigned long) &barg);
diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c
index e97f5316ad2d..8fed3603e9ea 100644
--- a/drivers/s390/block/dasd_ioctl.c
+++ b/drivers/s390/block/dasd_ioctl.c
@@ -345,7 +345,7 @@ dasd_ioctl_set_ro(struct block_device *bdev, void __user *argp)
345 if (bdev != bdev->bd_contains) 345 if (bdev != bdev->bd_contains)
346 // ro setting is not allowed for partitions 346 // ro setting is not allowed for partitions
347 return -EINVAL; 347 return -EINVAL;
348 if (get_user(intval, (int *)argp)) 348 if (get_user(intval, (int __user *)argp))
349 return -EFAULT; 349 return -EFAULT;
350 350
351 set_disk_ro(bdev->bd_disk, intval); 351 set_disk_ro(bdev->bd_disk, intval);
diff --git a/drivers/s390/block/xpram.c b/drivers/s390/block/xpram.c
index 4c1e56b9b98d..1140302ff11d 100644
--- a/drivers/s390/block/xpram.c
+++ b/drivers/s390/block/xpram.c
@@ -71,11 +71,11 @@ static int xpram_devs;
71/* 71/*
72 * Parameter parsing functions. 72 * Parameter parsing functions.
73 */ 73 */
74static int devs = XPRAM_DEVS; 74static int __initdata devs = XPRAM_DEVS;
75static unsigned int sizes[XPRAM_MAX_DEVS]; 75static char __initdata *sizes[XPRAM_MAX_DEVS];
76 76
77module_param(devs, int, 0); 77module_param(devs, int, 0);
78module_param_array(sizes, int, NULL, 0); 78module_param_array(sizes, charp, NULL, 0);
79 79
80MODULE_PARM_DESC(devs, "number of devices (\"partitions\"), " \ 80MODULE_PARM_DESC(devs, "number of devices (\"partitions\"), " \
81 "the default is " __MODULE_STRING(XPRAM_DEVS) "\n"); 81 "the default is " __MODULE_STRING(XPRAM_DEVS) "\n");
@@ -86,59 +86,6 @@ MODULE_PARM_DESC(sizes, "list of device (partition) sizes " \
86 "claimed by explicit sizes\n"); 86 "claimed by explicit sizes\n");
87MODULE_LICENSE("GPL"); 87MODULE_LICENSE("GPL");
88 88
89#ifndef MODULE
90/*
91 * Parses the kernel parameters given in the kernel parameter line.
92 * The expected format is
93 * <number_of_partitions>[","<partition_size>]*
94 * where
95 * devices is a positive integer that initializes xpram_devs
96 * each size is a non-negative integer possibly followed by a
97 * magnitude (k,K,m,M,g,G), the list of sizes initialises
98 * xpram_sizes
99 *
100 * Arguments
101 * str: substring of kernel parameter line that contains xprams
102 * kernel parameters.
103 *
104 * Result 0 on success, -EINVAL else -- only for Version > 2.3
105 *
106 * Side effects
107 * the global variabls devs is set to the value of
108 * <number_of_partitions> and sizes[i] is set to the i-th
109 * partition size (if provided). A parsing error of a value
110 * results in this value being set to -EINVAL.
111 */
112static int __init xpram_setup (char *str)
113{
114 char *cp;
115 int i;
116
117 devs = simple_strtoul(str, &cp, 10);
118 if (cp <= str || devs > XPRAM_MAX_DEVS)
119 return 0;
120 for (i = 0; (i < devs) && (*cp++ == ','); i++) {
121 sizes[i] = simple_strtoul(cp, &cp, 10);
122 if (*cp == 'g' || *cp == 'G') {
123 sizes[i] <<= 20;
124 cp++;
125 } else if (*cp == 'm' || *cp == 'M') {
126 sizes[i] <<= 10;
127 cp++;
128 } else if (*cp == 'k' || *cp == 'K')
129 cp++;
130 while (isspace(*cp)) cp++;
131 }
132 if (*cp == ',' && i >= devs)
133 PRINT_WARN("partition sizes list has too many entries.\n");
134 else if (*cp != 0)
135 PRINT_WARN("ignored '%s' at end of parameter string.\n", cp);
136 return 1;
137}
138
139__setup("xpram_parts=", xpram_setup);
140#endif
141
142/* 89/*
143 * Copy expanded memory page (4kB) into main memory 90 * Copy expanded memory page (4kB) into main memory
144 * Arguments 91 * Arguments
@@ -357,6 +304,7 @@ static int __init xpram_setup_sizes(unsigned long pages)
357{ 304{
358 unsigned long mem_needed; 305 unsigned long mem_needed;
359 unsigned long mem_auto; 306 unsigned long mem_auto;
307 unsigned long long size;
360 int mem_auto_no; 308 int mem_auto_no;
361 int i; 309 int i;
362 310
@@ -374,7 +322,19 @@ static int __init xpram_setup_sizes(unsigned long pages)
374 mem_needed = 0; 322 mem_needed = 0;
375 mem_auto_no = 0; 323 mem_auto_no = 0;
376 for (i = 0; i < xpram_devs; i++) { 324 for (i = 0; i < xpram_devs; i++) {
377 xpram_sizes[i] = (sizes[i] + 3) & -4UL; 325 if (sizes[i]) {
326 size = simple_strtoull(sizes[i], &sizes[i], 0);
327 switch (sizes[i][0]) {
328 case 'g':
329 case 'G':
330 size <<= 20;
331 break;
332 case 'm':
333 case 'M':
334 size <<= 10;
335 }
336 xpram_sizes[i] = (size + 3) & -4UL;
337 }
378 if (xpram_sizes[i]) 338 if (xpram_sizes[i])
379 mem_needed += xpram_sizes[i]; 339 mem_needed += xpram_sizes[i];
380 else 340 else
diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c
index f25c6d116f6f..2fa566fa6da4 100644
--- a/drivers/s390/char/con3215.c
+++ b/drivers/s390/char/con3215.c
@@ -693,7 +693,7 @@ raw3215_probe (struct ccw_device *cdev)
693 GFP_KERNEL|GFP_DMA); 693 GFP_KERNEL|GFP_DMA);
694 if (raw->buffer == NULL) { 694 if (raw->buffer == NULL) {
695 spin_lock(&raw3215_device_lock); 695 spin_lock(&raw3215_device_lock);
696 raw3215[line] = 0; 696 raw3215[line] = NULL;
697 spin_unlock(&raw3215_device_lock); 697 spin_unlock(&raw3215_device_lock);
698 kfree(raw); 698 kfree(raw);
699 return -ENOMEM; 699 return -ENOMEM;
diff --git a/drivers/s390/char/ctrlchar.c b/drivers/s390/char/ctrlchar.c
index 0ea6f36a2527..d83eb6358bac 100644
--- a/drivers/s390/char/ctrlchar.c
+++ b/drivers/s390/char/ctrlchar.c
@@ -23,7 +23,7 @@ ctrlchar_handle_sysrq(void *tty)
23 handle_sysrq(ctrlchar_sysrq_key, NULL, (struct tty_struct *) tty); 23 handle_sysrq(ctrlchar_sysrq_key, NULL, (struct tty_struct *) tty);
24} 24}
25 25
26static DECLARE_WORK(ctrlchar_work, ctrlchar_handle_sysrq, 0); 26static DECLARE_WORK(ctrlchar_work, ctrlchar_handle_sysrq, NULL);
27#endif 27#endif
28 28
29 29
diff --git a/drivers/s390/char/defkeymap.c b/drivers/s390/char/defkeymap.c
index ca15adb140d1..17027d918cf7 100644
--- a/drivers/s390/char/defkeymap.c
+++ b/drivers/s390/char/defkeymap.c
@@ -83,8 +83,8 @@ static u_short shift_ctrl_map[NR_KEYS] = {
83}; 83};
84 84
85ushort *key_maps[MAX_NR_KEYMAPS] = { 85ushort *key_maps[MAX_NR_KEYMAPS] = {
86 plain_map, shift_map, 0, 0, 86 plain_map, shift_map, NULL, NULL,
87 ctrl_map, shift_ctrl_map, 0 87 ctrl_map, shift_ctrl_map, NULL,
88}; 88};
89 89
90unsigned int keymap_count = 4; 90unsigned int keymap_count = 4;
@@ -145,7 +145,7 @@ char *func_table[MAX_NR_FUNC] = {
145 func_buf + 97, 145 func_buf + 97,
146 func_buf + 103, 146 func_buf + 103,
147 func_buf + 109, 147 func_buf + 109,
148 0, 148 NULL,
149}; 149};
150 150
151struct kbdiacr accent_table[MAX_DIACR] = { 151struct kbdiacr accent_table[MAX_DIACR] = {
diff --git a/drivers/s390/char/fs3270.c b/drivers/s390/char/fs3270.c
index 6099c14de429..ef004d089712 100644
--- a/drivers/s390/char/fs3270.c
+++ b/drivers/s390/char/fs3270.c
@@ -236,7 +236,7 @@ fs3270_irq(struct fs3270 *fp, struct raw3270_request *rq, struct irb *irb)
236 * Process reads from fullscreen 3270. 236 * Process reads from fullscreen 3270.
237 */ 237 */
238static ssize_t 238static ssize_t
239fs3270_read(struct file *filp, char *data, size_t count, loff_t *off) 239fs3270_read(struct file *filp, char __user *data, size_t count, loff_t *off)
240{ 240{
241 struct fs3270 *fp; 241 struct fs3270 *fp;
242 struct raw3270_request *rq; 242 struct raw3270_request *rq;
@@ -281,7 +281,7 @@ fs3270_read(struct file *filp, char *data, size_t count, loff_t *off)
281 * Process writes to fullscreen 3270. 281 * Process writes to fullscreen 3270.
282 */ 282 */
283static ssize_t 283static ssize_t
284fs3270_write(struct file *filp, const char *data, size_t count, loff_t *off) 284fs3270_write(struct file *filp, const char __user *data, size_t count, loff_t *off)
285{ 285{
286 struct fs3270 *fp; 286 struct fs3270 *fp;
287 struct raw3270_request *rq; 287 struct raw3270_request *rq;
@@ -338,10 +338,10 @@ fs3270_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
338 fp->write_command = arg; 338 fp->write_command = arg;
339 break; 339 break;
340 case TUBGETI: 340 case TUBGETI:
341 rc = put_user(fp->read_command, (char *) arg); 341 rc = put_user(fp->read_command, (char __user *) arg);
342 break; 342 break;
343 case TUBGETO: 343 case TUBGETO:
344 rc = put_user(fp->write_command,(char *) arg); 344 rc = put_user(fp->write_command,(char __user *) arg);
345 break; 345 break;
346 case TUBGETMOD: 346 case TUBGETMOD:
347 iocb.model = fp->view.model; 347 iocb.model = fp->view.model;
@@ -350,7 +350,7 @@ fs3270_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
350 iocb.pf_cnt = 24; 350 iocb.pf_cnt = 24;
351 iocb.re_cnt = 20; 351 iocb.re_cnt = 20;
352 iocb.map = 0; 352 iocb.map = 0;
353 if (copy_to_user((char *) arg, &iocb, 353 if (copy_to_user((char __user *) arg, &iocb,
354 sizeof(struct raw3270_iocb))) 354 sizeof(struct raw3270_iocb)))
355 rc = -EFAULT; 355 rc = -EFAULT;
356 break; 356 break;
@@ -479,7 +479,7 @@ fs3270_close(struct inode *inode, struct file *filp)
479 struct fs3270 *fp; 479 struct fs3270 *fp;
480 480
481 fp = filp->private_data; 481 fp = filp->private_data;
482 filp->private_data = 0; 482 filp->private_data = NULL;
483 if (fp) { 483 if (fp) {
484 fp->fs_pid = 0; 484 fp->fs_pid = 0;
485 raw3270_reset(&fp->view); 485 raw3270_reset(&fp->view);
diff --git a/drivers/s390/char/keyboard.c b/drivers/s390/char/keyboard.c
index 547ef906ae2c..3be06569180d 100644
--- a/drivers/s390/char/keyboard.c
+++ b/drivers/s390/char/keyboard.c
@@ -103,7 +103,7 @@ out_maps:
103out_kbd: 103out_kbd:
104 kfree(kbd); 104 kfree(kbd);
105out: 105out:
106 return 0; 106 return NULL;
107} 107}
108 108
109void 109void
@@ -304,7 +304,7 @@ kbd_keycode(struct kbd_data *kbd, unsigned int keycode)
304 if (kbd->sysrq) { 304 if (kbd->sysrq) {
305 if (kbd->sysrq == K(KT_LATIN, '-')) { 305 if (kbd->sysrq == K(KT_LATIN, '-')) {
306 kbd->sysrq = 0; 306 kbd->sysrq = 0;
307 handle_sysrq(value, 0, kbd->tty); 307 handle_sysrq(value, NULL, kbd->tty);
308 return; 308 return;
309 } 309 }
310 if (value == '-') { 310 if (value == '-') {
@@ -363,7 +363,7 @@ do_kdsk_ioctl(struct kbd_data *kbd, struct kbentry __user *user_kbe,
363 /* disallocate map */ 363 /* disallocate map */
364 key_map = kbd->key_maps[tmp.kb_table]; 364 key_map = kbd->key_maps[tmp.kb_table];
365 if (key_map) { 365 if (key_map) {
366 kbd->key_maps[tmp.kb_table] = 0; 366 kbd->key_maps[tmp.kb_table] = NULL;
367 kfree(key_map); 367 kfree(key_map);
368 } 368 }
369 break; 369 break;
diff --git a/drivers/s390/char/raw3270.c b/drivers/s390/char/raw3270.c
index e95b56f810db..7a84014f2037 100644
--- a/drivers/s390/char/raw3270.c
+++ b/drivers/s390/char/raw3270.c
@@ -555,7 +555,7 @@ raw3270_start_init(struct raw3270 *rp, struct raw3270_view *view,
555#ifdef CONFIG_TN3270_CONSOLE 555#ifdef CONFIG_TN3270_CONSOLE
556 if (raw3270_registered == 0) { 556 if (raw3270_registered == 0) {
557 spin_lock_irqsave(get_ccwdev_lock(view->dev->cdev), flags); 557 spin_lock_irqsave(get_ccwdev_lock(view->dev->cdev), flags);
558 rq->callback = 0; 558 rq->callback = NULL;
559 rc = __raw3270_start(rp, view, rq); 559 rc = __raw3270_start(rp, view, rq);
560 if (rc == 0) 560 if (rc == 0)
561 while (!raw3270_request_final(rq)) { 561 while (!raw3270_request_final(rq)) {
@@ -719,8 +719,8 @@ raw3270_size_device(struct raw3270 *rp)
719 rc = __raw3270_size_device_vm(rp); 719 rc = __raw3270_size_device_vm(rp);
720 else 720 else
721 rc = __raw3270_size_device(rp); 721 rc = __raw3270_size_device(rp);
722 raw3270_init_view.dev = 0; 722 raw3270_init_view.dev = NULL;
723 rp->view = 0; 723 rp->view = NULL;
724 up(&raw3270_init_sem); 724 up(&raw3270_init_sem);
725 if (rc == 0) { /* Found something. */ 725 if (rc == 0) { /* Found something. */
726 /* Try to find a model. */ 726 /* Try to find a model. */
@@ -761,8 +761,8 @@ raw3270_reset_device(struct raw3270 *rp)
761 rp->view = &raw3270_init_view; 761 rp->view = &raw3270_init_view;
762 raw3270_init_view.dev = rp; 762 raw3270_init_view.dev = rp;
763 rc = raw3270_start_init(rp, &raw3270_init_view, &rp->init_request); 763 rc = raw3270_start_init(rp, &raw3270_init_view, &rp->init_request);
764 raw3270_init_view.dev = 0; 764 raw3270_init_view.dev = NULL;
765 rp->view = 0; 765 rp->view = NULL;
766 up(&raw3270_init_sem); 766 up(&raw3270_init_sem);
767 return rc; 767 return rc;
768} 768}
@@ -934,7 +934,7 @@ raw3270_activate_view(struct raw3270_view *view)
934 else if (!test_bit(RAW3270_FLAGS_READY, &rp->flags)) 934 else if (!test_bit(RAW3270_FLAGS_READY, &rp->flags))
935 rc = -ENODEV; 935 rc = -ENODEV;
936 else { 936 else {
937 oldview = 0; 937 oldview = NULL;
938 if (rp->view) { 938 if (rp->view) {
939 oldview = rp->view; 939 oldview = rp->view;
940 oldview->fn->deactivate(oldview); 940 oldview->fn->deactivate(oldview);
@@ -951,7 +951,7 @@ raw3270_activate_view(struct raw3270_view *view)
951 rp->view = nv; 951 rp->view = nv;
952 if (nv->fn->activate(nv) == 0) 952 if (nv->fn->activate(nv) == 0)
953 break; 953 break;
954 rp->view = 0; 954 rp->view = NULL;
955 } 955 }
956 } 956 }
957 } 957 }
@@ -975,7 +975,7 @@ raw3270_deactivate_view(struct raw3270_view *view)
975 spin_lock_irqsave(get_ccwdev_lock(rp->cdev), flags); 975 spin_lock_irqsave(get_ccwdev_lock(rp->cdev), flags);
976 if (rp->view == view) { 976 if (rp->view == view) {
977 view->fn->deactivate(view); 977 view->fn->deactivate(view);
978 rp->view = 0; 978 rp->view = NULL;
979 /* Move deactivated view to end of list. */ 979 /* Move deactivated view to end of list. */
980 list_del_init(&view->list); 980 list_del_init(&view->list);
981 list_add_tail(&view->list, &rp->view_list); 981 list_add_tail(&view->list, &rp->view_list);
@@ -985,7 +985,7 @@ raw3270_deactivate_view(struct raw3270_view *view)
985 rp->view = view; 985 rp->view = view;
986 if (view->fn->activate(view) == 0) 986 if (view->fn->activate(view) == 0)
987 break; 987 break;
988 rp->view = 0; 988 rp->view = NULL;
989 } 989 }
990 } 990 }
991 } 991 }
@@ -1076,7 +1076,7 @@ raw3270_del_view(struct raw3270_view *view)
1076 spin_lock_irqsave(get_ccwdev_lock(rp->cdev), flags); 1076 spin_lock_irqsave(get_ccwdev_lock(rp->cdev), flags);
1077 if (rp->view == view) { 1077 if (rp->view == view) {
1078 view->fn->deactivate(view); 1078 view->fn->deactivate(view);
1079 rp->view = 0; 1079 rp->view = NULL;
1080 } 1080 }
1081 list_del_init(&view->list); 1081 list_del_init(&view->list);
1082 if (!rp->view && test_bit(RAW3270_FLAGS_READY, &rp->flags)) { 1082 if (!rp->view && test_bit(RAW3270_FLAGS_READY, &rp->flags)) {
@@ -1106,10 +1106,10 @@ raw3270_delete_device(struct raw3270 *rp)
1106 1106
1107 /* Remove from device chain. */ 1107 /* Remove from device chain. */
1108 mutex_lock(&raw3270_mutex); 1108 mutex_lock(&raw3270_mutex);
1109 if (rp->clttydev) 1109 if (rp->clttydev && !IS_ERR(rp->clttydev))
1110 class_device_destroy(class3270, 1110 class_device_destroy(class3270,
1111 MKDEV(IBM_TTY3270_MAJOR, rp->minor)); 1111 MKDEV(IBM_TTY3270_MAJOR, rp->minor));
1112 if (rp->cltubdev) 1112 if (rp->cltubdev && !IS_ERR(rp->cltubdev))
1113 class_device_destroy(class3270, 1113 class_device_destroy(class3270,
1114 MKDEV(IBM_FS3270_MAJOR, rp->minor)); 1114 MKDEV(IBM_FS3270_MAJOR, rp->minor));
1115 list_del_init(&rp->list); 1115 list_del_init(&rp->list);
@@ -1117,9 +1117,9 @@ raw3270_delete_device(struct raw3270 *rp)
1117 1117
1118 /* Disconnect from ccw_device. */ 1118 /* Disconnect from ccw_device. */
1119 cdev = rp->cdev; 1119 cdev = rp->cdev;
1120 rp->cdev = 0; 1120 rp->cdev = NULL;
1121 cdev->dev.driver_data = 0; 1121 cdev->dev.driver_data = NULL;
1122 cdev->handler = 0; 1122 cdev->handler = NULL;
1123 1123
1124 /* Put ccw_device structure. */ 1124 /* Put ccw_device structure. */
1125 put_device(&cdev->dev); 1125 put_device(&cdev->dev);
@@ -1144,7 +1144,7 @@ raw3270_model_show(struct device *dev, struct device_attribute *attr, char *buf)
1144 return snprintf(buf, PAGE_SIZE, "%i\n", 1144 return snprintf(buf, PAGE_SIZE, "%i\n",
1145 ((struct raw3270 *) dev->driver_data)->model); 1145 ((struct raw3270 *) dev->driver_data)->model);
1146} 1146}
1147static DEVICE_ATTR(model, 0444, raw3270_model_show, 0); 1147static DEVICE_ATTR(model, 0444, raw3270_model_show, NULL);
1148 1148
1149static ssize_t 1149static ssize_t
1150raw3270_rows_show(struct device *dev, struct device_attribute *attr, char *buf) 1150raw3270_rows_show(struct device *dev, struct device_attribute *attr, char *buf)
@@ -1152,7 +1152,7 @@ raw3270_rows_show(struct device *dev, struct device_attribute *attr, char *buf)
1152 return snprintf(buf, PAGE_SIZE, "%i\n", 1152 return snprintf(buf, PAGE_SIZE, "%i\n",
1153 ((struct raw3270 *) dev->driver_data)->rows); 1153 ((struct raw3270 *) dev->driver_data)->rows);
1154} 1154}
1155static DEVICE_ATTR(rows, 0444, raw3270_rows_show, 0); 1155static DEVICE_ATTR(rows, 0444, raw3270_rows_show, NULL);
1156 1156
1157static ssize_t 1157static ssize_t
1158raw3270_columns_show(struct device *dev, struct device_attribute *attr, char *buf) 1158raw3270_columns_show(struct device *dev, struct device_attribute *attr, char *buf)
@@ -1160,7 +1160,7 @@ raw3270_columns_show(struct device *dev, struct device_attribute *attr, char *bu
1160 return snprintf(buf, PAGE_SIZE, "%i\n", 1160 return snprintf(buf, PAGE_SIZE, "%i\n",
1161 ((struct raw3270 *) dev->driver_data)->cols); 1161 ((struct raw3270 *) dev->driver_data)->cols);
1162} 1162}
1163static DEVICE_ATTR(columns, 0444, raw3270_columns_show, 0); 1163static DEVICE_ATTR(columns, 0444, raw3270_columns_show, NULL);
1164 1164
1165static struct attribute * raw3270_attrs[] = { 1165static struct attribute * raw3270_attrs[] = {
1166 &dev_attr_model.attr, 1166 &dev_attr_model.attr,
@@ -1173,21 +1173,37 @@ static struct attribute_group raw3270_attr_group = {
1173 .attrs = raw3270_attrs, 1173 .attrs = raw3270_attrs,
1174}; 1174};
1175 1175
1176static void 1176static int raw3270_create_attributes(struct raw3270 *rp)
1177raw3270_create_attributes(struct raw3270 *rp)
1178{ 1177{
1179 //FIXME: check return code 1178 int rc;
1180 sysfs_create_group(&rp->cdev->dev.kobj, &raw3270_attr_group); 1179
1181 rp->clttydev = 1180 rc = sysfs_create_group(&rp->cdev->dev.kobj, &raw3270_attr_group);
1182 class_device_create(class3270, NULL, 1181 if (rc)
1183 MKDEV(IBM_TTY3270_MAJOR, rp->minor), 1182 goto out;
1184 &rp->cdev->dev, "tty%s", 1183
1185 rp->cdev->dev.bus_id); 1184 rp->clttydev = class_device_create(class3270, NULL,
1186 rp->cltubdev = 1185 MKDEV(IBM_TTY3270_MAJOR, rp->minor),
1187 class_device_create(class3270, NULL, 1186 &rp->cdev->dev, "tty%s",
1188 MKDEV(IBM_FS3270_MAJOR, rp->minor), 1187 rp->cdev->dev.bus_id);
1189 &rp->cdev->dev, "tub%s", 1188 if (IS_ERR(rp->clttydev)) {
1190 rp->cdev->dev.bus_id); 1189 rc = PTR_ERR(rp->clttydev);
1190 goto out_ttydev;
1191 }
1192
1193 rp->cltubdev = class_device_create(class3270, NULL,
1194 MKDEV(IBM_FS3270_MAJOR, rp->minor),
1195 &rp->cdev->dev, "tub%s",
1196 rp->cdev->dev.bus_id);
1197 if (!IS_ERR(rp->cltubdev))
1198 goto out;
1199
1200 rc = PTR_ERR(rp->cltubdev);
1201 class_device_destroy(class3270, MKDEV(IBM_TTY3270_MAJOR, rp->minor));
1202
1203out_ttydev:
1204 sysfs_remove_group(&rp->cdev->dev.kobj, &raw3270_attr_group);
1205out:
1206 return rc;
1191} 1207}
1192 1208
1193/* 1209/*
@@ -1255,7 +1271,9 @@ raw3270_set_online (struct ccw_device *cdev)
1255 rc = raw3270_reset_device(rp); 1271 rc = raw3270_reset_device(rp);
1256 if (rc) 1272 if (rc)
1257 goto failure; 1273 goto failure;
1258 raw3270_create_attributes(rp); 1274 rc = raw3270_create_attributes(rp);
1275 if (rc)
1276 goto failure;
1259 set_bit(RAW3270_FLAGS_READY, &rp->flags); 1277 set_bit(RAW3270_FLAGS_READY, &rp->flags);
1260 mutex_lock(&raw3270_mutex); 1278 mutex_lock(&raw3270_mutex);
1261 list_for_each_entry(np, &raw3270_notifier, list) 1279 list_for_each_entry(np, &raw3270_notifier, list)
@@ -1296,7 +1314,7 @@ raw3270_remove (struct ccw_device *cdev)
1296 spin_lock_irqsave(get_ccwdev_lock(cdev), flags); 1314 spin_lock_irqsave(get_ccwdev_lock(cdev), flags);
1297 if (rp->view) { 1315 if (rp->view) {
1298 rp->view->fn->deactivate(rp->view); 1316 rp->view->fn->deactivate(rp->view);
1299 rp->view = 0; 1317 rp->view = NULL;
1300 } 1318 }
1301 while (!list_empty(&rp->view_list)) { 1319 while (!list_empty(&rp->view_list)) {
1302 v = list_entry(rp->view_list.next, struct raw3270_view, list); 1320 v = list_entry(rp->view_list.next, struct raw3270_view, list);
diff --git a/drivers/s390/char/raw3270.h b/drivers/s390/char/raw3270.h
index b635bf8e7775..90beaa80a782 100644
--- a/drivers/s390/char/raw3270.h
+++ b/drivers/s390/char/raw3270.h
@@ -231,7 +231,7 @@ alloc_string(struct list_head *free_list, unsigned long len)
231 INIT_LIST_HEAD(&cs->update); 231 INIT_LIST_HEAD(&cs->update);
232 return cs; 232 return cs;
233 } 233 }
234 return 0; 234 return NULL;
235} 235}
236 236
237static inline unsigned long 237static inline unsigned long
diff --git a/drivers/s390/char/tape_34xx.c b/drivers/s390/char/tape_34xx.c
index 48b4d30a7256..7b95dab913d0 100644
--- a/drivers/s390/char/tape_34xx.c
+++ b/drivers/s390/char/tape_34xx.c
@@ -1309,9 +1309,9 @@ static struct tape_discipline tape_discipline_34xx = {
1309}; 1309};
1310 1310
1311static struct ccw_device_id tape_34xx_ids[] = { 1311static struct ccw_device_id tape_34xx_ids[] = {
1312 { CCW_DEVICE_DEVTYPE(0x3480, 0, 0x3480, 0), driver_info: tape_3480}, 1312 { CCW_DEVICE_DEVTYPE(0x3480, 0, 0x3480, 0), .driver_info = tape_3480},
1313 { CCW_DEVICE_DEVTYPE(0x3490, 0, 0x3490, 0), driver_info: tape_3490}, 1313 { CCW_DEVICE_DEVTYPE(0x3490, 0, 0x3490, 0), .driver_info = tape_3490},
1314 { /* end of list */ } 1314 { /* end of list */ },
1315}; 1315};
1316 1316
1317static int 1317static int
diff --git a/drivers/s390/char/tape_class.c b/drivers/s390/char/tape_class.c
index a5c68e60fcf4..643b6d078563 100644
--- a/drivers/s390/char/tape_class.c
+++ b/drivers/s390/char/tape_class.c
@@ -76,14 +76,22 @@ struct tape_class_device *register_tape_dev(
76 device, 76 device,
77 "%s", tcd->device_name 77 "%s", tcd->device_name
78 ); 78 );
79 sysfs_create_link( 79 rc = PTR_ERR(tcd->class_device);
80 if (rc)
81 goto fail_with_cdev;
82 rc = sysfs_create_link(
80 &device->kobj, 83 &device->kobj,
81 &tcd->class_device->kobj, 84 &tcd->class_device->kobj,
82 tcd->mode_name 85 tcd->mode_name
83 ); 86 );
87 if (rc)
88 goto fail_with_class_device;
84 89
85 return tcd; 90 return tcd;
86 91
92fail_with_class_device:
93 class_device_destroy(tape_class, tcd->char_device->dev);
94
87fail_with_cdev: 95fail_with_cdev:
88 cdev_del(tcd->char_device); 96 cdev_del(tcd->char_device);
89 97
diff --git a/drivers/s390/char/tape_core.c b/drivers/s390/char/tape_core.c
index 122b4d8965c3..2826aed91043 100644
--- a/drivers/s390/char/tape_core.c
+++ b/drivers/s390/char/tape_core.c
@@ -543,20 +543,24 @@ int
543tape_generic_probe(struct ccw_device *cdev) 543tape_generic_probe(struct ccw_device *cdev)
544{ 544{
545 struct tape_device *device; 545 struct tape_device *device;
546 int ret;
546 547
547 device = tape_alloc_device(); 548 device = tape_alloc_device();
548 if (IS_ERR(device)) 549 if (IS_ERR(device))
549 return -ENODEV; 550 return -ENODEV;
550 PRINT_INFO("tape device %s found\n", cdev->dev.bus_id); 551 ccw_device_set_options(cdev, CCWDEV_DO_PATHGROUP);
552 ret = sysfs_create_group(&cdev->dev.kobj, &tape_attr_group);
553 if (ret) {
554 tape_put_device(device);
555 PRINT_ERR("probe failed for tape device %s\n", cdev->dev.bus_id);
556 return ret;
557 }
551 cdev->dev.driver_data = device; 558 cdev->dev.driver_data = device;
559 cdev->handler = __tape_do_irq;
552 device->cdev = cdev; 560 device->cdev = cdev;
553 device->cdev_id = busid_to_int(cdev->dev.bus_id); 561 device->cdev_id = busid_to_int(cdev->dev.bus_id);
554 cdev->handler = __tape_do_irq; 562 PRINT_INFO("tape device %s found\n", cdev->dev.bus_id);
555 563 return ret;
556 ccw_device_set_options(cdev, CCWDEV_DO_PATHGROUP);
557 sysfs_create_group(&cdev->dev.kobj, &tape_attr_group);
558
559 return 0;
560} 564}
561 565
562static inline void 566static inline void
diff --git a/drivers/s390/char/tty3270.c b/drivers/s390/char/tty3270.c
index f496f236b9c0..29718042c6c9 100644
--- a/drivers/s390/char/tty3270.c
+++ b/drivers/s390/char/tty3270.c
@@ -437,7 +437,7 @@ tty3270_rcl_add(struct tty3270 *tp, char *input, int len)
437{ 437{
438 struct string *s; 438 struct string *s;
439 439
440 tp->rcl_walk = 0; 440 tp->rcl_walk = NULL;
441 if (len <= 0) 441 if (len <= 0)
442 return; 442 return;
443 if (tp->rcl_nr >= tp->rcl_max) { 443 if (tp->rcl_nr >= tp->rcl_max) {
@@ -466,12 +466,12 @@ tty3270_rcl_backward(struct kbd_data *kbd)
466 else if (!list_empty(&tp->rcl_lines)) 466 else if (!list_empty(&tp->rcl_lines))
467 tp->rcl_walk = tp->rcl_lines.prev; 467 tp->rcl_walk = tp->rcl_lines.prev;
468 s = tp->rcl_walk ? 468 s = tp->rcl_walk ?
469 list_entry(tp->rcl_walk, struct string, list) : 0; 469 list_entry(tp->rcl_walk, struct string, list) : NULL;
470 if (tp->rcl_walk) { 470 if (tp->rcl_walk) {
471 s = list_entry(tp->rcl_walk, struct string, list); 471 s = list_entry(tp->rcl_walk, struct string, list);
472 tty3270_update_prompt(tp, s->string, s->len); 472 tty3270_update_prompt(tp, s->string, s->len);
473 } else 473 } else
474 tty3270_update_prompt(tp, 0, 0); 474 tty3270_update_prompt(tp, NULL, 0);
475 tty3270_set_timer(tp, 1); 475 tty3270_set_timer(tp, 1);
476 } 476 }
477 spin_unlock_bh(&tp->view.lock); 477 spin_unlock_bh(&tp->view.lock);
@@ -553,7 +553,7 @@ tty3270_read_tasklet(struct raw3270_request *rrq)
553 * has to be emitted to the tty and for 0x6d the screen 553 * has to be emitted to the tty and for 0x6d the screen
554 * needs to be redrawn. 554 * needs to be redrawn.
555 */ 555 */
556 input = 0; 556 input = NULL;
557 len = 0; 557 len = 0;
558 if (tp->input->string[0] == 0x7d) { 558 if (tp->input->string[0] == 0x7d) {
559 /* Enter: write input to tty. */ 559 /* Enter: write input to tty. */
@@ -567,7 +567,7 @@ tty3270_read_tasklet(struct raw3270_request *rrq)
567 tty3270_update_status(tp); 567 tty3270_update_status(tp);
568 } 568 }
569 /* Clear input area. */ 569 /* Clear input area. */
570 tty3270_update_prompt(tp, 0, 0); 570 tty3270_update_prompt(tp, NULL, 0);
571 tty3270_set_timer(tp, 1); 571 tty3270_set_timer(tp, 1);
572 } else if (tp->input->string[0] == 0x6d) { 572 } else if (tp->input->string[0] == 0x6d) {
573 /* Display has been cleared. Redraw. */ 573 /* Display has been cleared. Redraw. */
@@ -808,8 +808,8 @@ tty3270_release(struct raw3270_view *view)
808 tp = (struct tty3270 *) view; 808 tp = (struct tty3270 *) view;
809 tty = tp->tty; 809 tty = tp->tty;
810 if (tty) { 810 if (tty) {
811 tty->driver_data = 0; 811 tty->driver_data = NULL;
812 tp->tty = tp->kbd->tty = 0; 812 tp->tty = tp->kbd->tty = NULL;
813 tty_hangup(tty); 813 tty_hangup(tty);
814 raw3270_put_view(&tp->view); 814 raw3270_put_view(&tp->view);
815 } 815 }
@@ -948,8 +948,8 @@ tty3270_close(struct tty_struct *tty, struct file * filp)
948 return; 948 return;
949 tp = (struct tty3270 *) tty->driver_data; 949 tp = (struct tty3270 *) tty->driver_data;
950 if (tp) { 950 if (tp) {
951 tty->driver_data = 0; 951 tty->driver_data = NULL;
952 tp->tty = tp->kbd->tty = 0; 952 tp->tty = tp->kbd->tty = NULL;
953 raw3270_put_view(&tp->view); 953 raw3270_put_view(&tp->view);
954 } 954 }
955} 955}
@@ -1673,7 +1673,7 @@ tty3270_set_termios(struct tty_struct *tty, struct termios *old)
1673 new = L_ECHO(tty) ? TF_INPUT: TF_INPUTN; 1673 new = L_ECHO(tty) ? TF_INPUT: TF_INPUTN;
1674 if (new != tp->inattr) { 1674 if (new != tp->inattr) {
1675 tp->inattr = new; 1675 tp->inattr = new;
1676 tty3270_update_prompt(tp, 0, 0); 1676 tty3270_update_prompt(tp, NULL, 0);
1677 tty3270_set_timer(tp, 1); 1677 tty3270_set_timer(tp, 1);
1678 } 1678 }
1679 } 1679 }
@@ -1759,7 +1759,7 @@ void
1759tty3270_notifier(int index, int active) 1759tty3270_notifier(int index, int active)
1760{ 1760{
1761 if (active) 1761 if (active)
1762 tty_register_device(tty3270_driver, index, 0); 1762 tty_register_device(tty3270_driver, index, NULL);
1763 else 1763 else
1764 tty_unregister_device(tty3270_driver, index); 1764 tty_unregister_device(tty3270_driver, index);
1765} 1765}
@@ -1818,7 +1818,7 @@ tty3270_exit(void)
1818 1818
1819 raw3270_unregister_notifier(tty3270_notifier); 1819 raw3270_unregister_notifier(tty3270_notifier);
1820 driver = tty3270_driver; 1820 driver = tty3270_driver;
1821 tty3270_driver = 0; 1821 tty3270_driver = NULL;
1822 tty_unregister_driver(driver); 1822 tty_unregister_driver(driver);
1823 tty3270_del_views(); 1823 tty3270_del_views();
1824} 1824}
diff --git a/drivers/s390/char/vmlogrdr.c b/drivers/s390/char/vmlogrdr.c
index c625b69ebd19..6cb23040954b 100644
--- a/drivers/s390/char/vmlogrdr.c
+++ b/drivers/s390/char/vmlogrdr.c
@@ -86,8 +86,8 @@ struct vmlogrdr_priv_t {
86 */ 86 */
87static int vmlogrdr_open(struct inode *, struct file *); 87static int vmlogrdr_open(struct inode *, struct file *);
88static int vmlogrdr_release(struct inode *, struct file *); 88static int vmlogrdr_release(struct inode *, struct file *);
89static ssize_t vmlogrdr_read (struct file *filp, char *data, size_t count, 89static ssize_t vmlogrdr_read (struct file *filp, char __user *data,
90 loff_t * ppos); 90 size_t count, loff_t * ppos);
91 91
92static struct file_operations vmlogrdr_fops = { 92static struct file_operations vmlogrdr_fops = {
93 .owner = THIS_MODULE, 93 .owner = THIS_MODULE,
@@ -515,7 +515,7 @@ vmlogrdr_receive_data(struct vmlogrdr_priv_t *priv) {
515 515
516 516
517static ssize_t 517static ssize_t
518vmlogrdr_read (struct file *filp, char *data, size_t count, loff_t * ppos) 518vmlogrdr_read(struct file *filp, char __user *data, size_t count, loff_t * ppos)
519{ 519{
520 int rc; 520 int rc;
521 struct vmlogrdr_priv_t * priv = filp->private_data; 521 struct vmlogrdr_priv_t * priv = filp->private_data;
diff --git a/drivers/s390/char/vmwatchdog.c b/drivers/s390/char/vmwatchdog.c
index 5acc0ace3d7d..807320a41fa4 100644
--- a/drivers/s390/char/vmwatchdog.c
+++ b/drivers/s390/char/vmwatchdog.c
@@ -193,7 +193,7 @@ static int vmwdt_ioctl(struct inode *i, struct file *f,
193 return 0; 193 return 0;
194 case WDIOC_GETSTATUS: 194 case WDIOC_GETSTATUS:
195 case WDIOC_GETBOOTSTATUS: 195 case WDIOC_GETBOOTSTATUS:
196 return put_user(0, (int *)arg); 196 return put_user(0, (int __user *)arg);
197 case WDIOC_GETTEMP: 197 case WDIOC_GETTEMP:
198 return -EINVAL; 198 return -EINVAL;
199 case WDIOC_SETOPTIONS: 199 case WDIOC_SETOPTIONS:
diff --git a/drivers/s390/cio/ccwgroup.c b/drivers/s390/cio/ccwgroup.c
index c7319a07ba35..3cba6c9fab11 100644
--- a/drivers/s390/cio/ccwgroup.c
+++ b/drivers/s390/cio/ccwgroup.c
@@ -152,7 +152,6 @@ ccwgroup_create(struct device *root,
152 struct ccwgroup_device *gdev; 152 struct ccwgroup_device *gdev;
153 int i; 153 int i;
154 int rc; 154 int rc;
155 int del_drvdata;
156 155
157 if (argc > 256) /* disallow dumb users */ 156 if (argc > 256) /* disallow dumb users */
158 return -EINVAL; 157 return -EINVAL;
@@ -163,7 +162,6 @@ ccwgroup_create(struct device *root,
163 162
164 atomic_set(&gdev->onoff, 0); 163 atomic_set(&gdev->onoff, 0);
165 164
166 del_drvdata = 0;
167 for (i = 0; i < argc; i++) { 165 for (i = 0; i < argc; i++) {
168 gdev->cdev[i] = get_ccwdev_by_busid(cdrv, argv[i]); 166 gdev->cdev[i] = get_ccwdev_by_busid(cdrv, argv[i]);
169 167
@@ -180,10 +178,8 @@ ccwgroup_create(struct device *root,
180 rc = -EINVAL; 178 rc = -EINVAL;
181 goto free_dev; 179 goto free_dev;
182 } 180 }
183 }
184 for (i = 0; i < argc; i++)
185 gdev->cdev[i]->dev.driver_data = gdev; 181 gdev->cdev[i]->dev.driver_data = gdev;
186 del_drvdata = 1; 182 }
187 183
188 gdev->creator_id = creator_id; 184 gdev->creator_id = creator_id;
189 gdev->count = argc; 185 gdev->count = argc;
@@ -226,9 +222,9 @@ error:
226free_dev: 222free_dev:
227 for (i = 0; i < argc; i++) 223 for (i = 0; i < argc; i++)
228 if (gdev->cdev[i]) { 224 if (gdev->cdev[i]) {
229 put_device(&gdev->cdev[i]->dev); 225 if (gdev->cdev[i]->dev.driver_data == gdev)
230 if (del_drvdata)
231 gdev->cdev[i]->dev.driver_data = NULL; 226 gdev->cdev[i]->dev.driver_data = NULL;
227 put_device(&gdev->cdev[i]->dev);
232 } 228 }
233 kfree(gdev); 229 kfree(gdev);
234 return rc; 230 return rc;
@@ -319,7 +315,7 @@ ccwgroup_online_store (struct device *dev, struct device_attribute *attr, const
319 if (!try_module_get(gdrv->owner)) 315 if (!try_module_get(gdrv->owner))
320 return -EINVAL; 316 return -EINVAL;
321 317
322 value = simple_strtoul(buf, 0, 0); 318 value = simple_strtoul(buf, NULL, 0);
323 ret = count; 319 ret = count;
324 if (value == 1) 320 if (value == 1)
325 ccwgroup_set_online(gdev); 321 ccwgroup_set_online(gdev);
diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c
index a01f3bba4a7b..61ce3f1d5228 100644
--- a/drivers/s390/cio/chsc.c
+++ b/drivers/s390/cio/chsc.c
@@ -1464,6 +1464,40 @@ chsc_get_chp_desc(struct subchannel *sch, int chp_no)
1464 return desc; 1464 return desc;
1465} 1465}
1466 1466
1467static int reset_channel_path(struct channel_path *chp)
1468{
1469 int cc;
1470
1471 cc = rchp(chp->id);
1472 switch (cc) {
1473 case 0:
1474 return 0;
1475 case 2:
1476 return -EBUSY;
1477 default:
1478 return -ENODEV;
1479 }
1480}
1481
1482static void reset_channel_paths_css(struct channel_subsystem *css)
1483{
1484 int i;
1485
1486 for (i = 0; i <= __MAX_CHPID; i++) {
1487 if (css->chps[i])
1488 reset_channel_path(css->chps[i]);
1489 }
1490}
1491
1492void cio_reset_channel_paths(void)
1493{
1494 int i;
1495
1496 for (i = 0; i <= __MAX_CSSID; i++) {
1497 if (css[i] && css[i]->valid)
1498 reset_channel_paths_css(css[i]);
1499 }
1500}
1467 1501
1468static int __init 1502static int __init
1469chsc_alloc_sei_area(void) 1503chsc_alloc_sei_area(void)
diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c
index 6fec90eab00e..89320c1ad825 100644
--- a/drivers/s390/cio/cio.c
+++ b/drivers/s390/cio/cio.c
@@ -519,6 +519,7 @@ cio_validate_subchannel (struct subchannel *sch, struct subchannel_id schid)
519 memset(sch, 0, sizeof(struct subchannel)); 519 memset(sch, 0, sizeof(struct subchannel));
520 520
521 spin_lock_init(&sch->lock); 521 spin_lock_init(&sch->lock);
522 mutex_init(&sch->reg_mutex);
522 523
523 /* Set a name for the subchannel */ 524 /* Set a name for the subchannel */
524 snprintf (sch->dev.bus_id, BUS_ID_SIZE, "0.%x.%04x", schid.ssid, 525 snprintf (sch->dev.bus_id, BUS_ID_SIZE, "0.%x.%04x", schid.ssid,
@@ -797,7 +798,7 @@ struct subchannel *
797cio_get_console_subchannel(void) 798cio_get_console_subchannel(void)
798{ 799{
799 if (!console_subchannel_in_use) 800 if (!console_subchannel_in_use)
800 return 0; 801 return NULL;
801 return &console_subchannel; 802 return &console_subchannel;
802} 803}
803 804
@@ -875,5 +876,6 @@ void
875reipl(unsigned long devno) 876reipl(unsigned long devno)
876{ 877{
877 clear_all_subchannels(); 878 clear_all_subchannels();
879 cio_reset_channel_paths();
878 do_reipl(devno); 880 do_reipl(devno);
879} 881}
diff --git a/drivers/s390/cio/cio.h b/drivers/s390/cio/cio.h
index 0ca987344e07..4541c1af4b66 100644
--- a/drivers/s390/cio/cio.h
+++ b/drivers/s390/cio/cio.h
@@ -2,6 +2,7 @@
2#define S390_CIO_H 2#define S390_CIO_H
3 3
4#include "schid.h" 4#include "schid.h"
5#include <linux/mutex.h>
5 6
6/* 7/*
7 * where we put the ssd info 8 * where we put the ssd info
@@ -87,7 +88,7 @@ struct orb {
87struct subchannel { 88struct subchannel {
88 struct subchannel_id schid; 89 struct subchannel_id schid;
89 spinlock_t lock; /* subchannel lock */ 90 spinlock_t lock; /* subchannel lock */
90 91 struct mutex reg_mutex;
91 enum { 92 enum {
92 SUBCHANNEL_TYPE_IO = 0, 93 SUBCHANNEL_TYPE_IO = 0,
93 SUBCHANNEL_TYPE_CHSC = 1, 94 SUBCHANNEL_TYPE_CHSC = 1,
diff --git a/drivers/s390/cio/cmf.c b/drivers/s390/cio/cmf.c
index 1c3e8e9012b0..828b2d334f0a 100644
--- a/drivers/s390/cio/cmf.c
+++ b/drivers/s390/cio/cmf.c
@@ -1068,6 +1068,7 @@ cmb_show_avg_sample_interval(struct device *dev, struct device_attribute *attr,
1068 if (count) { 1068 if (count) {
1069 interval = cmb_data->last_update - 1069 interval = cmb_data->last_update -
1070 cdev->private->cmb_start_time; 1070 cdev->private->cmb_start_time;
1071 interval = (interval * 1000) >> 12;
1071 interval /= count; 1072 interval /= count;
1072 } else 1073 } else
1073 interval = -1; 1074 interval = -1;
@@ -1140,7 +1141,7 @@ static struct attribute *cmf_attributes[] = {
1140 &dev_attr_avg_device_disconnect_time.attr, 1141 &dev_attr_avg_device_disconnect_time.attr,
1141 &dev_attr_avg_control_unit_queuing_time.attr, 1142 &dev_attr_avg_control_unit_queuing_time.attr,
1142 &dev_attr_avg_device_active_only_time.attr, 1143 &dev_attr_avg_device_active_only_time.attr,
1143 0, 1144 NULL,
1144}; 1145};
1145 1146
1146static struct attribute_group cmf_attr_group = { 1147static struct attribute_group cmf_attr_group = {
@@ -1160,7 +1161,7 @@ static struct attribute *cmf_attributes_ext[] = {
1160 &dev_attr_avg_device_active_only_time.attr, 1161 &dev_attr_avg_device_active_only_time.attr,
1161 &dev_attr_avg_device_busy_time.attr, 1162 &dev_attr_avg_device_busy_time.attr,
1162 &dev_attr_avg_initial_command_response_time.attr, 1163 &dev_attr_avg_initial_command_response_time.attr,
1163 0, 1164 NULL,
1164}; 1165};
1165 1166
1166static struct attribute_group cmf_attr_group_ext = { 1167static struct attribute_group cmf_attr_group_ext = {
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c
index 1d3be80797f8..13eeea3d547f 100644
--- a/drivers/s390/cio/css.c
+++ b/drivers/s390/cio/css.c
@@ -108,6 +108,24 @@ css_subchannel_release(struct device *dev)
108 108
109extern int css_get_ssd_info(struct subchannel *sch); 109extern int css_get_ssd_info(struct subchannel *sch);
110 110
111
112int css_sch_device_register(struct subchannel *sch)
113{
114 int ret;
115
116 mutex_lock(&sch->reg_mutex);
117 ret = device_register(&sch->dev);
118 mutex_unlock(&sch->reg_mutex);
119 return ret;
120}
121
122void css_sch_device_unregister(struct subchannel *sch)
123{
124 mutex_lock(&sch->reg_mutex);
125 device_unregister(&sch->dev);
126 mutex_unlock(&sch->reg_mutex);
127}
128
111static int 129static int
112css_register_subchannel(struct subchannel *sch) 130css_register_subchannel(struct subchannel *sch)
113{ 131{
@@ -119,7 +137,7 @@ css_register_subchannel(struct subchannel *sch)
119 sch->dev.release = &css_subchannel_release; 137 sch->dev.release = &css_subchannel_release;
120 138
121 /* make it known to the system */ 139 /* make it known to the system */
122 ret = device_register(&sch->dev); 140 ret = css_sch_device_register(sch);
123 if (ret) 141 if (ret)
124 printk (KERN_WARNING "%s: could not register %s\n", 142 printk (KERN_WARNING "%s: could not register %s\n",
125 __func__, sch->dev.bus_id); 143 __func__, sch->dev.bus_id);
@@ -250,7 +268,7 @@ css_evaluate_subchannel(struct subchannel_id schid, int slow)
250 * The device will be killed automatically. 268 * The device will be killed automatically.
251 */ 269 */
252 cio_disable_subchannel(sch); 270 cio_disable_subchannel(sch);
253 device_unregister(&sch->dev); 271 css_sch_device_unregister(sch);
254 /* Reset intparm to zeroes. */ 272 /* Reset intparm to zeroes. */
255 sch->schib.pmcw.intparm = 0; 273 sch->schib.pmcw.intparm = 0;
256 cio_modify(sch); 274 cio_modify(sch);
@@ -264,7 +282,7 @@ css_evaluate_subchannel(struct subchannel_id schid, int slow)
264 * away in any case. 282 * away in any case.
265 */ 283 */
266 if (!disc) { 284 if (!disc) {
267 device_unregister(&sch->dev); 285 css_sch_device_unregister(sch);
268 /* Reset intparm to zeroes. */ 286 /* Reset intparm to zeroes. */
269 sch->schib.pmcw.intparm = 0; 287 sch->schib.pmcw.intparm = 0;
270 cio_modify(sch); 288 cio_modify(sch);
@@ -605,9 +623,13 @@ init_channel_subsystem (void)
605 ret = device_register(&css[i]->device); 623 ret = device_register(&css[i]->device);
606 if (ret) 624 if (ret)
607 goto out_free; 625 goto out_free;
608 if (css_characteristics_avail && css_chsc_characteristics.secm) 626 if (css_characteristics_avail &&
609 device_create_file(&css[i]->device, 627 css_chsc_characteristics.secm) {
610 &dev_attr_cm_enable); 628 ret = device_create_file(&css[i]->device,
629 &dev_attr_cm_enable);
630 if (ret)
631 goto out_device;
632 }
611 } 633 }
612 css_init_done = 1; 634 css_init_done = 1;
613 635
@@ -615,6 +637,8 @@ init_channel_subsystem (void)
615 637
616 for_each_subchannel(__init_channel_subsystem, NULL); 638 for_each_subchannel(__init_channel_subsystem, NULL);
617 return 0; 639 return 0;
640out_device:
641 device_unregister(&css[i]->device);
618out_free: 642out_free:
619 kfree(css[i]); 643 kfree(css[i]);
620out_unregister: 644out_unregister:
diff --git a/drivers/s390/cio/css.h b/drivers/s390/cio/css.h
index e210f89a2449..8aabb4adeb5f 100644
--- a/drivers/s390/cio/css.h
+++ b/drivers/s390/cio/css.h
@@ -100,7 +100,7 @@ struct ccw_device_private {
100 struct qdio_irq *qdio_data; 100 struct qdio_irq *qdio_data;
101 struct irb irb; /* device status */ 101 struct irb irb; /* device status */
102 struct senseid senseid; /* SenseID info */ 102 struct senseid senseid; /* SenseID info */
103 struct pgid pgid; /* path group ID */ 103 struct pgid pgid[8]; /* path group IDs per chpid*/
104 struct ccw1 iccws[2]; /* ccws for SNID/SID/SPGID commands */ 104 struct ccw1 iccws[2]; /* ccws for SNID/SID/SPGID commands */
105 struct work_struct kick_work; 105 struct work_struct kick_work;
106 wait_queue_head_t wait_q; 106 wait_queue_head_t wait_q;
@@ -136,6 +136,8 @@ extern struct bus_type css_bus_type;
136extern struct css_driver io_subchannel_driver; 136extern struct css_driver io_subchannel_driver;
137 137
138extern int css_probe_device(struct subchannel_id); 138extern int css_probe_device(struct subchannel_id);
139extern int css_sch_device_register(struct subchannel *);
140extern void css_sch_device_unregister(struct subchannel *);
139extern struct subchannel * get_subchannel_by_schid(struct subchannel_id); 141extern struct subchannel * get_subchannel_by_schid(struct subchannel_id);
140extern int css_init_done; 142extern int css_init_done;
141extern int for_each_subchannel(int(*fn)(struct subchannel_id, void *), void *); 143extern int for_each_subchannel(int(*fn)(struct subchannel_id, void *), void *);
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c
index 67f0de6aed33..585fa04233c3 100644
--- a/drivers/s390/cio/device.c
+++ b/drivers/s390/cio/device.c
@@ -100,7 +100,7 @@ ccw_uevent (struct device *dev, char **envp, int num_envp,
100 if ((buffer_size - length <= 0) || (i >= num_envp)) 100 if ((buffer_size - length <= 0) || (i >= num_envp))
101 return -ENOMEM; 101 return -ENOMEM;
102 102
103 envp[i] = 0; 103 envp[i] = NULL;
104 104
105 return 0; 105 return 0;
106} 106}
@@ -280,7 +280,7 @@ ccw_device_remove_disconnected(struct ccw_device *cdev)
280 * 'throw away device'. 280 * 'throw away device'.
281 */ 281 */
282 sch = to_subchannel(cdev->dev.parent); 282 sch = to_subchannel(cdev->dev.parent);
283 device_unregister(&sch->dev); 283 css_sch_device_unregister(sch);
284 /* Reset intparm to zeroes. */ 284 /* Reset intparm to zeroes. */
285 sch->schib.pmcw.intparm = 0; 285 sch->schib.pmcw.intparm = 0;
286 cio_modify(sch); 286 cio_modify(sch);
@@ -625,7 +625,7 @@ ccw_device_do_unreg_rereg(void *data)
625 other_sch->schib.pmcw.intparm = 0; 625 other_sch->schib.pmcw.intparm = 0;
626 cio_modify(other_sch); 626 cio_modify(other_sch);
627 } 627 }
628 device_unregister(&other_sch->dev); 628 css_sch_device_unregister(other_sch);
629 } 629 }
630 } 630 }
631 /* Update ssd info here. */ 631 /* Update ssd info here. */
@@ -709,7 +709,7 @@ ccw_device_call_sch_unregister(void *data)
709 struct subchannel *sch; 709 struct subchannel *sch;
710 710
711 sch = to_subchannel(cdev->dev.parent); 711 sch = to_subchannel(cdev->dev.parent);
712 device_unregister(&sch->dev); 712 css_sch_device_unregister(sch);
713 /* Reset intparm to zeroes. */ 713 /* Reset intparm to zeroes. */
714 sch->schib.pmcw.intparm = 0; 714 sch->schib.pmcw.intparm = 0;
715 cio_modify(sch); 715 cio_modify(sch);
@@ -1057,7 +1057,7 @@ get_ccwdev_by_busid(struct ccw_driver *cdrv, const char *bus_id)
1057 __ccwdev_check_busid); 1057 __ccwdev_check_busid);
1058 put_driver(drv); 1058 put_driver(drv);
1059 1059
1060 return dev ? to_ccwdev(dev) : 0; 1060 return dev ? to_ccwdev(dev) : NULL;
1061} 1061}
1062 1062
1063/************************** device driver handling ************************/ 1063/************************** device driver handling ************************/
@@ -1082,7 +1082,7 @@ ccw_device_probe (struct device *dev)
1082 ret = cdrv->probe ? cdrv->probe(cdev) : -ENODEV; 1082 ret = cdrv->probe ? cdrv->probe(cdev) : -ENODEV;
1083 1083
1084 if (ret) { 1084 if (ret) {
1085 cdev->drv = 0; 1085 cdev->drv = NULL;
1086 return ret; 1086 return ret;
1087 } 1087 }
1088 1088
@@ -1113,7 +1113,7 @@ ccw_device_remove (struct device *dev)
1113 ret, cdev->dev.bus_id); 1113 ret, cdev->dev.bus_id);
1114 } 1114 }
1115 ccw_device_set_timeout(cdev, 0); 1115 ccw_device_set_timeout(cdev, 0);
1116 cdev->drv = 0; 1116 cdev->drv = NULL;
1117 return 0; 1117 return 0;
1118} 1118}
1119 1119
diff --git a/drivers/s390/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c
index cb1af0b6f033..7a39e0b0386c 100644
--- a/drivers/s390/cio/device_fsm.c
+++ b/drivers/s390/cio/device_fsm.c
@@ -152,7 +152,8 @@ ccw_device_cancel_halt_clear(struct ccw_device *cdev)
152 if (cdev->private->iretry) { 152 if (cdev->private->iretry) {
153 cdev->private->iretry--; 153 cdev->private->iretry--;
154 ret = cio_halt(sch); 154 ret = cio_halt(sch);
155 return (ret == 0) ? -EBUSY : ret; 155 if (ret != -EBUSY)
156 return (ret == 0) ? -EBUSY : ret;
156 } 157 }
157 /* halt io unsuccessful. */ 158 /* halt io unsuccessful. */
158 cdev->private->iretry = 255; /* 255 clear retries. */ 159 cdev->private->iretry = 255; /* 255 clear retries. */
@@ -378,6 +379,56 @@ ccw_device_done(struct ccw_device *cdev, int state)
378 put_device (&cdev->dev); 379 put_device (&cdev->dev);
379} 380}
380 381
382static inline int cmp_pgid(struct pgid *p1, struct pgid *p2)
383{
384 char *c1;
385 char *c2;
386
387 c1 = (char *)p1;
388 c2 = (char *)p2;
389
390 return memcmp(c1 + 1, c2 + 1, sizeof(struct pgid) - 1);
391}
392
393static void __ccw_device_get_common_pgid(struct ccw_device *cdev)
394{
395 int i;
396 int last;
397
398 last = 0;
399 for (i = 0; i < 8; i++) {
400 if (cdev->private->pgid[i].inf.ps.state1 == SNID_STATE1_RESET)
401 /* No PGID yet */
402 continue;
403 if (cdev->private->pgid[last].inf.ps.state1 ==
404 SNID_STATE1_RESET) {
405 /* First non-zero PGID */
406 last = i;
407 continue;
408 }
409 if (cmp_pgid(&cdev->private->pgid[i],
410 &cdev->private->pgid[last]) == 0)
411 /* Non-conflicting PGIDs */
412 continue;
413
414 /* PGID mismatch, can't pathgroup. */
415 CIO_MSG_EVENT(0, "SNID - pgid mismatch for device "
416 "0.%x.%04x, can't pathgroup\n",
417 cdev->private->ssid, cdev->private->devno);
418 cdev->private->options.pgroup = 0;
419 return;
420 }
421 if (cdev->private->pgid[last].inf.ps.state1 ==
422 SNID_STATE1_RESET)
423 /* No previous pgid found */
424 memcpy(&cdev->private->pgid[0], &css[0]->global_pgid,
425 sizeof(struct pgid));
426 else
427 /* Use existing pgid */
428 memcpy(&cdev->private->pgid[0], &cdev->private->pgid[last],
429 sizeof(struct pgid));
430}
431
381/* 432/*
382 * Function called from device_pgid.c after sense path ground has completed. 433 * Function called from device_pgid.c after sense path ground has completed.
383 */ 434 */
@@ -388,24 +439,26 @@ ccw_device_sense_pgid_done(struct ccw_device *cdev, int err)
388 439
389 sch = to_subchannel(cdev->dev.parent); 440 sch = to_subchannel(cdev->dev.parent);
390 switch (err) { 441 switch (err) {
391 case 0: 442 case -EOPNOTSUPP: /* path grouping not supported, use nop instead. */
392 /* Start Path Group verification. */ 443 cdev->private->options.pgroup = 0;
393 sch->vpm = 0; /* Start with no path groups set. */ 444 break;
394 cdev->private->state = DEV_STATE_VERIFY; 445 case 0: /* success */
395 ccw_device_verify_start(cdev); 446 case -EACCES: /* partial success, some paths not operational */
447 /* Check if all pgids are equal or 0. */
448 __ccw_device_get_common_pgid(cdev);
396 break; 449 break;
397 case -ETIME: /* Sense path group id stopped by timeout. */ 450 case -ETIME: /* Sense path group id stopped by timeout. */
398 case -EUSERS: /* device is reserved for someone else. */ 451 case -EUSERS: /* device is reserved for someone else. */
399 ccw_device_done(cdev, DEV_STATE_BOXED); 452 ccw_device_done(cdev, DEV_STATE_BOXED);
400 break; 453 return;
401 case -EOPNOTSUPP: /* path grouping not supported, just set online. */
402 cdev->private->options.pgroup = 0;
403 ccw_device_done(cdev, DEV_STATE_ONLINE);
404 break;
405 default: 454 default:
406 ccw_device_done(cdev, DEV_STATE_NOT_OPER); 455 ccw_device_done(cdev, DEV_STATE_NOT_OPER);
407 break; 456 return;
408 } 457 }
458 /* Start Path Group verification. */
459 sch->vpm = 0; /* Start with no path groups set. */
460 cdev->private->state = DEV_STATE_VERIFY;
461 ccw_device_verify_start(cdev);
409} 462}
410 463
411/* 464/*
@@ -562,8 +615,9 @@ ccw_device_online(struct ccw_device *cdev)
562 } 615 }
563 /* Do we want to do path grouping? */ 616 /* Do we want to do path grouping? */
564 if (!cdev->private->options.pgroup) { 617 if (!cdev->private->options.pgroup) {
565 /* No, set state online immediately. */ 618 /* Start initial path verification. */
566 ccw_device_done(cdev, DEV_STATE_ONLINE); 619 cdev->private->state = DEV_STATE_VERIFY;
620 ccw_device_verify_start(cdev);
567 return 0; 621 return 0;
568 } 622 }
569 /* Do a SensePGID first. */ 623 /* Do a SensePGID first. */
@@ -609,6 +663,7 @@ ccw_device_offline(struct ccw_device *cdev)
609 /* Are we doing path grouping? */ 663 /* Are we doing path grouping? */
610 if (!cdev->private->options.pgroup) { 664 if (!cdev->private->options.pgroup) {
611 /* No, set state offline immediately. */ 665 /* No, set state offline immediately. */
666 sch->vpm = 0;
612 ccw_device_done(cdev, DEV_STATE_OFFLINE); 667 ccw_device_done(cdev, DEV_STATE_OFFLINE);
613 return 0; 668 return 0;
614 } 669 }
@@ -705,8 +760,6 @@ ccw_device_online_verify(struct ccw_device *cdev, enum dev_event dev_event)
705{ 760{
706 struct subchannel *sch; 761 struct subchannel *sch;
707 762
708 if (!cdev->private->options.pgroup)
709 return;
710 if (cdev->private->state == DEV_STATE_W4SENSE) { 763 if (cdev->private->state == DEV_STATE_W4SENSE) {
711 cdev->private->flags.doverify = 1; 764 cdev->private->flags.doverify = 1;
712 return; 765 return;
@@ -995,8 +1048,7 @@ static void
995ccw_device_wait4io_verify(struct ccw_device *cdev, enum dev_event dev_event) 1048ccw_device_wait4io_verify(struct ccw_device *cdev, enum dev_event dev_event)
996{ 1049{
997 /* When the I/O has terminated, we have to start verification. */ 1050 /* When the I/O has terminated, we have to start verification. */
998 if (cdev->private->options.pgroup) 1051 cdev->private->flags.doverify = 1;
999 cdev->private->flags.doverify = 1;
1000} 1052}
1001 1053
1002static void 1054static void
diff --git a/drivers/s390/cio/device_pgid.c b/drivers/s390/cio/device_pgid.c
index 54cb64ed0786..32610fd8868e 100644
--- a/drivers/s390/cio/device_pgid.c
+++ b/drivers/s390/cio/device_pgid.c
@@ -33,12 +33,17 @@ __ccw_device_sense_pgid_start(struct ccw_device *cdev)
33 struct subchannel *sch; 33 struct subchannel *sch;
34 struct ccw1 *ccw; 34 struct ccw1 *ccw;
35 int ret; 35 int ret;
36 int i;
36 37
37 sch = to_subchannel(cdev->dev.parent); 38 sch = to_subchannel(cdev->dev.parent);
39 /* Return if we already checked on all paths. */
40 if (cdev->private->imask == 0)
41 return (sch->lpm == 0) ? -ENODEV : -EACCES;
42 i = 8 - ffs(cdev->private->imask);
43
38 /* Setup sense path group id channel program. */ 44 /* Setup sense path group id channel program. */
39 ccw = cdev->private->iccws; 45 ccw = cdev->private->iccws;
40 ccw->cmd_code = CCW_CMD_SENSE_PGID; 46 ccw->cmd_code = CCW_CMD_SENSE_PGID;
41 ccw->cda = (__u32) __pa (&cdev->private->pgid);
42 ccw->count = sizeof (struct pgid); 47 ccw->count = sizeof (struct pgid);
43 ccw->flags = CCW_FLAG_SLI; 48 ccw->flags = CCW_FLAG_SLI;
44 49
@@ -48,6 +53,7 @@ __ccw_device_sense_pgid_start(struct ccw_device *cdev)
48 ret = -ENODEV; 53 ret = -ENODEV;
49 while (cdev->private->imask != 0) { 54 while (cdev->private->imask != 0) {
50 /* Try every path multiple times. */ 55 /* Try every path multiple times. */
56 ccw->cda = (__u32) __pa (&cdev->private->pgid[i]);
51 if (cdev->private->iretry > 0) { 57 if (cdev->private->iretry > 0) {
52 cdev->private->iretry--; 58 cdev->private->iretry--;
53 ret = cio_start (sch, cdev->private->iccws, 59 ret = cio_start (sch, cdev->private->iccws,
@@ -64,7 +70,9 @@ __ccw_device_sense_pgid_start(struct ccw_device *cdev)
64 } 70 }
65 cdev->private->imask >>= 1; 71 cdev->private->imask >>= 1;
66 cdev->private->iretry = 5; 72 cdev->private->iretry = 5;
73 i++;
67 } 74 }
75
68 return ret; 76 return ret;
69} 77}
70 78
@@ -76,7 +84,7 @@ ccw_device_sense_pgid_start(struct ccw_device *cdev)
76 cdev->private->state = DEV_STATE_SENSE_PGID; 84 cdev->private->state = DEV_STATE_SENSE_PGID;
77 cdev->private->imask = 0x80; 85 cdev->private->imask = 0x80;
78 cdev->private->iretry = 5; 86 cdev->private->iretry = 5;
79 memset (&cdev->private->pgid, 0, sizeof (struct pgid)); 87 memset (&cdev->private->pgid, 0, sizeof (cdev->private->pgid));
80 ret = __ccw_device_sense_pgid_start(cdev); 88 ret = __ccw_device_sense_pgid_start(cdev);
81 if (ret && ret != -EBUSY) 89 if (ret && ret != -EBUSY)
82 ccw_device_sense_pgid_done(cdev, ret); 90 ccw_device_sense_pgid_done(cdev, ret);
@@ -91,6 +99,7 @@ __ccw_device_check_sense_pgid(struct ccw_device *cdev)
91{ 99{
92 struct subchannel *sch; 100 struct subchannel *sch;
93 struct irb *irb; 101 struct irb *irb;
102 int i;
94 103
95 sch = to_subchannel(cdev->dev.parent); 104 sch = to_subchannel(cdev->dev.parent);
96 irb = &cdev->private->irb; 105 irb = &cdev->private->irb;
@@ -124,7 +133,8 @@ __ccw_device_check_sense_pgid(struct ccw_device *cdev)
124 sch->schid.sch_no, sch->orb.lpm); 133 sch->schid.sch_no, sch->orb.lpm);
125 return -EACCES; 134 return -EACCES;
126 } 135 }
127 if (cdev->private->pgid.inf.ps.state2 == SNID_STATE2_RESVD_ELSE) { 136 i = 8 - ffs(cdev->private->imask);
137 if (cdev->private->pgid[i].inf.ps.state2 == SNID_STATE2_RESVD_ELSE) {
128 CIO_MSG_EVENT(2, "SNID - Device %04x on Subchannel 0.%x.%04x " 138 CIO_MSG_EVENT(2, "SNID - Device %04x on Subchannel 0.%x.%04x "
129 "is reserved by someone else\n", 139 "is reserved by someone else\n",
130 cdev->private->devno, sch->schid.ssid, 140 cdev->private->devno, sch->schid.ssid,
@@ -162,12 +172,6 @@ ccw_device_sense_pgid_irq(struct ccw_device *cdev, enum dev_event dev_event)
162 memset(&cdev->private->irb, 0, sizeof(struct irb)); 172 memset(&cdev->private->irb, 0, sizeof(struct irb));
163 switch (ret) { 173 switch (ret) {
164 /* 0, -ETIME, -EOPNOTSUPP, -EAGAIN, -EACCES or -EUSERS */ 174 /* 0, -ETIME, -EOPNOTSUPP, -EAGAIN, -EACCES or -EUSERS */
165 case 0: /* Sense Path Group ID successful. */
166 if (cdev->private->pgid.inf.ps.state1 == SNID_STATE1_RESET)
167 memcpy(&cdev->private->pgid, &css[0]->global_pgid,
168 sizeof(struct pgid));
169 ccw_device_sense_pgid_done(cdev, 0);
170 break;
171 case -EOPNOTSUPP: /* Sense Path Group ID not supported */ 175 case -EOPNOTSUPP: /* Sense Path Group ID not supported */
172 ccw_device_sense_pgid_done(cdev, -EOPNOTSUPP); 176 ccw_device_sense_pgid_done(cdev, -EOPNOTSUPP);
173 break; 177 break;
@@ -176,13 +180,15 @@ ccw_device_sense_pgid_irq(struct ccw_device *cdev, enum dev_event dev_event)
176 break; 180 break;
177 case -EACCES: /* channel is not operational. */ 181 case -EACCES: /* channel is not operational. */
178 sch->lpm &= ~cdev->private->imask; 182 sch->lpm &= ~cdev->private->imask;
183 /* Fall through. */
184 case 0: /* Sense Path Group ID successful. */
179 cdev->private->imask >>= 1; 185 cdev->private->imask >>= 1;
180 cdev->private->iretry = 5; 186 cdev->private->iretry = 5;
181 /* Fall through. */ 187 /* Fall through. */
182 case -EAGAIN: /* Try again. */ 188 case -EAGAIN: /* Try again. */
183 ret = __ccw_device_sense_pgid_start(cdev); 189 ret = __ccw_device_sense_pgid_start(cdev);
184 if (ret != 0 && ret != -EBUSY) 190 if (ret != 0 && ret != -EBUSY)
185 ccw_device_sense_pgid_done(cdev, -ENODEV); 191 ccw_device_sense_pgid_done(cdev, ret);
186 break; 192 break;
187 case -EUSERS: /* device is reserved for someone else. */ 193 case -EUSERS: /* device is reserved for someone else. */
188 ccw_device_sense_pgid_done(cdev, -EUSERS); 194 ccw_device_sense_pgid_done(cdev, -EUSERS);
@@ -203,20 +209,20 @@ __ccw_device_do_pgid(struct ccw_device *cdev, __u8 func)
203 sch = to_subchannel(cdev->dev.parent); 209 sch = to_subchannel(cdev->dev.parent);
204 210
205 /* Setup sense path group id channel program. */ 211 /* Setup sense path group id channel program. */
206 cdev->private->pgid.inf.fc = func; 212 cdev->private->pgid[0].inf.fc = func;
207 ccw = cdev->private->iccws; 213 ccw = cdev->private->iccws;
208 if (!cdev->private->flags.pgid_single) { 214 if (!cdev->private->flags.pgid_single) {
209 cdev->private->pgid.inf.fc |= SPID_FUNC_MULTI_PATH; 215 cdev->private->pgid[0].inf.fc |= SPID_FUNC_MULTI_PATH;
210 ccw->cmd_code = CCW_CMD_SUSPEND_RECONN; 216 ccw->cmd_code = CCW_CMD_SUSPEND_RECONN;
211 ccw->cda = 0; 217 ccw->cda = 0;
212 ccw->count = 0; 218 ccw->count = 0;
213 ccw->flags = CCW_FLAG_SLI | CCW_FLAG_CC; 219 ccw->flags = CCW_FLAG_SLI | CCW_FLAG_CC;
214 ccw++; 220 ccw++;
215 } else 221 } else
216 cdev->private->pgid.inf.fc |= SPID_FUNC_SINGLE_PATH; 222 cdev->private->pgid[0].inf.fc |= SPID_FUNC_SINGLE_PATH;
217 223
218 ccw->cmd_code = CCW_CMD_SET_PGID; 224 ccw->cmd_code = CCW_CMD_SET_PGID;
219 ccw->cda = (__u32) __pa (&cdev->private->pgid); 225 ccw->cda = (__u32) __pa (&cdev->private->pgid[0]);
220 ccw->count = sizeof (struct pgid); 226 ccw->count = sizeof (struct pgid);
221 ccw->flags = CCW_FLAG_SLI; 227 ccw->flags = CCW_FLAG_SLI;
222 228
@@ -244,6 +250,48 @@ __ccw_device_do_pgid(struct ccw_device *cdev, __u8 func)
244} 250}
245 251
246/* 252/*
253 * Helper function to send a nop ccw down a path.
254 */
255static int __ccw_device_do_nop(struct ccw_device *cdev)
256{
257 struct subchannel *sch;
258 struct ccw1 *ccw;
259 int ret;
260
261 sch = to_subchannel(cdev->dev.parent);
262
263 /* Setup nop channel program. */
264 ccw = cdev->private->iccws;
265 ccw->cmd_code = CCW_CMD_NOOP;
266 ccw->cda = 0;
267 ccw->count = 0;
268 ccw->flags = CCW_FLAG_SLI;
269
270 /* Reset device status. */
271 memset(&cdev->private->irb, 0, sizeof(struct irb));
272
273 /* Try multiple times. */
274 ret = -ENODEV;
275 if (cdev->private->iretry > 0) {
276 cdev->private->iretry--;
277 ret = cio_start (sch, cdev->private->iccws,
278 cdev->private->imask);
279 /* ret is 0, -EBUSY, -EACCES or -ENODEV */
280 if ((ret != -EACCES) && (ret != -ENODEV))
281 return ret;
282 }
283 /* nop command failed on this path. Switch it off. */
284 sch->lpm &= ~cdev->private->imask;
285 sch->vpm &= ~cdev->private->imask;
286 CIO_MSG_EVENT(2, "NOP - Device %04x on Subchannel "
287 "0.%x.%04x, lpm %02X, became 'not operational'\n",
288 cdev->private->devno, sch->schid.ssid,
289 sch->schid.sch_no, cdev->private->imask);
290 return ret;
291}
292
293
294/*
247 * Called from interrupt context to check if a valid answer 295 * Called from interrupt context to check if a valid answer
248 * to Set Path Group ID was received. 296 * to Set Path Group ID was received.
249 */ 297 */
@@ -282,6 +330,29 @@ __ccw_device_check_pgid(struct ccw_device *cdev)
282 return 0; 330 return 0;
283} 331}
284 332
333/*
334 * Called from interrupt context to check the path status after a nop has
335 * been send.
336 */
337static int __ccw_device_check_nop(struct ccw_device *cdev)
338{
339 struct subchannel *sch;
340 struct irb *irb;
341
342 sch = to_subchannel(cdev->dev.parent);
343 irb = &cdev->private->irb;
344 if (irb->scsw.fctl & (SCSW_FCTL_HALT_FUNC | SCSW_FCTL_CLEAR_FUNC))
345 return -ETIME;
346 if (irb->scsw.cc == 3) {
347 CIO_MSG_EVENT(2, "NOP - Device %04x on Subchannel 0.%x.%04x,"
348 " lpm %02X, became 'not operational'\n",
349 cdev->private->devno, sch->schid.ssid,
350 sch->schid.sch_no, cdev->private->imask);
351 return -EACCES;
352 }
353 return 0;
354}
355
285static void 356static void
286__ccw_device_verify_start(struct ccw_device *cdev) 357__ccw_device_verify_start(struct ccw_device *cdev)
287{ 358{
@@ -296,9 +367,12 @@ __ccw_device_verify_start(struct ccw_device *cdev)
296 if ((sch->vpm & imask) != (sch->lpm & imask)) 367 if ((sch->vpm & imask) != (sch->lpm & imask))
297 break; 368 break;
298 cdev->private->imask = imask; 369 cdev->private->imask = imask;
299 func = (sch->vpm & imask) ? 370 if (cdev->private->options.pgroup) {
300 SPID_FUNC_RESIGN : SPID_FUNC_ESTABLISH; 371 func = (sch->vpm & imask) ?
301 ret = __ccw_device_do_pgid(cdev, func); 372 SPID_FUNC_RESIGN : SPID_FUNC_ESTABLISH;
373 ret = __ccw_device_do_pgid(cdev, func);
374 } else
375 ret = __ccw_device_do_nop(cdev);
302 if (ret == 0 || ret == -EBUSY) 376 if (ret == 0 || ret == -EBUSY)
303 return; 377 return;
304 cdev->private->iretry = 5; 378 cdev->private->iretry = 5;
@@ -327,7 +401,10 @@ ccw_device_verify_irq(struct ccw_device *cdev, enum dev_event dev_event)
327 if (ccw_device_accumulate_and_sense(cdev, irb) != 0) 401 if (ccw_device_accumulate_and_sense(cdev, irb) != 0)
328 return; 402 return;
329 sch = to_subchannel(cdev->dev.parent); 403 sch = to_subchannel(cdev->dev.parent);
330 ret = __ccw_device_check_pgid(cdev); 404 if (cdev->private->options.pgroup)
405 ret = __ccw_device_check_pgid(cdev);
406 else
407 ret = __ccw_device_check_nop(cdev);
331 memset(&cdev->private->irb, 0, sizeof(struct irb)); 408 memset(&cdev->private->irb, 0, sizeof(struct irb));
332 switch (ret) { 409 switch (ret) {
333 /* 0, -ETIME, -EAGAIN, -EOPNOTSUPP or -EACCES */ 410 /* 0, -ETIME, -EAGAIN, -EOPNOTSUPP or -EACCES */
@@ -345,11 +422,10 @@ ccw_device_verify_irq(struct ccw_device *cdev, enum dev_event dev_event)
345 * One of those strange devices which claim to be able 422 * One of those strange devices which claim to be able
346 * to do multipathing but not for Set Path Group ID. 423 * to do multipathing but not for Set Path Group ID.
347 */ 424 */
348 if (cdev->private->flags.pgid_single) { 425 if (cdev->private->flags.pgid_single)
349 ccw_device_verify_done(cdev, -EOPNOTSUPP); 426 cdev->private->options.pgroup = 0;
350 break; 427 else
351 } 428 cdev->private->flags.pgid_single = 1;
352 cdev->private->flags.pgid_single = 1;
353 /* fall through. */ 429 /* fall through. */
354 case -EAGAIN: /* Try again. */ 430 case -EAGAIN: /* Try again. */
355 __ccw_device_verify_start(cdev); 431 __ccw_device_verify_start(cdev);
diff --git a/drivers/s390/cio/device_status.c b/drivers/s390/cio/device_status.c
index 14bef2c179bf..caf148d5caad 100644
--- a/drivers/s390/cio/device_status.c
+++ b/drivers/s390/cio/device_status.c
@@ -67,8 +67,7 @@ ccw_device_path_notoper(struct ccw_device *cdev)
67 sch->schib.pmcw.pnom); 67 sch->schib.pmcw.pnom);
68 68
69 sch->lpm &= ~sch->schib.pmcw.pnom; 69 sch->lpm &= ~sch->schib.pmcw.pnom;
70 if (cdev->private->options.pgroup) 70 cdev->private->flags.doverify = 1;
71 cdev->private->flags.doverify = 1;
72} 71}
73 72
74/* 73/*
@@ -180,7 +179,7 @@ ccw_device_accumulate_esw(struct ccw_device *cdev, struct irb *irb)
180 cdev_irb->esw.esw0.erw.auth = irb->esw.esw0.erw.auth; 179 cdev_irb->esw.esw0.erw.auth = irb->esw.esw0.erw.auth;
181 /* Copy path verification required flag. */ 180 /* Copy path verification required flag. */
182 cdev_irb->esw.esw0.erw.pvrf = irb->esw.esw0.erw.pvrf; 181 cdev_irb->esw.esw0.erw.pvrf = irb->esw.esw0.erw.pvrf;
183 if (irb->esw.esw0.erw.pvrf && cdev->private->options.pgroup) 182 if (irb->esw.esw0.erw.pvrf)
184 cdev->private->flags.doverify = 1; 183 cdev->private->flags.doverify = 1;
185 /* Copy concurrent sense bit. */ 184 /* Copy concurrent sense bit. */
186 cdev_irb->esw.esw0.erw.cons = irb->esw.esw0.erw.cons; 185 cdev_irb->esw.esw0.erw.cons = irb->esw.esw0.erw.cons;
@@ -354,7 +353,7 @@ ccw_device_accumulate_basic_sense(struct ccw_device *cdev, struct irb *irb)
354 } 353 }
355 /* Check if path verification is required. */ 354 /* Check if path verification is required. */
356 if (ccw_device_accumulate_esw_valid(irb) && 355 if (ccw_device_accumulate_esw_valid(irb) &&
357 irb->esw.esw0.erw.pvrf && cdev->private->options.pgroup) 356 irb->esw.esw0.erw.pvrf)
358 cdev->private->flags.doverify = 1; 357 cdev->private->flags.doverify = 1;
359} 358}
360 359
diff --git a/drivers/s390/cio/qdio.c b/drivers/s390/cio/qdio.c
index b70039af70d6..7c93a8798d23 100644
--- a/drivers/s390/cio/qdio.c
+++ b/drivers/s390/cio/qdio.c
@@ -2735,7 +2735,7 @@ qdio_free(struct ccw_device *cdev)
2735 QDIO_DBF_TEXT1(0,trace,dbf_text); 2735 QDIO_DBF_TEXT1(0,trace,dbf_text);
2736 QDIO_DBF_TEXT0(0,setup,dbf_text); 2736 QDIO_DBF_TEXT0(0,setup,dbf_text);
2737 2737
2738 cdev->private->qdio_data = 0; 2738 cdev->private->qdio_data = NULL;
2739 2739
2740 up(&irq_ptr->setting_up_sema); 2740 up(&irq_ptr->setting_up_sema);
2741 2741
diff --git a/drivers/s390/net/claw.c b/drivers/s390/net/claw.c
index 23d53bf9daf1..95f4e105cb96 100644
--- a/drivers/s390/net/claw.c
+++ b/drivers/s390/net/claw.c
@@ -529,7 +529,7 @@ claw_open(struct net_device *dev)
529 printk(KERN_INFO "%s:%s Enter \n",dev->name,__FUNCTION__); 529 printk(KERN_INFO "%s:%s Enter \n",dev->name,__FUNCTION__);
530#endif 530#endif
531 CLAW_DBF_TEXT(4,trace,"open"); 531 CLAW_DBF_TEXT(4,trace,"open");
532 if (!dev | (dev->name[0] == 0x00)) { 532 if (!dev || (dev->name[0] == 0x00)) {
533 CLAW_DBF_TEXT(2,trace,"BadDev"); 533 CLAW_DBF_TEXT(2,trace,"BadDev");
534 printk(KERN_WARNING "claw: Bad device at open failing \n"); 534 printk(KERN_WARNING "claw: Bad device at open failing \n");
535 return -ENODEV; 535 return -ENODEV;
diff --git a/drivers/s390/net/ctcmain.c b/drivers/s390/net/ctcmain.c
index 20c8eb16f464..8a4b58120146 100644
--- a/drivers/s390/net/ctcmain.c
+++ b/drivers/s390/net/ctcmain.c
@@ -2686,9 +2686,17 @@ static struct attribute_group ctc_attr_group = {
2686static int 2686static int
2687ctc_add_attributes(struct device *dev) 2687ctc_add_attributes(struct device *dev)
2688{ 2688{
2689 device_create_file(dev, &dev_attr_loglevel); 2689 int rc;
2690 device_create_file(dev, &dev_attr_stats); 2690
2691 return 0; 2691 rc = device_create_file(dev, &dev_attr_loglevel);
2692 if (rc)
2693 goto out;
2694 rc = device_create_file(dev, &dev_attr_stats);
2695 if (!rc)
2696 goto out;
2697 device_remove_file(dev, &dev_attr_loglevel);
2698out:
2699 return rc;
2692} 2700}
2693 2701
2694static void 2702static void
@@ -2901,7 +2909,12 @@ ctc_new_device(struct ccwgroup_device *cgdev)
2901 goto out; 2909 goto out;
2902 } 2910 }
2903 2911
2904 ctc_add_attributes(&cgdev->dev); 2912 if (ctc_add_attributes(&cgdev->dev)) {
2913 ctc_netdev_unregister(dev);
2914 dev->priv = NULL;
2915 ctc_free_netdevice(dev, 1);
2916 goto out;
2917 }
2905 2918
2906 strlcpy(privptr->fsm->name, dev->name, sizeof (privptr->fsm->name)); 2919 strlcpy(privptr->fsm->name, dev->name, sizeof (privptr->fsm->name));
2907 2920
diff --git a/drivers/s390/net/iucv.c b/drivers/s390/net/iucv.c
index 189a49275433..0e863df4027a 100644
--- a/drivers/s390/net/iucv.c
+++ b/drivers/s390/net/iucv.c
@@ -692,7 +692,7 @@ iucv_retrieve_buffer (void)
692 iucv_debug(1, "entering"); 692 iucv_debug(1, "entering");
693 if (iucv_cpuid != -1) { 693 if (iucv_cpuid != -1) {
694 smp_call_function_on(iucv_retrieve_buffer_cpuid, 694 smp_call_function_on(iucv_retrieve_buffer_cpuid,
695 0, 0, 1, iucv_cpuid); 695 NULL, 0, 1, iucv_cpuid);
696 /* Release the cpu reserved by iucv_declare_buffer. */ 696 /* Release the cpu reserved by iucv_declare_buffer. */
697 smp_put_cpu(iucv_cpuid); 697 smp_put_cpu(iucv_cpuid);
698 iucv_cpuid = -1; 698 iucv_cpuid = -1;
diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c
index b452cc1afd55..5d6e6cbfa360 100644
--- a/drivers/s390/net/netiucv.c
+++ b/drivers/s390/net/netiucv.c
@@ -2029,7 +2029,7 @@ remove_write (struct device_driver *drv, const char *buf, size_t count)
2029 count = IFNAMSIZ-1; 2029 count = IFNAMSIZ-1;
2030 2030
2031 for (i=0, p=(char *)buf; i<count && *p; i++, p++) { 2031 for (i=0, p=(char *)buf; i<count && *p; i++, p++) {
2032 if ((*p == '\n') | (*p == ' ')) { 2032 if ((*p == '\n') || (*p == ' ')) {
2033 /* trailing lf, grr */ 2033 /* trailing lf, grr */
2034 break; 2034 break;
2035 } else { 2035 } else {
diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c
index 8e8963f15731..5fff1f93973a 100644
--- a/drivers/s390/net/qeth_main.c
+++ b/drivers/s390/net/qeth_main.c
@@ -4420,8 +4420,10 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb)
4420 enum qeth_large_send_types large_send = QETH_LARGE_SEND_NO; 4420 enum qeth_large_send_types large_send = QETH_LARGE_SEND_NO;
4421 struct qeth_eddp_context *ctx = NULL; 4421 struct qeth_eddp_context *ctx = NULL;
4422 int tx_bytes = skb->len; 4422 int tx_bytes = skb->len;
4423#ifdef CONFIG_QETH_PERF_STATS
4423 unsigned short nr_frags = skb_shinfo(skb)->nr_frags; 4424 unsigned short nr_frags = skb_shinfo(skb)->nr_frags;
4424 unsigned short tso_size = skb_shinfo(skb)->gso_size; 4425 unsigned short tso_size = skb_shinfo(skb)->gso_size;
4426#endif
4425 int rc; 4427 int rc;
4426 4428
4427 QETH_DBF_TEXT(trace, 6, "sendpkt"); 4429 QETH_DBF_TEXT(trace, 6, "sendpkt");
@@ -4457,7 +4459,7 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb)
4457 queue = card->qdio.out_qs 4459 queue = card->qdio.out_qs
4458 [qeth_get_priority_queue(card, skb, ipv, cast_type)]; 4460 [qeth_get_priority_queue(card, skb, ipv, cast_type)];
4459 4461
4460 if (skb_shinfo(skb)->gso_size) 4462 if (skb_is_gso(skb))
4461 large_send = card->options.large_send; 4463 large_send = card->options.large_send;
4462 4464
4463 /*are we able to do TSO ? If so ,prepare and send it from here */ 4465 /*are we able to do TSO ? If so ,prepare and send it from here */
@@ -4802,7 +4804,7 @@ static struct qeth_cmd_buffer *
4802qeth_get_setassparms_cmd(struct qeth_card *, enum qeth_ipa_funcs, 4804qeth_get_setassparms_cmd(struct qeth_card *, enum qeth_ipa_funcs,
4803 __u16, __u16, enum qeth_prot_versions); 4805 __u16, __u16, enum qeth_prot_versions);
4804static int 4806static int
4805qeth_arp_query(struct qeth_card *card, char *udata) 4807qeth_arp_query(struct qeth_card *card, char __user *udata)
4806{ 4808{
4807 struct qeth_cmd_buffer *iob; 4809 struct qeth_cmd_buffer *iob;
4808 struct qeth_arp_query_info qinfo = {0, }; 4810 struct qeth_arp_query_info qinfo = {0, };
@@ -4935,7 +4937,7 @@ qeth_get_adapter_cmd(struct qeth_card *card, __u32 command, __u32 cmdlen)
4935 * function to send SNMP commands to OSA-E card 4937 * function to send SNMP commands to OSA-E card
4936 */ 4938 */
4937static int 4939static int
4938qeth_snmp_command(struct qeth_card *card, char *udata) 4940qeth_snmp_command(struct qeth_card *card, char __user *udata)
4939{ 4941{
4940 struct qeth_cmd_buffer *iob; 4942 struct qeth_cmd_buffer *iob;
4941 struct qeth_ipa_cmd *cmd; 4943 struct qeth_ipa_cmd *cmd;
@@ -7907,9 +7909,9 @@ qeth_set_online(struct ccwgroup_device *gdev)
7907} 7909}
7908 7910
7909static struct ccw_device_id qeth_ids[] = { 7911static struct ccw_device_id qeth_ids[] = {
7910 {CCW_DEVICE(0x1731, 0x01), driver_info:QETH_CARD_TYPE_OSAE}, 7912 {CCW_DEVICE(0x1731, 0x01), .driver_info = QETH_CARD_TYPE_OSAE},
7911 {CCW_DEVICE(0x1731, 0x05), driver_info:QETH_CARD_TYPE_IQD}, 7913 {CCW_DEVICE(0x1731, 0x05), .driver_info = QETH_CARD_TYPE_IQD},
7912 {CCW_DEVICE(0x1731, 0x06), driver_info:QETH_CARD_TYPE_OSN}, 7914 {CCW_DEVICE(0x1731, 0x06), .driver_info = QETH_CARD_TYPE_OSN},
7913 {}, 7915 {},
7914}; 7916};
7915MODULE_DEVICE_TABLE(ccw, qeth_ids); 7917MODULE_DEVICE_TABLE(ccw, qeth_ids);
@@ -8378,7 +8380,7 @@ out:
8378 8380
8379static struct notifier_block qeth_ip_notifier = { 8381static struct notifier_block qeth_ip_notifier = {
8380 qeth_ip_event, 8382 qeth_ip_event,
8381 0 8383 NULL,
8382}; 8384};
8383 8385
8384#ifdef CONFIG_QETH_IPV6 8386#ifdef CONFIG_QETH_IPV6
@@ -8431,7 +8433,7 @@ out:
8431 8433
8432static struct notifier_block qeth_ip6_notifier = { 8434static struct notifier_block qeth_ip6_notifier = {
8433 qeth_ip6_event, 8435 qeth_ip6_event,
8434 0 8436 NULL,
8435}; 8437};
8436#endif 8438#endif
8437 8439
@@ -8449,16 +8451,17 @@ __qeth_reboot_event_card(struct device *dev, void *data)
8449static int 8451static int
8450qeth_reboot_event(struct notifier_block *this, unsigned long event, void *ptr) 8452qeth_reboot_event(struct notifier_block *this, unsigned long event, void *ptr)
8451{ 8453{
8454 int ret;
8452 8455
8453 driver_for_each_device(&qeth_ccwgroup_driver.driver, NULL, NULL, 8456 ret = driver_for_each_device(&qeth_ccwgroup_driver.driver, NULL, NULL,
8454 __qeth_reboot_event_card); 8457 __qeth_reboot_event_card);
8455 return NOTIFY_DONE; 8458 return ret ? NOTIFY_BAD : NOTIFY_DONE;
8456} 8459}
8457 8460
8458 8461
8459static struct notifier_block qeth_reboot_notifier = { 8462static struct notifier_block qeth_reboot_notifier = {
8460 qeth_reboot_event, 8463 qeth_reboot_event,
8461 0 8464 NULL,
8462}; 8465};
8463 8466
8464static int 8467static int
diff --git a/drivers/s390/net/qeth_sys.c b/drivers/s390/net/qeth_sys.c
index 185a9cfbcbdc..001497bbea16 100644
--- a/drivers/s390/net/qeth_sys.c
+++ b/drivers/s390/net/qeth_sys.c
@@ -1755,7 +1755,7 @@ qeth_driver_group_store(struct device_driver *ddrv, const char *buf,
1755} 1755}
1756 1756
1757 1757
1758static DRIVER_ATTR(group, 0200, 0, qeth_driver_group_store); 1758static DRIVER_ATTR(group, 0200, NULL, qeth_driver_group_store);
1759 1759
1760static ssize_t 1760static ssize_t
1761qeth_driver_notifier_register_store(struct device_driver *ddrv, const char *buf, 1761qeth_driver_notifier_register_store(struct device_driver *ddrv, const char *buf,
@@ -1783,7 +1783,7 @@ qeth_driver_notifier_register_store(struct device_driver *ddrv, const char *buf,
1783 return count; 1783 return count;
1784} 1784}
1785 1785
1786static DRIVER_ATTR(notifier_register, 0200, 0, 1786static DRIVER_ATTR(notifier_register, 0200, NULL,
1787 qeth_driver_notifier_register_store); 1787 qeth_driver_notifier_register_store);
1788 1788
1789int 1789int
diff --git a/drivers/s390/net/smsgiucv.c b/drivers/s390/net/smsgiucv.c
index 72118ee68954..b8179c27ceb6 100644
--- a/drivers/s390/net/smsgiucv.c
+++ b/drivers/s390/net/smsgiucv.c
@@ -66,7 +66,7 @@ smsg_message_pending(iucv_MessagePending *eib, void *pgm_data)
66 return; 66 return;
67 } 67 }
68 rc = iucv_receive(eib->ippathid, eib->ipmsgid, eib->iptrgcls, 68 rc = iucv_receive(eib->ippathid, eib->ipmsgid, eib->iptrgcls,
69 msg, len, 0, 0, 0); 69 msg, len, NULL, NULL, NULL);
70 if (rc == 0) { 70 if (rc == 0) {
71 msg[len] = 0; 71 msg[len] = 0;
72 EBCASC(msg, len); 72 EBCASC(msg, len);
@@ -122,7 +122,7 @@ smsg_unregister_callback(char *prefix, void (*callback)(char *from, char *str))
122 struct smsg_callback *cb, *tmp; 122 struct smsg_callback *cb, *tmp;
123 123
124 spin_lock(&smsg_list_lock); 124 spin_lock(&smsg_list_lock);
125 cb = 0; 125 cb = NULL;
126 list_for_each_entry(tmp, &smsg_list, list) 126 list_for_each_entry(tmp, &smsg_list, list)
127 if (tmp->callback == callback && 127 if (tmp->callback == callback &&
128 strcmp(tmp->prefix, prefix) == 0) { 128 strcmp(tmp->prefix, prefix) == 0) {
@@ -139,7 +139,7 @@ smsg_exit(void)
139{ 139{
140 if (smsg_handle > 0) { 140 if (smsg_handle > 0) {
141 cpcmd("SET SMSG OFF", NULL, 0, NULL); 141 cpcmd("SET SMSG OFF", NULL, 0, NULL);
142 iucv_sever(smsg_pathid, 0); 142 iucv_sever(smsg_pathid, NULL);
143 iucv_unregister_program(smsg_handle); 143 iucv_unregister_program(smsg_handle);
144 driver_unregister(&smsg_driver); 144 driver_unregister(&smsg_driver);
145 } 145 }
@@ -162,19 +162,19 @@ smsg_init(void)
162 return rc; 162 return rc;
163 } 163 }
164 smsg_handle = iucv_register_program("SMSGIUCV ", "*MSG ", 164 smsg_handle = iucv_register_program("SMSGIUCV ", "*MSG ",
165 pgmmask, &smsg_ops, 0); 165 pgmmask, &smsg_ops, NULL);
166 if (!smsg_handle) { 166 if (!smsg_handle) {
167 printk(KERN_ERR "SMSGIUCV: failed to register to iucv"); 167 printk(KERN_ERR "SMSGIUCV: failed to register to iucv");
168 driver_unregister(&smsg_driver); 168 driver_unregister(&smsg_driver);
169 return -EIO; /* better errno ? */ 169 return -EIO; /* better errno ? */
170 } 170 }
171 rc = iucv_connect (&smsg_pathid, 255, 0, "*MSG ", 0, 0, 0, 0, 171 rc = iucv_connect (&smsg_pathid, 255, NULL, "*MSG ", NULL, 0,
172 smsg_handle, 0); 172 NULL, NULL, smsg_handle, NULL);
173 if (rc) { 173 if (rc) {
174 printk(KERN_ERR "SMSGIUCV: failed to connect to *MSG"); 174 printk(KERN_ERR "SMSGIUCV: failed to connect to *MSG");
175 iucv_unregister_program(smsg_handle); 175 iucv_unregister_program(smsg_handle);
176 driver_unregister(&smsg_driver); 176 driver_unregister(&smsg_driver);
177 smsg_handle = 0; 177 smsg_handle = NULL;
178 return -EIO; 178 return -EIO;
179 } 179 }
180 cpcmd("SET SMSG IUCV", NULL, 0, NULL); 180 cpcmd("SET SMSG IUCV", NULL, 0, NULL);
diff --git a/drivers/s390/s390mach.c b/drivers/s390/s390mach.c
index ffb3677e354f..5399c5d99b81 100644
--- a/drivers/s390/s390mach.c
+++ b/drivers/s390/s390mach.c
@@ -111,6 +111,16 @@ repeat:
111 break; 111 break;
112 case CRW_RSC_CPATH: 112 case CRW_RSC_CPATH:
113 pr_debug("source is channel path %02X\n", crw[0].rsid); 113 pr_debug("source is channel path %02X\n", crw[0].rsid);
114 /*
115 * Check for solicited machine checks. These are
116 * created by reset channel path and need not be
117 * reported to the common I/O layer.
118 */
119 if (crw[chain].slct) {
120 DBG(KERN_INFO"solicited machine check for "
121 "channel path %02X\n", crw[0].rsid);
122 break;
123 }
114 switch (crw[0].erc) { 124 switch (crw[0].erc) {
115 case CRW_ERC_IPARM: /* Path has come. */ 125 case CRW_ERC_IPARM: /* Path has come. */
116 ret = chp_process_crw(crw[0].rsid, 1); 126 ret = chp_process_crw(crw[0].rsid, 1);
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index 6335f9229184..31db2b06faba 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -2227,7 +2227,7 @@ zfcp_fsf_exchange_port_data(struct zfcp_erp_action *erp_action,
2227 /* setup new FSF request */ 2227 /* setup new FSF request */
2228 retval = zfcp_fsf_req_create(adapter, FSF_QTCB_EXCHANGE_PORT_DATA, 2228 retval = zfcp_fsf_req_create(adapter, FSF_QTCB_EXCHANGE_PORT_DATA,
2229 erp_action ? ZFCP_REQ_AUTO_CLEANUP : 0, 2229 erp_action ? ZFCP_REQ_AUTO_CLEANUP : 0,
2230 0, &lock_flags, &fsf_req); 2230 NULL, &lock_flags, &fsf_req);
2231 if (retval < 0) { 2231 if (retval < 0) {
2232 ZFCP_LOG_INFO("error: Out of resources. Could not create an " 2232 ZFCP_LOG_INFO("error: Out of resources. Could not create an "
2233 "exchange port data request for" 2233 "exchange port data request for"
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c
index 46e14f22ec18..671f4a6a5d18 100644
--- a/drivers/s390/scsi/zfcp_scsi.c
+++ b/drivers/s390/scsi/zfcp_scsi.c
@@ -44,30 +44,29 @@ struct scsi_transport_template *zfcp_transport_template;
44 44
45struct zfcp_data zfcp_data = { 45struct zfcp_data zfcp_data = {
46 .scsi_host_template = { 46 .scsi_host_template = {
47 name: ZFCP_NAME, 47 .name = ZFCP_NAME,
48 proc_name: "zfcp", 48 .proc_name = "zfcp",
49 proc_info: NULL, 49 .proc_info = NULL,
50 detect: NULL, 50 .detect = NULL,
51 slave_alloc: zfcp_scsi_slave_alloc, 51 .slave_alloc = zfcp_scsi_slave_alloc,
52 slave_configure: zfcp_scsi_slave_configure, 52 .slave_configure = zfcp_scsi_slave_configure,
53 slave_destroy: zfcp_scsi_slave_destroy, 53 .slave_destroy = zfcp_scsi_slave_destroy,
54 queuecommand: zfcp_scsi_queuecommand, 54 .queuecommand = zfcp_scsi_queuecommand,
55 eh_abort_handler: zfcp_scsi_eh_abort_handler, 55 .eh_abort_handler = zfcp_scsi_eh_abort_handler,
56 eh_device_reset_handler: zfcp_scsi_eh_device_reset_handler, 56 .eh_device_reset_handler = zfcp_scsi_eh_device_reset_handler,
57 eh_bus_reset_handler: zfcp_scsi_eh_bus_reset_handler, 57 .eh_bus_reset_handler = zfcp_scsi_eh_bus_reset_handler,
58 eh_host_reset_handler: zfcp_scsi_eh_host_reset_handler, 58 .eh_host_reset_handler = zfcp_scsi_eh_host_reset_handler,
59 /* FIXME(openfcp): Tune */ 59 .can_queue = 4096,
60 can_queue: 4096, 60 .this_id = -1,
61 this_id: -1, 61 /*
62 /* 62 * FIXME:
63 * FIXME: 63 * one less? can zfcp_create_sbale cope with it?
64 * one less? can zfcp_create_sbale cope with it? 64 */
65 */ 65 .sg_tablesize = ZFCP_MAX_SBALES_PER_REQ,
66 sg_tablesize: ZFCP_MAX_SBALES_PER_REQ, 66 .cmd_per_lun = 1,
67 cmd_per_lun: 1, 67 .unchecked_isa_dma = 0,
68 unchecked_isa_dma: 0, 68 .use_clustering = 1,
69 use_clustering: 1, 69 .sdev_attrs = zfcp_sysfs_sdev_attrs,
70 sdev_attrs: zfcp_sysfs_sdev_attrs,
71 }, 70 },
72 .driver_version = ZFCP_VERSION, 71 .driver_version = ZFCP_VERSION,
73 /* rest initialised with zeros */ 72 /* rest initialised with zeros */
diff --git a/drivers/sbus/sbus.c b/drivers/sbus/sbus.c
index 16b59773c0bb..935952ef88f1 100644
--- a/drivers/sbus/sbus.c
+++ b/drivers/sbus/sbus.c
@@ -233,7 +233,7 @@ static void __init build_one_sbus(struct device_node *dp, int num_sbus)
233 sbus->ofdev.node = dp; 233 sbus->ofdev.node = dp;
234 sbus->ofdev.dev.parent = NULL; 234 sbus->ofdev.dev.parent = NULL;
235 sbus->ofdev.dev.bus = &sbus_bus_type; 235 sbus->ofdev.dev.bus = &sbus_bus_type;
236 strcpy(sbus->ofdev.dev.bus_id, dp->path_component_name); 236 sprintf(sbus->ofdev.dev.bus_id, "sbus%d", num_sbus);
237 237
238 if (of_device_register(&sbus->ofdev) != 0) 238 if (of_device_register(&sbus->ofdev) != 0)
239 printk(KERN_DEBUG "sbus: device registration error for %s!\n", 239 printk(KERN_DEBUG "sbus: device registration error for %s!\n",
diff --git a/drivers/scsi/53c7xx.c b/drivers/scsi/53c7xx.c
index c690c2b89e41..acf292736b4e 100644
--- a/drivers/scsi/53c7xx.c
+++ b/drivers/scsi/53c7xx.c
@@ -3451,12 +3451,12 @@ create_cmd (Scsi_Cmnd *cmd) {
3451 for (i = 0; cmd->use_sg ? (i < cmd->use_sg) : !i; cmd_datain += 4, 3451 for (i = 0; cmd->use_sg ? (i < cmd->use_sg) : !i; cmd_datain += 4,
3452 cmd_dataout += 4, ++i) { 3452 cmd_dataout += 4, ++i) {
3453 u32 vbuf = cmd->use_sg 3453 u32 vbuf = cmd->use_sg
3454 ? (u32)page_address(((struct scatterlist *)cmd->buffer)[i].page)+ 3454 ? (u32)page_address(((struct scatterlist *)cmd->request_buffer)[i].page)+
3455 ((struct scatterlist *)cmd->buffer)[i].offset 3455 ((struct scatterlist *)cmd->request_buffer)[i].offset
3456 : (u32)(cmd->request_buffer); 3456 : (u32)(cmd->request_buffer);
3457 u32 bbuf = virt_to_bus((void *)vbuf); 3457 u32 bbuf = virt_to_bus((void *)vbuf);
3458 u32 count = cmd->use_sg ? 3458 u32 count = cmd->use_sg ?
3459 ((struct scatterlist *)cmd->buffer)[i].length : 3459 ((struct scatterlist *)cmd->request_buffer)[i].length :
3460 cmd->request_bufflen; 3460 cmd->request_bufflen;
3461 3461
3462 /* 3462 /*
@@ -5417,7 +5417,7 @@ insn_to_offset (Scsi_Cmnd *cmd, u32 *insn) {
5417 5417
5418 if ((buffers = cmd->use_sg)) { 5418 if ((buffers = cmd->use_sg)) {
5419 for (offset = 0, 5419 for (offset = 0,
5420 segment = (struct scatterlist *) cmd->buffer; 5420 segment = (struct scatterlist *) cmd->request_buffer;
5421 buffers && !((found = ((ptr >= (char *)page_address(segment->page)+segment->offset) && 5421 buffers && !((found = ((ptr >= (char *)page_address(segment->page)+segment->offset) &&
5422 (ptr < ((char *)page_address(segment->page)+segment->offset+segment->length))))); 5422 (ptr < ((char *)page_address(segment->page)+segment->offset+segment->length)))));
5423 --buffers, offset += segment->length, ++segment) 5423 --buffers, offset += segment->length, ++segment)
diff --git a/drivers/scsi/NCR53C9x.c b/drivers/scsi/NCR53C9x.c
index 8a4659e94105..bdc6bb262bce 100644
--- a/drivers/scsi/NCR53C9x.c
+++ b/drivers/scsi/NCR53C9x.c
@@ -911,7 +911,7 @@ static void esp_get_dmabufs(struct NCR_ESP *esp, Scsi_Cmnd *sp)
911 sp->SCp.ptr = 911 sp->SCp.ptr =
912 (char *) virt_to_phys(sp->request_buffer); 912 (char *) virt_to_phys(sp->request_buffer);
913 } else { 913 } else {
914 sp->SCp.buffer = (struct scatterlist *) sp->buffer; 914 sp->SCp.buffer = (struct scatterlist *) sp->request_buffer;
915 sp->SCp.buffers_residual = sp->use_sg - 1; 915 sp->SCp.buffers_residual = sp->use_sg - 1;
916 sp->SCp.this_residual = sp->SCp.buffer->length; 916 sp->SCp.this_residual = sp->SCp.buffer->length;
917 if (esp->dma_mmu_get_scsi_sgl) 917 if (esp->dma_mmu_get_scsi_sgl)
@@ -2152,29 +2152,23 @@ static int esp_do_data_finale(struct NCR_ESP *esp,
2152 */ 2152 */
2153static int esp_should_clear_sync(Scsi_Cmnd *sp) 2153static int esp_should_clear_sync(Scsi_Cmnd *sp)
2154{ 2154{
2155 unchar cmd1 = sp->cmnd[0]; 2155 unchar cmd = sp->cmnd[0];
2156 unchar cmd2 = sp->data_cmnd[0];
2157 2156
2158 /* These cases are for spinning up a disk and 2157 /* These cases are for spinning up a disk and
2159 * waiting for that spinup to complete. 2158 * waiting for that spinup to complete.
2160 */ 2159 */
2161 if(cmd1 == START_STOP || 2160 if(cmd == START_STOP)
2162 cmd2 == START_STOP)
2163 return 0; 2161 return 0;
2164 2162
2165 if(cmd1 == TEST_UNIT_READY || 2163 if(cmd == TEST_UNIT_READY)
2166 cmd2 == TEST_UNIT_READY)
2167 return 0; 2164 return 0;
2168 2165
2169 /* One more special case for SCSI tape drives, 2166 /* One more special case for SCSI tape drives,
2170 * this is what is used to probe the device for 2167 * this is what is used to probe the device for
2171 * completion of a rewind or tape load operation. 2168 * completion of a rewind or tape load operation.
2172 */ 2169 */
2173 if(sp->device->type == TYPE_TAPE) { 2170 if(sp->device->type == TYPE_TAPE && cmd == MODE_SENSE)
2174 if(cmd1 == MODE_SENSE || 2171 return 0;
2175 cmd2 == MODE_SENSE)
2176 return 0;
2177 }
2178 2172
2179 return 1; 2173 return 1;
2180} 2174}
diff --git a/drivers/scsi/NCR_D700.c b/drivers/scsi/NCR_D700.c
index a06f547e87f7..d05681f9d81a 100644
--- a/drivers/scsi/NCR_D700.c
+++ b/drivers/scsi/NCR_D700.c
@@ -114,7 +114,7 @@ MODULE_DESCRIPTION("NCR Dual700 SCSI Driver");
114MODULE_LICENSE("GPL"); 114MODULE_LICENSE("GPL");
115module_param(NCR_D700, charp, 0); 115module_param(NCR_D700, charp, 0);
116 116
117static __u8 __initdata id_array[2*(MCA_MAX_SLOT_NR + 1)] = 117static __u8 __devinitdata id_array[2*(MCA_MAX_SLOT_NR + 1)] =
118 { [0 ... 2*(MCA_MAX_SLOT_NR + 1)-1] = 7 }; 118 { [0 ... 2*(MCA_MAX_SLOT_NR + 1)-1] = 7 };
119 119
120#ifdef MODULE 120#ifdef MODULE
@@ -173,7 +173,7 @@ struct NCR_D700_private {
173 char pad; 173 char pad;
174}; 174};
175 175
176static int 176static int __devinit
177NCR_D700_probe_one(struct NCR_D700_private *p, int siop, int irq, 177NCR_D700_probe_one(struct NCR_D700_private *p, int siop, int irq,
178 int slot, u32 region, int differential) 178 int slot, u32 region, int differential)
179{ 179{
@@ -243,7 +243,7 @@ NCR_D700_intr(int irq, void *data, struct pt_regs *regs)
243 * essentially connectecd to the MCA bus independently, it is easier 243 * essentially connectecd to the MCA bus independently, it is easier
244 * to set them up as two separate host adapters, rather than one 244 * to set them up as two separate host adapters, rather than one
245 * adapter with two channels */ 245 * adapter with two channels */
246static int 246static int __devinit
247NCR_D700_probe(struct device *dev) 247NCR_D700_probe(struct device *dev)
248{ 248{
249 struct NCR_D700_private *p; 249 struct NCR_D700_private *p;
@@ -329,7 +329,7 @@ NCR_D700_probe(struct device *dev)
329 for (i = 0; i < 2; i++) { 329 for (i = 0; i < 2; i++) {
330 int err; 330 int err;
331 331
332 if ((err = NCR_D700_probe_one(p, i, slot, irq, 332 if ((err = NCR_D700_probe_one(p, i, irq, slot,
333 offset_addr + (0x80 * i), 333 offset_addr + (0x80 * i),
334 differential)) != 0) 334 differential)) != 0)
335 printk("D700: SIOP%d: probe failed, error = %d\n", 335 printk("D700: SIOP%d: probe failed, error = %d\n",
@@ -349,7 +349,7 @@ NCR_D700_probe(struct device *dev)
349 return 0; 349 return 0;
350} 350}
351 351
352static void 352static void __devexit
353NCR_D700_remove_one(struct Scsi_Host *host) 353NCR_D700_remove_one(struct Scsi_Host *host)
354{ 354{
355 scsi_remove_host(host); 355 scsi_remove_host(host);
@@ -359,7 +359,7 @@ NCR_D700_remove_one(struct Scsi_Host *host)
359 release_region(host->base, 64); 359 release_region(host->base, 64);
360} 360}
361 361
362static int 362static int __devexit
363NCR_D700_remove(struct device *dev) 363NCR_D700_remove(struct device *dev)
364{ 364{
365 struct NCR_D700_private *p = dev_get_drvdata(dev); 365 struct NCR_D700_private *p = dev_get_drvdata(dev);
@@ -380,7 +380,7 @@ static struct mca_driver NCR_D700_driver = {
380 .name = "NCR_D700", 380 .name = "NCR_D700",
381 .bus = &mca_bus_type, 381 .bus = &mca_bus_type,
382 .probe = NCR_D700_probe, 382 .probe = NCR_D700_probe,
383 .remove = NCR_D700_remove, 383 .remove = __devexit_p(NCR_D700_remove),
384 }, 384 },
385}; 385};
386 386
diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c
index 36e63f82d9f8..f974869ea323 100644
--- a/drivers/scsi/aha152x.c
+++ b/drivers/scsi/aha152x.c
@@ -551,6 +551,11 @@ struct aha152x_hostdata {
551struct aha152x_scdata { 551struct aha152x_scdata {
552 Scsi_Cmnd *next; /* next sc in queue */ 552 Scsi_Cmnd *next; /* next sc in queue */
553 struct semaphore *sem; /* semaphore to block on */ 553 struct semaphore *sem; /* semaphore to block on */
554 unsigned char cmd_len;
555 unsigned char cmnd[MAX_COMMAND_SIZE];
556 unsigned short use_sg;
557 unsigned request_bufflen;
558 void *request_buffer;
554}; 559};
555 560
556 561
@@ -1006,11 +1011,20 @@ static int aha152x_internal_queue(Scsi_Cmnd *SCpnt, struct semaphore *sem, int p
1006 return FAILED; 1011 return FAILED;
1007 } 1012 }
1008 } else { 1013 } else {
1014 struct aha152x_scdata *sc;
1015
1009 SCpnt->host_scribble = kmalloc(sizeof(struct aha152x_scdata), GFP_ATOMIC); 1016 SCpnt->host_scribble = kmalloc(sizeof(struct aha152x_scdata), GFP_ATOMIC);
1010 if(SCpnt->host_scribble==0) { 1017 if(SCpnt->host_scribble==0) {
1011 printk(ERR_LEAD "allocation failed\n", CMDINFO(SCpnt)); 1018 printk(ERR_LEAD "allocation failed\n", CMDINFO(SCpnt));
1012 return FAILED; 1019 return FAILED;
1013 } 1020 }
1021
1022 sc = SCDATA(SCpnt);
1023 memcpy(sc->cmnd, SCpnt->cmnd, sizeof(sc->cmnd));
1024 sc->request_buffer = SCpnt->request_buffer;
1025 sc->request_bufflen = SCpnt->request_bufflen;
1026 sc->use_sg = SCpnt->use_sg;
1027 sc->cmd_len = SCpnt->cmd_len;
1014 } 1028 }
1015 1029
1016 SCNEXT(SCpnt) = NULL; 1030 SCNEXT(SCpnt) = NULL;
@@ -1165,6 +1179,10 @@ static int aha152x_device_reset(Scsi_Cmnd * SCpnt)
1165 DECLARE_MUTEX_LOCKED(sem); 1179 DECLARE_MUTEX_LOCKED(sem);
1166 struct timer_list timer; 1180 struct timer_list timer;
1167 int ret, issued, disconnected; 1181 int ret, issued, disconnected;
1182 unsigned char old_cmd_len = SCpnt->cmd_len;
1183 unsigned short old_use_sg = SCpnt->use_sg;
1184 void *old_buffer = SCpnt->request_buffer;
1185 unsigned old_bufflen = SCpnt->request_bufflen;
1168 unsigned long flags; 1186 unsigned long flags;
1169 1187
1170#if defined(AHA152X_DEBUG) 1188#if defined(AHA152X_DEBUG)
@@ -1198,11 +1216,11 @@ static int aha152x_device_reset(Scsi_Cmnd * SCpnt)
1198 add_timer(&timer); 1216 add_timer(&timer);
1199 down(&sem); 1217 down(&sem);
1200 del_timer(&timer); 1218 del_timer(&timer);
1201 1219
1202 SCpnt->cmd_len = SCpnt->old_cmd_len; 1220 SCpnt->cmd_len = old_cmd_len;
1203 SCpnt->use_sg = SCpnt->old_use_sg; 1221 SCpnt->use_sg = old_use_sg;
1204 SCpnt->request_buffer = SCpnt->buffer; 1222 SCpnt->request_buffer = old_buffer;
1205 SCpnt->request_bufflen = SCpnt->bufflen; 1223 SCpnt->request_bufflen = old_bufflen;
1206 1224
1207 DO_LOCK(flags); 1225 DO_LOCK(flags);
1208 1226
@@ -1565,6 +1583,9 @@ static void busfree_run(struct Scsi_Host *shpnt)
1565#endif 1583#endif
1566 1584
1567 if(DONE_SC->SCp.phase & check_condition) { 1585 if(DONE_SC->SCp.phase & check_condition) {
1586 struct scsi_cmnd *cmd = HOSTDATA(shpnt)->done_SC;
1587 struct aha152x_scdata *sc = SCDATA(cmd);
1588
1568#if 0 1589#if 0
1569 if(HOSTDATA(shpnt)->debug & debug_eh) { 1590 if(HOSTDATA(shpnt)->debug & debug_eh) {
1570 printk(ERR_LEAD "received sense: ", CMDINFO(DONE_SC)); 1591 printk(ERR_LEAD "received sense: ", CMDINFO(DONE_SC));
@@ -1573,13 +1594,13 @@ static void busfree_run(struct Scsi_Host *shpnt)
1573#endif 1594#endif
1574 1595
1575 /* restore old command */ 1596 /* restore old command */
1576 memcpy((void *) DONE_SC->cmnd, (void *) DONE_SC->data_cmnd, sizeof(DONE_SC->data_cmnd)); 1597 memcpy(cmd->cmnd, sc->cmnd, sizeof(sc->cmnd));
1577 DONE_SC->request_buffer = DONE_SC->buffer; 1598 cmd->request_buffer = sc->request_buffer;
1578 DONE_SC->request_bufflen = DONE_SC->bufflen; 1599 cmd->request_bufflen = sc->request_bufflen;
1579 DONE_SC->use_sg = DONE_SC->old_use_sg; 1600 cmd->use_sg = sc->use_sg;
1580 DONE_SC->cmd_len = DONE_SC->old_cmd_len; 1601 cmd->cmd_len = sc->cmd_len;
1581 1602
1582 DONE_SC->SCp.Status = 0x02; 1603 cmd->SCp.Status = 0x02;
1583 1604
1584 HOSTDATA(shpnt)->commands--; 1605 HOSTDATA(shpnt)->commands--;
1585 if (!HOSTDATA(shpnt)->commands) 1606 if (!HOSTDATA(shpnt)->commands)
diff --git a/drivers/scsi/ahci.c b/drivers/scsi/ahci.c
index 15f6cd4279b7..904c25fb4ba4 100644
--- a/drivers/scsi/ahci.c
+++ b/drivers/scsi/ahci.c
@@ -940,14 +940,8 @@ static void ahci_host_intr(struct ata_port *ap)
940 return; 940 return;
941 941
942 /* ignore interim PIO setup fis interrupts */ 942 /* ignore interim PIO setup fis interrupts */
943 if (ata_tag_valid(ap->active_tag)) { 943 if (ata_tag_valid(ap->active_tag) && (status & PORT_IRQ_PIOS_FIS))
944 struct ata_queued_cmd *qc = 944 return;
945 ata_qc_from_tag(ap, ap->active_tag);
946
947 if (qc && qc->tf.protocol == ATA_PROT_PIO &&
948 (status & PORT_IRQ_PIOS_FIS))
949 return;
950 }
951 945
952 if (ata_ratelimit()) 946 if (ata_ratelimit())
953 ata_port_printk(ap, KERN_INFO, "spurious interrupt " 947 ata_port_printk(ap, KERN_INFO, "spurious interrupt "
@@ -1052,7 +1046,7 @@ static void ahci_thaw(struct ata_port *ap)
1052 1046
1053static void ahci_error_handler(struct ata_port *ap) 1047static void ahci_error_handler(struct ata_port *ap)
1054{ 1048{
1055 if (!(ap->flags & ATA_FLAG_FROZEN)) { 1049 if (!(ap->pflags & ATA_PFLAG_FROZEN)) {
1056 /* restart engine */ 1050 /* restart engine */
1057 ahci_stop_engine(ap); 1051 ahci_stop_engine(ap);
1058 ahci_start_engine(ap); 1052 ahci_start_engine(ap);
@@ -1323,6 +1317,17 @@ static int ahci_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
1323 if (!printed_version++) 1317 if (!printed_version++)
1324 dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n"); 1318 dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
1325 1319
1320 /* JMicron-specific fixup: make sure we're in AHCI mode */
1321 /* This is protected from races with ata_jmicron by the pci probe
1322 locking */
1323 if (pdev->vendor == PCI_VENDOR_ID_JMICRON) {
1324 /* AHCI enable, AHCI on function 0 */
1325 pci_write_config_byte(pdev, 0x41, 0xa1);
1326 /* Function 1 is the PATA controller */
1327 if (PCI_FUNC(pdev->devfn))
1328 return -ENODEV;
1329 }
1330
1326 rc = pci_enable_device(pdev); 1331 rc = pci_enable_device(pdev);
1327 if (rc) 1332 if (rc)
1328 return rc; 1333 return rc;
@@ -1378,10 +1383,6 @@ static int ahci_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
1378 if (have_msi) 1383 if (have_msi)
1379 hpriv->flags |= AHCI_FLAG_MSI; 1384 hpriv->flags |= AHCI_FLAG_MSI;
1380 1385
1381 /* JMicron-specific fixup: make sure we're in AHCI mode */
1382 if (pdev->vendor == 0x197b)
1383 pci_write_config_byte(pdev, 0x41, 0xa1);
1384
1385 /* initialize adapter */ 1386 /* initialize adapter */
1386 rc = ahci_host_init(probe_ent); 1387 rc = ahci_host_init(probe_ent);
1387 if (rc) 1388 if (rc)
diff --git a/drivers/scsi/aic7xxx/aic79xx_core.c b/drivers/scsi/aic7xxx/aic79xx_core.c
index a1e8ca758594..653818d2f802 100644
--- a/drivers/scsi/aic7xxx/aic79xx_core.c
+++ b/drivers/scsi/aic7xxx/aic79xx_core.c
@@ -7289,7 +7289,7 @@ ahd_reset_cmds_pending(struct ahd_softc *ahd)
7289 ahd->flags &= ~AHD_UPDATE_PEND_CMDS; 7289 ahd->flags &= ~AHD_UPDATE_PEND_CMDS;
7290} 7290}
7291 7291
7292void 7292static void
7293ahd_done_with_status(struct ahd_softc *ahd, struct scb *scb, uint32_t status) 7293ahd_done_with_status(struct ahd_softc *ahd, struct scb *scb, uint32_t status)
7294{ 7294{
7295 cam_status ostat; 7295 cam_status ostat;
diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c
index b244c7124179..998999c0a972 100644
--- a/drivers/scsi/aic7xxx/aic79xx_osm.c
+++ b/drivers/scsi/aic7xxx/aic79xx_osm.c
@@ -243,25 +243,6 @@ ahd_print_path(struct ahd_softc *ahd, struct scb *scb)
243static uint32_t aic79xx_no_reset; 243static uint32_t aic79xx_no_reset;
244 244
245/* 245/*
246 * Certain PCI motherboards will scan PCI devices from highest to lowest,
247 * others scan from lowest to highest, and they tend to do all kinds of
248 * strange things when they come into contact with PCI bridge chips. The
249 * net result of all this is that the PCI card that is actually used to boot
250 * the machine is very hard to detect. Most motherboards go from lowest
251 * PCI slot number to highest, and the first SCSI controller found is the
252 * one you boot from. The only exceptions to this are when a controller
253 * has its BIOS disabled. So, we by default sort all of our SCSI controllers
254 * from lowest PCI slot number to highest PCI slot number. We also force
255 * all controllers with their BIOS disabled to the end of the list. This
256 * works on *almost* all computers. Where it doesn't work, we have this
257 * option. Setting this option to non-0 will reverse the order of the sort
258 * to highest first, then lowest, but will still leave cards with their BIOS
259 * disabled at the very end. That should fix everyone up unless there are
260 * really strange cirumstances.
261 */
262static uint32_t aic79xx_reverse_scan;
263
264/*
265 * Should we force EXTENDED translation on a controller. 246 * Should we force EXTENDED translation on a controller.
266 * 0 == Use whatever is in the SEEPROM or default to off 247 * 0 == Use whatever is in the SEEPROM or default to off
267 * 1 == Use whatever is in the SEEPROM or default to on 248 * 1 == Use whatever is in the SEEPROM or default to on
@@ -350,7 +331,6 @@ MODULE_PARM_DESC(aic79xx,
350" periodically to prevent tag starvation.\n" 331" periodically to prevent tag starvation.\n"
351" This may be required by some older disk\n" 332" This may be required by some older disk\n"
352" or drives/RAID arrays.\n" 333" or drives/RAID arrays.\n"
353" reverse_scan Sort PCI devices highest Bus/Slot to lowest\n"
354" tag_info:<tag_str> Set per-target tag depth\n" 334" tag_info:<tag_str> Set per-target tag depth\n"
355" global_tag_depth:<int> Global tag depth for all targets on all buses\n" 335" global_tag_depth:<int> Global tag depth for all targets on all buses\n"
356" slewrate:<slewrate_list>Set the signal slew rate (0-15).\n" 336" slewrate:<slewrate_list>Set the signal slew rate (0-15).\n"
@@ -1031,7 +1011,6 @@ aic79xx_setup(char *s)
1031#ifdef AHD_DEBUG 1011#ifdef AHD_DEBUG
1032 { "debug", &ahd_debug }, 1012 { "debug", &ahd_debug },
1033#endif 1013#endif
1034 { "reverse_scan", &aic79xx_reverse_scan },
1035 { "periodic_otag", &aic79xx_periodic_otag }, 1014 { "periodic_otag", &aic79xx_periodic_otag },
1036 { "pci_parity", &aic79xx_pci_parity }, 1015 { "pci_parity", &aic79xx_pci_parity },
1037 { "seltime", &aic79xx_seltime }, 1016 { "seltime", &aic79xx_seltime },
diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.h b/drivers/scsi/aic7xxx/aic79xx_osm.h
index 9e871de23835..601340d84410 100644
--- a/drivers/scsi/aic7xxx/aic79xx_osm.h
+++ b/drivers/scsi/aic7xxx/aic79xx_osm.h
@@ -93,7 +93,6 @@
93#endif 93#endif
94 94
95/********************************** Misc Macros *******************************/ 95/********************************** Misc Macros *******************************/
96#define roundup(x, y) ((((x)+((y)-1))/(y))*(y))
97#define powerof2(x) ((((x)-1)&(x))==0) 96#define powerof2(x) ((((x)-1)&(x))==0)
98 97
99/************************* Forward Declarations *******************************/ 98/************************* Forward Declarations *******************************/
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c
index debf3e2a0798..aa4be8a31415 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c
@@ -353,7 +353,6 @@ MODULE_PARM_DESC(aic7xxx,
353" periodically to prevent tag starvation.\n" 353" periodically to prevent tag starvation.\n"
354" This may be required by some older disk\n" 354" This may be required by some older disk\n"
355" drives or RAID arrays.\n" 355" drives or RAID arrays.\n"
356" reverse_scan Sort PCI devices highest Bus/Slot to lowest\n"
357" tag_info:<tag_str> Set per-target tag depth\n" 356" tag_info:<tag_str> Set per-target tag depth\n"
358" global_tag_depth:<int> Global tag depth for every target\n" 357" global_tag_depth:<int> Global tag depth for every target\n"
359" on every bus\n" 358" on every bus\n"
diff --git a/drivers/scsi/aic7xxx/aicasm/Makefile b/drivers/scsi/aic7xxx/aicasm/Makefile
index 8c91fda6482c..b98c5c1056c3 100644
--- a/drivers/scsi/aic7xxx/aicasm/Makefile
+++ b/drivers/scsi/aic7xxx/aicasm/Makefile
@@ -14,6 +14,8 @@ LIBS= -ldb
14clean-files:= ${GENSRCS} ${GENHDRS} $(YSRCS:.y=.output) $(PROG) 14clean-files:= ${GENSRCS} ${GENHDRS} $(YSRCS:.y=.output) $(PROG)
15# Override default kernel CFLAGS. This is a userland app. 15# Override default kernel CFLAGS. This is a userland app.
16AICASM_CFLAGS:= -I/usr/include -I. 16AICASM_CFLAGS:= -I/usr/include -I.
17LEX= flex
18YACC= bison
17YFLAGS= -d 19YFLAGS= -d
18 20
19NOMAN= noman 21NOMAN= noman
diff --git a/drivers/scsi/arm/fas216.c b/drivers/scsi/arm/fas216.c
index 3e1053f111dc..4cf7afc31cc7 100644
--- a/drivers/scsi/arm/fas216.c
+++ b/drivers/scsi/arm/fas216.c
@@ -2427,7 +2427,7 @@ int fas216_eh_abort(Scsi_Cmnd *SCpnt)
2427 info->stats.aborts += 1; 2427 info->stats.aborts += 1;
2428 2428
2429 printk(KERN_WARNING "scsi%d: abort command ", info->host->host_no); 2429 printk(KERN_WARNING "scsi%d: abort command ", info->host->host_no);
2430 __scsi_print_command(SCpnt->data_cmnd); 2430 __scsi_print_command(SCpnt->cmnd);
2431 2431
2432 print_debug_list(); 2432 print_debug_list();
2433 fas216_dumpstate(info); 2433 fas216_dumpstate(info);
diff --git a/drivers/scsi/ata_piix.c b/drivers/scsi/ata_piix.c
index 94b1261a259d..19745a31072b 100644
--- a/drivers/scsi/ata_piix.c
+++ b/drivers/scsi/ata_piix.c
@@ -105,9 +105,6 @@ enum {
105 PIIX_FLAG_SCR = (1 << 26), /* SCR available */ 105 PIIX_FLAG_SCR = (1 << 26), /* SCR available */
106 PIIX_FLAG_AHCI = (1 << 27), /* AHCI possible */ 106 PIIX_FLAG_AHCI = (1 << 27), /* AHCI possible */
107 PIIX_FLAG_CHECKINTR = (1 << 28), /* make sure PCI INTx enabled */ 107 PIIX_FLAG_CHECKINTR = (1 << 28), /* make sure PCI INTx enabled */
108 PIIX_FLAG_COMBINED = (1 << 29), /* combined mode possible */
109 /* ICH6/7 use different scheme for map value */
110 PIIX_FLAG_COMBINED_ICH6 = PIIX_FLAG_COMBINED | (1 << 30),
111 108
112 /* combined mode. if set, PATA is channel 0. 109 /* combined mode. if set, PATA is channel 0.
113 * if clear, PATA is channel 1. 110 * if clear, PATA is channel 1.
@@ -126,6 +123,7 @@ enum {
126 ich6_sata = 4, 123 ich6_sata = 4,
127 ich6_sata_ahci = 5, 124 ich6_sata_ahci = 5,
128 ich6m_sata_ahci = 6, 125 ich6m_sata_ahci = 6,
126 ich8_sata_ahci = 7,
129 127
130 /* constants for mapping table */ 128 /* constants for mapping table */
131 P0 = 0, /* port 0 */ 129 P0 = 0, /* port 0 */
@@ -141,11 +139,19 @@ enum {
141 139
142struct piix_map_db { 140struct piix_map_db {
143 const u32 mask; 141 const u32 mask;
142 const u16 port_enable;
143 const int present_shift;
144 const int map[][4]; 144 const int map[][4];
145}; 145};
146 146
147struct piix_host_priv {
148 const int *map;
149 const struct piix_map_db *map_db;
150};
151
147static int piix_init_one (struct pci_dev *pdev, 152static int piix_init_one (struct pci_dev *pdev,
148 const struct pci_device_id *ent); 153 const struct pci_device_id *ent);
154static void piix_host_stop(struct ata_host_set *host_set);
149static void piix_set_piomode (struct ata_port *ap, struct ata_device *adev); 155static void piix_set_piomode (struct ata_port *ap, struct ata_device *adev);
150static void piix_set_dmamode (struct ata_port *ap, struct ata_device *adev); 156static void piix_set_dmamode (struct ata_port *ap, struct ata_device *adev);
151static void piix_pata_error_handler(struct ata_port *ap); 157static void piix_pata_error_handler(struct ata_port *ap);
@@ -186,11 +192,11 @@ static const struct pci_device_id piix_pci_tbl[] = {
186 /* Enterprise Southbridge 2 (where's the datasheet?) */ 192 /* Enterprise Southbridge 2 (where's the datasheet?) */
187 { 0x8086, 0x2680, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata_ahci }, 193 { 0x8086, 0x2680, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata_ahci },
188 /* SATA Controller 1 IDE (ICH8, no datasheet yet) */ 194 /* SATA Controller 1 IDE (ICH8, no datasheet yet) */
189 { 0x8086, 0x2820, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata_ahci }, 195 { 0x8086, 0x2820, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
190 /* SATA Controller 2 IDE (ICH8, ditto) */ 196 /* SATA Controller 2 IDE (ICH8, ditto) */
191 { 0x8086, 0x2825, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata_ahci }, 197 { 0x8086, 0x2825, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
192 /* Mobile SATA Controller IDE (ICH8M, ditto) */ 198 /* Mobile SATA Controller IDE (ICH8M, ditto) */
193 { 0x8086, 0x2828, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6m_sata_ahci }, 199 { 0x8086, 0x2828, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
194 200
195 { } /* terminate list */ 201 { } /* terminate list */
196}; 202};
@@ -254,7 +260,7 @@ static const struct ata_port_operations piix_pata_ops = {
254 260
255 .port_start = ata_port_start, 261 .port_start = ata_port_start,
256 .port_stop = ata_port_stop, 262 .port_stop = ata_port_stop,
257 .host_stop = ata_host_stop, 263 .host_stop = piix_host_stop,
258}; 264};
259 265
260static const struct ata_port_operations piix_sata_ops = { 266static const struct ata_port_operations piix_sata_ops = {
@@ -284,11 +290,13 @@ static const struct ata_port_operations piix_sata_ops = {
284 290
285 .port_start = ata_port_start, 291 .port_start = ata_port_start,
286 .port_stop = ata_port_stop, 292 .port_stop = ata_port_stop,
287 .host_stop = ata_host_stop, 293 .host_stop = piix_host_stop,
288}; 294};
289 295
290static struct piix_map_db ich5_map_db = { 296static const struct piix_map_db ich5_map_db = {
291 .mask = 0x7, 297 .mask = 0x7,
298 .port_enable = 0x3,
299 .present_shift = 4,
292 .map = { 300 .map = {
293 /* PM PS SM SS MAP */ 301 /* PM PS SM SS MAP */
294 { P0, NA, P1, NA }, /* 000b */ 302 { P0, NA, P1, NA }, /* 000b */
@@ -302,8 +310,10 @@ static struct piix_map_db ich5_map_db = {
302 }, 310 },
303}; 311};
304 312
305static struct piix_map_db ich6_map_db = { 313static const struct piix_map_db ich6_map_db = {
306 .mask = 0x3, 314 .mask = 0x3,
315 .port_enable = 0xf,
316 .present_shift = 4,
307 .map = { 317 .map = {
308 /* PM PS SM SS MAP */ 318 /* PM PS SM SS MAP */
309 { P0, P2, P1, P3 }, /* 00b */ 319 { P0, P2, P1, P3 }, /* 00b */
@@ -313,8 +323,10 @@ static struct piix_map_db ich6_map_db = {
313 }, 323 },
314}; 324};
315 325
316static struct piix_map_db ich6m_map_db = { 326static const struct piix_map_db ich6m_map_db = {
317 .mask = 0x3, 327 .mask = 0x3,
328 .port_enable = 0x5,
329 .present_shift = 4,
318 .map = { 330 .map = {
319 /* PM PS SM SS MAP */ 331 /* PM PS SM SS MAP */
320 { P0, P2, RV, RV }, /* 00b */ 332 { P0, P2, RV, RV }, /* 00b */
@@ -324,6 +336,28 @@ static struct piix_map_db ich6m_map_db = {
324 }, 336 },
325}; 337};
326 338
339static const struct piix_map_db ich8_map_db = {
340 .mask = 0x3,
341 .port_enable = 0x3,
342 .present_shift = 8,
343 .map = {
344 /* PM PS SM SS MAP */
345 { P0, NA, P1, NA }, /* 00b (hardwired) */
346 { RV, RV, RV, RV },
347 { RV, RV, RV, RV }, /* 10b (never) */
348 { RV, RV, RV, RV },
349 },
350};
351
352static const struct piix_map_db *piix_map_db_table[] = {
353 [ich5_sata] = &ich5_map_db,
354 [esb_sata] = &ich5_map_db,
355 [ich6_sata] = &ich6_map_db,
356 [ich6_sata_ahci] = &ich6_map_db,
357 [ich6m_sata_ahci] = &ich6m_map_db,
358 [ich8_sata_ahci] = &ich8_map_db,
359};
360
327static struct ata_port_info piix_port_info[] = { 361static struct ata_port_info piix_port_info[] = {
328 /* piix4_pata */ 362 /* piix4_pata */
329 { 363 {
@@ -356,63 +390,69 @@ static struct ata_port_info piix_port_info[] = {
356 /* ich5_sata */ 390 /* ich5_sata */
357 { 391 {
358 .sht = &piix_sht, 392 .sht = &piix_sht,
359 .host_flags = ATA_FLAG_SATA | PIIX_FLAG_COMBINED | 393 .host_flags = ATA_FLAG_SATA | PIIX_FLAG_CHECKINTR,
360 PIIX_FLAG_CHECKINTR,
361 .pio_mask = 0x1f, /* pio0-4 */ 394 .pio_mask = 0x1f, /* pio0-4 */
362 .mwdma_mask = 0x07, /* mwdma0-2 */ 395 .mwdma_mask = 0x07, /* mwdma0-2 */
363 .udma_mask = 0x7f, /* udma0-6 */ 396 .udma_mask = 0x7f, /* udma0-6 */
364 .port_ops = &piix_sata_ops, 397 .port_ops = &piix_sata_ops,
365 .private_data = &ich5_map_db,
366 }, 398 },
367 399
368 /* i6300esb_sata */ 400 /* i6300esb_sata */
369 { 401 {
370 .sht = &piix_sht, 402 .sht = &piix_sht,
371 .host_flags = ATA_FLAG_SATA | PIIX_FLAG_COMBINED | 403 .host_flags = ATA_FLAG_SATA |
372 PIIX_FLAG_CHECKINTR | PIIX_FLAG_IGNORE_PCS, 404 PIIX_FLAG_CHECKINTR | PIIX_FLAG_IGNORE_PCS,
373 .pio_mask = 0x1f, /* pio0-4 */ 405 .pio_mask = 0x1f, /* pio0-4 */
374 .mwdma_mask = 0x07, /* mwdma0-2 */ 406 .mwdma_mask = 0x07, /* mwdma0-2 */
375 .udma_mask = 0x7f, /* udma0-6 */ 407 .udma_mask = 0x7f, /* udma0-6 */
376 .port_ops = &piix_sata_ops, 408 .port_ops = &piix_sata_ops,
377 .private_data = &ich5_map_db,
378 }, 409 },
379 410
380 /* ich6_sata */ 411 /* ich6_sata */
381 { 412 {
382 .sht = &piix_sht, 413 .sht = &piix_sht,
383 .host_flags = ATA_FLAG_SATA | PIIX_FLAG_COMBINED_ICH6 | 414 .host_flags = ATA_FLAG_SATA |
384 PIIX_FLAG_CHECKINTR | PIIX_FLAG_SCR, 415 PIIX_FLAG_CHECKINTR | PIIX_FLAG_SCR,
385 .pio_mask = 0x1f, /* pio0-4 */ 416 .pio_mask = 0x1f, /* pio0-4 */
386 .mwdma_mask = 0x07, /* mwdma0-2 */ 417 .mwdma_mask = 0x07, /* mwdma0-2 */
387 .udma_mask = 0x7f, /* udma0-6 */ 418 .udma_mask = 0x7f, /* udma0-6 */
388 .port_ops = &piix_sata_ops, 419 .port_ops = &piix_sata_ops,
389 .private_data = &ich6_map_db,
390 }, 420 },
391 421
392 /* ich6_sata_ahci */ 422 /* ich6_sata_ahci */
393 { 423 {
394 .sht = &piix_sht, 424 .sht = &piix_sht,
395 .host_flags = ATA_FLAG_SATA | PIIX_FLAG_COMBINED_ICH6 | 425 .host_flags = ATA_FLAG_SATA |
396 PIIX_FLAG_CHECKINTR | PIIX_FLAG_SCR | 426 PIIX_FLAG_CHECKINTR | PIIX_FLAG_SCR |
397 PIIX_FLAG_AHCI, 427 PIIX_FLAG_AHCI,
398 .pio_mask = 0x1f, /* pio0-4 */ 428 .pio_mask = 0x1f, /* pio0-4 */
399 .mwdma_mask = 0x07, /* mwdma0-2 */ 429 .mwdma_mask = 0x07, /* mwdma0-2 */
400 .udma_mask = 0x7f, /* udma0-6 */ 430 .udma_mask = 0x7f, /* udma0-6 */
401 .port_ops = &piix_sata_ops, 431 .port_ops = &piix_sata_ops,
402 .private_data = &ich6_map_db,
403 }, 432 },
404 433
405 /* ich6m_sata_ahci */ 434 /* ich6m_sata_ahci */
406 { 435 {
407 .sht = &piix_sht, 436 .sht = &piix_sht,
408 .host_flags = ATA_FLAG_SATA | PIIX_FLAG_COMBINED_ICH6 | 437 .host_flags = ATA_FLAG_SATA |
438 PIIX_FLAG_CHECKINTR | PIIX_FLAG_SCR |
439 PIIX_FLAG_AHCI,
440 .pio_mask = 0x1f, /* pio0-4 */
441 .mwdma_mask = 0x07, /* mwdma0-2 */
442 .udma_mask = 0x7f, /* udma0-6 */
443 .port_ops = &piix_sata_ops,
444 },
445
446 /* ich8_sata_ahci */
447 {
448 .sht = &piix_sht,
449 .host_flags = ATA_FLAG_SATA |
409 PIIX_FLAG_CHECKINTR | PIIX_FLAG_SCR | 450 PIIX_FLAG_CHECKINTR | PIIX_FLAG_SCR |
410 PIIX_FLAG_AHCI, 451 PIIX_FLAG_AHCI,
411 .pio_mask = 0x1f, /* pio0-4 */ 452 .pio_mask = 0x1f, /* pio0-4 */
412 .mwdma_mask = 0x07, /* mwdma0-2 */ 453 .mwdma_mask = 0x07, /* mwdma0-2 */
413 .udma_mask = 0x7f, /* udma0-6 */ 454 .udma_mask = 0x7f, /* udma0-6 */
414 .port_ops = &piix_sata_ops, 455 .port_ops = &piix_sata_ops,
415 .private_data = &ich6m_map_db,
416 }, 456 },
417}; 457};
418 458
@@ -508,46 +548,29 @@ static void piix_pata_error_handler(struct ata_port *ap)
508static int piix_sata_prereset(struct ata_port *ap) 548static int piix_sata_prereset(struct ata_port *ap)
509{ 549{
510 struct pci_dev *pdev = to_pci_dev(ap->host_set->dev); 550 struct pci_dev *pdev = to_pci_dev(ap->host_set->dev);
511 const unsigned int *map = ap->host_set->private_data; 551 struct piix_host_priv *hpriv = ap->host_set->private_data;
552 const unsigned int *map = hpriv->map;
512 int base = 2 * ap->hard_port_no; 553 int base = 2 * ap->hard_port_no;
513 unsigned int present_mask = 0; 554 unsigned int present = 0;
514 int port, i; 555 int port, i;
515 u8 pcs; 556 u16 pcs;
516 557
517 pci_read_config_byte(pdev, ICH5_PCS, &pcs); 558 pci_read_config_word(pdev, ICH5_PCS, &pcs);
518 DPRINTK("ata%u: ENTER, pcs=0x%x base=%d\n", ap->id, pcs, base); 559 DPRINTK("ata%u: ENTER, pcs=0x%x base=%d\n", ap->id, pcs, base);
519 560
520 /* enable all ports on this ap and wait for them to settle */
521 for (i = 0; i < 2; i++) {
522 port = map[base + i];
523 if (port >= 0)
524 pcs |= 1 << port;
525 }
526
527 pci_write_config_byte(pdev, ICH5_PCS, pcs);
528 msleep(100);
529
530 /* let's see which devices are present */
531 pci_read_config_byte(pdev, ICH5_PCS, &pcs);
532
533 for (i = 0; i < 2; i++) { 561 for (i = 0; i < 2; i++) {
534 port = map[base + i]; 562 port = map[base + i];
535 if (port < 0) 563 if (port < 0)
536 continue; 564 continue;
537 if (ap->flags & PIIX_FLAG_IGNORE_PCS || pcs & 1 << (4 + port)) 565 if ((ap->flags & PIIX_FLAG_IGNORE_PCS) ||
538 present_mask |= 1 << i; 566 (pcs & 1 << (hpriv->map_db->present_shift + port)))
539 else 567 present = 1;
540 pcs &= ~(1 << port);
541 } 568 }
542 569
543 /* disable offline ports on non-AHCI controllers */
544 if (!(ap->flags & PIIX_FLAG_AHCI))
545 pci_write_config_byte(pdev, ICH5_PCS, pcs);
546
547 DPRINTK("ata%u: LEAVE, pcs=0x%x present_mask=0x%x\n", 570 DPRINTK("ata%u: LEAVE, pcs=0x%x present_mask=0x%x\n",
548 ap->id, pcs, present_mask); 571 ap->id, pcs, present_mask);
549 572
550 if (!present_mask) { 573 if (!present) {
551 ata_port_printk(ap, KERN_INFO, "SATA port has no device.\n"); 574 ata_port_printk(ap, KERN_INFO, "SATA port has no device.\n");
552 ap->eh_context.i.action &= ~ATA_EH_RESET_MASK; 575 ap->eh_context.i.action &= ~ATA_EH_RESET_MASK;
553 return 0; 576 return 0;
@@ -761,10 +784,27 @@ static int __devinit piix_check_450nx_errata(struct pci_dev *ata_dev)
761 return no_piix_dma; 784 return no_piix_dma;
762} 785}
763 786
787static void __devinit piix_init_pcs(struct pci_dev *pdev,
788 const struct piix_map_db *map_db)
789{
790 u16 pcs, new_pcs;
791
792 pci_read_config_word(pdev, ICH5_PCS, &pcs);
793
794 new_pcs = pcs | map_db->port_enable;
795
796 if (new_pcs != pcs) {
797 DPRINTK("updating PCS from 0x%x to 0x%x\n", pcs, new_pcs);
798 pci_write_config_word(pdev, ICH5_PCS, new_pcs);
799 msleep(150);
800 }
801}
802
764static void __devinit piix_init_sata_map(struct pci_dev *pdev, 803static void __devinit piix_init_sata_map(struct pci_dev *pdev,
765 struct ata_port_info *pinfo) 804 struct ata_port_info *pinfo,
805 const struct piix_map_db *map_db)
766{ 806{
767 struct piix_map_db *map_db = pinfo[0].private_data; 807 struct piix_host_priv *hpriv = pinfo[0].private_data;
768 const unsigned int *map; 808 const unsigned int *map;
769 int i, invalid_map = 0; 809 int i, invalid_map = 0;
770 u8 map_value; 810 u8 map_value;
@@ -805,8 +845,8 @@ static void __devinit piix_init_sata_map(struct pci_dev *pdev,
805 dev_printk(KERN_ERR, &pdev->dev, 845 dev_printk(KERN_ERR, &pdev->dev,
806 "invalid MAP value %u\n", map_value); 846 "invalid MAP value %u\n", map_value);
807 847
808 pinfo[0].private_data = (void *)map; 848 hpriv->map = map;
809 pinfo[1].private_data = (void *)map; 849 hpriv->map_db = map_db;
810} 850}
811 851
812/** 852/**
@@ -829,6 +869,7 @@ static int piix_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
829 static int printed_version; 869 static int printed_version;
830 struct ata_port_info port_info[2]; 870 struct ata_port_info port_info[2];
831 struct ata_port_info *ppinfo[2] = { &port_info[0], &port_info[1] }; 871 struct ata_port_info *ppinfo[2] = { &port_info[0], &port_info[1] };
872 struct piix_host_priv *hpriv;
832 unsigned long host_flags; 873 unsigned long host_flags;
833 874
834 if (!printed_version++) 875 if (!printed_version++)
@@ -839,8 +880,14 @@ static int piix_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
839 if (!in_module_init) 880 if (!in_module_init)
840 return -ENODEV; 881 return -ENODEV;
841 882
883 hpriv = kzalloc(sizeof(*hpriv), GFP_KERNEL);
884 if (!hpriv)
885 return -ENOMEM;
886
842 port_info[0] = piix_port_info[ent->driver_data]; 887 port_info[0] = piix_port_info[ent->driver_data];
843 port_info[1] = piix_port_info[ent->driver_data]; 888 port_info[1] = piix_port_info[ent->driver_data];
889 port_info[0].private_data = hpriv;
890 port_info[1].private_data = hpriv;
844 891
845 host_flags = port_info[0].host_flags; 892 host_flags = port_info[0].host_flags;
846 893
@@ -855,8 +902,11 @@ static int piix_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
855 } 902 }
856 903
857 /* Initialize SATA map */ 904 /* Initialize SATA map */
858 if (host_flags & ATA_FLAG_SATA) 905 if (host_flags & ATA_FLAG_SATA) {
859 piix_init_sata_map(pdev, port_info); 906 piix_init_sata_map(pdev, port_info,
907 piix_map_db_table[ent->driver_data]);
908 piix_init_pcs(pdev, piix_map_db_table[ent->driver_data]);
909 }
860 910
861 /* On ICH5, some BIOSen disable the interrupt using the 911 /* On ICH5, some BIOSen disable the interrupt using the
862 * PCI_COMMAND_INTX_DISABLE bit added in PCI 2.3. 912 * PCI_COMMAND_INTX_DISABLE bit added in PCI 2.3.
@@ -879,6 +929,13 @@ static int piix_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
879 return ata_pci_init_one(pdev, ppinfo, 2); 929 return ata_pci_init_one(pdev, ppinfo, 2);
880} 930}
881 931
932static void piix_host_stop(struct ata_host_set *host_set)
933{
934 if (host_set->next == NULL)
935 kfree(host_set->private_data);
936 ata_host_stop(host_set);
937}
938
882static int __init piix_init(void) 939static int __init piix_init(void)
883{ 940{
884 int rc; 941 int rc;
diff --git a/drivers/scsi/atari_NCR5380.c b/drivers/scsi/atari_NCR5380.c
index 007a14e5c3fd..e397129c90d1 100644
--- a/drivers/scsi/atari_NCR5380.c
+++ b/drivers/scsi/atari_NCR5380.c
@@ -507,7 +507,7 @@ static __inline__ void initialize_SCp(Scsi_Cmnd *cmd)
507 */ 507 */
508 508
509 if (cmd->use_sg) { 509 if (cmd->use_sg) {
510 cmd->SCp.buffer = (struct scatterlist *) cmd->buffer; 510 cmd->SCp.buffer = (struct scatterlist *) cmd->request_buffer;
511 cmd->SCp.buffers_residual = cmd->use_sg - 1; 511 cmd->SCp.buffers_residual = cmd->use_sg - 1;
512 cmd->SCp.ptr = (char *)page_address(cmd->SCp.buffer->page)+ 512 cmd->SCp.ptr = (char *)page_address(cmd->SCp.buffer->page)+
513 cmd->SCp.buffer->offset; 513 cmd->SCp.buffer->offset;
diff --git a/drivers/scsi/constants.c b/drivers/scsi/constants.c
index dddd2acce76f..61f6024b61ba 100644
--- a/drivers/scsi/constants.c
+++ b/drivers/scsi/constants.c
@@ -5,6 +5,7 @@
5 * Additions for SCSI 3+ (SPC-3 T10/1416-D Rev 07 3 May 2002) 5 * Additions for SCSI 3+ (SPC-3 T10/1416-D Rev 07 3 May 2002)
6 * by D. Gilbert and aeb (20020609) 6 * by D. Gilbert and aeb (20020609)
7 * Additions for SPC-3 T10/1416-D Rev 21 22 Sept 2004, D. Gilbert 20041025 7 * Additions for SPC-3 T10/1416-D Rev 21 22 Sept 2004, D. Gilbert 20041025
8 * Update to SPC-4 T10/1713-D Rev 5a, 14 June 2006, D. Gilbert 20060702
8 */ 9 */
9 10
10#include <linux/blkdev.h> 11#include <linux/blkdev.h>
@@ -36,55 +37,56 @@ static const char * cdb_byte0_names[] = {
36/* 00-03 */ "Test Unit Ready", "Rezero Unit/Rewind", NULL, "Request Sense", 37/* 00-03 */ "Test Unit Ready", "Rezero Unit/Rewind", NULL, "Request Sense",
37/* 04-07 */ "Format Unit/Medium", "Read Block Limits", NULL, 38/* 04-07 */ "Format Unit/Medium", "Read Block Limits", NULL,
38 "Reasssign Blocks", 39 "Reasssign Blocks",
39/* 08-0d */ "Read (6)", NULL, "Write (6)", "Seek (6)", NULL, NULL, 40/* 08-0d */ "Read(6)", NULL, "Write(6)", "Seek(6)", NULL, NULL,
40/* 0e-12 */ NULL, "Read Reverse", "Write Filemarks", "Space", "Inquiry", 41/* 0e-12 */ NULL, "Read Reverse", "Write Filemarks", "Space", "Inquiry",
41/* 13-16 */ "Verify (6)", "Recover Buffered Data", "Mode Select (6)", 42/* 13-16 */ "Verify(6)", "Recover Buffered Data", "Mode Select(6)",
42 "Reserve (6)", 43 "Reserve(6)",
43/* 17-1a */ "Release (6)", "Copy", "Erase", "Mode Sense (6)", 44/* 17-1a */ "Release(6)", "Copy", "Erase", "Mode Sense(6)",
44/* 1b-1d */ "Start/Stop Unit", "Receive Diagnostic", "Send Diagnostic", 45/* 1b-1d */ "Start/Stop Unit", "Receive Diagnostic", "Send Diagnostic",
45/* 1e-1f */ "Prevent/Allow Medium Removal", NULL, 46/* 1e-1f */ "Prevent/Allow Medium Removal", NULL,
46/* 20-22 */ NULL, NULL, NULL, 47/* 20-22 */ NULL, NULL, NULL,
47/* 23-28 */ "Read Format Capacities", "Set Window", 48/* 23-28 */ "Read Format Capacities", "Set Window",
48 "Read Capacity (10)", NULL, NULL, "Read (10)", 49 "Read Capacity(10)", NULL, NULL, "Read(10)",
49/* 29-2d */ "Read Generation", "Write (10)", "Seek (10)", "Erase (10)", 50/* 29-2d */ "Read Generation", "Write(10)", "Seek(10)", "Erase(10)",
50 "Read updated block", 51 "Read updated block",
51/* 2e-31 */ "Write Verify (10)", "Verify (10)", "Search High", "Search Equal", 52/* 2e-31 */ "Write Verify(10)", "Verify(10)", "Search High", "Search Equal",
52/* 32-34 */ "Search Low", "Set Limits", "Prefetch/Read Position", 53/* 32-34 */ "Search Low", "Set Limits", "Prefetch/Read Position",
53/* 35-37 */ "Synchronize Cache (10)", "Lock/Unlock Cache (10)", 54/* 35-37 */ "Synchronize Cache(10)", "Lock/Unlock Cache(10)",
54 "Read Defect Data(10)", 55 "Read Defect Data(10)",
55/* 38-3c */ "Medium Scan", "Compare", "Copy Verify", "Write Buffer", 56/* 38-3c */ "Medium Scan", "Compare", "Copy Verify", "Write Buffer",
56 "Read Buffer", 57 "Read Buffer",
57/* 3d-3f */ "Update Block", "Read Long (10)", "Write Long (10)", 58/* 3d-3f */ "Update Block", "Read Long(10)", "Write Long(10)",
58/* 40-41 */ "Change Definition", "Write Same (10)", 59/* 40-41 */ "Change Definition", "Write Same(10)",
59/* 42-48 */ "Read sub-channel", "Read TOC/PMA/ATIP", "Read density support", 60/* 42-48 */ "Read sub-channel", "Read TOC/PMA/ATIP", "Read density support",
60 "Play audio (10)", "Get configuration", "Play audio msf", 61 "Play audio(10)", "Get configuration", "Play audio msf",
61 "Play audio track/index", 62 "Play audio track/index",
62/* 49-4f */ "Play track relative (10)", "Get event status notification", 63/* 49-4f */ "Play track relative(10)", "Get event status notification",
63 "Pause/resume", "Log Select", "Log Sense", "Stop play/scan", 64 "Pause/resume", "Log Select", "Log Sense", "Stop play/scan",
64 NULL, 65 NULL,
65/* 50-55 */ "Xdwrite", "Xpwrite, Read disk info", "Xdread, Read track info", 66/* 50-55 */ "Xdwrite", "Xpwrite, Read disk info", "Xdread, Read track info",
66 "Reserve track", "Send OPC info", "Mode Select (10)", 67 "Reserve track", "Send OPC info", "Mode Select(10)",
67/* 56-5b */ "Reserve (10)", "Release (10)", "Repair track", "Read master cue", 68/* 56-5b */ "Reserve(10)", "Release(10)", "Repair track", "Read master cue",
68 "Mode Sense (10)", "Close track/session", 69 "Mode Sense(10)", "Close track/session",
69/* 5c-5f */ "Read buffer capacity", "Send cue sheet", "Persistent reserve in", 70/* 5c-5f */ "Read buffer capacity", "Send cue sheet", "Persistent reserve in",
70 "Persistent reserve out", 71 "Persistent reserve out",
71/* 60-67 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 72/* 60-67 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
72/* 68-6f */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 73/* 68-6f */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
73/* 70-77 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 74/* 70-77 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
74/* 78-7f */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, "Variable length", 75/* 78-7f */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, "Variable length",
75/* 80-84 */ "Xdwrite (16)", "Rebuild (16)", "Regenerate (16)", "Extended copy", 76/* 80-84 */ "Xdwrite(16)", "Rebuild(16)", "Regenerate(16)", "Extended copy",
76 "Receive copy results", 77 "Receive copy results",
77/* 85-89 */ "Memory Export In (16)", "Access control in", "Access control out", 78/* 85-89 */ "ATA command pass through(16)", "Access control in",
78 "Read (16)", "Memory Export Out (16)", 79 "Access control out", "Read(16)", "Memory Export Out(16)",
79/* 8a-8f */ "Write (16)", NULL, "Read attributes", "Write attributes", 80/* 8a-8f */ "Write(16)", NULL, "Read attributes", "Write attributes",
80 "Write and verify (16)", "Verify (16)", 81 "Write and verify(16)", "Verify(16)",
81/* 90-94 */ "Pre-fetch (16)", "Synchronize cache (16)", 82/* 90-94 */ "Pre-fetch(16)", "Synchronize cache(16)",
82 "Lock/unlock cache (16)", "Write same (16)", NULL, 83 "Lock/unlock cache(16)", "Write same(16)", NULL,
83/* 95-99 */ NULL, NULL, NULL, NULL, NULL, 84/* 95-99 */ NULL, NULL, NULL, NULL, NULL,
84/* 9a-9f */ NULL, NULL, NULL, NULL, "Service action in (16)", 85/* 9a-9f */ NULL, NULL, NULL, NULL, "Service action in(16)",
85 "Service action out (16)", 86 "Service action out(16)",
86/* a0-a5 */ "Report luns", "Blank", "Send event", "Maintenance in", 87/* a0-a5 */ "Report luns", "ATA command pass through(12)/Blank",
87 "Maintenance out", "Move medium/play audio(12)", 88 "Security protocol in", "Maintenance in", "Maintenance out",
89 "Move medium/play audio(12)",
88/* a6-a9 */ "Exchange medium", "Move medium attached", "Read(12)", 90/* a6-a9 */ "Exchange medium", "Move medium attached", "Read(12)",
89 "Play track relative(12)", 91 "Play track relative(12)",
90/* aa-ae */ "Write(12)", NULL, "Erase(12), Get Performance", 92/* aa-ae */ "Write(12)", NULL, "Erase(12), Get Performance",
@@ -92,12 +94,12 @@ static const char * cdb_byte0_names[] = {
92/* af-b1 */ "Verify(12)", "Search data high(12)", "Search data equal(12)", 94/* af-b1 */ "Verify(12)", "Search data high(12)", "Search data equal(12)",
93/* b2-b4 */ "Search data low(12)", "Set limits(12)", 95/* b2-b4 */ "Search data low(12)", "Set limits(12)",
94 "Read element status attached", 96 "Read element status attached",
95/* b5-b6 */ "Request volume element address", "Send volume tag, set streaming", 97/* b5-b6 */ "Security protocol out", "Send volume tag, set streaming",
96/* b7-b9 */ "Read defect data(12)", "Read element status", "Read CD msf", 98/* b7-b9 */ "Read defect data(12)", "Read element status", "Read CD msf",
97/* ba-bc */ "Redundancy group (in), Scan", 99/* ba-bc */ "Redundancy group (in), Scan",
98 "Redundancy group (out), Set cd-rom speed", "Spare in, Play cd", 100 "Redundancy group (out), Set cd-rom speed", "Spare (in), Play cd",
99/* bd-bf */ "Spare out, Mechanism status", "Volume set in, Read cd", 101/* bd-bf */ "Spare (out), Mechanism status", "Volume set (in), Read cd",
100 "Volume set out, Send DVD structure", 102 "Volume set (out), Send DVD structure",
101}; 103};
102 104
103struct value_name_pair { 105struct value_name_pair {
@@ -112,6 +114,7 @@ static const struct value_name_pair maint_in_arr[] = {
112 {0xc, "Report supported operation codes"}, 114 {0xc, "Report supported operation codes"},
113 {0xd, "Report supported task management functions"}, 115 {0xd, "Report supported task management functions"},
114 {0xe, "Report priority"}, 116 {0xe, "Report priority"},
117 {0xf, "Report timestamp"},
115}; 118};
116#define MAINT_IN_SZ ARRAY_SIZE(maint_in_arr) 119#define MAINT_IN_SZ ARRAY_SIZE(maint_in_arr)
117 120
@@ -120,6 +123,7 @@ static const struct value_name_pair maint_out_arr[] = {
120 {0xa, "Set target port groups"}, 123 {0xa, "Set target port groups"},
121 {0xb, "Change aliases"}, 124 {0xb, "Change aliases"},
122 {0xe, "Set priority"}, 125 {0xe, "Set priority"},
126 {0xe, "Set timestamp"},
123}; 127};
124#define MAINT_OUT_SZ ARRAY_SIZE(maint_out_arr) 128#define MAINT_OUT_SZ ARRAY_SIZE(maint_out_arr)
125 129
@@ -427,6 +431,7 @@ static struct error_info additional[] =
427 {0x001A, "Rewind operation in progress"}, 431 {0x001A, "Rewind operation in progress"},
428 {0x001B, "Set capacity operation in progress"}, 432 {0x001B, "Set capacity operation in progress"},
429 {0x001C, "Verify operation in progress"}, 433 {0x001C, "Verify operation in progress"},
434 {0x001D, "ATA pass through information available"},
430 435
431 {0x0100, "No index/sector signal"}, 436 {0x0100, "No index/sector signal"},
432 437
@@ -438,7 +443,7 @@ static struct error_info additional[] =
438 443
439 {0x0400, "Logical unit not ready, cause not reportable"}, 444 {0x0400, "Logical unit not ready, cause not reportable"},
440 {0x0401, "Logical unit is in process of becoming ready"}, 445 {0x0401, "Logical unit is in process of becoming ready"},
441 {0x0402, "Logical unit not ready, initializing cmd. required"}, 446 {0x0402, "Logical unit not ready, initializing command required"},
442 {0x0403, "Logical unit not ready, manual intervention required"}, 447 {0x0403, "Logical unit not ready, manual intervention required"},
443 {0x0404, "Logical unit not ready, format in progress"}, 448 {0x0404, "Logical unit not ready, format in progress"},
444 {0x0405, "Logical unit not ready, rebuild in progress"}, 449 {0x0405, "Logical unit not ready, rebuild in progress"},
@@ -478,6 +483,9 @@ static struct error_info additional[] =
478 {0x0B00, "Warning"}, 483 {0x0B00, "Warning"},
479 {0x0B01, "Warning - specified temperature exceeded"}, 484 {0x0B01, "Warning - specified temperature exceeded"},
480 {0x0B02, "Warning - enclosure degraded"}, 485 {0x0B02, "Warning - enclosure degraded"},
486 {0x0B03, "Warning - background self-test failed"},
487 {0x0B04, "Warning - background pre-scan detected medium error"},
488 {0x0B05, "Warning - background medium scan detected medium error"},
481 489
482 {0x0C00, "Write error"}, 490 {0x0C00, "Write error"},
483 {0x0C01, "Write error - recovered with auto reallocation"}, 491 {0x0C01, "Write error - recovered with auto reallocation"},
@@ -493,6 +501,7 @@ static struct error_info additional[] =
493 {0x0C0B, "Auxiliary memory write error"}, 501 {0x0C0B, "Auxiliary memory write error"},
494 {0x0C0C, "Write error - unexpected unsolicited data"}, 502 {0x0C0C, "Write error - unexpected unsolicited data"},
495 {0x0C0D, "Write error - not enough unsolicited data"}, 503 {0x0C0D, "Write error - not enough unsolicited data"},
504 {0x0C0F, "Defects in error window"},
496 505
497 {0x0D00, "Error detected by third party temporary initiator"}, 506 {0x0D00, "Error detected by third party temporary initiator"},
498 {0x0D01, "Third party device failure"}, 507 {0x0D01, "Third party device failure"},
@@ -504,11 +513,12 @@ static struct error_info additional[] =
504 {0x0E00, "Invalid information unit"}, 513 {0x0E00, "Invalid information unit"},
505 {0x0E01, "Information unit too short"}, 514 {0x0E01, "Information unit too short"},
506 {0x0E02, "Information unit too long"}, 515 {0x0E02, "Information unit too long"},
516 {0x0E03, "Invalid field in command information unit"},
507 517
508 {0x1000, "Id CRC or ECC error"}, 518 {0x1000, "Id CRC or ECC error"},
509 {0x1001, "Data block guard check failed"}, 519 {0x1001, "Logical block guard check failed"},
510 {0x1002, "Data block application tag check failed"}, 520 {0x1002, "Logical block application tag check failed"},
511 {0x1003, "Data block reference tag check failed"}, 521 {0x1003, "Logical block reference tag check failed"},
512 522
513 {0x1100, "Unrecovered read error"}, 523 {0x1100, "Unrecovered read error"},
514 {0x1101, "Read retries exhausted"}, 524 {0x1101, "Read retries exhausted"},
@@ -530,6 +540,7 @@ static struct error_info additional[] =
530 {0x1111, "Read error - loss of streaming"}, 540 {0x1111, "Read error - loss of streaming"},
531 {0x1112, "Auxiliary memory read error"}, 541 {0x1112, "Auxiliary memory read error"},
532 {0x1113, "Read error - failed retransmission request"}, 542 {0x1113, "Read error - failed retransmission request"},
543 {0x1114, "Read error - lba marked bad by application client"},
533 544
534 {0x1200, "Address mark not found for id field"}, 545 {0x1200, "Address mark not found for id field"},
535 546
@@ -610,11 +621,14 @@ static struct error_info additional[] =
610 {0x2100, "Logical block address out of range"}, 621 {0x2100, "Logical block address out of range"},
611 {0x2101, "Invalid element address"}, 622 {0x2101, "Invalid element address"},
612 {0x2102, "Invalid address for write"}, 623 {0x2102, "Invalid address for write"},
624 {0x2103, "Invalid write crossing layer jump"},
613 625
614 {0x2200, "Illegal function (use 20 00, 24 00, or 26 00)"}, 626 {0x2200, "Illegal function (use 20 00, 24 00, or 26 00)"},
615 627
616 {0x2400, "Invalid field in cdb"}, 628 {0x2400, "Invalid field in cdb"},
617 {0x2401, "CDB decryption error"}, 629 {0x2401, "CDB decryption error"},
630 {0x2402, "Obsolete"},
631 {0x2403, "Obsolete"},
618 {0x2404, "Security audit value frozen"}, 632 {0x2404, "Security audit value frozen"},
619 {0x2405, "Security working key frozen"}, 633 {0x2405, "Security working key frozen"},
620 {0x2406, "Nonce not unique"}, 634 {0x2406, "Nonce not unique"},
@@ -637,7 +651,10 @@ static struct error_info additional[] =
637 {0x260C, "Invalid operation for copy source or destination"}, 651 {0x260C, "Invalid operation for copy source or destination"},
638 {0x260D, "Copy segment granularity violation"}, 652 {0x260D, "Copy segment granularity violation"},
639 {0x260E, "Invalid parameter while port is enabled"}, 653 {0x260E, "Invalid parameter while port is enabled"},
640 {0x260F, "Invalid data-out buffer integrity"}, 654 {0x260F, "Invalid data-out buffer integrity check value"},
655 {0x2610, "Data decryption key fail limit reached"},
656 {0x2611, "Incomplete key-associated data set"},
657 {0x2612, "Vendor specific key reference not found"},
641 658
642 {0x2700, "Write protected"}, 659 {0x2700, "Write protected"},
643 {0x2701, "Hardware write protected"}, 660 {0x2701, "Hardware write protected"},
@@ -649,6 +666,7 @@ static struct error_info additional[] =
649 666
650 {0x2800, "Not ready to ready change, medium may have changed"}, 667 {0x2800, "Not ready to ready change, medium may have changed"},
651 {0x2801, "Import or export element accessed"}, 668 {0x2801, "Import or export element accessed"},
669 {0x2802, "Format-layer may have changed"},
652 670
653 {0x2900, "Power on, reset, or bus device reset occurred"}, 671 {0x2900, "Power on, reset, or bus device reset occurred"},
654 {0x2901, "Power on occurred"}, 672 {0x2901, "Power on occurred"},
@@ -669,6 +687,11 @@ static struct error_info additional[] =
669 {0x2A07, "Implicit asymmetric access state transition failed"}, 687 {0x2A07, "Implicit asymmetric access state transition failed"},
670 {0x2A08, "Priority changed"}, 688 {0x2A08, "Priority changed"},
671 {0x2A09, "Capacity data has changed"}, 689 {0x2A09, "Capacity data has changed"},
690 {0x2A10, "Timestamp changed"},
691 {0x2A11, "Data encryption parameters changed by another i_t nexus"},
692 {0x2A12, "Data encryption parameters changed by vendor specific "
693 "event"},
694 {0x2A13, "Data encryption key instance counter has changed"},
672 695
673 {0x2B00, "Copy cannot execute since host cannot disconnect"}, 696 {0x2B00, "Copy cannot execute since host cannot disconnect"},
674 697
@@ -690,6 +713,7 @@ static struct error_info additional[] =
690 {0x2E00, "Insufficient time for operation"}, 713 {0x2E00, "Insufficient time for operation"},
691 714
692 {0x2F00, "Commands cleared by another initiator"}, 715 {0x2F00, "Commands cleared by another initiator"},
716 {0x2F01, "Commands cleared by power loss notification"},
693 717
694 {0x3000, "Incompatible medium installed"}, 718 {0x3000, "Incompatible medium installed"},
695 {0x3001, "Cannot read medium - unknown format"}, 719 {0x3001, "Cannot read medium - unknown format"},
@@ -702,7 +726,8 @@ static struct error_info additional[] =
702 {0x3008, "Cannot write - application code mismatch"}, 726 {0x3008, "Cannot write - application code mismatch"},
703 {0x3009, "Current session not fixated for append"}, 727 {0x3009, "Current session not fixated for append"},
704 {0x300A, "Cleaning request rejected"}, 728 {0x300A, "Cleaning request rejected"},
705 {0x300C, "WORM medium, overwrite attempted"}, 729 {0x300C, "WORM medium - overwrite attempted"},
730 {0x300D, "WORM medium - integrity check"},
706 {0x3010, "Medium not formatted"}, 731 {0x3010, "Medium not formatted"},
707 732
708 {0x3100, "Medium format corrupted"}, 733 {0x3100, "Medium format corrupted"},
@@ -790,6 +815,9 @@ static struct error_info additional[] =
790 {0x3F0F, "Echo buffer overwritten"}, 815 {0x3F0F, "Echo buffer overwritten"},
791 {0x3F10, "Medium loadable"}, 816 {0x3F10, "Medium loadable"},
792 {0x3F11, "Medium auxiliary memory accessible"}, 817 {0x3F11, "Medium auxiliary memory accessible"},
818 {0x3F12, "iSCSI IP address added"},
819 {0x3F13, "iSCSI IP address removed"},
820 {0x3F14, "iSCSI IP address changed"},
793/* 821/*
794 * {0x40NN, "Ram failure"}, 822 * {0x40NN, "Ram failure"},
795 * {0x40NN, "Diagnostic failure on component nn"}, 823 * {0x40NN, "Diagnostic failure on component nn"},
@@ -799,6 +827,7 @@ static struct error_info additional[] =
799 {0x4300, "Message error"}, 827 {0x4300, "Message error"},
800 828
801 {0x4400, "Internal target failure"}, 829 {0x4400, "Internal target failure"},
830 {0x4471, "ATA device failed set features"},
802 831
803 {0x4500, "Select or reselect failure"}, 832 {0x4500, "Select or reselect failure"},
804 833
@@ -807,9 +836,10 @@ static struct error_info additional[] =
807 {0x4700, "Scsi parity error"}, 836 {0x4700, "Scsi parity error"},
808 {0x4701, "Data phase CRC error detected"}, 837 {0x4701, "Data phase CRC error detected"},
809 {0x4702, "Scsi parity error detected during st data phase"}, 838 {0x4702, "Scsi parity error detected during st data phase"},
810 {0x4703, "Information unit CRC error detected"}, 839 {0x4703, "Information unit iuCRC error detected"},
811 {0x4704, "Asynchronous information protection error detected"}, 840 {0x4704, "Asynchronous information protection error detected"},
812 {0x4705, "Protocol service CRC error"}, 841 {0x4705, "Protocol service CRC error"},
842 {0x4706, "Phy test function in progress"},
813 {0x477f, "Some commands cleared by iSCSI Protocol event"}, 843 {0x477f, "Some commands cleared by iSCSI Protocol event"},
814 844
815 {0x4800, "Initiator detected error message received"}, 845 {0x4800, "Initiator detected error message received"},
@@ -844,6 +874,8 @@ static struct error_info additional[] =
844 {0x5300, "Media load or eject failed"}, 874 {0x5300, "Media load or eject failed"},
845 {0x5301, "Unload tape failure"}, 875 {0x5301, "Unload tape failure"},
846 {0x5302, "Medium removal prevented"}, 876 {0x5302, "Medium removal prevented"},
877 {0x5303, "Medium removal prevented by data transfer element"},
878 {0x5304, "Medium thread or unthread failure"},
847 879
848 {0x5400, "Scsi to host system interface failure"}, 880 {0x5400, "Scsi to host system interface failure"},
849 881
@@ -855,6 +887,7 @@ static struct error_info additional[] =
855 {0x5505, "Insufficient access control resources"}, 887 {0x5505, "Insufficient access control resources"},
856 {0x5506, "Auxiliary memory out of space"}, 888 {0x5506, "Auxiliary memory out of space"},
857 {0x5507, "Quota error"}, 889 {0x5507, "Quota error"},
890 {0x5508, "Maximum number of supplemental decryption keys exceeded"},
858 891
859 {0x5700, "Unable to recover table-of-contents"}, 892 {0x5700, "Unable to recover table-of-contents"},
860 893
@@ -1004,6 +1037,7 @@ static struct error_info additional[] =
1004 {0x6708, "Assign failure occurred"}, 1037 {0x6708, "Assign failure occurred"},
1005 {0x6709, "Multiply assigned logical unit"}, 1038 {0x6709, "Multiply assigned logical unit"},
1006 {0x670A, "Set target port groups command failed"}, 1039 {0x670A, "Set target port groups command failed"},
1040 {0x670B, "ATA device feature not enabled"},
1007 1041
1008 {0x6800, "Logical unit not configured"}, 1042 {0x6800, "Logical unit not configured"},
1009 1043
@@ -1030,6 +1064,8 @@ static struct error_info additional[] =
1030 {0x6F03, "Read of scrambled sector without authentication"}, 1064 {0x6F03, "Read of scrambled sector without authentication"},
1031 {0x6F04, "Media region code is mismatched to logical unit region"}, 1065 {0x6F04, "Media region code is mismatched to logical unit region"},
1032 {0x6F05, "Drive region must be permanent/region reset count error"}, 1066 {0x6F05, "Drive region must be permanent/region reset count error"},
1067 {0x6F06, "Insufficient block count for binding nonce recording"},
1068 {0x6F07, "Conflict in binding nonce recording"},
1033/* 1069/*
1034 * {0x70NN, "Decompression exception short algorithm id of nn"}, 1070 * {0x70NN, "Decompression exception short algorithm id of nn"},
1035 */ 1071 */
@@ -1041,6 +1077,8 @@ static struct error_info additional[] =
1041 {0x7203, "Session fixation error - incomplete track in session"}, 1077 {0x7203, "Session fixation error - incomplete track in session"},
1042 {0x7204, "Empty or partially written reserved track"}, 1078 {0x7204, "Empty or partially written reserved track"},
1043 {0x7205, "No more track reservations allowed"}, 1079 {0x7205, "No more track reservations allowed"},
1080 {0x7206, "RMZ extension is not allowed"},
1081 {0x7207, "No more test zone extensions are allowed"},
1044 1082
1045 {0x7300, "Cd control error"}, 1083 {0x7300, "Cd control error"},
1046 {0x7301, "Power calibration area almost full"}, 1084 {0x7301, "Power calibration area almost full"},
@@ -1049,6 +1087,18 @@ static struct error_info additional[] =
1049 {0x7304, "Program memory area update failure"}, 1087 {0x7304, "Program memory area update failure"},
1050 {0x7305, "Program memory area is full"}, 1088 {0x7305, "Program memory area is full"},
1051 {0x7306, "RMA/PMA is almost full"}, 1089 {0x7306, "RMA/PMA is almost full"},
1090 {0x7310, "Current power calibration area almost full"},
1091 {0x7311, "Current power calibration area is full"},
1092 {0x7317, "RDZ is full"},
1093
1094 {0x7400, "Security error"},
1095 {0x7401, "Unable to decrypt data"},
1096 {0x7402, "Unencrypted data encountered while decrypting"},
1097 {0x7403, "Incorrect data encryption key"},
1098 {0x7404, "Cryptographic integrity validation failed"},
1099 {0x7405, "Error decrypting data"},
1100 {0x7471, "Logical unit access not authorized"},
1101
1052 {0, NULL} 1102 {0, NULL}
1053}; 1103};
1054 1104
diff --git a/drivers/scsi/esp.c b/drivers/scsi/esp.c
index 10573c24a50b..98bd22714d0d 100644
--- a/drivers/scsi/esp.c
+++ b/drivers/scsi/esp.c
@@ -1397,7 +1397,7 @@ static void esp_get_dmabufs(struct esp *esp, struct scsi_cmnd *sp)
1397 sp->SCp.ptr = NULL; 1397 sp->SCp.ptr = NULL;
1398 } 1398 }
1399 } else { 1399 } else {
1400 sp->SCp.buffer = (struct scatterlist *) sp->buffer; 1400 sp->SCp.buffer = (struct scatterlist *) sp->request_buffer;
1401 sp->SCp.buffers_residual = sbus_map_sg(esp->sdev, 1401 sp->SCp.buffers_residual = sbus_map_sg(esp->sdev,
1402 sp->SCp.buffer, 1402 sp->SCp.buffer,
1403 sp->use_sg, 1403 sp->use_sg,
@@ -1410,7 +1410,7 @@ static void esp_get_dmabufs(struct esp *esp, struct scsi_cmnd *sp)
1410static void esp_release_dmabufs(struct esp *esp, struct scsi_cmnd *sp) 1410static void esp_release_dmabufs(struct esp *esp, struct scsi_cmnd *sp)
1411{ 1411{
1412 if (sp->use_sg) { 1412 if (sp->use_sg) {
1413 sbus_unmap_sg(esp->sdev, sp->buffer, sp->use_sg, 1413 sbus_unmap_sg(esp->sdev, sp->request_buffer, sp->use_sg,
1414 sp->sc_data_direction); 1414 sp->sc_data_direction);
1415 } else if (sp->request_bufflen) { 1415 } else if (sp->request_bufflen) {
1416 sbus_unmap_single(esp->sdev, 1416 sbus_unmap_single(esp->sdev,
@@ -2754,18 +2754,15 @@ static int esp_do_data_finale(struct esp *esp)
2754 */ 2754 */
2755static int esp_should_clear_sync(struct scsi_cmnd *sp) 2755static int esp_should_clear_sync(struct scsi_cmnd *sp)
2756{ 2756{
2757 u8 cmd1 = sp->cmnd[0]; 2757 u8 cmd = sp->cmnd[0];
2758 u8 cmd2 = sp->data_cmnd[0];
2759 2758
2760 /* These cases are for spinning up a disk and 2759 /* These cases are for spinning up a disk and
2761 * waiting for that spinup to complete. 2760 * waiting for that spinup to complete.
2762 */ 2761 */
2763 if (cmd1 == START_STOP || 2762 if (cmd == START_STOP)
2764 cmd2 == START_STOP)
2765 return 0; 2763 return 0;
2766 2764
2767 if (cmd1 == TEST_UNIT_READY || 2765 if (cmd == TEST_UNIT_READY)
2768 cmd2 == TEST_UNIT_READY)
2769 return 0; 2766 return 0;
2770 2767
2771 /* One more special case for SCSI tape drives, 2768 /* One more special case for SCSI tape drives,
@@ -2773,8 +2770,7 @@ static int esp_should_clear_sync(struct scsi_cmnd *sp)
2773 * completion of a rewind or tape load operation. 2770 * completion of a rewind or tape load operation.
2774 */ 2771 */
2775 if (sp->device->type == TYPE_TAPE) { 2772 if (sp->device->type == TYPE_TAPE) {
2776 if (cmd1 == MODE_SENSE || 2773 if (cmd == MODE_SENSE)
2777 cmd2 == MODE_SENSE)
2778 return 0; 2774 return 0;
2779 } 2775 }
2780 2776
diff --git a/drivers/scsi/ibmvscsi/iseries_vscsi.c b/drivers/scsi/ibmvscsi/iseries_vscsi.c
index 7eed0b098171..6aeb5f003c3c 100644
--- a/drivers/scsi/ibmvscsi/iseries_vscsi.c
+++ b/drivers/scsi/ibmvscsi/iseries_vscsi.c
@@ -81,7 +81,7 @@ int ibmvscsi_init_crq_queue(struct crq_queue *queue,
81 int rc; 81 int rc;
82 82
83 single_host_data = hostdata; 83 single_host_data = hostdata;
84 rc = viopath_open(viopath_hostLp, viomajorsubtype_scsi, 0); 84 rc = viopath_open(viopath_hostLp, viomajorsubtype_scsi, max_requests);
85 if (rc < 0) { 85 if (rc < 0) {
86 printk("viopath_open failed with rc %d in open_event_path\n", 86 printk("viopath_open failed with rc %d in open_event_path\n",
87 rc); 87 rc);
diff --git a/drivers/scsi/ibmvscsi/rpa_vscsi.c b/drivers/scsi/ibmvscsi/rpa_vscsi.c
index 242b8873b333..ed22b96580c6 100644
--- a/drivers/scsi/ibmvscsi/rpa_vscsi.c
+++ b/drivers/scsi/ibmvscsi/rpa_vscsi.c
@@ -238,6 +238,7 @@ int ibmvscsi_init_crq_queue(struct crq_queue *queue,
238 if (rc == 2) { 238 if (rc == 2) {
239 /* Adapter is good, but other end is not ready */ 239 /* Adapter is good, but other end is not ready */
240 printk(KERN_WARNING "ibmvscsi: Partner adapter not ready\n"); 240 printk(KERN_WARNING "ibmvscsi: Partner adapter not ready\n");
241 retrc = 0;
241 } else if (rc != 0) { 242 } else if (rc != 0) {
242 printk(KERN_WARNING "ibmvscsi: Error %d opening adapter\n", rc); 243 printk(KERN_WARNING "ibmvscsi: Error %d opening adapter\n", rc);
243 goto reg_crq_failed; 244 goto reg_crq_failed;
diff --git a/drivers/scsi/jazz_esp.c b/drivers/scsi/jazz_esp.c
index 3fd8a96f2af3..bfac4441d89f 100644
--- a/drivers/scsi/jazz_esp.c
+++ b/drivers/scsi/jazz_esp.c
@@ -257,7 +257,7 @@ static void dma_mmu_release_scsi_one (struct NCR_ESP *esp, struct scsi_cmnd *sp)
257static void dma_mmu_release_scsi_sgl (struct NCR_ESP *esp, struct scsi_cmnd *sp) 257static void dma_mmu_release_scsi_sgl (struct NCR_ESP *esp, struct scsi_cmnd *sp)
258{ 258{
259 int sz = sp->use_sg - 1; 259 int sz = sp->use_sg - 1;
260 struct scatterlist *sg = (struct scatterlist *)sp->buffer; 260 struct scatterlist *sg = (struct scatterlist *)sp->request_buffer;
261 261
262 while(sz >= 0) { 262 while(sz >= 0) {
263 vdma_free(sg[sz].dma_address); 263 vdma_free(sg[sz].dma_address);
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 1c960ac1617f..386e5f21e191 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -61,9 +61,9 @@
61#include "libata.h" 61#include "libata.h"
62 62
63/* debounce timing parameters in msecs { interval, duration, timeout } */ 63/* debounce timing parameters in msecs { interval, duration, timeout } */
64const unsigned long sata_deb_timing_boot[] = { 5, 100, 2000 }; 64const unsigned long sata_deb_timing_normal[] = { 5, 100, 2000 };
65const unsigned long sata_deb_timing_eh[] = { 25, 500, 2000 }; 65const unsigned long sata_deb_timing_hotplug[] = { 25, 500, 2000 };
66const unsigned long sata_deb_timing_before_fsrst[] = { 100, 2000, 5000 }; 66const unsigned long sata_deb_timing_long[] = { 100, 2000, 5000 };
67 67
68static unsigned int ata_dev_init_params(struct ata_device *dev, 68static unsigned int ata_dev_init_params(struct ata_device *dev,
69 u16 heads, u16 sectors); 69 u16 heads, u16 sectors);
@@ -907,7 +907,7 @@ void ata_port_queue_task(struct ata_port *ap, void (*fn)(void *), void *data,
907{ 907{
908 int rc; 908 int rc;
909 909
910 if (ap->flags & ATA_FLAG_FLUSH_PORT_TASK) 910 if (ap->pflags & ATA_PFLAG_FLUSH_PORT_TASK)
911 return; 911 return;
912 912
913 PREPARE_WORK(&ap->port_task, fn, data); 913 PREPARE_WORK(&ap->port_task, fn, data);
@@ -938,7 +938,7 @@ void ata_port_flush_task(struct ata_port *ap)
938 DPRINTK("ENTER\n"); 938 DPRINTK("ENTER\n");
939 939
940 spin_lock_irqsave(ap->lock, flags); 940 spin_lock_irqsave(ap->lock, flags);
941 ap->flags |= ATA_FLAG_FLUSH_PORT_TASK; 941 ap->pflags |= ATA_PFLAG_FLUSH_PORT_TASK;
942 spin_unlock_irqrestore(ap->lock, flags); 942 spin_unlock_irqrestore(ap->lock, flags);
943 943
944 DPRINTK("flush #1\n"); 944 DPRINTK("flush #1\n");
@@ -957,7 +957,7 @@ void ata_port_flush_task(struct ata_port *ap)
957 } 957 }
958 958
959 spin_lock_irqsave(ap->lock, flags); 959 spin_lock_irqsave(ap->lock, flags);
960 ap->flags &= ~ATA_FLAG_FLUSH_PORT_TASK; 960 ap->pflags &= ~ATA_PFLAG_FLUSH_PORT_TASK;
961 spin_unlock_irqrestore(ap->lock, flags); 961 spin_unlock_irqrestore(ap->lock, flags);
962 962
963 if (ata_msg_ctl(ap)) 963 if (ata_msg_ctl(ap))
@@ -1009,7 +1009,7 @@ unsigned ata_exec_internal(struct ata_device *dev,
1009 spin_lock_irqsave(ap->lock, flags); 1009 spin_lock_irqsave(ap->lock, flags);
1010 1010
1011 /* no internal command while frozen */ 1011 /* no internal command while frozen */
1012 if (ap->flags & ATA_FLAG_FROZEN) { 1012 if (ap->pflags & ATA_PFLAG_FROZEN) {
1013 spin_unlock_irqrestore(ap->lock, flags); 1013 spin_unlock_irqrestore(ap->lock, flags);
1014 return AC_ERR_SYSTEM; 1014 return AC_ERR_SYSTEM;
1015 } 1015 }
@@ -1325,6 +1325,19 @@ static void ata_dev_config_ncq(struct ata_device *dev,
1325 snprintf(desc, desc_sz, "NCQ (depth %d/%d)", hdepth, ddepth); 1325 snprintf(desc, desc_sz, "NCQ (depth %d/%d)", hdepth, ddepth);
1326} 1326}
1327 1327
1328static void ata_set_port_max_cmd_len(struct ata_port *ap)
1329{
1330 int i;
1331
1332 if (ap->host) {
1333 ap->host->max_cmd_len = 0;
1334 for (i = 0; i < ATA_MAX_DEVICES; i++)
1335 ap->host->max_cmd_len = max_t(unsigned int,
1336 ap->host->max_cmd_len,
1337 ap->device[i].cdb_len);
1338 }
1339}
1340
1328/** 1341/**
1329 * ata_dev_configure - Configure the specified ATA/ATAPI device 1342 * ata_dev_configure - Configure the specified ATA/ATAPI device
1330 * @dev: Target device to configure 1343 * @dev: Target device to configure
@@ -1344,7 +1357,7 @@ int ata_dev_configure(struct ata_device *dev, int print_info)
1344 struct ata_port *ap = dev->ap; 1357 struct ata_port *ap = dev->ap;
1345 const u16 *id = dev->id; 1358 const u16 *id = dev->id;
1346 unsigned int xfer_mask; 1359 unsigned int xfer_mask;
1347 int i, rc; 1360 int rc;
1348 1361
1349 if (!ata_dev_enabled(dev) && ata_msg_info(ap)) { 1362 if (!ata_dev_enabled(dev) && ata_msg_info(ap)) {
1350 ata_dev_printk(dev, KERN_INFO, 1363 ata_dev_printk(dev, KERN_INFO,
@@ -1404,7 +1417,7 @@ int ata_dev_configure(struct ata_device *dev, int print_info)
1404 ata_dev_config_ncq(dev, ncq_desc, sizeof(ncq_desc)); 1417 ata_dev_config_ncq(dev, ncq_desc, sizeof(ncq_desc));
1405 1418
1406 /* print device info to dmesg */ 1419 /* print device info to dmesg */
1407 if (ata_msg_info(ap)) 1420 if (ata_msg_drv(ap) && print_info)
1408 ata_dev_printk(dev, KERN_INFO, "ATA-%d, " 1421 ata_dev_printk(dev, KERN_INFO, "ATA-%d, "
1409 "max %s, %Lu sectors: %s %s\n", 1422 "max %s, %Lu sectors: %s %s\n",
1410 ata_id_major_version(id), 1423 ata_id_major_version(id),
@@ -1427,7 +1440,7 @@ int ata_dev_configure(struct ata_device *dev, int print_info)
1427 } 1440 }
1428 1441
1429 /* print device info to dmesg */ 1442 /* print device info to dmesg */
1430 if (ata_msg_info(ap)) 1443 if (ata_msg_drv(ap) && print_info)
1431 ata_dev_printk(dev, KERN_INFO, "ATA-%d, " 1444 ata_dev_printk(dev, KERN_INFO, "ATA-%d, "
1432 "max %s, %Lu sectors: CHS %u/%u/%u\n", 1445 "max %s, %Lu sectors: CHS %u/%u/%u\n",
1433 ata_id_major_version(id), 1446 ata_id_major_version(id),
@@ -1439,7 +1452,7 @@ int ata_dev_configure(struct ata_device *dev, int print_info)
1439 1452
1440 if (dev->id[59] & 0x100) { 1453 if (dev->id[59] & 0x100) {
1441 dev->multi_count = dev->id[59] & 0xff; 1454 dev->multi_count = dev->id[59] & 0xff;
1442 if (ata_msg_info(ap)) 1455 if (ata_msg_drv(ap) && print_info)
1443 ata_dev_printk(dev, KERN_INFO, 1456 ata_dev_printk(dev, KERN_INFO,
1444 "ata%u: dev %u multi count %u\n", 1457 "ata%u: dev %u multi count %u\n",
1445 ap->id, dev->devno, dev->multi_count); 1458 ap->id, dev->devno, dev->multi_count);
@@ -1468,21 +1481,17 @@ int ata_dev_configure(struct ata_device *dev, int print_info)
1468 } 1481 }
1469 1482
1470 /* print device info to dmesg */ 1483 /* print device info to dmesg */
1471 if (ata_msg_info(ap)) 1484 if (ata_msg_drv(ap) && print_info)
1472 ata_dev_printk(dev, KERN_INFO, "ATAPI, max %s%s\n", 1485 ata_dev_printk(dev, KERN_INFO, "ATAPI, max %s%s\n",
1473 ata_mode_string(xfer_mask), 1486 ata_mode_string(xfer_mask),
1474 cdb_intr_string); 1487 cdb_intr_string);
1475 } 1488 }
1476 1489
1477 ap->host->max_cmd_len = 0; 1490 ata_set_port_max_cmd_len(ap);
1478 for (i = 0; i < ATA_MAX_DEVICES; i++)
1479 ap->host->max_cmd_len = max_t(unsigned int,
1480 ap->host->max_cmd_len,
1481 ap->device[i].cdb_len);
1482 1491
1483 /* limit bridge transfers to udma5, 200 sectors */ 1492 /* limit bridge transfers to udma5, 200 sectors */
1484 if (ata_dev_knobble(dev)) { 1493 if (ata_dev_knobble(dev)) {
1485 if (ata_msg_info(ap)) 1494 if (ata_msg_drv(ap) && print_info)
1486 ata_dev_printk(dev, KERN_INFO, 1495 ata_dev_printk(dev, KERN_INFO,
1487 "applying bridge limits\n"); 1496 "applying bridge limits\n");
1488 dev->udma_mask &= ATA_UDMA5; 1497 dev->udma_mask &= ATA_UDMA5;
@@ -2137,7 +2146,7 @@ int ata_set_mode(struct ata_port *ap, struct ata_device **r_failed_dev)
2137 * return error code and failing device on failure. 2146 * return error code and failing device on failure.
2138 */ 2147 */
2139 for (i = 0; i < ATA_MAX_DEVICES; i++) { 2148 for (i = 0; i < ATA_MAX_DEVICES; i++) {
2140 if (ata_dev_enabled(&ap->device[i])) { 2149 if (ata_dev_ready(&ap->device[i])) {
2141 ap->ops->set_mode(ap); 2150 ap->ops->set_mode(ap);
2142 break; 2151 break;
2143 } 2152 }
@@ -2203,7 +2212,8 @@ int ata_set_mode(struct ata_port *ap, struct ata_device **r_failed_dev)
2203 for (i = 0; i < ATA_MAX_DEVICES; i++) { 2212 for (i = 0; i < ATA_MAX_DEVICES; i++) {
2204 dev = &ap->device[i]; 2213 dev = &ap->device[i];
2205 2214
2206 if (!ata_dev_enabled(dev)) 2215 /* don't udpate suspended devices' xfer mode */
2216 if (!ata_dev_ready(dev))
2207 continue; 2217 continue;
2208 2218
2209 rc = ata_dev_set_mode(dev); 2219 rc = ata_dev_set_mode(dev);
@@ -2579,7 +2589,7 @@ static void ata_wait_spinup(struct ata_port *ap)
2579 2589
2580 /* first, debounce phy if SATA */ 2590 /* first, debounce phy if SATA */
2581 if (ap->cbl == ATA_CBL_SATA) { 2591 if (ap->cbl == ATA_CBL_SATA) {
2582 rc = sata_phy_debounce(ap, sata_deb_timing_eh); 2592 rc = sata_phy_debounce(ap, sata_deb_timing_hotplug);
2583 2593
2584 /* if debounced successfully and offline, no need to wait */ 2594 /* if debounced successfully and offline, no need to wait */
2585 if ((rc == 0 || rc == -EOPNOTSUPP) && ata_port_offline(ap)) 2595 if ((rc == 0 || rc == -EOPNOTSUPP) && ata_port_offline(ap))
@@ -2615,16 +2625,17 @@ static void ata_wait_spinup(struct ata_port *ap)
2615int ata_std_prereset(struct ata_port *ap) 2625int ata_std_prereset(struct ata_port *ap)
2616{ 2626{
2617 struct ata_eh_context *ehc = &ap->eh_context; 2627 struct ata_eh_context *ehc = &ap->eh_context;
2618 const unsigned long *timing; 2628 const unsigned long *timing = sata_ehc_deb_timing(ehc);
2619 int rc; 2629 int rc;
2620 2630
2621 /* hotplug? */ 2631 /* handle link resume & hotplug spinup */
2622 if (ehc->i.flags & ATA_EHI_HOTPLUGGED) { 2632 if ((ehc->i.flags & ATA_EHI_RESUME_LINK) &&
2623 if (ap->flags & ATA_FLAG_HRST_TO_RESUME) 2633 (ap->flags & ATA_FLAG_HRST_TO_RESUME))
2624 ehc->i.action |= ATA_EH_HARDRESET; 2634 ehc->i.action |= ATA_EH_HARDRESET;
2625 if (ap->flags & ATA_FLAG_SKIP_D2H_BSY) 2635
2626 ata_wait_spinup(ap); 2636 if ((ehc->i.flags & ATA_EHI_HOTPLUGGED) &&
2627 } 2637 (ap->flags & ATA_FLAG_SKIP_D2H_BSY))
2638 ata_wait_spinup(ap);
2628 2639
2629 /* if we're about to do hardreset, nothing more to do */ 2640 /* if we're about to do hardreset, nothing more to do */
2630 if (ehc->i.action & ATA_EH_HARDRESET) 2641 if (ehc->i.action & ATA_EH_HARDRESET)
@@ -2632,11 +2643,6 @@ int ata_std_prereset(struct ata_port *ap)
2632 2643
2633 /* if SATA, resume phy */ 2644 /* if SATA, resume phy */
2634 if (ap->cbl == ATA_CBL_SATA) { 2645 if (ap->cbl == ATA_CBL_SATA) {
2635 if (ap->flags & ATA_FLAG_LOADING)
2636 timing = sata_deb_timing_boot;
2637 else
2638 timing = sata_deb_timing_eh;
2639
2640 rc = sata_phy_resume(ap, timing); 2646 rc = sata_phy_resume(ap, timing);
2641 if (rc && rc != -EOPNOTSUPP) { 2647 if (rc && rc != -EOPNOTSUPP) {
2642 /* phy resume failed */ 2648 /* phy resume failed */
@@ -2724,6 +2730,8 @@ int ata_std_softreset(struct ata_port *ap, unsigned int *classes)
2724 */ 2730 */
2725int sata_std_hardreset(struct ata_port *ap, unsigned int *class) 2731int sata_std_hardreset(struct ata_port *ap, unsigned int *class)
2726{ 2732{
2733 struct ata_eh_context *ehc = &ap->eh_context;
2734 const unsigned long *timing = sata_ehc_deb_timing(ehc);
2727 u32 scontrol; 2735 u32 scontrol;
2728 int rc; 2736 int rc;
2729 2737
@@ -2761,7 +2769,7 @@ int sata_std_hardreset(struct ata_port *ap, unsigned int *class)
2761 msleep(1); 2769 msleep(1);
2762 2770
2763 /* bring phy back */ 2771 /* bring phy back */
2764 sata_phy_resume(ap, sata_deb_timing_eh); 2772 sata_phy_resume(ap, timing);
2765 2773
2766 /* TODO: phy layer with polling, timeouts, etc. */ 2774 /* TODO: phy layer with polling, timeouts, etc. */
2767 if (ata_port_offline(ap)) { 2775 if (ata_port_offline(ap)) {
@@ -4285,7 +4293,7 @@ static struct ata_queued_cmd *ata_qc_new(struct ata_port *ap)
4285 unsigned int i; 4293 unsigned int i;
4286 4294
4287 /* no command while frozen */ 4295 /* no command while frozen */
4288 if (unlikely(ap->flags & ATA_FLAG_FROZEN)) 4296 if (unlikely(ap->pflags & ATA_PFLAG_FROZEN))
4289 return NULL; 4297 return NULL;
4290 4298
4291 /* the last tag is reserved for internal command. */ 4299 /* the last tag is reserved for internal command. */
@@ -4407,7 +4415,7 @@ void ata_qc_complete(struct ata_queued_cmd *qc)
4407 * taken care of. 4415 * taken care of.
4408 */ 4416 */
4409 if (ap->ops->error_handler) { 4417 if (ap->ops->error_handler) {
4410 WARN_ON(ap->flags & ATA_FLAG_FROZEN); 4418 WARN_ON(ap->pflags & ATA_PFLAG_FROZEN);
4411 4419
4412 if (unlikely(qc->err_mask)) 4420 if (unlikely(qc->err_mask))
4413 qc->flags |= ATA_QCFLAG_FAILED; 4421 qc->flags |= ATA_QCFLAG_FAILED;
@@ -5001,86 +5009,120 @@ int ata_flush_cache(struct ata_device *dev)
5001 return 0; 5009 return 0;
5002} 5010}
5003 5011
5004static int ata_standby_drive(struct ata_device *dev) 5012static int ata_host_set_request_pm(struct ata_host_set *host_set,
5013 pm_message_t mesg, unsigned int action,
5014 unsigned int ehi_flags, int wait)
5005{ 5015{
5006 unsigned int err_mask; 5016 unsigned long flags;
5017 int i, rc;
5007 5018
5008 err_mask = ata_do_simple_cmd(dev, ATA_CMD_STANDBYNOW1); 5019 for (i = 0; i < host_set->n_ports; i++) {
5009 if (err_mask) { 5020 struct ata_port *ap = host_set->ports[i];
5010 ata_dev_printk(dev, KERN_ERR, "failed to standby drive "
5011 "(err_mask=0x%x)\n", err_mask);
5012 return -EIO;
5013 }
5014 5021
5015 return 0; 5022 /* Previous resume operation might still be in
5016} 5023 * progress. Wait for PM_PENDING to clear.
5024 */
5025 if (ap->pflags & ATA_PFLAG_PM_PENDING) {
5026 ata_port_wait_eh(ap);
5027 WARN_ON(ap->pflags & ATA_PFLAG_PM_PENDING);
5028 }
5017 5029
5018static int ata_start_drive(struct ata_device *dev) 5030 /* request PM ops to EH */
5019{ 5031 spin_lock_irqsave(ap->lock, flags);
5020 unsigned int err_mask;
5021 5032
5022 err_mask = ata_do_simple_cmd(dev, ATA_CMD_IDLEIMMEDIATE); 5033 ap->pm_mesg = mesg;
5023 if (err_mask) { 5034 if (wait) {
5024 ata_dev_printk(dev, KERN_ERR, "failed to start drive " 5035 rc = 0;
5025 "(err_mask=0x%x)\n", err_mask); 5036 ap->pm_result = &rc;
5026 return -EIO; 5037 }
5038
5039 ap->pflags |= ATA_PFLAG_PM_PENDING;
5040 ap->eh_info.action |= action;
5041 ap->eh_info.flags |= ehi_flags;
5042
5043 ata_port_schedule_eh(ap);
5044
5045 spin_unlock_irqrestore(ap->lock, flags);
5046
5047 /* wait and check result */
5048 if (wait) {
5049 ata_port_wait_eh(ap);
5050 WARN_ON(ap->pflags & ATA_PFLAG_PM_PENDING);
5051 if (rc)
5052 return rc;
5053 }
5027 } 5054 }
5028 5055
5029 return 0; 5056 return 0;
5030} 5057}
5031 5058
5032/** 5059/**
5033 * ata_device_resume - wakeup a previously suspended devices 5060 * ata_host_set_suspend - suspend host_set
5034 * @dev: the device to resume 5061 * @host_set: host_set to suspend
5062 * @mesg: PM message
5035 * 5063 *
5036 * Kick the drive back into action, by sending it an idle immediate 5064 * Suspend @host_set. Actual operation is performed by EH. This
5037 * command and making sure its transfer mode matches between drive 5065 * function requests EH to perform PM operations and waits for EH
5038 * and host. 5066 * to finish.
5039 * 5067 *
5068 * LOCKING:
5069 * Kernel thread context (may sleep).
5070 *
5071 * RETURNS:
5072 * 0 on success, -errno on failure.
5040 */ 5073 */
5041int ata_device_resume(struct ata_device *dev) 5074int ata_host_set_suspend(struct ata_host_set *host_set, pm_message_t mesg)
5042{ 5075{
5043 struct ata_port *ap = dev->ap; 5076 int i, j, rc;
5044 5077
5045 if (ap->flags & ATA_FLAG_SUSPENDED) { 5078 rc = ata_host_set_request_pm(host_set, mesg, 0, ATA_EHI_QUIET, 1);
5046 struct ata_device *failed_dev; 5079 if (rc)
5080 goto fail;
5047 5081
5048 ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT); 5082 /* EH is quiescent now. Fail if we have any ready device.
5049 ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 200000); 5083 * This happens if hotplug occurs between completion of device
5084 * suspension and here.
5085 */
5086 for (i = 0; i < host_set->n_ports; i++) {
5087 struct ata_port *ap = host_set->ports[i];
5050 5088
5051 ap->flags &= ~ATA_FLAG_SUSPENDED; 5089 for (j = 0; j < ATA_MAX_DEVICES; j++) {
5052 while (ata_set_mode(ap, &failed_dev)) 5090 struct ata_device *dev = &ap->device[j];
5053 ata_dev_disable(failed_dev); 5091
5092 if (ata_dev_ready(dev)) {
5093 ata_port_printk(ap, KERN_WARNING,
5094 "suspend failed, device %d "
5095 "still active\n", dev->devno);
5096 rc = -EBUSY;
5097 goto fail;
5098 }
5099 }
5054 } 5100 }
5055 if (!ata_dev_enabled(dev))
5056 return 0;
5057 if (dev->class == ATA_DEV_ATA)
5058 ata_start_drive(dev);
5059 5101
5102 host_set->dev->power.power_state = mesg;
5060 return 0; 5103 return 0;
5104
5105 fail:
5106 ata_host_set_resume(host_set);
5107 return rc;
5061} 5108}
5062 5109
5063/** 5110/**
5064 * ata_device_suspend - prepare a device for suspend 5111 * ata_host_set_resume - resume host_set
5065 * @dev: the device to suspend 5112 * @host_set: host_set to resume
5066 * @state: target power management state 5113 *
5114 * Resume @host_set. Actual operation is performed by EH. This
5115 * function requests EH to perform PM operations and returns.
5116 * Note that all resume operations are performed parallely.
5067 * 5117 *
5068 * Flush the cache on the drive, if appropriate, then issue a 5118 * LOCKING:
5069 * standbynow command. 5119 * Kernel thread context (may sleep).
5070 */ 5120 */
5071int ata_device_suspend(struct ata_device *dev, pm_message_t state) 5121void ata_host_set_resume(struct ata_host_set *host_set)
5072{ 5122{
5073 struct ata_port *ap = dev->ap; 5123 ata_host_set_request_pm(host_set, PMSG_ON, ATA_EH_SOFTRESET,
5074 5124 ATA_EHI_NO_AUTOPSY | ATA_EHI_QUIET, 0);
5075 if (!ata_dev_enabled(dev)) 5125 host_set->dev->power.power_state = PMSG_ON;
5076 return 0;
5077 if (dev->class == ATA_DEV_ATA)
5078 ata_flush_cache(dev);
5079
5080 if (state.event != PM_EVENT_FREEZE)
5081 ata_standby_drive(dev);
5082 ap->flags |= ATA_FLAG_SUSPENDED;
5083 return 0;
5084} 5126}
5085 5127
5086/** 5128/**
@@ -5440,6 +5482,7 @@ int ata_device_add(const struct ata_probe_ent *ent)
5440 } 5482 }
5441 5483
5442 if (ap->ops->error_handler) { 5484 if (ap->ops->error_handler) {
5485 struct ata_eh_info *ehi = &ap->eh_info;
5443 unsigned long flags; 5486 unsigned long flags;
5444 5487
5445 ata_port_probe(ap); 5488 ata_port_probe(ap);
@@ -5447,10 +5490,11 @@ int ata_device_add(const struct ata_probe_ent *ent)
5447 /* kick EH for boot probing */ 5490 /* kick EH for boot probing */
5448 spin_lock_irqsave(ap->lock, flags); 5491 spin_lock_irqsave(ap->lock, flags);
5449 5492
5450 ap->eh_info.probe_mask = (1 << ATA_MAX_DEVICES) - 1; 5493 ehi->probe_mask = (1 << ATA_MAX_DEVICES) - 1;
5451 ap->eh_info.action |= ATA_EH_SOFTRESET; 5494 ehi->action |= ATA_EH_SOFTRESET;
5495 ehi->flags |= ATA_EHI_NO_AUTOPSY | ATA_EHI_QUIET;
5452 5496
5453 ap->flags |= ATA_FLAG_LOADING; 5497 ap->pflags |= ATA_PFLAG_LOADING;
5454 ata_port_schedule_eh(ap); 5498 ata_port_schedule_eh(ap);
5455 5499
5456 spin_unlock_irqrestore(ap->lock, flags); 5500 spin_unlock_irqrestore(ap->lock, flags);
@@ -5518,7 +5562,7 @@ void ata_port_detach(struct ata_port *ap)
5518 5562
5519 /* tell EH we're leaving & flush EH */ 5563 /* tell EH we're leaving & flush EH */
5520 spin_lock_irqsave(ap->lock, flags); 5564 spin_lock_irqsave(ap->lock, flags);
5521 ap->flags |= ATA_FLAG_UNLOADING; 5565 ap->pflags |= ATA_PFLAG_UNLOADING;
5522 spin_unlock_irqrestore(ap->lock, flags); 5566 spin_unlock_irqrestore(ap->lock, flags);
5523 5567
5524 ata_port_wait_eh(ap); 5568 ata_port_wait_eh(ap);
@@ -5723,20 +5767,55 @@ int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits)
5723 return (tmp == bits->val) ? 1 : 0; 5767 return (tmp == bits->val) ? 1 : 0;
5724} 5768}
5725 5769
5726int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t state) 5770void ata_pci_device_do_suspend(struct pci_dev *pdev, pm_message_t state)
5727{ 5771{
5728 pci_save_state(pdev); 5772 pci_save_state(pdev);
5729 pci_disable_device(pdev); 5773
5730 pci_set_power_state(pdev, PCI_D3hot); 5774 if (state.event == PM_EVENT_SUSPEND) {
5731 return 0; 5775 pci_disable_device(pdev);
5776 pci_set_power_state(pdev, PCI_D3hot);
5777 }
5732} 5778}
5733 5779
5734int ata_pci_device_resume(struct pci_dev *pdev) 5780void ata_pci_device_do_resume(struct pci_dev *pdev)
5735{ 5781{
5736 pci_set_power_state(pdev, PCI_D0); 5782 pci_set_power_state(pdev, PCI_D0);
5737 pci_restore_state(pdev); 5783 pci_restore_state(pdev);
5738 pci_enable_device(pdev); 5784 pci_enable_device(pdev);
5739 pci_set_master(pdev); 5785 pci_set_master(pdev);
5786}
5787
5788int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t state)
5789{
5790 struct ata_host_set *host_set = dev_get_drvdata(&pdev->dev);
5791 int rc = 0;
5792
5793 rc = ata_host_set_suspend(host_set, state);
5794 if (rc)
5795 return rc;
5796
5797 if (host_set->next) {
5798 rc = ata_host_set_suspend(host_set->next, state);
5799 if (rc) {
5800 ata_host_set_resume(host_set);
5801 return rc;
5802 }
5803 }
5804
5805 ata_pci_device_do_suspend(pdev, state);
5806
5807 return 0;
5808}
5809
5810int ata_pci_device_resume(struct pci_dev *pdev)
5811{
5812 struct ata_host_set *host_set = dev_get_drvdata(&pdev->dev);
5813
5814 ata_pci_device_do_resume(pdev);
5815 ata_host_set_resume(host_set);
5816 if (host_set->next)
5817 ata_host_set_resume(host_set->next);
5818
5740 return 0; 5819 return 0;
5741} 5820}
5742#endif /* CONFIG_PCI */ 5821#endif /* CONFIG_PCI */
@@ -5842,9 +5921,9 @@ u32 ata_wait_register(void __iomem *reg, u32 mask, u32 val,
5842 * Do not depend on ABI/API stability. 5921 * Do not depend on ABI/API stability.
5843 */ 5922 */
5844 5923
5845EXPORT_SYMBOL_GPL(sata_deb_timing_boot); 5924EXPORT_SYMBOL_GPL(sata_deb_timing_normal);
5846EXPORT_SYMBOL_GPL(sata_deb_timing_eh); 5925EXPORT_SYMBOL_GPL(sata_deb_timing_hotplug);
5847EXPORT_SYMBOL_GPL(sata_deb_timing_before_fsrst); 5926EXPORT_SYMBOL_GPL(sata_deb_timing_long);
5848EXPORT_SYMBOL_GPL(ata_std_bios_param); 5927EXPORT_SYMBOL_GPL(ata_std_bios_param);
5849EXPORT_SYMBOL_GPL(ata_std_ports); 5928EXPORT_SYMBOL_GPL(ata_std_ports);
5850EXPORT_SYMBOL_GPL(ata_device_add); 5929EXPORT_SYMBOL_GPL(ata_device_add);
@@ -5916,6 +5995,8 @@ EXPORT_SYMBOL_GPL(sata_scr_write);
5916EXPORT_SYMBOL_GPL(sata_scr_write_flush); 5995EXPORT_SYMBOL_GPL(sata_scr_write_flush);
5917EXPORT_SYMBOL_GPL(ata_port_online); 5996EXPORT_SYMBOL_GPL(ata_port_online);
5918EXPORT_SYMBOL_GPL(ata_port_offline); 5997EXPORT_SYMBOL_GPL(ata_port_offline);
5998EXPORT_SYMBOL_GPL(ata_host_set_suspend);
5999EXPORT_SYMBOL_GPL(ata_host_set_resume);
5919EXPORT_SYMBOL_GPL(ata_id_string); 6000EXPORT_SYMBOL_GPL(ata_id_string);
5920EXPORT_SYMBOL_GPL(ata_id_c_string); 6001EXPORT_SYMBOL_GPL(ata_id_c_string);
5921EXPORT_SYMBOL_GPL(ata_scsi_simulate); 6002EXPORT_SYMBOL_GPL(ata_scsi_simulate);
@@ -5930,14 +6011,14 @@ EXPORT_SYMBOL_GPL(ata_pci_host_stop);
5930EXPORT_SYMBOL_GPL(ata_pci_init_native_mode); 6011EXPORT_SYMBOL_GPL(ata_pci_init_native_mode);
5931EXPORT_SYMBOL_GPL(ata_pci_init_one); 6012EXPORT_SYMBOL_GPL(ata_pci_init_one);
5932EXPORT_SYMBOL_GPL(ata_pci_remove_one); 6013EXPORT_SYMBOL_GPL(ata_pci_remove_one);
6014EXPORT_SYMBOL_GPL(ata_pci_device_do_suspend);
6015EXPORT_SYMBOL_GPL(ata_pci_device_do_resume);
5933EXPORT_SYMBOL_GPL(ata_pci_device_suspend); 6016EXPORT_SYMBOL_GPL(ata_pci_device_suspend);
5934EXPORT_SYMBOL_GPL(ata_pci_device_resume); 6017EXPORT_SYMBOL_GPL(ata_pci_device_resume);
5935EXPORT_SYMBOL_GPL(ata_pci_default_filter); 6018EXPORT_SYMBOL_GPL(ata_pci_default_filter);
5936EXPORT_SYMBOL_GPL(ata_pci_clear_simplex); 6019EXPORT_SYMBOL_GPL(ata_pci_clear_simplex);
5937#endif /* CONFIG_PCI */ 6020#endif /* CONFIG_PCI */
5938 6021
5939EXPORT_SYMBOL_GPL(ata_device_suspend);
5940EXPORT_SYMBOL_GPL(ata_device_resume);
5941EXPORT_SYMBOL_GPL(ata_scsi_device_suspend); 6022EXPORT_SYMBOL_GPL(ata_scsi_device_suspend);
5942EXPORT_SYMBOL_GPL(ata_scsi_device_resume); 6023EXPORT_SYMBOL_GPL(ata_scsi_device_resume);
5943 6024
diff --git a/drivers/scsi/libata-eh.c b/drivers/scsi/libata-eh.c
index bf5a72aca8a4..29f59345305d 100644
--- a/drivers/scsi/libata-eh.c
+++ b/drivers/scsi/libata-eh.c
@@ -47,6 +47,8 @@
47 47
48static void __ata_port_freeze(struct ata_port *ap); 48static void __ata_port_freeze(struct ata_port *ap);
49static void ata_eh_finish(struct ata_port *ap); 49static void ata_eh_finish(struct ata_port *ap);
50static void ata_eh_handle_port_suspend(struct ata_port *ap);
51static void ata_eh_handle_port_resume(struct ata_port *ap);
50 52
51static void ata_ering_record(struct ata_ering *ering, int is_io, 53static void ata_ering_record(struct ata_ering *ering, int is_io,
52 unsigned int err_mask) 54 unsigned int err_mask)
@@ -190,7 +192,6 @@ enum scsi_eh_timer_return ata_scsi_timed_out(struct scsi_cmnd *cmd)
190void ata_scsi_error(struct Scsi_Host *host) 192void ata_scsi_error(struct Scsi_Host *host)
191{ 193{
192 struct ata_port *ap = ata_shost_to_port(host); 194 struct ata_port *ap = ata_shost_to_port(host);
193 spinlock_t *ap_lock = ap->lock;
194 int i, repeat_cnt = ATA_EH_MAX_REPEAT; 195 int i, repeat_cnt = ATA_EH_MAX_REPEAT;
195 unsigned long flags; 196 unsigned long flags;
196 197
@@ -217,7 +218,7 @@ void ata_scsi_error(struct Scsi_Host *host)
217 struct scsi_cmnd *scmd, *tmp; 218 struct scsi_cmnd *scmd, *tmp;
218 int nr_timedout = 0; 219 int nr_timedout = 0;
219 220
220 spin_lock_irqsave(ap_lock, flags); 221 spin_lock_irqsave(ap->lock, flags);
221 222
222 list_for_each_entry_safe(scmd, tmp, &host->eh_cmd_q, eh_entry) { 223 list_for_each_entry_safe(scmd, tmp, &host->eh_cmd_q, eh_entry) {
223 struct ata_queued_cmd *qc; 224 struct ata_queued_cmd *qc;
@@ -256,43 +257,49 @@ void ata_scsi_error(struct Scsi_Host *host)
256 if (nr_timedout) 257 if (nr_timedout)
257 __ata_port_freeze(ap); 258 __ata_port_freeze(ap);
258 259
259 spin_unlock_irqrestore(ap_lock, flags); 260 spin_unlock_irqrestore(ap->lock, flags);
260 } else 261 } else
261 spin_unlock_wait(ap_lock); 262 spin_unlock_wait(ap->lock);
262 263
263 repeat: 264 repeat:
264 /* invoke error handler */ 265 /* invoke error handler */
265 if (ap->ops->error_handler) { 266 if (ap->ops->error_handler) {
267 /* process port resume request */
268 ata_eh_handle_port_resume(ap);
269
266 /* fetch & clear EH info */ 270 /* fetch & clear EH info */
267 spin_lock_irqsave(ap_lock, flags); 271 spin_lock_irqsave(ap->lock, flags);
268 272
269 memset(&ap->eh_context, 0, sizeof(ap->eh_context)); 273 memset(&ap->eh_context, 0, sizeof(ap->eh_context));
270 ap->eh_context.i = ap->eh_info; 274 ap->eh_context.i = ap->eh_info;
271 memset(&ap->eh_info, 0, sizeof(ap->eh_info)); 275 memset(&ap->eh_info, 0, sizeof(ap->eh_info));
272 276
273 ap->flags |= ATA_FLAG_EH_IN_PROGRESS; 277 ap->pflags |= ATA_PFLAG_EH_IN_PROGRESS;
274 ap->flags &= ~ATA_FLAG_EH_PENDING; 278 ap->pflags &= ~ATA_PFLAG_EH_PENDING;
275 279
276 spin_unlock_irqrestore(ap_lock, flags); 280 spin_unlock_irqrestore(ap->lock, flags);
277 281
278 /* invoke EH. if unloading, just finish failed qcs */ 282 /* invoke EH, skip if unloading or suspended */
279 if (!(ap->flags & ATA_FLAG_UNLOADING)) 283 if (!(ap->pflags & (ATA_PFLAG_UNLOADING | ATA_PFLAG_SUSPENDED)))
280 ap->ops->error_handler(ap); 284 ap->ops->error_handler(ap);
281 else 285 else
282 ata_eh_finish(ap); 286 ata_eh_finish(ap);
283 287
288 /* process port suspend request */
289 ata_eh_handle_port_suspend(ap);
290
284 /* Exception might have happend after ->error_handler 291 /* Exception might have happend after ->error_handler
285 * recovered the port but before this point. Repeat 292 * recovered the port but before this point. Repeat
286 * EH in such case. 293 * EH in such case.
287 */ 294 */
288 spin_lock_irqsave(ap_lock, flags); 295 spin_lock_irqsave(ap->lock, flags);
289 296
290 if (ap->flags & ATA_FLAG_EH_PENDING) { 297 if (ap->pflags & ATA_PFLAG_EH_PENDING) {
291 if (--repeat_cnt) { 298 if (--repeat_cnt) {
292 ata_port_printk(ap, KERN_INFO, 299 ata_port_printk(ap, KERN_INFO,
293 "EH pending after completion, " 300 "EH pending after completion, "
294 "repeating EH (cnt=%d)\n", repeat_cnt); 301 "repeating EH (cnt=%d)\n", repeat_cnt);
295 spin_unlock_irqrestore(ap_lock, flags); 302 spin_unlock_irqrestore(ap->lock, flags);
296 goto repeat; 303 goto repeat;
297 } 304 }
298 ata_port_printk(ap, KERN_ERR, "EH pending after %d " 305 ata_port_printk(ap, KERN_ERR, "EH pending after %d "
@@ -302,14 +309,14 @@ void ata_scsi_error(struct Scsi_Host *host)
302 /* this run is complete, make sure EH info is clear */ 309 /* this run is complete, make sure EH info is clear */
303 memset(&ap->eh_info, 0, sizeof(ap->eh_info)); 310 memset(&ap->eh_info, 0, sizeof(ap->eh_info));
304 311
305 /* Clear host_eh_scheduled while holding ap_lock such 312 /* Clear host_eh_scheduled while holding ap->lock such
306 * that if exception occurs after this point but 313 * that if exception occurs after this point but
307 * before EH completion, SCSI midlayer will 314 * before EH completion, SCSI midlayer will
308 * re-initiate EH. 315 * re-initiate EH.
309 */ 316 */
310 host->host_eh_scheduled = 0; 317 host->host_eh_scheduled = 0;
311 318
312 spin_unlock_irqrestore(ap_lock, flags); 319 spin_unlock_irqrestore(ap->lock, flags);
313 } else { 320 } else {
314 WARN_ON(ata_qc_from_tag(ap, ap->active_tag) == NULL); 321 WARN_ON(ata_qc_from_tag(ap, ap->active_tag) == NULL);
315 ap->ops->eng_timeout(ap); 322 ap->ops->eng_timeout(ap);
@@ -321,24 +328,23 @@ void ata_scsi_error(struct Scsi_Host *host)
321 scsi_eh_flush_done_q(&ap->eh_done_q); 328 scsi_eh_flush_done_q(&ap->eh_done_q);
322 329
323 /* clean up */ 330 /* clean up */
324 spin_lock_irqsave(ap_lock, flags); 331 spin_lock_irqsave(ap->lock, flags);
325 332
326 if (ap->flags & ATA_FLAG_LOADING) { 333 if (ap->pflags & ATA_PFLAG_LOADING)
327 ap->flags &= ~ATA_FLAG_LOADING; 334 ap->pflags &= ~ATA_PFLAG_LOADING;
328 } else { 335 else if (ap->pflags & ATA_PFLAG_SCSI_HOTPLUG)
329 if (ap->flags & ATA_FLAG_SCSI_HOTPLUG) 336 queue_work(ata_aux_wq, &ap->hotplug_task);
330 queue_work(ata_aux_wq, &ap->hotplug_task);
331 if (ap->flags & ATA_FLAG_RECOVERED)
332 ata_port_printk(ap, KERN_INFO, "EH complete\n");
333 }
334 337
335 ap->flags &= ~(ATA_FLAG_SCSI_HOTPLUG | ATA_FLAG_RECOVERED); 338 if (ap->pflags & ATA_PFLAG_RECOVERED)
339 ata_port_printk(ap, KERN_INFO, "EH complete\n");
340
341 ap->pflags &= ~(ATA_PFLAG_SCSI_HOTPLUG | ATA_PFLAG_RECOVERED);
336 342
337 /* tell wait_eh that we're done */ 343 /* tell wait_eh that we're done */
338 ap->flags &= ~ATA_FLAG_EH_IN_PROGRESS; 344 ap->pflags &= ~ATA_PFLAG_EH_IN_PROGRESS;
339 wake_up_all(&ap->eh_wait_q); 345 wake_up_all(&ap->eh_wait_q);
340 346
341 spin_unlock_irqrestore(ap_lock, flags); 347 spin_unlock_irqrestore(ap->lock, flags);
342 348
343 DPRINTK("EXIT\n"); 349 DPRINTK("EXIT\n");
344} 350}
@@ -360,7 +366,7 @@ void ata_port_wait_eh(struct ata_port *ap)
360 retry: 366 retry:
361 spin_lock_irqsave(ap->lock, flags); 367 spin_lock_irqsave(ap->lock, flags);
362 368
363 while (ap->flags & (ATA_FLAG_EH_PENDING | ATA_FLAG_EH_IN_PROGRESS)) { 369 while (ap->pflags & (ATA_PFLAG_EH_PENDING | ATA_PFLAG_EH_IN_PROGRESS)) {
364 prepare_to_wait(&ap->eh_wait_q, &wait, TASK_UNINTERRUPTIBLE); 370 prepare_to_wait(&ap->eh_wait_q, &wait, TASK_UNINTERRUPTIBLE);
365 spin_unlock_irqrestore(ap->lock, flags); 371 spin_unlock_irqrestore(ap->lock, flags);
366 schedule(); 372 schedule();
@@ -489,7 +495,7 @@ void ata_qc_schedule_eh(struct ata_queued_cmd *qc)
489 WARN_ON(!ap->ops->error_handler); 495 WARN_ON(!ap->ops->error_handler);
490 496
491 qc->flags |= ATA_QCFLAG_FAILED; 497 qc->flags |= ATA_QCFLAG_FAILED;
492 qc->ap->flags |= ATA_FLAG_EH_PENDING; 498 qc->ap->pflags |= ATA_PFLAG_EH_PENDING;
493 499
494 /* The following will fail if timeout has already expired. 500 /* The following will fail if timeout has already expired.
495 * ata_scsi_error() takes care of such scmds on EH entry. 501 * ata_scsi_error() takes care of such scmds on EH entry.
@@ -513,7 +519,7 @@ void ata_port_schedule_eh(struct ata_port *ap)
513{ 519{
514 WARN_ON(!ap->ops->error_handler); 520 WARN_ON(!ap->ops->error_handler);
515 521
516 ap->flags |= ATA_FLAG_EH_PENDING; 522 ap->pflags |= ATA_PFLAG_EH_PENDING;
517 scsi_schedule_eh(ap->host); 523 scsi_schedule_eh(ap->host);
518 524
519 DPRINTK("port EH scheduled\n"); 525 DPRINTK("port EH scheduled\n");
@@ -578,7 +584,7 @@ static void __ata_port_freeze(struct ata_port *ap)
578 if (ap->ops->freeze) 584 if (ap->ops->freeze)
579 ap->ops->freeze(ap); 585 ap->ops->freeze(ap);
580 586
581 ap->flags |= ATA_FLAG_FROZEN; 587 ap->pflags |= ATA_PFLAG_FROZEN;
582 588
583 DPRINTK("ata%u port frozen\n", ap->id); 589 DPRINTK("ata%u port frozen\n", ap->id);
584} 590}
@@ -646,7 +652,7 @@ void ata_eh_thaw_port(struct ata_port *ap)
646 652
647 spin_lock_irqsave(ap->lock, flags); 653 spin_lock_irqsave(ap->lock, flags);
648 654
649 ap->flags &= ~ATA_FLAG_FROZEN; 655 ap->pflags &= ~ATA_PFLAG_FROZEN;
650 656
651 if (ap->ops->thaw) 657 if (ap->ops->thaw)
652 ap->ops->thaw(ap); 658 ap->ops->thaw(ap);
@@ -731,7 +737,7 @@ static void ata_eh_detach_dev(struct ata_device *dev)
731 737
732 if (ata_scsi_offline_dev(dev)) { 738 if (ata_scsi_offline_dev(dev)) {
733 dev->flags |= ATA_DFLAG_DETACHED; 739 dev->flags |= ATA_DFLAG_DETACHED;
734 ap->flags |= ATA_FLAG_SCSI_HOTPLUG; 740 ap->pflags |= ATA_PFLAG_SCSI_HOTPLUG;
735 } 741 }
736 742
737 /* clear per-dev EH actions */ 743 /* clear per-dev EH actions */
@@ -758,10 +764,29 @@ static void ata_eh_about_to_do(struct ata_port *ap, struct ata_device *dev,
758 unsigned int action) 764 unsigned int action)
759{ 765{
760 unsigned long flags; 766 unsigned long flags;
767 struct ata_eh_info *ehi = &ap->eh_info;
768 struct ata_eh_context *ehc = &ap->eh_context;
761 769
762 spin_lock_irqsave(ap->lock, flags); 770 spin_lock_irqsave(ap->lock, flags);
763 ata_eh_clear_action(dev, &ap->eh_info, action); 771
764 ap->flags |= ATA_FLAG_RECOVERED; 772 /* Reset is represented by combination of actions and EHI
773 * flags. Suck in all related bits before clearing eh_info to
774 * avoid losing requested action.
775 */
776 if (action & ATA_EH_RESET_MASK) {
777 ehc->i.action |= ehi->action & ATA_EH_RESET_MASK;
778 ehc->i.flags |= ehi->flags & ATA_EHI_RESET_MODIFIER_MASK;
779
780 /* make sure all reset actions are cleared & clear EHI flags */
781 action |= ATA_EH_RESET_MASK;
782 ehi->flags &= ~ATA_EHI_RESET_MODIFIER_MASK;
783 }
784
785 ata_eh_clear_action(dev, ehi, action);
786
787 if (!(ehc->i.flags & ATA_EHI_QUIET))
788 ap->pflags |= ATA_PFLAG_RECOVERED;
789
765 spin_unlock_irqrestore(ap->lock, flags); 790 spin_unlock_irqrestore(ap->lock, flags);
766} 791}
767 792
@@ -780,6 +805,12 @@ static void ata_eh_about_to_do(struct ata_port *ap, struct ata_device *dev,
780static void ata_eh_done(struct ata_port *ap, struct ata_device *dev, 805static void ata_eh_done(struct ata_port *ap, struct ata_device *dev,
781 unsigned int action) 806 unsigned int action)
782{ 807{
808 /* if reset is complete, clear all reset actions & reset modifier */
809 if (action & ATA_EH_RESET_MASK) {
810 action |= ATA_EH_RESET_MASK;
811 ap->eh_context.i.flags &= ~ATA_EHI_RESET_MODIFIER_MASK;
812 }
813
783 ata_eh_clear_action(dev, &ap->eh_context.i, action); 814 ata_eh_clear_action(dev, &ap->eh_context.i, action);
784} 815}
785 816
@@ -1027,7 +1058,7 @@ static void ata_eh_analyze_ncq_error(struct ata_port *ap)
1027 int tag, rc; 1058 int tag, rc;
1028 1059
1029 /* if frozen, we can't do much */ 1060 /* if frozen, we can't do much */
1030 if (ap->flags & ATA_FLAG_FROZEN) 1061 if (ap->pflags & ATA_PFLAG_FROZEN)
1031 return; 1062 return;
1032 1063
1033 /* is it NCQ device error? */ 1064 /* is it NCQ device error? */
@@ -1266,8 +1297,6 @@ static int ata_eh_speed_down(struct ata_device *dev, int is_io,
1266static void ata_eh_autopsy(struct ata_port *ap) 1297static void ata_eh_autopsy(struct ata_port *ap)
1267{ 1298{
1268 struct ata_eh_context *ehc = &ap->eh_context; 1299 struct ata_eh_context *ehc = &ap->eh_context;
1269 unsigned int action = ehc->i.action;
1270 struct ata_device *failed_dev = NULL;
1271 unsigned int all_err_mask = 0; 1300 unsigned int all_err_mask = 0;
1272 int tag, is_io = 0; 1301 int tag, is_io = 0;
1273 u32 serror; 1302 u32 serror;
@@ -1275,13 +1304,16 @@ static void ata_eh_autopsy(struct ata_port *ap)
1275 1304
1276 DPRINTK("ENTER\n"); 1305 DPRINTK("ENTER\n");
1277 1306
1307 if (ehc->i.flags & ATA_EHI_NO_AUTOPSY)
1308 return;
1309
1278 /* obtain and analyze SError */ 1310 /* obtain and analyze SError */
1279 rc = sata_scr_read(ap, SCR_ERROR, &serror); 1311 rc = sata_scr_read(ap, SCR_ERROR, &serror);
1280 if (rc == 0) { 1312 if (rc == 0) {
1281 ehc->i.serror |= serror; 1313 ehc->i.serror |= serror;
1282 ata_eh_analyze_serror(ap); 1314 ata_eh_analyze_serror(ap);
1283 } else if (rc != -EOPNOTSUPP) 1315 } else if (rc != -EOPNOTSUPP)
1284 action |= ATA_EH_HARDRESET; 1316 ehc->i.action |= ATA_EH_HARDRESET;
1285 1317
1286 /* analyze NCQ failure */ 1318 /* analyze NCQ failure */
1287 ata_eh_analyze_ncq_error(ap); 1319 ata_eh_analyze_ncq_error(ap);
@@ -1302,7 +1334,7 @@ static void ata_eh_autopsy(struct ata_port *ap)
1302 qc->err_mask |= ehc->i.err_mask; 1334 qc->err_mask |= ehc->i.err_mask;
1303 1335
1304 /* analyze TF */ 1336 /* analyze TF */
1305 action |= ata_eh_analyze_tf(qc, &qc->result_tf); 1337 ehc->i.action |= ata_eh_analyze_tf(qc, &qc->result_tf);
1306 1338
1307 /* DEV errors are probably spurious in case of ATA_BUS error */ 1339 /* DEV errors are probably spurious in case of ATA_BUS error */
1308 if (qc->err_mask & AC_ERR_ATA_BUS) 1340 if (qc->err_mask & AC_ERR_ATA_BUS)
@@ -1316,38 +1348,35 @@ static void ata_eh_autopsy(struct ata_port *ap)
1316 /* SENSE_VALID trumps dev/unknown error and revalidation */ 1348 /* SENSE_VALID trumps dev/unknown error and revalidation */
1317 if (qc->flags & ATA_QCFLAG_SENSE_VALID) { 1349 if (qc->flags & ATA_QCFLAG_SENSE_VALID) {
1318 qc->err_mask &= ~(AC_ERR_DEV | AC_ERR_OTHER); 1350 qc->err_mask &= ~(AC_ERR_DEV | AC_ERR_OTHER);
1319 action &= ~ATA_EH_REVALIDATE; 1351 ehc->i.action &= ~ATA_EH_REVALIDATE;
1320 } 1352 }
1321 1353
1322 /* accumulate error info */ 1354 /* accumulate error info */
1323 failed_dev = qc->dev; 1355 ehc->i.dev = qc->dev;
1324 all_err_mask |= qc->err_mask; 1356 all_err_mask |= qc->err_mask;
1325 if (qc->flags & ATA_QCFLAG_IO) 1357 if (qc->flags & ATA_QCFLAG_IO)
1326 is_io = 1; 1358 is_io = 1;
1327 } 1359 }
1328 1360
1329 /* enforce default EH actions */ 1361 /* enforce default EH actions */
1330 if (ap->flags & ATA_FLAG_FROZEN || 1362 if (ap->pflags & ATA_PFLAG_FROZEN ||
1331 all_err_mask & (AC_ERR_HSM | AC_ERR_TIMEOUT)) 1363 all_err_mask & (AC_ERR_HSM | AC_ERR_TIMEOUT))
1332 action |= ATA_EH_SOFTRESET; 1364 ehc->i.action |= ATA_EH_SOFTRESET;
1333 else if (all_err_mask) 1365 else if (all_err_mask)
1334 action |= ATA_EH_REVALIDATE; 1366 ehc->i.action |= ATA_EH_REVALIDATE;
1335 1367
1336 /* if we have offending qcs and the associated failed device */ 1368 /* if we have offending qcs and the associated failed device */
1337 if (failed_dev) { 1369 if (ehc->i.dev) {
1338 /* speed down */ 1370 /* speed down */
1339 action |= ata_eh_speed_down(failed_dev, is_io, all_err_mask); 1371 ehc->i.action |= ata_eh_speed_down(ehc->i.dev, is_io,
1372 all_err_mask);
1340 1373
1341 /* perform per-dev EH action only on the offending device */ 1374 /* perform per-dev EH action only on the offending device */
1342 ehc->i.dev_action[failed_dev->devno] |= 1375 ehc->i.dev_action[ehc->i.dev->devno] |=
1343 action & ATA_EH_PERDEV_MASK; 1376 ehc->i.action & ATA_EH_PERDEV_MASK;
1344 action &= ~ATA_EH_PERDEV_MASK; 1377 ehc->i.action &= ~ATA_EH_PERDEV_MASK;
1345 } 1378 }
1346 1379
1347 /* record autopsy result */
1348 ehc->i.dev = failed_dev;
1349 ehc->i.action = action;
1350
1351 DPRINTK("EXIT\n"); 1380 DPRINTK("EXIT\n");
1352} 1381}
1353 1382
@@ -1385,7 +1414,7 @@ static void ata_eh_report(struct ata_port *ap)
1385 return; 1414 return;
1386 1415
1387 frozen = ""; 1416 frozen = "";
1388 if (ap->flags & ATA_FLAG_FROZEN) 1417 if (ap->pflags & ATA_PFLAG_FROZEN)
1389 frozen = " frozen"; 1418 frozen = " frozen";
1390 1419
1391 if (ehc->i.dev) { 1420 if (ehc->i.dev) {
@@ -1465,11 +1494,14 @@ static int ata_eh_reset(struct ata_port *ap, int classify,
1465 struct ata_eh_context *ehc = &ap->eh_context; 1494 struct ata_eh_context *ehc = &ap->eh_context;
1466 unsigned int *classes = ehc->classes; 1495 unsigned int *classes = ehc->classes;
1467 int tries = ATA_EH_RESET_TRIES; 1496 int tries = ATA_EH_RESET_TRIES;
1468 int verbose = !(ap->flags & ATA_FLAG_LOADING); 1497 int verbose = !(ehc->i.flags & ATA_EHI_QUIET);
1469 unsigned int action; 1498 unsigned int action;
1470 ata_reset_fn_t reset; 1499 ata_reset_fn_t reset;
1471 int i, did_followup_srst, rc; 1500 int i, did_followup_srst, rc;
1472 1501
1502 /* about to reset */
1503 ata_eh_about_to_do(ap, NULL, ehc->i.action & ATA_EH_RESET_MASK);
1504
1473 /* Determine which reset to use and record in ehc->i.action. 1505 /* Determine which reset to use and record in ehc->i.action.
1474 * prereset() may examine and modify it. 1506 * prereset() may examine and modify it.
1475 */ 1507 */
@@ -1518,8 +1550,7 @@ static int ata_eh_reset(struct ata_port *ap, int classify,
1518 ata_port_printk(ap, KERN_INFO, "%s resetting port\n", 1550 ata_port_printk(ap, KERN_INFO, "%s resetting port\n",
1519 reset == softreset ? "soft" : "hard"); 1551 reset == softreset ? "soft" : "hard");
1520 1552
1521 /* reset */ 1553 /* mark that this EH session started with reset */
1522 ata_eh_about_to_do(ap, NULL, ATA_EH_RESET_MASK);
1523 ehc->i.flags |= ATA_EHI_DID_RESET; 1554 ehc->i.flags |= ATA_EHI_DID_RESET;
1524 1555
1525 rc = ata_do_reset(ap, reset, classes); 1556 rc = ata_do_reset(ap, reset, classes);
@@ -1582,7 +1613,7 @@ static int ata_eh_reset(struct ata_port *ap, int classify,
1582 postreset(ap, classes); 1613 postreset(ap, classes);
1583 1614
1584 /* reset successful, schedule revalidation */ 1615 /* reset successful, schedule revalidation */
1585 ata_eh_done(ap, NULL, ATA_EH_RESET_MASK); 1616 ata_eh_done(ap, NULL, ehc->i.action & ATA_EH_RESET_MASK);
1586 ehc->i.action |= ATA_EH_REVALIDATE; 1617 ehc->i.action |= ATA_EH_REVALIDATE;
1587 } 1618 }
1588 1619
@@ -1605,7 +1636,7 @@ static int ata_eh_revalidate_and_attach(struct ata_port *ap,
1605 dev = &ap->device[i]; 1636 dev = &ap->device[i];
1606 action = ata_eh_dev_action(dev); 1637 action = ata_eh_dev_action(dev);
1607 1638
1608 if (action & ATA_EH_REVALIDATE && ata_dev_enabled(dev)) { 1639 if (action & ATA_EH_REVALIDATE && ata_dev_ready(dev)) {
1609 if (ata_port_offline(ap)) { 1640 if (ata_port_offline(ap)) {
1610 rc = -EIO; 1641 rc = -EIO;
1611 break; 1642 break;
@@ -1636,7 +1667,7 @@ static int ata_eh_revalidate_and_attach(struct ata_port *ap,
1636 } 1667 }
1637 1668
1638 spin_lock_irqsave(ap->lock, flags); 1669 spin_lock_irqsave(ap->lock, flags);
1639 ap->flags |= ATA_FLAG_SCSI_HOTPLUG; 1670 ap->pflags |= ATA_PFLAG_SCSI_HOTPLUG;
1640 spin_unlock_irqrestore(ap->lock, flags); 1671 spin_unlock_irqrestore(ap->lock, flags);
1641 } 1672 }
1642 } 1673 }
@@ -1648,6 +1679,164 @@ static int ata_eh_revalidate_and_attach(struct ata_port *ap,
1648 return rc; 1679 return rc;
1649} 1680}
1650 1681
1682/**
1683 * ata_eh_suspend - handle suspend EH action
1684 * @ap: target host port
1685 * @r_failed_dev: result parameter to indicate failing device
1686 *
1687 * Handle suspend EH action. Disk devices are spinned down and
1688 * other types of devices are just marked suspended. Once
1689 * suspended, no EH action to the device is allowed until it is
1690 * resumed.
1691 *
1692 * LOCKING:
1693 * Kernel thread context (may sleep).
1694 *
1695 * RETURNS:
1696 * 0 on success, -errno otherwise
1697 */
1698static int ata_eh_suspend(struct ata_port *ap, struct ata_device **r_failed_dev)
1699{
1700 struct ata_device *dev;
1701 int i, rc = 0;
1702
1703 DPRINTK("ENTER\n");
1704
1705 for (i = 0; i < ATA_MAX_DEVICES; i++) {
1706 unsigned long flags;
1707 unsigned int action, err_mask;
1708
1709 dev = &ap->device[i];
1710 action = ata_eh_dev_action(dev);
1711
1712 if (!ata_dev_enabled(dev) || !(action & ATA_EH_SUSPEND))
1713 continue;
1714
1715 WARN_ON(dev->flags & ATA_DFLAG_SUSPENDED);
1716
1717 ata_eh_about_to_do(ap, dev, ATA_EH_SUSPEND);
1718
1719 if (dev->class == ATA_DEV_ATA && !(action & ATA_EH_PM_FREEZE)) {
1720 /* flush cache */
1721 rc = ata_flush_cache(dev);
1722 if (rc)
1723 break;
1724
1725 /* spin down */
1726 err_mask = ata_do_simple_cmd(dev, ATA_CMD_STANDBYNOW1);
1727 if (err_mask) {
1728 ata_dev_printk(dev, KERN_ERR, "failed to "
1729 "spin down (err_mask=0x%x)\n",
1730 err_mask);
1731 rc = -EIO;
1732 break;
1733 }
1734 }
1735
1736 spin_lock_irqsave(ap->lock, flags);
1737 dev->flags |= ATA_DFLAG_SUSPENDED;
1738 spin_unlock_irqrestore(ap->lock, flags);
1739
1740 ata_eh_done(ap, dev, ATA_EH_SUSPEND);
1741 }
1742
1743 if (rc)
1744 *r_failed_dev = dev;
1745
1746 DPRINTK("EXIT\n");
1747 return 0;
1748}
1749
1750/**
1751 * ata_eh_prep_resume - prep for resume EH action
1752 * @ap: target host port
1753 *
1754 * Clear SUSPENDED in preparation for scheduled resume actions.
1755 * This allows other parts of EH to access the devices being
1756 * resumed.
1757 *
1758 * LOCKING:
1759 * Kernel thread context (may sleep).
1760 */
1761static void ata_eh_prep_resume(struct ata_port *ap)
1762{
1763 struct ata_device *dev;
1764 unsigned long flags;
1765 int i;
1766
1767 DPRINTK("ENTER\n");
1768
1769 for (i = 0; i < ATA_MAX_DEVICES; i++) {
1770 unsigned int action;
1771
1772 dev = &ap->device[i];
1773 action = ata_eh_dev_action(dev);
1774
1775 if (!ata_dev_enabled(dev) || !(action & ATA_EH_RESUME))
1776 continue;
1777
1778 spin_lock_irqsave(ap->lock, flags);
1779 dev->flags &= ~ATA_DFLAG_SUSPENDED;
1780 spin_unlock_irqrestore(ap->lock, flags);
1781 }
1782
1783 DPRINTK("EXIT\n");
1784}
1785
1786/**
1787 * ata_eh_resume - handle resume EH action
1788 * @ap: target host port
1789 * @r_failed_dev: result parameter to indicate failing device
1790 *
1791 * Handle resume EH action. Target devices are already reset and
1792 * revalidated. Spinning up is the only operation left.
1793 *
1794 * LOCKING:
1795 * Kernel thread context (may sleep).
1796 *
1797 * RETURNS:
1798 * 0 on success, -errno otherwise
1799 */
1800static int ata_eh_resume(struct ata_port *ap, struct ata_device **r_failed_dev)
1801{
1802 struct ata_device *dev;
1803 int i, rc = 0;
1804
1805 DPRINTK("ENTER\n");
1806
1807 for (i = 0; i < ATA_MAX_DEVICES; i++) {
1808 unsigned int action, err_mask;
1809
1810 dev = &ap->device[i];
1811 action = ata_eh_dev_action(dev);
1812
1813 if (!ata_dev_enabled(dev) || !(action & ATA_EH_RESUME))
1814 continue;
1815
1816 ata_eh_about_to_do(ap, dev, ATA_EH_RESUME);
1817
1818 if (dev->class == ATA_DEV_ATA && !(action & ATA_EH_PM_FREEZE)) {
1819 err_mask = ata_do_simple_cmd(dev,
1820 ATA_CMD_IDLEIMMEDIATE);
1821 if (err_mask) {
1822 ata_dev_printk(dev, KERN_ERR, "failed to "
1823 "spin up (err_mask=0x%x)\n",
1824 err_mask);
1825 rc = -EIO;
1826 break;
1827 }
1828 }
1829
1830 ata_eh_done(ap, dev, ATA_EH_RESUME);
1831 }
1832
1833 if (rc)
1834 *r_failed_dev = dev;
1835
1836 DPRINTK("EXIT\n");
1837 return 0;
1838}
1839
1651static int ata_port_nr_enabled(struct ata_port *ap) 1840static int ata_port_nr_enabled(struct ata_port *ap)
1652{ 1841{
1653 int i, cnt = 0; 1842 int i, cnt = 0;
@@ -1673,7 +1862,20 @@ static int ata_eh_skip_recovery(struct ata_port *ap)
1673 struct ata_eh_context *ehc = &ap->eh_context; 1862 struct ata_eh_context *ehc = &ap->eh_context;
1674 int i; 1863 int i;
1675 1864
1676 if (ap->flags & ATA_FLAG_FROZEN || ata_port_nr_enabled(ap)) 1865 /* skip if all possible devices are suspended */
1866 for (i = 0; i < ata_port_max_devices(ap); i++) {
1867 struct ata_device *dev = &ap->device[i];
1868
1869 if (!(dev->flags & ATA_DFLAG_SUSPENDED))
1870 break;
1871 }
1872
1873 if (i == ata_port_max_devices(ap))
1874 return 1;
1875
1876 /* thaw frozen port, resume link and recover failed devices */
1877 if ((ap->pflags & ATA_PFLAG_FROZEN) ||
1878 (ehc->i.flags & ATA_EHI_RESUME_LINK) || ata_port_nr_enabled(ap))
1677 return 0; 1879 return 0;
1678 1880
1679 /* skip if class codes for all vacant slots are ATA_DEV_NONE */ 1881 /* skip if class codes for all vacant slots are ATA_DEV_NONE */
@@ -1744,9 +1946,12 @@ static int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset,
1744 rc = 0; 1946 rc = 0;
1745 1947
1746 /* if UNLOADING, finish immediately */ 1948 /* if UNLOADING, finish immediately */
1747 if (ap->flags & ATA_FLAG_UNLOADING) 1949 if (ap->pflags & ATA_PFLAG_UNLOADING)
1748 goto out; 1950 goto out;
1749 1951
1952 /* prep for resume */
1953 ata_eh_prep_resume(ap);
1954
1750 /* skip EH if possible. */ 1955 /* skip EH if possible. */
1751 if (ata_eh_skip_recovery(ap)) 1956 if (ata_eh_skip_recovery(ap))
1752 ehc->i.action = 0; 1957 ehc->i.action = 0;
@@ -1774,6 +1979,11 @@ static int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset,
1774 if (rc) 1979 if (rc)
1775 goto dev_fail; 1980 goto dev_fail;
1776 1981
1982 /* resume devices */
1983 rc = ata_eh_resume(ap, &dev);
1984 if (rc)
1985 goto dev_fail;
1986
1777 /* configure transfer mode if the port has been reset */ 1987 /* configure transfer mode if the port has been reset */
1778 if (ehc->i.flags & ATA_EHI_DID_RESET) { 1988 if (ehc->i.flags & ATA_EHI_DID_RESET) {
1779 rc = ata_set_mode(ap, &dev); 1989 rc = ata_set_mode(ap, &dev);
@@ -1783,6 +1993,11 @@ static int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset,
1783 } 1993 }
1784 } 1994 }
1785 1995
1996 /* suspend devices */
1997 rc = ata_eh_suspend(ap, &dev);
1998 if (rc)
1999 goto dev_fail;
2000
1786 goto out; 2001 goto out;
1787 2002
1788 dev_fail: 2003 dev_fail:
@@ -1908,11 +2123,124 @@ void ata_do_eh(struct ata_port *ap, ata_prereset_fn_t prereset,
1908 ata_reset_fn_t softreset, ata_reset_fn_t hardreset, 2123 ata_reset_fn_t softreset, ata_reset_fn_t hardreset,
1909 ata_postreset_fn_t postreset) 2124 ata_postreset_fn_t postreset)
1910{ 2125{
1911 if (!(ap->flags & ATA_FLAG_LOADING)) { 2126 ata_eh_autopsy(ap);
1912 ata_eh_autopsy(ap); 2127 ata_eh_report(ap);
1913 ata_eh_report(ap);
1914 }
1915
1916 ata_eh_recover(ap, prereset, softreset, hardreset, postreset); 2128 ata_eh_recover(ap, prereset, softreset, hardreset, postreset);
1917 ata_eh_finish(ap); 2129 ata_eh_finish(ap);
1918} 2130}
2131
2132/**
2133 * ata_eh_handle_port_suspend - perform port suspend operation
2134 * @ap: port to suspend
2135 *
2136 * Suspend @ap.
2137 *
2138 * LOCKING:
2139 * Kernel thread context (may sleep).
2140 */
2141static void ata_eh_handle_port_suspend(struct ata_port *ap)
2142{
2143 unsigned long flags;
2144 int rc = 0;
2145
2146 /* are we suspending? */
2147 spin_lock_irqsave(ap->lock, flags);
2148 if (!(ap->pflags & ATA_PFLAG_PM_PENDING) ||
2149 ap->pm_mesg.event == PM_EVENT_ON) {
2150 spin_unlock_irqrestore(ap->lock, flags);
2151 return;
2152 }
2153 spin_unlock_irqrestore(ap->lock, flags);
2154
2155 WARN_ON(ap->pflags & ATA_PFLAG_SUSPENDED);
2156
2157 /* suspend */
2158 ata_eh_freeze_port(ap);
2159
2160 if (ap->ops->port_suspend)
2161 rc = ap->ops->port_suspend(ap, ap->pm_mesg);
2162
2163 /* report result */
2164 spin_lock_irqsave(ap->lock, flags);
2165
2166 ap->pflags &= ~ATA_PFLAG_PM_PENDING;
2167 if (rc == 0)
2168 ap->pflags |= ATA_PFLAG_SUSPENDED;
2169 else
2170 ata_port_schedule_eh(ap);
2171
2172 if (ap->pm_result) {
2173 *ap->pm_result = rc;
2174 ap->pm_result = NULL;
2175 }
2176
2177 spin_unlock_irqrestore(ap->lock, flags);
2178
2179 return;
2180}
2181
2182/**
2183 * ata_eh_handle_port_resume - perform port resume operation
2184 * @ap: port to resume
2185 *
2186 * Resume @ap.
2187 *
2188 * This function also waits upto one second until all devices
2189 * hanging off this port requests resume EH action. This is to
2190 * prevent invoking EH and thus reset multiple times on resume.
2191 *
2192 * On DPM resume, where some of devices might not be resumed
2193 * together, this may delay port resume upto one second, but such
2194 * DPM resumes are rare and 1 sec delay isn't too bad.
2195 *
2196 * LOCKING:
2197 * Kernel thread context (may sleep).
2198 */
2199static void ata_eh_handle_port_resume(struct ata_port *ap)
2200{
2201 unsigned long timeout;
2202 unsigned long flags;
2203 int i, rc = 0;
2204
2205 /* are we resuming? */
2206 spin_lock_irqsave(ap->lock, flags);
2207 if (!(ap->pflags & ATA_PFLAG_PM_PENDING) ||
2208 ap->pm_mesg.event != PM_EVENT_ON) {
2209 spin_unlock_irqrestore(ap->lock, flags);
2210 return;
2211 }
2212 spin_unlock_irqrestore(ap->lock, flags);
2213
2214 /* spurious? */
2215 if (!(ap->pflags & ATA_PFLAG_SUSPENDED))
2216 goto done;
2217
2218 if (ap->ops->port_resume)
2219 rc = ap->ops->port_resume(ap);
2220
2221 /* give devices time to request EH */
2222 timeout = jiffies + HZ; /* 1s max */
2223 while (1) {
2224 for (i = 0; i < ATA_MAX_DEVICES; i++) {
2225 struct ata_device *dev = &ap->device[i];
2226 unsigned int action = ata_eh_dev_action(dev);
2227
2228 if ((dev->flags & ATA_DFLAG_SUSPENDED) &&
2229 !(action & ATA_EH_RESUME))
2230 break;
2231 }
2232
2233 if (i == ATA_MAX_DEVICES || time_after(jiffies, timeout))
2234 break;
2235 msleep(10);
2236 }
2237
2238 done:
2239 spin_lock_irqsave(ap->lock, flags);
2240 ap->pflags &= ~(ATA_PFLAG_PM_PENDING | ATA_PFLAG_SUSPENDED);
2241 if (ap->pm_result) {
2242 *ap->pm_result = rc;
2243 ap->pm_result = NULL;
2244 }
2245 spin_unlock_irqrestore(ap->lock, flags);
2246}
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c
index 2915bca691e8..7ced41ecde86 100644
--- a/drivers/scsi/libata-scsi.c
+++ b/drivers/scsi/libata-scsi.c
@@ -397,20 +397,129 @@ void ata_dump_status(unsigned id, struct ata_taskfile *tf)
397 } 397 }
398} 398}
399 399
400int ata_scsi_device_resume(struct scsi_device *sdev) 400/**
401 * ata_scsi_device_suspend - suspend ATA device associated with sdev
402 * @sdev: the SCSI device to suspend
403 * @state: target power management state
404 *
405 * Request suspend EH action on the ATA device associated with
406 * @sdev and wait for the operation to complete.
407 *
408 * LOCKING:
409 * Kernel thread context (may sleep).
410 *
411 * RETURNS:
412 * 0 on success, -errno otherwise.
413 */
414int ata_scsi_device_suspend(struct scsi_device *sdev, pm_message_t state)
401{ 415{
402 struct ata_port *ap = ata_shost_to_port(sdev->host); 416 struct ata_port *ap = ata_shost_to_port(sdev->host);
403 struct ata_device *dev = __ata_scsi_find_dev(ap, sdev); 417 struct ata_device *dev = ata_scsi_find_dev(ap, sdev);
418 unsigned long flags;
419 unsigned int action;
420 int rc = 0;
421
422 if (!dev)
423 goto out;
424
425 spin_lock_irqsave(ap->lock, flags);
426
427 /* wait for the previous resume to complete */
428 while (dev->flags & ATA_DFLAG_SUSPENDED) {
429 spin_unlock_irqrestore(ap->lock, flags);
430 ata_port_wait_eh(ap);
431 spin_lock_irqsave(ap->lock, flags);
432 }
433
434 /* if @sdev is already detached, nothing to do */
435 if (sdev->sdev_state == SDEV_OFFLINE ||
436 sdev->sdev_state == SDEV_CANCEL || sdev->sdev_state == SDEV_DEL)
437 goto out_unlock;
438
439 /* request suspend */
440 action = ATA_EH_SUSPEND;
441 if (state.event != PM_EVENT_SUSPEND)
442 action |= ATA_EH_PM_FREEZE;
443 ap->eh_info.dev_action[dev->devno] |= action;
444 ap->eh_info.flags |= ATA_EHI_QUIET;
445 ata_port_schedule_eh(ap);
446
447 spin_unlock_irqrestore(ap->lock, flags);
448
449 /* wait for EH to do the job */
450 ata_port_wait_eh(ap);
451
452 spin_lock_irqsave(ap->lock, flags);
453
454 /* If @sdev is still attached but the associated ATA device
455 * isn't suspended, the operation failed.
456 */
457 if (sdev->sdev_state != SDEV_OFFLINE &&
458 sdev->sdev_state != SDEV_CANCEL && sdev->sdev_state != SDEV_DEL &&
459 !(dev->flags & ATA_DFLAG_SUSPENDED))
460 rc = -EIO;
404 461
405 return ata_device_resume(dev); 462 out_unlock:
463 spin_unlock_irqrestore(ap->lock, flags);
464 out:
465 if (rc == 0)
466 sdev->sdev_gendev.power.power_state = state;
467 return rc;
406} 468}
407 469
408int ata_scsi_device_suspend(struct scsi_device *sdev, pm_message_t state) 470/**
471 * ata_scsi_device_resume - resume ATA device associated with sdev
472 * @sdev: the SCSI device to resume
473 *
474 * Request resume EH action on the ATA device associated with
475 * @sdev and return immediately. This enables parallel
476 * wakeup/spinup of devices.
477 *
478 * LOCKING:
479 * Kernel thread context (may sleep).
480 *
481 * RETURNS:
482 * 0.
483 */
484int ata_scsi_device_resume(struct scsi_device *sdev)
409{ 485{
410 struct ata_port *ap = ata_shost_to_port(sdev->host); 486 struct ata_port *ap = ata_shost_to_port(sdev->host);
411 struct ata_device *dev = __ata_scsi_find_dev(ap, sdev); 487 struct ata_device *dev = ata_scsi_find_dev(ap, sdev);
488 struct ata_eh_info *ehi = &ap->eh_info;
489 unsigned long flags;
490 unsigned int action;
491
492 if (!dev)
493 goto out;
494
495 spin_lock_irqsave(ap->lock, flags);
496
497 /* if @sdev is already detached, nothing to do */
498 if (sdev->sdev_state == SDEV_OFFLINE ||
499 sdev->sdev_state == SDEV_CANCEL || sdev->sdev_state == SDEV_DEL)
500 goto out_unlock;
412 501
413 return ata_device_suspend(dev, state); 502 /* request resume */
503 action = ATA_EH_RESUME;
504 if (sdev->sdev_gendev.power.power_state.event == PM_EVENT_SUSPEND)
505 __ata_ehi_hotplugged(ehi);
506 else
507 action |= ATA_EH_PM_FREEZE | ATA_EH_SOFTRESET;
508 ehi->dev_action[dev->devno] |= action;
509
510 /* We don't want autopsy and verbose EH messages. Disable
511 * those if we're the only device on this link.
512 */
513 if (ata_port_max_devices(ap) == 1)
514 ehi->flags |= ATA_EHI_NO_AUTOPSY | ATA_EHI_QUIET;
515
516 ata_port_schedule_eh(ap);
517
518 out_unlock:
519 spin_unlock_irqrestore(ap->lock, flags);
520 out:
521 sdev->sdev_gendev.power.power_state = PMSG_ON;
522 return 0;
414} 523}
415 524
416/** 525/**
@@ -2930,7 +3039,7 @@ void ata_scsi_hotplug(void *data)
2930 struct ata_port *ap = data; 3039 struct ata_port *ap = data;
2931 int i; 3040 int i;
2932 3041
2933 if (ap->flags & ATA_FLAG_UNLOADING) { 3042 if (ap->pflags & ATA_PFLAG_UNLOADING) {
2934 DPRINTK("ENTER/EXIT - unloading\n"); 3043 DPRINTK("ENTER/EXIT - unloading\n");
2935 return; 3044 return;
2936 } 3045 }
@@ -3011,6 +3120,7 @@ static int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel,
3011 if (dev) { 3120 if (dev) {
3012 ap->eh_info.probe_mask |= 1 << dev->devno; 3121 ap->eh_info.probe_mask |= 1 << dev->devno;
3013 ap->eh_info.action |= ATA_EH_SOFTRESET; 3122 ap->eh_info.action |= ATA_EH_SOFTRESET;
3123 ap->eh_info.flags |= ATA_EHI_RESUME_LINK;
3014 } else 3124 } else
3015 rc = -EINVAL; 3125 rc = -EINVAL;
3016 } 3126 }
diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h
index f81691fcf177..d44f9aac6b8f 100644
--- a/drivers/scsi/lpfc/lpfc.h
+++ b/drivers/scsi/lpfc/lpfc.h
@@ -21,10 +21,12 @@
21 21
22struct lpfc_sli2_slim; 22struct lpfc_sli2_slim;
23 23
24#define LPFC_MAX_TARGET 256 /* max targets supported */
25#define LPFC_MAX_DISC_THREADS 64 /* max outstanding discovery els req */
26#define LPFC_MAX_NS_RETRY 3 /* max NameServer retries */
27 24
25#define LPFC_MAX_TARGET 256 /* max number of targets supported */
26#define LPFC_MAX_DISC_THREADS 64 /* max outstanding discovery els
27 requests */
28#define LPFC_MAX_NS_RETRY 3 /* Number of retry attempts to contact
29 the NameServer before giving up. */
28#define LPFC_DFT_HBA_Q_DEPTH 2048 /* max cmds per hba */ 30#define LPFC_DFT_HBA_Q_DEPTH 2048 /* max cmds per hba */
29#define LPFC_LC_HBA_Q_DEPTH 1024 /* max cmds per low cost hba */ 31#define LPFC_LC_HBA_Q_DEPTH 1024 /* max cmds per low cost hba */
30#define LPFC_LP101_HBA_Q_DEPTH 128 /* max cmds per low cost hba */ 32#define LPFC_LP101_HBA_Q_DEPTH 128 /* max cmds per low cost hba */
@@ -41,7 +43,6 @@ struct lpfc_sli2_slim;
41 (( (u64)(high)<<16 ) << 16)|( (u64)(low)))) 43 (( (u64)(high)<<16 ) << 16)|( (u64)(low))))
42/* Provide maximum configuration definitions. */ 44/* Provide maximum configuration definitions. */
43#define LPFC_DRVR_TIMEOUT 16 /* driver iocb timeout value in sec */ 45#define LPFC_DRVR_TIMEOUT 16 /* driver iocb timeout value in sec */
44#define MAX_FCP_TARGET 256 /* max num of FCP targets supported */
45#define FC_MAX_ADPTMSG 64 46#define FC_MAX_ADPTMSG 64
46 47
47#define MAX_HBAEVT 32 48#define MAX_HBAEVT 32
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
index b62a72dfab29..5c68cdd8736f 100644
--- a/drivers/scsi/lpfc/lpfc_attr.c
+++ b/drivers/scsi/lpfc/lpfc_attr.c
@@ -219,9 +219,19 @@ lpfc_issue_lip(struct Scsi_Host *host)
219 return -ENOMEM; 219 return -ENOMEM;
220 220
221 memset((void *)pmboxq, 0, sizeof (LPFC_MBOXQ_t)); 221 memset((void *)pmboxq, 0, sizeof (LPFC_MBOXQ_t));
222 lpfc_init_link(phba, pmboxq, phba->cfg_topology, phba->cfg_link_speed); 222 pmboxq->mb.mbxCommand = MBX_DOWN_LINK;
223 pmboxq->mb.mbxOwner = OWN_HOST;
224
223 mbxstatus = lpfc_sli_issue_mbox_wait(phba, pmboxq, phba->fc_ratov * 2); 225 mbxstatus = lpfc_sli_issue_mbox_wait(phba, pmboxq, phba->fc_ratov * 2);
224 226
227 if ((mbxstatus == MBX_SUCCESS) && (pmboxq->mb.mbxStatus == 0)) {
228 memset((void *)pmboxq, 0, sizeof (LPFC_MBOXQ_t));
229 lpfc_init_link(phba, pmboxq, phba->cfg_topology,
230 phba->cfg_link_speed);
231 mbxstatus = lpfc_sli_issue_mbox_wait(phba, pmboxq,
232 phba->fc_ratov * 2);
233 }
234
225 if (mbxstatus == MBX_TIMEOUT) 235 if (mbxstatus == MBX_TIMEOUT)
226 pmboxq->mbox_cmpl = lpfc_sli_def_mbox_cmpl; 236 pmboxq->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
227 else 237 else
@@ -233,51 +243,53 @@ lpfc_issue_lip(struct Scsi_Host *host)
233 return 0; 243 return 0;
234} 244}
235 245
236static ssize_t 246static int
237lpfc_nport_evt_cnt_show(struct class_device *cdev, char *buf) 247lpfc_selective_reset(struct lpfc_hba *phba)
238{ 248{
239 struct Scsi_Host *host = class_to_shost(cdev); 249 struct completion online_compl;
240 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata; 250 int status = 0;
241 return snprintf(buf, PAGE_SIZE, "%d\n", phba->nport_event_cnt); 251
252 init_completion(&online_compl);
253 lpfc_workq_post_event(phba, &status, &online_compl,
254 LPFC_EVT_OFFLINE);
255 wait_for_completion(&online_compl);
256
257 if (status != 0)
258 return -EIO;
259
260 init_completion(&online_compl);
261 lpfc_workq_post_event(phba, &status, &online_compl,
262 LPFC_EVT_ONLINE);
263 wait_for_completion(&online_compl);
264
265 if (status != 0)
266 return -EIO;
267
268 return 0;
242} 269}
243 270
244static ssize_t 271static ssize_t
245lpfc_board_online_show(struct class_device *cdev, char *buf) 272lpfc_issue_reset(struct class_device *cdev, const char *buf, size_t count)
246{ 273{
247 struct Scsi_Host *host = class_to_shost(cdev); 274 struct Scsi_Host *host = class_to_shost(cdev);
248 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata; 275 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
276 int status = -EINVAL;
249 277
250 if (phba->fc_flag & FC_OFFLINE_MODE) 278 if (strncmp(buf, "selective", sizeof("selective") - 1) == 0)
251 return snprintf(buf, PAGE_SIZE, "0\n"); 279 status = lpfc_selective_reset(phba);
280
281 if (status == 0)
282 return strlen(buf);
252 else 283 else
253 return snprintf(buf, PAGE_SIZE, "1\n"); 284 return status;
254} 285}
255 286
256static ssize_t 287static ssize_t
257lpfc_board_online_store(struct class_device *cdev, const char *buf, 288lpfc_nport_evt_cnt_show(struct class_device *cdev, char *buf)
258 size_t count)
259{ 289{
260 struct Scsi_Host *host = class_to_shost(cdev); 290 struct Scsi_Host *host = class_to_shost(cdev);
261 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata; 291 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
262 struct completion online_compl; 292 return snprintf(buf, PAGE_SIZE, "%d\n", phba->nport_event_cnt);
263 int val=0, status=0;
264
265 if (sscanf(buf, "%d", &val) != 1)
266 return -EINVAL;
267
268 init_completion(&online_compl);
269
270 if (val)
271 lpfc_workq_post_event(phba, &status, &online_compl,
272 LPFC_EVT_ONLINE);
273 else
274 lpfc_workq_post_event(phba, &status, &online_compl,
275 LPFC_EVT_OFFLINE);
276 wait_for_completion(&online_compl);
277 if (!status)
278 return strlen(buf);
279 else
280 return -EIO;
281} 293}
282 294
283static ssize_t 295static ssize_t
@@ -532,10 +544,9 @@ static CLASS_DEVICE_ATTR(lpfc_drvr_version, S_IRUGO, lpfc_drvr_version_show,
532 NULL); 544 NULL);
533static CLASS_DEVICE_ATTR(management_version, S_IRUGO, management_version_show, 545static CLASS_DEVICE_ATTR(management_version, S_IRUGO, management_version_show,
534 NULL); 546 NULL);
535static CLASS_DEVICE_ATTR(board_online, S_IRUGO | S_IWUSR,
536 lpfc_board_online_show, lpfc_board_online_store);
537static CLASS_DEVICE_ATTR(board_mode, S_IRUGO | S_IWUSR, 547static CLASS_DEVICE_ATTR(board_mode, S_IRUGO | S_IWUSR,
538 lpfc_board_mode_show, lpfc_board_mode_store); 548 lpfc_board_mode_show, lpfc_board_mode_store);
549static CLASS_DEVICE_ATTR(issue_reset, S_IWUSR, NULL, lpfc_issue_reset);
539 550
540static int lpfc_poll = 0; 551static int lpfc_poll = 0;
541module_param(lpfc_poll, int, 0); 552module_param(lpfc_poll, int, 0);
@@ -695,12 +706,12 @@ LPFC_ATTR(discovery_threads, 32, 1, 64, "Maximum number of ELS commands "
695 "during discovery"); 706 "during discovery");
696 707
697/* 708/*
698# lpfc_max_luns: maximum number of LUNs per target driver will support 709# lpfc_max_luns: maximum allowed LUN.
699# Value range is [1,32768]. Default value is 256. 710# Value range is [0,65535]. Default value is 255.
700# NOTE: The SCSI layer will scan each target for this many luns 711# NOTE: The SCSI layer might probe all allowed LUN on some old targets.
701*/ 712*/
702LPFC_ATTR_R(max_luns, 256, 1, 32768, 713LPFC_ATTR_R(max_luns, 255, 0, 65535,
703 "Maximum number of LUNs per target driver will support"); 714 "Maximum allowed LUN");
704 715
705/* 716/*
706# lpfc_poll_tmo: .Milliseconds driver will wait between polling FCP ring. 717# lpfc_poll_tmo: .Milliseconds driver will wait between polling FCP ring.
@@ -739,8 +750,8 @@ struct class_device_attribute *lpfc_host_attrs[] = {
739 &class_device_attr_lpfc_max_luns, 750 &class_device_attr_lpfc_max_luns,
740 &class_device_attr_nport_evt_cnt, 751 &class_device_attr_nport_evt_cnt,
741 &class_device_attr_management_version, 752 &class_device_attr_management_version,
742 &class_device_attr_board_online,
743 &class_device_attr_board_mode, 753 &class_device_attr_board_mode,
754 &class_device_attr_issue_reset,
744 &class_device_attr_lpfc_poll, 755 &class_device_attr_lpfc_poll,
745 &class_device_attr_lpfc_poll_tmo, 756 &class_device_attr_lpfc_poll_tmo,
746 NULL, 757 NULL,
diff --git a/drivers/scsi/lpfc/lpfc_crtn.h b/drivers/scsi/lpfc/lpfc_crtn.h
index ee22173fce43..517e9e4dd461 100644
--- a/drivers/scsi/lpfc/lpfc_crtn.h
+++ b/drivers/scsi/lpfc/lpfc_crtn.h
@@ -147,6 +147,7 @@ int lpfc_sli_hba_setup(struct lpfc_hba *);
147int lpfc_sli_hba_down(struct lpfc_hba *); 147int lpfc_sli_hba_down(struct lpfc_hba *);
148int lpfc_sli_issue_mbox(struct lpfc_hba *, LPFC_MBOXQ_t *, uint32_t); 148int lpfc_sli_issue_mbox(struct lpfc_hba *, LPFC_MBOXQ_t *, uint32_t);
149int lpfc_sli_handle_mb_event(struct lpfc_hba *); 149int lpfc_sli_handle_mb_event(struct lpfc_hba *);
150int lpfc_sli_flush_mbox_queue(struct lpfc_hba *);
150int lpfc_sli_handle_slow_ring_event(struct lpfc_hba *, 151int lpfc_sli_handle_slow_ring_event(struct lpfc_hba *,
151 struct lpfc_sli_ring *, uint32_t); 152 struct lpfc_sli_ring *, uint32_t);
152void lpfc_sli_def_mbox_cmpl(struct lpfc_hba *, LPFC_MBOXQ_t *); 153void lpfc_sli_def_mbox_cmpl(struct lpfc_hba *, LPFC_MBOXQ_t *);
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
index 4126fd87956f..b89f6cb641e6 100644
--- a/drivers/scsi/lpfc/lpfc_els.c
+++ b/drivers/scsi/lpfc/lpfc_els.c
@@ -648,33 +648,32 @@ lpfc_more_plogi(struct lpfc_hba * phba)
648} 648}
649 649
650static struct lpfc_nodelist * 650static struct lpfc_nodelist *
651lpfc_plogi_confirm_nport(struct lpfc_hba * phba, struct lpfc_iocbq * cmdiocb, 651lpfc_plogi_confirm_nport(struct lpfc_hba * phba, struct lpfc_dmabuf *prsp,
652 struct lpfc_nodelist *ndlp) 652 struct lpfc_nodelist *ndlp)
653{ 653{
654 struct lpfc_nodelist *new_ndlp; 654 struct lpfc_nodelist *new_ndlp;
655 struct lpfc_dmabuf *pcmd, *prsp;
656 uint32_t *lp; 655 uint32_t *lp;
657 struct serv_parm *sp; 656 struct serv_parm *sp;
658 uint8_t name[sizeof (struct lpfc_name)]; 657 uint8_t name[sizeof (struct lpfc_name)];
659 uint32_t rc; 658 uint32_t rc;
660 659
661 pcmd = (struct lpfc_dmabuf *) cmdiocb->context2;
662 prsp = (struct lpfc_dmabuf *) pcmd->list.next;
663 lp = (uint32_t *) prsp->virt; 660 lp = (uint32_t *) prsp->virt;
664 sp = (struct serv_parm *) ((uint8_t *) lp + sizeof (uint32_t)); 661 sp = (struct serv_parm *) ((uint8_t *) lp + sizeof (uint32_t));
662 memset(name, 0, sizeof (struct lpfc_name));
665 663
666 /* Now we to find out if the NPort we are logging into, matches the WWPN 664 /* Now we to find out if the NPort we are logging into, matches the WWPN
667 * we have for that ndlp. If not, we have some work to do. 665 * we have for that ndlp. If not, we have some work to do.
668 */ 666 */
669 new_ndlp = lpfc_findnode_wwpn(phba, NLP_SEARCH_ALL, &sp->portName); 667 new_ndlp = lpfc_findnode_wwpn(phba, NLP_SEARCH_ALL, &sp->portName);
670 668
671 memset(name, 0, sizeof (struct lpfc_name)); 669 if (new_ndlp == ndlp)
672 rc = memcmp(&ndlp->nlp_portname, name, sizeof(struct lpfc_name));
673 if (!rc || (new_ndlp == ndlp)) {
674 return ndlp; 670 return ndlp;
675 }
676 671
677 if (!new_ndlp) { 672 if (!new_ndlp) {
673 rc =
674 memcmp(&ndlp->nlp_portname, name, sizeof(struct lpfc_name));
675 if (!rc)
676 return ndlp;
678 new_ndlp = mempool_alloc(phba->nlp_mem_pool, GFP_ATOMIC); 677 new_ndlp = mempool_alloc(phba->nlp_mem_pool, GFP_ATOMIC);
679 if (!new_ndlp) 678 if (!new_ndlp)
680 return ndlp; 679 return ndlp;
@@ -683,17 +682,21 @@ lpfc_plogi_confirm_nport(struct lpfc_hba * phba, struct lpfc_iocbq * cmdiocb,
683 } 682 }
684 683
685 lpfc_unreg_rpi(phba, new_ndlp); 684 lpfc_unreg_rpi(phba, new_ndlp);
686 new_ndlp->nlp_prev_state = ndlp->nlp_state;
687 new_ndlp->nlp_DID = ndlp->nlp_DID; 685 new_ndlp->nlp_DID = ndlp->nlp_DID;
688 new_ndlp->nlp_state = NLP_STE_PLOGI_ISSUE; 686 new_ndlp->nlp_prev_state = ndlp->nlp_prev_state;
689 lpfc_nlp_list(phba, new_ndlp, NLP_PLOGI_LIST); 687 new_ndlp->nlp_state = ndlp->nlp_state;
688 lpfc_nlp_list(phba, new_ndlp, ndlp->nlp_flag & NLP_LIST_MASK);
690 689
691 /* Move this back to NPR list */ 690 /* Move this back to NPR list */
692 lpfc_unreg_rpi(phba, ndlp); 691 if (memcmp(&ndlp->nlp_portname, name, sizeof(struct lpfc_name)) == 0) {
693 ndlp->nlp_DID = 0; /* Two ndlps cannot have the same did */ 692 lpfc_nlp_list(phba, ndlp, NLP_NO_LIST);
694 ndlp->nlp_state = NLP_STE_NPR_NODE; 693 }
695 lpfc_nlp_list(phba, ndlp, NLP_NPR_LIST); 694 else {
696 695 lpfc_unreg_rpi(phba, ndlp);
696 ndlp->nlp_DID = 0; /* Two ndlps cannot have the same did */
697 ndlp->nlp_state = NLP_STE_NPR_NODE;
698 lpfc_nlp_list(phba, ndlp, NLP_NPR_LIST);
699 }
697 return new_ndlp; 700 return new_ndlp;
698} 701}
699 702
@@ -703,6 +706,7 @@ lpfc_cmpl_els_plogi(struct lpfc_hba * phba, struct lpfc_iocbq * cmdiocb,
703{ 706{
704 IOCB_t *irsp; 707 IOCB_t *irsp;
705 struct lpfc_nodelist *ndlp; 708 struct lpfc_nodelist *ndlp;
709 struct lpfc_dmabuf *prsp;
706 int disc, rc, did, type; 710 int disc, rc, did, type;
707 711
708 712
@@ -769,7 +773,10 @@ lpfc_cmpl_els_plogi(struct lpfc_hba * phba, struct lpfc_iocbq * cmdiocb,
769 } 773 }
770 } else { 774 } else {
771 /* Good status, call state machine */ 775 /* Good status, call state machine */
772 ndlp = lpfc_plogi_confirm_nport(phba, cmdiocb, ndlp); 776 prsp = list_entry(((struct lpfc_dmabuf *)
777 cmdiocb->context2)->list.next,
778 struct lpfc_dmabuf, list);
779 ndlp = lpfc_plogi_confirm_nport(phba, prsp, ndlp);
773 rc = lpfc_disc_state_machine(phba, ndlp, cmdiocb, 780 rc = lpfc_disc_state_machine(phba, ndlp, cmdiocb,
774 NLP_EVT_CMPL_PLOGI); 781 NLP_EVT_CMPL_PLOGI);
775 } 782 }
@@ -3282,10 +3289,9 @@ lpfc_els_timeout_handler(struct lpfc_hba *phba)
3282 } else 3289 } else
3283 lpfc_sli_release_iocbq(phba, piocb); 3290 lpfc_sli_release_iocbq(phba, piocb);
3284 } 3291 }
3285 if (phba->sli.ring[LPFC_ELS_RING].txcmplq_cnt) { 3292 if (phba->sli.ring[LPFC_ELS_RING].txcmplq_cnt)
3286 phba->els_tmofunc.expires = jiffies + HZ * timeout; 3293 mod_timer(&phba->els_tmofunc, jiffies + HZ * timeout);
3287 add_timer(&phba->els_tmofunc); 3294
3288 }
3289 spin_unlock_irq(phba->host->host_lock); 3295 spin_unlock_irq(phba->host->host_lock);
3290} 3296}
3291 3297
@@ -3442,6 +3448,8 @@ lpfc_els_unsol_event(struct lpfc_hba * phba,
3442 if ((did & Fabric_DID_MASK) == Fabric_DID_MASK) { 3448 if ((did & Fabric_DID_MASK) == Fabric_DID_MASK) {
3443 ndlp->nlp_type |= NLP_FABRIC; 3449 ndlp->nlp_type |= NLP_FABRIC;
3444 } 3450 }
3451 ndlp->nlp_state = NLP_STE_UNUSED_NODE;
3452 lpfc_nlp_list(phba, ndlp, NLP_UNUSED_LIST);
3445 } 3453 }
3446 3454
3447 phba->fc_stat.elsRcvFrame++; 3455 phba->fc_stat.elsRcvFrame++;
@@ -3463,13 +3471,14 @@ lpfc_els_unsol_event(struct lpfc_hba * phba,
3463 rjt_err = 1; 3471 rjt_err = 1;
3464 break; 3472 break;
3465 } 3473 }
3474 ndlp = lpfc_plogi_confirm_nport(phba, mp, ndlp);
3466 lpfc_disc_state_machine(phba, ndlp, elsiocb, NLP_EVT_RCV_PLOGI); 3475 lpfc_disc_state_machine(phba, ndlp, elsiocb, NLP_EVT_RCV_PLOGI);
3467 break; 3476 break;
3468 case ELS_CMD_FLOGI: 3477 case ELS_CMD_FLOGI:
3469 phba->fc_stat.elsRcvFLOGI++; 3478 phba->fc_stat.elsRcvFLOGI++;
3470 lpfc_els_rcv_flogi(phba, elsiocb, ndlp, newnode); 3479 lpfc_els_rcv_flogi(phba, elsiocb, ndlp, newnode);
3471 if (newnode) { 3480 if (newnode) {
3472 mempool_free( ndlp, phba->nlp_mem_pool); 3481 lpfc_nlp_list(phba, ndlp, NLP_NO_LIST);
3473 } 3482 }
3474 break; 3483 break;
3475 case ELS_CMD_LOGO: 3484 case ELS_CMD_LOGO:
@@ -3492,7 +3501,7 @@ lpfc_els_unsol_event(struct lpfc_hba * phba,
3492 phba->fc_stat.elsRcvRSCN++; 3501 phba->fc_stat.elsRcvRSCN++;
3493 lpfc_els_rcv_rscn(phba, elsiocb, ndlp, newnode); 3502 lpfc_els_rcv_rscn(phba, elsiocb, ndlp, newnode);
3494 if (newnode) { 3503 if (newnode) {
3495 mempool_free( ndlp, phba->nlp_mem_pool); 3504 lpfc_nlp_list(phba, ndlp, NLP_NO_LIST);
3496 } 3505 }
3497 break; 3506 break;
3498 case ELS_CMD_ADISC: 3507 case ELS_CMD_ADISC:
@@ -3535,28 +3544,28 @@ lpfc_els_unsol_event(struct lpfc_hba * phba,
3535 phba->fc_stat.elsRcvLIRR++; 3544 phba->fc_stat.elsRcvLIRR++;
3536 lpfc_els_rcv_lirr(phba, elsiocb, ndlp); 3545 lpfc_els_rcv_lirr(phba, elsiocb, ndlp);
3537 if (newnode) { 3546 if (newnode) {
3538 mempool_free( ndlp, phba->nlp_mem_pool); 3547 lpfc_nlp_list(phba, ndlp, NLP_NO_LIST);
3539 } 3548 }
3540 break; 3549 break;
3541 case ELS_CMD_RPS: 3550 case ELS_CMD_RPS:
3542 phba->fc_stat.elsRcvRPS++; 3551 phba->fc_stat.elsRcvRPS++;
3543 lpfc_els_rcv_rps(phba, elsiocb, ndlp); 3552 lpfc_els_rcv_rps(phba, elsiocb, ndlp);
3544 if (newnode) { 3553 if (newnode) {
3545 mempool_free( ndlp, phba->nlp_mem_pool); 3554 lpfc_nlp_list(phba, ndlp, NLP_NO_LIST);
3546 } 3555 }
3547 break; 3556 break;
3548 case ELS_CMD_RPL: 3557 case ELS_CMD_RPL:
3549 phba->fc_stat.elsRcvRPL++; 3558 phba->fc_stat.elsRcvRPL++;
3550 lpfc_els_rcv_rpl(phba, elsiocb, ndlp); 3559 lpfc_els_rcv_rpl(phba, elsiocb, ndlp);
3551 if (newnode) { 3560 if (newnode) {
3552 mempool_free( ndlp, phba->nlp_mem_pool); 3561 lpfc_nlp_list(phba, ndlp, NLP_NO_LIST);
3553 } 3562 }
3554 break; 3563 break;
3555 case ELS_CMD_RNID: 3564 case ELS_CMD_RNID:
3556 phba->fc_stat.elsRcvRNID++; 3565 phba->fc_stat.elsRcvRNID++;
3557 lpfc_els_rcv_rnid(phba, elsiocb, ndlp); 3566 lpfc_els_rcv_rnid(phba, elsiocb, ndlp);
3558 if (newnode) { 3567 if (newnode) {
3559 mempool_free( ndlp, phba->nlp_mem_pool); 3568 lpfc_nlp_list(phba, ndlp, NLP_NO_LIST);
3560 } 3569 }
3561 break; 3570 break;
3562 default: 3571 default:
@@ -3568,7 +3577,7 @@ lpfc_els_unsol_event(struct lpfc_hba * phba,
3568 "%d:0115 Unknown ELS command x%x received from " 3577 "%d:0115 Unknown ELS command x%x received from "
3569 "NPORT x%x\n", phba->brd_no, cmd, did); 3578 "NPORT x%x\n", phba->brd_no, cmd, did);
3570 if (newnode) { 3579 if (newnode) {
3571 mempool_free( ndlp, phba->nlp_mem_pool); 3580 lpfc_nlp_list(phba, ndlp, NLP_NO_LIST);
3572 } 3581 }
3573 break; 3582 break;
3574 } 3583 }
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c
index adb086009ae0..4d6cf990c4fc 100644
--- a/drivers/scsi/lpfc/lpfc_hbadisc.c
+++ b/drivers/scsi/lpfc/lpfc_hbadisc.c
@@ -1084,7 +1084,7 @@ lpfc_register_remote_port(struct lpfc_hba * phba,
1084 fc_remote_port_rolechg(rport, rport_ids.roles); 1084 fc_remote_port_rolechg(rport, rport_ids.roles);
1085 1085
1086 if ((rport->scsi_target_id != -1) && 1086 if ((rport->scsi_target_id != -1) &&
1087 (rport->scsi_target_id < MAX_FCP_TARGET)) { 1087 (rport->scsi_target_id < LPFC_MAX_TARGET)) {
1088 ndlp->nlp_sid = rport->scsi_target_id; 1088 ndlp->nlp_sid = rport->scsi_target_id;
1089 } 1089 }
1090 1090
@@ -1313,7 +1313,7 @@ lpfc_nlp_list(struct lpfc_hba * phba, struct lpfc_nodelist * nlp, int list)
1313 if ((rport_add == mapped) && 1313 if ((rport_add == mapped) &&
1314 ((!nlp->rport) || 1314 ((!nlp->rport) ||
1315 (nlp->rport->scsi_target_id == -1) || 1315 (nlp->rport->scsi_target_id == -1) ||
1316 (nlp->rport->scsi_target_id >= MAX_FCP_TARGET))) { 1316 (nlp->rport->scsi_target_id >= LPFC_MAX_TARGET))) {
1317 nlp->nlp_state = NLP_STE_UNMAPPED_NODE; 1317 nlp->nlp_state = NLP_STE_UNMAPPED_NODE;
1318 spin_lock_irq(phba->host->host_lock); 1318 spin_lock_irq(phba->host->host_lock);
1319 nlp->nlp_flag |= NLP_TGT_NO_SCSIID; 1319 nlp->nlp_flag |= NLP_TGT_NO_SCSIID;
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 81755a3f7c68..ef47b824cbed 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -71,6 +71,7 @@ lpfc_config_port_prep(struct lpfc_hba * phba)
71 uint16_t offset = 0; 71 uint16_t offset = 0;
72 static char licensed[56] = 72 static char licensed[56] =
73 "key unlock for use with gnu public licensed code only\0"; 73 "key unlock for use with gnu public licensed code only\0";
74 static int init_key = 1;
74 75
75 pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); 76 pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
76 if (!pmb) { 77 if (!pmb) {
@@ -82,10 +83,13 @@ lpfc_config_port_prep(struct lpfc_hba * phba)
82 phba->hba_state = LPFC_INIT_MBX_CMDS; 83 phba->hba_state = LPFC_INIT_MBX_CMDS;
83 84
84 if (lpfc_is_LC_HBA(phba->pcidev->device)) { 85 if (lpfc_is_LC_HBA(phba->pcidev->device)) {
85 uint32_t *ptext = (uint32_t *) licensed; 86 if (init_key) {
87 uint32_t *ptext = (uint32_t *) licensed;
86 88
87 for (i = 0; i < 56; i += sizeof (uint32_t), ptext++) 89 for (i = 0; i < 56; i += sizeof (uint32_t), ptext++)
88 *ptext = cpu_to_be32(*ptext); 90 *ptext = cpu_to_be32(*ptext);
91 init_key = 0;
92 }
89 93
90 lpfc_read_nv(phba, pmb); 94 lpfc_read_nv(phba, pmb);
91 memset((char*)mb->un.varRDnvp.rsvd3, 0, 95 memset((char*)mb->un.varRDnvp.rsvd3, 0,
@@ -405,19 +409,26 @@ lpfc_config_port_post(struct lpfc_hba * phba)
405 } 409 }
406 /* MBOX buffer will be freed in mbox compl */ 410 /* MBOX buffer will be freed in mbox compl */
407 411
408 i = 0; 412 return (0);
413}
414
415static int
416lpfc_discovery_wait(struct lpfc_hba *phba)
417{
418 int i = 0;
419
409 while ((phba->hba_state != LPFC_HBA_READY) || 420 while ((phba->hba_state != LPFC_HBA_READY) ||
410 (phba->num_disc_nodes) || (phba->fc_prli_sent) || 421 (phba->num_disc_nodes) || (phba->fc_prli_sent) ||
411 ((phba->fc_map_cnt == 0) && (i<2)) || 422 ((phba->fc_map_cnt == 0) && (i<2)) ||
412 (psli->sli_flag & LPFC_SLI_MBOX_ACTIVE)) { 423 (phba->sli.sli_flag & LPFC_SLI_MBOX_ACTIVE)) {
413 /* Check every second for 30 retries. */ 424 /* Check every second for 30 retries. */
414 i++; 425 i++;
415 if (i > 30) { 426 if (i > 30) {
416 break; 427 return -ETIMEDOUT;
417 } 428 }
418 if ((i >= 15) && (phba->hba_state <= LPFC_LINK_DOWN)) { 429 if ((i >= 15) && (phba->hba_state <= LPFC_LINK_DOWN)) {
419 /* The link is down. Set linkdown timeout */ 430 /* The link is down. Set linkdown timeout */
420 break; 431 return -ETIMEDOUT;
421 } 432 }
422 433
423 /* Delay for 1 second to give discovery time to complete. */ 434 /* Delay for 1 second to give discovery time to complete. */
@@ -425,12 +436,7 @@ lpfc_config_port_post(struct lpfc_hba * phba)
425 436
426 } 437 }
427 438
428 /* Since num_disc_nodes keys off of PLOGI, delay a bit to let 439 return 0;
429 * any potential PRLIs to flush thru the SLI sub-system.
430 */
431 msleep(50);
432
433 return (0);
434} 440}
435 441
436/************************************************************************/ 442/************************************************************************/
@@ -1339,7 +1345,8 @@ lpfc_offline(struct lpfc_hba * phba)
1339 struct lpfc_sli_ring *pring; 1345 struct lpfc_sli_ring *pring;
1340 struct lpfc_sli *psli; 1346 struct lpfc_sli *psli;
1341 unsigned long iflag; 1347 unsigned long iflag;
1342 int i = 0; 1348 int i;
1349 int cnt = 0;
1343 1350
1344 if (!phba) 1351 if (!phba)
1345 return 0; 1352 return 0;
@@ -1348,17 +1355,27 @@ lpfc_offline(struct lpfc_hba * phba)
1348 return 0; 1355 return 0;
1349 1356
1350 psli = &phba->sli; 1357 psli = &phba->sli;
1351 pring = &psli->ring[psli->fcp_ring];
1352 1358
1353 lpfc_linkdown(phba); 1359 lpfc_linkdown(phba);
1360 lpfc_sli_flush_mbox_queue(phba);
1354 1361
1355 /* The linkdown event takes 30 seconds to timeout. */ 1362 for (i = 0; i < psli->num_rings; i++) {
1356 while (pring->txcmplq_cnt) { 1363 pring = &psli->ring[i];
1357 mdelay(10); 1364 /* The linkdown event takes 30 seconds to timeout. */
1358 if (i++ > 3000) 1365 while (pring->txcmplq_cnt) {
1359 break; 1366 mdelay(10);
1367 if (cnt++ > 3000) {
1368 lpfc_printf_log(phba,
1369 KERN_WARNING, LOG_INIT,
1370 "%d:0466 Outstanding IO when "
1371 "bringing Adapter offline\n",
1372 phba->brd_no);
1373 break;
1374 }
1375 }
1360 } 1376 }
1361 1377
1378
1362 /* stop all timers associated with this hba */ 1379 /* stop all timers associated with this hba */
1363 lpfc_stop_timer(phba); 1380 lpfc_stop_timer(phba);
1364 phba->work_hba_events = 0; 1381 phba->work_hba_events = 0;
@@ -1639,6 +1656,8 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid)
1639 goto out_free_irq; 1656 goto out_free_irq;
1640 } 1657 }
1641 1658
1659 lpfc_discovery_wait(phba);
1660
1642 if (phba->cfg_poll & DISABLE_FCP_RING_INT) { 1661 if (phba->cfg_poll & DISABLE_FCP_RING_INT) {
1643 spin_lock_irq(phba->host->host_lock); 1662 spin_lock_irq(phba->host->host_lock);
1644 lpfc_poll_start_timer(phba); 1663 lpfc_poll_start_timer(phba);
diff --git a/drivers/scsi/lpfc/lpfc_mem.c b/drivers/scsi/lpfc/lpfc_mem.c
index 07017658ac56..066292d3995a 100644
--- a/drivers/scsi/lpfc/lpfc_mem.c
+++ b/drivers/scsi/lpfc/lpfc_mem.c
@@ -133,6 +133,11 @@ lpfc_mem_free(struct lpfc_hba * phba)
133 133
134 pci_pool_destroy(phba->lpfc_scsi_dma_buf_pool); 134 pci_pool_destroy(phba->lpfc_scsi_dma_buf_pool);
135 pci_pool_destroy(phba->lpfc_mbuf_pool); 135 pci_pool_destroy(phba->lpfc_mbuf_pool);
136
137 /* Free the iocb lookup array */
138 kfree(psli->iocbq_lookup);
139 psli->iocbq_lookup = NULL;
140
136} 141}
137 142
138void * 143void *
diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c
index 27d60ad897cd..bd0b0e293d63 100644
--- a/drivers/scsi/lpfc/lpfc_nportdisc.c
+++ b/drivers/scsi/lpfc/lpfc_nportdisc.c
@@ -1110,6 +1110,17 @@ lpfc_cmpl_reglogin_reglogin_issue(struct lpfc_hba * phba,
1110 phba->brd_no, 1110 phba->brd_no,
1111 did, mb->mbxStatus, phba->hba_state); 1111 did, mb->mbxStatus, phba->hba_state);
1112 1112
1113 /*
1114 * If RegLogin failed due to lack of HBA resources do not
1115 * retry discovery.
1116 */
1117 if (mb->mbxStatus == MBXERR_RPI_FULL) {
1118 ndlp->nlp_prev_state = NLP_STE_UNUSED_NODE;
1119 ndlp->nlp_state = NLP_STE_UNUSED_NODE;
1120 lpfc_nlp_list(phba, ndlp, NLP_UNUSED_LIST);
1121 return ndlp->nlp_state;
1122 }
1123
1113 /* Put ndlp in npr list set plogi timer for 1 sec */ 1124 /* Put ndlp in npr list set plogi timer for 1 sec */
1114 mod_timer(&ndlp->nlp_delayfunc, jiffies + HZ * 1); 1125 mod_timer(&ndlp->nlp_delayfunc, jiffies + HZ * 1);
1115 spin_lock_irq(phba->host->host_lock); 1126 spin_lock_irq(phba->host->host_lock);
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index aea1ee472f3d..a760a44173df 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -153,22 +153,6 @@ static void
153lpfc_release_scsi_buf(struct lpfc_hba * phba, struct lpfc_scsi_buf * psb) 153lpfc_release_scsi_buf(struct lpfc_hba * phba, struct lpfc_scsi_buf * psb)
154{ 154{
155 unsigned long iflag = 0; 155 unsigned long iflag = 0;
156 /*
157 * There are only two special cases to consider. (1) the scsi command
158 * requested scatter-gather usage or (2) the scsi command allocated
159 * a request buffer, but did not request use_sg. There is a third
160 * case, but it does not require resource deallocation.
161 */
162 if ((psb->seg_cnt > 0) && (psb->pCmd->use_sg)) {
163 dma_unmap_sg(&phba->pcidev->dev, psb->pCmd->request_buffer,
164 psb->seg_cnt, psb->pCmd->sc_data_direction);
165 } else {
166 if ((psb->nonsg_phys) && (psb->pCmd->request_bufflen)) {
167 dma_unmap_single(&phba->pcidev->dev, psb->nonsg_phys,
168 psb->pCmd->request_bufflen,
169 psb->pCmd->sc_data_direction);
170 }
171 }
172 156
173 spin_lock_irqsave(&phba->scsi_buf_list_lock, iflag); 157 spin_lock_irqsave(&phba->scsi_buf_list_lock, iflag);
174 psb->pCmd = NULL; 158 psb->pCmd = NULL;
@@ -282,6 +266,27 @@ lpfc_scsi_prep_dma_buf(struct lpfc_hba * phba, struct lpfc_scsi_buf * lpfc_cmd)
282} 266}
283 267
284static void 268static void
269lpfc_scsi_unprep_dma_buf(struct lpfc_hba * phba, struct lpfc_scsi_buf * psb)
270{
271 /*
272 * There are only two special cases to consider. (1) the scsi command
273 * requested scatter-gather usage or (2) the scsi command allocated
274 * a request buffer, but did not request use_sg. There is a third
275 * case, but it does not require resource deallocation.
276 */
277 if ((psb->seg_cnt > 0) && (psb->pCmd->use_sg)) {
278 dma_unmap_sg(&phba->pcidev->dev, psb->pCmd->request_buffer,
279 psb->seg_cnt, psb->pCmd->sc_data_direction);
280 } else {
281 if ((psb->nonsg_phys) && (psb->pCmd->request_bufflen)) {
282 dma_unmap_single(&phba->pcidev->dev, psb->nonsg_phys,
283 psb->pCmd->request_bufflen,
284 psb->pCmd->sc_data_direction);
285 }
286 }
287}
288
289static void
285lpfc_handle_fcp_err(struct lpfc_scsi_buf *lpfc_cmd) 290lpfc_handle_fcp_err(struct lpfc_scsi_buf *lpfc_cmd)
286{ 291{
287 struct scsi_cmnd *cmnd = lpfc_cmd->pCmd; 292 struct scsi_cmnd *cmnd = lpfc_cmd->pCmd;
@@ -454,6 +459,7 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
454 cmd->scsi_done(cmd); 459 cmd->scsi_done(cmd);
455 460
456 if (phba->cfg_poll & ENABLE_FCP_RING_POLLING) { 461 if (phba->cfg_poll & ENABLE_FCP_RING_POLLING) {
462 lpfc_scsi_unprep_dma_buf(phba, lpfc_cmd);
457 lpfc_release_scsi_buf(phba, lpfc_cmd); 463 lpfc_release_scsi_buf(phba, lpfc_cmd);
458 return; 464 return;
459 } 465 }
@@ -511,6 +517,7 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
511 } 517 }
512 } 518 }
513 519
520 lpfc_scsi_unprep_dma_buf(phba, lpfc_cmd);
514 lpfc_release_scsi_buf(phba, lpfc_cmd); 521 lpfc_release_scsi_buf(phba, lpfc_cmd);
515} 522}
516 523
@@ -609,6 +616,7 @@ lpfc_scsi_prep_cmnd(struct lpfc_hba * phba, struct lpfc_scsi_buf * lpfc_cmd,
609static int 616static int
610lpfc_scsi_prep_task_mgmt_cmd(struct lpfc_hba *phba, 617lpfc_scsi_prep_task_mgmt_cmd(struct lpfc_hba *phba,
611 struct lpfc_scsi_buf *lpfc_cmd, 618 struct lpfc_scsi_buf *lpfc_cmd,
619 unsigned int lun,
612 uint8_t task_mgmt_cmd) 620 uint8_t task_mgmt_cmd)
613{ 621{
614 struct lpfc_sli *psli; 622 struct lpfc_sli *psli;
@@ -627,8 +635,7 @@ lpfc_scsi_prep_task_mgmt_cmd(struct lpfc_hba *phba,
627 piocb = &piocbq->iocb; 635 piocb = &piocbq->iocb;
628 636
629 fcp_cmnd = lpfc_cmd->fcp_cmnd; 637 fcp_cmnd = lpfc_cmd->fcp_cmnd;
630 int_to_scsilun(lpfc_cmd->pCmd->device->lun, 638 int_to_scsilun(lun, &lpfc_cmd->fcp_cmnd->fcp_lun);
631 &lpfc_cmd->fcp_cmnd->fcp_lun);
632 fcp_cmnd->fcpCntl2 = task_mgmt_cmd; 639 fcp_cmnd->fcpCntl2 = task_mgmt_cmd;
633 640
634 piocb->ulpCommand = CMD_FCP_ICMND64_CR; 641 piocb->ulpCommand = CMD_FCP_ICMND64_CR;
@@ -655,14 +662,16 @@ lpfc_scsi_prep_task_mgmt_cmd(struct lpfc_hba *phba,
655 662
656static int 663static int
657lpfc_scsi_tgt_reset(struct lpfc_scsi_buf * lpfc_cmd, struct lpfc_hba * phba, 664lpfc_scsi_tgt_reset(struct lpfc_scsi_buf * lpfc_cmd, struct lpfc_hba * phba,
658 unsigned tgt_id, struct lpfc_rport_data *rdata) 665 unsigned tgt_id, unsigned int lun,
666 struct lpfc_rport_data *rdata)
659{ 667{
660 struct lpfc_iocbq *iocbq; 668 struct lpfc_iocbq *iocbq;
661 struct lpfc_iocbq *iocbqrsp; 669 struct lpfc_iocbq *iocbqrsp;
662 int ret; 670 int ret;
663 671
664 lpfc_cmd->rdata = rdata; 672 lpfc_cmd->rdata = rdata;
665 ret = lpfc_scsi_prep_task_mgmt_cmd(phba, lpfc_cmd, FCP_TARGET_RESET); 673 ret = lpfc_scsi_prep_task_mgmt_cmd(phba, lpfc_cmd, lun,
674 FCP_TARGET_RESET);
666 if (!ret) 675 if (!ret)
667 return FAILED; 676 return FAILED;
668 677
@@ -822,6 +831,7 @@ lpfc_queuecommand(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *))
822 return 0; 831 return 0;
823 832
824 out_host_busy_free_buf: 833 out_host_busy_free_buf:
834 lpfc_scsi_unprep_dma_buf(phba, lpfc_cmd);
825 lpfc_release_scsi_buf(phba, lpfc_cmd); 835 lpfc_release_scsi_buf(phba, lpfc_cmd);
826 out_host_busy: 836 out_host_busy:
827 return SCSI_MLQUEUE_HOST_BUSY; 837 return SCSI_MLQUEUE_HOST_BUSY;
@@ -969,12 +979,12 @@ lpfc_reset_lun_handler(struct scsi_cmnd *cmnd)
969 if (lpfc_cmd == NULL) 979 if (lpfc_cmd == NULL)
970 goto out; 980 goto out;
971 981
972 lpfc_cmd->pCmd = cmnd;
973 lpfc_cmd->timeout = 60; 982 lpfc_cmd->timeout = 60;
974 lpfc_cmd->scsi_hba = phba; 983 lpfc_cmd->scsi_hba = phba;
975 lpfc_cmd->rdata = rdata; 984 lpfc_cmd->rdata = rdata;
976 985
977 ret = lpfc_scsi_prep_task_mgmt_cmd(phba, lpfc_cmd, FCP_LUN_RESET); 986 ret = lpfc_scsi_prep_task_mgmt_cmd(phba, lpfc_cmd, cmnd->device->lun,
987 FCP_LUN_RESET);
978 if (!ret) 988 if (!ret)
979 goto out_free_scsi_buf; 989 goto out_free_scsi_buf;
980 990
@@ -1001,7 +1011,6 @@ lpfc_reset_lun_handler(struct scsi_cmnd *cmnd)
1001 cmd_status = iocbqrsp->iocb.ulpStatus; 1011 cmd_status = iocbqrsp->iocb.ulpStatus;
1002 1012
1003 lpfc_sli_release_iocbq(phba, iocbqrsp); 1013 lpfc_sli_release_iocbq(phba, iocbqrsp);
1004 lpfc_release_scsi_buf(phba, lpfc_cmd);
1005 1014
1006 /* 1015 /*
1007 * All outstanding txcmplq I/Os should have been aborted by the device. 1016 * All outstanding txcmplq I/Os should have been aborted by the device.
@@ -1040,6 +1049,8 @@ lpfc_reset_lun_handler(struct scsi_cmnd *cmnd)
1040 } 1049 }
1041 1050
1042out_free_scsi_buf: 1051out_free_scsi_buf:
1052 lpfc_release_scsi_buf(phba, lpfc_cmd);
1053
1043 lpfc_printf_log(phba, KERN_ERR, LOG_FCP, 1054 lpfc_printf_log(phba, KERN_ERR, LOG_FCP,
1044 "%d:0713 SCSI layer issued LUN reset (%d, %d) " 1055 "%d:0713 SCSI layer issued LUN reset (%d, %d) "
1045 "Data: x%x x%x x%x\n", 1056 "Data: x%x x%x x%x\n",
@@ -1070,7 +1081,6 @@ lpfc_reset_bus_handler(struct scsi_cmnd *cmnd)
1070 1081
1071 /* The lpfc_cmd storage is reused. Set all loop invariants. */ 1082 /* The lpfc_cmd storage is reused. Set all loop invariants. */
1072 lpfc_cmd->timeout = 60; 1083 lpfc_cmd->timeout = 60;
1073 lpfc_cmd->pCmd = cmnd;
1074 lpfc_cmd->scsi_hba = phba; 1084 lpfc_cmd->scsi_hba = phba;
1075 1085
1076 /* 1086 /*
@@ -1078,7 +1088,7 @@ lpfc_reset_bus_handler(struct scsi_cmnd *cmnd)
1078 * targets known to the driver. Should any target reset 1088 * targets known to the driver. Should any target reset
1079 * fail, this routine returns failure to the midlayer. 1089 * fail, this routine returns failure to the midlayer.
1080 */ 1090 */
1081 for (i = 0; i < MAX_FCP_TARGET; i++) { 1091 for (i = 0; i < LPFC_MAX_TARGET; i++) {
1082 /* Search the mapped list for this target ID */ 1092 /* Search the mapped list for this target ID */
1083 match = 0; 1093 match = 0;
1084 list_for_each_entry(ndlp, &phba->fc_nlpmap_list, nlp_listp) { 1094 list_for_each_entry(ndlp, &phba->fc_nlpmap_list, nlp_listp) {
@@ -1090,8 +1100,8 @@ lpfc_reset_bus_handler(struct scsi_cmnd *cmnd)
1090 if (!match) 1100 if (!match)
1091 continue; 1101 continue;
1092 1102
1093 ret = lpfc_scsi_tgt_reset(lpfc_cmd, phba, 1103 ret = lpfc_scsi_tgt_reset(lpfc_cmd, phba, i, cmnd->device->lun,
1094 i, ndlp->rport->dd_data); 1104 ndlp->rport->dd_data);
1095 if (ret != SUCCESS) { 1105 if (ret != SUCCESS) {
1096 lpfc_printf_log(phba, KERN_ERR, LOG_FCP, 1106 lpfc_printf_log(phba, KERN_ERR, LOG_FCP,
1097 "%d:0713 Bus Reset on target %d failed\n", 1107 "%d:0713 Bus Reset on target %d failed\n",
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index bb69a7a1ec59..350a625fa224 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -191,35 +191,12 @@ static int
191lpfc_sli_ringtxcmpl_put(struct lpfc_hba * phba, 191lpfc_sli_ringtxcmpl_put(struct lpfc_hba * phba,
192 struct lpfc_sli_ring * pring, struct lpfc_iocbq * piocb) 192 struct lpfc_sli_ring * pring, struct lpfc_iocbq * piocb)
193{ 193{
194 uint16_t iotag;
195
196 list_add_tail(&piocb->list, &pring->txcmplq); 194 list_add_tail(&piocb->list, &pring->txcmplq);
197 pring->txcmplq_cnt++; 195 pring->txcmplq_cnt++;
198 if (unlikely(pring->ringno == LPFC_ELS_RING)) 196 if (unlikely(pring->ringno == LPFC_ELS_RING))
199 mod_timer(&phba->els_tmofunc, 197 mod_timer(&phba->els_tmofunc,
200 jiffies + HZ * (phba->fc_ratov << 1)); 198 jiffies + HZ * (phba->fc_ratov << 1));
201 199
202 if (pring->fast_lookup) {
203 /* Setup fast lookup based on iotag for completion */
204 iotag = piocb->iocb.ulpIoTag;
205 if (iotag && (iotag < pring->fast_iotag))
206 *(pring->fast_lookup + iotag) = piocb;
207 else {
208
209 /* Cmd ring <ringno> put: iotag <iotag> greater then
210 configured max <fast_iotag> wd0 <icmd> */
211 lpfc_printf_log(phba,
212 KERN_ERR,
213 LOG_SLI,
214 "%d:0316 Cmd ring %d put: iotag x%x "
215 "greater then configured max x%x "
216 "wd0 x%x\n",
217 phba->brd_no,
218 pring->ringno, iotag,
219 pring->fast_iotag,
220 *(((uint32_t *)(&piocb->iocb)) + 7));
221 }
222 }
223 return (0); 200 return (0);
224} 201}
225 202
@@ -601,7 +578,7 @@ lpfc_sli_handle_mb_event(struct lpfc_hba * phba)
601 /* Stray Mailbox Interrupt, mbxCommand <cmd> mbxStatus 578 /* Stray Mailbox Interrupt, mbxCommand <cmd> mbxStatus
602 <status> */ 579 <status> */
603 lpfc_printf_log(phba, 580 lpfc_printf_log(phba,
604 KERN_ERR, 581 KERN_WARNING,
605 LOG_MBOX | LOG_SLI, 582 LOG_MBOX | LOG_SLI,
606 "%d:0304 Stray Mailbox Interrupt " 583 "%d:0304 Stray Mailbox Interrupt "
607 "mbxCommand x%x mbxStatus x%x\n", 584 "mbxCommand x%x mbxStatus x%x\n",
@@ -1570,8 +1547,8 @@ lpfc_sli_brdready(struct lpfc_hba * phba, uint32_t mask)
1570 1547
1571void lpfc_reset_barrier(struct lpfc_hba * phba) 1548void lpfc_reset_barrier(struct lpfc_hba * phba)
1572{ 1549{
1573 uint32_t * resp_buf; 1550 uint32_t __iomem *resp_buf;
1574 uint32_t * mbox_buf; 1551 uint32_t __iomem *mbox_buf;
1575 volatile uint32_t mbox; 1552 volatile uint32_t mbox;
1576 uint32_t hc_copy; 1553 uint32_t hc_copy;
1577 int i; 1554 int i;
@@ -1587,7 +1564,7 @@ void lpfc_reset_barrier(struct lpfc_hba * phba)
1587 * Tell the other part of the chip to suspend temporarily all 1564 * Tell the other part of the chip to suspend temporarily all
1588 * its DMA activity. 1565 * its DMA activity.
1589 */ 1566 */
1590 resp_buf = (uint32_t *)phba->MBslimaddr; 1567 resp_buf = phba->MBslimaddr;
1591 1568
1592 /* Disable the error attention */ 1569 /* Disable the error attention */
1593 hc_copy = readl(phba->HCregaddr); 1570 hc_copy = readl(phba->HCregaddr);
@@ -1605,7 +1582,7 @@ void lpfc_reset_barrier(struct lpfc_hba * phba)
1605 ((MAILBOX_t *)&mbox)->mbxOwner = OWN_CHIP; 1582 ((MAILBOX_t *)&mbox)->mbxOwner = OWN_CHIP;
1606 1583
1607 writel(BARRIER_TEST_PATTERN, (resp_buf + 1)); 1584 writel(BARRIER_TEST_PATTERN, (resp_buf + 1));
1608 mbox_buf = (uint32_t *)phba->MBslimaddr; 1585 mbox_buf = phba->MBslimaddr;
1609 writel(mbox, mbox_buf); 1586 writel(mbox, mbox_buf);
1610 1587
1611 for (i = 0; 1588 for (i = 0;
@@ -1805,7 +1782,7 @@ lpfc_sli_brdrestart(struct lpfc_hba * phba)
1805 skip_post = 0; 1782 skip_post = 0;
1806 word0 = 0; /* This is really setting up word1 */ 1783 word0 = 0; /* This is really setting up word1 */
1807 } 1784 }
1808 to_slim = (uint8_t *) phba->MBslimaddr + sizeof (uint32_t); 1785 to_slim = phba->MBslimaddr + sizeof (uint32_t);
1809 writel(*(uint32_t *) mb, to_slim); 1786 writel(*(uint32_t *) mb, to_slim);
1810 readl(to_slim); /* flush */ 1787 readl(to_slim); /* flush */
1811 1788
@@ -2659,8 +2636,6 @@ lpfc_sli_hba_down(struct lpfc_hba * phba)
2659 2636
2660 INIT_LIST_HEAD(&(pring->txq)); 2637 INIT_LIST_HEAD(&(pring->txq));
2661 2638
2662 kfree(pring->fast_lookup);
2663 pring->fast_lookup = NULL;
2664 } 2639 }
2665 2640
2666 spin_unlock_irqrestore(phba->host->host_lock, flags); 2641 spin_unlock_irqrestore(phba->host->host_lock, flags);
@@ -3110,6 +3085,24 @@ lpfc_sli_issue_mbox_wait(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmboxq,
3110 return retval; 3085 return retval;
3111} 3086}
3112 3087
3088int
3089lpfc_sli_flush_mbox_queue(struct lpfc_hba * phba)
3090{
3091 int i = 0;
3092
3093 while (phba->sli.sli_flag & LPFC_SLI_MBOX_ACTIVE && !phba->stopped) {
3094 if (i++ > LPFC_MBOX_TMO * 1000)
3095 return 1;
3096
3097 if (lpfc_sli_handle_mb_event(phba) == 0)
3098 i = 0;
3099
3100 msleep(1);
3101 }
3102
3103 return (phba->sli.sli_flag & LPFC_SLI_MBOX_ACTIVE) ? 1 : 0;
3104}
3105
3113irqreturn_t 3106irqreturn_t
3114lpfc_intr_handler(int irq, void *dev_id, struct pt_regs * regs) 3107lpfc_intr_handler(int irq, void *dev_id, struct pt_regs * regs)
3115{ 3108{
diff --git a/drivers/scsi/lpfc/lpfc_sli.h b/drivers/scsi/lpfc/lpfc_sli.h
index a52d6c6cf083..d8ef0d2894d4 100644
--- a/drivers/scsi/lpfc/lpfc_sli.h
+++ b/drivers/scsi/lpfc/lpfc_sli.h
@@ -135,8 +135,6 @@ struct lpfc_sli_ring {
135 uint32_t fast_iotag; /* max fastlookup based iotag */ 135 uint32_t fast_iotag; /* max fastlookup based iotag */
136 uint32_t iotag_ctr; /* keeps track of the next iotag to use */ 136 uint32_t iotag_ctr; /* keeps track of the next iotag to use */
137 uint32_t iotag_max; /* max iotag value to use */ 137 uint32_t iotag_max; /* max iotag value to use */
138 struct lpfc_iocbq ** fast_lookup; /* array of IOCB ptrs indexed by
139 iotag */
140 struct list_head txq; 138 struct list_head txq;
141 uint16_t txq_cnt; /* current length of queue */ 139 uint16_t txq_cnt; /* current length of queue */
142 uint16_t txq_max; /* max length */ 140 uint16_t txq_max; /* max length */
diff --git a/drivers/scsi/lpfc/lpfc_version.h b/drivers/scsi/lpfc/lpfc_version.h
index 6b737568b831..10e89c6ae823 100644
--- a/drivers/scsi/lpfc/lpfc_version.h
+++ b/drivers/scsi/lpfc/lpfc_version.h
@@ -18,7 +18,7 @@
18 * included with this package. * 18 * included with this package. *
19 *******************************************************************/ 19 *******************************************************************/
20 20
21#define LPFC_DRIVER_VERSION "8.1.6" 21#define LPFC_DRIVER_VERSION "8.1.7"
22 22
23#define LPFC_DRIVER_NAME "lpfc" 23#define LPFC_DRIVER_NAME "lpfc"
24 24
diff --git a/drivers/scsi/mac53c94.c b/drivers/scsi/mac53c94.c
index 93edaa8696cf..89ef34df5a1d 100644
--- a/drivers/scsi/mac53c94.c
+++ b/drivers/scsi/mac53c94.c
@@ -378,7 +378,7 @@ static void set_dma_cmds(struct fsc_state *state, struct scsi_cmnd *cmd)
378 int nseg; 378 int nseg;
379 379
380 total = 0; 380 total = 0;
381 scl = (struct scatterlist *) cmd->buffer; 381 scl = (struct scatterlist *) cmd->request_buffer;
382 nseg = pci_map_sg(state->pdev, scl, cmd->use_sg, 382 nseg = pci_map_sg(state->pdev, scl, cmd->use_sg,
383 cmd->sc_data_direction); 383 cmd->sc_data_direction);
384 for (i = 0; i < nseg; ++i) { 384 for (i = 0; i < nseg; ++i) {
diff --git a/drivers/scsi/mesh.c b/drivers/scsi/mesh.c
index c88717727be8..5572981a9f92 100644
--- a/drivers/scsi/mesh.c
+++ b/drivers/scsi/mesh.c
@@ -1268,7 +1268,7 @@ static void set_dma_cmds(struct mesh_state *ms, struct scsi_cmnd *cmd)
1268 if (cmd->use_sg > 0) { 1268 if (cmd->use_sg > 0) {
1269 int nseg; 1269 int nseg;
1270 total = 0; 1270 total = 0;
1271 scl = (struct scatterlist *) cmd->buffer; 1271 scl = (struct scatterlist *) cmd->request_buffer;
1272 off = ms->data_ptr; 1272 off = ms->data_ptr;
1273 nseg = pci_map_sg(ms->pdev, scl, cmd->use_sg, 1273 nseg = pci_map_sg(ms->pdev, scl, cmd->use_sg,
1274 cmd->sc_data_direction); 1274 cmd->sc_data_direction);
diff --git a/drivers/scsi/pluto.c b/drivers/scsi/pluto.c
index 7abf64d1bfc9..0bd9c60e6455 100644
--- a/drivers/scsi/pluto.c
+++ b/drivers/scsi/pluto.c
@@ -169,8 +169,6 @@ int __init pluto_detect(struct scsi_host_template *tpnt)
169 SCpnt->request->rq_status = RQ_SCSI_BUSY; 169 SCpnt->request->rq_status = RQ_SCSI_BUSY;
170 170
171 SCpnt->done = pluto_detect_done; 171 SCpnt->done = pluto_detect_done;
172 SCpnt->bufflen = 256;
173 SCpnt->buffer = fcs[i].inquiry;
174 SCpnt->request_bufflen = 256; 172 SCpnt->request_bufflen = 256;
175 SCpnt->request_buffer = fcs[i].inquiry; 173 SCpnt->request_buffer = fcs[i].inquiry;
176 PLD(("set up %d %08lx\n", i, (long)SCpnt)) 174 PLD(("set up %d %08lx\n", i, (long)SCpnt))
diff --git a/drivers/scsi/qlogicpti.c b/drivers/scsi/qlogicpti.c
index 69e0551a81d2..5b2f0741a55b 100644
--- a/drivers/scsi/qlogicpti.c
+++ b/drivers/scsi/qlogicpti.c
@@ -874,7 +874,7 @@ static inline int load_cmd(struct scsi_cmnd *Cmnd, struct Command_Entry *cmd,
874 if (Cmnd->use_sg) { 874 if (Cmnd->use_sg) {
875 int sg_count; 875 int sg_count;
876 876
877 sg = (struct scatterlist *) Cmnd->buffer; 877 sg = (struct scatterlist *) Cmnd->request_buffer;
878 sg_count = sbus_map_sg(qpti->sdev, sg, Cmnd->use_sg, Cmnd->sc_data_direction); 878 sg_count = sbus_map_sg(qpti->sdev, sg, Cmnd->use_sg, Cmnd->sc_data_direction);
879 879
880 ds = cmd->dataseg; 880 ds = cmd->dataseg;
@@ -1278,7 +1278,7 @@ static struct scsi_cmnd *qlogicpti_intr_handler(struct qlogicpti *qpti)
1278 1278
1279 if (Cmnd->use_sg) { 1279 if (Cmnd->use_sg) {
1280 sbus_unmap_sg(qpti->sdev, 1280 sbus_unmap_sg(qpti->sdev,
1281 (struct scatterlist *)Cmnd->buffer, 1281 (struct scatterlist *)Cmnd->request_buffer,
1282 Cmnd->use_sg, 1282 Cmnd->use_sg,
1283 Cmnd->sc_data_direction); 1283 Cmnd->sc_data_direction);
1284 } else { 1284 } else {
diff --git a/drivers/scsi/sata_promise.c b/drivers/scsi/sata_promise.c
index 64631bd38952..4776f4e55839 100644
--- a/drivers/scsi/sata_promise.c
+++ b/drivers/scsi/sata_promise.c
@@ -269,8 +269,15 @@ static const struct pci_device_id pdc_ata_pci_tbl[] = {
269 { PCI_VENDOR_ID_PROMISE, 0x6629, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 269 { PCI_VENDOR_ID_PROMISE, 0x6629, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
270 board_20619 }, 270 board_20619 },
271 271
272/* TODO: remove all associated board_20771 code, as it completely
273 * duplicates board_2037x code, unless reason for separation can be
274 * divined.
275 */
276#if 0
272 { PCI_VENDOR_ID_PROMISE, 0x3570, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 277 { PCI_VENDOR_ID_PROMISE, 0x3570, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
273 board_20771 }, 278 board_20771 },
279#endif
280
274 { } /* terminate list */ 281 { } /* terminate list */
275}; 282};
276 283
diff --git a/drivers/scsi/sata_sil.c b/drivers/scsi/sata_sil.c
index 7aabb45c35e5..d0a85073ebf7 100644
--- a/drivers/scsi/sata_sil.c
+++ b/drivers/scsi/sata_sil.c
@@ -109,6 +109,7 @@ enum {
109}; 109};
110 110
111static int sil_init_one (struct pci_dev *pdev, const struct pci_device_id *ent); 111static int sil_init_one (struct pci_dev *pdev, const struct pci_device_id *ent);
112static int sil_pci_device_resume(struct pci_dev *pdev);
112static void sil_dev_config(struct ata_port *ap, struct ata_device *dev); 113static void sil_dev_config(struct ata_port *ap, struct ata_device *dev);
113static u32 sil_scr_read (struct ata_port *ap, unsigned int sc_reg); 114static u32 sil_scr_read (struct ata_port *ap, unsigned int sc_reg);
114static void sil_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val); 115static void sil_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val);
@@ -160,6 +161,8 @@ static struct pci_driver sil_pci_driver = {
160 .id_table = sil_pci_tbl, 161 .id_table = sil_pci_tbl,
161 .probe = sil_init_one, 162 .probe = sil_init_one,
162 .remove = ata_pci_remove_one, 163 .remove = ata_pci_remove_one,
164 .suspend = ata_pci_device_suspend,
165 .resume = sil_pci_device_resume,
163}; 166};
164 167
165static struct scsi_host_template sil_sht = { 168static struct scsi_host_template sil_sht = {
@@ -178,6 +181,8 @@ static struct scsi_host_template sil_sht = {
178 .slave_configure = ata_scsi_slave_config, 181 .slave_configure = ata_scsi_slave_config,
179 .slave_destroy = ata_scsi_slave_destroy, 182 .slave_destroy = ata_scsi_slave_destroy,
180 .bios_param = ata_std_bios_param, 183 .bios_param = ata_std_bios_param,
184 .suspend = ata_scsi_device_suspend,
185 .resume = ata_scsi_device_resume,
181}; 186};
182 187
183static const struct ata_port_operations sil_ops = { 188static const struct ata_port_operations sil_ops = {
@@ -370,7 +375,7 @@ static void sil_host_intr(struct ata_port *ap, u32 bmdma2)
370 * during hardreset makes controllers with broken SIEN 375 * during hardreset makes controllers with broken SIEN
371 * repeat probing needlessly. 376 * repeat probing needlessly.
372 */ 377 */
373 if (!(ap->flags & ATA_FLAG_FROZEN)) { 378 if (!(ap->pflags & ATA_PFLAG_FROZEN)) {
374 ata_ehi_hotplugged(&ap->eh_info); 379 ata_ehi_hotplugged(&ap->eh_info);
375 ap->eh_info.serror |= serror; 380 ap->eh_info.serror |= serror;
376 } 381 }
@@ -561,6 +566,52 @@ static void sil_dev_config(struct ata_port *ap, struct ata_device *dev)
561 } 566 }
562} 567}
563 568
569static void sil_init_controller(struct pci_dev *pdev,
570 int n_ports, unsigned long host_flags,
571 void __iomem *mmio_base)
572{
573 u8 cls;
574 u32 tmp;
575 int i;
576
577 /* Initialize FIFO PCI bus arbitration */
578 cls = sil_get_device_cache_line(pdev);
579 if (cls) {
580 cls >>= 3;
581 cls++; /* cls = (line_size/8)+1 */
582 for (i = 0; i < n_ports; i++)
583 writew(cls << 8 | cls,
584 mmio_base + sil_port[i].fifo_cfg);
585 } else
586 dev_printk(KERN_WARNING, &pdev->dev,
587 "cache line size not set. Driver may not function\n");
588
589 /* Apply R_ERR on DMA activate FIS errata workaround */
590 if (host_flags & SIL_FLAG_RERR_ON_DMA_ACT) {
591 int cnt;
592
593 for (i = 0, cnt = 0; i < n_ports; i++) {
594 tmp = readl(mmio_base + sil_port[i].sfis_cfg);
595 if ((tmp & 0x3) != 0x01)
596 continue;
597 if (!cnt)
598 dev_printk(KERN_INFO, &pdev->dev,
599 "Applying R_ERR on DMA activate "
600 "FIS errata fix\n");
601 writel(tmp & ~0x3, mmio_base + sil_port[i].sfis_cfg);
602 cnt++;
603 }
604 }
605
606 if (n_ports == 4) {
607 /* flip the magic "make 4 ports work" bit */
608 tmp = readl(mmio_base + sil_port[2].bmdma);
609 if ((tmp & SIL_INTR_STEERING) == 0)
610 writel(tmp | SIL_INTR_STEERING,
611 mmio_base + sil_port[2].bmdma);
612 }
613}
614
564static int sil_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) 615static int sil_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
565{ 616{
566 static int printed_version; 617 static int printed_version;
@@ -570,8 +621,6 @@ static int sil_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
570 int rc; 621 int rc;
571 unsigned int i; 622 unsigned int i;
572 int pci_dev_busy = 0; 623 int pci_dev_busy = 0;
573 u32 tmp;
574 u8 cls;
575 624
576 if (!printed_version++) 625 if (!printed_version++)
577 dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n"); 626 dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
@@ -630,42 +679,8 @@ static int sil_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
630 ata_std_ports(&probe_ent->port[i]); 679 ata_std_ports(&probe_ent->port[i]);
631 } 680 }
632 681
633 /* Initialize FIFO PCI bus arbitration */ 682 sil_init_controller(pdev, probe_ent->n_ports, probe_ent->host_flags,
634 cls = sil_get_device_cache_line(pdev); 683 mmio_base);
635 if (cls) {
636 cls >>= 3;
637 cls++; /* cls = (line_size/8)+1 */
638 for (i = 0; i < probe_ent->n_ports; i++)
639 writew(cls << 8 | cls,
640 mmio_base + sil_port[i].fifo_cfg);
641 } else
642 dev_printk(KERN_WARNING, &pdev->dev,
643 "cache line size not set. Driver may not function\n");
644
645 /* Apply R_ERR on DMA activate FIS errata workaround */
646 if (probe_ent->host_flags & SIL_FLAG_RERR_ON_DMA_ACT) {
647 int cnt;
648
649 for (i = 0, cnt = 0; i < probe_ent->n_ports; i++) {
650 tmp = readl(mmio_base + sil_port[i].sfis_cfg);
651 if ((tmp & 0x3) != 0x01)
652 continue;
653 if (!cnt)
654 dev_printk(KERN_INFO, &pdev->dev,
655 "Applying R_ERR on DMA activate "
656 "FIS errata fix\n");
657 writel(tmp & ~0x3, mmio_base + sil_port[i].sfis_cfg);
658 cnt++;
659 }
660 }
661
662 if (ent->driver_data == sil_3114) {
663 /* flip the magic "make 4 ports work" bit */
664 tmp = readl(mmio_base + sil_port[2].bmdma);
665 if ((tmp & SIL_INTR_STEERING) == 0)
666 writel(tmp | SIL_INTR_STEERING,
667 mmio_base + sil_port[2].bmdma);
668 }
669 684
670 pci_set_master(pdev); 685 pci_set_master(pdev);
671 686
@@ -685,6 +700,18 @@ err_out:
685 return rc; 700 return rc;
686} 701}
687 702
703static int sil_pci_device_resume(struct pci_dev *pdev)
704{
705 struct ata_host_set *host_set = dev_get_drvdata(&pdev->dev);
706
707 ata_pci_device_do_resume(pdev);
708 sil_init_controller(pdev, host_set->n_ports, host_set->ports[0]->flags,
709 host_set->mmio_base);
710 ata_host_set_resume(host_set);
711
712 return 0;
713}
714
688static int __init sil_init(void) 715static int __init sil_init(void)
689{ 716{
690 return pci_module_init(&sil_pci_driver); 717 return pci_module_init(&sil_pci_driver);
diff --git a/drivers/scsi/sata_sil24.c b/drivers/scsi/sata_sil24.c
index 07a1c6a8a414..2e0f4a4076af 100644
--- a/drivers/scsi/sata_sil24.c
+++ b/drivers/scsi/sata_sil24.c
@@ -92,6 +92,7 @@ enum {
92 HOST_CTRL_STOP = (1 << 18), /* latched PCI STOP */ 92 HOST_CTRL_STOP = (1 << 18), /* latched PCI STOP */
93 HOST_CTRL_DEVSEL = (1 << 19), /* latched PCI DEVSEL */ 93 HOST_CTRL_DEVSEL = (1 << 19), /* latched PCI DEVSEL */
94 HOST_CTRL_REQ64 = (1 << 20), /* latched PCI REQ64 */ 94 HOST_CTRL_REQ64 = (1 << 20), /* latched PCI REQ64 */
95 HOST_CTRL_GLOBAL_RST = (1 << 31), /* global reset */
95 96
96 /* 97 /*
97 * Port registers 98 * Port registers
@@ -338,6 +339,7 @@ static int sil24_port_start(struct ata_port *ap);
338static void sil24_port_stop(struct ata_port *ap); 339static void sil24_port_stop(struct ata_port *ap);
339static void sil24_host_stop(struct ata_host_set *host_set); 340static void sil24_host_stop(struct ata_host_set *host_set);
340static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent); 341static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
342static int sil24_pci_device_resume(struct pci_dev *pdev);
341 343
342static const struct pci_device_id sil24_pci_tbl[] = { 344static const struct pci_device_id sil24_pci_tbl[] = {
343 { 0x1095, 0x3124, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BID_SIL3124 }, 345 { 0x1095, 0x3124, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BID_SIL3124 },
@@ -353,6 +355,8 @@ static struct pci_driver sil24_pci_driver = {
353 .id_table = sil24_pci_tbl, 355 .id_table = sil24_pci_tbl,
354 .probe = sil24_init_one, 356 .probe = sil24_init_one,
355 .remove = ata_pci_remove_one, /* safe? */ 357 .remove = ata_pci_remove_one, /* safe? */
358 .suspend = ata_pci_device_suspend,
359 .resume = sil24_pci_device_resume,
356}; 360};
357 361
358static struct scsi_host_template sil24_sht = { 362static struct scsi_host_template sil24_sht = {
@@ -372,6 +376,8 @@ static struct scsi_host_template sil24_sht = {
372 .slave_configure = ata_scsi_slave_config, 376 .slave_configure = ata_scsi_slave_config,
373 .slave_destroy = ata_scsi_slave_destroy, 377 .slave_destroy = ata_scsi_slave_destroy,
374 .bios_param = ata_std_bios_param, 378 .bios_param = ata_std_bios_param,
379 .suspend = ata_scsi_device_suspend,
380 .resume = ata_scsi_device_resume,
375}; 381};
376 382
377static const struct ata_port_operations sil24_ops = { 383static const struct ata_port_operations sil24_ops = {
@@ -607,7 +613,7 @@ static int sil24_hardreset(struct ata_port *ap, unsigned int *class)
607 /* SStatus oscillates between zero and valid status after 613 /* SStatus oscillates between zero and valid status after
608 * DEV_RST, debounce it. 614 * DEV_RST, debounce it.
609 */ 615 */
610 rc = sata_phy_debounce(ap, sata_deb_timing_before_fsrst); 616 rc = sata_phy_debounce(ap, sata_deb_timing_long);
611 if (rc) { 617 if (rc) {
612 reason = "PHY debouncing failed"; 618 reason = "PHY debouncing failed";
613 goto err; 619 goto err;
@@ -988,6 +994,64 @@ static void sil24_host_stop(struct ata_host_set *host_set)
988 kfree(hpriv); 994 kfree(hpriv);
989} 995}
990 996
997static void sil24_init_controller(struct pci_dev *pdev, int n_ports,
998 unsigned long host_flags,
999 void __iomem *host_base,
1000 void __iomem *port_base)
1001{
1002 u32 tmp;
1003 int i;
1004
1005 /* GPIO off */
1006 writel(0, host_base + HOST_FLASH_CMD);
1007
1008 /* clear global reset & mask interrupts during initialization */
1009 writel(0, host_base + HOST_CTRL);
1010
1011 /* init ports */
1012 for (i = 0; i < n_ports; i++) {
1013 void __iomem *port = port_base + i * PORT_REGS_SIZE;
1014
1015 /* Initial PHY setting */
1016 writel(0x20c, port + PORT_PHY_CFG);
1017
1018 /* Clear port RST */
1019 tmp = readl(port + PORT_CTRL_STAT);
1020 if (tmp & PORT_CS_PORT_RST) {
1021 writel(PORT_CS_PORT_RST, port + PORT_CTRL_CLR);
1022 tmp = ata_wait_register(port + PORT_CTRL_STAT,
1023 PORT_CS_PORT_RST,
1024 PORT_CS_PORT_RST, 10, 100);
1025 if (tmp & PORT_CS_PORT_RST)
1026 dev_printk(KERN_ERR, &pdev->dev,
1027 "failed to clear port RST\n");
1028 }
1029
1030 /* Configure IRQ WoC */
1031 if (host_flags & SIL24_FLAG_PCIX_IRQ_WOC)
1032 writel(PORT_CS_IRQ_WOC, port + PORT_CTRL_STAT);
1033 else
1034 writel(PORT_CS_IRQ_WOC, port + PORT_CTRL_CLR);
1035
1036 /* Zero error counters. */
1037 writel(0x8000, port + PORT_DECODE_ERR_THRESH);
1038 writel(0x8000, port + PORT_CRC_ERR_THRESH);
1039 writel(0x8000, port + PORT_HSHK_ERR_THRESH);
1040 writel(0x0000, port + PORT_DECODE_ERR_CNT);
1041 writel(0x0000, port + PORT_CRC_ERR_CNT);
1042 writel(0x0000, port + PORT_HSHK_ERR_CNT);
1043
1044 /* Always use 64bit activation */
1045 writel(PORT_CS_32BIT_ACTV, port + PORT_CTRL_CLR);
1046
1047 /* Clear port multiplier enable and resume bits */
1048 writel(PORT_CS_PM_EN | PORT_CS_RESUME, port + PORT_CTRL_CLR);
1049 }
1050
1051 /* Turn on interrupts */
1052 writel(IRQ_STAT_4PORTS, host_base + HOST_CTRL);
1053}
1054
991static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) 1055static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
992{ 1056{
993 static int printed_version = 0; 1057 static int printed_version = 0;
@@ -1076,9 +1140,6 @@ static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1076 } 1140 }
1077 } 1141 }
1078 1142
1079 /* GPIO off */
1080 writel(0, host_base + HOST_FLASH_CMD);
1081
1082 /* Apply workaround for completion IRQ loss on PCI-X errata */ 1143 /* Apply workaround for completion IRQ loss on PCI-X errata */
1083 if (probe_ent->host_flags & SIL24_FLAG_PCIX_IRQ_WOC) { 1144 if (probe_ent->host_flags & SIL24_FLAG_PCIX_IRQ_WOC) {
1084 tmp = readl(host_base + HOST_CTRL); 1145 tmp = readl(host_base + HOST_CTRL);
@@ -1090,56 +1151,18 @@ static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1090 probe_ent->host_flags &= ~SIL24_FLAG_PCIX_IRQ_WOC; 1151 probe_ent->host_flags &= ~SIL24_FLAG_PCIX_IRQ_WOC;
1091 } 1152 }
1092 1153
1093 /* clear global reset & mask interrupts during initialization */
1094 writel(0, host_base + HOST_CTRL);
1095
1096 for (i = 0; i < probe_ent->n_ports; i++) { 1154 for (i = 0; i < probe_ent->n_ports; i++) {
1097 void __iomem *port = port_base + i * PORT_REGS_SIZE; 1155 unsigned long portu =
1098 unsigned long portu = (unsigned long)port; 1156 (unsigned long)port_base + i * PORT_REGS_SIZE;
1099 1157
1100 probe_ent->port[i].cmd_addr = portu; 1158 probe_ent->port[i].cmd_addr = portu;
1101 probe_ent->port[i].scr_addr = portu + PORT_SCONTROL; 1159 probe_ent->port[i].scr_addr = portu + PORT_SCONTROL;
1102 1160
1103 ata_std_ports(&probe_ent->port[i]); 1161 ata_std_ports(&probe_ent->port[i]);
1104
1105 /* Initial PHY setting */
1106 writel(0x20c, port + PORT_PHY_CFG);
1107
1108 /* Clear port RST */
1109 tmp = readl(port + PORT_CTRL_STAT);
1110 if (tmp & PORT_CS_PORT_RST) {
1111 writel(PORT_CS_PORT_RST, port + PORT_CTRL_CLR);
1112 tmp = ata_wait_register(port + PORT_CTRL_STAT,
1113 PORT_CS_PORT_RST,
1114 PORT_CS_PORT_RST, 10, 100);
1115 if (tmp & PORT_CS_PORT_RST)
1116 dev_printk(KERN_ERR, &pdev->dev,
1117 "failed to clear port RST\n");
1118 }
1119
1120 /* Configure IRQ WoC */
1121 if (probe_ent->host_flags & SIL24_FLAG_PCIX_IRQ_WOC)
1122 writel(PORT_CS_IRQ_WOC, port + PORT_CTRL_STAT);
1123 else
1124 writel(PORT_CS_IRQ_WOC, port + PORT_CTRL_CLR);
1125
1126 /* Zero error counters. */
1127 writel(0x8000, port + PORT_DECODE_ERR_THRESH);
1128 writel(0x8000, port + PORT_CRC_ERR_THRESH);
1129 writel(0x8000, port + PORT_HSHK_ERR_THRESH);
1130 writel(0x0000, port + PORT_DECODE_ERR_CNT);
1131 writel(0x0000, port + PORT_CRC_ERR_CNT);
1132 writel(0x0000, port + PORT_HSHK_ERR_CNT);
1133
1134 /* Always use 64bit activation */
1135 writel(PORT_CS_32BIT_ACTV, port + PORT_CTRL_CLR);
1136
1137 /* Clear port multiplier enable and resume bits */
1138 writel(PORT_CS_PM_EN | PORT_CS_RESUME, port + PORT_CTRL_CLR);
1139 } 1162 }
1140 1163
1141 /* Turn on interrupts */ 1164 sil24_init_controller(pdev, probe_ent->n_ports, probe_ent->host_flags,
1142 writel(IRQ_STAT_4PORTS, host_base + HOST_CTRL); 1165 host_base, port_base);
1143 1166
1144 pci_set_master(pdev); 1167 pci_set_master(pdev);
1145 1168
@@ -1162,6 +1185,25 @@ static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1162 return rc; 1185 return rc;
1163} 1186}
1164 1187
1188static int sil24_pci_device_resume(struct pci_dev *pdev)
1189{
1190 struct ata_host_set *host_set = dev_get_drvdata(&pdev->dev);
1191 struct sil24_host_priv *hpriv = host_set->private_data;
1192
1193 ata_pci_device_do_resume(pdev);
1194
1195 if (pdev->dev.power.power_state.event == PM_EVENT_SUSPEND)
1196 writel(HOST_CTRL_GLOBAL_RST, hpriv->host_base + HOST_CTRL);
1197
1198 sil24_init_controller(pdev, host_set->n_ports,
1199 host_set->ports[0]->flags,
1200 hpriv->host_base, hpriv->port_base);
1201
1202 ata_host_set_resume(host_set);
1203
1204 return 0;
1205}
1206
1165static int __init sil24_init(void) 1207static int __init sil24_init(void)
1166{ 1208{
1167 return pci_module_init(&sil24_pci_driver); 1209 return pci_module_init(&sil24_pci_driver);
diff --git a/drivers/scsi/sata_vsc.c b/drivers/scsi/sata_vsc.c
index 916fe6fba756..ad37871594f5 100644
--- a/drivers/scsi/sata_vsc.c
+++ b/drivers/scsi/sata_vsc.c
@@ -297,7 +297,7 @@ static const struct ata_port_operations vsc_sata_ops = {
297 .bmdma_status = ata_bmdma_status, 297 .bmdma_status = ata_bmdma_status,
298 .qc_prep = ata_qc_prep, 298 .qc_prep = ata_qc_prep,
299 .qc_issue = ata_qc_issue_prot, 299 .qc_issue = ata_qc_issue_prot,
300 .data_xfer = ata_pio_data_xfer, 300 .data_xfer = ata_mmio_data_xfer,
301 .freeze = ata_bmdma_freeze, 301 .freeze = ata_bmdma_freeze,
302 .thaw = ata_bmdma_thaw, 302 .thaw = ata_bmdma_thaw,
303 .error_handler = ata_bmdma_error_handler, 303 .error_handler = ata_bmdma_error_handler,
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 2ab7df0dcfe8..b332caddd5b3 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -346,7 +346,7 @@ void scsi_log_send(struct scsi_cmnd *cmd)
346 if (level > 3) { 346 if (level > 3) {
347 printk(KERN_INFO "buffer = 0x%p, bufflen = %d," 347 printk(KERN_INFO "buffer = 0x%p, bufflen = %d,"
348 " done = 0x%p, queuecommand 0x%p\n", 348 " done = 0x%p, queuecommand 0x%p\n",
349 cmd->buffer, cmd->bufflen, 349 cmd->request_buffer, cmd->request_bufflen,
350 cmd->done, 350 cmd->done,
351 sdev->host->hostt->queuecommand); 351 sdev->host->hostt->queuecommand);
352 352
@@ -661,11 +661,6 @@ void __scsi_done(struct scsi_cmnd *cmd)
661 */ 661 */
662int scsi_retry_command(struct scsi_cmnd *cmd) 662int scsi_retry_command(struct scsi_cmnd *cmd)
663{ 663{
664 /*
665 * Restore the SCSI command state.
666 */
667 scsi_setup_cmd_retry(cmd);
668
669 /* 664 /*
670 * Zero the sense information from the last time we tried 665 * Zero the sense information from the last time we tried
671 * this command. 666 * this command.
@@ -711,10 +706,6 @@ void scsi_finish_command(struct scsi_cmnd *cmd)
711 "Notifying upper driver of completion " 706 "Notifying upper driver of completion "
712 "(result %x)\n", cmd->result)); 707 "(result %x)\n", cmd->result));
713 708
714 /*
715 * We can get here with use_sg=0, causing a panic in the upper level
716 */
717 cmd->use_sg = cmd->old_use_sg;
718 cmd->done(cmd); 709 cmd->done(cmd);
719} 710}
720EXPORT_SYMBOL(scsi_finish_command); 711EXPORT_SYMBOL(scsi_finish_command);
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 9c63b00773c4..a80303c6b3fd 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -286,7 +286,7 @@ static int inquiry_evpd_83(unsigned char * arr, int target_dev_id,
286 int dev_id_num, const char * dev_id_str, 286 int dev_id_num, const char * dev_id_str,
287 int dev_id_str_len); 287 int dev_id_str_len);
288static int inquiry_evpd_88(unsigned char * arr, int target_dev_id); 288static int inquiry_evpd_88(unsigned char * arr, int target_dev_id);
289static void do_create_driverfs_files(void); 289static int do_create_driverfs_files(void);
290static void do_remove_driverfs_files(void); 290static void do_remove_driverfs_files(void);
291 291
292static int sdebug_add_adapter(void); 292static int sdebug_add_adapter(void);
@@ -2487,19 +2487,22 @@ static ssize_t sdebug_add_host_store(struct device_driver * ddp,
2487DRIVER_ATTR(add_host, S_IRUGO | S_IWUSR, sdebug_add_host_show, 2487DRIVER_ATTR(add_host, S_IRUGO | S_IWUSR, sdebug_add_host_show,
2488 sdebug_add_host_store); 2488 sdebug_add_host_store);
2489 2489
2490static void do_create_driverfs_files(void) 2490static int do_create_driverfs_files(void)
2491{ 2491{
2492 driver_create_file(&sdebug_driverfs_driver, &driver_attr_add_host); 2492 int ret;
2493 driver_create_file(&sdebug_driverfs_driver, &driver_attr_delay); 2493
2494 driver_create_file(&sdebug_driverfs_driver, &driver_attr_dev_size_mb); 2494 ret = driver_create_file(&sdebug_driverfs_driver, &driver_attr_add_host);
2495 driver_create_file(&sdebug_driverfs_driver, &driver_attr_dsense); 2495 ret |= driver_create_file(&sdebug_driverfs_driver, &driver_attr_delay);
2496 driver_create_file(&sdebug_driverfs_driver, &driver_attr_every_nth); 2496 ret |= driver_create_file(&sdebug_driverfs_driver, &driver_attr_dev_size_mb);
2497 driver_create_file(&sdebug_driverfs_driver, &driver_attr_max_luns); 2497 ret |= driver_create_file(&sdebug_driverfs_driver, &driver_attr_dsense);
2498 driver_create_file(&sdebug_driverfs_driver, &driver_attr_num_tgts); 2498 ret |= driver_create_file(&sdebug_driverfs_driver, &driver_attr_every_nth);
2499 driver_create_file(&sdebug_driverfs_driver, &driver_attr_num_parts); 2499 ret |= driver_create_file(&sdebug_driverfs_driver, &driver_attr_max_luns);
2500 driver_create_file(&sdebug_driverfs_driver, &driver_attr_ptype); 2500 ret |= driver_create_file(&sdebug_driverfs_driver, &driver_attr_num_tgts);
2501 driver_create_file(&sdebug_driverfs_driver, &driver_attr_opts); 2501 ret |= driver_create_file(&sdebug_driverfs_driver, &driver_attr_num_parts);
2502 driver_create_file(&sdebug_driverfs_driver, &driver_attr_scsi_level); 2502 ret |= driver_create_file(&sdebug_driverfs_driver, &driver_attr_ptype);
2503 ret |= driver_create_file(&sdebug_driverfs_driver, &driver_attr_opts);
2504 ret |= driver_create_file(&sdebug_driverfs_driver, &driver_attr_scsi_level);
2505 return ret;
2503} 2506}
2504 2507
2505static void do_remove_driverfs_files(void) 2508static void do_remove_driverfs_files(void)
@@ -2522,6 +2525,7 @@ static int __init scsi_debug_init(void)
2522 unsigned int sz; 2525 unsigned int sz;
2523 int host_to_add; 2526 int host_to_add;
2524 int k; 2527 int k;
2528 int ret;
2525 2529
2526 if (scsi_debug_dev_size_mb < 1) 2530 if (scsi_debug_dev_size_mb < 1)
2527 scsi_debug_dev_size_mb = 1; /* force minimum 1 MB ramdisk */ 2531 scsi_debug_dev_size_mb = 1; /* force minimum 1 MB ramdisk */
@@ -2560,12 +2564,32 @@ static int __init scsi_debug_init(void)
2560 if (scsi_debug_num_parts > 0) 2564 if (scsi_debug_num_parts > 0)
2561 sdebug_build_parts(fake_storep); 2565 sdebug_build_parts(fake_storep);
2562 2566
2563 init_all_queued(); 2567 ret = device_register(&pseudo_primary);
2568 if (ret < 0) {
2569 printk(KERN_WARNING "scsi_debug: device_register error: %d\n",
2570 ret);
2571 goto free_vm;
2572 }
2573 ret = bus_register(&pseudo_lld_bus);
2574 if (ret < 0) {
2575 printk(KERN_WARNING "scsi_debug: bus_register error: %d\n",
2576 ret);
2577 goto dev_unreg;
2578 }
2579 ret = driver_register(&sdebug_driverfs_driver);
2580 if (ret < 0) {
2581 printk(KERN_WARNING "scsi_debug: driver_register error: %d\n",
2582 ret);
2583 goto bus_unreg;
2584 }
2585 ret = do_create_driverfs_files();
2586 if (ret < 0) {
2587 printk(KERN_WARNING "scsi_debug: driver_create_file error: %d\n",
2588 ret);
2589 goto del_files;
2590 }
2564 2591
2565 device_register(&pseudo_primary); 2592 init_all_queued();
2566 bus_register(&pseudo_lld_bus);
2567 driver_register(&sdebug_driverfs_driver);
2568 do_create_driverfs_files();
2569 2593
2570 sdebug_driver_template.proc_name = (char *)sdebug_proc_name; 2594 sdebug_driver_template.proc_name = (char *)sdebug_proc_name;
2571 2595
@@ -2585,6 +2609,18 @@ static int __init scsi_debug_init(void)
2585 scsi_debug_add_host); 2609 scsi_debug_add_host);
2586 } 2610 }
2587 return 0; 2611 return 0;
2612
2613del_files:
2614 do_remove_driverfs_files();
2615 driver_unregister(&sdebug_driverfs_driver);
2616bus_unreg:
2617 bus_unregister(&pseudo_lld_bus);
2618dev_unreg:
2619 device_unregister(&pseudo_primary);
2620free_vm:
2621 vfree(fake_storep);
2622
2623 return ret;
2588} 2624}
2589 2625
2590static void __exit scsi_debug_exit(void) 2626static void __exit scsi_debug_exit(void)
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index 6683d596234a..6a5b731bd5ba 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -460,19 +460,67 @@ static void scsi_eh_done(struct scsi_cmnd *scmd)
460 * Return value: 460 * Return value:
461 * SUCCESS or FAILED or NEEDS_RETRY 461 * SUCCESS or FAILED or NEEDS_RETRY
462 **/ 462 **/
463static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout) 463static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout, int copy_sense)
464{ 464{
465 struct scsi_device *sdev = scmd->device; 465 struct scsi_device *sdev = scmd->device;
466 struct Scsi_Host *shost = sdev->host; 466 struct Scsi_Host *shost = sdev->host;
467 int old_result = scmd->result;
467 DECLARE_COMPLETION(done); 468 DECLARE_COMPLETION(done);
468 unsigned long timeleft; 469 unsigned long timeleft;
469 unsigned long flags; 470 unsigned long flags;
471 unsigned char old_cmnd[MAX_COMMAND_SIZE];
472 enum dma_data_direction old_data_direction;
473 unsigned short old_use_sg;
474 unsigned char old_cmd_len;
475 unsigned old_bufflen;
476 void *old_buffer;
470 int rtn; 477 int rtn;
471 478
479 /*
480 * We need saved copies of a number of fields - this is because
481 * error handling may need to overwrite these with different values
482 * to run different commands, and once error handling is complete,
483 * we will need to restore these values prior to running the actual
484 * command.
485 */
486 old_buffer = scmd->request_buffer;
487 old_bufflen = scmd->request_bufflen;
488 memcpy(old_cmnd, scmd->cmnd, sizeof(scmd->cmnd));
489 old_data_direction = scmd->sc_data_direction;
490 old_cmd_len = scmd->cmd_len;
491 old_use_sg = scmd->use_sg;
492
493 if (copy_sense) {
494 int gfp_mask = GFP_ATOMIC;
495
496 if (shost->hostt->unchecked_isa_dma)
497 gfp_mask |= __GFP_DMA;
498
499 scmd->sc_data_direction = DMA_FROM_DEVICE;
500 scmd->request_bufflen = 252;
501 scmd->request_buffer = kzalloc(scmd->request_bufflen, gfp_mask);
502 if (!scmd->request_buffer)
503 return FAILED;
504 } else {
505 scmd->request_buffer = NULL;
506 scmd->request_bufflen = 0;
507 scmd->sc_data_direction = DMA_NONE;
508 }
509
510 scmd->underflow = 0;
511 scmd->use_sg = 0;
512 scmd->cmd_len = COMMAND_SIZE(scmd->cmnd[0]);
513
472 if (sdev->scsi_level <= SCSI_2) 514 if (sdev->scsi_level <= SCSI_2)
473 scmd->cmnd[1] = (scmd->cmnd[1] & 0x1f) | 515 scmd->cmnd[1] = (scmd->cmnd[1] & 0x1f) |
474 (sdev->lun << 5 & 0xe0); 516 (sdev->lun << 5 & 0xe0);
475 517
518 /*
519 * Zero the sense buffer. The scsi spec mandates that any
520 * untransferred sense data should be interpreted as being zero.
521 */
522 memset(scmd->sense_buffer, 0, sizeof(scmd->sense_buffer));
523
476 shost->eh_action = &done; 524 shost->eh_action = &done;
477 525
478 spin_lock_irqsave(shost->host_lock, flags); 526 spin_lock_irqsave(shost->host_lock, flags);
@@ -522,6 +570,29 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout)
522 rtn = FAILED; 570 rtn = FAILED;
523 } 571 }
524 572
573
574 /*
575 * Last chance to have valid sense data.
576 */
577 if (copy_sense) {
578 if (!SCSI_SENSE_VALID(scmd)) {
579 memcpy(scmd->sense_buffer, scmd->request_buffer,
580 sizeof(scmd->sense_buffer));
581 }
582 kfree(scmd->request_buffer);
583 }
584
585
586 /*
587 * Restore original data
588 */
589 scmd->request_buffer = old_buffer;
590 scmd->request_bufflen = old_bufflen;
591 memcpy(scmd->cmnd, old_cmnd, sizeof(scmd->cmnd));
592 scmd->sc_data_direction = old_data_direction;
593 scmd->cmd_len = old_cmd_len;
594 scmd->use_sg = old_use_sg;
595 scmd->result = old_result;
525 return rtn; 596 return rtn;
526} 597}
527 598
@@ -537,56 +608,10 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout)
537static int scsi_request_sense(struct scsi_cmnd *scmd) 608static int scsi_request_sense(struct scsi_cmnd *scmd)
538{ 609{
539 static unsigned char generic_sense[6] = 610 static unsigned char generic_sense[6] =
540 {REQUEST_SENSE, 0, 0, 0, 252, 0}; 611 {REQUEST_SENSE, 0, 0, 0, 252, 0};
541 unsigned char *scsi_result;
542 int saved_result;
543 int rtn;
544 612
545 memcpy(scmd->cmnd, generic_sense, sizeof(generic_sense)); 613 memcpy(scmd->cmnd, generic_sense, sizeof(generic_sense));
546 614 return scsi_send_eh_cmnd(scmd, SENSE_TIMEOUT, 1);
547 scsi_result = kmalloc(252, GFP_ATOMIC | ((scmd->device->host->hostt->unchecked_isa_dma) ? __GFP_DMA : 0));
548
549
550 if (unlikely(!scsi_result)) {
551 printk(KERN_ERR "%s: cannot allocate scsi_result.\n",
552 __FUNCTION__);
553 return FAILED;
554 }
555
556 /*
557 * zero the sense buffer. some host adapters automatically always
558 * request sense, so it is not a good idea that
559 * scmd->request_buffer and scmd->sense_buffer point to the same
560 * address (db). 0 is not a valid sense code.
561 */
562 memset(scmd->sense_buffer, 0, sizeof(scmd->sense_buffer));
563 memset(scsi_result, 0, 252);
564
565 saved_result = scmd->result;
566 scmd->request_buffer = scsi_result;
567 scmd->request_bufflen = 252;
568 scmd->use_sg = 0;
569 scmd->cmd_len = COMMAND_SIZE(scmd->cmnd[0]);
570 scmd->sc_data_direction = DMA_FROM_DEVICE;
571 scmd->underflow = 0;
572
573 rtn = scsi_send_eh_cmnd(scmd, SENSE_TIMEOUT);
574
575 /* last chance to have valid sense data */
576 if(!SCSI_SENSE_VALID(scmd)) {
577 memcpy(scmd->sense_buffer, scmd->request_buffer,
578 sizeof(scmd->sense_buffer));
579 }
580
581 kfree(scsi_result);
582
583 /*
584 * when we eventually call scsi_finish, we really wish to complete
585 * the original request, so let's restore the original data. (db)
586 */
587 scsi_setup_cmd_retry(scmd);
588 scmd->result = saved_result;
589 return rtn;
590} 615}
591 616
592/** 617/**
@@ -605,12 +630,6 @@ void scsi_eh_finish_cmd(struct scsi_cmnd *scmd, struct list_head *done_q)
605{ 630{
606 scmd->device->host->host_failed--; 631 scmd->device->host->host_failed--;
607 scmd->eh_eflags = 0; 632 scmd->eh_eflags = 0;
608
609 /*
610 * set this back so that the upper level can correctly free up
611 * things.
612 */
613 scsi_setup_cmd_retry(scmd);
614 list_move_tail(&scmd->eh_entry, done_q); 633 list_move_tail(&scmd->eh_entry, done_q);
615} 634}
616EXPORT_SYMBOL(scsi_eh_finish_cmd); 635EXPORT_SYMBOL(scsi_eh_finish_cmd);
@@ -715,47 +734,26 @@ static int scsi_eh_tur(struct scsi_cmnd *scmd)
715{ 734{
716 static unsigned char tur_command[6] = {TEST_UNIT_READY, 0, 0, 0, 0, 0}; 735 static unsigned char tur_command[6] = {TEST_UNIT_READY, 0, 0, 0, 0, 0};
717 int retry_cnt = 1, rtn; 736 int retry_cnt = 1, rtn;
718 int saved_result;
719 737
720retry_tur: 738retry_tur:
721 memcpy(scmd->cmnd, tur_command, sizeof(tur_command)); 739 memcpy(scmd->cmnd, tur_command, sizeof(tur_command));
722 740
723 /*
724 * zero the sense buffer. the scsi spec mandates that any
725 * untransferred sense data should be interpreted as being zero.
726 */
727 memset(scmd->sense_buffer, 0, sizeof(scmd->sense_buffer));
728
729 saved_result = scmd->result;
730 scmd->request_buffer = NULL;
731 scmd->request_bufflen = 0;
732 scmd->use_sg = 0;
733 scmd->cmd_len = COMMAND_SIZE(scmd->cmnd[0]);
734 scmd->underflow = 0;
735 scmd->sc_data_direction = DMA_NONE;
736 741
737 rtn = scsi_send_eh_cmnd(scmd, SENSE_TIMEOUT); 742 rtn = scsi_send_eh_cmnd(scmd, SENSE_TIMEOUT, 0);
738 743
739 /*
740 * when we eventually call scsi_finish, we really wish to complete
741 * the original request, so let's restore the original data. (db)
742 */
743 scsi_setup_cmd_retry(scmd);
744 scmd->result = saved_result;
745
746 /*
747 * hey, we are done. let's look to see what happened.
748 */
749 SCSI_LOG_ERROR_RECOVERY(3, printk("%s: scmd %p rtn %x\n", 744 SCSI_LOG_ERROR_RECOVERY(3, printk("%s: scmd %p rtn %x\n",
750 __FUNCTION__, scmd, rtn)); 745 __FUNCTION__, scmd, rtn));
751 if (rtn == SUCCESS) 746
752 return 0; 747 switch (rtn) {
753 else if (rtn == NEEDS_RETRY) { 748 case NEEDS_RETRY:
754 if (retry_cnt--) 749 if (retry_cnt--)
755 goto retry_tur; 750 goto retry_tur;
751 /*FALLTHRU*/
752 case SUCCESS:
756 return 0; 753 return 0;
754 default:
755 return 1;
757 } 756 }
758 return 1;
759} 757}
760 758
761/** 759/**
@@ -837,44 +835,16 @@ static int scsi_try_bus_device_reset(struct scsi_cmnd *scmd)
837static int scsi_eh_try_stu(struct scsi_cmnd *scmd) 835static int scsi_eh_try_stu(struct scsi_cmnd *scmd)
838{ 836{
839 static unsigned char stu_command[6] = {START_STOP, 0, 0, 0, 1, 0}; 837 static unsigned char stu_command[6] = {START_STOP, 0, 0, 0, 1, 0};
840 int rtn;
841 int saved_result;
842 838
843 if (!scmd->device->allow_restart) 839 if (scmd->device->allow_restart) {
844 return 1; 840 int rtn;
845
846 memcpy(scmd->cmnd, stu_command, sizeof(stu_command));
847
848 /*
849 * zero the sense buffer. the scsi spec mandates that any
850 * untransferred sense data should be interpreted as being zero.
851 */
852 memset(scmd->sense_buffer, 0, sizeof(scmd->sense_buffer));
853
854 saved_result = scmd->result;
855 scmd->request_buffer = NULL;
856 scmd->request_bufflen = 0;
857 scmd->use_sg = 0;
858 scmd->cmd_len = COMMAND_SIZE(scmd->cmnd[0]);
859 scmd->underflow = 0;
860 scmd->sc_data_direction = DMA_NONE;
861 841
862 rtn = scsi_send_eh_cmnd(scmd, START_UNIT_TIMEOUT); 842 memcpy(scmd->cmnd, stu_command, sizeof(stu_command));
863 843 rtn = scsi_send_eh_cmnd(scmd, START_UNIT_TIMEOUT, 0);
864 /* 844 if (rtn == SUCCESS)
865 * when we eventually call scsi_finish, we really wish to complete 845 return 0;
866 * the original request, so let's restore the original data. (db) 846 }
867 */
868 scsi_setup_cmd_retry(scmd);
869 scmd->result = saved_result;
870 847
871 /*
872 * hey, we are done. let's look to see what happened.
873 */
874 SCSI_LOG_ERROR_RECOVERY(3, printk("%s: scmd %p rtn %x\n",
875 __FUNCTION__, scmd, rtn));
876 if (rtn == SUCCESS)
877 return 0;
878 return 1; 848 return 1;
879} 849}
880 850
@@ -1684,8 +1654,6 @@ scsi_reset_provider(struct scsi_device *dev, int flag)
1684 1654
1685 scmd->scsi_done = scsi_reset_provider_done_command; 1655 scmd->scsi_done = scsi_reset_provider_done_command;
1686 scmd->done = NULL; 1656 scmd->done = NULL;
1687 scmd->buffer = NULL;
1688 scmd->bufflen = 0;
1689 scmd->request_buffer = NULL; 1657 scmd->request_buffer = NULL;
1690 scmd->request_bufflen = 0; 1658 scmd->request_bufflen = 0;
1691 1659
diff --git a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c
index a89c4115cfba..32293f451669 100644
--- a/drivers/scsi/scsi_ioctl.c
+++ b/drivers/scsi/scsi_ioctl.c
@@ -110,11 +110,8 @@ static int ioctl_internal_command(struct scsi_device *sdev, char *cmd,
110 sshdr.asc, sshdr.ascq); 110 sshdr.asc, sshdr.ascq);
111 break; 111 break;
112 case NOT_READY: /* This happens if there is no disc in drive */ 112 case NOT_READY: /* This happens if there is no disc in drive */
113 if (sdev->removable && (cmd[0] != TEST_UNIT_READY)) { 113 if (sdev->removable)
114 printk(KERN_INFO "Device not ready. Make sure"
115 " there is a disc in the drive.\n");
116 break; 114 break;
117 }
118 case UNIT_ATTENTION: 115 case UNIT_ATTENTION:
119 if (sdev->removable) { 116 if (sdev->removable) {
120 sdev->changed = 1; 117 sdev->changed = 1;
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 08af9aae7df3..077c1c691210 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -436,60 +436,16 @@ EXPORT_SYMBOL_GPL(scsi_execute_async);
436 * 436 *
437 * Arguments: cmd - command that is ready to be queued. 437 * Arguments: cmd - command that is ready to be queued.
438 * 438 *
439 * Returns: Nothing
440 *
441 * Notes: This function has the job of initializing a number of 439 * Notes: This function has the job of initializing a number of
442 * fields related to error handling. Typically this will 440 * fields related to error handling. Typically this will
443 * be called once for each command, as required. 441 * be called once for each command, as required.
444 */ 442 */
445static int scsi_init_cmd_errh(struct scsi_cmnd *cmd) 443static void scsi_init_cmd_errh(struct scsi_cmnd *cmd)
446{ 444{
447 cmd->serial_number = 0; 445 cmd->serial_number = 0;
448
449 memset(cmd->sense_buffer, 0, sizeof cmd->sense_buffer); 446 memset(cmd->sense_buffer, 0, sizeof cmd->sense_buffer);
450
451 if (cmd->cmd_len == 0) 447 if (cmd->cmd_len == 0)
452 cmd->cmd_len = COMMAND_SIZE(cmd->cmnd[0]); 448 cmd->cmd_len = COMMAND_SIZE(cmd->cmnd[0]);
453
454 /*
455 * We need saved copies of a number of fields - this is because
456 * error handling may need to overwrite these with different values
457 * to run different commands, and once error handling is complete,
458 * we will need to restore these values prior to running the actual
459 * command.
460 */
461 cmd->old_use_sg = cmd->use_sg;
462 cmd->old_cmd_len = cmd->cmd_len;
463 cmd->sc_old_data_direction = cmd->sc_data_direction;
464 cmd->old_underflow = cmd->underflow;
465 memcpy(cmd->data_cmnd, cmd->cmnd, sizeof(cmd->cmnd));
466 cmd->buffer = cmd->request_buffer;
467 cmd->bufflen = cmd->request_bufflen;
468
469 return 1;
470}
471
472/*
473 * Function: scsi_setup_cmd_retry()
474 *
475 * Purpose: Restore the command state for a retry
476 *
477 * Arguments: cmd - command to be restored
478 *
479 * Returns: Nothing
480 *
481 * Notes: Immediately prior to retrying a command, we need
482 * to restore certain fields that we saved above.
483 */
484void scsi_setup_cmd_retry(struct scsi_cmnd *cmd)
485{
486 memcpy(cmd->cmnd, cmd->data_cmnd, sizeof(cmd->data_cmnd));
487 cmd->request_buffer = cmd->buffer;
488 cmd->request_bufflen = cmd->bufflen;
489 cmd->use_sg = cmd->old_use_sg;
490 cmd->cmd_len = cmd->old_cmd_len;
491 cmd->sc_data_direction = cmd->sc_old_data_direction;
492 cmd->underflow = cmd->old_underflow;
493} 449}
494 450
495void scsi_device_unbusy(struct scsi_device *sdev) 451void scsi_device_unbusy(struct scsi_device *sdev)
@@ -807,22 +763,13 @@ static void scsi_free_sgtable(struct scatterlist *sgl, int index)
807 */ 763 */
808static void scsi_release_buffers(struct scsi_cmnd *cmd) 764static void scsi_release_buffers(struct scsi_cmnd *cmd)
809{ 765{
810 struct request *req = cmd->request;
811
812 /*
813 * Free up any indirection buffers we allocated for DMA purposes.
814 */
815 if (cmd->use_sg) 766 if (cmd->use_sg)
816 scsi_free_sgtable(cmd->request_buffer, cmd->sglist_len); 767 scsi_free_sgtable(cmd->request_buffer, cmd->sglist_len);
817 else if (cmd->request_buffer != req->buffer)
818 kfree(cmd->request_buffer);
819 768
820 /* 769 /*
821 * Zero these out. They now point to freed memory, and it is 770 * Zero these out. They now point to freed memory, and it is
822 * dangerous to hang onto the pointers. 771 * dangerous to hang onto the pointers.
823 */ 772 */
824 cmd->buffer = NULL;
825 cmd->bufflen = 0;
826 cmd->request_buffer = NULL; 773 cmd->request_buffer = NULL;
827 cmd->request_bufflen = 0; 774 cmd->request_bufflen = 0;
828} 775}
@@ -858,7 +805,7 @@ static void scsi_release_buffers(struct scsi_cmnd *cmd)
858void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes) 805void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
859{ 806{
860 int result = cmd->result; 807 int result = cmd->result;
861 int this_count = cmd->bufflen; 808 int this_count = cmd->request_bufflen;
862 request_queue_t *q = cmd->device->request_queue; 809 request_queue_t *q = cmd->device->request_queue;
863 struct request *req = cmd->request; 810 struct request *req = cmd->request;
864 int clear_errors = 1; 811 int clear_errors = 1;
@@ -866,28 +813,14 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
866 int sense_valid = 0; 813 int sense_valid = 0;
867 int sense_deferred = 0; 814 int sense_deferred = 0;
868 815
869 /* 816 scsi_release_buffers(cmd);
870 * Free up any indirection buffers we allocated for DMA purposes.
871 * For the case of a READ, we need to copy the data out of the
872 * bounce buffer and into the real buffer.
873 */
874 if (cmd->use_sg)
875 scsi_free_sgtable(cmd->buffer, cmd->sglist_len);
876 else if (cmd->buffer != req->buffer) {
877 if (rq_data_dir(req) == READ) {
878 unsigned long flags;
879 char *to = bio_kmap_irq(req->bio, &flags);
880 memcpy(to, cmd->buffer, cmd->bufflen);
881 bio_kunmap_irq(to, &flags);
882 }
883 kfree(cmd->buffer);
884 }
885 817
886 if (result) { 818 if (result) {
887 sense_valid = scsi_command_normalize_sense(cmd, &sshdr); 819 sense_valid = scsi_command_normalize_sense(cmd, &sshdr);
888 if (sense_valid) 820 if (sense_valid)
889 sense_deferred = scsi_sense_is_deferred(&sshdr); 821 sense_deferred = scsi_sense_is_deferred(&sshdr);
890 } 822 }
823
891 if (blk_pc_request(req)) { /* SG_IO ioctl from block level */ 824 if (blk_pc_request(req)) { /* SG_IO ioctl from block level */
892 req->errors = result; 825 req->errors = result;
893 if (result) { 826 if (result) {
@@ -908,15 +841,6 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
908 } 841 }
909 842
910 /* 843 /*
911 * Zero these out. They now point to freed memory, and it is
912 * dangerous to hang onto the pointers.
913 */
914 cmd->buffer = NULL;
915 cmd->bufflen = 0;
916 cmd->request_buffer = NULL;
917 cmd->request_bufflen = 0;
918
919 /*
920 * Next deal with any sectors which we were able to correctly 844 * Next deal with any sectors which we were able to correctly
921 * handle. 845 * handle.
922 */ 846 */
@@ -1012,7 +936,7 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
1012 if (!(req->flags & REQ_QUIET)) { 936 if (!(req->flags & REQ_QUIET)) {
1013 scmd_printk(KERN_INFO, cmd, 937 scmd_printk(KERN_INFO, cmd,
1014 "Volume overflow, CDB: "); 938 "Volume overflow, CDB: ");
1015 __scsi_print_command(cmd->data_cmnd); 939 __scsi_print_command(cmd->cmnd);
1016 scsi_print_sense("", cmd); 940 scsi_print_sense("", cmd);
1017 } 941 }
1018 /* See SSC3rXX or current. */ 942 /* See SSC3rXX or current. */
@@ -1143,7 +1067,7 @@ static void scsi_blk_pc_done(struct scsi_cmnd *cmd)
1143 * successfully. Since this is a REQ_BLOCK_PC command the 1067 * successfully. Since this is a REQ_BLOCK_PC command the
1144 * caller should check the request's errors value 1068 * caller should check the request's errors value
1145 */ 1069 */
1146 scsi_io_completion(cmd, cmd->bufflen); 1070 scsi_io_completion(cmd, cmd->request_bufflen);
1147} 1071}
1148 1072
1149static void scsi_setup_blk_pc_cmnd(struct scsi_cmnd *cmd) 1073static void scsi_setup_blk_pc_cmnd(struct scsi_cmnd *cmd)
diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h
index e2fbe9a9d5a9..ae24c85aaeea 100644
--- a/drivers/scsi/scsi_priv.h
+++ b/drivers/scsi/scsi_priv.h
@@ -57,7 +57,6 @@ extern int scsi_eh_scmd_add(struct scsi_cmnd *, int);
57 57
58/* scsi_lib.c */ 58/* scsi_lib.c */
59extern int scsi_maybe_unblock_host(struct scsi_device *sdev); 59extern int scsi_maybe_unblock_host(struct scsi_device *sdev);
60extern void scsi_setup_cmd_retry(struct scsi_cmnd *cmd);
61extern void scsi_device_unbusy(struct scsi_device *sdev); 60extern void scsi_device_unbusy(struct scsi_device *sdev);
62extern int scsi_queue_insert(struct scsi_cmnd *cmd, int reason); 61extern int scsi_queue_insert(struct scsi_cmnd *cmd, int reason);
63extern void scsi_next_command(struct scsi_cmnd *cmd); 62extern void scsi_next_command(struct scsi_cmnd *cmd);
diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c
index dd075627e605..5a625c3fddae 100644
--- a/drivers/scsi/scsi_transport_sas.c
+++ b/drivers/scsi/scsi_transport_sas.c
@@ -41,6 +41,7 @@ struct sas_host_attrs {
41 struct mutex lock; 41 struct mutex lock;
42 u32 next_target_id; 42 u32 next_target_id;
43 u32 next_expander_id; 43 u32 next_expander_id;
44 int next_port_id;
44}; 45};
45#define to_sas_host_attrs(host) ((struct sas_host_attrs *)(host)->shost_data) 46#define to_sas_host_attrs(host) ((struct sas_host_attrs *)(host)->shost_data)
46 47
@@ -146,6 +147,7 @@ static int sas_host_setup(struct transport_container *tc, struct device *dev,
146 mutex_init(&sas_host->lock); 147 mutex_init(&sas_host->lock);
147 sas_host->next_target_id = 0; 148 sas_host->next_target_id = 0;
148 sas_host->next_expander_id = 0; 149 sas_host->next_expander_id = 0;
150 sas_host->next_port_id = 0;
149 return 0; 151 return 0;
150} 152}
151 153
@@ -327,7 +329,7 @@ sas_phy_protocol_attr(identify.target_port_protocols,
327sas_phy_simple_attr(identify.sas_address, sas_address, "0x%016llx\n", 329sas_phy_simple_attr(identify.sas_address, sas_address, "0x%016llx\n",
328 unsigned long long); 330 unsigned long long);
329sas_phy_simple_attr(identify.phy_identifier, phy_identifier, "%d\n", u8); 331sas_phy_simple_attr(identify.phy_identifier, phy_identifier, "%d\n", u8);
330//sas_phy_simple_attr(port_identifier, port_identifier, "%d\n", u8); 332//sas_phy_simple_attr(port_identifier, port_identifier, "%d\n", int);
331sas_phy_linkspeed_attr(negotiated_linkrate); 333sas_phy_linkspeed_attr(negotiated_linkrate);
332sas_phy_linkspeed_attr(minimum_linkrate_hw); 334sas_phy_linkspeed_attr(minimum_linkrate_hw);
333sas_phy_linkspeed_attr(minimum_linkrate); 335sas_phy_linkspeed_attr(minimum_linkrate);
@@ -590,6 +592,38 @@ struct sas_port *sas_port_alloc(struct device *parent, int port_id)
590} 592}
591EXPORT_SYMBOL(sas_port_alloc); 593EXPORT_SYMBOL(sas_port_alloc);
592 594
595/** sas_port_alloc_num - allocate and initialize a SAS port structure
596 *
597 * @parent: parent device
598 *
599 * Allocates a SAS port structure and a number to go with it. This
600 * interface is really for adapters where the port number has no
601 * meansing, so the sas class should manage them. It will be added to
602 * the device tree below the device specified by @parent which must be
603 * either a Scsi_Host or a sas_expander_device.
604 *
605 * Returns %NULL on error
606 */
607struct sas_port *sas_port_alloc_num(struct device *parent)
608{
609 int index;
610 struct Scsi_Host *shost = dev_to_shost(parent);
611 struct sas_host_attrs *sas_host = to_sas_host_attrs(shost);
612
613 /* FIXME: use idr for this eventually */
614 mutex_lock(&sas_host->lock);
615 if (scsi_is_sas_expander_device(parent)) {
616 struct sas_rphy *rphy = dev_to_rphy(parent);
617 struct sas_expander_device *exp = rphy_to_expander_device(rphy);
618
619 index = exp->next_port_id++;
620 } else
621 index = sas_host->next_port_id++;
622 mutex_unlock(&sas_host->lock);
623 return sas_port_alloc(parent, index);
624}
625EXPORT_SYMBOL(sas_port_alloc_num);
626
593/** 627/**
594 * sas_port_add - add a SAS port to the device hierarchy 628 * sas_port_add - add a SAS port to the device hierarchy
595 * 629 *
@@ -658,6 +692,13 @@ void sas_port_delete(struct sas_port *port)
658 } 692 }
659 mutex_unlock(&port->phy_list_mutex); 693 mutex_unlock(&port->phy_list_mutex);
660 694
695 if (port->is_backlink) {
696 struct device *parent = port->dev.parent;
697
698 sysfs_remove_link(&port->dev.kobj, parent->bus_id);
699 port->is_backlink = 0;
700 }
701
661 transport_remove_device(dev); 702 transport_remove_device(dev);
662 device_del(dev); 703 device_del(dev);
663 transport_destroy_device(dev); 704 transport_destroy_device(dev);
@@ -733,6 +774,19 @@ void sas_port_delete_phy(struct sas_port *port, struct sas_phy *phy)
733} 774}
734EXPORT_SYMBOL(sas_port_delete_phy); 775EXPORT_SYMBOL(sas_port_delete_phy);
735 776
777void sas_port_mark_backlink(struct sas_port *port)
778{
779 struct device *parent = port->dev.parent->parent->parent;
780
781 if (port->is_backlink)
782 return;
783 port->is_backlink = 1;
784 sysfs_create_link(&port->dev.kobj, &parent->kobj,
785 parent->bus_id);
786
787}
788EXPORT_SYMBOL(sas_port_mark_backlink);
789
736/* 790/*
737 * SAS remote PHY attributes. 791 * SAS remote PHY attributes.
738 */ 792 */
@@ -1140,7 +1194,7 @@ int sas_rphy_add(struct sas_rphy *rphy)
1140 1194
1141 if (identify->device_type == SAS_END_DEVICE && 1195 if (identify->device_type == SAS_END_DEVICE &&
1142 rphy->scsi_target_id != -1) { 1196 rphy->scsi_target_id != -1) {
1143 scsi_scan_target(&rphy->dev, parent->port_identifier, 1197 scsi_scan_target(&rphy->dev, 0,
1144 rphy->scsi_target_id, ~0, 0); 1198 rphy->scsi_target_id, ~0, 0);
1145 } 1199 }
1146 1200
@@ -1242,15 +1296,13 @@ static int sas_user_scan(struct Scsi_Host *shost, uint channel,
1242 1296
1243 mutex_lock(&sas_host->lock); 1297 mutex_lock(&sas_host->lock);
1244 list_for_each_entry(rphy, &sas_host->rphy_list, list) { 1298 list_for_each_entry(rphy, &sas_host->rphy_list, list) {
1245 struct sas_port *parent = dev_to_sas_port(rphy->dev.parent);
1246
1247 if (rphy->identify.device_type != SAS_END_DEVICE || 1299 if (rphy->identify.device_type != SAS_END_DEVICE ||
1248 rphy->scsi_target_id == -1) 1300 rphy->scsi_target_id == -1)
1249 continue; 1301 continue;
1250 1302
1251 if ((channel == SCAN_WILD_CARD || channel == parent->port_identifier) && 1303 if ((channel == SCAN_WILD_CARD || channel == 0) &&
1252 (id == SCAN_WILD_CARD || id == rphy->scsi_target_id)) { 1304 (id == SCAN_WILD_CARD || id == rphy->scsi_target_id)) {
1253 scsi_scan_target(&rphy->dev, parent->port_identifier, 1305 scsi_scan_target(&rphy->dev, 0,
1254 rphy->scsi_target_id, lun, 1); 1306 rphy->scsi_target_id, lun, 1);
1255 } 1307 }
1256 } 1308 }
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 3225d31449e1..98bd3aab9739 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -502,8 +502,7 @@ static int sd_init_command(struct scsi_cmnd * SCpnt)
502 SCpnt->cmnd[4] = (unsigned char) this_count; 502 SCpnt->cmnd[4] = (unsigned char) this_count;
503 SCpnt->cmnd[5] = 0; 503 SCpnt->cmnd[5] = 0;
504 } 504 }
505 SCpnt->request_bufflen = SCpnt->bufflen = 505 SCpnt->request_bufflen = this_count * sdp->sector_size;
506 this_count * sdp->sector_size;
507 506
508 /* 507 /*
509 * We shouldn't disconnect in the middle of a sector, so with a dumb 508 * We shouldn't disconnect in the middle of a sector, so with a dumb
diff --git a/drivers/scsi/seagate.c b/drivers/scsi/seagate.c
index 3f312a84c6a7..2679ea8bff1a 100644
--- a/drivers/scsi/seagate.c
+++ b/drivers/scsi/seagate.c
@@ -1002,7 +1002,7 @@ connect_loop:
1002 } 1002 }
1003#endif 1003#endif
1004 1004
1005 buffer = (struct scatterlist *) SCint->buffer; 1005 buffer = (struct scatterlist *) SCint->request_buffer;
1006 len = buffer->length; 1006 len = buffer->length;
1007 data = page_address(buffer->page) + buffer->offset; 1007 data = page_address(buffer->page) + buffer->offset;
1008 } else { 1008 } else {
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index fd94408577e5..fae6e95a6298 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -360,7 +360,7 @@ static int sr_init_command(struct scsi_cmnd * SCpnt)
360 "mismatch count %d, bytes %d\n", 360 "mismatch count %d, bytes %d\n",
361 size, SCpnt->request_bufflen); 361 size, SCpnt->request_bufflen);
362 if (SCpnt->request_bufflen > size) 362 if (SCpnt->request_bufflen > size)
363 SCpnt->request_bufflen = SCpnt->bufflen = size; 363 SCpnt->request_bufflen = size;
364 } 364 }
365 } 365 }
366 366
@@ -387,8 +387,7 @@ static int sr_init_command(struct scsi_cmnd * SCpnt)
387 387
388 if (this_count > 0xffff) { 388 if (this_count > 0xffff) {
389 this_count = 0xffff; 389 this_count = 0xffff;
390 SCpnt->request_bufflen = SCpnt->bufflen = 390 SCpnt->request_bufflen = this_count * s_size;
391 this_count * s_size;
392 } 391 }
393 392
394 SCpnt->cmnd[2] = (unsigned char) (block >> 24) & 0xff; 393 SCpnt->cmnd[2] = (unsigned char) (block >> 24) & 0xff;
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index 756ceb93ddc8..7f669b600677 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -368,7 +368,7 @@ static int st_chk_result(struct scsi_tape *STp, struct st_request * SRpnt)
368 SRpnt->cmd[0], SRpnt->cmd[1], SRpnt->cmd[2], 368 SRpnt->cmd[0], SRpnt->cmd[1], SRpnt->cmd[2],
369 SRpnt->cmd[3], SRpnt->cmd[4], SRpnt->cmd[5]); 369 SRpnt->cmd[3], SRpnt->cmd[4], SRpnt->cmd[5]);
370 if (cmdstatp->have_sense) 370 if (cmdstatp->have_sense)
371 __scsi_print_sense("st", SRpnt->sense, SCSI_SENSE_BUFFERSIZE); 371 __scsi_print_sense(name, SRpnt->sense, SCSI_SENSE_BUFFERSIZE);
372 } ) /* end DEB */ 372 } ) /* end DEB */
373 if (!debugging) { /* Abnormal conditions for tape */ 373 if (!debugging) { /* Abnormal conditions for tape */
374 if (!cmdstatp->have_sense) 374 if (!cmdstatp->have_sense)
@@ -384,9 +384,8 @@ static int st_chk_result(struct scsi_tape *STp, struct st_request * SRpnt)
384 scode != VOLUME_OVERFLOW && 384 scode != VOLUME_OVERFLOW &&
385 SRpnt->cmd[0] != MODE_SENSE && 385 SRpnt->cmd[0] != MODE_SENSE &&
386 SRpnt->cmd[0] != TEST_UNIT_READY) { 386 SRpnt->cmd[0] != TEST_UNIT_READY) {
387 printk(KERN_WARNING "%s: Error with sense data: ", name); 387
388 __scsi_print_sense("st", SRpnt->sense, 388 __scsi_print_sense(name, SRpnt->sense, SCSI_SENSE_BUFFERSIZE);
389 SCSI_SENSE_BUFFERSIZE);
390 } 389 }
391 } 390 }
392 391
diff --git a/drivers/scsi/sun3_NCR5380.c b/drivers/scsi/sun3_NCR5380.c
index 2ebe0d663899..2f8073b73bf3 100644
--- a/drivers/scsi/sun3_NCR5380.c
+++ b/drivers/scsi/sun3_NCR5380.c
@@ -517,7 +517,7 @@ static __inline__ void initialize_SCp(Scsi_Cmnd *cmd)
517 */ 517 */
518 518
519 if (cmd->use_sg) { 519 if (cmd->use_sg) {
520 cmd->SCp.buffer = (struct scatterlist *) cmd->buffer; 520 cmd->SCp.buffer = (struct scatterlist *) cmd->request_buffer;
521 cmd->SCp.buffers_residual = cmd->use_sg - 1; 521 cmd->SCp.buffers_residual = cmd->use_sg - 1;
522 cmd->SCp.ptr = (char *) SGADDR(cmd->SCp.buffer); 522 cmd->SCp.ptr = (char *) SGADDR(cmd->SCp.buffer);
523 cmd->SCp.this_residual = cmd->SCp.buffer->length; 523 cmd->SCp.this_residual = cmd->SCp.buffer->length;
diff --git a/drivers/scsi/sun3x_esp.c b/drivers/scsi/sun3x_esp.c
index 1f328cae5c05..6b60536ac92b 100644
--- a/drivers/scsi/sun3x_esp.c
+++ b/drivers/scsi/sun3x_esp.c
@@ -347,7 +347,7 @@ static void dma_mmu_release_scsi_one (struct NCR_ESP *esp, Scsi_Cmnd *sp)
347static void dma_mmu_release_scsi_sgl (struct NCR_ESP *esp, Scsi_Cmnd *sp) 347static void dma_mmu_release_scsi_sgl (struct NCR_ESP *esp, Scsi_Cmnd *sp)
348{ 348{
349 int sz = sp->use_sg - 1; 349 int sz = sp->use_sg - 1;
350 struct scatterlist *sg = (struct scatterlist *)sp->buffer; 350 struct scatterlist *sg = (struct scatterlist *)sp->request_buffer;
351 351
352 while(sz >= 0) { 352 while(sz >= 0) {
353 dvma_unmap((char *)sg[sz].dma_address); 353 dvma_unmap((char *)sg[sz].dma_address);
diff --git a/drivers/scsi/wd33c93.c b/drivers/scsi/wd33c93.c
index 680f38ab60d8..2083454db511 100644
--- a/drivers/scsi/wd33c93.c
+++ b/drivers/scsi/wd33c93.c
@@ -373,7 +373,7 @@ wd33c93_queuecommand(struct scsi_cmnd *cmd,
373 */ 373 */
374 374
375 if (cmd->use_sg) { 375 if (cmd->use_sg) {
376 cmd->SCp.buffer = (struct scatterlist *) cmd->buffer; 376 cmd->SCp.buffer = (struct scatterlist *) cmd->request_buffer;
377 cmd->SCp.buffers_residual = cmd->use_sg - 1; 377 cmd->SCp.buffers_residual = cmd->use_sg - 1;
378 cmd->SCp.ptr = page_address(cmd->SCp.buffer->page) + 378 cmd->SCp.ptr = page_address(cmd->SCp.buffer->page) +
379 cmd->SCp.buffer->offset; 379 cmd->SCp.buffer->offset;
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 0995430e4cf1..0ae9ced00ed4 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -299,6 +299,7 @@ static inline int map_8250_out_reg(struct uart_8250_port *up, int offset)
299 299
300static unsigned int serial_in(struct uart_8250_port *up, int offset) 300static unsigned int serial_in(struct uart_8250_port *up, int offset)
301{ 301{
302 unsigned int tmp;
302 offset = map_8250_in_reg(up, offset) << up->port.regshift; 303 offset = map_8250_in_reg(up, offset) << up->port.regshift;
303 304
304 switch (up->port.iotype) { 305 switch (up->port.iotype) {
@@ -317,6 +318,13 @@ static unsigned int serial_in(struct uart_8250_port *up, int offset)
317 return __raw_readl(up->port.membase + offset); 318 return __raw_readl(up->port.membase + offset);
318#endif 319#endif
319 320
321 case UPIO_TSI:
322 if (offset == UART_IIR) {
323 tmp = readl((u32 *)(up->port.membase + UART_RX));
324 return (cpu_to_le32(tmp) >> 8) & 0xff;
325 } else
326 return readb(up->port.membase + offset);
327
320 default: 328 default:
321 return inb(up->port.iobase + offset); 329 return inb(up->port.iobase + offset);
322 } 330 }
@@ -346,6 +354,10 @@ serial_out(struct uart_8250_port *up, int offset, int value)
346 __raw_writel(value, up->port.membase + offset); 354 __raw_writel(value, up->port.membase + offset);
347 break; 355 break;
348#endif 356#endif
357 case UPIO_TSI:
358 if (!((offset == UART_IER) && (value & UART_IER_UUE)))
359 writeb(value, up->port.membase + offset);
360 break;
349 361
350 default: 362 default:
351 outb(value, up->port.iobase + offset); 363 outb(value, up->port.iobase + offset);
@@ -2240,10 +2252,14 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count)
2240 2252
2241 touch_nmi_watchdog(); 2253 touch_nmi_watchdog();
2242 2254
2243 if (oops_in_progress) { 2255 local_irq_save(flags);
2244 locked = spin_trylock_irqsave(&up->port.lock, flags); 2256 if (up->port.sysrq) {
2257 /* serial8250_handle_port() already took the lock */
2258 locked = 0;
2259 } else if (oops_in_progress) {
2260 locked = spin_trylock(&up->port.lock);
2245 } else 2261 } else
2246 spin_lock_irqsave(&up->port.lock, flags); 2262 spin_lock(&up->port.lock);
2247 2263
2248 /* 2264 /*
2249 * First save the IER then disable the interrupts 2265 * First save the IER then disable the interrupts
@@ -2265,7 +2281,8 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count)
2265 serial_out(up, UART_IER, ier); 2281 serial_out(up, UART_IER, ier);
2266 2282
2267 if (locked) 2283 if (locked)
2268 spin_unlock_irqrestore(&up->port.lock, flags); 2284 spin_unlock(&up->port.lock);
2285 local_irq_restore(flags);
2269} 2286}
2270 2287
2271static int serial8250_console_setup(struct console *co, char *options) 2288static int serial8250_console_setup(struct console *co, char *options)
diff --git a/drivers/serial/at91_serial.c b/drivers/serial/at91_serial.c
index a7d664383dae..54c6b2adf7b7 100644
--- a/drivers/serial/at91_serial.c
+++ b/drivers/serial/at91_serial.c
@@ -41,6 +41,7 @@
41#include <asm/mach/serial_at91.h> 41#include <asm/mach/serial_at91.h>
42#include <asm/arch/board.h> 42#include <asm/arch/board.h>
43#include <asm/arch/system.h> 43#include <asm/arch/system.h>
44#include <asm/arch/gpio.h>
44 45
45#if defined(CONFIG_SERIAL_AT91_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) 46#if defined(CONFIG_SERIAL_AT91_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
46#define SUPPORT_SYSRQ 47#define SUPPORT_SYSRQ
@@ -140,9 +141,9 @@ static void at91_set_mctrl(struct uart_port *port, u_int mctrl)
140 */ 141 */
141 if (port->mapbase == AT91_BASE_US0) { 142 if (port->mapbase == AT91_BASE_US0) {
142 if (mctrl & TIOCM_RTS) 143 if (mctrl & TIOCM_RTS)
143 at91_sys_write(AT91_PIOA + PIO_CODR, AT91_PA21_RTS0); 144 at91_set_gpio_value(AT91_PIN_PA21, 0);
144 else 145 else
145 at91_sys_write(AT91_PIOA + PIO_SODR, AT91_PA21_RTS0); 146 at91_set_gpio_value(AT91_PIN_PA21, 1);
146 } 147 }
147 } 148 }
148 149
diff --git a/drivers/serial/dz.c b/drivers/serial/dz.c
index d119c8296a78..8a98aae80e22 100644
--- a/drivers/serial/dz.c
+++ b/drivers/serial/dz.c
@@ -673,7 +673,7 @@ static void dz_reset(struct dz_port *dport)
673} 673}
674 674
675#ifdef CONFIG_SERIAL_DZ_CONSOLE 675#ifdef CONFIG_SERIAL_DZ_CONSOLE
676static void dz_console_putchar(struct uart_port *port, int ch) 676static void dz_console_putchar(struct uart_port *uport, int ch)
677{ 677{
678 struct dz_port *dport = (struct dz_port *)uport; 678 struct dz_port *dport = (struct dz_port *)uport;
679 unsigned long flags; 679 unsigned long flags;
diff --git a/drivers/serial/ip22zilog.c b/drivers/serial/ip22zilog.c
index 342042889f6e..5ff269fb604c 100644
--- a/drivers/serial/ip22zilog.c
+++ b/drivers/serial/ip22zilog.c
@@ -1143,9 +1143,8 @@ static void __init ip22zilog_prepare(void)
1143 up[(chip * 2) + 1].port.fifosize = 1; 1143 up[(chip * 2) + 1].port.fifosize = 1;
1144 up[(chip * 2) + 1].port.ops = &ip22zilog_pops; 1144 up[(chip * 2) + 1].port.ops = &ip22zilog_pops;
1145 up[(chip * 2) + 1].port.type = PORT_IP22ZILOG; 1145 up[(chip * 2) + 1].port.type = PORT_IP22ZILOG;
1146 up[(chip * 2) + 1].port.flags |= IP22ZILOG_FLAG_IS_CHANNEL_A;
1147 up[(chip * 2) + 1].port.line = (chip * 2) + 1; 1146 up[(chip * 2) + 1].port.line = (chip * 2) + 1;
1148 up[(chip * 2) + 1].flags = 0; 1147 up[(chip * 2) + 1].flags |= IP22ZILOG_FLAG_IS_CHANNEL_A;
1149 } 1148 }
1150} 1149}
1151 1150
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
index d5f636fbf29a..80ef7d482756 100644
--- a/drivers/serial/serial_core.c
+++ b/drivers/serial/serial_core.c
@@ -2036,6 +2036,7 @@ uart_report_port(struct uart_driver *drv, struct uart_port *port)
2036 case UPIO_MEM: 2036 case UPIO_MEM:
2037 case UPIO_MEM32: 2037 case UPIO_MEM32:
2038 case UPIO_AU: 2038 case UPIO_AU:
2039 case UPIO_TSI:
2039 snprintf(address, sizeof(address), 2040 snprintf(address, sizeof(address),
2040 "MMIO 0x%lx", port->mapbase); 2041 "MMIO 0x%lx", port->mapbase);
2041 break; 2042 break;
diff --git a/drivers/serial/sunsab.c b/drivers/serial/sunsab.c
index 0dbd4df44c05..dc673e1b6fd9 100644
--- a/drivers/serial/sunsab.c
+++ b/drivers/serial/sunsab.c
@@ -1047,12 +1047,13 @@ static int __devinit sab_probe(struct of_device *op, const struct of_device_id *
1047 up = &sunsab_ports[inst * 2]; 1047 up = &sunsab_ports[inst * 2];
1048 1048
1049 err = sunsab_init_one(&up[0], op, 1049 err = sunsab_init_one(&up[0], op,
1050 sizeof(union sab82532_async_regs), 1050 0,
1051 (inst * 2) + 0); 1051 (inst * 2) + 0);
1052 if (err) 1052 if (err)
1053 return err; 1053 return err;
1054 1054
1055 err = sunsab_init_one(&up[0], op, 0, 1055 err = sunsab_init_one(&up[1], op,
1056 sizeof(union sab82532_async_regs),
1056 (inst * 2) + 1); 1057 (inst * 2) + 1);
1057 if (err) { 1058 if (err) {
1058 of_iounmap(up[0].port.membase, 1059 of_iounmap(up[0].port.membase,
@@ -1117,7 +1118,7 @@ static int __init sunsab_init(void)
1117 int err; 1118 int err;
1118 1119
1119 num_channels = 0; 1120 num_channels = 0;
1120 for_each_node_by_name(dp, "su") 1121 for_each_node_by_name(dp, "se")
1121 num_channels += 2; 1122 num_channels += 2;
1122 for_each_node_by_name(dp, "serial") { 1123 for_each_node_by_name(dp, "serial") {
1123 if (of_device_is_compatible(dp, "sab82532")) 1124 if (of_device_is_compatible(dp, "sab82532"))
diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c
index f9013baba05b..d3a5aeee73a3 100644
--- a/drivers/serial/sunsu.c
+++ b/drivers/serial/sunsu.c
@@ -1200,6 +1200,11 @@ static int __init sunsu_kbd_ms_init(struct uart_sunsu_port *up)
1200 if (up->port.type == PORT_UNKNOWN) 1200 if (up->port.type == PORT_UNKNOWN)
1201 return -ENODEV; 1201 return -ENODEV;
1202 1202
1203 printk("%s: %s port at %lx, irq %u\n",
1204 to_of_device(up->port.dev)->node->full_name,
1205 (up->su_type == SU_PORT_KBD) ? "Keyboard" : "Mouse",
1206 up->port.mapbase, up->port.irq);
1207
1203#ifdef CONFIG_SERIO 1208#ifdef CONFIG_SERIO
1204 serio = &up->serio; 1209 serio = &up->serio;
1205 serio->port_data = up; 1210 serio->port_data = up;
@@ -1406,25 +1411,35 @@ static int __devinit su_probe(struct of_device *op, const struct of_device_id *m
1406 struct device_node *dp = op->node; 1411 struct device_node *dp = op->node;
1407 struct uart_sunsu_port *up; 1412 struct uart_sunsu_port *up;
1408 struct resource *rp; 1413 struct resource *rp;
1414 enum su_type type;
1409 int err; 1415 int err;
1410 1416
1411 if (inst >= UART_NR) 1417 type = su_get_type(dp);
1412 return -EINVAL; 1418 if (type == SU_PORT_PORT) {
1419 if (inst >= UART_NR)
1420 return -EINVAL;
1421 up = &sunsu_ports[inst];
1422 } else {
1423 up = kzalloc(sizeof(*up), GFP_KERNEL);
1424 if (!up)
1425 return -ENOMEM;
1426 }
1413 1427
1414 up = &sunsu_ports[inst];
1415 up->port.line = inst; 1428 up->port.line = inst;
1416 1429
1417 spin_lock_init(&up->port.lock); 1430 spin_lock_init(&up->port.lock);
1418 1431
1419 up->su_type = su_get_type(dp); 1432 up->su_type = type;
1420 1433
1421 rp = &op->resource[0]; 1434 rp = &op->resource[0];
1422 up->port.mapbase = op->resource[0].start; 1435 up->port.mapbase = rp->start;
1423
1424 up->reg_size = (rp->end - rp->start) + 1; 1436 up->reg_size = (rp->end - rp->start) + 1;
1425 up->port.membase = of_ioremap(rp, 0, up->reg_size, "su"); 1437 up->port.membase = of_ioremap(rp, 0, up->reg_size, "su");
1426 if (!up->port.membase) 1438 if (!up->port.membase) {
1439 if (type != SU_PORT_PORT)
1440 kfree(up);
1427 return -ENOMEM; 1441 return -ENOMEM;
1442 }
1428 1443
1429 up->port.irq = op->irqs[0]; 1444 up->port.irq = op->irqs[0];
1430 1445
@@ -1436,8 +1451,11 @@ static int __devinit su_probe(struct of_device *op, const struct of_device_id *m
1436 err = 0; 1451 err = 0;
1437 if (up->su_type == SU_PORT_KBD || up->su_type == SU_PORT_MS) { 1452 if (up->su_type == SU_PORT_KBD || up->su_type == SU_PORT_MS) {
1438 err = sunsu_kbd_ms_init(up); 1453 err = sunsu_kbd_ms_init(up);
1439 if (err) 1454 if (err) {
1455 kfree(up);
1440 goto out_unmap; 1456 goto out_unmap;
1457 }
1458 dev_set_drvdata(&op->dev, up);
1441 1459
1442 return 0; 1460 return 0;
1443 } 1461 }
@@ -1476,8 +1494,12 @@ static int __devexit su_remove(struct of_device *dev)
1476#ifdef CONFIG_SERIO 1494#ifdef CONFIG_SERIO
1477 serio_unregister_port(&up->serio); 1495 serio_unregister_port(&up->serio);
1478#endif 1496#endif
1479 } else if (up->port.type != PORT_UNKNOWN) 1497 kfree(up);
1498 } else if (up->port.type != PORT_UNKNOWN) {
1480 uart_remove_one_port(&sunsu_reg, &up->port); 1499 uart_remove_one_port(&sunsu_reg, &up->port);
1500 }
1501
1502 dev_set_drvdata(&dev->dev, NULL);
1481 1503
1482 return 0; 1504 return 0;
1483} 1505}
diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c
index a1456d9352cb..47bc3d57e019 100644
--- a/drivers/serial/sunzilog.c
+++ b/drivers/serial/sunzilog.c
@@ -68,9 +68,6 @@ static int num_sunzilog;
68#define NUM_SUNZILOG num_sunzilog 68#define NUM_SUNZILOG num_sunzilog
69#define NUM_CHANNELS (NUM_SUNZILOG * 2) 69#define NUM_CHANNELS (NUM_SUNZILOG * 2)
70 70
71#define KEYBOARD_LINE 0x2
72#define MOUSE_LINE 0x3
73
74#define ZS_CLOCK 4915200 /* Zilog input clock rate. */ 71#define ZS_CLOCK 4915200 /* Zilog input clock rate. */
75#define ZS_CLOCK_DIVISOR 16 /* Divisor this driver uses. */ 72#define ZS_CLOCK_DIVISOR 16 /* Divisor this driver uses. */
76 73
@@ -1225,12 +1222,10 @@ static void __init sunzilog_init_kbdms(struct uart_sunzilog_port *up, int channe
1225{ 1222{
1226 int baud, brg; 1223 int baud, brg;
1227 1224
1228 if (channel == KEYBOARD_LINE) { 1225 if (up->flags & SUNZILOG_FLAG_CONS_KEYB) {
1229 up->flags |= SUNZILOG_FLAG_CONS_KEYB;
1230 up->cflag = B1200 | CS8 | CLOCAL | CREAD; 1226 up->cflag = B1200 | CS8 | CLOCAL | CREAD;
1231 baud = 1200; 1227 baud = 1200;
1232 } else { 1228 } else {
1233 up->flags |= SUNZILOG_FLAG_CONS_MOUSE;
1234 up->cflag = B4800 | CS8 | CLOCAL | CREAD; 1229 up->cflag = B4800 | CS8 | CLOCAL | CREAD;
1235 baud = 4800; 1230 baud = 4800;
1236 } 1231 }
@@ -1243,14 +1238,14 @@ static void __init sunzilog_init_kbdms(struct uart_sunzilog_port *up, int channe
1243} 1238}
1244 1239
1245#ifdef CONFIG_SERIO 1240#ifdef CONFIG_SERIO
1246static void __init sunzilog_register_serio(struct uart_sunzilog_port *up, int channel) 1241static void __init sunzilog_register_serio(struct uart_sunzilog_port *up)
1247{ 1242{
1248 struct serio *serio = &up->serio; 1243 struct serio *serio = &up->serio;
1249 1244
1250 serio->port_data = up; 1245 serio->port_data = up;
1251 1246
1252 serio->id.type = SERIO_RS232; 1247 serio->id.type = SERIO_RS232;
1253 if (channel == KEYBOARD_LINE) { 1248 if (up->flags & SUNZILOG_FLAG_CONS_KEYB) {
1254 serio->id.proto = SERIO_SUNKBD; 1249 serio->id.proto = SERIO_SUNKBD;
1255 strlcpy(serio->name, "zskbd", sizeof(serio->name)); 1250 strlcpy(serio->name, "zskbd", sizeof(serio->name));
1256 } else { 1251 } else {
@@ -1259,7 +1254,8 @@ static void __init sunzilog_register_serio(struct uart_sunzilog_port *up, int ch
1259 strlcpy(serio->name, "zsms", sizeof(serio->name)); 1254 strlcpy(serio->name, "zsms", sizeof(serio->name));
1260 } 1255 }
1261 strlcpy(serio->phys, 1256 strlcpy(serio->phys,
1262 (channel == KEYBOARD_LINE ? "zs/serio0" : "zs/serio1"), 1257 ((up->flags & SUNZILOG_FLAG_CONS_KEYB) ?
1258 "zs/serio0" : "zs/serio1"),
1263 sizeof(serio->phys)); 1259 sizeof(serio->phys));
1264 1260
1265 serio->write = sunzilog_serio_write; 1261 serio->write = sunzilog_serio_write;
@@ -1286,8 +1282,8 @@ static void __init sunzilog_init_hw(struct uart_sunzilog_port *up)
1286 (void) read_zsreg(channel, R0); 1282 (void) read_zsreg(channel, R0);
1287 } 1283 }
1288 1284
1289 if (up->port.line == KEYBOARD_LINE || 1285 if (up->flags & (SUNZILOG_FLAG_CONS_KEYB |
1290 up->port.line == MOUSE_LINE) { 1286 SUNZILOG_FLAG_CONS_MOUSE)) {
1291 sunzilog_init_kbdms(up, up->port.line); 1287 sunzilog_init_kbdms(up, up->port.line);
1292 up->curregs[R9] |= (NV | MIE); 1288 up->curregs[R9] |= (NV | MIE);
1293 write_zsreg(channel, R9, up->curregs[R9]); 1289 write_zsreg(channel, R9, up->curregs[R9]);
@@ -1313,37 +1309,26 @@ static void __init sunzilog_init_hw(struct uart_sunzilog_port *up)
1313 spin_unlock_irqrestore(&up->port.lock, flags); 1309 spin_unlock_irqrestore(&up->port.lock, flags);
1314 1310
1315#ifdef CONFIG_SERIO 1311#ifdef CONFIG_SERIO
1316 if (up->port.line == KEYBOARD_LINE || up->port.line == MOUSE_LINE) 1312 if (up->flags & (SUNZILOG_FLAG_CONS_KEYB |
1317 sunzilog_register_serio(up, up->port.line); 1313 SUNZILOG_FLAG_CONS_MOUSE))
1314 sunzilog_register_serio(up);
1318#endif 1315#endif
1319} 1316}
1320 1317
1321static int __devinit zs_get_instance(struct device_node *dp)
1322{
1323 int ret;
1324
1325 ret = of_getintprop_default(dp, "slave", -1);
1326 if (ret != -1)
1327 return ret;
1328
1329 if (of_find_property(dp, "keyboard", NULL))
1330 ret = 1;
1331 else
1332 ret = 0;
1333
1334 return ret;
1335}
1336
1337static int zilog_irq = -1; 1318static int zilog_irq = -1;
1338 1319
1339static int __devinit zs_probe(struct of_device *dev, const struct of_device_id *match) 1320static int __devinit zs_probe(struct of_device *op, const struct of_device_id *match)
1340{ 1321{
1341 struct of_device *op = to_of_device(&dev->dev); 1322 static int inst;
1342 struct uart_sunzilog_port *up; 1323 struct uart_sunzilog_port *up;
1343 struct zilog_layout __iomem *rp; 1324 struct zilog_layout __iomem *rp;
1344 int inst = zs_get_instance(dev->node); 1325 int keyboard_mouse;
1345 int err; 1326 int err;
1346 1327
1328 keyboard_mouse = 0;
1329 if (of_find_property(op->node, "keyboard", NULL))
1330 keyboard_mouse = 1;
1331
1347 sunzilog_chip_regs[inst] = of_ioremap(&op->resource[0], 0, 1332 sunzilog_chip_regs[inst] = of_ioremap(&op->resource[0], 0,
1348 sizeof(struct zilog_layout), 1333 sizeof(struct zilog_layout),
1349 "zs"); 1334 "zs");
@@ -1352,16 +1337,8 @@ static int __devinit zs_probe(struct of_device *dev, const struct of_device_id *
1352 1337
1353 rp = sunzilog_chip_regs[inst]; 1338 rp = sunzilog_chip_regs[inst];
1354 1339
1355 if (zilog_irq == -1) { 1340 if (zilog_irq == -1)
1356 zilog_irq = op->irqs[0]; 1341 zilog_irq = op->irqs[0];
1357 err = request_irq(zilog_irq, sunzilog_interrupt, IRQF_SHARED,
1358 "zs", sunzilog_irq_chain);
1359 if (err) {
1360 of_iounmap(rp, sizeof(struct zilog_layout));
1361
1362 return err;
1363 }
1364 }
1365 1342
1366 up = &sunzilog_port_table[inst * 2]; 1343 up = &sunzilog_port_table[inst * 2];
1367 1344
@@ -1378,7 +1355,7 @@ static int __devinit zs_probe(struct of_device *dev, const struct of_device_id *
1378 up[0].port.line = (inst * 2) + 0; 1355 up[0].port.line = (inst * 2) + 0;
1379 up[0].port.dev = &op->dev; 1356 up[0].port.dev = &op->dev;
1380 up[0].flags |= SUNZILOG_FLAG_IS_CHANNEL_A; 1357 up[0].flags |= SUNZILOG_FLAG_IS_CHANNEL_A;
1381 if (inst == 1) 1358 if (keyboard_mouse)
1382 up[0].flags |= SUNZILOG_FLAG_CONS_KEYB; 1359 up[0].flags |= SUNZILOG_FLAG_CONS_KEYB;
1383 sunzilog_init_hw(&up[0]); 1360 sunzilog_init_hw(&up[0]);
1384 1361
@@ -1395,11 +1372,11 @@ static int __devinit zs_probe(struct of_device *dev, const struct of_device_id *
1395 up[1].port.line = (inst * 2) + 1; 1372 up[1].port.line = (inst * 2) + 1;
1396 up[1].port.dev = &op->dev; 1373 up[1].port.dev = &op->dev;
1397 up[1].flags |= 0; 1374 up[1].flags |= 0;
1398 if (inst == 1) 1375 if (keyboard_mouse)
1399 up[1].flags |= SUNZILOG_FLAG_CONS_MOUSE; 1376 up[1].flags |= SUNZILOG_FLAG_CONS_MOUSE;
1400 sunzilog_init_hw(&up[1]); 1377 sunzilog_init_hw(&up[1]);
1401 1378
1402 if (inst != 1) { 1379 if (!keyboard_mouse) {
1403 err = uart_add_one_port(&sunzilog_reg, &up[0].port); 1380 err = uart_add_one_port(&sunzilog_reg, &up[0].port);
1404 if (err) { 1381 if (err) {
1405 of_iounmap(rp, sizeof(struct zilog_layout)); 1382 of_iounmap(rp, sizeof(struct zilog_layout));
@@ -1411,9 +1388,18 @@ static int __devinit zs_probe(struct of_device *dev, const struct of_device_id *
1411 of_iounmap(rp, sizeof(struct zilog_layout)); 1388 of_iounmap(rp, sizeof(struct zilog_layout));
1412 return err; 1389 return err;
1413 } 1390 }
1391 } else {
1392 printk(KERN_INFO "%s: Keyboard at MMIO %lx (irq = %d) "
1393 "is a zs\n",
1394 op->dev.bus_id, up[0].port.mapbase, op->irqs[0]);
1395 printk(KERN_INFO "%s: Mouse at MMIO %lx (irq = %d) "
1396 "is a zs\n",
1397 op->dev.bus_id, up[1].port.mapbase, op->irqs[0]);
1414 } 1398 }
1415 1399
1416 dev_set_drvdata(&dev->dev, &up[0]); 1400 dev_set_drvdata(&op->dev, &up[0]);
1401
1402 inst++;
1417 1403
1418 return 0; 1404 return 0;
1419} 1405}
@@ -1462,36 +1448,65 @@ static struct of_platform_driver zs_driver = {
1462static int __init sunzilog_init(void) 1448static int __init sunzilog_init(void)
1463{ 1449{
1464 struct device_node *dp; 1450 struct device_node *dp;
1465 int err; 1451 int err, uart_count;
1452 int num_keybms;
1466 1453
1467 NUM_SUNZILOG = 0; 1454 NUM_SUNZILOG = 0;
1468 for_each_node_by_name(dp, "zs") 1455 num_keybms = 0;
1456 for_each_node_by_name(dp, "zs") {
1469 NUM_SUNZILOG++; 1457 NUM_SUNZILOG++;
1458 if (of_find_property(dp, "keyboard", NULL))
1459 num_keybms++;
1460 }
1470 1461
1462 uart_count = 0;
1471 if (NUM_SUNZILOG) { 1463 if (NUM_SUNZILOG) {
1472 int uart_count; 1464 int uart_count;
1473 1465
1474 err = sunzilog_alloc_tables(); 1466 err = sunzilog_alloc_tables();
1475 if (err) 1467 if (err)
1476 return err; 1468 goto out;
1477 1469
1478 /* Subtract 1 for keyboard, 1 for mouse. */ 1470 uart_count = (NUM_SUNZILOG * 2) - (2 * num_keybms);
1479 uart_count = (NUM_SUNZILOG * 2) - 2;
1480 1471
1481 sunzilog_reg.nr = uart_count; 1472 sunzilog_reg.nr = uart_count;
1482 sunzilog_reg.minor = sunserial_current_minor; 1473 sunzilog_reg.minor = sunserial_current_minor;
1483 err = uart_register_driver(&sunzilog_reg); 1474 err = uart_register_driver(&sunzilog_reg);
1484 if (err) { 1475 if (err)
1485 sunzilog_free_tables(); 1476 goto out_free_tables;
1486 return err; 1477
1487 }
1488 sunzilog_reg.tty_driver->name_base = sunzilog_reg.minor - 64; 1478 sunzilog_reg.tty_driver->name_base = sunzilog_reg.minor - 64;
1489 sunzilog_reg.cons = SUNZILOG_CONSOLE(); 1479 sunzilog_reg.cons = SUNZILOG_CONSOLE();
1490 1480
1491 sunserial_current_minor += uart_count; 1481 sunserial_current_minor += uart_count;
1492 } 1482 }
1493 1483
1494 return of_register_driver(&zs_driver, &of_bus_type); 1484 err = of_register_driver(&zs_driver, &of_bus_type);
1485 if (err)
1486 goto out_unregister_uart;
1487
1488 if (zilog_irq != -1) {
1489 err = request_irq(zilog_irq, sunzilog_interrupt, IRQF_SHARED,
1490 "zs", sunzilog_irq_chain);
1491 if (err)
1492 goto out_unregister_driver;
1493 }
1494
1495out:
1496 return err;
1497
1498out_unregister_driver:
1499 of_unregister_driver(&zs_driver);
1500
1501out_unregister_uart:
1502 if (NUM_SUNZILOG) {
1503 uart_unregister_driver(&sunzilog_reg);
1504 sunzilog_reg.cons = NULL;
1505 }
1506
1507out_free_tables:
1508 sunzilog_free_tables();
1509 goto out;
1495} 1510}
1496 1511
1497static void __exit sunzilog_exit(void) 1512static void __exit sunzilog_exit(void)
diff --git a/drivers/serial/vr41xx_siu.c b/drivers/serial/vr41xx_siu.c
index e93d0edc2e08..6c8b0ea83c3c 100644
--- a/drivers/serial/vr41xx_siu.c
+++ b/drivers/serial/vr41xx_siu.c
@@ -38,6 +38,7 @@
38#include <linux/tty_flip.h> 38#include <linux/tty_flip.h>
39 39
40#include <asm/io.h> 40#include <asm/io.h>
41#include <asm/vr41xx/irq.h>
41#include <asm/vr41xx/siu.h> 42#include <asm/vr41xx/siu.h>
42#include <asm/vr41xx/vr41xx.h> 43#include <asm/vr41xx/vr41xx.h>
43 44
diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig
index 7fdbc5dad5fd..005043197527 100644
--- a/drivers/usb/Kconfig
+++ b/drivers/usb/Kconfig
@@ -23,7 +23,8 @@ config USB_ARCH_HAS_OHCI
23 default y if ARCH_LH7A404 23 default y if ARCH_LH7A404
24 default y if ARCH_S3C2410 24 default y if ARCH_S3C2410
25 default y if PXA27x 25 default y if PXA27x
26 default y if ARCH_AT91RM9200 26 default y if ARCH_EP93XX
27 default y if (ARCH_AT91RM9200 || ARCH_AT91SAM9261)
27 # PPC: 28 # PPC:
28 default y if STB03xxx 29 default y if STB03xxx
29 default y if PPC_MPC52xx 30 default y if PPC_MPC52xx
diff --git a/drivers/usb/Makefile b/drivers/usb/Makefile
index c7123bf71c58..4710eb02ed64 100644
--- a/drivers/usb/Makefile
+++ b/drivers/usb/Makefile
@@ -48,7 +48,7 @@ obj-$(CONFIG_USB_MICROTEK) += image/
48obj-$(CONFIG_USB_SERIAL) += serial/ 48obj-$(CONFIG_USB_SERIAL) += serial/
49 49
50obj-$(CONFIG_USB_AUERSWALD) += misc/ 50obj-$(CONFIG_USB_AUERSWALD) += misc/
51obj-$(CONFIG_USB_CY7C63) += misc/ 51obj-$(CONFIG_USB_CYPRESS_CY7C63)+= misc/
52obj-$(CONFIG_USB_CYTHERM) += misc/ 52obj-$(CONFIG_USB_CYTHERM) += misc/
53obj-$(CONFIG_USB_EMI26) += misc/ 53obj-$(CONFIG_USB_EMI26) += misc/
54obj-$(CONFIG_USB_EMI62) += misc/ 54obj-$(CONFIG_USB_EMI62) += misc/
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 3670d77e912c..ca90326f2f5c 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -291,13 +291,13 @@ static void acm_read_bulk(struct urb *urb, struct pt_regs *regs)
291 struct acm_ru *rcv = urb->context; 291 struct acm_ru *rcv = urb->context;
292 struct acm *acm = rcv->instance; 292 struct acm *acm = rcv->instance;
293 int status = urb->status; 293 int status = urb->status;
294 dbg("Entering acm_read_bulk with status %d\n", urb->status); 294 dbg("Entering acm_read_bulk with status %d", urb->status);
295 295
296 if (!ACM_READY(acm)) 296 if (!ACM_READY(acm))
297 return; 297 return;
298 298
299 if (status) 299 if (status)
300 dev_dbg(&acm->data->dev, "bulk rx status %d\n", status); 300 dev_dbg(&acm->data->dev, "bulk rx status %d", status);
301 301
302 buf = rcv->buffer; 302 buf = rcv->buffer;
303 buf->size = urb->actual_length; 303 buf->size = urb->actual_length;
@@ -343,7 +343,7 @@ next_buffer:
343 list_del(&buf->list); 343 list_del(&buf->list);
344 spin_unlock(&acm->read_lock); 344 spin_unlock(&acm->read_lock);
345 345
346 dbg("acm_rx_tasklet: procesing buf 0x%p, size = %d\n", buf, buf->size); 346 dbg("acm_rx_tasklet: procesing buf 0x%p, size = %d", buf, buf->size);
347 347
348 tty_buffer_request_room(tty, buf->size); 348 tty_buffer_request_room(tty, buf->size);
349 if (!acm->throttle) 349 if (!acm->throttle)
@@ -394,7 +394,7 @@ urbs:
394 rcv->urb->transfer_dma = buf->dma; 394 rcv->urb->transfer_dma = buf->dma;
395 rcv->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; 395 rcv->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
396 396
397 dbg("acm_rx_tasklet: sending urb 0x%p, rcv 0x%p, buf 0x%p\n", rcv->urb, rcv, buf); 397 dbg("acm_rx_tasklet: sending urb 0x%p, rcv 0x%p, buf 0x%p", rcv->urb, rcv, buf);
398 398
399 /* This shouldn't kill the driver as unsuccessful URBs are returned to the 399 /* This shouldn't kill the driver as unsuccessful URBs are returned to the
400 free-urbs-pool and resubmited ASAP */ 400 free-urbs-pool and resubmited ASAP */
@@ -413,7 +413,7 @@ static void acm_write_bulk(struct urb *urb, struct pt_regs *regs)
413{ 413{
414 struct acm *acm = (struct acm *)urb->context; 414 struct acm *acm = (struct acm *)urb->context;
415 415
416 dbg("Entering acm_write_bulk with status %d\n", urb->status); 416 dbg("Entering acm_write_bulk with status %d", urb->status);
417 417
418 acm_write_done(acm); 418 acm_write_done(acm);
419 acm_write_start(acm); 419 acm_write_start(acm);
@@ -424,7 +424,7 @@ static void acm_write_bulk(struct urb *urb, struct pt_regs *regs)
424static void acm_softint(void *private) 424static void acm_softint(void *private)
425{ 425{
426 struct acm *acm = private; 426 struct acm *acm = private;
427 dbg("Entering acm_softint.\n"); 427 dbg("Entering acm_softint.");
428 428
429 if (!ACM_READY(acm)) 429 if (!ACM_READY(acm))
430 return; 430 return;
@@ -440,7 +440,7 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp)
440 struct acm *acm; 440 struct acm *acm;
441 int rv = -EINVAL; 441 int rv = -EINVAL;
442 int i; 442 int i;
443 dbg("Entering acm_tty_open.\n"); 443 dbg("Entering acm_tty_open.");
444 444
445 mutex_lock(&open_mutex); 445 mutex_lock(&open_mutex);
446 446
@@ -541,7 +541,7 @@ static int acm_tty_write(struct tty_struct *tty, const unsigned char *buf, int c
541 int wbn; 541 int wbn;
542 struct acm_wb *wb; 542 struct acm_wb *wb;
543 543
544 dbg("Entering acm_tty_write to write %d bytes,\n", count); 544 dbg("Entering acm_tty_write to write %d bytes,", count);
545 545
546 if (!ACM_READY(acm)) 546 if (!ACM_READY(acm))
547 return -EINVAL; 547 return -EINVAL;
@@ -793,7 +793,7 @@ static int acm_probe (struct usb_interface *intf,
793 793
794 if (!buflen) { 794 if (!buflen) {
795 if (intf->cur_altsetting->endpoint->extralen && intf->cur_altsetting->endpoint->extra) { 795 if (intf->cur_altsetting->endpoint->extralen && intf->cur_altsetting->endpoint->extra) {
796 dev_dbg(&intf->dev,"Seeking extra descriptors on endpoint\n"); 796 dev_dbg(&intf->dev,"Seeking extra descriptors on endpoint");
797 buflen = intf->cur_altsetting->endpoint->extralen; 797 buflen = intf->cur_altsetting->endpoint->extralen;
798 buffer = intf->cur_altsetting->endpoint->extra; 798 buffer = intf->cur_altsetting->endpoint->extra;
799 } else { 799 } else {
@@ -842,24 +842,24 @@ next_desc:
842 842
843 if (!union_header) { 843 if (!union_header) {
844 if (call_interface_num > 0) { 844 if (call_interface_num > 0) {
845 dev_dbg(&intf->dev,"No union descriptor, using call management descriptor\n"); 845 dev_dbg(&intf->dev,"No union descriptor, using call management descriptor");
846 data_interface = usb_ifnum_to_if(usb_dev, (data_interface_num = call_interface_num)); 846 data_interface = usb_ifnum_to_if(usb_dev, (data_interface_num = call_interface_num));
847 control_interface = intf; 847 control_interface = intf;
848 } else { 848 } else {
849 dev_dbg(&intf->dev,"No union descriptor, giving up\n"); 849 dev_dbg(&intf->dev,"No union descriptor, giving up");
850 return -ENODEV; 850 return -ENODEV;
851 } 851 }
852 } else { 852 } else {
853 control_interface = usb_ifnum_to_if(usb_dev, union_header->bMasterInterface0); 853 control_interface = usb_ifnum_to_if(usb_dev, union_header->bMasterInterface0);
854 data_interface = usb_ifnum_to_if(usb_dev, (data_interface_num = union_header->bSlaveInterface0)); 854 data_interface = usb_ifnum_to_if(usb_dev, (data_interface_num = union_header->bSlaveInterface0));
855 if (!control_interface || !data_interface) { 855 if (!control_interface || !data_interface) {
856 dev_dbg(&intf->dev,"no interfaces\n"); 856 dev_dbg(&intf->dev,"no interfaces");
857 return -ENODEV; 857 return -ENODEV;
858 } 858 }
859 } 859 }
860 860
861 if (data_interface_num != call_interface_num) 861 if (data_interface_num != call_interface_num)
862 dev_dbg(&intf->dev,"Seperate call control interface. That is not fully supported.\n"); 862 dev_dbg(&intf->dev,"Seperate call control interface. That is not fully supported.");
863 863
864skip_normal_probe: 864skip_normal_probe:
865 865
@@ -867,7 +867,7 @@ skip_normal_probe:
867 if (data_interface->cur_altsetting->desc.bInterfaceClass != CDC_DATA_INTERFACE_TYPE) { 867 if (data_interface->cur_altsetting->desc.bInterfaceClass != CDC_DATA_INTERFACE_TYPE) {
868 if (control_interface->cur_altsetting->desc.bInterfaceClass == CDC_DATA_INTERFACE_TYPE) { 868 if (control_interface->cur_altsetting->desc.bInterfaceClass == CDC_DATA_INTERFACE_TYPE) {
869 struct usb_interface *t; 869 struct usb_interface *t;
870 dev_dbg(&intf->dev,"Your device has switched interfaces.\n"); 870 dev_dbg(&intf->dev,"Your device has switched interfaces.");
871 871
872 t = control_interface; 872 t = control_interface;
873 control_interface = data_interface; 873 control_interface = data_interface;
@@ -878,7 +878,7 @@ skip_normal_probe:
878 } 878 }
879 879
880 if (usb_interface_claimed(data_interface)) { /* valid in this context */ 880 if (usb_interface_claimed(data_interface)) { /* valid in this context */
881 dev_dbg(&intf->dev,"The data interface isn't available\n"); 881 dev_dbg(&intf->dev,"The data interface isn't available");
882 return -EBUSY; 882 return -EBUSY;
883 } 883 }
884 884
@@ -895,7 +895,7 @@ skip_normal_probe:
895 if ((epread->bEndpointAddress & USB_DIR_IN) != USB_DIR_IN) { 895 if ((epread->bEndpointAddress & USB_DIR_IN) != USB_DIR_IN) {
896 /* descriptors are swapped */ 896 /* descriptors are swapped */
897 struct usb_endpoint_descriptor *t; 897 struct usb_endpoint_descriptor *t;
898 dev_dbg(&intf->dev,"The data interface has switched endpoints\n"); 898 dev_dbg(&intf->dev,"The data interface has switched endpoints");
899 899
900 t = epread; 900 t = epread;
901 epread = epwrite; 901 epread = epwrite;
@@ -910,7 +910,7 @@ skip_normal_probe:
910 } 910 }
911 911
912 if (!(acm = kzalloc(sizeof(struct acm), GFP_KERNEL))) { 912 if (!(acm = kzalloc(sizeof(struct acm), GFP_KERNEL))) {
913 dev_dbg(&intf->dev, "out of memory (acm kzalloc)\n"); 913 dev_dbg(&intf->dev, "out of memory (acm kzalloc)");
914 goto alloc_fail; 914 goto alloc_fail;
915 } 915 }
916 916
@@ -936,26 +936,26 @@ skip_normal_probe:
936 936
937 buf = usb_buffer_alloc(usb_dev, ctrlsize, GFP_KERNEL, &acm->ctrl_dma); 937 buf = usb_buffer_alloc(usb_dev, ctrlsize, GFP_KERNEL, &acm->ctrl_dma);
938 if (!buf) { 938 if (!buf) {
939 dev_dbg(&intf->dev, "out of memory (ctrl buffer alloc)\n"); 939 dev_dbg(&intf->dev, "out of memory (ctrl buffer alloc)");
940 goto alloc_fail2; 940 goto alloc_fail2;
941 } 941 }
942 acm->ctrl_buffer = buf; 942 acm->ctrl_buffer = buf;
943 943
944 if (acm_write_buffers_alloc(acm) < 0) { 944 if (acm_write_buffers_alloc(acm) < 0) {
945 dev_dbg(&intf->dev, "out of memory (write buffer alloc)\n"); 945 dev_dbg(&intf->dev, "out of memory (write buffer alloc)");
946 goto alloc_fail4; 946 goto alloc_fail4;
947 } 947 }
948 948
949 acm->ctrlurb = usb_alloc_urb(0, GFP_KERNEL); 949 acm->ctrlurb = usb_alloc_urb(0, GFP_KERNEL);
950 if (!acm->ctrlurb) { 950 if (!acm->ctrlurb) {
951 dev_dbg(&intf->dev, "out of memory (ctrlurb kmalloc)\n"); 951 dev_dbg(&intf->dev, "out of memory (ctrlurb kmalloc)");
952 goto alloc_fail5; 952 goto alloc_fail5;
953 } 953 }
954 for (i = 0; i < num_rx_buf; i++) { 954 for (i = 0; i < num_rx_buf; i++) {
955 struct acm_ru *rcv = &(acm->ru[i]); 955 struct acm_ru *rcv = &(acm->ru[i]);
956 956
957 if (!(rcv->urb = usb_alloc_urb(0, GFP_KERNEL))) { 957 if (!(rcv->urb = usb_alloc_urb(0, GFP_KERNEL))) {
958 dev_dbg(&intf->dev, "out of memory (read urbs usb_alloc_urb)\n"); 958 dev_dbg(&intf->dev, "out of memory (read urbs usb_alloc_urb)");
959 goto alloc_fail7; 959 goto alloc_fail7;
960 } 960 }
961 961
@@ -966,13 +966,13 @@ skip_normal_probe:
966 struct acm_rb *buf = &(acm->rb[i]); 966 struct acm_rb *buf = &(acm->rb[i]);
967 967
968 if (!(buf->base = usb_buffer_alloc(acm->dev, readsize, GFP_KERNEL, &buf->dma))) { 968 if (!(buf->base = usb_buffer_alloc(acm->dev, readsize, GFP_KERNEL, &buf->dma))) {
969 dev_dbg(&intf->dev, "out of memory (read bufs usb_buffer_alloc)\n"); 969 dev_dbg(&intf->dev, "out of memory (read bufs usb_buffer_alloc)");
970 goto alloc_fail7; 970 goto alloc_fail7;
971 } 971 }
972 } 972 }
973 acm->writeurb = usb_alloc_urb(0, GFP_KERNEL); 973 acm->writeurb = usb_alloc_urb(0, GFP_KERNEL);
974 if (!acm->writeurb) { 974 if (!acm->writeurb) {
975 dev_dbg(&intf->dev, "out of memory (writeurb kmalloc)\n"); 975 dev_dbg(&intf->dev, "out of memory (writeurb kmalloc)");
976 goto alloc_fail7; 976 goto alloc_fail7;
977 } 977 }
978 978
@@ -1086,6 +1086,9 @@ static struct usb_device_id acm_ids[] = {
1086 { USB_DEVICE(0x0ace, 0x1608), /* ZyDAS 56K USB MODEM */ 1086 { USB_DEVICE(0x0ace, 0x1608), /* ZyDAS 56K USB MODEM */
1087 .driver_info = SINGLE_RX_URB, /* firmware bug */ 1087 .driver_info = SINGLE_RX_URB, /* firmware bug */
1088 }, 1088 },
1089 { USB_DEVICE(0x0ace, 0x1611), /* ZyDAS 56K USB MODEM - new version */
1090 .driver_info = SINGLE_RX_URB, /* firmware bug */
1091 },
1089 /* control interfaces with various AT-command sets */ 1092 /* control interfaces with various AT-command sets */
1090 { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM, 1093 { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM,
1091 USB_CDC_ACM_PROTO_AT_V25TER) }, 1094 USB_CDC_ACM_PROTO_AT_V25TER) },
diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig
index a08787e253aa..6e3b5358a760 100644
--- a/drivers/usb/core/Kconfig
+++ b/drivers/usb/core/Kconfig
@@ -31,9 +31,6 @@ config USB_DEVICEFS
31 For the format of the various /proc/bus/usb/ files, please read 31 For the format of the various /proc/bus/usb/ files, please read
32 <file:Documentation/usb/proc_usb_info.txt>. 32 <file:Documentation/usb/proc_usb_info.txt>.
33 33
34 Please note that this code is completely unrelated to devfs, the
35 "/dev file system support".
36
37 Most users want to say Y here. 34 Most users want to say Y here.
38 35
39config USB_BANDWIDTH 36config USB_BANDWIDTH
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index f7bdd94b3aa8..218621b9958e 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -517,19 +517,19 @@ static int check_ctrlrecip(struct dev_state *ps, unsigned int requesttype, unsig
517 517
518static struct usb_device *usbdev_lookup_minor(int minor) 518static struct usb_device *usbdev_lookup_minor(int minor)
519{ 519{
520 struct device *device; 520 struct class_device *class_dev;
521 struct usb_device *udev = NULL; 521 struct usb_device *dev = NULL;
522 522
523 down(&usb_device_class->sem); 523 down(&usb_device_class->sem);
524 list_for_each_entry(device, &usb_device_class->devices, node) { 524 list_for_each_entry(class_dev, &usb_device_class->children, node) {
525 if (device->devt == MKDEV(USB_DEVICE_MAJOR, minor)) { 525 if (class_dev->devt == MKDEV(USB_DEVICE_MAJOR, minor)) {
526 udev = device->platform_data; 526 dev = class_dev->class_data;
527 break; 527 break;
528 } 528 }
529 } 529 }
530 up(&usb_device_class->sem); 530 up(&usb_device_class->sem);
531 531
532 return udev; 532 return dev;
533}; 533};
534 534
535/* 535/*
@@ -1580,16 +1580,16 @@ static void usbdev_add(struct usb_device *dev)
1580{ 1580{
1581 int minor = ((dev->bus->busnum-1) * 128) + (dev->devnum-1); 1581 int minor = ((dev->bus->busnum-1) * 128) + (dev->devnum-1);
1582 1582
1583 dev->usbfs_dev = device_create(usb_device_class, &dev->dev, 1583 dev->class_dev = class_device_create(usb_device_class, NULL,
1584 MKDEV(USB_DEVICE_MAJOR, minor), 1584 MKDEV(USB_DEVICE_MAJOR, minor), &dev->dev,
1585 "usbdev%d.%d", dev->bus->busnum, dev->devnum); 1585 "usbdev%d.%d", dev->bus->busnum, dev->devnum);
1586 1586
1587 dev->usbfs_dev->platform_data = dev; 1587 dev->class_dev->class_data = dev;
1588} 1588}
1589 1589
1590static void usbdev_remove(struct usb_device *dev) 1590static void usbdev_remove(struct usb_device *dev)
1591{ 1591{
1592 device_unregister(dev->usbfs_dev); 1592 class_device_unregister(dev->class_dev);
1593} 1593}
1594 1594
1595static int usbdev_notify(struct notifier_block *self, unsigned long action, 1595static int usbdev_notify(struct notifier_block *self, unsigned long action,
diff --git a/drivers/usb/core/file.c b/drivers/usb/core/file.c
index abee0f5b6a66..8de4f8c99d61 100644
--- a/drivers/usb/core/file.c
+++ b/drivers/usb/core/file.c
@@ -194,13 +194,14 @@ int usb_register_dev(struct usb_interface *intf,
194 ++temp; 194 ++temp;
195 else 195 else
196 temp = name; 196 temp = name;
197 intf->usb_dev = device_create(usb_class->class, &intf->dev, 197 intf->class_dev = class_device_create(usb_class->class, NULL,
198 MKDEV(USB_MAJOR, minor), "%s", temp); 198 MKDEV(USB_MAJOR, minor),
199 if (IS_ERR(intf->usb_dev)) { 199 &intf->dev, "%s", temp);
200 if (IS_ERR(intf->class_dev)) {
200 spin_lock (&minor_lock); 201 spin_lock (&minor_lock);
201 usb_minors[intf->minor] = NULL; 202 usb_minors[intf->minor] = NULL;
202 spin_unlock (&minor_lock); 203 spin_unlock (&minor_lock);
203 retval = PTR_ERR(intf->usb_dev); 204 retval = PTR_ERR(intf->class_dev);
204 } 205 }
205exit: 206exit:
206 return retval; 207 return retval;
@@ -241,8 +242,8 @@ void usb_deregister_dev(struct usb_interface *intf,
241 spin_unlock (&minor_lock); 242 spin_unlock (&minor_lock);
242 243
243 snprintf(name, BUS_ID_SIZE, class_driver->name, intf->minor - minor_base); 244 snprintf(name, BUS_ID_SIZE, class_driver->name, intf->minor - minor_base);
244 device_destroy(usb_class->class, MKDEV(USB_MAJOR, intf->minor)); 245 class_device_destroy(usb_class->class, MKDEV(USB_MAJOR, intf->minor));
245 intf->usb_dev = NULL; 246 intf->class_dev = NULL;
246 intf->minor = -1; 247 intf->minor = -1;
247 destroy_usb_class(); 248 destroy_usb_class();
248} 249}
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 875596e98e42..26c8cb5f3e67 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -1790,7 +1790,10 @@ static int finish_device_resume(struct usb_device *udev)
1790 * and device drivers will know about any resume quirks. 1790 * and device drivers will know about any resume quirks.
1791 */ 1791 */
1792 status = usb_get_status(udev, USB_RECIP_DEVICE, 0, &devstatus); 1792 status = usb_get_status(udev, USB_RECIP_DEVICE, 0, &devstatus);
1793 if (status < 2) 1793 if (status >= 0)
1794 status = (status == 2 ? 0 : -ENODEV);
1795
1796 if (status)
1794 dev_dbg(&udev->dev, 1797 dev_dbg(&udev->dev,
1795 "gone after usb resume? status %d\n", 1798 "gone after usb resume? status %d\n",
1796 status); 1799 status);
@@ -1879,7 +1882,12 @@ hub_port_resume(struct usb_hub *hub, int port1, struct usb_device *udev)
1879 dev_dbg(hub->intfdev, 1882 dev_dbg(hub->intfdev,
1880 "port %d status %04x.%04x after resume, %d\n", 1883 "port %d status %04x.%04x after resume, %d\n",
1881 port1, portchange, devstatus, status); 1884 port1, portchange, devstatus, status);
1885 if (status >= 0)
1886 status = -ENODEV;
1882 } else { 1887 } else {
1888 if (portchange & USB_PORT_STAT_C_SUSPEND)
1889 clear_port_feature(hub->hdev, port1,
1890 USB_PORT_FEAT_C_SUSPEND);
1883 /* TRSMRCY = 10 msec */ 1891 /* TRSMRCY = 10 msec */
1884 msleep(10); 1892 msleep(10);
1885 if (udev) 1893 if (udev)
diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c
index f48c3dbc367a..3182c2224ba2 100644
--- a/drivers/usb/core/inode.c
+++ b/drivers/usb/core/inode.c
@@ -695,7 +695,7 @@ static void usbfs_remove_device(struct usb_device *dev)
695 wake_up_all(&ds->wait); 695 wake_up_all(&ds->wait);
696 list_del_init(&ds->list); 696 list_del_init(&ds->list);
697 if (ds->discsignr) { 697 if (ds->discsignr) {
698 sinfo.si_signo = SIGPIPE; 698 sinfo.si_signo = ds->discsignr;
699 sinfo.si_errno = EPIPE; 699 sinfo.si_errno = EPIPE;
700 sinfo.si_code = SI_ASYNCIO; 700 sinfo.si_code = SI_ASYNCIO;
701 sinfo.si_addr = ds->disccontext; 701 sinfo.si_addr = ds->disccontext;
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index 363b2ad74ae6..1a32d96774b4 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -207,7 +207,7 @@ config USB_AT91
207 207
208config USB_GADGET_DUMMY_HCD 208config USB_GADGET_DUMMY_HCD
209 boolean "Dummy HCD (DEVELOPMENT)" 209 boolean "Dummy HCD (DEVELOPMENT)"
210 depends on USB && EXPERIMENTAL 210 depends on (USB=y || (USB=m && USB_GADGET=m)) && EXPERIMENTAL
211 select USB_GADGET_DUALSPEED 211 select USB_GADGET_DUALSPEED
212 help 212 help
213 This host controller driver emulates USB, looping all data transfer 213 This host controller driver emulates USB, looping all data transfer
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index 1c459ff037ce..cfebca05ead5 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -57,19 +57,23 @@
57 57
58/* 58/*
59 * This controller is simple and PIO-only. It's used in many AT91-series 59 * This controller is simple and PIO-only. It's used in many AT91-series
60 * ARMv4T controllers, including the at91rm9200 (arm920T, with MMU), 60 * full speed USB controllers, including the at91rm9200 (arm920T, with MMU),
61 * at91sam9261 (arm926ejs, with MMU), and several no-mmu versions. 61 * at91sam926x (arm926ejs, with MMU), and several no-mmu versions.
62 * 62 *
63 * This driver expects the board has been wired with two GPIOs suppporting 63 * This driver expects the board has been wired with two GPIOs suppporting
64 * a VBUS sensing IRQ, and a D+ pullup. (They may be omitted, but the 64 * a VBUS sensing IRQ, and a D+ pullup. (They may be omitted, but the
65 * testing hasn't covered such cases.) The pullup is most important; it 65 * testing hasn't covered such cases.)
66 *
67 * The pullup is most important (so it's integrated on sam926x parts). It
66 * provides software control over whether the host enumerates the device. 68 * provides software control over whether the host enumerates the device.
69 *
67 * The VBUS sensing helps during enumeration, and allows both USB clocks 70 * The VBUS sensing helps during enumeration, and allows both USB clocks
68 * (and the transceiver) to stay gated off until they're necessary, saving 71 * (and the transceiver) to stay gated off until they're necessary, saving
69 * power. During USB suspend, the 48 MHz clock is gated off. 72 * power. During USB suspend, the 48 MHz clock is gated off in hardware;
73 * it may also be gated off by software during some Linux sleep states.
70 */ 74 */
71 75
72#define DRIVER_VERSION "8 March 2005" 76#define DRIVER_VERSION "3 May 2006"
73 77
74static const char driver_name [] = "at91_udc"; 78static const char driver_name [] = "at91_udc";
75static const char ep0name[] = "ep0"; 79static const char ep0name[] = "ep0";
@@ -316,9 +320,15 @@ static void done(struct at91_ep *ep, struct at91_request *req, int status)
316 * 320 *
317 * There are also state bits like FORCESTALL, EPEDS, DIR, and EPTYPE 321 * There are also state bits like FORCESTALL, EPEDS, DIR, and EPTYPE
318 * that shouldn't normally be changed. 322 * that shouldn't normally be changed.
323 *
324 * NOTE at91sam9260 docs mention synch between UDPCK and MCK clock domains,
325 * implying a need to wait for one write to complete (test relevant bits)
326 * before starting the next write. This shouldn't be an issue given how
327 * infrequently we write, except maybe for write-then-read idioms.
319 */ 328 */
320#define SET_FX (AT91_UDP_TXPKTRDY) 329#define SET_FX (AT91_UDP_TXPKTRDY)
321#define CLR_FX (RX_DATA_READY | AT91_UDP_RXSETUP | AT91_UDP_STALLSENT | AT91_UDP_TXCOMP) 330#define CLR_FX (RX_DATA_READY | AT91_UDP_RXSETUP \
331 | AT91_UDP_STALLSENT | AT91_UDP_TXCOMP)
322 332
323/* pull OUT packet data from the endpoint's fifo */ 333/* pull OUT packet data from the endpoint's fifo */
324static int read_fifo (struct at91_ep *ep, struct at91_request *req) 334static int read_fifo (struct at91_ep *ep, struct at91_request *req)
@@ -472,7 +482,8 @@ static void nuke(struct at91_ep *ep, int status)
472 482
473/*-------------------------------------------------------------------------*/ 483/*-------------------------------------------------------------------------*/
474 484
475static int at91_ep_enable(struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc) 485static int at91_ep_enable(struct usb_ep *_ep,
486 const struct usb_endpoint_descriptor *desc)
476{ 487{
477 struct at91_ep *ep = container_of(_ep, struct at91_ep, ep); 488 struct at91_ep *ep = container_of(_ep, struct at91_ep, ep);
478 struct at91_udc *dev = ep->udc; 489 struct at91_udc *dev = ep->udc;
@@ -582,11 +593,12 @@ static int at91_ep_disable (struct usb_ep * _ep)
582 * interesting for request or buffer allocation. 593 * interesting for request or buffer allocation.
583 */ 594 */
584 595
585static struct usb_request *at91_ep_alloc_request (struct usb_ep *_ep, unsigned int gfp_flags) 596static struct usb_request *
597at91_ep_alloc_request(struct usb_ep *_ep, unsigned int gfp_flags)
586{ 598{
587 struct at91_request *req; 599 struct at91_request *req;
588 600
589 req = kcalloc(1, sizeof (struct at91_request), SLAB_KERNEL); 601 req = kcalloc(1, sizeof (struct at91_request), gfp_flags);
590 if (!req) 602 if (!req)
591 return NULL; 603 return NULL;
592 604
@@ -862,6 +874,7 @@ static void stop_activity(struct at91_udc *udc)
862 if (udc->gadget.speed == USB_SPEED_UNKNOWN) 874 if (udc->gadget.speed == USB_SPEED_UNKNOWN)
863 driver = NULL; 875 driver = NULL;
864 udc->gadget.speed = USB_SPEED_UNKNOWN; 876 udc->gadget.speed = USB_SPEED_UNKNOWN;
877 udc->suspended = 0;
865 878
866 for (i = 0; i < NUM_ENDPOINTS; i++) { 879 for (i = 0; i < NUM_ENDPOINTS; i++) {
867 struct at91_ep *ep = &udc->ep[i]; 880 struct at91_ep *ep = &udc->ep[i];
@@ -889,8 +902,8 @@ static void clk_off(struct at91_udc *udc)
889 return; 902 return;
890 udc->clocked = 0; 903 udc->clocked = 0;
891 udc->gadget.speed = USB_SPEED_UNKNOWN; 904 udc->gadget.speed = USB_SPEED_UNKNOWN;
892 clk_disable(udc->iclk);
893 clk_disable(udc->fclk); 905 clk_disable(udc->fclk);
906 clk_disable(udc->iclk);
894} 907}
895 908
896/* 909/*
@@ -911,9 +924,6 @@ static void pullup(struct at91_udc *udc, int is_on)
911 at91_udp_write(AT91_UDP_TXVC, AT91_UDP_TXVC_TXVDIS); 924 at91_udp_write(AT91_UDP_TXVC, AT91_UDP_TXVC_TXVDIS);
912 at91_set_gpio_value(udc->board.pullup_pin, 0); 925 at91_set_gpio_value(udc->board.pullup_pin, 0);
913 clk_off(udc); 926 clk_off(udc);
914
915 // REVISIT: with transceiver disabled, will D- float
916 // so that a host would falsely detect a device?
917 } 927 }
918} 928}
919 929
@@ -1290,7 +1300,8 @@ static void handle_ep0(struct at91_udc *udc)
1290 if (udc->wait_for_addr_ack) { 1300 if (udc->wait_for_addr_ack) {
1291 u32 tmp; 1301 u32 tmp;
1292 1302
1293 at91_udp_write(AT91_UDP_FADDR, AT91_UDP_FEN | udc->addr); 1303 at91_udp_write(AT91_UDP_FADDR,
1304 AT91_UDP_FEN | udc->addr);
1294 tmp = at91_udp_read(AT91_UDP_GLB_STAT); 1305 tmp = at91_udp_read(AT91_UDP_GLB_STAT);
1295 tmp &= ~AT91_UDP_FADDEN; 1306 tmp &= ~AT91_UDP_FADDEN;
1296 if (udc->addr) 1307 if (udc->addr)
@@ -1361,9 +1372,10 @@ static irqreturn_t at91_udc_irq (int irq, void *_udc, struct pt_regs *r)
1361 u32 rescans = 5; 1372 u32 rescans = 5;
1362 1373
1363 while (rescans--) { 1374 while (rescans--) {
1364 u32 status = at91_udp_read(AT91_UDP_ISR); 1375 u32 status;
1365 1376
1366 status &= at91_udp_read(AT91_UDP_IMR); 1377 status = at91_udp_read(AT91_UDP_ISR)
1378 & at91_udp_read(AT91_UDP_IMR);
1367 if (!status) 1379 if (!status)
1368 break; 1380 break;
1369 1381
@@ -1379,18 +1391,17 @@ static irqreturn_t at91_udc_irq (int irq, void *_udc, struct pt_regs *r)
1379 stop_activity(udc); 1391 stop_activity(udc);
1380 1392
1381 /* enable ep0 */ 1393 /* enable ep0 */
1382 at91_udp_write(AT91_UDP_CSR(0), AT91_UDP_EPEDS | AT91_UDP_EPTYPE_CTRL); 1394 at91_udp_write(AT91_UDP_CSR(0),
1395 AT91_UDP_EPEDS | AT91_UDP_EPTYPE_CTRL);
1383 udc->gadget.speed = USB_SPEED_FULL; 1396 udc->gadget.speed = USB_SPEED_FULL;
1384 udc->suspended = 0; 1397 udc->suspended = 0;
1385 at91_udp_write(AT91_UDP_IER, AT91_UDP_EP(0)); 1398 at91_udp_write(AT91_UDP_IER, AT91_UDP_EP(0));
1386 1399
1387 /* 1400 /*
1388 * NOTE: this driver keeps clocks off unless the 1401 * NOTE: this driver keeps clocks off unless the
1389 * USB host is present. That saves power, and also 1402 * USB host is present. That saves power, but for
1390 * eliminates IRQs (reset, resume, suspend) that can 1403 * boards that don't support VBUS detection, both
1391 * otherwise flood from the controller. If your 1404 * clocks need to be active most of the time.
1392 * board doesn't support VBUS detection, suspend and
1393 * resume irq logic may need more attention...
1394 */ 1405 */
1395 1406
1396 /* host initiated suspend (3+ms bus idle) */ 1407 /* host initiated suspend (3+ms bus idle) */
@@ -1452,13 +1463,19 @@ static irqreturn_t at91_udc_irq (int irq, void *_udc, struct pt_regs *r)
1452 1463
1453/*-------------------------------------------------------------------------*/ 1464/*-------------------------------------------------------------------------*/
1454 1465
1466static void nop_release(struct device *dev)
1467{
1468 /* nothing to free */
1469}
1470
1455static struct at91_udc controller = { 1471static struct at91_udc controller = {
1456 .gadget = { 1472 .gadget = {
1457 .ops = &at91_udc_ops, 1473 .ops = &at91_udc_ops,
1458 .ep0 = &controller.ep[0].ep, 1474 .ep0 = &controller.ep[0].ep,
1459 .name = driver_name, 1475 .name = driver_name,
1460 .dev = { 1476 .dev = {
1461 .bus_id = "gadget" 1477 .bus_id = "gadget",
1478 .release = nop_release,
1462 } 1479 }
1463 }, 1480 },
1464 .ep[0] = { 1481 .ep[0] = {
@@ -1468,7 +1485,8 @@ static struct at91_udc controller = {
1468 }, 1485 },
1469 .udc = &controller, 1486 .udc = &controller,
1470 .maxpacket = 8, 1487 .maxpacket = 8,
1471 .creg = (void __iomem *)(AT91_VA_BASE_UDP + AT91_UDP_CSR(0)), 1488 .creg = (void __iomem *)(AT91_VA_BASE_UDP
1489 + AT91_UDP_CSR(0)),
1472 .int_mask = 1 << 0, 1490 .int_mask = 1 << 0,
1473 }, 1491 },
1474 .ep[1] = { 1492 .ep[1] = {
@@ -1479,7 +1497,8 @@ static struct at91_udc controller = {
1479 .udc = &controller, 1497 .udc = &controller,
1480 .is_pingpong = 1, 1498 .is_pingpong = 1,
1481 .maxpacket = 64, 1499 .maxpacket = 64,
1482 .creg = (void __iomem *)(AT91_VA_BASE_UDP + AT91_UDP_CSR(1)), 1500 .creg = (void __iomem *)(AT91_VA_BASE_UDP
1501 + AT91_UDP_CSR(1)),
1483 .int_mask = 1 << 1, 1502 .int_mask = 1 << 1,
1484 }, 1503 },
1485 .ep[2] = { 1504 .ep[2] = {
@@ -1490,7 +1509,8 @@ static struct at91_udc controller = {
1490 .udc = &controller, 1509 .udc = &controller,
1491 .is_pingpong = 1, 1510 .is_pingpong = 1,
1492 .maxpacket = 64, 1511 .maxpacket = 64,
1493 .creg = (void __iomem *)(AT91_VA_BASE_UDP + AT91_UDP_CSR(2)), 1512 .creg = (void __iomem *)(AT91_VA_BASE_UDP
1513 + AT91_UDP_CSR(2)),
1494 .int_mask = 1 << 2, 1514 .int_mask = 1 << 2,
1495 }, 1515 },
1496 .ep[3] = { 1516 .ep[3] = {
@@ -1501,7 +1521,8 @@ static struct at91_udc controller = {
1501 }, 1521 },
1502 .udc = &controller, 1522 .udc = &controller,
1503 .maxpacket = 8, 1523 .maxpacket = 8,
1504 .creg = (void __iomem *)(AT91_VA_BASE_UDP + AT91_UDP_CSR(3)), 1524 .creg = (void __iomem *)(AT91_VA_BASE_UDP
1525 + AT91_UDP_CSR(3)),
1505 .int_mask = 1 << 3, 1526 .int_mask = 1 << 3,
1506 }, 1527 },
1507 .ep[4] = { 1528 .ep[4] = {
@@ -1512,7 +1533,8 @@ static struct at91_udc controller = {
1512 .udc = &controller, 1533 .udc = &controller,
1513 .is_pingpong = 1, 1534 .is_pingpong = 1,
1514 .maxpacket = 256, 1535 .maxpacket = 256,
1515 .creg = (void __iomem *)(AT91_VA_BASE_UDP + AT91_UDP_CSR(4)), 1536 .creg = (void __iomem *)(AT91_VA_BASE_UDP
1537 + AT91_UDP_CSR(4)),
1516 .int_mask = 1 << 4, 1538 .int_mask = 1 << 4,
1517 }, 1539 },
1518 .ep[5] = { 1540 .ep[5] = {
@@ -1523,10 +1545,11 @@ static struct at91_udc controller = {
1523 .udc = &controller, 1545 .udc = &controller,
1524 .is_pingpong = 1, 1546 .is_pingpong = 1,
1525 .maxpacket = 256, 1547 .maxpacket = 256,
1526 .creg = (void __iomem *)(AT91_VA_BASE_UDP + AT91_UDP_CSR(5)), 1548 .creg = (void __iomem *)(AT91_VA_BASE_UDP
1549 + AT91_UDP_CSR(5)),
1527 .int_mask = 1 << 5, 1550 .int_mask = 1 << 5,
1528 }, 1551 },
1529 /* ep6 and ep7 are also reserved */ 1552 /* ep6 and ep7 are also reserved (custom silicon might use them) */
1530}; 1553};
1531 1554
1532static irqreturn_t at91_vbus_irq(int irq, void *_udc, struct pt_regs *r) 1555static irqreturn_t at91_vbus_irq(int irq, void *_udc, struct pt_regs *r)
@@ -1593,6 +1616,7 @@ int usb_gadget_unregister_driver (struct usb_gadget_driver *driver)
1593 1616
1594 local_irq_disable(); 1617 local_irq_disable();
1595 udc->enabled = 0; 1618 udc->enabled = 0;
1619 at91_udp_write(AT91_UDP_IDR, ~0);
1596 pullup(udc, 0); 1620 pullup(udc, 0);
1597 local_irq_enable(); 1621 local_irq_enable();
1598 1622
@@ -1624,6 +1648,16 @@ static int __devinit at91udc_probe(struct platform_device *pdev)
1624 return -ENODEV; 1648 return -ENODEV;
1625 } 1649 }
1626 1650
1651 if (pdev->num_resources != 2) {
1652 DBG("invalid num_resources");
1653 return -ENODEV;
1654 }
1655 if ((pdev->resource[0].flags != IORESOURCE_MEM)
1656 || (pdev->resource[1].flags != IORESOURCE_IRQ)) {
1657 DBG("invalid resource type");
1658 return -ENODEV;
1659 }
1660
1627 if (!request_mem_region(AT91_BASE_UDP, SZ_16K, driver_name)) { 1661 if (!request_mem_region(AT91_BASE_UDP, SZ_16K, driver_name)) {
1628 DBG("someone's using UDC memory\n"); 1662 DBG("someone's using UDC memory\n");
1629 return -EBUSY; 1663 return -EBUSY;
@@ -1649,19 +1683,26 @@ static int __devinit at91udc_probe(struct platform_device *pdev)
1649 if (retval < 0) 1683 if (retval < 0)
1650 goto fail0; 1684 goto fail0;
1651 1685
1652 /* disable everything until there's a gadget driver and vbus */ 1686 /* don't do anything until we have both gadget driver and VBUS */
1653 pullup(udc, 0); 1687 clk_enable(udc->iclk);
1688 at91_udp_write(AT91_UDP_TXVC, AT91_UDP_TXVC_TXVDIS);
1689 at91_udp_write(AT91_UDP_IDR, 0xffffffff);
1690 clk_disable(udc->iclk);
1654 1691
1655 /* request UDC and maybe VBUS irqs */ 1692 /* request UDC and maybe VBUS irqs */
1656 if (request_irq(AT91_ID_UDP, at91_udc_irq, IRQF_DISABLED, driver_name, udc)) { 1693 udc->udp_irq = platform_get_irq(pdev, 0);
1657 DBG("request irq %d failed\n", AT91_ID_UDP); 1694 if (request_irq(udc->udp_irq, at91_udc_irq,
1695 IRQF_DISABLED, driver_name, udc)) {
1696 DBG("request irq %d failed\n", udc->udp_irq);
1658 retval = -EBUSY; 1697 retval = -EBUSY;
1659 goto fail1; 1698 goto fail1;
1660 } 1699 }
1661 if (udc->board.vbus_pin > 0) { 1700 if (udc->board.vbus_pin > 0) {
1662 if (request_irq(udc->board.vbus_pin, at91_vbus_irq, IRQF_DISABLED, driver_name, udc)) { 1701 if (request_irq(udc->board.vbus_pin, at91_vbus_irq,
1663 DBG("request vbus irq %d failed\n", udc->board.vbus_pin); 1702 IRQF_DISABLED, driver_name, udc)) {
1664 free_irq(AT91_ID_UDP, udc); 1703 DBG("request vbus irq %d failed\n",
1704 udc->board.vbus_pin);
1705 free_irq(udc->udp_irq, udc);
1665 retval = -EBUSY; 1706 retval = -EBUSY;
1666 goto fail1; 1707 goto fail1;
1667 } 1708 }
@@ -1670,6 +1711,7 @@ static int __devinit at91udc_probe(struct platform_device *pdev)
1670 udc->vbus = 1; 1711 udc->vbus = 1;
1671 } 1712 }
1672 dev_set_drvdata(dev, udc); 1713 dev_set_drvdata(dev, udc);
1714 device_init_wakeup(dev, 1);
1673 create_debug_file(udc); 1715 create_debug_file(udc);
1674 1716
1675 INFO("%s version %s\n", driver_name, DRIVER_VERSION); 1717 INFO("%s version %s\n", driver_name, DRIVER_VERSION);
@@ -1678,14 +1720,14 @@ static int __devinit at91udc_probe(struct platform_device *pdev)
1678fail1: 1720fail1:
1679 device_unregister(&udc->gadget.dev); 1721 device_unregister(&udc->gadget.dev);
1680fail0: 1722fail0:
1681 release_mem_region(AT91_VA_BASE_UDP, SZ_16K); 1723 release_mem_region(AT91_BASE_UDP, SZ_16K);
1682 DBG("%s probe failed, %d\n", driver_name, retval); 1724 DBG("%s probe failed, %d\n", driver_name, retval);
1683 return retval; 1725 return retval;
1684} 1726}
1685 1727
1686static int __devexit at91udc_remove(struct platform_device *dev) 1728static int __devexit at91udc_remove(struct platform_device *pdev)
1687{ 1729{
1688 struct at91_udc *udc = platform_get_drvdata(dev); 1730 struct at91_udc *udc = platform_get_drvdata(pdev);
1689 1731
1690 DBG("remove\n"); 1732 DBG("remove\n");
1691 1733
@@ -1694,10 +1736,11 @@ static int __devexit at91udc_remove(struct platform_device *dev)
1694 if (udc->driver != 0) 1736 if (udc->driver != 0)
1695 usb_gadget_unregister_driver(udc->driver); 1737 usb_gadget_unregister_driver(udc->driver);
1696 1738
1739 device_init_wakeup(&pdev->dev, 0);
1697 remove_debug_file(udc); 1740 remove_debug_file(udc);
1698 if (udc->board.vbus_pin > 0) 1741 if (udc->board.vbus_pin > 0)
1699 free_irq(udc->board.vbus_pin, udc); 1742 free_irq(udc->board.vbus_pin, udc);
1700 free_irq(AT91_ID_UDP, udc); 1743 free_irq(udc->udp_irq, udc);
1701 device_unregister(&udc->gadget.dev); 1744 device_unregister(&udc->gadget.dev);
1702 release_mem_region(AT91_BASE_UDP, SZ_16K); 1745 release_mem_region(AT91_BASE_UDP, SZ_16K);
1703 1746
@@ -1708,31 +1751,36 @@ static int __devexit at91udc_remove(struct platform_device *dev)
1708} 1751}
1709 1752
1710#ifdef CONFIG_PM 1753#ifdef CONFIG_PM
1711static int at91udc_suspend(struct platform_device *dev, pm_message_t mesg) 1754static int at91udc_suspend(struct platform_device *pdev, pm_message_t mesg)
1712{ 1755{
1713 struct at91_udc *udc = platform_get_drvdata(dev); 1756 struct at91_udc *udc = platform_get_drvdata(pdev);
1757 int wake = udc->driver && device_may_wakeup(&pdev->dev);
1714 1758
1715 /* 1759 /* Unless we can act normally to the host (letting it wake us up
1716 * The "safe" suspend transitions are opportunistic ... e.g. when 1760 * whenever it has work for us) force disconnect. Wakeup requires
1717 * the USB link is suspended (48MHz clock autogated off), or when 1761 * PLLB for USB events (signaling for reset, wakeup, or incoming
1718 * it's disconnected (programmatically gated off, elsewhere). 1762 * tokens) and VBUS irqs (on systems which support them).
1719 * Then we can suspend, and the chip can enter slow clock mode.
1720 *
1721 * The problem case is some component (user mode?) suspending this
1722 * device while it's active, with the 48 MHz clock in use. There
1723 * are two basic approaches: (a) veto suspend levels involving slow
1724 * clock mode, (b) disconnect, so 48 MHz will no longer be in use
1725 * and we can enter slow clock mode. This uses (b) for now, since
1726 * it's simplest until AT91 PM exists and supports the other option.
1727 */ 1763 */
1728 if (udc->vbus && !udc->suspended) 1764 if ((!udc->suspended && udc->addr)
1765 || !wake
1766 || at91_suspend_entering_slow_clock()) {
1729 pullup(udc, 0); 1767 pullup(udc, 0);
1768 disable_irq_wake(udc->udp_irq);
1769 } else
1770 enable_irq_wake(udc->udp_irq);
1771
1772 if (udc->board.vbus_pin > 0) {
1773 if (wake)
1774 enable_irq_wake(udc->board.vbus_pin);
1775 else
1776 disable_irq_wake(udc->board.vbus_pin);
1777 }
1730 return 0; 1778 return 0;
1731} 1779}
1732 1780
1733static int at91udc_resume(struct platform_device *dev) 1781static int at91udc_resume(struct platform_device *pdev)
1734{ 1782{
1735 struct at91_udc *udc = platform_get_drvdata(dev); 1783 struct at91_udc *udc = platform_get_drvdata(pdev);
1736 1784
1737 /* maybe reconnect to host; if so, clocks on */ 1785 /* maybe reconnect to host; if so, clocks on */
1738 pullup(udc, 1); 1786 pullup(udc, 1);
@@ -1748,7 +1796,7 @@ static struct platform_driver at91_udc = {
1748 .remove = __devexit_p(at91udc_remove), 1796 .remove = __devexit_p(at91udc_remove),
1749 .shutdown = at91udc_shutdown, 1797 .shutdown = at91udc_shutdown,
1750 .suspend = at91udc_suspend, 1798 .suspend = at91udc_suspend,
1751 .resume = at91udc_resume, 1799 .resume = at91udc_resume,
1752 .driver = { 1800 .driver = {
1753 .name = (char *) driver_name, 1801 .name = (char *) driver_name,
1754 .owner = THIS_MODULE, 1802 .owner = THIS_MODULE,
@@ -1767,6 +1815,6 @@ static void __devexit udc_exit_module(void)
1767} 1815}
1768module_exit(udc_exit_module); 1816module_exit(udc_exit_module);
1769 1817
1770MODULE_DESCRIPTION("AT91RM9200 udc driver"); 1818MODULE_DESCRIPTION("AT91 udc driver");
1771MODULE_AUTHOR("Thomas Rathbone, David Brownell"); 1819MODULE_AUTHOR("Thomas Rathbone, David Brownell");
1772MODULE_LICENSE("GPL"); 1820MODULE_LICENSE("GPL");
diff --git a/drivers/usb/gadget/at91_udc.h b/drivers/usb/gadget/at91_udc.h
index 5a4799cedd19..882af42e86cc 100644
--- a/drivers/usb/gadget/at91_udc.h
+++ b/drivers/usb/gadget/at91_udc.h
@@ -141,6 +141,7 @@ struct at91_udc {
141 struct clk *iclk, *fclk; 141 struct clk *iclk, *fclk;
142 struct platform_device *pdev; 142 struct platform_device *pdev;
143 struct proc_dir_entry *pde; 143 struct proc_dir_entry *pde;
144 int udp_irq;
144}; 145};
145 146
146static inline struct at91_udc *to_udc(struct usb_gadget *g) 147static inline struct at91_udc *to_udc(struct usb_gadget *g)
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
index 4be47195bd38..7d1c22c34957 100644
--- a/drivers/usb/gadget/dummy_hcd.c
+++ b/drivers/usb/gadget/dummy_hcd.c
@@ -609,7 +609,8 @@ static int dummy_dequeue (struct usb_ep *_ep, struct usb_request *_req)
609 if (!dum->driver) 609 if (!dum->driver)
610 return -ESHUTDOWN; 610 return -ESHUTDOWN;
611 611
612 spin_lock_irqsave (&dum->lock, flags); 612 local_irq_save (flags);
613 spin_lock (&dum->lock);
613 list_for_each_entry (req, &ep->queue, queue) { 614 list_for_each_entry (req, &ep->queue, queue) {
614 if (&req->req == _req) { 615 if (&req->req == _req) {
615 list_del_init (&req->queue); 616 list_del_init (&req->queue);
@@ -618,7 +619,7 @@ static int dummy_dequeue (struct usb_ep *_ep, struct usb_request *_req)
618 break; 619 break;
619 } 620 }
620 } 621 }
621 spin_unlock_irqrestore (&dum->lock, flags); 622 spin_unlock (&dum->lock);
622 623
623 if (retval == 0) { 624 if (retval == 0) {
624 dev_dbg (udc_dev(dum), 625 dev_dbg (udc_dev(dum),
@@ -626,6 +627,7 @@ static int dummy_dequeue (struct usb_ep *_ep, struct usb_request *_req)
626 req, _ep->name, _req->length, _req->buf); 627 req, _ep->name, _req->length, _req->buf);
627 _req->complete (_ep, _req); 628 _req->complete (_ep, _req);
628 } 629 }
630 local_irq_restore (flags);
629 return retval; 631 return retval;
630} 632}
631 633
diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c
index f7c6d758e1b0..53d584589c26 100644
--- a/drivers/usb/gadget/epautoconf.c
+++ b/drivers/usb/gadget/epautoconf.c
@@ -34,12 +34,12 @@
34 34
35 35
36/* we must assign addresses for configurable endpoints (like net2280) */ 36/* we must assign addresses for configurable endpoints (like net2280) */
37static __initdata unsigned epnum; 37static __devinitdata unsigned epnum;
38 38
39// #define MANY_ENDPOINTS 39// #define MANY_ENDPOINTS
40#ifdef MANY_ENDPOINTS 40#ifdef MANY_ENDPOINTS
41/* more than 15 configurable endpoints */ 41/* more than 15 configurable endpoints */
42static __initdata unsigned in_epnum; 42static __devinitdata unsigned in_epnum;
43#endif 43#endif
44 44
45 45
@@ -59,7 +59,7 @@ static __initdata unsigned in_epnum;
59 * NOTE: each endpoint is unidirectional, as specified by its USB 59 * NOTE: each endpoint is unidirectional, as specified by its USB
60 * descriptor; and isn't specific to a configuration or altsetting. 60 * descriptor; and isn't specific to a configuration or altsetting.
61 */ 61 */
62static int __init 62static int __devinit
63ep_matches ( 63ep_matches (
64 struct usb_gadget *gadget, 64 struct usb_gadget *gadget,
65 struct usb_ep *ep, 65 struct usb_ep *ep,
@@ -73,7 +73,7 @@ ep_matches (
73 /* endpoint already claimed? */ 73 /* endpoint already claimed? */
74 if (0 != ep->driver_data) 74 if (0 != ep->driver_data)
75 return 0; 75 return 0;
76 76
77 /* only support ep0 for portable CONTROL traffic */ 77 /* only support ep0 for portable CONTROL traffic */
78 type = desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK; 78 type = desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK;
79 if (USB_ENDPOINT_XFER_CONTROL == type) 79 if (USB_ENDPOINT_XFER_CONTROL == type)
@@ -186,7 +186,7 @@ ep_matches (
186 return 1; 186 return 1;
187} 187}
188 188
189static struct usb_ep * __init 189static struct usb_ep * __devinit
190find_ep (struct usb_gadget *gadget, const char *name) 190find_ep (struct usb_gadget *gadget, const char *name)
191{ 191{
192 struct usb_ep *ep; 192 struct usb_ep *ep;
@@ -228,7 +228,7 @@ find_ep (struct usb_gadget *gadget, const char *name)
228 * 228 *
229 * On failure, this returns a null endpoint descriptor. 229 * On failure, this returns a null endpoint descriptor.
230 */ 230 */
231struct usb_ep * __init usb_ep_autoconfig ( 231struct usb_ep * __devinit usb_ep_autoconfig (
232 struct usb_gadget *gadget, 232 struct usb_gadget *gadget,
233 struct usb_endpoint_descriptor *desc 233 struct usb_endpoint_descriptor *desc
234) 234)
@@ -276,7 +276,7 @@ struct usb_ep * __init usb_ep_autoconfig (
276 return ep; 276 return ep;
277 } 277 }
278 278
279 /* Second, look at endpoints until an unclaimed one looks usable */ 279 /* Second, look at endpoints until an unclaimed one looks usable */
280 list_for_each_entry (ep, &gadget->ep_list, ep_list) { 280 list_for_each_entry (ep, &gadget->ep_list, ep_list) {
281 if (ep_matches (gadget, ep, desc)) 281 if (ep_matches (gadget, ep, desc))
282 return ep; 282 return ep;
@@ -295,7 +295,7 @@ struct usb_ep * __init usb_ep_autoconfig (
295 * state such as ep->driver_data and the record of assigned endpoints 295 * state such as ep->driver_data and the record of assigned endpoints
296 * used by usb_ep_autoconfig(). 296 * used by usb_ep_autoconfig().
297 */ 297 */
298void __init usb_ep_autoconfig_reset (struct usb_gadget *gadget) 298void __devinit usb_ep_autoconfig_reset (struct usb_gadget *gadget)
299{ 299{
300 struct usb_ep *ep; 300 struct usb_ep *ep;
301 301
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 8320fcef0425..4fe1bec1c255 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -2131,7 +2131,7 @@ eth_req_free (struct usb_ep *ep, struct usb_request *req)
2131} 2131}
2132 2132
2133 2133
2134static void __exit 2134static void /* __init_or_exit */
2135eth_unbind (struct usb_gadget *gadget) 2135eth_unbind (struct usb_gadget *gadget)
2136{ 2136{
2137 struct eth_dev *dev = get_gadget_data (gadget); 2137 struct eth_dev *dev = get_gadget_data (gadget);
@@ -2158,7 +2158,7 @@ eth_unbind (struct usb_gadget *gadget)
2158 set_gadget_data (gadget, NULL); 2158 set_gadget_data (gadget, NULL);
2159} 2159}
2160 2160
2161static u8 __init nibble (unsigned char c) 2161static u8 __devinit nibble (unsigned char c)
2162{ 2162{
2163 if (likely (isdigit (c))) 2163 if (likely (isdigit (c)))
2164 return c - '0'; 2164 return c - '0';
@@ -2168,7 +2168,7 @@ static u8 __init nibble (unsigned char c)
2168 return 0; 2168 return 0;
2169} 2169}
2170 2170
2171static int __init get_ether_addr(const char *str, u8 *dev_addr) 2171static int __devinit get_ether_addr(const char *str, u8 *dev_addr)
2172{ 2172{
2173 if (str) { 2173 if (str) {
2174 unsigned i; 2174 unsigned i;
@@ -2189,7 +2189,7 @@ static int __init get_ether_addr(const char *str, u8 *dev_addr)
2189 return 1; 2189 return 1;
2190} 2190}
2191 2191
2192static int __init 2192static int __devinit
2193eth_bind (struct usb_gadget *gadget) 2193eth_bind (struct usb_gadget *gadget)
2194{ 2194{
2195 struct eth_dev *dev; 2195 struct eth_dev *dev;
diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c
index b1a9cf06f3e6..8d7f1e84cd7b 100644
--- a/drivers/usb/gadget/file_storage.c
+++ b/drivers/usb/gadget/file_storage.c
@@ -3691,7 +3691,7 @@ static void lun_release(struct device *dev)
3691 kref_put(&fsg->ref, fsg_release); 3691 kref_put(&fsg->ref, fsg_release);
3692} 3692}
3693 3693
3694static void __exit fsg_unbind(struct usb_gadget *gadget) 3694static void /* __init_or_exit */ fsg_unbind(struct usb_gadget *gadget)
3695{ 3695{
3696 struct fsg_dev *fsg = get_gadget_data(gadget); 3696 struct fsg_dev *fsg = get_gadget_data(gadget);
3697 int i; 3697 int i;
diff --git a/drivers/usb/gadget/rndis.c b/drivers/usb/gadget/rndis.c
index 354670d12308..408c3380d602 100644
--- a/drivers/usb/gadget/rndis.c
+++ b/drivers/usb/gadget/rndis.c
@@ -1398,7 +1398,7 @@ static struct proc_dir_entry *rndis_connect_state [RNDIS_MAX_CONFIGS];
1398#endif /* CONFIG_USB_GADGET_DEBUG_FILES */ 1398#endif /* CONFIG_USB_GADGET_DEBUG_FILES */
1399 1399
1400 1400
1401int __init rndis_init (void) 1401int __devinit rndis_init (void)
1402{ 1402{
1403 u8 i; 1403 u8 i;
1404 1404
diff --git a/drivers/usb/gadget/rndis.h b/drivers/usb/gadget/rndis.h
index 2956608be751..4c3c7259f019 100644
--- a/drivers/usb/gadget/rndis.h
+++ b/drivers/usb/gadget/rndis.h
@@ -264,7 +264,7 @@ int rndis_signal_disconnect (int configNr);
264int rndis_state (int configNr); 264int rndis_state (int configNr);
265extern void rndis_set_host_mac (int configNr, const u8 *addr); 265extern void rndis_set_host_mac (int configNr, const u8 *addr);
266 266
267int __init rndis_init (void); 267int __devinit rndis_init (void);
268void rndis_exit (void); 268void rndis_exit (void);
269 269
270#endif /* _LINUX_RNDIS_H */ 270#endif /* _LINUX_RNDIS_H */
diff --git a/drivers/usb/gadget/serial.c b/drivers/usb/gadget/serial.c
index 30d7664d449d..e762aa19ab0a 100644
--- a/drivers/usb/gadget/serial.c
+++ b/drivers/usb/gadget/serial.c
@@ -1473,7 +1473,7 @@ autoconf_fail:
1473 * Called on module unload. Frees the control request and device 1473 * Called on module unload. Frees the control request and device
1474 * structure. 1474 * structure.
1475 */ 1475 */
1476static void __exit gs_unbind(struct usb_gadget *gadget) 1476static void /* __init_or_exit */ gs_unbind(struct usb_gadget *gadget)
1477{ 1477{
1478 struct gs_dev *dev = get_gadget_data(gadget); 1478 struct gs_dev *dev = get_gadget_data(gadget);
1479 1479
diff --git a/drivers/usb/gadget/zero.c b/drivers/usb/gadget/zero.c
index 3a08a7ab4ce0..b7018ee487ea 100644
--- a/drivers/usb/gadget/zero.c
+++ b/drivers/usb/gadget/zero.c
@@ -1121,7 +1121,7 @@ zero_autoresume (unsigned long _dev)
1121 1121
1122/*-------------------------------------------------------------------------*/ 1122/*-------------------------------------------------------------------------*/
1123 1123
1124static void __exit 1124static void /* __init_or_exit */
1125zero_unbind (struct usb_gadget *gadget) 1125zero_unbind (struct usb_gadget *gadget)
1126{ 1126{
1127 struct zero_dev *dev = get_gadget_data (gadget); 1127 struct zero_dev *dev = get_gadget_data (gadget);
diff --git a/drivers/usb/host/ehci-au1xxx.c b/drivers/usb/host/ehci-au1xxx.c
index d66867aa527e..26ed757d22a6 100644
--- a/drivers/usb/host/ehci-au1xxx.c
+++ b/drivers/usb/host/ehci-au1xxx.c
@@ -41,8 +41,6 @@
41#endif 41#endif
42#define USBH_DISABLE (USB_MCFG_EBMEN | USB_MCFG_EMEMEN) 42#define USBH_DISABLE (USB_MCFG_EBMEN | USB_MCFG_EMEMEN)
43 43
44#endif /* Au1200 */
45
46extern int usb_disabled(void); 44extern int usb_disabled(void);
47 45
48/*-------------------------------------------------------------------------*/ 46/*-------------------------------------------------------------------------*/
@@ -107,9 +105,9 @@ int usb_ehci_au1xxx_probe(const struct hc_driver *driver,
107 105
108 /* Au1200 AB USB does not support coherent memory */ 106 /* Au1200 AB USB does not support coherent memory */
109 if (!(read_c0_prid() & 0xff)) { 107 if (!(read_c0_prid() & 0xff)) {
110 pr_info("%s: this is chip revision AB!\n", dev->dev.name); 108 pr_info("%s: this is chip revision AB!\n", dev->name);
111 pr_info("%s: update your board or re-configure the kernel\n", 109 pr_info("%s: update your board or re-configure the kernel\n",
112 dev->dev.name); 110 dev->name);
113 return -ENODEV; 111 return -ENODEV;
114 } 112 }
115#endif 113#endif
@@ -228,9 +226,8 @@ static const struct hc_driver ehci_au1xxx_hc_driver = {
228 226
229/*-------------------------------------------------------------------------*/ 227/*-------------------------------------------------------------------------*/
230 228
231static int ehci_hcd_au1xxx_drv_probe(struct device *dev) 229static int ehci_hcd_au1xxx_drv_probe(struct platform_device *pdev)
232{ 230{
233 struct platform_device *pdev = to_platform_device(dev);
234 struct usb_hcd *hcd = NULL; 231 struct usb_hcd *hcd = NULL;
235 int ret; 232 int ret;
236 233
@@ -243,10 +240,9 @@ static int ehci_hcd_au1xxx_drv_probe(struct device *dev)
243 return ret; 240 return ret;
244} 241}
245 242
246static int ehci_hcd_au1xxx_drv_remove(struct device *dev) 243static int ehci_hcd_au1xxx_drv_remove(struct platform_device *pdev)
247{ 244{
248 struct platform_device *pdev = to_platform_device(dev); 245 struct usb_hcd *hcd = platform_get_drvdata(pdev);
249 struct usb_hcd *hcd = dev_get_drvdata(dev);
250 246
251 usb_ehci_au1xxx_remove(hcd, pdev); 247 usb_ehci_au1xxx_remove(hcd, pdev);
252 return 0; 248 return 0;
@@ -269,12 +265,13 @@ static int ehci_hcd_au1xxx_drv_resume(struct device *dev)
269} 265}
270*/ 266*/
271MODULE_ALIAS("au1xxx-ehci"); 267MODULE_ALIAS("au1xxx-ehci");
272/* FIXME use "struct platform_driver" */ 268static struct platform_driver ehci_hcd_au1xxx_driver = {
273static struct device_driver ehci_hcd_au1xxx_driver = {
274 .name = "au1xxx-ehci",
275 .bus = &platform_bus_type,
276 .probe = ehci_hcd_au1xxx_drv_probe, 269 .probe = ehci_hcd_au1xxx_drv_probe,
277 .remove = ehci_hcd_au1xxx_drv_remove, 270 .remove = ehci_hcd_au1xxx_drv_remove,
278 /*.suspend = ehci_hcd_au1xxx_drv_suspend, */ 271 /*.suspend = ehci_hcd_au1xxx_drv_suspend, */
279 /*.resume = ehci_hcd_au1xxx_drv_resume, */ 272 /*.resume = ehci_hcd_au1xxx_drv_resume, */
273 .driver = {
274 .name = "au1xxx-ehci",
275 .bus = &platform_bus_type
276 }
280}; 277};
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index cee6f538de0a..d63177a8eaea 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -625,10 +625,11 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd, struct pt_regs *regs)
625 writel (status | CMD_RUN, &ehci->regs->command); 625 writel (status | CMD_RUN, &ehci->regs->command);
626 626
627 while (i--) { 627 while (i--) {
628 status = readl (&ehci->regs->port_status [i]); 628 int pstatus = readl (&ehci->regs->port_status [i]);
629 if (status & PORT_OWNER) 629
630 if (pstatus & PORT_OWNER)
630 continue; 631 continue;
631 if (!(status & PORT_RESUME) 632 if (!(pstatus & PORT_RESUME)
632 || ehci->reset_done [i] != 0) 633 || ehci->reset_done [i] != 0)
633 continue; 634 continue;
634 635
@@ -891,7 +892,7 @@ MODULE_LICENSE ("GPL");
891#define PCI_DRIVER ehci_pci_driver 892#define PCI_DRIVER ehci_pci_driver
892#endif 893#endif
893 894
894#ifdef CONFIG_PPC_83xx 895#ifdef CONFIG_MPC834x
895#include "ehci-fsl.c" 896#include "ehci-fsl.c"
896#define PLATFORM_DRIVER ehci_fsl_driver 897#define PLATFORM_DRIVER ehci_fsl_driver
897#endif 898#endif
diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
index cdbafb710000..85cc059705a6 100644
--- a/drivers/usb/host/ohci-at91.c
+++ b/drivers/usb/host/ohci-at91.c
@@ -4,7 +4,7 @@
4 * Copyright (C) 2004 SAN People (Pty) Ltd. 4 * Copyright (C) 2004 SAN People (Pty) Ltd.
5 * Copyright (C) 2005 Thibaut VARENE <varenet@parisc-linux.org> 5 * Copyright (C) 2005 Thibaut VARENE <varenet@parisc-linux.org>
6 * 6 *
7 * AT91RM9200 Bus Glue 7 * AT91 Bus Glue
8 * 8 *
9 * Based on fragments of 2.4 driver by Rick Bronson. 9 * Based on fragments of 2.4 driver by Rick Bronson.
10 * Based on ohci-omap.c 10 * Based on ohci-omap.c
@@ -19,12 +19,13 @@
19#include <asm/hardware.h> 19#include <asm/hardware.h>
20#include <asm/arch/board.h> 20#include <asm/arch/board.h>
21 21
22#ifndef CONFIG_ARCH_AT91RM9200 22#ifndef CONFIG_ARCH_AT91
23#error "CONFIG_ARCH_AT91RM9200 must be defined." 23#error "CONFIG_ARCH_AT91 must be defined."
24#endif 24#endif
25 25
26/* interface and function clocks */ 26/* interface and function clocks */
27static struct clk *iclk, *fclk; 27static struct clk *iclk, *fclk;
28static int clocked;
28 29
29extern int usb_disabled(void); 30extern int usb_disabled(void);
30 31
@@ -35,13 +36,14 @@ static void at91_start_hc(struct platform_device *pdev)
35 struct usb_hcd *hcd = platform_get_drvdata(pdev); 36 struct usb_hcd *hcd = platform_get_drvdata(pdev);
36 struct ohci_regs __iomem *regs = hcd->regs; 37 struct ohci_regs __iomem *regs = hcd->regs;
37 38
38 dev_dbg(&pdev->dev, "starting AT91RM9200 OHCI USB Controller\n"); 39 dev_dbg(&pdev->dev, "start\n");
39 40
40 /* 41 /*
41 * Start the USB clocks. 42 * Start the USB clocks.
42 */ 43 */
43 clk_enable(iclk); 44 clk_enable(iclk);
44 clk_enable(fclk); 45 clk_enable(fclk);
46 clocked = 1;
45 47
46 /* 48 /*
47 * The USB host controller must remain in reset. 49 * The USB host controller must remain in reset.
@@ -54,7 +56,7 @@ static void at91_stop_hc(struct platform_device *pdev)
54 struct usb_hcd *hcd = platform_get_drvdata(pdev); 56 struct usb_hcd *hcd = platform_get_drvdata(pdev);
55 struct ohci_regs __iomem *regs = hcd->regs; 57 struct ohci_regs __iomem *regs = hcd->regs;
56 58
57 dev_dbg(&pdev->dev, "stopping AT91RM9200 OHCI USB Controller\n"); 59 dev_dbg(&pdev->dev, "stop\n");
58 60
59 /* 61 /*
60 * Put the USB host controller into reset. 62 * Put the USB host controller into reset.
@@ -66,6 +68,7 @@ static void at91_stop_hc(struct platform_device *pdev)
66 */ 68 */
67 clk_disable(fclk); 69 clk_disable(fclk);
68 clk_disable(iclk); 70 clk_disable(iclk);
71 clocked = 0;
69} 72}
70 73
71 74
@@ -78,14 +81,15 @@ static int usb_hcd_at91_remove (struct usb_hcd *, struct platform_device *);
78 81
79 82
80/** 83/**
81 * usb_hcd_at91_probe - initialize AT91RM9200-based HCDs 84 * usb_hcd_at91_probe - initialize AT91-based HCDs
82 * Context: !in_interrupt() 85 * Context: !in_interrupt()
83 * 86 *
84 * Allocates basic resources for this USB host controller, and 87 * Allocates basic resources for this USB host controller, and
85 * then invokes the start() method for the HCD associated with it 88 * then invokes the start() method for the HCD associated with it
86 * through the hotplug entry's driver_data. 89 * through the hotplug entry's driver_data.
87 */ 90 */
88int usb_hcd_at91_probe (const struct hc_driver *driver, struct platform_device *pdev) 91static int usb_hcd_at91_probe(const struct hc_driver *driver,
92 struct platform_device *pdev)
89{ 93{
90 int retval; 94 int retval;
91 struct usb_hcd *hcd = NULL; 95 struct usb_hcd *hcd = NULL;
@@ -95,12 +99,13 @@ int usb_hcd_at91_probe (const struct hc_driver *driver, struct platform_device *
95 return -ENODEV; 99 return -ENODEV;
96 } 100 }
97 101
98 if ((pdev->resource[0].flags != IORESOURCE_MEM) || (pdev->resource[1].flags != IORESOURCE_IRQ)) { 102 if ((pdev->resource[0].flags != IORESOURCE_MEM)
103 || (pdev->resource[1].flags != IORESOURCE_IRQ)) {
99 pr_debug("hcd probe: invalid resource type\n"); 104 pr_debug("hcd probe: invalid resource type\n");
100 return -ENODEV; 105 return -ENODEV;
101 } 106 }
102 107
103 hcd = usb_create_hcd(driver, &pdev->dev, "at91rm9200"); 108 hcd = usb_create_hcd(driver, &pdev->dev, "at91");
104 if (!hcd) 109 if (!hcd)
105 return -ENOMEM; 110 return -ENOMEM;
106 hcd->rsrc_start = pdev->resource[0].start; 111 hcd->rsrc_start = pdev->resource[0].start;
@@ -149,21 +154,23 @@ int usb_hcd_at91_probe (const struct hc_driver *driver, struct platform_device *
149/* may be called with controller, bus, and devices active */ 154/* may be called with controller, bus, and devices active */
150 155
151/** 156/**
152 * usb_hcd_at91_remove - shutdown processing for AT91RM9200-based HCDs 157 * usb_hcd_at91_remove - shutdown processing for AT91-based HCDs
153 * @dev: USB Host Controller being removed 158 * @dev: USB Host Controller being removed
154 * Context: !in_interrupt() 159 * Context: !in_interrupt()
155 * 160 *
156 * Reverses the effect of usb_hcd_at91_probe(), first invoking 161 * Reverses the effect of usb_hcd_at91_probe(), first invoking
157 * the HCD's stop() method. It is always called from a thread 162 * the HCD's stop() method. It is always called from a thread
158 * context, normally "rmmod", "apmd", or something similar. 163 * context, "rmmod" or something similar.
159 * 164 *
160 */ 165 */
161static int usb_hcd_at91_remove (struct usb_hcd *hcd, struct platform_device *pdev) 166static int usb_hcd_at91_remove(struct usb_hcd *hcd,
167 struct platform_device *pdev)
162{ 168{
163 usb_remove_hcd(hcd); 169 usb_remove_hcd(hcd);
164 at91_stop_hc(pdev); 170 at91_stop_hc(pdev);
165 iounmap(hcd->regs); 171 iounmap(hcd->regs);
166 release_mem_region(hcd->rsrc_start, hcd->rsrc_len); 172 release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
173 disable_irq_wake(hcd->irq);
167 174
168 clk_put(fclk); 175 clk_put(fclk);
169 clk_put(iclk); 176 clk_put(iclk);
@@ -178,19 +185,21 @@ static int usb_hcd_at91_remove (struct usb_hcd *hcd, struct platform_device *pde
178static int __devinit 185static int __devinit
179ohci_at91_start (struct usb_hcd *hcd) 186ohci_at91_start (struct usb_hcd *hcd)
180{ 187{
181// struct at91_ohci_data *board = hcd->self.controller->platform_data; 188 struct at91_usbh_data *board = hcd->self.controller->platform_data;
182 struct ohci_hcd *ohci = hcd_to_ohci (hcd); 189 struct ohci_hcd *ohci = hcd_to_ohci (hcd);
190 struct usb_device *root = hcd->self.root_hub;
183 int ret; 191 int ret;
184 192
185 if ((ret = ohci_init(ohci)) < 0) 193 if ((ret = ohci_init(ohci)) < 0)
186 return ret; 194 return ret;
187 195
196 root->maxchild = board->ports;
197
188 if ((ret = ohci_run(ohci)) < 0) { 198 if ((ret = ohci_run(ohci)) < 0) {
189 err("can't start %s", hcd->self.bus_name); 199 err("can't start %s", hcd->self.bus_name);
190 ohci_stop(hcd); 200 ohci_stop(hcd);
191 return ret; 201 return ret;
192 } 202 }
193// hcd->self.root_hub->maxchild = board->ports;
194 return 0; 203 return 0;
195} 204}
196 205
@@ -198,7 +207,7 @@ ohci_at91_start (struct usb_hcd *hcd)
198 207
199static const struct hc_driver ohci_at91_hc_driver = { 208static const struct hc_driver ohci_at91_hc_driver = {
200 .description = hcd_name, 209 .description = hcd_name,
201 .product_desc = "AT91RM9200 OHCI", 210 .product_desc = "AT91 OHCI",
202 .hcd_priv_size = sizeof(struct ohci_hcd), 211 .hcd_priv_size = sizeof(struct ohci_hcd),
203 212
204 /* 213 /*
@@ -240,33 +249,54 @@ static const struct hc_driver ohci_at91_hc_driver = {
240 249
241/*-------------------------------------------------------------------------*/ 250/*-------------------------------------------------------------------------*/
242 251
243static int ohci_hcd_at91_drv_probe(struct platform_device *dev) 252static int ohci_hcd_at91_drv_probe(struct platform_device *pdev)
244{ 253{
245 return usb_hcd_at91_probe(&ohci_at91_hc_driver, dev); 254 device_init_wakeup(&pdev->dev, 1);
255 return usb_hcd_at91_probe(&ohci_at91_hc_driver, pdev);
246} 256}
247 257
248static int ohci_hcd_at91_drv_remove(struct platform_device *dev) 258static int ohci_hcd_at91_drv_remove(struct platform_device *pdev)
249{ 259{
250 return usb_hcd_at91_remove(platform_get_drvdata(dev), dev); 260 device_init_wakeup(&pdev->dev, 0);
261 return usb_hcd_at91_remove(platform_get_drvdata(pdev), pdev);
251} 262}
252 263
253#ifdef CONFIG_PM 264#ifdef CONFIG_PM
254 265
255/* REVISIT suspend/resume look "too" simple here */
256
257static int 266static int
258ohci_hcd_at91_drv_suspend(struct platform_device *dev, pm_message_t mesg) 267ohci_hcd_at91_drv_suspend(struct platform_device *pdev, pm_message_t mesg)
259{ 268{
260 clk_disable(fclk); 269 struct usb_hcd *hcd = platform_get_drvdata(pdev);
261 clk_disable(iclk); 270 struct ohci_hcd *ohci = hcd_to_ohci(hcd);
271
272 if (device_may_wakeup(&pdev->dev))
273 enable_irq_wake(hcd->irq);
274 else
275 disable_irq_wake(hcd->irq);
276
277 /*
278 * The integrated transceivers seem unable to notice disconnect,
279 * reconnect, or wakeup without the 48 MHz clock active. so for
280 * correctness, always discard connection state (using reset).
281 *
282 * REVISIT: some boards will be able to turn VBUS off...
283 */
284 if (at91_suspend_entering_slow_clock()) {
285 ohci_usb_reset (ohci);
286 clk_disable(fclk);
287 clk_disable(iclk);
288 clocked = 0;
289 }
262 290
263 return 0; 291 return 0;
264} 292}
265 293
266static int ohci_hcd_at91_drv_resume(struct platform_device *dev) 294static int ohci_hcd_at91_drv_resume(struct platform_device *pdev)
267{ 295{
268 clk_enable(iclk); 296 if (!clocked) {
269 clk_enable(fclk); 297 clk_enable(iclk);
298 clk_enable(fclk);
299 }
270 300
271 return 0; 301 return 0;
272} 302}
@@ -275,7 +305,7 @@ static int ohci_hcd_at91_drv_resume(struct platform_device *dev)
275#define ohci_hcd_at91_drv_resume NULL 305#define ohci_hcd_at91_drv_resume NULL
276#endif 306#endif
277 307
278MODULE_ALIAS("at91rm9200-ohci"); 308MODULE_ALIAS("at91_ohci");
279 309
280static struct platform_driver ohci_hcd_at91_driver = { 310static struct platform_driver ohci_hcd_at91_driver = {
281 .probe = ohci_hcd_at91_drv_probe, 311 .probe = ohci_hcd_at91_drv_probe,
@@ -283,7 +313,7 @@ static struct platform_driver ohci_hcd_at91_driver = {
283 .suspend = ohci_hcd_at91_drv_suspend, 313 .suspend = ohci_hcd_at91_drv_suspend,
284 .resume = ohci_hcd_at91_drv_resume, 314 .resume = ohci_hcd_at91_drv_resume,
285 .driver = { 315 .driver = {
286 .name = "at91rm9200-ohci", 316 .name = "at91_ohci",
287 .owner = THIS_MODULE, 317 .owner = THIS_MODULE,
288 }, 318 },
289}; 319};
diff --git a/drivers/usb/host/ohci-au1xxx.c b/drivers/usb/host/ohci-au1xxx.c
index 689261e44018..822914e2f43b 100644
--- a/drivers/usb/host/ohci-au1xxx.c
+++ b/drivers/usb/host/ohci-au1xxx.c
@@ -101,13 +101,16 @@ static void au1xxx_start_ohc(struct platform_device *dev)
101 101
102#endif /* Au1200 */ 102#endif /* Au1200 */
103 103
104#ifndef CONFIG_SOC_AU1200
104 /* wait for reset complete (read register twice; see au1500 errata) */ 105 /* wait for reset complete (read register twice; see au1500 errata) */
105 while (au_readl(USB_HOST_CONFIG), 106 while (au_readl(USB_HOST_CONFIG),
106 !(au_readl(USB_HOST_CONFIG) & USBH_ENABLE_RD)) 107 !(au_readl(USB_HOST_CONFIG) & USBH_ENABLE_RD))
108#endif
107 udelay(1000); 109 udelay(1000);
108 110
109 printk(KERN_DEBUG __FILE__ 111 printk(KERN_DEBUG __FILE__
110 ": Clock to USB host has been enabled \n"); 112 ": Clock to USB host has been enabled \n");
113#endif
111} 114}
112 115
113static void au1xxx_stop_ohc(struct platform_device *dev) 116static void au1xxx_stop_ohc(struct platform_device *dev)
@@ -157,9 +160,9 @@ static int usb_ohci_au1xxx_probe(const struct hc_driver *driver,
157 /* Au1200 AB USB does not support coherent memory */ 160 /* Au1200 AB USB does not support coherent memory */
158 if (!(read_c0_prid() & 0xff)) { 161 if (!(read_c0_prid() & 0xff)) {
159 pr_info("%s: this is chip revision AB !!\n", 162 pr_info("%s: this is chip revision AB !!\n",
160 dev->dev.name); 163 dev->name);
161 pr_info("%s: update your board or re-configure the kernel\n", 164 pr_info("%s: update your board or re-configure the kernel\n",
162 dev->dev.name); 165 dev->name);
163 return -ENODEV; 166 return -ENODEV;
164 } 167 }
165#endif 168#endif
diff --git a/drivers/usb/host/ohci-ep93xx.c b/drivers/usb/host/ohci-ep93xx.c
new file mode 100644
index 000000000000..6531c4d26527
--- /dev/null
+++ b/drivers/usb/host/ohci-ep93xx.c
@@ -0,0 +1,225 @@
1/*
2 * OHCI HCD (Host Controller Driver) for USB.
3 *
4 * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at>
5 * (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net>
6 * (C) Copyright 2002 Hewlett-Packard Company
7 *
8 * Bus Glue for ep93xx.
9 *
10 * Written by Christopher Hoover <ch@hpl.hp.com>
11 * Based on fragments of previous driver by Russell King et al.
12 *
13 * Modified for LH7A404 from ohci-sa1111.c
14 * by Durgesh Pattamatta <pattamattad@sharpsec.com>
15 *
16 * Modified for pxa27x from ohci-lh7a404.c
17 * by Nick Bane <nick@cecomputing.co.uk> 26-8-2004
18 *
19 * Modified for ep93xx from ohci-pxa27x.c
20 * by Lennert Buytenhek <buytenh@wantstofly.org> 28-2-2006
21 * Based on an earlier driver by Ray Lehtiniemi
22 *
23 * This file is licenced under the GPL.
24 */
25
26#include <linux/clk.h>
27#include <linux/device.h>
28#include <linux/signal.h>
29#include <linux/platform_device.h>
30
31#include <asm/mach-types.h>
32#include <asm/hardware.h>
33
34static struct clk *usb_host_clock;
35
36static void ep93xx_start_hc(struct device *dev)
37{
38 clk_enable(usb_host_clock);
39}
40
41static void ep93xx_stop_hc(struct device *dev)
42{
43 clk_disable(usb_host_clock);
44}
45
46static int usb_hcd_ep93xx_probe(const struct hc_driver *driver,
47 struct platform_device *pdev)
48{
49 int retval;
50 struct usb_hcd *hcd;
51
52 if (pdev->resource[1].flags != IORESOURCE_IRQ) {
53 pr_debug("resource[1] is not IORESOURCE_IRQ");
54 return -ENOMEM;
55 }
56
57 hcd = usb_create_hcd(driver, &pdev->dev, "ep93xx");
58 if (hcd == NULL)
59 return -ENOMEM;
60
61 hcd->rsrc_start = pdev->resource[0].start;
62 hcd->rsrc_len = pdev->resource[0].end - pdev->resource[0].start + 1;
63 if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) {
64 usb_put_hcd(hcd);
65 retval = -EBUSY;
66 goto err1;
67 }
68
69 hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len);
70 if (hcd->regs == NULL) {
71 pr_debug("ioremap failed");
72 retval = -ENOMEM;
73 goto err2;
74 }
75
76 usb_host_clock = clk_get(&pdev->dev, "usb_host");
77 ep93xx_start_hc(&pdev->dev);
78
79 ohci_hcd_init(hcd_to_ohci(hcd));
80
81 retval = usb_add_hcd(hcd, pdev->resource[1].start, SA_INTERRUPT);
82 if (retval == 0)
83 return retval;
84
85 ep93xx_stop_hc(&pdev->dev);
86 iounmap(hcd->regs);
87err2:
88 release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
89err1:
90 usb_put_hcd(hcd);
91
92 return retval;
93}
94
95static void usb_hcd_ep93xx_remove(struct usb_hcd *hcd,
96 struct platform_device *pdev)
97{
98 usb_remove_hcd(hcd);
99 ep93xx_stop_hc(&pdev->dev);
100 clk_put(usb_host_clock);
101 iounmap(hcd->regs);
102 release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
103 usb_put_hcd(hcd);
104}
105
106static int __devinit ohci_ep93xx_start(struct usb_hcd *hcd)
107{
108 struct ohci_hcd *ohci = hcd_to_ohci(hcd);
109 int ret;
110
111 if ((ret = ohci_init(ohci)) < 0)
112 return ret;
113
114 if ((ret = ohci_run(ohci)) < 0) {
115 err("can't start %s", hcd->self.bus_name);
116 ohci_stop(hcd);
117 return ret;
118 }
119
120 return 0;
121}
122
123static struct hc_driver ohci_ep93xx_hc_driver = {
124 .description = hcd_name,
125 .product_desc = "EP93xx OHCI",
126 .hcd_priv_size = sizeof(struct ohci_hcd),
127 .irq = ohci_irq,
128 .flags = HCD_USB11 | HCD_MEMORY,
129 .start = ohci_ep93xx_start,
130 .stop = ohci_stop,
131 .urb_enqueue = ohci_urb_enqueue,
132 .urb_dequeue = ohci_urb_dequeue,
133 .endpoint_disable = ohci_endpoint_disable,
134 .get_frame_number = ohci_get_frame,
135 .hub_status_data = ohci_hub_status_data,
136 .hub_control = ohci_hub_control,
137#ifdef CONFIG_PM
138 .bus_suspend = ohci_bus_suspend,
139 .bus_resume = ohci_bus_resume,
140#endif
141 .start_port_reset = ohci_start_port_reset,
142};
143
144extern int usb_disabled(void);
145
146static int ohci_hcd_ep93xx_drv_probe(struct platform_device *pdev)
147{
148 int ret;
149
150 ret = -ENODEV;
151 if (!usb_disabled())
152 ret = usb_hcd_ep93xx_probe(&ohci_ep93xx_hc_driver, pdev);
153
154 return ret;
155}
156
157static int ohci_hcd_ep93xx_drv_remove(struct platform_device *pdev)
158{
159 struct usb_hcd *hcd = platform_get_drvdata(pdev);
160
161 usb_hcd_ep93xx_remove(hcd, pdev);
162
163 return 0;
164}
165
166#ifdef CONFIG_PM
167static int ohci_hcd_ep93xx_drv_suspend(struct platform_device *pdev, pm_message_t state)
168{
169 struct usb_hcd *hcd = platform_get_drvdata(pdev);
170 struct ochi_hcd *ohci = hcd_to_ohci(hcd);
171
172 if (time_before(jiffies, ohci->next_statechange))
173 msleep(5);
174 ohci->next_statechange = jiffies;
175
176 ep93xx_stop_hc(&pdev->dev);
177 hcd->state = HC_STATE_SUSPENDED;
178 pdev->dev.power.power_state = PMSG_SUSPEND;
179
180 return 0;
181}
182
183static int ohci_hcd_ep93xx_drv_resume(struct platform_device *pdev)
184{
185 struct usb_hcd *hcd = platform_get_drvdata(pdev);
186 struct ohci_hcd *ohci = hcd_to_ohci(hcd);
187 int status;
188
189 if (time_before(jiffies, ohci->next_statechange))
190 msleep(5);
191 ohci->next_statechange = jiffies;
192
193 ep93xx_start_hc(&pdev->dev);
194 pdev->dev.power.power_state = PMSG_ON;
195 usb_hcd_resume_root_hub(hcd);
196
197 return 0;
198}
199#endif
200
201
202static struct platform_driver ohci_hcd_ep93xx_driver = {
203 .probe = ohci_hcd_ep93xx_drv_probe,
204 .remove = ohci_hcd_ep93xx_drv_remove,
205#ifdef CONFIG_PM
206 .suspend = ohci_hcd_ep93xx_drv_suspend,
207 .resume = ohci_hcd_ep93xx_drv_resume,
208#endif
209 .driver = {
210 .name = "ep93xx-ohci",
211 },
212};
213
214static int __init ohci_hcd_ep93xx_init(void)
215{
216 return platform_driver_register(&ohci_hcd_ep93xx_driver);
217}
218
219static void __exit ohci_hcd_ep93xx_cleanup(void)
220{
221 platform_driver_unregister(&ohci_hcd_ep93xx_driver);
222}
223
224module_init(ohci_hcd_ep93xx_init);
225module_exit(ohci_hcd_ep93xx_cleanup);
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 8fb842ed5f6e..94d8cf4b36c1 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -901,6 +901,10 @@ MODULE_LICENSE ("GPL");
901#include "ohci-pxa27x.c" 901#include "ohci-pxa27x.c"
902#endif 902#endif
903 903
904#ifdef CONFIG_ARCH_EP93XX
905#include "ohci-ep93xx.c"
906#endif
907
904#ifdef CONFIG_SOC_AU1X00 908#ifdef CONFIG_SOC_AU1X00
905#include "ohci-au1xxx.c" 909#include "ohci-au1xxx.c"
906#endif 910#endif
@@ -909,7 +913,7 @@ MODULE_LICENSE ("GPL");
909#include "ohci-ppc-soc.c" 913#include "ohci-ppc-soc.c"
910#endif 914#endif
911 915
912#ifdef CONFIG_ARCH_AT91RM9200 916#if defined(CONFIG_ARCH_AT91RM9200) || defined(CONFIG_ARCH_AT91SAM9261)
913#include "ohci-at91.c" 917#include "ohci-at91.c"
914#endif 918#endif
915 919
@@ -919,9 +923,11 @@ MODULE_LICENSE ("GPL");
919 || defined(CONFIG_ARCH_OMAP) \ 923 || defined(CONFIG_ARCH_OMAP) \
920 || defined (CONFIG_ARCH_LH7A404) \ 924 || defined (CONFIG_ARCH_LH7A404) \
921 || defined (CONFIG_PXA27x) \ 925 || defined (CONFIG_PXA27x) \
926 || defined (CONFIG_ARCH_EP93XX) \
922 || defined (CONFIG_SOC_AU1X00) \ 927 || defined (CONFIG_SOC_AU1X00) \
923 || defined (CONFIG_USB_OHCI_HCD_PPC_SOC) \ 928 || defined (CONFIG_USB_OHCI_HCD_PPC_SOC) \
924 || defined (CONFIG_ARCH_AT91RM9200) \ 929 || defined (CONFIG_ARCH_AT91RM9200) \
930 || defined (CONFIG_ARCH_AT91SAM9261) \
925 ) 931 )
926#error "missing bus glue for ohci-hcd" 932#error "missing bus glue for ohci-hcd"
927#endif 933#endif
diff --git a/drivers/usb/host/ohci-hub.c b/drivers/usb/host/ohci-hub.c
index 0bb972b58336..5b0a23fd798b 100644
--- a/drivers/usb/host/ohci-hub.c
+++ b/drivers/usb/host/ohci-hub.c
@@ -581,14 +581,14 @@ static int ohci_hub_control (
581 break; 581 break;
582 case GetHubStatus: 582 case GetHubStatus:
583 temp = roothub_status (ohci) & ~(RH_HS_CRWE | RH_HS_DRWE); 583 temp = roothub_status (ohci) & ~(RH_HS_CRWE | RH_HS_DRWE);
584 *(__le32 *) buf = cpu_to_le32 (temp); 584 put_unaligned(cpu_to_le32 (temp), (__le32 *) buf);
585 break; 585 break;
586 case GetPortStatus: 586 case GetPortStatus:
587 if (!wIndex || wIndex > ports) 587 if (!wIndex || wIndex > ports)
588 goto error; 588 goto error;
589 wIndex--; 589 wIndex--;
590 temp = roothub_portstatus (ohci, wIndex); 590 temp = roothub_portstatus (ohci, wIndex);
591 *(__le32 *) buf = cpu_to_le32 (temp); 591 put_unaligned(cpu_to_le32 (temp), (__le32 *) buf);
592 592
593#ifndef OHCI_VERBOSE_DEBUG 593#ifndef OHCI_VERBOSE_DEBUG
594 if (*(u16*)(buf+2)) /* only if wPortChange is interesting */ 594 if (*(u16*)(buf+2)) /* only if wPortChange is interesting */
diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
index dff60568b4a1..20861650905e 100644
--- a/drivers/usb/host/pci-quirks.c
+++ b/drivers/usb/host/pci-quirks.c
@@ -167,8 +167,6 @@ static int __devinit mmio_resource_enabled(struct pci_dev *pdev, int idx)
167static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev) 167static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev)
168{ 168{
169 void __iomem *base; 169 void __iomem *base;
170 int wait_time;
171 u32 control;
172 170
173 if (!mmio_resource_enabled(pdev, 0)) 171 if (!mmio_resource_enabled(pdev, 0))
174 return; 172 return;
@@ -179,9 +177,10 @@ static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev)
179 177
180/* On PA-RISC, PDC can leave IR set incorrectly; ignore it there. */ 178/* On PA-RISC, PDC can leave IR set incorrectly; ignore it there. */
181#ifndef __hppa__ 179#ifndef __hppa__
182 control = readl(base + OHCI_CONTROL); 180{
181 u32 control = readl(base + OHCI_CONTROL);
183 if (control & OHCI_CTRL_IR) { 182 if (control & OHCI_CTRL_IR) {
184 wait_time = 500; /* arbitrary; 5 seconds */ 183 int wait_time = 500; /* arbitrary; 5 seconds */
185 writel(OHCI_INTR_OC, base + OHCI_INTRENABLE); 184 writel(OHCI_INTR_OC, base + OHCI_INTRENABLE);
186 writel(OHCI_OCR, base + OHCI_CMDSTATUS); 185 writel(OHCI_OCR, base + OHCI_CMDSTATUS);
187 while (wait_time > 0 && 186 while (wait_time > 0 &&
@@ -198,6 +197,7 @@ static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev)
198 /* reset controller, preserving RWC */ 197 /* reset controller, preserving RWC */
199 writel(control & OHCI_CTRL_RWC, base + OHCI_CONTROL); 198 writel(control & OHCI_CTRL_RWC, base + OHCI_CONTROL);
200 } 199 }
200}
201#endif 201#endif
202 202
203 /* 203 /*
diff --git a/drivers/usb/host/uhci-q.c b/drivers/usb/host/uhci-q.c
index c9d72ac0a1d7..66c3f61bc9d1 100644
--- a/drivers/usb/host/uhci-q.c
+++ b/drivers/usb/host/uhci-q.c
@@ -943,7 +943,9 @@ static int uhci_result_common(struct uhci_hcd *uhci, struct urb *urb)
943 /* We received a short packet */ 943 /* We received a short packet */
944 if (urb->transfer_flags & URB_SHORT_NOT_OK) 944 if (urb->transfer_flags & URB_SHORT_NOT_OK)
945 ret = -EREMOTEIO; 945 ret = -EREMOTEIO;
946 else if (ctrlstat & TD_CTRL_SPD) 946
947 /* Fixup needed only if this isn't the URB's last TD */
948 else if (&td->list != urbp->td_list.prev)
947 ret = 1; 949 ret = 1;
948 } 950 }
949 951
diff --git a/drivers/usb/input/ati_remote.c b/drivers/usb/input/ati_remote.c
index 05d2d6012eb2..df198cf76f52 100644
--- a/drivers/usb/input/ati_remote.c
+++ b/drivers/usb/input/ati_remote.c
@@ -152,9 +152,8 @@ static const char accel[] = { 1, 2, 4, 6, 9, 13, 20 };
152 * events. The hardware generates 5 events for the first keypress 152 * events. The hardware generates 5 events for the first keypress
153 * and we have to take this into account for an accurate repeat 153 * and we have to take this into account for an accurate repeat
154 * behaviour. 154 * behaviour.
155 * (HZ / 20) == 50 ms and works well for me.
156 */ 155 */
157#define FILTER_TIME (HZ / 20) 156#define FILTER_TIME 60 /* msec */
158 157
159struct ati_remote { 158struct ati_remote {
160 struct input_dev *idev; 159 struct input_dev *idev;
@@ -467,7 +466,7 @@ static void ati_remote_input_report(struct urb *urb, struct pt_regs *regs)
467 /* Filter duplicate events which happen "too close" together. */ 466 /* Filter duplicate events which happen "too close" together. */
468 if ((ati_remote->old_data[0] == data[1]) && 467 if ((ati_remote->old_data[0] == data[1]) &&
469 (ati_remote->old_data[1] == data[2]) && 468 (ati_remote->old_data[1] == data[2]) &&
470 time_before(jiffies, ati_remote->old_jiffies + FILTER_TIME)) { 469 time_before(jiffies, ati_remote->old_jiffies + msecs_to_jiffies(FILTER_TIME))) {
471 ati_remote->repeat_count++; 470 ati_remote->repeat_count++;
472 } else { 471 } else {
473 ati_remote->repeat_count = 0; 472 ati_remote->repeat_count = 0;
diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c
index b9fb9687f926..8ea9c915fbf9 100644
--- a/drivers/usb/input/hid-core.c
+++ b/drivers/usb/input/hid-core.c
@@ -1507,6 +1507,9 @@ void hid_init_reports(struct hid_device *hid)
1507#define USB_DEVICE_ID_4_PHIDGETSERVO_20 0x8104 1507#define USB_DEVICE_ID_4_PHIDGETSERVO_20 0x8104
1508#define USB_DEVICE_ID_DUAL_USB_JOYPAD 0x8866 1508#define USB_DEVICE_ID_DUAL_USB_JOYPAD 0x8866
1509 1509
1510#define USB_VENDOR_ID_WISEGROUP_LTD 0x6677
1511#define USB_DEVICE_ID_SMARTJOY_DUAL_PLUS 0x8802
1512
1510#define USB_VENDOR_ID_CODEMERCS 0x07c0 1513#define USB_VENDOR_ID_CODEMERCS 0x07c0
1511#define USB_DEVICE_ID_CODEMERCS_IOW40 0x1500 1514#define USB_DEVICE_ID_CODEMERCS_IOW40 0x1500
1512#define USB_DEVICE_ID_CODEMERCS_IOW24 0x1501 1515#define USB_DEVICE_ID_CODEMERCS_IOW24 0x1501
@@ -1670,6 +1673,7 @@ static const struct hid_blacklist {
1670 { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVM, HID_QUIRK_NOGET }, 1673 { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVM, HID_QUIRK_NOGET },
1671 { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVMC, HID_QUIRK_NOGET }, 1674 { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVMC, HID_QUIRK_NOGET },
1672 { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT }, 1675 { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT },
1676 { USB_VENDOR_ID_WISEGROUP_LTD, USB_DEVICE_ID_SMARTJOY_DUAL_PLUS, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT },
1673 1677
1674 { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MIGHTYMOUSE, HID_QUIRK_MIGHTYMOUSE | HID_QUIRK_INVERT_HWHEEL }, 1678 { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MIGHTYMOUSE, HID_QUIRK_MIGHTYMOUSE | HID_QUIRK_INVERT_HWHEEL },
1675 { USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU, HID_QUIRK_2WHEEL_MOUSE_HACK_7 }, 1679 { USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU, HID_QUIRK_2WHEEL_MOUSE_HACK_7 },
diff --git a/drivers/usb/misc/Kconfig b/drivers/usb/misc/Kconfig
index daa486dde8cf..88928a4be805 100644
--- a/drivers/usb/misc/Kconfig
+++ b/drivers/usb/misc/Kconfig
@@ -88,19 +88,19 @@ config USB_LED
88 To compile this driver as a module, choose M here: the 88 To compile this driver as a module, choose M here: the
89 module will be called usbled. 89 module will be called usbled.
90 90
91config USB_CY7C63 91config USB_CYPRESS_CY7C63
92 tristate "Cypress CY7C63xxx USB driver support" 92 tristate "Cypress CY7C63xxx USB driver support"
93 depends on USB 93 depends on USB
94 help 94 help
95 Say Y here if you want to connect a Cypress CY7C63xxx 95 Say Y here if you want to connect a Cypress CY7C63xxx
96 micro controller to your computer's USB port. This driver 96 micro controller to your computer's USB port. Currently this
97 supports the pre-programmed devices (incl. firmware) by 97 driver supports the pre-programmed devices (incl. firmware)
98 AK Modul-Bus Computer GmbH. 98 by AK Modul-Bus Computer GmbH.
99 99
100 Please see: http://www.ak-modul-bus.de/stat/mikrocontroller.html 100 Please see: http://www.ak-modul-bus.de/stat/mikrocontroller.html
101 101
102 To compile this driver as a module, choose M here: the 102 To compile this driver as a module, choose M here: the
103 module will be called cy7c63. 103 module will be called cypress_cy7c63.
104 104
105config USB_CYTHERM 105config USB_CYTHERM
106 tristate "Cypress USB thermometer driver support" 106 tristate "Cypress USB thermometer driver support"
diff --git a/drivers/usb/misc/Makefile b/drivers/usb/misc/Makefile
index f25a97227297..2927260c5812 100644
--- a/drivers/usb/misc/Makefile
+++ b/drivers/usb/misc/Makefile
@@ -4,7 +4,7 @@
4# 4#
5 5
6obj-$(CONFIG_USB_AUERSWALD) += auerswald.o 6obj-$(CONFIG_USB_AUERSWALD) += auerswald.o
7obj-$(CONFIG_USB_CY7C63) += cy7c63.o 7obj-$(CONFIG_USB_CYPRESS_CY7C63)+= cypress_cy7c63.o
8obj-$(CONFIG_USB_CYTHERM) += cytherm.o 8obj-$(CONFIG_USB_CYTHERM) += cytherm.o
9obj-$(CONFIG_USB_EMI26) += emi26.o 9obj-$(CONFIG_USB_EMI26) += emi26.o
10obj-$(CONFIG_USB_EMI62) += emi62.o 10obj-$(CONFIG_USB_EMI62) += emi62.o
diff --git a/drivers/usb/misc/cy7c63.c b/drivers/usb/misc/cy7c63.c
deleted file mode 100644
index 8a1c10b89b76..000000000000
--- a/drivers/usb/misc/cy7c63.c
+++ /dev/null
@@ -1,244 +0,0 @@
1/*
2* cy7c63.c
3*
4* Copyright (c) 2006 Oliver Bock (bock@fh-wolfenbuettel.de)
5*
6* This driver is based on the Cypress Thermometer USB Driver by
7* Marcus Maul and the 2.0 version of Greg Kroah-Hartman's
8* USB Skeleton driver.
9*
10* Is is a generic driver for the Cypress CY7C63000 family.
11* For the time being it enables you to toggle the single I/O ports
12* of the device.
13*
14* Supported vendors: AK Modul-Bus Computer GmbH
15* Supported devices: CY7C63001A-PC (to be continued...)
16* Supported functions: Read/Write Ports (to be continued...)
17*
18* Chipsets families: CY7C63000, CY7C63001, CY7C63100, CY7C63101
19*
20*
21* This program is free software; you can redistribute it and/or
22* modify it under the terms of the GNU General Public License as
23* published by the Free Software Foundation, version 2.
24*/
25
26#include <linux/init.h>
27#include <linux/module.h>
28#include <linux/kernel.h>
29#include <linux/usb.h>
30
31#define DRIVER_AUTHOR "Oliver Bock (bock@fh-wolfenbuettel.de)"
32#define DRIVER_DESC "Cypress CY7C63xxx USB driver"
33
34#define CY7C63_VENDOR_ID 0xa2c
35#define CY7C63_PRODUCT_ID 0x8
36
37#define CY7C63_READ_PORT 0x4
38#define CY7C63_WRITE_PORT 0x5
39#define CY7C63_READ_RAM 0x2
40#define CY7C63_WRITE_RAM 0x3
41#define CY7C63_READ_ROM 0x1
42
43#define CY7C63_READ_PORT_ID0 0
44#define CY7C63_WRITE_PORT_ID0 0
45#define CY7C63_READ_PORT_ID1 0x2
46#define CY7C63_WRITE_PORT_ID1 1
47
48#define CY7C63_MAX_REQSIZE 8
49
50
51/* table of devices that work with this driver */
52static struct usb_device_id cy7c63_table [] = {
53 { USB_DEVICE(CY7C63_VENDOR_ID, CY7C63_PRODUCT_ID) },
54 { }
55};
56MODULE_DEVICE_TABLE(usb, cy7c63_table);
57
58/* structure to hold all of our device specific stuff */
59struct cy7c63 {
60 struct usb_device * udev;
61 char port0;
62 char port1;
63};
64
65/* used to send usb control messages to device */
66int vendor_command(struct cy7c63 *dev, unsigned char request,
67 unsigned char address, unsigned char data) {
68
69 int retval = 0;
70 unsigned int pipe;
71 unsigned char *iobuf;
72
73 /* allocate some memory for the i/o buffer*/
74 iobuf = kzalloc(CY7C63_MAX_REQSIZE, GFP_KERNEL);
75 if (!iobuf) {
76 dev_err(&dev->udev->dev, "Out of memory!\n");
77 retval = -ENOMEM;
78 goto error;
79 }
80
81 dev_dbg(&dev->udev->dev, "Sending usb_control_msg (data: %d)\n", data);
82
83 /* prepare usb control message and send it upstream */
84 pipe = usb_rcvctrlpipe(dev->udev, 0);
85 retval = usb_control_msg(dev->udev, pipe, request,
86 USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_OTHER,
87 address, data, iobuf, CY7C63_MAX_REQSIZE,
88 USB_CTRL_GET_TIMEOUT);
89
90 /* store returned data (more READs to be added!) */
91 switch (request) {
92 case CY7C63_READ_PORT:
93 if (address == CY7C63_READ_PORT_ID0) {
94 dev->port0 = iobuf[1];
95 dev_dbg(&dev->udev->dev,
96 "READ_PORT0 returned: %d\n",dev->port0);
97 }
98 else if (address == CY7C63_READ_PORT_ID1) {
99 dev->port1 = iobuf[1];
100 dev_dbg(&dev->udev->dev,
101 "READ_PORT1 returned: %d\n",dev->port1);
102 }
103 break;
104 }
105
106 kfree(iobuf);
107error:
108 return retval;
109}
110
111#define get_set_port(num,read_id,write_id) \
112static ssize_t set_port##num(struct device *dev, struct device_attribute *attr, \
113 const char *buf, size_t count) { \
114 \
115 int value; \
116 int result = 0; \
117 \
118 struct usb_interface *intf = to_usb_interface(dev); \
119 struct cy7c63 *cyp = usb_get_intfdata(intf); \
120 \
121 dev_dbg(&cyp->udev->dev, "WRITE_PORT%d called\n", num); \
122 \
123 /* validate input data */ \
124 if (sscanf(buf, "%d", &value) < 1) { \
125 result = -EINVAL; \
126 goto error; \
127 } \
128 if (value>255 || value<0) { \
129 result = -EINVAL; \
130 goto error; \
131 } \
132 \
133 result = vendor_command(cyp, CY7C63_WRITE_PORT, write_id, \
134 (unsigned char)value); \
135 \
136 dev_dbg(&cyp->udev->dev, "Result of vendor_command: %d\n\n",result); \
137error: \
138 return result < 0 ? result : count; \
139} \
140 \
141static ssize_t get_port##num(struct device *dev, \
142 struct device_attribute *attr, char *buf) { \
143 \
144 int result = 0; \
145 \
146 struct usb_interface *intf = to_usb_interface(dev); \
147 struct cy7c63 *cyp = usb_get_intfdata(intf); \
148 \
149 dev_dbg(&cyp->udev->dev, "READ_PORT%d called\n", num); \
150 \
151 result = vendor_command(cyp, CY7C63_READ_PORT, read_id, 0); \
152 \
153 dev_dbg(&cyp->udev->dev, "Result of vendor_command: %d\n\n", result); \
154 \
155 return sprintf(buf, "%d", cyp->port##num); \
156} \
157static DEVICE_ATTR(port##num, S_IWUGO | S_IRUGO, get_port##num, set_port##num);
158
159get_set_port(0, CY7C63_READ_PORT_ID0, CY7C63_WRITE_PORT_ID0);
160get_set_port(1, CY7C63_READ_PORT_ID1, CY7C63_WRITE_PORT_ID1);
161
162static int cy7c63_probe(struct usb_interface *interface,
163 const struct usb_device_id *id) {
164
165 struct cy7c63 *dev = NULL;
166 int retval = -ENOMEM;
167
168 /* allocate memory for our device state and initialize it */
169 dev = kzalloc(sizeof(*dev), GFP_KERNEL);
170 if (dev == NULL) {
171 dev_err(&dev->udev->dev, "Out of memory!\n");
172 goto error;
173 }
174
175 dev->udev = usb_get_dev(interface_to_usbdev(interface));
176
177 /* save our data pointer in this interface device */
178 usb_set_intfdata(interface, dev);
179
180 /* create device attribute files */
181 device_create_file(&interface->dev, &dev_attr_port0);
182 device_create_file(&interface->dev, &dev_attr_port1);
183
184 /* let the user know what node this device is now attached to */
185 dev_info(&interface->dev,
186 "Cypress CY7C63xxx device now attached\n");
187
188 retval = 0;
189error:
190 return retval;
191}
192
193static void cy7c63_disconnect(struct usb_interface *interface) {
194
195 struct cy7c63 *dev;
196
197 dev = usb_get_intfdata(interface);
198 usb_set_intfdata(interface, NULL);
199
200 /* remove device attribute files */
201 device_remove_file(&interface->dev, &dev_attr_port0);
202 device_remove_file(&interface->dev, &dev_attr_port1);
203
204 usb_put_dev(dev->udev);
205
206 dev_info(&interface->dev,
207 "Cypress CY7C63xxx device now disconnected\n");
208
209 kfree(dev);
210}
211
212static struct usb_driver cy7c63_driver = {
213 .name = "cy7c63",
214 .probe = cy7c63_probe,
215 .disconnect = cy7c63_disconnect,
216 .id_table = cy7c63_table,
217};
218
219static int __init cy7c63_init(void) {
220
221 int result;
222
223 /* register this driver with the USB subsystem */
224 result = usb_register(&cy7c63_driver);
225 if (result) {
226 err("Function usb_register failed! Error number: %d\n", result);
227 }
228
229 return result;
230}
231
232static void __exit cy7c63_exit(void) {
233
234 /* deregister this driver with the USB subsystem */
235 usb_deregister(&cy7c63_driver);
236}
237
238module_init(cy7c63_init);
239module_exit(cy7c63_exit);
240
241MODULE_AUTHOR(DRIVER_AUTHOR);
242MODULE_DESCRIPTION(DRIVER_DESC);
243
244MODULE_LICENSE("GPL");
diff --git a/drivers/usb/misc/cypress_cy7c63.c b/drivers/usb/misc/cypress_cy7c63.c
new file mode 100644
index 000000000000..a4062a6adbb8
--- /dev/null
+++ b/drivers/usb/misc/cypress_cy7c63.c
@@ -0,0 +1,284 @@
1/*
2* cypress_cy7c63.c
3*
4* Copyright (c) 2006 Oliver Bock (o.bock@fh-wolfenbuettel.de)
5*
6* This driver is based on the Cypress USB Driver by Marcus Maul
7* (cyport) and the 2.0 version of Greg Kroah-Hartman's
8* USB Skeleton driver.
9*
10* This is a generic driver for the Cypress CY7C63xxx family.
11* For the time being it enables you to read from and write to
12* the single I/O ports of the device.
13*
14* Supported vendors: AK Modul-Bus Computer GmbH
15* (Firmware "Port-Chip")
16*
17* Supported devices: CY7C63001A-PC
18* CY7C63001C-PXC
19* CY7C63001C-SXC
20*
21* Supported functions: Read/Write Ports
22*
23*
24* This program is free software; you can redistribute it and/or
25* modify it under the terms of the GNU General Public License as
26* published by the Free Software Foundation, version 2.
27*/
28
29#include <linux/init.h>
30#include <linux/module.h>
31#include <linux/kernel.h>
32#include <linux/usb.h>
33
34#define DRIVER_AUTHOR "Oliver Bock (o.bock@fh-wolfenbuettel.de)"
35#define DRIVER_DESC "Cypress CY7C63xxx USB driver"
36
37#define CYPRESS_VENDOR_ID 0xa2c
38#define CYPRESS_PRODUCT_ID 0x8
39
40#define CYPRESS_READ_PORT 0x4
41#define CYPRESS_WRITE_PORT 0x5
42
43#define CYPRESS_READ_RAM 0x2
44#define CYPRESS_WRITE_RAM 0x3
45#define CYPRESS_READ_ROM 0x1
46
47#define CYPRESS_READ_PORT_ID0 0
48#define CYPRESS_WRITE_PORT_ID0 0
49#define CYPRESS_READ_PORT_ID1 0x2
50#define CYPRESS_WRITE_PORT_ID1 1
51
52#define CYPRESS_MAX_REQSIZE 8
53
54
55/* table of devices that work with this driver */
56static struct usb_device_id cypress_table [] = {
57 { USB_DEVICE(CYPRESS_VENDOR_ID, CYPRESS_PRODUCT_ID) },
58 { }
59};
60MODULE_DEVICE_TABLE(usb, cypress_table);
61
62/* structure to hold all of our device specific stuff */
63struct cypress {
64 struct usb_device * udev;
65 unsigned char port[2];
66};
67
68/* used to send usb control messages to device */
69static int vendor_command(struct cypress *dev, unsigned char request,
70 unsigned char address, unsigned char data)
71{
72 int retval = 0;
73 unsigned int pipe;
74 unsigned char *iobuf;
75
76 /* allocate some memory for the i/o buffer*/
77 iobuf = kzalloc(CYPRESS_MAX_REQSIZE, GFP_KERNEL);
78 if (!iobuf) {
79 dev_err(&dev->udev->dev, "Out of memory!\n");
80 retval = -ENOMEM;
81 goto error;
82 }
83
84 dev_dbg(&dev->udev->dev, "Sending usb_control_msg (data: %d)\n", data);
85
86 /* prepare usb control message and send it upstream */
87 pipe = usb_rcvctrlpipe(dev->udev, 0);
88 retval = usb_control_msg(dev->udev, pipe, request,
89 USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_OTHER,
90 address, data, iobuf, CYPRESS_MAX_REQSIZE,
91 USB_CTRL_GET_TIMEOUT);
92
93 /* store returned data (more READs to be added) */
94 switch (request) {
95 case CYPRESS_READ_PORT:
96 if (address == CYPRESS_READ_PORT_ID0) {
97 dev->port[0] = iobuf[1];
98 dev_dbg(&dev->udev->dev,
99 "READ_PORT0 returned: %d\n",
100 dev->port[0]);
101 }
102 else if (address == CYPRESS_READ_PORT_ID1) {
103 dev->port[1] = iobuf[1];
104 dev_dbg(&dev->udev->dev,
105 "READ_PORT1 returned: %d\n",
106 dev->port[1]);
107 }
108 break;
109 }
110
111 kfree(iobuf);
112error:
113 return retval;
114}
115
116/* write port value */
117static ssize_t write_port(struct device *dev, struct device_attribute *attr,
118 const char *buf, size_t count,
119 int port_num, int write_id)
120{
121 int value = -1;
122 int result = 0;
123
124 struct usb_interface *intf = to_usb_interface(dev);
125 struct cypress *cyp = usb_get_intfdata(intf);
126
127 dev_dbg(&cyp->udev->dev, "WRITE_PORT%d called\n", port_num);
128
129 /* validate input data */
130 if (sscanf(buf, "%d", &value) < 1) {
131 result = -EINVAL;
132 goto error;
133 }
134 if (value < 0 || value > 255) {
135 result = -EINVAL;
136 goto error;
137 }
138
139 result = vendor_command(cyp, CYPRESS_WRITE_PORT, write_id,
140 (unsigned char)value);
141
142 dev_dbg(&cyp->udev->dev, "Result of vendor_command: %d\n\n", result);
143error:
144 return result < 0 ? result : count;
145}
146
147/* attribute callback handler (write) */
148static ssize_t set_port0_handler(struct device *dev,
149 struct device_attribute *attr,
150 const char *buf, size_t count)
151{
152 return write_port(dev, attr, buf, count, 0, CYPRESS_WRITE_PORT_ID0);
153}
154
155/* attribute callback handler (write) */
156static ssize_t set_port1_handler(struct device *dev,
157 struct device_attribute *attr,
158 const char *buf, size_t count)
159{
160 return write_port(dev, attr, buf, count, 1, CYPRESS_WRITE_PORT_ID1);
161}
162
163/* read port value */
164static ssize_t read_port(struct device *dev, struct device_attribute *attr,
165 char *buf, int port_num, int read_id)
166{
167 int result = 0;
168
169 struct usb_interface *intf = to_usb_interface(dev);
170 struct cypress *cyp = usb_get_intfdata(intf);
171
172 dev_dbg(&cyp->udev->dev, "READ_PORT%d called\n", port_num);
173
174 result = vendor_command(cyp, CYPRESS_READ_PORT, read_id, 0);
175
176 dev_dbg(&cyp->udev->dev, "Result of vendor_command: %d\n\n", result);
177
178 return sprintf(buf, "%d", cyp->port[port_num]);
179}
180
181/* attribute callback handler (read) */
182static ssize_t get_port0_handler(struct device *dev,
183 struct device_attribute *attr, char *buf)
184{
185 return read_port(dev, attr, buf, 0, CYPRESS_READ_PORT_ID0);
186}
187
188/* attribute callback handler (read) */
189static ssize_t get_port1_handler(struct device *dev,
190 struct device_attribute *attr, char *buf)
191{
192 return read_port(dev, attr, buf, 1, CYPRESS_READ_PORT_ID1);
193}
194
195static DEVICE_ATTR(port0, S_IWUGO | S_IRUGO,
196 get_port0_handler, set_port0_handler);
197
198static DEVICE_ATTR(port1, S_IWUGO | S_IRUGO,
199 get_port1_handler, set_port1_handler);
200
201
202static int cypress_probe(struct usb_interface *interface,
203 const struct usb_device_id *id)
204{
205 struct cypress *dev = NULL;
206 int retval = -ENOMEM;
207
208 /* allocate memory for our device state and initialize it */
209 dev = kzalloc(sizeof(*dev), GFP_KERNEL);
210 if (dev == NULL) {
211 dev_err(&dev->udev->dev, "Out of memory!\n");
212 goto error;
213 }
214
215 dev->udev = usb_get_dev(interface_to_usbdev(interface));
216
217 /* save our data pointer in this interface device */
218 usb_set_intfdata(interface, dev);
219
220 /* create device attribute files */
221 device_create_file(&interface->dev, &dev_attr_port0);
222 device_create_file(&interface->dev, &dev_attr_port1);
223
224 /* let the user know that the device is now attached */
225 dev_info(&interface->dev,
226 "Cypress CY7C63xxx device now attached\n");
227
228 retval = 0;
229error:
230 return retval;
231}
232
233static void cypress_disconnect(struct usb_interface *interface)
234{
235 struct cypress *dev;
236
237 dev = usb_get_intfdata(interface);
238 usb_set_intfdata(interface, NULL);
239
240 /* remove device attribute files */
241 device_remove_file(&interface->dev, &dev_attr_port0);
242 device_remove_file(&interface->dev, &dev_attr_port1);
243
244 usb_put_dev(dev->udev);
245
246 dev_info(&interface->dev,
247 "Cypress CY7C63xxx device now disconnected\n");
248
249 kfree(dev);
250}
251
252static struct usb_driver cypress_driver = {
253 .name = "cypress_cy7c63",
254 .probe = cypress_probe,
255 .disconnect = cypress_disconnect,
256 .id_table = cypress_table,
257};
258
259static int __init cypress_init(void)
260{
261 int result;
262
263 /* register this driver with the USB subsystem */
264 result = usb_register(&cypress_driver);
265 if (result) {
266 err("Function usb_register failed! Error number: %d\n", result);
267 }
268
269 return result;
270}
271
272static void __exit cypress_exit(void)
273{
274 /* deregister this driver with the USB subsystem */
275 usb_deregister(&cypress_driver);
276}
277
278module_init(cypress_init);
279module_exit(cypress_exit);
280
281MODULE_AUTHOR(DRIVER_AUTHOR);
282MODULE_DESCRIPTION(DRIVER_DESC);
283
284MODULE_LICENSE("GPL");
diff --git a/drivers/usb/misc/usblcd.c b/drivers/usb/misc/usblcd.c
index c82c402285a0..e095772dd8e9 100644
--- a/drivers/usb/misc/usblcd.c
+++ b/drivers/usb/misc/usblcd.c
@@ -200,10 +200,8 @@ static ssize_t lcd_write(struct file *file, const char __user * user_buffer, siz
200 200
201 /* create a urb, and a buffer for it, and copy the data to the urb */ 201 /* create a urb, and a buffer for it, and copy the data to the urb */
202 urb = usb_alloc_urb(0, GFP_KERNEL); 202 urb = usb_alloc_urb(0, GFP_KERNEL);
203 if (!urb) { 203 if (!urb)
204 retval = -ENOMEM; 204 return -ENOMEM;
205 goto error;
206 }
207 205
208 buf = usb_buffer_alloc(dev->udev, count, GFP_KERNEL, &urb->transfer_dma); 206 buf = usb_buffer_alloc(dev->udev, count, GFP_KERNEL, &urb->transfer_dma);
209 if (!buf) { 207 if (!buf) {
diff --git a/drivers/usb/mon/mon_text.c b/drivers/usb/mon/mon_text.c
index e02c1a30c4cd..f961a770cee2 100644
--- a/drivers/usb/mon/mon_text.c
+++ b/drivers/usb/mon/mon_text.c
@@ -64,7 +64,6 @@ struct mon_reader_text {
64}; 64};
65 65
66static void mon_text_ctor(void *, kmem_cache_t *, unsigned long); 66static void mon_text_ctor(void *, kmem_cache_t *, unsigned long);
67static void mon_text_dtor(void *, kmem_cache_t *, unsigned long);
68 67
69/* 68/*
70 * mon_text_submit 69 * mon_text_submit
@@ -268,7 +267,7 @@ static int mon_text_open(struct inode *inode, struct file *file)
268 (long)rp); 267 (long)rp);
269 rp->e_slab = kmem_cache_create(rp->slab_name, 268 rp->e_slab = kmem_cache_create(rp->slab_name,
270 sizeof(struct mon_event_text), sizeof(long), 0, 269 sizeof(struct mon_event_text), sizeof(long), 0,
271 mon_text_ctor, mon_text_dtor); 270 mon_text_ctor, NULL);
272 if (rp->e_slab == NULL) { 271 if (rp->e_slab == NULL) {
273 rc = -ENOMEM; 272 rc = -ENOMEM;
274 goto err_slab; 273 goto err_slab;
@@ -459,7 +458,3 @@ static void mon_text_ctor(void *mem, kmem_cache_t *slab, unsigned long sflags)
459 memset(mem, 0xe5, sizeof(struct mon_event_text)); 458 memset(mem, 0xe5, sizeof(struct mon_event_text));
460} 459}
461 460
462static void mon_text_dtor(void *mem, kmem_cache_t *slab, unsigned long sflags)
463{
464 ;
465}
diff --git a/drivers/usb/net/rtl8150.c b/drivers/usb/net/rtl8150.c
index 718f8e2b552b..bd09232ce13c 100644
--- a/drivers/usb/net/rtl8150.c
+++ b/drivers/usb/net/rtl8150.c
@@ -128,11 +128,13 @@
128#define VENDOR_ID_MELCO 0x0411 128#define VENDOR_ID_MELCO 0x0411
129#define VENDOR_ID_MICRONET 0x3980 129#define VENDOR_ID_MICRONET 0x3980
130#define VENDOR_ID_LONGSHINE 0x07b8 130#define VENDOR_ID_LONGSHINE 0x07b8
131#define VENDOR_ID_ZYXEL 0x0586
131 132
132#define PRODUCT_ID_RTL8150 0x8150 133#define PRODUCT_ID_RTL8150 0x8150
133#define PRODUCT_ID_LUAKTX 0x0012 134#define PRODUCT_ID_LUAKTX 0x0012
134#define PRODUCT_ID_LCS8138TX 0x401a 135#define PRODUCT_ID_LCS8138TX 0x401a
135#define PRODUCT_ID_SP128AR 0x0003 136#define PRODUCT_ID_SP128AR 0x0003
137#define PRODUCT_ID_PRESTIGE 0x401a
136 138
137#undef EEPROM_WRITE 139#undef EEPROM_WRITE
138 140
@@ -142,6 +144,7 @@ static struct usb_device_id rtl8150_table[] = {
142 {USB_DEVICE(VENDOR_ID_MELCO, PRODUCT_ID_LUAKTX)}, 144 {USB_DEVICE(VENDOR_ID_MELCO, PRODUCT_ID_LUAKTX)},
143 {USB_DEVICE(VENDOR_ID_MICRONET, PRODUCT_ID_SP128AR)}, 145 {USB_DEVICE(VENDOR_ID_MICRONET, PRODUCT_ID_SP128AR)},
144 {USB_DEVICE(VENDOR_ID_LONGSHINE, PRODUCT_ID_LCS8138TX)}, 146 {USB_DEVICE(VENDOR_ID_LONGSHINE, PRODUCT_ID_LCS8138TX)},
147 {USB_DEVICE(VENDOR_ID_ZYXEL, PRODUCT_ID_PRESTIGE)},
145 {} 148 {}
146}; 149};
147 150
@@ -172,6 +175,8 @@ static inline struct sk_buff *pull_skb(rtl8150_t *);
172static void rtl8150_disconnect(struct usb_interface *intf); 175static void rtl8150_disconnect(struct usb_interface *intf);
173static int rtl8150_probe(struct usb_interface *intf, 176static int rtl8150_probe(struct usb_interface *intf,
174 const struct usb_device_id *id); 177 const struct usb_device_id *id);
178static int rtl8150_suspend(struct usb_interface *intf, pm_message_t message);
179static int rtl8150_resume(struct usb_interface *intf);
175 180
176static const char driver_name [] = "rtl8150"; 181static const char driver_name [] = "rtl8150";
177 182
@@ -180,6 +185,8 @@ static struct usb_driver rtl8150_driver = {
180 .probe = rtl8150_probe, 185 .probe = rtl8150_probe,
181 .disconnect = rtl8150_disconnect, 186 .disconnect = rtl8150_disconnect,
182 .id_table = rtl8150_table, 187 .id_table = rtl8150_table,
188 .suspend = rtl8150_suspend,
189 .resume = rtl8150_resume
183}; 190};
184 191
185/* 192/*
@@ -235,9 +242,11 @@ static int async_set_registers(rtl8150_t * dev, u16 indx, u16 size)
235 usb_fill_control_urb(dev->ctrl_urb, dev->udev, 242 usb_fill_control_urb(dev->ctrl_urb, dev->udev,
236 usb_sndctrlpipe(dev->udev, 0), (char *) &dev->dr, 243 usb_sndctrlpipe(dev->udev, 0), (char *) &dev->dr,
237 &dev->rx_creg, size, ctrl_callback, dev); 244 &dev->rx_creg, size, ctrl_callback, dev);
238 if ((ret = usb_submit_urb(dev->ctrl_urb, GFP_ATOMIC))) 245 if ((ret = usb_submit_urb(dev->ctrl_urb, GFP_ATOMIC))) {
246 if (ret == -ENODEV)
247 netif_device_detach(dev->netdev);
239 err("control request submission failed: %d", ret); 248 err("control request submission failed: %d", ret);
240 else 249 } else
241 set_bit(RX_REG_SET, &dev->flags); 250 set_bit(RX_REG_SET, &dev->flags);
242 251
243 return ret; 252 return ret;
@@ -413,6 +422,7 @@ static void read_bulk_callback(struct urb *urb, struct pt_regs *regs)
413 struct sk_buff *skb; 422 struct sk_buff *skb;
414 struct net_device *netdev; 423 struct net_device *netdev;
415 u16 rx_stat; 424 u16 rx_stat;
425 int status;
416 426
417 dev = urb->context; 427 dev = urb->context;
418 if (!dev) 428 if (!dev)
@@ -462,7 +472,10 @@ static void read_bulk_callback(struct urb *urb, struct pt_regs *regs)
462goon: 472goon:
463 usb_fill_bulk_urb(dev->rx_urb, dev->udev, usb_rcvbulkpipe(dev->udev, 1), 473 usb_fill_bulk_urb(dev->rx_urb, dev->udev, usb_rcvbulkpipe(dev->udev, 1),
464 dev->rx_skb->data, RTL8150_MTU, read_bulk_callback, dev); 474 dev->rx_skb->data, RTL8150_MTU, read_bulk_callback, dev);
465 if (usb_submit_urb(dev->rx_urb, GFP_ATOMIC)) { 475 status = usb_submit_urb(dev->rx_urb, GFP_ATOMIC);
476 if (status == -ENODEV)
477 netif_device_detach(dev->netdev);
478 else if (status) {
466 set_bit(RX_URB_FAIL, &dev->flags); 479 set_bit(RX_URB_FAIL, &dev->flags);
467 goto resched; 480 goto resched;
468 } else { 481 } else {
@@ -478,6 +491,7 @@ static void rx_fixup(unsigned long data)
478{ 491{
479 rtl8150_t *dev; 492 rtl8150_t *dev;
480 struct sk_buff *skb; 493 struct sk_buff *skb;
494 int status;
481 495
482 dev = (rtl8150_t *)data; 496 dev = (rtl8150_t *)data;
483 497
@@ -496,10 +510,13 @@ static void rx_fixup(unsigned long data)
496 usb_fill_bulk_urb(dev->rx_urb, dev->udev, usb_rcvbulkpipe(dev->udev, 1), 510 usb_fill_bulk_urb(dev->rx_urb, dev->udev, usb_rcvbulkpipe(dev->udev, 1),
497 dev->rx_skb->data, RTL8150_MTU, read_bulk_callback, dev); 511 dev->rx_skb->data, RTL8150_MTU, read_bulk_callback, dev);
498try_again: 512try_again:
499 if (usb_submit_urb(dev->rx_urb, GFP_ATOMIC)) { 513 status = usb_submit_urb(dev->rx_urb, GFP_ATOMIC);
514 if (status == -ENODEV) {
515 netif_device_detach(dev->netdev);
516 } else if (status) {
500 set_bit(RX_URB_FAIL, &dev->flags); 517 set_bit(RX_URB_FAIL, &dev->flags);
501 goto tlsched; 518 goto tlsched;
502 } else { 519 } else {
503 clear_bit(RX_URB_FAIL, &dev->flags); 520 clear_bit(RX_URB_FAIL, &dev->flags);
504 } 521 }
505 522
@@ -571,12 +588,43 @@ static void intr_callback(struct urb *urb, struct pt_regs *regs)
571 588
572resubmit: 589resubmit:
573 status = usb_submit_urb (urb, SLAB_ATOMIC); 590 status = usb_submit_urb (urb, SLAB_ATOMIC);
574 if (status) 591 if (status == -ENODEV)
592 netif_device_detach(dev->netdev);
593 else if (status)
575 err ("can't resubmit intr, %s-%s/input0, status %d", 594 err ("can't resubmit intr, %s-%s/input0, status %d",
576 dev->udev->bus->bus_name, 595 dev->udev->bus->bus_name,
577 dev->udev->devpath, status); 596 dev->udev->devpath, status);
578} 597}
579 598
599static int rtl8150_suspend(struct usb_interface *intf, pm_message_t message)
600{
601 rtl8150_t *dev = usb_get_intfdata(intf);
602
603 netif_device_detach(dev->netdev);
604
605 if (netif_running(dev->netdev)) {
606 usb_kill_urb(dev->rx_urb);
607 usb_kill_urb(dev->intr_urb);
608 }
609 return 0;
610}
611
612static int rtl8150_resume(struct usb_interface *intf)
613{
614 rtl8150_t *dev = usb_get_intfdata(intf);
615
616 netif_device_attach(dev->netdev);
617 if (netif_running(dev->netdev)) {
618 dev->rx_urb->status = 0;
619 dev->rx_urb->actual_length = 0;
620 read_bulk_callback(dev->rx_urb, NULL);
621
622 dev->intr_urb->status = 0;
623 dev->intr_urb->actual_length = 0;
624 intr_callback(dev->intr_urb, NULL);
625 }
626 return 0;
627}
580 628
581/* 629/*
582** 630**
@@ -687,9 +735,14 @@ static int rtl8150_start_xmit(struct sk_buff *skb, struct net_device *netdev)
687 usb_fill_bulk_urb(dev->tx_urb, dev->udev, usb_sndbulkpipe(dev->udev, 2), 735 usb_fill_bulk_urb(dev->tx_urb, dev->udev, usb_sndbulkpipe(dev->udev, 2),
688 skb->data, count, write_bulk_callback, dev); 736 skb->data, count, write_bulk_callback, dev);
689 if ((res = usb_submit_urb(dev->tx_urb, GFP_ATOMIC))) { 737 if ((res = usb_submit_urb(dev->tx_urb, GFP_ATOMIC))) {
690 warn("failed tx_urb %d\n", res); 738 /* Can we get/handle EPIPE here? */
691 dev->stats.tx_errors++; 739 if (res == -ENODEV)
692 netif_start_queue(netdev); 740 netif_device_detach(dev->netdev);
741 else {
742 warn("failed tx_urb %d\n", res);
743 dev->stats.tx_errors++;
744 netif_start_queue(netdev);
745 }
693 } else { 746 } else {
694 dev->stats.tx_packets++; 747 dev->stats.tx_packets++;
695 dev->stats.tx_bytes += skb->len; 748 dev->stats.tx_bytes += skb->len;
@@ -726,16 +779,25 @@ static int rtl8150_open(struct net_device *netdev)
726 779
727 usb_fill_bulk_urb(dev->rx_urb, dev->udev, usb_rcvbulkpipe(dev->udev, 1), 780 usb_fill_bulk_urb(dev->rx_urb, dev->udev, usb_rcvbulkpipe(dev->udev, 1),
728 dev->rx_skb->data, RTL8150_MTU, read_bulk_callback, dev); 781 dev->rx_skb->data, RTL8150_MTU, read_bulk_callback, dev);
729 if ((res = usb_submit_urb(dev->rx_urb, GFP_KERNEL))) 782 if ((res = usb_submit_urb(dev->rx_urb, GFP_KERNEL))) {
783 if (res == -ENODEV)
784 netif_device_detach(dev->netdev);
730 warn("%s: rx_urb submit failed: %d", __FUNCTION__, res); 785 warn("%s: rx_urb submit failed: %d", __FUNCTION__, res);
786 return res;
787 }
731 usb_fill_int_urb(dev->intr_urb, dev->udev, usb_rcvintpipe(dev->udev, 3), 788 usb_fill_int_urb(dev->intr_urb, dev->udev, usb_rcvintpipe(dev->udev, 3),
732 dev->intr_buff, INTBUFSIZE, intr_callback, 789 dev->intr_buff, INTBUFSIZE, intr_callback,
733 dev, dev->intr_interval); 790 dev, dev->intr_interval);
734 if ((res = usb_submit_urb(dev->intr_urb, GFP_KERNEL))) 791 if ((res = usb_submit_urb(dev->intr_urb, GFP_KERNEL))) {
792 if (res == -ENODEV)
793 netif_device_detach(dev->netdev);
735 warn("%s: intr_urb submit failed: %d", __FUNCTION__, res); 794 warn("%s: intr_urb submit failed: %d", __FUNCTION__, res);
736 netif_start_queue(netdev); 795 usb_kill_urb(dev->rx_urb);
796 return res;
797 }
737 enable_net_traffic(dev); 798 enable_net_traffic(dev);
738 set_carrier(netdev); 799 set_carrier(netdev);
800 netif_start_queue(netdev);
739 801
740 return res; 802 return res;
741} 803}
diff --git a/drivers/usb/serial/Kconfig b/drivers/usb/serial/Kconfig
index 8bd44fda5eaf..f5b9438c94f0 100644
--- a/drivers/usb/serial/Kconfig
+++ b/drivers/usb/serial/Kconfig
@@ -62,15 +62,6 @@ config USB_SERIAL_AIRPRIME
62 To compile this driver as a module, choose M here: the 62 To compile this driver as a module, choose M here: the
63 module will be called airprime. 63 module will be called airprime.
64 64
65config USB_SERIAL_ANYDATA
66 tristate "USB AnyData CDMA Wireless Driver"
67 depends on USB_SERIAL
68 help
69 Say Y here if you want to use a AnyData CDMA device.
70
71 To compile this driver as a module, choose M here: the
72 module will be called anydata.
73
74config USB_SERIAL_ARK3116 65config USB_SERIAL_ARK3116
75 tristate "USB ARK Micro 3116 USB Serial Driver (EXPERIMENTAL)" 66 tristate "USB ARK Micro 3116 USB Serial Driver (EXPERIMENTAL)"
76 depends on USB_SERIAL && EXPERIMENTAL 67 depends on USB_SERIAL && EXPERIMENTAL
@@ -456,6 +447,17 @@ config USB_SERIAL_SAFE_PADDED
456 bool "USB Secure Encapsulated Driver - Padded" 447 bool "USB Secure Encapsulated Driver - Padded"
457 depends on USB_SERIAL_SAFE 448 depends on USB_SERIAL_SAFE
458 449
450config USB_SERIAL_SIERRAWIRELESS
451 tristate "USB Sierra Wireless Driver"
452 depends on USB_SERIAL
453 help
454 Say M here if you want to use a Sierra Wireless device (if
455 using an PC 5220 or AC580 please use the Airprime driver
456 instead).
457
458 To compile this driver as a module, choose M here: the
459 module will be called sierra.
460
459config USB_SERIAL_TI 461config USB_SERIAL_TI
460 tristate "USB TI 3410/5052 Serial Driver" 462 tristate "USB TI 3410/5052 Serial Driver"
461 depends on USB_SERIAL 463 depends on USB_SERIAL
@@ -491,15 +493,18 @@ config USB_SERIAL_XIRCOM
491 module will be called keyspan_pda. 493 module will be called keyspan_pda.
492 494
493config USB_SERIAL_OPTION 495config USB_SERIAL_OPTION
494 tristate "USB driver for GSM modems" 496 tristate "USB driver for GSM and CDMA modems"
495 depends on USB_SERIAL 497 depends on USB_SERIAL
496 help 498 help
497 Say Y here if you have an "Option" GSM PCMCIA card 499 Say Y here if you have a GSM or CDMA modem that's connected to USB.
498 (or an OEM version: branded Huawei, Audiovox, or Novatel). 500
501 This driver also supports several PCMCIA cards which have a
502 built-in OHCI-USB adapter and an internally-connected GSM modem.
503 The USB bus on these cards is not accessible externally.
499 504
500 These cards feature a built-in OHCI-USB adapter and an 505 Supported devices include (some of?) those made by:
501 internally-connected GSM modem. The USB bus is not 506 Option, Huawei, Audiovox, Sierra Wireless, Novatel Wireless, or
502 accessible externally. 507 Anydata.
503 508
504 To compile this driver as a module, choose M here: the 509 To compile this driver as a module, choose M here: the
505 module will be called option. 510 module will be called option.
diff --git a/drivers/usb/serial/Makefile b/drivers/usb/serial/Makefile
index 5a0960fc9d3e..8efed2ce1ba3 100644
--- a/drivers/usb/serial/Makefile
+++ b/drivers/usb/serial/Makefile
@@ -12,7 +12,6 @@ usbserial-obj-$(CONFIG_USB_EZUSB) += ezusb.o
12usbserial-objs := usb-serial.o generic.o bus.o $(usbserial-obj-y) 12usbserial-objs := usb-serial.o generic.o bus.o $(usbserial-obj-y)
13 13
14obj-$(CONFIG_USB_SERIAL_AIRPRIME) += airprime.o 14obj-$(CONFIG_USB_SERIAL_AIRPRIME) += airprime.o
15obj-$(CONFIG_USB_SERIAL_ANYDATA) += anydata.o
16obj-$(CONFIG_USB_SERIAL_ARK3116) += ark3116.o 15obj-$(CONFIG_USB_SERIAL_ARK3116) += ark3116.o
17obj-$(CONFIG_USB_SERIAL_BELKIN) += belkin_sa.o 16obj-$(CONFIG_USB_SERIAL_BELKIN) += belkin_sa.o
18obj-$(CONFIG_USB_SERIAL_CP2101) += cp2101.o 17obj-$(CONFIG_USB_SERIAL_CP2101) += cp2101.o
@@ -39,6 +38,7 @@ obj-$(CONFIG_USB_SERIAL_OMNINET) += omninet.o
39obj-$(CONFIG_USB_SERIAL_OPTION) += option.o 38obj-$(CONFIG_USB_SERIAL_OPTION) += option.o
40obj-$(CONFIG_USB_SERIAL_PL2303) += pl2303.o 39obj-$(CONFIG_USB_SERIAL_PL2303) += pl2303.o
41obj-$(CONFIG_USB_SERIAL_SAFE) += safe_serial.o 40obj-$(CONFIG_USB_SERIAL_SAFE) += safe_serial.o
41obj-$(CONFIG_USB_SERIAL_SIERRAWIRELESS) += sierra.o
42obj-$(CONFIG_USB_SERIAL_TI) += ti_usb_3410_5052.o 42obj-$(CONFIG_USB_SERIAL_TI) += ti_usb_3410_5052.o
43obj-$(CONFIG_USB_SERIAL_VISOR) += visor.o 43obj-$(CONFIG_USB_SERIAL_VISOR) += visor.o
44obj-$(CONFIG_USB_SERIAL_WHITEHEAT) += whiteheat.o 44obj-$(CONFIG_USB_SERIAL_WHITEHEAT) += whiteheat.o
diff --git a/drivers/usb/serial/airprime.c b/drivers/usb/serial/airprime.c
index 94b9ba0ff875..62082532a8b3 100644
--- a/drivers/usb/serial/airprime.c
+++ b/drivers/usb/serial/airprime.c
@@ -13,7 +13,7 @@
13#include <linux/tty.h> 13#include <linux/tty.h>
14#include <linux/module.h> 14#include <linux/module.h>
15#include <linux/usb.h> 15#include <linux/usb.h>
16#include "usb-serial.h" 16#include <linux/usb/serial.h>
17 17
18static struct usb_device_id id_table [] = { 18static struct usb_device_id id_table [] = {
19 { USB_DEVICE(0x0c88, 0x17da) }, /* Kyocera Wireless KPC650/Passport */ 19 { USB_DEVICE(0x0c88, 0x17da) }, /* Kyocera Wireless KPC650/Passport */
diff --git a/drivers/usb/serial/anydata.c b/drivers/usb/serial/anydata.c
deleted file mode 100644
index 343f6f228220..000000000000
--- a/drivers/usb/serial/anydata.c
+++ /dev/null
@@ -1,123 +0,0 @@
1/*
2 * AnyData CDMA Serial USB driver
3 *
4 * Copyright (C) 2005 Greg Kroah-Hartman <gregkh@suse.de>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License version
8 * 2 as published by the Free Software Foundation.
9 */
10
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/tty.h>
14#include <linux/module.h>
15#include <linux/usb.h>
16#include "usb-serial.h"
17
18static struct usb_device_id id_table [] = {
19 { USB_DEVICE(0x16d5, 0x6501) }, /* AirData CDMA device */
20 { },
21};
22MODULE_DEVICE_TABLE(usb, id_table);
23
24/* if overridden by the user, then use their value for the size of the
25 * read and write urbs */
26static int buffer_size;
27static int debug;
28
29static struct usb_driver anydata_driver = {
30 .name = "anydata",
31 .probe = usb_serial_probe,
32 .disconnect = usb_serial_disconnect,
33 .id_table = id_table,
34 .no_dynamic_id = 1,
35};
36
37static int anydata_open(struct usb_serial_port *port, struct file *filp)
38{
39 char *buffer;
40 int result = 0;
41
42 dbg("%s - port %d", __FUNCTION__, port->number);
43
44 if (buffer_size) {
45 /* override the default buffer sizes */
46 buffer = kmalloc(buffer_size, GFP_KERNEL);
47 if (!buffer) {
48 dev_err(&port->dev, "%s - out of memory.\n",
49 __FUNCTION__);
50 return -ENOMEM;
51 }
52 kfree (port->read_urb->transfer_buffer);
53 port->read_urb->transfer_buffer = buffer;
54 port->read_urb->transfer_buffer_length = buffer_size;
55
56 buffer = kmalloc(buffer_size, GFP_KERNEL);
57 if (!buffer) {
58 dev_err(&port->dev, "%s - out of memory.\n",
59 __FUNCTION__);
60 return -ENOMEM;
61 }
62 kfree (port->write_urb->transfer_buffer);
63 port->write_urb->transfer_buffer = buffer;
64 port->write_urb->transfer_buffer_length = buffer_size;
65 port->bulk_out_size = buffer_size;
66 }
67
68 /* Start reading from the device */
69 usb_fill_bulk_urb(port->read_urb, port->serial->dev,
70 usb_rcvbulkpipe(port->serial->dev,
71 port->bulk_in_endpointAddress),
72 port->read_urb->transfer_buffer,
73 port->read_urb->transfer_buffer_length,
74 usb_serial_generic_write_bulk_callback, port);
75 result = usb_submit_urb(port->read_urb, GFP_KERNEL);
76 if (result)
77 dev_err(&port->dev,
78 "%s - failed submitting read urb, error %d\n",
79 __FUNCTION__, result);
80
81 return result;
82}
83
84static struct usb_serial_driver anydata_device = {
85 .driver = {
86 .owner = THIS_MODULE,
87 .name = "anydata",
88 },
89 .id_table = id_table,
90 .num_interrupt_in = NUM_DONT_CARE,
91 .num_bulk_in = NUM_DONT_CARE,
92 .num_bulk_out = NUM_DONT_CARE,
93 .num_ports = 1,
94 .open = anydata_open,
95};
96
97static int __init anydata_init(void)
98{
99 int retval;
100
101 retval = usb_serial_register(&anydata_device);
102 if (retval)
103 return retval;
104 retval = usb_register(&anydata_driver);
105 if (retval)
106 usb_serial_deregister(&anydata_device);
107 return retval;
108}
109
110static void __exit anydata_exit(void)
111{
112 usb_deregister(&anydata_driver);
113 usb_serial_deregister(&anydata_device);
114}
115
116module_init(anydata_init);
117module_exit(anydata_exit);
118MODULE_LICENSE("GPL");
119
120module_param(debug, bool, S_IRUGO | S_IWUSR);
121MODULE_PARM_DESC(debug, "Debug enabled or not");
122module_param(buffer_size, int, 0);
123MODULE_PARM_DESC(buffer_size, "Size of the transfer buffers");
diff --git a/drivers/usb/serial/ark3116.c b/drivers/usb/serial/ark3116.c
index 8dec796222a0..970d9ef0a7a5 100644
--- a/drivers/usb/serial/ark3116.c
+++ b/drivers/usb/serial/ark3116.c
@@ -21,7 +21,7 @@
21#include <linux/tty.h> 21#include <linux/tty.h>
22#include <linux/module.h> 22#include <linux/module.h>
23#include <linux/usb.h> 23#include <linux/usb.h>
24#include "usb-serial.h" 24#include <linux/usb/serial.h>
25 25
26 26
27static int debug; 27static int debug;
diff --git a/drivers/usb/serial/belkin_sa.c b/drivers/usb/serial/belkin_sa.c
index 3faa7aa0111a..70ece9e01ce4 100644
--- a/drivers/usb/serial/belkin_sa.c
+++ b/drivers/usb/serial/belkin_sa.c
@@ -74,7 +74,7 @@
74#include <linux/spinlock.h> 74#include <linux/spinlock.h>
75#include <asm/uaccess.h> 75#include <asm/uaccess.h>
76#include <linux/usb.h> 76#include <linux/usb.h>
77#include "usb-serial.h" 77#include <linux/usb/serial.h>
78#include "belkin_sa.h" 78#include "belkin_sa.h"
79 79
80static int debug; 80static int debug;
diff --git a/drivers/usb/serial/bus.c b/drivers/usb/serial/bus.c
index f2d993b70c18..6542f220468f 100644
--- a/drivers/usb/serial/bus.c
+++ b/drivers/usb/serial/bus.c
@@ -13,7 +13,7 @@
13#include <linux/tty.h> 13#include <linux/tty.h>
14#include <linux/module.h> 14#include <linux/module.h>
15#include <linux/usb.h> 15#include <linux/usb.h>
16#include "usb-serial.h" 16#include <linux/usb/serial.h>
17 17
18static int usb_serial_device_match (struct device *dev, struct device_driver *drv) 18static int usb_serial_device_match (struct device *dev, struct device_driver *drv)
19{ 19{
diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c
index 3d456b32c316..3a9073dbfe6a 100644
--- a/drivers/usb/serial/console.c
+++ b/drivers/usb/serial/console.c
@@ -17,11 +17,10 @@
17#include <linux/tty.h> 17#include <linux/tty.h>
18#include <linux/console.h> 18#include <linux/console.h>
19#include <linux/usb.h> 19#include <linux/usb.h>
20#include <linux/usb/serial.h>
20 21
21static int debug; 22static int debug;
22 23
23#include "usb-serial.h"
24
25struct usbcons_info { 24struct usbcons_info {
26 int magic; 25 int magic;
27 int break_flag; 26 int break_flag;
diff --git a/drivers/usb/serial/cp2101.c b/drivers/usb/serial/cp2101.c
index df0a4f98b4ae..486c7411b9a7 100644
--- a/drivers/usb/serial/cp2101.c
+++ b/drivers/usb/serial/cp2101.c
@@ -26,7 +26,7 @@
26#include <linux/moduleparam.h> 26#include <linux/moduleparam.h>
27#include <linux/usb.h> 27#include <linux/usb.h>
28#include <asm/uaccess.h> 28#include <asm/uaccess.h>
29#include "usb-serial.h" 29#include <linux/usb/serial.h>
30 30
31/* 31/*
32 * Version Information 32 * Version Information
diff --git a/drivers/usb/serial/cyberjack.c b/drivers/usb/serial/cyberjack.c
index 49b51ab0d4cb..6286aba86fae 100644
--- a/drivers/usb/serial/cyberjack.c
+++ b/drivers/usb/serial/cyberjack.c
@@ -39,7 +39,7 @@
39#include <linux/spinlock.h> 39#include <linux/spinlock.h>
40#include <asm/uaccess.h> 40#include <asm/uaccess.h>
41#include <linux/usb.h> 41#include <linux/usb.h>
42#include "usb-serial.h" 42#include <linux/usb/serial.h>
43 43
44#define CYBERJACK_LOCAL_BUF_SIZE 32 44#define CYBERJACK_LOCAL_BUF_SIZE 32
45 45
diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c
index 4ff2dfb299bd..ee70fddcab60 100644
--- a/drivers/usb/serial/cypress_m8.c
+++ b/drivers/usb/serial/cypress_m8.c
@@ -59,11 +59,11 @@
59#include <linux/moduleparam.h> 59#include <linux/moduleparam.h>
60#include <linux/spinlock.h> 60#include <linux/spinlock.h>
61#include <linux/usb.h> 61#include <linux/usb.h>
62#include <linux/usb/serial.h>
62#include <linux/serial.h> 63#include <linux/serial.h>
63#include <linux/delay.h> 64#include <linux/delay.h>
64#include <asm/uaccess.h> 65#include <asm/uaccess.h>
65 66
66#include "usb-serial.h"
67#include "cypress_m8.h" 67#include "cypress_m8.h"
68 68
69 69
diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c
index 6953d3ef5738..9b225183fc7a 100644
--- a/drivers/usb/serial/digi_acceleport.c
+++ b/drivers/usb/serial/digi_acceleport.c
@@ -246,7 +246,7 @@
246#include <asm/uaccess.h> 246#include <asm/uaccess.h>
247#include <linux/usb.h> 247#include <linux/usb.h>
248#include <linux/wait.h> 248#include <linux/wait.h>
249#include "usb-serial.h" 249#include <linux/usb/serial.h>
250 250
251/* Defines */ 251/* Defines */
252 252
diff --git a/drivers/usb/serial/empeg.c b/drivers/usb/serial/empeg.c
index 1e2b31eeb497..daafe405d86d 100644
--- a/drivers/usb/serial/empeg.c
+++ b/drivers/usb/serial/empeg.c
@@ -62,7 +62,7 @@
62#include <linux/spinlock.h> 62#include <linux/spinlock.h>
63#include <asm/uaccess.h> 63#include <asm/uaccess.h>
64#include <linux/usb.h> 64#include <linux/usb.h>
65#include "usb-serial.h" 65#include <linux/usb/serial.h>
66 66
67static int debug; 67static int debug;
68 68
diff --git a/drivers/usb/serial/ezusb.c b/drivers/usb/serial/ezusb.c
index debc3b0f9662..5169c2d154ab 100644
--- a/drivers/usb/serial/ezusb.c
+++ b/drivers/usb/serial/ezusb.c
@@ -15,7 +15,7 @@
15#include <linux/tty.h> 15#include <linux/tty.h>
16#include <linux/module.h> 16#include <linux/module.h>
17#include <linux/usb.h> 17#include <linux/usb.h>
18#include "usb-serial.h" 18#include <linux/usb/serial.h>
19 19
20/* EZ-USB Control and Status Register. Bit 0 controls 8051 reset */ 20/* EZ-USB Control and Status Register. Bit 0 controls 8051 reset */
21#define CPUCS_REG 0x7F92 21#define CPUCS_REG 0x7F92
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 8a74b19f1283..a20da8528a5f 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -257,7 +257,7 @@
257#include <asm/uaccess.h> 257#include <asm/uaccess.h>
258#include <linux/usb.h> 258#include <linux/usb.h>
259#include <linux/serial.h> 259#include <linux/serial.h>
260#include "usb-serial.h" 260#include <linux/usb/serial.h>
261#include "ftdi_sio.h" 261#include "ftdi_sio.h"
262 262
263/* 263/*
@@ -313,6 +313,7 @@ static struct usb_device_id id_table_combined [] = {
313 { USB_DEVICE(FTDI_VID, FTDI_8U232AM_PID) }, 313 { USB_DEVICE(FTDI_VID, FTDI_8U232AM_PID) },
314 { USB_DEVICE(FTDI_VID, FTDI_8U232AM_ALT_PID) }, 314 { USB_DEVICE(FTDI_VID, FTDI_8U232AM_ALT_PID) },
315 { USB_DEVICE(FTDI_VID, FTDI_8U2232C_PID) }, 315 { USB_DEVICE(FTDI_VID, FTDI_8U2232C_PID) },
316 { USB_DEVICE(FTDI_VID, FTDI_MICRO_CHAMELEON_PID) },
316 { USB_DEVICE(FTDI_VID, FTDI_RELAIS_PID) }, 317 { USB_DEVICE(FTDI_VID, FTDI_RELAIS_PID) },
317 { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) }, 318 { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) },
318 { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) }, 319 { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) },
@@ -336,6 +337,7 @@ static struct usb_device_id id_table_combined [] = {
336 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_6_PID) }, 337 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_6_PID) },
337 { USB_DEVICE(FTDI_VID, FTDI_PERLE_ULTRAPORT_PID) }, 338 { USB_DEVICE(FTDI_VID, FTDI_PERLE_ULTRAPORT_PID) },
338 { USB_DEVICE(FTDI_VID, FTDI_PIEGROUP_PID) }, 339 { USB_DEVICE(FTDI_VID, FTDI_PIEGROUP_PID) },
340 { USB_DEVICE(FTDI_VID, FTDI_TNC_X_PID) },
339 { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2101_PID) }, 341 { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2101_PID) },
340 { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2102_PID) }, 342 { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2102_PID) },
341 { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2103_PID) }, 343 { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2103_PID) },
@@ -500,6 +502,8 @@ static struct usb_device_id id_table_combined [] = {
500 { USB_DEVICE(PAPOUCH_VID, PAPOUCH_TMU_PID) }, 502 { USB_DEVICE(PAPOUCH_VID, PAPOUCH_TMU_PID) },
501 { USB_DEVICE(FTDI_VID, FTDI_ACG_HFDUAL_PID) }, 503 { USB_DEVICE(FTDI_VID, FTDI_ACG_HFDUAL_PID) },
502 { USB_DEVICE(FTDI_VID, FTDI_YEI_SERVOCENTER31_PID) }, 504 { USB_DEVICE(FTDI_VID, FTDI_YEI_SERVOCENTER31_PID) },
505 { USB_DEVICE(FTDI_VID, FTDI_THORLABS_PID) },
506 { USB_DEVICE(TESTO_VID, TESTO_USB_INTERFACE_PID) },
503 { }, /* Optional parameter entry */ 507 { }, /* Optional parameter entry */
504 { } /* Terminating entry */ 508 { } /* Terminating entry */
505}; 509};
@@ -548,11 +552,17 @@ struct ftdi_private {
548 spinlock_t rx_lock; /* spinlock for receive state */ 552 spinlock_t rx_lock; /* spinlock for receive state */
549 struct work_struct rx_work; 553 struct work_struct rx_work;
550 int rx_processed; 554 int rx_processed;
555 unsigned long rx_bytes;
551 556
552 __u16 interface; /* FT2232C port interface (0 for FT232/245) */ 557 __u16 interface; /* FT2232C port interface (0 for FT232/245) */
553 558
554 int force_baud; /* if non-zero, force the baud rate to this value */ 559 int force_baud; /* if non-zero, force the baud rate to this value */
555 int force_rtscts; /* if non-zero, force RTS-CTS to always be enabled */ 560 int force_rtscts; /* if non-zero, force RTS-CTS to always be enabled */
561
562 spinlock_t tx_lock; /* spinlock for transmit state */
563 unsigned long tx_bytes;
564 unsigned long tx_outstanding_bytes;
565 unsigned long tx_outstanding_urbs;
556}; 566};
557 567
558/* Used for TIOCMIWAIT */ 568/* Used for TIOCMIWAIT */
@@ -626,6 +636,9 @@ static struct usb_serial_driver ftdi_sio_device = {
626#define HIGH 1 636#define HIGH 1
627#define LOW 0 637#define LOW 0
628 638
639/* number of outstanding urbs to prevent userspace DoS from happening */
640#define URB_UPPER_LIMIT 42
641
629/* 642/*
630 * *************************************************************************** 643 * ***************************************************************************
631 * Utlity functions 644 * Utlity functions
@@ -1156,6 +1169,7 @@ static int ftdi_sio_attach (struct usb_serial *serial)
1156 } 1169 }
1157 1170
1158 spin_lock_init(&priv->rx_lock); 1171 spin_lock_init(&priv->rx_lock);
1172 spin_lock_init(&priv->tx_lock);
1159 init_waitqueue_head(&priv->delta_msr_wait); 1173 init_waitqueue_head(&priv->delta_msr_wait);
1160 /* This will push the characters through immediately rather 1174 /* This will push the characters through immediately rather
1161 than queue a task to deliver them */ 1175 than queue a task to deliver them */
@@ -1270,6 +1284,13 @@ static int ftdi_open (struct usb_serial_port *port, struct file *filp)
1270 1284
1271 dbg("%s", __FUNCTION__); 1285 dbg("%s", __FUNCTION__);
1272 1286
1287 spin_lock_irqsave(&priv->tx_lock, flags);
1288 priv->tx_bytes = 0;
1289 spin_unlock_irqrestore(&priv->tx_lock, flags);
1290 spin_lock_irqsave(&priv->rx_lock, flags);
1291 priv->rx_bytes = 0;
1292 spin_unlock_irqrestore(&priv->rx_lock, flags);
1293
1273 if (port->tty) 1294 if (port->tty)
1274 port->tty->low_latency = (priv->flags & ASYNC_LOW_LATENCY) ? 1 : 0; 1295 port->tty->low_latency = (priv->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
1275 1296
@@ -1372,6 +1393,7 @@ static int ftdi_write (struct usb_serial_port *port,
1372 int data_offset ; /* will be 1 for the SIO and 0 otherwise */ 1393 int data_offset ; /* will be 1 for the SIO and 0 otherwise */
1373 int status; 1394 int status;
1374 int transfer_size; 1395 int transfer_size;
1396 unsigned long flags;
1375 1397
1376 dbg("%s port %d, %d bytes", __FUNCTION__, port->number, count); 1398 dbg("%s port %d, %d bytes", __FUNCTION__, port->number, count);
1377 1399
@@ -1379,6 +1401,13 @@ static int ftdi_write (struct usb_serial_port *port,
1379 dbg("write request of 0 bytes"); 1401 dbg("write request of 0 bytes");
1380 return 0; 1402 return 0;
1381 } 1403 }
1404 spin_lock_irqsave(&priv->tx_lock, flags);
1405 if (priv->tx_outstanding_urbs > URB_UPPER_LIMIT) {
1406 spin_unlock_irqrestore(&priv->tx_lock, flags);
1407 dbg("%s - write limit hit\n", __FUNCTION__);
1408 return 0;
1409 }
1410 spin_unlock_irqrestore(&priv->tx_lock, flags);
1382 1411
1383 data_offset = priv->write_offset; 1412 data_offset = priv->write_offset;
1384 dbg("data_offset set to %d",data_offset); 1413 dbg("data_offset set to %d",data_offset);
@@ -1445,6 +1474,12 @@ static int ftdi_write (struct usb_serial_port *port,
1445 err("%s - failed submitting write urb, error %d", __FUNCTION__, status); 1474 err("%s - failed submitting write urb, error %d", __FUNCTION__, status);
1446 count = status; 1475 count = status;
1447 kfree (buffer); 1476 kfree (buffer);
1477 } else {
1478 spin_lock_irqsave(&priv->tx_lock, flags);
1479 ++priv->tx_outstanding_urbs;
1480 priv->tx_outstanding_bytes += count;
1481 priv->tx_bytes += count;
1482 spin_unlock_irqrestore(&priv->tx_lock, flags);
1448 } 1483 }
1449 1484
1450 /* we are done with this urb, so let the host driver 1485 /* we are done with this urb, so let the host driver
@@ -1460,7 +1495,11 @@ static int ftdi_write (struct usb_serial_port *port,
1460 1495
1461static void ftdi_write_bulk_callback (struct urb *urb, struct pt_regs *regs) 1496static void ftdi_write_bulk_callback (struct urb *urb, struct pt_regs *regs)
1462{ 1497{
1498 unsigned long flags;
1463 struct usb_serial_port *port = (struct usb_serial_port *)urb->context; 1499 struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
1500 struct ftdi_private *priv;
1501 int data_offset; /* will be 1 for the SIO and 0 otherwise */
1502 unsigned long countback;
1464 1503
1465 /* free up the transfer buffer, as usb_free_urb() does not do this */ 1504 /* free up the transfer buffer, as usb_free_urb() does not do this */
1466 kfree (urb->transfer_buffer); 1505 kfree (urb->transfer_buffer);
@@ -1472,34 +1511,67 @@ static void ftdi_write_bulk_callback (struct urb *urb, struct pt_regs *regs)
1472 return; 1511 return;
1473 } 1512 }
1474 1513
1514 priv = usb_get_serial_port_data(port);
1515 if (!priv) {
1516 dbg("%s - bad port private data pointer - exiting", __FUNCTION__);
1517 return;
1518 }
1519 /* account for transferred data */
1520 countback = urb->actual_length;
1521 data_offset = priv->write_offset;
1522 if (data_offset > 0) {
1523 /* Subtract the control bytes */
1524 countback -= (data_offset * ((countback + (PKTSZ - 1)) / PKTSZ));
1525 }
1526 spin_lock_irqsave(&priv->tx_lock, flags);
1527 --priv->tx_outstanding_urbs;
1528 priv->tx_outstanding_bytes -= countback;
1529 spin_unlock_irqrestore(&priv->tx_lock, flags);
1530
1475 usb_serial_port_softint(port); 1531 usb_serial_port_softint(port);
1476} /* ftdi_write_bulk_callback */ 1532} /* ftdi_write_bulk_callback */
1477 1533
1478 1534
1479static int ftdi_write_room( struct usb_serial_port *port ) 1535static int ftdi_write_room( struct usb_serial_port *port )
1480{ 1536{
1537 struct ftdi_private *priv = usb_get_serial_port_data(port);
1538 int room;
1539 unsigned long flags;
1540
1481 dbg("%s - port %d", __FUNCTION__, port->number); 1541 dbg("%s - port %d", __FUNCTION__, port->number);
1482 1542
1483 /* 1543 spin_lock_irqsave(&priv->tx_lock, flags);
1484 * We really can take anything the user throws at us 1544 if (priv->tx_outstanding_urbs < URB_UPPER_LIMIT) {
1485 * but let's pick a nice big number to tell the tty 1545 /*
1486 * layer that we have lots of free space 1546 * We really can take anything the user throws at us
1487 */ 1547 * but let's pick a nice big number to tell the tty
1488 return 2048; 1548 * layer that we have lots of free space
1549 */
1550 room = 2048;
1551 } else {
1552 room = 0;
1553 }
1554 spin_unlock_irqrestore(&priv->tx_lock, flags);
1555 return room;
1489} /* ftdi_write_room */ 1556} /* ftdi_write_room */
1490 1557
1491 1558
1492static int ftdi_chars_in_buffer (struct usb_serial_port *port) 1559static int ftdi_chars_in_buffer (struct usb_serial_port *port)
1493{ /* ftdi_chars_in_buffer */ 1560{ /* ftdi_chars_in_buffer */
1561 struct ftdi_private *priv = usb_get_serial_port_data(port);
1562 int buffered;
1563 unsigned long flags;
1564
1494 dbg("%s - port %d", __FUNCTION__, port->number); 1565 dbg("%s - port %d", __FUNCTION__, port->number);
1495 1566
1496 /* 1567 spin_lock_irqsave(&priv->tx_lock, flags);
1497 * We can't really account for how much data we 1568 buffered = (int)priv->tx_outstanding_bytes;
1498 * have sent out, but hasn't made it through to the 1569 spin_unlock_irqrestore(&priv->tx_lock, flags);
1499 * device, so just tell the tty layer that everything 1570 if (buffered < 0) {
1500 * is flushed. 1571 err("%s outstanding tx bytes is negative!", __FUNCTION__);
1501 */ 1572 buffered = 0;
1502 return 0; 1573 }
1574 return buffered;
1503} /* ftdi_chars_in_buffer */ 1575} /* ftdi_chars_in_buffer */
1504 1576
1505 1577
@@ -1509,6 +1581,8 @@ static void ftdi_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
1509 struct usb_serial_port *port = (struct usb_serial_port *)urb->context; 1581 struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
1510 struct tty_struct *tty; 1582 struct tty_struct *tty;
1511 struct ftdi_private *priv; 1583 struct ftdi_private *priv;
1584 unsigned long countread;
1585 unsigned long flags;
1512 1586
1513 if (urb->number_of_packets > 0) { 1587 if (urb->number_of_packets > 0) {
1514 err("%s transfer_buffer_length %d actual_length %d number of packets %d",__FUNCTION__, 1588 err("%s transfer_buffer_length %d actual_length %d number of packets %d",__FUNCTION__,
@@ -1543,6 +1617,13 @@ static void ftdi_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
1543 return; 1617 return;
1544 } 1618 }
1545 1619
1620 /* count data bytes, but not status bytes */
1621 countread = urb->actual_length;
1622 countread -= 2 * ((countread + (PKTSZ - 1)) / PKTSZ);
1623 spin_lock_irqsave(&priv->rx_lock, flags);
1624 priv->rx_bytes += countread;
1625 spin_unlock_irqrestore(&priv->rx_lock, flags);
1626
1546 ftdi_process_read(port); 1627 ftdi_process_read(port);
1547 1628
1548} /* ftdi_read_bulk_callback */ 1629} /* ftdi_read_bulk_callback */
diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h
index 6ab2ac845bd7..9f7343a45424 100644
--- a/drivers/usb/serial/ftdi_sio.h
+++ b/drivers/usb/serial/ftdi_sio.h
@@ -36,6 +36,9 @@
36#define FTDI_ACTZWAVE_PID 0xF2D0 36#define FTDI_ACTZWAVE_PID 0xF2D0
37 37
38 38
39/* www.starting-point-systems.com µChameleon device */
40#define FTDI_MICRO_CHAMELEON_PID 0xCAA0 /* Product Id */
41
39/* www.irtrans.de device */ 42/* www.irtrans.de device */
40#define FTDI_IRTRANS_PID 0xFC60 /* Product Id */ 43#define FTDI_IRTRANS_PID 0xFC60 /* Product Id */
41 44
@@ -179,6 +182,10 @@
179/* http://home.earthlink.net/~jrhees/USBUIRT/index.htm */ 182/* http://home.earthlink.net/~jrhees/USBUIRT/index.htm */
180#define FTDI_USB_UIRT_PID 0xF850 /* Product Id */ 183#define FTDI_USB_UIRT_PID 0xF850 /* Product Id */
181 184
185/* TNC-X USB-to-packet-radio adapter, versions prior to 3.0 (DLP module) */
186
187#define FTDI_TNC_X_PID 0xEBE0
188
182/* 189/*
183 * ELV USB devices submitted by Christian Abt of ELV (www.elv.de). 190 * ELV USB devices submitted by Christian Abt of ELV (www.elv.de).
184 * All of these devices use FTDI's vendor ID (0x0403). 191 * All of these devices use FTDI's vendor ID (0x0403).
@@ -442,6 +449,18 @@
442 */ 449 */
443#define FTDI_YEI_SERVOCENTER31_PID 0xE050 /* YEI ServoCenter3.1 USB */ 450#define FTDI_YEI_SERVOCENTER31_PID 0xE050 /* YEI ServoCenter3.1 USB */
444 451
452/*
453 * ThorLabs USB motor drivers
454 */
455#define FTDI_THORLABS_PID 0xfaf0 /* ThorLabs USB motor drivers */
456
457/*
458 * Testo products (http://www.testo.com/)
459 * Submitted by Colin Leroy
460 */
461#define TESTO_VID 0x128D
462#define TESTO_USB_INTERFACE_PID 0x0001
463
445/* Commands */ 464/* Commands */
446#define FTDI_SIO_RESET 0 /* Reset the port */ 465#define FTDI_SIO_RESET 0 /* Reset the port */
447#define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */ 466#define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */
diff --git a/drivers/usb/serial/funsoft.c b/drivers/usb/serial/funsoft.c
index 803721b97e2e..77b977206a8c 100644
--- a/drivers/usb/serial/funsoft.c
+++ b/drivers/usb/serial/funsoft.c
@@ -13,7 +13,7 @@
13#include <linux/tty.h> 13#include <linux/tty.h>
14#include <linux/module.h> 14#include <linux/module.h>
15#include <linux/usb.h> 15#include <linux/usb.h>
16#include "usb-serial.h" 16#include <linux/usb/serial.h>
17 17
18static struct usb_device_id id_table [] = { 18static struct usb_device_id id_table [] = {
19 { USB_DEVICE(0x1404, 0xcddc) }, 19 { USB_DEVICE(0x1404, 0xcddc) },
diff --git a/drivers/usb/serial/garmin_gps.c b/drivers/usb/serial/garmin_gps.c
index 1f5d1620baa1..727852634be9 100644
--- a/drivers/usb/serial/garmin_gps.c
+++ b/drivers/usb/serial/garmin_gps.c
@@ -35,6 +35,7 @@
35#include <linux/spinlock.h> 35#include <linux/spinlock.h>
36#include <asm/uaccess.h> 36#include <asm/uaccess.h>
37#include <linux/usb.h> 37#include <linux/usb.h>
38#include <linux/usb/serial.h>
38 39
39/* the mode to be set when the port ist opened */ 40/* the mode to be set when the port ist opened */
40static int initial_mode = 1; 41static int initial_mode = 1;
@@ -42,8 +43,6 @@ static int initial_mode = 1;
42/* debug flag */ 43/* debug flag */
43static int debug = 0; 44static int debug = 0;
44 45
45#include "usb-serial.h"
46
47#define GARMIN_VENDOR_ID 0x091E 46#define GARMIN_VENDOR_ID 0x091E
48 47
49/* 48/*
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
index 945b8bb38c92..172713556393 100644
--- a/drivers/usb/serial/generic.c
+++ b/drivers/usb/serial/generic.c
@@ -17,8 +17,8 @@
17#include <linux/module.h> 17#include <linux/module.h>
18#include <linux/moduleparam.h> 18#include <linux/moduleparam.h>
19#include <linux/usb.h> 19#include <linux/usb.h>
20#include <linux/usb/serial.h>
20#include <asm/uaccess.h> 21#include <asm/uaccess.h>
21#include "usb-serial.h"
22 22
23static int debug; 23static int debug;
24 24
@@ -285,6 +285,7 @@ void usb_serial_generic_read_bulk_callback (struct urb *urb, struct pt_regs *reg
285 if (result) 285 if (result)
286 dev_err(&port->dev, "%s - failed resubmitting read urb, error %d\n", __FUNCTION__, result); 286 dev_err(&port->dev, "%s - failed resubmitting read urb, error %d\n", __FUNCTION__, result);
287} 287}
288EXPORT_SYMBOL_GPL(usb_serial_generic_read_bulk_callback);
288 289
289void usb_serial_generic_write_bulk_callback (struct urb *urb, struct pt_regs *regs) 290void usb_serial_generic_write_bulk_callback (struct urb *urb, struct pt_regs *regs)
290{ 291{
diff --git a/drivers/usb/serial/hp4x.c b/drivers/usb/serial/hp4x.c
index 7e06358b0310..ebcac701b069 100644
--- a/drivers/usb/serial/hp4x.c
+++ b/drivers/usb/serial/hp4x.c
@@ -17,7 +17,7 @@
17#include <linux/tty.h> 17#include <linux/tty.h>
18#include <linux/module.h> 18#include <linux/module.h>
19#include <linux/usb.h> 19#include <linux/usb.h>
20#include "usb-serial.h" 20#include <linux/usb/serial.h>
21 21
22/* 22/*
23 * Version Information 23 * Version Information
diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c
index bd2c05dac2a9..c49976c3ad52 100644
--- a/drivers/usb/serial/io_edgeport.c
+++ b/drivers/usb/serial/io_edgeport.c
@@ -44,7 +44,7 @@
44#include <linux/wait.h> 44#include <linux/wait.h>
45#include <asm/uaccess.h> 45#include <asm/uaccess.h>
46#include <linux/usb.h> 46#include <linux/usb.h>
47#include "usb-serial.h" 47#include <linux/usb/serial.h>
48#include "io_edgeport.h" 48#include "io_edgeport.h"
49#include "io_ionsp.h" /* info for the iosp messages */ 49#include "io_ionsp.h" /* info for the iosp messages */
50#include "io_16654.h" /* 16654 UART defines */ 50#include "io_16654.h" /* 16654 UART defines */
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c
index 723a12ae87b5..17c5b1d2311a 100644
--- a/drivers/usb/serial/io_ti.c
+++ b/drivers/usb/serial/io_ti.c
@@ -39,8 +39,8 @@
39#include <asm/uaccess.h> 39#include <asm/uaccess.h>
40#include <asm/semaphore.h> 40#include <asm/semaphore.h>
41#include <linux/usb.h> 41#include <linux/usb.h>
42#include <linux/usb/serial.h>
42 43
43#include "usb-serial.h"
44#include "io_16654.h" 44#include "io_16654.h"
45#include "io_usbvend.h" 45#include "io_usbvend.h"
46#include "io_ti.h" 46#include "io_ti.h"
diff --git a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c
index dbcfe172a5cc..7e1bd5d6dfa0 100644
--- a/drivers/usb/serial/ipaq.c
+++ b/drivers/usb/serial/ipaq.c
@@ -55,7 +55,7 @@
55#include <linux/spinlock.h> 55#include <linux/spinlock.h>
56#include <asm/uaccess.h> 56#include <asm/uaccess.h>
57#include <linux/usb.h> 57#include <linux/usb.h>
58#include "usb-serial.h" 58#include <linux/usb/serial.h>
59#include "ipaq.h" 59#include "ipaq.h"
60 60
61#define KP_RETRIES 100 61#define KP_RETRIES 100
@@ -70,6 +70,8 @@
70 70
71static __u16 product, vendor; 71static __u16 product, vendor;
72static int debug; 72static int debug;
73static int connect_retries = KP_RETRIES;
74static int initial_wait;
73 75
74/* Function prototypes for an ipaq */ 76/* Function prototypes for an ipaq */
75static int ipaq_open (struct usb_serial_port *port, struct file *filp); 77static int ipaq_open (struct usb_serial_port *port, struct file *filp);
@@ -248,6 +250,7 @@ static struct usb_device_id ipaq_id_table [] = {
248 { USB_DEVICE(0x04C5, 0x1058) }, /* FUJITSU USB Sync */ 250 { USB_DEVICE(0x04C5, 0x1058) }, /* FUJITSU USB Sync */
249 { USB_DEVICE(0x04C5, 0x1079) }, /* FUJITSU USB Sync */ 251 { USB_DEVICE(0x04C5, 0x1079) }, /* FUJITSU USB Sync */
250 { USB_DEVICE(0x04DA, 0x2500) }, /* Panasonic USB Sync */ 252 { USB_DEVICE(0x04DA, 0x2500) }, /* Panasonic USB Sync */
253 { USB_DEVICE(0x04DD, 0x9102) }, /* SHARP WS003SH USB Modem */
251 { USB_DEVICE(0x04E8, 0x5F00) }, /* Samsung NEXiO USB Sync */ 254 { USB_DEVICE(0x04E8, 0x5F00) }, /* Samsung NEXiO USB Sync */
252 { USB_DEVICE(0x04E8, 0x5F01) }, /* Samsung NEXiO USB Sync */ 255 { USB_DEVICE(0x04E8, 0x5F01) }, /* Samsung NEXiO USB Sync */
253 { USB_DEVICE(0x04E8, 0x5F02) }, /* Samsung NEXiO USB Sync */ 256 { USB_DEVICE(0x04E8, 0x5F02) }, /* Samsung NEXiO USB Sync */
@@ -582,7 +585,7 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp)
582 struct ipaq_private *priv; 585 struct ipaq_private *priv;
583 struct ipaq_packet *pkt; 586 struct ipaq_packet *pkt;
584 int i, result = 0; 587 int i, result = 0;
585 int retries = KP_RETRIES; 588 int retries = connect_retries;
586 589
587 dbg("%s - port %d", __FUNCTION__, port->number); 590 dbg("%s - port %d", __FUNCTION__, port->number);
588 591
@@ -646,16 +649,12 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp)
646 port->read_urb->transfer_buffer_length = URBDATA_SIZE; 649 port->read_urb->transfer_buffer_length = URBDATA_SIZE;
647 port->bulk_out_size = port->write_urb->transfer_buffer_length = URBDATA_SIZE; 650 port->bulk_out_size = port->write_urb->transfer_buffer_length = URBDATA_SIZE;
648 651
652 msleep(1000*initial_wait);
649 /* Start reading from the device */ 653 /* Start reading from the device */
650 usb_fill_bulk_urb(port->read_urb, serial->dev, 654 usb_fill_bulk_urb(port->read_urb, serial->dev,
651 usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress), 655 usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress),
652 port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length, 656 port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length,
653 ipaq_read_bulk_callback, port); 657 ipaq_read_bulk_callback, port);
654 result = usb_submit_urb(port->read_urb, GFP_KERNEL);
655 if (result) {
656 err("%s - failed submitting read urb, error %d", __FUNCTION__, result);
657 goto error;
658 }
659 658
660 /* 659 /*
661 * Send out control message observed in win98 sniffs. Not sure what 660 * Send out control message observed in win98 sniffs. Not sure what
@@ -670,8 +669,14 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp)
670 usb_sndctrlpipe(serial->dev, 0), 0x22, 0x21, 669 usb_sndctrlpipe(serial->dev, 0), 0x22, 0x21,
671 0x1, 0, NULL, 0, 100); 670 0x1, 0, NULL, 0, 100);
672 if (result == 0) { 671 if (result == 0) {
672 result = usb_submit_urb(port->read_urb, GFP_KERNEL);
673 if (result) {
674 err("%s - failed submitting read urb, error %d", __FUNCTION__, result);
675 goto error;
676 }
673 return 0; 677 return 0;
674 } 678 }
679 msleep(1000);
675 } 680 }
676 err("%s - failed doing control urb, error %d", __FUNCTION__, result); 681 err("%s - failed doing control urb, error %d", __FUNCTION__, result);
677 goto error; 682 goto error;
@@ -854,6 +859,7 @@ static void ipaq_write_bulk_callback(struct urb *urb, struct pt_regs *regs)
854 859
855 if (urb->status) { 860 if (urb->status) {
856 dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status); 861 dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status);
862 return;
857 } 863 }
858 864
859 spin_lock_irqsave(&write_list_lock, flags); 865 spin_lock_irqsave(&write_list_lock, flags);
@@ -966,3 +972,9 @@ MODULE_PARM_DESC(vendor, "User specified USB idVendor");
966 972
967module_param(product, ushort, 0); 973module_param(product, ushort, 0);
968MODULE_PARM_DESC(product, "User specified USB idProduct"); 974MODULE_PARM_DESC(product, "User specified USB idProduct");
975
976module_param(connect_retries, int, S_IRUGO|S_IWUSR);
977MODULE_PARM_DESC(connect_retries, "Maximum number of connect retries (one second each)");
978
979module_param(initial_wait, int, S_IRUGO|S_IWUSR);
980MODULE_PARM_DESC(initial_wait, "Time to wait before attempting a connection (in seconds)");
diff --git a/drivers/usb/serial/ipw.c b/drivers/usb/serial/ipw.c
index a4a0bfeaab00..87306cb6f9f5 100644
--- a/drivers/usb/serial/ipw.c
+++ b/drivers/usb/serial/ipw.c
@@ -46,8 +46,8 @@
46#include <linux/module.h> 46#include <linux/module.h>
47#include <linux/spinlock.h> 47#include <linux/spinlock.h>
48#include <linux/usb.h> 48#include <linux/usb.h>
49#include <linux/usb/serial.h>
49#include <asm/uaccess.h> 50#include <asm/uaccess.h>
50#include "usb-serial.h"
51 51
52/* 52/*
53 * Version Information 53 * Version Information
@@ -373,6 +373,8 @@ static void ipw_write_bulk_callback(struct urb *urb, struct pt_regs *regs)
373 373
374 dbg("%s", __FUNCTION__); 374 dbg("%s", __FUNCTION__);
375 375
376 port->write_urb_busy = 0;
377
376 if (urb->status) 378 if (urb->status)
377 dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status); 379 dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status);
378 380
diff --git a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c
index 2cf1fed3de43..1738b0b6a376 100644
--- a/drivers/usb/serial/ir-usb.c
+++ b/drivers/usb/serial/ir-usb.c
@@ -57,7 +57,7 @@
57#include <linux/spinlock.h> 57#include <linux/spinlock.h>
58#include <asm/uaccess.h> 58#include <asm/uaccess.h>
59#include <linux/usb.h> 59#include <linux/usb.h>
60#include "usb-serial.h" 60#include <linux/usb/serial.h>
61 61
62/* 62/*
63 * Version Information 63 * Version Information
diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c
index d7c58f1bc960..015ad6cc1bbb 100644
--- a/drivers/usb/serial/keyspan.c
+++ b/drivers/usb/serial/keyspan.c
@@ -107,7 +107,7 @@
107#include <linux/spinlock.h> 107#include <linux/spinlock.h>
108#include <asm/uaccess.h> 108#include <asm/uaccess.h>
109#include <linux/usb.h> 109#include <linux/usb.h>
110#include "usb-serial.h" 110#include <linux/usb/serial.h>
111#include "keyspan.h" 111#include "keyspan.h"
112 112
113static int debug; 113static int debug;
diff --git a/drivers/usb/serial/keyspan_pda.c b/drivers/usb/serial/keyspan_pda.c
index 03ab3c0f3cce..49b8dc039d1f 100644
--- a/drivers/usb/serial/keyspan_pda.c
+++ b/drivers/usb/serial/keyspan_pda.c
@@ -78,6 +78,7 @@
78#include <linux/workqueue.h> 78#include <linux/workqueue.h>
79#include <asm/uaccess.h> 79#include <asm/uaccess.h>
80#include <linux/usb.h> 80#include <linux/usb.h>
81#include <linux/usb/serial.h>
81 82
82static int debug; 83static int debug;
83 84
@@ -107,8 +108,6 @@ struct ezusb_hex_record {
107#include "xircom_pgs_fw.h" 108#include "xircom_pgs_fw.h"
108#endif 109#endif
109 110
110#include "usb-serial.h"
111
112/* 111/*
113 * Version Information 112 * Version Information
114 */ 113 */
diff --git a/drivers/usb/serial/kl5kusb105.c b/drivers/usb/serial/kl5kusb105.c
index b45ff3e7ab40..2a2f3e2da055 100644
--- a/drivers/usb/serial/kl5kusb105.c
+++ b/drivers/usb/serial/kl5kusb105.c
@@ -55,7 +55,7 @@
55#include <linux/module.h> 55#include <linux/module.h>
56#include <asm/uaccess.h> 56#include <asm/uaccess.h>
57#include <linux/usb.h> 57#include <linux/usb.h>
58#include "usb-serial.h" 58#include <linux/usb/serial.h>
59#include "kl5kusb105.h" 59#include "kl5kusb105.h"
60 60
61static int debug; 61static int debug;
diff --git a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c
index 457733374772..d50dce034958 100644
--- a/drivers/usb/serial/kobil_sct.c
+++ b/drivers/usb/serial/kobil_sct.c
@@ -46,8 +46,8 @@
46#include <linux/spinlock.h> 46#include <linux/spinlock.h>
47#include <asm/uaccess.h> 47#include <asm/uaccess.h>
48#include <linux/usb.h> 48#include <linux/usb.h>
49#include <linux/usb/serial.h>
49#include <linux/ioctl.h> 50#include <linux/ioctl.h>
50#include "usb-serial.h"
51#include "kobil_sct.h" 51#include "kobil_sct.h"
52 52
53static int debug; 53static int debug;
diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c
index ca05d3275f3e..f4d4305c2c02 100644
--- a/drivers/usb/serial/mct_u232.c
+++ b/drivers/usb/serial/mct_u232.c
@@ -75,7 +75,7 @@
75#include <linux/spinlock.h> 75#include <linux/spinlock.h>
76#include <asm/uaccess.h> 76#include <asm/uaccess.h>
77#include <linux/usb.h> 77#include <linux/usb.h>
78#include "usb-serial.h" 78#include <linux/usb/serial.h>
79#include "mct_u232.h" 79#include "mct_u232.h"
80 80
81/* 81/*
diff --git a/drivers/usb/serial/navman.c b/drivers/usb/serial/navman.c
index 7f544081032e..ac3f8b5d2c49 100644
--- a/drivers/usb/serial/navman.c
+++ b/drivers/usb/serial/navman.c
@@ -14,7 +14,7 @@
14#include <linux/tty_flip.h> 14#include <linux/tty_flip.h>
15#include <linux/module.h> 15#include <linux/module.h>
16#include <linux/usb.h> 16#include <linux/usb.h>
17#include "usb-serial.h" 17#include <linux/usb/serial.h>
18 18
19static int debug; 19static int debug;
20 20
diff --git a/drivers/usb/serial/omninet.c b/drivers/usb/serial/omninet.c
index cfb711a21a45..e49f40913c27 100644
--- a/drivers/usb/serial/omninet.c
+++ b/drivers/usb/serial/omninet.c
@@ -46,7 +46,7 @@
46#include <linux/spinlock.h> 46#include <linux/spinlock.h>
47#include <asm/uaccess.h> 47#include <asm/uaccess.h>
48#include <linux/usb.h> 48#include <linux/usb.h>
49#include "usb-serial.h" 49#include <linux/usb/serial.h>
50 50
51static int debug; 51static int debug;
52 52
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 78ad4b3126a6..c856e6f40e22 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -9,39 +9,14 @@
9 9
10 Portions copied from the Keyspan driver by Hugh Blemings <hugh@blemings.org> 10 Portions copied from the Keyspan driver by Hugh Blemings <hugh@blemings.org>
11 11
12 History: 12 History: see the git log.
13
14 2005-05-19 v0.1 Initial version, based on incomplete docs
15 and analysis of misbehavior with the standard driver
16 2005-05-20 v0.2 Extended the input buffer to avoid losing
17 random 64-byte chunks of data
18 2005-05-21 v0.3 implemented chars_in_buffer()
19 turned on low_latency
20 simplified the code somewhat
21 2005-05-24 v0.4 option_write() sometimes deadlocked under heavy load
22 removed some dead code
23 added sponsor notice
24 coding style clean-up
25 2005-06-20 v0.4.1 add missing braces :-/
26 killed end-of-line whitespace
27 2005-07-15 v0.4.2 rename WLAN product to FUSION, add FUSION2
28 2005-09-10 v0.4.3 added HUAWEI E600 card and Audiovox AirCard
29 2005-09-20 v0.4.4 increased recv buffer size: the card sometimes
30 wants to send >2000 bytes.
31 2006-04-10 v0.5 fixed two array overrun errors :-/
32 2006-04-21 v0.5.1 added support for Sierra Wireless MC8755
33 2006-05-15 v0.6 re-enable multi-port support
34 2006-06-01 v0.6.1 add COBRA
35 2006-06-01 v0.6.2 add backwards-compatibility stuff
36 2006-06-01 v0.6.3 add Novatel Wireless
37 2006-06-01 v0.7 Option => GSM
38 13
39 Work sponsored by: Sigos GmbH, Germany <info@sigos.de> 14 Work sponsored by: Sigos GmbH, Germany <info@sigos.de>
40 15
41 This driver exists because the "normal" serial driver doesn't work too well 16 This driver exists because the "normal" serial driver doesn't work too well
42 with GSM modems. Issues: 17 with GSM modems. Issues:
43 - data loss -- one single Receive URB is not nearly enough 18 - data loss -- one single Receive URB is not nearly enough
44 - nonstandard flow (Option devices) and multiplex (Sierra) control 19 - nonstandard flow (Option devices) control
45 - controlling the baud rate doesn't make sense 20 - controlling the baud rate doesn't make sense
46 21
47 This driver is named "option" because the most common device it's 22 This driver is named "option" because the most common device it's
@@ -53,7 +28,7 @@
53 device features. 28 device features.
54*/ 29*/
55 30
56#define DRIVER_VERSION "v0.7.0" 31#define DRIVER_VERSION "v0.7.1"
57#define DRIVER_AUTHOR "Matthias Urlichs <smurf@smurf.noris.de>" 32#define DRIVER_AUTHOR "Matthias Urlichs <smurf@smurf.noris.de>"
58#define DRIVER_DESC "USB Driver for GSM modems" 33#define DRIVER_DESC "USB Driver for GSM modems"
59 34
@@ -64,7 +39,7 @@
64#include <linux/tty_flip.h> 39#include <linux/tty_flip.h>
65#include <linux/module.h> 40#include <linux/module.h>
66#include <linux/usb.h> 41#include <linux/usb.h>
67#include "usb-serial.h" 42#include <linux/usb/serial.h>
68 43
69/* Function prototypes */ 44/* Function prototypes */
70static int option_open(struct usb_serial_port *port, struct file *filp); 45static int option_open(struct usb_serial_port *port, struct file *filp);
@@ -95,27 +70,29 @@ static int option_send_setup(struct usb_serial_port *port);
95#define OPTION_VENDOR_ID 0x0AF0 70#define OPTION_VENDOR_ID 0x0AF0
96#define HUAWEI_VENDOR_ID 0x12D1 71#define HUAWEI_VENDOR_ID 0x12D1
97#define AUDIOVOX_VENDOR_ID 0x0F3D 72#define AUDIOVOX_VENDOR_ID 0x0F3D
98#define SIERRAWIRELESS_VENDOR_ID 0x1199
99#define NOVATELWIRELESS_VENDOR_ID 0x1410 73#define NOVATELWIRELESS_VENDOR_ID 0x1410
74#define ANYDATA_VENDOR_ID 0x16d5
100 75
101#define OPTION_PRODUCT_OLD 0x5000 76#define OPTION_PRODUCT_OLD 0x5000
102#define OPTION_PRODUCT_FUSION 0x6000 77#define OPTION_PRODUCT_FUSION 0x6000
103#define OPTION_PRODUCT_FUSION2 0x6300 78#define OPTION_PRODUCT_FUSION2 0x6300
104#define OPTION_PRODUCT_COBRA 0x6500 79#define OPTION_PRODUCT_COBRA 0x6500
80#define OPTION_PRODUCT_COBRA2 0x6600
105#define HUAWEI_PRODUCT_E600 0x1001 81#define HUAWEI_PRODUCT_E600 0x1001
106#define AUDIOVOX_PRODUCT_AIRCARD 0x0112 82#define AUDIOVOX_PRODUCT_AIRCARD 0x0112
107#define SIERRAWIRELESS_PRODUCT_MC8755 0x6802
108#define NOVATELWIRELESS_PRODUCT_U740 0x1400 83#define NOVATELWIRELESS_PRODUCT_U740 0x1400
84#define ANYDATA_PRODUCT_ID 0x6501
109 85
110static struct usb_device_id option_ids[] = { 86static struct usb_device_id option_ids[] = {
111 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_OLD) }, 87 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_OLD) },
112 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUSION) }, 88 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUSION) },
113 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUSION2) }, 89 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUSION2) },
114 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA) }, 90 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA) },
91 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA2) },
115 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) }, 92 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) },
116 { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) }, 93 { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) },
117 { USB_DEVICE(SIERRAWIRELESS_VENDOR_ID, SIERRAWIRELESS_PRODUCT_MC8755) },
118 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID,NOVATELWIRELESS_PRODUCT_U740) }, 94 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID,NOVATELWIRELESS_PRODUCT_U740) },
95 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ID) },
119 { } /* Terminating entry */ 96 { } /* Terminating entry */
120}; 97};
121 98
@@ -124,13 +101,11 @@ static struct usb_device_id option_ids1[] = {
124 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUSION) }, 101 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUSION) },
125 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUSION2) }, 102 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUSION2) },
126 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA) }, 103 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA) },
104 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA2) },
127 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) }, 105 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) },
128 { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) }, 106 { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) },
129 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID,NOVATELWIRELESS_PRODUCT_U740) }, 107 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID,NOVATELWIRELESS_PRODUCT_U740) },
130 { } /* Terminating entry */ 108 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ID) },
131};
132static struct usb_device_id option_ids3[] = {
133 { USB_DEVICE(SIERRAWIRELESS_VENDOR_ID, SIERRAWIRELESS_PRODUCT_MC8755) },
134 { } /* Terminating entry */ 109 { } /* Terminating entry */
135}; 110};
136 111
@@ -147,37 +122,11 @@ static struct usb_driver option_driver = {
147/* The card has three separate interfaces, which the serial driver 122/* The card has three separate interfaces, which the serial driver
148 * recognizes separately, thus num_port=1. 123 * recognizes separately, thus num_port=1.
149 */ 124 */
150static struct usb_serial_driver option_3port_device = {
151 .driver = {
152 .owner = THIS_MODULE,
153 .name = "option",
154 },
155 .description = "GSM modem (3-port)",
156 .id_table = option_ids3,
157 .num_interrupt_in = NUM_DONT_CARE,
158 .num_bulk_in = NUM_DONT_CARE,
159 .num_bulk_out = NUM_DONT_CARE,
160 .num_ports = 3,
161 .open = option_open,
162 .close = option_close,
163 .write = option_write,
164 .write_room = option_write_room,
165 .chars_in_buffer = option_chars_in_buffer,
166 .throttle = option_rx_throttle,
167 .unthrottle = option_rx_unthrottle,
168 .set_termios = option_set_termios,
169 .break_ctl = option_break_ctl,
170 .tiocmget = option_tiocmget,
171 .tiocmset = option_tiocmset,
172 .attach = option_startup,
173 .shutdown = option_shutdown,
174 .read_int_callback = option_instat_callback,
175};
176 125
177static struct usb_serial_driver option_1port_device = { 126static struct usb_serial_driver option_1port_device = {
178 .driver = { 127 .driver = {
179 .owner = THIS_MODULE, 128 .owner = THIS_MODULE,
180 .name = "option", 129 .name = "option1",
181 }, 130 },
182 .description = "GSM modem (1-port)", 131 .description = "GSM modem (1-port)",
183 .id_table = option_ids1, 132 .id_table = option_ids1,
@@ -241,9 +190,6 @@ static int __init option_init(void)
241 retval = usb_serial_register(&option_1port_device); 190 retval = usb_serial_register(&option_1port_device);
242 if (retval) 191 if (retval)
243 goto failed_1port_device_register; 192 goto failed_1port_device_register;
244 retval = usb_serial_register(&option_3port_device);
245 if (retval)
246 goto failed_3port_device_register;
247 retval = usb_register(&option_driver); 193 retval = usb_register(&option_driver);
248 if (retval) 194 if (retval)
249 goto failed_driver_register; 195 goto failed_driver_register;
@@ -253,8 +199,6 @@ static int __init option_init(void)
253 return 0; 199 return 0;
254 200
255failed_driver_register: 201failed_driver_register:
256 usb_serial_deregister (&option_3port_device);
257failed_3port_device_register:
258 usb_serial_deregister (&option_1port_device); 202 usb_serial_deregister (&option_1port_device);
259failed_1port_device_register: 203failed_1port_device_register:
260 return retval; 204 return retval;
@@ -263,7 +207,6 @@ failed_1port_device_register:
263static void __exit option_exit(void) 207static void __exit option_exit(void)
264{ 208{
265 usb_deregister (&option_driver); 209 usb_deregister (&option_driver);
266 usb_serial_deregister (&option_3port_device);
267 usb_serial_deregister (&option_1port_device); 210 usb_serial_deregister (&option_1port_device);
268} 211}
269 212
@@ -652,7 +595,6 @@ static void option_setup_urbs(struct usb_serial *serial)
652 595
653 dbg("%s", __FUNCTION__); 596 dbg("%s", __FUNCTION__);
654 597
655
656 for (i = 0; i < serial->num_ports; i++) { 598 for (i = 0; i < serial->num_ports; i++) {
657 port = serial->port[i]; 599 port = serial->port[i];
658 portdata = usb_get_serial_port_data(port); 600 portdata = usb_get_serial_port_data(port);
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index de93a2b909e7..efbbc0adb89a 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -27,7 +27,7 @@
27#include <linux/spinlock.h> 27#include <linux/spinlock.h>
28#include <asm/uaccess.h> 28#include <asm/uaccess.h>
29#include <linux/usb.h> 29#include <linux/usb.h>
30#include "usb-serial.h" 30#include <linux/usb/serial.h>
31#include "pl2303.h" 31#include "pl2303.h"
32 32
33/* 33/*
@@ -52,6 +52,7 @@ struct pl2303_buf {
52static struct usb_device_id id_table [] = { 52static struct usb_device_id id_table [] = {
53 { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID) }, 53 { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID) },
54 { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_RSAQ2) }, 54 { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_RSAQ2) },
55 { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_DCU11) },
55 { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_RSAQ3) }, 56 { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_RSAQ3) },
56 { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_PHAROS) }, 57 { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_PHAROS) },
57 { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID) }, 58 { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID) },
@@ -79,6 +80,8 @@ static struct usb_device_id id_table [] = {
79 { USB_DEVICE(LEADTEK_VENDOR_ID, LEADTEK_9531_PRODUCT_ID) }, 80 { USB_DEVICE(LEADTEK_VENDOR_ID, LEADTEK_9531_PRODUCT_ID) },
80 { USB_DEVICE(SPEEDDRAGON_VENDOR_ID, SPEEDDRAGON_PRODUCT_ID) }, 81 { USB_DEVICE(SPEEDDRAGON_VENDOR_ID, SPEEDDRAGON_PRODUCT_ID) },
81 { USB_DEVICE(OTI_VENDOR_ID, OTI_PRODUCT_ID) }, 82 { USB_DEVICE(OTI_VENDOR_ID, OTI_PRODUCT_ID) },
83 { USB_DEVICE(DATAPILOT_U2_VENDOR_ID, DATAPILOT_U2_PRODUCT_ID) },
84 { USB_DEVICE(BELKIN_VENDOR_ID, BELKIN_PRODUCT_ID) },
82 { } /* Terminating entry */ 85 { } /* Terminating entry */
83}; 86};
84 87
diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h
index 7f29e81d3e35..a692ac66ca6c 100644
--- a/drivers/usb/serial/pl2303.h
+++ b/drivers/usb/serial/pl2303.h
@@ -10,6 +10,7 @@
10#define PL2303_VENDOR_ID 0x067b 10#define PL2303_VENDOR_ID 0x067b
11#define PL2303_PRODUCT_ID 0x2303 11#define PL2303_PRODUCT_ID 0x2303
12#define PL2303_PRODUCT_ID_RSAQ2 0x04bb 12#define PL2303_PRODUCT_ID_RSAQ2 0x04bb
13#define PL2303_PRODUCT_ID_DCU11 0x1234
13#define PL2303_PRODUCT_ID_PHAROS 0xaaa0 14#define PL2303_PRODUCT_ID_PHAROS 0xaaa0
14#define PL2303_PRODUCT_ID_RSAQ3 0xaaa2 15#define PL2303_PRODUCT_ID_RSAQ3 0xaaa2
15 16
@@ -84,3 +85,11 @@
84/* Ours Technology Inc DKU-5 clone, chipset: Prolific Technology Inc */ 85/* Ours Technology Inc DKU-5 clone, chipset: Prolific Technology Inc */
85#define OTI_VENDOR_ID 0x0ea0 86#define OTI_VENDOR_ID 0x0ea0
86#define OTI_PRODUCT_ID 0x6858 87#define OTI_PRODUCT_ID 0x6858
88
89/* DATAPILOT Universal-2 Phone Cable */
90#define DATAPILOT_U2_VENDOR_ID 0x0731
91#define DATAPILOT_U2_PRODUCT_ID 0x2003
92
93/* Belkin "F5U257" Serial Adapter */
94#define BELKIN_VENDOR_ID 0x050d
95#define BELKIN_PRODUCT_ID 0x0257
diff --git a/drivers/usb/serial/safe_serial.c b/drivers/usb/serial/safe_serial.c
index 897d8447252b..789771ecdb11 100644
--- a/drivers/usb/serial/safe_serial.c
+++ b/drivers/usb/serial/safe_serial.c
@@ -71,7 +71,7 @@
71#include <linux/spinlock.h> 71#include <linux/spinlock.h>
72#include <asm/uaccess.h> 72#include <asm/uaccess.h>
73#include <linux/usb.h> 73#include <linux/usb.h>
74#include "usb-serial.h" 74#include <linux/usb/serial.h>
75 75
76 76
77#ifndef CONFIG_USB_SAFE_PADDED 77#ifndef CONFIG_USB_SAFE_PADDED
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
new file mode 100644
index 000000000000..d29638daa987
--- /dev/null
+++ b/drivers/usb/serial/sierra.c
@@ -0,0 +1,75 @@
1/*
2 * Sierra Wireless CDMA Wireless Serial USB driver
3 *
4 * Current Copy modified by: Kevin Lloyd <linux@sierrawireless.com>
5 * Original Copyright (C) 2005-2006 Greg Kroah-Hartman <gregkh@suse.de>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License version
9 * 2 as published by the Free Software Foundation.
10 */
11
12#include <linux/kernel.h>
13#include <linux/init.h>
14#include <linux/tty.h>
15#include <linux/module.h>
16#include <linux/usb.h>
17#include <linux/usb/serial.h>
18
19static struct usb_device_id id_table [] = {
20 { USB_DEVICE(0x1199, 0x0018) }, /* Sierra Wireless MC5720 */
21 { USB_DEVICE(0x1199, 0x0020) }, /* Sierra Wireless MC5725 */
22 { USB_DEVICE(0x1199, 0x0017) }, /* Sierra Wireless EM5625 */
23 { USB_DEVICE(0x1199, 0x0019) }, /* Sierra Wireless AirCard 595 */
24 { USB_DEVICE(0x1199, 0x6802) }, /* Sierra Wireless MC8755 */
25 { USB_DEVICE(0x1199, 0x6803) }, /* Sierra Wireless MC8765 */
26 { USB_DEVICE(0x1199, 0x6812) }, /* Sierra Wireless MC8775 */
27 { USB_DEVICE(0x1199, 0x6820) }, /* Sierra Wireless AirCard 875 */
28 /* Following devices are supported in the airprime.c driver */
29 /* { USB_DEVICE(0x1199, 0x0112) }, */ /* Sierra Wireless AirCard 580 */
30 /* { USB_DEVICE(0x0F3D, 0x0112) }, */ /* AirPrime/Sierra PC 5220 */
31 { }
32};
33MODULE_DEVICE_TABLE(usb, id_table);
34
35static struct usb_driver sierra_driver = {
36 .name = "sierra_wireless",
37 .probe = usb_serial_probe,
38 .disconnect = usb_serial_disconnect,
39 .id_table = id_table,
40};
41
42static struct usb_serial_driver sierra_device = {
43 .driver = {
44 .owner = THIS_MODULE,
45 .name = "Sierra_Wireless",
46 },
47 .id_table = id_table,
48 .num_interrupt_in = NUM_DONT_CARE,
49 .num_bulk_in = NUM_DONT_CARE,
50 .num_bulk_out = NUM_DONT_CARE,
51 .num_ports = 3,
52};
53
54static int __init sierra_init(void)
55{
56 int retval;
57
58 retval = usb_serial_register(&sierra_device);
59 if (retval)
60 return retval;
61 retval = usb_register(&sierra_driver);
62 if (retval)
63 usb_serial_deregister(&sierra_device);
64 return retval;
65}
66
67static void __exit sierra_exit(void)
68{
69 usb_deregister(&sierra_driver);
70 usb_serial_deregister(&sierra_device);
71}
72
73module_init(sierra_init);
74module_exit(sierra_exit);
75MODULE_LICENSE("GPL");
diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c
index a9afff31a921..ac9b8ee52d44 100644
--- a/drivers/usb/serial/ti_usb_3410_5052.c
+++ b/drivers/usb/serial/ti_usb_3410_5052.c
@@ -83,8 +83,8 @@
83#include <asm/uaccess.h> 83#include <asm/uaccess.h>
84#include <asm/semaphore.h> 84#include <asm/semaphore.h>
85#include <linux/usb.h> 85#include <linux/usb.h>
86#include <linux/usb/serial.h>
86 87
87#include "usb-serial.h"
88#include "ti_usb_3410_5052.h" 88#include "ti_usb_3410_5052.h"
89#include "ti_fw_3410.h" /* firmware image for 3410 */ 89#include "ti_fw_3410.h" /* firmware image for 3410 */
90#include "ti_fw_5052.h" /* firmware image for 5052 */ 90#include "ti_fw_5052.h" /* firmware image for 5052 */
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index b59a0536ea5c..12c1694d322e 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -31,7 +31,7 @@
31#include <linux/smp_lock.h> 31#include <linux/smp_lock.h>
32#include <asm/uaccess.h> 32#include <asm/uaccess.h>
33#include <linux/usb.h> 33#include <linux/usb.h>
34#include "usb-serial.h" 34#include <linux/usb/serial.h>
35#include "pl2303.h" 35#include "pl2303.h"
36 36
37/* 37/*
@@ -40,6 +40,8 @@
40#define DRIVER_AUTHOR "Greg Kroah-Hartman, greg@kroah.com, http://www.kroah.com/linux/" 40#define DRIVER_AUTHOR "Greg Kroah-Hartman, greg@kroah.com, http://www.kroah.com/linux/"
41#define DRIVER_DESC "USB Serial Driver core" 41#define DRIVER_DESC "USB Serial Driver core"
42 42
43static void port_free(struct usb_serial_port *port);
44
43/* Driver structure we register with the USB core */ 45/* Driver structure we register with the USB core */
44static struct usb_driver usb_serial_driver = { 46static struct usb_driver usb_serial_driver = {
45 .name = "usbserial", 47 .name = "usbserial",
@@ -146,23 +148,10 @@ static void destroy_serial(struct kref *kref)
146 port = serial->port[i]; 148 port = serial->port[i];
147 if (!port) 149 if (!port)
148 continue; 150 continue;
149 usb_kill_urb(port->read_urb); 151 port_free(port);
150 usb_free_urb(port->read_urb);
151 usb_kill_urb(port->write_urb);
152 usb_free_urb(port->write_urb);
153 usb_kill_urb(port->interrupt_in_urb);
154 usb_free_urb(port->interrupt_in_urb);
155 usb_kill_urb(port->interrupt_out_urb);
156 usb_free_urb(port->interrupt_out_urb);
157 kfree(port->bulk_in_buffer);
158 kfree(port->bulk_out_buffer);
159 kfree(port->interrupt_in_buffer);
160 kfree(port->interrupt_out_buffer);
161 } 152 }
162 } 153 }
163 154
164 flush_scheduled_work(); /* port->work */
165
166 usb_put_dev(serial->dev); 155 usb_put_dev(serial->dev);
167 156
168 /* free up any memory that we allocated */ 157 /* free up any memory that we allocated */
@@ -564,6 +553,11 @@ static void port_release(struct device *dev)
564 struct usb_serial_port *port = to_usb_serial_port(dev); 553 struct usb_serial_port *port = to_usb_serial_port(dev);
565 554
566 dbg ("%s - %s", __FUNCTION__, dev->bus_id); 555 dbg ("%s - %s", __FUNCTION__, dev->bus_id);
556 port_free(port);
557}
558
559static void port_free(struct usb_serial_port *port)
560{
567 usb_kill_urb(port->read_urb); 561 usb_kill_urb(port->read_urb);
568 usb_free_urb(port->read_urb); 562 usb_free_urb(port->read_urb);
569 usb_kill_urb(port->write_urb); 563 usb_kill_urb(port->write_urb);
@@ -576,6 +570,7 @@ static void port_release(struct device *dev)
576 kfree(port->bulk_out_buffer); 570 kfree(port->bulk_out_buffer);
577 kfree(port->interrupt_in_buffer); 571 kfree(port->interrupt_in_buffer);
578 kfree(port->interrupt_out_buffer); 572 kfree(port->interrupt_out_buffer);
573 flush_scheduled_work(); /* port->work */
579 kfree(port); 574 kfree(port);
580} 575}
581 576
diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c
index 95a2936e902e..88949f7884ca 100644
--- a/drivers/usb/serial/visor.c
+++ b/drivers/usb/serial/visor.c
@@ -25,7 +25,7 @@
25#include <linux/spinlock.h> 25#include <linux/spinlock.h>
26#include <asm/uaccess.h> 26#include <asm/uaccess.h>
27#include <linux/usb.h> 27#include <linux/usb.h>
28#include "usb-serial.h" 28#include <linux/usb/serial.h>
29#include "visor.h" 29#include "visor.h"
30 30
31/* 31/*
@@ -302,7 +302,6 @@ static int visor_open (struct usb_serial_port *port, struct file *filp)
302 spin_lock_irqsave(&priv->lock, flags); 302 spin_lock_irqsave(&priv->lock, flags);
303 priv->bytes_in = 0; 303 priv->bytes_in = 0;
304 priv->bytes_out = 0; 304 priv->bytes_out = 0;
305 priv->outstanding_urbs = 0;
306 priv->throttled = 0; 305 priv->throttled = 0;
307 spin_unlock_irqrestore(&priv->lock, flags); 306 spin_unlock_irqrestore(&priv->lock, flags);
308 307
@@ -435,13 +434,25 @@ static int visor_write (struct usb_serial_port *port, const unsigned char *buf,
435 434
436static int visor_write_room (struct usb_serial_port *port) 435static int visor_write_room (struct usb_serial_port *port)
437{ 436{
437 struct visor_private *priv = usb_get_serial_port_data(port);
438 unsigned long flags;
439
438 dbg("%s - port %d", __FUNCTION__, port->number); 440 dbg("%s - port %d", __FUNCTION__, port->number);
439 441
440 /* 442 /*
441 * We really can take anything the user throws at us 443 * We really can take anything the user throws at us
442 * but let's pick a nice big number to tell the tty 444 * but let's pick a nice big number to tell the tty
443 * layer that we have lots of free space 445 * layer that we have lots of free space, unless we don't.
444 */ 446 */
447
448 spin_lock_irqsave(&priv->lock, flags);
449 if (priv->outstanding_urbs > URB_UPPER_LIMIT * 2 / 3) {
450 spin_unlock_irqrestore(&priv->lock, flags);
451 dbg("%s - write limit hit\n", __FUNCTION__);
452 return 0;
453 }
454 spin_unlock_irqrestore(&priv->lock, flags);
455
445 return 2048; 456 return 2048;
446} 457}
447 458
@@ -758,15 +769,22 @@ static int visor_calc_num_ports (struct usb_serial *serial)
758 769
759static int generic_startup(struct usb_serial *serial) 770static int generic_startup(struct usb_serial *serial)
760{ 771{
772 struct usb_serial_port **ports = serial->port;
761 struct visor_private *priv; 773 struct visor_private *priv;
762 int i; 774 int i;
763 775
764 for (i = 0; i < serial->num_ports; ++i) { 776 for (i = 0; i < serial->num_ports; ++i) {
765 priv = kzalloc (sizeof(*priv), GFP_KERNEL); 777 priv = kzalloc (sizeof(*priv), GFP_KERNEL);
766 if (!priv) 778 if (!priv) {
779 while (i-- != 0) {
780 priv = usb_get_serial_port_data(ports[i]);
781 usb_set_serial_port_data(ports[i], NULL);
782 kfree(priv);
783 }
767 return -ENOMEM; 784 return -ENOMEM;
785 }
768 spin_lock_init(&priv->lock); 786 spin_lock_init(&priv->lock);
769 usb_set_serial_port_data(serial->port[i], priv); 787 usb_set_serial_port_data(ports[i], priv);
770 } 788 }
771 return 0; 789 return 0;
772} 790}
@@ -876,7 +894,18 @@ static int clie_5_attach (struct usb_serial *serial)
876 894
877static void visor_shutdown (struct usb_serial *serial) 895static void visor_shutdown (struct usb_serial *serial)
878{ 896{
897 struct visor_private *priv;
898 int i;
899
879 dbg("%s", __FUNCTION__); 900 dbg("%s", __FUNCTION__);
901
902 for (i = 0; i < serial->num_ports; i++) {
903 priv = usb_get_serial_port_data(serial->port[i]);
904 if (priv) {
905 usb_set_serial_port_data(serial->port[i], NULL);
906 kfree(priv);
907 }
908 }
880} 909}
881 910
882static int visor_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg) 911static int visor_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg)
diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c
index 540438c3f381..6e6c7934be32 100644
--- a/drivers/usb/serial/whiteheat.c
+++ b/drivers/usb/serial/whiteheat.c
@@ -79,7 +79,7 @@
79#include <linux/usb.h> 79#include <linux/usb.h>
80#include <linux/serial_reg.h> 80#include <linux/serial_reg.h>
81#include <linux/serial.h> 81#include <linux/serial.h>
82#include "usb-serial.h" 82#include <linux/usb/serial.h>
83#include "whiteheat_fw.h" /* firmware for the ConnectTech WhiteHEAT device */ 83#include "whiteheat_fw.h" /* firmware for the ConnectTech WhiteHEAT device */
84#include "whiteheat.h" /* WhiteHEAT specific commands */ 84#include "whiteheat.h" /* WhiteHEAT specific commands */
85 85
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
index 5715291ba540..a4b7df9ff8c1 100644
--- a/drivers/usb/storage/scsiglue.c
+++ b/drivers/usb/storage/scsiglue.c
@@ -112,13 +112,11 @@ static int slave_configure(struct scsi_device *sdev)
112 if (sdev->scsi_level < SCSI_2) 112 if (sdev->scsi_level < SCSI_2)
113 sdev->scsi_level = sdev->sdev_target->scsi_level = SCSI_2; 113 sdev->scsi_level = sdev->sdev_target->scsi_level = SCSI_2;
114 114
115 /* According to the technical support people at Genesys Logic, 115 /* Many devices have trouble transfering more than 32KB at a time,
116 * devices using their chips have problems transferring more than 116 * while others have trouble with more than 64K. At this time we
117 * 32 KB at a time. In practice people have found that 64 KB 117 * are limiting both to 32K (64 sectores).
118 * works okay and that's what Windows does. But we'll be 118 */
119 * conservative; people can always use the sysfs interface to 119 if ((us->flags & US_FL_MAX_SECTORS_64) &&
120 * increase max_sectors. */
121 if (le16_to_cpu(us->pusb_dev->descriptor.idVendor) == USB_VENDOR_ID_GENESYS &&
122 sdev->request_queue->max_sectors > 64) 120 sdev->request_queue->max_sectors > 64)
123 blk_queue_max_sectors(sdev->request_queue, 64); 121 blk_queue_max_sectors(sdev->request_queue, 64);
124 122
diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c
index eb7188b3565c..d6acc92a4ae3 100644
--- a/drivers/usb/storage/transport.c
+++ b/drivers/usb/storage/transport.c
@@ -180,7 +180,7 @@ static int usb_stor_msg_common(struct us_data *us, int timeout)
180 if (timeleft <= 0) { 180 if (timeleft <= 0) {
181 US_DEBUGP("%s -- cancelling URB\n", 181 US_DEBUGP("%s -- cancelling URB\n",
182 timeleft == 0 ? "Timeout" : "Signal"); 182 timeleft == 0 ? "Timeout" : "Signal");
183 usb_unlink_urb(us->current_urb); 183 usb_kill_urb(us->current_urb);
184 } 184 }
185 185
186 /* return the URB status */ 186 /* return the URB status */
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index c7e84e653df9..2793f9a912b4 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -112,6 +112,19 @@ UNUSUAL_DEV( 0x0411, 0x001c, 0x0113, 0x0113,
112 US_SC_DEVICE, US_PR_DEVICE, NULL, 112 US_SC_DEVICE, US_PR_DEVICE, NULL,
113 US_FL_FIX_INQUIRY ), 113 US_FL_FIX_INQUIRY ),
114 114
115/* Submitted by Ernestas Vaiciukevicius <ernisv@gmail.com> */
116UNUSUAL_DEV( 0x0419, 0x0100, 0x0100, 0x0100,
117 "Samsung Info. Systems America, Inc.",
118 "MP3 Player",
119 US_SC_DEVICE, US_PR_DEVICE, NULL,
120 US_FL_IGNORE_RESIDUE ),
121
122/* Reported by Orgad Shaneh <orgads@gmail.com> */
123UNUSUAL_DEV( 0x0419, 0xaace, 0x0100, 0x0100,
124 "Samsung", "MP3 Player",
125 US_SC_DEVICE, US_PR_DEVICE, NULL,
126 US_FL_IGNORE_RESIDUE ),
127
115/* Reported by Christian Leber <christian@leber.de> */ 128/* Reported by Christian Leber <christian@leber.de> */
116UNUSUAL_DEV( 0x0419, 0xaaf5, 0x0100, 0x0100, 129UNUSUAL_DEV( 0x0419, 0xaaf5, 0x0100, 0x0100,
117 "TrekStor", 130 "TrekStor",
@@ -132,6 +145,21 @@ UNUSUAL_DEV( 0x0420, 0x0001, 0x0100, 0x0100,
132 US_SC_DEVICE, US_PR_DEVICE, NULL, 145 US_SC_DEVICE, US_PR_DEVICE, NULL,
133 US_FL_IGNORE_RESIDUE ), 146 US_FL_IGNORE_RESIDUE ),
134 147
148/* Reported by Mario Rettig <mariorettig@web.de> */
149UNUSUAL_DEV( 0x0421, 0x042e, 0x0100, 0x0100,
150 "Nokia",
151 "Nokia 3250",
152 US_SC_DEVICE, US_PR_DEVICE, NULL,
153 US_FL_IGNORE_RESIDUE | US_FL_FIX_CAPACITY ),
154
155/* Reported by Sumedha Swamy <sumedhaswamy@gmail.com> and
156 * Einar Th. Einarsson <einarthered@gmail.com> */
157UNUSUAL_DEV( 0x0421, 0x0444, 0x0100, 0x0100,
158 "Nokia",
159 "N91",
160 US_SC_DEVICE, US_PR_DEVICE, NULL,
161 US_FL_IGNORE_RESIDUE | US_FL_FIX_CAPACITY ),
162
135/* Reported by Jiri Slaby <jirislaby@gmail.com> and 163/* Reported by Jiri Slaby <jirislaby@gmail.com> and
136 * Rene C. Castberg <Rene@Castberg.org> */ 164 * Rene C. Castberg <Rene@Castberg.org> */
137UNUSUAL_DEV( 0x0421, 0x0446, 0x0100, 0x0100, 165UNUSUAL_DEV( 0x0421, 0x0446, 0x0100, 0x0100,
@@ -140,6 +168,13 @@ UNUSUAL_DEV( 0x0421, 0x0446, 0x0100, 0x0100,
140 US_SC_DEVICE, US_PR_DEVICE, NULL, 168 US_SC_DEVICE, US_PR_DEVICE, NULL,
141 US_FL_IGNORE_RESIDUE | US_FL_FIX_CAPACITY ), 169 US_FL_IGNORE_RESIDUE | US_FL_FIX_CAPACITY ),
142 170
171/* Reported by Matthew Bloch <matthew@bytemark.co.uk> */
172UNUSUAL_DEV( 0x0421, 0x044e, 0x0100, 0x0100,
173 "Nokia",
174 "E61",
175 US_SC_DEVICE, US_PR_DEVICE, NULL,
176 US_FL_IGNORE_RESIDUE | US_FL_FIX_CAPACITY ),
177
143/* Reported by Olaf Hering <olh@suse.de> from novell bug #105878 */ 178/* Reported by Olaf Hering <olh@suse.de> from novell bug #105878 */
144UNUSUAL_DEV( 0x0424, 0x0fdc, 0x0210, 0x0210, 179UNUSUAL_DEV( 0x0424, 0x0fdc, 0x0210, 0x0210,
145 "SMSC", 180 "SMSC",
@@ -473,10 +508,11 @@ UNUSUAL_DEV( 0x054c, 0x0010, 0x0106, 0x0450,
473 US_SC_SCSI, US_PR_DEVICE, NULL, 508 US_SC_SCSI, US_PR_DEVICE, NULL,
474 US_FL_SINGLE_LUN | US_FL_NOT_LOCKABLE | US_FL_NO_WP_DETECT ), 509 US_FL_SINGLE_LUN | US_FL_NOT_LOCKABLE | US_FL_NO_WP_DETECT ),
475 510
476/* This entry is needed because the device reports Sub=ff */ 511/* Submitted by Lars Jacob <jacob.lars@googlemail.com>
477UNUSUAL_DEV( 0x054c, 0x0010, 0x0500, 0x0600, 512 * This entry is needed because the device reports Sub=ff */
513UNUSUAL_DEV( 0x054c, 0x0010, 0x0500, 0x0610,
478 "Sony", 514 "Sony",
479 "DSC-T1/T5", 515 "DSC-T1/T5/H5",
480 US_SC_8070, US_PR_DEVICE, NULL, 516 US_SC_8070, US_PR_DEVICE, NULL,
481 US_FL_SINGLE_LUN ), 517 US_FL_SINGLE_LUN ),
482 518
@@ -598,18 +634,6 @@ UNUSUAL_DEV( 0x0595, 0x4343, 0x0000, 0x2210,
598 "Digital Camera EX-20 DSC", 634 "Digital Camera EX-20 DSC",
599 US_SC_8070, US_PR_DEVICE, NULL, 0 ), 635 US_SC_8070, US_PR_DEVICE, NULL, 0 ),
600 636
601/* The entry was here before I took over, and had US_SC_RBC. It turns
602 * out that isn't needed. Additionally, Torsten Eriksson
603 * <Torsten.Eriksson@bergianska.se> is able to use his device fine
604 * without this entry at all - but I don't suspect that will be true
605 * for all users (the protocol is likely needed), so is staying at
606 * this time. - Phil Dibowitz <phil@ipom.com>
607 */
608UNUSUAL_DEV( 0x059f, 0xa601, 0x0200, 0x0200,
609 "LaCie",
610 "USB Hard Disk",
611 US_SC_DEVICE, US_PR_CB, NULL, 0 ),
612
613/* Submitted by Joel Bourquard <numlock@freesurf.ch> 637/* Submitted by Joel Bourquard <numlock@freesurf.ch>
614 * Some versions of this device need the SubClass and Protocol overrides 638 * Some versions of this device need the SubClass and Protocol overrides
615 * while others don't. 639 * while others don't.
@@ -708,18 +732,22 @@ UNUSUAL_DEV( 0x05dc, 0xb002, 0x0000, 0x0113,
708 * They were originally reported by Alexander Oltu 732 * They were originally reported by Alexander Oltu
709 * <alexander@all-2.com> and Peter Marks <peter.marks@turner.com> 733 * <alexander@all-2.com> and Peter Marks <peter.marks@turner.com>
710 * respectively. 734 * respectively.
735 *
736 * US_FL_GO_SLOW and US_FL_MAX_SECTORS_64 added by Phil Dibowitz
737 * <phil@ipom.com> as these flags were made and hard-coded
738 * special-cases were pulled from scsiglue.c.
711 */ 739 */
712UNUSUAL_DEV( 0x05e3, 0x0701, 0x0000, 0xffff, 740UNUSUAL_DEV( 0x05e3, 0x0701, 0x0000, 0xffff,
713 "Genesys Logic", 741 "Genesys Logic",
714 "USB to IDE Optical", 742 "USB to IDE Optical",
715 US_SC_DEVICE, US_PR_DEVICE, NULL, 743 US_SC_DEVICE, US_PR_DEVICE, NULL,
716 US_FL_GO_SLOW ), 744 US_FL_GO_SLOW | US_FL_MAX_SECTORS_64 ),
717 745
718UNUSUAL_DEV( 0x05e3, 0x0702, 0x0000, 0xffff, 746UNUSUAL_DEV( 0x05e3, 0x0702, 0x0000, 0xffff,
719 "Genesys Logic", 747 "Genesys Logic",
720 "USB to IDE Disk", 748 "USB to IDE Disk",
721 US_SC_DEVICE, US_PR_DEVICE, NULL, 749 US_SC_DEVICE, US_PR_DEVICE, NULL,
722 US_FL_GO_SLOW ), 750 US_FL_GO_SLOW | US_FL_MAX_SECTORS_64 ),
723 751
724/* Reported by Hanno Boeck <hanno@gmx.de> 752/* Reported by Hanno Boeck <hanno@gmx.de>
725 * Taken from the Lycoris Kernel */ 753 * Taken from the Lycoris Kernel */
@@ -1073,7 +1101,15 @@ UNUSUAL_DEV( 0x0a17, 0x006, 0x0000, 0xffff,
1073 "Optio S/S4", 1101 "Optio S/S4",
1074 US_SC_DEVICE, US_PR_DEVICE, NULL, 1102 US_SC_DEVICE, US_PR_DEVICE, NULL,
1075 US_FL_FIX_INQUIRY ), 1103 US_FL_FIX_INQUIRY ),
1076 1104
1105/* This is a virtual windows driver CD, which the zd1211rw driver automatically
1106 * converts into a WLAN device. */
1107UNUSUAL_DEV( 0x0ace, 0x2011, 0x0101, 0x0101,
1108 "ZyXEL",
1109 "G-220F USB-WLAN Install",
1110 US_SC_DEVICE, US_PR_DEVICE, NULL,
1111 US_FL_IGNORE_DEVICE ),
1112
1077#ifdef CONFIG_USB_STORAGE_ISD200 1113#ifdef CONFIG_USB_STORAGE_ISD200
1078UNUSUAL_DEV( 0x0bf6, 0xa001, 0x0100, 0x0110, 1114UNUSUAL_DEV( 0x0bf6, 0xa001, 0x0100, 0x0110,
1079 "ATI", 1115 "ATI",
@@ -1196,6 +1232,14 @@ UNUSUAL_DEV( 0x0ea0, 0x6828, 0x0110, 0x0110,
1196 US_SC_DEVICE, US_PR_DEVICE, NULL, 1232 US_SC_DEVICE, US_PR_DEVICE, NULL,
1197 US_FL_IGNORE_RESIDUE ), 1233 US_FL_IGNORE_RESIDUE ),
1198 1234
1235/* Reported by Benjamin Schiller <sbenni@gmx.de>
1236 * It is also sold by Easylite as DJ 20 */
1237UNUSUAL_DEV( 0x0ed1, 0x7636, 0x0103, 0x0103,
1238 "Typhoon",
1239 "My DJ 1820",
1240 US_SC_DEVICE, US_PR_DEVICE, NULL,
1241 US_FL_IGNORE_RESIDUE | US_FL_GO_SLOW | US_FL_MAX_SECTORS_64),
1242
1199/* Reported by Michael Stattmann <michael@stattmann.com> */ 1243/* Reported by Michael Stattmann <michael@stattmann.com> */
1200UNUSUAL_DEV( 0x0fce, 0xd008, 0x0000, 0x0000, 1244UNUSUAL_DEV( 0x0fce, 0xd008, 0x0000, 0x0000,
1201 "Sony Ericsson", 1245 "Sony Ericsson",
@@ -1227,6 +1271,15 @@ UNUSUAL_DEV( 0x1370, 0x6828, 0x0110, 0x0110,
1227 US_SC_DEVICE, US_PR_DEVICE, NULL, 1271 US_SC_DEVICE, US_PR_DEVICE, NULL,
1228 US_FL_IGNORE_RESIDUE ), 1272 US_FL_IGNORE_RESIDUE ),
1229 1273
1274/* patch submitted by Davide Perini <perini.davide@dpsoftware.org>
1275 * and Renato Perini <rperini@email.it>
1276 */
1277UNUSUAL_DEV( 0x22b8, 0x3010, 0x0001, 0x0001,
1278 "Motorola",
1279 "RAZR V3x",
1280 US_SC_DEVICE, US_PR_DEVICE, NULL,
1281 US_FL_FIX_CAPACITY | US_FL_IGNORE_RESIDUE ),
1282
1230/* Reported by Radovan Garabik <garabik@kassiopeia.juls.savba.sk> */ 1283/* Reported by Radovan Garabik <garabik@kassiopeia.juls.savba.sk> */
1231UNUSUAL_DEV( 0x2735, 0x100b, 0x0000, 0x9999, 1284UNUSUAL_DEV( 0x2735, 0x100b, 0x0000, 0x9999,
1232 "MPIO", 1285 "MPIO",
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index 1185acac4b21..8d7bdcb5924d 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -55,6 +55,7 @@
55#include <linux/slab.h> 55#include <linux/slab.h>
56#include <linux/kthread.h> 56#include <linux/kthread.h>
57#include <linux/mutex.h> 57#include <linux/mutex.h>
58#include <linux/utsrelease.h>
58 59
59#include <scsi/scsi.h> 60#include <scsi/scsi.h>
60#include <scsi/scsi_cmnd.h> 61#include <scsi/scsi_cmnd.h>
@@ -373,8 +374,12 @@ static int usb_stor_control_thread(void * __us)
373 /* lock access to the state */ 374 /* lock access to the state */
374 scsi_lock(host); 375 scsi_lock(host);
375 376
377 /* did the command already complete because of a disconnect? */
378 if (!us->srb)
379 ; /* nothing to do */
380
376 /* indicate that the command is done */ 381 /* indicate that the command is done */
377 if (us->srb->result != DID_ABORT << 16) { 382 else if (us->srb->result != DID_ABORT << 16) {
378 US_DEBUGP("scsi cmd done, result=0x%x\n", 383 US_DEBUGP("scsi cmd done, result=0x%x\n",
379 us->srb->result); 384 us->srb->result);
380 us->srb->scsi_done(us->srb); 385 us->srb->scsi_done(us->srb);
@@ -478,7 +483,7 @@ static struct us_unusual_dev *find_unusual(const struct usb_device_id *id)
478} 483}
479 484
480/* Get the unusual_devs entries and the string descriptors */ 485/* Get the unusual_devs entries and the string descriptors */
481static void get_device_info(struct us_data *us, const struct usb_device_id *id) 486static int get_device_info(struct us_data *us, const struct usb_device_id *id)
482{ 487{
483 struct usb_device *dev = us->pusb_dev; 488 struct usb_device *dev = us->pusb_dev;
484 struct usb_interface_descriptor *idesc = 489 struct usb_interface_descriptor *idesc =
@@ -495,6 +500,11 @@ static void get_device_info(struct us_data *us, const struct usb_device_id *id)
495 unusual_dev->useTransport; 500 unusual_dev->useTransport;
496 us->flags = USB_US_ORIG_FLAGS(id->driver_info); 501 us->flags = USB_US_ORIG_FLAGS(id->driver_info);
497 502
503 if (us->flags & US_FL_IGNORE_DEVICE) {
504 printk(KERN_INFO USB_STORAGE "device ignored\n");
505 return -ENODEV;
506 }
507
498 /* 508 /*
499 * This flag is only needed when we're in high-speed, so let's 509 * This flag is only needed when we're in high-speed, so let's
500 * disable it if we're in full-speed 510 * disable it if we're in full-speed
@@ -524,7 +534,8 @@ static void get_device_info(struct us_data *us, const struct usb_device_id *id)
524 if (msg >= 0 && !(us->flags & US_FL_NEED_OVERRIDE)) 534 if (msg >= 0 && !(us->flags & US_FL_NEED_OVERRIDE))
525 printk(KERN_NOTICE USB_STORAGE "This device " 535 printk(KERN_NOTICE USB_STORAGE "This device "
526 "(%04x,%04x,%04x S %02x P %02x)" 536 "(%04x,%04x,%04x S %02x P %02x)"
527 " has %s in unusual_devs.h\n" 537 " has %s in unusual_devs.h (kernel"
538 " %s)\n"
528 " Please send a copy of this message to " 539 " Please send a copy of this message to "
529 "<linux-usb-devel@lists.sourceforge.net>\n", 540 "<linux-usb-devel@lists.sourceforge.net>\n",
530 le16_to_cpu(ddesc->idVendor), 541 le16_to_cpu(ddesc->idVendor),
@@ -532,8 +543,11 @@ static void get_device_info(struct us_data *us, const struct usb_device_id *id)
532 le16_to_cpu(ddesc->bcdDevice), 543 le16_to_cpu(ddesc->bcdDevice),
533 idesc->bInterfaceSubClass, 544 idesc->bInterfaceSubClass,
534 idesc->bInterfaceProtocol, 545 idesc->bInterfaceProtocol,
535 msgs[msg]); 546 msgs[msg],
547 UTS_RELEASE);
536 } 548 }
549
550 return 0;
537} 551}
538 552
539/* Get the transport settings */ 553/* Get the transport settings */
@@ -836,32 +850,34 @@ static void dissociate_dev(struct us_data *us)
836 * the host */ 850 * the host */
837static void quiesce_and_remove_host(struct us_data *us) 851static void quiesce_and_remove_host(struct us_data *us)
838{ 852{
853 struct Scsi_Host *host = us_to_host(us);
854
839 /* Prevent new USB transfers, stop the current command, and 855 /* Prevent new USB transfers, stop the current command, and
840 * interrupt a SCSI-scan or device-reset delay */ 856 * interrupt a SCSI-scan or device-reset delay */
857 scsi_lock(host);
841 set_bit(US_FLIDX_DISCONNECTING, &us->flags); 858 set_bit(US_FLIDX_DISCONNECTING, &us->flags);
859 scsi_unlock(host);
842 usb_stor_stop_transport(us); 860 usb_stor_stop_transport(us);
843 wake_up(&us->delay_wait); 861 wake_up(&us->delay_wait);
844 862
845 /* It doesn't matter if the SCSI-scanning thread is still running. 863 /* It doesn't matter if the SCSI-scanning thread is still running.
846 * The thread will exit when it sees the DISCONNECTING flag. */ 864 * The thread will exit when it sees the DISCONNECTING flag. */
847 865
848 /* Wait for the current command to finish, then remove the host */
849 mutex_lock(&us->dev_mutex);
850 mutex_unlock(&us->dev_mutex);
851
852 /* queuecommand won't accept any new commands and the control 866 /* queuecommand won't accept any new commands and the control
853 * thread won't execute a previously-queued command. If there 867 * thread won't execute a previously-queued command. If there
854 * is such a command pending, complete it with an error. */ 868 * is such a command pending, complete it with an error. */
869 mutex_lock(&us->dev_mutex);
855 if (us->srb) { 870 if (us->srb) {
856 us->srb->result = DID_NO_CONNECT << 16; 871 us->srb->result = DID_NO_CONNECT << 16;
857 scsi_lock(us_to_host(us)); 872 scsi_lock(host);
858 us->srb->scsi_done(us->srb); 873 us->srb->scsi_done(us->srb);
859 us->srb = NULL; 874 us->srb = NULL;
860 scsi_unlock(us_to_host(us)); 875 scsi_unlock(host);
861 } 876 }
877 mutex_unlock(&us->dev_mutex);
862 878
863 /* Now we own no commands so it's safe to remove the SCSI host */ 879 /* Now we own no commands so it's safe to remove the SCSI host */
864 scsi_remove_host(us_to_host(us)); 880 scsi_remove_host(host);
865} 881}
866 882
867/* Second stage of disconnect processing: deallocate all resources */ 883/* Second stage of disconnect processing: deallocate all resources */
@@ -960,7 +976,9 @@ static int storage_probe(struct usb_interface *intf,
960 * of the match from the usb_device_id table, so we can find the 976 * of the match from the usb_device_id table, so we can find the
961 * corresponding entry in the private table. 977 * corresponding entry in the private table.
962 */ 978 */
963 get_device_info(us, id); 979 result = get_device_info(us, id);
980 if (result)
981 goto BadDevice;
964 982
965 /* Get the transport, protocol, and pipe settings */ 983 /* Get the transport, protocol, and pipe settings */
966 result = get_transport(us); 984 result = get_transport(us);
diff --git a/drivers/usb/storage/usb.h b/drivers/usb/storage/usb.h
index 5284abe1b5eb..21f3ddbc9080 100644
--- a/drivers/usb/storage/usb.h
+++ b/drivers/usb/storage/usb.h
@@ -176,8 +176,4 @@ extern void fill_inquiry_response(struct us_data *us,
176#define scsi_unlock(host) spin_unlock_irq(host->host_lock) 176#define scsi_unlock(host) spin_unlock_irq(host->host_lock)
177#define scsi_lock(host) spin_lock_irq(host->host_lock) 177#define scsi_lock(host) spin_lock_irq(host->host_lock)
178 178
179
180/* Vendor ID list for devices that require special handling */
181#define USB_VENDOR_ID_GENESYS 0x05e3 /* Genesys Logic */
182
183#endif 179#endif
diff --git a/drivers/video/68328fb.c b/drivers/video/68328fb.c
index 78488bb41aeb..0dda73da8628 100644
--- a/drivers/video/68328fb.c
+++ b/drivers/video/68328fb.c
@@ -32,7 +32,6 @@
32#include <linux/errno.h> 32#include <linux/errno.h>
33#include <linux/string.h> 33#include <linux/string.h>
34#include <linux/mm.h> 34#include <linux/mm.h>
35#include <linux/tty.h>
36#include <linux/slab.h> 35#include <linux/slab.h>
37#include <linux/vmalloc.h> 36#include <linux/vmalloc.h>
38#include <linux/delay.h> 37#include <linux/delay.h>
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 3badb48d662b..c40b9b8b1e7e 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -86,9 +86,11 @@ config FB_MACMODES
86 default n 86 default n
87 87
88config FB_BACKLIGHT 88config FB_BACKLIGHT
89 bool 89 bool
90 depends on FB 90 depends on FB
91 default n 91 select BACKLIGHT_LCD_SUPPORT
92 select BACKLIGHT_CLASS_DEVICE
93 default n
92 94
93config FB_MODE_HELPERS 95config FB_MODE_HELPERS
94 bool "Enable Video Mode Handling Helpers" 96 bool "Enable Video Mode Handling Helpers"
@@ -420,7 +422,7 @@ config FB_OF
420 422
421config FB_CONTROL 423config FB_CONTROL
422 bool "Apple \"control\" display support" 424 bool "Apple \"control\" display support"
423 depends on (FB = y) && PPC_PMAC 425 depends on (FB = y) && PPC_PMAC && PPC32
424 select FB_CFB_FILLRECT 426 select FB_CFB_FILLRECT
425 select FB_CFB_COPYAREA 427 select FB_CFB_COPYAREA
426 select FB_CFB_IMAGEBLIT 428 select FB_CFB_IMAGEBLIT
@@ -431,7 +433,7 @@ config FB_CONTROL
431 433
432config FB_PLATINUM 434config FB_PLATINUM
433 bool "Apple \"platinum\" display support" 435 bool "Apple \"platinum\" display support"
434 depends on (FB = y) && PPC_PMAC 436 depends on (FB = y) && PPC_PMAC && PPC32
435 select FB_CFB_FILLRECT 437 select FB_CFB_FILLRECT
436 select FB_CFB_COPYAREA 438 select FB_CFB_COPYAREA
437 select FB_CFB_IMAGEBLIT 439 select FB_CFB_IMAGEBLIT
@@ -442,7 +444,7 @@ config FB_PLATINUM
442 444
443config FB_VALKYRIE 445config FB_VALKYRIE
444 bool "Apple \"valkyrie\" display support" 446 bool "Apple \"valkyrie\" display support"
445 depends on (FB = y) && (MAC || PPC_PMAC) 447 depends on (FB = y) && (MAC || (PPC_PMAC && PPC32))
446 select FB_CFB_FILLRECT 448 select FB_CFB_FILLRECT
447 select FB_CFB_COPYAREA 449 select FB_CFB_COPYAREA
448 select FB_CFB_IMAGEBLIT 450 select FB_CFB_IMAGEBLIT
@@ -453,7 +455,7 @@ config FB_VALKYRIE
453 455
454config FB_CT65550 456config FB_CT65550
455 bool "Chips 65550 display support" 457 bool "Chips 65550 display support"
456 depends on (FB = y) && PPC 458 depends on (FB = y) && PPC32
457 select FB_CFB_FILLRECT 459 select FB_CFB_FILLRECT
458 select FB_CFB_COPYAREA 460 select FB_CFB_COPYAREA
459 select FB_CFB_IMAGEBLIT 461 select FB_CFB_IMAGEBLIT
@@ -721,10 +723,8 @@ config FB_NVIDIA_I2C
721 723
722config FB_NVIDIA_BACKLIGHT 724config FB_NVIDIA_BACKLIGHT
723 bool "Support for backlight control" 725 bool "Support for backlight control"
724 depends on FB_NVIDIA && PPC_PMAC 726 depends on FB_NVIDIA && PMAC_BACKLIGHT
725 select FB_BACKLIGHT 727 select FB_BACKLIGHT
726 select BACKLIGHT_LCD_SUPPORT
727 select BACKLIGHT_CLASS_DEVICE
728 default y 728 default y
729 help 729 help
730 Say Y here if you want to control the backlight of your display. 730 Say Y here if you want to control the backlight of your display.
@@ -769,10 +769,8 @@ config FB_RIVA_DEBUG
769 769
770config FB_RIVA_BACKLIGHT 770config FB_RIVA_BACKLIGHT
771 bool "Support for backlight control" 771 bool "Support for backlight control"
772 depends on FB_RIVA && PPC_PMAC 772 depends on FB_RIVA && PMAC_BACKLIGHT
773 select FB_BACKLIGHT 773 select FB_BACKLIGHT
774 select BACKLIGHT_LCD_SUPPORT
775 select BACKLIGHT_CLASS_DEVICE
776 default y 774 default y
777 help 775 help
778 Say Y here if you want to control the backlight of your display. 776 Say Y here if you want to control the backlight of your display.
@@ -1025,10 +1023,8 @@ config FB_RADEON_I2C
1025 1023
1026config FB_RADEON_BACKLIGHT 1024config FB_RADEON_BACKLIGHT
1027 bool "Support for backlight control" 1025 bool "Support for backlight control"
1028 depends on FB_RADEON && PPC_PMAC 1026 depends on FB_RADEON && PMAC_BACKLIGHT
1029 select FB_BACKLIGHT 1027 select FB_BACKLIGHT
1030 select BACKLIGHT_LCD_SUPPORT
1031 select BACKLIGHT_CLASS_DEVICE
1032 default y 1028 default y
1033 help 1029 help
1034 Say Y here if you want to control the backlight of your display. 1030 Say Y here if you want to control the backlight of your display.
@@ -1059,10 +1055,8 @@ config FB_ATY128
1059 1055
1060config FB_ATY128_BACKLIGHT 1056config FB_ATY128_BACKLIGHT
1061 bool "Support for backlight control" 1057 bool "Support for backlight control"
1062 depends on FB_ATY128 && PPC_PMAC 1058 depends on FB_ATY128 && PMAC_BACKLIGHT
1063 select FB_BACKLIGHT 1059 select FB_BACKLIGHT
1064 select BACKLIGHT_LCD_SUPPORT
1065 select BACKLIGHT_CLASS_DEVICE
1066 default y 1060 default y
1067 help 1061 help
1068 Say Y here if you want to control the backlight of your display. 1062 Say Y here if you want to control the backlight of your display.
@@ -1111,10 +1105,8 @@ config FB_ATY_GX
1111 1105
1112config FB_ATY_BACKLIGHT 1106config FB_ATY_BACKLIGHT
1113 bool "Support for backlight control" 1107 bool "Support for backlight control"
1114 depends on FB_ATY && PPC_PMAC 1108 depends on FB_ATY && PMAC_BACKLIGHT
1115 select FB_BACKLIGHT 1109 select FB_BACKLIGHT
1116 select BACKLIGHT_LCD_SUPPORT
1117 select BACKLIGHT_CLASS_DEVICE
1118 default y 1110 default y
1119 help 1111 help
1120 Say Y here if you want to control the backlight of your display. 1112 Say Y here if you want to control the backlight of your display.
@@ -1518,6 +1510,26 @@ config FB_PXA_PARAMETERS
1518 1510
1519 <file:Documentation/fb/pxafb.txt> describes the available parameters. 1511 <file:Documentation/fb/pxafb.txt> describes the available parameters.
1520 1512
1513config FB_MBX
1514 tristate "2700G LCD framebuffer support"
1515 depends on FB && ARCH_PXA
1516 select FB_CFB_FILLRECT
1517 select FB_CFB_COPYAREA
1518 select FB_CFB_IMAGEBLIT
1519 ---help---
1520 Framebuffer driver for the Intel 2700G (Marathon) Graphics
1521 Accelerator
1522
1523config FB_MBX_DEBUG
1524 bool "Enable debugging info via debugfs"
1525 depends on FB_MBX && DEBUG_FS
1526 default n
1527 ---help---
1528 Enable this if you want debugging information using the debug
1529 filesystem (debugfs)
1530
1531 If unsure, say N.
1532
1521config FB_W100 1533config FB_W100
1522 tristate "W100 frame buffer support" 1534 tristate "W100 frame buffer support"
1523 depends on FB && PXA_SHARPSL 1535 depends on FB && PXA_SHARPSL
@@ -1600,7 +1612,7 @@ if FB || SGI_NEWPORT_CONSOLE
1600 source "drivers/video/logo/Kconfig" 1612 source "drivers/video/logo/Kconfig"
1601endif 1613endif
1602 1614
1603if FB && SYSFS 1615if SYSFS
1604 source "drivers/video/backlight/Kconfig" 1616 source "drivers/video/backlight/Kconfig"
1605endif 1617endif
1606 1618
diff --git a/drivers/video/Makefile b/drivers/video/Makefile
index 6283d015f8f5..481c6c9695f8 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -4,6 +4,7 @@
4 4
5# Each configuration option enables a list of files. 5# Each configuration option enables a list of files.
6 6
7obj-y += fb_notify.o
7obj-$(CONFIG_FB) += fb.o 8obj-$(CONFIG_FB) += fb.o
8fb-y := fbmem.o fbmon.o fbcmap.o fbsysfs.o \ 9fb-y := fbmem.o fbmon.o fbcmap.o fbsysfs.o \
9 modedb.o fbcvt.o 10 modedb.o fbcvt.o
@@ -38,6 +39,7 @@ obj-$(CONFIG_FB_SIS) += sis/
38obj-$(CONFIG_FB_KYRO) += kyro/ 39obj-$(CONFIG_FB_KYRO) += kyro/
39obj-$(CONFIG_FB_SAVAGE) += savage/ 40obj-$(CONFIG_FB_SAVAGE) += savage/
40obj-$(CONFIG_FB_GEODE) += geode/ 41obj-$(CONFIG_FB_GEODE) += geode/
42obj-$(CONFIG_FB_MBX) += mbx/
41obj-$(CONFIG_FB_I810) += vgastate.o 43obj-$(CONFIG_FB_I810) += vgastate.o
42obj-$(CONFIG_FB_NEOMAGIC) += neofb.o vgastate.o 44obj-$(CONFIG_FB_NEOMAGIC) += neofb.o vgastate.o
43obj-$(CONFIG_FB_VIRGE) += virgefb.o 45obj-$(CONFIG_FB_VIRGE) += virgefb.o
diff --git a/drivers/video/S3triofb.c b/drivers/video/S3triofb.c
index e714e8449c1d..afd146f5f683 100644
--- a/drivers/video/S3triofb.c
+++ b/drivers/video/S3triofb.c
@@ -28,7 +28,6 @@
28#include <linux/errno.h> 28#include <linux/errno.h>
29#include <linux/string.h> 29#include <linux/string.h>
30#include <linux/mm.h> 30#include <linux/mm.h>
31#include <linux/tty.h>
32#include <linux/slab.h> 31#include <linux/slab.h>
33#include <linux/vmalloc.h> 32#include <linux/vmalloc.h>
34#include <linux/delay.h> 33#include <linux/delay.h>
diff --git a/drivers/video/amifb.c b/drivers/video/amifb.c
index f9bc9f777e75..f1ba54f4fc39 100644
--- a/drivers/video/amifb.c
+++ b/drivers/video/amifb.c
@@ -45,7 +45,6 @@
45#include <linux/errno.h> 45#include <linux/errno.h>
46#include <linux/string.h> 46#include <linux/string.h>
47#include <linux/mm.h> 47#include <linux/mm.h>
48#include <linux/tty.h>
49#include <linux/slab.h> 48#include <linux/slab.h>
50#include <linux/delay.h> 49#include <linux/delay.h>
51#include <linux/interrupt.h> 50#include <linux/interrupt.h>
diff --git a/drivers/video/arcfb.c b/drivers/video/arcfb.c
index fd95c2dbd4f7..70dd8115a4d8 100644
--- a/drivers/video/arcfb.c
+++ b/drivers/video/arcfb.c
@@ -39,7 +39,6 @@
39#include <linux/errno.h> 39#include <linux/errno.h>
40#include <linux/string.h> 40#include <linux/string.h>
41#include <linux/mm.h> 41#include <linux/mm.h>
42#include <linux/tty.h>
43#include <linux/slab.h> 42#include <linux/slab.h>
44#include <linux/vmalloc.h> 43#include <linux/vmalloc.h>
45#include <linux/delay.h> 44#include <linux/delay.h>
diff --git a/drivers/video/asiliantfb.c b/drivers/video/asiliantfb.c
index eaeaf4d1a094..1fd22f460b0f 100644
--- a/drivers/video/asiliantfb.c
+++ b/drivers/video/asiliantfb.c
@@ -34,7 +34,6 @@
34#include <linux/errno.h> 34#include <linux/errno.h>
35#include <linux/string.h> 35#include <linux/string.h>
36#include <linux/mm.h> 36#include <linux/mm.h>
37#include <linux/tty.h>
38#include <linux/slab.h> 37#include <linux/slab.h>
39#include <linux/vmalloc.h> 38#include <linux/vmalloc.h>
40#include <linux/delay.h> 39#include <linux/delay.h>
diff --git a/drivers/video/atafb.c b/drivers/video/atafb.c
index e69ab65f7843..5831893bf7a0 100644
--- a/drivers/video/atafb.c
+++ b/drivers/video/atafb.c
@@ -53,7 +53,6 @@
53#include <linux/errno.h> 53#include <linux/errno.h>
54#include <linux/string.h> 54#include <linux/string.h>
55#include <linux/mm.h> 55#include <linux/mm.h>
56#include <linux/tty.h>
57#include <linux/slab.h> 56#include <linux/slab.h>
58#include <linux/delay.h> 57#include <linux/delay.h>
59#include <linux/init.h> 58#include <linux/init.h>
diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c
index 72c589109471..8b08121b390b 100644
--- a/drivers/video/aty/aty128fb.c
+++ b/drivers/video/aty/aty128fb.c
@@ -52,7 +52,6 @@
52#include <linux/errno.h> 52#include <linux/errno.h>
53#include <linux/string.h> 53#include <linux/string.h>
54#include <linux/mm.h> 54#include <linux/mm.h>
55#include <linux/tty.h>
56#include <linux/slab.h> 55#include <linux/slab.h>
57#include <linux/vmalloc.h> 56#include <linux/vmalloc.h>
58#include <linux/delay.h> 57#include <linux/delay.h>
@@ -457,6 +456,10 @@ static void wait_for_fifo(u16 entries, struct aty128fb_par *par);
457static void wait_for_idle(struct aty128fb_par *par); 456static void wait_for_idle(struct aty128fb_par *par);
458static u32 depth_to_dst(u32 depth); 457static u32 depth_to_dst(u32 depth);
459 458
459#ifdef CONFIG_FB_ATY128_BACKLIGHT
460static void aty128_bl_set_power(struct fb_info *info, int power);
461#endif
462
460#define BIOS_IN8(v) (readb(bios + (v))) 463#define BIOS_IN8(v) (readb(bios + (v)))
461#define BIOS_IN16(v) (readb(bios + (v)) | \ 464#define BIOS_IN16(v) (readb(bios + (v)) | \
462 (readb(bios + (v) + 1) << 8)) 465 (readb(bios + (v) + 1) << 8))
@@ -1258,25 +1261,11 @@ static void aty128_set_lcd_enable(struct aty128fb_par *par, int on)
1258 reg &= ~LVDS_DISPLAY_DIS; 1261 reg &= ~LVDS_DISPLAY_DIS;
1259 aty_st_le32(LVDS_GEN_CNTL, reg); 1262 aty_st_le32(LVDS_GEN_CNTL, reg);
1260#ifdef CONFIG_FB_ATY128_BACKLIGHT 1263#ifdef CONFIG_FB_ATY128_BACKLIGHT
1261 mutex_lock(&info->bl_mutex); 1264 aty128_bl_set_power(info, FB_BLANK_UNBLANK);
1262 if (info->bl_dev) {
1263 down(&info->bl_dev->sem);
1264 info->bl_dev->props->update_status(info->bl_dev);
1265 up(&info->bl_dev->sem);
1266 }
1267 mutex_unlock(&info->bl_mutex);
1268#endif 1265#endif
1269 } else { 1266 } else {
1270#ifdef CONFIG_FB_ATY128_BACKLIGHT 1267#ifdef CONFIG_FB_ATY128_BACKLIGHT
1271 mutex_lock(&info->bl_mutex); 1268 aty128_bl_set_power(info, FB_BLANK_POWERDOWN);
1272 if (info->bl_dev) {
1273 down(&info->bl_dev->sem);
1274 info->bl_dev->props->brightness = 0;
1275 info->bl_dev->props->power = FB_BLANK_POWERDOWN;
1276 info->bl_dev->props->update_status(info->bl_dev);
1277 up(&info->bl_dev->sem);
1278 }
1279 mutex_unlock(&info->bl_mutex);
1280#endif 1269#endif
1281 reg = aty_ld_le32(LVDS_GEN_CNTL); 1270 reg = aty_ld_le32(LVDS_GEN_CNTL);
1282 reg |= LVDS_DISPLAY_DIS; 1271 reg |= LVDS_DISPLAY_DIS;
@@ -1703,6 +1692,7 @@ static int __devinit aty128fb_setup(char *options)
1703 1692
1704static struct backlight_properties aty128_bl_data; 1693static struct backlight_properties aty128_bl_data;
1705 1694
1695/* Call with fb_info->bl_mutex held */
1706static int aty128_bl_get_level_brightness(struct aty128fb_par *par, 1696static int aty128_bl_get_level_brightness(struct aty128fb_par *par,
1707 int level) 1697 int level)
1708{ 1698{
@@ -1710,10 +1700,8 @@ static int aty128_bl_get_level_brightness(struct aty128fb_par *par,
1710 int atylevel; 1700 int atylevel;
1711 1701
1712 /* Get and convert the value */ 1702 /* Get and convert the value */
1713 mutex_lock(&info->bl_mutex);
1714 atylevel = MAX_LEVEL - 1703 atylevel = MAX_LEVEL -
1715 (info->bl_curve[level] * FB_BACKLIGHT_MAX / MAX_LEVEL); 1704 (info->bl_curve[level] * FB_BACKLIGHT_MAX / MAX_LEVEL);
1716 mutex_unlock(&info->bl_mutex);
1717 1705
1718 if (atylevel < 0) 1706 if (atylevel < 0)
1719 atylevel = 0; 1707 atylevel = 0;
@@ -1731,7 +1719,8 @@ static int aty128_bl_get_level_brightness(struct aty128fb_par *par,
1731/* That one prevents proper CRT output with LCD off */ 1719/* That one prevents proper CRT output with LCD off */
1732#undef BACKLIGHT_DAC_OFF 1720#undef BACKLIGHT_DAC_OFF
1733 1721
1734static int aty128_bl_update_status(struct backlight_device *bd) 1722/* Call with fb_info->bl_mutex held */
1723static int __aty128_bl_update_status(struct backlight_device *bd)
1735{ 1724{
1736 struct aty128fb_par *par = class_get_devdata(&bd->class_dev); 1725 struct aty128fb_par *par = class_get_devdata(&bd->class_dev);
1737 unsigned int reg = aty_ld_le32(LVDS_GEN_CNTL); 1726 unsigned int reg = aty_ld_le32(LVDS_GEN_CNTL);
@@ -1784,6 +1773,19 @@ static int aty128_bl_update_status(struct backlight_device *bd)
1784 return 0; 1773 return 0;
1785} 1774}
1786 1775
1776static int aty128_bl_update_status(struct backlight_device *bd)
1777{
1778 struct aty128fb_par *par = class_get_devdata(&bd->class_dev);
1779 struct fb_info *info = pci_get_drvdata(par->pdev);
1780 int ret;
1781
1782 mutex_lock(&info->bl_mutex);
1783 ret = __aty128_bl_update_status(bd);
1784 mutex_unlock(&info->bl_mutex);
1785
1786 return ret;
1787}
1788
1787static int aty128_bl_get_brightness(struct backlight_device *bd) 1789static int aty128_bl_get_brightness(struct backlight_device *bd)
1788{ 1790{
1789 return bd->props->brightness; 1791 return bd->props->brightness;
@@ -1796,6 +1798,16 @@ static struct backlight_properties aty128_bl_data = {
1796 .max_brightness = (FB_BACKLIGHT_LEVELS - 1), 1798 .max_brightness = (FB_BACKLIGHT_LEVELS - 1),
1797}; 1799};
1798 1800
1801static void aty128_bl_set_power(struct fb_info *info, int power)
1802{
1803 mutex_lock(&info->bl_mutex);
1804 up(&info->bl_dev->sem);
1805 info->bl_dev->props->power = power;
1806 __aty128_bl_update_status(info->bl_dev);
1807 down(&info->bl_dev->sem);
1808 mutex_unlock(&info->bl_mutex);
1809}
1810
1799static void aty128_bl_init(struct aty128fb_par *par) 1811static void aty128_bl_init(struct aty128fb_par *par)
1800{ 1812{
1801 struct fb_info *info = pci_get_drvdata(par->pdev); 1813 struct fb_info *info = pci_get_drvdata(par->pdev);
@@ -2198,12 +2210,8 @@ static int aty128fb_blank(int blank, struct fb_info *fb)
2198 return 0; 2210 return 0;
2199 2211
2200#ifdef CONFIG_FB_ATY128_BACKLIGHT 2212#ifdef CONFIG_FB_ATY128_BACKLIGHT
2201 if (machine_is(powermac) && blank) { 2213 if (machine_is(powermac) && blank)
2202 down(&fb->bl_dev->sem); 2214 aty128_bl_set_power(fb, FB_BLANK_POWERDOWN);
2203 fb->bl_dev->props->power = FB_BLANK_POWERDOWN;
2204 fb->bl_dev->props->update_status(fb->bl_dev);
2205 up(&fb->bl_dev->sem);
2206 }
2207#endif 2215#endif
2208 2216
2209 if (blank & FB_BLANK_VSYNC_SUSPEND) 2217 if (blank & FB_BLANK_VSYNC_SUSPEND)
@@ -2219,14 +2227,12 @@ static int aty128fb_blank(int blank, struct fb_info *fb)
2219 aty128_set_crt_enable(par, par->crt_on && !blank); 2227 aty128_set_crt_enable(par, par->crt_on && !blank);
2220 aty128_set_lcd_enable(par, par->lcd_on && !blank); 2228 aty128_set_lcd_enable(par, par->lcd_on && !blank);
2221 } 2229 }
2230
2222#ifdef CONFIG_FB_ATY128_BACKLIGHT 2231#ifdef CONFIG_FB_ATY128_BACKLIGHT
2223 if (machine_is(powermac) && !blank) { 2232 if (machine_is(powermac) && !blank)
2224 down(&fb->bl_dev->sem); 2233 aty128_bl_set_power(fb, FB_BLANK_UNBLANK);
2225 fb->bl_dev->props->power = FB_BLANK_UNBLANK;
2226 fb->bl_dev->props->update_status(fb->bl_dev);
2227 up(&fb->bl_dev->sem);
2228 }
2229#endif 2234#endif
2235
2230 return 0; 2236 return 0;
2231} 2237}
2232 2238
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index 0c9706746d79..053ff63365b7 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -2129,15 +2129,14 @@ static int atyfb_pci_resume(struct pci_dev *pdev)
2129 2129
2130static struct backlight_properties aty_bl_data; 2130static struct backlight_properties aty_bl_data;
2131 2131
2132/* Call with fb_info->bl_mutex held */
2132static int aty_bl_get_level_brightness(struct atyfb_par *par, int level) 2133static int aty_bl_get_level_brightness(struct atyfb_par *par, int level)
2133{ 2134{
2134 struct fb_info *info = pci_get_drvdata(par->pdev); 2135 struct fb_info *info = pci_get_drvdata(par->pdev);
2135 int atylevel; 2136 int atylevel;
2136 2137
2137 /* Get and convert the value */ 2138 /* Get and convert the value */
2138 mutex_lock(&info->bl_mutex);
2139 atylevel = info->bl_curve[level] * FB_BACKLIGHT_MAX / MAX_LEVEL; 2139 atylevel = info->bl_curve[level] * FB_BACKLIGHT_MAX / MAX_LEVEL;
2140 mutex_unlock(&info->bl_mutex);
2141 2140
2142 if (atylevel < 0) 2141 if (atylevel < 0)
2143 atylevel = 0; 2142 atylevel = 0;
@@ -2147,7 +2146,8 @@ static int aty_bl_get_level_brightness(struct atyfb_par *par, int level)
2147 return atylevel; 2146 return atylevel;
2148} 2147}
2149 2148
2150static int aty_bl_update_status(struct backlight_device *bd) 2149/* Call with fb_info->bl_mutex held */
2150static int __aty_bl_update_status(struct backlight_device *bd)
2151{ 2151{
2152 struct atyfb_par *par = class_get_devdata(&bd->class_dev); 2152 struct atyfb_par *par = class_get_devdata(&bd->class_dev);
2153 unsigned int reg = aty_ld_lcd(LCD_MISC_CNTL, par); 2153 unsigned int reg = aty_ld_lcd(LCD_MISC_CNTL, par);
@@ -2172,6 +2172,19 @@ static int aty_bl_update_status(struct backlight_device *bd)
2172 return 0; 2172 return 0;
2173} 2173}
2174 2174
2175static int aty_bl_update_status(struct backlight_device *bd)
2176{
2177 struct atyfb_par *par = class_get_devdata(&bd->class_dev);
2178 struct fb_info *info = pci_get_drvdata(par->pdev);
2179 int ret;
2180
2181 mutex_lock(&info->bl_mutex);
2182 ret = __aty_bl_update_status(bd);
2183 mutex_unlock(&info->bl_mutex);
2184
2185 return ret;
2186}
2187
2175static int aty_bl_get_brightness(struct backlight_device *bd) 2188static int aty_bl_get_brightness(struct backlight_device *bd)
2176{ 2189{
2177 return bd->props->brightness; 2190 return bd->props->brightness;
@@ -2184,6 +2197,16 @@ static struct backlight_properties aty_bl_data = {
2184 .max_brightness = (FB_BACKLIGHT_LEVELS - 1), 2197 .max_brightness = (FB_BACKLIGHT_LEVELS - 1),
2185}; 2198};
2186 2199
2200static void aty_bl_set_power(struct fb_info *info, int power)
2201{
2202 mutex_lock(&info->bl_mutex);
2203 up(&info->bl_dev->sem);
2204 info->bl_dev->props->power = power;
2205 __aty_bl_update_status(info->bl_dev);
2206 down(&info->bl_dev->sem);
2207 mutex_unlock(&info->bl_mutex);
2208}
2209
2187static void aty_bl_init(struct atyfb_par *par) 2210static void aty_bl_init(struct atyfb_par *par)
2188{ 2211{
2189 struct fb_info *info = pci_get_drvdata(par->pdev); 2212 struct fb_info *info = pci_get_drvdata(par->pdev);
@@ -2789,17 +2812,9 @@ static int atyfb_blank(int blank, struct fb_info *info)
2789 if (par->lock_blank || par->asleep) 2812 if (par->lock_blank || par->asleep)
2790 return 0; 2813 return 0;
2791 2814
2792#ifdef CONFIG_PMAC_BACKLIGHT 2815#ifdef CONFIG_FB_ATY_BACKLIGHT
2793 if (machine_is(powermac) && blank > FB_BLANK_NORMAL) { 2816 if (machine_is(powermac) && blank > FB_BLANK_NORMAL)
2794 mutex_lock(&info->bl_mutex); 2817 aty_bl_set_power(info, FB_BLANK_POWERDOWN);
2795 if (info->bl_dev) {
2796 down(&info->bl_dev->sem);
2797 info->bl_dev->props->power = FB_BLANK_POWERDOWN;
2798 info->bl_dev->props->update_status(info->bl_dev);
2799 up(&info->bl_dev->sem);
2800 }
2801 mutex_unlock(&info->bl_mutex);
2802 }
2803#elif defined(CONFIG_FB_ATY_GENERIC_LCD) 2818#elif defined(CONFIG_FB_ATY_GENERIC_LCD)
2804 if (par->lcd_table && blank > FB_BLANK_NORMAL && 2819 if (par->lcd_table && blank > FB_BLANK_NORMAL &&
2805 (aty_ld_lcd(LCD_GEN_CNTL, par) & LCD_ON)) { 2820 (aty_ld_lcd(LCD_GEN_CNTL, par) & LCD_ON)) {
@@ -2829,17 +2844,9 @@ static int atyfb_blank(int blank, struct fb_info *info)
2829 } 2844 }
2830 aty_st_le32(CRTC_GEN_CNTL, gen_cntl, par); 2845 aty_st_le32(CRTC_GEN_CNTL, gen_cntl, par);
2831 2846
2832#ifdef CONFIG_PMAC_BACKLIGHT 2847#ifdef CONFIG_FB_ATY_BACKLIGHT
2833 if (machine_is(powermac) && blank <= FB_BLANK_NORMAL) { 2848 if (machine_is(powermac) && blank <= FB_BLANK_NORMAL)
2834 mutex_lock(&info->bl_mutex); 2849 aty_bl_set_power(info, FB_BLANK_UNBLANK);
2835 if (info->bl_dev) {
2836 down(&info->bl_dev->sem);
2837 info->bl_dev->props->power = FB_BLANK_UNBLANK;
2838 info->bl_dev->props->update_status(info->bl_dev);
2839 up(&info->bl_dev->sem);
2840 }
2841 mutex_unlock(&info->bl_mutex);
2842 }
2843#elif defined(CONFIG_FB_ATY_GENERIC_LCD) 2850#elif defined(CONFIG_FB_ATY_GENERIC_LCD)
2844 if (par->lcd_table && blank <= FB_BLANK_NORMAL && 2851 if (par->lcd_table && blank <= FB_BLANK_NORMAL &&
2845 (aty_ld_lcd(LCD_GEN_CNTL, par) & LCD_ON)) { 2852 (aty_ld_lcd(LCD_GEN_CNTL, par) & LCD_ON)) {
diff --git a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c
index 51b78f8de949..8e3400d5dd21 100644
--- a/drivers/video/aty/radeon_base.c
+++ b/drivers/video/aty/radeon_base.c
@@ -58,7 +58,6 @@
58#include <linux/errno.h> 58#include <linux/errno.h>
59#include <linux/string.h> 59#include <linux/string.h>
60#include <linux/mm.h> 60#include <linux/mm.h>
61#include <linux/tty.h>
62#include <linux/slab.h> 61#include <linux/slab.h>
63#include <linux/delay.h> 62#include <linux/delay.h>
64#include <linux/time.h> 63#include <linux/time.h>
@@ -267,6 +266,8 @@ static int force_measure_pll = 0;
267#ifdef CONFIG_MTRR 266#ifdef CONFIG_MTRR
268static int nomtrr = 0; 267static int nomtrr = 0;
269#endif 268#endif
269static int force_sleep;
270static int ignore_devlist;
270 271
271/* 272/*
272 * prototypes 273 * prototypes
@@ -2328,9 +2329,9 @@ static int __devinit radeonfb_pci_register (struct pci_dev *pdev,
2328 /* -2 is special: means ON on mobility chips and do not 2329 /* -2 is special: means ON on mobility chips and do not
2329 * change on others 2330 * change on others
2330 */ 2331 */
2331 radeonfb_pm_init(rinfo, rinfo->is_mobility ? 1 : -1); 2332 radeonfb_pm_init(rinfo, rinfo->is_mobility ? 1 : -1, ignore_devlist, force_sleep);
2332 } else 2333 } else
2333 radeonfb_pm_init(rinfo, default_dynclk); 2334 radeonfb_pm_init(rinfo, default_dynclk, ignore_devlist, force_sleep);
2334 2335
2335 pci_set_drvdata(pdev, info); 2336 pci_set_drvdata(pdev, info);
2336 2337
@@ -2478,6 +2479,12 @@ static int __init radeonfb_setup (char *options)
2478 force_measure_pll = 1; 2479 force_measure_pll = 1;
2479 } else if (!strncmp(this_opt, "ignore_edid", 11)) { 2480 } else if (!strncmp(this_opt, "ignore_edid", 11)) {
2480 ignore_edid = 1; 2481 ignore_edid = 1;
2482#if defined(CONFIG_PM) && defined(CONFIG_X86)
2483 } else if (!strncmp(this_opt, "force_sleep", 11)) {
2484 force_sleep = 1;
2485 } else if (!strncmp(this_opt, "ignore_devlist", 14)) {
2486 ignore_devlist = 1;
2487#endif
2481 } else 2488 } else
2482 mode_option = this_opt; 2489 mode_option = this_opt;
2483 } 2490 }
@@ -2533,3 +2540,9 @@ module_param(panel_yres, int, 0);
2533MODULE_PARM_DESC(panel_yres, "int: set panel yres"); 2540MODULE_PARM_DESC(panel_yres, "int: set panel yres");
2534module_param(mode_option, charp, 0); 2541module_param(mode_option, charp, 0);
2535MODULE_PARM_DESC(mode_option, "Specify resolution as \"<xres>x<yres>[-<bpp>][@<refresh>]\" "); 2542MODULE_PARM_DESC(mode_option, "Specify resolution as \"<xres>x<yres>[-<bpp>][@<refresh>]\" ");
2543#if defined(CONFIG_PM) && defined(CONFIG_X86)
2544module_param(force_sleep, bool, 0);
2545MODULE_PARM_DESC(force_sleep, "bool: force D2 sleep mode on all hardware");
2546module_param(ignore_devlist, bool, 0);
2547MODULE_PARM_DESC(ignore_devlist, "bool: ignore workarounds for bugs in specific laptops");
2548#endif
diff --git a/drivers/video/aty/radeon_pm.c b/drivers/video/aty/radeon_pm.c
index c7091761cef4..f31e606a2ded 100644
--- a/drivers/video/aty/radeon_pm.c
+++ b/drivers/video/aty/radeon_pm.c
@@ -27,6 +27,99 @@
27 27
28#include "ati_ids.h" 28#include "ati_ids.h"
29 29
30static void radeon_reinitialize_M10(struct radeonfb_info *rinfo);
31
32/*
33 * Workarounds for bugs in PC laptops:
34 * - enable D2 sleep in some IBM Thinkpads
35 * - special case for Samsung P35
36 *
37 * Whitelist by subsystem vendor/device because
38 * its the subsystem vendor's fault!
39 */
40
41#if defined(CONFIG_PM) && defined(CONFIG_X86)
42struct radeon_device_id {
43 const char *ident; /* (arbitrary) Name */
44 const unsigned short subsystem_vendor; /* Subsystem Vendor ID */
45 const unsigned short subsystem_device; /* Subsystem Device ID */
46 const enum radeon_pm_mode pm_mode_modifier; /* modify pm_mode */
47 const reinit_function_ptr new_reinit_func; /* changed reinit_func */
48};
49
50#define BUGFIX(model, sv, sd, pm, fn) { \
51 .ident = model, \
52 .subsystem_vendor = sv, \
53 .subsystem_device = sd, \
54 .pm_mode_modifier = pm, \
55 .new_reinit_func = fn \
56}
57
58static struct radeon_device_id radeon_workaround_list[] = {
59 BUGFIX("IBM Thinkpad R32",
60 PCI_VENDOR_ID_IBM, 0x1905,
61 radeon_pm_d2, NULL),
62 BUGFIX("IBM Thinkpad R40",
63 PCI_VENDOR_ID_IBM, 0x0526,
64 radeon_pm_d2, NULL),
65 BUGFIX("IBM Thinkpad R40",
66 PCI_VENDOR_ID_IBM, 0x0527,
67 radeon_pm_d2, NULL),
68 BUGFIX("IBM Thinkpad R50/R51/T40/T41",
69 PCI_VENDOR_ID_IBM, 0x0531,
70 radeon_pm_d2, NULL),
71 BUGFIX("IBM Thinkpad R51/T40/T41/T42",
72 PCI_VENDOR_ID_IBM, 0x0530,
73 radeon_pm_d2, NULL),
74 BUGFIX("IBM Thinkpad T30",
75 PCI_VENDOR_ID_IBM, 0x0517,
76 radeon_pm_d2, NULL),
77 BUGFIX("IBM Thinkpad T40p",
78 PCI_VENDOR_ID_IBM, 0x054d,
79 radeon_pm_d2, NULL),
80 BUGFIX("IBM Thinkpad T42",
81 PCI_VENDOR_ID_IBM, 0x0550,
82 radeon_pm_d2, NULL),
83 BUGFIX("IBM Thinkpad X31/X32",
84 PCI_VENDOR_ID_IBM, 0x052f,
85 radeon_pm_d2, NULL),
86 BUGFIX("Samsung P35",
87 PCI_VENDOR_ID_SAMSUNG, 0xc00c,
88 radeon_pm_off, radeon_reinitialize_M10),
89 { .ident = NULL }
90};
91
92static int radeon_apply_workarounds(struct radeonfb_info *rinfo)
93{
94 struct radeon_device_id *id;
95
96 for (id = radeon_workaround_list; id->ident != NULL; id++ )
97 if ((id->subsystem_vendor == rinfo->pdev->subsystem_vendor ) &&
98 (id->subsystem_device == rinfo->pdev->subsystem_device )) {
99
100 /* we found a device that requires workaround */
101 printk(KERN_DEBUG "radeonfb: %s detected"
102 ", enabling workaround\n", id->ident);
103
104 rinfo->pm_mode |= id->pm_mode_modifier;
105
106 if (id->new_reinit_func != NULL)
107 rinfo->reinit_func = id->new_reinit_func;
108
109 return 1;
110 }
111 return 0; /* not found */
112}
113
114#else /* defined(CONFIG_PM) && defined(CONFIG_X86) */
115static inline int radeon_apply_workarounds(struct radeonfb_info *rinfo)
116{
117 return 0;
118}
119#endif /* defined(CONFIG_PM) && defined(CONFIG_X86) */
120
121
122
30static void radeon_pm_disable_dynamic_mode(struct radeonfb_info *rinfo) 123static void radeon_pm_disable_dynamic_mode(struct radeonfb_info *rinfo)
31{ 124{
32 u32 tmp; 125 u32 tmp;
@@ -852,18 +945,26 @@ static void radeon_pm_setup_for_suspend(struct radeonfb_info *rinfo)
852 /* because both INPLL and OUTPLL take the same lock, that's why. */ 945 /* because both INPLL and OUTPLL take the same lock, that's why. */
853 tmp = INPLL( pllMCLK_MISC) | MCLK_MISC__EN_MCLK_TRISTATE_IN_SUSPEND; 946 tmp = INPLL( pllMCLK_MISC) | MCLK_MISC__EN_MCLK_TRISTATE_IN_SUSPEND;
854 OUTPLL( pllMCLK_MISC, tmp); 947 OUTPLL( pllMCLK_MISC, tmp);
855
856 /* AGP PLL control */
857 if (rinfo->family <= CHIP_FAMILY_RV280) {
858 OUTREG(BUS_CNTL1, INREG(BUS_CNTL1) | BUS_CNTL1__AGPCLK_VALID);
859 948
860 OUTREG(BUS_CNTL1, 949 /* BUS_CNTL1__MOBILE_PLATORM_SEL setting is northbridge chipset
861 (INREG(BUS_CNTL1) & ~BUS_CNTL1__MOBILE_PLATFORM_SEL_MASK) 950 * and radeon chip dependent. Thus we only enable it on Mac for
862 | (2<<BUS_CNTL1__MOBILE_PLATFORM_SEL__SHIFT)); // 440BX 951 * now (until we get more info on how to compute the correct
863 } else { 952 * value for various X86 bridges).
864 OUTREG(BUS_CNTL1, INREG(BUS_CNTL1)); 953 */
865 OUTREG(BUS_CNTL1, (INREG(BUS_CNTL1) & ~0x4000) | 0x8000); 954#ifdef CONFIG_PPC_PMAC
955 if (machine_is(powermac)) {
956 /* AGP PLL control */
957 if (rinfo->family <= CHIP_FAMILY_RV280) {
958 OUTREG(BUS_CNTL1, INREG(BUS_CNTL1) | BUS_CNTL1__AGPCLK_VALID);
959 OUTREG(BUS_CNTL1,
960 (INREG(BUS_CNTL1) & ~BUS_CNTL1__MOBILE_PLATFORM_SEL_MASK)
961 | (2<<BUS_CNTL1__MOBILE_PLATFORM_SEL__SHIFT)); // 440BX
962 } else {
963 OUTREG(BUS_CNTL1, INREG(BUS_CNTL1));
964 OUTREG(BUS_CNTL1, (INREG(BUS_CNTL1) & ~0x4000) | 0x8000);
965 }
866 } 966 }
967#endif
867 968
868 OUTREG(CRTC_OFFSET_CNTL, (INREG(CRTC_OFFSET_CNTL) 969 OUTREG(CRTC_OFFSET_CNTL, (INREG(CRTC_OFFSET_CNTL)
869 & ~CRTC_OFFSET_CNTL__CRTC_STEREO_SYNC_OUT_EN)); 970 & ~CRTC_OFFSET_CNTL__CRTC_STEREO_SYNC_OUT_EN));
@@ -2713,7 +2814,7 @@ static void radeonfb_early_resume(void *data)
2713 2814
2714#endif /* CONFIG_PM */ 2815#endif /* CONFIG_PM */
2715 2816
2716void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk) 2817void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk, int ignore_devlist, int force_sleep)
2717{ 2818{
2718 /* Find PM registers in config space if any*/ 2819 /* Find PM registers in config space if any*/
2719 rinfo->pm_reg = pci_find_capability(rinfo->pdev, PCI_CAP_ID_PM); 2820 rinfo->pm_reg = pci_find_capability(rinfo->pdev, PCI_CAP_ID_PM);
@@ -2729,22 +2830,13 @@ void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk)
2729 } 2830 }
2730 2831
2731#if defined(CONFIG_PM) 2832#if defined(CONFIG_PM)
2833#if defined(CONFIG_PPC_PMAC)
2732 /* Check if we can power manage on suspend/resume. We can do 2834 /* Check if we can power manage on suspend/resume. We can do
2733 * D2 on M6, M7 and M9, and we can resume from D3 cold a few other 2835 * D2 on M6, M7 and M9, and we can resume from D3 cold a few other
2734 * "Mac" cards, but that's all. We need more infos about what the 2836 * "Mac" cards, but that's all. We need more infos about what the
2735 * BIOS does tho. Right now, all this PM stuff is pmac-only for that 2837 * BIOS does tho. Right now, all this PM stuff is pmac-only for that
2736 * reason. --BenH 2838 * reason. --BenH
2737 */ 2839 */
2738 /* Special case for Samsung P35 laptops
2739 */
2740 if ((rinfo->pdev->vendor == PCI_VENDOR_ID_ATI) &&
2741 (rinfo->pdev->device == PCI_CHIP_RV350_NP) &&
2742 (rinfo->pdev->subsystem_vendor == PCI_VENDOR_ID_SAMSUNG) &&
2743 (rinfo->pdev->subsystem_device == 0xc00c)) {
2744 rinfo->reinit_func = radeon_reinitialize_M10;
2745 rinfo->pm_mode |= radeon_pm_off;
2746 }
2747#if defined(CONFIG_PPC_PMAC)
2748 if (machine_is(powermac) && rinfo->of_node) { 2840 if (machine_is(powermac) && rinfo->of_node) {
2749 if (rinfo->is_mobility && rinfo->pm_reg && 2841 if (rinfo->is_mobility && rinfo->pm_reg &&
2750 rinfo->family <= CHIP_FAMILY_RV250) 2842 rinfo->family <= CHIP_FAMILY_RV250)
@@ -2790,6 +2882,18 @@ void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk)
2790 } 2882 }
2791#endif /* defined(CONFIG_PPC_PMAC) */ 2883#endif /* defined(CONFIG_PPC_PMAC) */
2792#endif /* defined(CONFIG_PM) */ 2884#endif /* defined(CONFIG_PM) */
2885
2886 if (ignore_devlist)
2887 printk(KERN_DEBUG
2888 "radeonfb: skipping test for device workarounds\n");
2889 else
2890 radeon_apply_workarounds(rinfo);
2891
2892 if (force_sleep) {
2893 printk(KERN_DEBUG
2894 "radeonfb: forcefully enabling D2 sleep mode\n");
2895 rinfo->pm_mode |= radeon_pm_d2;
2896 }
2793} 2897}
2794 2898
2795void radeonfb_pm_exit(struct radeonfb_info *rinfo) 2899void radeonfb_pm_exit(struct radeonfb_info *rinfo)
diff --git a/drivers/video/aty/radeonfb.h b/drivers/video/aty/radeonfb.h
index 38657b2d10eb..d5ff224a6258 100644
--- a/drivers/video/aty/radeonfb.h
+++ b/drivers/video/aty/radeonfb.h
@@ -273,6 +273,8 @@ enum radeon_pm_mode {
273 radeon_pm_off = 0x00000002, /* Can resume from D3 cold */ 273 radeon_pm_off = 0x00000002, /* Can resume from D3 cold */
274}; 274};
275 275
276typedef void (*reinit_function_ptr)(struct radeonfb_info *rinfo);
277
276struct radeonfb_info { 278struct radeonfb_info {
277 struct fb_info *info; 279 struct fb_info *info;
278 280
@@ -338,7 +340,7 @@ struct radeonfb_info {
338 int dynclk; 340 int dynclk;
339 int no_schedule; 341 int no_schedule;
340 enum radeon_pm_mode pm_mode; 342 enum radeon_pm_mode pm_mode;
341 void (*reinit_func)(struct radeonfb_info *rinfo); 343 reinit_function_ptr reinit_func;
342 344
343 /* Lock on register access */ 345 /* Lock on register access */
344 spinlock_t reg_lock; 346 spinlock_t reg_lock;
@@ -600,7 +602,7 @@ extern int radeon_probe_i2c_connector(struct radeonfb_info *rinfo, int conn, u8
600/* PM Functions */ 602/* PM Functions */
601extern int radeonfb_pci_suspend(struct pci_dev *pdev, pm_message_t state); 603extern int radeonfb_pci_suspend(struct pci_dev *pdev, pm_message_t state);
602extern int radeonfb_pci_resume(struct pci_dev *pdev); 604extern int radeonfb_pci_resume(struct pci_dev *pdev);
603extern void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk); 605extern void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk, int ignore_devlist, int force_sleep);
604extern void radeonfb_pm_exit(struct radeonfb_info *rinfo); 606extern void radeonfb_pm_exit(struct radeonfb_info *rinfo);
605 607
606/* Monitor probe functions */ 608/* Monitor probe functions */
diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig
index 022f9d3473f5..02f15297a021 100644
--- a/drivers/video/backlight/Kconfig
+++ b/drivers/video/backlight/Kconfig
@@ -10,7 +10,7 @@ menuconfig BACKLIGHT_LCD_SUPPORT
10 10
11config BACKLIGHT_CLASS_DEVICE 11config BACKLIGHT_CLASS_DEVICE
12 tristate "Lowlevel Backlight controls" 12 tristate "Lowlevel Backlight controls"
13 depends on BACKLIGHT_LCD_SUPPORT && FB 13 depends on BACKLIGHT_LCD_SUPPORT
14 default m 14 default m
15 help 15 help
16 This framework adds support for low-level control of the LCD 16 This framework adds support for low-level control of the LCD
@@ -26,7 +26,7 @@ config BACKLIGHT_DEVICE
26 26
27config LCD_CLASS_DEVICE 27config LCD_CLASS_DEVICE
28 tristate "Lowlevel LCD controls" 28 tristate "Lowlevel LCD controls"
29 depends on BACKLIGHT_LCD_SUPPORT && FB 29 depends on BACKLIGHT_LCD_SUPPORT
30 default m 30 default m
31 help 31 help
32 This framework adds support for low-level control of LCD. 32 This framework adds support for low-level control of LCD.
diff --git a/drivers/video/chipsfb.c b/drivers/video/chipsfb.c
index 0e465c80ef24..73cb426bf2d7 100644
--- a/drivers/video/chipsfb.c
+++ b/drivers/video/chipsfb.c
@@ -19,7 +19,6 @@
19#include <linux/errno.h> 19#include <linux/errno.h>
20#include <linux/string.h> 20#include <linux/string.h>
21#include <linux/mm.h> 21#include <linux/mm.h>
22#include <linux/tty.h>
23#include <linux/slab.h> 22#include <linux/slab.h>
24#include <linux/vmalloc.h> 23#include <linux/vmalloc.h>
25#include <linux/delay.h> 24#include <linux/delay.h>
@@ -150,12 +149,11 @@ static int chipsfb_blank(int blank, struct fb_info *info)
150 mutex_lock(&pmac_backlight_mutex); 149 mutex_lock(&pmac_backlight_mutex);
151 150
152 if (pmac_backlight) { 151 if (pmac_backlight) {
153 down(&pmac_backlight->sem);
154
155 /* used to disable backlight only for blank > 1, but it seems 152 /* used to disable backlight only for blank > 1, but it seems
156 * useful at blank = 1 too (saves battery, extends backlight 153 * useful at blank = 1 too (saves battery, extends backlight
157 * life) 154 * life)
158 */ 155 */
156 down(&pmac_backlight->sem);
159 if (blank) 157 if (blank)
160 pmac_backlight->props->power = FB_BLANK_POWERDOWN; 158 pmac_backlight->props->power = FB_BLANK_POWERDOWN;
161 else 159 else
diff --git a/drivers/video/cirrusfb.c b/drivers/video/cirrusfb.c
index 7355da09c721..daf43f535a0b 100644
--- a/drivers/video/cirrusfb.c
+++ b/drivers/video/cirrusfb.c
@@ -41,7 +41,6 @@
41#include <linux/errno.h> 41#include <linux/errno.h>
42#include <linux/string.h> 42#include <linux/string.h>
43#include <linux/mm.h> 43#include <linux/mm.h>
44#include <linux/tty.h>
45#include <linux/slab.h> 44#include <linux/slab.h>
46#include <linux/delay.h> 45#include <linux/delay.h>
47#include <linux/fb.h> 46#include <linux/fb.h>
diff --git a/drivers/video/console/dummycon.c b/drivers/video/console/dummycon.c
index 878707a04398..d9315d99445f 100644
--- a/drivers/video/console/dummycon.c
+++ b/drivers/video/console/dummycon.c
@@ -7,9 +7,9 @@
7 7
8#include <linux/types.h> 8#include <linux/types.h>
9#include <linux/kdev_t.h> 9#include <linux/kdev_t.h>
10#include <linux/tty.h>
11#include <linux/console.h> 10#include <linux/console.h>
12#include <linux/vt_kern.h> 11#include <linux/vt_kern.h>
12#include <linux/screen_info.h>
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/module.h> 14#include <linux/module.h>
15 15
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index 94e9f7069bef..390439b3d899 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -64,7 +64,6 @@
64#include <linux/fs.h> 64#include <linux/fs.h>
65#include <linux/kernel.h> 65#include <linux/kernel.h>
66#include <linux/delay.h> /* MSch: for IRQ probe */ 66#include <linux/delay.h> /* MSch: for IRQ probe */
67#include <linux/tty.h>
68#include <linux/console.h> 67#include <linux/console.h>
69#include <linux/string.h> 68#include <linux/string.h>
70#include <linux/kd.h> 69#include <linux/kd.h>
diff --git a/drivers/video/console/mdacon.c b/drivers/video/console/mdacon.c
index c89f90edf8ac..eb4d03fa5391 100644
--- a/drivers/video/console/mdacon.c
+++ b/drivers/video/console/mdacon.c
@@ -31,7 +31,6 @@
31#include <linux/fs.h> 31#include <linux/fs.h>
32#include <linux/kernel.h> 32#include <linux/kernel.h>
33#include <linux/module.h> 33#include <linux/module.h>
34#include <linux/tty.h>
35#include <linux/console.h> 34#include <linux/console.h>
36#include <linux/string.h> 35#include <linux/string.h>
37#include <linux/kd.h> 36#include <linux/kd.h>
@@ -198,7 +197,7 @@ static int __init mdacon_setup(char *str)
198__setup("mdacon=", mdacon_setup); 197__setup("mdacon=", mdacon_setup);
199#endif 198#endif
200 199
201static int __init mda_detect(void) 200static int mda_detect(void)
202{ 201{
203 int count=0; 202 int count=0;
204 u16 *p, p_save; 203 u16 *p, p_save;
@@ -283,7 +282,7 @@ static int __init mda_detect(void)
283 return 1; 282 return 1;
284} 283}
285 284
286static void __init mda_initialize(void) 285static void mda_initialize(void)
287{ 286{
288 write_mda_b(97, 0x00); /* horizontal total */ 287 write_mda_b(97, 0x00); /* horizontal total */
289 write_mda_b(80, 0x01); /* horizontal displayed */ 288 write_mda_b(80, 0x01); /* horizontal displayed */
diff --git a/drivers/video/console/newport_con.c b/drivers/video/console/newport_con.c
index 03041311711b..7fa1afeae8dc 100644
--- a/drivers/video/console/newport_con.c
+++ b/drivers/video/console/newport_con.c
@@ -12,7 +12,6 @@
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/errno.h> 14#include <linux/errno.h>
15#include <linux/tty.h>
16#include <linux/kd.h> 15#include <linux/kd.h>
17#include <linux/selection.h> 16#include <linux/selection.h>
18#include <linux/console.h> 17#include <linux/console.h>
diff --git a/drivers/video/console/promcon.c b/drivers/video/console/promcon.c
index 5cd5e114d1e6..b78eac63459f 100644
--- a/drivers/video/console/promcon.c
+++ b/drivers/video/console/promcon.c
@@ -10,7 +10,6 @@
10#include <linux/errno.h> 10#include <linux/errno.h>
11#include <linux/string.h> 11#include <linux/string.h>
12#include <linux/mm.h> 12#include <linux/mm.h>
13#include <linux/tty.h>
14#include <linux/slab.h> 13#include <linux/slab.h>
15#include <linux/delay.h> 14#include <linux/delay.h>
16#include <linux/console.h> 15#include <linux/console.h>
diff --git a/drivers/video/console/softcursor.c b/drivers/video/console/softcursor.c
index 3957fc7523e2..557c563e4aed 100644
--- a/drivers/video/console/softcursor.c
+++ b/drivers/video/console/softcursor.c
@@ -10,7 +10,6 @@
10 10
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/string.h> 12#include <linux/string.h>
13#include <linux/tty.h>
14#include <linux/fb.h> 13#include <linux/fb.h>
15#include <linux/slab.h> 14#include <linux/slab.h>
16 15
diff --git a/drivers/video/console/sticon.c b/drivers/video/console/sticon.c
index 45c4f227e56e..45586aaabd1e 100644
--- a/drivers/video/console/sticon.c
+++ b/drivers/video/console/sticon.c
@@ -37,7 +37,6 @@
37 37
38#include <linux/init.h> 38#include <linux/init.h>
39#include <linux/kernel.h> 39#include <linux/kernel.h>
40#include <linux/tty.h>
41#include <linux/console.h> 40#include <linux/console.h>
42#include <linux/errno.h> 41#include <linux/errno.h>
43#include <linux/vt_kern.h> 42#include <linux/vt_kern.h>
diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
index 05735ff4e9c5..0a2c10a1abf8 100644
--- a/drivers/video/console/vgacon.c
+++ b/drivers/video/console/vgacon.c
@@ -38,7 +38,6 @@
38#include <linux/sched.h> 38#include <linux/sched.h>
39#include <linux/fs.h> 39#include <linux/fs.h>
40#include <linux/kernel.h> 40#include <linux/kernel.h>
41#include <linux/tty.h>
42#include <linux/console.h> 41#include <linux/console.h>
43#include <linux/string.h> 42#include <linux/string.h>
44#include <linux/kd.h> 43#include <linux/kd.h>
@@ -48,6 +47,7 @@
48#include <linux/spinlock.h> 47#include <linux/spinlock.h>
49#include <linux/ioport.h> 48#include <linux/ioport.h>
50#include <linux/init.h> 49#include <linux/init.h>
50#include <linux/screen_info.h>
51#include <linux/smp_lock.h> 51#include <linux/smp_lock.h>
52#include <video/vga.h> 52#include <video/vga.h>
53#include <asm/io.h> 53#include <asm/io.h>
diff --git a/drivers/video/controlfb.c b/drivers/video/controlfb.c
index acdd6a103dbb..8cc6c0e2d27a 100644
--- a/drivers/video/controlfb.c
+++ b/drivers/video/controlfb.c
@@ -36,7 +36,6 @@
36#include <linux/errno.h> 36#include <linux/errno.h>
37#include <linux/string.h> 37#include <linux/string.h>
38#include <linux/mm.h> 38#include <linux/mm.h>
39#include <linux/tty.h>
40#include <linux/slab.h> 39#include <linux/slab.h>
41#include <linux/vmalloc.h> 40#include <linux/vmalloc.h>
42#include <linux/delay.h> 41#include <linux/delay.h>
diff --git a/drivers/video/cyber2000fb.c b/drivers/video/cyber2000fb.c
index 2e2924957d8f..aae6d9c26e88 100644
--- a/drivers/video/cyber2000fb.c
+++ b/drivers/video/cyber2000fb.c
@@ -41,7 +41,6 @@
41#include <linux/errno.h> 41#include <linux/errno.h>
42#include <linux/string.h> 42#include <linux/string.h>
43#include <linux/mm.h> 43#include <linux/mm.h>
44#include <linux/tty.h>
45#include <linux/slab.h> 44#include <linux/slab.h>
46#include <linux/delay.h> 45#include <linux/delay.h>
47#include <linux/fb.h> 46#include <linux/fb.h>
diff --git a/drivers/video/cyberfb.c b/drivers/video/cyberfb.c
index a3e189f90a7d..c40e72dafb0e 100644
--- a/drivers/video/cyberfb.c
+++ b/drivers/video/cyberfb.c
@@ -81,7 +81,6 @@
81#include <linux/errno.h> 81#include <linux/errno.h>
82#include <linux/string.h> 82#include <linux/string.h>
83#include <linux/mm.h> 83#include <linux/mm.h>
84#include <linux/tty.h>
85#include <linux/slab.h> 84#include <linux/slab.h>
86#include <linux/delay.h> 85#include <linux/delay.h>
87#include <linux/zorro.h> 86#include <linux/zorro.h>
diff --git a/drivers/video/dnfb.c b/drivers/video/dnfb.c
index 5abd3cb00671..b083ea7e9c69 100644
--- a/drivers/video/dnfb.c
+++ b/drivers/video/dnfb.c
@@ -2,7 +2,6 @@
2#include <linux/errno.h> 2#include <linux/errno.h>
3#include <linux/string.h> 3#include <linux/string.h>
4#include <linux/mm.h> 4#include <linux/mm.h>
5#include <linux/tty.h>
6#include <linux/slab.h> 5#include <linux/slab.h>
7#include <linux/delay.h> 6#include <linux/delay.h>
8#include <linux/interrupt.h> 7#include <linux/interrupt.h>
diff --git a/drivers/video/epson1355fb.c b/drivers/video/epson1355fb.c
index f0a621ecc288..737257d278f0 100644
--- a/drivers/video/epson1355fb.c
+++ b/drivers/video/epson1355fb.c
@@ -48,7 +48,6 @@
48#include <linux/errno.h> 48#include <linux/errno.h>
49#include <linux/string.h> 49#include <linux/string.h>
50#include <linux/mm.h> 50#include <linux/mm.h>
51#include <linux/tty.h>
52#include <linux/slab.h> 51#include <linux/slab.h>
53#include <linux/delay.h> 52#include <linux/delay.h>
54#include <linux/fb.h> 53#include <linux/fb.h>
diff --git a/drivers/video/fb_notify.c b/drivers/video/fb_notify.c
new file mode 100644
index 000000000000..8c020389e4fa
--- /dev/null
+++ b/drivers/video/fb_notify.c
@@ -0,0 +1,46 @@
1/*
2 * linux/drivers/video/fb_notify.c
3 *
4 * Copyright (C) 2006 Antonino Daplas <adaplas@pol.net>
5 *
6 * 2001 - Documented with DocBook
7 * - Brad Douglas <brad@neruo.com>
8 *
9 * This file is subject to the terms and conditions of the GNU General Public
10 * License. See the file COPYING in the main directory of this archive
11 * for more details.
12 */
13#include <linux/fb.h>
14#include <linux/notifier.h>
15
16static BLOCKING_NOTIFIER_HEAD(fb_notifier_list);
17
18/**
19 * fb_register_client - register a client notifier
20 * @nb: notifier block to callback on events
21 */
22int fb_register_client(struct notifier_block *nb)
23{
24 return blocking_notifier_chain_register(&fb_notifier_list, nb);
25}
26EXPORT_SYMBOL(fb_register_client);
27
28/**
29 * fb_unregister_client - unregister a client notifier
30 * @nb: notifier block to callback on events
31 */
32int fb_unregister_client(struct notifier_block *nb)
33{
34 return blocking_notifier_chain_unregister(&fb_notifier_list, nb);
35}
36EXPORT_SYMBOL(fb_unregister_client);
37
38/**
39 * fb_notifier_call_chain - notify clients of fb_events
40 *
41 */
42int fb_notifier_call_chain(unsigned long val, void *v)
43{
44 return blocking_notifier_call_chain(&fb_notifier_list, val, v);
45}
46EXPORT_SYMBOL_GPL(fb_notifier_call_chain);
diff --git a/drivers/video/fbcmap.c b/drivers/video/fbcmap.c
index 1f98392a43b3..e8b135f3d80d 100644
--- a/drivers/video/fbcmap.c
+++ b/drivers/video/fbcmap.c
@@ -13,7 +13,6 @@
13 13
14#include <linux/string.h> 14#include <linux/string.h>
15#include <linux/module.h> 15#include <linux/module.h>
16#include <linux/tty.h>
17#include <linux/fb.h> 16#include <linux/fb.h>
18#include <linux/slab.h> 17#include <linux/slab.h>
19 18
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 33034f81114d..17961e3ecaa0 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -23,7 +23,7 @@
23#include <linux/slab.h> 23#include <linux/slab.h>
24#include <linux/mm.h> 24#include <linux/mm.h>
25#include <linux/mman.h> 25#include <linux/mman.h>
26#include <linux/tty.h> 26#include <linux/vt.h>
27#include <linux/init.h> 27#include <linux/init.h>
28#include <linux/linux_logo.h> 28#include <linux/linux_logo.h>
29#include <linux/proc_fs.h> 29#include <linux/proc_fs.h>
@@ -52,7 +52,6 @@
52 52
53#define FBPIXMAPSIZE (1024 * 8) 53#define FBPIXMAPSIZE (1024 * 8)
54 54
55static BLOCKING_NOTIFIER_HEAD(fb_notifier_list);
56struct fb_info *registered_fb[FB_MAX]; 55struct fb_info *registered_fb[FB_MAX];
57int num_registered_fb; 56int num_registered_fb;
58 57
@@ -791,8 +790,7 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var)
791 790
792 event.info = info; 791 event.info = info;
793 event.data = &mode1; 792 event.data = &mode1;
794 ret = blocking_notifier_call_chain(&fb_notifier_list, 793 ret = fb_notifier_call_chain(FB_EVENT_MODE_DELETE, &event);
795 FB_EVENT_MODE_DELETE, &event);
796 } 794 }
797 795
798 if (!ret) 796 if (!ret)
@@ -837,8 +835,7 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var)
837 835
838 info->flags &= ~FBINFO_MISC_USEREVENT; 836 info->flags &= ~FBINFO_MISC_USEREVENT;
839 event.info = info; 837 event.info = info;
840 blocking_notifier_call_chain(&fb_notifier_list, 838 fb_notifier_call_chain(evnt, &event);
841 evnt, &event);
842 } 839 }
843 } 840 }
844 } 841 }
@@ -861,8 +858,7 @@ fb_blank(struct fb_info *info, int blank)
861 858
862 event.info = info; 859 event.info = info;
863 event.data = &blank; 860 event.data = &blank;
864 blocking_notifier_call_chain(&fb_notifier_list, 861 fb_notifier_call_chain(FB_EVENT_BLANK, &event);
865 FB_EVENT_BLANK, &event);
866 } 862 }
867 863
868 return ret; 864 return ret;
@@ -933,8 +929,7 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
933 con2fb.framebuffer = -1; 929 con2fb.framebuffer = -1;
934 event.info = info; 930 event.info = info;
935 event.data = &con2fb; 931 event.data = &con2fb;
936 blocking_notifier_call_chain(&fb_notifier_list, 932 fb_notifier_call_chain(FB_EVENT_GET_CONSOLE_MAP, &event);
937 FB_EVENT_GET_CONSOLE_MAP, &event);
938 return copy_to_user(argp, &con2fb, 933 return copy_to_user(argp, &con2fb,
939 sizeof(con2fb)) ? -EFAULT : 0; 934 sizeof(con2fb)) ? -EFAULT : 0;
940 case FBIOPUT_CON2FBMAP: 935 case FBIOPUT_CON2FBMAP:
@@ -952,9 +947,8 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
952 return -EINVAL; 947 return -EINVAL;
953 event.info = info; 948 event.info = info;
954 event.data = &con2fb; 949 event.data = &con2fb;
955 return blocking_notifier_call_chain(&fb_notifier_list, 950 return fb_notifier_call_chain(FB_EVENT_SET_CONSOLE_MAP,
956 FB_EVENT_SET_CONSOLE_MAP, 951 &event);
957 &event);
958 case FBIOBLANK: 952 case FBIOBLANK:
959 acquire_console_sem(); 953 acquire_console_sem();
960 info->flags |= FBINFO_MISC_USEREVENT; 954 info->flags |= FBINFO_MISC_USEREVENT;
@@ -1330,8 +1324,7 @@ register_framebuffer(struct fb_info *fb_info)
1330 registered_fb[i] = fb_info; 1324 registered_fb[i] = fb_info;
1331 1325
1332 event.info = fb_info; 1326 event.info = fb_info;
1333 blocking_notifier_call_chain(&fb_notifier_list, 1327 fb_notifier_call_chain(FB_EVENT_FB_REGISTERED, &event);
1334 FB_EVENT_FB_REGISTERED, &event);
1335 return 0; 1328 return 0;
1336} 1329}
1337 1330
@@ -1365,30 +1358,11 @@ unregister_framebuffer(struct fb_info *fb_info)
1365 fb_cleanup_class_device(fb_info); 1358 fb_cleanup_class_device(fb_info);
1366 class_device_destroy(fb_class, MKDEV(FB_MAJOR, i)); 1359 class_device_destroy(fb_class, MKDEV(FB_MAJOR, i));
1367 event.info = fb_info; 1360 event.info = fb_info;
1368 blocking_notifier_call_chain(&fb_notifier_list, 1361 fb_notifier_call_chain(FB_EVENT_FB_UNREGISTERED, &event);
1369 FB_EVENT_FB_UNREGISTERED, &event);
1370 return 0; 1362 return 0;
1371} 1363}
1372 1364
1373/** 1365/**
1374 * fb_register_client - register a client notifier
1375 * @nb: notifier block to callback on events
1376 */
1377int fb_register_client(struct notifier_block *nb)
1378{
1379 return blocking_notifier_chain_register(&fb_notifier_list, nb);
1380}
1381
1382/**
1383 * fb_unregister_client - unregister a client notifier
1384 * @nb: notifier block to callback on events
1385 */
1386int fb_unregister_client(struct notifier_block *nb)
1387{
1388 return blocking_notifier_chain_unregister(&fb_notifier_list, nb);
1389}
1390
1391/**
1392 * fb_set_suspend - low level driver signals suspend 1366 * fb_set_suspend - low level driver signals suspend
1393 * @info: framebuffer affected 1367 * @info: framebuffer affected
1394 * @state: 0 = resuming, !=0 = suspending 1368 * @state: 0 = resuming, !=0 = suspending
@@ -1403,13 +1377,11 @@ void fb_set_suspend(struct fb_info *info, int state)
1403 1377
1404 event.info = info; 1378 event.info = info;
1405 if (state) { 1379 if (state) {
1406 blocking_notifier_call_chain(&fb_notifier_list, 1380 fb_notifier_call_chain(FB_EVENT_SUSPEND, &event);
1407 FB_EVENT_SUSPEND, &event);
1408 info->state = FBINFO_STATE_SUSPENDED; 1381 info->state = FBINFO_STATE_SUSPENDED;
1409 } else { 1382 } else {
1410 info->state = FBINFO_STATE_RUNNING; 1383 info->state = FBINFO_STATE_RUNNING;
1411 blocking_notifier_call_chain(&fb_notifier_list, 1384 fb_notifier_call_chain(FB_EVENT_RESUME, &event);
1412 FB_EVENT_RESUME, &event);
1413 } 1385 }
1414} 1386}
1415 1387
@@ -1480,9 +1452,7 @@ int fb_new_modelist(struct fb_info *info)
1480 1452
1481 if (!list_empty(&info->modelist)) { 1453 if (!list_empty(&info->modelist)) {
1482 event.info = info; 1454 event.info = info;
1483 err = blocking_notifier_call_chain(&fb_notifier_list, 1455 err = fb_notifier_call_chain(FB_EVENT_NEW_MODELIST, &event);
1484 FB_EVENT_NEW_MODELIST,
1485 &event);
1486 } 1456 }
1487 1457
1488 return err; 1458 return err;
@@ -1594,8 +1564,6 @@ EXPORT_SYMBOL(fb_blank);
1594EXPORT_SYMBOL(fb_pan_display); 1564EXPORT_SYMBOL(fb_pan_display);
1595EXPORT_SYMBOL(fb_get_buffer_offset); 1565EXPORT_SYMBOL(fb_get_buffer_offset);
1596EXPORT_SYMBOL(fb_set_suspend); 1566EXPORT_SYMBOL(fb_set_suspend);
1597EXPORT_SYMBOL(fb_register_client);
1598EXPORT_SYMBOL(fb_unregister_client);
1599EXPORT_SYMBOL(fb_get_options); 1567EXPORT_SYMBOL(fb_get_options);
1600 1568
1601MODULE_LICENSE("GPL"); 1569MODULE_LICENSE("GPL");
diff --git a/drivers/video/fbmon.c b/drivers/video/fbmon.c
index 3ccfff715a51..de93139ccbb5 100644
--- a/drivers/video/fbmon.c
+++ b/drivers/video/fbmon.c
@@ -26,7 +26,6 @@
26 * for more details. 26 * for more details.
27 * 27 *
28 */ 28 */
29#include <linux/tty.h>
30#include <linux/fb.h> 29#include <linux/fb.h>
31#include <linux/module.h> 30#include <linux/module.h>
32#include <linux/pci.h> 31#include <linux/pci.h>
diff --git a/drivers/video/g364fb.c b/drivers/video/g364fb.c
index 605d1a132020..1b981b635675 100644
--- a/drivers/video/g364fb.c
+++ b/drivers/video/g364fb.c
@@ -21,7 +21,6 @@
21#include <linux/errno.h> 21#include <linux/errno.h>
22#include <linux/string.h> 22#include <linux/string.h>
23#include <linux/mm.h> 23#include <linux/mm.h>
24#include <linux/tty.h>
25#include <linux/slab.h> 24#include <linux/slab.h>
26#include <linux/vmalloc.h> 25#include <linux/vmalloc.h>
27#include <linux/delay.h> 26#include <linux/delay.h>
diff --git a/drivers/video/geode/gx1fb_core.c b/drivers/video/geode/gx1fb_core.c
index 4d3a8871d3d1..bcf9cea54d8b 100644
--- a/drivers/video/geode/gx1fb_core.c
+++ b/drivers/video/geode/gx1fb_core.c
@@ -15,7 +15,6 @@
15#include <linux/errno.h> 15#include <linux/errno.h>
16#include <linux/string.h> 16#include <linux/string.h>
17#include <linux/mm.h> 17#include <linux/mm.h>
18#include <linux/tty.h>
19#include <linux/slab.h> 18#include <linux/slab.h>
20#include <linux/delay.h> 19#include <linux/delay.h>
21#include <linux/fb.h> 20#include <linux/fb.h>
diff --git a/drivers/video/geode/gxfb_core.c b/drivers/video/geode/gxfb_core.c
index 5ef12a3dfa50..0d3643fc6293 100644
--- a/drivers/video/geode/gxfb_core.c
+++ b/drivers/video/geode/gxfb_core.c
@@ -25,7 +25,6 @@
25#include <linux/errno.h> 25#include <linux/errno.h>
26#include <linux/string.h> 26#include <linux/string.h>
27#include <linux/mm.h> 27#include <linux/mm.h>
28#include <linux/tty.h>
29#include <linux/slab.h> 28#include <linux/slab.h>
30#include <linux/delay.h> 29#include <linux/delay.h>
31#include <linux/fb.h> 30#include <linux/fb.h>
diff --git a/drivers/video/hgafb.c b/drivers/video/hgafb.c
index 4e39035cf335..fb9e67228543 100644
--- a/drivers/video/hgafb.c
+++ b/drivers/video/hgafb.c
@@ -36,7 +36,6 @@
36#include <linux/spinlock.h> 36#include <linux/spinlock.h>
37#include <linux/string.h> 37#include <linux/string.h>
38#include <linux/mm.h> 38#include <linux/mm.h>
39#include <linux/tty.h>
40#include <linux/slab.h> 39#include <linux/slab.h>
41#include <linux/delay.h> 40#include <linux/delay.h>
42#include <linux/fb.h> 41#include <linux/fb.h>
diff --git a/drivers/video/hitfb.c b/drivers/video/hitfb.c
index 01864767450d..4cc6b454265e 100644
--- a/drivers/video/hitfb.c
+++ b/drivers/video/hitfb.c
@@ -17,7 +17,6 @@
17#include <linux/errno.h> 17#include <linux/errno.h>
18#include <linux/string.h> 18#include <linux/string.h>
19#include <linux/mm.h> 19#include <linux/mm.h>
20#include <linux/tty.h>
21#include <linux/slab.h> 20#include <linux/slab.h>
22#include <linux/delay.h> 21#include <linux/delay.h>
23#include <linux/init.h> 22#include <linux/init.h>
diff --git a/drivers/video/hpfb.c b/drivers/video/hpfb.c
index abd920a663a0..91cf3b577d15 100644
--- a/drivers/video/hpfb.c
+++ b/drivers/video/hpfb.c
@@ -11,7 +11,6 @@
11#include <linux/errno.h> 11#include <linux/errno.h>
12#include <linux/string.h> 12#include <linux/string.h>
13#include <linux/mm.h> 13#include <linux/mm.h>
14#include <linux/tty.h>
15#include <linux/slab.h> 14#include <linux/slab.h>
16#include <linux/delay.h> 15#include <linux/delay.h>
17#include <linux/init.h> 16#include <linux/init.h>
diff --git a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c
index fbe8a2c4b04c..a6ca02f2156a 100644
--- a/drivers/video/i810/i810_main.c
+++ b/drivers/video/i810/i810_main.c
@@ -33,7 +33,6 @@
33#include <linux/errno.h> 33#include <linux/errno.h>
34#include <linux/string.h> 34#include <linux/string.h>
35#include <linux/mm.h> 35#include <linux/mm.h>
36#include <linux/tty.h>
37#include <linux/slab.h> 36#include <linux/slab.h>
38#include <linux/fb.h> 37#include <linux/fb.h>
39#include <linux/init.h> 38#include <linux/init.h>
diff --git a/drivers/video/igafb.c b/drivers/video/igafb.c
index 8a0c2d3d3805..67f384f86758 100644
--- a/drivers/video/igafb.c
+++ b/drivers/video/igafb.c
@@ -33,7 +33,6 @@
33#include <linux/errno.h> 33#include <linux/errno.h>
34#include <linux/string.h> 34#include <linux/string.h>
35#include <linux/mm.h> 35#include <linux/mm.h>
36#include <linux/tty.h>
37#include <linux/slab.h> 36#include <linux/slab.h>
38#include <linux/vmalloc.h> 37#include <linux/vmalloc.h>
39#include <linux/delay.h> 38#include <linux/delay.h>
diff --git a/drivers/video/imacfb.c b/drivers/video/imacfb.c
index cdbae173d69a..ff233b84dec4 100644
--- a/drivers/video/imacfb.c
+++ b/drivers/video/imacfb.c
@@ -15,9 +15,9 @@
15#include <linux/mm.h> 15#include <linux/mm.h>
16#include <linux/module.h> 16#include <linux/module.h>
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/screen_info.h>
18#include <linux/slab.h> 19#include <linux/slab.h>
19#include <linux/string.h> 20#include <linux/string.h>
20#include <linux/tty.h>
21 21
22#include <asm/io.h> 22#include <asm/io.h>
23 23
diff --git a/drivers/video/imsttfb.c b/drivers/video/imsttfb.c
index 5f393d985b11..5715b8ad0ddc 100644
--- a/drivers/video/imsttfb.c
+++ b/drivers/video/imsttfb.c
@@ -21,7 +21,6 @@
21#include <linux/errno.h> 21#include <linux/errno.h>
22#include <linux/string.h> 22#include <linux/string.h>
23#include <linux/mm.h> 23#include <linux/mm.h>
24#include <linux/tty.h>
25#include <linux/slab.h> 24#include <linux/slab.h>
26#include <linux/vmalloc.h> 25#include <linux/vmalloc.h>
27#include <linux/delay.h> 26#include <linux/delay.h>
diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c
index 3f39d84015f1..06af89d44a0d 100644
--- a/drivers/video/intelfb/intelfbdrv.c
+++ b/drivers/video/intelfb/intelfbdrv.c
@@ -113,7 +113,6 @@
113#include <linux/errno.h> 113#include <linux/errno.h>
114#include <linux/string.h> 114#include <linux/string.h>
115#include <linux/mm.h> 115#include <linux/mm.h>
116#include <linux/tty.h>
117#include <linux/slab.h> 116#include <linux/slab.h>
118#include <linux/delay.h> 117#include <linux/delay.h>
119#include <linux/fb.h> 118#include <linux/fb.h>
@@ -122,6 +121,7 @@
122#include <linux/pci.h> 121#include <linux/pci.h>
123#include <linux/vmalloc.h> 122#include <linux/vmalloc.h>
124#include <linux/pagemap.h> 123#include <linux/pagemap.h>
124#include <linux/screen_info.h>
125 125
126#include <asm/io.h> 126#include <asm/io.h>
127 127
diff --git a/drivers/video/intelfb/intelfbhw.c b/drivers/video/intelfb/intelfbhw.c
index 3b78a57924f0..2a9322f9cfdc 100644
--- a/drivers/video/intelfb/intelfbhw.c
+++ b/drivers/video/intelfb/intelfbhw.c
@@ -24,7 +24,6 @@
24#include <linux/errno.h> 24#include <linux/errno.h>
25#include <linux/string.h> 25#include <linux/string.h>
26#include <linux/mm.h> 26#include <linux/mm.h>
27#include <linux/tty.h>
28#include <linux/slab.h> 27#include <linux/slab.h>
29#include <linux/delay.h> 28#include <linux/delay.h>
30#include <linux/fb.h> 29#include <linux/fb.h>
diff --git a/drivers/video/kyro/fbdev.c b/drivers/video/kyro/fbdev.c
index 2fdbe9b2b04b..f0d614a80f1f 100644
--- a/drivers/video/kyro/fbdev.c
+++ b/drivers/video/kyro/fbdev.c
@@ -16,7 +16,6 @@
16#include <linux/mm.h> 16#include <linux/mm.h>
17#include <linux/errno.h> 17#include <linux/errno.h>
18#include <linux/string.h> 18#include <linux/string.h>
19#include <linux/tty.h>
20#include <linux/delay.h> 19#include <linux/delay.h>
21#include <linux/fb.h> 20#include <linux/fb.h>
22#include <linux/ioctl.h> 21#include <linux/ioctl.h>
diff --git a/drivers/video/macfb.c b/drivers/video/macfb.c
index e6cbd9de944a..80a043807161 100644
--- a/drivers/video/macfb.c
+++ b/drivers/video/macfb.c
@@ -24,7 +24,6 @@
24#include <linux/errno.h> 24#include <linux/errno.h>
25#include <linux/string.h> 25#include <linux/string.h>
26#include <linux/mm.h> 26#include <linux/mm.h>
27#include <linux/tty.h>
28#include <linux/slab.h> 27#include <linux/slab.h>
29#include <linux/delay.h> 28#include <linux/delay.h>
30#include <linux/nubus.h> 29#include <linux/nubus.h>
diff --git a/drivers/video/matrox/matroxfb_base.h b/drivers/video/matrox/matroxfb_base.h
index b95779b57c06..9c25c2f7966b 100644
--- a/drivers/video/matrox/matroxfb_base.h
+++ b/drivers/video/matrox/matroxfb_base.h
@@ -30,7 +30,6 @@
30#include <linux/errno.h> 30#include <linux/errno.h>
31#include <linux/string.h> 31#include <linux/string.h>
32#include <linux/mm.h> 32#include <linux/mm.h>
33#include <linux/tty.h>
34#include <linux/slab.h> 33#include <linux/slab.h>
35#include <linux/delay.h> 34#include <linux/delay.h>
36#include <linux/fb.h> 35#include <linux/fb.h>
diff --git a/drivers/video/maxinefb.c b/drivers/video/maxinefb.c
index f85421bf7cb5..38c8d38de4fd 100644
--- a/drivers/video/maxinefb.c
+++ b/drivers/video/maxinefb.c
@@ -29,7 +29,6 @@
29#include <linux/errno.h> 29#include <linux/errno.h>
30#include <linux/string.h> 30#include <linux/string.h>
31#include <linux/mm.h> 31#include <linux/mm.h>
32#include <linux/tty.h>
33#include <linux/slab.h> 32#include <linux/slab.h>
34#include <linux/delay.h> 33#include <linux/delay.h>
35#include <linux/init.h> 34#include <linux/init.h>
diff --git a/drivers/video/mbx/Makefile b/drivers/video/mbx/Makefile
new file mode 100644
index 000000000000..16c1165cf9c7
--- /dev/null
+++ b/drivers/video/mbx/Makefile
@@ -0,0 +1,4 @@
1# Makefile for the 2700G controller driver.
2
3obj-$(CONFIG_FB_MBX) += mbxfb.o
4obj-$(CONFIG_FB_MBX_DEBUG) += mbxfbdebugfs.o
diff --git a/drivers/video/mbx/mbxdebugfs.c b/drivers/video/mbx/mbxdebugfs.c
new file mode 100644
index 000000000000..84aab3ad024e
--- /dev/null
+++ b/drivers/video/mbx/mbxdebugfs.c
@@ -0,0 +1,188 @@
1#include <linux/debugfs.h>
2
3#define BIG_BUFFER_SIZE (1024)
4
5static char big_buffer[BIG_BUFFER_SIZE];
6
7struct mbxfb_debugfs_data {
8 struct dentry *dir;
9 struct dentry *sysconf;
10 struct dentry *clock;
11 struct dentry *display;
12 struct dentry *gsctl;
13};
14
15static int open_file_generic(struct inode *inode, struct file *file)
16{
17 file->private_data = inode->u.generic_ip;
18 return 0;
19}
20
21static ssize_t write_file_dummy(struct file *file, const char __user *buf,
22 size_t count, loff_t *ppos)
23{
24 return count;
25}
26
27static ssize_t sysconf_read_file(struct file *file, char __user *userbuf,
28 size_t count, loff_t *ppos)
29{
30 char * s = big_buffer;
31
32 s += sprintf(s, "SYSCFG = %08lx\n", SYSCFG);
33 s += sprintf(s, "PFBASE = %08lx\n", PFBASE);
34 s += sprintf(s, "PFCEIL = %08lx\n", PFCEIL);
35 s += sprintf(s, "POLLFLAG = %08lx\n", POLLFLAG);
36 s += sprintf(s, "SYSRST = %08lx\n", SYSRST);
37
38 return simple_read_from_buffer(userbuf, count, ppos,
39 big_buffer, s-big_buffer);
40}
41
42
43static ssize_t gsctl_read_file(struct file *file, char __user *userbuf,
44 size_t count, loff_t *ppos)
45{
46 char * s = big_buffer;
47
48 s += sprintf(s, "GSCTRL = %08lx\n", GSCTRL);
49 s += sprintf(s, "VSCTRL = %08lx\n", VSCTRL);
50 s += sprintf(s, "GBBASE = %08lx\n", GBBASE);
51 s += sprintf(s, "VBBASE = %08lx\n", VBBASE);
52 s += sprintf(s, "GDRCTRL = %08lx\n", GDRCTRL);
53 s += sprintf(s, "VCMSK = %08lx\n", VCMSK);
54 s += sprintf(s, "GSCADR = %08lx\n", GSCADR);
55 s += sprintf(s, "VSCADR = %08lx\n", VSCADR);
56 s += sprintf(s, "VUBASE = %08lx\n", VUBASE);
57 s += sprintf(s, "VVBASE = %08lx\n", VVBASE);
58 s += sprintf(s, "GSADR = %08lx\n", GSADR);
59 s += sprintf(s, "VSADR = %08lx\n", VSADR);
60 s += sprintf(s, "HCCTRL = %08lx\n", HCCTRL);
61 s += sprintf(s, "HCSIZE = %08lx\n", HCSIZE);
62 s += sprintf(s, "HCPOS = %08lx\n", HCPOS);
63 s += sprintf(s, "HCBADR = %08lx\n", HCBADR);
64 s += sprintf(s, "HCCKMSK = %08lx\n", HCCKMSK);
65 s += sprintf(s, "GPLUT = %08lx\n", GPLUT);
66
67 return simple_read_from_buffer(userbuf, count, ppos,
68 big_buffer, s-big_buffer);
69}
70
71static ssize_t display_read_file(struct file *file, char __user *userbuf,
72 size_t count, loff_t *ppos)
73{
74 char * s = big_buffer;
75
76 s += sprintf(s, "DSCTRL = %08lx\n", DSCTRL);
77 s += sprintf(s, "DHT01 = %08lx\n", DHT01);
78 s += sprintf(s, "DHT02 = %08lx\n", DHT02);
79 s += sprintf(s, "DHT03 = %08lx\n", DHT03);
80 s += sprintf(s, "DVT01 = %08lx\n", DVT01);
81 s += sprintf(s, "DVT02 = %08lx\n", DVT02);
82 s += sprintf(s, "DVT03 = %08lx\n", DVT03);
83 s += sprintf(s, "DBCOL = %08lx\n", DBCOL);
84 s += sprintf(s, "BGCOLOR = %08lx\n", BGCOLOR);
85 s += sprintf(s, "DINTRS = %08lx\n", DINTRS);
86 s += sprintf(s, "DINTRE = %08lx\n", DINTRE);
87 s += sprintf(s, "DINTRCNT = %08lx\n", DINTRCNT);
88 s += sprintf(s, "DSIG = %08lx\n", DSIG);
89 s += sprintf(s, "DMCTRL = %08lx\n", DMCTRL);
90 s += sprintf(s, "CLIPCTRL = %08lx\n", CLIPCTRL);
91 s += sprintf(s, "SPOCTRL = %08lx\n", SPOCTRL);
92 s += sprintf(s, "SVCTRL = %08lx\n", SVCTRL);
93 s += sprintf(s, "DLSTS = %08lx\n", DLSTS);
94 s += sprintf(s, "DLLCTRL = %08lx\n", DLLCTRL);
95 s += sprintf(s, "DVLNUM = %08lx\n", DVLNUM);
96 s += sprintf(s, "DUCTRL = %08lx\n", DUCTRL);
97 s += sprintf(s, "DVECTRL = %08lx\n", DVECTRL);
98 s += sprintf(s, "DHDET = %08lx\n", DHDET);
99 s += sprintf(s, "DVDET = %08lx\n", DVDET);
100 s += sprintf(s, "DODMSK = %08lx\n", DODMSK);
101 s += sprintf(s, "CSC01 = %08lx\n", CSC01);
102 s += sprintf(s, "CSC02 = %08lx\n", CSC02);
103 s += sprintf(s, "CSC03 = %08lx\n", CSC03);
104 s += sprintf(s, "CSC04 = %08lx\n", CSC04);
105 s += sprintf(s, "CSC05 = %08lx\n", CSC05);
106
107 return simple_read_from_buffer(userbuf, count, ppos,
108 big_buffer, s-big_buffer);
109}
110
111static ssize_t clock_read_file(struct file *file, char __user *userbuf,
112 size_t count, loff_t *ppos)
113{
114 char * s = big_buffer;
115
116 s += sprintf(s, "SYSCLKSRC = %08lx\n", SYSCLKSRC);
117 s += sprintf(s, "PIXCLKSRC = %08lx\n", PIXCLKSRC);
118 s += sprintf(s, "CLKSLEEP = %08lx\n", CLKSLEEP);
119 s += sprintf(s, "COREPLL = %08lx\n", COREPLL);
120 s += sprintf(s, "DISPPLL = %08lx\n", DISPPLL);
121 s += sprintf(s, "PLLSTAT = %08lx\n", PLLSTAT);
122 s += sprintf(s, "VOVRCLK = %08lx\n", VOVRCLK);
123 s += sprintf(s, "PIXCLK = %08lx\n", PIXCLK);
124 s += sprintf(s, "MEMCLK = %08lx\n", MEMCLK);
125 s += sprintf(s, "M24CLK = %08lx\n", M24CLK);
126 s += sprintf(s, "MBXCLK = %08lx\n", MBXCLK);
127 s += sprintf(s, "SDCLK = %08lx\n", SDCLK);
128 s += sprintf(s, "PIXCLKDIV = %08lx\n", PIXCLKDIV);
129
130 return simple_read_from_buffer(userbuf, count, ppos,
131 big_buffer, s-big_buffer);
132}
133
134static struct file_operations sysconf_fops = {
135 .read = sysconf_read_file,
136 .write = write_file_dummy,
137 .open = open_file_generic,
138};
139
140static struct file_operations clock_fops = {
141 .read = clock_read_file,
142 .write = write_file_dummy,
143 .open = open_file_generic,
144};
145
146static struct file_operations display_fops = {
147 .read = display_read_file,
148 .write = write_file_dummy,
149 .open = open_file_generic,
150};
151
152static struct file_operations gsctl_fops = {
153 .read = gsctl_read_file,
154 .write = write_file_dummy,
155 .open = open_file_generic,
156};
157
158
159static void __devinit mbxfb_debugfs_init(struct fb_info *fbi)
160{
161 struct mbxfb_info *mfbi = fbi->par;
162 struct mbxfb_debugfs_data *dbg;
163
164 dbg = kzalloc(sizeof(struct mbxfb_debugfs_data), GFP_KERNEL);
165 mfbi->debugfs_data = dbg;
166
167 dbg->dir = debugfs_create_dir("mbxfb", NULL);
168 dbg->sysconf = debugfs_create_file("sysconf", 0444, dbg->dir,
169 fbi, &sysconf_fops);
170 dbg->clock = debugfs_create_file("clock", 0444, dbg->dir,
171 fbi, &clock_fops);
172 dbg->display = debugfs_create_file("display", 0444, dbg->dir,
173 fbi, &display_fops);
174 dbg->gsctl = debugfs_create_file("gsctl", 0444, dbg->dir,
175 fbi, &gsctl_fops);
176}
177
178static void __devexit mbxfb_debugfs_remove(struct fb_info *fbi)
179{
180 struct mbxfb_info *mfbi = fbi->par;
181 struct mbxfb_debugfs_data *dbg = mfbi->debugfs_data;
182
183 debugfs_remove(dbg->gsctl);
184 debugfs_remove(dbg->display);
185 debugfs_remove(dbg->clock);
186 debugfs_remove(dbg->sysconf);
187 debugfs_remove(dbg->dir);
188}
diff --git a/drivers/video/mbx/mbxfb.c b/drivers/video/mbx/mbxfb.c
new file mode 100644
index 000000000000..6849ab75d403
--- /dev/null
+++ b/drivers/video/mbx/mbxfb.c
@@ -0,0 +1,683 @@
1/*
2 * linux/drivers/video/mbx/mbxfb.c
3 *
4 * Copyright (C) 2006 Compulab, Ltd.
5 * Mike Rapoport <mike@compulab.co.il>
6 *
7 * Based on pxafb.c
8 *
9 * This file is subject to the terms and conditions of the GNU General Public
10 * License. See the file COPYING in the main directory of this archive for
11 * more details.
12 *
13 * Intel 2700G (Marathon) Graphics Accelerator Frame Buffer Driver
14 *
15 */
16
17#include <linux/delay.h>
18#include <linux/fb.h>
19#include <linux/init.h>
20#include <linux/module.h>
21#include <linux/platform_device.h>
22
23#include <asm/io.h>
24
25#include <video/mbxfb.h>
26
27#include "regs.h"
28#include "reg_bits.h"
29
30static unsigned long virt_base_2700;
31
32#define MIN_XRES 16
33#define MIN_YRES 16
34#define MAX_XRES 2048
35#define MAX_YRES 2048
36
37#define MAX_PALETTES 16
38
39/* FIXME: take care of different chip revisions with different sizes
40 of ODFB */
41#define MEMORY_OFFSET 0x60000
42
43struct mbxfb_info {
44 struct device *dev;
45
46 struct resource *fb_res;
47 struct resource *fb_req;
48
49 struct resource *reg_res;
50 struct resource *reg_req;
51
52 void __iomem *fb_virt_addr;
53 unsigned long fb_phys_addr;
54
55 void __iomem *reg_virt_addr;
56 unsigned long reg_phys_addr;
57
58 int (*platform_probe) (struct fb_info * fb);
59 int (*platform_remove) (struct fb_info * fb);
60
61 u32 pseudo_palette[MAX_PALETTES];
62#ifdef CONFIG_FB_MBX_DEBUG
63 void *debugfs_data;
64#endif
65
66};
67
68static struct fb_var_screeninfo mbxfb_default __devinitdata = {
69 .xres = 640,
70 .yres = 480,
71 .xres_virtual = 640,
72 .yres_virtual = 480,
73 .bits_per_pixel = 16,
74 .red = {11, 5, 0},
75 .green = {5, 6, 0},
76 .blue = {0, 5, 0},
77 .activate = FB_ACTIVATE_TEST,
78 .height = -1,
79 .width = -1,
80 .pixclock = 40000,
81 .left_margin = 48,
82 .right_margin = 16,
83 .upper_margin = 33,
84 .lower_margin = 10,
85 .hsync_len = 96,
86 .vsync_len = 2,
87 .vmode = FB_VMODE_NONINTERLACED,
88 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
89};
90
91static struct fb_fix_screeninfo mbxfb_fix __devinitdata = {
92 .id = "MBX",
93 .type = FB_TYPE_PACKED_PIXELS,
94 .visual = FB_VISUAL_TRUECOLOR,
95 .xpanstep = 0,
96 .ypanstep = 0,
97 .ywrapstep = 0,
98 .accel = FB_ACCEL_NONE,
99};
100
101struct pixclock_div {
102 u8 m;
103 u8 n;
104 u8 p;
105};
106
107static unsigned int mbxfb_get_pixclock(unsigned int pixclock_ps,
108 struct pixclock_div *div)
109{
110 u8 m, n, p;
111 unsigned int err = 0;
112 unsigned int min_err = ~0x0;
113 unsigned int clk;
114 unsigned int best_clk = 0;
115 unsigned int ref_clk = 13000; /* FIXME: take from platform data */
116 unsigned int pixclock;
117
118 /* convert pixclock to KHz */
119 pixclock = PICOS2KHZ(pixclock_ps);
120
121 for (m = 1; m < 64; m++) {
122 for (n = 1; n < 8; n++) {
123 for (p = 0; p < 8; p++) {
124 clk = (ref_clk * m) / (n * (1 << p));
125 err = (clk > pixclock) ? (clk - pixclock) :
126 (pixclock - clk);
127 if (err < min_err) {
128 min_err = err;
129 best_clk = clk;
130 div->m = m;
131 div->n = n;
132 div->p = p;
133 }
134 }
135 }
136 }
137 return KHZ2PICOS(best_clk);
138}
139
140static int mbxfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
141 u_int trans, struct fb_info *info)
142{
143 u32 val, ret = 1;
144
145 if (regno < MAX_PALETTES) {
146 u32 *pal = info->pseudo_palette;
147
148 val = (red & 0xf800) | ((green & 0xfc00) >> 5) |
149 ((blue & 0xf800) >> 11);
150 pal[regno] = val;
151 ret = 0;
152 }
153
154 return ret;
155}
156
157static int mbxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
158{
159 struct pixclock_div div;
160
161 var->pixclock = mbxfb_get_pixclock(var->pixclock, &div);
162
163 if (var->xres < MIN_XRES)
164 var->xres = MIN_XRES;
165 if (var->yres < MIN_YRES)
166 var->yres = MIN_YRES;
167 if (var->xres > MAX_XRES)
168 return -EINVAL;
169 if (var->yres > MAX_YRES)
170 return -EINVAL;
171 var->xres_virtual = max(var->xres_virtual, var->xres);
172 var->yres_virtual = max(var->yres_virtual, var->yres);
173
174 switch (var->bits_per_pixel) {
175 /* 8 bits-per-pixel is not supported yet */
176 case 8:
177 return -EINVAL;
178 case 16:
179 var->green.length = (var->green.length == 5) ? 5 : 6;
180 var->red.length = 5;
181 var->blue.length = 5;
182 var->transp.length = 6 - var->green.length;
183 var->blue.offset = 0;
184 var->green.offset = 5;
185 var->red.offset = 5 + var->green.length;
186 var->transp.offset = (5 + var->red.offset) & 15;
187 break;
188 case 24: /* RGB 888 */
189 case 32: /* RGBA 8888 */
190 var->red.offset = 16;
191 var->red.length = 8;
192 var->green.offset = 8;
193 var->green.length = 8;
194 var->blue.offset = 0;
195 var->blue.length = 8;
196 var->transp.length = var->bits_per_pixel - 24;
197 var->transp.offset = (var->transp.length) ? 24 : 0;
198 break;
199 }
200 var->red.msb_right = 0;
201 var->green.msb_right = 0;
202 var->blue.msb_right = 0;
203 var->transp.msb_right = 0;
204
205 return 0;
206}
207
208static int mbxfb_set_par(struct fb_info *info)
209{
210 struct fb_var_screeninfo *var = &info->var;
211 struct pixclock_div div;
212 ushort hbps, ht, hfps, has;
213 ushort vbps, vt, vfps, vas;
214 u32 gsctrl = readl(GSCTRL);
215 u32 gsadr = readl(GSADR);
216
217 info->fix.line_length = var->xres_virtual * var->bits_per_pixel / 8;
218
219 /* setup color mode */
220 gsctrl &= ~(FMsk(GSCTRL_GPIXFMT));
221 /* FIXME: add *WORKING* support for 8-bits per color */
222 if (info->var.bits_per_pixel == 8) {
223 return -EINVAL;
224 } else {
225 fb_dealloc_cmap(&info->cmap);
226 gsctrl &= ~GSCTRL_LUT_EN;
227
228 info->fix.visual = FB_VISUAL_TRUECOLOR;
229 switch (info->var.bits_per_pixel) {
230 case 16:
231 if (info->var.green.length == 5)
232 gsctrl |= GSCTRL_GPIXFMT_ARGB1555;
233 else
234 gsctrl |= GSCTRL_GPIXFMT_RGB565;
235 break;
236 case 24:
237 gsctrl |= GSCTRL_GPIXFMT_RGB888;
238 break;
239 case 32:
240 gsctrl |= GSCTRL_GPIXFMT_ARGB8888;
241 break;
242 }
243 }
244
245 /* setup resolution */
246 gsctrl &= ~(FMsk(GSCTRL_GSWIDTH) | FMsk(GSCTRL_GSHEIGHT));
247 gsctrl |= Gsctrl_Width(info->var.xres - 1) |
248 Gsctrl_Height(info->var.yres - 1);
249 writel(gsctrl, GSCTRL);
250 udelay(1000);
251
252 gsadr &= ~(FMsk(GSADR_SRCSTRIDE));
253 gsadr |= Gsadr_Srcstride(info->var.xres * info->var.bits_per_pixel /
254 (8 * 16) - 1);
255 writel(gsadr, GSADR);
256 udelay(1000);
257
258 /* setup timings */
259 var->pixclock = mbxfb_get_pixclock(info->var.pixclock, &div);
260
261 writel((Disp_Pll_M(div.m) | Disp_Pll_N(div.n) |
262 Disp_Pll_P(div.p) | DISP_PLL_EN), DISPPLL);
263
264 hbps = var->hsync_len;
265 has = hbps + var->left_margin;
266 hfps = has + var->xres;
267 ht = hfps + var->right_margin;
268
269 vbps = var->vsync_len;
270 vas = vbps + var->upper_margin;
271 vfps = vas + var->yres;
272 vt = vfps + var->lower_margin;
273
274 writel((Dht01_Hbps(hbps) | Dht01_Ht(ht)), DHT01);
275 writel((Dht02_Hlbs(has) | Dht02_Has(has)), DHT02);
276 writel((Dht03_Hfps(hfps) | Dht03_Hrbs(hfps)), DHT03);
277 writel((Dhdet_Hdes(has) | Dhdet_Hdef(hfps)), DHDET);
278
279 writel((Dvt01_Vbps(vbps) | Dvt01_Vt(vt)), DVT01);
280 writel((Dvt02_Vtbs(vas) | Dvt02_Vas(vas)), DVT02);
281 writel((Dvt03_Vfps(vfps) | Dvt03_Vbbs(vfps)), DVT03);
282 writel((Dvdet_Vdes(vas) | Dvdet_Vdef(vfps)), DVDET);
283 writel((Dvectrl_Vevent(vfps) | Dvectrl_Vfetch(vbps)), DVECTRL);
284
285 writel((readl(DSCTRL) | DSCTRL_SYNCGEN_EN), DSCTRL);
286
287 return 0;
288}
289
290static int mbxfb_blank(int blank, struct fb_info *info)
291{
292 switch (blank) {
293 case FB_BLANK_POWERDOWN:
294 case FB_BLANK_VSYNC_SUSPEND:
295 case FB_BLANK_HSYNC_SUSPEND:
296 case FB_BLANK_NORMAL:
297 writel((readl(DSCTRL) & ~DSCTRL_SYNCGEN_EN), DSCTRL);
298 udelay(1000);
299 writel((readl(PIXCLK) & ~PIXCLK_EN), PIXCLK);
300 udelay(1000);
301 writel((readl(VOVRCLK) & ~VOVRCLK_EN), VOVRCLK);
302 udelay(1000);
303 break;
304 case FB_BLANK_UNBLANK:
305 writel((readl(DSCTRL) | DSCTRL_SYNCGEN_EN), DSCTRL);
306 udelay(1000);
307 writel((readl(PIXCLK) | PIXCLK_EN), PIXCLK);
308 udelay(1000);
309 break;
310 }
311 return 0;
312}
313
314static struct fb_ops mbxfb_ops = {
315 .owner = THIS_MODULE,
316 .fb_check_var = mbxfb_check_var,
317 .fb_set_par = mbxfb_set_par,
318 .fb_setcolreg = mbxfb_setcolreg,
319 .fb_fillrect = cfb_fillrect,
320 .fb_copyarea = cfb_copyarea,
321 .fb_imageblit = cfb_imageblit,
322 .fb_blank = mbxfb_blank,
323};
324
325/*
326 Enable external SDRAM controller. Assume that all clocks are active
327 by now.
328*/
329static void __devinit setup_memc(struct fb_info *fbi)
330{
331 struct mbxfb_info *mfbi = fbi->par;
332 unsigned long tmp;
333 int i;
334
335 /* FIXME: use platfrom specific parameters */
336 /* setup SDRAM controller */
337 writel((LMCFG_LMC_DS | LMCFG_LMC_TS | LMCFG_LMD_TS |
338 LMCFG_LMA_TS),
339 LMCFG);
340 udelay(1000);
341
342 writel(LMPWR_MC_PWR_ACT, LMPWR);
343 udelay(1000);
344
345 /* setup SDRAM timings */
346 writel((Lmtim_Tras(7) | Lmtim_Trp(3) | Lmtim_Trcd(3) |
347 Lmtim_Trc(9) | Lmtim_Tdpl(2)),
348 LMTIM);
349 udelay(1000);
350 /* setup SDRAM refresh rate */
351 writel(0xc2b, LMREFRESH);
352 udelay(1000);
353 /* setup SDRAM type parameters */
354 writel((LMTYPE_CASLAT_3 | LMTYPE_BKSZ_2 | LMTYPE_ROWSZ_11 |
355 LMTYPE_COLSZ_8),
356 LMTYPE);
357 udelay(1000);
358 /* enable memory controller */
359 writel(LMPWR_MC_PWR_ACT, LMPWR);
360 udelay(1000);
361
362 /* perform dummy reads */
363 for ( i = 0; i < 16; i++ ) {
364 tmp = readl(fbi->screen_base);
365 }
366}
367
368static void enable_clocks(struct fb_info *fbi)
369{
370 /* enable clocks */
371 writel(SYSCLKSRC_PLL_2, SYSCLKSRC);
372 udelay(1000);
373 writel(PIXCLKSRC_PLL_1, PIXCLKSRC);
374 udelay(1000);
375 writel(0x00000000, CLKSLEEP);
376 udelay(1000);
377 writel((Core_Pll_M(0x17) | Core_Pll_N(0x3) | Core_Pll_P(0x0) |
378 CORE_PLL_EN),
379 COREPLL);
380 udelay(1000);
381 writel((Disp_Pll_M(0x1b) | Disp_Pll_N(0x7) | Disp_Pll_P(0x1) |
382 DISP_PLL_EN),
383 DISPPLL);
384
385 writel(0x00000000, VOVRCLK);
386 udelay(1000);
387 writel(PIXCLK_EN, PIXCLK);
388 udelay(1000);
389 writel(MEMCLK_EN, MEMCLK);
390 udelay(1000);
391 writel(0x00000006, M24CLK);
392 udelay(1000);
393 writel(0x00000006, MBXCLK);
394 udelay(1000);
395 writel(SDCLK_EN, SDCLK);
396 udelay(1000);
397 writel(0x00000001, PIXCLKDIV);
398 udelay(1000);
399}
400
401static void __devinit setup_graphics(struct fb_info *fbi)
402{
403 unsigned long gsctrl;
404
405 gsctrl = GSCTRL_GAMMA_EN | Gsctrl_Width(fbi->var.xres - 1) |
406 Gsctrl_Height(fbi->var.yres - 1);
407 switch (fbi->var.bits_per_pixel) {
408 case 16:
409 if (fbi->var.green.length == 5)
410 gsctrl |= GSCTRL_GPIXFMT_ARGB1555;
411 else
412 gsctrl |= GSCTRL_GPIXFMT_RGB565;
413 break;
414 case 24:
415 gsctrl |= GSCTRL_GPIXFMT_RGB888;
416 break;
417 case 32:
418 gsctrl |= GSCTRL_GPIXFMT_ARGB8888;
419 break;
420 }
421
422 writel(gsctrl, GSCTRL);
423 udelay(1000);
424 writel(0x00000000, GBBASE);
425 udelay(1000);
426 writel(0x00ffffff, GDRCTRL);
427 udelay(1000);
428 writel((GSCADR_STR_EN | Gscadr_Gbase_Adr(0x6000)), GSCADR);
429 udelay(1000);
430 writel(0x00000000, GPLUT);
431 udelay(1000);
432}
433
434static void __devinit setup_display(struct fb_info *fbi)
435{
436 unsigned long dsctrl = 0;
437
438 dsctrl = DSCTRL_BLNK_POL;
439 if (fbi->var.sync & FB_SYNC_HOR_HIGH_ACT)
440 dsctrl |= DSCTRL_HS_POL;
441 if (fbi->var.sync & FB_SYNC_VERT_HIGH_ACT)
442 dsctrl |= DSCTRL_VS_POL;
443 writel(dsctrl, DSCTRL);
444 udelay(1000);
445 writel(0xd0303010, DMCTRL);
446 udelay(1000);
447 writel((readl(DSCTRL) | DSCTRL_SYNCGEN_EN), DSCTRL);
448}
449
450static void __devinit enable_controller(struct fb_info *fbi)
451{
452 writel(SYSRST_RST, SYSRST);
453 udelay(1000);
454
455
456 enable_clocks(fbi);
457 setup_memc(fbi);
458 setup_graphics(fbi);
459 setup_display(fbi);
460}
461
462#ifdef CONFIG_PM
463/*
464 * Power management hooks. Note that we won't be called from IRQ context,
465 * unlike the blank functions above, so we may sleep.
466 */
467static int mbxfb_suspend(struct platform_device *dev, pm_message_t state)
468{
469 /* make frame buffer memory enter self-refresh mode */
470 writel(LMPWR_MC_PWR_SRM, LMPWR);
471 while (LMPWRSTAT != LMPWRSTAT_MC_PWR_SRM)
472 ; /* empty statement */
473
474 /* reset the device, since it's initial state is 'mostly sleeping' */
475 writel(SYSRST_RST, SYSRST);
476 return 0;
477}
478
479static int mbxfb_resume(struct platform_device *dev)
480{
481 struct fb_info *fbi = platform_get_drvdata(dev);
482
483 enable_clocks(fbi);
484/* setup_graphics(fbi); */
485/* setup_display(fbi); */
486
487 writel((readl(DSCTRL) | DSCTRL_SYNCGEN_EN), DSCTRL);
488 return 0;
489}
490#else
491#define mbxfb_suspend NULL
492#define mbxfb_resume NULL
493#endif
494
495/* debugfs entries */
496#ifndef CONFIG_FB_MBX_DEBUG
497#define mbxfb_debugfs_init(x) do {} while(0)
498#define mbxfb_debugfs_remove(x) do {} while(0)
499#endif
500
501#define res_size(_r) (((_r)->end - (_r)->start) + 1)
502
503static int __devinit mbxfb_probe(struct platform_device *dev)
504{
505 int ret;
506 struct fb_info *fbi;
507 struct mbxfb_info *mfbi;
508 struct mbxfb_platform_data *pdata;
509
510 dev_dbg(dev, "mbxfb_probe\n");
511
512 fbi = framebuffer_alloc(sizeof(struct mbxfb_info), &dev->dev);
513 if (fbi == NULL) {
514 dev_err(&dev->dev, "framebuffer_alloc failed\n");
515 return -ENOMEM;
516 }
517
518 mfbi = fbi->par;
519 fbi->pseudo_palette = mfbi->pseudo_palette;
520 pdata = dev->dev.platform_data;
521 if (pdata->probe)
522 mfbi->platform_probe = pdata->probe;
523 if (pdata->remove)
524 mfbi->platform_remove = pdata->remove;
525
526 mfbi->fb_res = platform_get_resource(dev, IORESOURCE_MEM, 0);
527 mfbi->reg_res = platform_get_resource(dev, IORESOURCE_MEM, 1);
528
529 if (!mfbi->fb_res || !mfbi->reg_res) {
530 dev_err(&dev->dev, "no resources found\n");
531 ret = -ENODEV;
532 goto err1;
533 }
534
535 mfbi->fb_req = request_mem_region(mfbi->fb_res->start,
536 res_size(mfbi->fb_res), dev->name);
537 if (mfbi->fb_req == NULL) {
538 dev_err(&dev->dev, "failed to claim framebuffer memory\n");
539 ret = -EINVAL;
540 goto err1;
541 }
542 mfbi->fb_phys_addr = mfbi->fb_res->start;
543
544 mfbi->reg_req = request_mem_region(mfbi->reg_res->start,
545 res_size(mfbi->reg_res), dev->name);
546 if (mfbi->reg_req == NULL) {
547 dev_err(&dev->dev, "failed to claim Marathon registers\n");
548 ret = -EINVAL;
549 goto err2;
550 }
551 mfbi->reg_phys_addr = mfbi->reg_res->start;
552
553 mfbi->reg_virt_addr = ioremap_nocache(mfbi->reg_phys_addr,
554 res_size(mfbi->reg_req));
555 if (!mfbi->reg_virt_addr) {
556 dev_err(&dev->dev, "failed to ioremap Marathon registers\n");
557 ret = -EINVAL;
558 goto err3;
559 }
560 virt_base_2700 = (unsigned long)mfbi->reg_virt_addr;
561
562 mfbi->fb_virt_addr = ioremap_nocache(mfbi->fb_phys_addr,
563 res_size(mfbi->fb_req));
564 if (!mfbi->reg_virt_addr) {
565 dev_err(&dev->dev, "failed to ioremap frame buffer\n");
566 ret = -EINVAL;
567 goto err4;
568 }
569
570 /* FIXME: get from platform */
571 fbi->screen_base = (char __iomem *)(mfbi->fb_virt_addr + 0x60000);
572 fbi->screen_size = 8 * 1024 * 1024; /* 8 Megs */
573 fbi->fbops = &mbxfb_ops;
574
575 fbi->var = mbxfb_default;
576 fbi->fix = mbxfb_fix;
577 fbi->fix.smem_start = mfbi->fb_phys_addr + 0x60000;
578 fbi->fix.smem_len = 8 * 1024 * 1024;
579 fbi->fix.line_length = 640 * 2;
580
581 ret = fb_alloc_cmap(&fbi->cmap, 256, 0);
582 if (ret < 0) {
583 dev_err(&dev->dev, "fb_alloc_cmap failed\n");
584 ret = -EINVAL;
585 goto err5;
586 }
587
588 platform_set_drvdata(dev, fbi);
589
590 printk(KERN_INFO "fb%d: mbx frame buffer device\n", fbi->node);
591
592 if (mfbi->platform_probe)
593 mfbi->platform_probe(fbi);
594
595 enable_controller(fbi);
596
597 mbxfb_debugfs_init(fbi);
598
599 ret = register_framebuffer(fbi);
600 if (ret < 0) {
601 dev_err(&dev->dev, "register_framebuffer failed\n");
602 ret = -EINVAL;
603 goto err6;
604 }
605
606 return 0;
607
608err6:
609 fb_dealloc_cmap(&fbi->cmap);
610err5:
611 iounmap(mfbi->fb_virt_addr);
612err4:
613 iounmap(mfbi->reg_virt_addr);
614err3:
615 release_mem_region(mfbi->reg_res->start, res_size(mfbi->reg_res));
616err2:
617 release_mem_region(mfbi->fb_res->start, res_size(mfbi->fb_res));
618err1:
619 framebuffer_release(fbi);
620
621 return ret;
622}
623
624static int __devexit mbxfb_remove(struct platform_device *dev)
625{
626 struct fb_info *fbi = platform_get_drvdata(dev);
627
628 writel(SYSRST_RST, SYSRST);
629 udelay(1000);
630
631 mbxfb_debugfs_remove(fbi);
632
633 if (fbi) {
634 struct mbxfb_info *mfbi = fbi->par;
635
636 unregister_framebuffer(fbi);
637 if (mfbi) {
638 if (mfbi->platform_remove)
639 mfbi->platform_remove(fbi);
640
641 if (mfbi->fb_virt_addr)
642 iounmap(mfbi->fb_virt_addr);
643 if (mfbi->reg_virt_addr)
644 iounmap(mfbi->reg_virt_addr);
645 if (mfbi->reg_req)
646 release_mem_region(mfbi->reg_req->start,
647 res_size(mfbi->reg_req));
648 if (mfbi->fb_req)
649 release_mem_region(mfbi->fb_req->start,
650 res_size(mfbi->fb_req));
651 }
652 framebuffer_release(fbi);
653 }
654
655 return 0;
656}
657
658static struct platform_driver mbxfb_driver = {
659 .probe = mbxfb_probe,
660 .remove = mbxfb_remove,
661 .suspend = mbxfb_suspend,
662 .resume = mbxfb_resume,
663 .driver = {
664 .name = "mbx-fb",
665 },
666};
667
668int __devinit mbxfb_init(void)
669{
670 return platform_driver_register(&mbxfb_driver);
671}
672
673static void __devexit mbxfb_exit(void)
674{
675 platform_driver_unregister(&mbxfb_driver);
676}
677
678module_init(mbxfb_init);
679module_exit(mbxfb_exit);
680
681MODULE_DESCRIPTION("loadable framebuffer driver for Marathon device");
682MODULE_AUTHOR("Mike Rapoport, Compulab");
683MODULE_LICENSE("GPL");
diff --git a/drivers/video/mbx/reg_bits.h b/drivers/video/mbx/reg_bits.h
new file mode 100644
index 000000000000..c226a8e45312
--- /dev/null
+++ b/drivers/video/mbx/reg_bits.h
@@ -0,0 +1,418 @@
1#ifndef __REG_BITS_2700G_
2#define __REG_BITS_2700G_
3
4/* use defines from asm-arm/arch-pxa/bitfields.h for bit fields access */
5#define UData(Data) ((unsigned long) (Data))
6#define Fld(Size, Shft) (((Size) << 16) + (Shft))
7#define FSize(Field) ((Field) >> 16)
8#define FShft(Field) ((Field) & 0x0000FFFF)
9#define FMsk(Field) (((UData (1) << FSize (Field)) - 1) << FShft (Field))
10#define FAlnMsk(Field) ((UData (1) << FSize (Field)) - 1)
11#define F1stBit(Field) (UData (1) << FShft (Field))
12
13#define SYSRST_RST (1 << 0)
14
15/* SYSCLKSRC - SYSCLK Source Control Register */
16#define SYSCLKSRC_SEL Fld(2,0)
17#define SYSCLKSRC_REF ((0x0) << FShft(SYSCLKSRC_SEL))
18#define SYSCLKSRC_PLL_1 ((0x1) << FShft(SYSCLKSRC_SEL))
19#define SYSCLKSRC_PLL_2 ((0x2) << FShft(SYSCLKSRC_SEL))
20
21/* PIXCLKSRC - PIXCLK Source Control Register */
22#define PIXCLKSRC_SEL Fld(2,0)
23#define PIXCLKSRC_REF ((0x0) << FShft(PIXCLKSRC_SEL))
24#define PIXCLKSRC_PLL_1 ((0x1) << FShft(PIXCLKSRC_SEL))
25#define PIXCLKSRC_PLL_2 ((0x2) << FShft(PIXCLKSRC_SEL))
26
27/* Clock Disable Register */
28#define CLKSLEEP_SLP (1 << 0)
29
30/* Core PLL Control Register */
31#define CORE_PLL_M Fld(6,7)
32#define Core_Pll_M(x) ((x) << FShft(CORE_PLL_M))
33#define CORE_PLL_N Fld(3,4)
34#define Core_Pll_N(x) ((x) << FShft(CORE_PLL_N))
35#define CORE_PLL_P Fld(3,1)
36#define Core_Pll_P(x) ((x) << FShft(CORE_PLL_P))
37#define CORE_PLL_EN (1 << 0)
38
39/* Display PLL Control Register */
40#define DISP_PLL_M Fld(6,7)
41#define Disp_Pll_M(x) ((x) << FShft(DISP_PLL_M))
42#define DISP_PLL_N Fld(3,4)
43#define Disp_Pll_N(x) ((x) << FShft(DISP_PLL_N))
44#define DISP_PLL_P Fld(3,1)
45#define Disp_Pll_P(x) ((x) << FShft(DISP_PLL_P))
46#define DISP_PLL_EN (1 << 0)
47
48/* PLL status register */
49#define PLLSTAT_CORE_PLL_LOST_L (1 << 3)
50#define PLLSTAT_CORE_PLL_LSTS (1 << 2)
51#define PLLSTAT_DISP_PLL_LOST_L (1 << 1)
52#define PLLSTAT_DISP_PLL_LSTS (1 << 0)
53
54/* Video and scale clock control register */
55#define VOVRCLK_EN (1 << 0)
56
57/* Pixel clock control register */
58#define PIXCLK_EN (1 << 0)
59
60/* Memory clock control register */
61#define MEMCLK_EN (1 << 0)
62
63/* MBX clock control register */
64#define MBXCLK_DIV Fld(2,2)
65#define MBXCLK_DIV_1 ((0x0) << FShft(MBXCLK_DIV))
66#define MBXCLK_DIV_2 ((0x1) << FShft(MBXCLK_DIV))
67#define MBXCLK_DIV_3 ((0x2) << FShft(MBXCLK_DIV))
68#define MBXCLK_DIV_4 ((0x3) << FShft(MBXCLK_DIV))
69#define MBXCLK_EN Fld(2,0)
70#define MBXCLK_EN_NONE ((0x0) << FShft(MBXCLK_EN))
71#define MBXCLK_EN_2D ((0x1) << FShft(MBXCLK_EN))
72#define MBXCLK_EN_BOTH ((0x2) << FShft(MBXCLK_EN))
73
74/* M24 clock control register */
75#define M24CLK_DIV Fld(2,1)
76#define M24CLK_DIV_1 ((0x0) << FShft(M24CLK_DIV))
77#define M24CLK_DIV_2 ((0x1) << FShft(M24CLK_DIV))
78#define M24CLK_DIV_3 ((0x2) << FShft(M24CLK_DIV))
79#define M24CLK_DIV_4 ((0x3) << FShft(M24CLK_DIV))
80#define M24CLK_EN (1 << 0)
81
82/* SDRAM clock control register */
83#define SDCLK_EN (1 << 0)
84
85/* PixClk Divisor Register */
86#define PIXCLKDIV_PD Fld(9,0)
87#define Pixclkdiv_Pd(x) ((x) << FShft(PIXCLKDIV_PD))
88
89/* LCD Config control register */
90#define LCDCFG_IN_FMT Fld(3,28)
91#define Lcdcfg_In_Fmt(x) ((x) << FShft(LCDCFG_IN_FMT))
92#define LCDCFG_LCD1DEN_POL (1 << 27)
93#define LCDCFG_LCD1FCLK_POL (1 << 26)
94#define LCDCFG_LCD1LCLK_POL (1 << 25)
95#define LCDCFG_LCD1D_POL (1 << 24)
96#define LCDCFG_LCD2DEN_POL (1 << 23)
97#define LCDCFG_LCD2FCLK_POL (1 << 22)
98#define LCDCFG_LCD2LCLK_POL (1 << 21)
99#define LCDCFG_LCD2D_POL (1 << 20)
100#define LCDCFG_LCD1_TS (1 << 19)
101#define LCDCFG_LCD1D_DS (1 << 18)
102#define LCDCFG_LCD1C_DS (1 << 17)
103#define LCDCFG_LCD1_IS_IN (1 << 16)
104#define LCDCFG_LCD2_TS (1 << 3)
105#define LCDCFG_LCD2D_DS (1 << 2)
106#define LCDCFG_LCD2C_DS (1 << 1)
107#define LCDCFG_LCD2_IS_IN (1 << 0)
108
109/* On-Die Frame Buffer Power Control Register */
110#define ODFBPWR_SLOW (1 << 2)
111#define ODFBPWR_MODE Fld(2,0)
112#define ODFBPWR_MODE_ACT ((0x0) << FShft(ODFBPWR_MODE))
113#define ODFBPWR_MODE_ACT_LP ((0x1) << FShft(ODFBPWR_MODE))
114#define ODFBPWR_MODE_SLEEP ((0x2) << FShft(ODFBPWR_MODE))
115#define ODFBPWR_MODE_SHUTD ((0x3) << FShft(ODFBPWR_MODE))
116
117/* On-Die Frame Buffer Power State Status Register */
118#define ODFBSTAT_ACT (1 << 2)
119#define ODFBSTAT_SLP (1 << 1)
120#define ODFBSTAT_SDN (1 << 0)
121
122/* LMRST - Local Memory (SDRAM) Reset */
123#define LMRST_MC_RST (1 << 0)
124
125/* LMCFG - Local Memory (SDRAM) Configuration Register */
126#define LMCFG_LMC_DS (1 << 5)
127#define LMCFG_LMD_DS (1 << 4)
128#define LMCFG_LMA_DS (1 << 3)
129#define LMCFG_LMC_TS (1 << 2)
130#define LMCFG_LMD_TS (1 << 1)
131#define LMCFG_LMA_TS (1 << 0)
132
133/* LMPWR - Local Memory (SDRAM) Power Control Register */
134#define LMPWR_MC_PWR_CNT Fld(2,0)
135#define LMPWR_MC_PWR_ACT ((0x0) << FShft(LMPWR_MC_PWR_CNT)) /* Active */
136#define LMPWR_MC_PWR_SRM ((0x1) << FShft(LMPWR_MC_PWR_CNT)) /* Self-refresh */
137#define LMPWR_MC_PWR_DPD ((0x3) << FShft(LMPWR_MC_PWR_CNT)) /* deep power down */
138
139/* LMPWRSTAT - Local Memory (SDRAM) Power Status Register */
140#define LMPWRSTAT_MC_PWR_CNT Fld(2,0)
141#define LMPWRSTAT_MC_PWR_ACT ((0x0) << FShft(LMPWRSTAT_MC_PWR_CNT)) /* Active */
142#define LMPWRSTAT_MC_PWR_SRM ((0x1) << FShft(LMPWRSTAT_MC_PWR_CNT)) /* Self-refresh */
143#define LMPWRSTAT_MC_PWR_DPD ((0x3) << FShft(LMPWRSTAT_MC_PWR_CNT)) /* deep power down */
144
145/* LMTYPE - Local Memory (SDRAM) Type Register */
146#define LMTYPE_CASLAT Fld(3,10)
147#define LMTYPE_CASLAT_1 ((0x1) << FShft(LMTYPE_CASLAT))
148#define LMTYPE_CASLAT_2 ((0x2) << FShft(LMTYPE_CASLAT))
149#define LMTYPE_CASLAT_3 ((0x3) << FShft(LMTYPE_CASLAT))
150#define LMTYPE_BKSZ Fld(2,8)
151#define LMTYPE_BKSZ_1 ((0x1) << FShft(LMTYPE_BKSZ))
152#define LMTYPE_BKSZ_2 ((0x2) << FShft(LMTYPE_BKSZ))
153#define LMTYPE_ROWSZ Fld(4,4)
154#define LMTYPE_ROWSZ_11 ((0xb) << FShft(LMTYPE_ROWSZ))
155#define LMTYPE_ROWSZ_12 ((0xc) << FShft(LMTYPE_ROWSZ))
156#define LMTYPE_ROWSZ_13 ((0xd) << FShft(LMTYPE_ROWSZ))
157#define LMTYPE_COLSZ Fld(4,0)
158#define LMTYPE_COLSZ_7 ((0x7) << FShft(LMTYPE_COLSZ))
159#define LMTYPE_COLSZ_8 ((0x8) << FShft(LMTYPE_COLSZ))
160#define LMTYPE_COLSZ_9 ((0x9) << FShft(LMTYPE_COLSZ))
161#define LMTYPE_COLSZ_10 ((0xa) << FShft(LMTYPE_COLSZ))
162#define LMTYPE_COLSZ_11 ((0xb) << FShft(LMTYPE_COLSZ))
163#define LMTYPE_COLSZ_12 ((0xc) << FShft(LMTYPE_COLSZ))
164
165/* LMTIM - Local Memory (SDRAM) Timing Register */
166#define LMTIM_TRAS Fld(4,16)
167#define Lmtim_Tras(x) ((x) << FShft(LMTIM_TRAS))
168#define LMTIM_TRP Fld(4,12)
169#define Lmtim_Trp(x) ((x) << FShft(LMTIM_TRP))
170#define LMTIM_TRCD Fld(4,8)
171#define Lmtim_Trcd(x) ((x) << FShft(LMTIM_TRCD))
172#define LMTIM_TRC Fld(4,4)
173#define Lmtim_Trc(x) ((x) << FShft(LMTIM_TRC))
174#define LMTIM_TDPL Fld(4,0)
175#define Lmtim_Tdpl(x) ((x) << FShft(LMTIM_TDPL))
176
177/* LMREFRESH - Local Memory (SDRAM) tREF Control Register */
178#define LMREFRESH_TREF Fld(2,0)
179#define Lmrefresh_Tref(x) ((x) << FShft(LMREFRESH_TREF))
180
181/* GSCTRL - Graphics surface control register */
182#define GSCTRL_LUT_EN (1 << 31)
183#define GSCTRL_GPIXFMT Fld(4,27)
184#define GSCTRL_GPIXFMT_INDEXED ((0x0) << FShft(GSCTRL_GPIXFMT))
185#define GSCTRL_GPIXFMT_ARGB4444 ((0x4) << FShft(GSCTRL_GPIXFMT))
186#define GSCTRL_GPIXFMT_ARGB1555 ((0x5) << FShft(GSCTRL_GPIXFMT))
187#define GSCTRL_GPIXFMT_RGB888 ((0x6) << FShft(GSCTRL_GPIXFMT))
188#define GSCTRL_GPIXFMT_RGB565 ((0x7) << FShft(GSCTRL_GPIXFMT))
189#define GSCTRL_GPIXFMT_ARGB8888 ((0x8) << FShft(GSCTRL_GPIXFMT))
190#define GSCTRL_GAMMA_EN (1 << 26)
191
192#define GSCTRL_GSWIDTH Fld(11,11)
193#define Gsctrl_Width(Pixel) /* Display Width [1..2048 pix.] */ \
194 (((Pixel) - 1) << FShft(GSCTRL_GSWIDTH))
195
196#define GSCTRL_GSHEIGHT Fld(11,0)
197#define Gsctrl_Height(Pixel) /* Display Height [1..2048 pix.] */ \
198 (((Pixel) - 1) << FShft(GSCTRL_GSHEIGHT))
199
200/* GBBASE fileds */
201#define GBBASE_GLALPHA Fld(8,24)
202#define Gbbase_Glalpha(x) ((x) << FShft(GBBASE_GLALPHA))
203
204#define GBBASE_COLKEY Fld(24,0)
205#define Gbbase_Colkey(x) ((x) << FShft(GBBASE_COLKEY))
206
207/* GDRCTRL fields */
208#define GDRCTRL_PIXDBL (1 << 31)
209#define GDRCTRL_PIXHLV (1 << 30)
210#define GDRCTRL_LNDBL (1 << 29)
211#define GDRCTRL_LNHLV (1 << 28)
212#define GDRCTRL_COLKEYM Fld(24,0)
213#define Gdrctrl_Colkeym(x) ((x) << FShft(GDRCTRL_COLKEYM))
214
215/* GSCADR graphics stream control address register fields */
216#define GSCADR_STR_EN (1 << 31)
217#define GSCADR_COLKEY_EN (1 << 30)
218#define GSCADR_COLKEYSCR (1 << 29)
219#define GSCADR_BLEND_M Fld(2,27)
220#define GSCADR_BLEND_NONE ((0x0) << FShft(GSCADR_BLEND_M))
221#define GSCADR_BLEND_INV ((0x1) << FShft(GSCADR_BLEND_M))
222#define GSCADR_BLEND_GLOB ((0x2) << FShft(GSCADR_BLEND_M))
223#define GSCADR_BLEND_PIX ((0x3) << FShft(GSCADR_BLEND_M))
224#define GSCADR_BLEND_POS Fld(2,24)
225#define GSCADR_BLEND_GFX ((0x0) << FShft(GSCADR_BLEND_POS))
226#define GSCADR_BLEND_VID ((0x1) << FShft(GSCADR_BLEND_POS))
227#define GSCADR_BLEND_CUR ((0x2) << FShft(GSCADR_BLEND_POS))
228#define GSCADR_GBASE_ADR Fld(23,0)
229#define Gscadr_Gbase_Adr(x) ((x) << FShft(GSCADR_GBASE_ADR))
230
231/* GSADR graphics stride address register fields */
232#define GSADR_SRCSTRIDE Fld(10,22)
233#define Gsadr_Srcstride(x) ((x) << FShft(GSADR_SRCSTRIDE))
234#define GSADR_XSTART Fld(11,11)
235#define Gsadr_Xstart(x) ((x) << FShft(GSADR_XSTART))
236#define GSADR_YSTART Fld(11,0)
237#define Gsadr_Ystart(y) ((y) << FShft(GSADR_YSTART))
238
239/* GPLUT graphics palette register fields */
240#define GPLUT_LUTADR Fld(8,24)
241#define Gplut_Lutadr(x) ((x) << FShft(GPLUT_LUTADR))
242#define GPLUT_LUTDATA Fld(24,0)
243#define Gplut_Lutdata(x) ((x) << FShft(GPLUT_LUTDATA))
244
245/* HCCTRL - Hardware Cursor Register fields */
246#define HCCTRL_CUR_EN (1 << 31)
247#define HCCTRL_COLKEY_EN (1 << 29)
248#define HCCTRL_COLKEYSRC (1 << 28)
249#define HCCTRL_BLEND_M Fld(2,26)
250#define HCCTRL_BLEND_NONE ((0x0) << FShft(HCCTRL_BLEND_M))
251#define HCCTRL_BLEND_INV ((0x1) << FShft(HCCTRL_BLEND_M))
252#define HCCTRL_BLEND_GLOB ((0x2) << FShft(HCCTRL_BLEND_M))
253#define HCCTRL_BLEND_PIX ((0x3) << FShft(HCCTRL_BLEND_M))
254#define HCCTRL_CPIXFMT Fld(3,23)
255#define HCCTRL_CPIXFMT_RGB332 ((0x3) << FShft(HCCTRL_CPIXFMT))
256#define HCCTRL_CPIXFMT_ARGB4444 ((0x4) << FShft(HCCTRL_CPIXFMT))
257#define HCCTRL_CPIXFMT_ARGB1555 ((0x5) << FShft(HCCTRL_CPIXFMT))
258#define HCCTRL_CBASE_ADR Fld(23,0)
259#define Hcctrl_Cbase_Adr(x) ((x) << FShft(HCCTRL_CBASE_ADR))
260
261/* HCSIZE Hardware Cursor Size Register fields */
262#define HCSIZE_BLEND_POS Fld(2,29)
263#define HCSIZE_BLEND_GFX ((0x0) << FShft(HCSIZE_BLEND_POS))
264#define HCSIZE_BLEND_VID ((0x1) << FShft(HCSIZE_BLEND_POS))
265#define HCSIZE_BLEND_CUR ((0x2) << FShft(HCSIZE_BLEND_POS))
266#define HCSIZE_CWIDTH Fld(3,16)
267#define Hcsize_Cwidth(x) ((x) << FShft(HCSIZE_CWIDTH))
268#define HCSIZE_CHEIGHT Fld(3,0)
269#define Hcsize_Cheight(x) ((x) << FShft(HCSIZE_CHEIGHT))
270
271/* HCPOS Hardware Cursor Position Register fields */
272#define HCPOS_SWITCHSRC (1 << 30)
273#define HCPOS_CURBLINK Fld(6,24)
274#define Hcpos_Curblink(x) ((x) << FShft(HCPOS_CURBLINK))
275#define HCPOS_XSTART Fld(12,12)
276#define Hcpos_Xstart(x) ((x) << FShft(HCPOS_XSTART))
277#define HCPOS_YSTART Fld(12,0)
278#define Hcpos_Ystart(y) ((y) << FShft(HCPOS_YSTART))
279
280/* HCBADR Hardware Cursor Blend Address Register */
281#define HCBADR_GLALPHA Fld(8,24)
282#define Hcbadr_Glalpha(x) ((x) << FShft(HCBADR_GLALPHA))
283#define HCBADR_COLKEY Fld(24,0)
284#define Hcbadr_Colkey(x) ((x) << FShft(HCBADR_COLKEY))
285
286/* HCCKMSK - Hardware Cursor Color Key Mask Register */
287#define HCCKMSK_COLKEY_M Fld(24,0)
288#define Hcckmsk_Colkey_M(x) ((x) << FShft(HCCKMSK_COLKEY_M))
289
290/* DSCTRL - Display sync control register */
291#define DSCTRL_SYNCGEN_EN (1 << 31)
292#define DSCTRL_DPL_RST (1 << 29)
293#define DSCTRL_PWRDN_M (1 << 28)
294#define DSCTRL_UPDSYNCCNT (1 << 26)
295#define DSCTRL_UPDINTCNT (1 << 25)
296#define DSCTRL_UPDCNT (1 << 24)
297#define DSCTRL_UPDWAIT Fld(4,16)
298#define Dsctrl_Updwait(x) ((x) << FShft(DSCTRL_UPDWAIT))
299#define DSCTRL_CLKPOL (1 << 11)
300#define DSCTRL_CSYNC_EN (1 << 10)
301#define DSCTRL_VS_SLAVE (1 << 7)
302#define DSCTRL_HS_SLAVE (1 << 6)
303#define DSCTRL_BLNK_POL (1 << 5)
304#define DSCTRL_BLNK_DIS (1 << 4)
305#define DSCTRL_VS_POL (1 << 3)
306#define DSCTRL_VS_DIS (1 << 2)
307#define DSCTRL_HS_POL (1 << 1)
308#define DSCTRL_HS_DIS (1 << 0)
309
310/* DHT01 - Display horizontal timing register 01 */
311#define DHT01_HBPS Fld(12,16)
312#define Dht01_Hbps(x) ((x) << FShft(DHT01_HBPS))
313#define DHT01_HT Fld(12,0)
314#define Dht01_Ht(x) ((x) << FShft(DHT01_HT))
315
316/* DHT02 - Display horizontal timing register 02 */
317#define DHT02_HAS Fld(12,16)
318#define Dht02_Has(x) ((x) << FShft(DHT02_HAS))
319#define DHT02_HLBS Fld(12,0)
320#define Dht02_Hlbs(x) ((x) << FShft(DHT02_HLBS))
321
322/* DHT03 - Display horizontal timing register 03 */
323#define DHT03_HFPS Fld(12,16)
324#define Dht03_Hfps(x) ((x) << FShft(DHT03_HFPS))
325#define DHT03_HRBS Fld(12,0)
326#define Dht03_Hrbs(x) ((x) << FShft(DHT03_HRBS))
327
328/* DVT01 - Display vertical timing register 01 */
329#define DVT01_VBPS Fld(12,16)
330#define Dvt01_Vbps(x) ((x) << FShft(DVT01_VBPS))
331#define DVT01_VT Fld(12,0)
332#define Dvt01_Vt(x) ((x) << FShft(DVT01_VT))
333
334/* DVT02 - Display vertical timing register 02 */
335#define DVT02_VAS Fld(12,16)
336#define Dvt02_Vas(x) ((x) << FShft(DVT02_VAS))
337#define DVT02_VTBS Fld(12,0)
338#define Dvt02_Vtbs(x) ((x) << FShft(DVT02_VTBS))
339
340/* DVT03 - Display vertical timing register 03 */
341#define DVT03_VFPS Fld(12,16)
342#define Dvt03_Vfps(x) ((x) << FShft(DVT03_VFPS))
343#define DVT03_VBBS Fld(12,0)
344#define Dvt03_Vbbs(x) ((x) << FShft(DVT03_VBBS))
345
346/* DVECTRL - display vertical event control register */
347#define DVECTRL_VEVENT Fld(12,16)
348#define Dvectrl_Vevent(x) ((x) << FShft(DVECTRL_VEVENT))
349#define DVECTRL_VFETCH Fld(12,0)
350#define Dvectrl_Vfetch(x) ((x) << FShft(DVECTRL_VFETCH))
351
352/* DHDET - display horizontal DE timing register */
353#define DHDET_HDES Fld(12,16)
354#define Dhdet_Hdes(x) ((x) << FShft(DHDET_HDES))
355#define DHDET_HDEF Fld(12,0)
356#define Dhdet_Hdef(x) ((x) << FShft(DHDET_HDEF))
357
358/* DVDET - display vertical DE timing register */
359#define DVDET_VDES Fld(12,16)
360#define Dvdet_Vdes(x) ((x) << FShft(DVDET_VDES))
361#define DVDET_VDEF Fld(12,0)
362#define Dvdet_Vdef(x) ((x) << FShft(DVDET_VDEF))
363
364/* DODMSK - display output data mask register */
365#define DODMSK_MASK_LVL (1 << 31)
366#define DODMSK_BLNK_LVL (1 << 30)
367#define DODMSK_MASK_B Fld(8,16)
368#define Dodmsk_Mask_B(x) ((x) << FShft(DODMSK_MASK_B))
369#define DODMSK_MASK_G Fld(8,8)
370#define Dodmsk_Mask_G(x) ((x) << FShft(DODMSK_MASK_G))
371#define DODMSK_MASK_R Fld(8,0)
372#define Dodmsk_Mask_R(x) ((x) << FShft(DODMSK_MASK_R))
373
374/* DBCOL - display border color control register */
375#define DBCOL_BORDCOL Fld(24,0)
376#define Dbcol_Bordcol(x) ((x) << FShft(DBCOL_BORDCOL))
377
378/* DVLNUM - display vertical line number register */
379#define DVLNUM_VLINE Fld(12,0)
380#define Dvlnum_Vline(x) ((x) << FShft(DVLNUM_VLINE))
381
382/* DMCTRL - Display Memory Control Register */
383#define DMCTRL_MEM_REF Fld(2,30)
384#define DMCTRL_MEM_REF_ACT ((0x0) << FShft(DMCTRL_MEM_REF))
385#define DMCTRL_MEM_REF_HB ((0x1) << FShft(DMCTRL_MEM_REF))
386#define DMCTRL_MEM_REF_VB ((0x2) << FShft(DMCTRL_MEM_REF))
387#define DMCTRL_MEM_REF_BOTH ((0x3) << FShft(DMCTRL_MEM_REF))
388#define DMCTRL_UV_THRHLD Fld(6,24)
389#define Dmctrl_Uv_Thrhld(x) ((x) << FShft(DMCTRL_UV_THRHLD))
390#define DMCTRL_V_THRHLD Fld(7,16)
391#define Dmctrl_V_Thrhld(x) ((x) << FShft(DMCTRL_V_THRHLD))
392#define DMCTRL_D_THRHLD Fld(7,8)
393#define Dmctrl_D_Thrhld(x) ((x) << FShft(DMCTRL_D_THRHLD))
394#define DMCTRL_BURSTLEN Fld(6,0)
395#define Dmctrl_Burstlen(x) ((x) << FShft(DMCTRL_BURSTLEN))
396
397
398/* DLSTS - display load status register */
399#define DLSTS_RLD_ADONE (1 << 23)
400/* #define DLSTS_RLD_ADOUT Fld(23,0) */
401
402/* DLLCTRL - display list load control register */
403#define DLLCTRL_RLD_ADRLN Fld(8,24)
404#define Dllctrl_Rld_Adrln(x) ((x) << FShft(DLLCTRL_RLD_ADRLN))
405
406/* SPOCTRL - Scale Pitch/Order Control Register */
407#define SPOCTRL_H_SC_BP (1 << 31)
408#define SPOCTRL_V_SC_BP (1 << 30)
409#define SPOCTRL_HV_SC_OR (1 << 29)
410#define SPOCTRL_VS_UR_C (1 << 27)
411#define SPOCTRL_VORDER Fld(2,16)
412#define SPOCTRL_VORDER_1TAP ((0x0) << FShft(SPOCTRL_VORDER))
413#define SPOCTRL_VORDER_2TAP ((0x1) << FShft(SPOCTRL_VORDER))
414#define SPOCTRL_VORDER_4TAP ((0x3) << FShft(SPOCTRL_VORDER))
415#define SPOCTRL_VPITCH Fld(16,0)
416#define Spoctrl_Vpitch(x) ((x) << FShft(SPOCTRL_VPITCH))
417
418#endif /* __REG_BITS_2700G_ */
diff --git a/drivers/video/mbx/regs.h b/drivers/video/mbx/regs.h
new file mode 100644
index 000000000000..ad20be07666b
--- /dev/null
+++ b/drivers/video/mbx/regs.h
@@ -0,0 +1,195 @@
1#ifndef __REGS_2700G_
2#define __REGS_2700G_
3
4/* extern unsigned long virt_base_2700; */
5/* #define __REG_2700G(x) (*(volatile unsigned long*)((x)+virt_base_2700)) */
6#define __REG_2700G(x) ((x)+virt_base_2700)
7
8/* System Configuration Registers (0x0000_0000 0x0000_0010) */
9#define SYSCFG __REG_2700G(0x00000000)
10#define PFBASE __REG_2700G(0x00000004)
11#define PFCEIL __REG_2700G(0x00000008)
12#define POLLFLAG __REG_2700G(0x0000000c)
13#define SYSRST __REG_2700G(0x00000010)
14
15/* Interrupt Control Registers (0x0000_0014 0x0000_002F) */
16#define NINTPW __REG_2700G(0x00000014)
17#define MINTENABLE __REG_2700G(0x00000018)
18#define MINTSTAT __REG_2700G(0x0000001c)
19#define SINTENABLE __REG_2700G(0x00000020)
20#define SINTSTAT __REG_2700G(0x00000024)
21#define SINTCLR __REG_2700G(0x00000028)
22
23/* Clock Control Registers (0x0000_002C 0x0000_005F) */
24#define SYSCLKSRC __REG_2700G(0x0000002c)
25#define PIXCLKSRC __REG_2700G(0x00000030)
26#define CLKSLEEP __REG_2700G(0x00000034)
27#define COREPLL __REG_2700G(0x00000038)
28#define DISPPLL __REG_2700G(0x0000003c)
29#define PLLSTAT __REG_2700G(0x00000040)
30#define VOVRCLK __REG_2700G(0x00000044)
31#define PIXCLK __REG_2700G(0x00000048)
32#define MEMCLK __REG_2700G(0x0000004c)
33#define M24CLK __REG_2700G(0x00000054)
34#define MBXCLK __REG_2700G(0x00000054)
35#define SDCLK __REG_2700G(0x00000058)
36#define PIXCLKDIV __REG_2700G(0x0000005c)
37
38/* LCD Port Control Register (0x0000_0060 0x0000_006F) */
39#define LCD_CONFIG __REG_2700G(0x00000060)
40
41/* On-Die Frame Buffer Registers (0x0000_0064 0x0000_006B) */
42#define ODFBPWR __REG_2700G(0x00000064)
43#define ODFBSTAT __REG_2700G(0x00000068)
44
45/* GPIO Registers (0x0000_006C 0x0000_007F) */
46#define GPIOCGF __REG_2700G(0x0000006c)
47#define GPIOHI __REG_2700G(0x00000070)
48#define GPIOLO __REG_2700G(0x00000074)
49#define GPIOSTAT __REG_2700G(0x00000078)
50
51/* Pulse Width Modulator (PWM) Registers (0x0000_0200 0x0000_02FF) */
52#define PWMRST __REG_2700G(0x00000200)
53#define PWMCFG __REG_2700G(0x00000204)
54#define PWM0DIV __REG_2700G(0x00000210)
55#define PWM0DUTY __REG_2700G(0x00000214)
56#define PWM0PER __REG_2700G(0x00000218)
57#define PWM1DIV __REG_2700G(0x00000220)
58#define PWM1DUTY __REG_2700G(0x00000224)
59#define PWM1PER __REG_2700G(0x00000228)
60
61/* Identification (ID) Registers (0x0000_0300 0x0000_0FFF) */
62#define ID __REG_2700G(0x00000FF0)
63
64/* Local Memory (SDRAM) Interface Registers (0x0000_1000 0x0000_1FFF) */
65#define LMRST __REG_2700G(0x00001000)
66#define LMCFG __REG_2700G(0x00001004)
67#define LMPWR __REG_2700G(0x00001008)
68#define LMPWRSTAT __REG_2700G(0x0000100c)
69#define LMCEMR __REG_2700G(0x00001010)
70#define LMTYPE __REG_2700G(0x00001014)
71#define LMTIM __REG_2700G(0x00001018)
72#define LMREFRESH __REG_2700G(0x0000101c)
73#define LMPROTMIN __REG_2700G(0x00001020)
74#define LMPROTMAX __REG_2700G(0x00001024)
75#define LMPROTCFG __REG_2700G(0x00001028)
76#define LMPROTERR __REG_2700G(0x0000102c)
77
78/* Plane Controller Registers (0x0000_2000 0x0000_2FFF) */
79#define GSCTRL __REG_2700G(0x00002000)
80#define VSCTRL __REG_2700G(0x00002004)
81#define GBBASE __REG_2700G(0x00002020)
82#define VBBASE __REG_2700G(0x00002024)
83#define GDRCTRL __REG_2700G(0x00002040)
84#define VCMSK __REG_2700G(0x00002044)
85#define GSCADR __REG_2700G(0x00002060)
86#define VSCADR __REG_2700G(0x00002064)
87#define VUBASE __REG_2700G(0x00002084)
88#define VVBASE __REG_2700G(0x000020a4)
89#define GSADR __REG_2700G(0x000020c0)
90#define VSADR __REG_2700G(0x000020c4)
91#define HCCTRL __REG_2700G(0x00002100)
92#define HCSIZE __REG_2700G(0x00002110)
93#define HCPOS __REG_2700G(0x00002120)
94#define HCBADR __REG_2700G(0x00002130)
95#define HCCKMSK __REG_2700G(0x00002140)
96#define GPLUT __REG_2700G(0x00002150)
97#define DSCTRL __REG_2700G(0x00002154)
98#define DHT01 __REG_2700G(0x00002158)
99#define DHT02 __REG_2700G(0x0000215c)
100#define DHT03 __REG_2700G(0x00002160)
101#define DVT01 __REG_2700G(0x00002164)
102#define DVT02 __REG_2700G(0x00002168)
103#define DVT03 __REG_2700G(0x0000216c)
104#define DBCOL __REG_2700G(0x00002170)
105#define BGCOLOR __REG_2700G(0x00002174)
106#define DINTRS __REG_2700G(0x00002178)
107#define DINTRE __REG_2700G(0x0000217c)
108#define DINTRCNT __REG_2700G(0x00002180)
109#define DSIG __REG_2700G(0x00002184)
110#define DMCTRL __REG_2700G(0x00002188)
111#define CLIPCTRL __REG_2700G(0x0000218c)
112#define SPOCTRL __REG_2700G(0x00002190)
113#define SVCTRL __REG_2700G(0x00002194)
114
115/* 0x0000_2198 */
116/* 0x0000_21A8 VSCOEFF[0:4] Video Scalar Vertical Coefficient [0:4] 4.14.5 */
117#define VSCOEFF0 __REG_2700G(0x00002198)
118#define VSCOEFF1 __REG_2700G(0x0000219c)
119#define VSCOEFF2 __REG_2700G(0x000021a0)
120#define VSCOEFF3 __REG_2700G(0x000021a4)
121#define VSCOEFF4 __REG_2700G(0x000021a8)
122
123#define SHCTRL __REG_2700G(0x000021b0)
124
125/* 0x0000_21B4 */
126/* 0x0000_21D4 HSCOEFF[0:8] Video Scalar Horizontal Coefficient [0:8] 4.14.7 */
127#define HSCOEFF0 __REG_2700G(0x000021b4)
128#define HSCOEFF1 __REG_2700G(0x000021b8)
129#define HSCOEFF2 __REG_2700G(0x000021bc)
130#define HSCOEFF3 __REG_2700G(0x000021b0)
131#define HSCOEFF4 __REG_2700G(0x000021c4)
132#define HSCOEFF5 __REG_2700G(0x000021c8)
133#define HSCOEFF6 __REG_2700G(0x000021cc)
134#define HSCOEFF7 __REG_2700G(0x000021d0)
135#define HSCOEFF8 __REG_2700G(0x000021d4)
136
137#define SSSIZE __REG_2700G(0x000021D8)
138
139/* 0x0000_2200 */
140/* 0x0000_2240 VIDGAM[0:16] Video Gamma LUT Index [0:16] 4.15.2 */
141#define VIDGAM0 __REG_2700G(0x00002200)
142#define VIDGAM1 __REG_2700G(0x00002204)
143#define VIDGAM2 __REG_2700G(0x00002208)
144#define VIDGAM3 __REG_2700G(0x0000220c)
145#define VIDGAM4 __REG_2700G(0x00002210)
146#define VIDGAM5 __REG_2700G(0x00002214)
147#define VIDGAM6 __REG_2700G(0x00002218)
148#define VIDGAM7 __REG_2700G(0x0000221c)
149#define VIDGAM8 __REG_2700G(0x00002220)
150#define VIDGAM9 __REG_2700G(0x00002224)
151#define VIDGAM10 __REG_2700G(0x00002228)
152#define VIDGAM11 __REG_2700G(0x0000222c)
153#define VIDGAM12 __REG_2700G(0x00002230)
154#define VIDGAM13 __REG_2700G(0x00002234)
155#define VIDGAM14 __REG_2700G(0x00002238)
156#define VIDGAM15 __REG_2700G(0x0000223c)
157#define VIDGAM16 __REG_2700G(0x00002240)
158
159/* 0x0000_2250 */
160/* 0x0000_2290 GFXGAM[0:16] Graphics Gamma LUT Index [0:16] 4.15.3 */
161#define GFXGAM0 __REG_2700G(0x00002250)
162#define GFXGAM1 __REG_2700G(0x00002254)
163#define GFXGAM2 __REG_2700G(0x00002258)
164#define GFXGAM3 __REG_2700G(0x0000225c)
165#define GFXGAM4 __REG_2700G(0x00002260)
166#define GFXGAM5 __REG_2700G(0x00002264)
167#define GFXGAM6 __REG_2700G(0x00002268)
168#define GFXGAM7 __REG_2700G(0x0000226c)
169#define GFXGAM8 __REG_2700G(0x00002270)
170#define GFXGAM9 __REG_2700G(0x00002274)
171#define GFXGAM10 __REG_2700G(0x00002278)
172#define GFXGAM11 __REG_2700G(0x0000227c)
173#define GFXGAM12 __REG_2700G(0x00002280)
174#define GFXGAM13 __REG_2700G(0x00002284)
175#define GFXGAM14 __REG_2700G(0x00002288)
176#define GFXGAM15 __REG_2700G(0x0000228c)
177#define GFXGAM16 __REG_2700G(0x00002290)
178
179#define DLSTS __REG_2700G(0x00002300)
180#define DLLCTRL __REG_2700G(0x00002304)
181#define DVLNUM __REG_2700G(0x00002308)
182#define DUCTRL __REG_2700G(0x0000230c)
183#define DVECTRL __REG_2700G(0x00002310)
184#define DHDET __REG_2700G(0x00002314)
185#define DVDET __REG_2700G(0x00002318)
186#define DODMSK __REG_2700G(0x0000231c)
187#define CSC01 __REG_2700G(0x00002330)
188#define CSC02 __REG_2700G(0x00002334)
189#define CSC03 __REG_2700G(0x00002338)
190#define CSC04 __REG_2700G(0x0000233c)
191#define CSC05 __REG_2700G(0x00002340)
192
193#define FB_MEMORY_START __REG_2700G(0x00060000)
194
195#endif /* __REGS_2700G_ */
diff --git a/drivers/video/modedb.c b/drivers/video/modedb.c
index ff5454601e22..d1267904c280 100644
--- a/drivers/video/modedb.c
+++ b/drivers/video/modedb.c
@@ -12,7 +12,6 @@
12 */ 12 */
13 13
14#include <linux/module.h> 14#include <linux/module.h>
15#include <linux/tty.h>
16#include <linux/fb.h> 15#include <linux/fb.h>
17#include <linux/sched.h> 16#include <linux/sched.h>
18 17
diff --git a/drivers/video/neofb.c b/drivers/video/neofb.c
index 773855a311e8..59a6f5fa5ae6 100644
--- a/drivers/video/neofb.c
+++ b/drivers/video/neofb.c
@@ -59,7 +59,6 @@
59#include <linux/errno.h> 59#include <linux/errno.h>
60#include <linux/string.h> 60#include <linux/string.h>
61#include <linux/mm.h> 61#include <linux/mm.h>
62#include <linux/tty.h>
63#include <linux/slab.h> 62#include <linux/slab.h>
64#include <linux/delay.h> 63#include <linux/delay.h>
65#include <linux/fb.h> 64#include <linux/fb.h>
diff --git a/drivers/video/nvidia/nv_backlight.c b/drivers/video/nvidia/nv_backlight.c
index 1c1c10c699c5..b45f577094ac 100644
--- a/drivers/video/nvidia/nv_backlight.c
+++ b/drivers/video/nvidia/nv_backlight.c
@@ -26,9 +26,11 @@
26 */ 26 */
27#define MIN_LEVEL 0x158 27#define MIN_LEVEL 0x158
28#define MAX_LEVEL 0x534 28#define MAX_LEVEL 0x534
29#define LEVEL_STEP ((MAX_LEVEL - MIN_LEVEL) / FB_BACKLIGHT_MAX)
29 30
30static struct backlight_properties nvidia_bl_data; 31static struct backlight_properties nvidia_bl_data;
31 32
33/* Call with fb_info->bl_mutex held */
32static int nvidia_bl_get_level_brightness(struct nvidia_par *par, 34static int nvidia_bl_get_level_brightness(struct nvidia_par *par,
33 int level) 35 int level)
34{ 36{
@@ -36,9 +38,7 @@ static int nvidia_bl_get_level_brightness(struct nvidia_par *par,
36 int nlevel; 38 int nlevel;
37 39
38 /* Get and convert the value */ 40 /* Get and convert the value */
39 mutex_lock(&info->bl_mutex); 41 nlevel = MIN_LEVEL + info->bl_curve[level] * LEVEL_STEP;
40 nlevel = info->bl_curve[level] * FB_BACKLIGHT_MAX / MAX_LEVEL;
41 mutex_unlock(&info->bl_mutex);
42 42
43 if (nlevel < 0) 43 if (nlevel < 0)
44 nlevel = 0; 44 nlevel = 0;
@@ -50,7 +50,8 @@ static int nvidia_bl_get_level_brightness(struct nvidia_par *par,
50 return nlevel; 50 return nlevel;
51} 51}
52 52
53static int nvidia_bl_update_status(struct backlight_device *bd) 53/* Call with fb_info->bl_mutex held */
54static int __nvidia_bl_update_status(struct backlight_device *bd)
54{ 55{
55 struct nvidia_par *par = class_get_devdata(&bd->class_dev); 56 struct nvidia_par *par = class_get_devdata(&bd->class_dev);
56 u32 tmp_pcrt, tmp_pmc, fpcontrol; 57 u32 tmp_pcrt, tmp_pmc, fpcontrol;
@@ -84,6 +85,19 @@ static int nvidia_bl_update_status(struct backlight_device *bd)
84 return 0; 85 return 0;
85} 86}
86 87
88static int nvidia_bl_update_status(struct backlight_device *bd)
89{
90 struct nvidia_par *par = class_get_devdata(&bd->class_dev);
91 struct fb_info *info = pci_get_drvdata(par->pci_dev);
92 int ret;
93
94 mutex_lock(&info->bl_mutex);
95 ret = __nvidia_bl_update_status(bd);
96 mutex_unlock(&info->bl_mutex);
97
98 return ret;
99}
100
87static int nvidia_bl_get_brightness(struct backlight_device *bd) 101static int nvidia_bl_get_brightness(struct backlight_device *bd)
88{ 102{
89 return bd->props->brightness; 103 return bd->props->brightness;
@@ -96,6 +110,16 @@ static struct backlight_properties nvidia_bl_data = {
96 .max_brightness = (FB_BACKLIGHT_LEVELS - 1), 110 .max_brightness = (FB_BACKLIGHT_LEVELS - 1),
97}; 111};
98 112
113void nvidia_bl_set_power(struct fb_info *info, int power)
114{
115 mutex_lock(&info->bl_mutex);
116 up(&info->bl_dev->sem);
117 info->bl_dev->props->power = power;
118 __nvidia_bl_update_status(info->bl_dev);
119 down(&info->bl_dev->sem);
120 mutex_unlock(&info->bl_mutex);
121}
122
99void nvidia_bl_init(struct nvidia_par *par) 123void nvidia_bl_init(struct nvidia_par *par)
100{ 124{
101 struct fb_info *info = pci_get_drvdata(par->pci_dev); 125 struct fb_info *info = pci_get_drvdata(par->pci_dev);
diff --git a/drivers/video/nvidia/nv_proto.h b/drivers/video/nvidia/nv_proto.h
index 6fba656cd56b..861271017655 100644
--- a/drivers/video/nvidia/nv_proto.h
+++ b/drivers/video/nvidia/nv_proto.h
@@ -68,9 +68,11 @@ extern u8 byte_rev[256];
68#ifdef CONFIG_FB_NVIDIA_BACKLIGHT 68#ifdef CONFIG_FB_NVIDIA_BACKLIGHT
69extern void nvidia_bl_init(struct nvidia_par *par); 69extern void nvidia_bl_init(struct nvidia_par *par);
70extern void nvidia_bl_exit(struct nvidia_par *par); 70extern void nvidia_bl_exit(struct nvidia_par *par);
71extern void nvidia_bl_set_power(struct fb_info *info, int power);
71#else 72#else
72static inline void nvidia_bl_init(struct nvidia_par *par) {} 73static inline void nvidia_bl_init(struct nvidia_par *par) {}
73static inline void nvidia_bl_exit(struct nvidia_par *par) {} 74static inline void nvidia_bl_exit(struct nvidia_par *par) {}
75static inline void nvidia_bl_set_power(struct fb_info *info, int power) {}
74#endif 76#endif
75 77
76#endif /* __NV_PROTO_H__ */ 78#endif /* __NV_PROTO_H__ */
diff --git a/drivers/video/nvidia/nvidia.c b/drivers/video/nvidia/nvidia.c
index b02d6033cc0c..d4f850117874 100644
--- a/drivers/video/nvidia/nvidia.c
+++ b/drivers/video/nvidia/nvidia.c
@@ -14,7 +14,6 @@
14#include <linux/errno.h> 14#include <linux/errno.h>
15#include <linux/string.h> 15#include <linux/string.h>
16#include <linux/mm.h> 16#include <linux/mm.h>
17#include <linux/tty.h>
18#include <linux/slab.h> 17#include <linux/slab.h>
19#include <linux/delay.h> 18#include <linux/delay.h>
20#include <linux/fb.h> 19#include <linux/fb.h>
@@ -35,10 +34,6 @@
35#include "nv_proto.h" 34#include "nv_proto.h"
36#include "nv_dma.h" 35#include "nv_dma.h"
37 36
38#ifndef CONFIG_PCI /* sanity check */
39#error This driver requires PCI support.
40#endif
41
42#undef CONFIG_FB_NVIDIA_DEBUG 37#undef CONFIG_FB_NVIDIA_DEBUG
43#ifdef CONFIG_FB_NVIDIA_DEBUG 38#ifdef CONFIG_FB_NVIDIA_DEBUG
44#define NVTRACE printk 39#define NVTRACE printk
@@ -933,16 +928,7 @@ static int nvidiafb_blank(int blank, struct fb_info *info)
933 NVWriteSeq(par, 0x01, tmp); 928 NVWriteSeq(par, 0x01, tmp);
934 NVWriteCrtc(par, 0x1a, vesa); 929 NVWriteCrtc(par, 0x1a, vesa);
935 930
936#ifdef CONFIG_FB_NVIDIA_BACKLIGHT 931 nvidia_bl_set_power(info, blank);
937 mutex_lock(&info->bl_mutex);
938 if (info->bl_dev) {
939 down(&info->bl_dev->sem);
940 info->bl_dev->props->power = blank;
941 info->bl_dev->props->update_status(info->bl_dev);
942 up(&info->bl_dev->sem);
943 }
944 mutex_unlock(&info->bl_mutex);
945#endif
946 932
947 NVTRACE_LEAVE(); 933 NVTRACE_LEAVE();
948 934
@@ -1313,20 +1299,19 @@ static int __devinit nvidiafb_probe(struct pci_dev *pd,
1313 1299
1314 nvidia_save_vga(par, &par->SavedReg); 1300 nvidia_save_vga(par, &par->SavedReg);
1315 1301
1302 pci_set_drvdata(pd, info);
1303 nvidia_bl_init(par);
1316 if (register_framebuffer(info) < 0) { 1304 if (register_framebuffer(info) < 0) {
1317 printk(KERN_ERR PFX "error registering nVidia framebuffer\n"); 1305 printk(KERN_ERR PFX "error registering nVidia framebuffer\n");
1318 goto err_out_iounmap_fb; 1306 goto err_out_iounmap_fb;
1319 } 1307 }
1320 1308
1321 pci_set_drvdata(pd, info);
1322 1309
1323 printk(KERN_INFO PFX 1310 printk(KERN_INFO PFX
1324 "PCI nVidia %s framebuffer (%dMB @ 0x%lX)\n", 1311 "PCI nVidia %s framebuffer (%dMB @ 0x%lX)\n",
1325 info->fix.id, 1312 info->fix.id,
1326 par->FbMapSize / (1024 * 1024), info->fix.smem_start); 1313 par->FbMapSize / (1024 * 1024), info->fix.smem_start);
1327 1314
1328 nvidia_bl_init(par);
1329
1330 NVTRACE_LEAVE(); 1315 NVTRACE_LEAVE();
1331 return 0; 1316 return 0;
1332 1317
diff --git a/drivers/video/offb.c b/drivers/video/offb.c
index 71ce1fa45cf4..0013311e0564 100644
--- a/drivers/video/offb.c
+++ b/drivers/video/offb.c
@@ -17,7 +17,6 @@
17#include <linux/errno.h> 17#include <linux/errno.h>
18#include <linux/string.h> 18#include <linux/string.h>
19#include <linux/mm.h> 19#include <linux/mm.h>
20#include <linux/tty.h>
21#include <linux/slab.h> 20#include <linux/slab.h>
22#include <linux/vmalloc.h> 21#include <linux/vmalloc.h>
23#include <linux/delay.h> 22#include <linux/delay.h>
@@ -63,8 +62,6 @@ struct offb_par default_par;
63 * Interface used by the world 62 * Interface used by the world
64 */ 63 */
65 64
66int offb_init(void);
67
68static int offb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, 65static int offb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
69 u_int transp, struct fb_info *info); 66 u_int transp, struct fb_info *info);
70static int offb_blank(int blank, struct fb_info *info); 67static int offb_blank(int blank, struct fb_info *info);
@@ -73,11 +70,6 @@ static int offb_blank(int blank, struct fb_info *info);
73extern boot_infos_t *boot_infos; 70extern boot_infos_t *boot_infos;
74#endif 71#endif
75 72
76static void offb_init_nodriver(struct device_node *);
77static void offb_init_fb(const char *name, const char *full_name,
78 int width, int height, int depth, int pitch,
79 unsigned long address, struct device_node *dp);
80
81static struct fb_ops offb_ops = { 73static struct fb_ops offb_ops = {
82 .owner = THIS_MODULE, 74 .owner = THIS_MODULE,
83 .fb_setcolreg = offb_setcolreg, 75 .fb_setcolreg = offb_setcolreg,
@@ -230,123 +222,17 @@ static int offb_blank(int blank, struct fb_info *info)
230 return 0; 222 return 0;
231} 223}
232 224
233 /*
234 * Initialisation
235 */
236 225
237int __init offb_init(void) 226static void __iomem *offb_map_reg(struct device_node *np, int index,
227 unsigned long offset, unsigned long size)
238{ 228{
239 struct device_node *dp = NULL, *boot_disp = NULL; 229 struct resource r;
240
241 if (fb_get_options("offb", NULL))
242 return -ENODEV;
243 230
244 for (dp = NULL; (dp = of_find_node_by_type(dp, "display"));) { 231 if (of_address_to_resource(np, index, &r))
245 if (get_property(dp, "linux,opened", NULL) && 232 return 0;
246 get_property(dp, "linux,boot-display", NULL)) { 233 if ((r.start + offset + size) > r.end)
247 boot_disp = dp; 234 return 0;
248 offb_init_nodriver(dp); 235 return ioremap(r.start + offset, size);
249 }
250 }
251 for (dp = NULL; (dp = of_find_node_by_type(dp, "display"));) {
252 if (get_property(dp, "linux,opened", NULL) &&
253 dp != boot_disp)
254 offb_init_nodriver(dp);
255 }
256
257 return 0;
258}
259
260
261static void __init offb_init_nodriver(struct device_node *dp)
262{
263 unsigned int len;
264 int i, width = 640, height = 480, depth = 8, pitch = 640;
265 unsigned int flags, rsize, addr_prop = 0;
266 unsigned long max_size = 0;
267 u64 rstart, address = OF_BAD_ADDR;
268 u32 *pp, *addrp, *up;
269 u64 asize;
270
271 pp = (u32 *)get_property(dp, "linux,bootx-depth", &len);
272 if (pp == NULL)
273 pp = (u32 *)get_property(dp, "depth", &len);
274 if (pp && len == sizeof(u32))
275 depth = *pp;
276
277 pp = (u32 *)get_property(dp, "linux,bootx-width", &len);
278 if (pp == NULL)
279 pp = (u32 *)get_property(dp, "width", &len);
280 if (pp && len == sizeof(u32))
281 width = *pp;
282
283 pp = (u32 *)get_property(dp, "linux,bootx-height", &len);
284 if (pp == NULL)
285 pp = (u32 *)get_property(dp, "height", &len);
286 if (pp && len == sizeof(u32))
287 height = *pp;
288
289 pp = (u32 *)get_property(dp, "linux,bootx-linebytes", &len);
290 if (pp == NULL)
291 pp = (u32 *)get_property(dp, "linebytes", &len);
292 if (pp && len == sizeof(u32))
293 pitch = *pp;
294 else
295 pitch = width * ((depth + 7) / 8);
296
297 rsize = (unsigned long)pitch * (unsigned long)height;
298
299 /* Ok, now we try to figure out the address of the framebuffer.
300 *
301 * Unfortunately, Open Firmware doesn't provide a standard way to do
302 * so. All we can do is a dodgy heuristic that happens to work in
303 * practice. On most machines, the "address" property contains what
304 * we need, though not on Matrox cards found in IBM machines. What I've
305 * found that appears to give good results is to go through the PCI
306 * ranges and pick one that is both big enough and if possible encloses
307 * the "address" property. If none match, we pick the biggest
308 */
309 up = (u32 *)get_property(dp, "linux,bootx-addr", &len);
310 if (up == NULL)
311 up = (u32 *)get_property(dp, "address", &len);
312 if (up && len == sizeof(u32))
313 addr_prop = *up;
314
315 for (i = 0; (addrp = of_get_address(dp, i, &asize, &flags))
316 != NULL; i++) {
317 int match_addrp = 0;
318
319 if (!(flags & IORESOURCE_MEM))
320 continue;
321 if (asize < rsize)
322 continue;
323 rstart = of_translate_address(dp, addrp);
324 if (rstart == OF_BAD_ADDR)
325 continue;
326 if (addr_prop && (rstart <= addr_prop) &&
327 ((rstart + asize) >= (addr_prop + rsize)))
328 match_addrp = 1;
329 if (match_addrp) {
330 address = addr_prop;
331 break;
332 }
333 if (rsize > max_size) {
334 max_size = rsize;
335 address = OF_BAD_ADDR;
336 }
337
338 if (address == OF_BAD_ADDR)
339 address = rstart;
340 }
341 if (address == OF_BAD_ADDR && addr_prop)
342 address = (u64)addr_prop;
343 if (address != OF_BAD_ADDR) {
344 /* kludge for valkyrie */
345 if (strcmp(dp->name, "valkyrie") == 0)
346 address += 0x1000;
347 offb_init_fb(dp->name, dp->full_name, width, height, depth,
348 pitch, address, dp);
349 }
350} 236}
351 237
352static void __init offb_init_fb(const char *name, const char *full_name, 238static void __init offb_init_fb(const char *name, const char *full_name,
@@ -403,45 +289,39 @@ static void __init offb_init_fb(const char *name, const char *full_name,
403 289
404 par->cmap_type = cmap_unknown; 290 par->cmap_type = cmap_unknown;
405 if (depth == 8) { 291 if (depth == 8) {
406
407 /* Palette hacks disabled for now */ 292 /* Palette hacks disabled for now */
408#if 0
409 if (dp && !strncmp(name, "ATY,Rage128", 11)) { 293 if (dp && !strncmp(name, "ATY,Rage128", 11)) {
410 unsigned long regbase = dp->addrs[2].address; 294 par->cmap_adr = offb_map_reg(dp, 2, 0, 0x1fff);
411 par->cmap_adr = ioremap(regbase, 0x1FFF); 295 if (par->cmap_adr)
412 par->cmap_type = cmap_r128; 296 par->cmap_type = cmap_r128;
413 } else if (dp && (!strncmp(name, "ATY,RageM3pA", 12) 297 } else if (dp && (!strncmp(name, "ATY,RageM3pA", 12)
414 || !strncmp(name, "ATY,RageM3p12A", 14))) { 298 || !strncmp(name, "ATY,RageM3p12A", 14))) {
415 unsigned long regbase = 299 par->cmap_adr = offb_map_reg(dp, 2, 0, 0x1fff);
416 dp->parent->addrs[2].address; 300 if (par->cmap_adr)
417 par->cmap_adr = ioremap(regbase, 0x1FFF); 301 par->cmap_type = cmap_M3A;
418 par->cmap_type = cmap_M3A;
419 } else if (dp && !strncmp(name, "ATY,RageM3pB", 12)) { 302 } else if (dp && !strncmp(name, "ATY,RageM3pB", 12)) {
420 unsigned long regbase = 303 par->cmap_adr = offb_map_reg(dp, 2, 0, 0x1fff);
421 dp->parent->addrs[2].address; 304 if (par->cmap_adr)
422 par->cmap_adr = ioremap(regbase, 0x1FFF); 305 par->cmap_type = cmap_M3B;
423 par->cmap_type = cmap_M3B;
424 } else if (dp && !strncmp(name, "ATY,Rage6", 9)) { 306 } else if (dp && !strncmp(name, "ATY,Rage6", 9)) {
425 unsigned long regbase = dp->addrs[1].address; 307 par->cmap_adr = offb_map_reg(dp, 1, 0, 0x1fff);
426 par->cmap_adr = ioremap(regbase, 0x1FFF); 308 if (par->cmap_adr)
427 par->cmap_type = cmap_radeon; 309 par->cmap_type = cmap_radeon;
428 } else if (!strncmp(name, "ATY,", 4)) { 310 } else if (!strncmp(name, "ATY,", 4)) {
429 unsigned long base = address & 0xff000000UL; 311 unsigned long base = address & 0xff000000UL;
430 par->cmap_adr = 312 par->cmap_adr =
431 ioremap(base + 0x7ff000, 0x1000) + 0xcc0; 313 ioremap(base + 0x7ff000, 0x1000) + 0xcc0;
432 par->cmap_data = par->cmap_adr + 1; 314 par->cmap_data = par->cmap_adr + 1;
433 par->cmap_type = cmap_m64; 315 par->cmap_type = cmap_m64;
434 } else if (device_is_compatible(dp, "pci1014,b7")) { 316 } else if (dp && device_is_compatible(dp, "pci1014,b7")) {
435 unsigned long regbase = dp->addrs[0].address; 317 par->cmap_adr = offb_map_reg(dp, 0, 0x6000, 0x1000);
436 par->cmap_adr = ioremap(regbase + 0x6000, 0x1000); 318 if (par->cmap_adr)
437 par->cmap_type = cmap_gxt2000; 319 par->cmap_type = cmap_gxt2000;
438 } 320 }
439#endif 321 fix->visual = (par->cmap_type != cmap_unknown) ?
440 fix->visual = par->cmap_adr ? FB_VISUAL_PSEUDOCOLOR 322 FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_STATIC_PSEUDOCOLOR;
441 : FB_VISUAL_STATIC_PSEUDOCOLOR;
442 } else 323 } else
443 fix->visual = /* par->cmap_adr ? FB_VISUAL_DIRECTCOLOR 324 fix->visual = FB_VISUAL_TRUECOLOR;
444 : */ FB_VISUAL_TRUECOLOR;
445 325
446 var->xoffset = var->yoffset = 0; 326 var->xoffset = var->yoffset = 0;
447 switch (depth) { 327 switch (depth) {
@@ -521,5 +401,139 @@ static void __init offb_init_fb(const char *name, const char *full_name,
521 info->node, full_name); 401 info->node, full_name);
522} 402}
523 403
404
405static void __init offb_init_nodriver(struct device_node *dp, int no_real_node)
406{
407 unsigned int len;
408 int i, width = 640, height = 480, depth = 8, pitch = 640;
409 unsigned int flags, rsize, addr_prop = 0;
410 unsigned long max_size = 0;
411 u64 rstart, address = OF_BAD_ADDR;
412 u32 *pp, *addrp, *up;
413 u64 asize;
414
415 pp = (u32 *)get_property(dp, "linux,bootx-depth", &len);
416 if (pp == NULL)
417 pp = (u32 *)get_property(dp, "depth", &len);
418 if (pp && len == sizeof(u32))
419 depth = *pp;
420
421 pp = (u32 *)get_property(dp, "linux,bootx-width", &len);
422 if (pp == NULL)
423 pp = (u32 *)get_property(dp, "width", &len);
424 if (pp && len == sizeof(u32))
425 width = *pp;
426
427 pp = (u32 *)get_property(dp, "linux,bootx-height", &len);
428 if (pp == NULL)
429 pp = (u32 *)get_property(dp, "height", &len);
430 if (pp && len == sizeof(u32))
431 height = *pp;
432
433 pp = (u32 *)get_property(dp, "linux,bootx-linebytes", &len);
434 if (pp == NULL)
435 pp = (u32 *)get_property(dp, "linebytes", &len);
436 if (pp && len == sizeof(u32))
437 pitch = *pp;
438 else
439 pitch = width * ((depth + 7) / 8);
440
441 rsize = (unsigned long)pitch * (unsigned long)height;
442
443 /* Ok, now we try to figure out the address of the framebuffer.
444 *
445 * Unfortunately, Open Firmware doesn't provide a standard way to do
446 * so. All we can do is a dodgy heuristic that happens to work in
447 * practice. On most machines, the "address" property contains what
448 * we need, though not on Matrox cards found in IBM machines. What I've
449 * found that appears to give good results is to go through the PCI
450 * ranges and pick one that is both big enough and if possible encloses
451 * the "address" property. If none match, we pick the biggest
452 */
453 up = (u32 *)get_property(dp, "linux,bootx-addr", &len);
454 if (up == NULL)
455 up = (u32 *)get_property(dp, "address", &len);
456 if (up && len == sizeof(u32))
457 addr_prop = *up;
458
459 /* Hack for when BootX is passing us */
460 if (no_real_node)
461 goto skip_addr;
462
463 for (i = 0; (addrp = of_get_address(dp, i, &asize, &flags))
464 != NULL; i++) {
465 int match_addrp = 0;
466
467 if (!(flags & IORESOURCE_MEM))
468 continue;
469 if (asize < rsize)
470 continue;
471 rstart = of_translate_address(dp, addrp);
472 if (rstart == OF_BAD_ADDR)
473 continue;
474 if (addr_prop && (rstart <= addr_prop) &&
475 ((rstart + asize) >= (addr_prop + rsize)))
476 match_addrp = 1;
477 if (match_addrp) {
478 address = addr_prop;
479 break;
480 }
481 if (rsize > max_size) {
482 max_size = rsize;
483 address = OF_BAD_ADDR;
484 }
485
486 if (address == OF_BAD_ADDR)
487 address = rstart;
488 }
489 skip_addr:
490 if (address == OF_BAD_ADDR && addr_prop)
491 address = (u64)addr_prop;
492 if (address != OF_BAD_ADDR) {
493 /* kludge for valkyrie */
494 if (strcmp(dp->name, "valkyrie") == 0)
495 address += 0x1000;
496 offb_init_fb(no_real_node ? "bootx" : dp->name,
497 no_real_node ? "display" : dp->full_name,
498 width, height, depth, pitch, address,
499 no_real_node ? dp : NULL);
500 }
501}
502
503static int __init offb_init(void)
504{
505 struct device_node *dp = NULL, *boot_disp = NULL;
506
507 if (fb_get_options("offb", NULL))
508 return -ENODEV;
509
510 /* Check if we have a MacOS display without a node spec */
511 if (get_property(of_chosen, "linux,bootx-noscreen", NULL) != NULL) {
512 /* The old code tried to work out which node was the MacOS
513 * display based on the address. I'm dropping that since the
514 * lack of a node spec only happens with old BootX versions
515 * (users can update) and with this code, they'll still get
516 * a display (just not the palette hacks).
517 */
518 offb_init_nodriver(of_chosen, 1);
519 }
520
521 for (dp = NULL; (dp = of_find_node_by_type(dp, "display"));) {
522 if (get_property(dp, "linux,opened", NULL) &&
523 get_property(dp, "linux,boot-display", NULL)) {
524 boot_disp = dp;
525 offb_init_nodriver(dp, 0);
526 }
527 }
528 for (dp = NULL; (dp = of_find_node_by_type(dp, "display"));) {
529 if (get_property(dp, "linux,opened", NULL) &&
530 dp != boot_disp)
531 offb_init_nodriver(dp, 0);
532 }
533
534 return 0;
535}
536
537
524module_init(offb_init); 538module_init(offb_init);
525MODULE_LICENSE("GPL"); 539MODULE_LICENSE("GPL");
diff --git a/drivers/video/platinumfb.c b/drivers/video/platinumfb.c
index 450e802e0aa8..983be3ec2345 100644
--- a/drivers/video/platinumfb.c
+++ b/drivers/video/platinumfb.c
@@ -22,7 +22,6 @@
22#include <linux/errno.h> 22#include <linux/errno.h>
23#include <linux/string.h> 23#include <linux/string.h>
24#include <linux/mm.h> 24#include <linux/mm.h>
25#include <linux/tty.h>
26#include <linux/slab.h> 25#include <linux/slab.h>
27#include <linux/vmalloc.h> 26#include <linux/vmalloc.h>
28#include <linux/delay.h> 27#include <linux/delay.h>
diff --git a/drivers/video/pm2fb.c b/drivers/video/pm2fb.c
index 49a203e1591c..a560a2223825 100644
--- a/drivers/video/pm2fb.c
+++ b/drivers/video/pm2fb.c
@@ -33,7 +33,6 @@
33#include <linux/errno.h> 33#include <linux/errno.h>
34#include <linux/string.h> 34#include <linux/string.h>
35#include <linux/mm.h> 35#include <linux/mm.h>
36#include <linux/tty.h>
37#include <linux/slab.h> 36#include <linux/slab.h>
38#include <linux/delay.h> 37#include <linux/delay.h>
39#include <linux/fb.h> 38#include <linux/fb.h>
diff --git a/drivers/video/pm3fb.c b/drivers/video/pm3fb.c
index 0e0f977b05ee..1d81ef47efd3 100644
--- a/drivers/video/pm3fb.c
+++ b/drivers/video/pm3fb.c
@@ -57,7 +57,6 @@
57#include <linux/errno.h> 57#include <linux/errno.h>
58#include <linux/string.h> 58#include <linux/string.h>
59#include <linux/mm.h> 59#include <linux/mm.h>
60#include <linux/tty.h>
61#include <linux/slab.h> 60#include <linux/slab.h>
62#include <linux/vmalloc.h> 61#include <linux/vmalloc.h>
63#include <linux/delay.h> 62#include <linux/delay.h>
diff --git a/drivers/video/pmag-aa-fb.c b/drivers/video/pmag-aa-fb.c
index d92f352211ef..68ca3cc40770 100644
--- a/drivers/video/pmag-aa-fb.c
+++ b/drivers/video/pmag-aa-fb.c
@@ -29,7 +29,6 @@
29#include <linux/string.h> 29#include <linux/string.h>
30#include <linux/timer.h> 30#include <linux/timer.h>
31#include <linux/mm.h> 31#include <linux/mm.h>
32#include <linux/tty.h>
33#include <linux/slab.h> 32#include <linux/slab.h>
34#include <linux/delay.h> 33#include <linux/delay.h>
35#include <linux/init.h> 34#include <linux/init.h>
diff --git a/drivers/video/pvr2fb.c b/drivers/video/pvr2fb.c
index 4a1e0e856920..940ba2be55e9 100644
--- a/drivers/video/pvr2fb.c
+++ b/drivers/video/pvr2fb.c
@@ -53,7 +53,6 @@
53#include <linux/errno.h> 53#include <linux/errno.h>
54#include <linux/string.h> 54#include <linux/string.h>
55#include <linux/mm.h> 55#include <linux/mm.h>
56#include <linux/tty.h>
57#include <linux/slab.h> 56#include <linux/slab.h>
58#include <linux/delay.h> 57#include <linux/delay.h>
59#include <linux/interrupt.h> 58#include <linux/interrupt.h>
diff --git a/drivers/video/q40fb.c b/drivers/video/q40fb.c
index fc91dbf896d2..48536c3e58a4 100644
--- a/drivers/video/q40fb.c
+++ b/drivers/video/q40fb.c
@@ -14,7 +14,6 @@
14#include <linux/errno.h> 14#include <linux/errno.h>
15#include <linux/string.h> 15#include <linux/string.h>
16#include <linux/mm.h> 16#include <linux/mm.h>
17#include <linux/tty.h>
18#include <linux/slab.h> 17#include <linux/slab.h>
19#include <linux/delay.h> 18#include <linux/delay.h>
20#include <linux/interrupt.h> 19#include <linux/interrupt.h>
diff --git a/drivers/video/retz3fb.c b/drivers/video/retz3fb.c
index 5e2c64f622cb..cf41ff177644 100644
--- a/drivers/video/retz3fb.c
+++ b/drivers/video/retz3fb.c
@@ -25,7 +25,6 @@
25#include <linux/errno.h> 25#include <linux/errno.h>
26#include <linux/string.h> 26#include <linux/string.h>
27#include <linux/mm.h> 27#include <linux/mm.h>
28#include <linux/tty.h>
29#include <linux/slab.h> 28#include <linux/slab.h>
30#include <linux/delay.h> 29#include <linux/delay.h>
31#include <linux/fb.h> 30#include <linux/fb.h>
diff --git a/drivers/video/riva/fbdev.c b/drivers/video/riva/fbdev.c
index 2788655e6e7d..76fc9d355eb7 100644
--- a/drivers/video/riva/fbdev.c
+++ b/drivers/video/riva/fbdev.c
@@ -34,7 +34,6 @@
34#include <linux/errno.h> 34#include <linux/errno.h>
35#include <linux/string.h> 35#include <linux/string.h>
36#include <linux/mm.h> 36#include <linux/mm.h>
37#include <linux/tty.h>
38#include <linux/slab.h> 37#include <linux/slab.h>
39#include <linux/delay.h> 38#include <linux/delay.h>
40#include <linux/fb.h> 39#include <linux/fb.h>
@@ -278,9 +277,11 @@ static const struct riva_regs reg_template = {
278 */ 277 */
279#define MIN_LEVEL 0x158 278#define MIN_LEVEL 0x158
280#define MAX_LEVEL 0x534 279#define MAX_LEVEL 0x534
280#define LEVEL_STEP ((MAX_LEVEL - MIN_LEVEL) / FB_BACKLIGHT_MAX)
281 281
282static struct backlight_properties riva_bl_data; 282static struct backlight_properties riva_bl_data;
283 283
284/* Call with fb_info->bl_mutex held */
284static int riva_bl_get_level_brightness(struct riva_par *par, 285static int riva_bl_get_level_brightness(struct riva_par *par,
285 int level) 286 int level)
286{ 287{
@@ -288,9 +289,7 @@ static int riva_bl_get_level_brightness(struct riva_par *par,
288 int nlevel; 289 int nlevel;
289 290
290 /* Get and convert the value */ 291 /* Get and convert the value */
291 mutex_lock(&info->bl_mutex); 292 nlevel = MIN_LEVEL + info->bl_curve[level] * LEVEL_STEP;
292 nlevel = info->bl_curve[level] * FB_BACKLIGHT_MAX / MAX_LEVEL;
293 mutex_unlock(&info->bl_mutex);
294 293
295 if (nlevel < 0) 294 if (nlevel < 0)
296 nlevel = 0; 295 nlevel = 0;
@@ -302,7 +301,8 @@ static int riva_bl_get_level_brightness(struct riva_par *par,
302 return nlevel; 301 return nlevel;
303} 302}
304 303
305static int riva_bl_update_status(struct backlight_device *bd) 304/* Call with fb_info->bl_mutex held */
305static int __riva_bl_update_status(struct backlight_device *bd)
306{ 306{
307 struct riva_par *par = class_get_devdata(&bd->class_dev); 307 struct riva_par *par = class_get_devdata(&bd->class_dev);
308 U032 tmp_pcrt, tmp_pmc; 308 U032 tmp_pcrt, tmp_pmc;
@@ -327,6 +327,19 @@ static int riva_bl_update_status(struct backlight_device *bd)
327 return 0; 327 return 0;
328} 328}
329 329
330static int riva_bl_update_status(struct backlight_device *bd)
331{
332 struct riva_par *par = class_get_devdata(&bd->class_dev);
333 struct fb_info *info = pci_get_drvdata(par->pdev);
334 int ret;
335
336 mutex_lock(&info->bl_mutex);
337 ret = __riva_bl_update_status(bd);
338 mutex_unlock(&info->bl_mutex);
339
340 return ret;
341}
342
330static int riva_bl_get_brightness(struct backlight_device *bd) 343static int riva_bl_get_brightness(struct backlight_device *bd)
331{ 344{
332 return bd->props->brightness; 345 return bd->props->brightness;
@@ -339,6 +352,16 @@ static struct backlight_properties riva_bl_data = {
339 .max_brightness = (FB_BACKLIGHT_LEVELS - 1), 352 .max_brightness = (FB_BACKLIGHT_LEVELS - 1),
340}; 353};
341 354
355static void riva_bl_set_power(struct fb_info *info, int power)
356{
357 mutex_lock(&info->bl_mutex);
358 up(&info->bl_dev->sem);
359 info->bl_dev->props->power = power;
360 __riva_bl_update_status(info->bl_dev);
361 down(&info->bl_dev->sem);
362 mutex_unlock(&info->bl_mutex);
363}
364
342static void riva_bl_init(struct riva_par *par) 365static void riva_bl_init(struct riva_par *par)
343{ 366{
344 struct fb_info *info = pci_get_drvdata(par->pdev); 367 struct fb_info *info = pci_get_drvdata(par->pdev);
@@ -419,6 +442,7 @@ static void riva_bl_exit(struct riva_par *par)
419#else 442#else
420static inline void riva_bl_init(struct riva_par *par) {} 443static inline void riva_bl_init(struct riva_par *par) {}
421static inline void riva_bl_exit(struct riva_par *par) {} 444static inline void riva_bl_exit(struct riva_par *par) {}
445static inline void riva_bl_set_power(struct fb_info *info, int power) {}
422#endif /* CONFIG_FB_RIVA_BACKLIGHT */ 446#endif /* CONFIG_FB_RIVA_BACKLIGHT */
423 447
424/* ------------------------------------------------------------------------- * 448/* ------------------------------------------------------------------------- *
@@ -1337,16 +1361,7 @@ static int rivafb_blank(int blank, struct fb_info *info)
1337 SEQout(par, 0x01, tmp); 1361 SEQout(par, 0x01, tmp);
1338 CRTCout(par, 0x1a, vesa); 1362 CRTCout(par, 0x1a, vesa);
1339 1363
1340#ifdef CONFIG_FB_RIVA_BACKLIGHT 1364 riva_bl_set_power(info, blank);
1341 mutex_lock(&info->bl_mutex);
1342 if (info->bl_dev) {
1343 down(&info->bl_dev->sem);
1344 info->bl_dev->props->power = blank;
1345 info->bl_dev->props->update_status(info->bl_dev);
1346 up(&info->bl_dev->sem);
1347 }
1348 mutex_unlock(&info->bl_mutex);
1349#endif
1350 1365
1351 NVTRACE_LEAVE(); 1366 NVTRACE_LEAVE();
1352 1367
@@ -2117,6 +2132,9 @@ static int __devinit rivafb_probe(struct pci_dev *pd,
2117 2132
2118 fb_destroy_modedb(info->monspecs.modedb); 2133 fb_destroy_modedb(info->monspecs.modedb);
2119 info->monspecs.modedb = NULL; 2134 info->monspecs.modedb = NULL;
2135
2136 pci_set_drvdata(pd, info);
2137 riva_bl_init(info->par);
2120 ret = register_framebuffer(info); 2138 ret = register_framebuffer(info);
2121 if (ret < 0) { 2139 if (ret < 0) {
2122 printk(KERN_ERR PFX 2140 printk(KERN_ERR PFX
@@ -2124,8 +2142,6 @@ static int __devinit rivafb_probe(struct pci_dev *pd,
2124 goto err_iounmap_screen_base; 2142 goto err_iounmap_screen_base;
2125 } 2143 }
2126 2144
2127 pci_set_drvdata(pd, info);
2128
2129 printk(KERN_INFO PFX 2145 printk(KERN_INFO PFX
2130 "PCI nVidia %s framebuffer ver %s (%dMB @ 0x%lX)\n", 2146 "PCI nVidia %s framebuffer ver %s (%dMB @ 0x%lX)\n",
2131 info->fix.id, 2147 info->fix.id,
@@ -2133,8 +2149,6 @@ static int __devinit rivafb_probe(struct pci_dev *pd,
2133 info->fix.smem_len / (1024 * 1024), 2149 info->fix.smem_len / (1024 * 1024),
2134 info->fix.smem_start); 2150 info->fix.smem_start);
2135 2151
2136 riva_bl_init(info->par);
2137
2138 NVTRACE_LEAVE(); 2152 NVTRACE_LEAVE();
2139 return 0; 2153 return 0;
2140 2154
diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c
index f461eb10cc79..ad3bdd6f1ac1 100644
--- a/drivers/video/s3c2410fb.c
+++ b/drivers/video/s3c2410fb.c
@@ -76,7 +76,6 @@
76#include <linux/errno.h> 76#include <linux/errno.h>
77#include <linux/string.h> 77#include <linux/string.h>
78#include <linux/mm.h> 78#include <linux/mm.h>
79#include <linux/tty.h>
80#include <linux/slab.h> 79#include <linux/slab.h>
81#include <linux/delay.h> 80#include <linux/delay.h>
82#include <linux/fb.h> 81#include <linux/fb.h>
diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c
index 4729af477fbf..461e094e7b45 100644
--- a/drivers/video/savage/savagefb_driver.c
+++ b/drivers/video/savage/savagefb_driver.c
@@ -46,7 +46,6 @@
46#include <linux/errno.h> 46#include <linux/errno.h>
47#include <linux/string.h> 47#include <linux/string.h>
48#include <linux/mm.h> 48#include <linux/mm.h>
49#include <linux/tty.h>
50#include <linux/slab.h> 49#include <linux/slab.h>
51#include <linux/delay.h> 50#include <linux/delay.h>
52#include <linux/fb.h> 51#include <linux/fb.h>
diff --git a/drivers/video/sis/sis_main.c b/drivers/video/sis/sis_main.c
index b848ca7db7f9..895ebda7d9e3 100644
--- a/drivers/video/sis/sis_main.c
+++ b/drivers/video/sis/sis_main.c
@@ -44,7 +44,13 @@
44#include <linux/errno.h> 44#include <linux/errno.h>
45#include <linux/string.h> 45#include <linux/string.h>
46#include <linux/mm.h> 46#include <linux/mm.h>
47
48#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17)
47#include <linux/tty.h> 49#include <linux/tty.h>
50#else
51#include <linux/screen_info.h>
52#endif
53
48#include <linux/slab.h> 54#include <linux/slab.h>
49#include <linux/fb.h> 55#include <linux/fb.h>
50#include <linux/selection.h> 56#include <linux/selection.h>
diff --git a/drivers/video/skeletonfb.c b/drivers/video/skeletonfb.c
index 67f429e93189..bb96cb65fdaa 100644
--- a/drivers/video/skeletonfb.c
+++ b/drivers/video/skeletonfb.c
@@ -47,7 +47,6 @@
47#include <linux/errno.h> 47#include <linux/errno.h>
48#include <linux/string.h> 48#include <linux/string.h>
49#include <linux/mm.h> 49#include <linux/mm.h>
50#include <linux/tty.h>
51#include <linux/slab.h> 50#include <linux/slab.h>
52#include <linux/delay.h> 51#include <linux/delay.h>
53#include <linux/fb.h> 52#include <linux/fb.h>
diff --git a/drivers/video/sun3fb.c b/drivers/video/sun3fb.c
index e046e20f02b9..f80356dfa8e8 100644
--- a/drivers/video/sun3fb.c
+++ b/drivers/video/sun3fb.c
@@ -30,7 +30,6 @@
30#include <linux/errno.h> 30#include <linux/errno.h>
31#include <linux/string.h> 31#include <linux/string.h>
32#include <linux/mm.h> 32#include <linux/mm.h>
33#include <linux/tty.h>
34#include <linux/slab.h> 33#include <linux/slab.h>
35#include <linux/vmalloc.h> 34#include <linux/vmalloc.h>
36#include <linux/delay.h> 35#include <linux/delay.h>
diff --git a/drivers/video/tdfxfb.c b/drivers/video/tdfxfb.c
index 239b1496874b..689ce0270b81 100644
--- a/drivers/video/tdfxfb.c
+++ b/drivers/video/tdfxfb.c
@@ -63,7 +63,6 @@
63#include <linux/errno.h> 63#include <linux/errno.h>
64#include <linux/string.h> 64#include <linux/string.h>
65#include <linux/mm.h> 65#include <linux/mm.h>
66#include <linux/tty.h>
67#include <linux/slab.h> 66#include <linux/slab.h>
68#include <linux/delay.h> 67#include <linux/delay.h>
69#include <linux/interrupt.h> 68#include <linux/interrupt.h>
diff --git a/drivers/video/tgafb.c b/drivers/video/tgafb.c
index 6c2c78ab9827..94fde625a6c0 100644
--- a/drivers/video/tgafb.c
+++ b/drivers/video/tgafb.c
@@ -17,7 +17,6 @@
17#include <linux/errno.h> 17#include <linux/errno.h>
18#include <linux/string.h> 18#include <linux/string.h>
19#include <linux/mm.h> 19#include <linux/mm.h>
20#include <linux/tty.h>
21#include <linux/slab.h> 20#include <linux/slab.h>
22#include <linux/delay.h> 21#include <linux/delay.h>
23#include <linux/init.h> 22#include <linux/init.h>
diff --git a/drivers/video/tx3912fb.c b/drivers/video/tx3912fb.c
index d904da44e1aa..07389ba01eff 100644
--- a/drivers/video/tx3912fb.c
+++ b/drivers/video/tx3912fb.c
@@ -14,7 +14,6 @@
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/errno.h> 15#include <linux/errno.h>
16#include <linux/string.h> 16#include <linux/string.h>
17#include <linux/tty.h>
18#include <linux/delay.h> 17#include <linux/delay.h>
19#include <linux/interrupt.h> 18#include <linux/interrupt.h>
20#include <linux/init.h> 19#include <linux/init.h>
diff --git a/drivers/video/valkyriefb.c b/drivers/video/valkyriefb.c
index 1d76c035050e..47f27924a7d7 100644
--- a/drivers/video/valkyriefb.c
+++ b/drivers/video/valkyriefb.c
@@ -44,7 +44,6 @@
44#include <linux/errno.h> 44#include <linux/errno.h>
45#include <linux/string.h> 45#include <linux/string.h>
46#include <linux/mm.h> 46#include <linux/mm.h>
47#include <linux/tty.h>
48#include <linux/slab.h> 47#include <linux/slab.h>
49#include <linux/vmalloc.h> 48#include <linux/vmalloc.h>
50#include <linux/delay.h> 49#include <linux/delay.h>
diff --git a/drivers/video/vesafb.c b/drivers/video/vesafb.c
index 5718924b677f..2196448396ec 100644
--- a/drivers/video/vesafb.c
+++ b/drivers/video/vesafb.c
@@ -13,13 +13,13 @@
13#include <linux/errno.h> 13#include <linux/errno.h>
14#include <linux/string.h> 14#include <linux/string.h>
15#include <linux/mm.h> 15#include <linux/mm.h>
16#include <linux/tty.h>
17#include <linux/slab.h> 16#include <linux/slab.h>
18#include <linux/delay.h> 17#include <linux/delay.h>
19#include <linux/fb.h> 18#include <linux/fb.h>
20#include <linux/ioport.h> 19#include <linux/ioport.h>
21#include <linux/init.h> 20#include <linux/init.h>
22#include <linux/platform_device.h> 21#include <linux/platform_device.h>
22#include <linux/screen_info.h>
23 23
24#include <video/vga.h> 24#include <video/vga.h>
25#include <asm/io.h> 25#include <asm/io.h>
diff --git a/drivers/video/vfb.c b/drivers/video/vfb.c
index d073ffb6e1f9..a9b99b01bd8e 100644
--- a/drivers/video/vfb.c
+++ b/drivers/video/vfb.c
@@ -15,7 +15,6 @@
15#include <linux/errno.h> 15#include <linux/errno.h>
16#include <linux/string.h> 16#include <linux/string.h>
17#include <linux/mm.h> 17#include <linux/mm.h>
18#include <linux/tty.h>
19#include <linux/slab.h> 18#include <linux/slab.h>
20#include <linux/vmalloc.h> 19#include <linux/vmalloc.h>
21#include <linux/delay.h> 20#include <linux/delay.h>
diff --git a/drivers/video/vga16fb.c b/drivers/video/vga16fb.c
index 3c404c9bd36c..43d5a6d9c4a6 100644
--- a/drivers/video/vga16fb.c
+++ b/drivers/video/vga16fb.c
@@ -15,13 +15,13 @@
15#include <linux/errno.h> 15#include <linux/errno.h>
16#include <linux/string.h> 16#include <linux/string.h>
17#include <linux/mm.h> 17#include <linux/mm.h>
18#include <linux/tty.h>
19#include <linux/slab.h> 18#include <linux/slab.h>
20#include <linux/delay.h> 19#include <linux/delay.h>
21#include <linux/fb.h> 20#include <linux/fb.h>
22#include <linux/ioport.h> 21#include <linux/ioport.h>
23#include <linux/init.h> 22#include <linux/init.h>
24#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <linux/screen_info.h>
25 25
26#include <asm/io.h> 26#include <asm/io.h>
27#include <video/vga.h> 27#include <video/vga.h>
diff --git a/drivers/video/virgefb.c b/drivers/video/virgefb.c
index 5ea2345dab99..64378959dd7b 100644
--- a/drivers/video/virgefb.c
+++ b/drivers/video/virgefb.c
@@ -39,7 +39,6 @@
39#include <linux/errno.h> 39#include <linux/errno.h>
40#include <linux/string.h> 40#include <linux/string.h>
41#include <linux/mm.h> 41#include <linux/mm.h>
42#include <linux/tty.h>
43#include <linux/slab.h> 42#include <linux/slab.h>
44#include <linux/delay.h> 43#include <linux/delay.h>
45#include <linux/zorro.h> 44#include <linux/zorro.h>
diff --git a/drivers/w1/masters/ds2482.c b/drivers/w1/masters/ds2482.c
index af492cc48db2..d93eb626b2f0 100644
--- a/drivers/w1/masters/ds2482.c
+++ b/drivers/w1/masters/ds2482.c
@@ -218,7 +218,7 @@ static int ds2482_wait_1wire_idle(struct ds2482_data *pdev)
218 do { 218 do {
219 temp = i2c_smbus_read_byte(&pdev->client); 219 temp = i2c_smbus_read_byte(&pdev->client);
220 } while ((temp >= 0) && (temp & DS2482_REG_STS_1WB) && 220 } while ((temp >= 0) && (temp & DS2482_REG_STS_1WB) &&
221 (++retries > DS2482_WAIT_IDLE_TIMEOUT)); 221 (++retries < DS2482_WAIT_IDLE_TIMEOUT));
222 } 222 }
223 223
224 if (retries > DS2482_WAIT_IDLE_TIMEOUT) 224 if (retries > DS2482_WAIT_IDLE_TIMEOUT)
diff --git a/fs/9p/conv.c b/fs/9p/conv.c
index 1e898144eb7c..56d88c1a09c5 100644
--- a/fs/9p/conv.c
+++ b/fs/9p/conv.c
@@ -673,8 +673,10 @@ struct v9fs_fcall *v9fs_create_tcreate(u32 fid, char *name, u32 perm, u8 mode,
673 struct cbuf *bufp = &buffer; 673 struct cbuf *bufp = &buffer;
674 674
675 size = 4 + 2 + strlen(name) + 4 + 1; /* fid[4] name[s] perm[4] mode[1] */ 675 size = 4 + 2 + strlen(name) + 4 + 1; /* fid[4] name[s] perm[4] mode[1] */
676 if (extended && extension!=NULL) 676 if (extended) {
677 size += 2 + strlen(extension); /* extension[s] */ 677 size += 2 + /* extension[s] */
678 (extension == NULL ? 0 : strlen(extension));
679 }
678 680
679 fc = v9fs_create_common(bufp, size, TCREATE); 681 fc = v9fs_create_common(bufp, size, TCREATE);
680 if (IS_ERR(fc)) 682 if (IS_ERR(fc))
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index 2f580a197b8d..eae50c9d6dc4 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -434,11 +434,11 @@ static int v9fs_remove(struct inode *dir, struct dentry *file, int rmdir)
434 result = v9fs_t_remove(v9ses, fid, &fcall); 434 result = v9fs_t_remove(v9ses, fid, &fcall);
435 if (result < 0) { 435 if (result < 0) {
436 PRINT_FCALL_ERROR("remove fails", fcall); 436 PRINT_FCALL_ERROR("remove fails", fcall);
437 } else {
438 v9fs_put_idpool(fid, &v9ses->fidpool);
439 v9fs_fid_destroy(v9fid);
440 } 437 }
441 438
439 v9fs_put_idpool(fid, &v9ses->fidpool);
440 v9fs_fid_destroy(v9fid);
441
442 kfree(fcall); 442 kfree(fcall);
443 return result; 443 return result;
444} 444}
diff --git a/fs/Kconfig b/fs/Kconfig
index 53f5c6d61121..3f00a9faabcb 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -1801,6 +1801,7 @@ config CIFS_POSIX
1801 1801
1802config CIFS_DEBUG2 1802config CIFS_DEBUG2
1803 bool "Enable additional CIFS debugging routines" 1803 bool "Enable additional CIFS debugging routines"
1804 depends on CIFS
1804 help 1805 help
1805 Enabling this option adds a few more debugging routines 1806 Enabling this option adds a few more debugging routines
1806 to the cifs code which slightly increases the size of 1807 to the cifs code which slightly increases the size of
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index f42e64210ee5..672a3b90bc55 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -1185,8 +1185,6 @@ static int maydump(struct vm_area_struct *vma)
1185 return 1; 1185 return 1;
1186} 1186}
1187 1187
1188#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
1189
1190/* An ELF note in memory */ 1188/* An ELF note in memory */
1191struct memelfnote 1189struct memelfnote
1192{ 1190{
diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c
index eba4e23b9ca0..2f3365829229 100644
--- a/fs/binfmt_elf_fdpic.c
+++ b/fs/binfmt_elf_fdpic.c
@@ -1,6 +1,6 @@
1/* binfmt_elf_fdpic.c: FDPIC ELF binary format 1/* binfmt_elf_fdpic.c: FDPIC ELF binary format
2 * 2 *
3 * Copyright (C) 2003, 2004 Red Hat, Inc. All Rights Reserved. 3 * Copyright (C) 2003, 2004, 2006 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com) 4 * Written by David Howells (dhowells@redhat.com)
5 * Derived from binfmt_elf.c 5 * Derived from binfmt_elf.c
6 * 6 *
@@ -24,7 +24,9 @@
24#include <linux/file.h> 24#include <linux/file.h>
25#include <linux/fcntl.h> 25#include <linux/fcntl.h>
26#include <linux/slab.h> 26#include <linux/slab.h>
27#include <linux/pagemap.h>
27#include <linux/highmem.h> 28#include <linux/highmem.h>
29#include <linux/highuid.h>
28#include <linux/personality.h> 30#include <linux/personality.h>
29#include <linux/ptrace.h> 31#include <linux/ptrace.h>
30#include <linux/init.h> 32#include <linux/init.h>
@@ -48,45 +50,59 @@ typedef char *elf_caddr_t;
48#define kdebug(fmt, ...) do {} while(0) 50#define kdebug(fmt, ...) do {} while(0)
49#endif 51#endif
50 52
53#if 0
54#define kdcore(fmt, ...) printk("FDPIC "fmt"\n" ,##__VA_ARGS__ )
55#else
56#define kdcore(fmt, ...) do {} while(0)
57#endif
58
51MODULE_LICENSE("GPL"); 59MODULE_LICENSE("GPL");
52 60
53static int load_elf_fdpic_binary(struct linux_binprm *bprm, struct pt_regs *regs); 61static int load_elf_fdpic_binary(struct linux_binprm *, struct pt_regs *);
54//static int load_elf_fdpic_library(struct file *); 62static int elf_fdpic_fetch_phdrs(struct elf_fdpic_params *, struct file *);
55static int elf_fdpic_fetch_phdrs(struct elf_fdpic_params *params, struct file *file); 63static int elf_fdpic_map_file(struct elf_fdpic_params *, struct file *,
56static int elf_fdpic_map_file(struct elf_fdpic_params *params, 64 struct mm_struct *, const char *);
57 struct file *file,
58 struct mm_struct *mm,
59 const char *what);
60 65
61static int create_elf_fdpic_tables(struct linux_binprm *bprm, 66static int create_elf_fdpic_tables(struct linux_binprm *, struct mm_struct *,
62 struct mm_struct *mm, 67 struct elf_fdpic_params *,
63 struct elf_fdpic_params *exec_params, 68 struct elf_fdpic_params *);
64 struct elf_fdpic_params *interp_params);
65 69
66#ifndef CONFIG_MMU 70#ifndef CONFIG_MMU
67static int elf_fdpic_transfer_args_to_stack(struct linux_binprm *bprm, unsigned long *_sp); 71static int elf_fdpic_transfer_args_to_stack(struct linux_binprm *,
68static int elf_fdpic_map_file_constdisp_on_uclinux(struct elf_fdpic_params *params, 72 unsigned long *);
69 struct file *file, 73static int elf_fdpic_map_file_constdisp_on_uclinux(struct elf_fdpic_params *,
70 struct mm_struct *mm); 74 struct file *,
75 struct mm_struct *);
71#endif 76#endif
72 77
73static int elf_fdpic_map_file_by_direct_mmap(struct elf_fdpic_params *params, 78static int elf_fdpic_map_file_by_direct_mmap(struct elf_fdpic_params *,
74 struct file *file, 79 struct file *, struct mm_struct *);
75 struct mm_struct *mm); 80
81#if defined(USE_ELF_CORE_DUMP) && defined(CONFIG_ELF_CORE)
82static int elf_fdpic_core_dump(long, struct pt_regs *, struct file *);
83#endif
76 84
77static struct linux_binfmt elf_fdpic_format = { 85static struct linux_binfmt elf_fdpic_format = {
78 .module = THIS_MODULE, 86 .module = THIS_MODULE,
79 .load_binary = load_elf_fdpic_binary, 87 .load_binary = load_elf_fdpic_binary,
80// .load_shlib = load_elf_fdpic_library, 88#if defined(USE_ELF_CORE_DUMP) && defined(CONFIG_ELF_CORE)
81// .core_dump = elf_fdpic_core_dump, 89 .core_dump = elf_fdpic_core_dump,
90#endif
82 .min_coredump = ELF_EXEC_PAGESIZE, 91 .min_coredump = ELF_EXEC_PAGESIZE,
83}; 92};
84 93
85static int __init init_elf_fdpic_binfmt(void) { return register_binfmt(&elf_fdpic_format); } 94static int __init init_elf_fdpic_binfmt(void)
86static void __exit exit_elf_fdpic_binfmt(void) { unregister_binfmt(&elf_fdpic_format); } 95{
96 return register_binfmt(&elf_fdpic_format);
97}
98
99static void __exit exit_elf_fdpic_binfmt(void)
100{
101 unregister_binfmt(&elf_fdpic_format);
102}
87 103
88module_init(init_elf_fdpic_binfmt) 104core_initcall(init_elf_fdpic_binfmt);
89module_exit(exit_elf_fdpic_binfmt) 105module_exit(exit_elf_fdpic_binfmt);
90 106
91static int is_elf_fdpic(struct elfhdr *hdr, struct file *file) 107static int is_elf_fdpic(struct elfhdr *hdr, struct file *file)
92{ 108{
@@ -105,7 +121,8 @@ static int is_elf_fdpic(struct elfhdr *hdr, struct file *file)
105/* 121/*
106 * read the program headers table into memory 122 * read the program headers table into memory
107 */ 123 */
108static int elf_fdpic_fetch_phdrs(struct elf_fdpic_params *params, struct file *file) 124static int elf_fdpic_fetch_phdrs(struct elf_fdpic_params *params,
125 struct file *file)
109{ 126{
110 struct elf32_phdr *phdr; 127 struct elf32_phdr *phdr;
111 unsigned long size; 128 unsigned long size;
@@ -121,7 +138,8 @@ static int elf_fdpic_fetch_phdrs(struct elf_fdpic_params *params, struct file *f
121 if (!params->phdrs) 138 if (!params->phdrs)
122 return -ENOMEM; 139 return -ENOMEM;
123 140
124 retval = kernel_read(file, params->hdr.e_phoff, (char *) params->phdrs, size); 141 retval = kernel_read(file, params->hdr.e_phoff,
142 (char *) params->phdrs, size);
125 if (retval < 0) 143 if (retval < 0)
126 return retval; 144 return retval;
127 145
@@ -141,17 +159,24 @@ static int elf_fdpic_fetch_phdrs(struct elf_fdpic_params *params, struct file *f
141 } 159 }
142 160
143 return 0; 161 return 0;
144} /* end elf_fdpic_fetch_phdrs() */ 162}
145 163
146/*****************************************************************************/ 164/*****************************************************************************/
147/* 165/*
148 * load an fdpic binary into various bits of memory 166 * load an fdpic binary into various bits of memory
149 */ 167 */
150static int load_elf_fdpic_binary(struct linux_binprm *bprm, struct pt_regs *regs) 168static int load_elf_fdpic_binary(struct linux_binprm *bprm,
169 struct pt_regs *regs)
151{ 170{
152 struct elf_fdpic_params exec_params, interp_params; 171 struct elf_fdpic_params exec_params, interp_params;
153 struct elf_phdr *phdr; 172 struct elf_phdr *phdr;
154 unsigned long stack_size; 173 unsigned long stack_size, entryaddr;
174#ifndef CONFIG_MMU
175 unsigned long fullsize;
176#endif
177#ifdef ELF_FDPIC_PLAT_INIT
178 unsigned long dynaddr;
179#endif
155 struct file *interpreter = NULL; /* to shut gcc up */ 180 struct file *interpreter = NULL; /* to shut gcc up */
156 char *interpreter_name = NULL; 181 char *interpreter_name = NULL;
157 int executable_stack; 182 int executable_stack;
@@ -212,7 +237,8 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm, struct pt_regs *regs
212 goto error; 237 goto error;
213 } 238 }
214 239
215 retval = kernel_read(interpreter, 0, bprm->buf, BINPRM_BUF_SIZE); 240 retval = kernel_read(interpreter, 0, bprm->buf,
241 BINPRM_BUF_SIZE);
216 if (retval < 0) 242 if (retval < 0)
217 goto error; 243 goto error;
218 244
@@ -295,7 +321,8 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm, struct pt_regs *regs
295 &current->mm->start_stack, 321 &current->mm->start_stack,
296 &current->mm->start_brk); 322 &current->mm->start_brk);
297 323
298 retval = setup_arg_pages(bprm, current->mm->start_stack, executable_stack); 324 retval = setup_arg_pages(bprm, current->mm->start_stack,
325 executable_stack);
299 if (retval < 0) { 326 if (retval < 0) {
300 send_sig(SIGKILL, current, 0); 327 send_sig(SIGKILL, current, 0);
301 goto error_kill; 328 goto error_kill;
@@ -303,7 +330,8 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm, struct pt_regs *regs
303#endif 330#endif
304 331
305 /* load the executable and interpreter into memory */ 332 /* load the executable and interpreter into memory */
306 retval = elf_fdpic_map_file(&exec_params, bprm->file, current->mm, "executable"); 333 retval = elf_fdpic_map_file(&exec_params, bprm->file, current->mm,
334 "executable");
307 if (retval < 0) 335 if (retval < 0)
308 goto error_kill; 336 goto error_kill;
309 337
@@ -324,7 +352,8 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm, struct pt_regs *regs
324 if (!current->mm->start_brk) 352 if (!current->mm->start_brk)
325 current->mm->start_brk = current->mm->end_data; 353 current->mm->start_brk = current->mm->end_data;
326 354
327 current->mm->brk = current->mm->start_brk = PAGE_ALIGN(current->mm->start_brk); 355 current->mm->brk = current->mm->start_brk =
356 PAGE_ALIGN(current->mm->start_brk);
328 357
329#else 358#else
330 /* create a stack and brk area big enough for everyone 359 /* create a stack and brk area big enough for everyone
@@ -336,47 +365,45 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm, struct pt_regs *regs
336 stack_size = PAGE_SIZE * 2; 365 stack_size = PAGE_SIZE * 2;
337 366
338 down_write(&current->mm->mmap_sem); 367 down_write(&current->mm->mmap_sem);
339 current->mm->start_brk = do_mmap(NULL, 368 current->mm->start_brk = do_mmap(NULL, 0, stack_size,
340 0,
341 stack_size,
342 PROT_READ | PROT_WRITE | PROT_EXEC, 369 PROT_READ | PROT_WRITE | PROT_EXEC,
343 MAP_PRIVATE | MAP_ANON | MAP_GROWSDOWN, 370 MAP_PRIVATE | MAP_ANON | MAP_GROWSDOWN,
344 0); 371 0);
345 372
346 if (IS_ERR((void *) current->mm->start_brk)) { 373 if (IS_ERR_VALUE(current->mm->start_brk)) {
347 up_write(&current->mm->mmap_sem); 374 up_write(&current->mm->mmap_sem);
348 retval = current->mm->start_brk; 375 retval = current->mm->start_brk;
349 current->mm->start_brk = 0; 376 current->mm->start_brk = 0;
350 goto error_kill; 377 goto error_kill;
351 } 378 }
352 379
353 if (do_mremap(current->mm->start_brk, 380 /* expand the stack mapping to use up the entire allocation granule */
354 stack_size, 381 fullsize = ksize((char *) current->mm->start_brk);
355 ksize((char *) current->mm->start_brk), 382 if (!IS_ERR_VALUE(do_mremap(current->mm->start_brk, stack_size,
356 0, 0 383 fullsize, 0, 0)))
357 ) == current->mm->start_brk 384 stack_size = fullsize;
358 )
359 stack_size = ksize((char *) current->mm->start_brk);
360 up_write(&current->mm->mmap_sem); 385 up_write(&current->mm->mmap_sem);
361 386
362 current->mm->brk = current->mm->start_brk; 387 current->mm->brk = current->mm->start_brk;
363 current->mm->context.end_brk = current->mm->start_brk; 388 current->mm->context.end_brk = current->mm->start_brk;
364 current->mm->context.end_brk += (stack_size > PAGE_SIZE) ? (stack_size - PAGE_SIZE) : 0; 389 current->mm->context.end_brk +=
390 (stack_size > PAGE_SIZE) ? (stack_size - PAGE_SIZE) : 0;
365 current->mm->start_stack = current->mm->start_brk + stack_size; 391 current->mm->start_stack = current->mm->start_brk + stack_size;
366#endif 392#endif
367 393
368 compute_creds(bprm); 394 compute_creds(bprm);
369 current->flags &= ~PF_FORKNOEXEC; 395 current->flags &= ~PF_FORKNOEXEC;
370 if (create_elf_fdpic_tables(bprm, current->mm, &exec_params, &interp_params) < 0) 396 if (create_elf_fdpic_tables(bprm, current->mm,
397 &exec_params, &interp_params) < 0)
371 goto error_kill; 398 goto error_kill;
372 399
373 kdebug("- start_code %lx", (long) current->mm->start_code); 400 kdebug("- start_code %lx", current->mm->start_code);
374 kdebug("- end_code %lx", (long) current->mm->end_code); 401 kdebug("- end_code %lx", current->mm->end_code);
375 kdebug("- start_data %lx", (long) current->mm->start_data); 402 kdebug("- start_data %lx", current->mm->start_data);
376 kdebug("- end_data %lx", (long) current->mm->end_data); 403 kdebug("- end_data %lx", current->mm->end_data);
377 kdebug("- start_brk %lx", (long) current->mm->start_brk); 404 kdebug("- start_brk %lx", current->mm->start_brk);
378 kdebug("- brk %lx", (long) current->mm->brk); 405 kdebug("- brk %lx", current->mm->brk);
379 kdebug("- start_stack %lx", (long) current->mm->start_stack); 406 kdebug("- start_stack %lx", current->mm->start_stack);
380 407
381#ifdef ELF_FDPIC_PLAT_INIT 408#ifdef ELF_FDPIC_PLAT_INIT
382 /* 409 /*
@@ -385,21 +412,18 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm, struct pt_regs *regs
385 * example. This macro performs whatever initialization to 412 * example. This macro performs whatever initialization to
386 * the regs structure is required. 413 * the regs structure is required.
387 */ 414 */
388 ELF_FDPIC_PLAT_INIT(regs, 415 dynaddr = interp_params.dynamic_addr ?: exec_params.dynamic_addr;
389 exec_params.map_addr, 416 ELF_FDPIC_PLAT_INIT(regs, exec_params.map_addr, interp_params.map_addr,
390 interp_params.map_addr, 417 dynaddr);
391 interp_params.dynamic_addr ?: exec_params.dynamic_addr
392 );
393#endif 418#endif
394 419
395 /* everything is now ready... get the userspace context ready to roll */ 420 /* everything is now ready... get the userspace context ready to roll */
396 start_thread(regs, 421 entryaddr = interp_params.entry_addr ?: exec_params.entry_addr;
397 interp_params.entry_addr ?: exec_params.entry_addr, 422 start_thread(regs, entryaddr, current->mm->start_stack);
398 current->mm->start_stack);
399 423
400 if (unlikely(current->ptrace & PT_PTRACED)) { 424 if (unlikely(current->ptrace & PT_PTRACED)) {
401 if (current->ptrace & PT_TRACE_EXEC) 425 if (current->ptrace & PT_TRACE_EXEC)
402 ptrace_notify ((PTRACE_EVENT_EXEC << 8) | SIGTRAP); 426 ptrace_notify((PTRACE_EVENT_EXEC << 8) | SIGTRAP);
403 else 427 else
404 send_sig(SIGTRAP, current, 0); 428 send_sig(SIGTRAP, current, 0);
405 } 429 }
@@ -419,11 +443,11 @@ error:
419 return retval; 443 return retval;
420 444
421 /* unrecoverable error - kill the process */ 445 /* unrecoverable error - kill the process */
422 error_kill: 446error_kill:
423 send_sig(SIGSEGV, current, 0); 447 send_sig(SIGSEGV, current, 0);
424 goto error; 448 goto error;
425 449
426} /* end load_elf_fdpic_binary() */ 450}
427 451
428/*****************************************************************************/ 452/*****************************************************************************/
429/* 453/*
@@ -459,6 +483,7 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm,
459 */ 483 */
460 hwcap = ELF_HWCAP; 484 hwcap = ELF_HWCAP;
461 k_platform = ELF_PLATFORM; 485 k_platform = ELF_PLATFORM;
486 u_platform = NULL;
462 487
463 if (k_platform) { 488 if (k_platform) {
464 platform_len = strlen(k_platform) + 1; 489 platform_len = strlen(k_platform) + 1;
@@ -470,11 +495,11 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm,
470 495
471#if defined(__i386__) && defined(CONFIG_SMP) 496#if defined(__i386__) && defined(CONFIG_SMP)
472 /* in some cases (e.g. Hyper-Threading), we want to avoid L1 evictions 497 /* in some cases (e.g. Hyper-Threading), we want to avoid L1 evictions
473 * by the processes running on the same package. One thing we can do 498 * by the processes running on the same package. One thing we can do is
474 * is to shuffle the initial stack for them. 499 * to shuffle the initial stack for them.
475 * 500 *
476 * the conditionals here are unneeded, but kept in to make the 501 * the conditionals here are unneeded, but kept in to make the code
477 * code behaviour the same as pre change unless we have hyperthreaded 502 * behaviour the same as pre change unless we have hyperthreaded
478 * processors. This keeps Mr Marcelo Person happier but should be 503 * processors. This keeps Mr Marcelo Person happier but should be
479 * removed for 2.5 504 * removed for 2.5
480 */ 505 */
@@ -497,11 +522,13 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm,
497 522
498 if (interp_params->loadmap) { 523 if (interp_params->loadmap) {
499 len = sizeof(struct elf32_fdpic_loadmap); 524 len = sizeof(struct elf32_fdpic_loadmap);
500 len += sizeof(struct elf32_fdpic_loadseg) * interp_params->loadmap->nsegs; 525 len += sizeof(struct elf32_fdpic_loadseg) *
526 interp_params->loadmap->nsegs;
501 sp = (sp - len) & ~7UL; 527 sp = (sp - len) & ~7UL;
502 interp_params->map_addr = sp; 528 interp_params->map_addr = sp;
503 529
504 if (copy_to_user((void __user *) sp, interp_params->loadmap, len) != 0) 530 if (copy_to_user((void __user *) sp, interp_params->loadmap,
531 len) != 0)
505 return -EFAULT; 532 return -EFAULT;
506 533
507 current->mm->context.interp_fdpic_loadmap = (unsigned long) sp; 534 current->mm->context.interp_fdpic_loadmap = (unsigned long) sp;
@@ -525,34 +552,37 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm,
525 sp -= sp & 15UL; 552 sp -= sp & 15UL;
526 553
527 /* put the ELF interpreter info on the stack */ 554 /* put the ELF interpreter info on the stack */
528#define NEW_AUX_ENT(nr, id, val) \ 555#define NEW_AUX_ENT(nr, id, val) \
529 do { \ 556 do { \
530 struct { unsigned long _id, _val; } __user *ent = (void __user *) csp; \ 557 struct { unsigned long _id, _val; } __user *ent; \
531 __put_user((id), &ent[nr]._id); \ 558 \
532 __put_user((val), &ent[nr]._val); \ 559 ent = (void __user *) csp; \
560 __put_user((id), &ent[nr]._id); \
561 __put_user((val), &ent[nr]._val); \
533 } while (0) 562 } while (0)
534 563
535 csp -= 2 * sizeof(unsigned long); 564 csp -= 2 * sizeof(unsigned long);
536 NEW_AUX_ENT(0, AT_NULL, 0); 565 NEW_AUX_ENT(0, AT_NULL, 0);
537 if (k_platform) { 566 if (k_platform) {
538 csp -= 2 * sizeof(unsigned long); 567 csp -= 2 * sizeof(unsigned long);
539 NEW_AUX_ENT(0, AT_PLATFORM, (elf_addr_t)(unsigned long) u_platform); 568 NEW_AUX_ENT(0, AT_PLATFORM,
569 (elf_addr_t) (unsigned long) u_platform);
540 } 570 }
541 571
542 csp -= DLINFO_ITEMS * 2 * sizeof(unsigned long); 572 csp -= DLINFO_ITEMS * 2 * sizeof(unsigned long);
543 NEW_AUX_ENT( 0, AT_HWCAP, hwcap); 573 NEW_AUX_ENT( 0, AT_HWCAP, hwcap);
544 NEW_AUX_ENT( 1, AT_PAGESZ, PAGE_SIZE); 574 NEW_AUX_ENT( 1, AT_PAGESZ, PAGE_SIZE);
545 NEW_AUX_ENT( 2, AT_CLKTCK, CLOCKS_PER_SEC); 575 NEW_AUX_ENT( 2, AT_CLKTCK, CLOCKS_PER_SEC);
546 NEW_AUX_ENT( 3, AT_PHDR, exec_params->ph_addr); 576 NEW_AUX_ENT( 3, AT_PHDR, exec_params->ph_addr);
547 NEW_AUX_ENT( 4, AT_PHENT, sizeof(struct elf_phdr)); 577 NEW_AUX_ENT( 4, AT_PHENT, sizeof(struct elf_phdr));
548 NEW_AUX_ENT( 5, AT_PHNUM, exec_params->hdr.e_phnum); 578 NEW_AUX_ENT( 5, AT_PHNUM, exec_params->hdr.e_phnum);
549 NEW_AUX_ENT( 6, AT_BASE, interp_params->elfhdr_addr); 579 NEW_AUX_ENT( 6, AT_BASE, interp_params->elfhdr_addr);
550 NEW_AUX_ENT( 7, AT_FLAGS, 0); 580 NEW_AUX_ENT( 7, AT_FLAGS, 0);
551 NEW_AUX_ENT( 8, AT_ENTRY, exec_params->entry_addr); 581 NEW_AUX_ENT( 8, AT_ENTRY, exec_params->entry_addr);
552 NEW_AUX_ENT( 9, AT_UID, (elf_addr_t) current->uid); 582 NEW_AUX_ENT( 9, AT_UID, (elf_addr_t) current->uid);
553 NEW_AUX_ENT(10, AT_EUID, (elf_addr_t) current->euid); 583 NEW_AUX_ENT(10, AT_EUID, (elf_addr_t) current->euid);
554 NEW_AUX_ENT(11, AT_GID, (elf_addr_t) current->gid); 584 NEW_AUX_ENT(11, AT_GID, (elf_addr_t) current->gid);
555 NEW_AUX_ENT(12, AT_EGID, (elf_addr_t) current->egid); 585 NEW_AUX_ENT(12, AT_EGID, (elf_addr_t) current->egid);
556 586
557#ifdef ARCH_DLINFO 587#ifdef ARCH_DLINFO
558 /* ARCH_DLINFO must come last so platform specific code can enforce 588 /* ARCH_DLINFO must come last so platform specific code can enforce
@@ -578,7 +608,8 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm,
578#ifdef CONFIG_MMU 608#ifdef CONFIG_MMU
579 current->mm->arg_start = bprm->p; 609 current->mm->arg_start = bprm->p;
580#else 610#else
581 current->mm->arg_start = current->mm->start_stack - (MAX_ARG_PAGES * PAGE_SIZE - bprm->p); 611 current->mm->arg_start = current->mm->start_stack -
612 (MAX_ARG_PAGES * PAGE_SIZE - bprm->p);
582#endif 613#endif
583 614
584 p = (char __user *) current->mm->arg_start; 615 p = (char __user *) current->mm->arg_start;
@@ -606,7 +637,7 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm,
606 637
607 mm->start_stack = (unsigned long) sp; 638 mm->start_stack = (unsigned long) sp;
608 return 0; 639 return 0;
609} /* end create_elf_fdpic_tables() */ 640}
610 641
611/*****************************************************************************/ 642/*****************************************************************************/
612/* 643/*
@@ -614,7 +645,8 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm,
614 * the stack 645 * the stack
615 */ 646 */
616#ifndef CONFIG_MMU 647#ifndef CONFIG_MMU
617static int elf_fdpic_transfer_args_to_stack(struct linux_binprm *bprm, unsigned long *_sp) 648static int elf_fdpic_transfer_args_to_stack(struct linux_binprm *bprm,
649 unsigned long *_sp)
618{ 650{
619 unsigned long index, stop, sp; 651 unsigned long index, stop, sp;
620 char *src; 652 char *src;
@@ -635,9 +667,9 @@ static int elf_fdpic_transfer_args_to_stack(struct linux_binprm *bprm, unsigned
635 667
636 *_sp = (*_sp - (MAX_ARG_PAGES * PAGE_SIZE - bprm->p)) & ~15; 668 *_sp = (*_sp - (MAX_ARG_PAGES * PAGE_SIZE - bprm->p)) & ~15;
637 669
638 out: 670out:
639 return ret; 671 return ret;
640} /* end elf_fdpic_transfer_args_to_stack() */ 672}
641#endif 673#endif
642 674
643/*****************************************************************************/ 675/*****************************************************************************/
@@ -712,17 +744,18 @@ static int elf_fdpic_map_file(struct elf_fdpic_params *params,
712 seg = loadmap->segs; 744 seg = loadmap->segs;
713 for (loop = loadmap->nsegs; loop > 0; loop--, seg++) { 745 for (loop = loadmap->nsegs; loop > 0; loop--, seg++) {
714 if (params->hdr.e_entry >= seg->p_vaddr && 746 if (params->hdr.e_entry >= seg->p_vaddr &&
715 params->hdr.e_entry < seg->p_vaddr + seg->p_memsz 747 params->hdr.e_entry < seg->p_vaddr + seg->p_memsz) {
716 ) {
717 params->entry_addr = 748 params->entry_addr =
718 (params->hdr.e_entry - seg->p_vaddr) + seg->addr; 749 (params->hdr.e_entry - seg->p_vaddr) +
750 seg->addr;
719 break; 751 break;
720 } 752 }
721 } 753 }
722 } 754 }
723 755
724 /* determine where the program header table has wound up if mapped */ 756 /* determine where the program header table has wound up if mapped */
725 stop = params->hdr.e_phoff + params->hdr.e_phnum * sizeof (struct elf_phdr); 757 stop = params->hdr.e_phoff;
758 stop += params->hdr.e_phnum * sizeof (struct elf_phdr);
726 phdr = params->phdrs; 759 phdr = params->phdrs;
727 760
728 for (loop = 0; loop < params->hdr.e_phnum; loop++, phdr++) { 761 for (loop = 0; loop < params->hdr.e_phnum; loop++, phdr++) {
@@ -736,9 +769,11 @@ static int elf_fdpic_map_file(struct elf_fdpic_params *params,
736 seg = loadmap->segs; 769 seg = loadmap->segs;
737 for (loop = loadmap->nsegs; loop > 0; loop--, seg++) { 770 for (loop = loadmap->nsegs; loop > 0; loop--, seg++) {
738 if (phdr->p_vaddr >= seg->p_vaddr && 771 if (phdr->p_vaddr >= seg->p_vaddr &&
739 phdr->p_vaddr + phdr->p_filesz <= seg->p_vaddr + seg->p_memsz 772 phdr->p_vaddr + phdr->p_filesz <=
740 ) { 773 seg->p_vaddr + seg->p_memsz) {
741 params->ph_addr = (phdr->p_vaddr - seg->p_vaddr) + seg->addr + 774 params->ph_addr =
775 (phdr->p_vaddr - seg->p_vaddr) +
776 seg->addr +
742 params->hdr.e_phoff - phdr->p_offset; 777 params->hdr.e_phoff - phdr->p_offset;
743 break; 778 break;
744 } 779 }
@@ -755,18 +790,22 @@ static int elf_fdpic_map_file(struct elf_fdpic_params *params,
755 seg = loadmap->segs; 790 seg = loadmap->segs;
756 for (loop = loadmap->nsegs; loop > 0; loop--, seg++) { 791 for (loop = loadmap->nsegs; loop > 0; loop--, seg++) {
757 if (phdr->p_vaddr >= seg->p_vaddr && 792 if (phdr->p_vaddr >= seg->p_vaddr &&
758 phdr->p_vaddr + phdr->p_memsz <= seg->p_vaddr + seg->p_memsz 793 phdr->p_vaddr + phdr->p_memsz <=
759 ) { 794 seg->p_vaddr + seg->p_memsz) {
760 params->dynamic_addr = (phdr->p_vaddr - seg->p_vaddr) + seg->addr; 795 params->dynamic_addr =
761 796 (phdr->p_vaddr - seg->p_vaddr) +
762 /* check the dynamic section contains at least one item, and that 797 seg->addr;
763 * the last item is a NULL entry */ 798
799 /* check the dynamic section contains at least
800 * one item, and that the last item is a NULL
801 * entry */
764 if (phdr->p_memsz == 0 || 802 if (phdr->p_memsz == 0 ||
765 phdr->p_memsz % sizeof(Elf32_Dyn) != 0) 803 phdr->p_memsz % sizeof(Elf32_Dyn) != 0)
766 goto dynamic_error; 804 goto dynamic_error;
767 805
768 tmp = phdr->p_memsz / sizeof(Elf32_Dyn); 806 tmp = phdr->p_memsz / sizeof(Elf32_Dyn);
769 if (((Elf32_Dyn *) params->dynamic_addr)[tmp - 1].d_tag != 0) 807 if (((Elf32_Dyn *)
808 params->dynamic_addr)[tmp - 1].d_tag != 0)
770 goto dynamic_error; 809 goto dynamic_error;
771 break; 810 break;
772 } 811 }
@@ -775,8 +814,8 @@ static int elf_fdpic_map_file(struct elf_fdpic_params *params,
775 } 814 }
776 815
777 /* now elide adjacent segments in the load map on MMU linux 816 /* now elide adjacent segments in the load map on MMU linux
778 * - on uClinux the holes between may actually be filled with system stuff or stuff from 817 * - on uClinux the holes between may actually be filled with system
779 * other processes 818 * stuff or stuff from other processes
780 */ 819 */
781#ifdef CONFIG_MMU 820#ifdef CONFIG_MMU
782 nloads = loadmap->nsegs; 821 nloads = loadmap->nsegs;
@@ -787,7 +826,9 @@ static int elf_fdpic_map_file(struct elf_fdpic_params *params,
787 if (seg->p_vaddr - mseg->p_vaddr == seg->addr - mseg->addr) { 826 if (seg->p_vaddr - mseg->p_vaddr == seg->addr - mseg->addr) {
788 load_addr = PAGE_ALIGN(mseg->addr + mseg->p_memsz); 827 load_addr = PAGE_ALIGN(mseg->addr + mseg->p_memsz);
789 if (load_addr == (seg->addr & PAGE_MASK)) { 828 if (load_addr == (seg->addr & PAGE_MASK)) {
790 mseg->p_memsz += load_addr - (mseg->addr + mseg->p_memsz); 829 mseg->p_memsz +=
830 load_addr -
831 (mseg->addr + mseg->p_memsz);
791 mseg->p_memsz += seg->addr & ~PAGE_MASK; 832 mseg->p_memsz += seg->addr & ~PAGE_MASK;
792 mseg->p_memsz += seg->p_memsz; 833 mseg->p_memsz += seg->p_memsz;
793 loadmap->nsegs--; 834 loadmap->nsegs--;
@@ -815,20 +856,21 @@ static int elf_fdpic_map_file(struct elf_fdpic_params *params,
815 856
816 return 0; 857 return 0;
817 858
818 dynamic_error: 859dynamic_error:
819 printk("ELF FDPIC %s with invalid DYNAMIC section (inode=%lu)\n", 860 printk("ELF FDPIC %s with invalid DYNAMIC section (inode=%lu)\n",
820 what, file->f_dentry->d_inode->i_ino); 861 what, file->f_dentry->d_inode->i_ino);
821 return -ELIBBAD; 862 return -ELIBBAD;
822} /* end elf_fdpic_map_file() */ 863}
823 864
824/*****************************************************************************/ 865/*****************************************************************************/
825/* 866/*
826 * map a file with constant displacement under uClinux 867 * map a file with constant displacement under uClinux
827 */ 868 */
828#ifndef CONFIG_MMU 869#ifndef CONFIG_MMU
829static int elf_fdpic_map_file_constdisp_on_uclinux(struct elf_fdpic_params *params, 870static int elf_fdpic_map_file_constdisp_on_uclinux(
830 struct file *file, 871 struct elf_fdpic_params *params,
831 struct mm_struct *mm) 872 struct file *file,
873 struct mm_struct *mm)
832{ 874{
833 struct elf32_fdpic_loadseg *seg; 875 struct elf32_fdpic_loadseg *seg;
834 struct elf32_phdr *phdr; 876 struct elf32_phdr *phdr;
@@ -839,7 +881,8 @@ static int elf_fdpic_map_file_constdisp_on_uclinux(struct elf_fdpic_params *para
839 load_addr = params->load_addr; 881 load_addr = params->load_addr;
840 seg = params->loadmap->segs; 882 seg = params->loadmap->segs;
841 883
842 /* determine the bounds of the contiguous overall allocation we must make */ 884 /* determine the bounds of the contiguous overall allocation we must
885 * make */
843 phdr = params->phdrs; 886 phdr = params->phdrs;
844 for (loop = 0; loop < params->hdr.e_phnum; loop++, phdr++) { 887 for (loop = 0; loop < params->hdr.e_phnum; loop++, phdr++) {
845 if (params->phdrs[loop].p_type != PT_LOAD) 888 if (params->phdrs[loop].p_type != PT_LOAD)
@@ -860,7 +903,7 @@ static int elf_fdpic_map_file_constdisp_on_uclinux(struct elf_fdpic_params *para
860 maddr = do_mmap(NULL, load_addr, top - base, 903 maddr = do_mmap(NULL, load_addr, top - base,
861 PROT_READ | PROT_WRITE | PROT_EXEC, mflags, 0); 904 PROT_READ | PROT_WRITE | PROT_EXEC, mflags, 0);
862 up_write(&mm->mmap_sem); 905 up_write(&mm->mmap_sem);
863 if (IS_ERR((void *) maddr)) 906 if (IS_ERR_VALUE(maddr))
864 return (int) maddr; 907 return (int) maddr;
865 908
866 if (load_addr != 0) 909 if (load_addr != 0)
@@ -878,7 +921,8 @@ static int elf_fdpic_map_file_constdisp_on_uclinux(struct elf_fdpic_params *para
878 seg->p_vaddr = phdr->p_vaddr; 921 seg->p_vaddr = phdr->p_vaddr;
879 seg->p_memsz = phdr->p_memsz; 922 seg->p_memsz = phdr->p_memsz;
880 923
881 ret = file->f_op->read(file, (void *) seg->addr, phdr->p_filesz, &fpos); 924 ret = file->f_op->read(file, (void *) seg->addr,
925 phdr->p_filesz, &fpos);
882 if (ret < 0) 926 if (ret < 0)
883 return ret; 927 return ret;
884 928
@@ -895,8 +939,7 @@ static int elf_fdpic_map_file_constdisp_on_uclinux(struct elf_fdpic_params *para
895 if (phdr->p_flags & PF_X) { 939 if (phdr->p_flags & PF_X) {
896 mm->start_code = seg->addr; 940 mm->start_code = seg->addr;
897 mm->end_code = seg->addr + phdr->p_memsz; 941 mm->end_code = seg->addr + phdr->p_memsz;
898 } 942 } else if (!mm->start_data) {
899 else if (!mm->start_data) {
900 mm->start_data = seg->addr; 943 mm->start_data = seg->addr;
901#ifndef CONFIG_MMU 944#ifndef CONFIG_MMU
902 mm->end_data = seg->addr + phdr->p_memsz; 945 mm->end_data = seg->addr + phdr->p_memsz;
@@ -913,7 +956,7 @@ static int elf_fdpic_map_file_constdisp_on_uclinux(struct elf_fdpic_params *para
913 } 956 }
914 957
915 return 0; 958 return 0;
916} /* end elf_fdpic_map_file_constdisp_on_uclinux() */ 959}
917#endif 960#endif
918 961
919/*****************************************************************************/ 962/*****************************************************************************/
@@ -974,14 +1017,14 @@ static int elf_fdpic_map_file_by_direct_mmap(struct elf_fdpic_params *params,
974 1017
975 case ELF_FDPIC_FLAG_CONSTDISP: 1018 case ELF_FDPIC_FLAG_CONSTDISP:
976 /* constant displacement 1019 /* constant displacement
977 * - can be mapped anywhere, but must be mapped as a unit 1020 * - can be mapped anywhere, but must be mapped as a
1021 * unit
978 */ 1022 */
979 if (!dvset) { 1023 if (!dvset) {
980 maddr = load_addr; 1024 maddr = load_addr;
981 delta_vaddr = phdr->p_vaddr; 1025 delta_vaddr = phdr->p_vaddr;
982 dvset = 1; 1026 dvset = 1;
983 } 1027 } else {
984 else {
985 maddr = load_addr + phdr->p_vaddr - delta_vaddr; 1028 maddr = load_addr + phdr->p_vaddr - delta_vaddr;
986 flags |= MAP_FIXED; 1029 flags |= MAP_FIXED;
987 } 1030 }
@@ -1005,13 +1048,14 @@ static int elf_fdpic_map_file_by_direct_mmap(struct elf_fdpic_params *params,
1005 up_write(&mm->mmap_sem); 1048 up_write(&mm->mmap_sem);
1006 1049
1007 kdebug("mmap[%d] <file> sz=%lx pr=%x fl=%x of=%lx --> %08lx", 1050 kdebug("mmap[%d] <file> sz=%lx pr=%x fl=%x of=%lx --> %08lx",
1008 loop, phdr->p_memsz + disp, prot, flags, phdr->p_offset - disp, 1051 loop, phdr->p_memsz + disp, prot, flags,
1009 maddr); 1052 phdr->p_offset - disp, maddr);
1010 1053
1011 if (IS_ERR((void *) maddr)) 1054 if (IS_ERR_VALUE(maddr))
1012 return (int) maddr; 1055 return (int) maddr;
1013 1056
1014 if ((params->flags & ELF_FDPIC_FLAG_ARRANGEMENT) == ELF_FDPIC_FLAG_CONTIGUOUS) 1057 if ((params->flags & ELF_FDPIC_FLAG_ARRANGEMENT) ==
1058 ELF_FDPIC_FLAG_CONTIGUOUS)
1015 load_addr += PAGE_ALIGN(phdr->p_memsz + disp); 1059 load_addr += PAGE_ALIGN(phdr->p_memsz + disp);
1016 1060
1017 seg->addr = maddr + disp; 1061 seg->addr = maddr + disp;
@@ -1022,7 +1066,8 @@ static int elf_fdpic_map_file_by_direct_mmap(struct elf_fdpic_params *params,
1022 if (phdr->p_offset == 0) 1066 if (phdr->p_offset == 0)
1023 params->elfhdr_addr = seg->addr; 1067 params->elfhdr_addr = seg->addr;
1024 1068
1025 /* clear the bit between beginning of mapping and beginning of PT_LOAD */ 1069 /* clear the bit between beginning of mapping and beginning of
1070 * PT_LOAD */
1026 if (prot & PROT_WRITE && disp > 0) { 1071 if (prot & PROT_WRITE && disp > 0) {
1027 kdebug("clear[%d] ad=%lx sz=%lx", loop, maddr, disp); 1072 kdebug("clear[%d] ad=%lx sz=%lx", loop, maddr, disp);
1028 clear_user((void __user *) maddr, disp); 1073 clear_user((void __user *) maddr, disp);
@@ -1038,19 +1083,20 @@ static int elf_fdpic_map_file_by_direct_mmap(struct elf_fdpic_params *params,
1038 excess1 = PAGE_SIZE - ((maddr + phdr->p_filesz) & ~PAGE_MASK); 1083 excess1 = PAGE_SIZE - ((maddr + phdr->p_filesz) & ~PAGE_MASK);
1039 1084
1040#ifdef CONFIG_MMU 1085#ifdef CONFIG_MMU
1041
1042 if (excess > excess1) { 1086 if (excess > excess1) {
1043 unsigned long xaddr = maddr + phdr->p_filesz + excess1; 1087 unsigned long xaddr = maddr + phdr->p_filesz + excess1;
1044 unsigned long xmaddr; 1088 unsigned long xmaddr;
1045 1089
1046 flags |= MAP_FIXED | MAP_ANONYMOUS; 1090 flags |= MAP_FIXED | MAP_ANONYMOUS;
1047 down_write(&mm->mmap_sem); 1091 down_write(&mm->mmap_sem);
1048 xmaddr = do_mmap(NULL, xaddr, excess - excess1, prot, flags, 0); 1092 xmaddr = do_mmap(NULL, xaddr, excess - excess1,
1093 prot, flags, 0);
1049 up_write(&mm->mmap_sem); 1094 up_write(&mm->mmap_sem);
1050 1095
1051 kdebug("mmap[%d] <anon>" 1096 kdebug("mmap[%d] <anon>"
1052 " ad=%lx sz=%lx pr=%x fl=%x of=0 --> %08lx", 1097 " ad=%lx sz=%lx pr=%x fl=%x of=0 --> %08lx",
1053 loop, xaddr, excess - excess1, prot, flags, xmaddr); 1098 loop, xaddr, excess - excess1, prot, flags,
1099 xmaddr);
1054 1100
1055 if (xmaddr != xaddr) 1101 if (xmaddr != xaddr)
1056 return -ENOMEM; 1102 return -ENOMEM;
@@ -1059,7 +1105,8 @@ static int elf_fdpic_map_file_by_direct_mmap(struct elf_fdpic_params *params,
1059 if (prot & PROT_WRITE && excess1 > 0) { 1105 if (prot & PROT_WRITE && excess1 > 0) {
1060 kdebug("clear[%d] ad=%lx sz=%lx", 1106 kdebug("clear[%d] ad=%lx sz=%lx",
1061 loop, maddr + phdr->p_filesz, excess1); 1107 loop, maddr + phdr->p_filesz, excess1);
1062 clear_user((void __user *) maddr + phdr->p_filesz, excess1); 1108 clear_user((void __user *) maddr + phdr->p_filesz,
1109 excess1);
1063 } 1110 }
1064 1111
1065#else 1112#else
@@ -1074,8 +1121,7 @@ static int elf_fdpic_map_file_by_direct_mmap(struct elf_fdpic_params *params,
1074 if (phdr->p_flags & PF_X) { 1121 if (phdr->p_flags & PF_X) {
1075 mm->start_code = maddr; 1122 mm->start_code = maddr;
1076 mm->end_code = maddr + phdr->p_memsz; 1123 mm->end_code = maddr + phdr->p_memsz;
1077 } 1124 } else if (!mm->start_data) {
1078 else if (!mm->start_data) {
1079 mm->start_data = maddr; 1125 mm->start_data = maddr;
1080 mm->end_data = maddr + phdr->p_memsz; 1126 mm->end_data = maddr + phdr->p_memsz;
1081 } 1127 }
@@ -1085,4 +1131,662 @@ static int elf_fdpic_map_file_by_direct_mmap(struct elf_fdpic_params *params,
1085 } 1131 }
1086 1132
1087 return 0; 1133 return 0;
1088} /* end elf_fdpic_map_file_by_direct_mmap() */ 1134}
1135
1136/*****************************************************************************/
1137/*
1138 * ELF-FDPIC core dumper
1139 *
1140 * Modelled on fs/exec.c:aout_core_dump()
1141 * Jeremy Fitzhardinge <jeremy@sw.oz.au>
1142 *
1143 * Modelled on fs/binfmt_elf.c core dumper
1144 */
1145#if defined(USE_ELF_CORE_DUMP) && defined(CONFIG_ELF_CORE)
1146
1147/*
1148 * These are the only things you should do on a core-file: use only these
1149 * functions to write out all the necessary info.
1150 */
1151static int dump_write(struct file *file, const void *addr, int nr)
1152{
1153 return file->f_op->write(file, addr, nr, &file->f_pos) == nr;
1154}
1155
1156static int dump_seek(struct file *file, loff_t off)
1157{
1158 if (file->f_op->llseek) {
1159 if (file->f_op->llseek(file, off, SEEK_SET) != off)
1160 return 0;
1161 } else {
1162 file->f_pos = off;
1163 }
1164 return 1;
1165}
1166
1167/*
1168 * Decide whether a segment is worth dumping; default is yes to be
1169 * sure (missing info is worse than too much; etc).
1170 * Personally I'd include everything, and use the coredump limit...
1171 *
1172 * I think we should skip something. But I am not sure how. H.J.
1173 */
1174static int maydump(struct vm_area_struct *vma)
1175{
1176 /* Do not dump I/O mapped devices or special mappings */
1177 if (vma->vm_flags & (VM_IO | VM_RESERVED)) {
1178 kdcore("%08lx: %08lx: no (IO)", vma->vm_start, vma->vm_flags);
1179 return 0;
1180 }
1181
1182 /* If we may not read the contents, don't allow us to dump
1183 * them either. "dump_write()" can't handle it anyway.
1184 */
1185 if (!(vma->vm_flags & VM_READ)) {
1186 kdcore("%08lx: %08lx: no (!read)", vma->vm_start, vma->vm_flags);
1187 return 0;
1188 }
1189
1190 /* Dump shared memory only if mapped from an anonymous file. */
1191 if (vma->vm_flags & VM_SHARED) {
1192 if (vma->vm_file->f_dentry->d_inode->i_nlink == 0) {
1193 kdcore("%08lx: %08lx: no (share)", vma->vm_start, vma->vm_flags);
1194 return 1;
1195 }
1196
1197 kdcore("%08lx: %08lx: no (share)", vma->vm_start, vma->vm_flags);
1198 return 0;
1199 }
1200
1201#ifdef CONFIG_MMU
1202 /* If it hasn't been written to, don't write it out */
1203 if (!vma->anon_vma) {
1204 kdcore("%08lx: %08lx: no (!anon)", vma->vm_start, vma->vm_flags);
1205 return 0;
1206 }
1207#endif
1208
1209 kdcore("%08lx: %08lx: yes", vma->vm_start, vma->vm_flags);
1210 return 1;
1211}
1212
1213/* An ELF note in memory */
1214struct memelfnote
1215{
1216 const char *name;
1217 int type;
1218 unsigned int datasz;
1219 void *data;
1220};
1221
1222static int notesize(struct memelfnote *en)
1223{
1224 int sz;
1225
1226 sz = sizeof(struct elf_note);
1227 sz += roundup(strlen(en->name) + 1, 4);
1228 sz += roundup(en->datasz, 4);
1229
1230 return sz;
1231}
1232
1233/* #define DEBUG */
1234
1235#define DUMP_WRITE(addr, nr) \
1236 do { if (!dump_write(file, (addr), (nr))) return 0; } while(0)
1237#define DUMP_SEEK(off) \
1238 do { if (!dump_seek(file, (off))) return 0; } while(0)
1239
1240static int writenote(struct memelfnote *men, struct file *file)
1241{
1242 struct elf_note en;
1243
1244 en.n_namesz = strlen(men->name) + 1;
1245 en.n_descsz = men->datasz;
1246 en.n_type = men->type;
1247
1248 DUMP_WRITE(&en, sizeof(en));
1249 DUMP_WRITE(men->name, en.n_namesz);
1250 /* XXX - cast from long long to long to avoid need for libgcc.a */
1251 DUMP_SEEK(roundup((unsigned long)file->f_pos, 4)); /* XXX */
1252 DUMP_WRITE(men->data, men->datasz);
1253 DUMP_SEEK(roundup((unsigned long)file->f_pos, 4)); /* XXX */
1254
1255 return 1;
1256}
1257#undef DUMP_WRITE
1258#undef DUMP_SEEK
1259
1260#define DUMP_WRITE(addr, nr) \
1261 if ((size += (nr)) > limit || !dump_write(file, (addr), (nr))) \
1262 goto end_coredump;
1263#define DUMP_SEEK(off) \
1264 if (!dump_seek(file, (off))) \
1265 goto end_coredump;
1266
1267static inline void fill_elf_fdpic_header(struct elfhdr *elf, int segs)
1268{
1269 memcpy(elf->e_ident, ELFMAG, SELFMAG);
1270 elf->e_ident[EI_CLASS] = ELF_CLASS;
1271 elf->e_ident[EI_DATA] = ELF_DATA;
1272 elf->e_ident[EI_VERSION] = EV_CURRENT;
1273 elf->e_ident[EI_OSABI] = ELF_OSABI;
1274 memset(elf->e_ident+EI_PAD, 0, EI_NIDENT-EI_PAD);
1275
1276 elf->e_type = ET_CORE;
1277 elf->e_machine = ELF_ARCH;
1278 elf->e_version = EV_CURRENT;
1279 elf->e_entry = 0;
1280 elf->e_phoff = sizeof(struct elfhdr);
1281 elf->e_shoff = 0;
1282 elf->e_flags = ELF_FDPIC_CORE_EFLAGS;
1283 elf->e_ehsize = sizeof(struct elfhdr);
1284 elf->e_phentsize = sizeof(struct elf_phdr);
1285 elf->e_phnum = segs;
1286 elf->e_shentsize = 0;
1287 elf->e_shnum = 0;
1288 elf->e_shstrndx = 0;
1289 return;
1290}
1291
1292static inline void fill_elf_note_phdr(struct elf_phdr *phdr, int sz, loff_t offset)
1293{
1294 phdr->p_type = PT_NOTE;
1295 phdr->p_offset = offset;
1296 phdr->p_vaddr = 0;
1297 phdr->p_paddr = 0;
1298 phdr->p_filesz = sz;
1299 phdr->p_memsz = 0;
1300 phdr->p_flags = 0;
1301 phdr->p_align = 0;
1302 return;
1303}
1304
1305static inline void fill_note(struct memelfnote *note, const char *name, int type,
1306 unsigned int sz, void *data)
1307{
1308 note->name = name;
1309 note->type = type;
1310 note->datasz = sz;
1311 note->data = data;
1312 return;
1313}
1314
1315/*
1316 * fill up all the fields in prstatus from the given task struct, except
1317 * registers which need to be filled up seperately.
1318 */
1319static void fill_prstatus(struct elf_prstatus *prstatus,
1320 struct task_struct *p, long signr)
1321{
1322 prstatus->pr_info.si_signo = prstatus->pr_cursig = signr;
1323 prstatus->pr_sigpend = p->pending.signal.sig[0];
1324 prstatus->pr_sighold = p->blocked.sig[0];
1325 prstatus->pr_pid = p->pid;
1326 prstatus->pr_ppid = p->parent->pid;
1327 prstatus->pr_pgrp = process_group(p);
1328 prstatus->pr_sid = p->signal->session;
1329 if (thread_group_leader(p)) {
1330 /*
1331 * This is the record for the group leader. Add in the
1332 * cumulative times of previous dead threads. This total
1333 * won't include the time of each live thread whose state
1334 * is included in the core dump. The final total reported
1335 * to our parent process when it calls wait4 will include
1336 * those sums as well as the little bit more time it takes
1337 * this and each other thread to finish dying after the
1338 * core dump synchronization phase.
1339 */
1340 cputime_to_timeval(cputime_add(p->utime, p->signal->utime),
1341 &prstatus->pr_utime);
1342 cputime_to_timeval(cputime_add(p->stime, p->signal->stime),
1343 &prstatus->pr_stime);
1344 } else {
1345 cputime_to_timeval(p->utime, &prstatus->pr_utime);
1346 cputime_to_timeval(p->stime, &prstatus->pr_stime);
1347 }
1348 cputime_to_timeval(p->signal->cutime, &prstatus->pr_cutime);
1349 cputime_to_timeval(p->signal->cstime, &prstatus->pr_cstime);
1350
1351 prstatus->pr_exec_fdpic_loadmap = p->mm->context.exec_fdpic_loadmap;
1352 prstatus->pr_interp_fdpic_loadmap = p->mm->context.interp_fdpic_loadmap;
1353}
1354
1355static int fill_psinfo(struct elf_prpsinfo *psinfo, struct task_struct *p,
1356 struct mm_struct *mm)
1357{
1358 unsigned int i, len;
1359
1360 /* first copy the parameters from user space */
1361 memset(psinfo, 0, sizeof(struct elf_prpsinfo));
1362
1363 len = mm->arg_end - mm->arg_start;
1364 if (len >= ELF_PRARGSZ)
1365 len = ELF_PRARGSZ - 1;
1366 if (copy_from_user(&psinfo->pr_psargs,
1367 (const char __user *) mm->arg_start, len))
1368 return -EFAULT;
1369 for (i = 0; i < len; i++)
1370 if (psinfo->pr_psargs[i] == 0)
1371 psinfo->pr_psargs[i] = ' ';
1372 psinfo->pr_psargs[len] = 0;
1373
1374 psinfo->pr_pid = p->pid;
1375 psinfo->pr_ppid = p->parent->pid;
1376 psinfo->pr_pgrp = process_group(p);
1377 psinfo->pr_sid = p->signal->session;
1378
1379 i = p->state ? ffz(~p->state) + 1 : 0;
1380 psinfo->pr_state = i;
1381 psinfo->pr_sname = (i > 5) ? '.' : "RSDTZW"[i];
1382 psinfo->pr_zomb = psinfo->pr_sname == 'Z';
1383 psinfo->pr_nice = task_nice(p);
1384 psinfo->pr_flag = p->flags;
1385 SET_UID(psinfo->pr_uid, p->uid);
1386 SET_GID(psinfo->pr_gid, p->gid);
1387 strncpy(psinfo->pr_fname, p->comm, sizeof(psinfo->pr_fname));
1388
1389 return 0;
1390}
1391
1392/* Here is the structure in which status of each thread is captured. */
1393struct elf_thread_status
1394{
1395 struct list_head list;
1396 struct elf_prstatus prstatus; /* NT_PRSTATUS */
1397 elf_fpregset_t fpu; /* NT_PRFPREG */
1398 struct task_struct *thread;
1399#ifdef ELF_CORE_COPY_XFPREGS
1400 elf_fpxregset_t xfpu; /* NT_PRXFPREG */
1401#endif
1402 struct memelfnote notes[3];
1403 int num_notes;
1404};
1405
1406/*
1407 * In order to add the specific thread information for the elf file format,
1408 * we need to keep a linked list of every thread's pr_status and then create
1409 * a single section for them in the final core file.
1410 */
1411static int elf_dump_thread_status(long signr, struct elf_thread_status *t)
1412{
1413 struct task_struct *p = t->thread;
1414 int sz = 0;
1415
1416 t->num_notes = 0;
1417
1418 fill_prstatus(&t->prstatus, p, signr);
1419 elf_core_copy_task_regs(p, &t->prstatus.pr_reg);
1420
1421 fill_note(&t->notes[0], "CORE", NT_PRSTATUS, sizeof(t->prstatus),
1422 &t->prstatus);
1423 t->num_notes++;
1424 sz += notesize(&t->notes[0]);
1425
1426 t->prstatus.pr_fpvalid = elf_core_copy_task_fpregs(p, NULL, &t->fpu);
1427 if (t->prstatus.pr_fpvalid) {
1428 fill_note(&t->notes[1], "CORE", NT_PRFPREG, sizeof(t->fpu),
1429 &t->fpu);
1430 t->num_notes++;
1431 sz += notesize(&t->notes[1]);
1432 }
1433
1434#ifdef ELF_CORE_COPY_XFPREGS
1435 if (elf_core_copy_task_xfpregs(p, &t->xfpu)) {
1436 fill_note(&t->notes[2], "LINUX", NT_PRXFPREG, sizeof(t->xfpu),
1437 &t->xfpu);
1438 t->num_notes++;
1439 sz += notesize(&t->notes[2]);
1440 }
1441#endif
1442 return sz;
1443}
1444
1445/*
1446 * dump the segments for an MMU process
1447 */
1448#ifdef CONFIG_MMU
1449static int elf_fdpic_dump_segments(struct file *file, struct mm_struct *mm,
1450 size_t *size, unsigned long *limit)
1451{
1452 struct vm_area_struct *vma;
1453
1454 for (vma = current->mm->mmap; vma; vma = vma->vm_next) {
1455 unsigned long addr;
1456
1457 if (!maydump(vma))
1458 continue;
1459
1460 for (addr = vma->vm_start;
1461 addr < vma->vm_end;
1462 addr += PAGE_SIZE
1463 ) {
1464 struct vm_area_struct *vma;
1465 struct page *page;
1466
1467 if (get_user_pages(current, current->mm, addr, 1, 0, 1,
1468 &page, &vma) <= 0) {
1469 DUMP_SEEK(file->f_pos + PAGE_SIZE);
1470 }
1471 else if (page == ZERO_PAGE(addr)) {
1472 DUMP_SEEK(file->f_pos + PAGE_SIZE);
1473 page_cache_release(page);
1474 }
1475 else {
1476 void *kaddr;
1477
1478 flush_cache_page(vma, addr, page_to_pfn(page));
1479 kaddr = kmap(page);
1480 if ((*size += PAGE_SIZE) > *limit ||
1481 !dump_write(file, kaddr, PAGE_SIZE)
1482 ) {
1483 kunmap(page);
1484 page_cache_release(page);
1485 return -EIO;
1486 }
1487 kunmap(page);
1488 page_cache_release(page);
1489 }
1490 }
1491 }
1492
1493 return 0;
1494
1495end_coredump:
1496 return -EFBIG;
1497}
1498#endif
1499
1500/*
1501 * dump the segments for a NOMMU process
1502 */
1503#ifndef CONFIG_MMU
1504static int elf_fdpic_dump_segments(struct file *file, struct mm_struct *mm,
1505 size_t *size, unsigned long *limit)
1506{
1507 struct vm_list_struct *vml;
1508
1509 for (vml = current->mm->context.vmlist; vml; vml = vml->next) {
1510 struct vm_area_struct *vma = vml->vma;
1511
1512 if (!maydump(vma))
1513 continue;
1514
1515 if ((*size += PAGE_SIZE) > *limit)
1516 return -EFBIG;
1517
1518 if (!dump_write(file, (void *) vma->vm_start,
1519 vma->vm_end - vma->vm_start))
1520 return -EIO;
1521 }
1522
1523 return 0;
1524}
1525#endif
1526
1527/*
1528 * Actual dumper
1529 *
1530 * This is a two-pass process; first we find the offsets of the bits,
1531 * and then they are actually written out. If we run out of core limit
1532 * we just truncate.
1533 */
1534static int elf_fdpic_core_dump(long signr, struct pt_regs *regs,
1535 struct file *file)
1536{
1537#define NUM_NOTES 6
1538 int has_dumped = 0;
1539 mm_segment_t fs;
1540 int segs;
1541 size_t size = 0;
1542 int i;
1543 struct vm_area_struct *vma;
1544 struct elfhdr *elf = NULL;
1545 loff_t offset = 0, dataoff;
1546 unsigned long limit = current->signal->rlim[RLIMIT_CORE].rlim_cur;
1547 int numnote;
1548 struct memelfnote *notes = NULL;
1549 struct elf_prstatus *prstatus = NULL; /* NT_PRSTATUS */
1550 struct elf_prpsinfo *psinfo = NULL; /* NT_PRPSINFO */
1551 struct task_struct *g, *p;
1552 LIST_HEAD(thread_list);
1553 struct list_head *t;
1554 elf_fpregset_t *fpu = NULL;
1555#ifdef ELF_CORE_COPY_XFPREGS
1556 elf_fpxregset_t *xfpu = NULL;
1557#endif
1558 int thread_status_size = 0;
1559#ifndef CONFIG_MMU
1560 struct vm_list_struct *vml;
1561#endif
1562 elf_addr_t *auxv;
1563
1564 /*
1565 * We no longer stop all VM operations.
1566 *
1567 * This is because those proceses that could possibly change map_count
1568 * or the mmap / vma pages are now blocked in do_exit on current
1569 * finishing this core dump.
1570 *
1571 * Only ptrace can touch these memory addresses, but it doesn't change
1572 * the map_count or the pages allocated. So no possibility of crashing
1573 * exists while dumping the mm->vm_next areas to the core file.
1574 */
1575
1576 /* alloc memory for large data structures: too large to be on stack */
1577 elf = kmalloc(sizeof(*elf), GFP_KERNEL);
1578 if (!elf)
1579 goto cleanup;
1580 prstatus = kzalloc(sizeof(*prstatus), GFP_KERNEL);
1581 if (!prstatus)
1582 goto cleanup;
1583 psinfo = kmalloc(sizeof(*psinfo), GFP_KERNEL);
1584 if (!psinfo)
1585 goto cleanup;
1586 notes = kmalloc(NUM_NOTES * sizeof(struct memelfnote), GFP_KERNEL);
1587 if (!notes)
1588 goto cleanup;
1589 fpu = kmalloc(sizeof(*fpu), GFP_KERNEL);
1590 if (!fpu)
1591 goto cleanup;
1592#ifdef ELF_CORE_COPY_XFPREGS
1593 xfpu = kmalloc(sizeof(*xfpu), GFP_KERNEL);
1594 if (!xfpu)
1595 goto cleanup;
1596#endif
1597
1598 if (signr) {
1599 struct elf_thread_status *tmp;
1600 read_lock(&tasklist_lock);
1601 do_each_thread(g,p)
1602 if (current->mm == p->mm && current != p) {
1603 tmp = kzalloc(sizeof(*tmp), GFP_ATOMIC);
1604 if (!tmp) {
1605 read_unlock(&tasklist_lock);
1606 goto cleanup;
1607 }
1608 INIT_LIST_HEAD(&tmp->list);
1609 tmp->thread = p;
1610 list_add(&tmp->list, &thread_list);
1611 }
1612 while_each_thread(g,p);
1613 read_unlock(&tasklist_lock);
1614 list_for_each(t, &thread_list) {
1615 struct elf_thread_status *tmp;
1616 int sz;
1617
1618 tmp = list_entry(t, struct elf_thread_status, list);
1619 sz = elf_dump_thread_status(signr, tmp);
1620 thread_status_size += sz;
1621 }
1622 }
1623
1624 /* now collect the dump for the current */
1625 fill_prstatus(prstatus, current, signr);
1626 elf_core_copy_regs(&prstatus->pr_reg, regs);
1627
1628#ifdef CONFIG_MMU
1629 segs = current->mm->map_count;
1630#else
1631 segs = 0;
1632 for (vml = current->mm->context.vmlist; vml; vml = vml->next)
1633 segs++;
1634#endif
1635#ifdef ELF_CORE_EXTRA_PHDRS
1636 segs += ELF_CORE_EXTRA_PHDRS;
1637#endif
1638
1639 /* Set up header */
1640 fill_elf_fdpic_header(elf, segs + 1); /* including notes section */
1641
1642 has_dumped = 1;
1643 current->flags |= PF_DUMPCORE;
1644
1645 /*
1646 * Set up the notes in similar form to SVR4 core dumps made
1647 * with info from their /proc.
1648 */
1649
1650 fill_note(notes + 0, "CORE", NT_PRSTATUS, sizeof(*prstatus), prstatus);
1651 fill_psinfo(psinfo, current->group_leader, current->mm);
1652 fill_note(notes + 1, "CORE", NT_PRPSINFO, sizeof(*psinfo), psinfo);
1653
1654 numnote = 2;
1655
1656 auxv = (elf_addr_t *) current->mm->saved_auxv;
1657
1658 i = 0;
1659 do
1660 i += 2;
1661 while (auxv[i - 2] != AT_NULL);
1662 fill_note(&notes[numnote++], "CORE", NT_AUXV,
1663 i * sizeof(elf_addr_t), auxv);
1664
1665 /* Try to dump the FPU. */
1666 if ((prstatus->pr_fpvalid =
1667 elf_core_copy_task_fpregs(current, regs, fpu)))
1668 fill_note(notes + numnote++,
1669 "CORE", NT_PRFPREG, sizeof(*fpu), fpu);
1670#ifdef ELF_CORE_COPY_XFPREGS
1671 if (elf_core_copy_task_xfpregs(current, xfpu))
1672 fill_note(notes + numnote++,
1673 "LINUX", NT_PRXFPREG, sizeof(*xfpu), xfpu);
1674#endif
1675
1676 fs = get_fs();
1677 set_fs(KERNEL_DS);
1678
1679 DUMP_WRITE(elf, sizeof(*elf));
1680 offset += sizeof(*elf); /* Elf header */
1681 offset += (segs+1) * sizeof(struct elf_phdr); /* Program headers */
1682
1683 /* Write notes phdr entry */
1684 {
1685 struct elf_phdr phdr;
1686 int sz = 0;
1687
1688 for (i = 0; i < numnote; i++)
1689 sz += notesize(notes + i);
1690
1691 sz += thread_status_size;
1692
1693 fill_elf_note_phdr(&phdr, sz, offset);
1694 offset += sz;
1695 DUMP_WRITE(&phdr, sizeof(phdr));
1696 }
1697
1698 /* Page-align dumped data */
1699 dataoff = offset = roundup(offset, ELF_EXEC_PAGESIZE);
1700
1701 /* write program headers for segments dump */
1702 for (
1703#ifdef CONFIG_MMU
1704 vma = current->mm->mmap; vma; vma = vma->vm_next
1705#else
1706 vml = current->mm->context.vmlist; vml; vml = vml->next
1707#endif
1708 ) {
1709 struct elf_phdr phdr;
1710 size_t sz;
1711
1712#ifndef CONFIG_MMU
1713 vma = vml->vma;
1714#endif
1715
1716 sz = vma->vm_end - vma->vm_start;
1717
1718 phdr.p_type = PT_LOAD;
1719 phdr.p_offset = offset;
1720 phdr.p_vaddr = vma->vm_start;
1721 phdr.p_paddr = 0;
1722 phdr.p_filesz = maydump(vma) ? sz : 0;
1723 phdr.p_memsz = sz;
1724 offset += phdr.p_filesz;
1725 phdr.p_flags = vma->vm_flags & VM_READ ? PF_R : 0;
1726 if (vma->vm_flags & VM_WRITE)
1727 phdr.p_flags |= PF_W;
1728 if (vma->vm_flags & VM_EXEC)
1729 phdr.p_flags |= PF_X;
1730 phdr.p_align = ELF_EXEC_PAGESIZE;
1731
1732 DUMP_WRITE(&phdr, sizeof(phdr));
1733 }
1734
1735#ifdef ELF_CORE_WRITE_EXTRA_PHDRS
1736 ELF_CORE_WRITE_EXTRA_PHDRS;
1737#endif
1738
1739 /* write out the notes section */
1740 for (i = 0; i < numnote; i++)
1741 if (!writenote(notes + i, file))
1742 goto end_coredump;
1743
1744 /* write out the thread status notes section */
1745 list_for_each(t, &thread_list) {
1746 struct elf_thread_status *tmp =
1747 list_entry(t, struct elf_thread_status, list);
1748
1749 for (i = 0; i < tmp->num_notes; i++)
1750 if (!writenote(&tmp->notes[i], file))
1751 goto end_coredump;
1752 }
1753
1754 DUMP_SEEK(dataoff);
1755
1756 if (elf_fdpic_dump_segments(file, current->mm, &size, &limit) < 0)
1757 goto end_coredump;
1758
1759#ifdef ELF_CORE_WRITE_EXTRA_DATA
1760 ELF_CORE_WRITE_EXTRA_DATA;
1761#endif
1762
1763 if (file->f_pos != offset) {
1764 /* Sanity check */
1765 printk(KERN_WARNING
1766 "elf_core_dump: file->f_pos (%lld) != offset (%lld)\n",
1767 file->f_pos, offset);
1768 }
1769
1770end_coredump:
1771 set_fs(fs);
1772
1773cleanup:
1774 while (!list_empty(&thread_list)) {
1775 struct list_head *tmp = thread_list.next;
1776 list_del(tmp);
1777 kfree(list_entry(tmp, struct elf_thread_status, list));
1778 }
1779
1780 kfree(elf);
1781 kfree(prstatus);
1782 kfree(psinfo);
1783 kfree(notes);
1784 kfree(fpu);
1785#ifdef ELF_CORE_COPY_XFPREGS
1786 kfree(xfpu);
1787#endif
1788 return has_dumped;
1789#undef NUM_NOTES
1790}
1791
1792#endif /* USE_ELF_CORE_DUMP */
diff --git a/fs/buffer.c b/fs/buffer.c
index 3660dcb97591..71649ef9b658 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -470,13 +470,18 @@ out:
470 pass does the actual I/O. */ 470 pass does the actual I/O. */
471void invalidate_bdev(struct block_device *bdev, int destroy_dirty_buffers) 471void invalidate_bdev(struct block_device *bdev, int destroy_dirty_buffers)
472{ 472{
473 struct address_space *mapping = bdev->bd_inode->i_mapping;
474
475 if (mapping->nrpages == 0)
476 return;
477
473 invalidate_bh_lrus(); 478 invalidate_bh_lrus();
474 /* 479 /*
475 * FIXME: what about destroy_dirty_buffers? 480 * FIXME: what about destroy_dirty_buffers?
476 * We really want to use invalidate_inode_pages2() for 481 * We really want to use invalidate_inode_pages2() for
477 * that, but not until that's cleaned up. 482 * that, but not until that's cleaned up.
478 */ 483 */
479 invalidate_inode_pages(bdev->bd_inode->i_mapping); 484 invalidate_inode_pages(mapping);
480} 485}
481 486
482/* 487/*
diff --git a/fs/char_dev.c b/fs/char_dev.c
index a4cbc6706ef0..3483d3cf8087 100644
--- a/fs/char_dev.c
+++ b/fs/char_dev.c
@@ -182,6 +182,28 @@ int alloc_chrdev_region(dev_t *dev, unsigned baseminor, unsigned count,
182 return 0; 182 return 0;
183} 183}
184 184
185/**
186 * register_chrdev() - Register a major number for character devices.
187 * @major: major device number or 0 for dynamic allocation
188 * @name: name of this range of devices
189 * @fops: file operations associated with this devices
190 *
191 * If @major == 0 this functions will dynamically allocate a major and return
192 * its number.
193 *
194 * If @major > 0 this function will attempt to reserve a device with the given
195 * major number and will return zero on success.
196 *
197 * Returns a -ve errno on failure.
198 *
199 * The name of this device has nothing to do with the name of the device in
200 * /dev. It only helps to keep track of the different owners of devices. If
201 * your module name has only one type of devices it's ok to use e.g. the name
202 * of the module here.
203 *
204 * This function registers a range of 256 minor numbers. The first minor number
205 * is 0.
206 */
185int register_chrdev(unsigned int major, const char *name, 207int register_chrdev(unsigned int major, const char *name,
186 const struct file_operations *fops) 208 const struct file_operations *fops)
187{ 209{
diff --git a/fs/coda/file.c b/fs/coda/file.c
index cc66c681bd11..dbfbcfa5b3c0 100644
--- a/fs/coda/file.c
+++ b/fs/coda/file.c
@@ -136,10 +136,8 @@ int coda_open(struct inode *coda_inode, struct file *coda_file)
136 coda_vfs_stat.open++; 136 coda_vfs_stat.open++;
137 137
138 cfi = kmalloc(sizeof(struct coda_file_info), GFP_KERNEL); 138 cfi = kmalloc(sizeof(struct coda_file_info), GFP_KERNEL);
139 if (!cfi) { 139 if (!cfi)
140 unlock_kernel();
141 return -ENOMEM; 140 return -ENOMEM;
142 }
143 141
144 lock_kernel(); 142 lock_kernel();
145 143
diff --git a/fs/efs/symlink.c b/fs/efs/symlink.c
index e249cf733a6b..1d30d2ff440f 100644
--- a/fs/efs/symlink.c
+++ b/fs/efs/symlink.c
@@ -22,7 +22,7 @@ static int efs_symlink_readpage(struct file *file, struct page *page)
22 22
23 err = -ENAMETOOLONG; 23 err = -ENAMETOOLONG;
24 if (size > 2 * EFS_BLOCKSIZE) 24 if (size > 2 * EFS_BLOCKSIZE)
25 goto fail; 25 goto fail_notlocked;
26 26
27 lock_kernel(); 27 lock_kernel();
28 /* read first 512 bytes of link target */ 28 /* read first 512 bytes of link target */
@@ -47,6 +47,7 @@ static int efs_symlink_readpage(struct file *file, struct page *page)
47 return 0; 47 return 0;
48fail: 48fail:
49 unlock_kernel(); 49 unlock_kernel();
50fail_notlocked:
50 SetPageError(page); 51 SetPageError(page);
51 kunmap(page); 52 kunmap(page);
52 unlock_page(page); 53 unlock_page(page);
diff --git a/fs/ext3/acl.h b/fs/ext3/acl.h
index 92d50b53a933..0d1e6279cbfd 100644
--- a/fs/ext3/acl.h
+++ b/fs/ext3/acl.h
@@ -62,9 +62,6 @@ extern int ext3_permission (struct inode *, int, struct nameidata *);
62extern int ext3_acl_chmod (struct inode *); 62extern int ext3_acl_chmod (struct inode *);
63extern int ext3_init_acl (handle_t *, struct inode *, struct inode *); 63extern int ext3_init_acl (handle_t *, struct inode *, struct inode *);
64 64
65extern int init_ext3_acl(void);
66extern void exit_ext3_acl(void);
67
68#else /* CONFIG_EXT3_FS_POSIX_ACL */ 65#else /* CONFIG_EXT3_FS_POSIX_ACL */
69#include <linux/sched.h> 66#include <linux/sched.h>
70#define ext3_permission NULL 67#define ext3_permission NULL
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
index f804d5e9d60c..c5ee9f0691e3 100644
--- a/fs/ext3/inode.c
+++ b/fs/ext3/inode.c
@@ -1158,7 +1158,7 @@ retry:
1158 ret = PTR_ERR(handle); 1158 ret = PTR_ERR(handle);
1159 goto out; 1159 goto out;
1160 } 1160 }
1161 if (test_opt(inode->i_sb, NOBH)) 1161 if (test_opt(inode->i_sb, NOBH) && ext3_should_writeback_data(inode))
1162 ret = nobh_prepare_write(page, from, to, ext3_get_block); 1162 ret = nobh_prepare_write(page, from, to, ext3_get_block);
1163 else 1163 else
1164 ret = block_prepare_write(page, from, to, ext3_get_block); 1164 ret = block_prepare_write(page, from, to, ext3_get_block);
@@ -1244,7 +1244,7 @@ static int ext3_writeback_commit_write(struct file *file, struct page *page,
1244 if (new_i_size > EXT3_I(inode)->i_disksize) 1244 if (new_i_size > EXT3_I(inode)->i_disksize)
1245 EXT3_I(inode)->i_disksize = new_i_size; 1245 EXT3_I(inode)->i_disksize = new_i_size;
1246 1246
1247 if (test_opt(inode->i_sb, NOBH)) 1247 if (test_opt(inode->i_sb, NOBH) && ext3_should_writeback_data(inode))
1248 ret = nobh_commit_write(file, page, from, to); 1248 ret = nobh_commit_write(file, page, from, to);
1249 else 1249 else
1250 ret = generic_commit_write(file, page, from, to); 1250 ret = generic_commit_write(file, page, from, to);
@@ -1494,7 +1494,7 @@ static int ext3_writeback_writepage(struct page *page,
1494 goto out_fail; 1494 goto out_fail;
1495 } 1495 }
1496 1496
1497 if (test_opt(inode->i_sb, NOBH)) 1497 if (test_opt(inode->i_sb, NOBH) && ext3_should_writeback_data(inode))
1498 ret = nobh_writepage(page, ext3_get_block, wbc); 1498 ret = nobh_writepage(page, ext3_get_block, wbc);
1499 else 1499 else
1500 ret = block_write_full_page(page, ext3_get_block, wbc); 1500 ret = block_write_full_page(page, ext3_get_block, wbc);
@@ -2402,14 +2402,15 @@ static ext3_fsblk_t ext3_get_inode_block(struct super_block *sb,
2402 struct buffer_head *bh; 2402 struct buffer_head *bh;
2403 struct ext3_group_desc * gdp; 2403 struct ext3_group_desc * gdp;
2404 2404
2405 2405 if (!ext3_valid_inum(sb, ino)) {
2406 if ((ino != EXT3_ROOT_INO && ino != EXT3_JOURNAL_INO && 2406 /*
2407 ino != EXT3_RESIZE_INO && ino < EXT3_FIRST_INO(sb)) || 2407 * This error is already checked for in namei.c unless we are
2408 ino > le32_to_cpu(EXT3_SB(sb)->s_es->s_inodes_count)) { 2408 * looking at an NFS filehandle, in which case no error
2409 ext3_error(sb, "ext3_get_inode_block", 2409 * report is needed
2410 "bad inode number: %lu", ino); 2410 */
2411 return 0; 2411 return 0;
2412 } 2412 }
2413
2413 block_group = (ino - 1) / EXT3_INODES_PER_GROUP(sb); 2414 block_group = (ino - 1) / EXT3_INODES_PER_GROUP(sb);
2414 if (block_group >= EXT3_SB(sb)->s_groups_count) { 2415 if (block_group >= EXT3_SB(sb)->s_groups_count) {
2415 ext3_error(sb,"ext3_get_inode_block","group >= groups count"); 2416 ext3_error(sb,"ext3_get_inode_block","group >= groups count");
diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c
index d9176dba3698..2aa7101b27cd 100644
--- a/fs/ext3/namei.c
+++ b/fs/ext3/namei.c
@@ -1000,7 +1000,12 @@ static struct dentry *ext3_lookup(struct inode * dir, struct dentry *dentry, str
1000 if (bh) { 1000 if (bh) {
1001 unsigned long ino = le32_to_cpu(de->inode); 1001 unsigned long ino = le32_to_cpu(de->inode);
1002 brelse (bh); 1002 brelse (bh);
1003 inode = iget(dir->i_sb, ino); 1003 if (!ext3_valid_inum(dir->i_sb, ino)) {
1004 ext3_error(dir->i_sb, "ext3_lookup",
1005 "bad inode number: %lu", ino);
1006 inode = NULL;
1007 } else
1008 inode = iget(dir->i_sb, ino);
1004 1009
1005 if (!inode) 1010 if (!inode)
1006 return ERR_PTR(-EACCES); 1011 return ERR_PTR(-EACCES);
@@ -1028,7 +1033,13 @@ struct dentry *ext3_get_parent(struct dentry *child)
1028 return ERR_PTR(-ENOENT); 1033 return ERR_PTR(-ENOENT);
1029 ino = le32_to_cpu(de->inode); 1034 ino = le32_to_cpu(de->inode);
1030 brelse(bh); 1035 brelse(bh);
1031 inode = iget(child->d_inode->i_sb, ino); 1036
1037 if (!ext3_valid_inum(child->d_inode->i_sb, ino)) {
1038 ext3_error(child->d_inode->i_sb, "ext3_get_parent",
1039 "bad inode number: %lu", ino);
1040 inode = NULL;
1041 } else
1042 inode = iget(child->d_inode->i_sb, ino);
1032 1043
1033 if (!inode) 1044 if (!inode)
1034 return ERR_PTR(-EACCES); 1045 return ERR_PTR(-EACCES);
diff --git a/fs/file.c b/fs/file.c
index 55f4e7022563..b3c6b82e6a9d 100644
--- a/fs/file.c
+++ b/fs/file.c
@@ -240,13 +240,9 @@ static struct fdtable *alloc_fdtable(int nr)
240 if (!fdt) 240 if (!fdt)
241 goto out; 241 goto out;
242 242
243 nfds = 8 * L1_CACHE_BYTES; 243 nfds = max_t(int, 8 * L1_CACHE_BYTES, roundup_pow_of_two(nr + 1));
244 /* Expand to the max in easy steps */ 244 if (nfds > NR_OPEN)
245 while (nfds <= nr) { 245 nfds = NR_OPEN;
246 nfds = nfds * 2;
247 if (nfds > NR_OPEN)
248 nfds = NR_OPEN;
249 }
250 246
251 new_openset = alloc_fdset(nfds); 247 new_openset = alloc_fdset(nfds);
252 new_execset = alloc_fdset(nfds); 248 new_execset = alloc_fdset(nfds);
@@ -277,11 +273,13 @@ static struct fdtable *alloc_fdtable(int nr)
277 } while (nfds <= nr); 273 } while (nfds <= nr);
278 new_fds = alloc_fd_array(nfds); 274 new_fds = alloc_fd_array(nfds);
279 if (!new_fds) 275 if (!new_fds)
280 goto out; 276 goto out2;
281 fdt->fd = new_fds; 277 fdt->fd = new_fds;
282 fdt->max_fds = nfds; 278 fdt->max_fds = nfds;
283 fdt->free_files = NULL; 279 fdt->free_files = NULL;
284 return fdt; 280 return fdt;
281out2:
282 nfds = fdt->max_fdset;
285out: 283out:
286 if (new_openset) 284 if (new_openset)
287 free_fdset(new_openset, nfds); 285 free_fdset(new_openset, nfds);
diff --git a/fs/freevxfs/vxfs_lookup.c b/fs/freevxfs/vxfs_lookup.c
index 29cce456c7ce..43886fa00a2a 100644
--- a/fs/freevxfs/vxfs_lookup.c
+++ b/fs/freevxfs/vxfs_lookup.c
@@ -246,6 +246,8 @@ vxfs_readdir(struct file *fp, void *retp, filldir_t filler)
246 u_long page, npages, block, pblocks, nblocks, offset; 246 u_long page, npages, block, pblocks, nblocks, offset;
247 loff_t pos; 247 loff_t pos;
248 248
249 lock_kernel();
250
249 switch ((long)fp->f_pos) { 251 switch ((long)fp->f_pos) {
250 case 0: 252 case 0:
251 if (filler(retp, ".", 1, fp->f_pos, ip->i_ino, DT_DIR) < 0) 253 if (filler(retp, ".", 1, fp->f_pos, ip->i_ino, DT_DIR) < 0)
diff --git a/fs/fuse/control.c b/fs/fuse/control.c
index a3bce3a77253..46fe60b2da23 100644
--- a/fs/fuse/control.c
+++ b/fs/fuse/control.c
@@ -105,7 +105,7 @@ static struct dentry *fuse_ctl_add_dentry(struct dentry *parent,
105 105
106/* 106/*
107 * Add a connection to the control filesystem (if it exists). Caller 107 * Add a connection to the control filesystem (if it exists). Caller
108 * must host fuse_mutex 108 * must hold fuse_mutex
109 */ 109 */
110int fuse_ctl_add_conn(struct fuse_conn *fc) 110int fuse_ctl_add_conn(struct fuse_conn *fc)
111{ 111{
@@ -139,7 +139,7 @@ int fuse_ctl_add_conn(struct fuse_conn *fc)
139 139
140/* 140/*
141 * Remove a connection from the control filesystem (if it exists). 141 * Remove a connection from the control filesystem (if it exists).
142 * Caller must host fuse_mutex 142 * Caller must hold fuse_mutex
143 */ 143 */
144void fuse_ctl_remove_conn(struct fuse_conn *fc) 144void fuse_ctl_remove_conn(struct fuse_conn *fc)
145{ 145{
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index 72a74cde6de8..409ce6a7cca4 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -14,6 +14,33 @@
14#include <linux/sched.h> 14#include <linux/sched.h>
15#include <linux/namei.h> 15#include <linux/namei.h>
16 16
17#if BITS_PER_LONG >= 64
18static inline void fuse_dentry_settime(struct dentry *entry, u64 time)
19{
20 entry->d_time = time;
21}
22
23static inline u64 fuse_dentry_time(struct dentry *entry)
24{
25 return entry->d_time;
26}
27#else
28/*
29 * On 32 bit archs store the high 32 bits of time in d_fsdata
30 */
31static void fuse_dentry_settime(struct dentry *entry, u64 time)
32{
33 entry->d_time = time;
34 entry->d_fsdata = (void *) (unsigned long) (time >> 32);
35}
36
37static u64 fuse_dentry_time(struct dentry *entry)
38{
39 return (u64) entry->d_time +
40 ((u64) (unsigned long) entry->d_fsdata << 32);
41}
42#endif
43
17/* 44/*
18 * FUSE caches dentries and attributes with separate timeout. The 45 * FUSE caches dentries and attributes with separate timeout. The
19 * time in jiffies until the dentry/attributes are valid is stored in 46 * time in jiffies until the dentry/attributes are valid is stored in
@@ -23,10 +50,13 @@
23/* 50/*
24 * Calculate the time in jiffies until a dentry/attributes are valid 51 * Calculate the time in jiffies until a dentry/attributes are valid
25 */ 52 */
26static unsigned long time_to_jiffies(unsigned long sec, unsigned long nsec) 53static u64 time_to_jiffies(unsigned long sec, unsigned long nsec)
27{ 54{
28 struct timespec ts = {sec, nsec}; 55 if (sec || nsec) {
29 return jiffies + timespec_to_jiffies(&ts); 56 struct timespec ts = {sec, nsec};
57 return get_jiffies_64() + timespec_to_jiffies(&ts);
58 } else
59 return 0;
30} 60}
31 61
32/* 62/*
@@ -35,7 +65,8 @@ static unsigned long time_to_jiffies(unsigned long sec, unsigned long nsec)
35 */ 65 */
36static void fuse_change_timeout(struct dentry *entry, struct fuse_entry_out *o) 66static void fuse_change_timeout(struct dentry *entry, struct fuse_entry_out *o)
37{ 67{
38 entry->d_time = time_to_jiffies(o->entry_valid, o->entry_valid_nsec); 68 fuse_dentry_settime(entry,
69 time_to_jiffies(o->entry_valid, o->entry_valid_nsec));
39 if (entry->d_inode) 70 if (entry->d_inode)
40 get_fuse_inode(entry->d_inode)->i_time = 71 get_fuse_inode(entry->d_inode)->i_time =
41 time_to_jiffies(o->attr_valid, o->attr_valid_nsec); 72 time_to_jiffies(o->attr_valid, o->attr_valid_nsec);
@@ -47,7 +78,7 @@ static void fuse_change_timeout(struct dentry *entry, struct fuse_entry_out *o)
47 */ 78 */
48void fuse_invalidate_attr(struct inode *inode) 79void fuse_invalidate_attr(struct inode *inode)
49{ 80{
50 get_fuse_inode(inode)->i_time = jiffies - 1; 81 get_fuse_inode(inode)->i_time = 0;
51} 82}
52 83
53/* 84/*
@@ -60,7 +91,7 @@ void fuse_invalidate_attr(struct inode *inode)
60 */ 91 */
61static void fuse_invalidate_entry_cache(struct dentry *entry) 92static void fuse_invalidate_entry_cache(struct dentry *entry)
62{ 93{
63 entry->d_time = jiffies - 1; 94 fuse_dentry_settime(entry, 0);
64} 95}
65 96
66/* 97/*
@@ -102,7 +133,7 @@ static int fuse_dentry_revalidate(struct dentry *entry, struct nameidata *nd)
102 133
103 if (inode && is_bad_inode(inode)) 134 if (inode && is_bad_inode(inode))
104 return 0; 135 return 0;
105 else if (time_after(jiffies, entry->d_time)) { 136 else if (fuse_dentry_time(entry) < get_jiffies_64()) {
106 int err; 137 int err;
107 struct fuse_entry_out outarg; 138 struct fuse_entry_out outarg;
108 struct fuse_conn *fc; 139 struct fuse_conn *fc;
@@ -666,7 +697,7 @@ static int fuse_revalidate(struct dentry *entry)
666 if (!fuse_allow_task(fc, current)) 697 if (!fuse_allow_task(fc, current))
667 return -EACCES; 698 return -EACCES;
668 if (get_node_id(inode) != FUSE_ROOT_ID && 699 if (get_node_id(inode) != FUSE_ROOT_ID &&
669 time_before_eq(jiffies, fi->i_time)) 700 fi->i_time >= get_jiffies_64())
670 return 0; 701 return 0;
671 702
672 return fuse_do_getattr(inode); 703 return fuse_do_getattr(inode);
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h
index 0dbf96621841..69c7750d55b8 100644
--- a/fs/fuse/fuse_i.h
+++ b/fs/fuse/fuse_i.h
@@ -59,7 +59,7 @@ struct fuse_inode {
59 struct fuse_req *forget_req; 59 struct fuse_req *forget_req;
60 60
61 /** Time in jiffies until the file attributes are valid */ 61 /** Time in jiffies until the file attributes are valid */
62 unsigned long i_time; 62 u64 i_time;
63}; 63};
64 64
65/** FUSE specific file data */ 65/** FUSE specific file data */
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index dcaaabd3b9c4..7d25092262ae 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -51,7 +51,7 @@ static struct inode *fuse_alloc_inode(struct super_block *sb)
51 return NULL; 51 return NULL;
52 52
53 fi = get_fuse_inode(inode); 53 fi = get_fuse_inode(inode);
54 fi->i_time = jiffies - 1; 54 fi->i_time = 0;
55 fi->nodeid = 0; 55 fi->nodeid = 0;
56 fi->nlookup = 0; 56 fi->nlookup = 0;
57 fi->forget_req = fuse_request_alloc(); 57 fi->forget_req = fuse_request_alloc();
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index 6449cb697967..c3920c96dadf 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -83,8 +83,6 @@ static int hugetlbfs_file_mmap(struct file *file, struct vm_area_struct *vma)
83 83
84 ret = -ENOMEM; 84 ret = -ENOMEM;
85 len = vma_len + ((loff_t)vma->vm_pgoff << PAGE_SHIFT); 85 len = vma_len + ((loff_t)vma->vm_pgoff << PAGE_SHIFT);
86 if (!(vma->vm_flags & VM_WRITE) && len > inode->i_size)
87 goto out;
88 86
89 if (vma->vm_flags & VM_MAYSHARE && 87 if (vma->vm_flags & VM_MAYSHARE &&
90 hugetlb_reserve_pages(inode, vma->vm_pgoff >> (HPAGE_SHIFT-PAGE_SHIFT), 88 hugetlb_reserve_pages(inode, vma->vm_pgoff >> (HPAGE_SHIFT-PAGE_SHIFT),
@@ -93,7 +91,7 @@ static int hugetlbfs_file_mmap(struct file *file, struct vm_area_struct *vma)
93 91
94 ret = 0; 92 ret = 0;
95 hugetlb_prefault_arch_hook(vma->vm_mm); 93 hugetlb_prefault_arch_hook(vma->vm_mm);
96 if (inode->i_size < len) 94 if (vma->vm_flags & VM_WRITE && inode->i_size < len)
97 inode->i_size = len; 95 inode->i_size = len;
98out: 96out:
99 mutex_unlock(&inode->i_mutex); 97 mutex_unlock(&inode->i_mutex);
diff --git a/fs/inotify_user.c b/fs/inotify_user.c
index f2386442adee..017cb0f134d6 100644
--- a/fs/inotify_user.c
+++ b/fs/inotify_user.c
@@ -187,7 +187,7 @@ static struct inotify_kernel_event * kernel_event(s32 wd, u32 mask, u32 cookie,
187{ 187{
188 struct inotify_kernel_event *kevent; 188 struct inotify_kernel_event *kevent;
189 189
190 kevent = kmem_cache_alloc(event_cachep, GFP_KERNEL); 190 kevent = kmem_cache_alloc(event_cachep, GFP_NOFS);
191 if (unlikely(!kevent)) 191 if (unlikely(!kevent))
192 return NULL; 192 return NULL;
193 193
diff --git a/fs/jfs/jfs_txnmgr.c b/fs/jfs/jfs_txnmgr.c
index 10c46231ce15..efbb586bed4b 100644
--- a/fs/jfs/jfs_txnmgr.c
+++ b/fs/jfs/jfs_txnmgr.c
@@ -2944,7 +2944,7 @@ int jfs_sync(void *arg)
2944 * Inode is being freed 2944 * Inode is being freed
2945 */ 2945 */
2946 list_del_init(&jfs_ip->anon_inode_list); 2946 list_del_init(&jfs_ip->anon_inode_list);
2947 } else if (! !mutex_trylock(&jfs_ip->commit_mutex)) { 2947 } else if (mutex_trylock(&jfs_ip->commit_mutex)) {
2948 /* 2948 /*
2949 * inode will be removed from anonymous list 2949 * inode will be removed from anonymous list
2950 * when it is committed 2950 * when it is committed
diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c
index 09ea03f62277..295268ad231b 100644
--- a/fs/jfs/namei.c
+++ b/fs/jfs/namei.c
@@ -165,8 +165,8 @@ static int jfs_create(struct inode *dip, struct dentry *dentry, int mode,
165 165
166 out3: 166 out3:
167 txEnd(tid); 167 txEnd(tid);
168 mutex_unlock(&JFS_IP(dip)->commit_mutex);
169 mutex_unlock(&JFS_IP(ip)->commit_mutex); 168 mutex_unlock(&JFS_IP(ip)->commit_mutex);
169 mutex_unlock(&JFS_IP(dip)->commit_mutex);
170 if (rc) { 170 if (rc) {
171 free_ea_wmap(ip); 171 free_ea_wmap(ip);
172 ip->i_nlink = 0; 172 ip->i_nlink = 0;
@@ -300,8 +300,8 @@ static int jfs_mkdir(struct inode *dip, struct dentry *dentry, int mode)
300 300
301 out3: 301 out3:
302 txEnd(tid); 302 txEnd(tid);
303 mutex_unlock(&JFS_IP(dip)->commit_mutex);
304 mutex_unlock(&JFS_IP(ip)->commit_mutex); 303 mutex_unlock(&JFS_IP(ip)->commit_mutex);
304 mutex_unlock(&JFS_IP(dip)->commit_mutex);
305 if (rc) { 305 if (rc) {
306 free_ea_wmap(ip); 306 free_ea_wmap(ip);
307 ip->i_nlink = 0; 307 ip->i_nlink = 0;
@@ -384,8 +384,8 @@ static int jfs_rmdir(struct inode *dip, struct dentry *dentry)
384 if (rc == -EIO) 384 if (rc == -EIO)
385 txAbort(tid, 1); 385 txAbort(tid, 1);
386 txEnd(tid); 386 txEnd(tid);
387 mutex_unlock(&JFS_IP(dip)->commit_mutex);
388 mutex_unlock(&JFS_IP(ip)->commit_mutex); 387 mutex_unlock(&JFS_IP(ip)->commit_mutex);
388 mutex_unlock(&JFS_IP(dip)->commit_mutex);
389 389
390 goto out2; 390 goto out2;
391 } 391 }
@@ -422,8 +422,8 @@ static int jfs_rmdir(struct inode *dip, struct dentry *dentry)
422 422
423 txEnd(tid); 423 txEnd(tid);
424 424
425 mutex_unlock(&JFS_IP(dip)->commit_mutex);
426 mutex_unlock(&JFS_IP(ip)->commit_mutex); 425 mutex_unlock(&JFS_IP(ip)->commit_mutex);
426 mutex_unlock(&JFS_IP(dip)->commit_mutex);
427 427
428 /* 428 /*
429 * Truncating the directory index table is not guaranteed. It 429 * Truncating the directory index table is not guaranteed. It
@@ -503,8 +503,8 @@ static int jfs_unlink(struct inode *dip, struct dentry *dentry)
503 if (rc == -EIO) 503 if (rc == -EIO)
504 txAbort(tid, 1); /* Marks FS Dirty */ 504 txAbort(tid, 1); /* Marks FS Dirty */
505 txEnd(tid); 505 txEnd(tid);
506 mutex_unlock(&JFS_IP(dip)->commit_mutex);
507 mutex_unlock(&JFS_IP(ip)->commit_mutex); 506 mutex_unlock(&JFS_IP(ip)->commit_mutex);
507 mutex_unlock(&JFS_IP(dip)->commit_mutex);
508 IWRITE_UNLOCK(ip); 508 IWRITE_UNLOCK(ip);
509 goto out1; 509 goto out1;
510 } 510 }
@@ -527,8 +527,8 @@ static int jfs_unlink(struct inode *dip, struct dentry *dentry)
527 if ((new_size = commitZeroLink(tid, ip)) < 0) { 527 if ((new_size = commitZeroLink(tid, ip)) < 0) {
528 txAbort(tid, 1); /* Marks FS Dirty */ 528 txAbort(tid, 1); /* Marks FS Dirty */
529 txEnd(tid); 529 txEnd(tid);
530 mutex_unlock(&JFS_IP(dip)->commit_mutex);
531 mutex_unlock(&JFS_IP(ip)->commit_mutex); 530 mutex_unlock(&JFS_IP(ip)->commit_mutex);
531 mutex_unlock(&JFS_IP(dip)->commit_mutex);
532 IWRITE_UNLOCK(ip); 532 IWRITE_UNLOCK(ip);
533 rc = new_size; 533 rc = new_size;
534 goto out1; 534 goto out1;
@@ -556,9 +556,8 @@ static int jfs_unlink(struct inode *dip, struct dentry *dentry)
556 556
557 txEnd(tid); 557 txEnd(tid);
558 558
559 mutex_unlock(&JFS_IP(dip)->commit_mutex);
560 mutex_unlock(&JFS_IP(ip)->commit_mutex); 559 mutex_unlock(&JFS_IP(ip)->commit_mutex);
561 560 mutex_unlock(&JFS_IP(dip)->commit_mutex);
562 561
563 while (new_size && (rc == 0)) { 562 while (new_size && (rc == 0)) {
564 tid = txBegin(dip->i_sb, 0); 563 tid = txBegin(dip->i_sb, 0);
@@ -847,8 +846,8 @@ static int jfs_link(struct dentry *old_dentry,
847 out: 846 out:
848 txEnd(tid); 847 txEnd(tid);
849 848
850 mutex_unlock(&JFS_IP(dir)->commit_mutex);
851 mutex_unlock(&JFS_IP(ip)->commit_mutex); 849 mutex_unlock(&JFS_IP(ip)->commit_mutex);
850 mutex_unlock(&JFS_IP(dir)->commit_mutex);
852 851
853 jfs_info("jfs_link: rc:%d", rc); 852 jfs_info("jfs_link: rc:%d", rc);
854 return rc; 853 return rc;
@@ -1037,8 +1036,8 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry,
1037 1036
1038 out3: 1037 out3:
1039 txEnd(tid); 1038 txEnd(tid);
1040 mutex_unlock(&JFS_IP(dip)->commit_mutex);
1041 mutex_unlock(&JFS_IP(ip)->commit_mutex); 1039 mutex_unlock(&JFS_IP(ip)->commit_mutex);
1040 mutex_unlock(&JFS_IP(dip)->commit_mutex);
1042 if (rc) { 1041 if (rc) {
1043 free_ea_wmap(ip); 1042 free_ea_wmap(ip);
1044 ip->i_nlink = 0; 1043 ip->i_nlink = 0;
@@ -1160,10 +1159,11 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
1160 if (S_ISDIR(new_ip->i_mode)) { 1159 if (S_ISDIR(new_ip->i_mode)) {
1161 new_ip->i_nlink--; 1160 new_ip->i_nlink--;
1162 if (new_ip->i_nlink) { 1161 if (new_ip->i_nlink) {
1163 mutex_unlock(&JFS_IP(new_dir)->commit_mutex); 1162 mutex_unlock(&JFS_IP(new_ip)->commit_mutex);
1164 mutex_unlock(&JFS_IP(old_ip)->commit_mutex);
1165 if (old_dir != new_dir) 1163 if (old_dir != new_dir)
1166 mutex_unlock(&JFS_IP(old_dir)->commit_mutex); 1164 mutex_unlock(&JFS_IP(old_dir)->commit_mutex);
1165 mutex_unlock(&JFS_IP(old_ip)->commit_mutex);
1166 mutex_unlock(&JFS_IP(new_dir)->commit_mutex);
1167 if (!S_ISDIR(old_ip->i_mode) && new_ip) 1167 if (!S_ISDIR(old_ip->i_mode) && new_ip)
1168 IWRITE_UNLOCK(new_ip); 1168 IWRITE_UNLOCK(new_ip);
1169 jfs_error(new_ip->i_sb, 1169 jfs_error(new_ip->i_sb,
@@ -1281,13 +1281,12 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
1281 1281
1282 out4: 1282 out4:
1283 txEnd(tid); 1283 txEnd(tid);
1284
1285 mutex_unlock(&JFS_IP(new_dir)->commit_mutex);
1286 mutex_unlock(&JFS_IP(old_ip)->commit_mutex);
1287 if (old_dir != new_dir)
1288 mutex_unlock(&JFS_IP(old_dir)->commit_mutex);
1289 if (new_ip) 1284 if (new_ip)
1290 mutex_unlock(&JFS_IP(new_ip)->commit_mutex); 1285 mutex_unlock(&JFS_IP(new_ip)->commit_mutex);
1286 if (old_dir != new_dir)
1287 mutex_unlock(&JFS_IP(old_dir)->commit_mutex);
1288 mutex_unlock(&JFS_IP(old_ip)->commit_mutex);
1289 mutex_unlock(&JFS_IP(new_dir)->commit_mutex);
1291 1290
1292 while (new_size && (rc == 0)) { 1291 while (new_size && (rc == 0)) {
1293 tid = txBegin(new_ip->i_sb, 0); 1292 tid = txBegin(new_ip->i_sb, 0);
diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c
index 5980c45998cc..89ba0df14c22 100644
--- a/fs/lockd/clntproc.c
+++ b/fs/lockd/clntproc.c
@@ -454,7 +454,7 @@ static void nlmclnt_locks_init_private(struct file_lock *fl, struct nlm_host *ho
454 fl->fl_ops = &nlmclnt_lock_ops; 454 fl->fl_ops = &nlmclnt_lock_ops;
455} 455}
456 456
457static void do_vfs_lock(struct file_lock *fl) 457static int do_vfs_lock(struct file_lock *fl)
458{ 458{
459 int res = 0; 459 int res = 0;
460 switch (fl->fl_flags & (FL_POSIX|FL_FLOCK)) { 460 switch (fl->fl_flags & (FL_POSIX|FL_FLOCK)) {
@@ -467,9 +467,7 @@ static void do_vfs_lock(struct file_lock *fl)
467 default: 467 default:
468 BUG(); 468 BUG();
469 } 469 }
470 if (res < 0) 470 return res;
471 printk(KERN_WARNING "%s: VFS is out of sync with lock manager!\n",
472 __FUNCTION__);
473} 471}
474 472
475/* 473/*
@@ -498,6 +496,7 @@ nlmclnt_lock(struct nlm_rqst *req, struct file_lock *fl)
498 struct nlm_host *host = req->a_host; 496 struct nlm_host *host = req->a_host;
499 struct nlm_res *resp = &req->a_res; 497 struct nlm_res *resp = &req->a_res;
500 struct nlm_wait *block = NULL; 498 struct nlm_wait *block = NULL;
499 unsigned char fl_flags = fl->fl_flags;
501 int status = -ENOLCK; 500 int status = -ENOLCK;
502 501
503 if (!host->h_monitored && nsm_monitor(host) < 0) { 502 if (!host->h_monitored && nsm_monitor(host) < 0) {
@@ -505,6 +504,10 @@ nlmclnt_lock(struct nlm_rqst *req, struct file_lock *fl)
505 host->h_name); 504 host->h_name);
506 goto out; 505 goto out;
507 } 506 }
507 fl->fl_flags |= FL_ACCESS;
508 status = do_vfs_lock(fl);
509 if (status < 0)
510 goto out;
508 511
509 block = nlmclnt_prepare_block(host, fl); 512 block = nlmclnt_prepare_block(host, fl);
510again: 513again:
@@ -539,9 +542,10 @@ again:
539 up_read(&host->h_rwsem); 542 up_read(&host->h_rwsem);
540 goto again; 543 goto again;
541 } 544 }
542 fl->fl_flags |= FL_SLEEP;
543 /* Ensure the resulting lock will get added to granted list */ 545 /* Ensure the resulting lock will get added to granted list */
544 do_vfs_lock(fl); 546 fl->fl_flags = fl_flags | FL_SLEEP;
547 if (do_vfs_lock(fl) < 0)
548 printk(KERN_WARNING "%s: VFS is out of sync with lock manager!\n", __FUNCTION__);
545 up_read(&host->h_rwsem); 549 up_read(&host->h_rwsem);
546 } 550 }
547 status = nlm_stat_to_errno(resp->status); 551 status = nlm_stat_to_errno(resp->status);
@@ -552,6 +556,7 @@ out_unblock:
552 nlmclnt_cancel(host, req->a_args.block, fl); 556 nlmclnt_cancel(host, req->a_args.block, fl);
553out: 557out:
554 nlm_release_call(req); 558 nlm_release_call(req);
559 fl->fl_flags = fl_flags;
555 return status; 560 return status;
556} 561}
557 562
@@ -606,15 +611,19 @@ nlmclnt_unlock(struct nlm_rqst *req, struct file_lock *fl)
606{ 611{
607 struct nlm_host *host = req->a_host; 612 struct nlm_host *host = req->a_host;
608 struct nlm_res *resp = &req->a_res; 613 struct nlm_res *resp = &req->a_res;
609 int status; 614 int status = 0;
610 615
611 /* 616 /*
612 * Note: the server is supposed to either grant us the unlock 617 * Note: the server is supposed to either grant us the unlock
613 * request, or to deny it with NLM_LCK_DENIED_GRACE_PERIOD. In either 618 * request, or to deny it with NLM_LCK_DENIED_GRACE_PERIOD. In either
614 * case, we want to unlock. 619 * case, we want to unlock.
615 */ 620 */
621 fl->fl_flags |= FL_EXISTS;
616 down_read(&host->h_rwsem); 622 down_read(&host->h_rwsem);
617 do_vfs_lock(fl); 623 if (do_vfs_lock(fl) == -ENOENT) {
624 up_read(&host->h_rwsem);
625 goto out;
626 }
618 up_read(&host->h_rwsem); 627 up_read(&host->h_rwsem);
619 628
620 if (req->a_flags & RPC_TASK_ASYNC) 629 if (req->a_flags & RPC_TASK_ASYNC)
@@ -624,7 +633,6 @@ nlmclnt_unlock(struct nlm_rqst *req, struct file_lock *fl)
624 if (status < 0) 633 if (status < 0)
625 goto out; 634 goto out;
626 635
627 status = 0;
628 if (resp->status == NLM_LCK_GRANTED) 636 if (resp->status == NLM_LCK_GRANTED)
629 goto out; 637 goto out;
630 638
diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c
index baf5ae513481..c9d419703cf3 100644
--- a/fs/lockd/svclock.c
+++ b/fs/lockd/svclock.c
@@ -638,9 +638,6 @@ static void nlmsvc_grant_callback(struct rpc_task *task, void *data)
638 if (task->tk_status < 0) { 638 if (task->tk_status < 0) {
639 /* RPC error: Re-insert for retransmission */ 639 /* RPC error: Re-insert for retransmission */
640 timeout = 10 * HZ; 640 timeout = 10 * HZ;
641 } else if (block->b_done) {
642 /* Block already removed, kill it for real */
643 timeout = 0;
644 } else { 641 } else {
645 /* Call was successful, now wait for client callback */ 642 /* Call was successful, now wait for client callback */
646 timeout = 60 * HZ; 643 timeout = 60 * HZ;
@@ -709,13 +706,10 @@ nlmsvc_retry_blocked(void)
709 break; 706 break;
710 if (time_after(block->b_when,jiffies)) 707 if (time_after(block->b_when,jiffies))
711 break; 708 break;
712 dprintk("nlmsvc_retry_blocked(%p, when=%ld, done=%d)\n", 709 dprintk("nlmsvc_retry_blocked(%p, when=%ld)\n",
713 block, block->b_when, block->b_done); 710 block, block->b_when);
714 kref_get(&block->b_count); 711 kref_get(&block->b_count);
715 if (block->b_done) 712 nlmsvc_grant_blocked(block);
716 nlmsvc_unlink_block(block);
717 else
718 nlmsvc_grant_blocked(block);
719 nlmsvc_release_block(block); 713 nlmsvc_release_block(block);
720 } 714 }
721 715
diff --git a/fs/locks.c b/fs/locks.c
index 1ad29c9b6252..b0b41a64e10b 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -725,6 +725,10 @@ next_task:
725/* Try to create a FLOCK lock on filp. We always insert new FLOCK locks 725/* Try to create a FLOCK lock on filp. We always insert new FLOCK locks
726 * at the head of the list, but that's secret knowledge known only to 726 * at the head of the list, but that's secret knowledge known only to
727 * flock_lock_file and posix_lock_file. 727 * flock_lock_file and posix_lock_file.
728 *
729 * Note that if called with an FL_EXISTS argument, the caller may determine
730 * whether or not a lock was successfully freed by testing the return
731 * value for -ENOENT.
728 */ 732 */
729static int flock_lock_file(struct file *filp, struct file_lock *request) 733static int flock_lock_file(struct file *filp, struct file_lock *request)
730{ 734{
@@ -735,6 +739,8 @@ static int flock_lock_file(struct file *filp, struct file_lock *request)
735 int found = 0; 739 int found = 0;
736 740
737 lock_kernel(); 741 lock_kernel();
742 if (request->fl_flags & FL_ACCESS)
743 goto find_conflict;
738 for_each_lock(inode, before) { 744 for_each_lock(inode, before) {
739 struct file_lock *fl = *before; 745 struct file_lock *fl = *before;
740 if (IS_POSIX(fl)) 746 if (IS_POSIX(fl))
@@ -750,8 +756,11 @@ static int flock_lock_file(struct file *filp, struct file_lock *request)
750 break; 756 break;
751 } 757 }
752 758
753 if (request->fl_type == F_UNLCK) 759 if (request->fl_type == F_UNLCK) {
760 if ((request->fl_flags & FL_EXISTS) && !found)
761 error = -ENOENT;
754 goto out; 762 goto out;
763 }
755 764
756 error = -ENOMEM; 765 error = -ENOMEM;
757 new_fl = locks_alloc_lock(); 766 new_fl = locks_alloc_lock();
@@ -764,6 +773,7 @@ static int flock_lock_file(struct file *filp, struct file_lock *request)
764 if (found) 773 if (found)
765 cond_resched(); 774 cond_resched();
766 775
776find_conflict:
767 for_each_lock(inode, before) { 777 for_each_lock(inode, before) {
768 struct file_lock *fl = *before; 778 struct file_lock *fl = *before;
769 if (IS_POSIX(fl)) 779 if (IS_POSIX(fl))
@@ -777,6 +787,8 @@ static int flock_lock_file(struct file *filp, struct file_lock *request)
777 locks_insert_block(fl, request); 787 locks_insert_block(fl, request);
778 goto out; 788 goto out;
779 } 789 }
790 if (request->fl_flags & FL_ACCESS)
791 goto out;
780 locks_copy_lock(new_fl, request); 792 locks_copy_lock(new_fl, request);
781 locks_insert_lock(&inode->i_flock, new_fl); 793 locks_insert_lock(&inode->i_flock, new_fl);
782 new_fl = NULL; 794 new_fl = NULL;
@@ -948,8 +960,11 @@ static int __posix_lock_file_conf(struct inode *inode, struct file_lock *request
948 960
949 error = 0; 961 error = 0;
950 if (!added) { 962 if (!added) {
951 if (request->fl_type == F_UNLCK) 963 if (request->fl_type == F_UNLCK) {
964 if (request->fl_flags & FL_EXISTS)
965 error = -ENOENT;
952 goto out; 966 goto out;
967 }
953 968
954 if (!new_fl) { 969 if (!new_fl) {
955 error = -ENOLCK; 970 error = -ENOLCK;
@@ -996,6 +1011,10 @@ static int __posix_lock_file_conf(struct inode *inode, struct file_lock *request
996 * Add a POSIX style lock to a file. 1011 * Add a POSIX style lock to a file.
997 * We merge adjacent & overlapping locks whenever possible. 1012 * We merge adjacent & overlapping locks whenever possible.
998 * POSIX locks are sorted by owner task, then by starting address 1013 * POSIX locks are sorted by owner task, then by starting address
1014 *
1015 * Note that if called with an FL_EXISTS argument, the caller may determine
1016 * whether or not a lock was successfully freed by testing the return
1017 * value for -ENOENT.
999 */ 1018 */
1000int posix_lock_file(struct file *filp, struct file_lock *fl) 1019int posix_lock_file(struct file *filp, struct file_lock *fl)
1001{ 1020{
diff --git a/fs/namei.c b/fs/namei.c
index c9750d755aff..55a131230f94 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -159,7 +159,7 @@ char * getname(const char __user * filename)
159#ifdef CONFIG_AUDITSYSCALL 159#ifdef CONFIG_AUDITSYSCALL
160void putname(const char *name) 160void putname(const char *name)
161{ 161{
162 if (unlikely(current->audit_context)) 162 if (unlikely(!audit_dummy_context()))
163 audit_putname(name); 163 audit_putname(name);
164 else 164 else
165 __putname(name); 165 __putname(name);
@@ -1125,7 +1125,7 @@ static int fastcall do_path_lookup(int dfd, const char *name,
1125 retval = link_path_walk(name, nd); 1125 retval = link_path_walk(name, nd);
1126out: 1126out:
1127 if (likely(retval == 0)) { 1127 if (likely(retval == 0)) {
1128 if (unlikely(current->audit_context && nd && nd->dentry && 1128 if (unlikely(!audit_dummy_context() && nd && nd->dentry &&
1129 nd->dentry->d_inode)) 1129 nd->dentry->d_inode))
1130 audit_inode(name, nd->dentry->d_inode); 1130 audit_inode(name, nd->dentry->d_inode);
1131 } 1131 }
@@ -1357,7 +1357,7 @@ static int may_delete(struct inode *dir,struct dentry *victim,int isdir)
1357 return -ENOENT; 1357 return -ENOENT;
1358 1358
1359 BUG_ON(victim->d_parent->d_inode != dir); 1359 BUG_ON(victim->d_parent->d_inode != dir);
1360 audit_inode_child(victim->d_name.name, victim->d_inode, dir->i_ino); 1360 audit_inode_child(victim->d_name.name, victim->d_inode, dir);
1361 1361
1362 error = permission(dir,MAY_WRITE | MAY_EXEC, NULL); 1362 error = permission(dir,MAY_WRITE | MAY_EXEC, NULL);
1363 if (error) 1363 if (error)
@@ -1659,6 +1659,7 @@ do_last:
1659 * It already exists. 1659 * It already exists.
1660 */ 1660 */
1661 mutex_unlock(&dir->d_inode->i_mutex); 1661 mutex_unlock(&dir->d_inode->i_mutex);
1662 audit_inode_update(path.dentry->d_inode);
1662 1663
1663 error = -EEXIST; 1664 error = -EEXIST;
1664 if (flag & O_EXCL) 1665 if (flag & O_EXCL)
@@ -1669,6 +1670,7 @@ do_last:
1669 if (flag & O_NOFOLLOW) 1670 if (flag & O_NOFOLLOW)
1670 goto exit_dput; 1671 goto exit_dput;
1671 } 1672 }
1673
1672 error = -ENOENT; 1674 error = -ENOENT;
1673 if (!path.dentry->d_inode) 1675 if (!path.dentry->d_inode)
1674 goto exit_dput; 1676 goto exit_dput;
@@ -1712,8 +1714,14 @@ do_link:
1712 if (error) 1714 if (error)
1713 goto exit_dput; 1715 goto exit_dput;
1714 error = __do_follow_link(&path, nd); 1716 error = __do_follow_link(&path, nd);
1715 if (error) 1717 if (error) {
1718 /* Does someone understand code flow here? Or it is only
1719 * me so stupid? Anathema to whoever designed this non-sense
1720 * with "intent.open".
1721 */
1722 release_open_intent(nd);
1716 return error; 1723 return error;
1724 }
1717 nd->flags &= ~LOOKUP_PARENT; 1725 nd->flags &= ~LOOKUP_PARENT;
1718 if (nd->last_type == LAST_BIND) 1726 if (nd->last_type == LAST_BIND)
1719 goto ok; 1727 goto ok;
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 3ddda6f7ecc2..e7ffb4deb3e5 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -690,7 +690,9 @@ int nfs_lookup_verify_inode(struct inode *inode, struct nameidata *nd)
690 goto out_force; 690 goto out_force;
691 /* This is an open(2) */ 691 /* This is an open(2) */
692 if (nfs_lookup_check_intent(nd, LOOKUP_OPEN) != 0 && 692 if (nfs_lookup_check_intent(nd, LOOKUP_OPEN) != 0 &&
693 !(server->flags & NFS_MOUNT_NOCTO)) 693 !(server->flags & NFS_MOUNT_NOCTO) &&
694 (S_ISREG(inode->i_mode) ||
695 S_ISDIR(inode->i_mode)))
694 goto out_force; 696 goto out_force;
695 } 697 }
696 return nfs_revalidate_inode(server, inode); 698 return nfs_revalidate_inode(server, inode);
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index 4cdd1b499e35..fecd3b095deb 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -67,25 +67,19 @@ struct nfs_direct_req {
67 struct kref kref; /* release manager */ 67 struct kref kref; /* release manager */
68 68
69 /* I/O parameters */ 69 /* I/O parameters */
70 struct list_head list, /* nfs_read/write_data structs */
71 rewrite_list; /* saved nfs_write_data structs */
72 struct nfs_open_context *ctx; /* file open context info */ 70 struct nfs_open_context *ctx; /* file open context info */
73 struct kiocb * iocb; /* controlling i/o request */ 71 struct kiocb * iocb; /* controlling i/o request */
74 struct inode * inode; /* target file of i/o */ 72 struct inode * inode; /* target file of i/o */
75 unsigned long user_addr; /* location of user's buffer */
76 size_t user_count; /* total bytes to move */
77 loff_t pos; /* starting offset in file */
78 struct page ** pages; /* pages in our buffer */
79 unsigned int npages; /* count of pages */
80 73
81 /* completion state */ 74 /* completion state */
75 atomic_t io_count; /* i/os we're waiting for */
82 spinlock_t lock; /* protect completion state */ 76 spinlock_t lock; /* protect completion state */
83 int outstanding; /* i/os we're waiting for */
84 ssize_t count, /* bytes actually processed */ 77 ssize_t count, /* bytes actually processed */
85 error; /* any reported error */ 78 error; /* any reported error */
86 struct completion completion; /* wait for i/o completion */ 79 struct completion completion; /* wait for i/o completion */
87 80
88 /* commit state */ 81 /* commit state */
82 struct list_head rewrite_list; /* saved nfs_write_data structs */
89 struct nfs_write_data * commit_data; /* special write_data for commits */ 83 struct nfs_write_data * commit_data; /* special write_data for commits */
90 int flags; 84 int flags;
91#define NFS_ODIRECT_DO_COMMIT (1) /* an unstable reply was received */ 85#define NFS_ODIRECT_DO_COMMIT (1) /* an unstable reply was received */
@@ -93,8 +87,37 @@ struct nfs_direct_req {
93 struct nfs_writeverf verf; /* unstable write verifier */ 87 struct nfs_writeverf verf; /* unstable write verifier */
94}; 88};
95 89
96static void nfs_direct_write_schedule(struct nfs_direct_req *dreq, int sync);
97static void nfs_direct_write_complete(struct nfs_direct_req *dreq, struct inode *inode); 90static void nfs_direct_write_complete(struct nfs_direct_req *dreq, struct inode *inode);
91static const struct rpc_call_ops nfs_write_direct_ops;
92
93static inline void get_dreq(struct nfs_direct_req *dreq)
94{
95 atomic_inc(&dreq->io_count);
96}
97
98static inline int put_dreq(struct nfs_direct_req *dreq)
99{
100 return atomic_dec_and_test(&dreq->io_count);
101}
102
103/*
104 * "size" is never larger than rsize or wsize.
105 */
106static inline int nfs_direct_count_pages(unsigned long user_addr, size_t size)
107{
108 int page_count;
109
110 page_count = (user_addr + size + PAGE_SIZE - 1) >> PAGE_SHIFT;
111 page_count -= user_addr >> PAGE_SHIFT;
112 BUG_ON(page_count < 0);
113
114 return page_count;
115}
116
117static inline unsigned int nfs_max_pages(unsigned int size)
118{
119 return (size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
120}
98 121
99/** 122/**
100 * nfs_direct_IO - NFS address space operation for direct I/O 123 * nfs_direct_IO - NFS address space operation for direct I/O
@@ -118,50 +141,21 @@ ssize_t nfs_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, loff_
118 return -EINVAL; 141 return -EINVAL;
119} 142}
120 143
121static void nfs_free_user_pages(struct page **pages, int npages, int do_dirty) 144static void nfs_direct_dirty_pages(struct page **pages, int npages)
122{ 145{
123 int i; 146 int i;
124 for (i = 0; i < npages; i++) { 147 for (i = 0; i < npages; i++) {
125 struct page *page = pages[i]; 148 struct page *page = pages[i];
126 if (do_dirty && !PageCompound(page)) 149 if (!PageCompound(page))
127 set_page_dirty_lock(page); 150 set_page_dirty_lock(page);
128 page_cache_release(page);
129 } 151 }
130 kfree(pages);
131} 152}
132 153
133static inline int nfs_get_user_pages(int rw, unsigned long user_addr, size_t size, struct page ***pages) 154static void nfs_direct_release_pages(struct page **pages, int npages)
134{ 155{
135 int result = -ENOMEM; 156 int i;
136 unsigned long page_count; 157 for (i = 0; i < npages; i++)
137 size_t array_size; 158 page_cache_release(pages[i]);
138
139 page_count = (user_addr + size + PAGE_SIZE - 1) >> PAGE_SHIFT;
140 page_count -= user_addr >> PAGE_SHIFT;
141
142 array_size = (page_count * sizeof(struct page *));
143 *pages = kmalloc(array_size, GFP_KERNEL);
144 if (*pages) {
145 down_read(&current->mm->mmap_sem);
146 result = get_user_pages(current, current->mm, user_addr,
147 page_count, (rw == READ), 0,
148 *pages, NULL);
149 up_read(&current->mm->mmap_sem);
150 if (result != page_count) {
151 /*
152 * If we got fewer pages than expected from
153 * get_user_pages(), the user buffer runs off the
154 * end of a mapping; return EFAULT.
155 */
156 if (result >= 0) {
157 nfs_free_user_pages(*pages, result, 0);
158 result = -EFAULT;
159 } else
160 kfree(*pages);
161 *pages = NULL;
162 }
163 }
164 return result;
165} 159}
166 160
167static inline struct nfs_direct_req *nfs_direct_req_alloc(void) 161static inline struct nfs_direct_req *nfs_direct_req_alloc(void)
@@ -173,13 +167,13 @@ static inline struct nfs_direct_req *nfs_direct_req_alloc(void)
173 return NULL; 167 return NULL;
174 168
175 kref_init(&dreq->kref); 169 kref_init(&dreq->kref);
170 kref_get(&dreq->kref);
176 init_completion(&dreq->completion); 171 init_completion(&dreq->completion);
177 INIT_LIST_HEAD(&dreq->list);
178 INIT_LIST_HEAD(&dreq->rewrite_list); 172 INIT_LIST_HEAD(&dreq->rewrite_list);
179 dreq->iocb = NULL; 173 dreq->iocb = NULL;
180 dreq->ctx = NULL; 174 dreq->ctx = NULL;
181 spin_lock_init(&dreq->lock); 175 spin_lock_init(&dreq->lock);
182 dreq->outstanding = 0; 176 atomic_set(&dreq->io_count, 0);
183 dreq->count = 0; 177 dreq->count = 0;
184 dreq->error = 0; 178 dreq->error = 0;
185 dreq->flags = 0; 179 dreq->flags = 0;
@@ -220,18 +214,11 @@ out:
220} 214}
221 215
222/* 216/*
223 * We must hold a reference to all the pages in this direct read request 217 * Synchronous I/O uses a stack-allocated iocb. Thus we can't trust
224 * until the RPCs complete. This could be long *after* we are woken up in 218 * the iocb is still valid here if this is a synchronous request.
225 * nfs_direct_wait (for instance, if someone hits ^C on a slow server).
226 *
227 * In addition, synchronous I/O uses a stack-allocated iocb. Thus we
228 * can't trust the iocb is still valid here if this is a synchronous
229 * request. If the waiter is woken prematurely, the iocb is long gone.
230 */ 219 */
231static void nfs_direct_complete(struct nfs_direct_req *dreq) 220static void nfs_direct_complete(struct nfs_direct_req *dreq)
232{ 221{
233 nfs_free_user_pages(dreq->pages, dreq->npages, 1);
234
235 if (dreq->iocb) { 222 if (dreq->iocb) {
236 long res = (long) dreq->error; 223 long res = (long) dreq->error;
237 if (!res) 224 if (!res)
@@ -244,48 +231,10 @@ static void nfs_direct_complete(struct nfs_direct_req *dreq)
244} 231}
245 232
246/* 233/*
247 * Note we also set the number of requests we have in the dreq when we are 234 * We must hold a reference to all the pages in this direct read request
248 * done. This prevents races with I/O completion so we will always wait 235 * until the RPCs complete. This could be long *after* we are woken up in
249 * until all requests have been dispatched and completed. 236 * nfs_direct_wait (for instance, if someone hits ^C on a slow server).
250 */ 237 */
251static struct nfs_direct_req *nfs_direct_read_alloc(size_t nbytes, size_t rsize)
252{
253 struct list_head *list;
254 struct nfs_direct_req *dreq;
255 unsigned int rpages = (rsize + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
256
257 dreq = nfs_direct_req_alloc();
258 if (!dreq)
259 return NULL;
260
261 list = &dreq->list;
262 for(;;) {
263 struct nfs_read_data *data = nfs_readdata_alloc(rpages);
264
265 if (unlikely(!data)) {
266 while (!list_empty(list)) {
267 data = list_entry(list->next,
268 struct nfs_read_data, pages);
269 list_del(&data->pages);
270 nfs_readdata_free(data);
271 }
272 kref_put(&dreq->kref, nfs_direct_req_release);
273 return NULL;
274 }
275
276 INIT_LIST_HEAD(&data->pages);
277 list_add(&data->pages, list);
278
279 data->req = (struct nfs_page *) dreq;
280 dreq->outstanding++;
281 if (nbytes <= rsize)
282 break;
283 nbytes -= rsize;
284 }
285 kref_get(&dreq->kref);
286 return dreq;
287}
288
289static void nfs_direct_read_result(struct rpc_task *task, void *calldata) 238static void nfs_direct_read_result(struct rpc_task *task, void *calldata)
290{ 239{
291 struct nfs_read_data *data = calldata; 240 struct nfs_read_data *data = calldata;
@@ -294,6 +243,9 @@ static void nfs_direct_read_result(struct rpc_task *task, void *calldata)
294 if (nfs_readpage_result(task, data) != 0) 243 if (nfs_readpage_result(task, data) != 0)
295 return; 244 return;
296 245
246 nfs_direct_dirty_pages(data->pagevec, data->npages);
247 nfs_direct_release_pages(data->pagevec, data->npages);
248
297 spin_lock(&dreq->lock); 249 spin_lock(&dreq->lock);
298 250
299 if (likely(task->tk_status >= 0)) 251 if (likely(task->tk_status >= 0))
@@ -301,13 +253,10 @@ static void nfs_direct_read_result(struct rpc_task *task, void *calldata)
301 else 253 else
302 dreq->error = task->tk_status; 254 dreq->error = task->tk_status;
303 255
304 if (--dreq->outstanding) {
305 spin_unlock(&dreq->lock);
306 return;
307 }
308
309 spin_unlock(&dreq->lock); 256 spin_unlock(&dreq->lock);
310 nfs_direct_complete(dreq); 257
258 if (put_dreq(dreq))
259 nfs_direct_complete(dreq);
311} 260}
312 261
313static const struct rpc_call_ops nfs_read_direct_ops = { 262static const struct rpc_call_ops nfs_read_direct_ops = {
@@ -316,41 +265,60 @@ static const struct rpc_call_ops nfs_read_direct_ops = {
316}; 265};
317 266
318/* 267/*
319 * For each nfs_read_data struct that was allocated on the list, dispatch 268 * For each rsize'd chunk of the user's buffer, dispatch an NFS READ
320 * an NFS READ operation 269 * operation. If nfs_readdata_alloc() or get_user_pages() fails,
270 * bail and stop sending more reads. Read length accounting is
271 * handled automatically by nfs_direct_read_result(). Otherwise, if
272 * no requests have been sent, just return an error.
321 */ 273 */
322static void nfs_direct_read_schedule(struct nfs_direct_req *dreq) 274static ssize_t nfs_direct_read_schedule(struct nfs_direct_req *dreq, unsigned long user_addr, size_t count, loff_t pos)
323{ 275{
324 struct nfs_open_context *ctx = dreq->ctx; 276 struct nfs_open_context *ctx = dreq->ctx;
325 struct inode *inode = ctx->dentry->d_inode; 277 struct inode *inode = ctx->dentry->d_inode;
326 struct list_head *list = &dreq->list;
327 struct page **pages = dreq->pages;
328 size_t count = dreq->user_count;
329 loff_t pos = dreq->pos;
330 size_t rsize = NFS_SERVER(inode)->rsize; 278 size_t rsize = NFS_SERVER(inode)->rsize;
331 unsigned int curpage, pgbase; 279 unsigned int rpages = nfs_max_pages(rsize);
280 unsigned int pgbase;
281 int result;
282 ssize_t started = 0;
283
284 get_dreq(dreq);
332 285
333 curpage = 0; 286 pgbase = user_addr & ~PAGE_MASK;
334 pgbase = dreq->user_addr & ~PAGE_MASK;
335 do { 287 do {
336 struct nfs_read_data *data; 288 struct nfs_read_data *data;
337 size_t bytes; 289 size_t bytes;
338 290
291 result = -ENOMEM;
292 data = nfs_readdata_alloc(rpages);
293 if (unlikely(!data))
294 break;
295
339 bytes = rsize; 296 bytes = rsize;
340 if (count < rsize) 297 if (count < rsize)
341 bytes = count; 298 bytes = count;
342 299
343 BUG_ON(list_empty(list)); 300 data->npages = nfs_direct_count_pages(user_addr, bytes);
344 data = list_entry(list->next, struct nfs_read_data, pages); 301 down_read(&current->mm->mmap_sem);
345 list_del_init(&data->pages); 302 result = get_user_pages(current, current->mm, user_addr,
303 data->npages, 1, 0, data->pagevec, NULL);
304 up_read(&current->mm->mmap_sem);
305 if (unlikely(result < data->npages)) {
306 if (result > 0)
307 nfs_direct_release_pages(data->pagevec, result);
308 nfs_readdata_release(data);
309 break;
310 }
311
312 get_dreq(dreq);
346 313
314 data->req = (struct nfs_page *) dreq;
347 data->inode = inode; 315 data->inode = inode;
348 data->cred = ctx->cred; 316 data->cred = ctx->cred;
349 data->args.fh = NFS_FH(inode); 317 data->args.fh = NFS_FH(inode);
350 data->args.context = ctx; 318 data->args.context = ctx;
351 data->args.offset = pos; 319 data->args.offset = pos;
352 data->args.pgbase = pgbase; 320 data->args.pgbase = pgbase;
353 data->args.pages = &pages[curpage]; 321 data->args.pages = data->pagevec;
354 data->args.count = bytes; 322 data->args.count = bytes;
355 data->res.fattr = &data->fattr; 323 data->res.fattr = &data->fattr;
356 data->res.eof = 0; 324 data->res.eof = 0;
@@ -373,33 +341,35 @@ static void nfs_direct_read_schedule(struct nfs_direct_req *dreq)
373 bytes, 341 bytes,
374 (unsigned long long)data->args.offset); 342 (unsigned long long)data->args.offset);
375 343
344 started += bytes;
345 user_addr += bytes;
376 pos += bytes; 346 pos += bytes;
377 pgbase += bytes; 347 pgbase += bytes;
378 curpage += pgbase >> PAGE_SHIFT;
379 pgbase &= ~PAGE_MASK; 348 pgbase &= ~PAGE_MASK;
380 349
381 count -= bytes; 350 count -= bytes;
382 } while (count != 0); 351 } while (count != 0);
383 BUG_ON(!list_empty(list)); 352
353 if (put_dreq(dreq))
354 nfs_direct_complete(dreq);
355
356 if (started)
357 return 0;
358 return result < 0 ? (ssize_t) result : -EFAULT;
384} 359}
385 360
386static ssize_t nfs_direct_read(struct kiocb *iocb, unsigned long user_addr, size_t count, loff_t pos, struct page **pages, unsigned int nr_pages) 361static ssize_t nfs_direct_read(struct kiocb *iocb, unsigned long user_addr, size_t count, loff_t pos)
387{ 362{
388 ssize_t result; 363 ssize_t result = 0;
389 sigset_t oldset; 364 sigset_t oldset;
390 struct inode *inode = iocb->ki_filp->f_mapping->host; 365 struct inode *inode = iocb->ki_filp->f_mapping->host;
391 struct rpc_clnt *clnt = NFS_CLIENT(inode); 366 struct rpc_clnt *clnt = NFS_CLIENT(inode);
392 struct nfs_direct_req *dreq; 367 struct nfs_direct_req *dreq;
393 368
394 dreq = nfs_direct_read_alloc(count, NFS_SERVER(inode)->rsize); 369 dreq = nfs_direct_req_alloc();
395 if (!dreq) 370 if (!dreq)
396 return -ENOMEM; 371 return -ENOMEM;
397 372
398 dreq->user_addr = user_addr;
399 dreq->user_count = count;
400 dreq->pos = pos;
401 dreq->pages = pages;
402 dreq->npages = nr_pages;
403 dreq->inode = inode; 373 dreq->inode = inode;
404 dreq->ctx = get_nfs_open_context((struct nfs_open_context *)iocb->ki_filp->private_data); 374 dreq->ctx = get_nfs_open_context((struct nfs_open_context *)iocb->ki_filp->private_data);
405 if (!is_sync_kiocb(iocb)) 375 if (!is_sync_kiocb(iocb))
@@ -407,8 +377,9 @@ static ssize_t nfs_direct_read(struct kiocb *iocb, unsigned long user_addr, size
407 377
408 nfs_add_stats(inode, NFSIOS_DIRECTREADBYTES, count); 378 nfs_add_stats(inode, NFSIOS_DIRECTREADBYTES, count);
409 rpc_clnt_sigmask(clnt, &oldset); 379 rpc_clnt_sigmask(clnt, &oldset);
410 nfs_direct_read_schedule(dreq); 380 result = nfs_direct_read_schedule(dreq, user_addr, count, pos);
411 result = nfs_direct_wait(dreq); 381 if (!result)
382 result = nfs_direct_wait(dreq);
412 rpc_clnt_sigunmask(clnt, &oldset); 383 rpc_clnt_sigunmask(clnt, &oldset);
413 384
414 return result; 385 return result;
@@ -416,10 +387,10 @@ static ssize_t nfs_direct_read(struct kiocb *iocb, unsigned long user_addr, size
416 387
417static void nfs_direct_free_writedata(struct nfs_direct_req *dreq) 388static void nfs_direct_free_writedata(struct nfs_direct_req *dreq)
418{ 389{
419 list_splice_init(&dreq->rewrite_list, &dreq->list); 390 while (!list_empty(&dreq->rewrite_list)) {
420 while (!list_empty(&dreq->list)) { 391 struct nfs_write_data *data = list_entry(dreq->rewrite_list.next, struct nfs_write_data, pages);
421 struct nfs_write_data *data = list_entry(dreq->list.next, struct nfs_write_data, pages);
422 list_del(&data->pages); 392 list_del(&data->pages);
393 nfs_direct_release_pages(data->pagevec, data->npages);
423 nfs_writedata_release(data); 394 nfs_writedata_release(data);
424 } 395 }
425} 396}
@@ -427,14 +398,51 @@ static void nfs_direct_free_writedata(struct nfs_direct_req *dreq)
427#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) 398#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
428static void nfs_direct_write_reschedule(struct nfs_direct_req *dreq) 399static void nfs_direct_write_reschedule(struct nfs_direct_req *dreq)
429{ 400{
430 struct list_head *pos; 401 struct inode *inode = dreq->inode;
402 struct list_head *p;
403 struct nfs_write_data *data;
431 404
432 list_splice_init(&dreq->rewrite_list, &dreq->list);
433 list_for_each(pos, &dreq->list)
434 dreq->outstanding++;
435 dreq->count = 0; 405 dreq->count = 0;
406 get_dreq(dreq);
407
408 list_for_each(p, &dreq->rewrite_list) {
409 data = list_entry(p, struct nfs_write_data, pages);
410
411 get_dreq(dreq);
412
413 /*
414 * Reset data->res.
415 */
416 nfs_fattr_init(&data->fattr);
417 data->res.count = data->args.count;
418 memset(&data->verf, 0, sizeof(data->verf));
419
420 /*
421 * Reuse data->task; data->args should not have changed
422 * since the original request was sent.
423 */
424 rpc_init_task(&data->task, NFS_CLIENT(inode), RPC_TASK_ASYNC,
425 &nfs_write_direct_ops, data);
426 NFS_PROTO(inode)->write_setup(data, FLUSH_STABLE);
427
428 data->task.tk_priority = RPC_PRIORITY_NORMAL;
429 data->task.tk_cookie = (unsigned long) inode;
430
431 /*
432 * We're called via an RPC callback, so BKL is already held.
433 */
434 rpc_execute(&data->task);
435
436 dprintk("NFS: %5u rescheduled direct write call (req %s/%Ld, %u bytes @ offset %Lu)\n",
437 data->task.tk_pid,
438 inode->i_sb->s_id,
439 (long long)NFS_FILEID(inode),
440 data->args.count,
441 (unsigned long long)data->args.offset);
442 }
436 443
437 nfs_direct_write_schedule(dreq, FLUSH_STABLE); 444 if (put_dreq(dreq))
445 nfs_direct_write_complete(dreq, inode);
438} 446}
439 447
440static void nfs_direct_commit_result(struct rpc_task *task, void *calldata) 448static void nfs_direct_commit_result(struct rpc_task *task, void *calldata)
@@ -471,8 +479,8 @@ static void nfs_direct_commit_schedule(struct nfs_direct_req *dreq)
471 data->cred = dreq->ctx->cred; 479 data->cred = dreq->ctx->cred;
472 480
473 data->args.fh = NFS_FH(data->inode); 481 data->args.fh = NFS_FH(data->inode);
474 data->args.offset = dreq->pos; 482 data->args.offset = 0;
475 data->args.count = dreq->user_count; 483 data->args.count = 0;
476 data->res.count = 0; 484 data->res.count = 0;
477 data->res.fattr = &data->fattr; 485 data->res.fattr = &data->fattr;
478 data->res.verf = &data->verf; 486 data->res.verf = &data->verf;
@@ -534,47 +542,6 @@ static void nfs_direct_write_complete(struct nfs_direct_req *dreq, struct inode
534} 542}
535#endif 543#endif
536 544
537static struct nfs_direct_req *nfs_direct_write_alloc(size_t nbytes, size_t wsize)
538{
539 struct list_head *list;
540 struct nfs_direct_req *dreq;
541 unsigned int wpages = (wsize + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
542
543 dreq = nfs_direct_req_alloc();
544 if (!dreq)
545 return NULL;
546
547 list = &dreq->list;
548 for(;;) {
549 struct nfs_write_data *data = nfs_writedata_alloc(wpages);
550
551 if (unlikely(!data)) {
552 while (!list_empty(list)) {
553 data = list_entry(list->next,
554 struct nfs_write_data, pages);
555 list_del(&data->pages);
556 nfs_writedata_free(data);
557 }
558 kref_put(&dreq->kref, nfs_direct_req_release);
559 return NULL;
560 }
561
562 INIT_LIST_HEAD(&data->pages);
563 list_add(&data->pages, list);
564
565 data->req = (struct nfs_page *) dreq;
566 dreq->outstanding++;
567 if (nbytes <= wsize)
568 break;
569 nbytes -= wsize;
570 }
571
572 nfs_alloc_commit_data(dreq);
573
574 kref_get(&dreq->kref);
575 return dreq;
576}
577
578static void nfs_direct_write_result(struct rpc_task *task, void *calldata) 545static void nfs_direct_write_result(struct rpc_task *task, void *calldata)
579{ 546{
580 struct nfs_write_data *data = calldata; 547 struct nfs_write_data *data = calldata;
@@ -604,8 +571,6 @@ static void nfs_direct_write_result(struct rpc_task *task, void *calldata)
604 } 571 }
605 } 572 }
606 } 573 }
607 /* In case we have to resend */
608 data->args.stable = NFS_FILE_SYNC;
609 574
610 spin_unlock(&dreq->lock); 575 spin_unlock(&dreq->lock);
611} 576}
@@ -619,14 +584,8 @@ static void nfs_direct_write_release(void *calldata)
619 struct nfs_write_data *data = calldata; 584 struct nfs_write_data *data = calldata;
620 struct nfs_direct_req *dreq = (struct nfs_direct_req *) data->req; 585 struct nfs_direct_req *dreq = (struct nfs_direct_req *) data->req;
621 586
622 spin_lock(&dreq->lock); 587 if (put_dreq(dreq))
623 if (--dreq->outstanding) { 588 nfs_direct_write_complete(dreq, data->inode);
624 spin_unlock(&dreq->lock);
625 return;
626 }
627 spin_unlock(&dreq->lock);
628
629 nfs_direct_write_complete(dreq, data->inode);
630} 589}
631 590
632static const struct rpc_call_ops nfs_write_direct_ops = { 591static const struct rpc_call_ops nfs_write_direct_ops = {
@@ -635,41 +594,62 @@ static const struct rpc_call_ops nfs_write_direct_ops = {
635}; 594};
636 595
637/* 596/*
638 * For each nfs_write_data struct that was allocated on the list, dispatch 597 * For each wsize'd chunk of the user's buffer, dispatch an NFS WRITE
639 * an NFS WRITE operation 598 * operation. If nfs_writedata_alloc() or get_user_pages() fails,
599 * bail and stop sending more writes. Write length accounting is
600 * handled automatically by nfs_direct_write_result(). Otherwise, if
601 * no requests have been sent, just return an error.
640 */ 602 */
641static void nfs_direct_write_schedule(struct nfs_direct_req *dreq, int sync) 603static ssize_t nfs_direct_write_schedule(struct nfs_direct_req *dreq, unsigned long user_addr, size_t count, loff_t pos, int sync)
642{ 604{
643 struct nfs_open_context *ctx = dreq->ctx; 605 struct nfs_open_context *ctx = dreq->ctx;
644 struct inode *inode = ctx->dentry->d_inode; 606 struct inode *inode = ctx->dentry->d_inode;
645 struct list_head *list = &dreq->list;
646 struct page **pages = dreq->pages;
647 size_t count = dreq->user_count;
648 loff_t pos = dreq->pos;
649 size_t wsize = NFS_SERVER(inode)->wsize; 607 size_t wsize = NFS_SERVER(inode)->wsize;
650 unsigned int curpage, pgbase; 608 unsigned int wpages = nfs_max_pages(wsize);
609 unsigned int pgbase;
610 int result;
611 ssize_t started = 0;
651 612
652 curpage = 0; 613 get_dreq(dreq);
653 pgbase = dreq->user_addr & ~PAGE_MASK; 614
615 pgbase = user_addr & ~PAGE_MASK;
654 do { 616 do {
655 struct nfs_write_data *data; 617 struct nfs_write_data *data;
656 size_t bytes; 618 size_t bytes;
657 619
620 result = -ENOMEM;
621 data = nfs_writedata_alloc(wpages);
622 if (unlikely(!data))
623 break;
624
658 bytes = wsize; 625 bytes = wsize;
659 if (count < wsize) 626 if (count < wsize)
660 bytes = count; 627 bytes = count;
661 628
662 BUG_ON(list_empty(list)); 629 data->npages = nfs_direct_count_pages(user_addr, bytes);
663 data = list_entry(list->next, struct nfs_write_data, pages); 630 down_read(&current->mm->mmap_sem);
631 result = get_user_pages(current, current->mm, user_addr,
632 data->npages, 0, 0, data->pagevec, NULL);
633 up_read(&current->mm->mmap_sem);
634 if (unlikely(result < data->npages)) {
635 if (result > 0)
636 nfs_direct_release_pages(data->pagevec, result);
637 nfs_writedata_release(data);
638 break;
639 }
640
641 get_dreq(dreq);
642
664 list_move_tail(&data->pages, &dreq->rewrite_list); 643 list_move_tail(&data->pages, &dreq->rewrite_list);
665 644
645 data->req = (struct nfs_page *) dreq;
666 data->inode = inode; 646 data->inode = inode;
667 data->cred = ctx->cred; 647 data->cred = ctx->cred;
668 data->args.fh = NFS_FH(inode); 648 data->args.fh = NFS_FH(inode);
669 data->args.context = ctx; 649 data->args.context = ctx;
670 data->args.offset = pos; 650 data->args.offset = pos;
671 data->args.pgbase = pgbase; 651 data->args.pgbase = pgbase;
672 data->args.pages = &pages[curpage]; 652 data->args.pages = data->pagevec;
673 data->args.count = bytes; 653 data->args.count = bytes;
674 data->res.fattr = &data->fattr; 654 data->res.fattr = &data->fattr;
675 data->res.count = bytes; 655 data->res.count = bytes;
@@ -693,19 +673,26 @@ static void nfs_direct_write_schedule(struct nfs_direct_req *dreq, int sync)
693 bytes, 673 bytes,
694 (unsigned long long)data->args.offset); 674 (unsigned long long)data->args.offset);
695 675
676 started += bytes;
677 user_addr += bytes;
696 pos += bytes; 678 pos += bytes;
697 pgbase += bytes; 679 pgbase += bytes;
698 curpage += pgbase >> PAGE_SHIFT;
699 pgbase &= ~PAGE_MASK; 680 pgbase &= ~PAGE_MASK;
700 681
701 count -= bytes; 682 count -= bytes;
702 } while (count != 0); 683 } while (count != 0);
703 BUG_ON(!list_empty(list)); 684
685 if (put_dreq(dreq))
686 nfs_direct_write_complete(dreq, inode);
687
688 if (started)
689 return 0;
690 return result < 0 ? (ssize_t) result : -EFAULT;
704} 691}
705 692
706static ssize_t nfs_direct_write(struct kiocb *iocb, unsigned long user_addr, size_t count, loff_t pos, struct page **pages, int nr_pages) 693static ssize_t nfs_direct_write(struct kiocb *iocb, unsigned long user_addr, size_t count, loff_t pos)
707{ 694{
708 ssize_t result; 695 ssize_t result = 0;
709 sigset_t oldset; 696 sigset_t oldset;
710 struct inode *inode = iocb->ki_filp->f_mapping->host; 697 struct inode *inode = iocb->ki_filp->f_mapping->host;
711 struct rpc_clnt *clnt = NFS_CLIENT(inode); 698 struct rpc_clnt *clnt = NFS_CLIENT(inode);
@@ -713,17 +700,14 @@ static ssize_t nfs_direct_write(struct kiocb *iocb, unsigned long user_addr, siz
713 size_t wsize = NFS_SERVER(inode)->wsize; 700 size_t wsize = NFS_SERVER(inode)->wsize;
714 int sync = 0; 701 int sync = 0;
715 702
716 dreq = nfs_direct_write_alloc(count, wsize); 703 dreq = nfs_direct_req_alloc();
717 if (!dreq) 704 if (!dreq)
718 return -ENOMEM; 705 return -ENOMEM;
706 nfs_alloc_commit_data(dreq);
707
719 if (dreq->commit_data == NULL || count < wsize) 708 if (dreq->commit_data == NULL || count < wsize)
720 sync = FLUSH_STABLE; 709 sync = FLUSH_STABLE;
721 710
722 dreq->user_addr = user_addr;
723 dreq->user_count = count;
724 dreq->pos = pos;
725 dreq->pages = pages;
726 dreq->npages = nr_pages;
727 dreq->inode = inode; 711 dreq->inode = inode;
728 dreq->ctx = get_nfs_open_context((struct nfs_open_context *)iocb->ki_filp->private_data); 712 dreq->ctx = get_nfs_open_context((struct nfs_open_context *)iocb->ki_filp->private_data);
729 if (!is_sync_kiocb(iocb)) 713 if (!is_sync_kiocb(iocb))
@@ -734,8 +718,9 @@ static ssize_t nfs_direct_write(struct kiocb *iocb, unsigned long user_addr, siz
734 nfs_begin_data_update(inode); 718 nfs_begin_data_update(inode);
735 719
736 rpc_clnt_sigmask(clnt, &oldset); 720 rpc_clnt_sigmask(clnt, &oldset);
737 nfs_direct_write_schedule(dreq, sync); 721 result = nfs_direct_write_schedule(dreq, user_addr, count, pos, sync);
738 result = nfs_direct_wait(dreq); 722 if (!result)
723 result = nfs_direct_wait(dreq);
739 rpc_clnt_sigunmask(clnt, &oldset); 724 rpc_clnt_sigunmask(clnt, &oldset);
740 725
741 return result; 726 return result;
@@ -765,8 +750,6 @@ static ssize_t nfs_direct_write(struct kiocb *iocb, unsigned long user_addr, siz
765ssize_t nfs_file_direct_read(struct kiocb *iocb, char __user *buf, size_t count, loff_t pos) 750ssize_t nfs_file_direct_read(struct kiocb *iocb, char __user *buf, size_t count, loff_t pos)
766{ 751{
767 ssize_t retval = -EINVAL; 752 ssize_t retval = -EINVAL;
768 int page_count;
769 struct page **pages;
770 struct file *file = iocb->ki_filp; 753 struct file *file = iocb->ki_filp;
771 struct address_space *mapping = file->f_mapping; 754 struct address_space *mapping = file->f_mapping;
772 755
@@ -788,14 +771,7 @@ ssize_t nfs_file_direct_read(struct kiocb *iocb, char __user *buf, size_t count,
788 if (retval) 771 if (retval)
789 goto out; 772 goto out;
790 773
791 retval = nfs_get_user_pages(READ, (unsigned long) buf, 774 retval = nfs_direct_read(iocb, (unsigned long) buf, count, pos);
792 count, &pages);
793 if (retval < 0)
794 goto out;
795 page_count = retval;
796
797 retval = nfs_direct_read(iocb, (unsigned long) buf, count, pos,
798 pages, page_count);
799 if (retval > 0) 775 if (retval > 0)
800 iocb->ki_pos = pos + retval; 776 iocb->ki_pos = pos + retval;
801 777
@@ -831,8 +807,6 @@ out:
831ssize_t nfs_file_direct_write(struct kiocb *iocb, const char __user *buf, size_t count, loff_t pos) 807ssize_t nfs_file_direct_write(struct kiocb *iocb, const char __user *buf, size_t count, loff_t pos)
832{ 808{
833 ssize_t retval; 809 ssize_t retval;
834 int page_count;
835 struct page **pages;
836 struct file *file = iocb->ki_filp; 810 struct file *file = iocb->ki_filp;
837 struct address_space *mapping = file->f_mapping; 811 struct address_space *mapping = file->f_mapping;
838 812
@@ -860,14 +834,7 @@ ssize_t nfs_file_direct_write(struct kiocb *iocb, const char __user *buf, size_t
860 if (retval) 834 if (retval)
861 goto out; 835 goto out;
862 836
863 retval = nfs_get_user_pages(WRITE, (unsigned long) buf, 837 retval = nfs_direct_write(iocb, (unsigned long) buf, count, pos);
864 count, &pages);
865 if (retval < 0)
866 goto out;
867 page_count = retval;
868
869 retval = nfs_direct_write(iocb, (unsigned long) buf, count,
870 pos, pages, page_count);
871 838
872 /* 839 /*
873 * XXX: nfs_end_data_update() already ensures this file's 840 * XXX: nfs_end_data_update() already ensures this file's
diff --git a/fs/nfs/namespace.c b/fs/nfs/namespace.c
index 19b98ca468eb..86b3169c8cac 100644
--- a/fs/nfs/namespace.c
+++ b/fs/nfs/namespace.c
@@ -51,7 +51,7 @@ char *nfs_path(const char *base, const struct dentry *dentry,
51 namelen = dentry->d_name.len; 51 namelen = dentry->d_name.len;
52 buflen -= namelen + 1; 52 buflen -= namelen + 1;
53 if (buflen < 0) 53 if (buflen < 0)
54 goto Elong; 54 goto Elong_unlock;
55 end -= namelen; 55 end -= namelen;
56 memcpy(end, dentry->d_name.name, namelen); 56 memcpy(end, dentry->d_name.name, namelen);
57 *--end = '/'; 57 *--end = '/';
@@ -68,6 +68,8 @@ char *nfs_path(const char *base, const struct dentry *dentry,
68 end -= namelen; 68 end -= namelen;
69 memcpy(end, base, namelen); 69 memcpy(end, base, namelen);
70 return end; 70 return end;
71Elong_unlock:
72 spin_unlock(&dcache_lock);
71Elong: 73Elong:
72 return ERR_PTR(-ENAMETOOLONG); 74 return ERR_PTR(-ENAMETOOLONG);
73} 75}
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index b4916b092194..e6ee97f19d81 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -3144,9 +3144,6 @@ static int do_vfs_lock(struct file *file, struct file_lock *fl)
3144 default: 3144 default:
3145 BUG(); 3145 BUG();
3146 } 3146 }
3147 if (res < 0)
3148 printk(KERN_WARNING "%s: VFS is out of sync with lock manager!\n",
3149 __FUNCTION__);
3150 return res; 3147 return res;
3151} 3148}
3152 3149
@@ -3258,8 +3255,6 @@ static struct rpc_task *nfs4_do_unlck(struct file_lock *fl,
3258 return ERR_PTR(-ENOMEM); 3255 return ERR_PTR(-ENOMEM);
3259 } 3256 }
3260 3257
3261 /* Unlock _before_ we do the RPC call */
3262 do_vfs_lock(fl->fl_file, fl);
3263 return rpc_run_task(NFS_CLIENT(lsp->ls_state->inode), RPC_TASK_ASYNC, &nfs4_locku_ops, data); 3258 return rpc_run_task(NFS_CLIENT(lsp->ls_state->inode), RPC_TASK_ASYNC, &nfs4_locku_ops, data);
3264} 3259}
3265 3260
@@ -3270,30 +3265,28 @@ static int nfs4_proc_unlck(struct nfs4_state *state, int cmd, struct file_lock *
3270 struct rpc_task *task; 3265 struct rpc_task *task;
3271 int status = 0; 3266 int status = 0;
3272 3267
3273 /* Is this a delegated lock? */
3274 if (test_bit(NFS_DELEGATED_STATE, &state->flags))
3275 goto out_unlock;
3276 /* Is this open_owner holding any locks on the server? */
3277 if (test_bit(LK_STATE_IN_USE, &state->flags) == 0)
3278 goto out_unlock;
3279
3280 status = nfs4_set_lock_state(state, request); 3268 status = nfs4_set_lock_state(state, request);
3269 /* Unlock _before_ we do the RPC call */
3270 request->fl_flags |= FL_EXISTS;
3271 if (do_vfs_lock(request->fl_file, request) == -ENOENT)
3272 goto out;
3281 if (status != 0) 3273 if (status != 0)
3282 goto out_unlock; 3274 goto out;
3275 /* Is this a delegated lock? */
3276 if (test_bit(NFS_DELEGATED_STATE, &state->flags))
3277 goto out;
3283 lsp = request->fl_u.nfs4_fl.owner; 3278 lsp = request->fl_u.nfs4_fl.owner;
3284 status = -ENOMEM;
3285 seqid = nfs_alloc_seqid(&lsp->ls_seqid); 3279 seqid = nfs_alloc_seqid(&lsp->ls_seqid);
3280 status = -ENOMEM;
3286 if (seqid == NULL) 3281 if (seqid == NULL)
3287 goto out_unlock; 3282 goto out;
3288 task = nfs4_do_unlck(request, request->fl_file->private_data, lsp, seqid); 3283 task = nfs4_do_unlck(request, request->fl_file->private_data, lsp, seqid);
3289 status = PTR_ERR(task); 3284 status = PTR_ERR(task);
3290 if (IS_ERR(task)) 3285 if (IS_ERR(task))
3291 goto out_unlock; 3286 goto out;
3292 status = nfs4_wait_for_completion_rpc_task(task); 3287 status = nfs4_wait_for_completion_rpc_task(task);
3293 rpc_release_task(task); 3288 rpc_release_task(task);
3294 return status; 3289out:
3295out_unlock:
3296 do_vfs_lock(request->fl_file, request);
3297 return status; 3290 return status;
3298} 3291}
3299 3292
@@ -3461,10 +3454,10 @@ static int nfs4_lock_reclaim(struct nfs4_state *state, struct file_lock *request
3461 struct nfs4_exception exception = { }; 3454 struct nfs4_exception exception = { };
3462 int err; 3455 int err;
3463 3456
3464 /* Cache the lock if possible... */
3465 if (test_bit(NFS_DELEGATED_STATE, &state->flags))
3466 return 0;
3467 do { 3457 do {
3458 /* Cache the lock if possible... */
3459 if (test_bit(NFS_DELEGATED_STATE, &state->flags) != 0)
3460 return 0;
3468 err = _nfs4_do_setlk(state, F_SETLK, request, 1); 3461 err = _nfs4_do_setlk(state, F_SETLK, request, 1);
3469 if (err != -NFS4ERR_DELAY) 3462 if (err != -NFS4ERR_DELAY)
3470 break; 3463 break;
@@ -3483,6 +3476,8 @@ static int nfs4_lock_expired(struct nfs4_state *state, struct file_lock *request
3483 if (err != 0) 3476 if (err != 0)
3484 return err; 3477 return err;
3485 do { 3478 do {
3479 if (test_bit(NFS_DELEGATED_STATE, &state->flags) != 0)
3480 return 0;
3486 err = _nfs4_do_setlk(state, F_SETLK, request, 0); 3481 err = _nfs4_do_setlk(state, F_SETLK, request, 0);
3487 if (err != -NFS4ERR_DELAY) 3482 if (err != -NFS4ERR_DELAY)
3488 break; 3483 break;
@@ -3494,29 +3489,42 @@ static int nfs4_lock_expired(struct nfs4_state *state, struct file_lock *request
3494static int _nfs4_proc_setlk(struct nfs4_state *state, int cmd, struct file_lock *request) 3489static int _nfs4_proc_setlk(struct nfs4_state *state, int cmd, struct file_lock *request)
3495{ 3490{
3496 struct nfs4_client *clp = state->owner->so_client; 3491 struct nfs4_client *clp = state->owner->so_client;
3492 unsigned char fl_flags = request->fl_flags;
3497 int status; 3493 int status;
3498 3494
3499 /* Is this a delegated open? */ 3495 /* Is this a delegated open? */
3500 if (NFS_I(state->inode)->delegation_state != 0) {
3501 /* Yes: cache locks! */
3502 status = do_vfs_lock(request->fl_file, request);
3503 /* ...but avoid races with delegation recall... */
3504 if (status < 0 || test_bit(NFS_DELEGATED_STATE, &state->flags))
3505 return status;
3506 }
3507 down_read(&clp->cl_sem);
3508 status = nfs4_set_lock_state(state, request); 3496 status = nfs4_set_lock_state(state, request);
3509 if (status != 0) 3497 if (status != 0)
3510 goto out; 3498 goto out;
3499 request->fl_flags |= FL_ACCESS;
3500 status = do_vfs_lock(request->fl_file, request);
3501 if (status < 0)
3502 goto out;
3503 down_read(&clp->cl_sem);
3504 if (test_bit(NFS_DELEGATED_STATE, &state->flags)) {
3505 struct nfs_inode *nfsi = NFS_I(state->inode);
3506 /* Yes: cache locks! */
3507 down_read(&nfsi->rwsem);
3508 /* ...but avoid races with delegation recall... */
3509 if (test_bit(NFS_DELEGATED_STATE, &state->flags)) {
3510 request->fl_flags = fl_flags & ~FL_SLEEP;
3511 status = do_vfs_lock(request->fl_file, request);
3512 up_read(&nfsi->rwsem);
3513 goto out_unlock;
3514 }
3515 up_read(&nfsi->rwsem);
3516 }
3511 status = _nfs4_do_setlk(state, cmd, request, 0); 3517 status = _nfs4_do_setlk(state, cmd, request, 0);
3512 if (status != 0) 3518 if (status != 0)
3513 goto out; 3519 goto out_unlock;
3514 /* Note: we always want to sleep here! */ 3520 /* Note: we always want to sleep here! */
3515 request->fl_flags |= FL_SLEEP; 3521 request->fl_flags = fl_flags | FL_SLEEP;
3516 if (do_vfs_lock(request->fl_file, request) < 0) 3522 if (do_vfs_lock(request->fl_file, request) < 0)
3517 printk(KERN_WARNING "%s: VFS is out of sync with lock manager!\n", __FUNCTION__); 3523 printk(KERN_WARNING "%s: VFS is out of sync with lock manager!\n", __FUNCTION__);
3518out: 3524out_unlock:
3519 up_read(&clp->cl_sem); 3525 up_read(&clp->cl_sem);
3526out:
3527 request->fl_flags = fl_flags;
3520 return status; 3528 return status;
3521} 3529}
3522 3530
diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index 52bf634260a1..65c0c5b32351 100644
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -63,7 +63,7 @@ struct nfs_read_data *nfs_readdata_alloc(unsigned int pagecount)
63 return p; 63 return p;
64} 64}
65 65
66void nfs_readdata_free(struct nfs_read_data *p) 66static void nfs_readdata_free(struct nfs_read_data *p)
67{ 67{
68 if (p && (p->pagevec != &p->page_array[0])) 68 if (p && (p->pagevec != &p->page_array[0]))
69 kfree(p->pagevec); 69 kfree(p->pagevec);
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index bca5734ca9fb..50774991f8d5 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -137,7 +137,7 @@ struct nfs_write_data *nfs_writedata_alloc(unsigned int pagecount)
137 return p; 137 return p;
138} 138}
139 139
140void nfs_writedata_free(struct nfs_write_data *p) 140static void nfs_writedata_free(struct nfs_write_data *p)
141{ 141{
142 if (p && (p->pagevec != &p->page_array[0])) 142 if (p && (p->pagevec != &p->page_array[0]))
143 kfree(p->pagevec); 143 kfree(p->pagevec);
@@ -578,7 +578,7 @@ static int nfs_wait_on_requests(struct inode *inode, unsigned long idx_start, un
578 return ret; 578 return ret;
579} 579}
580 580
581static void nfs_cancel_requests(struct list_head *head) 581static void nfs_cancel_dirty_list(struct list_head *head)
582{ 582{
583 struct nfs_page *req; 583 struct nfs_page *req;
584 while(!list_empty(head)) { 584 while(!list_empty(head)) {
@@ -589,6 +589,19 @@ static void nfs_cancel_requests(struct list_head *head)
589 } 589 }
590} 590}
591 591
592static void nfs_cancel_commit_list(struct list_head *head)
593{
594 struct nfs_page *req;
595
596 while(!list_empty(head)) {
597 req = nfs_list_entry(head->next);
598 nfs_list_remove_request(req);
599 nfs_inode_remove_request(req);
600 nfs_clear_page_writeback(req);
601 dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS);
602 }
603}
604
592/* 605/*
593 * nfs_scan_dirty - Scan an inode for dirty requests 606 * nfs_scan_dirty - Scan an inode for dirty requests
594 * @inode: NFS inode to scan 607 * @inode: NFS inode to scan
@@ -1381,6 +1394,7 @@ nfs_commit_list(struct inode *inode, struct list_head *head, int how)
1381 nfs_list_remove_request(req); 1394 nfs_list_remove_request(req);
1382 nfs_mark_request_commit(req); 1395 nfs_mark_request_commit(req);
1383 nfs_clear_page_writeback(req); 1396 nfs_clear_page_writeback(req);
1397 dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS);
1384 } 1398 }
1385 return -ENOMEM; 1399 return -ENOMEM;
1386} 1400}
@@ -1499,7 +1513,7 @@ int nfs_sync_inode_wait(struct inode *inode, unsigned long idx_start,
1499 if (pages != 0) { 1513 if (pages != 0) {
1500 spin_unlock(&nfsi->req_lock); 1514 spin_unlock(&nfsi->req_lock);
1501 if (how & FLUSH_INVALIDATE) 1515 if (how & FLUSH_INVALIDATE)
1502 nfs_cancel_requests(&head); 1516 nfs_cancel_dirty_list(&head);
1503 else 1517 else
1504 ret = nfs_flush_list(inode, &head, pages, how); 1518 ret = nfs_flush_list(inode, &head, pages, how);
1505 spin_lock(&nfsi->req_lock); 1519 spin_lock(&nfsi->req_lock);
@@ -1512,7 +1526,7 @@ int nfs_sync_inode_wait(struct inode *inode, unsigned long idx_start,
1512 break; 1526 break;
1513 if (how & FLUSH_INVALIDATE) { 1527 if (how & FLUSH_INVALIDATE) {
1514 spin_unlock(&nfsi->req_lock); 1528 spin_unlock(&nfsi->req_lock);
1515 nfs_cancel_requests(&head); 1529 nfs_cancel_commit_list(&head);
1516 spin_lock(&nfsi->req_lock); 1530 spin_lock(&nfsi->req_lock);
1517 continue; 1531 continue;
1518 } 1532 }
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index b0e095ea0c03..ee4eff27aedc 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -721,6 +721,12 @@ nfsd4_proc_null(struct svc_rqst *rqstp, void *argp, void *resp)
721 return nfs_ok; 721 return nfs_ok;
722} 722}
723 723
724static inline void nfsd4_increment_op_stats(u32 opnum)
725{
726 if (opnum >= FIRST_NFS4_OP && opnum <= LAST_NFS4_OP)
727 nfsdstats.nfs4_opcount[opnum]++;
728}
729
724 730
725/* 731/*
726 * COMPOUND call. 732 * COMPOUND call.
@@ -930,6 +936,8 @@ encode_op:
930 /* XXX Ugh, we need to get rid of this kind of special case: */ 936 /* XXX Ugh, we need to get rid of this kind of special case: */
931 if (op->opnum == OP_READ && op->u.read.rd_filp) 937 if (op->opnum == OP_READ && op->u.read.rd_filp)
932 fput(op->u.read.rd_filp); 938 fput(op->u.read.rd_filp);
939
940 nfsd4_increment_op_stats(op->opnum);
933 } 941 }
934 942
935out: 943out:
diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c
index ecc439d2565f..501d83884530 100644
--- a/fs/nfsd/nfsfh.c
+++ b/fs/nfsd/nfsfh.c
@@ -187,6 +187,11 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access)
187 goto out; 187 goto out;
188 } 188 }
189 189
190 /* Set user creds for this exportpoint */
191 error = nfserrno(nfsd_setuser(rqstp, exp));
192 if (error)
193 goto out;
194
190 /* 195 /*
191 * Look up the dentry using the NFS file handle. 196 * Look up the dentry using the NFS file handle.
192 */ 197 */
@@ -241,16 +246,17 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access)
241 dprintk("nfsd: fh_verify - just checking\n"); 246 dprintk("nfsd: fh_verify - just checking\n");
242 dentry = fhp->fh_dentry; 247 dentry = fhp->fh_dentry;
243 exp = fhp->fh_export; 248 exp = fhp->fh_export;
249 /* Set user creds for this exportpoint; necessary even
250 * in the "just checking" case because this may be a
251 * filehandle that was created by fh_compose, and that
252 * is about to be used in another nfsv4 compound
253 * operation */
254 error = nfserrno(nfsd_setuser(rqstp, exp));
255 if (error)
256 goto out;
244 } 257 }
245 cache_get(&exp->h); 258 cache_get(&exp->h);
246 259
247 /* Set user creds for this exportpoint; necessary even in the "just
248 * checking" case because this may be a filehandle that was created by
249 * fh_compose, and that is about to be used in another nfsv4 compound
250 * operation */
251 error = nfserrno(nfsd_setuser(rqstp, exp));
252 if (error)
253 goto out;
254 260
255 error = nfsd_mode_check(rqstp, dentry->d_inode->i_mode, type); 261 error = nfsd_mode_check(rqstp, dentry->d_inode->i_mode, type);
256 if (error) 262 if (error)
diff --git a/fs/nfsd/stats.c b/fs/nfsd/stats.c
index 57265d563804..71944cddf680 100644
--- a/fs/nfsd/stats.c
+++ b/fs/nfsd/stats.c
@@ -72,6 +72,16 @@ static int nfsd_proc_show(struct seq_file *seq, void *v)
72 /* show my rpc info */ 72 /* show my rpc info */
73 svc_seq_show(seq, &nfsd_svcstats); 73 svc_seq_show(seq, &nfsd_svcstats);
74 74
75#ifdef CONFIG_NFSD_V4
76 /* Show count for individual nfsv4 operations */
77 /* Writing operation numbers 0 1 2 also for maintaining uniformity */
78 seq_printf(seq,"proc4ops %u", LAST_NFS4_OP + 1);
79 for (i = 0; i <= LAST_NFS4_OP; i++)
80 seq_printf(seq, " %u", nfsdstats.nfs4_opcount[i]);
81
82 seq_putc(seq, '\n');
83#endif
84
75 return 0; 85 return 0;
76} 86}
77 87
diff --git a/fs/partitions/Kconfig b/fs/partitions/Kconfig
index c9a478099281..e478f1941831 100644
--- a/fs/partitions/Kconfig
+++ b/fs/partitions/Kconfig
@@ -99,7 +99,7 @@ config IBM_PARTITION
99 99
100config MAC_PARTITION 100config MAC_PARTITION
101 bool "Macintosh partition map support" if PARTITION_ADVANCED 101 bool "Macintosh partition map support" if PARTITION_ADVANCED
102 default y if MAC 102 default y if (MAC || PPC_PMAC)
103 help 103 help
104 Say Y here if you would like to use hard disks under Linux which 104 Say Y here if you would like to use hard disks under Linux which
105 were partitioned on a Macintosh. 105 were partitioned on a Macintosh.
diff --git a/fs/partitions/check.c b/fs/partitions/check.c
index 839634026eb5..51c6a748df49 100644
--- a/fs/partitions/check.c
+++ b/fs/partitions/check.c
@@ -339,6 +339,7 @@ void add_partition(struct gendisk *disk, int part, sector_t start, sector_t len)
339 p->start_sect = start; 339 p->start_sect = start;
340 p->nr_sects = len; 340 p->nr_sects = len;
341 p->partno = part; 341 p->partno = part;
342 p->policy = disk->policy;
342 343
343 if (isdigit(disk->kobj.name[strlen(disk->kobj.name)-1])) 344 if (isdigit(disk->kobj.name[strlen(disk->kobj.name)-1]))
344 snprintf(p->kobj.name,KOBJ_NAME_LEN,"%sp%d",disk->kobj.name,part); 345 snprintf(p->kobj.name,KOBJ_NAME_LEN,"%sp%d",disk->kobj.name,part);
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 7495d3e20775..0b615d62a159 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -74,6 +74,7 @@
74#include <linux/times.h> 74#include <linux/times.h>
75#include <linux/cpuset.h> 75#include <linux/cpuset.h>
76#include <linux/rcupdate.h> 76#include <linux/rcupdate.h>
77#include <linux/delayacct.h>
77 78
78#include <asm/uaccess.h> 79#include <asm/uaccess.h>
79#include <asm/pgtable.h> 80#include <asm/pgtable.h>
@@ -411,7 +412,7 @@ static int do_task_stat(struct task_struct *task, char * buffer, int whole)
411 412
412 res = sprintf(buffer,"%d (%s) %c %d %d %d %d %d %lu %lu \ 413 res = sprintf(buffer,"%d (%s) %c %d %d %d %d %d %lu %lu \
413%lu %lu %lu %lu %lu %ld %ld %ld %ld %d 0 %llu %lu %ld %lu %lu %lu %lu %lu \ 414%lu %lu %lu %lu %lu %ld %ld %ld %ld %d 0 %llu %lu %ld %lu %lu %lu %lu %lu \
414%lu %lu %lu %lu %lu %lu %lu %lu %d %d %lu %lu\n", 415%lu %lu %lu %lu %lu %lu %lu %lu %d %d %lu %lu %llu\n",
415 task->pid, 416 task->pid,
416 tcomm, 417 tcomm,
417 state, 418 state,
@@ -455,7 +456,8 @@ static int do_task_stat(struct task_struct *task, char * buffer, int whole)
455 task->exit_signal, 456 task->exit_signal,
456 task_cpu(task), 457 task_cpu(task),
457 task->rt_priority, 458 task->rt_priority,
458 task->policy); 459 task->policy,
460 (unsigned long long)delayacct_blkio_ticks(task));
459 if(mm) 461 if(mm)
460 mmput(mm); 462 mmput(mm);
461 return res; 463 return res;
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 243a94af0427..fe8d55fb17cc 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -551,6 +551,27 @@ static int proc_fd_access_allowed(struct inode *inode)
551 return allowed; 551 return allowed;
552} 552}
553 553
554static int proc_setattr(struct dentry *dentry, struct iattr *attr)
555{
556 int error;
557 struct inode *inode = dentry->d_inode;
558
559 if (attr->ia_valid & ATTR_MODE)
560 return -EPERM;
561
562 error = inode_change_ok(inode, attr);
563 if (!error) {
564 error = security_inode_setattr(dentry, attr);
565 if (!error)
566 error = inode_setattr(inode, attr);
567 }
568 return error;
569}
570
571static struct inode_operations proc_def_inode_operations = {
572 .setattr = proc_setattr,
573};
574
554extern struct seq_operations mounts_op; 575extern struct seq_operations mounts_op;
555struct proc_mounts { 576struct proc_mounts {
556 struct seq_file m; 577 struct seq_file m;
@@ -1111,7 +1132,8 @@ out:
1111 1132
1112static struct inode_operations proc_pid_link_inode_operations = { 1133static struct inode_operations proc_pid_link_inode_operations = {
1113 .readlink = proc_pid_readlink, 1134 .readlink = proc_pid_readlink,
1114 .follow_link = proc_pid_follow_link 1135 .follow_link = proc_pid_follow_link,
1136 .setattr = proc_setattr,
1115}; 1137};
1116 1138
1117static int proc_readfd(struct file * filp, void * dirent, filldir_t filldir) 1139static int proc_readfd(struct file * filp, void * dirent, filldir_t filldir)
@@ -1285,6 +1307,7 @@ static struct inode *proc_pid_make_inode(struct super_block * sb, struct task_st
1285 ei = PROC_I(inode); 1307 ei = PROC_I(inode);
1286 inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; 1308 inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
1287 inode->i_ino = fake_ino(task->pid, ino); 1309 inode->i_ino = fake_ino(task->pid, ino);
1310 inode->i_op = &proc_def_inode_operations;
1288 1311
1289 /* 1312 /*
1290 * grab the reference to task. 1313 * grab the reference to task.
@@ -1339,6 +1362,7 @@ static int pid_revalidate(struct dentry *dentry, struct nameidata *nd)
1339 inode->i_uid = 0; 1362 inode->i_uid = 0;
1340 inode->i_gid = 0; 1363 inode->i_gid = 0;
1341 } 1364 }
1365 inode->i_mode &= ~(S_ISUID | S_ISGID);
1342 security_task_to_inode(task, inode); 1366 security_task_to_inode(task, inode);
1343 put_task_struct(task); 1367 put_task_struct(task);
1344 return 1; 1368 return 1;
@@ -1389,6 +1413,7 @@ static int tid_fd_revalidate(struct dentry *dentry, struct nameidata *nd)
1389 inode->i_uid = 0; 1413 inode->i_uid = 0;
1390 inode->i_gid = 0; 1414 inode->i_gid = 0;
1391 } 1415 }
1416 inode->i_mode &= ~(S_ISUID | S_ISGID);
1392 security_task_to_inode(task, inode); 1417 security_task_to_inode(task, inode);
1393 put_task_struct(task); 1418 put_task_struct(task);
1394 return 1; 1419 return 1;
@@ -1527,11 +1552,13 @@ static struct file_operations proc_task_operations = {
1527 */ 1552 */
1528static struct inode_operations proc_fd_inode_operations = { 1553static struct inode_operations proc_fd_inode_operations = {
1529 .lookup = proc_lookupfd, 1554 .lookup = proc_lookupfd,
1555 .setattr = proc_setattr,
1530}; 1556};
1531 1557
1532static struct inode_operations proc_task_inode_operations = { 1558static struct inode_operations proc_task_inode_operations = {
1533 .lookup = proc_task_lookup, 1559 .lookup = proc_task_lookup,
1534 .getattr = proc_task_getattr, 1560 .getattr = proc_task_getattr,
1561 .setattr = proc_setattr,
1535}; 1562};
1536 1563
1537#ifdef CONFIG_SECURITY 1564#ifdef CONFIG_SECURITY
@@ -1845,11 +1872,13 @@ static struct file_operations proc_tid_base_operations = {
1845static struct inode_operations proc_tgid_base_inode_operations = { 1872static struct inode_operations proc_tgid_base_inode_operations = {
1846 .lookup = proc_tgid_base_lookup, 1873 .lookup = proc_tgid_base_lookup,
1847 .getattr = pid_getattr, 1874 .getattr = pid_getattr,
1875 .setattr = proc_setattr,
1848}; 1876};
1849 1877
1850static struct inode_operations proc_tid_base_inode_operations = { 1878static struct inode_operations proc_tid_base_inode_operations = {
1851 .lookup = proc_tid_base_lookup, 1879 .lookup = proc_tid_base_lookup,
1852 .getattr = pid_getattr, 1880 .getattr = pid_getattr,
1881 .setattr = proc_setattr,
1853}; 1882};
1854 1883
1855#ifdef CONFIG_SECURITY 1884#ifdef CONFIG_SECURITY
@@ -1892,11 +1921,13 @@ static struct dentry *proc_tid_attr_lookup(struct inode *dir,
1892static struct inode_operations proc_tgid_attr_inode_operations = { 1921static struct inode_operations proc_tgid_attr_inode_operations = {
1893 .lookup = proc_tgid_attr_lookup, 1922 .lookup = proc_tgid_attr_lookup,
1894 .getattr = pid_getattr, 1923 .getattr = pid_getattr,
1924 .setattr = proc_setattr,
1895}; 1925};
1896 1926
1897static struct inode_operations proc_tid_attr_inode_operations = { 1927static struct inode_operations proc_tid_attr_inode_operations = {
1898 .lookup = proc_tid_attr_lookup, 1928 .lookup = proc_tid_attr_lookup,
1899 .getattr = pid_getattr, 1929 .getattr = pid_getattr,
1930 .setattr = proc_setattr,
1900}; 1931};
1901#endif 1932#endif
1902 1933
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index 6dcef089e18e..49dfb2ab783e 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -192,7 +192,7 @@ int proc_fill_super(struct super_block *s, void *data, int silent)
192{ 192{
193 struct inode * root_inode; 193 struct inode * root_inode;
194 194
195 s->s_flags |= MS_NODIRATIME; 195 s->s_flags |= MS_NODIRATIME | MS_NOSUID | MS_NOEXEC;
196 s->s_blocksize = 1024; 196 s->s_blocksize = 1024;
197 s->s_blocksize_bits = 10; 197 s->s_blocksize_bits = 10;
198 s->s_magic = PROC_SUPER_MAGIC; 198 s->s_magic = PROC_SUPER_MAGIC;
diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c
index 036d14d83627..6a984f64edd7 100644
--- a/fs/proc/kcore.c
+++ b/fs/proc/kcore.c
@@ -42,8 +42,6 @@ const struct file_operations proc_kcore_operations = {
42#define kc_offset_to_vaddr(o) ((o) + PAGE_OFFSET) 42#define kc_offset_to_vaddr(o) ((o) + PAGE_OFFSET)
43#endif 43#endif
44 44
45#define roundup(x, y) ((((x)+((y)-1))/(y))*(y))
46
47/* An ELF note in memory */ 45/* An ELF note in memory */
48struct memelfnote 46struct memelfnote
49{ 47{
@@ -384,7 +382,7 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos)
384 */ 382 */
385 if (n) { 383 if (n) {
386 if (clear_user(buffer + tsz - n, 384 if (clear_user(buffer + tsz - n,
387 tsz - n)) 385 n))
388 return -EFAULT; 386 return -EFAULT;
389 } 387 }
390 } else { 388 } else {
diff --git a/fs/ramfs/file-nommu.c b/fs/ramfs/file-nommu.c
index 99fffc9e1bfd..677139b48e00 100644
--- a/fs/ramfs/file-nommu.c
+++ b/fs/ramfs/file-nommu.c
@@ -283,9 +283,9 @@ unsigned long ramfs_nommu_get_unmapped_area(struct file *file,
283 283
284/*****************************************************************************/ 284/*****************************************************************************/
285/* 285/*
286 * set up a mapping 286 * set up a mapping for shared memory segments
287 */ 287 */
288int ramfs_nommu_mmap(struct file *file, struct vm_area_struct *vma) 288int ramfs_nommu_mmap(struct file *file, struct vm_area_struct *vma)
289{ 289{
290 return 0; 290 return vma->vm_flags & VM_SHARED ? 0 : -ENOSYS;
291} 291}
diff --git a/fs/read_write.c b/fs/read_write.c
index 5bc0e9234f9d..d4cb3183c99c 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -436,7 +436,7 @@ unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, size_t to)
436 return seg; 436 return seg;
437} 437}
438 438
439EXPORT_SYMBOL(iov_shorten); 439EXPORT_UNUSED_SYMBOL(iov_shorten); /* June 2006 */
440 440
441/* A write operation does a read from user space and vice versa */ 441/* A write operation does a read from user space and vice versa */
442#define vrfy_dir(type) ((type) == READ ? VERIFY_WRITE : VERIFY_READ) 442#define vrfy_dir(type) ((type) == READ ? VERIFY_WRITE : VERIFY_READ)
diff --git a/fs/reiserfs/file.c b/fs/reiserfs/file.c
index 752cea12e30f..f318b58510fd 100644
--- a/fs/reiserfs/file.c
+++ b/fs/reiserfs/file.c
@@ -860,8 +860,12 @@ static int reiserfs_submit_file_region_for_write(struct reiserfs_transaction_han
860 // this sets the proper flags for O_SYNC to trigger a commit 860 // this sets the proper flags for O_SYNC to trigger a commit
861 mark_inode_dirty(inode); 861 mark_inode_dirty(inode);
862 reiserfs_write_unlock(inode->i_sb); 862 reiserfs_write_unlock(inode->i_sb);
863 } else 863 } else {
864 reiserfs_write_lock(inode->i_sb);
865 reiserfs_update_inode_transaction(inode);
864 mark_inode_dirty(inode); 866 mark_inode_dirty(inode);
867 reiserfs_write_unlock(inode->i_sb);
868 }
865 869
866 sd_update = 1; 870 sd_update = 1;
867 } 871 }
diff --git a/fs/reiserfs/procfs.c b/fs/reiserfs/procfs.c
index 5d8a8cfebc70..c533ec1bcaec 100644
--- a/fs/reiserfs/procfs.c
+++ b/fs/reiserfs/procfs.c
@@ -492,9 +492,17 @@ static void add_file(struct super_block *sb, char *name,
492 492
493int reiserfs_proc_info_init(struct super_block *sb) 493int reiserfs_proc_info_init(struct super_block *sb)
494{ 494{
495 char b[BDEVNAME_SIZE];
496 char *s;
497
498 /* Some block devices use /'s */
499 strlcpy(b, reiserfs_bdevname(sb), BDEVNAME_SIZE);
500 s = strchr(b, '/');
501 if (s)
502 *s = '!';
503
495 spin_lock_init(&__PINFO(sb).lock); 504 spin_lock_init(&__PINFO(sb).lock);
496 REISERFS_SB(sb)->procdir = 505 REISERFS_SB(sb)->procdir = proc_mkdir(b, proc_info_root);
497 proc_mkdir(reiserfs_bdevname(sb), proc_info_root);
498 if (REISERFS_SB(sb)->procdir) { 506 if (REISERFS_SB(sb)->procdir) {
499 REISERFS_SB(sb)->procdir->owner = THIS_MODULE; 507 REISERFS_SB(sb)->procdir->owner = THIS_MODULE;
500 REISERFS_SB(sb)->procdir->data = sb; 508 REISERFS_SB(sb)->procdir->data = sb;
@@ -508,13 +516,22 @@ int reiserfs_proc_info_init(struct super_block *sb)
508 return 0; 516 return 0;
509 } 517 }
510 reiserfs_warning(sb, "reiserfs: cannot create /proc/%s/%s", 518 reiserfs_warning(sb, "reiserfs: cannot create /proc/%s/%s",
511 proc_info_root_name, reiserfs_bdevname(sb)); 519 proc_info_root_name, b);
512 return 1; 520 return 1;
513} 521}
514 522
515int reiserfs_proc_info_done(struct super_block *sb) 523int reiserfs_proc_info_done(struct super_block *sb)
516{ 524{
517 struct proc_dir_entry *de = REISERFS_SB(sb)->procdir; 525 struct proc_dir_entry *de = REISERFS_SB(sb)->procdir;
526 char b[BDEVNAME_SIZE];
527 char *s;
528
529 /* Some block devices use /'s */
530 strlcpy(b, reiserfs_bdevname(sb), BDEVNAME_SIZE);
531 s = strchr(b, '/');
532 if (s)
533 *s = '!';
534
518 if (de) { 535 if (de) {
519 remove_proc_entry("journal", de); 536 remove_proc_entry("journal", de);
520 remove_proc_entry("oidmap", de); 537 remove_proc_entry("oidmap", de);
@@ -528,7 +545,7 @@ int reiserfs_proc_info_done(struct super_block *sb)
528 __PINFO(sb).exiting = 1; 545 __PINFO(sb).exiting = 1;
529 spin_unlock(&__PINFO(sb).lock); 546 spin_unlock(&__PINFO(sb).lock);
530 if (proc_info_root) { 547 if (proc_info_root) {
531 remove_proc_entry(reiserfs_bdevname(sb), proc_info_root); 548 remove_proc_entry(b, proc_info_root);
532 REISERFS_SB(sb)->procdir = NULL; 549 REISERFS_SB(sb)->procdir = NULL;
533 } 550 }
534 return 0; 551 return 0;
diff --git a/fs/splice.c b/fs/splice.c
index 05fd2787be98..684bca3d3a10 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -1307,6 +1307,85 @@ asmlinkage long sys_splice(int fd_in, loff_t __user *off_in,
1307} 1307}
1308 1308
1309/* 1309/*
1310 * Make sure there's data to read. Wait for input if we can, otherwise
1311 * return an appropriate error.
1312 */
1313static int link_ipipe_prep(struct pipe_inode_info *pipe, unsigned int flags)
1314{
1315 int ret;
1316
1317 /*
1318 * Check ->nrbufs without the inode lock first. This function
1319 * is speculative anyways, so missing one is ok.
1320 */
1321 if (pipe->nrbufs)
1322 return 0;
1323
1324 ret = 0;
1325 mutex_lock(&pipe->inode->i_mutex);
1326
1327 while (!pipe->nrbufs) {
1328 if (signal_pending(current)) {
1329 ret = -ERESTARTSYS;
1330 break;
1331 }
1332 if (!pipe->writers)
1333 break;
1334 if (!pipe->waiting_writers) {
1335 if (flags & SPLICE_F_NONBLOCK) {
1336 ret = -EAGAIN;
1337 break;
1338 }
1339 }
1340 pipe_wait(pipe);
1341 }
1342
1343 mutex_unlock(&pipe->inode->i_mutex);
1344 return ret;
1345}
1346
1347/*
1348 * Make sure there's writeable room. Wait for room if we can, otherwise
1349 * return an appropriate error.
1350 */
1351static int link_opipe_prep(struct pipe_inode_info *pipe, unsigned int flags)
1352{
1353 int ret;
1354
1355 /*
1356 * Check ->nrbufs without the inode lock first. This function
1357 * is speculative anyways, so missing one is ok.
1358 */
1359 if (pipe->nrbufs < PIPE_BUFFERS)
1360 return 0;
1361
1362 ret = 0;
1363 mutex_lock(&pipe->inode->i_mutex);
1364
1365 while (pipe->nrbufs >= PIPE_BUFFERS) {
1366 if (!pipe->readers) {
1367 send_sig(SIGPIPE, current, 0);
1368 ret = -EPIPE;
1369 break;
1370 }
1371 if (flags & SPLICE_F_NONBLOCK) {
1372 ret = -EAGAIN;
1373 break;
1374 }
1375 if (signal_pending(current)) {
1376 ret = -ERESTARTSYS;
1377 break;
1378 }
1379 pipe->waiting_writers++;
1380 pipe_wait(pipe);
1381 pipe->waiting_writers--;
1382 }
1383
1384 mutex_unlock(&pipe->inode->i_mutex);
1385 return ret;
1386}
1387
1388/*
1310 * Link contents of ipipe to opipe. 1389 * Link contents of ipipe to opipe.
1311 */ 1390 */
1312static int link_pipe(struct pipe_inode_info *ipipe, 1391static int link_pipe(struct pipe_inode_info *ipipe,
@@ -1314,9 +1393,7 @@ static int link_pipe(struct pipe_inode_info *ipipe,
1314 size_t len, unsigned int flags) 1393 size_t len, unsigned int flags)
1315{ 1394{
1316 struct pipe_buffer *ibuf, *obuf; 1395 struct pipe_buffer *ibuf, *obuf;
1317 int ret, do_wakeup, i, ipipe_first; 1396 int ret = 0, i = 0, nbuf;
1318
1319 ret = do_wakeup = ipipe_first = 0;
1320 1397
1321 /* 1398 /*
1322 * Potential ABBA deadlock, work around it by ordering lock 1399 * Potential ABBA deadlock, work around it by ordering lock
@@ -1324,126 +1401,62 @@ static int link_pipe(struct pipe_inode_info *ipipe,
1324 * could deadlock (one doing tee from A -> B, the other from B -> A). 1401 * could deadlock (one doing tee from A -> B, the other from B -> A).
1325 */ 1402 */
1326 if (ipipe->inode < opipe->inode) { 1403 if (ipipe->inode < opipe->inode) {
1327 ipipe_first = 1; 1404 mutex_lock_nested(&ipipe->inode->i_mutex, I_MUTEX_PARENT);
1328 mutex_lock(&ipipe->inode->i_mutex); 1405 mutex_lock_nested(&opipe->inode->i_mutex, I_MUTEX_CHILD);
1329 mutex_lock(&opipe->inode->i_mutex);
1330 } else { 1406 } else {
1331 mutex_lock(&opipe->inode->i_mutex); 1407 mutex_lock_nested(&opipe->inode->i_mutex, I_MUTEX_PARENT);
1332 mutex_lock(&ipipe->inode->i_mutex); 1408 mutex_lock_nested(&ipipe->inode->i_mutex, I_MUTEX_CHILD);
1333 } 1409 }
1334 1410
1335 for (i = 0;; i++) { 1411 do {
1336 if (!opipe->readers) { 1412 if (!opipe->readers) {
1337 send_sig(SIGPIPE, current, 0); 1413 send_sig(SIGPIPE, current, 0);
1338 if (!ret) 1414 if (!ret)
1339 ret = -EPIPE; 1415 ret = -EPIPE;
1340 break; 1416 break;
1341 } 1417 }
1342 if (ipipe->nrbufs - i) {
1343 ibuf = ipipe->bufs + ((ipipe->curbuf + i) & (PIPE_BUFFERS - 1));
1344 1418
1345 /* 1419 /*
1346 * If we have room, fill this buffer 1420 * If we have iterated all input buffers or ran out of
1347 */ 1421 * output room, break.
1348 if (opipe->nrbufs < PIPE_BUFFERS) { 1422 */
1349 int nbuf = (opipe->curbuf + opipe->nrbufs) & (PIPE_BUFFERS - 1); 1423 if (i >= ipipe->nrbufs || opipe->nrbufs >= PIPE_BUFFERS)
1350 1424 break;
1351 /*
1352 * Get a reference to this pipe buffer,
1353 * so we can copy the contents over.
1354 */
1355 ibuf->ops->get(ipipe, ibuf);
1356
1357 obuf = opipe->bufs + nbuf;
1358 *obuf = *ibuf;
1359
1360 /*
1361 * Don't inherit the gift flag, we need to
1362 * prevent multiple steals of this page.
1363 */
1364 obuf->flags &= ~PIPE_BUF_FLAG_GIFT;
1365
1366 if (obuf->len > len)
1367 obuf->len = len;
1368
1369 opipe->nrbufs++;
1370 do_wakeup = 1;
1371 ret += obuf->len;
1372 len -= obuf->len;
1373
1374 if (!len)
1375 break;
1376 if (opipe->nrbufs < PIPE_BUFFERS)
1377 continue;
1378 }
1379
1380 /*
1381 * We have input available, but no output room.
1382 * If we already copied data, return that. If we
1383 * need to drop the opipe lock, it must be ordered
1384 * last to avoid deadlocks.
1385 */
1386 if ((flags & SPLICE_F_NONBLOCK) || !ipipe_first) {
1387 if (!ret)
1388 ret = -EAGAIN;
1389 break;
1390 }
1391 if (signal_pending(current)) {
1392 if (!ret)
1393 ret = -ERESTARTSYS;
1394 break;
1395 }
1396 if (do_wakeup) {
1397 smp_mb();
1398 if (waitqueue_active(&opipe->wait))
1399 wake_up_interruptible(&opipe->wait);
1400 kill_fasync(&opipe->fasync_readers, SIGIO, POLL_IN);
1401 do_wakeup = 0;
1402 }
1403 1425
1404 opipe->waiting_writers++; 1426 ibuf = ipipe->bufs + ((ipipe->curbuf + i) & (PIPE_BUFFERS - 1));
1405 pipe_wait(opipe); 1427 nbuf = (opipe->curbuf + opipe->nrbufs) & (PIPE_BUFFERS - 1);
1406 opipe->waiting_writers--;
1407 continue;
1408 }
1409 1428
1410 /* 1429 /*
1411 * No input buffers, do the usual checks for available 1430 * Get a reference to this pipe buffer,
1412 * writers and blocking and wait if necessary 1431 * so we can copy the contents over.
1413 */ 1432 */
1414 if (!ipipe->writers) 1433 ibuf->ops->get(ipipe, ibuf);
1415 break; 1434
1416 if (!ipipe->waiting_writers) { 1435 obuf = opipe->bufs + nbuf;
1417 if (ret) 1436 *obuf = *ibuf;
1418 break; 1437
1419 }
1420 /* 1438 /*
1421 * pipe_wait() drops the ipipe mutex. To avoid deadlocks 1439 * Don't inherit the gift flag, we need to
1422 * with another process, we can only safely do that if 1440 * prevent multiple steals of this page.
1423 * the ipipe lock is ordered last.
1424 */ 1441 */
1425 if ((flags & SPLICE_F_NONBLOCK) || ipipe_first) { 1442 obuf->flags &= ~PIPE_BUF_FLAG_GIFT;
1426 if (!ret)
1427 ret = -EAGAIN;
1428 break;
1429 }
1430 if (signal_pending(current)) {
1431 if (!ret)
1432 ret = -ERESTARTSYS;
1433 break;
1434 }
1435 1443
1436 if (waitqueue_active(&ipipe->wait)) 1444 if (obuf->len > len)
1437 wake_up_interruptible_sync(&ipipe->wait); 1445 obuf->len = len;
1438 kill_fasync(&ipipe->fasync_writers, SIGIO, POLL_OUT);
1439 1446
1440 pipe_wait(ipipe); 1447 opipe->nrbufs++;
1441 } 1448 ret += obuf->len;
1449 len -= obuf->len;
1450 i++;
1451 } while (len);
1442 1452
1443 mutex_unlock(&ipipe->inode->i_mutex); 1453 mutex_unlock(&ipipe->inode->i_mutex);
1444 mutex_unlock(&opipe->inode->i_mutex); 1454 mutex_unlock(&opipe->inode->i_mutex);
1445 1455
1446 if (do_wakeup) { 1456 /*
1457 * If we put data in the output pipe, wakeup any potential readers.
1458 */
1459 if (ret > 0) {
1447 smp_mb(); 1460 smp_mb();
1448 if (waitqueue_active(&opipe->wait)) 1461 if (waitqueue_active(&opipe->wait))
1449 wake_up_interruptible(&opipe->wait); 1462 wake_up_interruptible(&opipe->wait);
@@ -1464,14 +1477,29 @@ static long do_tee(struct file *in, struct file *out, size_t len,
1464{ 1477{
1465 struct pipe_inode_info *ipipe = in->f_dentry->d_inode->i_pipe; 1478 struct pipe_inode_info *ipipe = in->f_dentry->d_inode->i_pipe;
1466 struct pipe_inode_info *opipe = out->f_dentry->d_inode->i_pipe; 1479 struct pipe_inode_info *opipe = out->f_dentry->d_inode->i_pipe;
1480 int ret = -EINVAL;
1467 1481
1468 /* 1482 /*
1469 * Link ipipe to the two output pipes, consuming as we go along. 1483 * Duplicate the contents of ipipe to opipe without actually
1484 * copying the data.
1470 */ 1485 */
1471 if (ipipe && opipe) 1486 if (ipipe && opipe && ipipe != opipe) {
1472 return link_pipe(ipipe, opipe, len, flags); 1487 /*
1488 * Keep going, unless we encounter an error. The ipipe/opipe
1489 * ordering doesn't really matter.
1490 */
1491 ret = link_ipipe_prep(ipipe, flags);
1492 if (!ret) {
1493 ret = link_opipe_prep(opipe, flags);
1494 if (!ret) {
1495 ret = link_pipe(ipipe, opipe, len, flags);
1496 if (!ret && (flags & SPLICE_F_NONBLOCK))
1497 ret = -EAGAIN;
1498 }
1499 }
1500 }
1473 1501
1474 return -EINVAL; 1502 return ret;
1475} 1503}
1476 1504
1477asmlinkage long sys_tee(int fdin, int fdout, size_t len, unsigned int flags) 1505asmlinkage long sys_tee(int fdin, int fdout, size_t len, unsigned int flags)
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c
index 5e0e31cc46f5..9889e54e1f13 100644
--- a/fs/sysfs/inode.c
+++ b/fs/sysfs/inode.c
@@ -109,6 +109,17 @@ static inline void set_inode_attr(struct inode * inode, struct iattr * iattr)
109 inode->i_ctime = iattr->ia_ctime; 109 inode->i_ctime = iattr->ia_ctime;
110} 110}
111 111
112
113/*
114 * sysfs has a different i_mutex lock order behavior for i_mutex than other
115 * filesystems; sysfs i_mutex is called in many places with subsystem locks
116 * held. At the same time, many of the VFS locking rules do not apply to
117 * sysfs at all (cross directory rename for example). To untangle this mess
118 * (which gives false positives in lockdep), we're giving sysfs inodes their
119 * own class for i_mutex.
120 */
121static struct lock_class_key sysfs_inode_imutex_key;
122
112struct inode * sysfs_new_inode(mode_t mode, struct sysfs_dirent * sd) 123struct inode * sysfs_new_inode(mode_t mode, struct sysfs_dirent * sd)
113{ 124{
114 struct inode * inode = new_inode(sysfs_sb); 125 struct inode * inode = new_inode(sysfs_sb);
@@ -118,6 +129,7 @@ struct inode * sysfs_new_inode(mode_t mode, struct sysfs_dirent * sd)
118 inode->i_mapping->a_ops = &sysfs_aops; 129 inode->i_mapping->a_ops = &sysfs_aops;
119 inode->i_mapping->backing_dev_info = &sysfs_backing_dev_info; 130 inode->i_mapping->backing_dev_info = &sysfs_backing_dev_info;
120 inode->i_op = &sysfs_inode_operations; 131 inode->i_op = &sysfs_inode_operations;
132 lockdep_set_class(&inode->i_mutex, &sysfs_inode_imutex_key);
121 133
122 if (sd->s_iattr) { 134 if (sd->s_iattr) {
123 /* sysfs_dirent has non-default attributes 135 /* sysfs_dirent has non-default attributes
diff --git a/fs/ufs/namei.c b/fs/ufs/namei.c
index abd5f23a426d..d344b411e261 100644
--- a/fs/ufs/namei.c
+++ b/fs/ufs/namei.c
@@ -129,7 +129,7 @@ static int ufs_symlink (struct inode * dir, struct dentry * dentry,
129 struct inode * inode; 129 struct inode * inode;
130 130
131 if (l > sb->s_blocksize) 131 if (l > sb->s_blocksize)
132 goto out; 132 goto out_notlocked;
133 133
134 lock_kernel(); 134 lock_kernel();
135 inode = ufs_new_inode(dir, S_IFLNK | S_IRWXUGO); 135 inode = ufs_new_inode(dir, S_IFLNK | S_IRWXUGO);
@@ -155,6 +155,7 @@ static int ufs_symlink (struct inode * dir, struct dentry * dentry,
155 err = ufs_add_nondir(dentry, inode); 155 err = ufs_add_nondir(dentry, inode);
156out: 156out:
157 unlock_kernel(); 157 unlock_kernel();
158out_notlocked:
158 return err; 159 return err;
159 160
160out_fail: 161out_fail:
diff --git a/fs/xfs/linux-2.6/xfs_buf.h b/fs/xfs/linux-2.6/xfs_buf.h
index ceda3a2859d2..7858703ed84c 100644
--- a/fs/xfs/linux-2.6/xfs_buf.h
+++ b/fs/xfs/linux-2.6/xfs_buf.h
@@ -246,8 +246,8 @@ extern void xfs_buf_trace(xfs_buf_t *, char *, void *, void *);
246#define BUF_BUSY XBF_DONT_BLOCK 246#define BUF_BUSY XBF_DONT_BLOCK
247 247
248#define XFS_BUF_BFLAGS(bp) ((bp)->b_flags) 248#define XFS_BUF_BFLAGS(bp) ((bp)->b_flags)
249#define XFS_BUF_ZEROFLAGS(bp) \ 249#define XFS_BUF_ZEROFLAGS(bp) ((bp)->b_flags &= \
250 ((bp)->b_flags &= ~(XBF_READ|XBF_WRITE|XBF_ASYNC|XBF_DELWRI)) 250 ~(XBF_READ|XBF_WRITE|XBF_ASYNC|XBF_DELWRI|XBF_ORDERED))
251 251
252#define XFS_BUF_STALE(bp) ((bp)->b_flags |= XFS_B_STALE) 252#define XFS_BUF_STALE(bp) ((bp)->b_flags |= XFS_B_STALE)
253#define XFS_BUF_UNSTALE(bp) ((bp)->b_flags &= ~XFS_B_STALE) 253#define XFS_BUF_UNSTALE(bp) ((bp)->b_flags &= ~XFS_B_STALE)
diff --git a/fs/xfs/linux-2.6/xfs_linux.h b/fs/xfs/linux-2.6/xfs_linux.h
index 8c021dc57d1f..a13f75c1a936 100644
--- a/fs/xfs/linux-2.6/xfs_linux.h
+++ b/fs/xfs/linux-2.6/xfs_linux.h
@@ -215,7 +215,6 @@ BUFFER_FNS(PrivateStart, unwritten);
215#define MIN(a,b) (min(a,b)) 215#define MIN(a,b) (min(a,b))
216#define MAX(a,b) (max(a,b)) 216#define MAX(a,b) (max(a,b))
217#define howmany(x, y) (((x)+((y)-1))/(y)) 217#define howmany(x, y) (((x)+((y)-1))/(y))
218#define roundup(x, y) ((((x)+((y)-1))/(y))*(y))
219 218
220/* 219/*
221 * Various platform dependent calls that don't fit anywhere else 220 * Various platform dependent calls that don't fit anywhere else
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index 9bdef9d51900..4754f342a5d3 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -314,6 +314,13 @@ xfs_mountfs_check_barriers(xfs_mount_t *mp)
314 return; 314 return;
315 } 315 }
316 316
317 if (xfs_readonly_buftarg(mp->m_ddev_targp)) {
318 xfs_fs_cmn_err(CE_NOTE, mp,
319 "Disabling barriers, underlying device is readonly");
320 mp->m_flags &= ~XFS_MOUNT_BARRIER;
321 return;
322 }
323
317 error = xfs_barrier_test(mp); 324 error = xfs_barrier_test(mp);
318 if (error) { 325 if (error) {
319 xfs_fs_cmn_err(CE_NOTE, mp, 326 xfs_fs_cmn_err(CE_NOTE, mp,
diff --git a/fs/xfs/quota/xfs_qm_bhv.c b/fs/xfs/quota/xfs_qm_bhv.c
index e95e99f7168f..f137856c3261 100644
--- a/fs/xfs/quota/xfs_qm_bhv.c
+++ b/fs/xfs/quota/xfs_qm_bhv.c
@@ -217,17 +217,24 @@ xfs_qm_statvfs(
217 return 0; 217 return 0;
218 dp = &dqp->q_core; 218 dp = &dqp->q_core;
219 219
220 limit = dp->d_blk_softlimit ? dp->d_blk_softlimit : dp->d_blk_hardlimit; 220 limit = dp->d_blk_softlimit ?
221 be64_to_cpu(dp->d_blk_softlimit) :
222 be64_to_cpu(dp->d_blk_hardlimit);
221 if (limit && statp->f_blocks > limit) { 223 if (limit && statp->f_blocks > limit) {
222 statp->f_blocks = limit; 224 statp->f_blocks = limit;
223 statp->f_bfree = (statp->f_blocks > dp->d_bcount) ? 225 statp->f_bfree =
224 (statp->f_blocks - dp->d_bcount) : 0; 226 (statp->f_blocks > be64_to_cpu(dp->d_bcount)) ?
227 (statp->f_blocks - be64_to_cpu(dp->d_bcount)) : 0;
225 } 228 }
226 limit = dp->d_ino_softlimit ? dp->d_ino_softlimit : dp->d_ino_hardlimit; 229
230 limit = dp->d_ino_softlimit ?
231 be64_to_cpu(dp->d_ino_softlimit) :
232 be64_to_cpu(dp->d_ino_hardlimit);
227 if (limit && statp->f_files > limit) { 233 if (limit && statp->f_files > limit) {
228 statp->f_files = limit; 234 statp->f_files = limit;
229 statp->f_ffree = (statp->f_files > dp->d_icount) ? 235 statp->f_ffree =
230 (statp->f_ffree - dp->d_icount) : 0; 236 (statp->f_files > be64_to_cpu(dp->d_icount)) ?
237 (statp->f_ffree - be64_to_cpu(dp->d_icount)) : 0;
231 } 238 }
232 239
233 xfs_qm_dqput(dqp); 240 xfs_qm_dqput(dqp);
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 86c1bf0bba9e..1f8ecff8553a 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -334,10 +334,9 @@ xfs_itobp(
334#if !defined(__KERNEL__) 334#if !defined(__KERNEL__)
335 ni = 0; 335 ni = 0;
336#elif defined(DEBUG) 336#elif defined(DEBUG)
337 ni = (imap_flags & XFS_IMAP_BULKSTAT) ? 0 : 337 ni = BBTOB(imap.im_len) >> mp->m_sb.sb_inodelog;
338 (BBTOB(imap.im_len) >> mp->m_sb.sb_inodelog);
339#else /* usual case */ 338#else /* usual case */
340 ni = (imap_flags & XFS_IMAP_BULKSTAT) ? 0 : 1; 339 ni = 1;
341#endif 340#endif
342 341
343 for (i = 0; i < ni; i++) { 342 for (i = 0; i < ni; i++) {
@@ -348,11 +347,15 @@ xfs_itobp(
348 (i << mp->m_sb.sb_inodelog)); 347 (i << mp->m_sb.sb_inodelog));
349 di_ok = INT_GET(dip->di_core.di_magic, ARCH_CONVERT) == XFS_DINODE_MAGIC && 348 di_ok = INT_GET(dip->di_core.di_magic, ARCH_CONVERT) == XFS_DINODE_MAGIC &&
350 XFS_DINODE_GOOD_VERSION(INT_GET(dip->di_core.di_version, ARCH_CONVERT)); 349 XFS_DINODE_GOOD_VERSION(INT_GET(dip->di_core.di_version, ARCH_CONVERT));
351 if (unlikely(XFS_TEST_ERROR(!di_ok, mp, XFS_ERRTAG_ITOBP_INOTOBP, 350 if (unlikely(XFS_TEST_ERROR(!di_ok, mp,
352 XFS_RANDOM_ITOBP_INOTOBP))) { 351 XFS_ERRTAG_ITOBP_INOTOBP,
352 XFS_RANDOM_ITOBP_INOTOBP))) {
353 if (imap_flags & XFS_IMAP_BULKSTAT) {
354 xfs_trans_brelse(tp, bp);
355 return XFS_ERROR(EINVAL);
356 }
353#ifdef DEBUG 357#ifdef DEBUG
354 if (!(imap_flags & XFS_IMAP_BULKSTAT)) 358 cmn_err(CE_ALERT,
355 cmn_err(CE_ALERT,
356 "Device %s - bad inode magic/vsn " 359 "Device %s - bad inode magic/vsn "
357 "daddr %lld #%d (magic=%x)", 360 "daddr %lld #%d (magic=%x)",
358 XFS_BUFTARG_NAME(mp->m_ddev_targp), 361 XFS_BUFTARG_NAME(mp->m_ddev_targp),
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index e730328636c3..21ac1a67e3e0 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -1413,7 +1413,7 @@ xlog_sync(xlog_t *log,
1413 ops = iclog->ic_header.h_num_logops; 1413 ops = iclog->ic_header.h_num_logops;
1414 INT_SET(iclog->ic_header.h_num_logops, ARCH_CONVERT, ops); 1414 INT_SET(iclog->ic_header.h_num_logops, ARCH_CONVERT, ops);
1415 1415
1416 bp = iclog->ic_bp; 1416 bp = iclog->ic_bp;
1417 ASSERT(XFS_BUF_FSPRIVATE2(bp, unsigned long) == (unsigned long)1); 1417 ASSERT(XFS_BUF_FSPRIVATE2(bp, unsigned long) == (unsigned long)1);
1418 XFS_BUF_SET_FSPRIVATE2(bp, (unsigned long)2); 1418 XFS_BUF_SET_FSPRIVATE2(bp, (unsigned long)2);
1419 XFS_BUF_SET_ADDR(bp, BLOCK_LSN(INT_GET(iclog->ic_header.h_lsn, ARCH_CONVERT))); 1419 XFS_BUF_SET_ADDR(bp, BLOCK_LSN(INT_GET(iclog->ic_header.h_lsn, ARCH_CONVERT)));
@@ -1430,15 +1430,14 @@ xlog_sync(xlog_t *log,
1430 } 1430 }
1431 XFS_BUF_SET_PTR(bp, (xfs_caddr_t) &(iclog->ic_header), count); 1431 XFS_BUF_SET_PTR(bp, (xfs_caddr_t) &(iclog->ic_header), count);
1432 XFS_BUF_SET_FSPRIVATE(bp, iclog); /* save for later */ 1432 XFS_BUF_SET_FSPRIVATE(bp, iclog); /* save for later */
1433 XFS_BUF_ZEROFLAGS(bp);
1433 XFS_BUF_BUSY(bp); 1434 XFS_BUF_BUSY(bp);
1434 XFS_BUF_ASYNC(bp); 1435 XFS_BUF_ASYNC(bp);
1435 /* 1436 /*
1436 * Do an ordered write for the log block. 1437 * Do an ordered write for the log block.
1437 * 1438 * Its unnecessary to flush the first split block in the log wrap case.
1438 * It may not be needed to flush the first split block in the log wrap
1439 * case, but do it anyways to be safe -AK
1440 */ 1439 */
1441 if (log->l_mp->m_flags & XFS_MOUNT_BARRIER) 1440 if (!split && (log->l_mp->m_flags & XFS_MOUNT_BARRIER))
1442 XFS_BUF_ORDERED(bp); 1441 XFS_BUF_ORDERED(bp);
1443 1442
1444 ASSERT(XFS_BUF_ADDR(bp) <= log->l_logBBsize-1); 1443 ASSERT(XFS_BUF_ADDR(bp) <= log->l_logBBsize-1);
@@ -1460,7 +1459,7 @@ xlog_sync(xlog_t *log,
1460 return error; 1459 return error;
1461 } 1460 }
1462 if (split) { 1461 if (split) {
1463 bp = iclog->ic_log->l_xbuf; 1462 bp = iclog->ic_log->l_xbuf;
1464 ASSERT(XFS_BUF_FSPRIVATE2(bp, unsigned long) == 1463 ASSERT(XFS_BUF_FSPRIVATE2(bp, unsigned long) ==
1465 (unsigned long)1); 1464 (unsigned long)1);
1466 XFS_BUF_SET_FSPRIVATE2(bp, (unsigned long)2); 1465 XFS_BUF_SET_FSPRIVATE2(bp, (unsigned long)2);
@@ -1468,6 +1467,7 @@ xlog_sync(xlog_t *log,
1468 XFS_BUF_SET_PTR(bp, (xfs_caddr_t)((__psint_t)&(iclog->ic_header)+ 1467 XFS_BUF_SET_PTR(bp, (xfs_caddr_t)((__psint_t)&(iclog->ic_header)+
1469 (__psint_t)count), split); 1468 (__psint_t)count), split);
1470 XFS_BUF_SET_FSPRIVATE(bp, iclog); 1469 XFS_BUF_SET_FSPRIVATE(bp, iclog);
1470 XFS_BUF_ZEROFLAGS(bp);
1471 XFS_BUF_BUSY(bp); 1471 XFS_BUF_BUSY(bp);
1472 XFS_BUF_ASYNC(bp); 1472 XFS_BUF_ASYNC(bp);
1473 if (log->l_mp->m_flags & XFS_MOUNT_BARRIER) 1473 if (log->l_mp->m_flags & XFS_MOUNT_BARRIER)
diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c
index 6c96391f3f1a..b427d220a169 100644
--- a/fs/xfs/xfs_vfsops.c
+++ b/fs/xfs/xfs_vfsops.c
@@ -515,7 +515,7 @@ xfs_mount(
515 if (error) 515 if (error)
516 goto error2; 516 goto error2;
517 517
518 if ((mp->m_flags & XFS_MOUNT_BARRIER) && !(vfsp->vfs_flag & VFS_RDONLY)) 518 if (mp->m_flags & XFS_MOUNT_BARRIER)
519 xfs_mountfs_check_barriers(mp); 519 xfs_mountfs_check_barriers(mp);
520 520
521 error = XFS_IOINIT(vfsp, args, flags); 521 error = XFS_IOINIT(vfsp, args, flags);
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index b492857fe721..9e6c23c360b2 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -63,7 +63,7 @@
63 63
64/* Current ACPICA subsystem version in YYYYMMDD format */ 64/* Current ACPICA subsystem version in YYYYMMDD format */
65 65
66#define ACPI_CA_VERSION 0x20060623 66#define ACPI_CA_VERSION 0x20060707
67 67
68/* 68/*
69 * OS name, used for the _OS object. The _OS object is essentially obsolete, 69 * OS name, used for the _OS object. The _OS object is essentially obsolete,
diff --git a/include/acpi/acinterp.h b/include/acpi/acinterp.h
index 216339a8f1f6..91586d0d5bb5 100644
--- a/include/acpi/acinterp.h
+++ b/include/acpi/acinterp.h
@@ -53,10 +53,14 @@
53#define ACPI_EXD_TABLE_SIZE(name) (sizeof(name) / sizeof (struct acpi_exdump_info)) 53#define ACPI_EXD_TABLE_SIZE(name) (sizeof(name) / sizeof (struct acpi_exdump_info))
54 54
55/* 55/*
56 * If possible, pack the following structure to byte alignment, since we 56 * If possible, pack the following structures to byte alignment, since we
57 * don't care about performance for debug output 57 * don't care about performance for debug output. Two cases where we cannot
58 * pack the structures:
59 *
60 * 1) Hardware does not support misaligned memory transfers
61 * 2) Compiler does not support pointers within packed structures
58 */ 62 */
59#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED 63#if (!defined(ACPI_MISALIGNMENT_NOT_SUPPORTED) && !defined(ACPI_PACKED_POINTERS_NOT_SUPPORTED))
60#pragma pack(1) 64#pragma pack(1)
61#endif 65#endif
62 66
diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h
index 56b802486161..a4d0e73d5aca 100644
--- a/include/acpi/aclocal.h
+++ b/include/acpi/aclocal.h
@@ -127,7 +127,7 @@ typedef u8 acpi_owner_id;
127 127
128/* This Thread ID means that the mutex is not in use (unlocked) */ 128/* This Thread ID means that the mutex is not in use (unlocked) */
129 129
130#define ACPI_MUTEX_NOT_ACQUIRED (u32) -1 130#define ACPI_MUTEX_NOT_ACQUIRED (acpi_thread_id) 0
131 131
132/* Table for the global mutexes */ 132/* Table for the global mutexes */
133 133
@@ -204,7 +204,7 @@ struct acpi_namespace_node {
204/* Namespace Node flags */ 204/* Namespace Node flags */
205 205
206#define ANOBJ_END_OF_PEER_LIST 0x01 /* End-of-list, Peer field points to parent */ 206#define ANOBJ_END_OF_PEER_LIST 0x01 /* End-of-list, Peer field points to parent */
207#define ANOBJ_DATA_WIDTH_32 0x02 /* Parent table uses 32-bit math */ 207#define ANOBJ_RESERVED 0x02 /* Available for future use */
208#define ANOBJ_METHOD_ARG 0x04 /* Node is a method argument */ 208#define ANOBJ_METHOD_ARG 0x04 /* Node is a method argument */
209#define ANOBJ_METHOD_LOCAL 0x08 /* Node is a method local */ 209#define ANOBJ_METHOD_LOCAL 0x08 /* Node is a method local */
210#define ANOBJ_SUBTREE_HAS_INI 0x10 /* Used to optimize device initialization */ 210#define ANOBJ_SUBTREE_HAS_INI 0x10 /* Used to optimize device initialization */
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h
index f1ac6109556e..192fa095a515 100644
--- a/include/acpi/acmacros.h
+++ b/include/acpi/acmacros.h
@@ -724,9 +724,15 @@
724 724
725/* Memory allocation */ 725/* Memory allocation */
726 726
727#ifndef ACPI_ALLOCATE
727#define ACPI_ALLOCATE(a) acpi_ut_allocate((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__) 728#define ACPI_ALLOCATE(a) acpi_ut_allocate((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__)
729#endif
730#ifndef ACPI_ALLOCATE_ZEROED
728#define ACPI_ALLOCATE_ZEROED(a) acpi_ut_allocate_zeroed((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__) 731#define ACPI_ALLOCATE_ZEROED(a) acpi_ut_allocate_zeroed((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__)
729#define ACPI_FREE(a) kfree(a) 732#endif
733#ifndef ACPI_FREE
734#define ACPI_FREE(a) acpio_os_free(a)
735#endif
730#define ACPI_MEM_TRACKING(a) 736#define ACPI_MEM_TRACKING(a)
731 737
732#else 738#else
diff --git a/include/acpi/acresrc.h b/include/acpi/acresrc.h
index ad11fc13fbef..80a3b33571b4 100644
--- a/include/acpi/acresrc.h
+++ b/include/acpi/acresrc.h
@@ -50,9 +50,13 @@
50 50
51/* 51/*
52 * If possible, pack the following structures to byte alignment, since we 52 * If possible, pack the following structures to byte alignment, since we
53 * don't care about performance for debug output 53 * don't care about performance for debug output. Two cases where we cannot
54 * pack the structures:
55 *
56 * 1) Hardware does not support misaligned memory transfers
57 * 2) Compiler does not support pointers within packed structures
54 */ 58 */
55#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED 59#if (!defined(ACPI_MISALIGNMENT_NOT_SUPPORTED) && !defined(ACPI_PACKED_POINTERS_NOT_SUPPORTED))
56#pragma pack(1) 60#pragma pack(1)
57#endif 61#endif
58 62
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index 3f853cabbd41..47faf27913a5 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -59,6 +59,7 @@
59#include <asm/acpi.h> 59#include <asm/acpi.h>
60#include <linux/slab.h> 60#include <linux/slab.h>
61#include <linux/spinlock_types.h> 61#include <linux/spinlock_types.h>
62#include <asm/current.h>
62 63
63/* Host-dependent types and defines */ 64/* Host-dependent types and defines */
64 65
@@ -100,8 +101,30 @@
100 101
101#define acpi_cpu_flags unsigned long 102#define acpi_cpu_flags unsigned long
102 103
103#define acpi_thread_id u32 104#define acpi_thread_id struct task_struct *
104 105
105static inline acpi_thread_id acpi_os_get_thread_id(void) { return 0; } 106static inline acpi_thread_id acpi_os_get_thread_id(void) { return current; }
107
108/*
109 * The irqs_disabled() check is for resume from RAM.
110 * Interrupts are off during resume, just like they are for boot.
111 * However, boot has (system_state != SYSTEM_RUNNING)
112 * to quiet __might_sleep() in kmalloc() and resume does not.
113 */
114#include <acpi/actypes.h>
115static inline void *acpi_os_allocate(acpi_size size) {
116 return kmalloc(size, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL);
117}
118static inline void *acpi_os_allocate_zeroed(acpi_size size) {
119 return kzalloc(size, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL);
120}
121
122static inline void *acpi_os_acquire_object(acpi_cache_t * cache) {
123 return kmem_cache_zalloc(cache, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL);
124}
125
126#define ACPI_ALLOCATE(a) acpi_os_allocate(a)
127#define ACPI_ALLOCATE_ZEROED(a) acpi_os_allocate_zeroed(a)
128#define ACPI_FREE(a) kfree(a)
106 129
107#endif /* __ACLINUX_H__ */ 130#endif /* __ACLINUX_H__ */
diff --git a/include/asm-alpha/barrier.h b/include/asm-alpha/barrier.h
index 681ff581afa5..384dc08d6f53 100644
--- a/include/asm-alpha/barrier.h
+++ b/include/asm-alpha/barrier.h
@@ -30,7 +30,4 @@ __asm__ __volatile__("mb": : :"memory")
30#define set_mb(var, value) \ 30#define set_mb(var, value) \
31do { var = value; mb(); } while (0) 31do { var = value; mb(); } while (0)
32 32
33#define set_wmb(var, value) \
34do { var = value; wmb(); } while (0)
35
36#endif /* __BARRIER_H */ 33#endif /* __BARRIER_H */
diff --git a/include/asm-arm/arch-at91rm9200/irqs.h b/include/asm-arm/arch-at91rm9200/irqs.h
index 2dc93b174a8f..f63842c2c093 100644
--- a/include/asm-arm/arch-at91rm9200/irqs.h
+++ b/include/asm-arm/arch-at91rm9200/irqs.h
@@ -39,12 +39,4 @@
39 */ 39 */
40#define NR_IRQS (NR_AIC_IRQS + (4 * 32)) 40#define NR_IRQS (NR_AIC_IRQS + (4 * 32))
41 41
42
43#ifndef __ASSEMBLY__
44/*
45 * Initialize the IRQ controller.
46 */
47extern void at91rm9200_init_irq(unsigned int priority[]);
48#endif
49
50#endif 42#endif
diff --git a/include/asm-arm/arch-iop3xx/iop331-irqs.h b/include/asm-arm/arch-iop3xx/iop331-irqs.h
index 8ff73d487222..7135ad7e335e 100644
--- a/include/asm-arm/arch-iop3xx/iop331-irqs.h
+++ b/include/asm-arm/arch-iop3xx/iop331-irqs.h
@@ -91,7 +91,6 @@
91#define NR_IRQS NR_IOP331_IRQS 91#define NR_IRQS NR_IOP331_IRQS
92 92
93 93
94#if defined(CONFIG_ARCH_IQ80331)
95/* 94/*
96 * Interrupts available on the IQ80331 board 95 * Interrupts available on the IQ80331 board
97 */ 96 */
@@ -111,7 +110,6 @@
111#define IRQ_IQ80331_INTC IRQ_IOP331_XINT2 110#define IRQ_IQ80331_INTC IRQ_IOP331_XINT2
112#define IRQ_IQ80331_INTD IRQ_IOP331_XINT3 111#define IRQ_IQ80331_INTD IRQ_IOP331_XINT3
113 112
114#elif defined(CONFIG_MACH_IQ80332)
115/* 113/*
116 * Interrupts available on the IQ80332 board 114 * Interrupts available on the IQ80332 board
117 */ 115 */
@@ -131,6 +129,4 @@
131#define IRQ_IQ80332_INTC IRQ_IOP331_XINT2 129#define IRQ_IQ80332_INTC IRQ_IOP331_XINT2
132#define IRQ_IQ80332_INTD IRQ_IOP331_XINT3 130#define IRQ_IQ80332_INTD IRQ_IOP331_XINT3
133 131
134#endif
135
136#endif // _IOP331_IRQ_H_ 132#endif // _IOP331_IRQ_H_
diff --git a/include/asm-arm/arch-omap/clock.h b/include/asm-arm/arch-omap/clock.h
index 3c4eb9fbe48a..f83003f5287b 100644
--- a/include/asm-arm/arch-omap/clock.h
+++ b/include/asm-arm/arch-omap/clock.h
@@ -48,8 +48,6 @@ struct clk_functions {
48}; 48};
49 49
50extern unsigned int mpurate; 50extern unsigned int mpurate;
51extern struct list_head clocks;
52extern spinlock_t clockfw_lock;
53 51
54extern int clk_init(struct clk_functions * custom_clocks); 52extern int clk_init(struct clk_functions * custom_clocks);
55extern int clk_register(struct clk *clk); 53extern int clk_register(struct clk *clk);
diff --git a/include/asm-arm/arch-versatile/platform.h b/include/asm-arm/arch-versatile/platform.h
index 72ef874567d5..2af9d7c9c63c 100644
--- a/include/asm-arm/arch-versatile/platform.h
+++ b/include/asm-arm/arch-versatile/platform.h
@@ -65,6 +65,8 @@
65#define VERSATILE_SYS_OSC1_OFFSET 0x1C 65#define VERSATILE_SYS_OSC1_OFFSET 0x1C
66#endif 66#endif
67 67
68#define VERSATILE_SYS_OSCCLCD_OFFSET 0x1c
69
68#define VERSATILE_SYS_LOCK_OFFSET 0x20 70#define VERSATILE_SYS_LOCK_OFFSET 0x20
69#define VERSATILE_SYS_100HZ_OFFSET 0x24 71#define VERSATILE_SYS_100HZ_OFFSET 0x24
70#define VERSATILE_SYS_CFGDATA1_OFFSET 0x28 72#define VERSATILE_SYS_CFGDATA1_OFFSET 0x28
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h
index 6001febfe63b..0947cbf9b69a 100644
--- a/include/asm-arm/system.h
+++ b/include/asm-arm/system.h
@@ -176,7 +176,6 @@ extern unsigned int user_debug;
176#define wmb() mb() 176#define wmb() mb()
177#define read_barrier_depends() do { } while(0) 177#define read_barrier_depends() do { } while(0)
178#define set_mb(var, value) do { var = value; mb(); } while (0) 178#define set_mb(var, value) do { var = value; mb(); } while (0)
179#define set_wmb(var, value) do { var = value; wmb(); } while (0)
180#define nop() __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t"); 179#define nop() __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t");
181 180
182/* 181/*
diff --git a/include/asm-arm26/system.h b/include/asm-arm26/system.h
index d1f69d706198..00ae32aa1dba 100644
--- a/include/asm-arm26/system.h
+++ b/include/asm-arm26/system.h
@@ -90,7 +90,6 @@ extern unsigned int user_debug;
90 90
91#define read_barrier_depends() do { } while(0) 91#define read_barrier_depends() do { } while(0)
92#define set_mb(var, value) do { var = value; mb(); } while (0) 92#define set_mb(var, value) do { var = value; mb(); } while (0)
93#define set_wmb(var, value) do { var = value; wmb(); } while (0)
94 93
95/* 94/*
96 * We assume knowledge of how 95 * We assume knowledge of how
diff --git a/include/asm-cris/system.h b/include/asm-cris/system.h
index b1c593b6dbff..b869f6161aaa 100644
--- a/include/asm-cris/system.h
+++ b/include/asm-cris/system.h
@@ -17,7 +17,6 @@ extern struct task_struct *resume(struct task_struct *prev, struct task_struct *
17#define wmb() mb() 17#define wmb() mb()
18#define read_barrier_depends() do { } while(0) 18#define read_barrier_depends() do { } while(0)
19#define set_mb(var, value) do { var = value; mb(); } while (0) 19#define set_mb(var, value) do { var = value; mb(); } while (0)
20#define set_wmb(var, value) do { var = value; wmb(); } while (0)
21 20
22#ifdef CONFIG_SMP 21#ifdef CONFIG_SMP
23#define smp_mb() mb() 22#define smp_mb() mb()
diff --git a/include/asm-frv/elf.h b/include/asm-frv/elf.h
index 38656da00e40..7df58a3e6e4a 100644
--- a/include/asm-frv/elf.h
+++ b/include/asm-frv/elf.h
@@ -64,7 +64,7 @@ typedef unsigned long elf_greg_t;
64#define ELF_NGREG (sizeof(struct pt_regs) / sizeof(elf_greg_t)) 64#define ELF_NGREG (sizeof(struct pt_regs) / sizeof(elf_greg_t))
65typedef elf_greg_t elf_gregset_t[ELF_NGREG]; 65typedef elf_greg_t elf_gregset_t[ELF_NGREG];
66 66
67typedef struct fpmedia_struct elf_fpregset_t; 67typedef struct user_fpmedia_regs elf_fpregset_t;
68 68
69/* 69/*
70 * This is used to ensure we don't load something for the wrong architecture. 70 * This is used to ensure we don't load something for the wrong architecture.
@@ -116,6 +116,7 @@ do { \
116} while(0) 116} while(0)
117 117
118#define USE_ELF_CORE_DUMP 118#define USE_ELF_CORE_DUMP
119#define ELF_FDPIC_CORE_EFLAGS EF_FRV_FDPIC
119#define ELF_EXEC_PAGESIZE 16384 120#define ELF_EXEC_PAGESIZE 16384
120 121
121/* This is the location that an ET_DYN program is loaded if exec'ed. Typical 122/* This is the location that an ET_DYN program is loaded if exec'ed. Typical
@@ -125,9 +126,6 @@ do { \
125 126
126#define ELF_ET_DYN_BASE 0x08000000UL 127#define ELF_ET_DYN_BASE 0x08000000UL
127 128
128#define ELF_CORE_COPY_REGS(pr_reg, regs) \
129 memcpy(&pr_reg[0], &regs->sp, 31 * sizeof(uint32_t));
130
131/* This yields a mask that user programs can use to figure out what 129/* This yields a mask that user programs can use to figure out what
132 instruction set this cpu supports. */ 130 instruction set this cpu supports. */
133 131
diff --git a/include/asm-frv/gdb-stub.h b/include/asm-frv/gdb-stub.h
index c58479a4be99..24f9738670bd 100644
--- a/include/asm-frv/gdb-stub.h
+++ b/include/asm-frv/gdb-stub.h
@@ -89,6 +89,7 @@ extern void gdbstub_do_rx(void);
89 89
90extern asmlinkage void __debug_stub_init_break(void); 90extern asmlinkage void __debug_stub_init_break(void);
91extern asmlinkage void __break_hijack_kernel_event(void); 91extern asmlinkage void __break_hijack_kernel_event(void);
92extern asmlinkage void __break_hijack_kernel_event_breaks_here(void);
92extern asmlinkage void start_kernel(void); 93extern asmlinkage void start_kernel(void);
93 94
94extern asmlinkage void gdbstub_rx_handler(void); 95extern asmlinkage void gdbstub_rx_handler(void);
@@ -114,5 +115,26 @@ extern void console_set_baud(unsigned baud);
114#define gdbstub_proto(FMT,...) ({ 0; }) 115#define gdbstub_proto(FMT,...) ({ 0; })
115#endif 116#endif
116 117
118/*
119 * we dedicate GR31 to keeping a pointer to the gdbstub exception frame
120 * - gr31 is destroyed on entry to the gdbstub if !MMU
121 * - gr31 is saved in scr3 on entry to the gdbstub if in !MMU
122 */
123register struct frv_frame0 *__debug_frame0 asm("gr31");
124
125#define __debug_frame (&__debug_frame0->regs)
126#define __debug_user_context (&__debug_frame0->uc)
127#define __debug_regs (&__debug_frame0->debug)
128#define __debug_reg(X) ((unsigned long *) ((unsigned long) &__debug_frame0 + (X)))
129
130struct frv_debug_status {
131 unsigned long bpsr;
132 unsigned long dcr;
133 unsigned long brr;
134 unsigned long nmar;
135};
136
137extern struct frv_debug_status __debug_status;
138
117#endif /* _LANGUAGE_ASSEMBLY */ 139#endif /* _LANGUAGE_ASSEMBLY */
118#endif /* __ASM_GDB_STUB_H */ 140#endif /* __ASM_GDB_STUB_H */
diff --git a/include/asm-frv/processor.h b/include/asm-frv/processor.h
index 1c4dba1c5f57..3744f2e47f48 100644
--- a/include/asm-frv/processor.h
+++ b/include/asm-frv/processor.h
@@ -21,6 +21,7 @@
21 */ 21 */
22#define current_text_addr() ({ __label__ _l; _l: &&_l;}) 22#define current_text_addr() ({ __label__ _l; _l: &&_l;})
23 23
24#include <linux/compiler.h>
24#include <linux/linkage.h> 25#include <linux/linkage.h>
25#include <asm/sections.h> 26#include <asm/sections.h>
26#include <asm/segment.h> 27#include <asm/segment.h>
@@ -139,7 +140,7 @@ unsigned long get_wchan(struct task_struct *p);
139extern struct task_struct *alloc_task_struct(void); 140extern struct task_struct *alloc_task_struct(void);
140extern void free_task_struct(struct task_struct *p); 141extern void free_task_struct(struct task_struct *p);
141 142
142#define cpu_relax() do { } while (0) 143#define cpu_relax() barrier()
143 144
144/* data cache prefetch */ 145/* data cache prefetch */
145#define ARCH_HAS_PREFETCH 146#define ARCH_HAS_PREFETCH
diff --git a/include/asm-frv/ptrace.h b/include/asm-frv/ptrace.h
index b2cce0718e57..7ff525162a72 100644
--- a/include/asm-frv/ptrace.h
+++ b/include/asm-frv/ptrace.h
@@ -62,18 +62,10 @@
62#ifndef __ASSEMBLY__ 62#ifndef __ASSEMBLY__
63 63
64/* 64/*
65 * dedicate GR28; to keeping the a pointer to the current exception frame 65 * we dedicate GR28 to keeping a pointer to the current exception frame
66 * - gr28 is destroyed on entry to the kernel from userspace
66 */ 67 */
67register struct pt_regs *__frame asm("gr28"); 68register struct pt_regs *__frame asm("gr28");
68register struct pt_regs *__debug_frame asm("gr31");
69
70#ifndef container_of
71#define container_of(ptr, type, member) ({ \
72 const typeof( ((type *)0)->member ) *__mptr = (ptr); \
73 (type *)( (char *)__mptr - offsetof(type,member) );})
74#endif
75
76#define __debug_regs container_of(__debug_frame, struct pt_debug_regs, normal_regs)
77 69
78#define user_mode(regs) (!((regs)->psr & PSR_S)) 70#define user_mode(regs) (!((regs)->psr & PSR_S))
79#define instruction_pointer(regs) ((regs)->pc) 71#define instruction_pointer(regs) ((regs)->pc)
diff --git a/include/asm-frv/registers.h b/include/asm-frv/registers.h
index fccfd95cff68..9666119fcf6e 100644
--- a/include/asm-frv/registers.h
+++ b/include/asm-frv/registers.h
@@ -23,7 +23,13 @@
23 * 23 *
24 * +0x2000 +---------------------- 24 * +0x2000 +----------------------
25 * | union { 25 * | union {
26 * | struct user_context 26 * | struct frv_frame0 {
27 * | struct user_context {
28 * | struct user_int_regs
29 * | struct user_fpmedia_regs
30 * | }
31 * | struct frv_debug_regs
32 * | }
27 * | struct pt_regs [user exception] 33 * | struct pt_regs [user exception]
28 * | } 34 * | }
29 * +---------------------- <-- __kernel_frame0_ptr (maybe GR28) 35 * +---------------------- <-- __kernel_frame0_ptr (maybe GR28)
@@ -51,11 +57,11 @@
51#define _ASM_REGISTERS_H 57#define _ASM_REGISTERS_H
52 58
53#ifndef __ASSEMBLY__ 59#ifndef __ASSEMBLY__
54#define __OFFSET(X) (X) 60#define __OFFSET(X,N) ((X)+(N)*4)
55#define __OFFSETC(X,N) xxxxxxxxxxxxxxxxxxxxxxxx 61#define __OFFSETC(X,N) xxxxxxxxxxxxxxxxxxxxxxxx
56#else 62#else
57#define __OFFSET(X) ((X)*4) 63#define __OFFSET(X,N) ((X)+(N)*4)
58#define __OFFSETC(X,N) ((X)*4+(N)) 64#define __OFFSETC(X,N) ((X)+(N))
59#endif 65#endif
60 66
61/*****************************************************************************/ 67/*****************************************************************************/
@@ -117,30 +123,13 @@ struct pt_regs {
117 123
118#endif 124#endif
119 125
120#define REG_PSR __OFFSET( 0) /* Processor Status Register */
121#define REG_ISR __OFFSET( 1) /* Integer Status Register */
122#define REG_CCR __OFFSET( 2) /* Condition Code Register */
123#define REG_CCCR __OFFSET( 3) /* Condition Code for Conditional Insns Register */
124#define REG_LR __OFFSET( 4) /* Link Register */
125#define REG_LCR __OFFSET( 5) /* Loop Count Register */
126#define REG_PC __OFFSET( 6) /* Program Counter */
127
128#define REG__STATUS __OFFSET( 7) /* exception status */
129#define REG__STATUS_STEP 0x00000001 /* - reenable single stepping on return */ 126#define REG__STATUS_STEP 0x00000001 /* - reenable single stepping on return */
130#define REG__STATUS_STEPPED 0x00000002 /* - single step caused exception */ 127#define REG__STATUS_STEPPED 0x00000002 /* - single step caused exception */
131#define REG__STATUS_BROKE 0x00000004 /* - BREAK insn caused exception */ 128#define REG__STATUS_BROKE 0x00000004 /* - BREAK insn caused exception */
132#define REG__STATUS_SYSC_ENTRY 0x40000000 /* - T on syscall entry (ptrace.c only) */ 129#define REG__STATUS_SYSC_ENTRY 0x40000000 /* - T on syscall entry (ptrace.c only) */
133#define REG__STATUS_SYSC_EXIT 0x80000000 /* - T on syscall exit (ptrace.c only) */ 130#define REG__STATUS_SYSC_EXIT 0x80000000 /* - T on syscall exit (ptrace.c only) */
134 131
135#define REG_SYSCALLNO __OFFSET( 8) /* syscall number or -1 */ 132#define REG_GR(R) __OFFSET(REG_GR0, (R))
136#define REG_ORIG_GR8 __OFFSET( 9) /* saved GR8 for signal handling */
137#define REG_GNER0 __OFFSET(10)
138#define REG_GNER1 __OFFSET(11)
139#define REG_IACC0 __OFFSET(12)
140
141#define REG_TBR __OFFSET(14) /* Trap Vector Register */
142#define REG_GR(R) __OFFSET((14+(R)))
143#define REG__END REG_GR(32)
144 133
145#define REG_SP REG_GR(1) 134#define REG_SP REG_GR(1)
146#define REG_FP REG_GR(2) 135#define REG_FP REG_GR(2)
@@ -149,27 +138,21 @@ struct pt_regs {
149 138
150/*****************************************************************************/ 139/*****************************************************************************/
151/* 140/*
152 * extension tacked in front of the exception frame in debug mode 141 * debugging registers
153 */ 142 */
154#ifndef __ASSEMBLY__ 143#ifndef __ASSEMBLY__
155 144
156struct pt_debug_regs 145struct frv_debug_regs
157{ 146{
158 unsigned long bpsr;
159 unsigned long dcr; 147 unsigned long dcr;
160 unsigned long brr; 148 unsigned long ibar[4] __attribute__((aligned(8)));
161 unsigned long nmar; 149 unsigned long dbar[4] __attribute__((aligned(8)));
162 struct pt_regs normal_regs; 150 unsigned long dbdr[4][4] __attribute__((aligned(8)));
151 unsigned long dbmr[4][4] __attribute__((aligned(8)));
163} __attribute__((aligned(8))); 152} __attribute__((aligned(8)));
164 153
165#endif 154#endif
166 155
167#define REG_NMAR __OFFSET(-1)
168#define REG_BRR __OFFSET(-2)
169#define REG_DCR __OFFSET(-3)
170#define REG_BPSR __OFFSET(-4)
171#define REG__DEBUG_XTRA __OFFSET(4)
172
173/*****************************************************************************/ 156/*****************************************************************************/
174/* 157/*
175 * userspace registers 158 * userspace registers
@@ -223,33 +206,27 @@ struct user_context
223 void *extension; 206 void *extension;
224} __attribute__((aligned(8))); 207} __attribute__((aligned(8)));
225 208
209struct frv_frame0 {
210 union {
211 struct pt_regs regs;
212 struct user_context uc;
213 };
214
215 struct frv_debug_regs debug;
216
217} __attribute__((aligned(32)));
218
226#endif 219#endif
227 220
228#define NR_USER_INT_REGS (14 + 64) 221#define __INT_GR(R) __OFFSET(__INT_GR0, (R))
229#define NR_USER_FPMEDIA_REGS (64 + 2 + 2 + 8 + 8/4 + 1) 222
230#define NR_USER_CONTEXT (NR_USER_INT_REGS + NR_USER_FPMEDIA_REGS + 1) 223#define __FPMEDIA_FR(R) __OFFSET(__FPMEDIA_FR0, (R))
231 224#define __FPMEDIA_FNER(R) __OFFSET(__FPMEDIA_FNER0, (R))
232#define USER_CONTEXT_SIZE (((NR_USER_CONTEXT + 1) & ~1) * 4) 225#define __FPMEDIA_MSR(R) __OFFSET(__FPMEDIA_MSR0, (R))
233 226#define __FPMEDIA_ACC(R) __OFFSET(__FPMEDIA_ACC0, (R))
234#define __THREAD_FRAME __OFFSET(0) 227#define __FPMEDIA_ACCG(R) __OFFSETC(__FPMEDIA_ACCG0, (R))
235#define __THREAD_CURR __OFFSET(1) 228#define __FPMEDIA_FSR(R) __OFFSET(__FPMEDIA_FSR0, (R))
236#define __THREAD_SP __OFFSET(2) 229
237#define __THREAD_FP __OFFSET(3) 230#define __THREAD_GR(R) __OFFSET(__THREAD_GR16, (R) - 16)
238#define __THREAD_LR __OFFSET(4)
239#define __THREAD_PC __OFFSET(5)
240#define __THREAD_GR(R) __OFFSET(6 + (R) - 16)
241#define __THREAD_FRAME0 __OFFSET(19)
242#define __THREAD_USER __OFFSET(19)
243
244#define __USER_INT __OFFSET(0)
245#define __INT_GR(R) __OFFSET(14 + (R))
246
247#define __USER_FPMEDIA __OFFSET(NR_USER_INT_REGS)
248#define __FPMEDIA_FR(R) __OFFSET(NR_USER_INT_REGS + (R))
249#define __FPMEDIA_FNER(R) __OFFSET(NR_USER_INT_REGS + 64 + (R))
250#define __FPMEDIA_MSR(R) __OFFSET(NR_USER_INT_REGS + 66 + (R))
251#define __FPMEDIA_ACC(R) __OFFSET(NR_USER_INT_REGS + 68 + (R))
252#define __FPMEDIA_ACCG(R) __OFFSETC(NR_USER_INT_REGS + 76, (R))
253#define __FPMEDIA_FSR(R) __OFFSET(NR_USER_INT_REGS + 78 + (R))
254 231
255#endif /* _ASM_REGISTERS_H */ 232#endif /* _ASM_REGISTERS_H */
diff --git a/include/asm-frv/system.h b/include/asm-frv/system.h
index 351863dfd06e..1166899317d7 100644
--- a/include/asm-frv/system.h
+++ b/include/asm-frv/system.h
@@ -179,7 +179,6 @@ do { \
179#define rmb() asm volatile ("membar" : : :"memory") 179#define rmb() asm volatile ("membar" : : :"memory")
180#define wmb() asm volatile ("membar" : : :"memory") 180#define wmb() asm volatile ("membar" : : :"memory")
181#define set_mb(var, value) do { var = value; mb(); } while (0) 181#define set_mb(var, value) do { var = value; mb(); } while (0)
182#define set_wmb(var, value) do { var = value; wmb(); } while (0)
183 182
184#define smp_mb() mb() 183#define smp_mb() mb()
185#define smp_rmb() rmb() 184#define smp_rmb() rmb()
diff --git a/include/asm-frv/thread_info.h b/include/asm-frv/thread_info.h
index ea426abf01d3..d66c48e6ef14 100644
--- a/include/asm-frv/thread_info.h
+++ b/include/asm-frv/thread_info.h
@@ -19,6 +19,8 @@
19#include <asm/processor.h> 19#include <asm/processor.h>
20#endif 20#endif
21 21
22#define THREAD_SIZE 8192
23
22/* 24/*
23 * low level task data that entry.S needs immediate access to 25 * low level task data that entry.S needs immediate access to
24 * - this struct should fit entirely inside of one cache line 26 * - this struct should fit entirely inside of one cache line
@@ -46,15 +48,7 @@ struct thread_info {
46 48
47#else /* !__ASSEMBLY__ */ 49#else /* !__ASSEMBLY__ */
48 50
49/* offsets into the thread_info struct for assembly code access */ 51#include <asm/asm-offsets.h>
50#define TI_TASK 0x00000000
51#define TI_EXEC_DOMAIN 0x00000004
52#define TI_FLAGS 0x00000008
53#define TI_STATUS 0x0000000C
54#define TI_CPU 0x00000010
55#define TI_PRE_COUNT 0x00000014
56#define TI_ADDR_LIMIT 0x00000018
57#define TI_RESTART_BLOCK 0x0000001C
58 52
59#endif 53#endif
60 54
@@ -83,12 +77,6 @@ struct thread_info {
83#define init_thread_info (init_thread_union.thread_info) 77#define init_thread_info (init_thread_union.thread_info)
84#define init_stack (init_thread_union.stack) 78#define init_stack (init_thread_union.stack)
85 79
86#ifdef CONFIG_SMALL_TASKS
87#define THREAD_SIZE 4096
88#else
89#define THREAD_SIZE 8192
90#endif
91
92/* how to get the thread information struct from C */ 80/* how to get the thread information struct from C */
93register struct thread_info *__current_thread_info asm("gr15"); 81register struct thread_info *__current_thread_info asm("gr15");
94 82
@@ -111,11 +99,7 @@ register struct thread_info *__current_thread_info asm("gr15");
111 99
112#define free_thread_info(info) kfree(info) 100#define free_thread_info(info) kfree(info)
113 101
114#else /* !__ASSEMBLY__ */ 102#endif /* __ASSEMBLY__ */
115
116#define THREAD_SIZE 8192
117
118#endif
119 103
120/* 104/*
121 * thread information flags 105 * thread information flags
diff --git a/include/asm-generic/Kbuild.asm b/include/asm-generic/Kbuild.asm
index d8d0bcecd23f..6b16dda18115 100644
--- a/include/asm-generic/Kbuild.asm
+++ b/include/asm-generic/Kbuild.asm
@@ -1,11 +1,8 @@
1unifdef-y += a.out.h auxvec.h byteorder.h errno.h fcntl.h ioctl.h \ 1unifdef-y += a.out.h auxvec.h byteorder.h errno.h fcntl.h ioctl.h \
2 ioctls.h ipcbuf.h irq.h mman.h msgbuf.h param.h poll.h \ 2 ioctls.h ipcbuf.h mman.h msgbuf.h param.h poll.h \
3 posix_types.h ptrace.h resource.h sembuf.h shmbuf.h shmparam.h \ 3 posix_types.h ptrace.h resource.h sembuf.h shmbuf.h shmparam.h \
4 sigcontext.h siginfo.h signal.h socket.h sockios.h stat.h \ 4 sigcontext.h siginfo.h signal.h socket.h sockios.h stat.h \
5 statfs.h termbits.h termios.h timex.h types.h unistd.h user.h 5 statfs.h termbits.h termios.h timex.h types.h unistd.h user.h
6 6
7# These really shouldn't be exported
8unifdef-y += atomic.h io.h
9
10# These probably shouldn't be exported 7# These probably shouldn't be exported
11unifdef-y += elf.h page.h 8unifdef-y += elf.h page.h
diff --git a/include/asm-h8300/page.h b/include/asm-h8300/page.h
index f9f9d3eea8ed..d673077d2fd6 100644
--- a/include/asm-h8300/page.h
+++ b/include/asm-h8300/page.h
@@ -66,7 +66,6 @@ extern unsigned long memory_end;
66 66
67#define MAP_NR(addr) (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT) 67#define MAP_NR(addr) (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT)
68#define virt_to_page(addr) (mem_map + (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT)) 68#define virt_to_page(addr) (mem_map + (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT))
69#define virt_to_page(addr) (mem_map + (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT))
70#define page_to_virt(page) ((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET) 69#define page_to_virt(page) ((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET)
71#define pfn_valid(page) (page < max_mapnr) 70#define pfn_valid(page) (page < max_mapnr)
72 71
diff --git a/include/asm-h8300/processor.h b/include/asm-h8300/processor.h
index c7e2f454b83a..99b664aa2083 100644
--- a/include/asm-h8300/processor.h
+++ b/include/asm-h8300/processor.h
@@ -17,6 +17,7 @@
17 */ 17 */
18#define current_text_addr() ({ __label__ _l; _l: &&_l;}) 18#define current_text_addr() ({ __label__ _l; _l: &&_l;})
19 19
20#include <linux/compiler.h>
20#include <asm/segment.h> 21#include <asm/segment.h>
21#include <asm/fpu.h> 22#include <asm/fpu.h>
22#include <asm/ptrace.h> 23#include <asm/ptrace.h>
@@ -129,6 +130,6 @@ unsigned long get_wchan(struct task_struct *p);
129 eip; }) 130 eip; })
130#define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp) 131#define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp)
131 132
132#define cpu_relax() do { } while (0) 133#define cpu_relax() barrier()
133 134
134#endif 135#endif
diff --git a/include/asm-h8300/system.h b/include/asm-h8300/system.h
index 134e0929fce5..5084a9d42922 100644
--- a/include/asm-h8300/system.h
+++ b/include/asm-h8300/system.h
@@ -84,7 +84,6 @@ asmlinkage void resume(void);
84#define wmb() asm volatile ("" : : :"memory") 84#define wmb() asm volatile ("" : : :"memory")
85#define set_rmb(var, value) do { xchg(&var, value); } while (0) 85#define set_rmb(var, value) do { xchg(&var, value); } while (0)
86#define set_mb(var, value) set_rmb(var, value) 86#define set_mb(var, value) set_rmb(var, value)
87#define set_wmb(var, value) do { var = value; wmb(); } while (0)
88 87
89#ifdef CONFIG_SMP 88#ifdef CONFIG_SMP
90#define smp_mb() mb() 89#define smp_mb() mb()
diff --git a/include/asm-i386/atomic.h b/include/asm-i386/atomic.h
index 4f061fa73794..51a166242522 100644
--- a/include/asm-i386/atomic.h
+++ b/include/asm-i386/atomic.h
@@ -46,8 +46,8 @@ static __inline__ void atomic_add(int i, atomic_t *v)
46{ 46{
47 __asm__ __volatile__( 47 __asm__ __volatile__(
48 LOCK_PREFIX "addl %1,%0" 48 LOCK_PREFIX "addl %1,%0"
49 :"=m" (v->counter) 49 :"+m" (v->counter)
50 :"ir" (i), "m" (v->counter)); 50 :"ir" (i));
51} 51}
52 52
53/** 53/**
@@ -61,8 +61,8 @@ static __inline__ void atomic_sub(int i, atomic_t *v)
61{ 61{
62 __asm__ __volatile__( 62 __asm__ __volatile__(
63 LOCK_PREFIX "subl %1,%0" 63 LOCK_PREFIX "subl %1,%0"
64 :"=m" (v->counter) 64 :"+m" (v->counter)
65 :"ir" (i), "m" (v->counter)); 65 :"ir" (i));
66} 66}
67 67
68/** 68/**
@@ -80,8 +80,8 @@ static __inline__ int atomic_sub_and_test(int i, atomic_t *v)
80 80
81 __asm__ __volatile__( 81 __asm__ __volatile__(
82 LOCK_PREFIX "subl %2,%0; sete %1" 82 LOCK_PREFIX "subl %2,%0; sete %1"
83 :"=m" (v->counter), "=qm" (c) 83 :"+m" (v->counter), "=qm" (c)
84 :"ir" (i), "m" (v->counter) : "memory"); 84 :"ir" (i) : "memory");
85 return c; 85 return c;
86} 86}
87 87
@@ -95,8 +95,7 @@ static __inline__ void atomic_inc(atomic_t *v)
95{ 95{
96 __asm__ __volatile__( 96 __asm__ __volatile__(
97 LOCK_PREFIX "incl %0" 97 LOCK_PREFIX "incl %0"
98 :"=m" (v->counter) 98 :"+m" (v->counter));
99 :"m" (v->counter));
100} 99}
101 100
102/** 101/**
@@ -109,8 +108,7 @@ static __inline__ void atomic_dec(atomic_t *v)
109{ 108{
110 __asm__ __volatile__( 109 __asm__ __volatile__(
111 LOCK_PREFIX "decl %0" 110 LOCK_PREFIX "decl %0"
112 :"=m" (v->counter) 111 :"+m" (v->counter));
113 :"m" (v->counter));
114} 112}
115 113
116/** 114/**
@@ -127,8 +125,8 @@ static __inline__ int atomic_dec_and_test(atomic_t *v)
127 125
128 __asm__ __volatile__( 126 __asm__ __volatile__(
129 LOCK_PREFIX "decl %0; sete %1" 127 LOCK_PREFIX "decl %0; sete %1"
130 :"=m" (v->counter), "=qm" (c) 128 :"+m" (v->counter), "=qm" (c)
131 :"m" (v->counter) : "memory"); 129 : : "memory");
132 return c != 0; 130 return c != 0;
133} 131}
134 132
@@ -146,8 +144,8 @@ static __inline__ int atomic_inc_and_test(atomic_t *v)
146 144
147 __asm__ __volatile__( 145 __asm__ __volatile__(
148 LOCK_PREFIX "incl %0; sete %1" 146 LOCK_PREFIX "incl %0; sete %1"
149 :"=m" (v->counter), "=qm" (c) 147 :"+m" (v->counter), "=qm" (c)
150 :"m" (v->counter) : "memory"); 148 : : "memory");
151 return c != 0; 149 return c != 0;
152} 150}
153 151
@@ -166,8 +164,8 @@ static __inline__ int atomic_add_negative(int i, atomic_t *v)
166 164
167 __asm__ __volatile__( 165 __asm__ __volatile__(
168 LOCK_PREFIX "addl %2,%0; sets %1" 166 LOCK_PREFIX "addl %2,%0; sets %1"
169 :"=m" (v->counter), "=qm" (c) 167 :"+m" (v->counter), "=qm" (c)
170 :"ir" (i), "m" (v->counter) : "memory"); 168 :"ir" (i) : "memory");
171 return c; 169 return c;
172} 170}
173 171
diff --git a/include/asm-i386/futex.h b/include/asm-i386/futex.h
index 7b8ceefd010f..946d97cfea23 100644
--- a/include/asm-i386/futex.h
+++ b/include/asm-i386/futex.h
@@ -20,8 +20,8 @@
20 .align 8\n\ 20 .align 8\n\
21 .long 1b,3b\n\ 21 .long 1b,3b\n\
22 .previous" \ 22 .previous" \
23 : "=r" (oldval), "=r" (ret), "=m" (*uaddr) \ 23 : "=r" (oldval), "=r" (ret), "+m" (*uaddr) \
24 : "i" (-EFAULT), "m" (*uaddr), "0" (oparg), "1" (0)) 24 : "i" (-EFAULT), "0" (oparg), "1" (0))
25 25
26#define __futex_atomic_op2(insn, ret, oldval, uaddr, oparg) \ 26#define __futex_atomic_op2(insn, ret, oldval, uaddr, oparg) \
27 __asm__ __volatile ( \ 27 __asm__ __volatile ( \
@@ -38,9 +38,9 @@
38 .align 8\n\ 38 .align 8\n\
39 .long 1b,4b,2b,4b\n\ 39 .long 1b,4b,2b,4b\n\
40 .previous" \ 40 .previous" \
41 : "=&a" (oldval), "=&r" (ret), "=m" (*uaddr), \ 41 : "=&a" (oldval), "=&r" (ret), "+m" (*uaddr), \
42 "=&r" (tem) \ 42 "=&r" (tem) \
43 : "r" (oparg), "i" (-EFAULT), "m" (*uaddr), "1" (0)) 43 : "r" (oparg), "i" (-EFAULT), "1" (0))
44 44
45static inline int 45static inline int
46futex_atomic_op_inuser (int encoded_op, int __user *uaddr) 46futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
@@ -123,7 +123,7 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
123 " .long 1b,3b \n" 123 " .long 1b,3b \n"
124 " .previous \n" 124 " .previous \n"
125 125
126 : "=a" (oldval), "=m" (*uaddr) 126 : "=a" (oldval), "+m" (*uaddr)
127 : "i" (-EFAULT), "r" (newval), "0" (oldval) 127 : "i" (-EFAULT), "r" (newval), "0" (oldval)
128 : "memory" 128 : "memory"
129 ); 129 );
diff --git a/include/asm-i386/kprobes.h b/include/asm-i386/kprobes.h
index 0730a20f6db8..8774d06689da 100644
--- a/include/asm-i386/kprobes.h
+++ b/include/asm-i386/kprobes.h
@@ -45,6 +45,7 @@ typedef u8 kprobe_opcode_t;
45#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry 45#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry
46#define ARCH_SUPPORTS_KRETPROBES 46#define ARCH_SUPPORTS_KRETPROBES
47#define ARCH_INACTIVE_KPROBE_COUNT 0 47#define ARCH_INACTIVE_KPROBE_COUNT 0
48#define flush_insn_slot(p) do { } while (0)
48 49
49void arch_remove_kprobe(struct kprobe *p); 50void arch_remove_kprobe(struct kprobe *p);
50void kretprobe_trampoline(void); 51void kretprobe_trampoline(void);
diff --git a/include/asm-i386/local.h b/include/asm-i386/local.h
index 3b4998c51d08..12060e22f7e2 100644
--- a/include/asm-i386/local.h
+++ b/include/asm-i386/local.h
@@ -17,32 +17,30 @@ static __inline__ void local_inc(local_t *v)
17{ 17{
18 __asm__ __volatile__( 18 __asm__ __volatile__(
19 "incl %0" 19 "incl %0"
20 :"=m" (v->counter) 20 :"+m" (v->counter));
21 :"m" (v->counter));
22} 21}
23 22
24static __inline__ void local_dec(local_t *v) 23static __inline__ void local_dec(local_t *v)
25{ 24{
26 __asm__ __volatile__( 25 __asm__ __volatile__(
27 "decl %0" 26 "decl %0"
28 :"=m" (v->counter) 27 :"+m" (v->counter));
29 :"m" (v->counter));
30} 28}
31 29
32static __inline__ void local_add(long i, local_t *v) 30static __inline__ void local_add(long i, local_t *v)
33{ 31{
34 __asm__ __volatile__( 32 __asm__ __volatile__(
35 "addl %1,%0" 33 "addl %1,%0"
36 :"=m" (v->counter) 34 :"+m" (v->counter)
37 :"ir" (i), "m" (v->counter)); 35 :"ir" (i));
38} 36}
39 37
40static __inline__ void local_sub(long i, local_t *v) 38static __inline__ void local_sub(long i, local_t *v)
41{ 39{
42 __asm__ __volatile__( 40 __asm__ __volatile__(
43 "subl %1,%0" 41 "subl %1,%0"
44 :"=m" (v->counter) 42 :"+m" (v->counter)
45 :"ir" (i), "m" (v->counter)); 43 :"ir" (i));
46} 44}
47 45
48/* On x86, these are no better than the atomic variants. */ 46/* On x86, these are no better than the atomic variants. */
diff --git a/include/asm-i386/posix_types.h b/include/asm-i386/posix_types.h
index 4e47ed059ad6..133e31e7dfde 100644
--- a/include/asm-i386/posix_types.h
+++ b/include/asm-i386/posix_types.h
@@ -51,12 +51,12 @@ typedef struct {
51#undef __FD_SET 51#undef __FD_SET
52#define __FD_SET(fd,fdsetp) \ 52#define __FD_SET(fd,fdsetp) \
53 __asm__ __volatile__("btsl %1,%0": \ 53 __asm__ __volatile__("btsl %1,%0": \
54 "=m" (*(__kernel_fd_set *) (fdsetp)):"r" ((int) (fd))) 54 "+m" (*(__kernel_fd_set *) (fdsetp)):"r" ((int) (fd)))
55 55
56#undef __FD_CLR 56#undef __FD_CLR
57#define __FD_CLR(fd,fdsetp) \ 57#define __FD_CLR(fd,fdsetp) \
58 __asm__ __volatile__("btrl %1,%0": \ 58 __asm__ __volatile__("btrl %1,%0": \
59 "=m" (*(__kernel_fd_set *) (fdsetp)):"r" ((int) (fd))) 59 "+m" (*(__kernel_fd_set *) (fdsetp)):"r" ((int) (fd)))
60 60
61#undef __FD_ISSET 61#undef __FD_ISSET
62#define __FD_ISSET(fd,fdsetp) (__extension__ ({ \ 62#define __FD_ISSET(fd,fdsetp) (__extension__ ({ \
diff --git a/include/asm-i386/rwlock.h b/include/asm-i386/rwlock.h
index 94f00195d543..96b0bef2ea56 100644
--- a/include/asm-i386/rwlock.h
+++ b/include/asm-i386/rwlock.h
@@ -37,7 +37,7 @@
37 "popl %%eax\n\t" \ 37 "popl %%eax\n\t" \
38 "1:\n", \ 38 "1:\n", \
39 "subl $1,%0\n\t", \ 39 "subl $1,%0\n\t", \
40 "=m" (*(volatile int *)rw) : : "memory") 40 "+m" (*(volatile int *)rw) : : "memory")
41 41
42#define __build_read_lock(rw, helper) do { \ 42#define __build_read_lock(rw, helper) do { \
43 if (__builtin_constant_p(rw)) \ 43 if (__builtin_constant_p(rw)) \
@@ -63,7 +63,7 @@
63 "popl %%eax\n\t" \ 63 "popl %%eax\n\t" \
64 "1:\n", \ 64 "1:\n", \
65 "subl $" RW_LOCK_BIAS_STR ",%0\n\t", \ 65 "subl $" RW_LOCK_BIAS_STR ",%0\n\t", \
66 "=m" (*(volatile int *)rw) : : "memory") 66 "+m" (*(volatile int *)rw) : : "memory")
67 67
68#define __build_write_lock(rw, helper) do { \ 68#define __build_write_lock(rw, helper) do { \
69 if (__builtin_constant_p(rw)) \ 69 if (__builtin_constant_p(rw)) \
diff --git a/include/asm-i386/rwsem.h b/include/asm-i386/rwsem.h
index 2f07601562e7..43113f5608eb 100644
--- a/include/asm-i386/rwsem.h
+++ b/include/asm-i386/rwsem.h
@@ -111,8 +111,8 @@ LOCK_PREFIX " incl (%%eax)\n\t" /* adds 0x00000001, returns the old value
111 " jmp 1b\n" 111 " jmp 1b\n"
112 LOCK_SECTION_END 112 LOCK_SECTION_END
113 "# ending down_read\n\t" 113 "# ending down_read\n\t"
114 : "=m"(sem->count) 114 : "+m" (sem->count)
115 : "a"(sem), "m"(sem->count) 115 : "a" (sem)
116 : "memory", "cc"); 116 : "memory", "cc");
117} 117}
118 118
@@ -133,8 +133,8 @@ LOCK_PREFIX " cmpxchgl %2,%0\n\t"
133 " jnz 1b\n\t" 133 " jnz 1b\n\t"
134 "2:\n\t" 134 "2:\n\t"
135 "# ending __down_read_trylock\n\t" 135 "# ending __down_read_trylock\n\t"
136 : "+m"(sem->count), "=&a"(result), "=&r"(tmp) 136 : "+m" (sem->count), "=&a" (result), "=&r" (tmp)
137 : "i"(RWSEM_ACTIVE_READ_BIAS) 137 : "i" (RWSEM_ACTIVE_READ_BIAS)
138 : "memory", "cc"); 138 : "memory", "cc");
139 return result>=0 ? 1 : 0; 139 return result>=0 ? 1 : 0;
140} 140}
@@ -161,8 +161,8 @@ LOCK_PREFIX " xadd %%edx,(%%eax)\n\t" /* subtract 0x0000ffff, returns the
161 " jmp 1b\n" 161 " jmp 1b\n"
162 LOCK_SECTION_END 162 LOCK_SECTION_END
163 "# ending down_write" 163 "# ending down_write"
164 : "=m"(sem->count), "=d"(tmp) 164 : "+m" (sem->count), "=d" (tmp)
165 : "a"(sem), "1"(tmp), "m"(sem->count) 165 : "a" (sem), "1" (tmp)
166 : "memory", "cc"); 166 : "memory", "cc");
167} 167}
168 168
@@ -205,8 +205,8 @@ LOCK_PREFIX " xadd %%edx,(%%eax)\n\t" /* subtracts 1, returns the old valu
205 " jmp 1b\n" 205 " jmp 1b\n"
206 LOCK_SECTION_END 206 LOCK_SECTION_END
207 "# ending __up_read\n" 207 "# ending __up_read\n"
208 : "=m"(sem->count), "=d"(tmp) 208 : "+m" (sem->count), "=d" (tmp)
209 : "a"(sem), "1"(tmp), "m"(sem->count) 209 : "a" (sem), "1" (tmp)
210 : "memory", "cc"); 210 : "memory", "cc");
211} 211}
212 212
@@ -231,8 +231,8 @@ LOCK_PREFIX " xaddl %%edx,(%%eax)\n\t" /* tries to transition 0xffff0001 ->
231 " jmp 1b\n" 231 " jmp 1b\n"
232 LOCK_SECTION_END 232 LOCK_SECTION_END
233 "# ending __up_write\n" 233 "# ending __up_write\n"
234 : "=m"(sem->count) 234 : "+m" (sem->count)
235 : "a"(sem), "i"(-RWSEM_ACTIVE_WRITE_BIAS), "m"(sem->count) 235 : "a" (sem), "i" (-RWSEM_ACTIVE_WRITE_BIAS)
236 : "memory", "cc", "edx"); 236 : "memory", "cc", "edx");
237} 237}
238 238
@@ -256,8 +256,8 @@ LOCK_PREFIX " addl %2,(%%eax)\n\t" /* transitions 0xZZZZ0001 -> 0xYYYY0001
256 " jmp 1b\n" 256 " jmp 1b\n"
257 LOCK_SECTION_END 257 LOCK_SECTION_END
258 "# ending __downgrade_write\n" 258 "# ending __downgrade_write\n"
259 : "=m"(sem->count) 259 : "+m" (sem->count)
260 : "a"(sem), "i"(-RWSEM_WAITING_BIAS), "m"(sem->count) 260 : "a" (sem), "i" (-RWSEM_WAITING_BIAS)
261 : "memory", "cc"); 261 : "memory", "cc");
262} 262}
263 263
@@ -268,8 +268,8 @@ static inline void rwsem_atomic_add(int delta, struct rw_semaphore *sem)
268{ 268{
269 __asm__ __volatile__( 269 __asm__ __volatile__(
270LOCK_PREFIX "addl %1,%0" 270LOCK_PREFIX "addl %1,%0"
271 : "=m"(sem->count) 271 : "+m" (sem->count)
272 : "ir"(delta), "m"(sem->count)); 272 : "ir" (delta));
273} 273}
274 274
275/* 275/*
@@ -280,10 +280,9 @@ static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem)
280 int tmp = delta; 280 int tmp = delta;
281 281
282 __asm__ __volatile__( 282 __asm__ __volatile__(
283LOCK_PREFIX "xadd %0,(%2)" 283LOCK_PREFIX "xadd %0,%1"
284 : "+r"(tmp), "=m"(sem->count) 284 : "+r" (tmp), "+m" (sem->count)
285 : "r"(sem), "m"(sem->count) 285 : : "memory");
286 : "memory");
287 286
288 return tmp+delta; 287 return tmp+delta;
289} 288}
diff --git a/include/asm-i386/semaphore.h b/include/asm-i386/semaphore.h
index f7a0f310c524..d51e800acf29 100644
--- a/include/asm-i386/semaphore.h
+++ b/include/asm-i386/semaphore.h
@@ -107,7 +107,7 @@ static inline void down(struct semaphore * sem)
107 "call __down_failed\n\t" 107 "call __down_failed\n\t"
108 "jmp 1b\n" 108 "jmp 1b\n"
109 LOCK_SECTION_END 109 LOCK_SECTION_END
110 :"=m" (sem->count) 110 :"+m" (sem->count)
111 : 111 :
112 :"memory","ax"); 112 :"memory","ax");
113} 113}
@@ -132,7 +132,7 @@ static inline int down_interruptible(struct semaphore * sem)
132 "call __down_failed_interruptible\n\t" 132 "call __down_failed_interruptible\n\t"
133 "jmp 1b\n" 133 "jmp 1b\n"
134 LOCK_SECTION_END 134 LOCK_SECTION_END
135 :"=a" (result), "=m" (sem->count) 135 :"=a" (result), "+m" (sem->count)
136 : 136 :
137 :"memory"); 137 :"memory");
138 return result; 138 return result;
@@ -157,7 +157,7 @@ static inline int down_trylock(struct semaphore * sem)
157 "call __down_failed_trylock\n\t" 157 "call __down_failed_trylock\n\t"
158 "jmp 1b\n" 158 "jmp 1b\n"
159 LOCK_SECTION_END 159 LOCK_SECTION_END
160 :"=a" (result), "=m" (sem->count) 160 :"=a" (result), "+m" (sem->count)
161 : 161 :
162 :"memory"); 162 :"memory");
163 return result; 163 return result;
@@ -182,7 +182,7 @@ static inline void up(struct semaphore * sem)
182 "jmp 1b\n" 182 "jmp 1b\n"
183 LOCK_SECTION_END 183 LOCK_SECTION_END
184 ".subsection 0\n" 184 ".subsection 0\n"
185 :"=m" (sem->count) 185 :"+m" (sem->count)
186 : 186 :
187 :"memory","ax"); 187 :"memory","ax");
188} 188}
diff --git a/include/asm-i386/spinlock.h b/include/asm-i386/spinlock.h
index 87c40f830653..d816c62a7a1d 100644
--- a/include/asm-i386/spinlock.h
+++ b/include/asm-i386/spinlock.h
@@ -65,7 +65,7 @@ static inline void __raw_spin_lock(raw_spinlock_t *lock)
65 alternative_smp( 65 alternative_smp(
66 __raw_spin_lock_string, 66 __raw_spin_lock_string,
67 __raw_spin_lock_string_up, 67 __raw_spin_lock_string_up,
68 "=m" (lock->slock) : : "memory"); 68 "+m" (lock->slock) : : "memory");
69} 69}
70 70
71/* 71/*
@@ -79,7 +79,7 @@ static inline void __raw_spin_lock_flags(raw_spinlock_t *lock, unsigned long fla
79 alternative_smp( 79 alternative_smp(
80 __raw_spin_lock_string_flags, 80 __raw_spin_lock_string_flags,
81 __raw_spin_lock_string_up, 81 __raw_spin_lock_string_up,
82 "=m" (lock->slock) : "r" (flags) : "memory"); 82 "+m" (lock->slock) : "r" (flags) : "memory");
83} 83}
84#endif 84#endif
85 85
@@ -88,7 +88,7 @@ static inline int __raw_spin_trylock(raw_spinlock_t *lock)
88 char oldval; 88 char oldval;
89 __asm__ __volatile__( 89 __asm__ __volatile__(
90 "xchgb %b0,%1" 90 "xchgb %b0,%1"
91 :"=q" (oldval), "=m" (lock->slock) 91 :"=q" (oldval), "+m" (lock->slock)
92 :"0" (0) : "memory"); 92 :"0" (0) : "memory");
93 return oldval > 0; 93 return oldval > 0;
94} 94}
@@ -104,7 +104,7 @@ static inline int __raw_spin_trylock(raw_spinlock_t *lock)
104 104
105#define __raw_spin_unlock_string \ 105#define __raw_spin_unlock_string \
106 "movb $1,%0" \ 106 "movb $1,%0" \
107 :"=m" (lock->slock) : : "memory" 107 :"+m" (lock->slock) : : "memory"
108 108
109 109
110static inline void __raw_spin_unlock(raw_spinlock_t *lock) 110static inline void __raw_spin_unlock(raw_spinlock_t *lock)
@@ -118,7 +118,7 @@ static inline void __raw_spin_unlock(raw_spinlock_t *lock)
118 118
119#define __raw_spin_unlock_string \ 119#define __raw_spin_unlock_string \
120 "xchgb %b0, %1" \ 120 "xchgb %b0, %1" \
121 :"=q" (oldval), "=m" (lock->slock) \ 121 :"=q" (oldval), "+m" (lock->slock) \
122 :"0" (oldval) : "memory" 122 :"0" (oldval) : "memory"
123 123
124static inline void __raw_spin_unlock(raw_spinlock_t *lock) 124static inline void __raw_spin_unlock(raw_spinlock_t *lock)
@@ -199,13 +199,13 @@ static inline int __raw_write_trylock(raw_rwlock_t *lock)
199 199
200static inline void __raw_read_unlock(raw_rwlock_t *rw) 200static inline void __raw_read_unlock(raw_rwlock_t *rw)
201{ 201{
202 asm volatile(LOCK_PREFIX "incl %0" :"=m" (rw->lock) : : "memory"); 202 asm volatile(LOCK_PREFIX "incl %0" :"+m" (rw->lock) : : "memory");
203} 203}
204 204
205static inline void __raw_write_unlock(raw_rwlock_t *rw) 205static inline void __raw_write_unlock(raw_rwlock_t *rw)
206{ 206{
207 asm volatile(LOCK_PREFIX "addl $" RW_LOCK_BIAS_STR ", %0" 207 asm volatile(LOCK_PREFIX "addl $" RW_LOCK_BIAS_STR ", %0"
208 : "=m" (rw->lock) : : "memory"); 208 : "+m" (rw->lock) : : "memory");
209} 209}
210 210
211#endif /* __ASM_SPINLOCK_H */ 211#endif /* __ASM_SPINLOCK_H */
diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h
index db398d88b1d9..49928eb33f8b 100644
--- a/include/asm-i386/system.h
+++ b/include/asm-i386/system.h
@@ -82,10 +82,6 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \
82#define savesegment(seg, value) \ 82#define savesegment(seg, value) \
83 asm volatile("mov %%" #seg ",%0":"=rm" (value)) 83 asm volatile("mov %%" #seg ",%0":"=rm" (value))
84 84
85/*
86 * Clear and set 'TS' bit respectively
87 */
88#define clts() __asm__ __volatile__ ("clts")
89#define read_cr0() ({ \ 85#define read_cr0() ({ \
90 unsigned int __dummy; \ 86 unsigned int __dummy; \
91 __asm__ __volatile__( \ 87 __asm__ __volatile__( \
@@ -94,7 +90,7 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \
94 __dummy; \ 90 __dummy; \
95}) 91})
96#define write_cr0(x) \ 92#define write_cr0(x) \
97 __asm__ __volatile__("movl %0,%%cr0": :"r" (x)); 93 __asm__ __volatile__("movl %0,%%cr0": :"r" (x))
98 94
99#define read_cr2() ({ \ 95#define read_cr2() ({ \
100 unsigned int __dummy; \ 96 unsigned int __dummy; \
@@ -104,7 +100,7 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \
104 __dummy; \ 100 __dummy; \
105}) 101})
106#define write_cr2(x) \ 102#define write_cr2(x) \
107 __asm__ __volatile__("movl %0,%%cr2": :"r" (x)); 103 __asm__ __volatile__("movl %0,%%cr2": :"r" (x))
108 104
109#define read_cr3() ({ \ 105#define read_cr3() ({ \
110 unsigned int __dummy; \ 106 unsigned int __dummy; \
@@ -114,7 +110,7 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \
114 __dummy; \ 110 __dummy; \
115}) 111})
116#define write_cr3(x) \ 112#define write_cr3(x) \
117 __asm__ __volatile__("movl %0,%%cr3": :"r" (x)); 113 __asm__ __volatile__("movl %0,%%cr3": :"r" (x))
118 114
119#define read_cr4() ({ \ 115#define read_cr4() ({ \
120 unsigned int __dummy; \ 116 unsigned int __dummy; \
@@ -123,7 +119,6 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \
123 :"=r" (__dummy)); \ 119 :"=r" (__dummy)); \
124 __dummy; \ 120 __dummy; \
125}) 121})
126
127#define read_cr4_safe() ({ \ 122#define read_cr4_safe() ({ \
128 unsigned int __dummy; \ 123 unsigned int __dummy; \
129 /* This could fault if %cr4 does not exist */ \ 124 /* This could fault if %cr4 does not exist */ \
@@ -135,15 +130,19 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \
135 : "=r" (__dummy): "0" (0)); \ 130 : "=r" (__dummy): "0" (0)); \
136 __dummy; \ 131 __dummy; \
137}) 132})
138
139#define write_cr4(x) \ 133#define write_cr4(x) \
140 __asm__ __volatile__("movl %0,%%cr4": :"r" (x)); 134 __asm__ __volatile__("movl %0,%%cr4": :"r" (x))
135
136/*
137 * Clear and set 'TS' bit respectively
138 */
139#define clts() __asm__ __volatile__ ("clts")
141#define stts() write_cr0(8 | read_cr0()) 140#define stts() write_cr0(8 | read_cr0())
142 141
143#endif /* __KERNEL__ */ 142#endif /* __KERNEL__ */
144 143
145#define wbinvd() \ 144#define wbinvd() \
146 __asm__ __volatile__ ("wbinvd": : :"memory"); 145 __asm__ __volatile__ ("wbinvd": : :"memory")
147 146
148static inline unsigned long get_limit(unsigned long segment) 147static inline unsigned long get_limit(unsigned long segment)
149{ 148{
@@ -454,8 +453,6 @@ static inline unsigned long long __cmpxchg64(volatile void *ptr, unsigned long l
454#define set_mb(var, value) do { var = value; barrier(); } while (0) 453#define set_mb(var, value) do { var = value; barrier(); } while (0)
455#endif 454#endif
456 455
457#define set_wmb(var, value) do { var = value; wmb(); } while (0)
458
459#include <linux/irqflags.h> 456#include <linux/irqflags.h>
460 457
461/* 458/*
diff --git a/include/asm-i386/thread_info.h b/include/asm-i386/thread_info.h
index 2833fa2c0dd0..54d6d7aea938 100644
--- a/include/asm-i386/thread_info.h
+++ b/include/asm-i386/thread_info.h
@@ -140,6 +140,8 @@ static inline struct thread_info *current_thread_info(void)
140#define TIF_SECCOMP 8 /* secure computing */ 140#define TIF_SECCOMP 8 /* secure computing */
141#define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal() */ 141#define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal() */
142#define TIF_MEMDIE 16 142#define TIF_MEMDIE 16
143#define TIF_DEBUG 17 /* uses debug registers */
144#define TIF_IO_BITMAP 18 /* uses I/O bitmap */
143 145
144#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 146#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
145#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) 147#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
@@ -151,6 +153,8 @@ static inline struct thread_info *current_thread_info(void)
151#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) 153#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT)
152#define _TIF_SECCOMP (1<<TIF_SECCOMP) 154#define _TIF_SECCOMP (1<<TIF_SECCOMP)
153#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) 155#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
156#define _TIF_DEBUG (1<<TIF_DEBUG)
157#define _TIF_IO_BITMAP (1<<TIF_IO_BITMAP)
154 158
155/* work to do on interrupt/exception return */ 159/* work to do on interrupt/exception return */
156#define _TIF_WORK_MASK \ 160#define _TIF_WORK_MASK \
@@ -159,6 +163,9 @@ static inline struct thread_info *current_thread_info(void)
159/* work to do on any return to u-space */ 163/* work to do on any return to u-space */
160#define _TIF_ALLWORK_MASK (0x0000FFFF & ~_TIF_SECCOMP) 164#define _TIF_ALLWORK_MASK (0x0000FFFF & ~_TIF_SECCOMP)
161 165
166/* flags to check in __switch_to() */
167#define _TIF_WORK_CTXSW (_TIF_DEBUG|_TIF_IO_BITMAP)
168
162/* 169/*
163 * Thread-synchronous status. 170 * Thread-synchronous status.
164 * 171 *
diff --git a/include/asm-ia64/io.h b/include/asm-ia64/io.h
index 781ee2c7e8c3..43bfff6c6b87 100644
--- a/include/asm-ia64/io.h
+++ b/include/asm-ia64/io.h
@@ -90,7 +90,7 @@ phys_to_virt (unsigned long address)
90#define ARCH_HAS_VALID_PHYS_ADDR_RANGE 90#define ARCH_HAS_VALID_PHYS_ADDR_RANGE
91extern u64 kern_mem_attribute (unsigned long phys_addr, unsigned long size); 91extern u64 kern_mem_attribute (unsigned long phys_addr, unsigned long size);
92extern int valid_phys_addr_range (unsigned long addr, size_t count); /* efi.c */ 92extern int valid_phys_addr_range (unsigned long addr, size_t count); /* efi.c */
93extern int valid_mmap_phys_addr_range (unsigned long addr, size_t count); 93extern int valid_mmap_phys_addr_range (unsigned long pfn, size_t count);
94 94
95/* 95/*
96 * The following two macros are deprecated and scheduled for removal. 96 * The following two macros are deprecated and scheduled for removal.
diff --git a/include/asm-ia64/kprobes.h b/include/asm-ia64/kprobes.h
index 2418a787c405..938904910115 100644
--- a/include/asm-ia64/kprobes.h
+++ b/include/asm-ia64/kprobes.h
@@ -125,5 +125,6 @@ static inline void jprobe_return(void)
125} 125}
126extern void invalidate_stacked_regs(void); 126extern void invalidate_stacked_regs(void);
127extern void flush_register_stack(void); 127extern void flush_register_stack(void);
128extern void flush_insn_slot(struct kprobe *p);
128 129
129#endif /* _ASM_KPROBES_H */ 130#endif /* _ASM_KPROBES_H */
diff --git a/include/asm-ia64/meminit.h b/include/asm-ia64/meminit.h
index 894bc4d89dc0..6a33a07b3f1d 100644
--- a/include/asm-ia64/meminit.h
+++ b/include/asm-ia64/meminit.h
@@ -56,6 +56,11 @@ extern void efi_memmap_init(unsigned long *, unsigned long *);
56 extern struct page *vmem_map; 56 extern struct page *vmem_map;
57 extern int find_largest_hole (u64 start, u64 end, void *arg); 57 extern int find_largest_hole (u64 start, u64 end, void *arg);
58 extern int create_mem_map_page_table (u64 start, u64 end, void *arg); 58 extern int create_mem_map_page_table (u64 start, u64 end, void *arg);
59 extern int vmemmap_find_next_valid_pfn(int, int);
60#else
61static inline int vmemmap_find_next_valid_pfn(int node, int i)
62{
63 return i + 1;
64}
59#endif 65#endif
60
61#endif /* meminit_h */ 66#endif /* meminit_h */
diff --git a/include/asm-ia64/pal.h b/include/asm-ia64/pal.h
index 37e52a2836b0..20a8d618c845 100644
--- a/include/asm-ia64/pal.h
+++ b/include/asm-ia64/pal.h
@@ -1433,7 +1433,12 @@ typedef union pal_version_u {
1433} pal_version_u_t; 1433} pal_version_u_t;
1434 1434
1435 1435
1436/* Return PAL version information */ 1436/*
1437 * Return PAL version information. While the documentation states that
1438 * PAL_VERSION can be called in either physical or virtual mode, some
1439 * implementations only allow physical calls. We don't call it very often,
1440 * so the overhead isn't worth eliminating.
1441 */
1437static inline s64 1442static inline s64
1438ia64_pal_version (pal_version_u_t *pal_min_version, pal_version_u_t *pal_cur_version) 1443ia64_pal_version (pal_version_u_t *pal_min_version, pal_version_u_t *pal_cur_version)
1439{ 1444{
diff --git a/include/asm-ia64/sn/xpc.h b/include/asm-ia64/sn/xpc.h
index 8406f1ef4caf..b72af597878d 100644
--- a/include/asm-ia64/sn/xpc.h
+++ b/include/asm-ia64/sn/xpc.h
@@ -1124,8 +1124,8 @@ xpc_notify_IRQ_send_local(struct xpc_channel *ch, u8 ipi_flag,
1124#define XPC_GET_IPI_FLAGS(_amo, _c) ((u8) (((_amo) >> ((_c) * 8)) & 0xff)) 1124#define XPC_GET_IPI_FLAGS(_amo, _c) ((u8) (((_amo) >> ((_c) * 8)) & 0xff))
1125#define XPC_SET_IPI_FLAGS(_amo, _c, _f) (_amo) |= ((u64) (_f) << ((_c) * 8)) 1125#define XPC_SET_IPI_FLAGS(_amo, _c, _f) (_amo) |= ((u64) (_f) << ((_c) * 8))
1126 1126
1127#define XPC_ANY_OPENCLOSE_IPI_FLAGS_SET(_amo) ((_amo) & 0x0f0f0f0f0f0f0f0f) 1127#define XPC_ANY_OPENCLOSE_IPI_FLAGS_SET(_amo) ((_amo) & __IA64_UL_CONST(0x0f0f0f0f0f0f0f0f))
1128#define XPC_ANY_MSG_IPI_FLAGS_SET(_amo) ((_amo) & 0x1010101010101010) 1128#define XPC_ANY_MSG_IPI_FLAGS_SET(_amo) ((_amo) & __IA64_UL_CONST(0x1010101010101010))
1129 1129
1130 1130
1131static inline void 1131static inline void
diff --git a/include/asm-ia64/system.h b/include/asm-ia64/system.h
index 65db43ce4de6..384fbf7f2a0f 100644
--- a/include/asm-ia64/system.h
+++ b/include/asm-ia64/system.h
@@ -24,7 +24,7 @@
24 * 0xa000000000000000+2*PERCPU_PAGE_SIZE 24 * 0xa000000000000000+2*PERCPU_PAGE_SIZE
25 * - 0xa000000000000000+3*PERCPU_PAGE_SIZE remain unmapped (guard page) 25 * - 0xa000000000000000+3*PERCPU_PAGE_SIZE remain unmapped (guard page)
26 */ 26 */
27#define KERNEL_START (GATE_ADDR+0x100000000) 27#define KERNEL_START (GATE_ADDR+__IA64_UL_CONST(0x100000000))
28#define PERCPU_ADDR (-PERCPU_PAGE_SIZE) 28#define PERCPU_ADDR (-PERCPU_PAGE_SIZE)
29 29
30#ifndef __ASSEMBLY__ 30#ifndef __ASSEMBLY__
@@ -98,12 +98,11 @@ extern struct ia64_boot_param {
98#endif 98#endif
99 99
100/* 100/*
101 * XXX check on these---I suspect what Linus really wants here is 101 * XXX check on this ---I suspect what Linus really wants here is
102 * acquire vs release semantics but we can't discuss this stuff with 102 * acquire vs release semantics but we can't discuss this stuff with
103 * Linus just yet. Grrr... 103 * Linus just yet. Grrr...
104 */ 104 */
105#define set_mb(var, value) do { (var) = (value); mb(); } while (0) 105#define set_mb(var, value) do { (var) = (value); mb(); } while (0)
106#define set_wmb(var, value) do { (var) = (value); mb(); } while (0)
107 106
108#define safe_halt() ia64_pal_halt_light() /* PAL_HALT_LIGHT */ 107#define safe_halt() ia64_pal_halt_light() /* PAL_HALT_LIGHT */
109 108
diff --git a/include/asm-m32r/system.h b/include/asm-m32r/system.h
index 311cebf44eff..9e618afec6ed 100644
--- a/include/asm-m32r/system.h
+++ b/include/asm-m32r/system.h
@@ -336,7 +336,6 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
336#endif 336#endif
337 337
338#define set_mb(var, value) do { xchg(&var, value); } while (0) 338#define set_mb(var, value) do { xchg(&var, value); } while (0)
339#define set_wmb(var, value) do { var = value; wmb(); } while (0)
340 339
341#define arch_align_stack(x) (x) 340#define arch_align_stack(x) (x)
342 341
diff --git a/include/asm-m68k/oplib.h b/include/asm-m68k/oplib.h
index c3594f473ef7..06caa2d08451 100644
--- a/include/asm-m68k/oplib.h
+++ b/include/asm-m68k/oplib.h
@@ -244,11 +244,6 @@ extern void prom_getstring(int node, char *prop, char *buf, int bufsize);
244/* Does the passed node have the given "name"? YES=1 NO=0 */ 244/* Does the passed node have the given "name"? YES=1 NO=0 */
245extern int prom_nodematch(int thisnode, char *name); 245extern int prom_nodematch(int thisnode, char *name);
246 246
247/* Puts in buffer a prom name in the form name@x,y or name (x for which_io
248 * and y for first regs phys address
249 */
250extern int prom_getname(int node, char *buf, int buflen);
251
252/* Search all siblings starting at the passed node for "name" matching 247/* Search all siblings starting at the passed node for "name" matching
253 * the given string. Returns the node on success, zero on failure. 248 * the given string. Returns the node on success, zero on failure.
254 */ 249 */
diff --git a/include/asm-m68k/system.h b/include/asm-m68k/system.h
index d6dd8052cd6f..131a0cb0f491 100644
--- a/include/asm-m68k/system.h
+++ b/include/asm-m68k/system.h
@@ -80,7 +80,6 @@ static inline int irqs_disabled(void)
80#define wmb() barrier() 80#define wmb() barrier()
81#define read_barrier_depends() do { } while(0) 81#define read_barrier_depends() do { } while(0)
82#define set_mb(var, value) do { xchg(&var, value); } while (0) 82#define set_mb(var, value) do { xchg(&var, value); } while (0)
83#define set_wmb(var, value) do { var = value; wmb(); } while (0)
84 83
85#define smp_mb() barrier() 84#define smp_mb() barrier()
86#define smp_rmb() barrier() 85#define smp_rmb() barrier()
diff --git a/include/asm-m68knommu/processor.h b/include/asm-m68knommu/processor.h
index 0ee158e09abb..9d3a1bf41231 100644
--- a/include/asm-m68knommu/processor.h
+++ b/include/asm-m68knommu/processor.h
@@ -13,6 +13,7 @@
13 */ 13 */
14#define current_text_addr() ({ __label__ _l; _l: &&_l;}) 14#define current_text_addr() ({ __label__ _l; _l: &&_l;})
15 15
16#include <linux/compiler.h>
16#include <linux/threads.h> 17#include <linux/threads.h>
17#include <asm/types.h> 18#include <asm/types.h>
18#include <asm/segment.h> 19#include <asm/segment.h>
@@ -137,6 +138,6 @@ unsigned long get_wchan(struct task_struct *p);
137 eip; }) 138 eip; })
138#define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp) 139#define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp)
139 140
140#define cpu_relax() do { } while (0) 141#define cpu_relax() barrier()
141 142
142#endif 143#endif
diff --git a/include/asm-m68knommu/system.h b/include/asm-m68knommu/system.h
index 2bbe2db00a22..2a814498672d 100644
--- a/include/asm-m68knommu/system.h
+++ b/include/asm-m68knommu/system.h
@@ -106,7 +106,6 @@ asmlinkage void resume(void);
106#define wmb() asm volatile ("" : : :"memory") 106#define wmb() asm volatile ("" : : :"memory")
107#define set_rmb(var, value) do { xchg(&var, value); } while (0) 107#define set_rmb(var, value) do { xchg(&var, value); } while (0)
108#define set_mb(var, value) set_rmb(var, value) 108#define set_mb(var, value) set_rmb(var, value)
109#define set_wmb(var, value) do { var = value; wmb(); } while (0)
110 109
111#ifdef CONFIG_SMP 110#ifdef CONFIG_SMP
112#define smp_mb() mb() 111#define smp_mb() mb()
diff --git a/include/asm-m68knommu/uaccess.h b/include/asm-m68knommu/uaccess.h
index 05be9515a2d2..62b29b10bc6d 100644
--- a/include/asm-m68knommu/uaccess.h
+++ b/include/asm-m68knommu/uaccess.h
@@ -93,7 +93,7 @@ extern int __put_user_bad(void);
93#define get_user(x, ptr) \ 93#define get_user(x, ptr) \
94({ \ 94({ \
95 int __gu_err = 0; \ 95 int __gu_err = 0; \
96 typeof(*(ptr)) __gu_val = 0; \ 96 typeof(x) __gu_val = 0; \
97 switch (sizeof(*(ptr))) { \ 97 switch (sizeof(*(ptr))) { \
98 case 1: \ 98 case 1: \
99 __get_user_asm(__gu_err, __gu_val, ptr, b, "=d"); \ 99 __get_user_asm(__gu_err, __gu_val, ptr, b, "=d"); \
@@ -105,23 +105,23 @@ extern int __put_user_bad(void);
105 __get_user_asm(__gu_err, __gu_val, ptr, l, "=r"); \ 105 __get_user_asm(__gu_err, __gu_val, ptr, l, "=r"); \
106 break; \ 106 break; \
107 case 8: \ 107 case 8: \
108 memcpy(&__gu_val, ptr, sizeof (*(ptr))); \ 108 memcpy((void *) &__gu_val, ptr, sizeof (*(ptr))); \
109 break; \ 109 break; \
110 default: \ 110 default: \
111 __gu_val = 0; \ 111 __gu_val = 0; \
112 __gu_err = __get_user_bad(); \ 112 __gu_err = __get_user_bad(); \
113 break; \ 113 break; \
114 } \ 114 } \
115 (x) = __gu_val; \ 115 (x) = (typeof(*(ptr))) __gu_val; \
116 __gu_err; \ 116 __gu_err; \
117}) 117})
118#define __get_user(x, ptr) get_user(x, ptr) 118#define __get_user(x, ptr) get_user(x, ptr)
119 119
120extern int __get_user_bad(void); 120extern int __get_user_bad(void);
121 121
122#define __get_user_asm(err,x,ptr,bwl,reg) \ 122#define __get_user_asm(err,x,ptr,bwl,reg) \
123 __asm__ ("move" #bwl " %1,%0" \ 123 __asm__ ("move" #bwl " %1,%0" \
124 : "=d" (x) \ 124 : "=d" (x) \
125 : "m" (*__ptr(ptr))) 125 : "m" (*__ptr(ptr)))
126 126
127#define copy_from_user(to, from, n) (memcpy(to, from, n), 0) 127#define copy_from_user(to, from, n) (memcpy(to, from, n), 0)
diff --git a/include/asm-mips/apm.h b/include/asm-mips/apm.h
index e8c69208f63a..4b99ffc11529 100644
--- a/include/asm-mips/apm.h
+++ b/include/asm-mips/apm.h
@@ -13,7 +13,6 @@
13#ifndef MIPS_ASM_SA1100_APM_H 13#ifndef MIPS_ASM_SA1100_APM_H
14#define MIPS_ASM_SA1100_APM_H 14#define MIPS_ASM_SA1100_APM_H
15 15
16#include <linux/config.h>
17#include <linux/apm_bios.h> 16#include <linux/apm_bios.h>
18 17
19/* 18/*
diff --git a/include/asm-mips/atomic.h b/include/asm-mips/atomic.h
index 13d44e14025a..e64abc0d8221 100644
--- a/include/asm-mips/atomic.h
+++ b/include/asm-mips/atomic.h
@@ -22,8 +22,8 @@
22#ifndef _ASM_ATOMIC_H 22#ifndef _ASM_ATOMIC_H
23#define _ASM_ATOMIC_H 23#define _ASM_ATOMIC_H
24 24
25#include <linux/irqflags.h>
25#include <asm/cpu-features.h> 26#include <asm/cpu-features.h>
26#include <asm/interrupt.h>
27#include <asm/war.h> 27#include <asm/war.h>
28 28
29typedef struct { volatile int counter; } atomic_t; 29typedef struct { volatile int counter; } atomic_t;
diff --git a/include/asm-mips/bitops.h b/include/asm-mips/bitops.h
index 098cec263681..1bb89c5a10ee 100644
--- a/include/asm-mips/bitops.h
+++ b/include/asm-mips/bitops.h
@@ -31,7 +31,7 @@
31 31
32#ifdef __KERNEL__ 32#ifdef __KERNEL__
33 33
34#include <asm/interrupt.h> 34#include <linux/irqflags.h>
35#include <asm/sgidefs.h> 35#include <asm/sgidefs.h>
36#include <asm/war.h> 36#include <asm/war.h>
37 37
diff --git a/include/asm-mips/cpu-features.h b/include/asm-mips/cpu-features.h
index 44285a9d5520..eadca266f159 100644
--- a/include/asm-mips/cpu-features.h
+++ b/include/asm-mips/cpu-features.h
@@ -143,12 +143,8 @@
143#define cpu_has_dsp (cpu_data[0].ases & MIPS_ASE_DSP) 143#define cpu_has_dsp (cpu_data[0].ases & MIPS_ASE_DSP)
144#endif 144#endif
145 145
146#ifdef CONFIG_MIPS_MT
147#ifndef cpu_has_mipsmt 146#ifndef cpu_has_mipsmt
148# define cpu_has_mipsmt (cpu_data[0].ases & MIPS_ASE_MIPSMT) 147#define cpu_has_mipsmt (cpu_data[0].ases & MIPS_ASE_MIPSMT)
149#endif
150#else
151# define cpu_has_mipsmt 0
152#endif 148#endif
153 149
154#ifdef CONFIG_32BIT 150#ifdef CONFIG_32BIT
@@ -199,8 +195,8 @@
199# define cpu_has_veic 0 195# define cpu_has_veic 0
200#endif 196#endif
201 197
202#ifndef cpu_has_subset_pcaches 198#ifndef cpu_has_inclusive_pcaches
203#define cpu_has_subset_pcaches (cpu_data[0].options & MIPS_CPU_SUBSET_CACHES) 199#define cpu_has_inclusive_pcaches (cpu_data[0].options & MIPS_CPU_INCLUSIVE_CACHES)
204#endif 200#endif
205 201
206#ifndef cpu_dcache_line_size 202#ifndef cpu_dcache_line_size
diff --git a/include/asm-mips/cpu.h b/include/asm-mips/cpu.h
index dff2a0a52f8f..d38fdbf845b2 100644
--- a/include/asm-mips/cpu.h
+++ b/include/asm-mips/cpu.h
@@ -242,7 +242,7 @@
242#define MIPS_CPU_EJTAG 0x00008000 /* EJTAG exception */ 242#define MIPS_CPU_EJTAG 0x00008000 /* EJTAG exception */
243#define MIPS_CPU_NOFPUEX 0x00010000 /* no FPU exception */ 243#define MIPS_CPU_NOFPUEX 0x00010000 /* no FPU exception */
244#define MIPS_CPU_LLSC 0x00020000 /* CPU has ll/sc instructions */ 244#define MIPS_CPU_LLSC 0x00020000 /* CPU has ll/sc instructions */
245#define MIPS_CPU_SUBSET_CACHES 0x00040000 /* P-cache subset enforced */ 245#define MIPS_CPU_INCLUSIVE_CACHES 0x00040000 /* P-cache subset enforced */
246#define MIPS_CPU_PREFETCH 0x00080000 /* CPU has usable prefetch */ 246#define MIPS_CPU_PREFETCH 0x00080000 /* CPU has usable prefetch */
247#define MIPS_CPU_VINT 0x00100000 /* CPU supports MIPSR2 vectored interrupts */ 247#define MIPS_CPU_VINT 0x00100000 /* CPU supports MIPSR2 vectored interrupts */
248#define MIPS_CPU_VEIC 0x00200000 /* CPU supports MIPSR2 external interrupt controller mode */ 248#define MIPS_CPU_VEIC 0x00200000 /* CPU supports MIPSR2 external interrupt controller mode */
diff --git a/include/asm-mips/inst.h b/include/asm-mips/inst.h
index 1ed8d0f62577..6489f00731ca 100644
--- a/include/asm-mips/inst.h
+++ b/include/asm-mips/inst.h
@@ -74,7 +74,7 @@ enum spec3_op {
74 ins_op, dinsm_op, dinsu_op, dins_op, 74 ins_op, dinsm_op, dinsu_op, dins_op,
75 bshfl_op = 0x20, 75 bshfl_op = 0x20,
76 dbshfl_op = 0x24, 76 dbshfl_op = 0x24,
77 rdhwr_op = 0x3f 77 rdhwr_op = 0x3b
78}; 78};
79 79
80/* 80/*
diff --git a/include/asm-mips/interrupt.h b/include/asm-mips/irqflags.h
index a99d6867510f..43ca09a3a3d0 100644
--- a/include/asm-mips/interrupt.h
+++ b/include/asm-mips/irqflags.h
@@ -8,13 +8,15 @@
8 * Copyright (C) 1999 Silicon Graphics 8 * Copyright (C) 1999 Silicon Graphics
9 * Copyright (C) 2000 MIPS Technologies, Inc. 9 * Copyright (C) 2000 MIPS Technologies, Inc.
10 */ 10 */
11#ifndef _ASM_INTERRUPT_H 11#ifndef _ASM_IRQFLAGS_H
12#define _ASM_INTERRUPT_H 12#define _ASM_IRQFLAGS_H
13
14#ifndef __ASSEMBLY__
13 15
14#include <asm/hazards.h> 16#include <asm/hazards.h>
15 17
16__asm__ ( 18__asm__ (
17 " .macro local_irq_enable \n" 19 " .macro raw_local_irq_enable \n"
18 " .set push \n" 20 " .set push \n"
19 " .set reorder \n" 21 " .set reorder \n"
20 " .set noat \n" 22 " .set noat \n"
@@ -35,10 +37,10 @@ __asm__ (
35 " .set pop \n" 37 " .set pop \n"
36 " .endm"); 38 " .endm");
37 39
38static inline void local_irq_enable(void) 40static inline void raw_local_irq_enable(void)
39{ 41{
40 __asm__ __volatile__( 42 __asm__ __volatile__(
41 "local_irq_enable" 43 "raw_local_irq_enable"
42 : /* no outputs */ 44 : /* no outputs */
43 : /* no inputs */ 45 : /* no inputs */
44 : "memory"); 46 : "memory");
@@ -63,7 +65,7 @@ static inline void local_irq_enable(void)
63 * Workaround: mask EXL bit of the result or place a nop before mfc0. 65 * Workaround: mask EXL bit of the result or place a nop before mfc0.
64 */ 66 */
65__asm__ ( 67__asm__ (
66 " .macro local_irq_disable\n" 68 " .macro raw_local_irq_disable\n"
67 " .set push \n" 69 " .set push \n"
68 " .set noat \n" 70 " .set noat \n"
69#ifdef CONFIG_MIPS_MT_SMTC 71#ifdef CONFIG_MIPS_MT_SMTC
@@ -84,17 +86,17 @@ __asm__ (
84 " .set pop \n" 86 " .set pop \n"
85 " .endm \n"); 87 " .endm \n");
86 88
87static inline void local_irq_disable(void) 89static inline void raw_local_irq_disable(void)
88{ 90{
89 __asm__ __volatile__( 91 __asm__ __volatile__(
90 "local_irq_disable" 92 "raw_local_irq_disable"
91 : /* no outputs */ 93 : /* no outputs */
92 : /* no inputs */ 94 : /* no inputs */
93 : "memory"); 95 : "memory");
94} 96}
95 97
96__asm__ ( 98__asm__ (
97 " .macro local_save_flags flags \n" 99 " .macro raw_local_save_flags flags \n"
98 " .set push \n" 100 " .set push \n"
99 " .set reorder \n" 101 " .set reorder \n"
100#ifdef CONFIG_MIPS_MT_SMTC 102#ifdef CONFIG_MIPS_MT_SMTC
@@ -105,13 +107,13 @@ __asm__ (
105 " .set pop \n" 107 " .set pop \n"
106 " .endm \n"); 108 " .endm \n");
107 109
108#define local_save_flags(x) \ 110#define raw_local_save_flags(x) \
109__asm__ __volatile__( \ 111__asm__ __volatile__( \
110 "local_save_flags %0" \ 112 "raw_local_save_flags %0" \
111 : "=r" (x)) 113 : "=r" (x))
112 114
113__asm__ ( 115__asm__ (
114 " .macro local_irq_save result \n" 116 " .macro raw_local_irq_save result \n"
115 " .set push \n" 117 " .set push \n"
116 " .set reorder \n" 118 " .set reorder \n"
117 " .set noat \n" 119 " .set noat \n"
@@ -135,15 +137,15 @@ __asm__ (
135 " .set pop \n" 137 " .set pop \n"
136 " .endm \n"); 138 " .endm \n");
137 139
138#define local_irq_save(x) \ 140#define raw_local_irq_save(x) \
139__asm__ __volatile__( \ 141__asm__ __volatile__( \
140 "local_irq_save\t%0" \ 142 "raw_local_irq_save\t%0" \
141 : "=r" (x) \ 143 : "=r" (x) \
142 : /* no inputs */ \ 144 : /* no inputs */ \
143 : "memory") 145 : "memory")
144 146
145__asm__ ( 147__asm__ (
146 " .macro local_irq_restore flags \n" 148 " .macro raw_local_irq_restore flags \n"
147 " .set push \n" 149 " .set push \n"
148 " .set noreorder \n" 150 " .set noreorder \n"
149 " .set noat \n" 151 " .set noat \n"
@@ -182,40 +184,42 @@ __asm__ (
182 " .set pop \n" 184 " .set pop \n"
183 " .endm \n"); 185 " .endm \n");
184 186
185#define local_irq_restore(flags) \ 187#define raw_local_irq_restore(flags) \
186do { \ 188do { \
187 unsigned long __tmp1; \ 189 unsigned long __tmp1; \
188 \ 190 \
189 __asm__ __volatile__( \ 191 __asm__ __volatile__( \
190 "local_irq_restore\t%0" \ 192 "raw_local_irq_restore\t%0" \
191 : "=r" (__tmp1) \ 193 : "=r" (__tmp1) \
192 : "0" (flags) \ 194 : "0" (flags) \
193 : "memory"); \ 195 : "memory"); \
194} while(0) 196} while(0)
195 197
196static inline int irqs_disabled(void) 198static inline int raw_irqs_disabled_flags(unsigned long flags)
197{ 199{
198#ifdef CONFIG_MIPS_MT_SMTC 200#ifdef CONFIG_MIPS_MT_SMTC
199 /* 201 /*
200 * SMTC model uses TCStatus.IXMT to disable interrupts for a thread/CPU 202 * SMTC model uses TCStatus.IXMT to disable interrupts for a thread/CPU
201 */ 203 */
202 unsigned long __result; 204 return flags & 0x400;
203
204 __asm__ __volatile__(
205 " .set noreorder \n"
206 " mfc0 %0, $2, 1 \n"
207 " andi %0, 0x400 \n"
208 " slt %0, $0, %0 \n"
209 " .set reorder \n"
210 : "=r" (__result));
211
212 return __result;
213#else 205#else
214 unsigned long flags;
215 local_save_flags(flags);
216
217 return !(flags & 1); 206 return !(flags & 1);
218#endif 207#endif
219} 208}
220 209
221#endif /* _ASM_INTERRUPT_H */ 210#endif
211
212/*
213 * Do the CPU's IRQ-state tracing from assembly code.
214 */
215#ifdef CONFIG_TRACE_IRQFLAGS
216# define TRACE_IRQS_ON \
217 jal trace_hardirqs_on
218# define TRACE_IRQS_OFF \
219 jal trace_hardirqs_off
220#else
221# define TRACE_IRQS_ON
222# define TRACE_IRQS_OFF
223#endif
224
225#endif /* _ASM_IRQFLAGS_H */
diff --git a/include/asm-mips/mach-cobalt/cpu-feature-overrides.h b/include/asm-mips/mach-cobalt/cpu-feature-overrides.h
index e0e08fc5d7f7..c6dfa59d1986 100644
--- a/include/asm-mips/mach-cobalt/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-cobalt/cpu-feature-overrides.h
@@ -27,7 +27,7 @@
27#define cpu_has_mcheck 0 27#define cpu_has_mcheck 0
28#define cpu_has_ejtag 0 28#define cpu_has_ejtag 0
29 29
30#define cpu_has_subset_pcaches 0 30#define cpu_has_inclusive_pcaches 0
31#define cpu_dcache_line_size() 32 31#define cpu_dcache_line_size() 32
32#define cpu_icache_line_size() 32 32#define cpu_icache_line_size() 32
33#define cpu_scache_line_size() 0 33#define cpu_scache_line_size() 0
diff --git a/include/asm-mips/mach-dec/mc146818rtc.h b/include/asm-mips/mach-dec/mc146818rtc.h
index 6d37a5675803..6724e99e43e1 100644
--- a/include/asm-mips/mach-dec/mc146818rtc.h
+++ b/include/asm-mips/mach-dec/mc146818rtc.h
@@ -19,6 +19,8 @@
19 19
20extern volatile u8 *dec_rtc_base; 20extern volatile u8 *dec_rtc_base;
21 21
22#define ARCH_RTC_LOCATION
23
22#define RTC_PORT(x) CPHYSADDR((long)dec_rtc_base) 24#define RTC_PORT(x) CPHYSADDR((long)dec_rtc_base)
23#define RTC_IO_EXTENT dec_kn_slot_size 25#define RTC_IO_EXTENT dec_kn_slot_size
24#define RTC_IOMAPPED 0 26#define RTC_IOMAPPED 0
diff --git a/include/asm-mips/mach-excite/cpu-feature-overrides.h b/include/asm-mips/mach-excite/cpu-feature-overrides.h
index abb76b2fd865..0d31854222f9 100644
--- a/include/asm-mips/mach-excite/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-excite/cpu-feature-overrides.h
@@ -31,7 +31,7 @@
31#define cpu_has_nofpuex 0 31#define cpu_has_nofpuex 0
32#define cpu_has_64bits 1 32#define cpu_has_64bits 1
33 33
34#define cpu_has_subset_pcaches 0 34#define cpu_has_inclusive_pcaches 0
35 35
36#define cpu_dcache_line_size() 32 36#define cpu_dcache_line_size() 32
37#define cpu_icache_line_size() 32 37#define cpu_icache_line_size() 32
diff --git a/include/asm-mips/mach-excite/excite.h b/include/asm-mips/mach-excite/excite.h
index c52610de2b3a..130bd4b8edce 100644
--- a/include/asm-mips/mach-excite/excite.h
+++ b/include/asm-mips/mach-excite/excite.h
@@ -1,7 +1,6 @@
1#ifndef __EXCITE_H__ 1#ifndef __EXCITE_H__
2#define __EXCITE_H__ 2#define __EXCITE_H__
3 3
4#include <linux/config.h>
5#include <linux/init.h> 4#include <linux/init.h>
6#include <asm/addrspace.h> 5#include <asm/addrspace.h>
7#include <asm/types.h> 6#include <asm/types.h>
diff --git a/include/asm-mips/mach-ip27/cpu-feature-overrides.h b/include/asm-mips/mach-ip27/cpu-feature-overrides.h
index 19c2d135985b..a071974b67bb 100644
--- a/include/asm-mips/mach-ip27/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-ip27/cpu-feature-overrides.h
@@ -34,7 +34,7 @@
34#define cpu_has_4kex 1 34#define cpu_has_4kex 1
35#define cpu_has_4k_cache 1 35#define cpu_has_4k_cache 1
36 36
37#define cpu_has_subset_pcaches 1 37#define cpu_has_inclusive_pcaches 1
38 38
39#define cpu_dcache_line_size() 32 39#define cpu_dcache_line_size() 32
40#define cpu_icache_line_size() 64 40#define cpu_icache_line_size() 64
diff --git a/include/asm-mips/mach-ja/cpu-feature-overrides.h b/include/asm-mips/mach-ja/cpu-feature-overrides.h
index 90ff087083b9..84b6dead0e8a 100644
--- a/include/asm-mips/mach-ja/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-ja/cpu-feature-overrides.h
@@ -31,7 +31,7 @@
31#define cpu_has_nofpuex 0 31#define cpu_has_nofpuex 0
32#define cpu_has_64bits 1 32#define cpu_has_64bits 1
33 33
34#define cpu_has_subset_pcaches 0 34#define cpu_has_inclusive_pcaches 0
35 35
36#define cpu_dcache_line_size() 32 36#define cpu_dcache_line_size() 32
37#define cpu_icache_line_size() 32 37#define cpu_icache_line_size() 32
diff --git a/include/asm-mips/mach-mips/cpu-feature-overrides.h b/include/asm-mips/mach-mips/cpu-feature-overrides.h
index e960679f54ba..7f3e3f9bd23a 100644
--- a/include/asm-mips/mach-mips/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-mips/cpu-feature-overrides.h
@@ -39,7 +39,7 @@
39#define cpu_has_nofpuex 0 39#define cpu_has_nofpuex 0
40/* #define cpu_has_64bits ? */ 40/* #define cpu_has_64bits ? */
41/* #define cpu_has_64bit_zero_reg ? */ 41/* #define cpu_has_64bit_zero_reg ? */
42/* #define cpu_has_subset_pcaches ? */ 42/* #define cpu_has_inclusive_pcaches ? */
43#define cpu_icache_snoops_remote_store 1 43#define cpu_icache_snoops_remote_store 1
44#endif 44#endif
45 45
@@ -65,7 +65,7 @@
65#define cpu_has_nofpuex 0 65#define cpu_has_nofpuex 0
66/* #define cpu_has_64bits ? */ 66/* #define cpu_has_64bits ? */
67/* #define cpu_has_64bit_zero_reg ? */ 67/* #define cpu_has_64bit_zero_reg ? */
68/* #define cpu_has_subset_pcaches ? */ 68/* #define cpu_has_inclusive_pcaches ? */
69#define cpu_icache_snoops_remote_store 1 69#define cpu_icache_snoops_remote_store 1
70#endif 70#endif
71 71
diff --git a/include/asm-mips/mach-ocelot3/cpu-feature-overrides.h b/include/asm-mips/mach-ocelot3/cpu-feature-overrides.h
index 782b986241dd..57a12ded0613 100644
--- a/include/asm-mips/mach-ocelot3/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-ocelot3/cpu-feature-overrides.h
@@ -34,7 +34,7 @@
34#define cpu_has_nofpuex 0 34#define cpu_has_nofpuex 0
35#define cpu_has_64bits 1 35#define cpu_has_64bits 1
36 36
37#define cpu_has_subset_pcaches 0 37#define cpu_has_inclusive_pcaches 0
38 38
39#define cpu_dcache_line_size() 32 39#define cpu_dcache_line_size() 32
40#define cpu_icache_line_size() 32 40#define cpu_icache_line_size() 32
diff --git a/include/asm-mips/mach-sibyte/cpu-feature-overrides.h b/include/asm-mips/mach-sibyte/cpu-feature-overrides.h
index 193a666cd131..a25968f277a2 100644
--- a/include/asm-mips/mach-sibyte/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-sibyte/cpu-feature-overrides.h
@@ -31,7 +31,7 @@
31#define cpu_has_nofpuex 0 31#define cpu_has_nofpuex 0
32#define cpu_has_64bits 1 32#define cpu_has_64bits 1
33 33
34#define cpu_has_subset_pcaches 0 34#define cpu_has_inclusive_pcaches 0
35 35
36#define cpu_dcache_line_size() 32 36#define cpu_dcache_line_size() 32
37#define cpu_icache_line_size() 32 37#define cpu_icache_line_size() 32
diff --git a/include/asm-mips/mach-sim/cpu-feature-overrides.h b/include/asm-mips/mach-sim/cpu-feature-overrides.h
index d736bdadb6df..779b02205737 100644
--- a/include/asm-mips/mach-sim/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-sim/cpu-feature-overrides.h
@@ -34,7 +34,7 @@
34#define cpu_has_nofpuex 0 34#define cpu_has_nofpuex 0
35/* #define cpu_has_64bits ? */ 35/* #define cpu_has_64bits ? */
36/* #define cpu_has_64bit_zero_reg ? */ 36/* #define cpu_has_64bit_zero_reg ? */
37/* #define cpu_has_subset_pcaches ? */ 37/* #define cpu_has_inclusive_pcaches ? */
38#endif 38#endif
39 39
40#ifdef CONFIG_CPU_MIPS64 40#ifdef CONFIG_CPU_MIPS64
@@ -59,7 +59,7 @@
59#define cpu_has_nofpuex 0 59#define cpu_has_nofpuex 0
60/* #define cpu_has_64bits ? */ 60/* #define cpu_has_64bits ? */
61/* #define cpu_has_64bit_zero_reg ? */ 61/* #define cpu_has_64bit_zero_reg ? */
62/* #define cpu_has_subset_pcaches ? */ 62/* #define cpu_has_inclusive_pcaches ? */
63#endif 63#endif
64 64
65#endif /* __ASM_MACH_MIPS_CPU_FEATURE_OVERRIDES_H */ 65#endif /* __ASM_MACH_MIPS_CPU_FEATURE_OVERRIDES_H */
diff --git a/include/asm-mips/mach-yosemite/cpu-feature-overrides.h b/include/asm-mips/mach-yosemite/cpu-feature-overrides.h
index 3073542c93c7..42cebb7ce7a6 100644
--- a/include/asm-mips/mach-yosemite/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-yosemite/cpu-feature-overrides.h
@@ -31,7 +31,7 @@
31#define cpu_has_nofpuex 0 31#define cpu_has_nofpuex 0
32#define cpu_has_64bits 1 32#define cpu_has_64bits 1
33 33
34#define cpu_has_subset_pcaches 0 34#define cpu_has_inclusive_pcaches 0
35 35
36#define cpu_dcache_line_size() 32 36#define cpu_dcache_line_size() 32
37#define cpu_icache_line_size() 32 37#define cpu_icache_line_size() 32
diff --git a/include/asm-mips/mipsregs.h b/include/asm-mips/mipsregs.h
index 9192d76c133d..1f318d707998 100644
--- a/include/asm-mips/mipsregs.h
+++ b/include/asm-mips/mipsregs.h
@@ -470,6 +470,8 @@
470 470
471/* Bits specific to the VR41xx. */ 471/* Bits specific to the VR41xx. */
472#define VR41_CONF_CS (_ULCAST_(1) << 12) 472#define VR41_CONF_CS (_ULCAST_(1) << 12)
473#define VR41_CONF_P4K (_ULCAST_(1) << 13)
474#define VR41_CONF_BP (_ULCAST_(1) << 16)
473#define VR41_CONF_M16 (_ULCAST_(1) << 20) 475#define VR41_CONF_M16 (_ULCAST_(1) << 20)
474#define VR41_CONF_AD (_ULCAST_(1) << 23) 476#define VR41_CONF_AD (_ULCAST_(1) << 23)
475 477
@@ -1416,7 +1418,7 @@ change_c0_##name(unsigned int change, unsigned int new) \
1416 1418
1417#else /* SMTC versions that manage MT scheduling */ 1419#else /* SMTC versions that manage MT scheduling */
1418 1420
1419#include <asm/interrupt.h> 1421#include <linux/irqflags.h>
1420 1422
1421/* 1423/*
1422 * This is a duplicate of dmt() in mipsmtregs.h to avoid problems with 1424 * This is a duplicate of dmt() in mipsmtregs.h to avoid problems with
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h
index 6b97744f00cd..6ed1151a05a3 100644
--- a/include/asm-mips/page.h
+++ b/include/asm-mips/page.h
@@ -138,16 +138,14 @@ typedef struct { unsigned long pgprot; } pgprot_t;
138 138
139#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) 139#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)
140 140
141#ifndef CONFIG_SPARSEMEM
142#ifndef CONFIG_NEED_MULTIPLE_NODES
143#define pfn_valid(pfn) ((pfn) < max_mapnr)
144#endif
145#endif
146
147#ifdef CONFIG_FLATMEM 141#ifdef CONFIG_FLATMEM
148 142
149#define pfn_valid(pfn) ((pfn) < max_mapnr) 143#define pfn_valid(pfn) ((pfn) < max_mapnr)
150 144
145#elif defined(CONFIG_SPARSEMEM)
146
147/* pfn_valid is defined in linux/mmzone.h */
148
151#elif defined(CONFIG_NEED_MULTIPLE_NODES) 149#elif defined(CONFIG_NEED_MULTIPLE_NODES)
152 150
153#define pfn_valid(pfn) \ 151#define pfn_valid(pfn) \
@@ -159,8 +157,6 @@ typedef struct { unsigned long pgprot; } pgprot_t;
159 : 0); \ 157 : 0); \
160}) 158})
161 159
162#else
163#error Provide a definition of pfn_valid
164#endif 160#endif
165 161
166#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) 162#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h
index 130333d7c4ee..dcb4701d5728 100644
--- a/include/asm-mips/system.h
+++ b/include/asm-mips/system.h
@@ -13,13 +13,13 @@
13#define _ASM_SYSTEM_H 13#define _ASM_SYSTEM_H
14 14
15#include <linux/types.h> 15#include <linux/types.h>
16#include <linux/irqflags.h>
16 17
17#include <asm/addrspace.h> 18#include <asm/addrspace.h>
18#include <asm/cpu-features.h> 19#include <asm/cpu-features.h>
19#include <asm/dsp.h> 20#include <asm/dsp.h>
20#include <asm/ptrace.h> 21#include <asm/ptrace.h>
21#include <asm/war.h> 22#include <asm/war.h>
22#include <asm/interrupt.h>
23 23
24/* 24/*
25 * read_barrier_depends - Flush all pending reads that subsequents reads 25 * read_barrier_depends - Flush all pending reads that subsequents reads
@@ -143,9 +143,6 @@
143#define set_mb(var, value) \ 143#define set_mb(var, value) \
144do { var = value; mb(); } while (0) 144do { var = value; mb(); } while (0)
145 145
146#define set_wmb(var, value) \
147do { var = value; wmb(); } while (0)
148
149/* 146/*
150 * switch_to(n) should switch tasks to task nr n, first 147 * switch_to(n) should switch tasks to task nr n, first
151 * checking that n isn't the current task, in which case it does nothing. 148 * checking that n isn't the current task, in which case it does nothing.
diff --git a/include/asm-mips/time.h b/include/asm-mips/time.h
index d897c8bb554d..2d543735668b 100644
--- a/include/asm-mips/time.h
+++ b/include/asm-mips/time.h
@@ -83,11 +83,11 @@ extern asmlinkage void ll_local_timer_interrupt(int irq, struct pt_regs *regs);
83/* 83/*
84 * board specific routines required by time_init(). 84 * board specific routines required by time_init().
85 * board_time_init is defaulted to NULL and can remain so. 85 * board_time_init is defaulted to NULL and can remain so.
86 * board_timer_setup must be setup properly in machine setup routine. 86 * plat_timer_setup must be setup properly in machine setup routine.
87 */ 87 */
88struct irqaction; 88struct irqaction;
89extern void (*board_time_init)(void); 89extern void (*board_time_init)(void);
90extern void (*board_timer_setup)(struct irqaction *irq); 90extern void plat_timer_setup(struct irqaction *irq);
91 91
92/* 92/*
93 * mips_hpt_frequency - must be set if you intend to use an R4k-compatible 93 * mips_hpt_frequency - must be set if you intend to use an R4k-compatible
diff --git a/include/asm-mips/unistd.h b/include/asm-mips/unistd.h
index 809f9f55bacb..610ccb8a50b3 100644
--- a/include/asm-mips/unistd.h
+++ b/include/asm-mips/unistd.h
@@ -327,16 +327,18 @@
327#define __NR_splice (__NR_Linux + 304) 327#define __NR_splice (__NR_Linux + 304)
328#define __NR_sync_file_range (__NR_Linux + 305) 328#define __NR_sync_file_range (__NR_Linux + 305)
329#define __NR_tee (__NR_Linux + 306) 329#define __NR_tee (__NR_Linux + 306)
330#define __NR_vmsplice (__NR_Linux + 307)
331#define __NR_move_pages (__NR_Linux + 308)
330 332
331/* 333/*
332 * Offset of the last Linux o32 flavoured syscall 334 * Offset of the last Linux o32 flavoured syscall
333 */ 335 */
334#define __NR_Linux_syscalls 306 336#define __NR_Linux_syscalls 308
335 337
336#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ 338#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
337 339
338#define __NR_O32_Linux 4000 340#define __NR_O32_Linux 4000
339#define __NR_O32_Linux_syscalls 306 341#define __NR_O32_Linux_syscalls 308
340 342
341#if _MIPS_SIM == _MIPS_SIM_ABI64 343#if _MIPS_SIM == _MIPS_SIM_ABI64
342 344
@@ -610,16 +612,18 @@
610#define __NR_splice (__NR_Linux + 263) 612#define __NR_splice (__NR_Linux + 263)
611#define __NR_sync_file_range (__NR_Linux + 264) 613#define __NR_sync_file_range (__NR_Linux + 264)
612#define __NR_tee (__NR_Linux + 265) 614#define __NR_tee (__NR_Linux + 265)
615#define __NR_vmsplice (__NR_Linux + 266)
616#define __NR_move_pages (__NR_Linux + 267)
613 617
614/* 618/*
615 * Offset of the last Linux 64-bit flavoured syscall 619 * Offset of the last Linux 64-bit flavoured syscall
616 */ 620 */
617#define __NR_Linux_syscalls 265 621#define __NR_Linux_syscalls 267
618 622
619#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ 623#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
620 624
621#define __NR_64_Linux 5000 625#define __NR_64_Linux 5000
622#define __NR_64_Linux_syscalls 265 626#define __NR_64_Linux_syscalls 267
623 627
624#if _MIPS_SIM == _MIPS_SIM_NABI32 628#if _MIPS_SIM == _MIPS_SIM_NABI32
625 629
@@ -897,16 +901,18 @@
897#define __NR_splice (__NR_Linux + 267) 901#define __NR_splice (__NR_Linux + 267)
898#define __NR_sync_file_range (__NR_Linux + 268) 902#define __NR_sync_file_range (__NR_Linux + 268)
899#define __NR_tee (__NR_Linux + 269) 903#define __NR_tee (__NR_Linux + 269)
904#define __NR_vmsplice (__NR_Linux + 270)
905#define __NR_move_pages (__NR_Linux + 271)
900 906
901/* 907/*
902 * Offset of the last N32 flavoured syscall 908 * Offset of the last N32 flavoured syscall
903 */ 909 */
904#define __NR_Linux_syscalls 269 910#define __NR_Linux_syscalls 271
905 911
906#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ 912#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
907 913
908#define __NR_N32_Linux 6000 914#define __NR_N32_Linux 6000
909#define __NR_N32_Linux_syscalls 269 915#define __NR_N32_Linux_syscalls 271
910 916
911#ifdef __KERNEL__ 917#ifdef __KERNEL__
912 918
diff --git a/include/asm-mips/vr41xx/capcella.h b/include/asm-mips/vr41xx/capcella.h
index d10ffda50de7..e0ee05a3dfcc 100644
--- a/include/asm-mips/vr41xx/capcella.h
+++ b/include/asm-mips/vr41xx/capcella.h
@@ -20,7 +20,7 @@
20#ifndef __ZAO_CAPCELLA_H 20#ifndef __ZAO_CAPCELLA_H
21#define __ZAO_CAPCELLA_H 21#define __ZAO_CAPCELLA_H
22 22
23#include <asm/vr41xx/vr41xx.h> 23#include <asm/vr41xx/irq.h>
24 24
25/* 25/*
26 * General-Purpose I/O Pin Number 26 * General-Purpose I/O Pin Number
diff --git a/include/asm-mips/vr41xx/cmbvr4133.h b/include/asm-mips/vr41xx/cmbvr4133.h
index 42af389019ea..9490ade58b46 100644
--- a/include/asm-mips/vr41xx/cmbvr4133.h
+++ b/include/asm-mips/vr41xx/cmbvr4133.h
@@ -15,8 +15,7 @@
15#ifndef __NEC_CMBVR4133_H 15#ifndef __NEC_CMBVR4133_H
16#define __NEC_CMBVR4133_H 16#define __NEC_CMBVR4133_H
17 17
18#include <asm/addrspace.h> 18#include <asm/vr41xx/irq.h>
19#include <asm/vr41xx/vr41xx.h>
20 19
21/* 20/*
22 * General-Purpose I/O Pin Number 21 * General-Purpose I/O Pin Number
@@ -55,7 +54,4 @@
55#define IDE_SECONDARY_IRQ I8259_IRQ(15) 54#define IDE_SECONDARY_IRQ I8259_IRQ(15)
56#define I8259_IRQ_LAST IDE_SECONDARY_IRQ 55#define I8259_IRQ_LAST IDE_SECONDARY_IRQ
57 56
58#define RTC_PORT(x) (0xaf000100 + (x))
59#define RTC_IO_EXTENT 0x140
60
61#endif /* __NEC_CMBVR4133_H */ 57#endif /* __NEC_CMBVR4133_H */
diff --git a/include/asm-mips/vr41xx/e55.h b/include/asm-mips/vr41xx/e55.h
deleted file mode 100644
index 558f2269bf37..000000000000
--- a/include/asm-mips/vr41xx/e55.h
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2 * e55.h, Include file for CASIO CASSIOPEIA E-10/15/55/65.
3 *
4 * Copyright (C) 2002-2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef __CASIO_E55_H
21#define __CASIO_E55_H
22
23#include <asm/addrspace.h>
24#include <asm/vr41xx/vr41xx.h>
25
26/*
27 * Board specific address mapping
28 */
29#define VR41XX_ISA_MEM_BASE 0x10000000
30#define VR41XX_ISA_MEM_SIZE 0x04000000
31
32/* VR41XX_ISA_IO_BASE includes offset from real base. */
33#define VR41XX_ISA_IO_BASE 0x1400c000
34#define VR41XX_ISA_IO_SIZE 0x03ff4000
35
36#define ISA_BUS_IO_BASE 0
37#define ISA_BUS_IO_SIZE VR41XX_ISA_IO_SIZE
38
39#define IO_PORT_BASE KSEG1ADDR(VR41XX_ISA_IO_BASE)
40#define IO_PORT_RESOURCE_START ISA_BUS_IO_BASE
41#define IO_PORT_RESOURCE_END (ISA_BUS_IO_BASE + ISA_BUS_IO_SIZE - 1)
42
43#endif /* __CASIO_E55_H */
diff --git a/include/asm-mips/vr41xx/irq.h b/include/asm-mips/vr41xx/irq.h
new file mode 100644
index 000000000000..d315dfbc08f2
--- /dev/null
+++ b/include/asm-mips/vr41xx/irq.h
@@ -0,0 +1,101 @@
1/*
2 * include/asm-mips/vr41xx/irq.h
3 *
4 * Interrupt numbers for NEC VR4100 series.
5 *
6 * Copyright (C) 1999 Michael Klar
7 * Copyright (C) 2001, 2002 Paul Mundt
8 * Copyright (C) 2002 MontaVista Software, Inc.
9 * Copyright (C) 2002 TimeSys Corp.
10 * Copyright (C) 2003-2006 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version.
16 */
17#ifndef __NEC_VR41XX_IRQ_H
18#define __NEC_VR41XX_IRQ_H
19
20/*
21 * CPU core Interrupt Numbers
22 */
23#define MIPS_CPU_IRQ_BASE 0
24#define MIPS_CPU_IRQ(x) (MIPS_CPU_IRQ_BASE + (x))
25#define MIPS_SOFTINT0_IRQ MIPS_CPU_IRQ(0)
26#define MIPS_SOFTINT1_IRQ MIPS_CPU_IRQ(1)
27#define INT0_IRQ MIPS_CPU_IRQ(2)
28#define INT1_IRQ MIPS_CPU_IRQ(3)
29#define INT2_IRQ MIPS_CPU_IRQ(4)
30#define INT3_IRQ MIPS_CPU_IRQ(5)
31#define INT4_IRQ MIPS_CPU_IRQ(6)
32#define TIMER_IRQ MIPS_CPU_IRQ(7)
33
34/*
35 * SYINT1 Interrupt Numbers
36 */
37#define SYSINT1_IRQ_BASE 8
38#define SYSINT1_IRQ(x) (SYSINT1_IRQ_BASE + (x))
39#define BATTRY_IRQ SYSINT1_IRQ(0)
40#define POWER_IRQ SYSINT1_IRQ(1)
41#define RTCLONG1_IRQ SYSINT1_IRQ(2)
42#define ELAPSEDTIME_IRQ SYSINT1_IRQ(3)
43/* RFU */
44#define PIU_IRQ SYSINT1_IRQ(5)
45#define AIU_IRQ SYSINT1_IRQ(6)
46#define KIU_IRQ SYSINT1_IRQ(7)
47#define GIUINT_IRQ SYSINT1_IRQ(8)
48#define SIU_IRQ SYSINT1_IRQ(9)
49#define BUSERR_IRQ SYSINT1_IRQ(10)
50#define SOFTINT_IRQ SYSINT1_IRQ(11)
51#define CLKRUN_IRQ SYSINT1_IRQ(12)
52#define DOZEPIU_IRQ SYSINT1_IRQ(13)
53#define SYSINT1_IRQ_LAST DOZEPIU_IRQ
54
55/*
56 * SYSINT2 Interrupt Numbers
57 */
58#define SYSINT2_IRQ_BASE 24
59#define SYSINT2_IRQ(x) (SYSINT2_IRQ_BASE + (x))
60#define RTCLONG2_IRQ SYSINT2_IRQ(0)
61#define LED_IRQ SYSINT2_IRQ(1)
62#define HSP_IRQ SYSINT2_IRQ(2)
63#define TCLOCK_IRQ SYSINT2_IRQ(3)
64#define FIR_IRQ SYSINT2_IRQ(4)
65#define CEU_IRQ SYSINT2_IRQ(4) /* same number as FIR_IRQ */
66#define DSIU_IRQ SYSINT2_IRQ(5)
67#define PCI_IRQ SYSINT2_IRQ(6)
68#define SCU_IRQ SYSINT2_IRQ(7)
69#define CSI_IRQ SYSINT2_IRQ(8)
70#define BCU_IRQ SYSINT2_IRQ(9)
71#define ETHERNET_IRQ SYSINT2_IRQ(10)
72#define SYSINT2_IRQ_LAST ETHERNET_IRQ
73
74/*
75 * GIU Interrupt Numbers
76 */
77#define GIU_IRQ_BASE 40
78#define GIU_IRQ(x) (GIU_IRQ_BASE + (x)) /* IRQ 40-71 */
79#define GIU_IRQ_LAST GIU_IRQ(31)
80
81/*
82 * VRC4173 Interrupt Numbers
83 */
84#define VRC4173_IRQ_BASE 72
85#define VRC4173_IRQ(x) (VRC4173_IRQ_BASE + (x))
86#define VRC4173_USB_IRQ VRC4173_IRQ(0)
87#define VRC4173_PCMCIA2_IRQ VRC4173_IRQ(1)
88#define VRC4173_PCMCIA1_IRQ VRC4173_IRQ(2)
89#define VRC4173_PS2CH2_IRQ VRC4173_IRQ(3)
90#define VRC4173_PS2CH1_IRQ VRC4173_IRQ(4)
91#define VRC4173_PIU_IRQ VRC4173_IRQ(5)
92#define VRC4173_AIU_IRQ VRC4173_IRQ(6)
93#define VRC4173_KIU_IRQ VRC4173_IRQ(7)
94#define VRC4173_GIU_IRQ VRC4173_IRQ(8)
95#define VRC4173_AC97_IRQ VRC4173_IRQ(9)
96#define VRC4173_AC97INT1_IRQ VRC4173_IRQ(10)
97/* RFU */
98#define VRC4173_DOZEPIU_IRQ VRC4173_IRQ(13)
99#define VRC4173_IRQ_LAST VRC4173_DOZEPIU_IRQ
100
101#endif /* __NEC_VR41XX_IRQ_H */
diff --git a/include/asm-mips/vr41xx/mpc30x.h b/include/asm-mips/vr41xx/mpc30x.h
index a6cbe4da6667..1d67df843dc3 100644
--- a/include/asm-mips/vr41xx/mpc30x.h
+++ b/include/asm-mips/vr41xx/mpc30x.h
@@ -20,7 +20,7 @@
20#ifndef __VICTOR_MPC30X_H 20#ifndef __VICTOR_MPC30X_H
21#define __VICTOR_MPC30X_H 21#define __VICTOR_MPC30X_H
22 22
23#include <asm/vr41xx/vr41xx.h> 23#include <asm/vr41xx/irq.h>
24 24
25/* 25/*
26 * General-Purpose I/O Pin Number 26 * General-Purpose I/O Pin Number
diff --git a/include/asm-mips/vr41xx/tb0219.h b/include/asm-mips/vr41xx/tb0219.h
index b318b9612a83..dc981b4be0a4 100644
--- a/include/asm-mips/vr41xx/tb0219.h
+++ b/include/asm-mips/vr41xx/tb0219.h
@@ -23,7 +23,7 @@
23#ifndef __TANBAC_TB0219_H 23#ifndef __TANBAC_TB0219_H
24#define __TANBAC_TB0219_H 24#define __TANBAC_TB0219_H
25 25
26#include <asm/vr41xx/vr41xx.h> 26#include <asm/vr41xx/irq.h>
27 27
28/* 28/*
29 * General-Purpose I/O Pin Number 29 * General-Purpose I/O Pin Number
diff --git a/include/asm-mips/vr41xx/tb0226.h b/include/asm-mips/vr41xx/tb0226.h
index 2513f450e2d6..de527dcfa5f3 100644
--- a/include/asm-mips/vr41xx/tb0226.h
+++ b/include/asm-mips/vr41xx/tb0226.h
@@ -20,7 +20,7 @@
20#ifndef __TANBAC_TB0226_H 20#ifndef __TANBAC_TB0226_H
21#define __TANBAC_TB0226_H 21#define __TANBAC_TB0226_H
22 22
23#include <asm/vr41xx/vr41xx.h> 23#include <asm/vr41xx/irq.h>
24 24
25/* 25/*
26 * General-Purpose I/O Pin Number 26 * General-Purpose I/O Pin Number
diff --git a/include/asm-mips/vr41xx/tb0287.h b/include/asm-mips/vr41xx/tb0287.h
index dd9832313afe..61bead68abf0 100644
--- a/include/asm-mips/vr41xx/tb0287.h
+++ b/include/asm-mips/vr41xx/tb0287.h
@@ -22,7 +22,7 @@
22#ifndef __TANBAC_TB0287_H 22#ifndef __TANBAC_TB0287_H
23#define __TANBAC_TB0287_H 23#define __TANBAC_TB0287_H
24 24
25#include <asm/vr41xx/vr41xx.h> 25#include <asm/vr41xx/irq.h>
26 26
27/* 27/*
28 * General-Purpose I/O Pin Number 28 * General-Purpose I/O Pin Number
diff --git a/include/asm-mips/vr41xx/vr41xx.h b/include/asm-mips/vr41xx/vr41xx.h
index 70828d5fae9c..dd3eb3dc5886 100644
--- a/include/asm-mips/vr41xx/vr41xx.h
+++ b/include/asm-mips/vr41xx/vr41xx.h
@@ -74,59 +74,6 @@ extern void vr41xx_mask_clock(vr41xx_clock_t clock);
74/* 74/*
75 * Interrupt Control Unit 75 * Interrupt Control Unit
76 */ 76 */
77/* CPU core Interrupt Numbers */
78#define MIPS_CPU_IRQ_BASE 0
79#define MIPS_CPU_IRQ(x) (MIPS_CPU_IRQ_BASE + (x))
80#define MIPS_SOFTINT0_IRQ MIPS_CPU_IRQ(0)
81#define MIPS_SOFTINT1_IRQ MIPS_CPU_IRQ(1)
82#define INT0_IRQ MIPS_CPU_IRQ(2)
83#define INT1_IRQ MIPS_CPU_IRQ(3)
84#define INT2_IRQ MIPS_CPU_IRQ(4)
85#define INT3_IRQ MIPS_CPU_IRQ(5)
86#define INT4_IRQ MIPS_CPU_IRQ(6)
87#define TIMER_IRQ MIPS_CPU_IRQ(7)
88
89/* SYINT1 Interrupt Numbers */
90#define SYSINT1_IRQ_BASE 8
91#define SYSINT1_IRQ(x) (SYSINT1_IRQ_BASE + (x))
92#define BATTRY_IRQ SYSINT1_IRQ(0)
93#define POWER_IRQ SYSINT1_IRQ(1)
94#define RTCLONG1_IRQ SYSINT1_IRQ(2)
95#define ELAPSEDTIME_IRQ SYSINT1_IRQ(3)
96/* RFU */
97#define PIU_IRQ SYSINT1_IRQ(5)
98#define AIU_IRQ SYSINT1_IRQ(6)
99#define KIU_IRQ SYSINT1_IRQ(7)
100#define GIUINT_IRQ SYSINT1_IRQ(8)
101#define SIU_IRQ SYSINT1_IRQ(9)
102#define BUSERR_IRQ SYSINT1_IRQ(10)
103#define SOFTINT_IRQ SYSINT1_IRQ(11)
104#define CLKRUN_IRQ SYSINT1_IRQ(12)
105#define DOZEPIU_IRQ SYSINT1_IRQ(13)
106#define SYSINT1_IRQ_LAST DOZEPIU_IRQ
107
108/* SYSINT2 Interrupt Numbers */
109#define SYSINT2_IRQ_BASE 24
110#define SYSINT2_IRQ(x) (SYSINT2_IRQ_BASE + (x))
111#define RTCLONG2_IRQ SYSINT2_IRQ(0)
112#define LED_IRQ SYSINT2_IRQ(1)
113#define HSP_IRQ SYSINT2_IRQ(2)
114#define TCLOCK_IRQ SYSINT2_IRQ(3)
115#define FIR_IRQ SYSINT2_IRQ(4)
116#define CEU_IRQ SYSINT2_IRQ(4) /* same number as FIR_IRQ */
117#define DSIU_IRQ SYSINT2_IRQ(5)
118#define PCI_IRQ SYSINT2_IRQ(6)
119#define SCU_IRQ SYSINT2_IRQ(7)
120#define CSI_IRQ SYSINT2_IRQ(8)
121#define BCU_IRQ SYSINT2_IRQ(9)
122#define ETHERNET_IRQ SYSINT2_IRQ(10)
123#define SYSINT2_IRQ_LAST ETHERNET_IRQ
124
125/* GIU Interrupt Numbers */
126#define GIU_IRQ_BASE 40
127#define GIU_IRQ(x) (GIU_IRQ_BASE + (x)) /* IRQ 40-71 */
128#define GIU_IRQ_LAST GIU_IRQ(31)
129
130extern int vr41xx_set_intassign(unsigned int irq, unsigned char intassign); 77extern int vr41xx_set_intassign(unsigned int irq, unsigned char intassign);
131extern int cascade_irq(unsigned int irq, int (*get_irq)(unsigned int, struct pt_regs *)); 78extern int cascade_irq(unsigned int irq, int (*get_irq)(unsigned int, struct pt_regs *));
132 79
diff --git a/include/asm-mips/vr41xx/vrc4173.h b/include/asm-mips/vr41xx/vrc4173.h
deleted file mode 100644
index 96fdcd54cec7..000000000000
--- a/include/asm-mips/vr41xx/vrc4173.h
+++ /dev/null
@@ -1,221 +0,0 @@
1/*
2 * vrc4173.h, Include file for NEC VRC4173.
3 *
4 * Copyright (C) 2000 Michael R. McDonald
5 * Copyright (C) 2001-2003 Montavista Software Inc.
6 * Author: Yoichi Yuasa <yyuasa@mvista.com, or source@mvista.com>
7 * Copyright (C) 2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
8 * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org)
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24#ifndef __NEC_VRC4173_H
25#define __NEC_VRC4173_H
26
27#include <asm/io.h>
28
29/*
30 * Interrupt Number
31 */
32#define VRC4173_IRQ_BASE 72
33#define VRC4173_IRQ(x) (VRC4173_IRQ_BASE + (x))
34#define VRC4173_USB_IRQ VRC4173_IRQ(0)
35#define VRC4173_PCMCIA2_IRQ VRC4173_IRQ(1)
36#define VRC4173_PCMCIA1_IRQ VRC4173_IRQ(2)
37#define VRC4173_PS2CH2_IRQ VRC4173_IRQ(3)
38#define VRC4173_PS2CH1_IRQ VRC4173_IRQ(4)
39#define VRC4173_PIU_IRQ VRC4173_IRQ(5)
40#define VRC4173_AIU_IRQ VRC4173_IRQ(6)
41#define VRC4173_KIU_IRQ VRC4173_IRQ(7)
42#define VRC4173_GIU_IRQ VRC4173_IRQ(8)
43#define VRC4173_AC97_IRQ VRC4173_IRQ(9)
44#define VRC4173_AC97INT1_IRQ VRC4173_IRQ(10)
45/* RFU */
46#define VRC4173_DOZEPIU_IRQ VRC4173_IRQ(13)
47#define VRC4173_IRQ_LAST VRC4173_DOZEPIU_IRQ
48
49/*
50 * PCI I/O accesses
51 */
52#ifdef CONFIG_VRC4173
53
54extern unsigned long vrc4173_io_offset;
55
56#define set_vrc4173_io_offset(offset) do { vrc4173_io_offset = (offset); } while (0)
57
58#define vrc4173_outb(val,port) outb((val), vrc4173_io_offset+(port))
59#define vrc4173_outw(val,port) outw((val), vrc4173_io_offset+(port))
60#define vrc4173_outl(val,port) outl((val), vrc4173_io_offset+(port))
61#define vrc4173_outb_p(val,port) outb_p((val), vrc4173_io_offset+(port))
62#define vrc4173_outw_p(val,port) outw_p((val), vrc4173_io_offset+(port))
63#define vrc4173_outl_p(val,port) outl_p((val), vrc4173_io_offset+(port))
64
65#define vrc4173_inb(port) inb(vrc4173_io_offset+(port))
66#define vrc4173_inw(port) inw(vrc4173_io_offset+(port))
67#define vrc4173_inl(port) inl(vrc4173_io_offset+(port))
68#define vrc4173_inb_p(port) inb_p(vrc4173_io_offset+(port))
69#define vrc4173_inw_p(port) inw_p(vrc4173_io_offset+(port))
70#define vrc4173_inl_p(port) inl_p(vrc4173_io_offset+(port))
71
72#define vrc4173_outsb(port,addr,count) outsb(vrc4173_io_offset+(port),(addr),(count))
73#define vrc4173_outsw(port,addr,count) outsw(vrc4173_io_offset+(port),(addr),(count))
74#define vrc4173_outsl(port,addr,count) outsl(vrc4173_io_offset+(port),(addr),(count))
75
76#define vrc4173_insb(port,addr,count) insb(vrc4173_io_offset+(port),(addr),(count))
77#define vrc4173_insw(port,addr,count) insw(vrc4173_io_offset+(port),(addr),(count))
78#define vrc4173_insl(port,addr,count) insl(vrc4173_io_offset+(port),(addr),(count))
79
80#else
81
82#define set_vrc4173_io_offset(offset) do {} while (0)
83
84#define vrc4173_outb(val,port) do {} while (0)
85#define vrc4173_outw(val,port) do {} while (0)
86#define vrc4173_outl(val,port) do {} while (0)
87#define vrc4173_outb_p(val,port) do {} while (0)
88#define vrc4173_outw_p(val,port) do {} while (0)
89#define vrc4173_outl_p(val,port) do {} while (0)
90
91#define vrc4173_inb(port) 0
92#define vrc4173_inw(port) 0
93#define vrc4173_inl(port) 0
94#define vrc4173_inb_p(port) 0
95#define vrc4173_inw_p(port) 0
96#define vrc4173_inl_p(port) 0
97
98#define vrc4173_outsb(port,addr,count) do {} while (0)
99#define vrc4173_outsw(port,addr,count) do {} while (0)
100#define vrc4173_outsl(port,addr,count) do {} while (0)
101
102#define vrc4173_insb(port,addr,count) do {} while (0)
103#define vrc4173_insw(port,addr,count) do {} while (0)
104#define vrc4173_insl(port,addr,count) do {} while (0)
105
106#endif
107
108/*
109 * Clock Mask Unit
110 */
111typedef enum vrc4173_clock {
112 VRC4173_PIU_CLOCK,
113 VRC4173_KIU_CLOCK,
114 VRC4173_AIU_CLOCK,
115 VRC4173_PS2_CH1_CLOCK,
116 VRC4173_PS2_CH2_CLOCK,
117 VRC4173_USBU_PCI_CLOCK,
118 VRC4173_CARDU1_PCI_CLOCK,
119 VRC4173_CARDU2_PCI_CLOCK,
120 VRC4173_AC97U_PCI_CLOCK,
121 VRC4173_USBU_48MHz_CLOCK,
122 VRC4173_EXT_48MHz_CLOCK,
123 VRC4173_48MHz_CLOCK,
124} vrc4173_clock_t;
125
126#ifdef CONFIG_VRC4173
127
128extern void vrc4173_supply_clock(vrc4173_clock_t clock);
129extern void vrc4173_mask_clock(vrc4173_clock_t clock);
130
131#else
132
133static inline void vrc4173_supply_clock(vrc4173_clock_t clock) {}
134static inline void vrc4173_mask_clock(vrc4173_clock_t clock) {}
135
136#endif
137
138/*
139 * Interupt Control Unit
140 */
141
142#define VRC4173_PIUINT_COMMAND 0x0040
143#define VRC4173_PIUINT_DATA 0x0020
144#define VRC4173_PIUINT_PAGE1 0x0010
145#define VRC4173_PIUINT_PAGE0 0x0008
146#define VRC4173_PIUINT_DATALOST 0x0004
147#define VRC4173_PIUINT_STATUSCHANGE 0x0001
148
149#ifdef CONFIG_VRC4173
150
151extern void vrc4173_enable_piuint(uint16_t mask);
152extern void vrc4173_disable_piuint(uint16_t mask);
153
154#else
155
156static inline void vrc4173_enable_piuint(uint16_t mask) {}
157static inline void vrc4173_disable_piuint(uint16_t mask) {}
158
159#endif
160
161#define VRC4173_AIUINT_INPUT_DMAEND 0x0800
162#define VRC4173_AIUINT_INPUT_DMAHALT 0x0400
163#define VRC4173_AIUINT_INPUT_DATALOST 0x0200
164#define VRC4173_AIUINT_INPUT_DATA 0x0100
165#define VRC4173_AIUINT_OUTPUT_DMAEND 0x0008
166#define VRC4173_AIUINT_OUTPUT_DMAHALT 0x0004
167#define VRC4173_AIUINT_OUTPUT_NODATA 0x0002
168
169#ifdef CONFIG_VRC4173
170
171extern void vrc4173_enable_aiuint(uint16_t mask);
172extern void vrc4173_disable_aiuint(uint16_t mask);
173
174#else
175
176static inline void vrc4173_enable_aiuint(uint16_t mask) {}
177static inline void vrc4173_disable_aiuint(uint16_t mask) {}
178
179#endif
180
181#define VRC4173_KIUINT_DATALOST 0x0004
182#define VRC4173_KIUINT_DATAREADY 0x0002
183#define VRC4173_KIUINT_SCAN 0x0001
184
185#ifdef CONFIG_VRC4173
186
187extern void vrc4173_enable_kiuint(uint16_t mask);
188extern void vrc4173_disable_kiuint(uint16_t mask);
189
190#else
191
192static inline void vrc4173_enable_kiuint(uint16_t mask) {}
193static inline void vrc4173_disable_kiuint(uint16_t mask) {}
194
195#endif
196
197/*
198 * General-Purpose I/O Unit
199 */
200typedef enum vrc4173_function {
201 PS2_CHANNEL1,
202 PS2_CHANNEL2,
203 TOUCHPANEL,
204 KEYBOARD_8SCANLINES,
205 KEYBOARD_10SCANLINES,
206 KEYBOARD_12SCANLINES,
207 GPIO_0_15PINS,
208 GPIO_16_20PINS,
209} vrc4173_function_t;
210
211#ifdef CONFIG_VRC4173
212
213extern void vrc4173_select_function(vrc4173_function_t function);
214
215#else
216
217static inline void vrc4173_select_function(vrc4173_function_t function) {}
218
219#endif
220
221#endif /* __NEC_VRC4173_H */
diff --git a/include/asm-mips/vr41xx/workpad.h b/include/asm-mips/vr41xx/workpad.h
deleted file mode 100644
index 6bfa9c009a9b..000000000000
--- a/include/asm-mips/vr41xx/workpad.h
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2 * workpad.h, Include file for IBM WorkPad z50.
3 *
4 * Copyright (C) 2002-2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef __IBM_WORKPAD_H
21#define __IBM_WORKPAD_H
22
23#include <asm/addrspace.h>
24#include <asm/vr41xx/vr41xx.h>
25
26/*
27 * Board specific address mapping
28 */
29#define VR41XX_ISA_MEM_BASE 0x10000000
30#define VR41XX_ISA_MEM_SIZE 0x04000000
31
32/* VR41XX_ISA_IO_BASE includes offset from real base. */
33#define VR41XX_ISA_IO_BASE 0x15000000
34#define VR41XX_ISA_IO_SIZE 0x03000000
35
36#define ISA_BUS_IO_BASE 0
37#define ISA_BUS_IO_SIZE VR41XX_ISA_IO_SIZE
38
39#define IO_PORT_BASE KSEG1ADDR(VR41XX_ISA_IO_BASE)
40#define IO_PORT_RESOURCE_START ISA_BUS_IO_BASE
41#define IO_PORT_RESOURCE_END (ISA_BUS_IO_BASE + ISA_BUS_IO_SIZE - 1)
42
43#endif /* __IBM_WORKPAD_H */
diff --git a/include/asm-parisc/system.h b/include/asm-parisc/system.h
index 5fe2d2329ab5..74f037a39e6f 100644
--- a/include/asm-parisc/system.h
+++ b/include/asm-parisc/system.h
@@ -143,8 +143,6 @@ static inline void set_eiem(unsigned long val)
143#define read_barrier_depends() do { } while(0) 143#define read_barrier_depends() do { } while(0)
144 144
145#define set_mb(var, value) do { var = value; mb(); } while (0) 145#define set_mb(var, value) do { var = value; mb(); } while (0)
146#define set_wmb(var, value) do { var = value; wmb(); } while (0)
147
148 146
149#ifndef CONFIG_PA20 147#ifndef CONFIG_PA20
150/* Because kmalloc only guarantees 8-byte alignment for kmalloc'd data, 148/* Because kmalloc only guarantees 8-byte alignment for kmalloc'd data,
diff --git a/include/asm-powerpc/atomic.h b/include/asm-powerpc/atomic.h
index bb3c0ab7e667..53283e2540b3 100644
--- a/include/asm-powerpc/atomic.h
+++ b/include/asm-powerpc/atomic.h
@@ -27,8 +27,8 @@ static __inline__ void atomic_add(int a, atomic_t *v)
27 PPC405_ERR77(0,%3) 27 PPC405_ERR77(0,%3)
28" stwcx. %0,0,%3 \n\ 28" stwcx. %0,0,%3 \n\
29 bne- 1b" 29 bne- 1b"
30 : "=&r" (t), "=m" (v->counter) 30 : "=&r" (t), "+m" (v->counter)
31 : "r" (a), "r" (&v->counter), "m" (v->counter) 31 : "r" (a), "r" (&v->counter)
32 : "cc"); 32 : "cc");
33} 33}
34 34
@@ -63,8 +63,8 @@ static __inline__ void atomic_sub(int a, atomic_t *v)
63 PPC405_ERR77(0,%3) 63 PPC405_ERR77(0,%3)
64" stwcx. %0,0,%3 \n\ 64" stwcx. %0,0,%3 \n\
65 bne- 1b" 65 bne- 1b"
66 : "=&r" (t), "=m" (v->counter) 66 : "=&r" (t), "+m" (v->counter)
67 : "r" (a), "r" (&v->counter), "m" (v->counter) 67 : "r" (a), "r" (&v->counter)
68 : "cc"); 68 : "cc");
69} 69}
70 70
@@ -97,8 +97,8 @@ static __inline__ void atomic_inc(atomic_t *v)
97 PPC405_ERR77(0,%2) 97 PPC405_ERR77(0,%2)
98" stwcx. %0,0,%2 \n\ 98" stwcx. %0,0,%2 \n\
99 bne- 1b" 99 bne- 1b"
100 : "=&r" (t), "=m" (v->counter) 100 : "=&r" (t), "+m" (v->counter)
101 : "r" (&v->counter), "m" (v->counter) 101 : "r" (&v->counter)
102 : "cc"); 102 : "cc");
103} 103}
104 104
@@ -141,8 +141,8 @@ static __inline__ void atomic_dec(atomic_t *v)
141 PPC405_ERR77(0,%2)\ 141 PPC405_ERR77(0,%2)\
142" stwcx. %0,0,%2\n\ 142" stwcx. %0,0,%2\n\
143 bne- 1b" 143 bne- 1b"
144 : "=&r" (t), "=m" (v->counter) 144 : "=&r" (t), "+m" (v->counter)
145 : "r" (&v->counter), "m" (v->counter) 145 : "r" (&v->counter)
146 : "cc"); 146 : "cc");
147} 147}
148 148
@@ -253,8 +253,8 @@ static __inline__ void atomic64_add(long a, atomic64_t *v)
253 add %0,%2,%0\n\ 253 add %0,%2,%0\n\
254 stdcx. %0,0,%3 \n\ 254 stdcx. %0,0,%3 \n\
255 bne- 1b" 255 bne- 1b"
256 : "=&r" (t), "=m" (v->counter) 256 : "=&r" (t), "+m" (v->counter)
257 : "r" (a), "r" (&v->counter), "m" (v->counter) 257 : "r" (a), "r" (&v->counter)
258 : "cc"); 258 : "cc");
259} 259}
260 260
@@ -287,8 +287,8 @@ static __inline__ void atomic64_sub(long a, atomic64_t *v)
287 subf %0,%2,%0\n\ 287 subf %0,%2,%0\n\
288 stdcx. %0,0,%3 \n\ 288 stdcx. %0,0,%3 \n\
289 bne- 1b" 289 bne- 1b"
290 : "=&r" (t), "=m" (v->counter) 290 : "=&r" (t), "+m" (v->counter)
291 : "r" (a), "r" (&v->counter), "m" (v->counter) 291 : "r" (a), "r" (&v->counter)
292 : "cc"); 292 : "cc");
293} 293}
294 294
@@ -319,8 +319,8 @@ static __inline__ void atomic64_inc(atomic64_t *v)
319 addic %0,%0,1\n\ 319 addic %0,%0,1\n\
320 stdcx. %0,0,%2 \n\ 320 stdcx. %0,0,%2 \n\
321 bne- 1b" 321 bne- 1b"
322 : "=&r" (t), "=m" (v->counter) 322 : "=&r" (t), "+m" (v->counter)
323 : "r" (&v->counter), "m" (v->counter) 323 : "r" (&v->counter)
324 : "cc"); 324 : "cc");
325} 325}
326 326
@@ -361,8 +361,8 @@ static __inline__ void atomic64_dec(atomic64_t *v)
361 addic %0,%0,-1\n\ 361 addic %0,%0,-1\n\
362 stdcx. %0,0,%2\n\ 362 stdcx. %0,0,%2\n\
363 bne- 1b" 363 bne- 1b"
364 : "=&r" (t), "=m" (v->counter) 364 : "=&r" (t), "+m" (v->counter)
365 : "r" (&v->counter), "m" (v->counter) 365 : "r" (&v->counter)
366 : "cc"); 366 : "cc");
367} 367}
368 368
diff --git a/include/asm-powerpc/backlight.h b/include/asm-powerpc/backlight.h
index a5e9e656e332..8cf5c37c3817 100644
--- a/include/asm-powerpc/backlight.h
+++ b/include/asm-powerpc/backlight.h
@@ -16,16 +16,26 @@
16extern struct backlight_device *pmac_backlight; 16extern struct backlight_device *pmac_backlight;
17extern struct mutex pmac_backlight_mutex; 17extern struct mutex pmac_backlight_mutex;
18 18
19extern void pmac_backlight_calc_curve(struct fb_info*);
20extern int pmac_backlight_curve_lookup(struct fb_info *info, int value); 19extern int pmac_backlight_curve_lookup(struct fb_info *info, int value);
21 20
22extern int pmac_has_backlight_type(const char *type); 21extern int pmac_has_backlight_type(const char *type);
23 22
24extern void pmac_backlight_key_up(void); 23extern void pmac_backlight_key(int direction);
25extern void pmac_backlight_key_down(void); 24static inline void pmac_backlight_key_up(void)
25{
26 pmac_backlight_key(0);
27}
28static inline void pmac_backlight_key_down(void)
29{
30 pmac_backlight_key(1);
31}
26 32
33extern void pmac_backlight_set_legacy_brightness_pmu(int brightness);
27extern int pmac_backlight_set_legacy_brightness(int brightness); 34extern int pmac_backlight_set_legacy_brightness(int brightness);
28extern int pmac_backlight_get_legacy_brightness(void); 35extern int pmac_backlight_get_legacy_brightness(void);
29 36
37extern void pmac_backlight_enable(void);
38extern void pmac_backlight_disable(void);
39
30#endif /* __KERNEL__ */ 40#endif /* __KERNEL__ */
31#endif 41#endif
diff --git a/include/asm-powerpc/bitops.h b/include/asm-powerpc/bitops.h
index 76e2f08c3c83..c341063d0804 100644
--- a/include/asm-powerpc/bitops.h
+++ b/include/asm-powerpc/bitops.h
@@ -65,8 +65,8 @@ static __inline__ void set_bit(int nr, volatile unsigned long *addr)
65 PPC405_ERR77(0,%3) 65 PPC405_ERR77(0,%3)
66 PPC_STLCX "%0,0,%3\n" 66 PPC_STLCX "%0,0,%3\n"
67 "bne- 1b" 67 "bne- 1b"
68 : "=&r"(old), "=m"(*p) 68 : "=&r" (old), "+m" (*p)
69 : "r"(mask), "r"(p), "m"(*p) 69 : "r" (mask), "r" (p)
70 : "cc" ); 70 : "cc" );
71} 71}
72 72
@@ -82,8 +82,8 @@ static __inline__ void clear_bit(int nr, volatile unsigned long *addr)
82 PPC405_ERR77(0,%3) 82 PPC405_ERR77(0,%3)
83 PPC_STLCX "%0,0,%3\n" 83 PPC_STLCX "%0,0,%3\n"
84 "bne- 1b" 84 "bne- 1b"
85 : "=&r"(old), "=m"(*p) 85 : "=&r" (old), "+m" (*p)
86 : "r"(mask), "r"(p), "m"(*p) 86 : "r" (mask), "r" (p)
87 : "cc" ); 87 : "cc" );
88} 88}
89 89
@@ -99,8 +99,8 @@ static __inline__ void change_bit(int nr, volatile unsigned long *addr)
99 PPC405_ERR77(0,%3) 99 PPC405_ERR77(0,%3)
100 PPC_STLCX "%0,0,%3\n" 100 PPC_STLCX "%0,0,%3\n"
101 "bne- 1b" 101 "bne- 1b"
102 : "=&r"(old), "=m"(*p) 102 : "=&r" (old), "+m" (*p)
103 : "r"(mask), "r"(p), "m"(*p) 103 : "r" (mask), "r" (p)
104 : "cc" ); 104 : "cc" );
105} 105}
106 106
@@ -179,8 +179,8 @@ static __inline__ void set_bits(unsigned long mask, unsigned long *addr)
179 "or %0,%0,%2\n" 179 "or %0,%0,%2\n"
180 PPC_STLCX "%0,0,%3\n" 180 PPC_STLCX "%0,0,%3\n"
181 "bne- 1b" 181 "bne- 1b"
182 : "=&r" (old), "=m" (*addr) 182 : "=&r" (old), "+m" (*addr)
183 : "r" (mask), "r" (addr), "m" (*addr) 183 : "r" (mask), "r" (addr)
184 : "cc"); 184 : "cc");
185} 185}
186 186
diff --git a/include/asm-powerpc/irq.h b/include/asm-powerpc/irq.h
index e05754752028..d903a62959da 100644
--- a/include/asm-powerpc/irq.h
+++ b/include/asm-powerpc/irq.h
@@ -83,25 +83,24 @@ struct irq_host_ops {
83 int (*match)(struct irq_host *h, struct device_node *node); 83 int (*match)(struct irq_host *h, struct device_node *node);
84 84
85 /* Create or update a mapping between a virtual irq number and a hw 85 /* Create or update a mapping between a virtual irq number and a hw
86 * irq number. This can be called several times for the same mapping 86 * irq number. This is called only once for a given mapping.
87 * but with different flags, though unmap shall always be called
88 * before the virq->hw mapping is changed.
89 */ 87 */
90 int (*map)(struct irq_host *h, unsigned int virq, 88 int (*map)(struct irq_host *h, unsigned int virq, irq_hw_number_t hw);
91 irq_hw_number_t hw, unsigned int flags);
92 89
93 /* Dispose of such a mapping */ 90 /* Dispose of such a mapping */
94 void (*unmap)(struct irq_host *h, unsigned int virq); 91 void (*unmap)(struct irq_host *h, unsigned int virq);
95 92
96 /* Translate device-tree interrupt specifier from raw format coming 93 /* Translate device-tree interrupt specifier from raw format coming
97 * from the firmware to a irq_hw_number_t (interrupt line number) and 94 * from the firmware to a irq_hw_number_t (interrupt line number) and
98 * trigger flags that can be passed to irq_create_mapping(). 95 * type (sense) that can be passed to set_irq_type(). In the absence
99 * If no translation is provided, raw format is assumed to be one cell 96 * of this callback, irq_create_of_mapping() and irq_of_parse_and_map()
100 * for interrupt line and default sense. 97 * will return the hw number in the first cell and IRQ_TYPE_NONE for
98 * the type (which amount to keeping whatever default value the
99 * interrupt controller has for that line)
101 */ 100 */
102 int (*xlate)(struct irq_host *h, struct device_node *ctrler, 101 int (*xlate)(struct irq_host *h, struct device_node *ctrler,
103 u32 *intspec, unsigned int intsize, 102 u32 *intspec, unsigned int intsize,
104 irq_hw_number_t *out_hwirq, unsigned int *out_flags); 103 irq_hw_number_t *out_hwirq, unsigned int *out_type);
105}; 104};
106 105
107struct irq_host { 106struct irq_host {
@@ -193,25 +192,14 @@ extern void irq_set_virq_count(unsigned int count);
193 * irq_create_mapping - Map a hardware interrupt into linux virq space 192 * irq_create_mapping - Map a hardware interrupt into linux virq space
194 * @host: host owning this hardware interrupt or NULL for default host 193 * @host: host owning this hardware interrupt or NULL for default host
195 * @hwirq: hardware irq number in that host space 194 * @hwirq: hardware irq number in that host space
196 * @flags: flags passed to the controller. contains the trigger type among
197 * others. Use IRQ_TYPE_* defined in include/linux/irq.h
198 * 195 *
199 * Only one mapping per hardware interrupt is permitted. Returns a linux 196 * Only one mapping per hardware interrupt is permitted. Returns a linux
200 * virq number. The flags can be used to provide sense information to the 197 * virq number.
201 * controller (typically extracted from the device-tree). If no information 198 * If the sense/trigger is to be specified, set_irq_type() should be called
202 * is passed, the controller defaults will apply (for example, xics can only 199 * on the number returned from that call.
203 * do edge so flags are irrelevant for some pseries specific irqs).
204 *
205 * The device-tree generally contains the trigger info in an encoding that is
206 * specific to a given type of controller. In that case, you can directly use
207 * host->ops->trigger_xlate() to translate that.
208 *
209 * It is recommended that new PICs that don't have existing OF bindings chose
210 * to use a representation of triggers identical to linux.
211 */ 200 */
212extern unsigned int irq_create_mapping(struct irq_host *host, 201extern unsigned int irq_create_mapping(struct irq_host *host,
213 irq_hw_number_t hwirq, 202 irq_hw_number_t hwirq);
214 unsigned int flags);
215 203
216 204
217/*** 205/***
@@ -295,7 +283,7 @@ extern void irq_free_virt(unsigned int virq, unsigned int count);
295 * 283 *
296 * This function is identical to irq_create_mapping except that it takes 284 * This function is identical to irq_create_mapping except that it takes
297 * as input informations straight from the device-tree (typically the results 285 * as input informations straight from the device-tree (typically the results
298 * of the of_irq_map_*() functions 286 * of the of_irq_map_*() functions.
299 */ 287 */
300extern unsigned int irq_create_of_mapping(struct device_node *controller, 288extern unsigned int irq_create_of_mapping(struct device_node *controller,
301 u32 *intspec, unsigned int intsize); 289 u32 *intspec, unsigned int intsize);
diff --git a/include/asm-powerpc/kprobes.h b/include/asm-powerpc/kprobes.h
index 2d0af52c823d..34e1f89a5fa0 100644
--- a/include/asm-powerpc/kprobes.h
+++ b/include/asm-powerpc/kprobes.h
@@ -51,6 +51,7 @@ typedef unsigned int kprobe_opcode_t;
51 51
52#define ARCH_SUPPORTS_KRETPROBES 52#define ARCH_SUPPORTS_KRETPROBES
53#define ARCH_INACTIVE_KPROBE_COUNT 1 53#define ARCH_INACTIVE_KPROBE_COUNT 1
54#define flush_insn_slot(p) do { } while (0)
54 55
55void kretprobe_trampoline(void); 56void kretprobe_trampoline(void);
56extern void arch_remove_kprobe(struct kprobe *p); 57extern void arch_remove_kprobe(struct kprobe *p);
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h
index d075725bf444..7307aa775671 100644
--- a/include/asm-powerpc/system.h
+++ b/include/asm-powerpc/system.h
@@ -39,7 +39,6 @@
39#define read_barrier_depends() do { } while(0) 39#define read_barrier_depends() do { } while(0)
40 40
41#define set_mb(var, value) do { var = value; mb(); } while (0) 41#define set_mb(var, value) do { var = value; mb(); } while (0)
42#define set_wmb(var, value) do { var = value; wmb(); } while (0)
43 42
44#ifdef __KERNEL__ 43#ifdef __KERNEL__
45#ifdef CONFIG_SMP 44#ifdef CONFIG_SMP
@@ -220,8 +219,8 @@ __xchg_u32(volatile void *p, unsigned long val)
220" stwcx. %3,0,%2 \n\ 219" stwcx. %3,0,%2 \n\
221 bne- 1b" 220 bne- 1b"
222 ISYNC_ON_SMP 221 ISYNC_ON_SMP
223 : "=&r" (prev), "=m" (*(volatile unsigned int *)p) 222 : "=&r" (prev), "+m" (*(volatile unsigned int *)p)
224 : "r" (p), "r" (val), "m" (*(volatile unsigned int *)p) 223 : "r" (p), "r" (val)
225 : "cc", "memory"); 224 : "cc", "memory");
226 225
227 return prev; 226 return prev;
@@ -240,8 +239,8 @@ __xchg_u64(volatile void *p, unsigned long val)
240" stdcx. %3,0,%2 \n\ 239" stdcx. %3,0,%2 \n\
241 bne- 1b" 240 bne- 1b"
242 ISYNC_ON_SMP 241 ISYNC_ON_SMP
243 : "=&r" (prev), "=m" (*(volatile unsigned long *)p) 242 : "=&r" (prev), "+m" (*(volatile unsigned long *)p)
244 : "r" (p), "r" (val), "m" (*(volatile unsigned long *)p) 243 : "r" (p), "r" (val)
245 : "cc", "memory"); 244 : "cc", "memory");
246 245
247 return prev; 246 return prev;
@@ -299,8 +298,8 @@ __cmpxchg_u32(volatile unsigned int *p, unsigned long old, unsigned long new)
299 ISYNC_ON_SMP 298 ISYNC_ON_SMP
300 "\n\ 299 "\n\
3012:" 3002:"
302 : "=&r" (prev), "=m" (*p) 301 : "=&r" (prev), "+m" (*p)
303 : "r" (p), "r" (old), "r" (new), "m" (*p) 302 : "r" (p), "r" (old), "r" (new)
304 : "cc", "memory"); 303 : "cc", "memory");
305 304
306 return prev; 305 return prev;
@@ -322,8 +321,8 @@ __cmpxchg_u64(volatile unsigned long *p, unsigned long old, unsigned long new)
322 ISYNC_ON_SMP 321 ISYNC_ON_SMP
323 "\n\ 322 "\n\
3242:" 3232:"
325 : "=&r" (prev), "=m" (*p) 324 : "=&r" (prev), "+m" (*p)
326 : "r" (p), "r" (old), "r" (new), "m" (*p) 325 : "r" (p), "r" (old), "r" (new)
327 : "cc", "memory"); 326 : "cc", "memory");
328 327
329 return prev; 328 return prev;
diff --git a/include/asm-ppc/system.h b/include/asm-ppc/system.h
index fb49c0c49ea1..738943584c01 100644
--- a/include/asm-ppc/system.h
+++ b/include/asm-ppc/system.h
@@ -33,7 +33,6 @@
33#define read_barrier_depends() do { } while(0) 33#define read_barrier_depends() do { } while(0)
34 34
35#define set_mb(var, value) do { var = value; mb(); } while (0) 35#define set_mb(var, value) do { var = value; mb(); } while (0)
36#define set_wmb(var, value) do { var = value; wmb(); } while (0)
37 36
38#ifdef CONFIG_SMP 37#ifdef CONFIG_SMP
39#define smp_mb() mb() 38#define smp_mb() mb()
diff --git a/include/asm-s390/bug.h b/include/asm-s390/bug.h
index 7ddaa05b98d8..876898363944 100644
--- a/include/asm-s390/bug.h
+++ b/include/asm-s390/bug.h
@@ -5,9 +5,18 @@
5 5
6#ifdef CONFIG_BUG 6#ifdef CONFIG_BUG
7 7
8static inline __attribute__((noreturn)) void __do_illegal_op(void)
9{
10#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
11 __builtin_trap();
12#else
13 asm volatile(".long 0");
14#endif
15}
16
8#define BUG() do { \ 17#define BUG() do { \
9 printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ 18 printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
10 __builtin_trap(); \ 19 __do_illegal_op(); \
11} while (0) 20} while (0)
12 21
13#define HAVE_ARCH_BUG 22#define HAVE_ARCH_BUG
diff --git a/include/asm-s390/ccwdev.h b/include/asm-s390/ccwdev.h
index 12456cb2f882..58c70acffc73 100644
--- a/include/asm-s390/ccwdev.h
+++ b/include/asm-s390/ccwdev.h
@@ -63,7 +63,7 @@ ccw_device_id_match(const struct ccw_device_id *array,
63 return id; 63 return id;
64 } 64 }
65 65
66 return 0; 66 return NULL;
67} 67}
68 68
69/* The struct ccw device is our replacement for the globally accessible 69/* The struct ccw device is our replacement for the globally accessible
diff --git a/include/asm-s390/cio.h b/include/asm-s390/cio.h
index 2b1619306351..28fdd6e2b8ba 100644
--- a/include/asm-s390/cio.h
+++ b/include/asm-s390/cio.h
@@ -276,6 +276,8 @@ extern void wait_cons_dev(void);
276 276
277extern void clear_all_subchannels(void); 277extern void clear_all_subchannels(void);
278 278
279extern void cio_reset_channel_paths(void);
280
279extern void css_schedule_reprobe(void); 281extern void css_schedule_reprobe(void);
280 282
281#endif 283#endif
diff --git a/include/asm-s390/futex.h b/include/asm-s390/futex.h
index 1802775568b9..ffedf14f89f6 100644
--- a/include/asm-s390/futex.h
+++ b/include/asm-s390/futex.h
@@ -98,9 +98,10 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
98 98
99 if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) 99 if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
100 return -EFAULT; 100 return -EFAULT;
101 asm volatile(" cs %1,%4,0(%5)\n" 101 asm volatile(" sacf 256\n"
102 " cs %1,%4,0(%5)\n"
102 "0: lr %0,%1\n" 103 "0: lr %0,%1\n"
103 "1:\n" 104 "1: sacf 0\n"
104#ifndef __s390x__ 105#ifndef __s390x__
105 ".section __ex_table,\"a\"\n" 106 ".section __ex_table,\"a\"\n"
106 " .align 4\n" 107 " .align 4\n"
diff --git a/include/asm-s390/irqflags.h b/include/asm-s390/irqflags.h
index 65f4db627e7a..3b566a5b3cc7 100644
--- a/include/asm-s390/irqflags.h
+++ b/include/asm-s390/irqflags.h
@@ -25,16 +25,22 @@
25 __flags; \ 25 __flags; \
26 }) 26 })
27 27
28#define raw_local_save_flags(x) \ 28#define raw_local_save_flags(x) \
29 __asm__ __volatile__("stosm 0(%1),0" : "=m" (x) : "a" (&x), "m" (x) ) 29do { \
30 30 typecheck(unsigned long, x); \
31#define raw_local_irq_restore(x) \ 31 __asm__ __volatile__("stosm 0(%1),0" : "=m" (x) : "a" (&x), "m" (x) ); \
32 __asm__ __volatile__("ssm 0(%0)" : : "a" (&x), "m" (x) : "memory") 32} while (0)
33
34#define raw_local_irq_restore(x) \
35do { \
36 typecheck(unsigned long, x); \
37 __asm__ __volatile__("ssm 0(%0)" : : "a" (&x), "m" (x) : "memory"); \
38} while (0)
33 39
34#define raw_irqs_disabled() \ 40#define raw_irqs_disabled() \
35({ \ 41({ \
36 unsigned long flags; \ 42 unsigned long flags; \
37 local_save_flags(flags); \ 43 raw_local_save_flags(flags); \
38 !((flags >> __FLAG_SHIFT) & 3); \ 44 !((flags >> __FLAG_SHIFT) & 3); \
39}) 45})
40 46
diff --git a/include/asm-s390/pgalloc.h b/include/asm-s390/pgalloc.h
index 3002fda89d33..a78e853e0dd5 100644
--- a/include/asm-s390/pgalloc.h
+++ b/include/asm-s390/pgalloc.h
@@ -142,7 +142,7 @@ pte_alloc_one(struct mm_struct *mm, unsigned long vmaddr)
142 pte_t *pte = pte_alloc_one_kernel(mm, vmaddr); 142 pte_t *pte = pte_alloc_one_kernel(mm, vmaddr);
143 if (pte) 143 if (pte)
144 return virt_to_page(pte); 144 return virt_to_page(pte);
145 return 0; 145 return NULL;
146} 146}
147 147
148static inline void pte_free_kernel(pte_t *pte) 148static inline void pte_free_kernel(pte_t *pte)
diff --git a/include/asm-s390/processor.h b/include/asm-s390/processor.h
index c5cbc4bd8414..5b71d3731723 100644
--- a/include/asm-s390/processor.h
+++ b/include/asm-s390/processor.h
@@ -199,15 +199,13 @@ unsigned long get_wchan(struct task_struct *p);
199/* 199/*
200 * Give up the time slice of the virtual PU. 200 * Give up the time slice of the virtual PU.
201 */ 201 */
202#ifndef __s390x__ 202static inline void cpu_relax(void)
203# define cpu_relax() asm volatile ("diag 0,0,68" : : : "memory") 203{
204#else /* __s390x__ */ 204 if (MACHINE_HAS_DIAG44)
205# define cpu_relax() \ 205 asm volatile ("diag 0,0,68" : : : "memory");
206 do { \ 206 else
207 if (MACHINE_HAS_DIAG44) \ 207 barrier();
208 asm volatile ("diag 0,0,68" : : : "memory"); \ 208}
209 } while (0)
210#endif /* __s390x__ */
211 209
212/* 210/*
213 * Set PSW to specified value. 211 * Set PSW to specified value.
diff --git a/include/asm-s390/setup.h b/include/asm-s390/setup.h
index da3fd4a7bb32..19e31979309a 100644
--- a/include/asm-s390/setup.h
+++ b/include/asm-s390/setup.h
@@ -40,15 +40,16 @@ extern unsigned long machine_flags;
40#define MACHINE_IS_VM (machine_flags & 1) 40#define MACHINE_IS_VM (machine_flags & 1)
41#define MACHINE_IS_P390 (machine_flags & 4) 41#define MACHINE_IS_P390 (machine_flags & 4)
42#define MACHINE_HAS_MVPG (machine_flags & 16) 42#define MACHINE_HAS_MVPG (machine_flags & 16)
43#define MACHINE_HAS_DIAG44 (machine_flags & 32)
44#define MACHINE_HAS_IDTE (machine_flags & 128) 43#define MACHINE_HAS_IDTE (machine_flags & 128)
45 44
46#ifndef __s390x__ 45#ifndef __s390x__
47#define MACHINE_HAS_IEEE (machine_flags & 2) 46#define MACHINE_HAS_IEEE (machine_flags & 2)
48#define MACHINE_HAS_CSP (machine_flags & 8) 47#define MACHINE_HAS_CSP (machine_flags & 8)
48#define MACHINE_HAS_DIAG44 (1)
49#else /* __s390x__ */ 49#else /* __s390x__ */
50#define MACHINE_HAS_IEEE (1) 50#define MACHINE_HAS_IEEE (1)
51#define MACHINE_HAS_CSP (1) 51#define MACHINE_HAS_CSP (1)
52#define MACHINE_HAS_DIAG44 (machine_flags & 32)
52#endif /* __s390x__ */ 53#endif /* __s390x__ */
53 54
54 55
diff --git a/include/asm-s390/system.h b/include/asm-s390/system.h
index 9ab186ffde23..16040048cd1b 100644
--- a/include/asm-s390/system.h
+++ b/include/asm-s390/system.h
@@ -128,8 +128,13 @@ extern void account_system_vtime(struct task_struct *);
128 128
129#define nop() __asm__ __volatile__ ("nop") 129#define nop() __asm__ __volatile__ ("nop")
130 130
131#define xchg(ptr,x) \ 131#define xchg(ptr,x) \
132 ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(void *)(ptr),sizeof(*(ptr)))) 132({ \
133 __typeof__(*(ptr)) __ret; \
134 __ret = (__typeof__(*(ptr))) \
135 __xchg((unsigned long)(x), (void *)(ptr),sizeof(*(ptr))); \
136 __ret; \
137})
133 138
134static inline unsigned long __xchg(unsigned long x, void * ptr, int size) 139static inline unsigned long __xchg(unsigned long x, void * ptr, int size)
135{ 140{
@@ -299,7 +304,6 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
299 304
300 305
301#define set_mb(var, value) do { var = value; mb(); } while (0) 306#define set_mb(var, value) do { var = value; mb(); } while (0)
302#define set_wmb(var, value) do { var = value; wmb(); } while (0)
303 307
304#ifdef __s390x__ 308#ifdef __s390x__
305 309
diff --git a/include/asm-s390/timex.h b/include/asm-s390/timex.h
index 4848057dafe4..5d0332a4c2bd 100644
--- a/include/asm-s390/timex.h
+++ b/include/asm-s390/timex.h
@@ -19,7 +19,7 @@ static inline cycles_t get_cycles(void)
19{ 19{
20 cycles_t cycles; 20 cycles_t cycles;
21 21
22 __asm__("stck 0(%1)" : "=m" (cycles) : "a" (&cycles) : "cc"); 22 __asm__ __volatile__ ("stck 0(%1)" : "=m" (cycles) : "a" (&cycles) : "cc");
23 return cycles >> 2; 23 return cycles >> 2;
24} 24}
25 25
@@ -27,7 +27,7 @@ static inline unsigned long long get_clock (void)
27{ 27{
28 unsigned long long clk; 28 unsigned long long clk;
29 29
30 __asm__("stck 0(%1)" : "=m" (clk) : "a" (&clk) : "cc"); 30 __asm__ __volatile__ ("stck 0(%1)" : "=m" (clk) : "a" (&clk) : "cc");
31 return clk; 31 return clk;
32} 32}
33 33
diff --git a/include/asm-sh/processor.h b/include/asm-sh/processor.h
index fa5bd2d8803e..eeb0f48bb99e 100644
--- a/include/asm-sh/processor.h
+++ b/include/asm-sh/processor.h
@@ -9,6 +9,7 @@
9#define __ASM_SH_PROCESSOR_H 9#define __ASM_SH_PROCESSOR_H
10#ifdef __KERNEL__ 10#ifdef __KERNEL__
11 11
12#include <linux/compiler.h>
12#include <asm/page.h> 13#include <asm/page.h>
13#include <asm/types.h> 14#include <asm/types.h>
14#include <asm/cache.h> 15#include <asm/cache.h>
@@ -263,7 +264,7 @@ extern unsigned long get_wchan(struct task_struct *p);
263#define KSTK_ESP(tsk) ((tsk)->thread.sp) 264#define KSTK_ESP(tsk) ((tsk)->thread.sp)
264 265
265#define cpu_sleep() __asm__ __volatile__ ("sleep" : : : "memory") 266#define cpu_sleep() __asm__ __volatile__ ("sleep" : : : "memory")
266#define cpu_relax() do { } while (0) 267#define cpu_relax() barrier()
267 268
268#endif /* __KERNEL__ */ 269#endif /* __KERNEL__ */
269#endif /* __ASM_SH_PROCESSOR_H */ 270#endif /* __ASM_SH_PROCESSOR_H */
diff --git a/include/asm-sh/system.h b/include/asm-sh/system.h
index ce2e60664a86..ad35ad4958f4 100644
--- a/include/asm-sh/system.h
+++ b/include/asm-sh/system.h
@@ -101,7 +101,6 @@ extern void __xchg_called_with_bad_pointer(void);
101#endif 101#endif
102 102
103#define set_mb(var, value) do { xchg(&var, value); } while (0) 103#define set_mb(var, value) do { xchg(&var, value); } while (0)
104#define set_wmb(var, value) do { var = value; wmb(); } while (0)
105 104
106/* Interrupt Control */ 105/* Interrupt Control */
107static __inline__ void local_irq_enable(void) 106static __inline__ void local_irq_enable(void)
diff --git a/include/asm-sh64/processor.h b/include/asm-sh64/processor.h
index 1bf252dad824..eb2bee4b47b9 100644
--- a/include/asm-sh64/processor.h
+++ b/include/asm-sh64/processor.h
@@ -22,6 +22,7 @@
22#include <asm/cache.h> 22#include <asm/cache.h>
23#include <asm/registers.h> 23#include <asm/registers.h>
24#include <linux/threads.h> 24#include <linux/threads.h>
25#include <linux/compiler.h>
25 26
26/* 27/*
27 * Default implementation of macro that returns current 28 * Default implementation of macro that returns current
@@ -279,7 +280,7 @@ extern unsigned long get_wchan(struct task_struct *p);
279#define KSTK_EIP(tsk) ((tsk)->thread.pc) 280#define KSTK_EIP(tsk) ((tsk)->thread.pc)
280#define KSTK_ESP(tsk) ((tsk)->thread.sp) 281#define KSTK_ESP(tsk) ((tsk)->thread.sp)
281 282
282#define cpu_relax() do { } while (0) 283#define cpu_relax() barrier()
283 284
284#endif /* __ASSEMBLY__ */ 285#endif /* __ASSEMBLY__ */
285#endif /* __ASM_SH64_PROCESSOR_H */ 286#endif /* __ASM_SH64_PROCESSOR_H */
diff --git a/include/asm-sh64/system.h b/include/asm-sh64/system.h
index 7606f6e1f01e..87ef6f1ad5a4 100644
--- a/include/asm-sh64/system.h
+++ b/include/asm-sh64/system.h
@@ -66,7 +66,6 @@ extern void __xchg_called_with_bad_pointer(void);
66 66
67#define set_rmb(var, value) do { xchg(&var, value); } while (0) 67#define set_rmb(var, value) do { xchg(&var, value); } while (0)
68#define set_mb(var, value) set_rmb(var, value) 68#define set_mb(var, value) set_rmb(var, value)
69#define set_wmb(var, value) do { var = value; wmb(); } while (0)
70 69
71/* Interrupt Control */ 70/* Interrupt Control */
72#ifndef HARD_CLI 71#ifndef HARD_CLI
diff --git a/include/asm-sparc/oplib.h b/include/asm-sparc/oplib.h
index f283f8aaf6a9..91691e52c058 100644
--- a/include/asm-sparc/oplib.h
+++ b/include/asm-sparc/oplib.h
@@ -267,11 +267,6 @@ extern void prom_getstring(int node, char *prop, char *buf, int bufsize);
267/* Does the passed node have the given "name"? YES=1 NO=0 */ 267/* Does the passed node have the given "name"? YES=1 NO=0 */
268extern int prom_nodematch(int thisnode, char *name); 268extern int prom_nodematch(int thisnode, char *name);
269 269
270/* Puts in buffer a prom name in the form name@x,y or name (x for which_io
271 * and y for first regs phys address
272 */
273extern int prom_getname(int node, char *buf, int buflen);
274
275/* Search all siblings starting at the passed node for "name" matching 270/* Search all siblings starting at the passed node for "name" matching
276 * the given string. Returns the node on success, zero on failure. 271 * the given string. Returns the node on success, zero on failure.
277 */ 272 */
diff --git a/include/asm-sparc/signal.h b/include/asm-sparc/signal.h
index 0ae5084c427b..d03a21c97abb 100644
--- a/include/asm-sparc/signal.h
+++ b/include/asm-sparc/signal.h
@@ -168,7 +168,7 @@ struct sigstack {
168 * statically allocated data.. which is NOT GOOD. 168 * statically allocated data.. which is NOT GOOD.
169 * 169 *
170 */ 170 */
171#define SA_STATIC_ALLOC 0x80 171#define SA_STATIC_ALLOC 0x8000
172#endif 172#endif
173 173
174#include <asm-generic/signal.h> 174#include <asm-generic/signal.h>
diff --git a/include/asm-sparc/system.h b/include/asm-sparc/system.h
index cb7dda1e5e91..100c3eaf3c1f 100644
--- a/include/asm-sparc/system.h
+++ b/include/asm-sparc/system.h
@@ -199,7 +199,6 @@ static inline unsigned long getipl(void)
199#define wmb() mb() 199#define wmb() mb()
200#define read_barrier_depends() do { } while(0) 200#define read_barrier_depends() do { } while(0)
201#define set_mb(__var, __value) do { __var = __value; mb(); } while(0) 201#define set_mb(__var, __value) do { __var = __value; mb(); } while(0)
202#define set_wmb(__var, __value) set_mb(__var, __value)
203#define smp_mb() __asm__ __volatile__("":::"memory") 202#define smp_mb() __asm__ __volatile__("":::"memory")
204#define smp_rmb() __asm__ __volatile__("":::"memory") 203#define smp_rmb() __asm__ __volatile__("":::"memory")
205#define smp_wmb() __asm__ __volatile__("":::"memory") 204#define smp_wmb() __asm__ __volatile__("":::"memory")
diff --git a/include/asm-sparc64/Kbuild b/include/asm-sparc64/Kbuild
index c78d44bb195f..9284c3cb27ec 100644
--- a/include/asm-sparc64/Kbuild
+++ b/include/asm-sparc64/Kbuild
@@ -4,7 +4,7 @@ ALTARCH := sparc
4ARCHDEF := defined __sparc__ && defined __arch64__ 4ARCHDEF := defined __sparc__ && defined __arch64__
5ALTARCHDEF := defined __sparc__ && !defined __arch64__ 5ALTARCHDEF := defined __sparc__ && !defined __arch64__
6 6
7unifdef-y := fbio.h perfctr.h 7unifdef-y += fbio.h perfctr.h
8header-y += apb.h asi.h bbc.h bpp.h display7seg.h envctrl.h floppy.h \ 8header-y += apb.h asi.h bbc.h bpp.h display7seg.h envctrl.h floppy.h \
9 ipc.h kdebug.h mostek.h openprom.h openpromio.h parport.h \ 9 ipc.h kdebug.h mostek.h openprom.h openpromio.h parport.h \
10 pconf.h psrcompat.h pstate.h reg.h uctx.h utrap.h watchdog.h 10 pconf.h psrcompat.h pstate.h reg.h uctx.h utrap.h watchdog.h
diff --git a/include/asm-sparc64/dma-mapping.h b/include/asm-sparc64/dma-mapping.h
index 0f5b89c9323b..27c46fbeebd6 100644
--- a/include/asm-sparc64/dma-mapping.h
+++ b/include/asm-sparc64/dma-mapping.h
@@ -160,6 +160,20 @@ static inline void dma_free_coherent(struct device *dev, size_t size,
160 BUG(); 160 BUG();
161} 161}
162 162
163static inline void
164dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size,
165 enum dma_data_direction direction)
166{
167 BUG();
168}
169
170static inline void
171dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size,
172 enum dma_data_direction direction)
173{
174 BUG();
175}
176
163#endif /* PCI */ 177#endif /* PCI */
164 178
165 179
diff --git a/include/asm-sparc64/kprobes.h b/include/asm-sparc64/kprobes.h
index 15065af566c2..c9f5c34d318c 100644
--- a/include/asm-sparc64/kprobes.h
+++ b/include/asm-sparc64/kprobes.h
@@ -13,6 +13,7 @@ typedef u32 kprobe_opcode_t;
13#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry 13#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry
14#define arch_remove_kprobe(p) do {} while (0) 14#define arch_remove_kprobe(p) do {} while (0)
15#define ARCH_INACTIVE_KPROBE_COUNT 0 15#define ARCH_INACTIVE_KPROBE_COUNT 0
16#define flush_insn_slot(p) do { } while (0)
16 17
17/* Architecture specific copy of original instruction*/ 18/* Architecture specific copy of original instruction*/
18struct arch_specific_insn { 19struct arch_specific_insn {
diff --git a/include/asm-sparc64/openprom.h b/include/asm-sparc64/openprom.h
index b4959d2b0d99..e01b80559c93 100644
--- a/include/asm-sparc64/openprom.h
+++ b/include/asm-sparc64/openprom.h
@@ -175,7 +175,7 @@ struct linux_nodeops {
175}; 175};
176 176
177/* More fun PROM structures for device probing. */ 177/* More fun PROM structures for device probing. */
178#define PROMREG_MAX 16 178#define PROMREG_MAX 24
179#define PROMVADDR_MAX 16 179#define PROMVADDR_MAX 16
180#define PROMINTR_MAX 15 180#define PROMINTR_MAX 15
181 181
diff --git a/include/asm-sparc64/oplib.h b/include/asm-sparc64/oplib.h
index a68b0bb05958..6a0da3b1695c 100644
--- a/include/asm-sparc64/oplib.h
+++ b/include/asm-sparc64/oplib.h
@@ -287,11 +287,6 @@ extern void prom_getstring(int node, const char *prop, char *buf, int bufsize);
287/* Does the passed node have the given "name"? YES=1 NO=0 */ 287/* Does the passed node have the given "name"? YES=1 NO=0 */
288extern int prom_nodematch(int thisnode, const char *name); 288extern int prom_nodematch(int thisnode, const char *name);
289 289
290/* Puts in buffer a prom name in the form name@x,y or name (x for which_io
291 * and y for first regs phys address
292 */
293extern int prom_getname(int node, char *buf, int buflen);
294
295/* Search all siblings starting at the passed node for "name" matching 290/* Search all siblings starting at the passed node for "name" matching
296 * the given string. Returns the node on success, zero on failure. 291 * the given string. Returns the node on success, zero on failure.
297 */ 292 */
diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h
index 03f5bc9b6bec..1ba19eb34ce3 100644
--- a/include/asm-sparc64/pgtable.h
+++ b/include/asm-sparc64/pgtable.h
@@ -339,7 +339,7 @@ static inline pgprot_t pgprot_noncached(pgprot_t prot)
339 " .section .sun4v_2insn_patch, \"ax\"\n" 339 " .section .sun4v_2insn_patch, \"ax\"\n"
340 " .word 661b\n" 340 " .word 661b\n"
341 " andn %0, %4, %0\n" 341 " andn %0, %4, %0\n"
342 " or %0, %3, %0\n" 342 " or %0, %5, %0\n"
343 " .previous\n" 343 " .previous\n"
344 : "=r" (val) 344 : "=r" (val)
345 : "0" (val), "i" (_PAGE_CP_4U | _PAGE_CV_4U), "i" (_PAGE_E_4U), 345 : "0" (val), "i" (_PAGE_CP_4U | _PAGE_CV_4U), "i" (_PAGE_E_4U),
diff --git a/include/asm-sparc64/sfp-machine.h b/include/asm-sparc64/sfp-machine.h
index 5015bb8d6c32..89d42431efb5 100644
--- a/include/asm-sparc64/sfp-machine.h
+++ b/include/asm-sparc64/sfp-machine.h
@@ -34,7 +34,7 @@
34#define _FP_MUL_MEAT_D(R,X,Y) \ 34#define _FP_MUL_MEAT_D(R,X,Y) \
35 _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm) 35 _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
36#define _FP_MUL_MEAT_Q(R,X,Y) \ 36#define _FP_MUL_MEAT_Q(R,X,Y) \
37 _FP_MUL_MEAT_2_wide_3mul(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm) 37 _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
38 38
39#define _FP_DIV_MEAT_S(R,X,Y) _FP_DIV_MEAT_1_imm(S,R,X,Y,_FP_DIV_HELP_imm) 39#define _FP_DIV_MEAT_S(R,X,Y) _FP_DIV_MEAT_1_imm(S,R,X,Y,_FP_DIV_HELP_imm)
40#define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_1_udiv_norm(D,R,X,Y) 40#define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_1_udiv_norm(D,R,X,Y)
diff --git a/include/asm-sparc64/system.h b/include/asm-sparc64/system.h
index 4ca68600c670..a8b7432c9a70 100644
--- a/include/asm-sparc64/system.h
+++ b/include/asm-sparc64/system.h
@@ -123,8 +123,6 @@ do { __asm__ __volatile__("ba,pt %%xcc, 1f\n\t" \
123#define read_barrier_depends() do { } while(0) 123#define read_barrier_depends() do { } while(0)
124#define set_mb(__var, __value) \ 124#define set_mb(__var, __value) \
125 do { __var = __value; membar_storeload_storestore(); } while(0) 125 do { __var = __value; membar_storeload_storestore(); } while(0)
126#define set_wmb(__var, __value) \
127 do { __var = __value; wmb(); } while(0)
128 126
129#ifdef CONFIG_SMP 127#ifdef CONFIG_SMP
130#define smp_mb() mb() 128#define smp_mb() mb()
diff --git a/include/asm-v850/processor.h b/include/asm-v850/processor.h
index 6965b66ccaed..979e3467f9af 100644
--- a/include/asm-v850/processor.h
+++ b/include/asm-v850/processor.h
@@ -18,6 +18,7 @@
18#include <linux/thread_info.h> 18#include <linux/thread_info.h>
19#endif 19#endif
20 20
21#include <linux/compiler.h>
21#include <asm/ptrace.h> 22#include <asm/ptrace.h>
22#include <asm/entry.h> 23#include <asm/entry.h>
23 24
@@ -106,7 +107,7 @@ unsigned long get_wchan (struct task_struct *p);
106#define KSTK_ESP(task) task_sp (task) 107#define KSTK_ESP(task) task_sp (task)
107 108
108 109
109#define cpu_relax() ((void)0) 110#define cpu_relax() barrier()
110 111
111 112
112#else /* __ASSEMBLY__ */ 113#else /* __ASSEMBLY__ */
diff --git a/include/asm-v850/system.h b/include/asm-v850/system.h
index 7091af4b7866..da39916f10b0 100644
--- a/include/asm-v850/system.h
+++ b/include/asm-v850/system.h
@@ -68,7 +68,6 @@ static inline int irqs_disabled (void)
68#define read_barrier_depends() ((void)0) 68#define read_barrier_depends() ((void)0)
69#define set_rmb(var, value) do { xchg (&var, value); } while (0) 69#define set_rmb(var, value) do { xchg (&var, value); } while (0)
70#define set_mb(var, value) set_rmb (var, value) 70#define set_mb(var, value) set_rmb (var, value)
71#define set_wmb(var, value) do { var = value; wmb (); } while (0)
72 71
73#define smp_mb() mb () 72#define smp_mb() mb ()
74#define smp_rmb() rmb () 73#define smp_rmb() rmb ()
diff --git a/include/asm-x86_64/calgary.h b/include/asm-x86_64/calgary.h
index 6e1654f30986..4e3919524240 100644
--- a/include/asm-x86_64/calgary.h
+++ b/include/asm-x86_64/calgary.h
@@ -1,8 +1,10 @@
1/* 1/*
2 * Derived from include/asm-powerpc/iommu.h 2 * Derived from include/asm-powerpc/iommu.h
3 * 3 *
4 * Copyright (C) 2006 Jon Mason <jdmason@us.ibm.com>, IBM Corporation 4 * Copyright (C) IBM Corporation, 2006
5 * Copyright (C) 2006 Muli Ben-Yehuda <muli@il.ibm.com>, IBM Corporation 5 *
6 * Author: Jon Mason <jdmason@us.ibm.com>
7 * Author: Muli Ben-Yehuda <muli@il.ibm.com>
6 * 8 *
7 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 10 * it under the terms of the GNU General Public License as published by
@@ -58,9 +60,4 @@ static inline int calgary_iommu_init(void) { return 1; }
58static inline void detect_calgary(void) { return; } 60static inline void detect_calgary(void) { return; }
59#endif 61#endif
60 62
61static inline unsigned int bus_to_phb(unsigned char busno)
62{
63 return ((busno % 15 == 0) ? 0 : busno / 2 + 1);
64}
65
66#endif /* _ASM_X86_64_CALGARY_H */ 63#endif /* _ASM_X86_64_CALGARY_H */
diff --git a/include/asm-x86_64/kprobes.h b/include/asm-x86_64/kprobes.h
index d36febd9bb18..cf5317898fb0 100644
--- a/include/asm-x86_64/kprobes.h
+++ b/include/asm-x86_64/kprobes.h
@@ -47,6 +47,7 @@ typedef u8 kprobe_opcode_t;
47 47
48void kretprobe_trampoline(void); 48void kretprobe_trampoline(void);
49extern void arch_remove_kprobe(struct kprobe *p); 49extern void arch_remove_kprobe(struct kprobe *p);
50#define flush_insn_slot(p) do { } while (0)
50 51
51/* Architecture specific copy of original instruction*/ 52/* Architecture specific copy of original instruction*/
52struct arch_specific_insn { 53struct arch_specific_insn {
diff --git a/include/asm-x86_64/page.h b/include/asm-x86_64/page.h
index f7bf875aae40..10f346165cab 100644
--- a/include/asm-x86_64/page.h
+++ b/include/asm-x86_64/page.h
@@ -19,7 +19,7 @@
19#define EXCEPTION_STACK_ORDER 0 19#define EXCEPTION_STACK_ORDER 0
20#define EXCEPTION_STKSZ (PAGE_SIZE << EXCEPTION_STACK_ORDER) 20#define EXCEPTION_STKSZ (PAGE_SIZE << EXCEPTION_STACK_ORDER)
21 21
22#define DEBUG_STACK_ORDER EXCEPTION_STACK_ORDER 22#define DEBUG_STACK_ORDER (EXCEPTION_STACK_ORDER + 1)
23#define DEBUG_STKSZ (PAGE_SIZE << DEBUG_STACK_ORDER) 23#define DEBUG_STKSZ (PAGE_SIZE << DEBUG_STACK_ORDER)
24 24
25#define IRQSTACK_ORDER 2 25#define IRQSTACK_ORDER 2
diff --git a/include/asm-x86_64/swiotlb.h b/include/asm-x86_64/swiotlb.h
index 5f9a01805821..ba94ab3d2673 100644
--- a/include/asm-x86_64/swiotlb.h
+++ b/include/asm-x86_64/swiotlb.h
@@ -42,6 +42,8 @@ extern void swiotlb_free_coherent (struct device *hwdev, size_t size,
42extern int swiotlb_dma_supported(struct device *hwdev, u64 mask); 42extern int swiotlb_dma_supported(struct device *hwdev, u64 mask);
43extern void swiotlb_init(void); 43extern void swiotlb_init(void);
44 44
45extern int swiotlb_force;
46
45#ifdef CONFIG_SWIOTLB 47#ifdef CONFIG_SWIOTLB
46extern int swiotlb; 48extern int swiotlb;
47#else 49#else
diff --git a/include/asm-x86_64/system.h b/include/asm-x86_64/system.h
index f67f2873a922..6bf170bceae1 100644
--- a/include/asm-x86_64/system.h
+++ b/include/asm-x86_64/system.h
@@ -240,7 +240,6 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
240#endif 240#endif
241#define read_barrier_depends() do {} while(0) 241#define read_barrier_depends() do {} while(0)
242#define set_mb(var, value) do { (void) xchg(&var, value); } while (0) 242#define set_mb(var, value) do { (void) xchg(&var, value); } while (0)
243#define set_wmb(var, value) do { var = value; wmb(); } while (0)
244 243
245#define warn_if_not_ulong(x) do { unsigned long foo; (void) (&(x) == &foo); } while (0) 244#define warn_if_not_ulong(x) do { unsigned long foo; (void) (&(x) == &foo); } while (0)
246 245
diff --git a/include/asm-x86_64/tce.h b/include/asm-x86_64/tce.h
index ee51d31528d6..53e9a68b3336 100644
--- a/include/asm-x86_64/tce.h
+++ b/include/asm-x86_64/tce.h
@@ -1,9 +1,11 @@
1/* 1/*
2 * Copyright (C) 2006 Muli Ben-Yehuda <muli@il.ibm.com>, IBM Corporation
3 * Copyright (C) 2006 Jon Mason <jdmason@us.ibm.com>, IBM Corporation
4 *
5 * This file is derived from asm-powerpc/tce.h. 2 * This file is derived from asm-powerpc/tce.h.
6 * 3 *
4 * Copyright (C) IBM Corporation, 2006
5 *
6 * Author: Muli Ben-Yehuda <muli@il.ibm.com>
7 * Author: Jon Mason <jdmason@us.ibm.com>
8 *
7 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 10 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or 11 * the Free Software Foundation; either version 2 of the License, or
diff --git a/include/asm-xtensa/processor.h b/include/asm-xtensa/processor.h
index d1d72ad36f08..8b96e77c9d82 100644
--- a/include/asm-xtensa/processor.h
+++ b/include/asm-xtensa/processor.h
@@ -20,6 +20,7 @@
20#include <xtensa/config/tie.h> 20#include <xtensa/config/tie.h>
21#include <xtensa/config/system.h> 21#include <xtensa/config/system.h>
22 22
23#include <linux/compiler.h>
23#include <asm/ptrace.h> 24#include <asm/ptrace.h>
24#include <asm/types.h> 25#include <asm/types.h>
25#include <asm/coprocessor.h> 26#include <asm/coprocessor.h>
@@ -191,7 +192,7 @@ extern unsigned long get_wchan(struct task_struct *p);
191#define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc) 192#define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc)
192#define KSTK_ESP(tsk) (task_pt_regs(tsk)->areg[1]) 193#define KSTK_ESP(tsk) (task_pt_regs(tsk)->areg[1])
193 194
194#define cpu_relax() do { } while (0) 195#define cpu_relax() barrier()
195 196
196/* Special register access. */ 197/* Special register access. */
197 198
diff --git a/include/asm-xtensa/system.h b/include/asm-xtensa/system.h
index f986170bd2a1..932bda92a21c 100644
--- a/include/asm-xtensa/system.h
+++ b/include/asm-xtensa/system.h
@@ -99,7 +99,6 @@ static inline void disable_coprocessor(int i)
99#endif 99#endif
100 100
101#define set_mb(var, value) do { var = value; mb(); } while (0) 101#define set_mb(var, value) do { var = value; mb(); } while (0)
102#define set_wmb(var, value) do { var = value; wmb(); } while (0)
103 102
104#if !defined (__ASSEMBLY__) 103#if !defined (__ASSEMBLY__)
105 104
diff --git a/include/linux/audit.h b/include/linux/audit.h
index b27d7debc5a1..64f9f9e56ac5 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -327,21 +327,31 @@ extern void __audit_getname(const char *name);
327extern void audit_putname(const char *name); 327extern void audit_putname(const char *name);
328extern void __audit_inode(const char *name, const struct inode *inode); 328extern void __audit_inode(const char *name, const struct inode *inode);
329extern void __audit_inode_child(const char *dname, const struct inode *inode, 329extern void __audit_inode_child(const char *dname, const struct inode *inode,
330 unsigned long pino); 330 const struct inode *parent);
331extern void __audit_inode_update(const struct inode *inode);
332static inline int audit_dummy_context(void)
333{
334 void *p = current->audit_context;
335 return !p || *(int *)p;
336}
331static inline void audit_getname(const char *name) 337static inline void audit_getname(const char *name)
332{ 338{
333 if (unlikely(current->audit_context)) 339 if (unlikely(!audit_dummy_context()))
334 __audit_getname(name); 340 __audit_getname(name);
335} 341}
336static inline void audit_inode(const char *name, const struct inode *inode) { 342static inline void audit_inode(const char *name, const struct inode *inode) {
337 if (unlikely(current->audit_context)) 343 if (unlikely(!audit_dummy_context()))
338 __audit_inode(name, inode); 344 __audit_inode(name, inode);
339} 345}
340static inline void audit_inode_child(const char *dname, 346static inline void audit_inode_child(const char *dname,
341 const struct inode *inode, 347 const struct inode *inode,
342 unsigned long pino) { 348 const struct inode *parent) {
343 if (unlikely(current->audit_context)) 349 if (unlikely(!audit_dummy_context()))
344 __audit_inode_child(dname, inode, pino); 350 __audit_inode_child(dname, inode, parent);
351}
352static inline void audit_inode_update(const struct inode *inode) {
353 if (unlikely(!audit_dummy_context()))
354 __audit_inode_update(inode);
345} 355}
346 356
347 /* Private API (for audit.c only) */ 357 /* Private API (for audit.c only) */
@@ -365,57 +375,61 @@ extern int __audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat);
365 375
366static inline int audit_ipc_obj(struct kern_ipc_perm *ipcp) 376static inline int audit_ipc_obj(struct kern_ipc_perm *ipcp)
367{ 377{
368 if (unlikely(current->audit_context)) 378 if (unlikely(!audit_dummy_context()))
369 return __audit_ipc_obj(ipcp); 379 return __audit_ipc_obj(ipcp);
370 return 0; 380 return 0;
371} 381}
372static inline int audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode) 382static inline int audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode)
373{ 383{
374 if (unlikely(current->audit_context)) 384 if (unlikely(!audit_dummy_context()))
375 return __audit_ipc_set_perm(qbytes, uid, gid, mode); 385 return __audit_ipc_set_perm(qbytes, uid, gid, mode);
376 return 0; 386 return 0;
377} 387}
378static inline int audit_mq_open(int oflag, mode_t mode, struct mq_attr __user *u_attr) 388static inline int audit_mq_open(int oflag, mode_t mode, struct mq_attr __user *u_attr)
379{ 389{
380 if (unlikely(current->audit_context)) 390 if (unlikely(!audit_dummy_context()))
381 return __audit_mq_open(oflag, mode, u_attr); 391 return __audit_mq_open(oflag, mode, u_attr);
382 return 0; 392 return 0;
383} 393}
384static inline int audit_mq_timedsend(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec __user *u_abs_timeout) 394static inline int audit_mq_timedsend(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec __user *u_abs_timeout)
385{ 395{
386 if (unlikely(current->audit_context)) 396 if (unlikely(!audit_dummy_context()))
387 return __audit_mq_timedsend(mqdes, msg_len, msg_prio, u_abs_timeout); 397 return __audit_mq_timedsend(mqdes, msg_len, msg_prio, u_abs_timeout);
388 return 0; 398 return 0;
389} 399}
390static inline int audit_mq_timedreceive(mqd_t mqdes, size_t msg_len, unsigned int __user *u_msg_prio, const struct timespec __user *u_abs_timeout) 400static inline int audit_mq_timedreceive(mqd_t mqdes, size_t msg_len, unsigned int __user *u_msg_prio, const struct timespec __user *u_abs_timeout)
391{ 401{
392 if (unlikely(current->audit_context)) 402 if (unlikely(!audit_dummy_context()))
393 return __audit_mq_timedreceive(mqdes, msg_len, u_msg_prio, u_abs_timeout); 403 return __audit_mq_timedreceive(mqdes, msg_len, u_msg_prio, u_abs_timeout);
394 return 0; 404 return 0;
395} 405}
396static inline int audit_mq_notify(mqd_t mqdes, const struct sigevent __user *u_notification) 406static inline int audit_mq_notify(mqd_t mqdes, const struct sigevent __user *u_notification)
397{ 407{
398 if (unlikely(current->audit_context)) 408 if (unlikely(!audit_dummy_context()))
399 return __audit_mq_notify(mqdes, u_notification); 409 return __audit_mq_notify(mqdes, u_notification);
400 return 0; 410 return 0;
401} 411}
402static inline int audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat) 412static inline int audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat)
403{ 413{
404 if (unlikely(current->audit_context)) 414 if (unlikely(!audit_dummy_context()))
405 return __audit_mq_getsetattr(mqdes, mqstat); 415 return __audit_mq_getsetattr(mqdes, mqstat);
406 return 0; 416 return 0;
407} 417}
418extern int audit_n_rules;
408#else 419#else
409#define audit_alloc(t) ({ 0; }) 420#define audit_alloc(t) ({ 0; })
410#define audit_free(t) do { ; } while (0) 421#define audit_free(t) do { ; } while (0)
411#define audit_syscall_entry(ta,a,b,c,d,e) do { ; } while (0) 422#define audit_syscall_entry(ta,a,b,c,d,e) do { ; } while (0)
412#define audit_syscall_exit(f,r) do { ; } while (0) 423#define audit_syscall_exit(f,r) do { ; } while (0)
424#define audit_dummy_context() 1
413#define audit_getname(n) do { ; } while (0) 425#define audit_getname(n) do { ; } while (0)
414#define audit_putname(n) do { ; } while (0) 426#define audit_putname(n) do { ; } while (0)
415#define __audit_inode(n,i) do { ; } while (0) 427#define __audit_inode(n,i) do { ; } while (0)
416#define __audit_inode_child(d,i,p) do { ; } while (0) 428#define __audit_inode_child(d,i,p) do { ; } while (0)
429#define __audit_inode_update(i) do { ; } while (0)
417#define audit_inode(n,i) do { ; } while (0) 430#define audit_inode(n,i) do { ; } while (0)
418#define audit_inode_child(d,i,p) do { ; } while (0) 431#define audit_inode_child(d,i,p) do { ; } while (0)
432#define audit_inode_update(i) do { ; } while (0)
419#define auditsc_get_stamp(c,t,s) do { BUG(); } while (0) 433#define auditsc_get_stamp(c,t,s) do { BUG(); } while (0)
420#define audit_get_loginuid(c) ({ -1; }) 434#define audit_get_loginuid(c) ({ -1; })
421#define audit_ipc_obj(i) ({ 0; }) 435#define audit_ipc_obj(i) ({ 0; })
@@ -430,6 +444,7 @@ static inline int audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat)
430#define audit_mq_timedreceive(d,l,p,t) ({ 0; }) 444#define audit_mq_timedreceive(d,l,p,t) ({ 0; })
431#define audit_mq_notify(d,n) ({ 0; }) 445#define audit_mq_notify(d,n) ({ 0; })
432#define audit_mq_getsetattr(d,s) ({ 0; }) 446#define audit_mq_getsetattr(d,s) ({ 0; })
447#define audit_n_rules 0
433#endif 448#endif
434 449
435#ifdef CONFIG_AUDIT 450#ifdef CONFIG_AUDIT
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
index a7e8cef73d15..7520cc1ff9e2 100644
--- a/include/linux/blktrace_api.h
+++ b/include/linux/blktrace_api.h
@@ -11,7 +11,7 @@ enum blktrace_cat {
11 BLK_TC_READ = 1 << 0, /* reads */ 11 BLK_TC_READ = 1 << 0, /* reads */
12 BLK_TC_WRITE = 1 << 1, /* writes */ 12 BLK_TC_WRITE = 1 << 1, /* writes */
13 BLK_TC_BARRIER = 1 << 2, /* barrier */ 13 BLK_TC_BARRIER = 1 << 2, /* barrier */
14 BLK_TC_SYNC = 1 << 3, /* barrier */ 14 BLK_TC_SYNC = 1 << 3, /* sync IO */
15 BLK_TC_QUEUE = 1 << 4, /* queueing/merging */ 15 BLK_TC_QUEUE = 1 << 4, /* queueing/merging */
16 BLK_TC_REQUEUE = 1 << 5, /* requeueing */ 16 BLK_TC_REQUEUE = 1 << 5, /* requeueing */
17 BLK_TC_ISSUE = 1 << 6, /* issue */ 17 BLK_TC_ISSUE = 1 << 6, /* issue */
@@ -19,6 +19,7 @@ enum blktrace_cat {
19 BLK_TC_FS = 1 << 8, /* fs requests */ 19 BLK_TC_FS = 1 << 8, /* fs requests */
20 BLK_TC_PC = 1 << 9, /* pc requests */ 20 BLK_TC_PC = 1 << 9, /* pc requests */
21 BLK_TC_NOTIFY = 1 << 10, /* special message */ 21 BLK_TC_NOTIFY = 1 << 10, /* special message */
22 BLK_TC_AHEAD = 1 << 11, /* readahead */
22 23
23 BLK_TC_END = 1 << 15, /* only 16-bits, reminder */ 24 BLK_TC_END = 1 << 15, /* only 16-bits, reminder */
24}; 25};
@@ -147,7 +148,7 @@ static inline void blk_add_trace_rq(struct request_queue *q, struct request *rq,
147 u32 what) 148 u32 what)
148{ 149{
149 struct blk_trace *bt = q->blk_trace; 150 struct blk_trace *bt = q->blk_trace;
150 int rw = rq->flags & 0x07; 151 int rw = rq->flags & 0x03;
151 152
152 if (likely(!bt)) 153 if (likely(!bt))
153 return; 154 return;
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
index 22866fa2d960..1021f508d82c 100644
--- a/include/linux/bootmem.h
+++ b/include/linux/bootmem.h
@@ -91,7 +91,7 @@ static inline void *alloc_remap(int nid, unsigned long size)
91} 91}
92#endif 92#endif
93 93
94extern unsigned long nr_kernel_pages; 94extern unsigned long __meminitdata nr_kernel_pages;
95extern unsigned long nr_all_pages; 95extern unsigned long nr_all_pages;
96 96
97extern void *__init alloc_large_system_hash(const char *tablename, 97extern void *__init alloc_large_system_hash(const char *tablename,
diff --git a/include/linux/cn_proc.h b/include/linux/cn_proc.h
index dbb7769009be..1c86d65bc4b9 100644
--- a/include/linux/cn_proc.h
+++ b/include/linux/cn_proc.h
@@ -57,7 +57,8 @@ struct proc_event {
57 PROC_EVENT_EXIT = 0x80000000 57 PROC_EVENT_EXIT = 0x80000000
58 } what; 58 } what;
59 __u32 cpu; 59 __u32 cpu;
60 struct timespec timestamp; 60 __u64 __attribute__((aligned(8))) timestamp_ns;
61 /* Number of nano seconds since system boot */
61 union { /* must be last field of proc_event struct */ 62 union { /* must be last field of proc_event struct */
62 struct { 63 struct {
63 __u32 err; 64 __u32 err;
diff --git a/include/linux/completion.h b/include/linux/completion.h
index 251c41e3ddd5..268c5a4a2bd4 100644
--- a/include/linux/completion.h
+++ b/include/linux/completion.h
@@ -18,6 +18,9 @@ struct completion {
18#define COMPLETION_INITIALIZER(work) \ 18#define COMPLETION_INITIALIZER(work) \
19 { 0, __WAIT_QUEUE_HEAD_INITIALIZER((work).wait) } 19 { 0, __WAIT_QUEUE_HEAD_INITIALIZER((work).wait) }
20 20
21#define COMPLETION_INITIALIZER_ONSTACK(work) \
22 ({ init_completion(&work); work; })
23
21#define DECLARE_COMPLETION(work) \ 24#define DECLARE_COMPLETION(work) \
22 struct completion work = COMPLETION_INITIALIZER(work) 25 struct completion work = COMPLETION_INITIALIZER(work)
23 26
@@ -28,7 +31,7 @@ struct completion {
28 */ 31 */
29#ifdef CONFIG_LOCKDEP 32#ifdef CONFIG_LOCKDEP
30# define DECLARE_COMPLETION_ONSTACK(work) \ 33# define DECLARE_COMPLETION_ONSTACK(work) \
31 struct completion work = ({ init_completion(&work); work; }) 34 struct completion work = COMPLETION_INITIALIZER_ONSTACK(work)
32#else 35#else
33# define DECLARE_COMPLETION_ONSTACK(work) DECLARE_COMPLETION(work) 36# define DECLARE_COMPLETION_ONSTACK(work) DECLARE_COMPLETION(work)
34#endif 37#endif
diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h
index f8e5587a0f92..25423f79bf9f 100644
--- a/include/linux/console_struct.h
+++ b/include/linux/console_struct.h
@@ -9,6 +9,7 @@
9 * to achieve effects such as fast scrolling by changing the origin. 9 * to achieve effects such as fast scrolling by changing the origin.
10 */ 10 */
11 11
12#include <linux/wait.h>
12#include <linux/vt.h> 13#include <linux/vt.h>
13 14
14struct vt_struct; 15struct vt_struct;
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 44a11f1ccaf2..8fb344a9abd8 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -48,7 +48,6 @@ static inline void unregister_cpu_notifier(struct notifier_block *nb)
48{ 48{
49} 49}
50#endif 50#endif
51extern int current_in_cpu_hotplug(void);
52 51
53int cpu_up(unsigned int cpu); 52int cpu_up(unsigned int cpu);
54 53
@@ -61,10 +60,6 @@ static inline int register_cpu_notifier(struct notifier_block *nb)
61static inline void unregister_cpu_notifier(struct notifier_block *nb) 60static inline void unregister_cpu_notifier(struct notifier_block *nb)
62{ 61{
63} 62}
64static inline int current_in_cpu_hotplug(void)
65{
66 return 0;
67}
68 63
69#endif /* CONFIG_SMP */ 64#endif /* CONFIG_SMP */
70extern struct sysdev_class cpu_sysdev_class; 65extern struct sysdev_class cpu_sysdev_class;
@@ -73,7 +68,6 @@ extern struct sysdev_class cpu_sysdev_class;
73/* Stop CPUs going up and down. */ 68/* Stop CPUs going up and down. */
74extern void lock_cpu_hotplug(void); 69extern void lock_cpu_hotplug(void);
75extern void unlock_cpu_hotplug(void); 70extern void unlock_cpu_hotplug(void);
76extern int lock_cpu_hotplug_interruptible(void);
77#define hotcpu_notifier(fn, pri) { \ 71#define hotcpu_notifier(fn, pri) { \
78 static struct notifier_block fn##_nb = \ 72 static struct notifier_block fn##_nb = \
79 { .notifier_call = fn, .priority = pri }; \ 73 { .notifier_call = fn, .priority = pri }; \
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 35e137636b0b..4ea39fee99c7 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -172,9 +172,6 @@ extern int __cpufreq_driver_target(struct cpufreq_policy *policy,
172 unsigned int relation); 172 unsigned int relation);
173 173
174 174
175/* pass an event to the cpufreq governor */
176int cpufreq_governor(unsigned int cpu, unsigned int event);
177
178int cpufreq_register_governor(struct cpufreq_governor *governor); 175int cpufreq_register_governor(struct cpufreq_governor *governor);
179void cpufreq_unregister_governor(struct cpufreq_governor *governor); 176void cpufreq_unregister_governor(struct cpufreq_governor *governor);
180 177
diff --git a/include/linux/delayacct.h b/include/linux/delayacct.h
new file mode 100644
index 000000000000..11487b6e7127
--- /dev/null
+++ b/include/linux/delayacct.h
@@ -0,0 +1,117 @@
1/* delayacct.h - per-task delay accounting
2 *
3 * Copyright (C) Shailabh Nagar, IBM Corp. 2006
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
13 * the GNU General Public License for more details.
14 *
15 */
16
17#ifndef _LINUX_DELAYACCT_H
18#define _LINUX_DELAYACCT_H
19
20#include <linux/sched.h>
21#include <linux/taskstats_kern.h>
22
23/*
24 * Per-task flags relevant to delay accounting
25 * maintained privately to avoid exhausting similar flags in sched.h:PF_*
26 * Used to set current->delays->flags
27 */
28#define DELAYACCT_PF_SWAPIN 0x00000001 /* I am doing a swapin */
29
30#ifdef CONFIG_TASK_DELAY_ACCT
31
32extern int delayacct_on; /* Delay accounting turned on/off */
33extern kmem_cache_t *delayacct_cache;
34extern void delayacct_init(void);
35extern void __delayacct_tsk_init(struct task_struct *);
36extern void __delayacct_tsk_exit(struct task_struct *);
37extern void __delayacct_blkio_start(void);
38extern void __delayacct_blkio_end(void);
39extern int __delayacct_add_tsk(struct taskstats *, struct task_struct *);
40extern __u64 __delayacct_blkio_ticks(struct task_struct *);
41
42static inline void delayacct_set_flag(int flag)
43{
44 if (current->delays)
45 current->delays->flags |= flag;
46}
47
48static inline void delayacct_clear_flag(int flag)
49{
50 if (current->delays)
51 current->delays->flags &= ~flag;
52}
53
54static inline void delayacct_tsk_init(struct task_struct *tsk)
55{
56 /* reinitialize in case parent's non-null pointer was dup'ed*/
57 tsk->delays = NULL;
58 if (delayacct_on)
59 __delayacct_tsk_init(tsk);
60}
61
62static inline void delayacct_tsk_exit(struct task_struct *tsk)
63{
64 if (tsk->delays)
65 __delayacct_tsk_exit(tsk);
66}
67
68static inline void delayacct_blkio_start(void)
69{
70 if (current->delays)
71 __delayacct_blkio_start();
72}
73
74static inline void delayacct_blkio_end(void)
75{
76 if (current->delays)
77 __delayacct_blkio_end();
78}
79
80static inline int delayacct_add_tsk(struct taskstats *d,
81 struct task_struct *tsk)
82{
83 if (!delayacct_on || !tsk->delays)
84 return 0;
85 return __delayacct_add_tsk(d, tsk);
86}
87
88static inline __u64 delayacct_blkio_ticks(struct task_struct *tsk)
89{
90 if (tsk->delays)
91 return __delayacct_blkio_ticks(tsk);
92 return 0;
93}
94
95#else
96static inline void delayacct_set_flag(int flag)
97{}
98static inline void delayacct_clear_flag(int flag)
99{}
100static inline void delayacct_init(void)
101{}
102static inline void delayacct_tsk_init(struct task_struct *tsk)
103{}
104static inline void delayacct_tsk_exit(struct task_struct *tsk)
105{}
106static inline void delayacct_blkio_start(void)
107{}
108static inline void delayacct_blkio_end(void)
109{}
110static inline int delayacct_add_tsk(struct taskstats *d,
111 struct task_struct *tsk)
112{ return 0; }
113static inline __u64 delayacct_blkio_ticks(struct task_struct *tsk)
114{ return 0; }
115#endif /* CONFIG_TASK_DELAY_ACCT */
116
117#endif
diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h
index 0cf0bea010fe..9631dddae348 100644
--- a/include/linux/elfcore.h
+++ b/include/linux/elfcore.h
@@ -60,6 +60,16 @@ struct elf_prstatus
60 long pr_instr; /* Current instruction */ 60 long pr_instr; /* Current instruction */
61#endif 61#endif
62 elf_gregset_t pr_reg; /* GP registers */ 62 elf_gregset_t pr_reg; /* GP registers */
63#ifdef CONFIG_BINFMT_ELF_FDPIC
64 /* When using FDPIC, the loadmap addresses need to be communicated
65 * to GDB in order for GDB to do the necessary relocations. The
66 * fields (below) used to communicate this information are placed
67 * immediately after ``pr_reg'', so that the loadmap addresses may
68 * be viewed as part of the register set if so desired.
69 */
70 unsigned long pr_exec_fdpic_loadmap;
71 unsigned long pr_interp_fdpic_loadmap;
72#endif
63 int pr_fpvalid; /* True if math co-processor being used. */ 73 int pr_fpvalid; /* True if math co-processor being used. */
64}; 74};
65 75
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index 5607e6457a65..9f9cce7bd86d 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -492,6 +492,15 @@ static inline struct ext3_inode_info *EXT3_I(struct inode *inode)
492{ 492{
493 return container_of(inode, struct ext3_inode_info, vfs_inode); 493 return container_of(inode, struct ext3_inode_info, vfs_inode);
494} 494}
495
496static inline int ext3_valid_inum(struct super_block *sb, unsigned long ino)
497{
498 return ino == EXT3_ROOT_INO ||
499 ino == EXT3_JOURNAL_INO ||
500 ino == EXT3_RESIZE_INO ||
501 (ino >= EXT3_FIRST_INO(sb) &&
502 ino <= le32_to_cpu(EXT3_SB(sb)->s_es->s_inodes_count));
503}
495#else 504#else
496/* Assume that user mode programs are passing in an ext3fs superblock, not 505/* Assume that user mode programs are passing in an ext3fs superblock, not
497 * a kernel struct super_block. This will allow us to call the feature-test 506 * a kernel struct super_block. This will allow us to call the feature-test
diff --git a/include/linux/fb.h b/include/linux/fb.h
index ffefeeeeca93..4ad0673b1995 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -377,7 +377,6 @@ struct fb_cursor {
377 377
378#include <linux/fs.h> 378#include <linux/fs.h>
379#include <linux/init.h> 379#include <linux/init.h>
380#include <linux/tty.h>
381#include <linux/device.h> 380#include <linux/device.h>
382#include <linux/workqueue.h> 381#include <linux/workqueue.h>
383#include <linux/notifier.h> 382#include <linux/notifier.h>
@@ -525,7 +524,7 @@ struct fb_event {
525 524
526extern int fb_register_client(struct notifier_block *nb); 525extern int fb_register_client(struct notifier_block *nb);
527extern int fb_unregister_client(struct notifier_block *nb); 526extern int fb_unregister_client(struct notifier_block *nb);
528 527extern int fb_notifier_call_chain(unsigned long val, void *v);
529/* 528/*
530 * Pixmap structure definition 529 * Pixmap structure definition
531 * 530 *
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 134b32068246..25610205c90d 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -27,6 +27,10 @@
27#define BLOCK_SIZE_BITS 10 27#define BLOCK_SIZE_BITS 10
28#define BLOCK_SIZE (1<<BLOCK_SIZE_BITS) 28#define BLOCK_SIZE (1<<BLOCK_SIZE_BITS)
29 29
30#define SEEK_SET 0 /* seek relative to beginning of file */
31#define SEEK_CUR 1 /* seek relative to current file position */
32#define SEEK_END 2 /* seek relative to end of file */
33
30/* And dynamically-tunable limits and defaults: */ 34/* And dynamically-tunable limits and defaults: */
31struct files_stat_struct { 35struct files_stat_struct {
32 int nr_files; /* read only */ 36 int nr_files; /* read only */
@@ -716,6 +720,7 @@ extern spinlock_t files_lock;
716#define FL_POSIX 1 720#define FL_POSIX 1
717#define FL_FLOCK 2 721#define FL_FLOCK 2
718#define FL_ACCESS 8 /* not trying to lock, just looking */ 722#define FL_ACCESS 8 /* not trying to lock, just looking */
723#define FL_EXISTS 16 /* when unlocking, test for existence */
719#define FL_LEASE 32 /* lease held on this file */ 724#define FL_LEASE 32 /* lease held on this file */
720#define FL_CLOSE 64 /* unlock on close */ 725#define FL_CLOSE 64 /* unlock on close */
721#define FL_SLEEP 128 /* A blocking lock */ 726#define FL_SLEEP 128 /* A blocking lock */
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h
index cc5dec70c32c..d4f219ffaa5d 100644
--- a/include/linux/fsnotify.h
+++ b/include/linux/fsnotify.h
@@ -67,7 +67,7 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir,
67 if (source) { 67 if (source) {
68 inotify_inode_queue_event(source, IN_MOVE_SELF, 0, NULL, NULL); 68 inotify_inode_queue_event(source, IN_MOVE_SELF, 0, NULL, NULL);
69 } 69 }
70 audit_inode_child(new_name, source, new_dir->i_ino); 70 audit_inode_child(new_name, source, new_dir);
71} 71}
72 72
73/* 73/*
@@ -98,7 +98,7 @@ static inline void fsnotify_create(struct inode *inode, struct dentry *dentry)
98 inode_dir_notify(inode, DN_CREATE); 98 inode_dir_notify(inode, DN_CREATE);
99 inotify_inode_queue_event(inode, IN_CREATE, 0, dentry->d_name.name, 99 inotify_inode_queue_event(inode, IN_CREATE, 0, dentry->d_name.name,
100 dentry->d_inode); 100 dentry->d_inode);
101 audit_inode_child(dentry->d_name.name, dentry->d_inode, inode->i_ino); 101 audit_inode_child(dentry->d_name.name, dentry->d_inode, inode);
102} 102}
103 103
104/* 104/*
@@ -109,7 +109,7 @@ static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry)
109 inode_dir_notify(inode, DN_CREATE); 109 inode_dir_notify(inode, DN_CREATE);
110 inotify_inode_queue_event(inode, IN_CREATE | IN_ISDIR, 0, 110 inotify_inode_queue_event(inode, IN_CREATE | IN_ISDIR, 0,
111 dentry->d_name.name, dentry->d_inode); 111 dentry->d_name.name, dentry->d_inode);
112 audit_inode_child(dentry->d_name.name, dentry->d_inode, inode->i_ino); 112 audit_inode_child(dentry->d_name.name, dentry->d_inode, inode);
113} 113}
114 114
115/* 115/*
diff --git a/include/linux/futex.h b/include/linux/futex.h
index 34c3a215f2cd..d097b5b72bc6 100644
--- a/include/linux/futex.h
+++ b/include/linux/futex.h
@@ -96,7 +96,8 @@ struct robust_list_head {
96long do_futex(u32 __user *uaddr, int op, u32 val, unsigned long timeout, 96long do_futex(u32 __user *uaddr, int op, u32 val, unsigned long timeout,
97 u32 __user *uaddr2, u32 val2, u32 val3); 97 u32 __user *uaddr2, u32 val2, u32 val3);
98 98
99extern int handle_futex_death(u32 __user *uaddr, struct task_struct *curr); 99extern int
100handle_futex_death(u32 __user *uaddr, struct task_struct *curr, int pi);
100 101
101#ifdef CONFIG_FUTEX 102#ifdef CONFIG_FUTEX
102extern void exit_robust_list(struct task_struct *curr); 103extern void exit_robust_list(struct task_struct *curr);
diff --git a/include/linux/hdlc.h b/include/linux/hdlc.h
index 4513f9e40937..d5ebbb29aeae 100644
--- a/include/linux/hdlc.h
+++ b/include/linux/hdlc.h
@@ -224,8 +224,6 @@ static __inline__ void debug_frame(const struct sk_buff *skb)
224int hdlc_open(struct net_device *dev); 224int hdlc_open(struct net_device *dev);
225/* Must be called by hardware driver when HDLC device is being closed */ 225/* Must be called by hardware driver when HDLC device is being closed */
226void hdlc_close(struct net_device *dev); 226void hdlc_close(struct net_device *dev);
227/* Called by hardware driver when DCD line level changes */
228void hdlc_set_carrier(int on, struct net_device *dev);
229 227
230/* May be used by hardware driver to gain control over HDLC device */ 228/* May be used by hardware driver to gain control over HDLC device */
231static __inline__ void hdlc_proto_detach(hdlc_device *hdlc) 229static __inline__ void hdlc_proto_detach(hdlc_device *hdlc)
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h
index 21338bb3441d..9418519a55d1 100644
--- a/include/linux/i2c-id.h
+++ b/include/linux/i2c-id.h
@@ -115,6 +115,7 @@
115#define I2C_DRIVERID_BT866 85 /* Conexant bt866 video encoder */ 115#define I2C_DRIVERID_BT866 85 /* Conexant bt866 video encoder */
116#define I2C_DRIVERID_KS0127 86 /* Samsung ks0127 video decoder */ 116#define I2C_DRIVERID_KS0127 86 /* Samsung ks0127 video decoder */
117#define I2C_DRIVERID_TLV320AIC23B 87 /* TI TLV320AIC23B audio codec */ 117#define I2C_DRIVERID_TLV320AIC23B 87 /* TI TLV320AIC23B audio codec */
118#define I2C_DRIVERID_ISL1208 88 /* Intersil ISL1208 RTC */
118 119
119#define I2C_DRIVERID_I2CDEV 900 120#define I2C_DRIVERID_I2CDEV 900
120#define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */ 121#define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 526ddc8eecfb..eb0628a7ecc6 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -193,6 +193,8 @@ struct i2c_algorithm {
193 to NULL. If an adapter algorithm can do SMBus access, set 193 to NULL. If an adapter algorithm can do SMBus access, set
194 smbus_xfer. If set to NULL, the SMBus protocol is simulated 194 smbus_xfer. If set to NULL, the SMBus protocol is simulated
195 using common I2C messages */ 195 using common I2C messages */
196 /* master_xfer should return the number of messages successfully
197 processed, or a negative value on error */
196 int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg *msgs, 198 int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg *msgs,
197 int num); 199 int num);
198 int (*smbus_xfer) (struct i2c_adapter *adap, u16 addr, 200 int (*smbus_xfer) (struct i2c_adapter *adap, u16 addr,
diff --git a/include/linux/ide.h b/include/linux/ide.h
index dc7abef10965..99620451d958 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -571,6 +571,7 @@ typedef struct ide_drive_s {
571 u8 waiting_for_dma; /* dma currently in progress */ 571 u8 waiting_for_dma; /* dma currently in progress */
572 u8 unmask; /* okay to unmask other irqs */ 572 u8 unmask; /* okay to unmask other irqs */
573 u8 bswap; /* byte swap data */ 573 u8 bswap; /* byte swap data */
574 u8 noflush; /* don't attempt flushes */
574 u8 dsc_overlap; /* DSC overlap */ 575 u8 dsc_overlap; /* DSC overlap */
575 u8 nice1; /* give potential excess bandwidth */ 576 u8 nice1; /* give potential excess bandwidth */
576 577
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index eef0876d8307..383627ad328f 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -23,8 +23,8 @@ struct vlan_collection;
23struct vlan_dev_info; 23struct vlan_dev_info;
24struct hlist_node; 24struct hlist_node;
25 25
26#include <linux/proc_fs.h> /* for proc_dir_entry */
27#include <linux/netdevice.h> 26#include <linux/netdevice.h>
27#include <linux/etherdevice.h>
28 28
29#define VLAN_HLEN 4 /* The additional bytes (on top of the Ethernet header) 29#define VLAN_HLEN 4 /* The additional bytes (on top of the Ethernet header)
30 * that VLAN requires. 30 * that VLAN requires.
@@ -185,7 +185,8 @@ static inline int __vlan_hwaccel_rx(struct sk_buff *skb,
185 * This allows the VLAN to have a different MAC than the underlying 185 * This allows the VLAN to have a different MAC than the underlying
186 * device, and still route correctly. 186 * device, and still route correctly.
187 */ 187 */
188 if (!memcmp(eth_hdr(skb)->h_dest, skb->dev->dev_addr, ETH_ALEN)) 188 if (!compare_ether_addr(eth_hdr(skb)->h_dest,
189 skb->dev->dev_addr))
189 skb->pkt_type = PACKET_HOST; 190 skb->pkt_type = PACKET_HOST;
190 break; 191 break;
191 }; 192 };
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 5612dfeeae50..d42c83399071 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -97,7 +97,7 @@ extern struct resource iomem_resource;
97extern int request_resource(struct resource *root, struct resource *new); 97extern int request_resource(struct resource *root, struct resource *new);
98extern struct resource * ____request_resource(struct resource *root, struct resource *new); 98extern struct resource * ____request_resource(struct resource *root, struct resource *new);
99extern int release_resource(struct resource *new); 99extern int release_resource(struct resource *new);
100extern __deprecated_for_modules int insert_resource(struct resource *parent, struct resource *new); 100extern int insert_resource(struct resource *parent, struct resource *new);
101extern int allocate_resource(struct resource *root, struct resource *new, 101extern int allocate_resource(struct resource *root, struct resource *new,
102 resource_size_t size, resource_size_t min, 102 resource_size_t size, resource_size_t min,
103 resource_size_t max, resource_size_t align, 103 resource_size_t max, resource_size_t align,
diff --git a/include/linux/irq.h b/include/linux/irq.h
index b48eae32dc61..fbf6d901e9c2 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -47,8 +47,8 @@
47#define IRQ_WAITING 0x00200000 /* IRQ not yet seen - for autodetection */ 47#define IRQ_WAITING 0x00200000 /* IRQ not yet seen - for autodetection */
48#define IRQ_LEVEL 0x00400000 /* IRQ level triggered */ 48#define IRQ_LEVEL 0x00400000 /* IRQ level triggered */
49#define IRQ_MASKED 0x00800000 /* IRQ masked - shouldn't be seen again */ 49#define IRQ_MASKED 0x00800000 /* IRQ masked - shouldn't be seen again */
50#define IRQ_PER_CPU 0x01000000 /* IRQ is per CPU */
50#ifdef CONFIG_IRQ_PER_CPU 51#ifdef CONFIG_IRQ_PER_CPU
51# define IRQ_PER_CPU 0x01000000 /* IRQ is per CPU */
52# define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU) 52# define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU)
53#else 53#else
54# define CHECK_IRQ_PER_CPU(var) 0 54# define CHECK_IRQ_PER_CPU(var) 0
@@ -58,6 +58,7 @@
58#define IRQ_NOREQUEST 0x04000000 /* IRQ cannot be requested */ 58#define IRQ_NOREQUEST 0x04000000 /* IRQ cannot be requested */
59#define IRQ_NOAUTOEN 0x08000000 /* IRQ will not be enabled on request irq */ 59#define IRQ_NOAUTOEN 0x08000000 /* IRQ will not be enabled on request irq */
60#define IRQ_DELAYED_DISABLE 0x10000000 /* IRQ disable (masking) happens delayed. */ 60#define IRQ_DELAYED_DISABLE 0x10000000 /* IRQ disable (masking) happens delayed. */
61#define IRQ_WAKEUP 0x20000000 /* IRQ triggers system wakeup */
61 62
62struct proc_dir_entry; 63struct proc_dir_entry;
63 64
@@ -124,6 +125,7 @@ struct irq_chip {
124 * @action: the irq action chain 125 * @action: the irq action chain
125 * @status: status information 126 * @status: status information
126 * @depth: disable-depth, for nested irq_disable() calls 127 * @depth: disable-depth, for nested irq_disable() calls
128 * @wake_depth: enable depth, for multiple set_irq_wake() callers
127 * @irq_count: stats field to detect stalled irqs 129 * @irq_count: stats field to detect stalled irqs
128 * @irqs_unhandled: stats field for spurious unhandled interrupts 130 * @irqs_unhandled: stats field for spurious unhandled interrupts
129 * @lock: locking for SMP 131 * @lock: locking for SMP
@@ -147,6 +149,7 @@ struct irq_desc {
147 unsigned int status; /* IRQ status */ 149 unsigned int status; /* IRQ status */
148 150
149 unsigned int depth; /* nested irq disables */ 151 unsigned int depth; /* nested irq disables */
152 unsigned int wake_depth; /* nested wake enables */
150 unsigned int irq_count; /* For detecting broken IRQs */ 153 unsigned int irq_count; /* For detecting broken IRQs */
151 unsigned int irqs_unhandled; 154 unsigned int irqs_unhandled;
152 spinlock_t lock; 155 spinlock_t lock;
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h
index 043376920f51..329ebcffa106 100644
--- a/include/linux/jiffies.h
+++ b/include/linux/jiffies.h
@@ -47,8 +47,8 @@
47 * - (NOM / DEN) fits in (32 - LSH) bits. 47 * - (NOM / DEN) fits in (32 - LSH) bits.
48 * - (NOM % DEN) fits in (32 - LSH) bits. 48 * - (NOM % DEN) fits in (32 - LSH) bits.
49 */ 49 */
50#define SH_DIV(NOM,DEN,LSH) ( ((NOM / DEN) << LSH) \ 50#define SH_DIV(NOM,DEN,LSH) ( (((NOM) / (DEN)) << (LSH)) \
51 + (((NOM % DEN) << LSH) + DEN / 2) / DEN) 51 + ((((NOM) % (DEN)) << (LSH)) + (DEN) / 2) / (DEN))
52 52
53/* HZ is the requested value. ACTHZ is actual HZ ("<< 8" is for accuracy) */ 53/* HZ is the requested value. ACTHZ is actual HZ ("<< 8" is for accuracy) */
54#define ACTHZ (SH_DIV (CLOCK_TICK_RATE, LATCH, 8)) 54#define ACTHZ (SH_DIV (CLOCK_TICK_RATE, LATCH, 8))
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 5c1ec1f84eab..181c69cad4e3 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -33,6 +33,7 @@ extern const char linux_banner[];
33#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) 33#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
34#define ALIGN(x,a) (((x)+(a)-1)&~((a)-1)) 34#define ALIGN(x,a) (((x)+(a)-1)&~((a)-1))
35#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f)) 35#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
36#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
36 37
37#define KERN_EMERG "<0>" /* system is unusable */ 38#define KERN_EMERG "<0>" /* system is unusable */
38#define KERN_ALERT "<1>" /* action must be taken immediately */ 39#define KERN_ALERT "<1>" /* action must be taken immediately */
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 0503b2ed8bae..2d229327959e 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -46,8 +46,6 @@ enum kobject_action {
46 KOBJ_UMOUNT = (__force kobject_action_t) 0x05, /* umount event for block devices (broken) */ 46 KOBJ_UMOUNT = (__force kobject_action_t) 0x05, /* umount event for block devices (broken) */
47 KOBJ_OFFLINE = (__force kobject_action_t) 0x06, /* device offline */ 47 KOBJ_OFFLINE = (__force kobject_action_t) 0x06, /* device offline */
48 KOBJ_ONLINE = (__force kobject_action_t) 0x07, /* device online */ 48 KOBJ_ONLINE = (__force kobject_action_t) 0x07, /* device online */
49 KOBJ_UNDOCK = (__force kobject_action_t) 0x08, /* undocking */
50 KOBJ_DOCK = (__force kobject_action_t) 0x09, /* dock */
51}; 49};
52 50
53struct kobject { 51struct kobject {
diff --git a/include/linux/kthread.h b/include/linux/kthread.h
index 7cce5dfa092f..1c65e7a9f186 100644
--- a/include/linux/kthread.h
+++ b/include/linux/kthread.h
@@ -28,7 +28,6 @@ struct task_struct *kthread_create(int (*threadfn)(void *data),
28 28
29void kthread_bind(struct task_struct *k, unsigned int cpu); 29void kthread_bind(struct task_struct *k, unsigned int cpu);
30int kthread_stop(struct task_struct *k); 30int kthread_stop(struct task_struct *k);
31int kthread_stop_sem(struct task_struct *k, struct semaphore *s);
32int kthread_should_stop(void); 31int kthread_should_stop(void);
33 32
34#endif /* _LINUX_KTHREAD_H */ 33#endif /* _LINUX_KTHREAD_H */
diff --git a/include/linux/libata.h b/include/linux/libata.h
index f4284bf89758..66c3100c2b94 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -131,6 +131,7 @@ enum {
131 ATA_DFLAG_CFG_MASK = (1 << 8) - 1, 131 ATA_DFLAG_CFG_MASK = (1 << 8) - 1,
132 132
133 ATA_DFLAG_PIO = (1 << 8), /* device currently in PIO mode */ 133 ATA_DFLAG_PIO = (1 << 8), /* device currently in PIO mode */
134 ATA_DFLAG_SUSPENDED = (1 << 9), /* device suspended */
134 ATA_DFLAG_INIT_MASK = (1 << 16) - 1, 135 ATA_DFLAG_INIT_MASK = (1 << 16) - 1,
135 136
136 ATA_DFLAG_DETACH = (1 << 16), 137 ATA_DFLAG_DETACH = (1 << 16),
@@ -160,22 +161,28 @@ enum {
160 ATA_FLAG_HRST_TO_RESUME = (1 << 11), /* hardreset to resume phy */ 161 ATA_FLAG_HRST_TO_RESUME = (1 << 11), /* hardreset to resume phy */
161 ATA_FLAG_SKIP_D2H_BSY = (1 << 12), /* can't wait for the first D2H 162 ATA_FLAG_SKIP_D2H_BSY = (1 << 12), /* can't wait for the first D2H
162 * Register FIS clearing BSY */ 163 * Register FIS clearing BSY */
163
164 ATA_FLAG_DEBUGMSG = (1 << 13), 164 ATA_FLAG_DEBUGMSG = (1 << 13),
165 ATA_FLAG_FLUSH_PORT_TASK = (1 << 14), /* flush port task */
166 165
167 ATA_FLAG_EH_PENDING = (1 << 15), /* EH pending */ 166 /* The following flag belongs to ap->pflags but is kept in
168 ATA_FLAG_EH_IN_PROGRESS = (1 << 16), /* EH in progress */ 167 * ap->flags because it's referenced in many LLDs and will be
169 ATA_FLAG_FROZEN = (1 << 17), /* port is frozen */ 168 * removed in not-too-distant future.
170 ATA_FLAG_RECOVERED = (1 << 18), /* recovery action performed */ 169 */
171 ATA_FLAG_LOADING = (1 << 19), /* boot/loading probe */ 170 ATA_FLAG_DISABLED = (1 << 23), /* port is disabled, ignore it */
172 ATA_FLAG_UNLOADING = (1 << 20), /* module is unloading */ 171
173 ATA_FLAG_SCSI_HOTPLUG = (1 << 21), /* SCSI hotplug scheduled */ 172 /* bits 24:31 of ap->flags are reserved for LLD specific flags */
174 173
175 ATA_FLAG_DISABLED = (1 << 22), /* port is disabled, ignore it */ 174 /* struct ata_port pflags */
176 ATA_FLAG_SUSPENDED = (1 << 23), /* port is suspended (power) */ 175 ATA_PFLAG_EH_PENDING = (1 << 0), /* EH pending */
176 ATA_PFLAG_EH_IN_PROGRESS = (1 << 1), /* EH in progress */
177 ATA_PFLAG_FROZEN = (1 << 2), /* port is frozen */
178 ATA_PFLAG_RECOVERED = (1 << 3), /* recovery action performed */
179 ATA_PFLAG_LOADING = (1 << 4), /* boot/loading probe */
180 ATA_PFLAG_UNLOADING = (1 << 5), /* module is unloading */
181 ATA_PFLAG_SCSI_HOTPLUG = (1 << 6), /* SCSI hotplug scheduled */
177 182
178 /* bits 24:31 of ap->flags are reserved for LLDD specific flags */ 183 ATA_PFLAG_FLUSH_PORT_TASK = (1 << 16), /* flush port task */
184 ATA_PFLAG_SUSPENDED = (1 << 17), /* port is suspended (power) */
185 ATA_PFLAG_PM_PENDING = (1 << 18), /* PM operation pending */
179 186
180 /* struct ata_queued_cmd flags */ 187 /* struct ata_queued_cmd flags */
181 ATA_QCFLAG_ACTIVE = (1 << 0), /* cmd not yet ack'd to scsi lyer */ 188 ATA_QCFLAG_ACTIVE = (1 << 0), /* cmd not yet ack'd to scsi lyer */
@@ -248,15 +255,24 @@ enum {
248 ATA_EH_REVALIDATE = (1 << 0), 255 ATA_EH_REVALIDATE = (1 << 0),
249 ATA_EH_SOFTRESET = (1 << 1), 256 ATA_EH_SOFTRESET = (1 << 1),
250 ATA_EH_HARDRESET = (1 << 2), 257 ATA_EH_HARDRESET = (1 << 2),
258 ATA_EH_SUSPEND = (1 << 3),
259 ATA_EH_RESUME = (1 << 4),
260 ATA_EH_PM_FREEZE = (1 << 5),
251 261
252 ATA_EH_RESET_MASK = ATA_EH_SOFTRESET | ATA_EH_HARDRESET, 262 ATA_EH_RESET_MASK = ATA_EH_SOFTRESET | ATA_EH_HARDRESET,
253 ATA_EH_PERDEV_MASK = ATA_EH_REVALIDATE, 263 ATA_EH_PERDEV_MASK = ATA_EH_REVALIDATE | ATA_EH_SUSPEND |
264 ATA_EH_RESUME | ATA_EH_PM_FREEZE,
254 265
255 /* ata_eh_info->flags */ 266 /* ata_eh_info->flags */
256 ATA_EHI_HOTPLUGGED = (1 << 0), /* could have been hotplugged */ 267 ATA_EHI_HOTPLUGGED = (1 << 0), /* could have been hotplugged */
268 ATA_EHI_RESUME_LINK = (1 << 1), /* resume link (reset modifier) */
269 ATA_EHI_NO_AUTOPSY = (1 << 2), /* no autopsy */
270 ATA_EHI_QUIET = (1 << 3), /* be quiet */
257 271
258 ATA_EHI_DID_RESET = (1 << 16), /* already reset this port */ 272 ATA_EHI_DID_RESET = (1 << 16), /* already reset this port */
259 273
274 ATA_EHI_RESET_MODIFIER_MASK = ATA_EHI_RESUME_LINK,
275
260 /* max repeat if error condition is still set after ->error_handler */ 276 /* max repeat if error condition is still set after ->error_handler */
261 ATA_EH_MAX_REPEAT = 5, 277 ATA_EH_MAX_REPEAT = 5,
262 278
@@ -486,6 +502,7 @@ struct ata_port {
486 const struct ata_port_operations *ops; 502 const struct ata_port_operations *ops;
487 spinlock_t *lock; 503 spinlock_t *lock;
488 unsigned long flags; /* ATA_FLAG_xxx */ 504 unsigned long flags; /* ATA_FLAG_xxx */
505 unsigned int pflags; /* ATA_PFLAG_xxx */
489 unsigned int id; /* unique id req'd by scsi midlyr */ 506 unsigned int id; /* unique id req'd by scsi midlyr */
490 unsigned int port_no; /* unique port #; from zero */ 507 unsigned int port_no; /* unique port #; from zero */
491 unsigned int hard_port_no; /* hardware port #; from zero */ 508 unsigned int hard_port_no; /* hardware port #; from zero */
@@ -535,6 +552,9 @@ struct ata_port {
535 struct list_head eh_done_q; 552 struct list_head eh_done_q;
536 wait_queue_head_t eh_wait_q; 553 wait_queue_head_t eh_wait_q;
537 554
555 pm_message_t pm_mesg;
556 int *pm_result;
557
538 void *private_data; 558 void *private_data;
539 559
540 u8 sector_buf[ATA_SECT_SIZE]; /* owned by EH */ 560 u8 sector_buf[ATA_SECT_SIZE]; /* owned by EH */
@@ -589,6 +609,9 @@ struct ata_port_operations {
589 void (*scr_write) (struct ata_port *ap, unsigned int sc_reg, 609 void (*scr_write) (struct ata_port *ap, unsigned int sc_reg,
590 u32 val); 610 u32 val);
591 611
612 int (*port_suspend) (struct ata_port *ap, pm_message_t mesg);
613 int (*port_resume) (struct ata_port *ap);
614
592 int (*port_start) (struct ata_port *ap); 615 int (*port_start) (struct ata_port *ap);
593 void (*port_stop) (struct ata_port *ap); 616 void (*port_stop) (struct ata_port *ap);
594 617
@@ -622,9 +645,18 @@ struct ata_timing {
622 645
623#define FIT(v,vmin,vmax) max_t(short,min_t(short,v,vmax),vmin) 646#define FIT(v,vmin,vmax) max_t(short,min_t(short,v,vmax),vmin)
624 647
625extern const unsigned long sata_deb_timing_boot[]; 648extern const unsigned long sata_deb_timing_normal[];
626extern const unsigned long sata_deb_timing_eh[]; 649extern const unsigned long sata_deb_timing_hotplug[];
627extern const unsigned long sata_deb_timing_before_fsrst[]; 650extern const unsigned long sata_deb_timing_long[];
651
652static inline const unsigned long *
653sata_ehc_deb_timing(struct ata_eh_context *ehc)
654{
655 if (ehc->i.flags & ATA_EHI_HOTPLUGGED)
656 return sata_deb_timing_hotplug;
657 else
658 return sata_deb_timing_normal;
659}
628 660
629extern void ata_port_probe(struct ata_port *); 661extern void ata_port_probe(struct ata_port *);
630extern void __sata_phy_reset(struct ata_port *ap); 662extern void __sata_phy_reset(struct ata_port *ap);
@@ -644,6 +676,8 @@ extern void ata_std_ports(struct ata_ioports *ioaddr);
644extern int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info, 676extern int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info,
645 unsigned int n_ports); 677 unsigned int n_ports);
646extern void ata_pci_remove_one (struct pci_dev *pdev); 678extern void ata_pci_remove_one (struct pci_dev *pdev);
679extern void ata_pci_device_do_suspend(struct pci_dev *pdev, pm_message_t state);
680extern void ata_pci_device_do_resume(struct pci_dev *pdev);
647extern int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t state); 681extern int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t state);
648extern int ata_pci_device_resume(struct pci_dev *pdev); 682extern int ata_pci_device_resume(struct pci_dev *pdev);
649extern int ata_pci_clear_simplex(struct pci_dev *pdev); 683extern int ata_pci_clear_simplex(struct pci_dev *pdev);
@@ -664,8 +698,9 @@ extern int ata_port_online(struct ata_port *ap);
664extern int ata_port_offline(struct ata_port *ap); 698extern int ata_port_offline(struct ata_port *ap);
665extern int ata_scsi_device_resume(struct scsi_device *); 699extern int ata_scsi_device_resume(struct scsi_device *);
666extern int ata_scsi_device_suspend(struct scsi_device *, pm_message_t state); 700extern int ata_scsi_device_suspend(struct scsi_device *, pm_message_t state);
667extern int ata_device_resume(struct ata_device *); 701extern int ata_host_set_suspend(struct ata_host_set *host_set,
668extern int ata_device_suspend(struct ata_device *, pm_message_t state); 702 pm_message_t mesg);
703extern void ata_host_set_resume(struct ata_host_set *host_set);
669extern int ata_ratelimit(void); 704extern int ata_ratelimit(void);
670extern unsigned int ata_busy_sleep(struct ata_port *ap, 705extern unsigned int ata_busy_sleep(struct ata_port *ap,
671 unsigned long timeout_pat, 706 unsigned long timeout_pat,
@@ -825,19 +860,24 @@ extern void ata_do_eh(struct ata_port *ap, ata_prereset_fn_t prereset,
825 (ehi)->desc_len = 0; \ 860 (ehi)->desc_len = 0; \
826} while (0) 861} while (0)
827 862
828static inline void ata_ehi_hotplugged(struct ata_eh_info *ehi) 863static inline void __ata_ehi_hotplugged(struct ata_eh_info *ehi)
829{ 864{
830 if (ehi->flags & ATA_EHI_HOTPLUGGED) 865 if (ehi->flags & ATA_EHI_HOTPLUGGED)
831 return; 866 return;
832 867
833 ehi->flags |= ATA_EHI_HOTPLUGGED; 868 ehi->flags |= ATA_EHI_HOTPLUGGED | ATA_EHI_RESUME_LINK;
834 ehi->hotplug_timestamp = jiffies; 869 ehi->hotplug_timestamp = jiffies;
835 870
836 ehi->err_mask |= AC_ERR_ATA_BUS;
837 ehi->action |= ATA_EH_SOFTRESET; 871 ehi->action |= ATA_EH_SOFTRESET;
838 ehi->probe_mask |= (1 << ATA_MAX_DEVICES) - 1; 872 ehi->probe_mask |= (1 << ATA_MAX_DEVICES) - 1;
839} 873}
840 874
875static inline void ata_ehi_hotplugged(struct ata_eh_info *ehi)
876{
877 __ata_ehi_hotplugged(ehi);
878 ehi->err_mask |= AC_ERR_ATA_BUS;
879}
880
841/* 881/*
842 * qc helpers 882 * qc helpers
843 */ 883 */
@@ -921,6 +961,11 @@ static inline unsigned int ata_dev_absent(const struct ata_device *dev)
921 return ata_class_absent(dev->class); 961 return ata_class_absent(dev->class);
922} 962}
923 963
964static inline unsigned int ata_dev_ready(const struct ata_device *dev)
965{
966 return ata_dev_enabled(dev) && !(dev->flags & ATA_DFLAG_SUSPENDED);
967}
968
924/* 969/*
925 * port helpers 970 * port helpers
926 */ 971 */
diff --git a/include/linux/list.h b/include/linux/list.h
index 6b74adf5297f..65a5b5ceda49 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -265,6 +265,17 @@ static inline void list_move_tail(struct list_head *list,
265} 265}
266 266
267/** 267/**
268 * list_is_last - tests whether @list is the last entry in list @head
269 * @list: the entry to test
270 * @head: the head of the list
271 */
272static inline int list_is_last(const struct list_head *list,
273 const struct list_head *head)
274{
275 return list->next == head;
276}
277
278/**
268 * list_empty - tests whether a list is empty 279 * list_empty - tests whether a list is empty
269 * @head: the list to test. 280 * @head: the list to test.
270 */ 281 */
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index aa4fe905bb4d..0d92c468d55a 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -123,7 +123,6 @@ struct nlm_block {
123 unsigned int b_id; /* block id */ 123 unsigned int b_id; /* block id */
124 unsigned char b_queued; /* re-queued */ 124 unsigned char b_queued; /* re-queued */
125 unsigned char b_granted; /* VFS granted lock */ 125 unsigned char b_granted; /* VFS granted lock */
126 unsigned char b_done; /* callback complete */
127 struct nlm_file * b_file; /* file in question */ 126 struct nlm_file * b_file; /* file in question */
128}; 127};
129 128
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index 316e0fb8d7b1..c040a8c969aa 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -120,7 +120,7 @@ struct lock_class {
120 */ 120 */
121struct lockdep_map { 121struct lockdep_map {
122 struct lock_class_key *key; 122 struct lock_class_key *key;
123 struct lock_class *class[MAX_LOCKDEP_SUBCLASSES]; 123 struct lock_class *class_cache;
124 const char *name; 124 const char *name;
125}; 125};
126 126
diff --git a/include/linux/mc146818rtc.h b/include/linux/mc146818rtc.h
index bbc93ae217e1..432b2fa24929 100644
--- a/include/linux/mc146818rtc.h
+++ b/include/linux/mc146818rtc.h
@@ -89,4 +89,11 @@ extern spinlock_t rtc_lock; /* serialize CMOS RAM access */
89# define RTC_VRT 0x80 /* valid RAM and time */ 89# define RTC_VRT 0x80 /* valid RAM and time */
90/**********************************************************************/ 90/**********************************************************************/
91 91
92#ifndef ARCH_RTC_LOCATION /* Override by <asm/mc146818rtc.h>? */
93
94#define RTC_IO_EXTENT 0x8
95#define RTC_IOMAPPED 1 /* Default to I/O mapping. */
96
97#endif /* ARCH_RTC_LOCATION */
98
92#endif /* _MC146818RTC_H */ 99#endif /* _MC146818RTC_H */
diff --git a/include/linux/module.h b/include/linux/module.h
index d06c74fb8c26..0dfb794c52d3 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -362,10 +362,8 @@ int is_module_address(unsigned long addr);
362 362
363/* Returns module and fills in value, defined and namebuf, or NULL if 363/* Returns module and fills in value, defined and namebuf, or NULL if
364 symnum out of range. */ 364 symnum out of range. */
365struct module *module_get_kallsym(unsigned int symnum, 365struct module *module_get_kallsym(unsigned int symnum, unsigned long *value,
366 unsigned long *value, 366 char *type, char *name, size_t namelen);
367 char *type,
368 char namebuf[128]);
369 367
370/* Look for this name: can be of form module:name. */ 368/* Look for this name: can be of form module:name. */
371unsigned long module_kallsyms_lookup_name(const char *name); 369unsigned long module_kallsyms_lookup_name(const char *name);
@@ -535,8 +533,8 @@ static inline const char *module_address_lookup(unsigned long addr,
535 533
536static inline struct module *module_get_kallsym(unsigned int symnum, 534static inline struct module *module_get_kallsym(unsigned int symnum,
537 unsigned long *value, 535 unsigned long *value,
538 char *type, 536 char *type, char *name,
539 char namebuf[128]) 537 size_t namelen)
540{ 538{
541 return NULL; 539 return NULL;
542} 540}
diff --git a/include/linux/namei.h b/include/linux/namei.h
index 58cb3d3d44b4..45511a5918d3 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -11,7 +11,7 @@ struct open_intent {
11 struct file *file; 11 struct file *file;
12}; 12};
13 13
14enum { MAX_NESTED_LINKS = 5 }; 14enum { MAX_NESTED_LINKS = 8 };
15 15
16struct nameidata { 16struct nameidata {
17 struct dentry *dentry; 17 struct dentry *dentry;
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 85f99f60deea..75f02d8c6ed3 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -549,6 +549,7 @@ struct packet_type {
549 struct net_device *); 549 struct net_device *);
550 struct sk_buff *(*gso_segment)(struct sk_buff *skb, 550 struct sk_buff *(*gso_segment)(struct sk_buff *skb,
551 int features); 551 int features);
552 int (*gso_send_check)(struct sk_buff *skb);
552 void *af_packet_priv; 553 void *af_packet_priv;
553 struct list_head list; 554 struct list_head list;
554}; 555};
@@ -923,10 +924,10 @@ static inline void netif_tx_lock_bh(struct net_device *dev)
923 924
924static inline int netif_tx_trylock(struct net_device *dev) 925static inline int netif_tx_trylock(struct net_device *dev)
925{ 926{
926 int err = spin_trylock(&dev->_xmit_lock); 927 int ok = spin_trylock(&dev->_xmit_lock);
927 if (!err) 928 if (likely(ok))
928 dev->xmit_lock_owner = smp_processor_id(); 929 dev->xmit_lock_owner = smp_processor_id();
929 return err; 930 return ok;
930} 931}
931 932
932static inline void netif_tx_unlock(struct net_device *dev) 933static inline void netif_tx_unlock(struct net_device *dev)
@@ -1001,13 +1002,14 @@ static inline int net_gso_ok(int features, int gso_type)
1001 1002
1002static inline int skb_gso_ok(struct sk_buff *skb, int features) 1003static inline int skb_gso_ok(struct sk_buff *skb, int features)
1003{ 1004{
1004 return net_gso_ok(features, skb_shinfo(skb)->gso_size ? 1005 return net_gso_ok(features, skb_shinfo(skb)->gso_type);
1005 skb_shinfo(skb)->gso_type : 0);
1006} 1006}
1007 1007
1008static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb) 1008static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb)
1009{ 1009{
1010 return !skb_gso_ok(skb, dev->features); 1010 return skb_is_gso(skb) &&
1011 (!skb_gso_ok(skb, dev->features) ||
1012 unlikely(skb->ip_summed != CHECKSUM_HW));
1011} 1013}
1012 1014
1013#endif /* __KERNEL__ */ 1015#endif /* __KERNEL__ */
diff --git a/include/linux/netfilter_bridge.h b/include/linux/netfilter_bridge.h
index 87764022cc67..10c13dc4665b 100644
--- a/include/linux/netfilter_bridge.h
+++ b/include/linux/netfilter_bridge.h
@@ -6,7 +6,6 @@
6 6
7#include <linux/netfilter.h> 7#include <linux/netfilter.h>
8#if defined(__KERNEL__) && defined(CONFIG_BRIDGE_NETFILTER) 8#if defined(__KERNEL__) && defined(CONFIG_BRIDGE_NETFILTER)
9#include <asm/atomic.h>
10#include <linux/if_ether.h> 9#include <linux/if_ether.h>
11#endif 10#endif
12 11
@@ -79,6 +78,8 @@ struct bridge_skb_cb {
79 __u32 ipv4; 78 __u32 ipv4;
80 } daddr; 79 } daddr;
81}; 80};
81
82extern int brnf_deferred_hooks;
82#endif /* CONFIG_BRIDGE_NETFILTER */ 83#endif /* CONFIG_BRIDGE_NETFILTER */
83 84
84#endif /* __KERNEL__ */ 85#endif /* __KERNEL__ */
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
index 5f681d534295..db05182ca0e8 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -157,6 +157,12 @@ enum nfs_opnum4 {
157 OP_ILLEGAL = 10044, 157 OP_ILLEGAL = 10044,
158}; 158};
159 159
160/*Defining first and last NFS4 operations implemented.
161Needs to be updated if more operations are defined in future.*/
162
163#define FIRST_NFS4_OP OP_ACCESS
164#define LAST_NFS4_OP OP_RELEASE_LOCKOWNER
165
160enum nfsstat4 { 166enum nfsstat4 {
161 NFS4_OK = 0, 167 NFS4_OK = 0,
162 NFS4ERR_PERM = 1, 168 NFS4ERR_PERM = 1,
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 55ea853d57bc..247434553ae8 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -476,10 +476,9 @@ static inline int nfs_wb_page(struct inode *inode, struct page* page)
476} 476}
477 477
478/* 478/*
479 * Allocate and free nfs_write_data structures 479 * Allocate nfs_write_data structures
480 */ 480 */
481extern struct nfs_write_data *nfs_writedata_alloc(unsigned int pagecount); 481extern struct nfs_write_data *nfs_writedata_alloc(unsigned int pagecount);
482extern void nfs_writedata_free(struct nfs_write_data *p);
483 482
484/* 483/*
485 * linux/fs/nfs/read.c 484 * linux/fs/nfs/read.c
@@ -491,10 +490,9 @@ extern int nfs_readpage_result(struct rpc_task *, struct nfs_read_data *);
491extern void nfs_readdata_release(void *data); 490extern void nfs_readdata_release(void *data);
492 491
493/* 492/*
494 * Allocate and free nfs_read_data structures 493 * Allocate nfs_read_data structures
495 */ 494 */
496extern struct nfs_read_data *nfs_readdata_alloc(unsigned int pagecount); 495extern struct nfs_read_data *nfs_readdata_alloc(unsigned int pagecount);
497extern void nfs_readdata_free(struct nfs_read_data *p);
498 496
499/* 497/*
500 * linux/fs/nfs3proc.c 498 * linux/fs/nfs3proc.c
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 7c7320fa51aa..2d3fb6416d91 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -729,6 +729,7 @@ struct nfs_read_data {
729 struct list_head pages; /* Coalesced read requests */ 729 struct list_head pages; /* Coalesced read requests */
730 struct nfs_page *req; /* multi ops per nfs_page */ 730 struct nfs_page *req; /* multi ops per nfs_page */
731 struct page **pagevec; 731 struct page **pagevec;
732 unsigned int npages; /* active pages in pagevec */
732 struct nfs_readargs args; 733 struct nfs_readargs args;
733 struct nfs_readres res; 734 struct nfs_readres res;
734#ifdef CONFIG_NFS_V4 735#ifdef CONFIG_NFS_V4
@@ -747,6 +748,7 @@ struct nfs_write_data {
747 struct list_head pages; /* Coalesced requests we wish to flush */ 748 struct list_head pages; /* Coalesced requests we wish to flush */
748 struct nfs_page *req; /* multi ops per nfs_page */ 749 struct nfs_page *req; /* multi ops per nfs_page */
749 struct page **pagevec; 750 struct page **pagevec;
751 unsigned int npages; /* active pages in pagevec */
750 struct nfs_writeargs args; /* argument struct */ 752 struct nfs_writeargs args; /* argument struct */
751 struct nfs_writeres res; /* result struct */ 753 struct nfs_writeres res; /* result struct */
752#ifdef CONFIG_NFS_V4 754#ifdef CONFIG_NFS_V4
diff --git a/include/linux/nfsd/stats.h b/include/linux/nfsd/stats.h
index b6f1e0cda4f2..28a82fdd922f 100644
--- a/include/linux/nfsd/stats.h
+++ b/include/linux/nfsd/stats.h
@@ -9,6 +9,8 @@
9#ifndef LINUX_NFSD_STATS_H 9#ifndef LINUX_NFSD_STATS_H
10#define LINUX_NFSD_STATS_H 10#define LINUX_NFSD_STATS_H
11 11
12#include <linux/nfs4.h>
13
12struct nfsd_stats { 14struct nfsd_stats {
13 unsigned int rchits; /* repcache hits */ 15 unsigned int rchits; /* repcache hits */
14 unsigned int rcmisses; /* repcache hits */ 16 unsigned int rcmisses; /* repcache hits */
@@ -27,6 +29,10 @@ struct nfsd_stats {
27 unsigned int ra_size; /* size of ra cache */ 29 unsigned int ra_size; /* size of ra cache */
28 unsigned int ra_depth[11]; /* number of times ra entry was found that deep 30 unsigned int ra_depth[11]; /* number of times ra entry was found that deep
29 * in the cache (10percentiles). [10] = not found */ 31 * in the cache (10percentiles). [10] = not found */
32#ifdef CONFIG_NFSD_V4
33 unsigned int nfs4_opcount[LAST_NFS4_OP + 1]; /* count of individual nfsv4 operations */
34#endif
35
30}; 36};
31 37
32/* thread usage wraps very million seconds (approx one fortnight) */ 38/* thread usage wraps very million seconds (approx one fortnight) */
diff --git a/include/linux/nsc_gpio.h b/include/linux/nsc_gpio.h
index 135742cfada5..7da0cf3702ee 100644
--- a/include/linux/nsc_gpio.h
+++ b/include/linux/nsc_gpio.h
@@ -25,8 +25,6 @@ struct nsc_gpio_ops {
25 void (*gpio_dump) (struct nsc_gpio_ops *amp, unsigned iminor); 25 void (*gpio_dump) (struct nsc_gpio_ops *amp, unsigned iminor);
26 int (*gpio_get) (unsigned iminor); 26 int (*gpio_get) (unsigned iminor);
27 void (*gpio_set) (unsigned iminor, int state); 27 void (*gpio_set) (unsigned iminor, int state);
28 void (*gpio_set_high)(unsigned iminor);
29 void (*gpio_set_low) (unsigned iminor);
30 void (*gpio_change) (unsigned iminor); 28 void (*gpio_change) (unsigned iminor);
31 int (*gpio_current) (unsigned iminor); 29 int (*gpio_current) (unsigned iminor);
32 struct device* dev; /* for dev_dbg() support, set in init */ 30 struct device* dev; /* for dev_dbg() support, set in init */
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 983fca251b25..8565b81d7fbc 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -161,6 +161,7 @@ struct pci_dev {
161 unsigned int is_enabled:1; /* pci_enable_device has been called */ 161 unsigned int is_enabled:1; /* pci_enable_device has been called */
162 unsigned int is_busmaster:1; /* device is busmaster */ 162 unsigned int is_busmaster:1; /* device is busmaster */
163 unsigned int no_msi:1; /* device may not use msi */ 163 unsigned int no_msi:1; /* device may not use msi */
164 unsigned int no_d1d2:1; /* only allow d0 or d3 */
164 unsigned int block_ucfg_access:1; /* userspace config space access is blocked */ 165 unsigned int block_ucfg_access:1; /* userspace config space access is blocked */
165 unsigned int broken_parity_status:1; /* Device generates false positive parity */ 166 unsigned int broken_parity_status:1; /* Device generates false positive parity */
166 unsigned int msi_enabled:1; 167 unsigned int msi_enabled:1;
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 685081c01342..4eae06b08cf2 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2019,6 +2019,13 @@
2019#define PCI_VENDOR_ID_TDI 0x192E 2019#define PCI_VENDOR_ID_TDI 0x192E
2020#define PCI_DEVICE_ID_TDI_EHCI 0x0101 2020#define PCI_DEVICE_ID_TDI_EHCI 0x0101
2021 2021
2022#define PCI_VENDOR_ID_JMICRON 0x197B
2023#define PCI_DEVICE_ID_JMICRON_JMB360 0x2360
2024#define PCI_DEVICE_ID_JMICRON_JMB361 0x2361
2025#define PCI_DEVICE_ID_JMICRON_JMB363 0x2363
2026#define PCI_DEVICE_ID_JMICRON_JMB365 0x2365
2027#define PCI_DEVICE_ID_JMICRON_JMB366 0x2366
2028#define PCI_DEVICE_ID_JMICRON_JMB368 0x2368
2022 2029
2023#define PCI_VENDOR_ID_TEKRAM 0x1de1 2030#define PCI_VENDOR_ID_TEKRAM 0x1de1
2024#define PCI_DEVICE_ID_TEKRAM_DC290 0xdc29 2031#define PCI_DEVICE_ID_TEKRAM_DC290 0xdc29
@@ -2135,6 +2142,7 @@
2135#define PCI_DEVICE_ID_INTEL_82820_UP_HB 0x2501 2142#define PCI_DEVICE_ID_INTEL_82820_UP_HB 0x2501
2136#define PCI_DEVICE_ID_INTEL_82850_HB 0x2530 2143#define PCI_DEVICE_ID_INTEL_82850_HB 0x2530
2137#define PCI_DEVICE_ID_INTEL_82860_HB 0x2531 2144#define PCI_DEVICE_ID_INTEL_82860_HB 0x2531
2145#define PCI_DEVICE_ID_INTEL_E7501_MCH 0x254c
2138#define PCI_DEVICE_ID_INTEL_82845G_HB 0x2560 2146#define PCI_DEVICE_ID_INTEL_82845G_HB 0x2560
2139#define PCI_DEVICE_ID_INTEL_82845G_IG 0x2562 2147#define PCI_DEVICE_ID_INTEL_82845G_IG 0x2562
2140#define PCI_DEVICE_ID_INTEL_82865_HB 0x2570 2148#define PCI_DEVICE_ID_INTEL_82865_HB 0x2570
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h
index 6bce4a240364..96930cb5927c 100644
--- a/include/linux/pci_regs.h
+++ b/include/linux/pci_regs.h
@@ -422,7 +422,23 @@
422#define PCI_ERR_CAP_ECRC_CHKE 0x00000100 /* ECRC Check Enable */ 422#define PCI_ERR_CAP_ECRC_CHKE 0x00000100 /* ECRC Check Enable */
423#define PCI_ERR_HEADER_LOG 28 /* Header Log Register (16 bytes) */ 423#define PCI_ERR_HEADER_LOG 28 /* Header Log Register (16 bytes) */
424#define PCI_ERR_ROOT_COMMAND 44 /* Root Error Command */ 424#define PCI_ERR_ROOT_COMMAND 44 /* Root Error Command */
425/* Correctable Err Reporting Enable */
426#define PCI_ERR_ROOT_CMD_COR_EN 0x00000001
427/* Non-fatal Err Reporting Enable */
428#define PCI_ERR_ROOT_CMD_NONFATAL_EN 0x00000002
429/* Fatal Err Reporting Enable */
430#define PCI_ERR_ROOT_CMD_FATAL_EN 0x00000004
425#define PCI_ERR_ROOT_STATUS 48 431#define PCI_ERR_ROOT_STATUS 48
432#define PCI_ERR_ROOT_COR_RCV 0x00000001 /* ERR_COR Received */
433/* Multi ERR_COR Received */
434#define PCI_ERR_ROOT_MULTI_COR_RCV 0x00000002
435/* ERR_FATAL/NONFATAL Recevied */
436#define PCI_ERR_ROOT_UNCOR_RCV 0x00000004
437/* Multi ERR_FATAL/NONFATAL Recevied */
438#define PCI_ERR_ROOT_MULTI_UNCOR_RCV 0x00000008
439#define PCI_ERR_ROOT_FIRST_FATAL 0x00000010 /* First Fatal */
440#define PCI_ERR_ROOT_NONFATAL_RCV 0x00000020 /* Non-Fatal Received */
441#define PCI_ERR_ROOT_FATAL_RCV 0x00000040 /* Fatal Received */
426#define PCI_ERR_ROOT_COR_SRC 52 442#define PCI_ERR_ROOT_COR_SRC 52
427#define PCI_ERR_ROOT_SRC 54 443#define PCI_ERR_ROOT_SRC 54
428 444
diff --git a/include/linux/pm_legacy.h b/include/linux/pm_legacy.h
index 78027c533b94..514729a44688 100644
--- a/include/linux/pm_legacy.h
+++ b/include/linux/pm_legacy.h
@@ -15,11 +15,6 @@ struct pm_dev __deprecated *
15pm_register(pm_dev_t type, unsigned long id, pm_callback callback); 15pm_register(pm_dev_t type, unsigned long id, pm_callback callback);
16 16
17/* 17/*
18 * Unregister all devices with matching callback
19 */
20void __deprecated pm_unregister_all(pm_callback callback);
21
22/*
23 * Send a request to all devices 18 * Send a request to all devices
24 */ 19 */
25int __deprecated pm_send_all(pm_request_t rqst, void *data); 20int __deprecated pm_send_all(pm_request_t rqst, void *data);
@@ -35,8 +30,6 @@ static inline struct pm_dev *pm_register(pm_dev_t type,
35 return NULL; 30 return NULL;
36} 31}
37 32
38static inline void pm_unregister_all(pm_callback callback) {}
39
40static inline int pm_send_all(pm_request_t rqst, void *data) 33static inline int pm_send_all(pm_request_t rqst, void *data)
41{ 34{
42 return 0; 35 return 0;
diff --git a/include/linux/pmu.h b/include/linux/pmu.h
index 2ed807ddc08c..783177387ac6 100644
--- a/include/linux/pmu.h
+++ b/include/linux/pmu.h
@@ -231,7 +231,6 @@ extern struct pmu_battery_info pmu_batteries[PMU_MAX_BATTERIES];
231extern unsigned int pmu_power_flags; 231extern unsigned int pmu_power_flags;
232 232
233/* Backlight */ 233/* Backlight */
234extern int disable_kernel_backlight; 234extern void pmu_backlight_init(void);
235extern void pmu_backlight_init(struct device_node*);
236 235
237#endif /* __KERNEL__ */ 236#endif /* __KERNEL__ */
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h
index c1e0ac55bab5..d28890295852 100644
--- a/include/linux/raid/md_k.h
+++ b/include/linux/raid/md_k.h
@@ -148,9 +148,10 @@ struct mddev_s
148 148
149 struct mdk_thread_s *thread; /* management thread */ 149 struct mdk_thread_s *thread; /* management thread */
150 struct mdk_thread_s *sync_thread; /* doing resync or reconstruct */ 150 struct mdk_thread_s *sync_thread; /* doing resync or reconstruct */
151 sector_t curr_resync; /* blocks scheduled */ 151 sector_t curr_resync; /* last block scheduled */
152 unsigned long resync_mark; /* a recent timestamp */ 152 unsigned long resync_mark; /* a recent timestamp */
153 sector_t resync_mark_cnt;/* blocks written at resync_mark */ 153 sector_t resync_mark_cnt;/* blocks written at resync_mark */
154 sector_t curr_mark_cnt; /* blocks scheduled now */
154 155
155 sector_t resync_max_sectors; /* may be set by personality */ 156 sector_t resync_max_sectors; /* may be set by personality */
156 157
diff --git a/include/linux/root_dev.h b/include/linux/root_dev.h
index ea4bc9d13735..ed241aad7c17 100644
--- a/include/linux/root_dev.h
+++ b/include/linux/root_dev.h
@@ -2,6 +2,8 @@
2#define _ROOT_DEV_H_ 2#define _ROOT_DEV_H_
3 3
4#include <linux/major.h> 4#include <linux/major.h>
5#include <linux/types.h>
6#include <linux/kdev_t.h>
5 7
6enum { 8enum {
7 Root_NFS = MKDEV(UNNAMED_MAJOR, 255), 9 Root_NFS = MKDEV(UNNAMED_MAJOR, 255),
diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h
index 658afb37c3f5..7b524b4109a0 100644
--- a/include/linux/rwsem.h
+++ b/include/linux/rwsem.h
@@ -61,12 +61,25 @@ extern void downgrade_write(struct rw_semaphore *sem);
61 61
62#ifdef CONFIG_DEBUG_LOCK_ALLOC 62#ifdef CONFIG_DEBUG_LOCK_ALLOC
63/* 63/*
64 * nested locking: 64 * nested locking. NOTE: rwsems are not allowed to recurse
65 * (which occurs if the same task tries to acquire the same
66 * lock instance multiple times), but multiple locks of the
67 * same lock class might be taken, if the order of the locks
68 * is always the same. This ordering rule can be expressed
69 * to lockdep via the _nested() APIs, but enumerating the
70 * subclasses that are used. (If the nesting relationship is
71 * static then another method for expressing nested locking is
72 * the explicit definition of lock class keys and the use of
73 * lockdep_set_class() at lock initialization time.
74 * See Documentation/lockdep-design.txt for more details.)
65 */ 75 */
66extern void down_read_nested(struct rw_semaphore *sem, int subclass); 76extern void down_read_nested(struct rw_semaphore *sem, int subclass);
67extern void down_write_nested(struct rw_semaphore *sem, int subclass); 77extern void down_write_nested(struct rw_semaphore *sem, int subclass);
68/* 78/*
69 * Take/release a lock when not the owner will release it: 79 * Take/release a lock when not the owner will release it.
80 *
81 * [ This API should be avoided as much as possible - the
82 * proper abstraction for this case is completions. ]
70 */ 83 */
71extern void down_read_non_owner(struct rw_semaphore *sem); 84extern void down_read_non_owner(struct rw_semaphore *sem);
72extern void up_read_non_owner(struct rw_semaphore *sem); 85extern void up_read_non_owner(struct rw_semaphore *sem);
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 1c876e27ff93..6afa72e080cb 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -463,6 +463,10 @@ struct signal_struct {
463#ifdef CONFIG_BSD_PROCESS_ACCT 463#ifdef CONFIG_BSD_PROCESS_ACCT
464 struct pacct_struct pacct; /* per-process accounting information */ 464 struct pacct_struct pacct; /* per-process accounting information */
465#endif 465#endif
466#ifdef CONFIG_TASKSTATS
467 spinlock_t stats_lock;
468 struct taskstats *stats;
469#endif
466}; 470};
467 471
468/* Context switch must be unlocked if interrupts are to be enabled */ 472/* Context switch must be unlocked if interrupts are to be enabled */
@@ -537,7 +541,7 @@ extern struct user_struct root_user;
537struct backing_dev_info; 541struct backing_dev_info;
538struct reclaim_state; 542struct reclaim_state;
539 543
540#ifdef CONFIG_SCHEDSTATS 544#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT)
541struct sched_info { 545struct sched_info {
542 /* cumulative counters */ 546 /* cumulative counters */
543 unsigned long cpu_time, /* time spent on the cpu */ 547 unsigned long cpu_time, /* time spent on the cpu */
@@ -548,9 +552,53 @@ struct sched_info {
548 unsigned long last_arrival, /* when we last ran on a cpu */ 552 unsigned long last_arrival, /* when we last ran on a cpu */
549 last_queued; /* when we were last queued to run */ 553 last_queued; /* when we were last queued to run */
550}; 554};
555#endif /* defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) */
551 556
557#ifdef CONFIG_SCHEDSTATS
552extern struct file_operations proc_schedstat_operations; 558extern struct file_operations proc_schedstat_operations;
559#endif /* CONFIG_SCHEDSTATS */
560
561#ifdef CONFIG_TASK_DELAY_ACCT
562struct task_delay_info {
563 spinlock_t lock;
564 unsigned int flags; /* Private per-task flags */
565
566 /* For each stat XXX, add following, aligned appropriately
567 *
568 * struct timespec XXX_start, XXX_end;
569 * u64 XXX_delay;
570 * u32 XXX_count;
571 *
572 * Atomicity of updates to XXX_delay, XXX_count protected by
573 * single lock above (split into XXX_lock if contention is an issue).
574 */
575
576 /*
577 * XXX_count is incremented on every XXX operation, the delay
578 * associated with the operation is added to XXX_delay.
579 * XXX_delay contains the accumulated delay time in nanoseconds.
580 */
581 struct timespec blkio_start, blkio_end; /* Shared by blkio, swapin */
582 u64 blkio_delay; /* wait for sync block io completion */
583 u64 swapin_delay; /* wait for swapin block io completion */
584 u32 blkio_count; /* total count of the number of sync block */
585 /* io operations performed */
586 u32 swapin_count; /* total count of the number of swapin block */
587 /* io operations performed */
588};
589#endif /* CONFIG_TASK_DELAY_ACCT */
590
591static inline int sched_info_on(void)
592{
593#ifdef CONFIG_SCHEDSTATS
594 return 1;
595#elif defined(CONFIG_TASK_DELAY_ACCT)
596 extern int delayacct_on;
597 return delayacct_on;
598#else
599 return 0;
553#endif 600#endif
601}
554 602
555enum idle_type 603enum idle_type
556{ 604{
@@ -747,7 +795,7 @@ struct task_struct {
747 cpumask_t cpus_allowed; 795 cpumask_t cpus_allowed;
748 unsigned int time_slice, first_time_slice; 796 unsigned int time_slice, first_time_slice;
749 797
750#ifdef CONFIG_SCHEDSTATS 798#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT)
751 struct sched_info sched_info; 799 struct sched_info sched_info;
752#endif 800#endif
753 801
@@ -945,6 +993,10 @@ struct task_struct {
945 * cache last used pipe for splice 993 * cache last used pipe for splice
946 */ 994 */
947 struct pipe_inode_info *splice_pipe; 995 struct pipe_inode_info *splice_pipe;
996#ifdef CONFIG_TASK_DELAY_ACCT
997 spinlock_t delays_lock;
998 struct task_delay_info *delays;
999#endif
948}; 1000};
949 1001
950static inline pid_t process_group(struct task_struct *tsk) 1002static inline pid_t process_group(struct task_struct *tsk)
diff --git a/include/linux/security.h b/include/linux/security.h
index f75303831d09..6bc2aad494ff 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -1109,6 +1109,16 @@ struct swap_info_struct;
1109 * @name contains the name of the security module being unstacked. 1109 * @name contains the name of the security module being unstacked.
1110 * @ops contains a pointer to the struct security_operations of the module to unstack. 1110 * @ops contains a pointer to the struct security_operations of the module to unstack.
1111 * 1111 *
1112 * @secid_to_secctx:
1113 * Convert secid to security context.
1114 * @secid contains the security ID.
1115 * @secdata contains the pointer that stores the converted security context.
1116 *
1117 * @release_secctx:
1118 * Release the security context.
1119 * @secdata contains the security context.
1120 * @seclen contains the length of the security context.
1121 *
1112 * This is the main security structure. 1122 * This is the main security structure.
1113 */ 1123 */
1114struct security_operations { 1124struct security_operations {
@@ -1289,6 +1299,8 @@ struct security_operations {
1289 1299
1290 int (*getprocattr)(struct task_struct *p, char *name, void *value, size_t size); 1300 int (*getprocattr)(struct task_struct *p, char *name, void *value, size_t size);
1291 int (*setprocattr)(struct task_struct *p, char *name, void *value, size_t size); 1301 int (*setprocattr)(struct task_struct *p, char *name, void *value, size_t size);
1302 int (*secid_to_secctx)(u32 secid, char **secdata, u32 *seclen);
1303 void (*release_secctx)(char *secdata, u32 seclen);
1292 1304
1293#ifdef CONFIG_SECURITY_NETWORK 1305#ifdef CONFIG_SECURITY_NETWORK
1294 int (*unix_stream_connect) (struct socket * sock, 1306 int (*unix_stream_connect) (struct socket * sock,
@@ -1317,7 +1329,7 @@ struct security_operations {
1317 int (*socket_shutdown) (struct socket * sock, int how); 1329 int (*socket_shutdown) (struct socket * sock, int how);
1318 int (*socket_sock_rcv_skb) (struct sock * sk, struct sk_buff * skb); 1330 int (*socket_sock_rcv_skb) (struct sock * sk, struct sk_buff * skb);
1319 int (*socket_getpeersec_stream) (struct socket *sock, char __user *optval, int __user *optlen, unsigned len); 1331 int (*socket_getpeersec_stream) (struct socket *sock, char __user *optval, int __user *optlen, unsigned len);
1320 int (*socket_getpeersec_dgram) (struct sk_buff *skb, char **secdata, u32 *seclen); 1332 int (*socket_getpeersec_dgram) (struct socket *sock, struct sk_buff *skb, u32 *secid);
1321 int (*sk_alloc_security) (struct sock *sk, int family, gfp_t priority); 1333 int (*sk_alloc_security) (struct sock *sk, int family, gfp_t priority);
1322 void (*sk_free_security) (struct sock *sk); 1334 void (*sk_free_security) (struct sock *sk);
1323 unsigned int (*sk_getsid) (struct sock *sk, struct flowi *fl, u8 dir); 1335 unsigned int (*sk_getsid) (struct sock *sk, struct flowi *fl, u8 dir);
@@ -2059,6 +2071,16 @@ static inline int security_netlink_recv(struct sk_buff * skb, int cap)
2059 return security_ops->netlink_recv(skb, cap); 2071 return security_ops->netlink_recv(skb, cap);
2060} 2072}
2061 2073
2074static inline int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen)
2075{
2076 return security_ops->secid_to_secctx(secid, secdata, seclen);
2077}
2078
2079static inline void security_release_secctx(char *secdata, u32 seclen)
2080{
2081 return security_ops->release_secctx(secdata, seclen);
2082}
2083
2062/* prototypes */ 2084/* prototypes */
2063extern int security_init (void); 2085extern int security_init (void);
2064extern int register_security (struct security_operations *ops); 2086extern int register_security (struct security_operations *ops);
@@ -2725,6 +2747,14 @@ static inline void securityfs_remove(struct dentry *dentry)
2725{ 2747{
2726} 2748}
2727 2749
2750static inline int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen)
2751{
2752 return -EOPNOTSUPP;
2753}
2754
2755static inline void security_release_secctx(char *secdata, u32 seclen)
2756{
2757}
2728#endif /* CONFIG_SECURITY */ 2758#endif /* CONFIG_SECURITY */
2729 2759
2730#ifdef CONFIG_SECURITY_NETWORK 2760#ifdef CONFIG_SECURITY_NETWORK
@@ -2840,10 +2870,9 @@ static inline int security_socket_getpeersec_stream(struct socket *sock, char __
2840 return security_ops->socket_getpeersec_stream(sock, optval, optlen, len); 2870 return security_ops->socket_getpeersec_stream(sock, optval, optlen, len);
2841} 2871}
2842 2872
2843static inline int security_socket_getpeersec_dgram(struct sk_buff *skb, char **secdata, 2873static inline int security_socket_getpeersec_dgram(struct socket *sock, struct sk_buff *skb, u32 *secid)
2844 u32 *seclen)
2845{ 2874{
2846 return security_ops->socket_getpeersec_dgram(skb, secdata, seclen); 2875 return security_ops->socket_getpeersec_dgram(sock, skb, secid);
2847} 2876}
2848 2877
2849static inline int security_sk_alloc(struct sock *sk, int family, gfp_t priority) 2878static inline int security_sk_alloc(struct sock *sk, int family, gfp_t priority)
@@ -2968,8 +2997,7 @@ static inline int security_socket_getpeersec_stream(struct socket *sock, char __
2968 return -ENOPROTOOPT; 2997 return -ENOPROTOOPT;
2969} 2998}
2970 2999
2971static inline int security_socket_getpeersec_dgram(struct sk_buff *skb, char **secdata, 3000static inline int security_socket_getpeersec_dgram(struct socket *sock, struct sk_buff *skb, u32 *secid)
2972 u32 *seclen)
2973{ 3001{
2974 return -ENOPROTOOPT; 3002 return -ENOPROTOOPT;
2975} 3003}
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 058cba70818a..86501a3de2ac 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -227,6 +227,7 @@ struct uart_port {
227#define UPIO_MEM (2) 227#define UPIO_MEM (2)
228#define UPIO_MEM32 (3) 228#define UPIO_MEM32 (3)
229#define UPIO_AU (4) /* Au1x00 type IO */ 229#define UPIO_AU (4) /* Au1x00 type IO */
230#define UPIO_TSI (5) /* Tsi108/109 type IO */
230 231
231 unsigned int read_status_mask; /* driver specific */ 232 unsigned int read_status_mask; /* driver specific */
232 unsigned int ignore_status_mask; /* driver specific */ 233 unsigned int ignore_status_mask; /* driver specific */
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 3597b4f14389..19c96d498e20 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -604,12 +604,17 @@ static inline __u32 skb_queue_len(const struct sk_buff_head *list_)
604 return list_->qlen; 604 return list_->qlen;
605} 605}
606 606
607extern struct lock_class_key skb_queue_lock_key; 607/*
608 608 * This function creates a split out lock class for each invocation;
609 * this is needed for now since a whole lot of users of the skb-queue
610 * infrastructure in drivers have different locking usage (in hardirq)
611 * than the networking core (in softirq only). In the long run either the
612 * network layer or drivers should need annotation to consolidate the
613 * main types of usage into 3 classes.
614 */
609static inline void skb_queue_head_init(struct sk_buff_head *list) 615static inline void skb_queue_head_init(struct sk_buff_head *list)
610{ 616{
611 spin_lock_init(&list->lock); 617 spin_lock_init(&list->lock);
612 lockdep_set_class(&list->lock, &skb_queue_lock_key);
613 list->prev = list->next = (struct sk_buff *)list; 618 list->prev = list->next = (struct sk_buff *)list;
614 list->qlen = 0; 619 list->qlen = 0;
615} 620}
@@ -1066,9 +1071,8 @@ static inline void __skb_queue_purge(struct sk_buff_head *list)
1066 kfree_skb(skb); 1071 kfree_skb(skb);
1067} 1072}
1068 1073
1069#ifndef CONFIG_HAVE_ARCH_DEV_ALLOC_SKB
1070/** 1074/**
1071 * __dev_alloc_skb - allocate an skbuff for sending 1075 * __dev_alloc_skb - allocate an skbuff for receiving
1072 * @length: length to allocate 1076 * @length: length to allocate
1073 * @gfp_mask: get_free_pages mask, passed to alloc_skb 1077 * @gfp_mask: get_free_pages mask, passed to alloc_skb
1074 * 1078 *
@@ -1087,12 +1091,9 @@ static inline struct sk_buff *__dev_alloc_skb(unsigned int length,
1087 skb_reserve(skb, NET_SKB_PAD); 1091 skb_reserve(skb, NET_SKB_PAD);
1088 return skb; 1092 return skb;
1089} 1093}
1090#else
1091extern struct sk_buff *__dev_alloc_skb(unsigned int length, int gfp_mask);
1092#endif
1093 1094
1094/** 1095/**
1095 * dev_alloc_skb - allocate an skbuff for sending 1096 * dev_alloc_skb - allocate an skbuff for receiving
1096 * @length: length to allocate 1097 * @length: length to allocate
1097 * 1098 *
1098 * Allocate a new &sk_buff and assign it a usage count of one. The 1099 * Allocate a new &sk_buff and assign it a usage count of one. The
@@ -1108,6 +1109,28 @@ static inline struct sk_buff *dev_alloc_skb(unsigned int length)
1108 return __dev_alloc_skb(length, GFP_ATOMIC); 1109 return __dev_alloc_skb(length, GFP_ATOMIC);
1109} 1110}
1110 1111
1112extern struct sk_buff *__netdev_alloc_skb(struct net_device *dev,
1113 unsigned int length, gfp_t gfp_mask);
1114
1115/**
1116 * netdev_alloc_skb - allocate an skbuff for rx on a specific device
1117 * @dev: network device to receive on
1118 * @length: length to allocate
1119 *
1120 * Allocate a new &sk_buff and assign it a usage count of one. The
1121 * buffer has unspecified headroom built in. Users should allocate
1122 * the headroom they think they need without accounting for the
1123 * built in space. The built in space is used for optimisations.
1124 *
1125 * %NULL is returned if there is no free memory. Although this function
1126 * allocates memory it can be called from an interrupt.
1127 */
1128static inline struct sk_buff *netdev_alloc_skb(struct net_device *dev,
1129 unsigned int length)
1130{
1131 return __netdev_alloc_skb(dev, length, GFP_ATOMIC);
1132}
1133
1111/** 1134/**
1112 * skb_cow - copy header of skb when it is required 1135 * skb_cow - copy header of skb when it is required
1113 * @skb: buffer to cow 1136 * @skb: buffer to cow
@@ -1455,5 +1478,10 @@ static inline void skb_init_secmark(struct sk_buff *skb)
1455{ } 1478{ }
1456#endif 1479#endif
1457 1480
1481static inline int skb_is_gso(const struct sk_buff *skb)
1482{
1483 return skb_shinfo(skb)->gso_size;
1484}
1485
1458#endif /* __KERNEL__ */ 1486#endif /* __KERNEL__ */
1459#endif /* _LINUX_SKBUFF_H */ 1487#endif /* _LINUX_SKBUFF_H */
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index e8bbe8118de8..840e47a4ccc5 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -229,7 +229,7 @@ int xprt_reserve_xprt(struct rpc_task *task);
229int xprt_reserve_xprt_cong(struct rpc_task *task); 229int xprt_reserve_xprt_cong(struct rpc_task *task);
230int xprt_prepare_transmit(struct rpc_task *task); 230int xprt_prepare_transmit(struct rpc_task *task);
231void xprt_transmit(struct rpc_task *task); 231void xprt_transmit(struct rpc_task *task);
232void xprt_abort_transmit(struct rpc_task *task); 232void xprt_end_transmit(struct rpc_task *task);
233int xprt_adjust_timeout(struct rpc_rqst *req); 233int xprt_adjust_timeout(struct rpc_rqst *req);
234void xprt_release_xprt(struct rpc_xprt *xprt, struct rpc_task *task); 234void xprt_release_xprt(struct rpc_xprt *xprt, struct rpc_task *task);
235void xprt_release_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task); 235void xprt_release_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task);
diff --git a/include/linux/taskstats.h b/include/linux/taskstats.h
new file mode 100644
index 000000000000..f1cb6cddd19d
--- /dev/null
+++ b/include/linux/taskstats.h
@@ -0,0 +1,137 @@
1/* taskstats.h - exporting per-task statistics
2 *
3 * Copyright (C) Shailabh Nagar, IBM Corp. 2006
4 * (C) Balbir Singh, IBM Corp. 2006
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of version 2.1 of the GNU Lesser General Public License
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it would be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 */
14
15#ifndef _LINUX_TASKSTATS_H
16#define _LINUX_TASKSTATS_H
17
18/* Format for per-task data returned to userland when
19 * - a task exits
20 * - listener requests stats for a task
21 *
22 * The struct is versioned. Newer versions should only add fields to
23 * the bottom of the struct to maintain backward compatibility.
24 *
25 *
26 * To add new fields
27 * a) bump up TASKSTATS_VERSION
28 * b) add comment indicating new version number at end of struct
29 * c) add new fields after version comment; maintain 64-bit alignment
30 */
31
32#define TASKSTATS_VERSION 1
33
34struct taskstats {
35
36 /* Version 1 */
37 __u16 version;
38 __u16 padding[3]; /* Userspace should not interpret the padding
39 * field which can be replaced by useful
40 * fields if struct taskstats is extended.
41 */
42
43 /* Delay accounting fields start
44 *
45 * All values, until comment "Delay accounting fields end" are
46 * available only if delay accounting is enabled, even though the last
47 * few fields are not delays
48 *
49 * xxx_count is the number of delay values recorded
50 * xxx_delay_total is the corresponding cumulative delay in nanoseconds
51 *
52 * xxx_delay_total wraps around to zero on overflow
53 * xxx_count incremented regardless of overflow
54 */
55
56 /* Delay waiting for cpu, while runnable
57 * count, delay_total NOT updated atomically
58 */
59 __u64 cpu_count;
60 __u64 cpu_delay_total;
61
62 /* Following four fields atomically updated using task->delays->lock */
63
64 /* Delay waiting for synchronous block I/O to complete
65 * does not account for delays in I/O submission
66 */
67 __u64 blkio_count;
68 __u64 blkio_delay_total;
69
70 /* Delay waiting for page fault I/O (swap in only) */
71 __u64 swapin_count;
72 __u64 swapin_delay_total;
73
74 /* cpu "wall-clock" running time
75 * On some architectures, value will adjust for cpu time stolen
76 * from the kernel in involuntary waits due to virtualization.
77 * Value is cumulative, in nanoseconds, without a corresponding count
78 * and wraps around to zero silently on overflow
79 */
80 __u64 cpu_run_real_total;
81
82 /* cpu "virtual" running time
83 * Uses time intervals seen by the kernel i.e. no adjustment
84 * for kernel's involuntary waits due to virtualization.
85 * Value is cumulative, in nanoseconds, without a corresponding count
86 * and wraps around to zero silently on overflow
87 */
88 __u64 cpu_run_virtual_total;
89 /* Delay accounting fields end */
90 /* version 1 ends here */
91};
92
93
94/*
95 * Commands sent from userspace
96 * Not versioned. New commands should only be inserted at the enum's end
97 * prior to __TASKSTATS_CMD_MAX
98 */
99
100enum {
101 TASKSTATS_CMD_UNSPEC = 0, /* Reserved */
102 TASKSTATS_CMD_GET, /* user->kernel request/get-response */
103 TASKSTATS_CMD_NEW, /* kernel->user event */
104 __TASKSTATS_CMD_MAX,
105};
106
107#define TASKSTATS_CMD_MAX (__TASKSTATS_CMD_MAX - 1)
108
109enum {
110 TASKSTATS_TYPE_UNSPEC = 0, /* Reserved */
111 TASKSTATS_TYPE_PID, /* Process id */
112 TASKSTATS_TYPE_TGID, /* Thread group id */
113 TASKSTATS_TYPE_STATS, /* taskstats structure */
114 TASKSTATS_TYPE_AGGR_PID, /* contains pid + stats */
115 TASKSTATS_TYPE_AGGR_TGID, /* contains tgid + stats */
116 __TASKSTATS_TYPE_MAX,
117};
118
119#define TASKSTATS_TYPE_MAX (__TASKSTATS_TYPE_MAX - 1)
120
121enum {
122 TASKSTATS_CMD_ATTR_UNSPEC = 0,
123 TASKSTATS_CMD_ATTR_PID,
124 TASKSTATS_CMD_ATTR_TGID,
125 TASKSTATS_CMD_ATTR_REGISTER_CPUMASK,
126 TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK,
127 __TASKSTATS_CMD_ATTR_MAX,
128};
129
130#define TASKSTATS_CMD_ATTR_MAX (__TASKSTATS_CMD_ATTR_MAX - 1)
131
132/* NETLINK_GENERIC related info */
133
134#define TASKSTATS_GENL_NAME "TASKSTATS"
135#define TASKSTATS_GENL_VERSION 0x1
136
137#endif /* _LINUX_TASKSTATS_H */
diff --git a/include/linux/taskstats_kern.h b/include/linux/taskstats_kern.h
new file mode 100644
index 000000000000..16894b7edcc8
--- /dev/null
+++ b/include/linux/taskstats_kern.h
@@ -0,0 +1,89 @@
1/* taskstats_kern.h - kernel header for per-task statistics interface
2 *
3 * Copyright (C) Shailabh Nagar, IBM Corp. 2006
4 * (C) Balbir Singh, IBM Corp. 2006
5 */
6
7#ifndef _LINUX_TASKSTATS_KERN_H
8#define _LINUX_TASKSTATS_KERN_H
9
10#include <linux/taskstats.h>
11#include <linux/sched.h>
12#include <net/genetlink.h>
13
14#ifdef CONFIG_TASKSTATS
15extern kmem_cache_t *taskstats_cache;
16extern struct mutex taskstats_exit_mutex;
17
18static inline void taskstats_exit_free(struct taskstats *tidstats)
19{
20 if (tidstats)
21 kmem_cache_free(taskstats_cache, tidstats);
22}
23
24static inline void taskstats_tgid_init(struct signal_struct *sig)
25{
26 spin_lock_init(&sig->stats_lock);
27 sig->stats = NULL;
28}
29
30static inline void taskstats_tgid_alloc(struct signal_struct *sig)
31{
32 struct taskstats *stats;
33 unsigned long flags;
34
35 stats = kmem_cache_zalloc(taskstats_cache, SLAB_KERNEL);
36 if (!stats)
37 return;
38
39 spin_lock_irqsave(&sig->stats_lock, flags);
40 if (!sig->stats) {
41 sig->stats = stats;
42 stats = NULL;
43 }
44 spin_unlock_irqrestore(&sig->stats_lock, flags);
45
46 if (stats)
47 kmem_cache_free(taskstats_cache, stats);
48}
49
50static inline void taskstats_tgid_free(struct signal_struct *sig)
51{
52 struct taskstats *stats = NULL;
53 unsigned long flags;
54
55 spin_lock_irqsave(&sig->stats_lock, flags);
56 if (sig->stats) {
57 stats = sig->stats;
58 sig->stats = NULL;
59 }
60 spin_unlock_irqrestore(&sig->stats_lock, flags);
61 if (stats)
62 kmem_cache_free(taskstats_cache, stats);
63}
64
65extern void taskstats_exit_alloc(struct taskstats **, unsigned int *);
66extern void taskstats_exit_send(struct task_struct *, struct taskstats *, int, unsigned int);
67extern void taskstats_init_early(void);
68extern void taskstats_tgid_alloc(struct signal_struct *);
69#else
70static inline void taskstats_exit_alloc(struct taskstats **ptidstats, unsigned int *mycpu)
71{}
72static inline void taskstats_exit_free(struct taskstats *ptidstats)
73{}
74static inline void taskstats_exit_send(struct task_struct *tsk,
75 struct taskstats *tidstats,
76 int group_dead, unsigned int cpu)
77{}
78static inline void taskstats_tgid_init(struct signal_struct *sig)
79{}
80static inline void taskstats_tgid_alloc(struct signal_struct *sig)
81{}
82static inline void taskstats_tgid_free(struct signal_struct *sig)
83{}
84static inline void taskstats_init_early(void)
85{}
86#endif /* CONFIG_TASKSTATS */
87
88#endif
89
diff --git a/include/linux/time.h b/include/linux/time.h
index c05f8bb9a323..a5b739967b74 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -71,6 +71,18 @@ extern unsigned long mktime(const unsigned int year, const unsigned int mon,
71extern void set_normalized_timespec(struct timespec *ts, time_t sec, long nsec); 71extern void set_normalized_timespec(struct timespec *ts, time_t sec, long nsec);
72 72
73/* 73/*
74 * sub = lhs - rhs, in normalized form
75 */
76static inline struct timespec timespec_sub(struct timespec lhs,
77 struct timespec rhs)
78{
79 struct timespec ts_delta;
80 set_normalized_timespec(&ts_delta, lhs.tv_sec - rhs.tv_sec,
81 lhs.tv_nsec - rhs.tv_nsec);
82 return ts_delta;
83}
84
85/*
74 * Returns true if the timespec is norm, false if denorm: 86 * Returns true if the timespec is norm, false if denorm:
75 */ 87 */
76#define timespec_valid(ts) \ 88#define timespec_valid(ts) \
diff --git a/include/linux/tty.h b/include/linux/tty.h
index b3b807e4b050..e421d5e34818 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -5,16 +5,6 @@
5 * 'tty.h' defines some structures used by tty_io.c and some defines. 5 * 'tty.h' defines some structures used by tty_io.c and some defines.
6 */ 6 */
7 7
8/*
9 * These constants are also useful for user-level apps (e.g., VC
10 * resizing).
11 */
12#define MIN_NR_CONSOLES 1 /* must be at least 1 */
13#define MAX_NR_CONSOLES 63 /* serial lines start at 64 */
14#define MAX_NR_USER_CONSOLES 63 /* must be root to allocate above this */
15 /* Note: the ioctl VT_GETSTATE does not work for
16 consoles 16 and higher (since it returns a short) */
17
18#ifdef __KERNEL__ 8#ifdef __KERNEL__
19#include <linux/fs.h> 9#include <linux/fs.h>
20#include <linux/major.h> 10#include <linux/major.h>
@@ -22,7 +12,6 @@
22#include <linux/workqueue.h> 12#include <linux/workqueue.h>
23#include <linux/tty_driver.h> 13#include <linux/tty_driver.h>
24#include <linux/tty_ldisc.h> 14#include <linux/tty_ldisc.h>
25#include <linux/screen_info.h>
26#include <linux/mutex.h> 15#include <linux/mutex.h>
27 16
28#include <asm/system.h> 17#include <asm/system.h>
@@ -270,7 +259,6 @@ struct tty_struct {
270extern void tty_write_flush(struct tty_struct *); 259extern void tty_write_flush(struct tty_struct *);
271 260
272extern struct termios tty_std_termios; 261extern struct termios tty_std_termios;
273extern int fg_console, last_console, want_console;
274 262
275extern int kmsg_redirect; 263extern int kmsg_redirect;
276 264
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 8dead32e7ebf..d2bd0c8e0154 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -48,7 +48,7 @@ struct ep_device;
48 * @urb_list: urbs queued to this endpoint; maintained by usbcore 48 * @urb_list: urbs queued to this endpoint; maintained by usbcore
49 * @hcpriv: for use by HCD; typically holds hardware dma queue head (QH) 49 * @hcpriv: for use by HCD; typically holds hardware dma queue head (QH)
50 * with one or more transfer descriptors (TDs) per urb 50 * with one or more transfer descriptors (TDs) per urb
51 * @kobj: kobject for sysfs info 51 * @ep_dev: ep_device for sysfs info
52 * @extra: descriptors following this endpoint in the configuration 52 * @extra: descriptors following this endpoint in the configuration
53 * @extralen: how many bytes of "extra" are valid 53 * @extralen: how many bytes of "extra" are valid
54 * 54 *
@@ -103,8 +103,7 @@ enum usb_interface_condition {
103 * @condition: binding state of the interface: not bound, binding 103 * @condition: binding state of the interface: not bound, binding
104 * (in probe()), bound to a driver, or unbinding (in disconnect()) 104 * (in probe()), bound to a driver, or unbinding (in disconnect())
105 * @dev: driver model's view of this device 105 * @dev: driver model's view of this device
106 * @usb_dev: if an interface is bound to the USB major, this will point 106 * @class_dev: driver model's class view of this device.
107 * to the sysfs representation for that device.
108 * 107 *
109 * USB device drivers attach to interfaces on a physical device. Each 108 * USB device drivers attach to interfaces on a physical device. Each
110 * interface encapsulates a single high level function, such as feeding 109 * interface encapsulates a single high level function, such as feeding
@@ -144,7 +143,7 @@ struct usb_interface {
144 * bound to */ 143 * bound to */
145 enum usb_interface_condition condition; /* state of binding */ 144 enum usb_interface_condition condition; /* state of binding */
146 struct device dev; /* interface specific device info */ 145 struct device dev; /* interface specific device info */
147 struct device *usb_dev; /* pointer to the usb class's device, if any */ 146 struct class_device *class_dev;
148}; 147};
149#define to_usb_interface(d) container_of(d, struct usb_interface, dev) 148#define to_usb_interface(d) container_of(d, struct usb_interface, dev)
150#define interface_to_usbdev(intf) \ 149#define interface_to_usbdev(intf) \
@@ -361,7 +360,7 @@ struct usb_device {
361 char *serial; /* iSerialNumber string, if present */ 360 char *serial; /* iSerialNumber string, if present */
362 361
363 struct list_head filelist; 362 struct list_head filelist;
364 struct device *usbfs_dev; 363 struct class_device *class_dev;
365 struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */ 364 struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */
366 365
367 /* 366 /*
diff --git a/drivers/usb/serial/usb-serial.h b/include/linux/usb/serial.h
index 0f2802a60194..91c983eef899 100644
--- a/drivers/usb/serial/usb-serial.h
+++ b/include/linux/usb/serial.h
@@ -1,12 +1,12 @@
1/* 1/*
2 * USB Serial Converter driver 2 * USB Serial Converter stuff
3 * 3 *
4 * Copyright (C) 1999 - 2005 4 * Copyright (C) 1999 - 2005
5 * Greg Kroah-Hartman (greg@kroah.com) 5 * Greg Kroah-Hartman (greg@kroah.com)
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License. 9 * the Free Software Foundation; version 2 of the License.
10 * 10 *
11 */ 11 */
12 12
@@ -171,7 +171,7 @@ static inline void usb_set_serial_data (struct usb_serial *serial, void *data)
171 * but before the device has been fully initialized by the usb_serial 171 * but before the device has been fully initialized by the usb_serial
172 * subsystem. Use this function to download any firmware to the device, 172 * subsystem. Use this function to download any firmware to the device,
173 * or any other early initialization that might be needed. 173 * or any other early initialization that might be needed.
174 * Return 0 to continue on with the initialization sequence. Anything 174 * Return 0 to continue on with the initialization sequence. Anything
175 * else will abort it. 175 * else will abort it.
176 * @attach: pointer to the driver's attach function. 176 * @attach: pointer to the driver's attach function.
177 * This will be called when the struct usb_serial structure is fully set 177 * This will be called when the struct usb_serial structure is fully set
diff --git a/include/linux/usb_ch9.h b/include/linux/usb_ch9.h
index a2aacfc7af2f..c720d107ff29 100644
--- a/include/linux/usb_ch9.h
+++ b/include/linux/usb_ch9.h
@@ -51,6 +51,9 @@
51#define USB_RECIP_INTERFACE 0x01 51#define USB_RECIP_INTERFACE 0x01
52#define USB_RECIP_ENDPOINT 0x02 52#define USB_RECIP_ENDPOINT 0x02
53#define USB_RECIP_OTHER 0x03 53#define USB_RECIP_OTHER 0x03
54/* From Wireless USB 1.0 */
55#define USB_RECIP_PORT 0x04
56#define USB_RECIP_RPIPE 0x05
54 57
55/* 58/*
56 * Standard requests, for the bRequest field of a SETUP packet. 59 * Standard requests, for the bRequest field of a SETUP packet.
@@ -73,7 +76,9 @@
73 76
74#define USB_REQ_SET_ENCRYPTION 0x0D /* Wireless USB */ 77#define USB_REQ_SET_ENCRYPTION 0x0D /* Wireless USB */
75#define USB_REQ_GET_ENCRYPTION 0x0E 78#define USB_REQ_GET_ENCRYPTION 0x0E
79#define USB_REQ_RPIPE_ABORT 0x0E
76#define USB_REQ_SET_HANDSHAKE 0x0F 80#define USB_REQ_SET_HANDSHAKE 0x0F
81#define USB_REQ_RPIPE_RESET 0x0F
77#define USB_REQ_GET_HANDSHAKE 0x10 82#define USB_REQ_GET_HANDSHAKE 0x10
78#define USB_REQ_SET_CONNECTION 0x11 83#define USB_REQ_SET_CONNECTION 0x11
79#define USB_REQ_SET_SECURITY_DATA 0x12 84#define USB_REQ_SET_SECURITY_DATA 0x12
@@ -159,6 +164,8 @@ struct usb_ctrlrequest {
159#define USB_DT_BOS 0x0f 164#define USB_DT_BOS 0x0f
160#define USB_DT_DEVICE_CAPABILITY 0x10 165#define USB_DT_DEVICE_CAPABILITY 0x10
161#define USB_DT_WIRELESS_ENDPOINT_COMP 0x11 166#define USB_DT_WIRELESS_ENDPOINT_COMP 0x11
167#define USB_DT_WIRE_ADAPTER 0x21
168#define USB_DT_RPIPE 0x22
162 169
163/* conventional codes for class-specific descriptors */ 170/* conventional codes for class-specific descriptors */
164#define USB_DT_CS_DEVICE 0x21 171#define USB_DT_CS_DEVICE 0x21
diff --git a/include/linux/usb_gadget.h b/include/linux/usb_gadget.h
index 1d78870ed8af..e17186dbcdca 100644
--- a/include/linux/usb_gadget.h
+++ b/include/linux/usb_gadget.h
@@ -872,9 +872,9 @@ int usb_gadget_config_buf(const struct usb_config_descriptor *config,
872/* utility wrapping a simple endpoint selection policy */ 872/* utility wrapping a simple endpoint selection policy */
873 873
874extern struct usb_ep *usb_ep_autoconfig (struct usb_gadget *, 874extern struct usb_ep *usb_ep_autoconfig (struct usb_gadget *,
875 struct usb_endpoint_descriptor *) __init; 875 struct usb_endpoint_descriptor *) __devinit;
876 876
877extern void usb_ep_autoconfig_reset (struct usb_gadget *) __init; 877extern void usb_ep_autoconfig_reset (struct usb_gadget *) __devinit;
878 878
879#endif /* __KERNEL__ */ 879#endif /* __KERNEL__ */
880 880
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h
index 608487a62c98..e7fc5fed5b98 100644
--- a/include/linux/usb_usual.h
+++ b/include/linux/usb_usual.h
@@ -43,6 +43,10 @@
43 /* Need delay after Command phase */ \ 43 /* Need delay after Command phase */ \
44 US_FLAG(NO_WP_DETECT, 0x00000200) \ 44 US_FLAG(NO_WP_DETECT, 0x00000200) \
45 /* Don't check for write-protect */ \ 45 /* Don't check for write-protect */ \
46 US_FLAG(MAX_SECTORS_64, 0x00000400) \
47 /* Sets max_sectors to 64 */ \
48 US_FLAG(IGNORE_DEVICE, 0x00000800) \
49 /* Don't claim device */
46 50
47#define US_FLAG(name, value) US_FL_##name = value , 51#define US_FLAG(name, value) US_FL_##name = value ,
48enum { US_DO_ALL_FLAGS }; 52enum { US_DO_ALL_FLAGS };
diff --git a/include/linux/videodev.h b/include/linux/videodev.h
index 41bc7e9603cd..518c7a32175e 100644
--- a/include/linux/videodev.h
+++ b/include/linux/videodev.h
@@ -12,10 +12,11 @@
12#ifndef __LINUX_VIDEODEV_H 12#ifndef __LINUX_VIDEODEV_H
13#define __LINUX_VIDEODEV_H 13#define __LINUX_VIDEODEV_H
14 14
15#define HAVE_V4L1 1
16
17#include <linux/videodev2.h> 15#include <linux/videodev2.h>
18 16
17#ifdef CONFIG_VIDEO_V4L1_COMPAT
18#define HAVE_V4L1 1
19
19struct video_capability 20struct video_capability
20{ 21{
21 char name[32]; 22 char name[32];
@@ -336,6 +337,8 @@ struct video_code
336#define VID_HARDWARE_SN9C102 38 337#define VID_HARDWARE_SN9C102 38
337#define VID_HARDWARE_ARV 39 338#define VID_HARDWARE_ARV 39
338 339
340#endif /* CONFIG_VIDEO_V4L1_COMPAT */
341
339#endif /* __LINUX_VIDEODEV_H */ 342#endif /* __LINUX_VIDEODEV_H */
340 343
341/* 344/*
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index a62673dad76e..b7146956a929 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -716,7 +716,7 @@ struct v4l2_ext_control
716 __s64 value64; 716 __s64 value64;
717 void *reserved; 717 void *reserved;
718 }; 718 };
719}; 719} __attribute__ ((packed));
720 720
721struct v4l2_ext_controls 721struct v4l2_ext_controls
722{ 722{
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index f6024ab4eff0..71b6363caaaf 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -11,6 +11,7 @@ struct vm_area_struct;
11#define VM_ALLOC 0x00000002 /* vmalloc() */ 11#define VM_ALLOC 0x00000002 /* vmalloc() */
12#define VM_MAP 0x00000004 /* vmap()ed pages */ 12#define VM_MAP 0x00000004 /* vmap()ed pages */
13#define VM_USERMAP 0x00000008 /* suitable for remap_vmalloc_range */ 13#define VM_USERMAP 0x00000008 /* suitable for remap_vmalloc_range */
14#define VM_VPAGES 0x00000010 /* buffer for pages was vmalloc'ed */
14/* bits [20..32] reserved for arch specific ioremap internals */ 15/* bits [20..32] reserved for arch specific ioremap internals */
15 16
16/* 17/*
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
index 3e0daf54133e..1ab806c47514 100644
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -57,7 +57,7 @@ static inline void __count_vm_events(enum vm_event_item item, long delta)
57 57
58static inline void count_vm_events(enum vm_event_item item, long delta) 58static inline void count_vm_events(enum vm_event_item item, long delta)
59{ 59{
60 get_cpu_var(vm_event_states.event[item])++; 60 get_cpu_var(vm_event_states.event[item]) += delta;
61 put_cpu(); 61 put_cpu();
62} 62}
63 63
@@ -186,11 +186,16 @@ static inline void __mod_zone_page_state(struct zone *zone,
186 zone_page_state_add(delta, zone, item); 186 zone_page_state_add(delta, zone, item);
187} 187}
188 188
189static inline void __inc_zone_state(struct zone *zone, enum zone_stat_item item)
190{
191 atomic_long_inc(&zone->vm_stat[item]);
192 atomic_long_inc(&vm_stat[item]);
193}
194
189static inline void __inc_zone_page_state(struct page *page, 195static inline void __inc_zone_page_state(struct page *page,
190 enum zone_stat_item item) 196 enum zone_stat_item item)
191{ 197{
192 atomic_long_inc(&page_zone(page)->vm_stat[item]); 198 __inc_zone_state(page_zone(page), item);
193 atomic_long_inc(&vm_stat[item]);
194} 199}
195 200
196static inline void __dec_zone_page_state(struct page *page, 201static inline void __dec_zone_page_state(struct page *page,
diff --git a/include/linux/vt.h b/include/linux/vt.h
index 9f95b0bea5b3..8ab334a48222 100644
--- a/include/linux/vt.h
+++ b/include/linux/vt.h
@@ -1,6 +1,16 @@
1#ifndef _LINUX_VT_H 1#ifndef _LINUX_VT_H
2#define _LINUX_VT_H 2#define _LINUX_VT_H
3 3
4/*
5 * These constants are also useful for user-level apps (e.g., VC
6 * resizing).
7 */
8#define MIN_NR_CONSOLES 1 /* must be at least 1 */
9#define MAX_NR_CONSOLES 63 /* serial lines start at 64 */
10#define MAX_NR_USER_CONSOLES 63 /* must be root to allocate above this */
11 /* Note: the ioctl VT_GETSTATE does not work for
12 consoles 16 and higher (since it returns a short) */
13
4/* 0x56 is 'V', to avoid collision with termios and kd */ 14/* 0x56 is 'V', to avoid collision with termios and kd */
5 15
6#define VT_OPENQRY 0x5600 /* find available vt */ 16#define VT_OPENQRY 0x5600 /* find available vt */
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h
index 940d0261a545..918a29763aea 100644
--- a/include/linux/vt_kern.h
+++ b/include/linux/vt_kern.h
@@ -26,6 +26,7 @@
26 26
27extern void kd_mksound(unsigned int hz, unsigned int ticks); 27extern void kd_mksound(unsigned int hz, unsigned int ticks);
28extern int kbd_rate(struct kbd_repeat *rep); 28extern int kbd_rate(struct kbd_repeat *rep);
29extern int fg_console, last_console, want_console;
29 30
30/* console.c */ 31/* console.c */
31 32
diff --git a/include/linux/wait.h b/include/linux/wait.h
index 794be7af58ae..b3b9048421d8 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -77,17 +77,7 @@ struct task_struct;
77#define __WAIT_BIT_KEY_INITIALIZER(word, bit) \ 77#define __WAIT_BIT_KEY_INITIALIZER(word, bit) \
78 { .flags = word, .bit_nr = bit, } 78 { .flags = word, .bit_nr = bit, }
79 79
80/* 80extern void init_waitqueue_head(wait_queue_head_t *q);
81 * lockdep: we want one lock-class for all waitqueue locks.
82 */
83extern struct lock_class_key waitqueue_lock_key;
84
85static inline void init_waitqueue_head(wait_queue_head_t *q)
86{
87 spin_lock_init(&q->lock);
88 lockdep_set_class(&q->lock, &waitqueue_lock_key);
89 INIT_LIST_HEAD(&q->task_list);
90}
91 81
92static inline void init_waitqueue_entry(wait_queue_t *q, struct task_struct *p) 82static inline void init_waitqueue_entry(wait_queue_t *q, struct task_struct *p)
93{ 83{
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h
index 62dae1a8c441..f8665326ed9f 100644
--- a/include/media/v4l2-dev.h
+++ b/include/media/v4l2-dev.h
@@ -341,11 +341,14 @@ extern int video_usercopy(struct inode *inode, struct file *file,
341extern struct video_device* video_devdata(struct file*); 341extern struct video_device* video_devdata(struct file*);
342 342
343#define to_video_device(cd) container_of(cd, struct video_device, class_dev) 343#define to_video_device(cd) container_of(cd, struct video_device, class_dev)
344static inline void 344static inline int
345video_device_create_file(struct video_device *vfd, 345video_device_create_file(struct video_device *vfd,
346 struct class_device_attribute *attr) 346 struct class_device_attribute *attr)
347{ 347{
348 class_device_create_file(&vfd->class_dev, attr); 348 int ret = class_device_create_file(&vfd->class_dev, attr);
349 if (ret < 0)
350 printk(KERN_WARNING "%s error: %d\n", __FUNCTION__, ret);
351 return ret;
349} 352}
350static inline void 353static inline void
351video_device_remove_file(struct video_device *vfd, 354video_device_remove_file(struct video_device *vfd,
diff --git a/include/net/af_unix.h b/include/net/af_unix.h
index 2fec827c8801..c0398f5a8cb9 100644
--- a/include/net/af_unix.h
+++ b/include/net/af_unix.h
@@ -54,15 +54,13 @@ struct unix_skb_parms {
54 struct ucred creds; /* Skb credentials */ 54 struct ucred creds; /* Skb credentials */
55 struct scm_fp_list *fp; /* Passed files */ 55 struct scm_fp_list *fp; /* Passed files */
56#ifdef CONFIG_SECURITY_NETWORK 56#ifdef CONFIG_SECURITY_NETWORK
57 char *secdata; /* Security context */ 57 u32 secid; /* Security ID */
58 u32 seclen; /* Security length */
59#endif 58#endif
60}; 59};
61 60
62#define UNIXCB(skb) (*(struct unix_skb_parms*)&((skb)->cb)) 61#define UNIXCB(skb) (*(struct unix_skb_parms*)&((skb)->cb))
63#define UNIXCREDS(skb) (&UNIXCB((skb)).creds) 62#define UNIXCREDS(skb) (&UNIXCB((skb)).creds)
64#define UNIXSECDATA(skb) (&UNIXCB((skb)).secdata) 63#define UNIXSID(skb) (&UNIXCB((skb)).secid)
65#define UNIXSECLEN(skb) (&UNIXCB((skb)).seclen)
66 64
67#define unix_state_rlock(s) spin_lock(&unix_sk(s)->lock) 65#define unix_state_rlock(s) spin_lock(&unix_sk(s)->lock)
68#define unix_state_runlock(s) spin_unlock(&unix_sk(s)->lock) 66#define unix_state_runlock(s) spin_unlock(&unix_sk(s)->lock)
diff --git a/include/net/genetlink.h b/include/net/genetlink.h
index 805de50df00d..8c2287264266 100644
--- a/include/net/genetlink.h
+++ b/include/net/genetlink.h
@@ -150,4 +150,24 @@ static inline int genlmsg_unicast(struct sk_buff *skb, u32 pid)
150 return nlmsg_unicast(genl_sock, skb, pid); 150 return nlmsg_unicast(genl_sock, skb, pid);
151} 151}
152 152
153/**
154 * gennlmsg_data - head of message payload
155 * @gnlh: genetlink messsage header
156 */
157static inline void *genlmsg_data(const struct genlmsghdr *gnlh)
158{
159 return ((unsigned char *) gnlh + GENL_HDRLEN);
160}
161
162/**
163 * genlmsg_len - length of message payload
164 * @gnlh: genetlink message header
165 */
166static inline int genlmsg_len(const struct genlmsghdr *gnlh)
167{
168 struct nlmsghdr *nlh = (struct nlmsghdr *)((unsigned char *)gnlh -
169 NLMSG_HDRLEN);
170 return (nlh->nlmsg_len - GENL_HDRLEN - NLMSG_HDRLEN);
171}
172
153#endif /* __NET_GENERIC_NETLINK_H */ 173#endif /* __NET_GENERIC_NETLINK_H */
diff --git a/include/net/ieee80211softmac.h b/include/net/ieee80211softmac.h
index 7a483ab4022f..00ad810eb883 100644
--- a/include/net/ieee80211softmac.h
+++ b/include/net/ieee80211softmac.h
@@ -104,6 +104,7 @@ struct ieee80211softmac_assoc_info {
104 */ 104 */
105 u8 static_essid:1, 105 u8 static_essid:1,
106 associating:1, 106 associating:1,
107 assoc_wait:1,
107 bssvalid:1, 108 bssvalid:1,
108 bssfixed:1; 109 bssfixed:1;
109 110
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index ab29dafb1a6a..96b0e66406ec 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -139,16 +139,22 @@ extern rwlock_t rt6_lock;
139/* 139/*
140 * Store a destination cache entry in a socket 140 * Store a destination cache entry in a socket
141 */ 141 */
142static inline void ip6_dst_store(struct sock *sk, struct dst_entry *dst, 142static inline void __ip6_dst_store(struct sock *sk, struct dst_entry *dst,
143 struct in6_addr *daddr) 143 struct in6_addr *daddr)
144{ 144{
145 struct ipv6_pinfo *np = inet6_sk(sk); 145 struct ipv6_pinfo *np = inet6_sk(sk);
146 struct rt6_info *rt = (struct rt6_info *) dst; 146 struct rt6_info *rt = (struct rt6_info *) dst;
147 147
148 write_lock(&sk->sk_dst_lock);
149 sk_setup_caps(sk, dst); 148 sk_setup_caps(sk, dst);
150 np->daddr_cache = daddr; 149 np->daddr_cache = daddr;
151 np->dst_cookie = rt->rt6i_node ? rt->rt6i_node->fn_sernum : 0; 150 np->dst_cookie = rt->rt6i_node ? rt->rt6i_node->fn_sernum : 0;
151}
152
153static inline void ip6_dst_store(struct sock *sk, struct dst_entry *dst,
154 struct in6_addr *daddr)
155{
156 write_lock(&sk->sk_dst_lock);
157 __ip6_dst_store(sk, dst, daddr);
152 write_unlock(&sk->sk_dst_lock); 158 write_unlock(&sk->sk_dst_lock);
153} 159}
154 160
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index a8fdf7970b37..ece7e8a84ffd 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -468,6 +468,9 @@ extern void ip6_flush_pending_frames(struct sock *sk);
468extern int ip6_dst_lookup(struct sock *sk, 468extern int ip6_dst_lookup(struct sock *sk,
469 struct dst_entry **dst, 469 struct dst_entry **dst,
470 struct flowi *fl); 470 struct flowi *fl);
471extern int ip6_sk_dst_lookup(struct sock *sk,
472 struct dst_entry **dst,
473 struct flowi *fl);
471 474
472/* 475/*
473 * skb processing functions 476 * skb processing functions
diff --git a/include/net/netdma.h b/include/net/netdma.h
index 19760eb131aa..7f53cd1d8b1e 100644
--- a/include/net/netdma.h
+++ b/include/net/netdma.h
@@ -29,7 +29,7 @@ static inline struct dma_chan *get_softnet_dma(void)
29{ 29{
30 struct dma_chan *chan; 30 struct dma_chan *chan;
31 rcu_read_lock(); 31 rcu_read_lock();
32 chan = rcu_dereference(__get_cpu_var(softnet_data.net_dma)); 32 chan = rcu_dereference(__get_cpu_var(softnet_data).net_dma);
33 if (chan) 33 if (chan)
34 dma_chan_get(chan); 34 dma_chan_get(chan);
35 rcu_read_unlock(); 35 rcu_read_unlock();
@@ -37,7 +37,7 @@ static inline struct dma_chan *get_softnet_dma(void)
37} 37}
38 38
39int dma_skb_copy_datagram_iovec(struct dma_chan* chan, 39int dma_skb_copy_datagram_iovec(struct dma_chan* chan,
40 const struct sk_buff *skb, int offset, struct iovec *to, 40 struct sk_buff *skb, int offset, struct iovec *to,
41 size_t len, struct dma_pinned_list *pinned_list); 41 size_t len, struct dma_pinned_list *pinned_list);
42 42
43#endif /* CONFIG_NET_DMA */ 43#endif /* CONFIG_NET_DMA */
diff --git a/include/net/netevent.h b/include/net/netevent.h
new file mode 100644
index 000000000000..e5d216241423
--- /dev/null
+++ b/include/net/netevent.h
@@ -0,0 +1,33 @@
1#ifndef _NET_EVENT_H
2#define _NET_EVENT_H
3
4/*
5 * Generic netevent notifiers
6 *
7 * Authors:
8 * Tom Tucker <tom@opengridcomputing.com>
9 * Steve Wise <swise@opengridcomputing.com>
10 *
11 * Changes:
12 */
13#ifdef __KERNEL__
14
15#include <net/dst.h>
16
17struct netevent_redirect {
18 struct dst_entry *old;
19 struct dst_entry *new;
20};
21
22enum netevent_notif_type {
23 NETEVENT_NEIGH_UPDATE = 1, /* arg is struct neighbour ptr */
24 NETEVENT_PMTU_UPDATE, /* arg is struct dst_entry ptr */
25 NETEVENT_REDIRECT, /* arg is struct netevent_redirect ptr */
26};
27
28extern int register_netevent_notifier(struct notifier_block *nb);
29extern int unregister_netevent_notifier(struct notifier_block *nb);
30extern int call_netevent_notifiers(unsigned long val, void *v);
31
32#endif
33#endif
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 1925c65e617b..f6afee73235d 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -169,23 +169,17 @@ psched_tod_diff(int delta_sec, int bound)
169 169
170#define PSCHED_TADD2(tv, delta, tv_res) \ 170#define PSCHED_TADD2(tv, delta, tv_res) \
171({ \ 171({ \
172 int __delta = (delta); \ 172 int __delta = (tv).tv_usec + (delta); \
173 (tv_res) = (tv); \ 173 (tv_res).tv_sec = (tv).tv_sec; \
174 while(__delta >= USEC_PER_SEC){ \ 174 while (__delta >= USEC_PER_SEC) { (tv_res).tv_sec++; __delta -= USEC_PER_SEC; } \
175 (tv_res).tv_sec++; \
176 __delta -= USEC_PER_SEC; \
177 } \
178 (tv_res).tv_usec = __delta; \ 175 (tv_res).tv_usec = __delta; \
179}) 176})
180 177
181#define PSCHED_TADD(tv, delta) \ 178#define PSCHED_TADD(tv, delta) \
182({ \ 179({ \
183 int __delta = (delta); \ 180 (tv).tv_usec += (delta); \
184 while(__delta >= USEC_PER_SEC){ \ 181 while ((tv).tv_usec >= USEC_PER_SEC) { (tv).tv_sec++; \
185 (tv).tv_sec++; \ 182 (tv).tv_usec -= USEC_PER_SEC; } \
186 __delta -= USEC_PER_SEC; \
187 } \
188 (tv).tv_usec = __delta; \
189}) 183})
190 184
191/* Set/check that time is in the "past perfect"; 185/* Set/check that time is in the "past perfect";
diff --git a/include/net/protocol.h b/include/net/protocol.h
index a225d6371cb1..c643bce64e55 100644
--- a/include/net/protocol.h
+++ b/include/net/protocol.h
@@ -36,6 +36,7 @@
36struct net_protocol { 36struct net_protocol {
37 int (*handler)(struct sk_buff *skb); 37 int (*handler)(struct sk_buff *skb);
38 void (*err_handler)(struct sk_buff *skb, u32 info); 38 void (*err_handler)(struct sk_buff *skb, u32 info);
39 int (*gso_send_check)(struct sk_buff *skb);
39 struct sk_buff *(*gso_segment)(struct sk_buff *skb, 40 struct sk_buff *(*gso_segment)(struct sk_buff *skb,
40 int features); 41 int features);
41 int no_policy; 42 int no_policy;
@@ -51,6 +52,7 @@ struct inet6_protocol
51 int type, int code, int offset, 52 int type, int code, int offset,
52 __u32 info); 53 __u32 info);
53 54
55 int (*gso_send_check)(struct sk_buff *skb);
54 struct sk_buff *(*gso_segment)(struct sk_buff *skb, 56 struct sk_buff *(*gso_segment)(struct sk_buff *skb,
55 int features); 57 int features);
56 58
diff --git a/include/net/scm.h b/include/net/scm.h
index 02daa097cdcd..5637d5e22d5f 100644
--- a/include/net/scm.h
+++ b/include/net/scm.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/limits.h> 4#include <linux/limits.h>
5#include <linux/net.h> 5#include <linux/net.h>
6#include <linux/security.h>
6 7
7/* Well, we should have at least one descriptor open 8/* Well, we should have at least one descriptor open
8 * to accept passed FDs 8) 9 * to accept passed FDs 8)
@@ -20,8 +21,7 @@ struct scm_cookie
20 struct ucred creds; /* Skb credentials */ 21 struct ucred creds; /* Skb credentials */
21 struct scm_fp_list *fp; /* Passed files */ 22 struct scm_fp_list *fp; /* Passed files */
22#ifdef CONFIG_SECURITY_NETWORK 23#ifdef CONFIG_SECURITY_NETWORK
23 char *secdata; /* Security context */ 24 u32 secid; /* Passed security ID */
24 u32 seclen; /* Security length */
25#endif 25#endif
26 unsigned long seq; /* Connection seqno */ 26 unsigned long seq; /* Connection seqno */
27}; 27};
@@ -32,6 +32,16 @@ extern int __scm_send(struct socket *sock, struct msghdr *msg, struct scm_cookie
32extern void __scm_destroy(struct scm_cookie *scm); 32extern void __scm_destroy(struct scm_cookie *scm);
33extern struct scm_fp_list * scm_fp_dup(struct scm_fp_list *fpl); 33extern struct scm_fp_list * scm_fp_dup(struct scm_fp_list *fpl);
34 34
35#ifdef CONFIG_SECURITY_NETWORK
36static __inline__ void unix_get_peersec_dgram(struct socket *sock, struct scm_cookie *scm)
37{
38 security_socket_getpeersec_dgram(sock, NULL, &scm->secid);
39}
40#else
41static __inline__ void unix_get_peersec_dgram(struct socket *sock, struct scm_cookie *scm)
42{ }
43#endif /* CONFIG_SECURITY_NETWORK */
44
35static __inline__ void scm_destroy(struct scm_cookie *scm) 45static __inline__ void scm_destroy(struct scm_cookie *scm)
36{ 46{
37 if (scm && scm->fp) 47 if (scm && scm->fp)
@@ -47,6 +57,7 @@ static __inline__ int scm_send(struct socket *sock, struct msghdr *msg,
47 scm->creds.pid = p->tgid; 57 scm->creds.pid = p->tgid;
48 scm->fp = NULL; 58 scm->fp = NULL;
49 scm->seq = 0; 59 scm->seq = 0;
60 unix_get_peersec_dgram(sock, scm);
50 if (msg->msg_controllen <= 0) 61 if (msg->msg_controllen <= 0)
51 return 0; 62 return 0;
52 return __scm_send(sock, msg, scm); 63 return __scm_send(sock, msg, scm);
@@ -55,8 +66,18 @@ static __inline__ int scm_send(struct socket *sock, struct msghdr *msg,
55#ifdef CONFIG_SECURITY_NETWORK 66#ifdef CONFIG_SECURITY_NETWORK
56static inline void scm_passec(struct socket *sock, struct msghdr *msg, struct scm_cookie *scm) 67static inline void scm_passec(struct socket *sock, struct msghdr *msg, struct scm_cookie *scm)
57{ 68{
58 if (test_bit(SOCK_PASSSEC, &sock->flags) && scm->secdata != NULL) 69 char *secdata;
59 put_cmsg(msg, SOL_SOCKET, SCM_SECURITY, scm->seclen, scm->secdata); 70 u32 seclen;
71 int err;
72
73 if (test_bit(SOCK_PASSSEC, &sock->flags)) {
74 err = security_secid_to_secctx(scm->secid, &secdata, &seclen);
75
76 if (!err) {
77 put_cmsg(msg, SOL_SOCKET, SCM_SECURITY, seclen, secdata);
78 security_release_secctx(secdata, seclen);
79 }
80 }
60} 81}
61#else 82#else
62static inline void scm_passec(struct socket *sock, struct msghdr *msg, struct scm_cookie *scm) 83static inline void scm_passec(struct socket *sock, struct msghdr *msg, struct scm_cookie *scm)
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 5f69158c1006..e5aa7ff1f5b5 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -445,6 +445,7 @@ typedef struct sctp_sender_hb_info {
445 struct sctp_paramhdr param_hdr; 445 struct sctp_paramhdr param_hdr;
446 union sctp_addr daddr; 446 union sctp_addr daddr;
447 unsigned long sent_at; 447 unsigned long sent_at;
448 __u64 hb_nonce;
448} __attribute__((packed)) sctp_sender_hb_info_t; 449} __attribute__((packed)) sctp_sender_hb_info_t;
449 450
450/* 451/*
@@ -730,13 +731,10 @@ void sctp_init_addrs(struct sctp_chunk *, union sctp_addr *,
730const union sctp_addr *sctp_source(const struct sctp_chunk *chunk); 731const union sctp_addr *sctp_source(const struct sctp_chunk *chunk);
731 732
732/* This is a structure for holding either an IPv6 or an IPv4 address. */ 733/* This is a structure for holding either an IPv6 or an IPv4 address. */
733/* sin_family -- AF_INET or AF_INET6
734 * sin_port -- ordinary port number
735 * sin_addr -- cast to either (struct in_addr) or (struct in6_addr)
736 */
737struct sctp_sockaddr_entry { 734struct sctp_sockaddr_entry {
738 struct list_head list; 735 struct list_head list;
739 union sctp_addr a; 736 union sctp_addr a;
737 __u8 use_as_src;
740}; 738};
741 739
742typedef struct sctp_chunk *(sctp_packet_phandler_t)(struct sctp_association *); 740typedef struct sctp_chunk *(sctp_packet_phandler_t)(struct sctp_association *);
@@ -984,6 +982,9 @@ struct sctp_transport {
984 */ 982 */
985 char cacc_saw_newack; 983 char cacc_saw_newack;
986 } cacc; 984 } cacc;
985
986 /* 64-bit random number sent with heartbeat. */
987 __u64 hb_nonce;
987}; 988};
988 989
989struct sctp_transport *sctp_transport_new(const union sctp_addr *, 990struct sctp_transport *sctp_transport_new(const union sctp_addr *,
@@ -1138,7 +1139,7 @@ int sctp_bind_addr_copy(struct sctp_bind_addr *dest,
1138 sctp_scope_t scope, gfp_t gfp, 1139 sctp_scope_t scope, gfp_t gfp,
1139 int flags); 1140 int flags);
1140int sctp_add_bind_addr(struct sctp_bind_addr *, union sctp_addr *, 1141int sctp_add_bind_addr(struct sctp_bind_addr *, union sctp_addr *,
1141 gfp_t gfp); 1142 __u8 use_as_src, gfp_t gfp);
1142int sctp_del_bind_addr(struct sctp_bind_addr *, union sctp_addr *); 1143int sctp_del_bind_addr(struct sctp_bind_addr *, union sctp_addr *);
1143int sctp_bind_addr_match(struct sctp_bind_addr *, const union sctp_addr *, 1144int sctp_bind_addr_match(struct sctp_bind_addr *, const union sctp_addr *,
1144 struct sctp_sock *); 1145 struct sctp_sock *);
diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h
index 8a6bef6f91eb..1b7aae6cdd82 100644
--- a/include/net/sctp/user.h
+++ b/include/net/sctp/user.h
@@ -560,9 +560,18 @@ struct sctp_paddrinfo {
560} __attribute__((packed, aligned(4))); 560} __attribute__((packed, aligned(4)));
561 561
562/* Peer addresses's state. */ 562/* Peer addresses's state. */
563/* UNKNOWN: Peer address passed by the upper layer in sendmsg or connect[x]
564 * calls.
565 * UNCONFIRMED: Peer address received in INIT/INIT-ACK address parameters.
566 * Not yet confirmed by a heartbeat and not available for data
567 * transfers.
568 * ACTIVE : Peer address confirmed, active and available for data transfers.
569 * INACTIVE: Peer address inactive and not available for data transfers.
570 */
563enum sctp_spinfo_state { 571enum sctp_spinfo_state {
564 SCTP_INACTIVE, 572 SCTP_INACTIVE,
565 SCTP_ACTIVE, 573 SCTP_ACTIVE,
574 SCTP_UNCONFIRMED,
566 SCTP_UNKNOWN = 0xffff /* Value used for transport state unknown */ 575 SCTP_UNKNOWN = 0xffff /* Value used for transport state unknown */
567}; 576};
568 577
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 3cd803b0d7a5..7a093d0aa0fe 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -914,6 +914,9 @@ static inline void tcp_set_state(struct sock *sk, int state)
914 914
915static inline void tcp_done(struct sock *sk) 915static inline void tcp_done(struct sock *sk)
916{ 916{
917 if(sk->sk_state == TCP_SYN_SENT || sk->sk_state == TCP_SYN_RECV)
918 TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS);
919
917 tcp_set_state(sk, TCP_CLOSE); 920 tcp_set_state(sk, TCP_CLOSE);
918 tcp_clear_xmit_timers(sk); 921 tcp_clear_xmit_timers(sk);
919 922
@@ -1086,6 +1089,7 @@ extern struct request_sock_ops tcp_request_sock_ops;
1086 1089
1087extern int tcp_v4_destroy_sock(struct sock *sk); 1090extern int tcp_v4_destroy_sock(struct sock *sk);
1088 1091
1092extern int tcp_v4_gso_send_check(struct sk_buff *skb);
1089extern struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features); 1093extern struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features);
1090 1094
1091#ifdef CONFIG_PROC_FS 1095#ifdef CONFIG_PROC_FS
diff --git a/include/rdma/ib_addr.h b/include/rdma/ib_addr.h
index fcb5ba87dcc5..0ff67398928d 100644
--- a/include/rdma/ib_addr.h
+++ b/include/rdma/ib_addr.h
@@ -89,9 +89,10 @@ static inline void ib_addr_set_pkey(struct rdma_dev_addr *dev_addr, u16 pkey)
89 dev_addr->broadcast[9] = (unsigned char) pkey; 89 dev_addr->broadcast[9] = (unsigned char) pkey;
90} 90}
91 91
92static inline union ib_gid *ib_addr_get_sgid(struct rdma_dev_addr *dev_addr) 92static inline void ib_addr_get_sgid(struct rdma_dev_addr *dev_addr,
93 union ib_gid *gid)
93{ 94{
94 return (union ib_gid *) (dev_addr->src_dev_addr + 4); 95 memcpy(gid, dev_addr->src_dev_addr + 4, sizeof *gid);
95} 96}
96 97
97static inline void ib_addr_set_sgid(struct rdma_dev_addr *dev_addr, 98static inline void ib_addr_set_sgid(struct rdma_dev_addr *dev_addr,
@@ -100,9 +101,10 @@ static inline void ib_addr_set_sgid(struct rdma_dev_addr *dev_addr,
100 memcpy(dev_addr->src_dev_addr + 4, gid, sizeof *gid); 101 memcpy(dev_addr->src_dev_addr + 4, gid, sizeof *gid);
101} 102}
102 103
103static inline union ib_gid *ib_addr_get_dgid(struct rdma_dev_addr *dev_addr) 104static inline void ib_addr_get_dgid(struct rdma_dev_addr *dev_addr,
105 union ib_gid *gid)
104{ 106{
105 return (union ib_gid *) (dev_addr->dst_dev_addr + 4); 107 memcpy(gid, dev_addr->dst_dev_addr + 4, sizeof *gid);
106} 108}
107 109
108static inline void ib_addr_set_dgid(struct rdma_dev_addr *dev_addr, 110static inline void ib_addr_set_dgid(struct rdma_dev_addr *dev_addr,
diff --git a/include/rdma/ib_fmr_pool.h b/include/rdma/ib_fmr_pool.h
index 4ace54cd0cce..00dadbf94e1d 100644
--- a/include/rdma/ib_fmr_pool.h
+++ b/include/rdma/ib_fmr_pool.h
@@ -88,7 +88,7 @@ int ib_flush_fmr_pool(struct ib_fmr_pool *pool);
88struct ib_pool_fmr *ib_fmr_pool_map_phys(struct ib_fmr_pool *pool_handle, 88struct ib_pool_fmr *ib_fmr_pool_map_phys(struct ib_fmr_pool *pool_handle,
89 u64 *page_list, 89 u64 *page_list,
90 int list_len, 90 int list_len,
91 u64 *io_virtual_address); 91 u64 io_virtual_address);
92 92
93int ib_fmr_pool_unmap(struct ib_pool_fmr *fmr); 93int ib_fmr_pool_unmap(struct ib_pool_fmr *fmr);
94 94
diff --git a/include/rdma/ib_mad.h b/include/rdma/ib_mad.h
index 5ff77558013b..585d28e960dd 100644
--- a/include/rdma/ib_mad.h
+++ b/include/rdma/ib_mad.h
@@ -75,6 +75,7 @@
75#define IB_MGMT_METHOD_TRAP_REPRESS 0x07 75#define IB_MGMT_METHOD_TRAP_REPRESS 0x07
76 76
77#define IB_MGMT_METHOD_RESP 0x80 77#define IB_MGMT_METHOD_RESP 0x80
78#define IB_BM_ATTR_MOD_RESP cpu_to_be32(1)
78 79
79#define IB_MGMT_MAX_METHODS 128 80#define IB_MGMT_MAX_METHODS 128
80 81
@@ -247,6 +248,12 @@ struct ib_mad_send_buf {
247}; 248};
248 249
249/** 250/**
251 * ib_response_mad - Returns if the specified MAD has been generated in
252 * response to a sent request or trap.
253 */
254int ib_response_mad(struct ib_mad *mad);
255
256/**
250 * ib_get_rmpp_resptime - Returns the RMPP response time. 257 * ib_get_rmpp_resptime - Returns the RMPP response time.
251 * @rmpp_hdr: An RMPP header. 258 * @rmpp_hdr: An RMPP header.
252 */ 259 */
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
index 371f70d9aa92..58e6444eebee 100644
--- a/include/scsi/scsi_cmnd.h
+++ b/include/scsi/scsi_cmnd.h
@@ -58,9 +58,7 @@ struct scsi_cmnd {
58 int timeout_per_command; 58 int timeout_per_command;
59 59
60 unsigned char cmd_len; 60 unsigned char cmd_len;
61 unsigned char old_cmd_len;
62 enum dma_data_direction sc_data_direction; 61 enum dma_data_direction sc_data_direction;
63 enum dma_data_direction sc_old_data_direction;
64 62
65 /* These elements define the operation we are about to perform */ 63 /* These elements define the operation we are about to perform */
66#define MAX_COMMAND_SIZE 16 64#define MAX_COMMAND_SIZE 16
@@ -71,18 +69,11 @@ struct scsi_cmnd {
71 void *request_buffer; /* Actual requested buffer */ 69 void *request_buffer; /* Actual requested buffer */
72 70
73 /* These elements define the operation we ultimately want to perform */ 71 /* These elements define the operation we ultimately want to perform */
74 unsigned char data_cmnd[MAX_COMMAND_SIZE];
75 unsigned short old_use_sg; /* We save use_sg here when requesting
76 * sense info */
77 unsigned short use_sg; /* Number of pieces of scatter-gather */ 72 unsigned short use_sg; /* Number of pieces of scatter-gather */
78 unsigned short sglist_len; /* size of malloc'd scatter-gather list */ 73 unsigned short sglist_len; /* size of malloc'd scatter-gather list */
79 unsigned bufflen; /* Size of data buffer */
80 void *buffer; /* Data buffer */
81 74
82 unsigned underflow; /* Return error if less than 75 unsigned underflow; /* Return error if less than
83 this amount is transferred */ 76 this amount is transferred */
84 unsigned old_underflow; /* save underflow here when reusing the
85 * command for error handling */
86 77
87 unsigned transfersize; /* How much we are guaranteed to 78 unsigned transfersize; /* How much we are guaranteed to
88 transfer with each SCSI transfer 79 transfer with each SCSI transfer
diff --git a/include/scsi/scsi_transport_sas.h b/include/scsi/scsi_transport_sas.h
index e3c503cd175e..6cc2314098cf 100644
--- a/include/scsi/scsi_transport_sas.h
+++ b/include/scsi/scsi_transport_sas.h
@@ -106,6 +106,7 @@ struct sas_end_device {
106 106
107struct sas_expander_device { 107struct sas_expander_device {
108 int level; 108 int level;
109 int next_port_id;
109 110
110 #define SAS_EXPANDER_VENDOR_ID_LEN 8 111 #define SAS_EXPANDER_VENDOR_ID_LEN 8
111 char vendor_id[SAS_EXPANDER_VENDOR_ID_LEN+1]; 112 char vendor_id[SAS_EXPANDER_VENDOR_ID_LEN+1];
@@ -127,8 +128,10 @@ struct sas_expander_device {
127struct sas_port { 128struct sas_port {
128 struct device dev; 129 struct device dev;
129 130
130 u8 port_identifier; 131 int port_identifier;
131 int num_phys; 132 int num_phys;
133 /* port flags */
134 unsigned int is_backlink:1;
132 135
133 /* the other end of the link */ 136 /* the other end of the link */
134 struct sas_rphy *rphy; 137 struct sas_rphy *rphy;
@@ -168,11 +171,13 @@ extern void sas_rphy_delete(struct sas_rphy *);
168extern int scsi_is_sas_rphy(const struct device *); 171extern int scsi_is_sas_rphy(const struct device *);
169 172
170struct sas_port *sas_port_alloc(struct device *, int); 173struct sas_port *sas_port_alloc(struct device *, int);
174struct sas_port *sas_port_alloc_num(struct device *);
171int sas_port_add(struct sas_port *); 175int sas_port_add(struct sas_port *);
172void sas_port_free(struct sas_port *); 176void sas_port_free(struct sas_port *);
173void sas_port_delete(struct sas_port *); 177void sas_port_delete(struct sas_port *);
174void sas_port_add_phy(struct sas_port *, struct sas_phy *); 178void sas_port_add_phy(struct sas_port *, struct sas_phy *);
175void sas_port_delete_phy(struct sas_port *, struct sas_phy *); 179void sas_port_delete_phy(struct sas_port *, struct sas_phy *);
180void sas_port_mark_backlink(struct sas_port *);
176int scsi_is_sas_port(const struct device *); 181int scsi_is_sas_port(const struct device *);
177 182
178extern struct scsi_transport_template * 183extern struct scsi_transport_template *
diff --git a/include/sound/core.h b/include/sound/core.h
index 5d184be0ff72..bab3ff457e40 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -188,8 +188,6 @@ struct snd_minor {
188 int device; /* device number */ 188 int device; /* device number */
189 const struct file_operations *f_ops; /* file operations */ 189 const struct file_operations *f_ops; /* file operations */
190 void *private_data; /* private data for f_ops->open */ 190 void *private_data; /* private data for f_ops->open */
191 char name[0]; /* device name (keep at the end of
192 structure) */
193}; 191};
194 192
195/* sound.c */ 193/* sound.c */
diff --git a/include/sound/cs46xx.h b/include/sound/cs46xx.h
index 80b2979c0cba..685928e6f65a 100644
--- a/include/sound/cs46xx.h
+++ b/include/sound/cs46xx.h
@@ -1704,6 +1704,7 @@ struct snd_cs46xx {
1704 int acpi_port; 1704 int acpi_port;
1705 struct snd_kcontrol *eapd_switch; /* for amplifier hack */ 1705 struct snd_kcontrol *eapd_switch; /* for amplifier hack */
1706 int accept_valid; /* accept mmap valid (for OSS) */ 1706 int accept_valid; /* accept mmap valid (for OSS) */
1707 int in_suspend;
1707 1708
1708 struct gameport *gameport; 1709 struct gameport *gameport;
1709 1710
diff --git a/include/video/mbxfb.h b/include/video/mbxfb.h
new file mode 100644
index 000000000000..3bde0f5cd55c
--- /dev/null
+++ b/include/video/mbxfb.h
@@ -0,0 +1,28 @@
1#ifndef __MBX_FB_H
2#define __MBX_FB_H
3
4struct mbxfb_val {
5 unsigned int defval;
6 unsigned int min;
7 unsigned int max;
8};
9
10struct fb_info;
11
12struct mbxfb_platform_data {
13 /* Screen info */
14 struct mbxfb_val xres;
15 struct mbxfb_val yres;
16 struct mbxfb_val bpp;
17
18 /* Memory info */
19 unsigned long memsize; /* if 0 use ODFB? */
20 unsigned long timings1;
21 unsigned long timings2;
22 unsigned long timings3;
23
24 int (*probe)(struct fb_info *fb);
25 int (*remove)(struct fb_info *fb);
26};
27
28#endif /* __MBX_FB_H */
diff --git a/init/Kconfig b/init/Kconfig
index a5b073a103e7..a099fc6526d9 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -158,6 +158,30 @@ config BSD_PROCESS_ACCT_V3
158 for processing it. A preliminary version of these tools is available 158 for processing it. A preliminary version of these tools is available
159 at <http://www.physik3.uni-rostock.de/tim/kernel/utils/acct/>. 159 at <http://www.physik3.uni-rostock.de/tim/kernel/utils/acct/>.
160 160
161config TASKSTATS
162 bool "Export task/process statistics through netlink (EXPERIMENTAL)"
163 depends on NET
164 default n
165 help
166 Export selected statistics for tasks/processes through the
167 generic netlink interface. Unlike BSD process accounting, the
168 statistics are available during the lifetime of tasks/processes as
169 responses to commands. Like BSD accounting, they are sent to user
170 space on task exit.
171
172 Say N if unsure.
173
174config TASK_DELAY_ACCT
175 bool "Enable per-task delay accounting (EXPERIMENTAL)"
176 depends on TASKSTATS
177 help
178 Collect information on time spent by a task waiting for system
179 resources like cpu, synchronous block I/O completion and swapping
180 in pages. Such statistics can help in setting a task's priorities
181 relative to other tasks for cpu, io, rss limits etc.
182
183 Say N if unsure.
184
161config SYSCTL 185config SYSCTL
162 bool "Sysctl support" if EMBEDDED 186 bool "Sysctl support" if EMBEDDED
163 default y 187 default y
diff --git a/init/main.c b/init/main.c
index 628b8e9e841a..8651a720a092 100644
--- a/init/main.c
+++ b/init/main.c
@@ -41,6 +41,8 @@
41#include <linux/cpu.h> 41#include <linux/cpu.h>
42#include <linux/cpuset.h> 42#include <linux/cpuset.h>
43#include <linux/efi.h> 43#include <linux/efi.h>
44#include <linux/taskstats_kern.h>
45#include <linux/delayacct.h>
44#include <linux/unistd.h> 46#include <linux/unistd.h>
45#include <linux/rmap.h> 47#include <linux/rmap.h>
46#include <linux/mempolicy.h> 48#include <linux/mempolicy.h>
@@ -574,6 +576,8 @@ asmlinkage void __init start_kernel(void)
574 proc_root_init(); 576 proc_root_init();
575#endif 577#endif
576 cpuset_init(); 578 cpuset_init();
579 taskstats_init_early();
580 delayacct_init();
577 581
578 check_bugs(); 582 check_bugs();
579 583
diff --git a/ipc/msg.c b/ipc/msg.c
index cd92d342953e..2b4fccf8ea55 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * linux/ipc/msg.c 2 * linux/ipc/msg.c
3 * Copyright (C) 1992 Krishna Balasubramanian 3 * Copyright (C) 1992 Krishna Balasubramanian
4 * 4 *
5 * Removed all the remaining kerneld mess 5 * Removed all the remaining kerneld mess
6 * Catch the -EFAULT stuff properly 6 * Catch the -EFAULT stuff properly
@@ -41,22 +41,24 @@ int msg_ctlmax = MSGMAX;
41int msg_ctlmnb = MSGMNB; 41int msg_ctlmnb = MSGMNB;
42int msg_ctlmni = MSGMNI; 42int msg_ctlmni = MSGMNI;
43 43
44/* one msg_receiver structure for each sleeping receiver */ 44/*
45 * one msg_receiver structure for each sleeping receiver:
46 */
45struct msg_receiver { 47struct msg_receiver {
46 struct list_head r_list; 48 struct list_head r_list;
47 struct task_struct* r_tsk; 49 struct task_struct *r_tsk;
48 50
49 int r_mode; 51 int r_mode;
50 long r_msgtype; 52 long r_msgtype;
51 long r_maxsize; 53 long r_maxsize;
52 54
53 struct msg_msg* volatile r_msg; 55 volatile struct msg_msg *r_msg;
54}; 56};
55 57
56/* one msg_sender for each sleeping sender */ 58/* one msg_sender for each sleeping sender */
57struct msg_sender { 59struct msg_sender {
58 struct list_head list; 60 struct list_head list;
59 struct task_struct* tsk; 61 struct task_struct *tsk;
60}; 62};
61 63
62#define SEARCH_ANY 1 64#define SEARCH_ANY 1
@@ -64,45 +66,42 @@ struct msg_sender {
64#define SEARCH_NOTEQUAL 3 66#define SEARCH_NOTEQUAL 3
65#define SEARCH_LESSEQUAL 4 67#define SEARCH_LESSEQUAL 4
66 68
67static atomic_t msg_bytes = ATOMIC_INIT(0); 69static atomic_t msg_bytes = ATOMIC_INIT(0);
68static atomic_t msg_hdrs = ATOMIC_INIT(0); 70static atomic_t msg_hdrs = ATOMIC_INIT(0);
69 71
70static struct ipc_ids msg_ids; 72static struct ipc_ids msg_ids;
71 73
72#define msg_lock(id) ((struct msg_queue*)ipc_lock(&msg_ids,id)) 74#define msg_lock(id) ((struct msg_queue *)ipc_lock(&msg_ids, id))
73#define msg_unlock(msq) ipc_unlock(&(msq)->q_perm) 75#define msg_unlock(msq) ipc_unlock(&(msq)->q_perm)
74#define msg_rmid(id) ((struct msg_queue*)ipc_rmid(&msg_ids,id)) 76#define msg_rmid(id) ((struct msg_queue *)ipc_rmid(&msg_ids, id))
75#define msg_checkid(msq, msgid) \ 77#define msg_checkid(msq, msgid) ipc_checkid(&msg_ids, &msq->q_perm, msgid)
76 ipc_checkid(&msg_ids,&msq->q_perm,msgid) 78#define msg_buildid(id, seq) ipc_buildid(&msg_ids, id, seq)
77#define msg_buildid(id, seq) \
78 ipc_buildid(&msg_ids, id, seq)
79 79
80static void freeque (struct msg_queue *msq, int id); 80static void freeque(struct msg_queue *msq, int id);
81static int newque (key_t key, int msgflg); 81static int newque(key_t key, int msgflg);
82#ifdef CONFIG_PROC_FS 82#ifdef CONFIG_PROC_FS
83static int sysvipc_msg_proc_show(struct seq_file *s, void *it); 83static int sysvipc_msg_proc_show(struct seq_file *s, void *it);
84#endif 84#endif
85 85
86void __init msg_init (void) 86void __init msg_init(void)
87{ 87{
88 ipc_init_ids(&msg_ids,msg_ctlmni); 88 ipc_init_ids(&msg_ids, msg_ctlmni);
89 ipc_init_proc_interface("sysvipc/msg", 89 ipc_init_proc_interface("sysvipc/msg",
90 " key msqid perms cbytes qnum lspid lrpid uid gid cuid cgid stime rtime ctime\n", 90 " key msqid perms cbytes qnum lspid lrpid uid gid cuid cgid stime rtime ctime\n",
91 &msg_ids, 91 &msg_ids,
92 sysvipc_msg_proc_show); 92 sysvipc_msg_proc_show);
93} 93}
94 94
95static int newque (key_t key, int msgflg) 95static int newque(key_t key, int msgflg)
96{ 96{
97 int id;
98 int retval;
99 struct msg_queue *msq; 97 struct msg_queue *msq;
98 int id, retval;
100 99
101 msq = ipc_rcu_alloc(sizeof(*msq)); 100 msq = ipc_rcu_alloc(sizeof(*msq));
102 if (!msq) 101 if (!msq)
103 return -ENOMEM; 102 return -ENOMEM;
104 103
105 msq->q_perm.mode = (msgflg & S_IRWXUGO); 104 msq->q_perm.mode = msgflg & S_IRWXUGO;
106 msq->q_perm.key = key; 105 msq->q_perm.key = key;
107 106
108 msq->q_perm.security = NULL; 107 msq->q_perm.security = NULL;
@@ -113,13 +112,13 @@ static int newque (key_t key, int msgflg)
113 } 112 }
114 113
115 id = ipc_addid(&msg_ids, &msq->q_perm, msg_ctlmni); 114 id = ipc_addid(&msg_ids, &msq->q_perm, msg_ctlmni);
116 if(id == -1) { 115 if (id == -1) {
117 security_msg_queue_free(msq); 116 security_msg_queue_free(msq);
118 ipc_rcu_putref(msq); 117 ipc_rcu_putref(msq);
119 return -ENOSPC; 118 return -ENOSPC;
120 } 119 }
121 120
122 msq->q_id = msg_buildid(id,msq->q_perm.seq); 121 msq->q_id = msg_buildid(id, msq->q_perm.seq);
123 msq->q_stime = msq->q_rtime = 0; 122 msq->q_stime = msq->q_rtime = 0;
124 msq->q_ctime = get_seconds(); 123 msq->q_ctime = get_seconds();
125 msq->q_cbytes = msq->q_qnum = 0; 124 msq->q_cbytes = msq->q_qnum = 0;
@@ -133,44 +132,44 @@ static int newque (key_t key, int msgflg)
133 return msq->q_id; 132 return msq->q_id;
134} 133}
135 134
136static inline void ss_add(struct msg_queue* msq, struct msg_sender* mss) 135static inline void ss_add(struct msg_queue *msq, struct msg_sender *mss)
137{ 136{
138 mss->tsk=current; 137 mss->tsk = current;
139 current->state=TASK_INTERRUPTIBLE; 138 current->state = TASK_INTERRUPTIBLE;
140 list_add_tail(&mss->list,&msq->q_senders); 139 list_add_tail(&mss->list, &msq->q_senders);
141} 140}
142 141
143static inline void ss_del(struct msg_sender* mss) 142static inline void ss_del(struct msg_sender *mss)
144{ 143{
145 if(mss->list.next != NULL) 144 if (mss->list.next != NULL)
146 list_del(&mss->list); 145 list_del(&mss->list);
147} 146}
148 147
149static void ss_wakeup(struct list_head* h, int kill) 148static void ss_wakeup(struct list_head *h, int kill)
150{ 149{
151 struct list_head *tmp; 150 struct list_head *tmp;
152 151
153 tmp = h->next; 152 tmp = h->next;
154 while (tmp != h) { 153 while (tmp != h) {
155 struct msg_sender* mss; 154 struct msg_sender *mss;
156 155
157 mss = list_entry(tmp,struct msg_sender,list); 156 mss = list_entry(tmp, struct msg_sender, list);
158 tmp = tmp->next; 157 tmp = tmp->next;
159 if(kill) 158 if (kill)
160 mss->list.next=NULL; 159 mss->list.next = NULL;
161 wake_up_process(mss->tsk); 160 wake_up_process(mss->tsk);
162 } 161 }
163} 162}
164 163
165static void expunge_all(struct msg_queue* msq, int res) 164static void expunge_all(struct msg_queue *msq, int res)
166{ 165{
167 struct list_head *tmp; 166 struct list_head *tmp;
168 167
169 tmp = msq->q_receivers.next; 168 tmp = msq->q_receivers.next;
170 while (tmp != &msq->q_receivers) { 169 while (tmp != &msq->q_receivers) {
171 struct msg_receiver* msr; 170 struct msg_receiver *msr;
172 171
173 msr = list_entry(tmp,struct msg_receiver,r_list); 172 msr = list_entry(tmp, struct msg_receiver, r_list);
174 tmp = tmp->next; 173 tmp = tmp->next;
175 msr->r_msg = NULL; 174 msr->r_msg = NULL;
176 wake_up_process(msr->r_tsk); 175 wake_up_process(msr->r_tsk);
@@ -178,26 +177,28 @@ static void expunge_all(struct msg_queue* msq, int res)
178 msr->r_msg = ERR_PTR(res); 177 msr->r_msg = ERR_PTR(res);
179 } 178 }
180} 179}
181/* 180
182 * freeque() wakes up waiters on the sender and receiver waiting queue, 181/*
183 * removes the message queue from message queue ID 182 * freeque() wakes up waiters on the sender and receiver waiting queue,
183 * removes the message queue from message queue ID
184 * array, and cleans up all the messages associated with this queue. 184 * array, and cleans up all the messages associated with this queue.
185 * 185 *
186 * msg_ids.mutex and the spinlock for this message queue is hold 186 * msg_ids.mutex and the spinlock for this message queue is hold
187 * before freeque() is called. msg_ids.mutex remains locked on exit. 187 * before freeque() is called. msg_ids.mutex remains locked on exit.
188 */ 188 */
189static void freeque (struct msg_queue *msq, int id) 189static void freeque(struct msg_queue *msq, int id)
190{ 190{
191 struct list_head *tmp; 191 struct list_head *tmp;
192 192
193 expunge_all(msq,-EIDRM); 193 expunge_all(msq, -EIDRM);
194 ss_wakeup(&msq->q_senders,1); 194 ss_wakeup(&msq->q_senders, 1);
195 msq = msg_rmid(id); 195 msq = msg_rmid(id);
196 msg_unlock(msq); 196 msg_unlock(msq);
197 197
198 tmp = msq->q_messages.next; 198 tmp = msq->q_messages.next;
199 while(tmp != &msq->q_messages) { 199 while (tmp != &msq->q_messages) {
200 struct msg_msg* msg = list_entry(tmp,struct msg_msg,m_list); 200 struct msg_msg *msg = list_entry(tmp, struct msg_msg, m_list);
201
201 tmp = tmp->next; 202 tmp = tmp->next;
202 atomic_dec(&msg_hdrs); 203 atomic_dec(&msg_hdrs);
203 free_msg(msg); 204 free_msg(msg);
@@ -207,10 +208,10 @@ static void freeque (struct msg_queue *msq, int id)
207 ipc_rcu_putref(msq); 208 ipc_rcu_putref(msq);
208} 209}
209 210
210asmlinkage long sys_msgget (key_t key, int msgflg) 211asmlinkage long sys_msgget(key_t key, int msgflg)
211{ 212{
212 int id, ret = -EPERM;
213 struct msg_queue *msq; 213 struct msg_queue *msq;
214 int id, ret = -EPERM;
214 215
215 mutex_lock(&msg_ids.mutex); 216 mutex_lock(&msg_ids.mutex);
216 if (key == IPC_PRIVATE) 217 if (key == IPC_PRIVATE)
@@ -224,31 +225,34 @@ asmlinkage long sys_msgget (key_t key, int msgflg)
224 ret = -EEXIST; 225 ret = -EEXIST;
225 } else { 226 } else {
226 msq = msg_lock(id); 227 msq = msg_lock(id);
227 BUG_ON(msq==NULL); 228 BUG_ON(msq == NULL);
228 if (ipcperms(&msq->q_perm, msgflg)) 229 if (ipcperms(&msq->q_perm, msgflg))
229 ret = -EACCES; 230 ret = -EACCES;
230 else { 231 else {
231 int qid = msg_buildid(id, msq->q_perm.seq); 232 int qid = msg_buildid(id, msq->q_perm.seq);
232 ret = security_msg_queue_associate(msq, msgflg); 233
234 ret = security_msg_queue_associate(msq, msgflg);
233 if (!ret) 235 if (!ret)
234 ret = qid; 236 ret = qid;
235 } 237 }
236 msg_unlock(msq); 238 msg_unlock(msq);
237 } 239 }
238 mutex_unlock(&msg_ids.mutex); 240 mutex_unlock(&msg_ids.mutex);
241
239 return ret; 242 return ret;
240} 243}
241 244
242static inline unsigned long copy_msqid_to_user(void __user *buf, struct msqid64_ds *in, int version) 245static inline unsigned long
246copy_msqid_to_user(void __user *buf, struct msqid64_ds *in, int version)
243{ 247{
244 switch(version) { 248 switch(version) {
245 case IPC_64: 249 case IPC_64:
246 return copy_to_user (buf, in, sizeof(*in)); 250 return copy_to_user(buf, in, sizeof(*in));
247 case IPC_OLD: 251 case IPC_OLD:
248 { 252 {
249 struct msqid_ds out; 253 struct msqid_ds out;
250 254
251 memset(&out,0,sizeof(out)); 255 memset(&out, 0, sizeof(out));
252 256
253 ipc64_perm_to_ipc_perm(&in->msg_perm, &out.msg_perm); 257 ipc64_perm_to_ipc_perm(&in->msg_perm, &out.msg_perm);
254 258
@@ -256,18 +260,18 @@ static inline unsigned long copy_msqid_to_user(void __user *buf, struct msqid64_
256 out.msg_rtime = in->msg_rtime; 260 out.msg_rtime = in->msg_rtime;
257 out.msg_ctime = in->msg_ctime; 261 out.msg_ctime = in->msg_ctime;
258 262
259 if(in->msg_cbytes > USHRT_MAX) 263 if (in->msg_cbytes > USHRT_MAX)
260 out.msg_cbytes = USHRT_MAX; 264 out.msg_cbytes = USHRT_MAX;
261 else 265 else
262 out.msg_cbytes = in->msg_cbytes; 266 out.msg_cbytes = in->msg_cbytes;
263 out.msg_lcbytes = in->msg_cbytes; 267 out.msg_lcbytes = in->msg_cbytes;
264 268
265 if(in->msg_qnum > USHRT_MAX) 269 if (in->msg_qnum > USHRT_MAX)
266 out.msg_qnum = USHRT_MAX; 270 out.msg_qnum = USHRT_MAX;
267 else 271 else
268 out.msg_qnum = in->msg_qnum; 272 out.msg_qnum = in->msg_qnum;
269 273
270 if(in->msg_qbytes > USHRT_MAX) 274 if (in->msg_qbytes > USHRT_MAX)
271 out.msg_qbytes = USHRT_MAX; 275 out.msg_qbytes = USHRT_MAX;
272 else 276 else
273 out.msg_qbytes = in->msg_qbytes; 277 out.msg_qbytes = in->msg_qbytes;
@@ -276,8 +280,8 @@ static inline unsigned long copy_msqid_to_user(void __user *buf, struct msqid64_
276 out.msg_lspid = in->msg_lspid; 280 out.msg_lspid = in->msg_lspid;
277 out.msg_lrpid = in->msg_lrpid; 281 out.msg_lrpid = in->msg_lrpid;
278 282
279 return copy_to_user (buf, &out, sizeof(out)); 283 return copy_to_user(buf, &out, sizeof(out));
280 } 284 }
281 default: 285 default:
282 return -EINVAL; 286 return -EINVAL;
283 } 287 }
@@ -290,14 +294,15 @@ struct msq_setbuf {
290 mode_t mode; 294 mode_t mode;
291}; 295};
292 296
293static inline unsigned long copy_msqid_from_user(struct msq_setbuf *out, void __user *buf, int version) 297static inline unsigned long
298copy_msqid_from_user(struct msq_setbuf *out, void __user *buf, int version)
294{ 299{
295 switch(version) { 300 switch(version) {
296 case IPC_64: 301 case IPC_64:
297 { 302 {
298 struct msqid64_ds tbuf; 303 struct msqid64_ds tbuf;
299 304
300 if (copy_from_user (&tbuf, buf, sizeof (tbuf))) 305 if (copy_from_user(&tbuf, buf, sizeof(tbuf)))
301 return -EFAULT; 306 return -EFAULT;
302 307
303 out->qbytes = tbuf.msg_qbytes; 308 out->qbytes = tbuf.msg_qbytes;
@@ -306,60 +311,61 @@ static inline unsigned long copy_msqid_from_user(struct msq_setbuf *out, void __
306 out->mode = tbuf.msg_perm.mode; 311 out->mode = tbuf.msg_perm.mode;
307 312
308 return 0; 313 return 0;
309 } 314 }
310 case IPC_OLD: 315 case IPC_OLD:
311 { 316 {
312 struct msqid_ds tbuf_old; 317 struct msqid_ds tbuf_old;
313 318
314 if (copy_from_user (&tbuf_old, buf, sizeof (tbuf_old))) 319 if (copy_from_user(&tbuf_old, buf, sizeof(tbuf_old)))
315 return -EFAULT; 320 return -EFAULT;
316 321
317 out->uid = tbuf_old.msg_perm.uid; 322 out->uid = tbuf_old.msg_perm.uid;
318 out->gid = tbuf_old.msg_perm.gid; 323 out->gid = tbuf_old.msg_perm.gid;
319 out->mode = tbuf_old.msg_perm.mode; 324 out->mode = tbuf_old.msg_perm.mode;
320 325
321 if(tbuf_old.msg_qbytes == 0) 326 if (tbuf_old.msg_qbytes == 0)
322 out->qbytes = tbuf_old.msg_lqbytes; 327 out->qbytes = tbuf_old.msg_lqbytes;
323 else 328 else
324 out->qbytes = tbuf_old.msg_qbytes; 329 out->qbytes = tbuf_old.msg_qbytes;
325 330
326 return 0; 331 return 0;
327 } 332 }
328 default: 333 default:
329 return -EINVAL; 334 return -EINVAL;
330 } 335 }
331} 336}
332 337
333asmlinkage long sys_msgctl (int msqid, int cmd, struct msqid_ds __user *buf) 338asmlinkage long sys_msgctl(int msqid, int cmd, struct msqid_ds __user *buf)
334{ 339{
335 int err, version;
336 struct msg_queue *msq;
337 struct msq_setbuf setbuf;
338 struct kern_ipc_perm *ipcp; 340 struct kern_ipc_perm *ipcp;
339 341 struct msq_setbuf setbuf;
342 struct msg_queue *msq;
343 int err, version;
344
340 if (msqid < 0 || cmd < 0) 345 if (msqid < 0 || cmd < 0)
341 return -EINVAL; 346 return -EINVAL;
342 347
343 version = ipc_parse_version(&cmd); 348 version = ipc_parse_version(&cmd);
344 349
345 switch (cmd) { 350 switch (cmd) {
346 case IPC_INFO: 351 case IPC_INFO:
347 case MSG_INFO: 352 case MSG_INFO:
348 { 353 {
349 struct msginfo msginfo; 354 struct msginfo msginfo;
350 int max_id; 355 int max_id;
356
351 if (!buf) 357 if (!buf)
352 return -EFAULT; 358 return -EFAULT;
353 /* We must not return kernel stack data. 359 /*
360 * We must not return kernel stack data.
354 * due to padding, it's not enough 361 * due to padding, it's not enough
355 * to set all member fields. 362 * to set all member fields.
356 */ 363 */
357
358 err = security_msg_queue_msgctl(NULL, cmd); 364 err = security_msg_queue_msgctl(NULL, cmd);
359 if (err) 365 if (err)
360 return err; 366 return err;
361 367
362 memset(&msginfo,0,sizeof(msginfo)); 368 memset(&msginfo, 0, sizeof(msginfo));
363 msginfo.msgmni = msg_ctlmni; 369 msginfo.msgmni = msg_ctlmni;
364 msginfo.msgmax = msg_ctlmax; 370 msginfo.msgmax = msg_ctlmax;
365 msginfo.msgmnb = msg_ctlmnb; 371 msginfo.msgmnb = msg_ctlmnb;
@@ -377,36 +383,37 @@ asmlinkage long sys_msgctl (int msqid, int cmd, struct msqid_ds __user *buf)
377 } 383 }
378 max_id = msg_ids.max_id; 384 max_id = msg_ids.max_id;
379 mutex_unlock(&msg_ids.mutex); 385 mutex_unlock(&msg_ids.mutex);
380 if (copy_to_user (buf, &msginfo, sizeof(struct msginfo))) 386 if (copy_to_user(buf, &msginfo, sizeof(struct msginfo)))
381 return -EFAULT; 387 return -EFAULT;
382 return (max_id < 0) ? 0: max_id; 388 return (max_id < 0) ? 0 : max_id;
383 } 389 }
384 case MSG_STAT: 390 case MSG_STAT:
385 case IPC_STAT: 391 case IPC_STAT:
386 { 392 {
387 struct msqid64_ds tbuf; 393 struct msqid64_ds tbuf;
388 int success_return; 394 int success_return;
395
389 if (!buf) 396 if (!buf)
390 return -EFAULT; 397 return -EFAULT;
391 if(cmd == MSG_STAT && msqid >= msg_ids.entries->size) 398 if (cmd == MSG_STAT && msqid >= msg_ids.entries->size)
392 return -EINVAL; 399 return -EINVAL;
393 400
394 memset(&tbuf,0,sizeof(tbuf)); 401 memset(&tbuf, 0, sizeof(tbuf));
395 402
396 msq = msg_lock(msqid); 403 msq = msg_lock(msqid);
397 if (msq == NULL) 404 if (msq == NULL)
398 return -EINVAL; 405 return -EINVAL;
399 406
400 if(cmd == MSG_STAT) { 407 if (cmd == MSG_STAT) {
401 success_return = msg_buildid(msqid, msq->q_perm.seq); 408 success_return = msg_buildid(msqid, msq->q_perm.seq);
402 } else { 409 } else {
403 err = -EIDRM; 410 err = -EIDRM;
404 if (msg_checkid(msq,msqid)) 411 if (msg_checkid(msq, msqid))
405 goto out_unlock; 412 goto out_unlock;
406 success_return = 0; 413 success_return = 0;
407 } 414 }
408 err = -EACCES; 415 err = -EACCES;
409 if (ipcperms (&msq->q_perm, S_IRUGO)) 416 if (ipcperms(&msq->q_perm, S_IRUGO))
410 goto out_unlock; 417 goto out_unlock;
411 418
412 err = security_msg_queue_msgctl(msq, cmd); 419 err = security_msg_queue_msgctl(msq, cmd);
@@ -430,7 +437,7 @@ asmlinkage long sys_msgctl (int msqid, int cmd, struct msqid_ds __user *buf)
430 case IPC_SET: 437 case IPC_SET:
431 if (!buf) 438 if (!buf)
432 return -EFAULT; 439 return -EFAULT;
433 if (copy_msqid_from_user (&setbuf, buf, version)) 440 if (copy_msqid_from_user(&setbuf, buf, version))
434 return -EFAULT; 441 return -EFAULT;
435 break; 442 break;
436 case IPC_RMID: 443 case IPC_RMID:
@@ -441,12 +448,12 @@ asmlinkage long sys_msgctl (int msqid, int cmd, struct msqid_ds __user *buf)
441 448
442 mutex_lock(&msg_ids.mutex); 449 mutex_lock(&msg_ids.mutex);
443 msq = msg_lock(msqid); 450 msq = msg_lock(msqid);
444 err=-EINVAL; 451 err = -EINVAL;
445 if (msq == NULL) 452 if (msq == NULL)
446 goto out_up; 453 goto out_up;
447 454
448 err = -EIDRM; 455 err = -EIDRM;
449 if (msg_checkid(msq,msqid)) 456 if (msg_checkid(msq, msqid))
450 goto out_unlock_up; 457 goto out_unlock_up;
451 ipcp = &msq->q_perm; 458 ipcp = &msq->q_perm;
452 459
@@ -454,15 +461,16 @@ asmlinkage long sys_msgctl (int msqid, int cmd, struct msqid_ds __user *buf)
454 if (err) 461 if (err)
455 goto out_unlock_up; 462 goto out_unlock_up;
456 if (cmd==IPC_SET) { 463 if (cmd==IPC_SET) {
457 err = audit_ipc_set_perm(setbuf.qbytes, setbuf.uid, setbuf.gid, setbuf.mode); 464 err = audit_ipc_set_perm(setbuf.qbytes, setbuf.uid, setbuf.gid,
465 setbuf.mode);
458 if (err) 466 if (err)
459 goto out_unlock_up; 467 goto out_unlock_up;
460 } 468 }
461 469
462 err = -EPERM; 470 err = -EPERM;
463 if (current->euid != ipcp->cuid && 471 if (current->euid != ipcp->cuid &&
464 current->euid != ipcp->uid && !capable(CAP_SYS_ADMIN)) 472 current->euid != ipcp->uid && !capable(CAP_SYS_ADMIN))
465 /* We _could_ check for CAP_CHOWN above, but we don't */ 473 /* We _could_ check for CAP_CHOWN above, but we don't */
466 goto out_unlock_up; 474 goto out_unlock_up;
467 475
468 err = security_msg_queue_msgctl(msq, cmd); 476 err = security_msg_queue_msgctl(msq, cmd);
@@ -480,22 +488,22 @@ asmlinkage long sys_msgctl (int msqid, int cmd, struct msqid_ds __user *buf)
480 488
481 ipcp->uid = setbuf.uid; 489 ipcp->uid = setbuf.uid;
482 ipcp->gid = setbuf.gid; 490 ipcp->gid = setbuf.gid;
483 ipcp->mode = (ipcp->mode & ~S_IRWXUGO) | 491 ipcp->mode = (ipcp->mode & ~S_IRWXUGO) |
484 (S_IRWXUGO & setbuf.mode); 492 (S_IRWXUGO & setbuf.mode);
485 msq->q_ctime = get_seconds(); 493 msq->q_ctime = get_seconds();
486 /* sleeping receivers might be excluded by 494 /* sleeping receivers might be excluded by
487 * stricter permissions. 495 * stricter permissions.
488 */ 496 */
489 expunge_all(msq,-EAGAIN); 497 expunge_all(msq, -EAGAIN);
490 /* sleeping senders might be able to send 498 /* sleeping senders might be able to send
491 * due to a larger queue size. 499 * due to a larger queue size.
492 */ 500 */
493 ss_wakeup(&msq->q_senders,0); 501 ss_wakeup(&msq->q_senders, 0);
494 msg_unlock(msq); 502 msg_unlock(msq);
495 break; 503 break;
496 } 504 }
497 case IPC_RMID: 505 case IPC_RMID:
498 freeque (msq, msqid); 506 freeque(msq, msqid);
499 break; 507 break;
500 } 508 }
501 err = 0; 509 err = 0;
@@ -510,41 +518,44 @@ out_unlock:
510 return err; 518 return err;
511} 519}
512 520
513static int testmsg(struct msg_msg* msg,long type,int mode) 521static int testmsg(struct msg_msg *msg, long type, int mode)
514{ 522{
515 switch(mode) 523 switch(mode)
516 { 524 {
517 case SEARCH_ANY: 525 case SEARCH_ANY:
518 return 1; 526 return 1;
519 case SEARCH_LESSEQUAL: 527 case SEARCH_LESSEQUAL:
520 if(msg->m_type <=type) 528 if (msg->m_type <=type)
521 return 1; 529 return 1;
522 break; 530 break;
523 case SEARCH_EQUAL: 531 case SEARCH_EQUAL:
524 if(msg->m_type == type) 532 if (msg->m_type == type)
525 return 1; 533 return 1;
526 break; 534 break;
527 case SEARCH_NOTEQUAL: 535 case SEARCH_NOTEQUAL:
528 if(msg->m_type != type) 536 if (msg->m_type != type)
529 return 1; 537 return 1;
530 break; 538 break;
531 } 539 }
532 return 0; 540 return 0;
533} 541}
534 542
535static inline int pipelined_send(struct msg_queue* msq, struct msg_msg* msg) 543static inline int pipelined_send(struct msg_queue *msq, struct msg_msg *msg)
536{ 544{
537 struct list_head* tmp; 545 struct list_head *tmp;
538 546
539 tmp = msq->q_receivers.next; 547 tmp = msq->q_receivers.next;
540 while (tmp != &msq->q_receivers) { 548 while (tmp != &msq->q_receivers) {
541 struct msg_receiver* msr; 549 struct msg_receiver *msr;
542 msr = list_entry(tmp,struct msg_receiver,r_list); 550
551 msr = list_entry(tmp, struct msg_receiver, r_list);
543 tmp = tmp->next; 552 tmp = tmp->next;
544 if(testmsg(msg,msr->r_msgtype,msr->r_mode) && 553 if (testmsg(msg, msr->r_msgtype, msr->r_mode) &&
545 !security_msg_queue_msgrcv(msq, msg, msr->r_tsk, msr->r_msgtype, msr->r_mode)) { 554 !security_msg_queue_msgrcv(msq, msg, msr->r_tsk,
555 msr->r_msgtype, msr->r_mode)) {
556
546 list_del(&msr->r_list); 557 list_del(&msr->r_list);
547 if(msr->r_maxsize < msg->m_ts) { 558 if (msr->r_maxsize < msg->m_ts) {
548 msr->r_msg = NULL; 559 msr->r_msg = NULL;
549 wake_up_process(msr->r_tsk); 560 wake_up_process(msr->r_tsk);
550 smp_mb(); 561 smp_mb();
@@ -556,6 +567,7 @@ static inline int pipelined_send(struct msg_queue* msq, struct msg_msg* msg)
556 wake_up_process(msr->r_tsk); 567 wake_up_process(msr->r_tsk);
557 smp_mb(); 568 smp_mb();
558 msr->r_msg = msg; 569 msr->r_msg = msg;
570
559 return 1; 571 return 1;
560 } 572 }
561 } 573 }
@@ -563,40 +575,41 @@ static inline int pipelined_send(struct msg_queue* msq, struct msg_msg* msg)
563 return 0; 575 return 0;
564} 576}
565 577
566asmlinkage long sys_msgsnd (int msqid, struct msgbuf __user *msgp, size_t msgsz, int msgflg) 578asmlinkage long
579sys_msgsnd(int msqid, struct msgbuf __user *msgp, size_t msgsz, int msgflg)
567{ 580{
568 struct msg_queue *msq; 581 struct msg_queue *msq;
569 struct msg_msg *msg; 582 struct msg_msg *msg;
570 long mtype; 583 long mtype;
571 int err; 584 int err;
572 585
573 if (msgsz > msg_ctlmax || (long) msgsz < 0 || msqid < 0) 586 if (msgsz > msg_ctlmax || (long) msgsz < 0 || msqid < 0)
574 return -EINVAL; 587 return -EINVAL;
575 if (get_user(mtype, &msgp->mtype)) 588 if (get_user(mtype, &msgp->mtype))
576 return -EFAULT; 589 return -EFAULT;
577 if (mtype < 1) 590 if (mtype < 1)
578 return -EINVAL; 591 return -EINVAL;
579 592
580 msg = load_msg(msgp->mtext, msgsz); 593 msg = load_msg(msgp->mtext, msgsz);
581 if(IS_ERR(msg)) 594 if (IS_ERR(msg))
582 return PTR_ERR(msg); 595 return PTR_ERR(msg);
583 596
584 msg->m_type = mtype; 597 msg->m_type = mtype;
585 msg->m_ts = msgsz; 598 msg->m_ts = msgsz;
586 599
587 msq = msg_lock(msqid); 600 msq = msg_lock(msqid);
588 err=-EINVAL; 601 err = -EINVAL;
589 if(msq==NULL) 602 if (msq == NULL)
590 goto out_free; 603 goto out_free;
591 604
592 err= -EIDRM; 605 err= -EIDRM;
593 if (msg_checkid(msq,msqid)) 606 if (msg_checkid(msq, msqid))
594 goto out_unlock_free; 607 goto out_unlock_free;
595 608
596 for (;;) { 609 for (;;) {
597 struct msg_sender s; 610 struct msg_sender s;
598 611
599 err=-EACCES; 612 err = -EACCES;
600 if (ipcperms(&msq->q_perm, S_IWUGO)) 613 if (ipcperms(&msq->q_perm, S_IWUGO))
601 goto out_unlock_free; 614 goto out_unlock_free;
602 615
@@ -604,14 +617,14 @@ asmlinkage long sys_msgsnd (int msqid, struct msgbuf __user *msgp, size_t msgsz,
604 if (err) 617 if (err)
605 goto out_unlock_free; 618 goto out_unlock_free;
606 619
607 if(msgsz + msq->q_cbytes <= msq->q_qbytes && 620 if (msgsz + msq->q_cbytes <= msq->q_qbytes &&
608 1 + msq->q_qnum <= msq->q_qbytes) { 621 1 + msq->q_qnum <= msq->q_qbytes) {
609 break; 622 break;
610 } 623 }
611 624
612 /* queue full, wait: */ 625 /* queue full, wait: */
613 if(msgflg&IPC_NOWAIT) { 626 if (msgflg & IPC_NOWAIT) {
614 err=-EAGAIN; 627 err = -EAGAIN;
615 goto out_unlock_free; 628 goto out_unlock_free;
616 } 629 }
617 ss_add(msq, &s); 630 ss_add(msq, &s);
@@ -626,9 +639,9 @@ asmlinkage long sys_msgsnd (int msqid, struct msgbuf __user *msgp, size_t msgsz,
626 goto out_unlock_free; 639 goto out_unlock_free;
627 } 640 }
628 ss_del(&s); 641 ss_del(&s);
629 642
630 if (signal_pending(current)) { 643 if (signal_pending(current)) {
631 err=-ERESTARTNOHAND; 644 err = -ERESTARTNOHAND;
632 goto out_unlock_free; 645 goto out_unlock_free;
633 } 646 }
634 } 647 }
@@ -636,47 +649,47 @@ asmlinkage long sys_msgsnd (int msqid, struct msgbuf __user *msgp, size_t msgsz,
636 msq->q_lspid = current->tgid; 649 msq->q_lspid = current->tgid;
637 msq->q_stime = get_seconds(); 650 msq->q_stime = get_seconds();
638 651
639 if(!pipelined_send(msq,msg)) { 652 if (!pipelined_send(msq, msg)) {
640 /* noone is waiting for this message, enqueue it */ 653 /* noone is waiting for this message, enqueue it */
641 list_add_tail(&msg->m_list,&msq->q_messages); 654 list_add_tail(&msg->m_list, &msq->q_messages);
642 msq->q_cbytes += msgsz; 655 msq->q_cbytes += msgsz;
643 msq->q_qnum++; 656 msq->q_qnum++;
644 atomic_add(msgsz,&msg_bytes); 657 atomic_add(msgsz, &msg_bytes);
645 atomic_inc(&msg_hdrs); 658 atomic_inc(&msg_hdrs);
646 } 659 }
647 660
648 err = 0; 661 err = 0;
649 msg = NULL; 662 msg = NULL;
650 663
651out_unlock_free: 664out_unlock_free:
652 msg_unlock(msq); 665 msg_unlock(msq);
653out_free: 666out_free:
654 if(msg!=NULL) 667 if (msg != NULL)
655 free_msg(msg); 668 free_msg(msg);
656 return err; 669 return err;
657} 670}
658 671
659static inline int convert_mode(long* msgtyp, int msgflg) 672static inline int convert_mode(long *msgtyp, int msgflg)
660{ 673{
661 /* 674 /*
662 * find message of correct type. 675 * find message of correct type.
663 * msgtyp = 0 => get first. 676 * msgtyp = 0 => get first.
664 * msgtyp > 0 => get first message of matching type. 677 * msgtyp > 0 => get first message of matching type.
665 * msgtyp < 0 => get message with least type must be < abs(msgtype). 678 * msgtyp < 0 => get message with least type must be < abs(msgtype).
666 */ 679 */
667 if(*msgtyp==0) 680 if (*msgtyp == 0)
668 return SEARCH_ANY; 681 return SEARCH_ANY;
669 if(*msgtyp<0) { 682 if (*msgtyp < 0) {
670 *msgtyp=-(*msgtyp); 683 *msgtyp = -*msgtyp;
671 return SEARCH_LESSEQUAL; 684 return SEARCH_LESSEQUAL;
672 } 685 }
673 if(msgflg & MSG_EXCEPT) 686 if (msgflg & MSG_EXCEPT)
674 return SEARCH_NOTEQUAL; 687 return SEARCH_NOTEQUAL;
675 return SEARCH_EQUAL; 688 return SEARCH_EQUAL;
676} 689}
677 690
678asmlinkage long sys_msgrcv (int msqid, struct msgbuf __user *msgp, size_t msgsz, 691asmlinkage long sys_msgrcv(int msqid, struct msgbuf __user *msgp, size_t msgsz,
679 long msgtyp, int msgflg) 692 long msgtyp, int msgflg)
680{ 693{
681 struct msg_queue *msq; 694 struct msg_queue *msq;
682 struct msg_msg *msg; 695 struct msg_msg *msg;
@@ -684,44 +697,51 @@ asmlinkage long sys_msgrcv (int msqid, struct msgbuf __user *msgp, size_t msgsz,
684 697
685 if (msqid < 0 || (long) msgsz < 0) 698 if (msqid < 0 || (long) msgsz < 0)
686 return -EINVAL; 699 return -EINVAL;
687 mode = convert_mode(&msgtyp,msgflg); 700 mode = convert_mode(&msgtyp, msgflg);
688 701
689 msq = msg_lock(msqid); 702 msq = msg_lock(msqid);
690 if(msq==NULL) 703 if (msq == NULL)
691 return -EINVAL; 704 return -EINVAL;
692 705
693 msg = ERR_PTR(-EIDRM); 706 msg = ERR_PTR(-EIDRM);
694 if (msg_checkid(msq,msqid)) 707 if (msg_checkid(msq, msqid))
695 goto out_unlock; 708 goto out_unlock;
696 709
697 for (;;) { 710 for (;;) {
698 struct msg_receiver msr_d; 711 struct msg_receiver msr_d;
699 struct list_head* tmp; 712 struct list_head *tmp;
700 713
701 msg = ERR_PTR(-EACCES); 714 msg = ERR_PTR(-EACCES);
702 if (ipcperms (&msq->q_perm, S_IRUGO)) 715 if (ipcperms(&msq->q_perm, S_IRUGO))
703 goto out_unlock; 716 goto out_unlock;
704 717
705 msg = ERR_PTR(-EAGAIN); 718 msg = ERR_PTR(-EAGAIN);
706 tmp = msq->q_messages.next; 719 tmp = msq->q_messages.next;
707 while (tmp != &msq->q_messages) { 720 while (tmp != &msq->q_messages) {
708 struct msg_msg *walk_msg; 721 struct msg_msg *walk_msg;
709 walk_msg = list_entry(tmp,struct msg_msg,m_list); 722
710 if(testmsg(walk_msg,msgtyp,mode) && 723 walk_msg = list_entry(tmp, struct msg_msg, m_list);
711 !security_msg_queue_msgrcv(msq, walk_msg, current, msgtyp, mode)) { 724 if (testmsg(walk_msg, msgtyp, mode) &&
725 !security_msg_queue_msgrcv(msq, walk_msg, current,
726 msgtyp, mode)) {
727
712 msg = walk_msg; 728 msg = walk_msg;
713 if(mode == SEARCH_LESSEQUAL && walk_msg->m_type != 1) { 729 if (mode == SEARCH_LESSEQUAL &&
714 msg=walk_msg; 730 walk_msg->m_type != 1) {
715 msgtyp=walk_msg->m_type-1; 731 msg = walk_msg;
732 msgtyp = walk_msg->m_type - 1;
716 } else { 733 } else {
717 msg=walk_msg; 734 msg = walk_msg;
718 break; 735 break;
719 } 736 }
720 } 737 }
721 tmp = tmp->next; 738 tmp = tmp->next;
722 } 739 }
723 if(!IS_ERR(msg)) { 740 if (!IS_ERR(msg)) {
724 /* Found a suitable message. Unlink it from the queue. */ 741 /*
742 * Found a suitable message.
743 * Unlink it from the queue.
744 */
725 if ((msgsz < msg->m_ts) && !(msgflg & MSG_NOERROR)) { 745 if ((msgsz < msg->m_ts) && !(msgflg & MSG_NOERROR)) {
726 msg = ERR_PTR(-E2BIG); 746 msg = ERR_PTR(-E2BIG);
727 goto out_unlock; 747 goto out_unlock;
@@ -731,9 +751,9 @@ asmlinkage long sys_msgrcv (int msqid, struct msgbuf __user *msgp, size_t msgsz,
731 msq->q_rtime = get_seconds(); 751 msq->q_rtime = get_seconds();
732 msq->q_lrpid = current->tgid; 752 msq->q_lrpid = current->tgid;
733 msq->q_cbytes -= msg->m_ts; 753 msq->q_cbytes -= msg->m_ts;
734 atomic_sub(msg->m_ts,&msg_bytes); 754 atomic_sub(msg->m_ts, &msg_bytes);
735 atomic_dec(&msg_hdrs); 755 atomic_dec(&msg_hdrs);
736 ss_wakeup(&msq->q_senders,0); 756 ss_wakeup(&msq->q_senders, 0);
737 msg_unlock(msq); 757 msg_unlock(msq);
738 break; 758 break;
739 } 759 }
@@ -742,13 +762,13 @@ asmlinkage long sys_msgrcv (int msqid, struct msgbuf __user *msgp, size_t msgsz,
742 msg = ERR_PTR(-ENOMSG); 762 msg = ERR_PTR(-ENOMSG);
743 goto out_unlock; 763 goto out_unlock;
744 } 764 }
745 list_add_tail(&msr_d.r_list,&msq->q_receivers); 765 list_add_tail(&msr_d.r_list, &msq->q_receivers);
746 msr_d.r_tsk = current; 766 msr_d.r_tsk = current;
747 msr_d.r_msgtype = msgtyp; 767 msr_d.r_msgtype = msgtyp;
748 msr_d.r_mode = mode; 768 msr_d.r_mode = mode;
749 if(msgflg & MSG_NOERROR) 769 if (msgflg & MSG_NOERROR)
750 msr_d.r_maxsize = INT_MAX; 770 msr_d.r_maxsize = INT_MAX;
751 else 771 else
752 msr_d.r_maxsize = msgsz; 772 msr_d.r_maxsize = msgsz;
753 msr_d.r_msg = ERR_PTR(-EAGAIN); 773 msr_d.r_msg = ERR_PTR(-EAGAIN);
754 current->state = TASK_INTERRUPTIBLE; 774 current->state = TASK_INTERRUPTIBLE;
@@ -773,17 +793,17 @@ asmlinkage long sys_msgrcv (int msqid, struct msgbuf __user *msgp, size_t msgsz,
773 * wake_up_process(). There is a race with exit(), see 793 * wake_up_process(). There is a race with exit(), see
774 * ipc/mqueue.c for the details. 794 * ipc/mqueue.c for the details.
775 */ 795 */
776 msg = (struct msg_msg*) msr_d.r_msg; 796 msg = (struct msg_msg*)msr_d.r_msg;
777 while (msg == NULL) { 797 while (msg == NULL) {
778 cpu_relax(); 798 cpu_relax();
779 msg = (struct msg_msg*) msr_d.r_msg; 799 msg = (struct msg_msg *)msr_d.r_msg;
780 } 800 }
781 801
782 /* Lockless receive, part 3: 802 /* Lockless receive, part 3:
783 * If there is a message or an error then accept it without 803 * If there is a message or an error then accept it without
784 * locking. 804 * locking.
785 */ 805 */
786 if(msg != ERR_PTR(-EAGAIN)) { 806 if (msg != ERR_PTR(-EAGAIN)) {
787 rcu_read_unlock(); 807 rcu_read_unlock();
788 break; 808 break;
789 } 809 }
@@ -798,7 +818,7 @@ asmlinkage long sys_msgrcv (int msqid, struct msgbuf __user *msgp, size_t msgsz,
798 * Repeat test after acquiring the spinlock. 818 * Repeat test after acquiring the spinlock.
799 */ 819 */
800 msg = (struct msg_msg*)msr_d.r_msg; 820 msg = (struct msg_msg*)msr_d.r_msg;
801 if(msg != ERR_PTR(-EAGAIN)) 821 if (msg != ERR_PTR(-EAGAIN))
802 goto out_unlock; 822 goto out_unlock;
803 823
804 list_del(&msr_d.r_list); 824 list_del(&msr_d.r_list);
@@ -810,14 +830,15 @@ out_unlock:
810 } 830 }
811 } 831 }
812 if (IS_ERR(msg)) 832 if (IS_ERR(msg))
813 return PTR_ERR(msg); 833 return PTR_ERR(msg);
814 834
815 msgsz = (msgsz > msg->m_ts) ? msg->m_ts : msgsz; 835 msgsz = (msgsz > msg->m_ts) ? msg->m_ts : msgsz;
816 if (put_user (msg->m_type, &msgp->mtype) || 836 if (put_user (msg->m_type, &msgp->mtype) ||
817 store_msg(msgp->mtext, msg, msgsz)) { 837 store_msg(msgp->mtext, msg, msgsz)) {
818 msgsz = -EFAULT; 838 msgsz = -EFAULT;
819 } 839 }
820 free_msg(msg); 840 free_msg(msg);
841
821 return msgsz; 842 return msgsz;
822} 843}
823 844
@@ -827,20 +848,20 @@ static int sysvipc_msg_proc_show(struct seq_file *s, void *it)
827 struct msg_queue *msq = it; 848 struct msg_queue *msq = it;
828 849
829 return seq_printf(s, 850 return seq_printf(s,
830 "%10d %10d %4o %10lu %10lu %5u %5u %5u %5u %5u %5u %10lu %10lu %10lu\n", 851 "%10d %10d %4o %10lu %10lu %5u %5u %5u %5u %5u %5u %10lu %10lu %10lu\n",
831 msq->q_perm.key, 852 msq->q_perm.key,
832 msq->q_id, 853 msq->q_id,
833 msq->q_perm.mode, 854 msq->q_perm.mode,
834 msq->q_cbytes, 855 msq->q_cbytes,
835 msq->q_qnum, 856 msq->q_qnum,
836 msq->q_lspid, 857 msq->q_lspid,
837 msq->q_lrpid, 858 msq->q_lrpid,
838 msq->q_perm.uid, 859 msq->q_perm.uid,
839 msq->q_perm.gid, 860 msq->q_perm.gid,
840 msq->q_perm.cuid, 861 msq->q_perm.cuid,
841 msq->q_perm.cgid, 862 msq->q_perm.cgid,
842 msq->q_stime, 863 msq->q_stime,
843 msq->q_rtime, 864 msq->q_rtime,
844 msq->q_ctime); 865 msq->q_ctime);
845} 866}
846#endif 867#endif
diff --git a/kernel/Makefile b/kernel/Makefile
index 47dbcd570cd8..d62ec66c1af2 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -48,6 +48,8 @@ obj-$(CONFIG_GENERIC_HARDIRQS) += irq/
48obj-$(CONFIG_SECCOMP) += seccomp.o 48obj-$(CONFIG_SECCOMP) += seccomp.o
49obj-$(CONFIG_RCU_TORTURE_TEST) += rcutorture.o 49obj-$(CONFIG_RCU_TORTURE_TEST) += rcutorture.o
50obj-$(CONFIG_RELAY) += relay.o 50obj-$(CONFIG_RELAY) += relay.o
51obj-$(CONFIG_TASK_DELAY_ACCT) += delayacct.o
52obj-$(CONFIG_TASKSTATS) += taskstats.o
51 53
52ifneq ($(CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER),y) 54ifneq ($(CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER),y)
53# According to Alan Modra <alan@linuxcare.com.au>, the -fno-omit-frame-pointer is 55# According to Alan Modra <alan@linuxcare.com.au>, the -fno-omit-frame-pointer is
diff --git a/kernel/acct.c b/kernel/acct.c
index f18e0b8df3e1..2a7c933651c7 100644
--- a/kernel/acct.c
+++ b/kernel/acct.c
@@ -488,7 +488,7 @@ static void do_acct_process(struct file *file)
488 old_encode_dev(tty_devnum(current->signal->tty)) : 0; 488 old_encode_dev(tty_devnum(current->signal->tty)) : 0;
489 read_unlock(&tasklist_lock); 489 read_unlock(&tasklist_lock);
490 490
491 spin_lock(&current->sighand->siglock); 491 spin_lock_irq(&current->sighand->siglock);
492 ac.ac_utime = encode_comp_t(jiffies_to_AHZ(cputime_to_jiffies(pacct->ac_utime))); 492 ac.ac_utime = encode_comp_t(jiffies_to_AHZ(cputime_to_jiffies(pacct->ac_utime)));
493 ac.ac_stime = encode_comp_t(jiffies_to_AHZ(cputime_to_jiffies(pacct->ac_stime))); 493 ac.ac_stime = encode_comp_t(jiffies_to_AHZ(cputime_to_jiffies(pacct->ac_stime)));
494 ac.ac_flag = pacct->ac_flag; 494 ac.ac_flag = pacct->ac_flag;
@@ -496,7 +496,7 @@ static void do_acct_process(struct file *file)
496 ac.ac_minflt = encode_comp_t(pacct->ac_minflt); 496 ac.ac_minflt = encode_comp_t(pacct->ac_minflt);
497 ac.ac_majflt = encode_comp_t(pacct->ac_majflt); 497 ac.ac_majflt = encode_comp_t(pacct->ac_majflt);
498 ac.ac_exitcode = pacct->ac_exitcode; 498 ac.ac_exitcode = pacct->ac_exitcode;
499 spin_unlock(&current->sighand->siglock); 499 spin_unlock_irq(&current->sighand->siglock);
500 ac.ac_io = encode_comp_t(0 /* current->io_usage */); /* %% */ 500 ac.ac_io = encode_comp_t(0 /* current->io_usage */); /* %% */
501 ac.ac_rw = encode_comp_t(ac.ac_io / 1024); 501 ac.ac_rw = encode_comp_t(ac.ac_io / 1024);
502 ac.ac_swaps = encode_comp_t(0); 502 ac.ac_swaps = encode_comp_t(0);
diff --git a/kernel/audit.c b/kernel/audit.c
index d417ca1db79b..0a36091ed712 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -690,9 +690,7 @@ static const struct inotify_operations audit_inotify_ops = {
690/* Initialize audit support at boot time. */ 690/* Initialize audit support at boot time. */
691static int __init audit_init(void) 691static int __init audit_init(void)
692{ 692{
693#ifdef CONFIG_AUDITSYSCALL
694 int i; 693 int i;
695#endif
696 694
697 printk(KERN_INFO "audit: initializing netlink socket (%s)\n", 695 printk(KERN_INFO "audit: initializing netlink socket (%s)\n",
698 audit_default ? "enabled" : "disabled"); 696 audit_default ? "enabled" : "disabled");
@@ -717,10 +715,10 @@ static int __init audit_init(void)
717 audit_ih = inotify_init(&audit_inotify_ops); 715 audit_ih = inotify_init(&audit_inotify_ops);
718 if (IS_ERR(audit_ih)) 716 if (IS_ERR(audit_ih))
719 audit_panic("cannot initialize inotify handle"); 717 audit_panic("cannot initialize inotify handle");
718#endif
720 719
721 for (i = 0; i < AUDIT_INODE_BUCKETS; i++) 720 for (i = 0; i < AUDIT_INODE_BUCKETS; i++)
722 INIT_LIST_HEAD(&audit_inode_hash[i]); 721 INIT_LIST_HEAD(&audit_inode_hash[i]);
723#endif
724 722
725 return 0; 723 return 0;
726} 724}
diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c
index 5b4e16276ca0..6a9a5c5a4e7d 100644
--- a/kernel/auditfilter.c
+++ b/kernel/auditfilter.c
@@ -442,6 +442,7 @@ static struct audit_entry *audit_rule_to_entry(struct audit_rule *rule)
442 case AUDIT_EQUAL: 442 case AUDIT_EQUAL:
443 break; 443 break;
444 default: 444 default:
445 err = -EINVAL;
445 goto exit_free; 446 goto exit_free;
446 } 447 }
447 } 448 }
@@ -579,6 +580,7 @@ static struct audit_entry *audit_data_to_entry(struct audit_rule_data *data,
579 case AUDIT_EQUAL: 580 case AUDIT_EQUAL:
580 break; 581 break;
581 default: 582 default:
583 err = -EINVAL;
582 goto exit_free; 584 goto exit_free;
583 } 585 }
584 } 586 }
@@ -1134,6 +1136,14 @@ static inline int audit_add_rule(struct audit_entry *entry,
1134 struct audit_watch *watch = entry->rule.watch; 1136 struct audit_watch *watch = entry->rule.watch;
1135 struct nameidata *ndp, *ndw; 1137 struct nameidata *ndp, *ndw;
1136 int h, err, putnd_needed = 0; 1138 int h, err, putnd_needed = 0;
1139#ifdef CONFIG_AUDITSYSCALL
1140 int dont_count = 0;
1141
1142 /* If either of these, don't count towards total */
1143 if (entry->rule.listnr == AUDIT_FILTER_USER ||
1144 entry->rule.listnr == AUDIT_FILTER_TYPE)
1145 dont_count = 1;
1146#endif
1137 1147
1138 if (inode_f) { 1148 if (inode_f) {
1139 h = audit_hash_ino(inode_f->val); 1149 h = audit_hash_ino(inode_f->val);
@@ -1174,6 +1184,10 @@ static inline int audit_add_rule(struct audit_entry *entry,
1174 } else { 1184 } else {
1175 list_add_tail_rcu(&entry->list, list); 1185 list_add_tail_rcu(&entry->list, list);
1176 } 1186 }
1187#ifdef CONFIG_AUDITSYSCALL
1188 if (!dont_count)
1189 audit_n_rules++;
1190#endif
1177 mutex_unlock(&audit_filter_mutex); 1191 mutex_unlock(&audit_filter_mutex);
1178 1192
1179 if (putnd_needed) 1193 if (putnd_needed)
@@ -1198,6 +1212,14 @@ static inline int audit_del_rule(struct audit_entry *entry,
1198 struct audit_watch *watch, *tmp_watch = entry->rule.watch; 1212 struct audit_watch *watch, *tmp_watch = entry->rule.watch;
1199 LIST_HEAD(inotify_list); 1213 LIST_HEAD(inotify_list);
1200 int h, ret = 0; 1214 int h, ret = 0;
1215#ifdef CONFIG_AUDITSYSCALL
1216 int dont_count = 0;
1217
1218 /* If either of these, don't count towards total */
1219 if (entry->rule.listnr == AUDIT_FILTER_USER ||
1220 entry->rule.listnr == AUDIT_FILTER_TYPE)
1221 dont_count = 1;
1222#endif
1201 1223
1202 if (inode_f) { 1224 if (inode_f) {
1203 h = audit_hash_ino(inode_f->val); 1225 h = audit_hash_ino(inode_f->val);
@@ -1235,6 +1257,10 @@ static inline int audit_del_rule(struct audit_entry *entry,
1235 list_del_rcu(&e->list); 1257 list_del_rcu(&e->list);
1236 call_rcu(&e->rcu, audit_free_rule_rcu); 1258 call_rcu(&e->rcu, audit_free_rule_rcu);
1237 1259
1260#ifdef CONFIG_AUDITSYSCALL
1261 if (!dont_count)
1262 audit_n_rules--;
1263#endif
1238 mutex_unlock(&audit_filter_mutex); 1264 mutex_unlock(&audit_filter_mutex);
1239 1265
1240 if (!list_empty(&inotify_list)) 1266 if (!list_empty(&inotify_list))
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index ae40ac8c39e7..efc1b74bebf3 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -85,6 +85,9 @@ extern int audit_enabled;
85/* Indicates that audit should log the full pathname. */ 85/* Indicates that audit should log the full pathname. */
86#define AUDIT_NAME_FULL -1 86#define AUDIT_NAME_FULL -1
87 87
88/* number of audit rules */
89int audit_n_rules;
90
88/* When fs/namei.c:getname() is called, we store the pointer in name and 91/* When fs/namei.c:getname() is called, we store the pointer in name and
89 * we don't let putname() free it (instead we free all of the saved 92 * we don't let putname() free it (instead we free all of the saved
90 * pointers at syscall exit time). 93 * pointers at syscall exit time).
@@ -174,6 +177,7 @@ struct audit_aux_data_path {
174 177
175/* The per-task audit context. */ 178/* The per-task audit context. */
176struct audit_context { 179struct audit_context {
180 int dummy; /* must be the first element */
177 int in_syscall; /* 1 if task is in a syscall */ 181 int in_syscall; /* 1 if task is in a syscall */
178 enum audit_state state; 182 enum audit_state state;
179 unsigned int serial; /* serial number for record */ 183 unsigned int serial; /* serial number for record */
@@ -514,7 +518,7 @@ static inline struct audit_context *audit_get_context(struct task_struct *tsk,
514 context->return_valid = return_valid; 518 context->return_valid = return_valid;
515 context->return_code = return_code; 519 context->return_code = return_code;
516 520
517 if (context->in_syscall && !context->auditable) { 521 if (context->in_syscall && !context->dummy && !context->auditable) {
518 enum audit_state state; 522 enum audit_state state;
519 523
520 state = audit_filter_syscall(tsk, context, &audit_filter_list[AUDIT_FILTER_EXIT]); 524 state = audit_filter_syscall(tsk, context, &audit_filter_list[AUDIT_FILTER_EXIT]);
@@ -530,17 +534,7 @@ static inline struct audit_context *audit_get_context(struct task_struct *tsk,
530 } 534 }
531 535
532get_context: 536get_context:
533 context->pid = tsk->pid; 537
534 context->ppid = sys_getppid(); /* sic. tsk == current in all cases */
535 context->uid = tsk->uid;
536 context->gid = tsk->gid;
537 context->euid = tsk->euid;
538 context->suid = tsk->suid;
539 context->fsuid = tsk->fsuid;
540 context->egid = tsk->egid;
541 context->sgid = tsk->sgid;
542 context->fsgid = tsk->fsgid;
543 context->personality = tsk->personality;
544 tsk->audit_context = NULL; 538 tsk->audit_context = NULL;
545 return context; 539 return context;
546} 540}
@@ -749,6 +743,17 @@ static void audit_log_exit(struct audit_context *context, struct task_struct *ts
749 const char *tty; 743 const char *tty;
750 744
751 /* tsk == current */ 745 /* tsk == current */
746 context->pid = tsk->pid;
747 context->ppid = sys_getppid(); /* sic. tsk == current in all cases */
748 context->uid = tsk->uid;
749 context->gid = tsk->gid;
750 context->euid = tsk->euid;
751 context->suid = tsk->suid;
752 context->fsuid = tsk->fsuid;
753 context->egid = tsk->egid;
754 context->sgid = tsk->sgid;
755 context->fsgid = tsk->fsgid;
756 context->personality = tsk->personality;
752 757
753 ab = audit_log_start(context, GFP_KERNEL, AUDIT_SYSCALL); 758 ab = audit_log_start(context, GFP_KERNEL, AUDIT_SYSCALL);
754 if (!ab) 759 if (!ab)
@@ -1066,7 +1071,8 @@ void audit_syscall_entry(int arch, int major,
1066 context->argv[3] = a4; 1071 context->argv[3] = a4;
1067 1072
1068 state = context->state; 1073 state = context->state;
1069 if (state == AUDIT_SETUP_CONTEXT || state == AUDIT_BUILD_CONTEXT) 1074 context->dummy = !audit_n_rules;
1075 if (!context->dummy && (state == AUDIT_SETUP_CONTEXT || state == AUDIT_BUILD_CONTEXT))
1070 state = audit_filter_syscall(tsk, context, &audit_filter_list[AUDIT_FILTER_ENTRY]); 1076 state = audit_filter_syscall(tsk, context, &audit_filter_list[AUDIT_FILTER_ENTRY]);
1071 if (likely(state == AUDIT_DISABLED)) 1077 if (likely(state == AUDIT_DISABLED))
1072 return; 1078 return;
@@ -1199,14 +1205,18 @@ void audit_putname(const char *name)
1199#endif 1205#endif
1200} 1206}
1201 1207
1202static void audit_inode_context(int idx, const struct inode *inode) 1208/* Copy inode data into an audit_names. */
1209static void audit_copy_inode(struct audit_names *name, const struct inode *inode)
1203{ 1210{
1204 struct audit_context *context = current->audit_context; 1211 name->ino = inode->i_ino;
1205 1212 name->dev = inode->i_sb->s_dev;
1206 selinux_get_inode_sid(inode, &context->names[idx].osid); 1213 name->mode = inode->i_mode;
1214 name->uid = inode->i_uid;
1215 name->gid = inode->i_gid;
1216 name->rdev = inode->i_rdev;
1217 selinux_get_inode_sid(inode, &name->osid);
1207} 1218}
1208 1219
1209
1210/** 1220/**
1211 * audit_inode - store the inode and device from a lookup 1221 * audit_inode - store the inode and device from a lookup
1212 * @name: name being audited 1222 * @name: name being audited
@@ -1240,20 +1250,14 @@ void __audit_inode(const char *name, const struct inode *inode)
1240 ++context->ino_count; 1250 ++context->ino_count;
1241#endif 1251#endif
1242 } 1252 }
1243 context->names[idx].ino = inode->i_ino; 1253 audit_copy_inode(&context->names[idx], inode);
1244 context->names[idx].dev = inode->i_sb->s_dev;
1245 context->names[idx].mode = inode->i_mode;
1246 context->names[idx].uid = inode->i_uid;
1247 context->names[idx].gid = inode->i_gid;
1248 context->names[idx].rdev = inode->i_rdev;
1249 audit_inode_context(idx, inode);
1250} 1254}
1251 1255
1252/** 1256/**
1253 * audit_inode_child - collect inode info for created/removed objects 1257 * audit_inode_child - collect inode info for created/removed objects
1254 * @dname: inode's dentry name 1258 * @dname: inode's dentry name
1255 * @inode: inode being audited 1259 * @inode: inode being audited
1256 * @pino: inode number of dentry parent 1260 * @parent: inode of dentry parent
1257 * 1261 *
1258 * For syscalls that create or remove filesystem objects, audit_inode 1262 * For syscalls that create or remove filesystem objects, audit_inode
1259 * can only collect information for the filesystem object's parent. 1263 * can only collect information for the filesystem object's parent.
@@ -1264,7 +1268,7 @@ void __audit_inode(const char *name, const struct inode *inode)
1264 * unsuccessful attempts. 1268 * unsuccessful attempts.
1265 */ 1269 */
1266void __audit_inode_child(const char *dname, const struct inode *inode, 1270void __audit_inode_child(const char *dname, const struct inode *inode,
1267 unsigned long pino) 1271 const struct inode *parent)
1268{ 1272{
1269 int idx; 1273 int idx;
1270 struct audit_context *context = current->audit_context; 1274 struct audit_context *context = current->audit_context;
@@ -1278,7 +1282,7 @@ void __audit_inode_child(const char *dname, const struct inode *inode,
1278 if (!dname) 1282 if (!dname)
1279 goto update_context; 1283 goto update_context;
1280 for (idx = 0; idx < context->name_count; idx++) 1284 for (idx = 0; idx < context->name_count; idx++)
1281 if (context->names[idx].ino == pino) { 1285 if (context->names[idx].ino == parent->i_ino) {
1282 const char *name = context->names[idx].name; 1286 const char *name = context->names[idx].name;
1283 1287
1284 if (!name) 1288 if (!name)
@@ -1302,16 +1306,47 @@ update_context:
1302 context->names[idx].name_len = AUDIT_NAME_FULL; 1306 context->names[idx].name_len = AUDIT_NAME_FULL;
1303 context->names[idx].name_put = 0; /* don't call __putname() */ 1307 context->names[idx].name_put = 0; /* don't call __putname() */
1304 1308
1305 if (inode) { 1309 if (!inode)
1306 context->names[idx].ino = inode->i_ino; 1310 context->names[idx].ino = (unsigned long)-1;
1307 context->names[idx].dev = inode->i_sb->s_dev; 1311 else
1308 context->names[idx].mode = inode->i_mode; 1312 audit_copy_inode(&context->names[idx], inode);
1309 context->names[idx].uid = inode->i_uid; 1313
1310 context->names[idx].gid = inode->i_gid; 1314 /* A parent was not found in audit_names, so copy the inode data for the
1311 context->names[idx].rdev = inode->i_rdev; 1315 * provided parent. */
1312 audit_inode_context(idx, inode); 1316 if (!found_name) {
1313 } else 1317 idx = context->name_count++;
1314 context->names[idx].ino = (unsigned long)-1; 1318#if AUDIT_DEBUG
1319 context->ino_count++;
1320#endif
1321 audit_copy_inode(&context->names[idx], parent);
1322 }
1323}
1324
1325/**
1326 * audit_inode_update - update inode info for last collected name
1327 * @inode: inode being audited
1328 *
1329 * When open() is called on an existing object with the O_CREAT flag, the inode
1330 * data audit initially collects is incorrect. This additional hook ensures
1331 * audit has the inode data for the actual object to be opened.
1332 */
1333void __audit_inode_update(const struct inode *inode)
1334{
1335 struct audit_context *context = current->audit_context;
1336 int idx;
1337
1338 if (!context->in_syscall || !inode)
1339 return;
1340
1341 if (context->name_count == 0) {
1342 context->name_count++;
1343#if AUDIT_DEBUG
1344 context->ino_count++;
1345#endif
1346 }
1347 idx = context->name_count - 1;
1348
1349 audit_copy_inode(&context->names[idx], inode);
1315} 1350}
1316 1351
1317/** 1352/**
@@ -1642,7 +1677,7 @@ int audit_bprm(struct linux_binprm *bprm)
1642 unsigned long p, next; 1677 unsigned long p, next;
1643 void *to; 1678 void *to;
1644 1679
1645 if (likely(!audit_enabled || !context)) 1680 if (likely(!audit_enabled || !context || context->dummy))
1646 return 0; 1681 return 0;
1647 1682
1648 ax = kmalloc(sizeof(*ax) + PAGE_SIZE * MAX_ARG_PAGES - bprm->p, 1683 ax = kmalloc(sizeof(*ax) + PAGE_SIZE * MAX_ARG_PAGES - bprm->p,
@@ -1680,7 +1715,7 @@ int audit_socketcall(int nargs, unsigned long *args)
1680 struct audit_aux_data_socketcall *ax; 1715 struct audit_aux_data_socketcall *ax;
1681 struct audit_context *context = current->audit_context; 1716 struct audit_context *context = current->audit_context;
1682 1717
1683 if (likely(!context)) 1718 if (likely(!context || context->dummy))
1684 return 0; 1719 return 0;
1685 1720
1686 ax = kmalloc(sizeof(*ax) + nargs * sizeof(unsigned long), GFP_KERNEL); 1721 ax = kmalloc(sizeof(*ax) + nargs * sizeof(unsigned long), GFP_KERNEL);
@@ -1708,7 +1743,7 @@ int audit_sockaddr(int len, void *a)
1708 struct audit_aux_data_sockaddr *ax; 1743 struct audit_aux_data_sockaddr *ax;
1709 struct audit_context *context = current->audit_context; 1744 struct audit_context *context = current->audit_context;
1710 1745
1711 if (likely(!context)) 1746 if (likely(!context || context->dummy))
1712 return 0; 1747 return 0;
1713 1748
1714 ax = kmalloc(sizeof(*ax) + len, GFP_KERNEL); 1749 ax = kmalloc(sizeof(*ax) + len, GFP_KERNEL);
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 70fbf2e83766..f230f9ae01c2 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -16,56 +16,48 @@
16#include <linux/mutex.h> 16#include <linux/mutex.h>
17 17
18/* This protects CPUs going up and down... */ 18/* This protects CPUs going up and down... */
19static DEFINE_MUTEX(cpucontrol); 19static DEFINE_MUTEX(cpu_add_remove_lock);
20static DEFINE_MUTEX(cpu_bitmask_lock);
20 21
21static __cpuinitdata BLOCKING_NOTIFIER_HEAD(cpu_chain); 22static __cpuinitdata BLOCKING_NOTIFIER_HEAD(cpu_chain);
22 23
23#ifdef CONFIG_HOTPLUG_CPU 24#ifdef CONFIG_HOTPLUG_CPU
24static struct task_struct *lock_cpu_hotplug_owner;
25static int lock_cpu_hotplug_depth;
26 25
27static int __lock_cpu_hotplug(int interruptible) 26/* Crappy recursive lock-takers in cpufreq! Complain loudly about idiots */
28{ 27static struct task_struct *recursive;
29 int ret = 0; 28static int recursive_depth;
30
31 if (lock_cpu_hotplug_owner != current) {
32 if (interruptible)
33 ret = mutex_lock_interruptible(&cpucontrol);
34 else
35 mutex_lock(&cpucontrol);
36 }
37
38 /*
39 * Set only if we succeed in locking
40 */
41 if (!ret) {
42 lock_cpu_hotplug_depth++;
43 lock_cpu_hotplug_owner = current;
44 }
45
46 return ret;
47}
48 29
49void lock_cpu_hotplug(void) 30void lock_cpu_hotplug(void)
50{ 31{
51 __lock_cpu_hotplug(0); 32 struct task_struct *tsk = current;
33
34 if (tsk == recursive) {
35 static int warnings = 10;
36 if (warnings) {
37 printk(KERN_ERR "Lukewarm IQ detected in hotplug locking\n");
38 WARN_ON(1);
39 warnings--;
40 }
41 recursive_depth++;
42 return;
43 }
44 mutex_lock(&cpu_bitmask_lock);
45 recursive = tsk;
52} 46}
53EXPORT_SYMBOL_GPL(lock_cpu_hotplug); 47EXPORT_SYMBOL_GPL(lock_cpu_hotplug);
54 48
55void unlock_cpu_hotplug(void) 49void unlock_cpu_hotplug(void)
56{ 50{
57 if (--lock_cpu_hotplug_depth == 0) { 51 WARN_ON(recursive != current);
58 lock_cpu_hotplug_owner = NULL; 52 if (recursive_depth) {
59 mutex_unlock(&cpucontrol); 53 recursive_depth--;
54 return;
60 } 55 }
56 mutex_unlock(&cpu_bitmask_lock);
57 recursive = NULL;
61} 58}
62EXPORT_SYMBOL_GPL(unlock_cpu_hotplug); 59EXPORT_SYMBOL_GPL(unlock_cpu_hotplug);
63 60
64int lock_cpu_hotplug_interruptible(void)
65{
66 return __lock_cpu_hotplug(1);
67}
68EXPORT_SYMBOL_GPL(lock_cpu_hotplug_interruptible);
69#endif /* CONFIG_HOTPLUG_CPU */ 61#endif /* CONFIG_HOTPLUG_CPU */
70 62
71/* Need to know about CPUs going up/down? */ 63/* Need to know about CPUs going up/down? */
@@ -122,9 +114,7 @@ int cpu_down(unsigned int cpu)
122 struct task_struct *p; 114 struct task_struct *p;
123 cpumask_t old_allowed, tmp; 115 cpumask_t old_allowed, tmp;
124 116
125 if ((err = lock_cpu_hotplug_interruptible()) != 0) 117 mutex_lock(&cpu_add_remove_lock);
126 return err;
127
128 if (num_online_cpus() == 1) { 118 if (num_online_cpus() == 1) {
129 err = -EBUSY; 119 err = -EBUSY;
130 goto out; 120 goto out;
@@ -150,7 +140,10 @@ int cpu_down(unsigned int cpu)
150 cpu_clear(cpu, tmp); 140 cpu_clear(cpu, tmp);
151 set_cpus_allowed(current, tmp); 141 set_cpus_allowed(current, tmp);
152 142
143 mutex_lock(&cpu_bitmask_lock);
153 p = __stop_machine_run(take_cpu_down, NULL, cpu); 144 p = __stop_machine_run(take_cpu_down, NULL, cpu);
145 mutex_unlock(&cpu_bitmask_lock);
146
154 if (IS_ERR(p)) { 147 if (IS_ERR(p)) {
155 /* CPU didn't die: tell everyone. Can't complain. */ 148 /* CPU didn't die: tell everyone. Can't complain. */
156 if (blocking_notifier_call_chain(&cpu_chain, CPU_DOWN_FAILED, 149 if (blocking_notifier_call_chain(&cpu_chain, CPU_DOWN_FAILED,
@@ -187,7 +180,7 @@ out_thread:
187out_allowed: 180out_allowed:
188 set_cpus_allowed(current, old_allowed); 181 set_cpus_allowed(current, old_allowed);
189out: 182out:
190 unlock_cpu_hotplug(); 183 mutex_unlock(&cpu_add_remove_lock);
191 return err; 184 return err;
192} 185}
193#endif /*CONFIG_HOTPLUG_CPU*/ 186#endif /*CONFIG_HOTPLUG_CPU*/
@@ -197,9 +190,7 @@ int __devinit cpu_up(unsigned int cpu)
197 int ret; 190 int ret;
198 void *hcpu = (void *)(long)cpu; 191 void *hcpu = (void *)(long)cpu;
199 192
200 if ((ret = lock_cpu_hotplug_interruptible()) != 0) 193 mutex_lock(&cpu_add_remove_lock);
201 return ret;
202
203 if (cpu_online(cpu) || !cpu_present(cpu)) { 194 if (cpu_online(cpu) || !cpu_present(cpu)) {
204 ret = -EINVAL; 195 ret = -EINVAL;
205 goto out; 196 goto out;
@@ -214,7 +205,9 @@ int __devinit cpu_up(unsigned int cpu)
214 } 205 }
215 206
216 /* Arch-specific enabling code. */ 207 /* Arch-specific enabling code. */
208 mutex_lock(&cpu_bitmask_lock);
217 ret = __cpu_up(cpu); 209 ret = __cpu_up(cpu);
210 mutex_unlock(&cpu_bitmask_lock);
218 if (ret != 0) 211 if (ret != 0)
219 goto out_notify; 212 goto out_notify;
220 BUG_ON(!cpu_online(cpu)); 213 BUG_ON(!cpu_online(cpu));
@@ -227,6 +220,6 @@ out_notify:
227 blocking_notifier_call_chain(&cpu_chain, 220 blocking_notifier_call_chain(&cpu_chain,
228 CPU_UP_CANCELED, hcpu); 221 CPU_UP_CANCELED, hcpu);
229out: 222out:
230 unlock_cpu_hotplug(); 223 mutex_unlock(&cpu_add_remove_lock);
231 return ret; 224 return ret;
232} 225}
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index c232dc077438..1a649f2bb9bb 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -762,6 +762,8 @@ static int validate_change(const struct cpuset *cur, const struct cpuset *trial)
762 * 762 *
763 * Call with manage_mutex held. May nest a call to the 763 * Call with manage_mutex held. May nest a call to the
764 * lock_cpu_hotplug()/unlock_cpu_hotplug() pair. 764 * lock_cpu_hotplug()/unlock_cpu_hotplug() pair.
765 * Must not be called holding callback_mutex, because we must
766 * not call lock_cpu_hotplug() while holding callback_mutex.
765 */ 767 */
766 768
767static void update_cpu_domains(struct cpuset *cur) 769static void update_cpu_domains(struct cpuset *cur)
@@ -781,7 +783,7 @@ static void update_cpu_domains(struct cpuset *cur)
781 if (is_cpu_exclusive(c)) 783 if (is_cpu_exclusive(c))
782 cpus_andnot(pspan, pspan, c->cpus_allowed); 784 cpus_andnot(pspan, pspan, c->cpus_allowed);
783 } 785 }
784 if (is_removed(cur) || !is_cpu_exclusive(cur)) { 786 if (!is_cpu_exclusive(cur)) {
785 cpus_or(pspan, pspan, cur->cpus_allowed); 787 cpus_or(pspan, pspan, cur->cpus_allowed);
786 if (cpus_equal(pspan, cur->cpus_allowed)) 788 if (cpus_equal(pspan, cur->cpus_allowed))
787 return; 789 return;
@@ -1917,6 +1919,17 @@ static int cpuset_mkdir(struct inode *dir, struct dentry *dentry, int mode)
1917 return cpuset_create(c_parent, dentry->d_name.name, mode | S_IFDIR); 1919 return cpuset_create(c_parent, dentry->d_name.name, mode | S_IFDIR);
1918} 1920}
1919 1921
1922/*
1923 * Locking note on the strange update_flag() call below:
1924 *
1925 * If the cpuset being removed is marked cpu_exclusive, then simulate
1926 * turning cpu_exclusive off, which will call update_cpu_domains().
1927 * The lock_cpu_hotplug() call in update_cpu_domains() must not be
1928 * made while holding callback_mutex. Elsewhere the kernel nests
1929 * callback_mutex inside lock_cpu_hotplug() calls. So the reverse
1930 * nesting would risk an ABBA deadlock.
1931 */
1932
1920static int cpuset_rmdir(struct inode *unused_dir, struct dentry *dentry) 1933static int cpuset_rmdir(struct inode *unused_dir, struct dentry *dentry)
1921{ 1934{
1922 struct cpuset *cs = dentry->d_fsdata; 1935 struct cpuset *cs = dentry->d_fsdata;
@@ -1936,11 +1949,16 @@ static int cpuset_rmdir(struct inode *unused_dir, struct dentry *dentry)
1936 mutex_unlock(&manage_mutex); 1949 mutex_unlock(&manage_mutex);
1937 return -EBUSY; 1950 return -EBUSY;
1938 } 1951 }
1952 if (is_cpu_exclusive(cs)) {
1953 int retval = update_flag(CS_CPU_EXCLUSIVE, cs, "0");
1954 if (retval < 0) {
1955 mutex_unlock(&manage_mutex);
1956 return retval;
1957 }
1958 }
1939 parent = cs->parent; 1959 parent = cs->parent;
1940 mutex_lock(&callback_mutex); 1960 mutex_lock(&callback_mutex);
1941 set_bit(CS_REMOVED, &cs->flags); 1961 set_bit(CS_REMOVED, &cs->flags);
1942 if (is_cpu_exclusive(cs))
1943 update_cpu_domains(cs);
1944 list_del(&cs->sibling); /* delete my sibling from parent->children */ 1962 list_del(&cs->sibling); /* delete my sibling from parent->children */
1945 spin_lock(&cs->dentry->d_lock); 1963 spin_lock(&cs->dentry->d_lock);
1946 d = dget(cs->dentry); 1964 d = dget(cs->dentry);
diff --git a/kernel/delayacct.c b/kernel/delayacct.c
new file mode 100644
index 000000000000..57ca3730205d
--- /dev/null
+++ b/kernel/delayacct.c
@@ -0,0 +1,178 @@
1/* delayacct.c - per-task delay accounting
2 *
3 * Copyright (C) Shailabh Nagar, IBM Corp. 2006
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it would be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
13 * the GNU General Public License for more details.
14 */
15
16#include <linux/sched.h>
17#include <linux/slab.h>
18#include <linux/time.h>
19#include <linux/sysctl.h>
20#include <linux/delayacct.h>
21
22int delayacct_on __read_mostly = 1; /* Delay accounting turned on/off */
23kmem_cache_t *delayacct_cache;
24
25static int __init delayacct_setup_disable(char *str)
26{
27 delayacct_on = 0;
28 return 1;
29}
30__setup("nodelayacct", delayacct_setup_disable);
31
32void delayacct_init(void)
33{
34 delayacct_cache = kmem_cache_create("delayacct_cache",
35 sizeof(struct task_delay_info),
36 0,
37 SLAB_PANIC,
38 NULL, NULL);
39 delayacct_tsk_init(&init_task);
40}
41
42void __delayacct_tsk_init(struct task_struct *tsk)
43{
44 spin_lock_init(&tsk->delays_lock);
45 /* No need to acquire tsk->delays_lock for allocation here unless
46 __delayacct_tsk_init called after tsk is attached to tasklist
47 */
48 tsk->delays = kmem_cache_zalloc(delayacct_cache, SLAB_KERNEL);
49 if (tsk->delays)
50 spin_lock_init(&tsk->delays->lock);
51}
52
53void __delayacct_tsk_exit(struct task_struct *tsk)
54{
55 struct task_delay_info *delays = tsk->delays;
56 spin_lock(&tsk->delays_lock);
57 tsk->delays = NULL;
58 spin_unlock(&tsk->delays_lock);
59 kmem_cache_free(delayacct_cache, delays);
60}
61
62/*
63 * Start accounting for a delay statistic using
64 * its starting timestamp (@start)
65 */
66
67static inline void delayacct_start(struct timespec *start)
68{
69 do_posix_clock_monotonic_gettime(start);
70}
71
72/*
73 * Finish delay accounting for a statistic using
74 * its timestamps (@start, @end), accumalator (@total) and @count
75 */
76
77static void delayacct_end(struct timespec *start, struct timespec *end,
78 u64 *total, u32 *count)
79{
80 struct timespec ts;
81 s64 ns;
82
83 do_posix_clock_monotonic_gettime(end);
84 ts = timespec_sub(*end, *start);
85 ns = timespec_to_ns(&ts);
86 if (ns < 0)
87 return;
88
89 spin_lock(&current->delays->lock);
90 *total += ns;
91 (*count)++;
92 spin_unlock(&current->delays->lock);
93}
94
95void __delayacct_blkio_start(void)
96{
97 delayacct_start(&current->delays->blkio_start);
98}
99
100void __delayacct_blkio_end(void)
101{
102 if (current->delays->flags & DELAYACCT_PF_SWAPIN)
103 /* Swapin block I/O */
104 delayacct_end(&current->delays->blkio_start,
105 &current->delays->blkio_end,
106 &current->delays->swapin_delay,
107 &current->delays->swapin_count);
108 else /* Other block I/O */
109 delayacct_end(&current->delays->blkio_start,
110 &current->delays->blkio_end,
111 &current->delays->blkio_delay,
112 &current->delays->blkio_count);
113}
114
115int __delayacct_add_tsk(struct taskstats *d, struct task_struct *tsk)
116{
117 s64 tmp;
118 struct timespec ts;
119 unsigned long t1,t2,t3;
120
121 spin_lock(&tsk->delays_lock);
122
123 /* Though tsk->delays accessed later, early exit avoids
124 * unnecessary returning of other data
125 */
126 if (!tsk->delays)
127 goto done;
128
129 tmp = (s64)d->cpu_run_real_total;
130 cputime_to_timespec(tsk->utime + tsk->stime, &ts);
131 tmp += timespec_to_ns(&ts);
132 d->cpu_run_real_total = (tmp < (s64)d->cpu_run_real_total) ? 0 : tmp;
133
134 /*
135 * No locking available for sched_info (and too expensive to add one)
136 * Mitigate by taking snapshot of values
137 */
138 t1 = tsk->sched_info.pcnt;
139 t2 = tsk->sched_info.run_delay;
140 t3 = tsk->sched_info.cpu_time;
141
142 d->cpu_count += t1;
143
144 jiffies_to_timespec(t2, &ts);
145 tmp = (s64)d->cpu_delay_total + timespec_to_ns(&ts);
146 d->cpu_delay_total = (tmp < (s64)d->cpu_delay_total) ? 0 : tmp;
147
148 tmp = (s64)d->cpu_run_virtual_total + (s64)jiffies_to_usecs(t3) * 1000;
149 d->cpu_run_virtual_total =
150 (tmp < (s64)d->cpu_run_virtual_total) ? 0 : tmp;
151
152 /* zero XXX_total, non-zero XXX_count implies XXX stat overflowed */
153
154 spin_lock(&tsk->delays->lock);
155 tmp = d->blkio_delay_total + tsk->delays->blkio_delay;
156 d->blkio_delay_total = (tmp < d->blkio_delay_total) ? 0 : tmp;
157 tmp = d->swapin_delay_total + tsk->delays->swapin_delay;
158 d->swapin_delay_total = (tmp < d->swapin_delay_total) ? 0 : tmp;
159 d->blkio_count += tsk->delays->blkio_count;
160 d->swapin_count += tsk->delays->swapin_count;
161 spin_unlock(&tsk->delays->lock);
162
163done:
164 spin_unlock(&tsk->delays_lock);
165 return 0;
166}
167
168__u64 __delayacct_blkio_ticks(struct task_struct *tsk)
169{
170 __u64 ret;
171
172 spin_lock(&tsk->delays->lock);
173 ret = nsec_to_clock_t(tsk->delays->blkio_delay +
174 tsk->delays->swapin_delay);
175 spin_unlock(&tsk->delays->lock);
176 return ret;
177}
178
diff --git a/kernel/exit.c b/kernel/exit.c
index 6664c084783d..dba194a8d416 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -25,6 +25,8 @@
25#include <linux/mount.h> 25#include <linux/mount.h>
26#include <linux/proc_fs.h> 26#include <linux/proc_fs.h>
27#include <linux/mempolicy.h> 27#include <linux/mempolicy.h>
28#include <linux/taskstats_kern.h>
29#include <linux/delayacct.h>
28#include <linux/cpuset.h> 30#include <linux/cpuset.h>
29#include <linux/syscalls.h> 31#include <linux/syscalls.h>
30#include <linux/signal.h> 32#include <linux/signal.h>
@@ -843,7 +845,9 @@ static void exit_notify(struct task_struct *tsk)
843fastcall NORET_TYPE void do_exit(long code) 845fastcall NORET_TYPE void do_exit(long code)
844{ 846{
845 struct task_struct *tsk = current; 847 struct task_struct *tsk = current;
848 struct taskstats *tidstats;
846 int group_dead; 849 int group_dead;
850 unsigned int mycpu;
847 851
848 profile_task_exit(tsk); 852 profile_task_exit(tsk);
849 853
@@ -881,6 +885,8 @@ fastcall NORET_TYPE void do_exit(long code)
881 current->comm, current->pid, 885 current->comm, current->pid,
882 preempt_count()); 886 preempt_count());
883 887
888 taskstats_exit_alloc(&tidstats, &mycpu);
889
884 acct_update_integrals(tsk); 890 acct_update_integrals(tsk);
885 if (tsk->mm) { 891 if (tsk->mm) {
886 update_hiwater_rss(tsk->mm); 892 update_hiwater_rss(tsk->mm);
@@ -900,6 +906,10 @@ fastcall NORET_TYPE void do_exit(long code)
900#endif 906#endif
901 if (unlikely(tsk->audit_context)) 907 if (unlikely(tsk->audit_context))
902 audit_free(tsk); 908 audit_free(tsk);
909 taskstats_exit_send(tsk, tidstats, group_dead, mycpu);
910 taskstats_exit_free(tidstats);
911 delayacct_tsk_exit(tsk);
912
903 exit_mm(tsk); 913 exit_mm(tsk);
904 914
905 if (group_dead) 915 if (group_dead)
diff --git a/kernel/fork.c b/kernel/fork.c
index 56e4e07e45f7..1b0f7b1e0881 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -43,6 +43,8 @@
43#include <linux/rmap.h> 43#include <linux/rmap.h>
44#include <linux/acct.h> 44#include <linux/acct.h>
45#include <linux/cn_proc.h> 45#include <linux/cn_proc.h>
46#include <linux/delayacct.h>
47#include <linux/taskstats_kern.h>
46 48
47#include <asm/pgtable.h> 49#include <asm/pgtable.h>
48#include <asm/pgalloc.h> 50#include <asm/pgalloc.h>
@@ -61,9 +63,7 @@ int max_threads; /* tunable limit on nr_threads */
61 63
62DEFINE_PER_CPU(unsigned long, process_counts) = 0; 64DEFINE_PER_CPU(unsigned long, process_counts) = 0;
63 65
64 __cacheline_aligned DEFINE_RWLOCK(tasklist_lock); /* outer */ 66__cacheline_aligned DEFINE_RWLOCK(tasklist_lock); /* outer */
65
66EXPORT_SYMBOL(tasklist_lock);
67 67
68int nr_processes(void) 68int nr_processes(void)
69{ 69{
@@ -820,6 +820,7 @@ static inline int copy_signal(unsigned long clone_flags, struct task_struct * ts
820 if (clone_flags & CLONE_THREAD) { 820 if (clone_flags & CLONE_THREAD) {
821 atomic_inc(&current->signal->count); 821 atomic_inc(&current->signal->count);
822 atomic_inc(&current->signal->live); 822 atomic_inc(&current->signal->live);
823 taskstats_tgid_alloc(current->signal);
823 return 0; 824 return 0;
824 } 825 }
825 sig = kmem_cache_alloc(signal_cachep, GFP_KERNEL); 826 sig = kmem_cache_alloc(signal_cachep, GFP_KERNEL);
@@ -864,6 +865,7 @@ static inline int copy_signal(unsigned long clone_flags, struct task_struct * ts
864 INIT_LIST_HEAD(&sig->cpu_timers[0]); 865 INIT_LIST_HEAD(&sig->cpu_timers[0]);
865 INIT_LIST_HEAD(&sig->cpu_timers[1]); 866 INIT_LIST_HEAD(&sig->cpu_timers[1]);
866 INIT_LIST_HEAD(&sig->cpu_timers[2]); 867 INIT_LIST_HEAD(&sig->cpu_timers[2]);
868 taskstats_tgid_init(sig);
867 869
868 task_lock(current->group_leader); 870 task_lock(current->group_leader);
869 memcpy(sig->rlim, current->signal->rlim, sizeof sig->rlim); 871 memcpy(sig->rlim, current->signal->rlim, sizeof sig->rlim);
@@ -885,6 +887,7 @@ static inline int copy_signal(unsigned long clone_flags, struct task_struct * ts
885void __cleanup_signal(struct signal_struct *sig) 887void __cleanup_signal(struct signal_struct *sig)
886{ 888{
887 exit_thread_group_keys(sig); 889 exit_thread_group_keys(sig);
890 taskstats_tgid_free(sig);
888 kmem_cache_free(signal_cachep, sig); 891 kmem_cache_free(signal_cachep, sig);
889} 892}
890 893
@@ -1002,6 +1005,7 @@ static struct task_struct *copy_process(unsigned long clone_flags,
1002 goto bad_fork_cleanup_put_domain; 1005 goto bad_fork_cleanup_put_domain;
1003 1006
1004 p->did_exec = 0; 1007 p->did_exec = 0;
1008 delayacct_tsk_init(p); /* Must remain after dup_task_struct() */
1005 copy_flags(clone_flags, p); 1009 copy_flags(clone_flags, p);
1006 p->pid = pid; 1010 p->pid = pid;
1007 retval = -EFAULT; 1011 retval = -EFAULT;
diff --git a/kernel/futex.c b/kernel/futex.c
index 1dc98e4dd287..dda2049692a2 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -415,15 +415,15 @@ out_unlock:
415 */ 415 */
416void exit_pi_state_list(struct task_struct *curr) 416void exit_pi_state_list(struct task_struct *curr)
417{ 417{
418 struct futex_hash_bucket *hb;
419 struct list_head *next, *head = &curr->pi_state_list; 418 struct list_head *next, *head = &curr->pi_state_list;
420 struct futex_pi_state *pi_state; 419 struct futex_pi_state *pi_state;
420 struct futex_hash_bucket *hb;
421 union futex_key key; 421 union futex_key key;
422 422
423 /* 423 /*
424 * We are a ZOMBIE and nobody can enqueue itself on 424 * We are a ZOMBIE and nobody can enqueue itself on
425 * pi_state_list anymore, but we have to be careful 425 * pi_state_list anymore, but we have to be careful
426 * versus waiters unqueueing themselfs 426 * versus waiters unqueueing themselves:
427 */ 427 */
428 spin_lock_irq(&curr->pi_lock); 428 spin_lock_irq(&curr->pi_lock);
429 while (!list_empty(head)) { 429 while (!list_empty(head)) {
@@ -431,21 +431,24 @@ void exit_pi_state_list(struct task_struct *curr)
431 next = head->next; 431 next = head->next;
432 pi_state = list_entry(next, struct futex_pi_state, list); 432 pi_state = list_entry(next, struct futex_pi_state, list);
433 key = pi_state->key; 433 key = pi_state->key;
434 hb = hash_futex(&key);
434 spin_unlock_irq(&curr->pi_lock); 435 spin_unlock_irq(&curr->pi_lock);
435 436
436 hb = hash_futex(&key);
437 spin_lock(&hb->lock); 437 spin_lock(&hb->lock);
438 438
439 spin_lock_irq(&curr->pi_lock); 439 spin_lock_irq(&curr->pi_lock);
440 /*
441 * We dropped the pi-lock, so re-check whether this
442 * task still owns the PI-state:
443 */
440 if (head->next != next) { 444 if (head->next != next) {
441 spin_unlock(&hb->lock); 445 spin_unlock(&hb->lock);
442 continue; 446 continue;
443 } 447 }
444 448
445 list_del_init(&pi_state->list);
446
447 WARN_ON(pi_state->owner != curr); 449 WARN_ON(pi_state->owner != curr);
448 450 WARN_ON(list_empty(&pi_state->list));
451 list_del_init(&pi_state->list);
449 pi_state->owner = NULL; 452 pi_state->owner = NULL;
450 spin_unlock_irq(&curr->pi_lock); 453 spin_unlock_irq(&curr->pi_lock);
451 454
@@ -470,12 +473,20 @@ lookup_pi_state(u32 uval, struct futex_hash_bucket *hb, struct futex_q *me)
470 head = &hb->chain; 473 head = &hb->chain;
471 474
472 list_for_each_entry_safe(this, next, head, list) { 475 list_for_each_entry_safe(this, next, head, list) {
473 if (match_futex (&this->key, &me->key)) { 476 if (match_futex(&this->key, &me->key)) {
474 /* 477 /*
475 * Another waiter already exists - bump up 478 * Another waiter already exists - bump up
476 * the refcount and return its pi_state: 479 * the refcount and return its pi_state:
477 */ 480 */
478 pi_state = this->pi_state; 481 pi_state = this->pi_state;
482 /*
483 * Userspace might have messed up non PI and PI futexes
484 */
485 if (unlikely(!pi_state))
486 return -EINVAL;
487
488 WARN_ON(!atomic_read(&pi_state->refcount));
489
479 atomic_inc(&pi_state->refcount); 490 atomic_inc(&pi_state->refcount);
480 me->pi_state = pi_state; 491 me->pi_state = pi_state;
481 492
@@ -484,10 +495,13 @@ lookup_pi_state(u32 uval, struct futex_hash_bucket *hb, struct futex_q *me)
484 } 495 }
485 496
486 /* 497 /*
487 * We are the first waiter - try to look up the real owner and 498 * We are the first waiter - try to look up the real owner and attach
488 * attach the new pi_state to it: 499 * the new pi_state to it, but bail out when the owner died bit is set
500 * and TID = 0:
489 */ 501 */
490 pid = uval & FUTEX_TID_MASK; 502 pid = uval & FUTEX_TID_MASK;
503 if (!pid && (uval & FUTEX_OWNER_DIED))
504 return -ESRCH;
491 p = futex_find_get_task(pid); 505 p = futex_find_get_task(pid);
492 if (!p) 506 if (!p)
493 return -ESRCH; 507 return -ESRCH;
@@ -504,6 +518,7 @@ lookup_pi_state(u32 uval, struct futex_hash_bucket *hb, struct futex_q *me)
504 pi_state->key = me->key; 518 pi_state->key = me->key;
505 519
506 spin_lock_irq(&p->pi_lock); 520 spin_lock_irq(&p->pi_lock);
521 WARN_ON(!list_empty(&pi_state->list));
507 list_add(&pi_state->list, &p->pi_state_list); 522 list_add(&pi_state->list, &p->pi_state_list);
508 pi_state->owner = p; 523 pi_state->owner = p;
509 spin_unlock_irq(&p->pi_lock); 524 spin_unlock_irq(&p->pi_lock);
@@ -567,20 +582,29 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *this)
567 * kept enabled while there is PI state around. We must also 582 * kept enabled while there is PI state around. We must also
568 * preserve the owner died bit.) 583 * preserve the owner died bit.)
569 */ 584 */
570 newval = (uval & FUTEX_OWNER_DIED) | FUTEX_WAITERS | new_owner->pid; 585 if (!(uval & FUTEX_OWNER_DIED)) {
586 newval = FUTEX_WAITERS | new_owner->pid;
571 587
572 inc_preempt_count(); 588 inc_preempt_count();
573 curval = futex_atomic_cmpxchg_inatomic(uaddr, uval, newval); 589 curval = futex_atomic_cmpxchg_inatomic(uaddr, uval, newval);
574 dec_preempt_count(); 590 dec_preempt_count();
591 if (curval == -EFAULT)
592 return -EFAULT;
593 if (curval != uval)
594 return -EINVAL;
595 }
575 596
576 if (curval == -EFAULT) 597 spin_lock_irq(&pi_state->owner->pi_lock);
577 return -EFAULT; 598 WARN_ON(list_empty(&pi_state->list));
578 if (curval != uval) 599 list_del_init(&pi_state->list);
579 return -EINVAL; 600 spin_unlock_irq(&pi_state->owner->pi_lock);
580 601
581 list_del_init(&pi_state->owner->pi_state_list); 602 spin_lock_irq(&new_owner->pi_lock);
603 WARN_ON(!list_empty(&pi_state->list));
582 list_add(&pi_state->list, &new_owner->pi_state_list); 604 list_add(&pi_state->list, &new_owner->pi_state_list);
583 pi_state->owner = new_owner; 605 pi_state->owner = new_owner;
606 spin_unlock_irq(&new_owner->pi_lock);
607
584 rt_mutex_unlock(&pi_state->pi_mutex); 608 rt_mutex_unlock(&pi_state->pi_mutex);
585 609
586 return 0; 610 return 0;
@@ -1230,6 +1254,7 @@ static int do_futex_lock_pi(u32 __user *uaddr, int detect, int trylock,
1230 /* Owner died? */ 1254 /* Owner died? */
1231 if (q.pi_state->owner != NULL) { 1255 if (q.pi_state->owner != NULL) {
1232 spin_lock_irq(&q.pi_state->owner->pi_lock); 1256 spin_lock_irq(&q.pi_state->owner->pi_lock);
1257 WARN_ON(list_empty(&q.pi_state->list));
1233 list_del_init(&q.pi_state->list); 1258 list_del_init(&q.pi_state->list);
1234 spin_unlock_irq(&q.pi_state->owner->pi_lock); 1259 spin_unlock_irq(&q.pi_state->owner->pi_lock);
1235 } else 1260 } else
@@ -1238,6 +1263,7 @@ static int do_futex_lock_pi(u32 __user *uaddr, int detect, int trylock,
1238 q.pi_state->owner = current; 1263 q.pi_state->owner = current;
1239 1264
1240 spin_lock_irq(&current->pi_lock); 1265 spin_lock_irq(&current->pi_lock);
1266 WARN_ON(!list_empty(&q.pi_state->list));
1241 list_add(&q.pi_state->list, &current->pi_state_list); 1267 list_add(&q.pi_state->list, &current->pi_state_list);
1242 spin_unlock_irq(&current->pi_lock); 1268 spin_unlock_irq(&current->pi_lock);
1243 1269
@@ -1421,9 +1447,11 @@ retry_locked:
1421 * again. If it succeeds then we can return without waking 1447 * again. If it succeeds then we can return without waking
1422 * anyone else up: 1448 * anyone else up:
1423 */ 1449 */
1424 inc_preempt_count(); 1450 if (!(uval & FUTEX_OWNER_DIED)) {
1425 uval = futex_atomic_cmpxchg_inatomic(uaddr, current->pid, 0); 1451 inc_preempt_count();
1426 dec_preempt_count(); 1452 uval = futex_atomic_cmpxchg_inatomic(uaddr, current->pid, 0);
1453 dec_preempt_count();
1454 }
1427 1455
1428 if (unlikely(uval == -EFAULT)) 1456 if (unlikely(uval == -EFAULT))
1429 goto pi_faulted; 1457 goto pi_faulted;
@@ -1456,9 +1484,11 @@ retry_locked:
1456 /* 1484 /*
1457 * No waiters - kernel unlocks the futex: 1485 * No waiters - kernel unlocks the futex:
1458 */ 1486 */
1459 ret = unlock_futex_pi(uaddr, uval); 1487 if (!(uval & FUTEX_OWNER_DIED)) {
1460 if (ret == -EFAULT) 1488 ret = unlock_futex_pi(uaddr, uval);
1461 goto pi_faulted; 1489 if (ret == -EFAULT)
1490 goto pi_faulted;
1491 }
1462 1492
1463out_unlock: 1493out_unlock:
1464 spin_unlock(&hb->lock); 1494 spin_unlock(&hb->lock);
@@ -1677,9 +1707,9 @@ err_unlock:
1677 * Process a futex-list entry, check whether it's owned by the 1707 * Process a futex-list entry, check whether it's owned by the
1678 * dying task, and do notification if so: 1708 * dying task, and do notification if so:
1679 */ 1709 */
1680int handle_futex_death(u32 __user *uaddr, struct task_struct *curr) 1710int handle_futex_death(u32 __user *uaddr, struct task_struct *curr, int pi)
1681{ 1711{
1682 u32 uval, nval; 1712 u32 uval, nval, mval;
1683 1713
1684retry: 1714retry:
1685 if (get_user(uval, uaddr)) 1715 if (get_user(uval, uaddr))
@@ -1696,21 +1726,45 @@ retry:
1696 * thread-death.) The rest of the cleanup is done in 1726 * thread-death.) The rest of the cleanup is done in
1697 * userspace. 1727 * userspace.
1698 */ 1728 */
1699 nval = futex_atomic_cmpxchg_inatomic(uaddr, uval, 1729 mval = (uval & FUTEX_WAITERS) | FUTEX_OWNER_DIED;
1700 uval | FUTEX_OWNER_DIED); 1730 nval = futex_atomic_cmpxchg_inatomic(uaddr, uval, mval);
1731
1701 if (nval == -EFAULT) 1732 if (nval == -EFAULT)
1702 return -1; 1733 return -1;
1703 1734
1704 if (nval != uval) 1735 if (nval != uval)
1705 goto retry; 1736 goto retry;
1706 1737
1707 if (uval & FUTEX_WAITERS) 1738 /*
1708 futex_wake(uaddr, 1); 1739 * Wake robust non-PI futexes here. The wakeup of
1740 * PI futexes happens in exit_pi_state():
1741 */
1742 if (!pi) {
1743 if (uval & FUTEX_WAITERS)
1744 futex_wake(uaddr, 1);
1745 }
1709 } 1746 }
1710 return 0; 1747 return 0;
1711} 1748}
1712 1749
1713/* 1750/*
1751 * Fetch a robust-list pointer. Bit 0 signals PI futexes:
1752 */
1753static inline int fetch_robust_entry(struct robust_list __user **entry,
1754 struct robust_list __user **head, int *pi)
1755{
1756 unsigned long uentry;
1757
1758 if (get_user(uentry, (unsigned long *)head))
1759 return -EFAULT;
1760
1761 *entry = (void *)(uentry & ~1UL);
1762 *pi = uentry & 1;
1763
1764 return 0;
1765}
1766
1767/*
1714 * Walk curr->robust_list (very carefully, it's a userspace list!) 1768 * Walk curr->robust_list (very carefully, it's a userspace list!)
1715 * and mark any locks found there dead, and notify any waiters. 1769 * and mark any locks found there dead, and notify any waiters.
1716 * 1770 *
@@ -1720,14 +1774,14 @@ void exit_robust_list(struct task_struct *curr)
1720{ 1774{
1721 struct robust_list_head __user *head = curr->robust_list; 1775 struct robust_list_head __user *head = curr->robust_list;
1722 struct robust_list __user *entry, *pending; 1776 struct robust_list __user *entry, *pending;
1723 unsigned int limit = ROBUST_LIST_LIMIT; 1777 unsigned int limit = ROBUST_LIST_LIMIT, pi, pip;
1724 unsigned long futex_offset; 1778 unsigned long futex_offset;
1725 1779
1726 /* 1780 /*
1727 * Fetch the list head (which was registered earlier, via 1781 * Fetch the list head (which was registered earlier, via
1728 * sys_set_robust_list()): 1782 * sys_set_robust_list()):
1729 */ 1783 */
1730 if (get_user(entry, &head->list.next)) 1784 if (fetch_robust_entry(&entry, &head->list.next, &pi))
1731 return; 1785 return;
1732 /* 1786 /*
1733 * Fetch the relative futex offset: 1787 * Fetch the relative futex offset:
@@ -1738,10 +1792,11 @@ void exit_robust_list(struct task_struct *curr)
1738 * Fetch any possibly pending lock-add first, and handle it 1792 * Fetch any possibly pending lock-add first, and handle it
1739 * if it exists: 1793 * if it exists:
1740 */ 1794 */
1741 if (get_user(pending, &head->list_op_pending)) 1795 if (fetch_robust_entry(&pending, &head->list_op_pending, &pip))
1742 return; 1796 return;
1797
1743 if (pending) 1798 if (pending)
1744 handle_futex_death((void *)pending + futex_offset, curr); 1799 handle_futex_death((void *)pending + futex_offset, curr, pip);
1745 1800
1746 while (entry != &head->list) { 1801 while (entry != &head->list) {
1747 /* 1802 /*
@@ -1750,12 +1805,12 @@ void exit_robust_list(struct task_struct *curr)
1750 */ 1805 */
1751 if (entry != pending) 1806 if (entry != pending)
1752 if (handle_futex_death((void *)entry + futex_offset, 1807 if (handle_futex_death((void *)entry + futex_offset,
1753 curr)) 1808 curr, pi))
1754 return; 1809 return;
1755 /* 1810 /*
1756 * Fetch the next entry in the list: 1811 * Fetch the next entry in the list:
1757 */ 1812 */
1758 if (get_user(entry, &entry->next)) 1813 if (fetch_robust_entry(&entry, &entry->next, &pi))
1759 return; 1814 return;
1760 /* 1815 /*
1761 * Avoid excessively long or circular lists: 1816 * Avoid excessively long or circular lists:
diff --git a/kernel/futex_compat.c b/kernel/futex_compat.c
index d1d92b441fb7..d1aab1a452cc 100644
--- a/kernel/futex_compat.c
+++ b/kernel/futex_compat.c
@@ -12,6 +12,23 @@
12 12
13#include <asm/uaccess.h> 13#include <asm/uaccess.h>
14 14
15
16/*
17 * Fetch a robust-list pointer. Bit 0 signals PI futexes:
18 */
19static inline int
20fetch_robust_entry(compat_uptr_t *uentry, struct robust_list __user **entry,
21 compat_uptr_t *head, int *pi)
22{
23 if (get_user(*uentry, head))
24 return -EFAULT;
25
26 *entry = compat_ptr((*uentry) & ~1);
27 *pi = (unsigned int)(*uentry) & 1;
28
29 return 0;
30}
31
15/* 32/*
16 * Walk curr->robust_list (very carefully, it's a userspace list!) 33 * Walk curr->robust_list (very carefully, it's a userspace list!)
17 * and mark any locks found there dead, and notify any waiters. 34 * and mark any locks found there dead, and notify any waiters.
@@ -22,17 +39,16 @@ void compat_exit_robust_list(struct task_struct *curr)
22{ 39{
23 struct compat_robust_list_head __user *head = curr->compat_robust_list; 40 struct compat_robust_list_head __user *head = curr->compat_robust_list;
24 struct robust_list __user *entry, *pending; 41 struct robust_list __user *entry, *pending;
42 unsigned int limit = ROBUST_LIST_LIMIT, pi;
25 compat_uptr_t uentry, upending; 43 compat_uptr_t uentry, upending;
26 unsigned int limit = ROBUST_LIST_LIMIT;
27 compat_long_t futex_offset; 44 compat_long_t futex_offset;
28 45
29 /* 46 /*
30 * Fetch the list head (which was registered earlier, via 47 * Fetch the list head (which was registered earlier, via
31 * sys_set_robust_list()): 48 * sys_set_robust_list()):
32 */ 49 */
33 if (get_user(uentry, &head->list.next)) 50 if (fetch_robust_entry(&uentry, &entry, &head->list.next, &pi))
34 return; 51 return;
35 entry = compat_ptr(uentry);
36 /* 52 /*
37 * Fetch the relative futex offset: 53 * Fetch the relative futex offset:
38 */ 54 */
@@ -42,11 +58,11 @@ void compat_exit_robust_list(struct task_struct *curr)
42 * Fetch any possibly pending lock-add first, and handle it 58 * Fetch any possibly pending lock-add first, and handle it
43 * if it exists: 59 * if it exists:
44 */ 60 */
45 if (get_user(upending, &head->list_op_pending)) 61 if (fetch_robust_entry(&upending, &pending,
62 &head->list_op_pending, &pi))
46 return; 63 return;
47 pending = compat_ptr(upending);
48 if (upending) 64 if (upending)
49 handle_futex_death((void *)pending + futex_offset, curr); 65 handle_futex_death((void *)pending + futex_offset, curr, pi);
50 66
51 while (compat_ptr(uentry) != &head->list) { 67 while (compat_ptr(uentry) != &head->list) {
52 /* 68 /*
@@ -55,15 +71,15 @@ void compat_exit_robust_list(struct task_struct *curr)
55 */ 71 */
56 if (entry != pending) 72 if (entry != pending)
57 if (handle_futex_death((void *)entry + futex_offset, 73 if (handle_futex_death((void *)entry + futex_offset,
58 curr)) 74 curr, pi))
59 return; 75 return;
60 76
61 /* 77 /*
62 * Fetch the next entry in the list: 78 * Fetch the next entry in the list:
63 */ 79 */
64 if (get_user(uentry, (compat_uptr_t *)&entry->next)) 80 if (fetch_robust_entry(&uentry, &entry,
81 (compat_uptr_t *)&entry->next, &pi))
65 return; 82 return;
66 entry = compat_ptr(uentry);
67 /* 83 /*
68 * Avoid excessively long or circular lists: 84 * Avoid excessively long or circular lists:
69 */ 85 */
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index d17766d40dab..be989efc7856 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -835,7 +835,7 @@ static void migrate_hrtimers(int cpu)
835} 835}
836#endif /* CONFIG_HOTPLUG_CPU */ 836#endif /* CONFIG_HOTPLUG_CPU */
837 837
838static int __devinit hrtimer_cpu_notify(struct notifier_block *self, 838static int __cpuinit hrtimer_cpu_notify(struct notifier_block *self,
839 unsigned long action, void *hcpu) 839 unsigned long action, void *hcpu)
840{ 840{
841 long cpu = (long)hcpu; 841 long cpu = (long)hcpu;
@@ -859,7 +859,7 @@ static int __devinit hrtimer_cpu_notify(struct notifier_block *self,
859 return NOTIFY_OK; 859 return NOTIFY_OK;
860} 860}
861 861
862static struct notifier_block __devinitdata hrtimers_nb = { 862static struct notifier_block __cpuinitdata hrtimers_nb = {
863 .notifier_call = hrtimer_cpu_notify, 863 .notifier_call = hrtimer_cpu_notify,
864}; 864};
865 865
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 4e461438e48b..92be519eff26 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -137,16 +137,40 @@ EXPORT_SYMBOL(enable_irq);
137 * @irq: interrupt to control 137 * @irq: interrupt to control
138 * @on: enable/disable power management wakeup 138 * @on: enable/disable power management wakeup
139 * 139 *
140 * Enable/disable power management wakeup mode 140 * Enable/disable power management wakeup mode, which is
141 * disabled by default. Enables and disables must match,
142 * just as they match for non-wakeup mode support.
143 *
144 * Wakeup mode lets this IRQ wake the system from sleep
145 * states like "suspend to RAM".
141 */ 146 */
142int set_irq_wake(unsigned int irq, unsigned int on) 147int set_irq_wake(unsigned int irq, unsigned int on)
143{ 148{
144 struct irq_desc *desc = irq_desc + irq; 149 struct irq_desc *desc = irq_desc + irq;
145 unsigned long flags; 150 unsigned long flags;
146 int ret = -ENXIO; 151 int ret = -ENXIO;
152 int (*set_wake)(unsigned, unsigned) = desc->chip->set_wake;
147 153
154 /* wakeup-capable irqs can be shared between drivers that
155 * don't need to have the same sleep mode behaviors.
156 */
148 spin_lock_irqsave(&desc->lock, flags); 157 spin_lock_irqsave(&desc->lock, flags);
149 if (desc->chip->set_wake) 158 if (on) {
159 if (desc->wake_depth++ == 0)
160 desc->status |= IRQ_WAKEUP;
161 else
162 set_wake = NULL;
163 } else {
164 if (desc->wake_depth == 0) {
165 printk(KERN_WARNING "Unbalanced IRQ %d "
166 "wake disable\n", irq);
167 WARN_ON(1);
168 } else if (--desc->wake_depth == 0)
169 desc->status &= ~IRQ_WAKEUP;
170 else
171 set_wake = NULL;
172 }
173 if (set_wake)
150 ret = desc->chip->set_wake(irq, on); 174 ret = desc->chip->set_wake(irq, on);
151 spin_unlock_irqrestore(&desc->lock, flags); 175 spin_unlock_irqrestore(&desc->lock, flags);
152 return ret; 176 return ret;
diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
index 39277dd6bf90..ab16a5a4cfe9 100644
--- a/kernel/kallsyms.c
+++ b/kernel/kallsyms.c
@@ -275,8 +275,8 @@ static void upcase_if_global(struct kallsym_iter *iter)
275static int get_ksymbol_mod(struct kallsym_iter *iter) 275static int get_ksymbol_mod(struct kallsym_iter *iter)
276{ 276{
277 iter->owner = module_get_kallsym(iter->pos - kallsyms_num_syms, 277 iter->owner = module_get_kallsym(iter->pos - kallsyms_num_syms,
278 &iter->value, 278 &iter->value, &iter->type,
279 &iter->type, iter->name); 279 iter->name, sizeof(iter->name));
280 if (iter->owner == NULL) 280 if (iter->owner == NULL)
281 return 0; 281 return 0;
282 282
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index 64aab081153b..3f57dfdc8f92 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -393,6 +393,7 @@ static int __kprobes add_new_kprobe(struct kprobe *old_p, struct kprobe *p)
393static inline void add_aggr_kprobe(struct kprobe *ap, struct kprobe *p) 393static inline void add_aggr_kprobe(struct kprobe *ap, struct kprobe *p)
394{ 394{
395 copy_kprobe(p, ap); 395 copy_kprobe(p, ap);
396 flush_insn_slot(ap);
396 ap->addr = p->addr; 397 ap->addr = p->addr;
397 ap->pre_handler = aggr_pre_handler; 398 ap->pre_handler = aggr_pre_handler;
398 ap->fault_handler = aggr_fault_handler; 399 ap->fault_handler = aggr_fault_handler;
diff --git a/kernel/kthread.c b/kernel/kthread.c
index 24be714b04c7..4f9c60ef95e8 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -216,23 +216,6 @@ EXPORT_SYMBOL(kthread_bind);
216 */ 216 */
217int kthread_stop(struct task_struct *k) 217int kthread_stop(struct task_struct *k)
218{ 218{
219 return kthread_stop_sem(k, NULL);
220}
221EXPORT_SYMBOL(kthread_stop);
222
223/**
224 * kthread_stop_sem - stop a thread created by kthread_create().
225 * @k: thread created by kthread_create().
226 * @s: semaphore that @k waits on while idle.
227 *
228 * Does essentially the same thing as kthread_stop() above, but wakes
229 * @k by calling up(@s).
230 *
231 * Returns the result of threadfn(), or %-EINTR if wake_up_process()
232 * was never called.
233 */
234int kthread_stop_sem(struct task_struct *k, struct semaphore *s)
235{
236 int ret; 219 int ret;
237 220
238 mutex_lock(&kthread_stop_lock); 221 mutex_lock(&kthread_stop_lock);
@@ -246,10 +229,7 @@ int kthread_stop_sem(struct task_struct *k, struct semaphore *s)
246 229
247 /* Now set kthread_should_stop() to true, and wake it up. */ 230 /* Now set kthread_should_stop() to true, and wake it up. */
248 kthread_stop_info.k = k; 231 kthread_stop_info.k = k;
249 if (s) 232 wake_up_process(k);
250 up(s);
251 else
252 wake_up_process(k);
253 put_task_struct(k); 233 put_task_struct(k);
254 234
255 /* Once it dies, reset stop ptr, gather result and we're done. */ 235 /* Once it dies, reset stop ptr, gather result and we're done. */
@@ -260,7 +240,7 @@ int kthread_stop_sem(struct task_struct *k, struct semaphore *s)
260 240
261 return ret; 241 return ret;
262} 242}
263EXPORT_SYMBOL(kthread_stop_sem); 243EXPORT_SYMBOL(kthread_stop);
264 244
265static __init int helper_init(void) 245static __init int helper_init(void)
266{ 246{
diff --git a/kernel/lockdep.c b/kernel/lockdep.c
index f32ca78c198d..9bad17884513 100644
--- a/kernel/lockdep.c
+++ b/kernel/lockdep.c
@@ -169,22 +169,17 @@ EXPORT_SYMBOL(lockdep_internal);
169 */ 169 */
170static int class_filter(struct lock_class *class) 170static int class_filter(struct lock_class *class)
171{ 171{
172#if 0
173 /* Example */
172 if (class->name_version == 1 && 174 if (class->name_version == 1 &&
173 !strcmp(class->name, "&rl->lock")) 175 !strcmp(class->name, "lockname"))
174 return 1; 176 return 1;
175 if (class->name_version == 1 && 177 if (class->name_version == 1 &&
176 !strcmp(class->name, "&ni->mrec_lock")) 178 !strcmp(class->name, "&struct->lockfield"))
177 return 1; 179 return 1;
178 if (class->name_version == 1 && 180#endif
179 !strcmp(class->name, "mft_ni_runlist_lock")) 181 /* Allow everything else. 0 would be filter everything else */
180 return 1; 182 return 1;
181 if (class->name_version == 1 &&
182 !strcmp(class->name, "mft_ni_mrec_lock"))
183 return 1;
184 if (class->name_version == 1 &&
185 !strcmp(class->name, "&vol->lcnbmp_lock"))
186 return 1;
187 return 0;
188} 183}
189#endif 184#endif
190 185
@@ -408,23 +403,12 @@ static void lockdep_print_held_locks(struct task_struct *curr)
408 print_lock(curr->held_locks + i); 403 print_lock(curr->held_locks + i);
409 } 404 }
410} 405}
411/*
412 * Helper to print a nice hierarchy of lock dependencies:
413 */
414static void print_spaces(int nr)
415{
416 int i;
417
418 for (i = 0; i < nr; i++)
419 printk(" ");
420}
421 406
422static void print_lock_class_header(struct lock_class *class, int depth) 407static void print_lock_class_header(struct lock_class *class, int depth)
423{ 408{
424 int bit; 409 int bit;
425 410
426 print_spaces(depth); 411 printk("%*s->", depth, "");
427 printk("->");
428 print_lock_name(class); 412 print_lock_name(class);
429 printk(" ops: %lu", class->ops); 413 printk(" ops: %lu", class->ops);
430 printk(" {\n"); 414 printk(" {\n");
@@ -433,17 +417,14 @@ static void print_lock_class_header(struct lock_class *class, int depth)
433 if (class->usage_mask & (1 << bit)) { 417 if (class->usage_mask & (1 << bit)) {
434 int len = depth; 418 int len = depth;
435 419
436 print_spaces(depth); 420 len += printk("%*s %s", depth, "", usage_str[bit]);
437 len += printk(" %s", usage_str[bit]);
438 len += printk(" at:\n"); 421 len += printk(" at:\n");
439 print_stack_trace(class->usage_traces + bit, len); 422 print_stack_trace(class->usage_traces + bit, len);
440 } 423 }
441 } 424 }
442 print_spaces(depth); 425 printk("%*s }\n", depth, "");
443 printk(" }\n");
444 426
445 print_spaces(depth); 427 printk("%*s ... key at: ",depth,"");
446 printk(" ... key at: ");
447 print_ip_sym((unsigned long)class->key); 428 print_ip_sym((unsigned long)class->key);
448} 429}
449 430
@@ -463,8 +444,7 @@ static void print_lock_dependencies(struct lock_class *class, int depth)
463 DEBUG_LOCKS_WARN_ON(!entry->class); 444 DEBUG_LOCKS_WARN_ON(!entry->class);
464 print_lock_dependencies(entry->class, depth + 1); 445 print_lock_dependencies(entry->class, depth + 1);
465 446
466 print_spaces(depth); 447 printk("%*s ... acquired at:\n",depth,"");
467 printk(" ... acquired at:\n");
468 print_stack_trace(&entry->trace, 2); 448 print_stack_trace(&entry->trace, 2);
469 printk("\n"); 449 printk("\n");
470 } 450 }
@@ -1124,7 +1104,7 @@ extern void __error_too_big_MAX_LOCKDEP_SUBCLASSES(void);
1124 * itself, so actual lookup of the hash should be once per lock object. 1104 * itself, so actual lookup of the hash should be once per lock object.
1125 */ 1105 */
1126static inline struct lock_class * 1106static inline struct lock_class *
1127register_lock_class(struct lockdep_map *lock, unsigned int subclass) 1107look_up_lock_class(struct lockdep_map *lock, unsigned int subclass)
1128{ 1108{
1129 struct lockdep_subclass_key *key; 1109 struct lockdep_subclass_key *key;
1130 struct list_head *hash_head; 1110 struct list_head *hash_head;
@@ -1168,7 +1148,26 @@ register_lock_class(struct lockdep_map *lock, unsigned int subclass)
1168 */ 1148 */
1169 list_for_each_entry(class, hash_head, hash_entry) 1149 list_for_each_entry(class, hash_head, hash_entry)
1170 if (class->key == key) 1150 if (class->key == key)
1171 goto out_set; 1151 return class;
1152
1153 return NULL;
1154}
1155
1156/*
1157 * Register a lock's class in the hash-table, if the class is not present
1158 * yet. Otherwise we look it up. We cache the result in the lock object
1159 * itself, so actual lookup of the hash should be once per lock object.
1160 */
1161static inline struct lock_class *
1162register_lock_class(struct lockdep_map *lock, unsigned int subclass)
1163{
1164 struct lockdep_subclass_key *key;
1165 struct list_head *hash_head;
1166 struct lock_class *class;
1167
1168 class = look_up_lock_class(lock, subclass);
1169 if (likely(class))
1170 return class;
1172 1171
1173 /* 1172 /*
1174 * Debug-check: all keys must be persistent! 1173 * Debug-check: all keys must be persistent!
@@ -1183,6 +1182,9 @@ register_lock_class(struct lockdep_map *lock, unsigned int subclass)
1183 return NULL; 1182 return NULL;
1184 } 1183 }
1185 1184
1185 key = lock->key->subkeys + subclass;
1186 hash_head = classhashentry(key);
1187
1186 __raw_spin_lock(&hash_lock); 1188 __raw_spin_lock(&hash_lock);
1187 /* 1189 /*
1188 * We have to do the hash-walk again, to avoid races 1190 * We have to do the hash-walk again, to avoid races
@@ -1229,8 +1231,8 @@ register_lock_class(struct lockdep_map *lock, unsigned int subclass)
1229out_unlock_set: 1231out_unlock_set:
1230 __raw_spin_unlock(&hash_lock); 1232 __raw_spin_unlock(&hash_lock);
1231 1233
1232out_set: 1234 if (!subclass)
1233 lock->class[subclass] = class; 1235 lock->class_cache = class;
1234 1236
1235 DEBUG_LOCKS_WARN_ON(class->subclass != subclass); 1237 DEBUG_LOCKS_WARN_ON(class->subclass != subclass);
1236 1238
@@ -1934,7 +1936,7 @@ void lockdep_init_map(struct lockdep_map *lock, const char *name,
1934 } 1936 }
1935 lock->name = name; 1937 lock->name = name;
1936 lock->key = key; 1938 lock->key = key;
1937 memset(lock->class, 0, sizeof(lock->class[0])*MAX_LOCKDEP_SUBCLASSES); 1939 lock->class_cache = NULL;
1938} 1940}
1939 1941
1940EXPORT_SYMBOL_GPL(lockdep_init_map); 1942EXPORT_SYMBOL_GPL(lockdep_init_map);
@@ -1948,8 +1950,8 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass,
1948 unsigned long ip) 1950 unsigned long ip)
1949{ 1951{
1950 struct task_struct *curr = current; 1952 struct task_struct *curr = current;
1953 struct lock_class *class = NULL;
1951 struct held_lock *hlock; 1954 struct held_lock *hlock;
1952 struct lock_class *class;
1953 unsigned int depth, id; 1955 unsigned int depth, id;
1954 int chain_head = 0; 1956 int chain_head = 0;
1955 u64 chain_key; 1957 u64 chain_key;
@@ -1967,8 +1969,11 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass,
1967 return 0; 1969 return 0;
1968 } 1970 }
1969 1971
1970 class = lock->class[subclass]; 1972 if (!subclass)
1971 /* not cached yet? */ 1973 class = lock->class_cache;
1974 /*
1975 * Not cached yet or subclass?
1976 */
1972 if (unlikely(!class)) { 1977 if (unlikely(!class)) {
1973 class = register_lock_class(lock, subclass); 1978 class = register_lock_class(lock, subclass);
1974 if (!class) 1979 if (!class)
@@ -2469,48 +2474,44 @@ void lockdep_free_key_range(void *start, unsigned long size)
2469 2474
2470void lockdep_reset_lock(struct lockdep_map *lock) 2475void lockdep_reset_lock(struct lockdep_map *lock)
2471{ 2476{
2472 struct lock_class *class, *next, *entry; 2477 struct lock_class *class, *next;
2473 struct list_head *head; 2478 struct list_head *head;
2474 unsigned long flags; 2479 unsigned long flags;
2475 int i, j; 2480 int i, j;
2476 2481
2477 raw_local_irq_save(flags); 2482 raw_local_irq_save(flags);
2478 __raw_spin_lock(&hash_lock);
2479 2483
2480 /* 2484 /*
2481 * Remove all classes this lock has: 2485 * Remove all classes this lock might have:
2486 */
2487 for (j = 0; j < MAX_LOCKDEP_SUBCLASSES; j++) {
2488 /*
2489 * If the class exists we look it up and zap it:
2490 */
2491 class = look_up_lock_class(lock, j);
2492 if (class)
2493 zap_class(class);
2494 }
2495 /*
2496 * Debug check: in the end all mapped classes should
2497 * be gone.
2482 */ 2498 */
2499 __raw_spin_lock(&hash_lock);
2483 for (i = 0; i < CLASSHASH_SIZE; i++) { 2500 for (i = 0; i < CLASSHASH_SIZE; i++) {
2484 head = classhash_table + i; 2501 head = classhash_table + i;
2485 if (list_empty(head)) 2502 if (list_empty(head))
2486 continue; 2503 continue;
2487 list_for_each_entry_safe(class, next, head, hash_entry) { 2504 list_for_each_entry_safe(class, next, head, hash_entry) {
2488 for (j = 0; j < MAX_LOCKDEP_SUBCLASSES; j++) { 2505 if (unlikely(class == lock->class_cache)) {
2489 entry = lock->class[j]; 2506 __raw_spin_unlock(&hash_lock);
2490 if (class == entry) { 2507 DEBUG_LOCKS_WARN_ON(1);
2491 zap_class(class); 2508 goto out_restore;
2492 lock->class[j] = NULL;
2493 break;
2494 }
2495 } 2509 }
2496 } 2510 }
2497 } 2511 }
2498
2499 /*
2500 * Debug check: in the end all mapped classes should
2501 * be gone.
2502 */
2503 for (j = 0; j < MAX_LOCKDEP_SUBCLASSES; j++) {
2504 entry = lock->class[j];
2505 if (!entry)
2506 continue;
2507 __raw_spin_unlock(&hash_lock);
2508 DEBUG_LOCKS_WARN_ON(1);
2509 raw_local_irq_restore(flags);
2510 return;
2511 }
2512
2513 __raw_spin_unlock(&hash_lock); 2512 __raw_spin_unlock(&hash_lock);
2513
2514out_restore:
2514 raw_local_irq_restore(flags); 2515 raw_local_irq_restore(flags);
2515} 2516}
2516 2517
@@ -2571,7 +2572,7 @@ static inline int in_range(const void *start, const void *addr, const void *end)
2571 2572
2572static void 2573static void
2573print_freed_lock_bug(struct task_struct *curr, const void *mem_from, 2574print_freed_lock_bug(struct task_struct *curr, const void *mem_from,
2574 const void *mem_to) 2575 const void *mem_to, struct held_lock *hlock)
2575{ 2576{
2576 if (!debug_locks_off()) 2577 if (!debug_locks_off())
2577 return; 2578 return;
@@ -2583,6 +2584,7 @@ print_freed_lock_bug(struct task_struct *curr, const void *mem_from,
2583 printk( "-------------------------\n"); 2584 printk( "-------------------------\n");
2584 printk("%s/%d is freeing memory %p-%p, with a lock still held there!\n", 2585 printk("%s/%d is freeing memory %p-%p, with a lock still held there!\n",
2585 curr->comm, curr->pid, mem_from, mem_to-1); 2586 curr->comm, curr->pid, mem_from, mem_to-1);
2587 print_lock(hlock);
2586 lockdep_print_held_locks(curr); 2588 lockdep_print_held_locks(curr);
2587 2589
2588 printk("\nstack backtrace:\n"); 2590 printk("\nstack backtrace:\n");
@@ -2616,7 +2618,7 @@ void debug_check_no_locks_freed(const void *mem_from, unsigned long mem_len)
2616 !in_range(mem_from, lock_to, mem_to)) 2618 !in_range(mem_from, lock_to, mem_to))
2617 continue; 2619 continue;
2618 2620
2619 print_freed_lock_bug(curr, mem_from, mem_to); 2621 print_freed_lock_bug(curr, mem_from, mem_to, hlock);
2620 break; 2622 break;
2621 } 2623 }
2622 local_irq_restore(flags); 2624 local_irq_restore(flags);
diff --git a/kernel/module.c b/kernel/module.c
index 35e1b1f859d7..2a19cd47c046 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2019,10 +2019,8 @@ const char *module_address_lookup(unsigned long addr,
2019 return NULL; 2019 return NULL;
2020} 2020}
2021 2021
2022struct module *module_get_kallsym(unsigned int symnum, 2022struct module *module_get_kallsym(unsigned int symnum, unsigned long *value,
2023 unsigned long *value, 2023 char *type, char *name, size_t namelen)
2024 char *type,
2025 char namebuf[128])
2026{ 2024{
2027 struct module *mod; 2025 struct module *mod;
2028 2026
@@ -2031,9 +2029,8 @@ struct module *module_get_kallsym(unsigned int symnum,
2031 if (symnum < mod->num_symtab) { 2029 if (symnum < mod->num_symtab) {
2032 *value = mod->symtab[symnum].st_value; 2030 *value = mod->symtab[symnum].st_value;
2033 *type = mod->symtab[symnum].st_info; 2031 *type = mod->symtab[symnum].st_info;
2034 strncpy(namebuf, 2032 strlcpy(name, mod->strtab + mod->symtab[symnum].st_name,
2035 mod->strtab + mod->symtab[symnum].st_name, 2033 namelen);
2036 127);
2037 mutex_unlock(&module_mutex); 2034 mutex_unlock(&module_mutex);
2038 return mod; 2035 return mod;
2039 } 2036 }
diff --git a/kernel/panic.c b/kernel/panic.c
index ab13f0f668b5..d8a0bca21233 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -172,6 +172,7 @@ const char *print_tainted(void)
172 172
173void add_taint(unsigned flag) 173void add_taint(unsigned flag)
174{ 174{
175 debug_locks_off(); /* can't trust the integrity of the kernel anymore */
175 tainted |= flag; 176 tainted |= flag;
176} 177}
177EXPORT_SYMBOL(add_taint); 178EXPORT_SYMBOL(add_taint);
@@ -256,6 +257,7 @@ int oops_may_print(void)
256 */ 257 */
257void oops_enter(void) 258void oops_enter(void)
258{ 259{
260 debug_locks_off(); /* can't trust the integrity of the kernel anymore */
259 do_oops_enter_exit(); 261 do_oops_enter_exit();
260} 262}
261 263
diff --git a/kernel/power/pm.c b/kernel/power/pm.c
index 84063ac8fcfc..c50d15266c10 100644
--- a/kernel/power/pm.c
+++ b/kernel/power/pm.c
@@ -75,42 +75,6 @@ struct pm_dev *pm_register(pm_dev_t type,
75 return dev; 75 return dev;
76} 76}
77 77
78static void __pm_unregister(struct pm_dev *dev)
79{
80 if (dev) {
81 list_del(&dev->entry);
82 kfree(dev);
83 }
84}
85
86/**
87 * pm_unregister_all - unregister all devices with matching callback
88 * @callback: callback function pointer
89 *
90 * Unregister every device that would call the callback passed. This
91 * is primarily meant as a helper function for loadable modules. It
92 * enables a module to give up all its managed devices without keeping
93 * its own private list.
94 */
95
96void pm_unregister_all(pm_callback callback)
97{
98 struct list_head *entry;
99
100 if (!callback)
101 return;
102
103 mutex_lock(&pm_devs_lock);
104 entry = pm_devs.next;
105 while (entry != &pm_devs) {
106 struct pm_dev *dev = list_entry(entry, struct pm_dev, entry);
107 entry = entry->next;
108 if (dev->callback == callback)
109 __pm_unregister(dev);
110 }
111 mutex_unlock(&pm_devs_lock);
112}
113
114/** 78/**
115 * pm_send - send request to a single device 79 * pm_send - send request to a single device
116 * @dev: device to send to 80 * @dev: device to send to
@@ -239,7 +203,6 @@ int pm_send_all(pm_request_t rqst, void *data)
239} 203}
240 204
241EXPORT_SYMBOL(pm_register); 205EXPORT_SYMBOL(pm_register);
242EXPORT_SYMBOL(pm_unregister_all);
243EXPORT_SYMBOL(pm_send_all); 206EXPORT_SYMBOL(pm_send_all);
244EXPORT_SYMBOL(pm_active); 207EXPORT_SYMBOL(pm_active);
245 208
diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
index 24c96f354231..75d4886e648e 100644
--- a/kernel/power/snapshot.c
+++ b/kernel/power/snapshot.c
@@ -227,11 +227,17 @@ static void copy_data_pages(struct pbe *pblist)
227 for (zone_pfn = 0; zone_pfn < zone->spanned_pages; ++zone_pfn) { 227 for (zone_pfn = 0; zone_pfn < zone->spanned_pages; ++zone_pfn) {
228 if (saveable(zone, &zone_pfn)) { 228 if (saveable(zone, &zone_pfn)) {
229 struct page *page; 229 struct page *page;
230 long *src, *dst;
231 int n;
232
230 page = pfn_to_page(zone_pfn + zone->zone_start_pfn); 233 page = pfn_to_page(zone_pfn + zone->zone_start_pfn);
231 BUG_ON(!pbe); 234 BUG_ON(!pbe);
232 pbe->orig_address = (unsigned long)page_address(page); 235 pbe->orig_address = (unsigned long)page_address(page);
233 /* copy_page is not usable for copying task structs. */ 236 /* copy_page and memcpy are not usable for copying task structs. */
234 memcpy((void *)pbe->address, (void *)pbe->orig_address, PAGE_SIZE); 237 dst = (long *)pbe->address;
238 src = (long *)pbe->orig_address;
239 for (n = PAGE_SIZE / sizeof(long); n; n--)
240 *dst++ = *src++;
235 pbe = pbe->next; 241 pbe = pbe->next;
236 } 242 }
237 } 243 }
diff --git a/kernel/power/swap.c b/kernel/power/swap.c
index 044b8e0c1025..f1dd146bd64d 100644
--- a/kernel/power/swap.c
+++ b/kernel/power/swap.c
@@ -263,7 +263,6 @@ int swsusp_write(void)
263 struct swap_map_handle handle; 263 struct swap_map_handle handle;
264 struct snapshot_handle snapshot; 264 struct snapshot_handle snapshot;
265 struct swsusp_info *header; 265 struct swsusp_info *header;
266 unsigned long start;
267 int error; 266 int error;
268 267
269 if ((error = swsusp_swap_check())) { 268 if ((error = swsusp_swap_check())) {
@@ -281,16 +280,17 @@ int swsusp_write(void)
281 } 280 }
282 error = get_swap_writer(&handle); 281 error = get_swap_writer(&handle);
283 if (!error) { 282 if (!error) {
284 start = handle.cur_swap; 283 unsigned long start = handle.cur_swap;
285 error = swap_write_page(&handle, header); 284 error = swap_write_page(&handle, header);
286 } 285 if (!error)
287 if (!error) 286 error = save_image(&handle, &snapshot,
288 error = save_image(&handle, &snapshot, header->pages - 1); 287 header->pages - 1);
289 if (!error) { 288 if (!error) {
290 flush_swap_writer(&handle); 289 flush_swap_writer(&handle);
291 printk("S"); 290 printk("S");
292 error = mark_swapfiles(swp_entry(root_swap, start)); 291 error = mark_swapfiles(swp_entry(root_swap, start));
293 printk("|\n"); 292 printk("|\n");
293 }
294 } 294 }
295 if (error) 295 if (error)
296 free_all_swap_pages(root_swap, handle.bitmap); 296 free_all_swap_pages(root_swap, handle.bitmap);
@@ -311,8 +311,10 @@ static atomic_t io_done = ATOMIC_INIT(0);
311 311
312static int end_io(struct bio *bio, unsigned int num, int err) 312static int end_io(struct bio *bio, unsigned int num, int err)
313{ 313{
314 if (!test_bit(BIO_UPTODATE, &bio->bi_flags)) 314 if (!test_bit(BIO_UPTODATE, &bio->bi_flags)) {
315 panic("I/O error reading memory image"); 315 printk(KERN_ERR "I/O error reading swsusp image.\n");
316 return -EIO;
317 }
316 atomic_set(&io_done, 0); 318 atomic_set(&io_done, 0);
317 return 0; 319 return 0;
318} 320}
diff --git a/kernel/printk.c b/kernel/printk.c
index bdba5d80496c..65ca0688f86f 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -52,7 +52,7 @@ int console_printk[4] = {
52 DEFAULT_CONSOLE_LOGLEVEL, /* default_console_loglevel */ 52 DEFAULT_CONSOLE_LOGLEVEL, /* default_console_loglevel */
53}; 53};
54 54
55EXPORT_SYMBOL(console_printk); 55EXPORT_UNUSED_SYMBOL(console_printk); /* June 2006 */
56 56
57/* 57/*
58 * Low lever drivers may need that to know if they can schedule in 58 * Low lever drivers may need that to know if they can schedule in
@@ -773,7 +773,7 @@ int is_console_locked(void)
773{ 773{
774 return console_locked; 774 return console_locked;
775} 775}
776EXPORT_SYMBOL(is_console_locked); 776EXPORT_UNUSED_SYMBOL(is_console_locked); /* June 2006 */
777 777
778/** 778/**
779 * release_console_sem - unlock the console system 779 * release_console_sem - unlock the console system
diff --git a/kernel/rcupdate.c b/kernel/rcupdate.c
index 759805c9859a..436ab35f6fa7 100644
--- a/kernel/rcupdate.c
+++ b/kernel/rcupdate.c
@@ -548,7 +548,7 @@ static void __devinit rcu_online_cpu(int cpu)
548 tasklet_init(&per_cpu(rcu_tasklet, cpu), rcu_process_callbacks, 0UL); 548 tasklet_init(&per_cpu(rcu_tasklet, cpu), rcu_process_callbacks, 0UL);
549} 549}
550 550
551static int __devinit rcu_cpu_notify(struct notifier_block *self, 551static int __cpuinit rcu_cpu_notify(struct notifier_block *self,
552 unsigned long action, void *hcpu) 552 unsigned long action, void *hcpu)
553{ 553{
554 long cpu = (long)hcpu; 554 long cpu = (long)hcpu;
@@ -565,7 +565,7 @@ static int __devinit rcu_cpu_notify(struct notifier_block *self,
565 return NOTIFY_OK; 565 return NOTIFY_OK;
566} 566}
567 567
568static struct notifier_block __devinitdata rcu_nb = { 568static struct notifier_block __cpuinitdata rcu_nb = {
569 .notifier_call = rcu_cpu_notify, 569 .notifier_call = rcu_cpu_notify,
570}; 570};
571 571
diff --git a/kernel/resource.c b/kernel/resource.c
index 129cf046e561..0dd3a857579e 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -404,8 +404,6 @@ int insert_resource(struct resource *parent, struct resource *new)
404 return result; 404 return result;
405} 405}
406 406
407EXPORT_SYMBOL(insert_resource);
408
409/* 407/*
410 * Given an existing resource, change its start and size to match the 408 * Given an existing resource, change its start and size to match the
411 * arguments. Returns -EBUSY if it can't fit. Existing children of 409 * arguments. Returns -EBUSY if it can't fit. Existing children of
diff --git a/kernel/rtmutex-tester.c b/kernel/rtmutex-tester.c
index 494dac872a13..948bd8f643e2 100644
--- a/kernel/rtmutex-tester.c
+++ b/kernel/rtmutex-tester.c
@@ -275,6 +275,7 @@ static int test_func(void *data)
275 275
276 /* Wait for the next command to be executed */ 276 /* Wait for the next command to be executed */
277 schedule(); 277 schedule();
278 try_to_freeze();
278 279
279 if (signal_pending(current)) 280 if (signal_pending(current))
280 flush_signals(current); 281 flush_signals(current);
diff --git a/kernel/rtmutex.c b/kernel/rtmutex.c
index d2ef13b485e7..3e13a1e5856f 100644
--- a/kernel/rtmutex.c
+++ b/kernel/rtmutex.c
@@ -7,6 +7,8 @@
7 * Copyright (C) 2005-2006 Timesys Corp., Thomas Gleixner <tglx@timesys.com> 7 * Copyright (C) 2005-2006 Timesys Corp., Thomas Gleixner <tglx@timesys.com>
8 * Copyright (C) 2005 Kihon Technologies Inc., Steven Rostedt 8 * Copyright (C) 2005 Kihon Technologies Inc., Steven Rostedt
9 * Copyright (C) 2006 Esben Nielsen 9 * Copyright (C) 2006 Esben Nielsen
10 *
11 * See Documentation/rt-mutex-design.txt for details.
10 */ 12 */
11#include <linux/spinlock.h> 13#include <linux/spinlock.h>
12#include <linux/module.h> 14#include <linux/module.h>
diff --git a/kernel/sched.c b/kernel/sched.c
index 4ee400f9d56b..a2be2d055299 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -51,6 +51,7 @@
51#include <linux/times.h> 51#include <linux/times.h>
52#include <linux/acct.h> 52#include <linux/acct.h>
53#include <linux/kprobes.h> 53#include <linux/kprobes.h>
54#include <linux/delayacct.h>
54#include <asm/tlb.h> 55#include <asm/tlb.h>
55 56
56#include <asm/unistd.h> 57#include <asm/unistd.h>
@@ -501,9 +502,36 @@ struct file_operations proc_schedstat_operations = {
501 .release = single_release, 502 .release = single_release,
502}; 503};
503 504
505/*
506 * Expects runqueue lock to be held for atomicity of update
507 */
508static inline void
509rq_sched_info_arrive(struct rq *rq, unsigned long delta_jiffies)
510{
511 if (rq) {
512 rq->rq_sched_info.run_delay += delta_jiffies;
513 rq->rq_sched_info.pcnt++;
514 }
515}
516
517/*
518 * Expects runqueue lock to be held for atomicity of update
519 */
520static inline void
521rq_sched_info_depart(struct rq *rq, unsigned long delta_jiffies)
522{
523 if (rq)
524 rq->rq_sched_info.cpu_time += delta_jiffies;
525}
504# define schedstat_inc(rq, field) do { (rq)->field++; } while (0) 526# define schedstat_inc(rq, field) do { (rq)->field++; } while (0)
505# define schedstat_add(rq, field, amt) do { (rq)->field += (amt); } while (0) 527# define schedstat_add(rq, field, amt) do { (rq)->field += (amt); } while (0)
506#else /* !CONFIG_SCHEDSTATS */ 528#else /* !CONFIG_SCHEDSTATS */
529static inline void
530rq_sched_info_arrive(struct rq *rq, unsigned long delta_jiffies)
531{}
532static inline void
533rq_sched_info_depart(struct rq *rq, unsigned long delta_jiffies)
534{}
507# define schedstat_inc(rq, field) do { } while (0) 535# define schedstat_inc(rq, field) do { } while (0)
508# define schedstat_add(rq, field, amt) do { } while (0) 536# define schedstat_add(rq, field, amt) do { } while (0)
509#endif 537#endif
@@ -523,7 +551,7 @@ static inline struct rq *this_rq_lock(void)
523 return rq; 551 return rq;
524} 552}
525 553
526#ifdef CONFIG_SCHEDSTATS 554#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT)
527/* 555/*
528 * Called when a process is dequeued from the active array and given 556 * Called when a process is dequeued from the active array and given
529 * the cpu. We should note that with the exception of interactive 557 * the cpu. We should note that with the exception of interactive
@@ -551,21 +579,16 @@ static inline void sched_info_dequeued(struct task_struct *t)
551 */ 579 */
552static void sched_info_arrive(struct task_struct *t) 580static void sched_info_arrive(struct task_struct *t)
553{ 581{
554 unsigned long now = jiffies, diff = 0; 582 unsigned long now = jiffies, delta_jiffies = 0;
555 struct rq *rq = task_rq(t);
556 583
557 if (t->sched_info.last_queued) 584 if (t->sched_info.last_queued)
558 diff = now - t->sched_info.last_queued; 585 delta_jiffies = now - t->sched_info.last_queued;
559 sched_info_dequeued(t); 586 sched_info_dequeued(t);
560 t->sched_info.run_delay += diff; 587 t->sched_info.run_delay += delta_jiffies;
561 t->sched_info.last_arrival = now; 588 t->sched_info.last_arrival = now;
562 t->sched_info.pcnt++; 589 t->sched_info.pcnt++;
563 590
564 if (!rq) 591 rq_sched_info_arrive(task_rq(t), delta_jiffies);
565 return;
566
567 rq->rq_sched_info.run_delay += diff;
568 rq->rq_sched_info.pcnt++;
569} 592}
570 593
571/* 594/*
@@ -585,8 +608,9 @@ static void sched_info_arrive(struct task_struct *t)
585 */ 608 */
586static inline void sched_info_queued(struct task_struct *t) 609static inline void sched_info_queued(struct task_struct *t)
587{ 610{
588 if (!t->sched_info.last_queued) 611 if (unlikely(sched_info_on()))
589 t->sched_info.last_queued = jiffies; 612 if (!t->sched_info.last_queued)
613 t->sched_info.last_queued = jiffies;
590} 614}
591 615
592/* 616/*
@@ -595,13 +619,10 @@ static inline void sched_info_queued(struct task_struct *t)
595 */ 619 */
596static inline void sched_info_depart(struct task_struct *t) 620static inline void sched_info_depart(struct task_struct *t)
597{ 621{
598 struct rq *rq = task_rq(t); 622 unsigned long delta_jiffies = jiffies - t->sched_info.last_arrival;
599 unsigned long diff = jiffies - t->sched_info.last_arrival;
600
601 t->sched_info.cpu_time += diff;
602 623
603 if (rq) 624 t->sched_info.cpu_time += delta_jiffies;
604 rq->rq_sched_info.cpu_time += diff; 625 rq_sched_info_depart(task_rq(t), delta_jiffies);
605} 626}
606 627
607/* 628/*
@@ -610,7 +631,7 @@ static inline void sched_info_depart(struct task_struct *t)
610 * the idle task.) We are only called when prev != next. 631 * the idle task.) We are only called when prev != next.
611 */ 632 */
612static inline void 633static inline void
613sched_info_switch(struct task_struct *prev, struct task_struct *next) 634__sched_info_switch(struct task_struct *prev, struct task_struct *next)
614{ 635{
615 struct rq *rq = task_rq(prev); 636 struct rq *rq = task_rq(prev);
616 637
@@ -625,10 +646,16 @@ sched_info_switch(struct task_struct *prev, struct task_struct *next)
625 if (next != rq->idle) 646 if (next != rq->idle)
626 sched_info_arrive(next); 647 sched_info_arrive(next);
627} 648}
649static inline void
650sched_info_switch(struct task_struct *prev, struct task_struct *next)
651{
652 if (unlikely(sched_info_on()))
653 __sched_info_switch(prev, next);
654}
628#else 655#else
629#define sched_info_queued(t) do { } while (0) 656#define sched_info_queued(t) do { } while (0)
630#define sched_info_switch(t, next) do { } while (0) 657#define sched_info_switch(t, next) do { } while (0)
631#endif /* CONFIG_SCHEDSTATS */ 658#endif /* CONFIG_SCHEDSTATS || CONFIG_TASK_DELAY_ACCT */
632 659
633/* 660/*
634 * Adding/removing a task to/from a priority array: 661 * Adding/removing a task to/from a priority array:
@@ -1530,8 +1557,9 @@ void fastcall sched_fork(struct task_struct *p, int clone_flags)
1530 1557
1531 INIT_LIST_HEAD(&p->run_list); 1558 INIT_LIST_HEAD(&p->run_list);
1532 p->array = NULL; 1559 p->array = NULL;
1533#ifdef CONFIG_SCHEDSTATS 1560#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT)
1534 memset(&p->sched_info, 0, sizeof(p->sched_info)); 1561 if (unlikely(sched_info_on()))
1562 memset(&p->sched_info, 0, sizeof(p->sched_info));
1535#endif 1563#endif
1536#if defined(CONFIG_SMP) && defined(__ARCH_WANT_UNLOCKED_CTXSW) 1564#if defined(CONFIG_SMP) && defined(__ARCH_WANT_UNLOCKED_CTXSW)
1537 p->oncpu = 0; 1565 p->oncpu = 0;
@@ -1788,7 +1816,15 @@ context_switch(struct rq *rq, struct task_struct *prev,
1788 WARN_ON(rq->prev_mm); 1816 WARN_ON(rq->prev_mm);
1789 rq->prev_mm = oldmm; 1817 rq->prev_mm = oldmm;
1790 } 1818 }
1819 /*
1820 * Since the runqueue lock will be released by the next
1821 * task (which is an invalid locking op but in the case
1822 * of the scheduler it's an obvious special-case), so we
1823 * do an early lockdep release here:
1824 */
1825#ifndef __ARCH_WANT_UNLOCKED_CTXSW
1791 spin_release(&rq->lock.dep_map, 1, _THIS_IP_); 1826 spin_release(&rq->lock.dep_map, 1, _THIS_IP_);
1827#endif
1792 1828
1793 /* Here we just switch the register state and the stack. */ 1829 /* Here we just switch the register state and the stack. */
1794 switch_to(prev, next, prev); 1830 switch_to(prev, next, prev);
@@ -3384,7 +3420,7 @@ EXPORT_SYMBOL(schedule);
3384 3420
3385#ifdef CONFIG_PREEMPT 3421#ifdef CONFIG_PREEMPT
3386/* 3422/*
3387 * this is is the entry point to schedule() from in-kernel preemption 3423 * this is the entry point to schedule() from in-kernel preemption
3388 * off of preempt_enable. Kernel preemptions off return from interrupt 3424 * off of preempt_enable. Kernel preemptions off return from interrupt
3389 * occur there and call schedule directly. 3425 * occur there and call schedule directly.
3390 */ 3426 */
@@ -3427,7 +3463,7 @@ need_resched:
3427EXPORT_SYMBOL(preempt_schedule); 3463EXPORT_SYMBOL(preempt_schedule);
3428 3464
3429/* 3465/*
3430 * this is is the entry point to schedule() from kernel preemption 3466 * this is the entry point to schedule() from kernel preemption
3431 * off of irq context. 3467 * off of irq context.
3432 * Note, that this is called and return with irqs disabled. This will 3468 * Note, that this is called and return with irqs disabled. This will
3433 * protect us against recursive calling from irq. 3469 * protect us against recursive calling from irq.
@@ -3439,7 +3475,7 @@ asmlinkage void __sched preempt_schedule_irq(void)
3439 struct task_struct *task = current; 3475 struct task_struct *task = current;
3440 int saved_lock_depth; 3476 int saved_lock_depth;
3441#endif 3477#endif
3442 /* Catch callers which need to be fixed*/ 3478 /* Catch callers which need to be fixed */
3443 BUG_ON(ti->preempt_count || !irqs_disabled()); 3479 BUG_ON(ti->preempt_count || !irqs_disabled());
3444 3480
3445need_resched: 3481need_resched:
@@ -4420,9 +4456,9 @@ asmlinkage long sys_sched_yield(void)
4420 return 0; 4456 return 0;
4421} 4457}
4422 4458
4423static inline int __resched_legal(void) 4459static inline int __resched_legal(int expected_preempt_count)
4424{ 4460{
4425 if (unlikely(preempt_count())) 4461 if (unlikely(preempt_count() != expected_preempt_count))
4426 return 0; 4462 return 0;
4427 if (unlikely(system_state != SYSTEM_RUNNING)) 4463 if (unlikely(system_state != SYSTEM_RUNNING))
4428 return 0; 4464 return 0;
@@ -4448,7 +4484,7 @@ static void __cond_resched(void)
4448 4484
4449int __sched cond_resched(void) 4485int __sched cond_resched(void)
4450{ 4486{
4451 if (need_resched() && __resched_legal()) { 4487 if (need_resched() && __resched_legal(0)) {
4452 __cond_resched(); 4488 __cond_resched();
4453 return 1; 4489 return 1;
4454 } 4490 }
@@ -4474,7 +4510,7 @@ int cond_resched_lock(spinlock_t *lock)
4474 ret = 1; 4510 ret = 1;
4475 spin_lock(lock); 4511 spin_lock(lock);
4476 } 4512 }
4477 if (need_resched() && __resched_legal()) { 4513 if (need_resched() && __resched_legal(1)) {
4478 spin_release(&lock->dep_map, 1, _THIS_IP_); 4514 spin_release(&lock->dep_map, 1, _THIS_IP_);
4479 _raw_spin_unlock(lock); 4515 _raw_spin_unlock(lock);
4480 preempt_enable_no_resched(); 4516 preempt_enable_no_resched();
@@ -4490,7 +4526,7 @@ int __sched cond_resched_softirq(void)
4490{ 4526{
4491 BUG_ON(!in_softirq()); 4527 BUG_ON(!in_softirq());
4492 4528
4493 if (need_resched() && __resched_legal()) { 4529 if (need_resched() && __resched_legal(0)) {
4494 raw_local_irq_disable(); 4530 raw_local_irq_disable();
4495 _local_bh_enable(); 4531 _local_bh_enable();
4496 raw_local_irq_enable(); 4532 raw_local_irq_enable();
@@ -4526,9 +4562,11 @@ void __sched io_schedule(void)
4526{ 4562{
4527 struct rq *rq = &__raw_get_cpu_var(runqueues); 4563 struct rq *rq = &__raw_get_cpu_var(runqueues);
4528 4564
4565 delayacct_blkio_start();
4529 atomic_inc(&rq->nr_iowait); 4566 atomic_inc(&rq->nr_iowait);
4530 schedule(); 4567 schedule();
4531 atomic_dec(&rq->nr_iowait); 4568 atomic_dec(&rq->nr_iowait);
4569 delayacct_blkio_end();
4532} 4570}
4533EXPORT_SYMBOL(io_schedule); 4571EXPORT_SYMBOL(io_schedule);
4534 4572
@@ -4537,9 +4575,11 @@ long __sched io_schedule_timeout(long timeout)
4537 struct rq *rq = &__raw_get_cpu_var(runqueues); 4575 struct rq *rq = &__raw_get_cpu_var(runqueues);
4538 long ret; 4576 long ret;
4539 4577
4578 delayacct_blkio_start();
4540 atomic_inc(&rq->nr_iowait); 4579 atomic_inc(&rq->nr_iowait);
4541 ret = schedule_timeout(timeout); 4580 ret = schedule_timeout(timeout);
4542 atomic_dec(&rq->nr_iowait); 4581 atomic_dec(&rq->nr_iowait);
4582 delayacct_blkio_end();
4543 return ret; 4583 return ret;
4544} 4584}
4545 4585
@@ -4650,7 +4690,7 @@ static inline struct task_struct *younger_sibling(struct task_struct *p)
4650 return list_entry(p->sibling.next,struct task_struct,sibling); 4690 return list_entry(p->sibling.next,struct task_struct,sibling);
4651} 4691}
4652 4692
4653static const char *stat_nam[] = { "R", "S", "D", "T", "t", "Z", "X" }; 4693static const char stat_nam[] = "RSDTtZX";
4654 4694
4655static void show_task(struct task_struct *p) 4695static void show_task(struct task_struct *p)
4656{ 4696{
@@ -4658,12 +4698,9 @@ static void show_task(struct task_struct *p)
4658 unsigned long free = 0; 4698 unsigned long free = 0;
4659 unsigned state; 4699 unsigned state;
4660 4700
4661 printk("%-13.13s ", p->comm);
4662 state = p->state ? __ffs(p->state) + 1 : 0; 4701 state = p->state ? __ffs(p->state) + 1 : 0;
4663 if (state < ARRAY_SIZE(stat_nam)) 4702 printk("%-13.13s %c", p->comm,
4664 printk(stat_nam[state]); 4703 state < sizeof(stat_nam) - 1 ? stat_nam[state] : '?');
4665 else
4666 printk("?");
4667#if (BITS_PER_LONG == 32) 4704#if (BITS_PER_LONG == 32)
4668 if (state == TASK_RUNNING) 4705 if (state == TASK_RUNNING)
4669 printk(" running "); 4706 printk(" running ");
@@ -4877,7 +4914,7 @@ static int __migrate_task(struct task_struct *p, int src_cpu, int dest_cpu)
4877 p->timestamp = p->timestamp - rq_src->timestamp_last_tick 4914 p->timestamp = p->timestamp - rq_src->timestamp_last_tick
4878 + rq_dest->timestamp_last_tick; 4915 + rq_dest->timestamp_last_tick;
4879 deactivate_task(p, rq_src); 4916 deactivate_task(p, rq_src);
4880 activate_task(p, rq_dest, 0); 4917 __activate_task(p, rq_dest);
4881 if (TASK_PREEMPTS_CURR(p, rq_dest)) 4918 if (TASK_PREEMPTS_CURR(p, rq_dest))
4882 resched_task(rq_dest->curr); 4919 resched_task(rq_dest->curr);
4883 } 4920 }
@@ -5776,7 +5813,7 @@ static unsigned long long measure_migration_cost(int cpu1, int cpu2)
5776 cache = vmalloc(max_size); 5813 cache = vmalloc(max_size);
5777 if (!cache) { 5814 if (!cache) {
5778 printk("could not vmalloc %d bytes for cache!\n", 2*max_size); 5815 printk("could not vmalloc %d bytes for cache!\n", 2*max_size);
5779 return 1000000; // return 1 msec on very small boxen 5816 return 1000000; /* return 1 msec on very small boxen */
5780 } 5817 }
5781 5818
5782 while (size <= max_size) { 5819 while (size <= max_size) {
@@ -6457,7 +6494,12 @@ static int build_sched_domains(const cpumask_t *cpu_map)
6457 for (i = 0; i < MAX_NUMNODES; i++) 6494 for (i = 0; i < MAX_NUMNODES; i++)
6458 init_numa_sched_groups_power(sched_group_nodes[i]); 6495 init_numa_sched_groups_power(sched_group_nodes[i]);
6459 6496
6460 init_numa_sched_groups_power(sched_group_allnodes); 6497 if (sched_group_allnodes) {
6498 int group = cpu_to_allnodes_group(first_cpu(*cpu_map));
6499 struct sched_group *sg = &sched_group_allnodes[group];
6500
6501 init_numa_sched_groups_power(sg);
6502 }
6461#endif 6503#endif
6462 6504
6463 /* Attach the domains */ 6505 /* Attach the domains */
@@ -6724,6 +6766,11 @@ void __init sched_init(void)
6724 } 6766 }
6725 6767
6726 set_load_weight(&init_task); 6768 set_load_weight(&init_task);
6769
6770#ifdef CONFIG_RT_MUTEXES
6771 plist_head_init(&init_task.pi_waiters, &init_task.pi_lock);
6772#endif
6773
6727 /* 6774 /*
6728 * The boot idle thread does lazy MMU switching as well: 6775 * The boot idle thread does lazy MMU switching as well:
6729 */ 6776 */
diff --git a/kernel/signal.c b/kernel/signal.c
index 7fe874d12fae..bfdb5686fa3e 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -791,22 +791,31 @@ out:
791/* 791/*
792 * Force a signal that the process can't ignore: if necessary 792 * Force a signal that the process can't ignore: if necessary
793 * we unblock the signal and change any SIG_IGN to SIG_DFL. 793 * we unblock the signal and change any SIG_IGN to SIG_DFL.
794 *
795 * Note: If we unblock the signal, we always reset it to SIG_DFL,
796 * since we do not want to have a signal handler that was blocked
797 * be invoked when user space had explicitly blocked it.
798 *
799 * We don't want to have recursive SIGSEGV's etc, for example.
794 */ 800 */
795
796int 801int
797force_sig_info(int sig, struct siginfo *info, struct task_struct *t) 802force_sig_info(int sig, struct siginfo *info, struct task_struct *t)
798{ 803{
799 unsigned long int flags; 804 unsigned long int flags;
800 int ret; 805 int ret, blocked, ignored;
806 struct k_sigaction *action;
801 807
802 spin_lock_irqsave(&t->sighand->siglock, flags); 808 spin_lock_irqsave(&t->sighand->siglock, flags);
803 if (t->sighand->action[sig-1].sa.sa_handler == SIG_IGN) { 809 action = &t->sighand->action[sig-1];
804 t->sighand->action[sig-1].sa.sa_handler = SIG_DFL; 810 ignored = action->sa.sa_handler == SIG_IGN;
805 } 811 blocked = sigismember(&t->blocked, sig);
806 if (sigismember(&t->blocked, sig)) { 812 if (blocked || ignored) {
807 sigdelset(&t->blocked, sig); 813 action->sa.sa_handler = SIG_DFL;
814 if (blocked) {
815 sigdelset(&t->blocked, sig);
816 recalc_sigpending_tsk(t);
817 }
808 } 818 }
809 recalc_sigpending_tsk(t);
810 ret = specific_send_sig_info(sig, info, t); 819 ret = specific_send_sig_info(sig, info, t);
811 spin_unlock_irqrestore(&t->sighand->siglock, flags); 820 spin_unlock_irqrestore(&t->sighand->siglock, flags);
812 821
diff --git a/kernel/softirq.c b/kernel/softirq.c
index 215541e26c1a..3789ca98197c 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -65,6 +65,7 @@ static inline void wakeup_softirqd(void)
65 * This one is for softirq.c-internal use, 65 * This one is for softirq.c-internal use,
66 * where hardirqs are disabled legitimately: 66 * where hardirqs are disabled legitimately:
67 */ 67 */
68#ifdef CONFIG_TRACE_IRQFLAGS
68static void __local_bh_disable(unsigned long ip) 69static void __local_bh_disable(unsigned long ip)
69{ 70{
70 unsigned long flags; 71 unsigned long flags;
@@ -80,6 +81,13 @@ static void __local_bh_disable(unsigned long ip)
80 trace_softirqs_off(ip); 81 trace_softirqs_off(ip);
81 raw_local_irq_restore(flags); 82 raw_local_irq_restore(flags);
82} 83}
84#else /* !CONFIG_TRACE_IRQFLAGS */
85static inline void __local_bh_disable(unsigned long ip)
86{
87 add_preempt_count(SOFTIRQ_OFFSET);
88 barrier();
89}
90#endif /* CONFIG_TRACE_IRQFLAGS */
83 91
84void local_bh_disable(void) 92void local_bh_disable(void)
85{ 93{
@@ -121,12 +129,16 @@ EXPORT_SYMBOL(_local_bh_enable);
121 129
122void local_bh_enable(void) 130void local_bh_enable(void)
123{ 131{
132#ifdef CONFIG_TRACE_IRQFLAGS
124 unsigned long flags; 133 unsigned long flags;
125 134
126 WARN_ON_ONCE(in_irq()); 135 WARN_ON_ONCE(in_irq());
136#endif
127 WARN_ON_ONCE(irqs_disabled()); 137 WARN_ON_ONCE(irqs_disabled());
128 138
139#ifdef CONFIG_TRACE_IRQFLAGS
129 local_irq_save(flags); 140 local_irq_save(flags);
141#endif
130 /* 142 /*
131 * Are softirqs going to be turned on now: 143 * Are softirqs going to be turned on now:
132 */ 144 */
@@ -142,18 +154,22 @@ void local_bh_enable(void)
142 do_softirq(); 154 do_softirq();
143 155
144 dec_preempt_count(); 156 dec_preempt_count();
157#ifdef CONFIG_TRACE_IRQFLAGS
145 local_irq_restore(flags); 158 local_irq_restore(flags);
159#endif
146 preempt_check_resched(); 160 preempt_check_resched();
147} 161}
148EXPORT_SYMBOL(local_bh_enable); 162EXPORT_SYMBOL(local_bh_enable);
149 163
150void local_bh_enable_ip(unsigned long ip) 164void local_bh_enable_ip(unsigned long ip)
151{ 165{
166#ifdef CONFIG_TRACE_IRQFLAGS
152 unsigned long flags; 167 unsigned long flags;
153 168
154 WARN_ON_ONCE(in_irq()); 169 WARN_ON_ONCE(in_irq());
155 170
156 local_irq_save(flags); 171 local_irq_save(flags);
172#endif
157 /* 173 /*
158 * Are softirqs going to be turned on now: 174 * Are softirqs going to be turned on now:
159 */ 175 */
@@ -169,7 +185,9 @@ void local_bh_enable_ip(unsigned long ip)
169 do_softirq(); 185 do_softirq();
170 186
171 dec_preempt_count(); 187 dec_preempt_count();
188#ifdef CONFIG_TRACE_IRQFLAGS
172 local_irq_restore(flags); 189 local_irq_restore(flags);
190#endif
173 preempt_check_resched(); 191 preempt_check_resched();
174} 192}
175EXPORT_SYMBOL(local_bh_enable_ip); 193EXPORT_SYMBOL(local_bh_enable_ip);
@@ -311,8 +329,6 @@ void open_softirq(int nr, void (*action)(struct softirq_action*), void *data)
311 softirq_vec[nr].action = action; 329 softirq_vec[nr].action = action;
312} 330}
313 331
314EXPORT_SYMBOL(open_softirq);
315
316/* Tasklets */ 332/* Tasklets */
317struct tasklet_head 333struct tasklet_head
318{ 334{
@@ -549,7 +565,7 @@ static void takeover_tasklets(unsigned int cpu)
549} 565}
550#endif /* CONFIG_HOTPLUG_CPU */ 566#endif /* CONFIG_HOTPLUG_CPU */
551 567
552static int __devinit cpu_callback(struct notifier_block *nfb, 568static int __cpuinit cpu_callback(struct notifier_block *nfb,
553 unsigned long action, 569 unsigned long action,
554 void *hcpu) 570 void *hcpu)
555{ 571{
@@ -589,7 +605,7 @@ static int __devinit cpu_callback(struct notifier_block *nfb,
589 return NOTIFY_OK; 605 return NOTIFY_OK;
590} 606}
591 607
592static struct notifier_block __devinitdata cpu_nfb = { 608static struct notifier_block __cpuinitdata cpu_nfb = {
593 .notifier_call = cpu_callback 609 .notifier_call = cpu_callback
594}; 610};
595 611
diff --git a/kernel/softlockup.c b/kernel/softlockup.c
index 6b76caa22981..03e6a2b0b787 100644
--- a/kernel/softlockup.c
+++ b/kernel/softlockup.c
@@ -104,7 +104,7 @@ static int watchdog(void * __bind_cpu)
104/* 104/*
105 * Create/destroy watchdog threads as CPUs come and go: 105 * Create/destroy watchdog threads as CPUs come and go:
106 */ 106 */
107static int __devinit 107static int __cpuinit
108cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) 108cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
109{ 109{
110 int hotcpu = (unsigned long)hcpu; 110 int hotcpu = (unsigned long)hcpu;
@@ -142,7 +142,7 @@ cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
142 return NOTIFY_OK; 142 return NOTIFY_OK;
143} 143}
144 144
145static struct notifier_block __devinitdata cpu_nfb = { 145static struct notifier_block __cpuinitdata cpu_nfb = {
146 .notifier_call = cpu_callback 146 .notifier_call = cpu_callback
147}; 147};
148 148
diff --git a/kernel/sys.c b/kernel/sys.c
index dbb3b9c7ea64..e236f98f7ec5 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -1983,7 +1983,7 @@ asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3,
1983 error = current->mm->dumpable; 1983 error = current->mm->dumpable;
1984 break; 1984 break;
1985 case PR_SET_DUMPABLE: 1985 case PR_SET_DUMPABLE:
1986 if (arg2 < 0 || arg2 > 2) { 1986 if (arg2 < 0 || arg2 > 1) {
1987 error = -EINVAL; 1987 error = -EINVAL;
1988 break; 1988 break;
1989 } 1989 }
diff --git a/kernel/taskstats.c b/kernel/taskstats.c
new file mode 100644
index 000000000000..e78187657330
--- /dev/null
+++ b/kernel/taskstats.c
@@ -0,0 +1,564 @@
1/*
2 * taskstats.c - Export per-task statistics to userland
3 *
4 * Copyright (C) Shailabh Nagar, IBM Corp. 2006
5 * (C) Balbir Singh, IBM Corp. 2006
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 */
18
19#include <linux/kernel.h>
20#include <linux/taskstats_kern.h>
21#include <linux/delayacct.h>
22#include <linux/cpumask.h>
23#include <linux/percpu.h>
24#include <net/genetlink.h>
25#include <asm/atomic.h>
26
27/*
28 * Maximum length of a cpumask that can be specified in
29 * the TASKSTATS_CMD_ATTR_REGISTER/DEREGISTER_CPUMASK attribute
30 */
31#define TASKSTATS_CPUMASK_MAXLEN (100+6*NR_CPUS)
32
33static DEFINE_PER_CPU(__u32, taskstats_seqnum) = { 0 };
34static int family_registered;
35kmem_cache_t *taskstats_cache;
36
37static struct genl_family family = {
38 .id = GENL_ID_GENERATE,
39 .name = TASKSTATS_GENL_NAME,
40 .version = TASKSTATS_GENL_VERSION,
41 .maxattr = TASKSTATS_CMD_ATTR_MAX,
42};
43
44static struct nla_policy taskstats_cmd_get_policy[TASKSTATS_CMD_ATTR_MAX+1]
45__read_mostly = {
46 [TASKSTATS_CMD_ATTR_PID] = { .type = NLA_U32 },
47 [TASKSTATS_CMD_ATTR_TGID] = { .type = NLA_U32 },
48 [TASKSTATS_CMD_ATTR_REGISTER_CPUMASK] = { .type = NLA_STRING },
49 [TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK] = { .type = NLA_STRING },};
50
51struct listener {
52 struct list_head list;
53 pid_t pid;
54 char valid;
55};
56
57struct listener_list {
58 struct rw_semaphore sem;
59 struct list_head list;
60};
61static DEFINE_PER_CPU(struct listener_list, listener_array);
62
63enum actions {
64 REGISTER,
65 DEREGISTER,
66 CPU_DONT_CARE
67};
68
69static int prepare_reply(struct genl_info *info, u8 cmd, struct sk_buff **skbp,
70 void **replyp, size_t size)
71{
72 struct sk_buff *skb;
73 void *reply;
74
75 /*
76 * If new attributes are added, please revisit this allocation
77 */
78 skb = nlmsg_new(size);
79 if (!skb)
80 return -ENOMEM;
81
82 if (!info) {
83 int seq = get_cpu_var(taskstats_seqnum)++;
84 put_cpu_var(taskstats_seqnum);
85
86 reply = genlmsg_put(skb, 0, seq,
87 family.id, 0, 0,
88 cmd, family.version);
89 } else
90 reply = genlmsg_put(skb, info->snd_pid, info->snd_seq,
91 family.id, 0, 0,
92 cmd, family.version);
93 if (reply == NULL) {
94 nlmsg_free(skb);
95 return -EINVAL;
96 }
97
98 *skbp = skb;
99 *replyp = reply;
100 return 0;
101}
102
103/*
104 * Send taskstats data in @skb to listener with nl_pid @pid
105 */
106static int send_reply(struct sk_buff *skb, pid_t pid)
107{
108 struct genlmsghdr *genlhdr = nlmsg_data((struct nlmsghdr *)skb->data);
109 void *reply = genlmsg_data(genlhdr);
110 int rc;
111
112 rc = genlmsg_end(skb, reply);
113 if (rc < 0) {
114 nlmsg_free(skb);
115 return rc;
116 }
117
118 return genlmsg_unicast(skb, pid);
119}
120
121/*
122 * Send taskstats data in @skb to listeners registered for @cpu's exit data
123 */
124static void send_cpu_listeners(struct sk_buff *skb, unsigned int cpu)
125{
126 struct genlmsghdr *genlhdr = nlmsg_data((struct nlmsghdr *)skb->data);
127 struct listener_list *listeners;
128 struct listener *s, *tmp;
129 struct sk_buff *skb_next, *skb_cur = skb;
130 void *reply = genlmsg_data(genlhdr);
131 int rc, delcount = 0;
132
133 rc = genlmsg_end(skb, reply);
134 if (rc < 0) {
135 nlmsg_free(skb);
136 return;
137 }
138
139 rc = 0;
140 listeners = &per_cpu(listener_array, cpu);
141 down_read(&listeners->sem);
142 list_for_each_entry(s, &listeners->list, list) {
143 skb_next = NULL;
144 if (!list_is_last(&s->list, &listeners->list)) {
145 skb_next = skb_clone(skb_cur, GFP_KERNEL);
146 if (!skb_next)
147 break;
148 }
149 rc = genlmsg_unicast(skb_cur, s->pid);
150 if (rc == -ECONNREFUSED) {
151 s->valid = 0;
152 delcount++;
153 }
154 skb_cur = skb_next;
155 }
156 up_read(&listeners->sem);
157
158 if (skb_cur)
159 nlmsg_free(skb_cur);
160
161 if (!delcount)
162 return;
163
164 /* Delete invalidated entries */
165 down_write(&listeners->sem);
166 list_for_each_entry_safe(s, tmp, &listeners->list, list) {
167 if (!s->valid) {
168 list_del(&s->list);
169 kfree(s);
170 }
171 }
172 up_write(&listeners->sem);
173}
174
175static int fill_pid(pid_t pid, struct task_struct *pidtsk,
176 struct taskstats *stats)
177{
178 int rc = 0;
179 struct task_struct *tsk = pidtsk;
180
181 if (!pidtsk) {
182 read_lock(&tasklist_lock);
183 tsk = find_task_by_pid(pid);
184 if (!tsk) {
185 read_unlock(&tasklist_lock);
186 return -ESRCH;
187 }
188 get_task_struct(tsk);
189 read_unlock(&tasklist_lock);
190 } else
191 get_task_struct(tsk);
192
193 /*
194 * Each accounting subsystem adds calls to its functions to
195 * fill in relevant parts of struct taskstsats as follows
196 *
197 * per-task-foo(stats, tsk);
198 */
199
200 delayacct_add_tsk(stats, tsk);
201 stats->version = TASKSTATS_VERSION;
202
203 /* Define err: label here if needed */
204 put_task_struct(tsk);
205 return rc;
206
207}
208
209static int fill_tgid(pid_t tgid, struct task_struct *tgidtsk,
210 struct taskstats *stats)
211{
212 struct task_struct *tsk, *first;
213 unsigned long flags;
214
215 /*
216 * Add additional stats from live tasks except zombie thread group
217 * leaders who are already counted with the dead tasks
218 */
219 first = tgidtsk;
220 if (!first) {
221 read_lock(&tasklist_lock);
222 first = find_task_by_pid(tgid);
223 if (!first) {
224 read_unlock(&tasklist_lock);
225 return -ESRCH;
226 }
227 get_task_struct(first);
228 read_unlock(&tasklist_lock);
229 } else
230 get_task_struct(first);
231
232 /* Start with stats from dead tasks */
233 spin_lock_irqsave(&first->signal->stats_lock, flags);
234 if (first->signal->stats)
235 memcpy(stats, first->signal->stats, sizeof(*stats));
236 spin_unlock_irqrestore(&first->signal->stats_lock, flags);
237
238 tsk = first;
239 read_lock(&tasklist_lock);
240 do {
241 if (tsk->exit_state == EXIT_ZOMBIE && thread_group_leader(tsk))
242 continue;
243 /*
244 * Accounting subsystem can call its functions here to
245 * fill in relevant parts of struct taskstsats as follows
246 *
247 * per-task-foo(stats, tsk);
248 */
249 delayacct_add_tsk(stats, tsk);
250
251 } while_each_thread(first, tsk);
252 read_unlock(&tasklist_lock);
253 stats->version = TASKSTATS_VERSION;
254
255 /*
256 * Accounting subsytems can also add calls here to modify
257 * fields of taskstats.
258 */
259
260 return 0;
261}
262
263
264static void fill_tgid_exit(struct task_struct *tsk)
265{
266 unsigned long flags;
267
268 spin_lock_irqsave(&tsk->signal->stats_lock, flags);
269 if (!tsk->signal->stats)
270 goto ret;
271
272 /*
273 * Each accounting subsystem calls its functions here to
274 * accumalate its per-task stats for tsk, into the per-tgid structure
275 *
276 * per-task-foo(tsk->signal->stats, tsk);
277 */
278 delayacct_add_tsk(tsk->signal->stats, tsk);
279ret:
280 spin_unlock_irqrestore(&tsk->signal->stats_lock, flags);
281 return;
282}
283
284static int add_del_listener(pid_t pid, cpumask_t *maskp, int isadd)
285{
286 struct listener_list *listeners;
287 struct listener *s, *tmp;
288 unsigned int cpu;
289 cpumask_t mask = *maskp;
290
291 if (!cpus_subset(mask, cpu_possible_map))
292 return -EINVAL;
293
294 if (isadd == REGISTER) {
295 for_each_cpu_mask(cpu, mask) {
296 s = kmalloc_node(sizeof(struct listener), GFP_KERNEL,
297 cpu_to_node(cpu));
298 if (!s)
299 goto cleanup;
300 s->pid = pid;
301 INIT_LIST_HEAD(&s->list);
302 s->valid = 1;
303
304 listeners = &per_cpu(listener_array, cpu);
305 down_write(&listeners->sem);
306 list_add(&s->list, &listeners->list);
307 up_write(&listeners->sem);
308 }
309 return 0;
310 }
311
312 /* Deregister or cleanup */
313cleanup:
314 for_each_cpu_mask(cpu, mask) {
315 listeners = &per_cpu(listener_array, cpu);
316 down_write(&listeners->sem);
317 list_for_each_entry_safe(s, tmp, &listeners->list, list) {
318 if (s->pid == pid) {
319 list_del(&s->list);
320 kfree(s);
321 break;
322 }
323 }
324 up_write(&listeners->sem);
325 }
326 return 0;
327}
328
329static int parse(struct nlattr *na, cpumask_t *mask)
330{
331 char *data;
332 int len;
333 int ret;
334
335 if (na == NULL)
336 return 1;
337 len = nla_len(na);
338 if (len > TASKSTATS_CPUMASK_MAXLEN)
339 return -E2BIG;
340 if (len < 1)
341 return -EINVAL;
342 data = kmalloc(len, GFP_KERNEL);
343 if (!data)
344 return -ENOMEM;
345 nla_strlcpy(data, na, len);
346 ret = cpulist_parse(data, *mask);
347 kfree(data);
348 return ret;
349}
350
351static int taskstats_user_cmd(struct sk_buff *skb, struct genl_info *info)
352{
353 int rc = 0;
354 struct sk_buff *rep_skb;
355 struct taskstats stats;
356 void *reply;
357 size_t size;
358 struct nlattr *na;
359 cpumask_t mask;
360
361 rc = parse(info->attrs[TASKSTATS_CMD_ATTR_REGISTER_CPUMASK], &mask);
362 if (rc < 0)
363 return rc;
364 if (rc == 0)
365 return add_del_listener(info->snd_pid, &mask, REGISTER);
366
367 rc = parse(info->attrs[TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK], &mask);
368 if (rc < 0)
369 return rc;
370 if (rc == 0)
371 return add_del_listener(info->snd_pid, &mask, DEREGISTER);
372
373 /*
374 * Size includes space for nested attributes
375 */
376 size = nla_total_size(sizeof(u32)) +
377 nla_total_size(sizeof(struct taskstats)) + nla_total_size(0);
378
379 memset(&stats, 0, sizeof(stats));
380 rc = prepare_reply(info, TASKSTATS_CMD_NEW, &rep_skb, &reply, size);
381 if (rc < 0)
382 return rc;
383
384 if (info->attrs[TASKSTATS_CMD_ATTR_PID]) {
385 u32 pid = nla_get_u32(info->attrs[TASKSTATS_CMD_ATTR_PID]);
386 rc = fill_pid(pid, NULL, &stats);
387 if (rc < 0)
388 goto err;
389
390 na = nla_nest_start(rep_skb, TASKSTATS_TYPE_AGGR_PID);
391 NLA_PUT_U32(rep_skb, TASKSTATS_TYPE_PID, pid);
392 NLA_PUT_TYPE(rep_skb, struct taskstats, TASKSTATS_TYPE_STATS,
393 stats);
394 } else if (info->attrs[TASKSTATS_CMD_ATTR_TGID]) {
395 u32 tgid = nla_get_u32(info->attrs[TASKSTATS_CMD_ATTR_TGID]);
396 rc = fill_tgid(tgid, NULL, &stats);
397 if (rc < 0)
398 goto err;
399
400 na = nla_nest_start(rep_skb, TASKSTATS_TYPE_AGGR_TGID);
401 NLA_PUT_U32(rep_skb, TASKSTATS_TYPE_TGID, tgid);
402 NLA_PUT_TYPE(rep_skb, struct taskstats, TASKSTATS_TYPE_STATS,
403 stats);
404 } else {
405 rc = -EINVAL;
406 goto err;
407 }
408
409 nla_nest_end(rep_skb, na);
410
411 return send_reply(rep_skb, info->snd_pid);
412
413nla_put_failure:
414 return genlmsg_cancel(rep_skb, reply);
415err:
416 nlmsg_free(rep_skb);
417 return rc;
418}
419
420void taskstats_exit_alloc(struct taskstats **ptidstats, unsigned int *mycpu)
421{
422 struct listener_list *listeners;
423 struct taskstats *tmp;
424 /*
425 * This is the cpu on which the task is exiting currently and will
426 * be the one for which the exit event is sent, even if the cpu
427 * on which this function is running changes later.
428 */
429 *mycpu = raw_smp_processor_id();
430
431 *ptidstats = NULL;
432 tmp = kmem_cache_zalloc(taskstats_cache, SLAB_KERNEL);
433 if (!tmp)
434 return;
435
436 listeners = &per_cpu(listener_array, *mycpu);
437 down_read(&listeners->sem);
438 if (!list_empty(&listeners->list)) {
439 *ptidstats = tmp;
440 tmp = NULL;
441 }
442 up_read(&listeners->sem);
443 kfree(tmp);
444}
445
446/* Send pid data out on exit */
447void taskstats_exit_send(struct task_struct *tsk, struct taskstats *tidstats,
448 int group_dead, unsigned int mycpu)
449{
450 int rc;
451 struct sk_buff *rep_skb;
452 void *reply;
453 size_t size;
454 int is_thread_group;
455 struct nlattr *na;
456 unsigned long flags;
457
458 if (!family_registered || !tidstats)
459 return;
460
461 spin_lock_irqsave(&tsk->signal->stats_lock, flags);
462 is_thread_group = tsk->signal->stats ? 1 : 0;
463 spin_unlock_irqrestore(&tsk->signal->stats_lock, flags);
464
465 rc = 0;
466 /*
467 * Size includes space for nested attributes
468 */
469 size = nla_total_size(sizeof(u32)) +
470 nla_total_size(sizeof(struct taskstats)) + nla_total_size(0);
471
472 if (is_thread_group)
473 size = 2 * size; /* PID + STATS + TGID + STATS */
474
475 rc = prepare_reply(NULL, TASKSTATS_CMD_NEW, &rep_skb, &reply, size);
476 if (rc < 0)
477 goto ret;
478
479 rc = fill_pid(tsk->pid, tsk, tidstats);
480 if (rc < 0)
481 goto err_skb;
482
483 na = nla_nest_start(rep_skb, TASKSTATS_TYPE_AGGR_PID);
484 NLA_PUT_U32(rep_skb, TASKSTATS_TYPE_PID, (u32)tsk->pid);
485 NLA_PUT_TYPE(rep_skb, struct taskstats, TASKSTATS_TYPE_STATS,
486 *tidstats);
487 nla_nest_end(rep_skb, na);
488
489 if (!is_thread_group)
490 goto send;
491
492 /*
493 * tsk has/had a thread group so fill the tsk->signal->stats structure
494 * Doesn't matter if tsk is the leader or the last group member leaving
495 */
496
497 fill_tgid_exit(tsk);
498 if (!group_dead)
499 goto send;
500
501 na = nla_nest_start(rep_skb, TASKSTATS_TYPE_AGGR_TGID);
502 NLA_PUT_U32(rep_skb, TASKSTATS_TYPE_TGID, (u32)tsk->tgid);
503 /* No locking needed for tsk->signal->stats since group is dead */
504 NLA_PUT_TYPE(rep_skb, struct taskstats, TASKSTATS_TYPE_STATS,
505 *tsk->signal->stats);
506 nla_nest_end(rep_skb, na);
507
508send:
509 send_cpu_listeners(rep_skb, mycpu);
510 return;
511
512nla_put_failure:
513 genlmsg_cancel(rep_skb, reply);
514 goto ret;
515err_skb:
516 nlmsg_free(rep_skb);
517ret:
518 return;
519}
520
521static struct genl_ops taskstats_ops = {
522 .cmd = TASKSTATS_CMD_GET,
523 .doit = taskstats_user_cmd,
524 .policy = taskstats_cmd_get_policy,
525};
526
527/* Needed early in initialization */
528void __init taskstats_init_early(void)
529{
530 unsigned int i;
531
532 taskstats_cache = kmem_cache_create("taskstats_cache",
533 sizeof(struct taskstats),
534 0, SLAB_PANIC, NULL, NULL);
535 for_each_possible_cpu(i) {
536 INIT_LIST_HEAD(&(per_cpu(listener_array, i).list));
537 init_rwsem(&(per_cpu(listener_array, i).sem));
538 }
539}
540
541static int __init taskstats_init(void)
542{
543 int rc;
544
545 rc = genl_register_family(&family);
546 if (rc)
547 return rc;
548
549 rc = genl_register_ops(&family, &taskstats_ops);
550 if (rc < 0)
551 goto err;
552
553 family_registered = 1;
554 return 0;
555err:
556 genl_unregister_family(&family);
557 return rc;
558}
559
560/*
561 * late initcall ensures initialization of statistics collection
562 * mechanisms precedes initialization of the taskstats interface
563 */
564late_initcall(taskstats_init);
diff --git a/kernel/timer.c b/kernel/timer.c
index 396a3c024c2c..b650f04888ed 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -84,7 +84,7 @@ typedef struct tvec_t_base_s tvec_base_t;
84 84
85tvec_base_t boot_tvec_bases; 85tvec_base_t boot_tvec_bases;
86EXPORT_SYMBOL(boot_tvec_bases); 86EXPORT_SYMBOL(boot_tvec_bases);
87static DEFINE_PER_CPU(tvec_base_t *, tvec_bases) = { &boot_tvec_bases }; 87static DEFINE_PER_CPU(tvec_base_t *, tvec_bases) = &boot_tvec_bases;
88 88
89static inline void set_running_timer(tvec_base_t *base, 89static inline void set_running_timer(tvec_base_t *base,
90 struct timer_list *timer) 90 struct timer_list *timer)
@@ -374,6 +374,7 @@ int del_timer_sync(struct timer_list *timer)
374 int ret = try_to_del_timer_sync(timer); 374 int ret = try_to_del_timer_sync(timer);
375 if (ret >= 0) 375 if (ret >= 0)
376 return ret; 376 return ret;
377 cpu_relax();
377 } 378 }
378} 379}
379 380
@@ -407,7 +408,7 @@ static int cascade(tvec_base_t *base, tvec_t *tv, int index)
407 * This function cascades all vectors and executes all expired timer 408 * This function cascades all vectors and executes all expired timer
408 * vectors. 409 * vectors.
409 */ 410 */
410#define INDEX(N) (base->timer_jiffies >> (TVR_BITS + N * TVN_BITS)) & TVN_MASK 411#define INDEX(N) ((base->timer_jiffies >> (TVR_BITS + (N) * TVN_BITS)) & TVN_MASK)
411 412
412static inline void __run_timers(tvec_base_t *base) 413static inline void __run_timers(tvec_base_t *base)
413{ 414{
@@ -891,6 +892,7 @@ int do_settimeofday(struct timespec *tv)
891 set_normalized_timespec(&xtime, sec, nsec); 892 set_normalized_timespec(&xtime, sec, nsec);
892 set_normalized_timespec(&wall_to_monotonic, wtm_sec, wtm_nsec); 893 set_normalized_timespec(&wall_to_monotonic, wtm_sec, wtm_nsec);
893 894
895 clock->error = 0;
894 ntp_clear(); 896 ntp_clear();
895 897
896 write_sequnlock_irqrestore(&xtime_lock, flags); 898 write_sequnlock_irqrestore(&xtime_lock, flags);
@@ -967,6 +969,7 @@ void __init timekeeping_init(void)
967} 969}
968 970
969 971
972static int timekeeping_suspended;
970/* 973/*
971 * timekeeping_resume - Resumes the generic timekeeping subsystem. 974 * timekeeping_resume - Resumes the generic timekeeping subsystem.
972 * @dev: unused 975 * @dev: unused
@@ -982,6 +985,18 @@ static int timekeeping_resume(struct sys_device *dev)
982 write_seqlock_irqsave(&xtime_lock, flags); 985 write_seqlock_irqsave(&xtime_lock, flags);
983 /* restart the last cycle value */ 986 /* restart the last cycle value */
984 clock->cycle_last = clocksource_read(clock); 987 clock->cycle_last = clocksource_read(clock);
988 clock->error = 0;
989 timekeeping_suspended = 0;
990 write_sequnlock_irqrestore(&xtime_lock, flags);
991 return 0;
992}
993
994static int timekeeping_suspend(struct sys_device *dev, pm_message_t state)
995{
996 unsigned long flags;
997
998 write_seqlock_irqsave(&xtime_lock, flags);
999 timekeeping_suspended = 1;
985 write_sequnlock_irqrestore(&xtime_lock, flags); 1000 write_sequnlock_irqrestore(&xtime_lock, flags);
986 return 0; 1001 return 0;
987} 1002}
@@ -989,6 +1004,7 @@ static int timekeeping_resume(struct sys_device *dev)
989/* sysfs resume/suspend bits for timekeeping */ 1004/* sysfs resume/suspend bits for timekeeping */
990static struct sysdev_class timekeeping_sysclass = { 1005static struct sysdev_class timekeeping_sysclass = {
991 .resume = timekeeping_resume, 1006 .resume = timekeeping_resume,
1007 .suspend = timekeeping_suspend,
992 set_kset_name("timekeeping"), 1008 set_kset_name("timekeeping"),
993}; 1009};
994 1010
@@ -1008,52 +1024,52 @@ static int __init timekeeping_init_device(void)
1008device_initcall(timekeeping_init_device); 1024device_initcall(timekeeping_init_device);
1009 1025
1010/* 1026/*
1011 * If the error is already larger, we look ahead another tick, 1027 * If the error is already larger, we look ahead even further
1012 * to compensate for late or lost adjustments. 1028 * to compensate for late or lost adjustments.
1013 */ 1029 */
1014static __always_inline int clocksource_bigadjust(int sign, s64 error, s64 *interval, s64 *offset) 1030static __always_inline int clocksource_bigadjust(s64 error, s64 *interval, s64 *offset)
1015{ 1031{
1016 int adj; 1032 s64 tick_error, i;
1033 u32 look_ahead, adj;
1034 s32 error2, mult;
1017 1035
1018 /* 1036 /*
1019 * As soon as the machine is synchronized to the external time 1037 * Use the current error value to determine how much to look ahead.
1020 * source this should be the common case. 1038 * The larger the error the slower we adjust for it to avoid problems
1039 * with losing too many ticks, otherwise we would overadjust and
1040 * produce an even larger error. The smaller the adjustment the
1041 * faster we try to adjust for it, as lost ticks can do less harm
1042 * here. This is tuned so that an error of about 1 msec is adusted
1043 * within about 1 sec (or 2^20 nsec in 2^SHIFT_HZ ticks).
1021 */ 1044 */
1022 error >>= 2; 1045 error2 = clock->error >> (TICK_LENGTH_SHIFT + 22 - 2 * SHIFT_HZ);
1023 if (likely(sign > 0 ? error <= *interval : error >= *interval)) 1046 error2 = abs(error2);
1024 return sign; 1047 for (look_ahead = 0; error2 > 0; look_ahead++)
1048 error2 >>= 2;
1025 1049
1026 /* 1050 /*
1027 * An extra look ahead dampens the effect of the current error, 1051 * Now calculate the error in (1 << look_ahead) ticks, but first
1028 * which can grow quite large with continously late updates, as 1052 * remove the single look ahead already included in the error.
1029 * it would dominate the adjustment value and can lead to
1030 * oscillation.
1031 */ 1053 */
1032 error += current_tick_length() >> (TICK_LENGTH_SHIFT - clock->shift + 1); 1054 tick_error = current_tick_length() >> (TICK_LENGTH_SHIFT - clock->shift + 1);
1033 error -= clock->xtime_interval >> 1; 1055 tick_error -= clock->xtime_interval >> 1;
1034 1056 error = ((error - tick_error) >> look_ahead) + tick_error;
1035 adj = 0; 1057
1036 while (1) { 1058 /* Finally calculate the adjustment shift value. */
1037 error >>= 1; 1059 i = *interval;
1038 if (sign > 0 ? error <= *interval : error >= *interval) 1060 mult = 1;
1039 break; 1061 if (error < 0) {
1040 adj++; 1062 error = -error;
1063 *interval = -*interval;
1064 *offset = -*offset;
1065 mult = -1;
1041 } 1066 }
1042 1067 for (adj = 0; error > i; adj++)
1043 /* 1068 error >>= 1;
1044 * Add the current adjustments to the error and take the offset
1045 * into account, the latter can cause the error to be hardly
1046 * reduced at the next tick. Check the error again if there's
1047 * room for another adjustment, thus further reducing the error
1048 * which otherwise had to be corrected at the next update.
1049 */
1050 error = (error << 1) - *interval + *offset;
1051 if (sign > 0 ? error > *interval : error < *interval)
1052 adj++;
1053 1069
1054 *interval <<= adj; 1070 *interval <<= adj;
1055 *offset <<= adj; 1071 *offset <<= adj;
1056 return sign << adj; 1072 return mult << adj;
1057} 1073}
1058 1074
1059/* 1075/*
@@ -1068,11 +1084,19 @@ static void clocksource_adjust(struct clocksource *clock, s64 offset)
1068 1084
1069 error = clock->error >> (TICK_LENGTH_SHIFT - clock->shift - 1); 1085 error = clock->error >> (TICK_LENGTH_SHIFT - clock->shift - 1);
1070 if (error > interval) { 1086 if (error > interval) {
1071 adj = clocksource_bigadjust(1, error, &interval, &offset); 1087 error >>= 2;
1088 if (likely(error <= interval))
1089 adj = 1;
1090 else
1091 adj = clocksource_bigadjust(error, &interval, &offset);
1072 } else if (error < -interval) { 1092 } else if (error < -interval) {
1073 interval = -interval; 1093 error >>= 2;
1074 offset = -offset; 1094 if (likely(error >= -interval)) {
1075 adj = clocksource_bigadjust(-1, error, &interval, &offset); 1095 adj = -1;
1096 interval = -interval;
1097 offset = -offset;
1098 } else
1099 adj = clocksource_bigadjust(error, &interval, &offset);
1076 } else 1100 } else
1077 return; 1101 return;
1078 1102
@@ -1091,13 +1115,16 @@ static void update_wall_time(void)
1091{ 1115{
1092 cycle_t offset; 1116 cycle_t offset;
1093 1117
1094 clock->xtime_nsec += (s64)xtime.tv_nsec << clock->shift; 1118 /* Make sure we're fully resumed: */
1119 if (unlikely(timekeeping_suspended))
1120 return;
1095 1121
1096#ifdef CONFIG_GENERIC_TIME 1122#ifdef CONFIG_GENERIC_TIME
1097 offset = (clocksource_read(clock) - clock->cycle_last) & clock->mask; 1123 offset = (clocksource_read(clock) - clock->cycle_last) & clock->mask;
1098#else 1124#else
1099 offset = clock->cycle_interval; 1125 offset = clock->cycle_interval;
1100#endif 1126#endif
1127 clock->xtime_nsec += (s64)xtime.tv_nsec << clock->shift;
1101 1128
1102 /* normally this loop will run just once, however in the 1129 /* normally this loop will run just once, however in the
1103 * case of lost or late ticks, it will accumulate correctly. 1130 * case of lost or late ticks, it will accumulate correctly.
@@ -1129,7 +1156,7 @@ static void update_wall_time(void)
1129 clocksource_adjust(clock, offset); 1156 clocksource_adjust(clock, offset);
1130 1157
1131 /* store full nanoseconds into xtime */ 1158 /* store full nanoseconds into xtime */
1132 xtime.tv_nsec = clock->xtime_nsec >> clock->shift; 1159 xtime.tv_nsec = (s64)clock->xtime_nsec >> clock->shift;
1133 clock->xtime_nsec -= (s64)xtime.tv_nsec << clock->shift; 1160 clock->xtime_nsec -= (s64)xtime.tv_nsec << clock->shift;
1134 1161
1135 /* check to see if there is a new clocksource to use */ 1162 /* check to see if there is a new clocksource to use */
@@ -1661,7 +1688,7 @@ static void __devinit migrate_timers(int cpu)
1661} 1688}
1662#endif /* CONFIG_HOTPLUG_CPU */ 1689#endif /* CONFIG_HOTPLUG_CPU */
1663 1690
1664static int __devinit timer_cpu_notify(struct notifier_block *self, 1691static int __cpuinit timer_cpu_notify(struct notifier_block *self,
1665 unsigned long action, void *hcpu) 1692 unsigned long action, void *hcpu)
1666{ 1693{
1667 long cpu = (long)hcpu; 1694 long cpu = (long)hcpu;
@@ -1681,7 +1708,7 @@ static int __devinit timer_cpu_notify(struct notifier_block *self,
1681 return NOTIFY_OK; 1708 return NOTIFY_OK;
1682} 1709}
1683 1710
1684static struct notifier_block __devinitdata timers_nb = { 1711static struct notifier_block __cpuinitdata timers_nb = {
1685 .notifier_call = timer_cpu_notify, 1712 .notifier_call = timer_cpu_notify,
1686}; 1713};
1687 1714
diff --git a/kernel/wait.c b/kernel/wait.c
index a1d57aeb7f75..59a82f63275d 100644
--- a/kernel/wait.c
+++ b/kernel/wait.c
@@ -10,9 +10,13 @@
10#include <linux/wait.h> 10#include <linux/wait.h>
11#include <linux/hash.h> 11#include <linux/hash.h>
12 12
13struct lock_class_key waitqueue_lock_key; 13void init_waitqueue_head(wait_queue_head_t *q)
14{
15 spin_lock_init(&q->lock);
16 INIT_LIST_HEAD(&q->task_list);
17}
14 18
15EXPORT_SYMBOL(waitqueue_lock_key); 19EXPORT_SYMBOL(init_waitqueue_head);
16 20
17void fastcall add_wait_queue(wait_queue_head_t *q, wait_queue_t *wait) 21void fastcall add_wait_queue(wait_queue_head_t *q, wait_queue_t *wait)
18{ 22{
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index eebb1d839235..448e8f7b342d 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -93,9 +93,12 @@ static void __queue_work(struct cpu_workqueue_struct *cwq,
93 spin_unlock_irqrestore(&cwq->lock, flags); 93 spin_unlock_irqrestore(&cwq->lock, flags);
94} 94}
95 95
96/* 96/**
97 * Queue work on a workqueue. Return non-zero if it was successfully 97 * queue_work - queue work on a workqueue
98 * added. 98 * @wq: workqueue to use
99 * @work: work to queue
100 *
101 * Returns non-zero if it was successfully added.
99 * 102 *
100 * We queue the work to the CPU it was submitted, but there is no 103 * We queue the work to the CPU it was submitted, but there is no
101 * guarantee that it will be processed by that CPU. 104 * guarantee that it will be processed by that CPU.
@@ -128,6 +131,14 @@ static void delayed_work_timer_fn(unsigned long __data)
128 __queue_work(per_cpu_ptr(wq->cpu_wq, cpu), work); 131 __queue_work(per_cpu_ptr(wq->cpu_wq, cpu), work);
129} 132}
130 133
134/**
135 * queue_delayed_work - queue work on a workqueue after delay
136 * @wq: workqueue to use
137 * @work: work to queue
138 * @delay: number of jiffies to wait before queueing
139 *
140 * Returns non-zero if it was successfully added.
141 */
131int fastcall queue_delayed_work(struct workqueue_struct *wq, 142int fastcall queue_delayed_work(struct workqueue_struct *wq,
132 struct work_struct *work, unsigned long delay) 143 struct work_struct *work, unsigned long delay)
133{ 144{
@@ -150,6 +161,15 @@ int fastcall queue_delayed_work(struct workqueue_struct *wq,
150} 161}
151EXPORT_SYMBOL_GPL(queue_delayed_work); 162EXPORT_SYMBOL_GPL(queue_delayed_work);
152 163
164/**
165 * queue_delayed_work_on - queue work on specific CPU after delay
166 * @cpu: CPU number to execute work on
167 * @wq: workqueue to use
168 * @work: work to queue
169 * @delay: number of jiffies to wait before queueing
170 *
171 * Returns non-zero if it was successfully added.
172 */
153int queue_delayed_work_on(int cpu, struct workqueue_struct *wq, 173int queue_delayed_work_on(int cpu, struct workqueue_struct *wq,
154 struct work_struct *work, unsigned long delay) 174 struct work_struct *work, unsigned long delay)
155{ 175{
@@ -275,8 +295,9 @@ static void flush_cpu_workqueue(struct cpu_workqueue_struct *cwq)
275 } 295 }
276} 296}
277 297
278/* 298/**
279 * flush_workqueue - ensure that any scheduled work has run to completion. 299 * flush_workqueue - ensure that any scheduled work has run to completion.
300 * @wq: workqueue to flush
280 * 301 *
281 * Forces execution of the workqueue and blocks until its completion. 302 * Forces execution of the workqueue and blocks until its completion.
282 * This is typically used in driver shutdown handlers. 303 * This is typically used in driver shutdown handlers.
@@ -400,6 +421,12 @@ static void cleanup_workqueue_thread(struct workqueue_struct *wq, int cpu)
400 kthread_stop(p); 421 kthread_stop(p);
401} 422}
402 423
424/**
425 * destroy_workqueue - safely terminate a workqueue
426 * @wq: target workqueue
427 *
428 * Safely destroy a workqueue. All work currently pending will be done first.
429 */
403void destroy_workqueue(struct workqueue_struct *wq) 430void destroy_workqueue(struct workqueue_struct *wq)
404{ 431{
405 int cpu; 432 int cpu;
@@ -425,18 +452,41 @@ EXPORT_SYMBOL_GPL(destroy_workqueue);
425 452
426static struct workqueue_struct *keventd_wq; 453static struct workqueue_struct *keventd_wq;
427 454
455/**
456 * schedule_work - put work task in global workqueue
457 * @work: job to be done
458 *
459 * This puts a job in the kernel-global workqueue.
460 */
428int fastcall schedule_work(struct work_struct *work) 461int fastcall schedule_work(struct work_struct *work)
429{ 462{
430 return queue_work(keventd_wq, work); 463 return queue_work(keventd_wq, work);
431} 464}
432EXPORT_SYMBOL(schedule_work); 465EXPORT_SYMBOL(schedule_work);
433 466
467/**
468 * schedule_delayed_work - put work task in global workqueue after delay
469 * @work: job to be done
470 * @delay: number of jiffies to wait
471 *
472 * After waiting for a given time this puts a job in the kernel-global
473 * workqueue.
474 */
434int fastcall schedule_delayed_work(struct work_struct *work, unsigned long delay) 475int fastcall schedule_delayed_work(struct work_struct *work, unsigned long delay)
435{ 476{
436 return queue_delayed_work(keventd_wq, work, delay); 477 return queue_delayed_work(keventd_wq, work, delay);
437} 478}
438EXPORT_SYMBOL(schedule_delayed_work); 479EXPORT_SYMBOL(schedule_delayed_work);
439 480
481/**
482 * schedule_delayed_work_on - queue work in global workqueue on CPU after delay
483 * @cpu: cpu to use
484 * @work: job to be done
485 * @delay: number of jiffies to wait
486 *
487 * After waiting for a given time this puts a job in the kernel-global
488 * workqueue on the specified CPU.
489 */
440int schedule_delayed_work_on(int cpu, 490int schedule_delayed_work_on(int cpu,
441 struct work_struct *work, unsigned long delay) 491 struct work_struct *work, unsigned long delay)
442{ 492{
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index e5889b1a33ff..554ee688a9f8 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -158,7 +158,7 @@ config DEBUG_RWSEMS
158 158
159config DEBUG_LOCK_ALLOC 159config DEBUG_LOCK_ALLOC
160 bool "Lock debugging: detect incorrect freeing of live locks" 160 bool "Lock debugging: detect incorrect freeing of live locks"
161 depends on TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT 161 depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
162 select DEBUG_SPINLOCK 162 select DEBUG_SPINLOCK
163 select DEBUG_MUTEXES 163 select DEBUG_MUTEXES
164 select DEBUG_RWSEMS 164 select DEBUG_RWSEMS
@@ -173,7 +173,7 @@ config DEBUG_LOCK_ALLOC
173 173
174config PROVE_LOCKING 174config PROVE_LOCKING
175 bool "Lock debugging: prove locking correctness" 175 bool "Lock debugging: prove locking correctness"
176 depends on TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT 176 depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
177 select LOCKDEP 177 select LOCKDEP
178 select DEBUG_SPINLOCK 178 select DEBUG_SPINLOCK
179 select DEBUG_MUTEXES 179 select DEBUG_MUTEXES
@@ -216,7 +216,7 @@ config PROVE_LOCKING
216 216
217config LOCKDEP 217config LOCKDEP
218 bool 218 bool
219 depends on TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT 219 depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
220 select STACKTRACE 220 select STACKTRACE
221 select FRAME_POINTER 221 select FRAME_POINTER
222 select KALLSYMS 222 select KALLSYMS
@@ -224,13 +224,14 @@ config LOCKDEP
224 224
225config DEBUG_LOCKDEP 225config DEBUG_LOCKDEP
226 bool "Lock dependency engine debugging" 226 bool "Lock dependency engine debugging"
227 depends on LOCKDEP 227 depends on DEBUG_KERNEL && LOCKDEP
228 help 228 help
229 If you say Y here, the lock dependency engine will do 229 If you say Y here, the lock dependency engine will do
230 additional runtime checks to debug itself, at the price 230 additional runtime checks to debug itself, at the price
231 of more runtime overhead. 231 of more runtime overhead.
232 232
233config TRACE_IRQFLAGS 233config TRACE_IRQFLAGS
234 depends on DEBUG_KERNEL
234 bool 235 bool
235 default y 236 default y
236 depends on TRACE_IRQFLAGS_SUPPORT 237 depends on TRACE_IRQFLAGS_SUPPORT
@@ -256,6 +257,7 @@ config DEBUG_LOCKING_API_SELFTESTS
256 257
257config STACKTRACE 258config STACKTRACE
258 bool 259 bool
260 depends on DEBUG_KERNEL
259 depends on STACKTRACE_SUPPORT 261 depends on STACKTRACE_SUPPORT
260 262
261config DEBUG_KOBJECT 263config DEBUG_KOBJECT
diff --git a/lib/idr.c b/lib/idr.c
index 4d096819511a..16d2143fea48 100644
--- a/lib/idr.c
+++ b/lib/idr.c
@@ -38,14 +38,15 @@ static kmem_cache_t *idr_layer_cache;
38static struct idr_layer *alloc_layer(struct idr *idp) 38static struct idr_layer *alloc_layer(struct idr *idp)
39{ 39{
40 struct idr_layer *p; 40 struct idr_layer *p;
41 unsigned long flags;
41 42
42 spin_lock(&idp->lock); 43 spin_lock_irqsave(&idp->lock, flags);
43 if ((p = idp->id_free)) { 44 if ((p = idp->id_free)) {
44 idp->id_free = p->ary[0]; 45 idp->id_free = p->ary[0];
45 idp->id_free_cnt--; 46 idp->id_free_cnt--;
46 p->ary[0] = NULL; 47 p->ary[0] = NULL;
47 } 48 }
48 spin_unlock(&idp->lock); 49 spin_unlock_irqrestore(&idp->lock, flags);
49 return(p); 50 return(p);
50} 51}
51 52
@@ -59,12 +60,14 @@ static void __free_layer(struct idr *idp, struct idr_layer *p)
59 60
60static void free_layer(struct idr *idp, struct idr_layer *p) 61static void free_layer(struct idr *idp, struct idr_layer *p)
61{ 62{
63 unsigned long flags;
64
62 /* 65 /*
63 * Depends on the return element being zeroed. 66 * Depends on the return element being zeroed.
64 */ 67 */
65 spin_lock(&idp->lock); 68 spin_lock_irqsave(&idp->lock, flags);
66 __free_layer(idp, p); 69 __free_layer(idp, p);
67 spin_unlock(&idp->lock); 70 spin_unlock_irqrestore(&idp->lock, flags);
68} 71}
69 72
70/** 73/**
@@ -168,6 +171,7 @@ static int idr_get_new_above_int(struct idr *idp, void *ptr, int starting_id)
168{ 171{
169 struct idr_layer *p, *new; 172 struct idr_layer *p, *new;
170 int layers, v, id; 173 int layers, v, id;
174 unsigned long flags;
171 175
172 id = starting_id; 176 id = starting_id;
173build_up: 177build_up:
@@ -191,14 +195,14 @@ build_up:
191 * The allocation failed. If we built part of 195 * The allocation failed. If we built part of
192 * the structure tear it down. 196 * the structure tear it down.
193 */ 197 */
194 spin_lock(&idp->lock); 198 spin_lock_irqsave(&idp->lock, flags);
195 for (new = p; p && p != idp->top; new = p) { 199 for (new = p; p && p != idp->top; new = p) {
196 p = p->ary[0]; 200 p = p->ary[0];
197 new->ary[0] = NULL; 201 new->ary[0] = NULL;
198 new->bitmap = new->count = 0; 202 new->bitmap = new->count = 0;
199 __free_layer(idp, new); 203 __free_layer(idp, new);
200 } 204 }
201 spin_unlock(&idp->lock); 205 spin_unlock_irqrestore(&idp->lock, flags);
202 return -1; 206 return -1;
203 } 207 }
204 new->ary[0] = p; 208 new->ary[0] = p;
diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index 2b1530fc573b..7f20e7b857cb 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -50,10 +50,6 @@ static char *action_to_string(enum kobject_action action)
50 return "offline"; 50 return "offline";
51 case KOBJ_ONLINE: 51 case KOBJ_ONLINE:
52 return "online"; 52 return "online";
53 case KOBJ_DOCK:
54 return "dock";
55 case KOBJ_UNDOCK:
56 return "undock";
57 default: 53 default:
58 return NULL; 54 return NULL;
59 } 55 }
diff --git a/lib/zlib_inflate/inflate.c b/lib/zlib_inflate/inflate.c
index 7f922dccf1a5..fceb97c3aff7 100644
--- a/lib/zlib_inflate/inflate.c
+++ b/lib/zlib_inflate/inflate.c
@@ -347,7 +347,10 @@ int zlib_inflate(z_streamp strm, int flush)
347 static const unsigned short order[19] = /* permutation of code lengths */ 347 static const unsigned short order[19] = /* permutation of code lengths */
348 {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; 348 {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
349 349
350 if (strm == NULL || strm->state == NULL || strm->next_out == NULL || 350 /* Do not check for strm->next_out == NULL here as ppc zImage
351 inflates to strm->next_out = 0 */
352
353 if (strm == NULL || strm->state == NULL ||
351 (strm->next_in == NULL && strm->avail_in != 0)) 354 (strm->next_in == NULL && strm->avail_in != 0))
352 return Z_STREAM_ERROR; 355 return Z_STREAM_ERROR;
353 356
diff --git a/mm/bootmem.c b/mm/bootmem.c
index d213feded10d..50353e0dac12 100644
--- a/mm/bootmem.c
+++ b/mm/bootmem.c
@@ -29,9 +29,7 @@ unsigned long max_low_pfn;
29unsigned long min_low_pfn; 29unsigned long min_low_pfn;
30unsigned long max_pfn; 30unsigned long max_pfn;
31 31
32EXPORT_SYMBOL(max_pfn); /* This is exported so 32EXPORT_UNUSED_SYMBOL(max_pfn); /* June 2006 */
33 * dma_get_required_mask(), which uses
34 * it, can be an inline function */
35 33
36static LIST_HEAD(bdata_list); 34static LIST_HEAD(bdata_list);
37#ifdef CONFIG_CRASH_DUMP 35#ifdef CONFIG_CRASH_DUMP
diff --git a/mm/fadvise.c b/mm/fadvise.c
index 0a03357a1f8e..60a5d55e51d9 100644
--- a/mm/fadvise.c
+++ b/mm/fadvise.c
@@ -23,18 +23,6 @@
23/* 23/*
24 * POSIX_FADV_WILLNEED could set PG_Referenced, and POSIX_FADV_NOREUSE could 24 * POSIX_FADV_WILLNEED could set PG_Referenced, and POSIX_FADV_NOREUSE could
25 * deactivate the pages and clear PG_Referenced. 25 * deactivate the pages and clear PG_Referenced.
26 *
27 * LINUX_FADV_ASYNC_WRITE: start async writeout of any dirty pages between file
28 * offsets `offset' and `offset+len' inclusive. Any pages which are currently
29 * under writeout are skipped, whether or not they are dirty.
30 *
31 * LINUX_FADV_WRITE_WAIT: wait upon writeout of any dirty pages between file
32 * offsets `offset' and `offset+len'.
33 *
34 * By combining these two operations the application may do several things:
35 *
36 * LINUX_FADV_ASYNC_WRITE: push some or all of the dirty pages at the disk.
37 *
38 */ 26 */
39asmlinkage long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice) 27asmlinkage long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice)
40{ 28{
diff --git a/mm/filemap.c b/mm/filemap.c
index d087fc3d3281..b9a60c43b61a 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -849,8 +849,6 @@ static void shrink_readahead_size_eio(struct file *filp,
849 return; 849 return;
850 850
851 ra->ra_pages /= 4; 851 ra->ra_pages /= 4;
852 printk(KERN_WARNING "Reducing readahead size to %luK\n",
853 ra->ra_pages << (PAGE_CACHE_SHIFT - 10));
854} 852}
855 853
856/** 854/**
diff --git a/mm/memory.c b/mm/memory.c
index c1e14c9e67e4..109e9866237e 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -47,6 +47,7 @@
47#include <linux/pagemap.h> 47#include <linux/pagemap.h>
48#include <linux/rmap.h> 48#include <linux/rmap.h>
49#include <linux/module.h> 49#include <linux/module.h>
50#include <linux/delayacct.h>
50#include <linux/init.h> 51#include <linux/init.h>
51 52
52#include <asm/pgalloc.h> 53#include <asm/pgalloc.h>
@@ -1549,9 +1550,9 @@ gotten:
1549 flush_cache_page(vma, address, pte_pfn(orig_pte)); 1550 flush_cache_page(vma, address, pte_pfn(orig_pte));
1550 entry = mk_pte(new_page, vma->vm_page_prot); 1551 entry = mk_pte(new_page, vma->vm_page_prot);
1551 entry = maybe_mkwrite(pte_mkdirty(entry), vma); 1552 entry = maybe_mkwrite(pte_mkdirty(entry), vma);
1553 lazy_mmu_prot_update(entry);
1552 ptep_establish(vma, address, page_table, entry); 1554 ptep_establish(vma, address, page_table, entry);
1553 update_mmu_cache(vma, address, entry); 1555 update_mmu_cache(vma, address, entry);
1554 lazy_mmu_prot_update(entry);
1555 lru_cache_add_active(new_page); 1556 lru_cache_add_active(new_page);
1556 page_add_new_anon_rmap(new_page, vma, address); 1557 page_add_new_anon_rmap(new_page, vma, address);
1557 1558
@@ -1853,7 +1854,7 @@ int vmtruncate_range(struct inode *inode, loff_t offset, loff_t end)
1853 1854
1854 return 0; 1855 return 0;
1855} 1856}
1856EXPORT_SYMBOL(vmtruncate_range); 1857EXPORT_UNUSED_SYMBOL(vmtruncate_range); /* June 2006 */
1857 1858
1858/* 1859/*
1859 * Primitive swap readahead code. We simply read an aligned block of 1860 * Primitive swap readahead code. We simply read an aligned block of
@@ -1934,6 +1935,7 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma,
1934 migration_entry_wait(mm, pmd, address); 1935 migration_entry_wait(mm, pmd, address);
1935 goto out; 1936 goto out;
1936 } 1937 }
1938 delayacct_set_flag(DELAYACCT_PF_SWAPIN);
1937 page = lookup_swap_cache(entry); 1939 page = lookup_swap_cache(entry);
1938 if (!page) { 1940 if (!page) {
1939 swapin_readahead(entry, address, vma); 1941 swapin_readahead(entry, address, vma);
@@ -1946,6 +1948,7 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma,
1946 page_table = pte_offset_map_lock(mm, pmd, address, &ptl); 1948 page_table = pte_offset_map_lock(mm, pmd, address, &ptl);
1947 if (likely(pte_same(*page_table, orig_pte))) 1949 if (likely(pte_same(*page_table, orig_pte)))
1948 ret = VM_FAULT_OOM; 1950 ret = VM_FAULT_OOM;
1951 delayacct_clear_flag(DELAYACCT_PF_SWAPIN);
1949 goto unlock; 1952 goto unlock;
1950 } 1953 }
1951 1954
@@ -1955,6 +1958,7 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma,
1955 grab_swap_token(); 1958 grab_swap_token();
1956 } 1959 }
1957 1960
1961 delayacct_clear_flag(DELAYACCT_PF_SWAPIN);
1958 mark_page_accessed(page); 1962 mark_page_accessed(page);
1959 lock_page(page); 1963 lock_page(page);
1960 1964
diff --git a/mm/mmzone.c b/mm/mmzone.c
index 0959ee1a4795..febea1c98168 100644
--- a/mm/mmzone.c
+++ b/mm/mmzone.c
@@ -14,7 +14,7 @@ struct pglist_data *first_online_pgdat(void)
14 return NODE_DATA(first_online_node); 14 return NODE_DATA(first_online_node);
15} 15}
16 16
17EXPORT_SYMBOL(first_online_pgdat); 17EXPORT_UNUSED_SYMBOL(first_online_pgdat); /* June 2006 */
18 18
19struct pglist_data *next_online_pgdat(struct pglist_data *pgdat) 19struct pglist_data *next_online_pgdat(struct pglist_data *pgdat)
20{ 20{
@@ -24,7 +24,7 @@ struct pglist_data *next_online_pgdat(struct pglist_data *pgdat)
24 return NULL; 24 return NULL;
25 return NODE_DATA(nid); 25 return NODE_DATA(nid);
26} 26}
27EXPORT_SYMBOL(next_online_pgdat); 27EXPORT_UNUSED_SYMBOL(next_online_pgdat); /* June 2006 */
28 28
29 29
30/* 30/*
@@ -45,5 +45,5 @@ struct zone *next_zone(struct zone *zone)
45 } 45 }
46 return zone; 46 return zone;
47} 47}
48EXPORT_SYMBOL(next_zone); 48EXPORT_UNUSED_SYMBOL(next_zone); /* June 2006 */
49 49
diff --git a/mm/nommu.c b/mm/nommu.c
index 5151c44a8257..c576df71e3bb 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -1070,6 +1070,7 @@ int remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
1070 vma->vm_start = vma->vm_pgoff << PAGE_SHIFT; 1070 vma->vm_start = vma->vm_pgoff << PAGE_SHIFT;
1071 return 0; 1071 return 0;
1072} 1072}
1073EXPORT_SYMBOL(remap_pfn_range);
1073 1074
1074void swap_unplug_io_fn(struct backing_dev_info *bdi, struct page *page) 1075void swap_unplug_io_fn(struct backing_dev_info *bdi, struct page *page)
1075{ 1076{
@@ -1090,6 +1091,7 @@ void unmap_mapping_range(struct address_space *mapping,
1090 int even_cows) 1091 int even_cows)
1091{ 1092{
1092} 1093}
1094EXPORT_SYMBOL(unmap_mapping_range);
1093 1095
1094/* 1096/*
1095 * Check that a process has enough memory to allocate a new virtual 1097 * Check that a process has enough memory to allocate a new virtual
diff --git a/mm/slab.c b/mm/slab.c
index 85c2e03098a7..21ba06035700 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -674,6 +674,37 @@ static struct kmem_cache cache_cache = {
674#endif 674#endif
675}; 675};
676 676
677#ifdef CONFIG_LOCKDEP
678
679/*
680 * Slab sometimes uses the kmalloc slabs to store the slab headers
681 * for other slabs "off slab".
682 * The locking for this is tricky in that it nests within the locks
683 * of all other slabs in a few places; to deal with this special
684 * locking we put on-slab caches into a separate lock-class.
685 */
686static struct lock_class_key on_slab_key;
687
688static inline void init_lock_keys(struct cache_sizes *s)
689{
690 int q;
691
692 for (q = 0; q < MAX_NUMNODES; q++) {
693 if (!s->cs_cachep->nodelists[q] || OFF_SLAB(s->cs_cachep))
694 continue;
695 lockdep_set_class(&s->cs_cachep->nodelists[q]->list_lock,
696 &on_slab_key);
697 }
698}
699
700#else
701static inline void init_lock_keys(struct cache_sizes *s)
702{
703}
704#endif
705
706
707
677/* Guard access to the cache-chain. */ 708/* Guard access to the cache-chain. */
678static DEFINE_MUTEX(cache_chain_mutex); 709static DEFINE_MUTEX(cache_chain_mutex);
679static struct list_head cache_chain; 710static struct list_head cache_chain;
@@ -1021,8 +1052,7 @@ static void drain_alien_cache(struct kmem_cache *cachep,
1021 } 1052 }
1022} 1053}
1023 1054
1024static inline int cache_free_alien(struct kmem_cache *cachep, void *objp, 1055static inline int cache_free_alien(struct kmem_cache *cachep, void *objp)
1025 int nesting)
1026{ 1056{
1027 struct slab *slabp = virt_to_slab(objp); 1057 struct slab *slabp = virt_to_slab(objp);
1028 int nodeid = slabp->nodeid; 1058 int nodeid = slabp->nodeid;
@@ -1040,7 +1070,7 @@ static inline int cache_free_alien(struct kmem_cache *cachep, void *objp,
1040 STATS_INC_NODEFREES(cachep); 1070 STATS_INC_NODEFREES(cachep);
1041 if (l3->alien && l3->alien[nodeid]) { 1071 if (l3->alien && l3->alien[nodeid]) {
1042 alien = l3->alien[nodeid]; 1072 alien = l3->alien[nodeid];
1043 spin_lock_nested(&alien->lock, nesting); 1073 spin_lock(&alien->lock);
1044 if (unlikely(alien->avail == alien->limit)) { 1074 if (unlikely(alien->avail == alien->limit)) {
1045 STATS_INC_ACOVERFLOW(cachep); 1075 STATS_INC_ACOVERFLOW(cachep);
1046 __drain_alien_cache(cachep, alien, nodeid); 1076 __drain_alien_cache(cachep, alien, nodeid);
@@ -1069,15 +1099,14 @@ static inline void free_alien_cache(struct array_cache **ac_ptr)
1069{ 1099{
1070} 1100}
1071 1101
1072static inline int cache_free_alien(struct kmem_cache *cachep, void *objp, 1102static inline int cache_free_alien(struct kmem_cache *cachep, void *objp)
1073 int nesting)
1074{ 1103{
1075 return 0; 1104 return 0;
1076} 1105}
1077 1106
1078#endif 1107#endif
1079 1108
1080static int __devinit cpuup_callback(struct notifier_block *nfb, 1109static int __cpuinit cpuup_callback(struct notifier_block *nfb,
1081 unsigned long action, void *hcpu) 1110 unsigned long action, void *hcpu)
1082{ 1111{
1083 long cpu = (long)hcpu; 1112 long cpu = (long)hcpu;
@@ -1393,6 +1422,7 @@ void __init kmem_cache_init(void)
1393 ARCH_KMALLOC_FLAGS|SLAB_PANIC, 1422 ARCH_KMALLOC_FLAGS|SLAB_PANIC,
1394 NULL, NULL); 1423 NULL, NULL);
1395 } 1424 }
1425 init_lock_keys(sizes);
1396 1426
1397 sizes->cs_dmacachep = kmem_cache_create(names->name_dma, 1427 sizes->cs_dmacachep = kmem_cache_create(names->name_dma,
1398 sizes->cs_size, 1428 sizes->cs_size,
@@ -1760,8 +1790,6 @@ static void slab_destroy_objs(struct kmem_cache *cachep, struct slab *slabp)
1760} 1790}
1761#endif 1791#endif
1762 1792
1763static void __cache_free(struct kmem_cache *cachep, void *objp, int nesting);
1764
1765/** 1793/**
1766 * slab_destroy - destroy and release all objects in a slab 1794 * slab_destroy - destroy and release all objects in a slab
1767 * @cachep: cache pointer being destroyed 1795 * @cachep: cache pointer being destroyed
@@ -1785,17 +1813,8 @@ static void slab_destroy(struct kmem_cache *cachep, struct slab *slabp)
1785 call_rcu(&slab_rcu->head, kmem_rcu_free); 1813 call_rcu(&slab_rcu->head, kmem_rcu_free);
1786 } else { 1814 } else {
1787 kmem_freepages(cachep, addr); 1815 kmem_freepages(cachep, addr);
1788 if (OFF_SLAB(cachep)) { 1816 if (OFF_SLAB(cachep))
1789 unsigned long flags; 1817 kmem_cache_free(cachep->slabp_cache, slabp);
1790
1791 /*
1792 * lockdep: we may nest inside an already held
1793 * ac->lock, so pass in a nesting flag:
1794 */
1795 local_irq_save(flags);
1796 __cache_free(cachep->slabp_cache, slabp, 1);
1797 local_irq_restore(flags);
1798 }
1799 } 1818 }
1800} 1819}
1801 1820
@@ -3100,16 +3119,7 @@ static void free_block(struct kmem_cache *cachep, void **objpp, int nr_objects,
3100 if (slabp->inuse == 0) { 3119 if (slabp->inuse == 0) {
3101 if (l3->free_objects > l3->free_limit) { 3120 if (l3->free_objects > l3->free_limit) {
3102 l3->free_objects -= cachep->num; 3121 l3->free_objects -= cachep->num;
3103 /*
3104 * It is safe to drop the lock. The slab is
3105 * no longer linked to the cache. cachep
3106 * cannot disappear - we are using it and
3107 * all destruction of caches must be
3108 * serialized properly by the user.
3109 */
3110 spin_unlock(&l3->list_lock);
3111 slab_destroy(cachep, slabp); 3122 slab_destroy(cachep, slabp);
3112 spin_lock(&l3->list_lock);
3113 } else { 3123 } else {
3114 list_add(&slabp->list, &l3->slabs_free); 3124 list_add(&slabp->list, &l3->slabs_free);
3115 } 3125 }
@@ -3135,7 +3145,7 @@ static void cache_flusharray(struct kmem_cache *cachep, struct array_cache *ac)
3135#endif 3145#endif
3136 check_irq_off(); 3146 check_irq_off();
3137 l3 = cachep->nodelists[node]; 3147 l3 = cachep->nodelists[node];
3138 spin_lock_nested(&l3->list_lock, SINGLE_DEPTH_NESTING); 3148 spin_lock(&l3->list_lock);
3139 if (l3->shared) { 3149 if (l3->shared) {
3140 struct array_cache *shared_array = l3->shared; 3150 struct array_cache *shared_array = l3->shared;
3141 int max = shared_array->limit - shared_array->avail; 3151 int max = shared_array->limit - shared_array->avail;
@@ -3178,14 +3188,14 @@ free_done:
3178 * Release an obj back to its cache. If the obj has a constructed state, it must 3188 * Release an obj back to its cache. If the obj has a constructed state, it must
3179 * be in this state _before_ it is released. Called with disabled ints. 3189 * be in this state _before_ it is released. Called with disabled ints.
3180 */ 3190 */
3181static void __cache_free(struct kmem_cache *cachep, void *objp, int nesting) 3191static inline void __cache_free(struct kmem_cache *cachep, void *objp)
3182{ 3192{
3183 struct array_cache *ac = cpu_cache_get(cachep); 3193 struct array_cache *ac = cpu_cache_get(cachep);
3184 3194
3185 check_irq_off(); 3195 check_irq_off();
3186 objp = cache_free_debugcheck(cachep, objp, __builtin_return_address(0)); 3196 objp = cache_free_debugcheck(cachep, objp, __builtin_return_address(0));
3187 3197
3188 if (cache_free_alien(cachep, objp, nesting)) 3198 if (cache_free_alien(cachep, objp))
3189 return; 3199 return;
3190 3200
3191 if (likely(ac->avail < ac->limit)) { 3201 if (likely(ac->avail < ac->limit)) {
@@ -3214,7 +3224,7 @@ void *kmem_cache_alloc(struct kmem_cache *cachep, gfp_t flags)
3214EXPORT_SYMBOL(kmem_cache_alloc); 3224EXPORT_SYMBOL(kmem_cache_alloc);
3215 3225
3216/** 3226/**
3217 * kmem_cache_alloc - Allocate an object. The memory is set to zero. 3227 * kmem_cache_zalloc - Allocate an object. The memory is set to zero.
3218 * @cache: The cache to allocate from. 3228 * @cache: The cache to allocate from.
3219 * @flags: See kmalloc(). 3229 * @flags: See kmalloc().
3220 * 3230 *
@@ -3424,7 +3434,7 @@ void kmem_cache_free(struct kmem_cache *cachep, void *objp)
3424 BUG_ON(virt_to_cache(objp) != cachep); 3434 BUG_ON(virt_to_cache(objp) != cachep);
3425 3435
3426 local_irq_save(flags); 3436 local_irq_save(flags);
3427 __cache_free(cachep, objp, 0); 3437 __cache_free(cachep, objp);
3428 local_irq_restore(flags); 3438 local_irq_restore(flags);
3429} 3439}
3430EXPORT_SYMBOL(kmem_cache_free); 3440EXPORT_SYMBOL(kmem_cache_free);
@@ -3449,7 +3459,7 @@ void kfree(const void *objp)
3449 kfree_debugcheck(objp); 3459 kfree_debugcheck(objp);
3450 c = virt_to_cache(objp); 3460 c = virt_to_cache(objp);
3451 debug_check_no_locks_freed(objp, obj_size(c)); 3461 debug_check_no_locks_freed(objp, obj_size(c));
3452 __cache_free(c, (void *)objp, 0); 3462 __cache_free(c, (void *)objp);
3453 local_irq_restore(flags); 3463 local_irq_restore(flags);
3454} 3464}
3455EXPORT_SYMBOL(kfree); 3465EXPORT_SYMBOL(kfree);
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 7b450798b458..266162d2ba28 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -340,7 +340,7 @@ void __vunmap(void *addr, int deallocate_pages)
340 __free_page(area->pages[i]); 340 __free_page(area->pages[i]);
341 } 341 }
342 342
343 if (area->nr_pages > PAGE_SIZE/sizeof(struct page *)) 343 if (area->flags & VM_VPAGES)
344 vfree(area->pages); 344 vfree(area->pages);
345 else 345 else
346 kfree(area->pages); 346 kfree(area->pages);
@@ -427,9 +427,10 @@ void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
427 427
428 area->nr_pages = nr_pages; 428 area->nr_pages = nr_pages;
429 /* Please note that the recursion is strictly bounded. */ 429 /* Please note that the recursion is strictly bounded. */
430 if (array_size > PAGE_SIZE) 430 if (array_size > PAGE_SIZE) {
431 pages = __vmalloc_node(array_size, gfp_mask, PAGE_KERNEL, node); 431 pages = __vmalloc_node(array_size, gfp_mask, PAGE_KERNEL, node);
432 else 432 area->flags |= VM_VPAGES;
433 } else
433 pages = kmalloc_node(array_size, (gfp_mask & ~__GFP_HIGHMEM), node); 434 pages = kmalloc_node(array_size, (gfp_mask & ~__GFP_HIGHMEM), node);
434 area->pages = pages; 435 area->pages = pages;
435 if (!area->pages) { 436 if (!area->pages) {
diff --git a/mm/vmstat.c b/mm/vmstat.c
index 73b83d67bab6..dfdf24133901 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -81,6 +81,7 @@ void all_vm_events(unsigned long *ret)
81{ 81{
82 sum_vm_events(ret, &cpu_online_map); 82 sum_vm_events(ret, &cpu_online_map);
83} 83}
84EXPORT_SYMBOL_GPL(all_vm_events);
84 85
85#ifdef CONFIG_HOTPLUG 86#ifdef CONFIG_HOTPLUG
86/* 87/*
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index 458031bfff55..18fcb9fa518d 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -67,10 +67,6 @@ static struct packet_type vlan_packet_type = {
67 .func = vlan_skb_recv, /* VLAN receive method */ 67 .func = vlan_skb_recv, /* VLAN receive method */
68}; 68};
69 69
70/* Bits of netdev state that are propagated from real device to virtual */
71#define VLAN_LINK_STATE_MASK \
72 ((1<<__LINK_STATE_PRESENT)|(1<<__LINK_STATE_NOCARRIER)|(1<<__LINK_STATE_DORMANT))
73
74/* End of global variables definitions. */ 70/* End of global variables definitions. */
75 71
76/* 72/*
@@ -479,7 +475,9 @@ static struct net_device *register_vlan_device(const char *eth_IF_name,
479 new_dev->flags = real_dev->flags; 475 new_dev->flags = real_dev->flags;
480 new_dev->flags &= ~IFF_UP; 476 new_dev->flags &= ~IFF_UP;
481 477
482 new_dev->state = real_dev->state & ~(1<<__LINK_STATE_START); 478 new_dev->state = (real_dev->state & ((1<<__LINK_STATE_NOCARRIER) |
479 (1<<__LINK_STATE_DORMANT))) |
480 (1<<__LINK_STATE_PRESENT);
483 481
484 /* need 4 bytes for extra VLAN header info, 482 /* need 4 bytes for extra VLAN header info,
485 * hope the underlying device can handle it. 483 * hope the underlying device can handle it.
@@ -542,12 +540,11 @@ static struct net_device *register_vlan_device(const char *eth_IF_name,
542 * so it cannot "appear" on us. 540 * so it cannot "appear" on us.
543 */ 541 */
544 if (!grp) { /* need to add a new group */ 542 if (!grp) { /* need to add a new group */
545 grp = kmalloc(sizeof(struct vlan_group), GFP_KERNEL); 543 grp = kzalloc(sizeof(struct vlan_group), GFP_KERNEL);
546 if (!grp) 544 if (!grp)
547 goto out_free_unregister; 545 goto out_free_unregister;
548 546
549 /* printk(KERN_ALERT "VLAN REGISTER: Allocated new group.\n"); */ 547 /* printk(KERN_ALERT "VLAN REGISTER: Allocated new group.\n"); */
550 memset(grp, 0, sizeof(struct vlan_group));
551 grp->real_dev_ifindex = real_dev->ifindex; 548 grp->real_dev_ifindex = real_dev->ifindex;
552 549
553 hlist_add_head_rcu(&grp->hlist, 550 hlist_add_head_rcu(&grp->hlist,
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
index 5ee96d4b40e9..96dc6bb52d14 100644
--- a/net/appletalk/ddp.c
+++ b/net/appletalk/ddp.c
@@ -227,12 +227,11 @@ static void atif_drop_device(struct net_device *dev)
227static struct atalk_iface *atif_add_device(struct net_device *dev, 227static struct atalk_iface *atif_add_device(struct net_device *dev,
228 struct atalk_addr *sa) 228 struct atalk_addr *sa)
229{ 229{
230 struct atalk_iface *iface = kmalloc(sizeof(*iface), GFP_KERNEL); 230 struct atalk_iface *iface = kzalloc(sizeof(*iface), GFP_KERNEL);
231 231
232 if (!iface) 232 if (!iface)
233 goto out; 233 goto out;
234 234
235 memset(iface, 0, sizeof(*iface));
236 dev_hold(dev); 235 dev_hold(dev);
237 iface->dev = dev; 236 iface->dev = dev;
238 dev->atalk_ptr = iface; 237 dev->atalk_ptr = iface;
@@ -559,12 +558,11 @@ static int atrtr_create(struct rtentry *r, struct net_device *devhint)
559 } 558 }
560 559
561 if (!rt) { 560 if (!rt) {
562 rt = kmalloc(sizeof(*rt), GFP_ATOMIC); 561 rt = kzalloc(sizeof(*rt), GFP_ATOMIC);
563 562
564 retval = -ENOBUFS; 563 retval = -ENOBUFS;
565 if (!rt) 564 if (!rt)
566 goto out_unlock; 565 goto out_unlock;
567 memset(rt, 0, sizeof(*rt));
568 566
569 rt->next = atalk_routes; 567 rt->next = atalk_routes;
570 atalk_routes = rt; 568 atalk_routes = rt;
diff --git a/net/atm/br2684.c b/net/atm/br2684.c
index a487233dc466..d00cca97eb33 100644
--- a/net/atm/br2684.c
+++ b/net/atm/br2684.c
@@ -508,10 +508,9 @@ Note: we do not have explicit unassign, but look at _push()
508 508
509 if (copy_from_user(&be, arg, sizeof be)) 509 if (copy_from_user(&be, arg, sizeof be))
510 return -EFAULT; 510 return -EFAULT;
511 brvcc = kmalloc(sizeof(struct br2684_vcc), GFP_KERNEL); 511 brvcc = kzalloc(sizeof(struct br2684_vcc), GFP_KERNEL);
512 if (!brvcc) 512 if (!brvcc)
513 return -ENOMEM; 513 return -ENOMEM;
514 memset(brvcc, 0, sizeof(struct br2684_vcc));
515 write_lock_irq(&devs_lock); 514 write_lock_irq(&devs_lock);
516 net_dev = br2684_find_dev(&be.ifspec); 515 net_dev = br2684_find_dev(&be.ifspec);
517 if (net_dev == NULL) { 516 if (net_dev == NULL) {
diff --git a/net/atm/clip.c b/net/atm/clip.c
index 121bf6f49148..7ce7bfe3fbad 100644
--- a/net/atm/clip.c
+++ b/net/atm/clip.c
@@ -929,12 +929,11 @@ static int arp_seq_open(struct inode *inode, struct file *file)
929 struct seq_file *seq; 929 struct seq_file *seq;
930 int rc = -EAGAIN; 930 int rc = -EAGAIN;
931 931
932 state = kmalloc(sizeof(*state), GFP_KERNEL); 932 state = kzalloc(sizeof(*state), GFP_KERNEL);
933 if (!state) { 933 if (!state) {
934 rc = -ENOMEM; 934 rc = -ENOMEM;
935 goto out_kfree; 935 goto out_kfree;
936 } 936 }
937 memset(state, 0, sizeof(*state));
938 state->ns.neigh_sub_iter = clip_seq_sub_iter; 937 state->ns.neigh_sub_iter = clip_seq_sub_iter;
939 938
940 rc = seq_open(file, &arp_seq_ops); 939 rc = seq_open(file, &arp_seq_ops);
@@ -962,7 +961,6 @@ static struct file_operations arp_seq_fops = {
962 961
963static int __init atm_clip_init(void) 962static int __init atm_clip_init(void)
964{ 963{
965 struct proc_dir_entry *p;
966 neigh_table_init_no_netlink(&clip_tbl); 964 neigh_table_init_no_netlink(&clip_tbl);
967 965
968 clip_tbl_hook = &clip_tbl; 966 clip_tbl_hook = &clip_tbl;
@@ -972,9 +970,15 @@ static int __init atm_clip_init(void)
972 970
973 setup_timer(&idle_timer, idle_timer_check, 0); 971 setup_timer(&idle_timer, idle_timer_check, 0);
974 972
975 p = create_proc_entry("arp", S_IRUGO, atm_proc_root); 973#ifdef CONFIG_PROC_FS
976 if (p) 974 {
977 p->proc_fops = &arp_seq_fops; 975 struct proc_dir_entry *p;
976
977 p = create_proc_entry("arp", S_IRUGO, atm_proc_root);
978 if (p)
979 p->proc_fops = &arp_seq_fops;
980 }
981#endif
978 982
979 return 0; 983 return 0;
980} 984}
diff --git a/net/atm/ipcommon.c b/net/atm/ipcommon.c
index 4b1faca5013f..1d3de42fada0 100644
--- a/net/atm/ipcommon.c
+++ b/net/atm/ipcommon.c
@@ -25,22 +25,27 @@
25/* 25/*
26 * skb_migrate appends the list at "from" to "to", emptying "from" in the 26 * skb_migrate appends the list at "from" to "to", emptying "from" in the
27 * process. skb_migrate is atomic with respect to all other skb operations on 27 * process. skb_migrate is atomic with respect to all other skb operations on
28 * "from" and "to". Note that it locks both lists at the same time, so beware 28 * "from" and "to". Note that it locks both lists at the same time, so to deal
29 * of potential deadlocks. 29 * with the lock ordering, the locks are taken in address order.
30 * 30 *
31 * This function should live in skbuff.c or skbuff.h. 31 * This function should live in skbuff.c or skbuff.h.
32 */ 32 */
33 33
34 34
35void skb_migrate(struct sk_buff_head *from,struct sk_buff_head *to) 35void skb_migrate(struct sk_buff_head *from, struct sk_buff_head *to)
36{ 36{
37 unsigned long flags; 37 unsigned long flags;
38 struct sk_buff *skb_from = (struct sk_buff *) from; 38 struct sk_buff *skb_from = (struct sk_buff *) from;
39 struct sk_buff *skb_to = (struct sk_buff *) to; 39 struct sk_buff *skb_to = (struct sk_buff *) to;
40 struct sk_buff *prev; 40 struct sk_buff *prev;
41 41
42 spin_lock_irqsave(&from->lock,flags); 42 if ((unsigned long) from < (unsigned long) to) {
43 spin_lock(&to->lock); 43 spin_lock_irqsave(&from->lock, flags);
44 spin_lock_nested(&to->lock, SINGLE_DEPTH_NESTING);
45 } else {
46 spin_lock_irqsave(&to->lock, flags);
47 spin_lock_nested(&from->lock, SINGLE_DEPTH_NESTING);
48 }
44 prev = from->prev; 49 prev = from->prev;
45 from->next->prev = to->prev; 50 from->next->prev = to->prev;
46 prev->next = skb_to; 51 prev->next = skb_to;
@@ -51,7 +56,7 @@ void skb_migrate(struct sk_buff_head *from,struct sk_buff_head *to)
51 from->prev = skb_from; 56 from->prev = skb_from;
52 from->next = skb_from; 57 from->next = skb_from;
53 from->qlen = 0; 58 from->qlen = 0;
54 spin_unlock_irqrestore(&from->lock,flags); 59 spin_unlock_irqrestore(&from->lock, flags);
55} 60}
56 61
57 62
diff --git a/net/atm/lec.c b/net/atm/lec.c
index 4b68a18171cf..b4aa489849df 100644
--- a/net/atm/lec.c
+++ b/net/atm/lec.c
@@ -1811,12 +1811,11 @@ make_entry(struct lec_priv *priv, unsigned char *mac_addr)
1811{ 1811{
1812 struct lec_arp_table *to_return; 1812 struct lec_arp_table *to_return;
1813 1813
1814 to_return = kmalloc(sizeof(struct lec_arp_table), GFP_ATOMIC); 1814 to_return = kzalloc(sizeof(struct lec_arp_table), GFP_ATOMIC);
1815 if (!to_return) { 1815 if (!to_return) {
1816 printk("LEC: Arp entry kmalloc failed\n"); 1816 printk("LEC: Arp entry kmalloc failed\n");
1817 return NULL; 1817 return NULL;
1818 } 1818 }
1819 memset(to_return, 0, sizeof(struct lec_arp_table));
1820 memcpy(to_return->mac_addr, mac_addr, ETH_ALEN); 1819 memcpy(to_return->mac_addr, mac_addr, ETH_ALEN);
1821 init_timer(&to_return->timer); 1820 init_timer(&to_return->timer);
1822 to_return->timer.function = lec_arp_expire_arp; 1821 to_return->timer.function = lec_arp_expire_arp;
diff --git a/net/atm/mpc.c b/net/atm/mpc.c
index 9aafe1e2f048..00704661e83f 100644
--- a/net/atm/mpc.c
+++ b/net/atm/mpc.c
@@ -258,10 +258,9 @@ static struct mpoa_client *alloc_mpc(void)
258{ 258{
259 struct mpoa_client *mpc; 259 struct mpoa_client *mpc;
260 260
261 mpc = kmalloc(sizeof (struct mpoa_client), GFP_KERNEL); 261 mpc = kzalloc(sizeof (struct mpoa_client), GFP_KERNEL);
262 if (mpc == NULL) 262 if (mpc == NULL)
263 return NULL; 263 return NULL;
264 memset(mpc, 0, sizeof(struct mpoa_client));
265 rwlock_init(&mpc->ingress_lock); 264 rwlock_init(&mpc->ingress_lock);
266 rwlock_init(&mpc->egress_lock); 265 rwlock_init(&mpc->egress_lock);
267 mpc->next = mpcs; 266 mpc->next = mpcs;
diff --git a/net/atm/pppoatm.c b/net/atm/pppoatm.c
index 76a7d8ff6c0e..19d5dfc0702f 100644
--- a/net/atm/pppoatm.c
+++ b/net/atm/pppoatm.c
@@ -287,10 +287,9 @@ static int pppoatm_assign_vcc(struct atm_vcc *atmvcc, void __user *arg)
287 if (be.encaps != PPPOATM_ENCAPS_AUTODETECT && 287 if (be.encaps != PPPOATM_ENCAPS_AUTODETECT &&
288 be.encaps != PPPOATM_ENCAPS_VC && be.encaps != PPPOATM_ENCAPS_LLC) 288 be.encaps != PPPOATM_ENCAPS_VC && be.encaps != PPPOATM_ENCAPS_LLC)
289 return -EINVAL; 289 return -EINVAL;
290 pvcc = kmalloc(sizeof(*pvcc), GFP_KERNEL); 290 pvcc = kzalloc(sizeof(*pvcc), GFP_KERNEL);
291 if (pvcc == NULL) 291 if (pvcc == NULL)
292 return -ENOMEM; 292 return -ENOMEM;
293 memset(pvcc, 0, sizeof(*pvcc));
294 pvcc->atmvcc = atmvcc; 293 pvcc->atmvcc = atmvcc;
295 pvcc->old_push = atmvcc->push; 294 pvcc->old_push = atmvcc->push;
296 pvcc->old_pop = atmvcc->pop; 295 pvcc->old_pop = atmvcc->pop;
diff --git a/net/atm/resources.c b/net/atm/resources.c
index de25c6408b04..529f7e64aa2c 100644
--- a/net/atm/resources.c
+++ b/net/atm/resources.c
@@ -33,10 +33,9 @@ static struct atm_dev *__alloc_atm_dev(const char *type)
33{ 33{
34 struct atm_dev *dev; 34 struct atm_dev *dev;
35 35
36 dev = kmalloc(sizeof(*dev), GFP_KERNEL); 36 dev = kzalloc(sizeof(*dev), GFP_KERNEL);
37 if (!dev) 37 if (!dev)
38 return NULL; 38 return NULL;
39 memset(dev, 0, sizeof(*dev));
40 dev->type = type; 39 dev->type = type;
41 dev->signal = ATM_PHY_SIG_UNKNOWN; 40 dev->signal = ATM_PHY_SIG_UNKNOWN;
42 dev->link_rate = ATM_OC3_PCR; 41 dev->link_rate = ATM_OC3_PCR;
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
index 10a3c0aa8398..000695c48583 100644
--- a/net/ax25/af_ax25.c
+++ b/net/ax25/af_ax25.c
@@ -145,7 +145,7 @@ struct sock *ax25_find_listener(ax25_address *addr, int digi,
145 ax25_cb *s; 145 ax25_cb *s;
146 struct hlist_node *node; 146 struct hlist_node *node;
147 147
148 spin_lock_bh(&ax25_list_lock); 148 spin_lock(&ax25_list_lock);
149 ax25_for_each(s, node, &ax25_list) { 149 ax25_for_each(s, node, &ax25_list) {
150 if ((s->iamdigi && !digi) || (!s->iamdigi && digi)) 150 if ((s->iamdigi && !digi) || (!s->iamdigi && digi))
151 continue; 151 continue;
@@ -154,12 +154,12 @@ struct sock *ax25_find_listener(ax25_address *addr, int digi,
154 /* If device is null we match any device */ 154 /* If device is null we match any device */
155 if (s->ax25_dev == NULL || s->ax25_dev->dev == dev) { 155 if (s->ax25_dev == NULL || s->ax25_dev->dev == dev) {
156 sock_hold(s->sk); 156 sock_hold(s->sk);
157 spin_unlock_bh(&ax25_list_lock); 157 spin_unlock(&ax25_list_lock);
158 return s->sk; 158 return s->sk;
159 } 159 }
160 } 160 }
161 } 161 }
162 spin_unlock_bh(&ax25_list_lock); 162 spin_unlock(&ax25_list_lock);
163 163
164 return NULL; 164 return NULL;
165} 165}
@@ -174,7 +174,7 @@ struct sock *ax25_get_socket(ax25_address *my_addr, ax25_address *dest_addr,
174 ax25_cb *s; 174 ax25_cb *s;
175 struct hlist_node *node; 175 struct hlist_node *node;
176 176
177 spin_lock_bh(&ax25_list_lock); 177 spin_lock(&ax25_list_lock);
178 ax25_for_each(s, node, &ax25_list) { 178 ax25_for_each(s, node, &ax25_list) {
179 if (s->sk && !ax25cmp(&s->source_addr, my_addr) && 179 if (s->sk && !ax25cmp(&s->source_addr, my_addr) &&
180 !ax25cmp(&s->dest_addr, dest_addr) && 180 !ax25cmp(&s->dest_addr, dest_addr) &&
@@ -185,7 +185,7 @@ struct sock *ax25_get_socket(ax25_address *my_addr, ax25_address *dest_addr,
185 } 185 }
186 } 186 }
187 187
188 spin_unlock_bh(&ax25_list_lock); 188 spin_unlock(&ax25_list_lock);
189 189
190 return sk; 190 return sk;
191} 191}
@@ -235,7 +235,7 @@ void ax25_send_to_raw(ax25_address *addr, struct sk_buff *skb, int proto)
235 struct sk_buff *copy; 235 struct sk_buff *copy;
236 struct hlist_node *node; 236 struct hlist_node *node;
237 237
238 spin_lock_bh(&ax25_list_lock); 238 spin_lock(&ax25_list_lock);
239 ax25_for_each(s, node, &ax25_list) { 239 ax25_for_each(s, node, &ax25_list) {
240 if (s->sk != NULL && ax25cmp(&s->source_addr, addr) == 0 && 240 if (s->sk != NULL && ax25cmp(&s->source_addr, addr) == 0 &&
241 s->sk->sk_type == SOCK_RAW && 241 s->sk->sk_type == SOCK_RAW &&
@@ -248,7 +248,7 @@ void ax25_send_to_raw(ax25_address *addr, struct sk_buff *skb, int proto)
248 kfree_skb(copy); 248 kfree_skb(copy);
249 } 249 }
250 } 250 }
251 spin_unlock_bh(&ax25_list_lock); 251 spin_unlock(&ax25_list_lock);
252} 252}
253 253
254/* 254/*
@@ -486,10 +486,9 @@ ax25_cb *ax25_create_cb(void)
486{ 486{
487 ax25_cb *ax25; 487 ax25_cb *ax25;
488 488
489 if ((ax25 = kmalloc(sizeof(*ax25), GFP_ATOMIC)) == NULL) 489 if ((ax25 = kzalloc(sizeof(*ax25), GFP_ATOMIC)) == NULL)
490 return NULL; 490 return NULL;
491 491
492 memset(ax25, 0x00, sizeof(*ax25));
493 atomic_set(&ax25->refcount, 1); 492 atomic_set(&ax25->refcount, 1);
494 493
495 skb_queue_head_init(&ax25->write_queue); 494 skb_queue_head_init(&ax25->write_queue);
diff --git a/net/ax25/ax25_dev.c b/net/ax25/ax25_dev.c
index 47e6e790bd67..b787678220ff 100644
--- a/net/ax25/ax25_dev.c
+++ b/net/ax25/ax25_dev.c
@@ -55,15 +55,13 @@ void ax25_dev_device_up(struct net_device *dev)
55{ 55{
56 ax25_dev *ax25_dev; 56 ax25_dev *ax25_dev;
57 57
58 if ((ax25_dev = kmalloc(sizeof(*ax25_dev), GFP_ATOMIC)) == NULL) { 58 if ((ax25_dev = kzalloc(sizeof(*ax25_dev), GFP_ATOMIC)) == NULL) {
59 printk(KERN_ERR "AX.25: ax25_dev_device_up - out of memory\n"); 59 printk(KERN_ERR "AX.25: ax25_dev_device_up - out of memory\n");
60 return; 60 return;
61 } 61 }
62 62
63 ax25_unregister_sysctl(); 63 ax25_unregister_sysctl();
64 64
65 memset(ax25_dev, 0x00, sizeof(*ax25_dev));
66
67 dev->ax25_ptr = ax25_dev; 65 dev->ax25_ptr = ax25_dev;
68 ax25_dev->dev = dev; 66 ax25_dev->dev = dev;
69 dev_hold(dev); 67 dev_hold(dev);
diff --git a/net/ax25/ax25_ds_subr.c b/net/ax25/ax25_ds_subr.c
index 1d4ab641f82b..4d22d4430ec8 100644
--- a/net/ax25/ax25_ds_subr.c
+++ b/net/ax25/ax25_ds_subr.c
@@ -80,7 +80,7 @@ void ax25_ds_enquiry_response(ax25_cb *ax25)
80 ax25_start_t3timer(ax25); 80 ax25_start_t3timer(ax25);
81 ax25_ds_set_timer(ax25->ax25_dev); 81 ax25_ds_set_timer(ax25->ax25_dev);
82 82
83 spin_lock_bh(&ax25_list_lock); 83 spin_lock(&ax25_list_lock);
84 ax25_for_each(ax25o, node, &ax25_list) { 84 ax25_for_each(ax25o, node, &ax25_list) {
85 if (ax25o == ax25) 85 if (ax25o == ax25)
86 continue; 86 continue;
@@ -106,7 +106,7 @@ void ax25_ds_enquiry_response(ax25_cb *ax25)
106 if (ax25o->state != AX25_STATE_0) 106 if (ax25o->state != AX25_STATE_0)
107 ax25_start_t3timer(ax25o); 107 ax25_start_t3timer(ax25o);
108 } 108 }
109 spin_unlock_bh(&ax25_list_lock); 109 spin_unlock(&ax25_list_lock);
110} 110}
111 111
112void ax25_ds_establish_data_link(ax25_cb *ax25) 112void ax25_ds_establish_data_link(ax25_cb *ax25)
@@ -162,13 +162,13 @@ static int ax25_check_dama_slave(ax25_dev *ax25_dev)
162 int res = 0; 162 int res = 0;
163 struct hlist_node *node; 163 struct hlist_node *node;
164 164
165 spin_lock_bh(&ax25_list_lock); 165 spin_lock(&ax25_list_lock);
166 ax25_for_each(ax25, node, &ax25_list) 166 ax25_for_each(ax25, node, &ax25_list)
167 if (ax25->ax25_dev == ax25_dev && (ax25->condition & AX25_COND_DAMA_MODE) && ax25->state > AX25_STATE_1) { 167 if (ax25->ax25_dev == ax25_dev && (ax25->condition & AX25_COND_DAMA_MODE) && ax25->state > AX25_STATE_1) {
168 res = 1; 168 res = 1;
169 break; 169 break;
170 } 170 }
171 spin_unlock_bh(&ax25_list_lock); 171 spin_unlock(&ax25_list_lock);
172 172
173 return res; 173 return res;
174} 174}
diff --git a/net/ax25/ax25_ds_timer.c b/net/ax25/ax25_ds_timer.c
index 5961459935eb..4f44185955c7 100644
--- a/net/ax25/ax25_ds_timer.c
+++ b/net/ax25/ax25_ds_timer.c
@@ -85,7 +85,7 @@ static void ax25_ds_timeout(unsigned long arg)
85 return; 85 return;
86 } 86 }
87 87
88 spin_lock_bh(&ax25_list_lock); 88 spin_lock(&ax25_list_lock);
89 ax25_for_each(ax25, node, &ax25_list) { 89 ax25_for_each(ax25, node, &ax25_list) {
90 if (ax25->ax25_dev != ax25_dev || !(ax25->condition & AX25_COND_DAMA_MODE)) 90 if (ax25->ax25_dev != ax25_dev || !(ax25->condition & AX25_COND_DAMA_MODE))
91 continue; 91 continue;
@@ -93,7 +93,7 @@ static void ax25_ds_timeout(unsigned long arg)
93 ax25_send_control(ax25, AX25_DISC, AX25_POLLON, AX25_COMMAND); 93 ax25_send_control(ax25, AX25_DISC, AX25_POLLON, AX25_COMMAND);
94 ax25_disconnect(ax25, ETIMEDOUT); 94 ax25_disconnect(ax25, ETIMEDOUT);
95 } 95 }
96 spin_unlock_bh(&ax25_list_lock); 96 spin_unlock(&ax25_list_lock);
97 97
98 ax25_dev_dama_off(ax25_dev); 98 ax25_dev_dama_off(ax25_dev);
99} 99}
diff --git a/net/ax25/ax25_iface.c b/net/ax25/ax25_iface.c
index 77ba07c67682..07ac0207eb69 100644
--- a/net/ax25/ax25_iface.c
+++ b/net/ax25/ax25_iface.c
@@ -66,10 +66,10 @@ int ax25_protocol_register(unsigned int pid,
66 protocol->pid = pid; 66 protocol->pid = pid;
67 protocol->func = func; 67 protocol->func = func;
68 68
69 write_lock(&protocol_list_lock); 69 write_lock_bh(&protocol_list_lock);
70 protocol->next = protocol_list; 70 protocol->next = protocol_list;
71 protocol_list = protocol; 71 protocol_list = protocol;
72 write_unlock(&protocol_list_lock); 72 write_unlock_bh(&protocol_list_lock);
73 73
74 return 1; 74 return 1;
75} 75}
@@ -80,16 +80,16 @@ void ax25_protocol_release(unsigned int pid)
80{ 80{
81 struct protocol_struct *s, *protocol; 81 struct protocol_struct *s, *protocol;
82 82
83 write_lock(&protocol_list_lock); 83 write_lock_bh(&protocol_list_lock);
84 protocol = protocol_list; 84 protocol = protocol_list;
85 if (protocol == NULL) { 85 if (protocol == NULL) {
86 write_unlock(&protocol_list_lock); 86 write_unlock_bh(&protocol_list_lock);
87 return; 87 return;
88 } 88 }
89 89
90 if (protocol->pid == pid) { 90 if (protocol->pid == pid) {
91 protocol_list = protocol->next; 91 protocol_list = protocol->next;
92 write_unlock(&protocol_list_lock); 92 write_unlock_bh(&protocol_list_lock);
93 kfree(protocol); 93 kfree(protocol);
94 return; 94 return;
95 } 95 }
@@ -98,14 +98,14 @@ void ax25_protocol_release(unsigned int pid)
98 if (protocol->next->pid == pid) { 98 if (protocol->next->pid == pid) {
99 s = protocol->next; 99 s = protocol->next;
100 protocol->next = protocol->next->next; 100 protocol->next = protocol->next->next;
101 write_unlock(&protocol_list_lock); 101 write_unlock_bh(&protocol_list_lock);
102 kfree(s); 102 kfree(s);
103 return; 103 return;
104 } 104 }
105 105
106 protocol = protocol->next; 106 protocol = protocol->next;
107 } 107 }
108 write_unlock(&protocol_list_lock); 108 write_unlock_bh(&protocol_list_lock);
109} 109}
110 110
111EXPORT_SYMBOL(ax25_protocol_release); 111EXPORT_SYMBOL(ax25_protocol_release);
@@ -266,13 +266,13 @@ int ax25_protocol_is_registered(unsigned int pid)
266 struct protocol_struct *protocol; 266 struct protocol_struct *protocol;
267 int res = 0; 267 int res = 0;
268 268
269 read_lock(&protocol_list_lock); 269 read_lock_bh(&protocol_list_lock);
270 for (protocol = protocol_list; protocol != NULL; protocol = protocol->next) 270 for (protocol = protocol_list; protocol != NULL; protocol = protocol->next)
271 if (protocol->pid == pid) { 271 if (protocol->pid == pid) {
272 res = 1; 272 res = 1;
273 break; 273 break;
274 } 274 }
275 read_unlock(&protocol_list_lock); 275 read_unlock_bh(&protocol_list_lock);
276 276
277 return res; 277 return res;
278} 278}
diff --git a/net/ax25/ax25_in.c b/net/ax25/ax25_in.c
index 4cf87540fb3a..e9d94291581e 100644
--- a/net/ax25/ax25_in.c
+++ b/net/ax25/ax25_in.c
@@ -102,8 +102,8 @@ static int ax25_rx_fragment(ax25_cb *ax25, struct sk_buff *skb)
102int ax25_rx_iframe(ax25_cb *ax25, struct sk_buff *skb) 102int ax25_rx_iframe(ax25_cb *ax25, struct sk_buff *skb)
103{ 103{
104 int (*func)(struct sk_buff *, ax25_cb *); 104 int (*func)(struct sk_buff *, ax25_cb *);
105 volatile int queued = 0;
106 unsigned char pid; 105 unsigned char pid;
106 int queued = 0;
107 107
108 if (skb == NULL) return 0; 108 if (skb == NULL) return 0;
109 109
diff --git a/net/ax25/sysctl_net_ax25.c b/net/ax25/sysctl_net_ax25.c
index 369a75b160f2..867d42537979 100644
--- a/net/ax25/sysctl_net_ax25.c
+++ b/net/ax25/sysctl_net_ax25.c
@@ -203,13 +203,11 @@ void ax25_register_sysctl(void)
203 for (ax25_table_size = sizeof(ctl_table), ax25_dev = ax25_dev_list; ax25_dev != NULL; ax25_dev = ax25_dev->next) 203 for (ax25_table_size = sizeof(ctl_table), ax25_dev = ax25_dev_list; ax25_dev != NULL; ax25_dev = ax25_dev->next)
204 ax25_table_size += sizeof(ctl_table); 204 ax25_table_size += sizeof(ctl_table);
205 205
206 if ((ax25_table = kmalloc(ax25_table_size, GFP_ATOMIC)) == NULL) { 206 if ((ax25_table = kzalloc(ax25_table_size, GFP_ATOMIC)) == NULL) {
207 spin_unlock_bh(&ax25_dev_lock); 207 spin_unlock_bh(&ax25_dev_lock);
208 return; 208 return;
209 } 209 }
210 210
211 memset(ax25_table, 0x00, ax25_table_size);
212
213 for (n = 0, ax25_dev = ax25_dev_list; ax25_dev != NULL; ax25_dev = ax25_dev->next) { 211 for (n = 0, ax25_dev = ax25_dev_list; ax25_dev != NULL; ax25_dev = ax25_dev->next) {
214 ctl_table *child = kmalloc(sizeof(ax25_param_table), GFP_ATOMIC); 212 ctl_table *child = kmalloc(sizeof(ax25_param_table), GFP_ATOMIC);
215 if (!child) { 213 if (!child) {
diff --git a/net/bluetooth/cmtp/capi.c b/net/bluetooth/cmtp/capi.c
index 6fb47e00e188..be04e9fb11f6 100644
--- a/net/bluetooth/cmtp/capi.c
+++ b/net/bluetooth/cmtp/capi.c
@@ -75,15 +75,13 @@
75 75
76static struct cmtp_application *cmtp_application_add(struct cmtp_session *session, __u16 appl) 76static struct cmtp_application *cmtp_application_add(struct cmtp_session *session, __u16 appl)
77{ 77{
78 struct cmtp_application *app = kmalloc(sizeof(*app), GFP_KERNEL); 78 struct cmtp_application *app = kzalloc(sizeof(*app), GFP_KERNEL);
79 79
80 BT_DBG("session %p application %p appl %d", session, app, appl); 80 BT_DBG("session %p application %p appl %d", session, app, appl);
81 81
82 if (!app) 82 if (!app)
83 return NULL; 83 return NULL;
84 84
85 memset(app, 0, sizeof(*app));
86
87 app->state = BT_OPEN; 85 app->state = BT_OPEN;
88 app->appl = appl; 86 app->appl = appl;
89 87
diff --git a/net/bluetooth/cmtp/core.c b/net/bluetooth/cmtp/core.c
index 182254a580e2..b81a01c64aea 100644
--- a/net/bluetooth/cmtp/core.c
+++ b/net/bluetooth/cmtp/core.c
@@ -335,10 +335,9 @@ int cmtp_add_connection(struct cmtp_connadd_req *req, struct socket *sock)
335 baswap(&src, &bt_sk(sock->sk)->src); 335 baswap(&src, &bt_sk(sock->sk)->src);
336 baswap(&dst, &bt_sk(sock->sk)->dst); 336 baswap(&dst, &bt_sk(sock->sk)->dst);
337 337
338 session = kmalloc(sizeof(struct cmtp_session), GFP_KERNEL); 338 session = kzalloc(sizeof(struct cmtp_session), GFP_KERNEL);
339 if (!session) 339 if (!session)
340 return -ENOMEM; 340 return -ENOMEM;
341 memset(session, 0, sizeof(struct cmtp_session));
342 341
343 down_write(&cmtp_session_sem); 342 down_write(&cmtp_session_sem);
344 343
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 54e8e5ea2154..5ed474277903 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -336,9 +336,8 @@ void hci_inquiry_cache_update(struct hci_dev *hdev, struct inquiry_data *data)
336 336
337 if (!(e = hci_inquiry_cache_lookup(hdev, &data->bdaddr))) { 337 if (!(e = hci_inquiry_cache_lookup(hdev, &data->bdaddr))) {
338 /* Entry not in the cache. Add new one. */ 338 /* Entry not in the cache. Add new one. */
339 if (!(e = kmalloc(sizeof(struct inquiry_entry), GFP_ATOMIC))) 339 if (!(e = kzalloc(sizeof(struct inquiry_entry), GFP_ATOMIC)))
340 return; 340 return;
341 memset(e, 0, sizeof(struct inquiry_entry));
342 e->next = cache->list; 341 e->next = cache->list;
343 cache->list = e; 342 cache->list = e;
344 } 343 }
@@ -800,12 +799,10 @@ struct hci_dev *hci_alloc_dev(void)
800{ 799{
801 struct hci_dev *hdev; 800 struct hci_dev *hdev;
802 801
803 hdev = kmalloc(sizeof(struct hci_dev), GFP_KERNEL); 802 hdev = kzalloc(sizeof(struct hci_dev), GFP_KERNEL);
804 if (!hdev) 803 if (!hdev)
805 return NULL; 804 return NULL;
806 805
807 memset(hdev, 0, sizeof(struct hci_dev));
808
809 skb_queue_head_init(&hdev->driver_init); 806 skb_queue_head_init(&hdev->driver_init);
810 807
811 return hdev; 808 return hdev;
diff --git a/net/bluetooth/hidp/Kconfig b/net/bluetooth/hidp/Kconfig
index edfea772fb67..c6abf2a5a932 100644
--- a/net/bluetooth/hidp/Kconfig
+++ b/net/bluetooth/hidp/Kconfig
@@ -1,7 +1,6 @@
1config BT_HIDP 1config BT_HIDP
2 tristate "HIDP protocol support" 2 tristate "HIDP protocol support"
3 depends on BT && BT_L2CAP && (BROKEN || !S390) 3 depends on BT && BT_L2CAP && INPUT
4 select INPUT
5 help 4 help
6 HIDP (Human Interface Device Protocol) is a transport layer 5 HIDP (Human Interface Device Protocol) is a transport layer
7 for HID reports. HIDP is required for the Bluetooth Human 6 for HID reports. HIDP is required for the Bluetooth Human
diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
index b9c24a55425c..c6e3a2c27c6e 100644
--- a/net/bluetooth/hidp/core.c
+++ b/net/bluetooth/hidp/core.c
@@ -582,10 +582,9 @@ int hidp_add_connection(struct hidp_connadd_req *req, struct socket *ctrl_sock,
582 bacmp(&bt_sk(ctrl_sock->sk)->dst, &bt_sk(intr_sock->sk)->dst)) 582 bacmp(&bt_sk(ctrl_sock->sk)->dst, &bt_sk(intr_sock->sk)->dst))
583 return -ENOTUNIQ; 583 return -ENOTUNIQ;
584 584
585 session = kmalloc(sizeof(struct hidp_session), GFP_KERNEL); 585 session = kzalloc(sizeof(struct hidp_session), GFP_KERNEL);
586 if (!session) 586 if (!session)
587 return -ENOMEM; 587 return -ENOMEM;
588 memset(session, 0, sizeof(struct hidp_session));
589 588
590 session->input = input_allocate_device(); 589 session->input = input_allocate_device();
591 if (!session->input) { 590 if (!session->input) {
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index eaaad658d11d..d56f60b392ac 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -185,7 +185,7 @@ static inline void l2cap_chan_unlink(struct l2cap_chan_list *l, struct sock *sk)
185{ 185{
186 struct sock *next = l2cap_pi(sk)->next_c, *prev = l2cap_pi(sk)->prev_c; 186 struct sock *next = l2cap_pi(sk)->next_c, *prev = l2cap_pi(sk)->prev_c;
187 187
188 write_lock(&l->lock); 188 write_lock_bh(&l->lock);
189 if (sk == l->head) 189 if (sk == l->head)
190 l->head = next; 190 l->head = next;
191 191
@@ -193,7 +193,7 @@ static inline void l2cap_chan_unlink(struct l2cap_chan_list *l, struct sock *sk)
193 l2cap_pi(next)->prev_c = prev; 193 l2cap_pi(next)->prev_c = prev;
194 if (prev) 194 if (prev)
195 l2cap_pi(prev)->next_c = next; 195 l2cap_pi(prev)->next_c = next;
196 write_unlock(&l->lock); 196 write_unlock_bh(&l->lock);
197 197
198 __sock_put(sk); 198 __sock_put(sk);
199} 199}
@@ -313,9 +313,9 @@ static void l2cap_conn_del(struct hci_conn *hcon, int err)
313static inline void l2cap_chan_add(struct l2cap_conn *conn, struct sock *sk, struct sock *parent) 313static inline void l2cap_chan_add(struct l2cap_conn *conn, struct sock *sk, struct sock *parent)
314{ 314{
315 struct l2cap_chan_list *l = &conn->chan_list; 315 struct l2cap_chan_list *l = &conn->chan_list;
316 write_lock(&l->lock); 316 write_lock_bh(&l->lock);
317 __l2cap_chan_add(conn, sk, parent); 317 __l2cap_chan_add(conn, sk, parent);
318 write_unlock(&l->lock); 318 write_unlock_bh(&l->lock);
319} 319}
320 320
321static inline u8 l2cap_get_ident(struct l2cap_conn *conn) 321static inline u8 l2cap_get_ident(struct l2cap_conn *conn)
@@ -328,14 +328,14 @@ static inline u8 l2cap_get_ident(struct l2cap_conn *conn)
328 * 200 - 254 are used by utilities like l2ping, etc. 328 * 200 - 254 are used by utilities like l2ping, etc.
329 */ 329 */
330 330
331 spin_lock(&conn->lock); 331 spin_lock_bh(&conn->lock);
332 332
333 if (++conn->tx_ident > 128) 333 if (++conn->tx_ident > 128)
334 conn->tx_ident = 1; 334 conn->tx_ident = 1;
335 335
336 id = conn->tx_ident; 336 id = conn->tx_ident;
337 337
338 spin_unlock(&conn->lock); 338 spin_unlock_bh(&conn->lock);
339 339
340 return id; 340 return id;
341} 341}
@@ -1416,11 +1416,11 @@ static inline int l2cap_connect_req(struct l2cap_conn *conn, struct l2cap_cmd_hd
1416 if (!sk) 1416 if (!sk)
1417 goto response; 1417 goto response;
1418 1418
1419 write_lock(&list->lock); 1419 write_lock_bh(&list->lock);
1420 1420
1421 /* Check if we already have channel with that dcid */ 1421 /* Check if we already have channel with that dcid */
1422 if (__l2cap_get_chan_by_dcid(list, scid)) { 1422 if (__l2cap_get_chan_by_dcid(list, scid)) {
1423 write_unlock(&list->lock); 1423 write_unlock_bh(&list->lock);
1424 sock_set_flag(sk, SOCK_ZAPPED); 1424 sock_set_flag(sk, SOCK_ZAPPED);
1425 l2cap_sock_kill(sk); 1425 l2cap_sock_kill(sk);
1426 goto response; 1426 goto response;
@@ -1458,7 +1458,7 @@ static inline int l2cap_connect_req(struct l2cap_conn *conn, struct l2cap_cmd_hd
1458 result = status = 0; 1458 result = status = 0;
1459 1459
1460done: 1460done:
1461 write_unlock(&list->lock); 1461 write_unlock_bh(&list->lock);
1462 1462
1463response: 1463response:
1464 bh_unlock_sock(parent); 1464 bh_unlock_sock(parent);
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c
index 155a2b93760e..332dd8f436ea 100644
--- a/net/bluetooth/rfcomm/core.c
+++ b/net/bluetooth/rfcomm/core.c
@@ -55,6 +55,7 @@
55#define VERSION "1.8" 55#define VERSION "1.8"
56 56
57static int disable_cfc = 0; 57static int disable_cfc = 0;
58static int channel_mtu = -1;
58static unsigned int l2cap_mtu = RFCOMM_MAX_L2CAP_MTU; 59static unsigned int l2cap_mtu = RFCOMM_MAX_L2CAP_MTU;
59 60
60static struct task_struct *rfcomm_thread; 61static struct task_struct *rfcomm_thread;
@@ -273,10 +274,10 @@ static void rfcomm_dlc_clear_state(struct rfcomm_dlc *d)
273 274
274struct rfcomm_dlc *rfcomm_dlc_alloc(gfp_t prio) 275struct rfcomm_dlc *rfcomm_dlc_alloc(gfp_t prio)
275{ 276{
276 struct rfcomm_dlc *d = kmalloc(sizeof(*d), prio); 277 struct rfcomm_dlc *d = kzalloc(sizeof(*d), prio);
278
277 if (!d) 279 if (!d)
278 return NULL; 280 return NULL;
279 memset(d, 0, sizeof(*d));
280 281
281 init_timer(&d->timer); 282 init_timer(&d->timer);
282 d->timer.function = rfcomm_dlc_timeout; 283 d->timer.function = rfcomm_dlc_timeout;
@@ -289,6 +290,7 @@ struct rfcomm_dlc *rfcomm_dlc_alloc(gfp_t prio)
289 rfcomm_dlc_clear_state(d); 290 rfcomm_dlc_clear_state(d);
290 291
291 BT_DBG("%p", d); 292 BT_DBG("%p", d);
293
292 return d; 294 return d;
293} 295}
294 296
@@ -522,10 +524,10 @@ int rfcomm_dlc_get_modem_status(struct rfcomm_dlc *d, u8 *v24_sig)
522/* ---- RFCOMM sessions ---- */ 524/* ---- RFCOMM sessions ---- */
523static struct rfcomm_session *rfcomm_session_add(struct socket *sock, int state) 525static struct rfcomm_session *rfcomm_session_add(struct socket *sock, int state)
524{ 526{
525 struct rfcomm_session *s = kmalloc(sizeof(*s), GFP_KERNEL); 527 struct rfcomm_session *s = kzalloc(sizeof(*s), GFP_KERNEL);
528
526 if (!s) 529 if (!s)
527 return NULL; 530 return NULL;
528 memset(s, 0, sizeof(*s));
529 531
530 BT_DBG("session %p sock %p", s, sock); 532 BT_DBG("session %p sock %p", s, sock);
531 533
@@ -811,7 +813,10 @@ static int rfcomm_send_pn(struct rfcomm_session *s, int cr, struct rfcomm_dlc *d
811 pn->credits = 0; 813 pn->credits = 0;
812 } 814 }
813 815
814 pn->mtu = htobs(d->mtu); 816 if (cr && channel_mtu >= 0)
817 pn->mtu = htobs(channel_mtu);
818 else
819 pn->mtu = htobs(d->mtu);
815 820
816 *ptr = __fcs(buf); ptr++; 821 *ptr = __fcs(buf); ptr++;
817 822
@@ -1242,7 +1247,10 @@ static int rfcomm_apply_pn(struct rfcomm_dlc *d, int cr, struct rfcomm_pn *pn)
1242 1247
1243 d->priority = pn->priority; 1248 d->priority = pn->priority;
1244 1249
1245 d->mtu = s->mtu = btohs(pn->mtu); 1250 d->mtu = btohs(pn->mtu);
1251
1252 if (cr && d->mtu > s->mtu)
1253 d->mtu = s->mtu;
1246 1254
1247 return 0; 1255 return 0;
1248} 1256}
@@ -1769,6 +1777,11 @@ static inline void rfcomm_accept_connection(struct rfcomm_session *s)
1769 s = rfcomm_session_add(nsock, BT_OPEN); 1777 s = rfcomm_session_add(nsock, BT_OPEN);
1770 if (s) { 1778 if (s) {
1771 rfcomm_session_hold(s); 1779 rfcomm_session_hold(s);
1780
1781 /* We should adjust MTU on incoming sessions.
1782 * L2CAP MTU minus UIH header and FCS. */
1783 s->mtu = min(l2cap_pi(nsock->sk)->omtu, l2cap_pi(nsock->sk)->imtu) - 5;
1784
1772 rfcomm_schedule(RFCOMM_SCHED_RX); 1785 rfcomm_schedule(RFCOMM_SCHED_RX);
1773 } else 1786 } else
1774 sock_release(nsock); 1787 sock_release(nsock);
@@ -2086,6 +2099,9 @@ module_exit(rfcomm_exit);
2086module_param(disable_cfc, bool, 0644); 2099module_param(disable_cfc, bool, 0644);
2087MODULE_PARM_DESC(disable_cfc, "Disable credit based flow control"); 2100MODULE_PARM_DESC(disable_cfc, "Disable credit based flow control");
2088 2101
2102module_param(channel_mtu, int, 0644);
2103MODULE_PARM_DESC(channel_mtu, "Default MTU for the RFCOMM channel");
2104
2089module_param(l2cap_mtu, uint, 0644); 2105module_param(l2cap_mtu, uint, 0644);
2090MODULE_PARM_DESC(l2cap_mtu, "Default MTU for the L2CAP connection"); 2106MODULE_PARM_DESC(l2cap_mtu, "Default MTU for the L2CAP connection");
2091 2107
diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
index 2ff2d5b87c93..bd8d671a0ba6 100644
--- a/net/bluetooth/rfcomm/tty.c
+++ b/net/bluetooth/rfcomm/tty.c
@@ -169,10 +169,9 @@ static int rfcomm_dev_add(struct rfcomm_dev_req *req, struct rfcomm_dlc *dlc)
169 169
170 BT_DBG("id %d channel %d", req->dev_id, req->channel); 170 BT_DBG("id %d channel %d", req->dev_id, req->channel);
171 171
172 dev = kmalloc(sizeof(struct rfcomm_dev), GFP_KERNEL); 172 dev = kzalloc(sizeof(struct rfcomm_dev), GFP_KERNEL);
173 if (!dev) 173 if (!dev)
174 return -ENOMEM; 174 return -ENOMEM;
175 memset(dev, 0, sizeof(struct rfcomm_dev));
176 175
177 write_lock_bh(&rfcomm_dev_lock); 176 write_lock_bh(&rfcomm_dev_lock);
178 177
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
index 85defccc0287..7714a2ec3854 100644
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -108,17 +108,14 @@ static void sco_sock_init_timer(struct sock *sk)
108static struct sco_conn *sco_conn_add(struct hci_conn *hcon, __u8 status) 108static struct sco_conn *sco_conn_add(struct hci_conn *hcon, __u8 status)
109{ 109{
110 struct hci_dev *hdev = hcon->hdev; 110 struct hci_dev *hdev = hcon->hdev;
111 struct sco_conn *conn; 111 struct sco_conn *conn = hcon->sco_data;
112
113 if ((conn = hcon->sco_data))
114 return conn;
115 112
116 if (status) 113 if (conn || status)
117 return conn; 114 return conn;
118 115
119 if (!(conn = kmalloc(sizeof(struct sco_conn), GFP_ATOMIC))) 116 conn = kzalloc(sizeof(struct sco_conn), GFP_ATOMIC);
117 if (!conn)
120 return NULL; 118 return NULL;
121 memset(conn, 0, sizeof(struct sco_conn));
122 119
123 spin_lock_init(&conn->lock); 120 spin_lock_init(&conn->lock);
124 121
@@ -134,6 +131,7 @@ static struct sco_conn *sco_conn_add(struct hci_conn *hcon, __u8 status)
134 conn->mtu = 60; 131 conn->mtu = 60;
135 132
136 BT_DBG("hcon %p conn %p", hcon, conn); 133 BT_DBG("hcon %p conn %p", hcon, conn);
134
137 return conn; 135 return conn;
138} 136}
139 137
diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c
index 8be9f2123e54..6ccd32b30809 100644
--- a/net/bridge/br_forward.c
+++ b/net/bridge/br_forward.c
@@ -35,7 +35,7 @@ static inline unsigned packet_length(const struct sk_buff *skb)
35int br_dev_queue_push_xmit(struct sk_buff *skb) 35int br_dev_queue_push_xmit(struct sk_buff *skb)
36{ 36{
37 /* drop mtu oversized packets except gso */ 37 /* drop mtu oversized packets except gso */
38 if (packet_length(skb) > skb->dev->mtu && !skb_shinfo(skb)->gso_size) 38 if (packet_length(skb) > skb->dev->mtu && !skb_is_gso(skb))
39 kfree_skb(skb); 39 kfree_skb(skb);
40 else { 40 else {
41#ifdef CONFIG_BRIDGE_NETFILTER 41#ifdef CONFIG_BRIDGE_NETFILTER
diff --git a/net/bridge/br_ioctl.c b/net/bridge/br_ioctl.c
index 159fb8409824..4e4119a12139 100644
--- a/net/bridge/br_ioctl.c
+++ b/net/bridge/br_ioctl.c
@@ -162,12 +162,10 @@ static int old_dev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
162 if (num > BR_MAX_PORTS) 162 if (num > BR_MAX_PORTS)
163 num = BR_MAX_PORTS; 163 num = BR_MAX_PORTS;
164 164
165 indices = kmalloc(num*sizeof(int), GFP_KERNEL); 165 indices = kcalloc(num, sizeof(int), GFP_KERNEL);
166 if (indices == NULL) 166 if (indices == NULL)
167 return -ENOMEM; 167 return -ENOMEM;
168 168
169 memset(indices, 0, num*sizeof(int));
170
171 get_port_ifindices(br, indices, num); 169 get_port_ifindices(br, indices, num);
172 if (copy_to_user((void __user *)args[1], indices, num*sizeof(int))) 170 if (copy_to_user((void __user *)args[1], indices, num*sizeof(int)))
173 num = -EFAULT; 171 num = -EFAULT;
@@ -327,11 +325,10 @@ static int old_deviceless(void __user *uarg)
327 325
328 if (args[2] >= 2048) 326 if (args[2] >= 2048)
329 return -ENOMEM; 327 return -ENOMEM;
330 indices = kmalloc(args[2]*sizeof(int), GFP_KERNEL); 328 indices = kcalloc(args[2], sizeof(int), GFP_KERNEL);
331 if (indices == NULL) 329 if (indices == NULL)
332 return -ENOMEM; 330 return -ENOMEM;
333 331
334 memset(indices, 0, args[2]*sizeof(int));
335 args[2] = get_bridge_ifindices(indices, args[2]); 332 args[2] = get_bridge_ifindices(indices, args[2]);
336 333
337 ret = copy_to_user((void __user *)args[1], indices, args[2]*sizeof(int)) 334 ret = copy_to_user((void __user *)args[1], indices, args[2]*sizeof(int))
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
index 8298a5179aef..05b3de888243 100644
--- a/net/bridge/br_netfilter.c
+++ b/net/bridge/br_netfilter.c
@@ -61,6 +61,9 @@ static int brnf_filter_vlan_tagged = 1;
61#define brnf_filter_vlan_tagged 1 61#define brnf_filter_vlan_tagged 1
62#endif 62#endif
63 63
64int brnf_deferred_hooks;
65EXPORT_SYMBOL_GPL(brnf_deferred_hooks);
66
64static __be16 inline vlan_proto(const struct sk_buff *skb) 67static __be16 inline vlan_proto(const struct sk_buff *skb)
65{ 68{
66 return vlan_eth_hdr(skb)->h_vlan_encapsulated_proto; 69 return vlan_eth_hdr(skb)->h_vlan_encapsulated_proto;
@@ -761,7 +764,7 @@ static int br_nf_dev_queue_xmit(struct sk_buff *skb)
761{ 764{
762 if (skb->protocol == htons(ETH_P_IP) && 765 if (skb->protocol == htons(ETH_P_IP) &&
763 skb->len > skb->dev->mtu && 766 skb->len > skb->dev->mtu &&
764 !skb_shinfo(skb)->gso_size) 767 !skb_is_gso(skb))
765 return ip_fragment(skb, br_dev_queue_push_xmit); 768 return ip_fragment(skb, br_dev_queue_push_xmit);
766 else 769 else
767 return br_dev_queue_push_xmit(skb); 770 return br_dev_queue_push_xmit(skb);
@@ -890,6 +893,8 @@ static unsigned int ip_sabotage_out(unsigned int hook, struct sk_buff **pskb,
890 return NF_ACCEPT; 893 return NF_ACCEPT;
891 else if (ip->version == 6 && !brnf_call_ip6tables) 894 else if (ip->version == 6 && !brnf_call_ip6tables)
892 return NF_ACCEPT; 895 return NF_ACCEPT;
896 else if (!brnf_deferred_hooks)
897 return NF_ACCEPT;
893#endif 898#endif
894 if (hook == NF_IP_POST_ROUTING) 899 if (hook == NF_IP_POST_ROUTING)
895 return NF_ACCEPT; 900 return NF_ACCEPT;
diff --git a/net/core/Makefile b/net/core/Makefile
index e9bd2467d5a9..2645ba428d48 100644
--- a/net/core/Makefile
+++ b/net/core/Makefile
@@ -7,7 +7,7 @@ obj-y := sock.o request_sock.o skbuff.o iovec.o datagram.o stream.o scm.o \
7 7
8obj-$(CONFIG_SYSCTL) += sysctl_net_core.o 8obj-$(CONFIG_SYSCTL) += sysctl_net_core.o
9 9
10obj-y += dev.o ethtool.o dev_mcast.o dst.o \ 10obj-y += dev.o ethtool.o dev_mcast.o dst.o netevent.o \
11 neighbour.o rtnetlink.o utils.o link_watch.o filter.o 11 neighbour.o rtnetlink.o utils.o link_watch.o filter.o
12 12
13obj-$(CONFIG_XFRM) += flow.o 13obj-$(CONFIG_XFRM) += flow.o
diff --git a/net/core/dev.c b/net/core/dev.c
index 066a60a75280..d95e2626d944 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1162,9 +1162,12 @@ int skb_checksum_help(struct sk_buff *skb, int inward)
1162 unsigned int csum; 1162 unsigned int csum;
1163 int ret = 0, offset = skb->h.raw - skb->data; 1163 int ret = 0, offset = skb->h.raw - skb->data;
1164 1164
1165 if (inward) { 1165 if (inward)
1166 skb->ip_summed = CHECKSUM_NONE; 1166 goto out_set_summed;
1167 goto out; 1167
1168 if (unlikely(skb_shinfo(skb)->gso_size)) {
1169 /* Let GSO fix up the checksum. */
1170 goto out_set_summed;
1168 } 1171 }
1169 1172
1170 if (skb_cloned(skb)) { 1173 if (skb_cloned(skb)) {
@@ -1181,6 +1184,8 @@ int skb_checksum_help(struct sk_buff *skb, int inward)
1181 BUG_ON(skb->csum + 2 > offset); 1184 BUG_ON(skb->csum + 2 > offset);
1182 1185
1183 *(u16*)(skb->h.raw + skb->csum) = csum_fold(csum); 1186 *(u16*)(skb->h.raw + skb->csum) = csum_fold(csum);
1187
1188out_set_summed:
1184 skb->ip_summed = CHECKSUM_NONE; 1189 skb->ip_summed = CHECKSUM_NONE;
1185out: 1190out:
1186 return ret; 1191 return ret;
@@ -1201,17 +1206,30 @@ struct sk_buff *skb_gso_segment(struct sk_buff *skb, int features)
1201 struct sk_buff *segs = ERR_PTR(-EPROTONOSUPPORT); 1206 struct sk_buff *segs = ERR_PTR(-EPROTONOSUPPORT);
1202 struct packet_type *ptype; 1207 struct packet_type *ptype;
1203 int type = skb->protocol; 1208 int type = skb->protocol;
1209 int err;
1204 1210
1205 BUG_ON(skb_shinfo(skb)->frag_list); 1211 BUG_ON(skb_shinfo(skb)->frag_list);
1206 BUG_ON(skb->ip_summed != CHECKSUM_HW);
1207 1212
1208 skb->mac.raw = skb->data; 1213 skb->mac.raw = skb->data;
1209 skb->mac_len = skb->nh.raw - skb->data; 1214 skb->mac_len = skb->nh.raw - skb->data;
1210 __skb_pull(skb, skb->mac_len); 1215 __skb_pull(skb, skb->mac_len);
1211 1216
1217 if (unlikely(skb->ip_summed != CHECKSUM_HW)) {
1218 if (skb_header_cloned(skb) &&
1219 (err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC)))
1220 return ERR_PTR(err);
1221 }
1222
1212 rcu_read_lock(); 1223 rcu_read_lock();
1213 list_for_each_entry_rcu(ptype, &ptype_base[ntohs(type) & 15], list) { 1224 list_for_each_entry_rcu(ptype, &ptype_base[ntohs(type) & 15], list) {
1214 if (ptype->type == type && !ptype->dev && ptype->gso_segment) { 1225 if (ptype->type == type && !ptype->dev && ptype->gso_segment) {
1226 if (unlikely(skb->ip_summed != CHECKSUM_HW)) {
1227 err = ptype->gso_send_check(skb);
1228 segs = ERR_PTR(err);
1229 if (err || skb_gso_ok(skb, features))
1230 break;
1231 __skb_push(skb, skb->data - skb->nh.raw);
1232 }
1215 segs = ptype->gso_segment(skb, features); 1233 segs = ptype->gso_segment(skb, features);
1216 break; 1234 break;
1217 } 1235 }
@@ -1727,7 +1745,7 @@ static int ing_filter(struct sk_buff *skb)
1727 if (dev->qdisc_ingress) { 1745 if (dev->qdisc_ingress) {
1728 __u32 ttl = (__u32) G_TC_RTTL(skb->tc_verd); 1746 __u32 ttl = (__u32) G_TC_RTTL(skb->tc_verd);
1729 if (MAX_RED_LOOP < ttl++) { 1747 if (MAX_RED_LOOP < ttl++) {
1730 printk("Redir loop detected Dropping packet (%s->%s)\n", 1748 printk(KERN_WARNING "Redir loop detected Dropping packet (%s->%s)\n",
1731 skb->input_dev->name, skb->dev->name); 1749 skb->input_dev->name, skb->dev->name);
1732 return TC_ACT_SHOT; 1750 return TC_ACT_SHOT;
1733 } 1751 }
@@ -2922,7 +2940,7 @@ int register_netdevice(struct net_device *dev)
2922 /* Fix illegal SG+CSUM combinations. */ 2940 /* Fix illegal SG+CSUM combinations. */
2923 if ((dev->features & NETIF_F_SG) && 2941 if ((dev->features & NETIF_F_SG) &&
2924 !(dev->features & NETIF_F_ALL_CSUM)) { 2942 !(dev->features & NETIF_F_ALL_CSUM)) {
2925 printk("%s: Dropping NETIF_F_SG since no checksum feature.\n", 2943 printk(KERN_NOTICE "%s: Dropping NETIF_F_SG since no checksum feature.\n",
2926 dev->name); 2944 dev->name);
2927 dev->features &= ~NETIF_F_SG; 2945 dev->features &= ~NETIF_F_SG;
2928 } 2946 }
@@ -2930,7 +2948,7 @@ int register_netdevice(struct net_device *dev)
2930 /* TSO requires that SG is present as well. */ 2948 /* TSO requires that SG is present as well. */
2931 if ((dev->features & NETIF_F_TSO) && 2949 if ((dev->features & NETIF_F_TSO) &&
2932 !(dev->features & NETIF_F_SG)) { 2950 !(dev->features & NETIF_F_SG)) {
2933 printk("%s: Dropping NETIF_F_TSO since no SG feature.\n", 2951 printk(KERN_NOTICE "%s: Dropping NETIF_F_TSO since no SG feature.\n",
2934 dev->name); 2952 dev->name);
2935 dev->features &= ~NETIF_F_TSO; 2953 dev->features &= ~NETIF_F_TSO;
2936 } 2954 }
@@ -3401,12 +3419,9 @@ static void net_dma_rebalance(void)
3401 unsigned int cpu, i, n; 3419 unsigned int cpu, i, n;
3402 struct dma_chan *chan; 3420 struct dma_chan *chan;
3403 3421
3404 lock_cpu_hotplug();
3405
3406 if (net_dma_count == 0) { 3422 if (net_dma_count == 0) {
3407 for_each_online_cpu(cpu) 3423 for_each_online_cpu(cpu)
3408 rcu_assign_pointer(per_cpu(softnet_data.net_dma, cpu), NULL); 3424 rcu_assign_pointer(per_cpu(softnet_data, cpu).net_dma, NULL);
3409 unlock_cpu_hotplug();
3410 return; 3425 return;
3411 } 3426 }
3412 3427
@@ -3419,15 +3434,13 @@ static void net_dma_rebalance(void)
3419 + (i < (num_online_cpus() % net_dma_count) ? 1 : 0)); 3434 + (i < (num_online_cpus() % net_dma_count) ? 1 : 0));
3420 3435
3421 while(n) { 3436 while(n) {
3422 per_cpu(softnet_data.net_dma, cpu) = chan; 3437 per_cpu(softnet_data, cpu).net_dma = chan;
3423 cpu = next_cpu(cpu, cpu_online_map); 3438 cpu = next_cpu(cpu, cpu_online_map);
3424 n--; 3439 n--;
3425 } 3440 }
3426 i++; 3441 i++;
3427 } 3442 }
3428 rcu_read_unlock(); 3443 rcu_read_unlock();
3429
3430 unlock_cpu_hotplug();
3431} 3444}
3432 3445
3433/** 3446/**
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index 27ce1683caf5..2797e2815418 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -437,7 +437,7 @@ static int ethtool_set_pauseparam(struct net_device *dev, void __user *useraddr)
437{ 437{
438 struct ethtool_pauseparam pauseparam; 438 struct ethtool_pauseparam pauseparam;
439 439
440 if (!dev->ethtool_ops->get_pauseparam) 440 if (!dev->ethtool_ops->set_pauseparam)
441 return -EOPNOTSUPP; 441 return -EOPNOTSUPP;
442 442
443 if (copy_from_user(&pauseparam, useraddr, sizeof(pauseparam))) 443 if (copy_from_user(&pauseparam, useraddr, sizeof(pauseparam)))
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 7ad681f5e712..5130d2efdbbe 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -29,6 +29,7 @@
29#include <net/neighbour.h> 29#include <net/neighbour.h>
30#include <net/dst.h> 30#include <net/dst.h>
31#include <net/sock.h> 31#include <net/sock.h>
32#include <net/netevent.h>
32#include <linux/rtnetlink.h> 33#include <linux/rtnetlink.h>
33#include <linux/random.h> 34#include <linux/random.h>
34#include <linux/string.h> 35#include <linux/string.h>
@@ -754,6 +755,7 @@ static void neigh_timer_handler(unsigned long arg)
754 neigh->nud_state = NUD_STALE; 755 neigh->nud_state = NUD_STALE;
755 neigh->updated = jiffies; 756 neigh->updated = jiffies;
756 neigh_suspect(neigh); 757 neigh_suspect(neigh);
758 notify = 1;
757 } 759 }
758 } else if (state & NUD_DELAY) { 760 } else if (state & NUD_DELAY) {
759 if (time_before_eq(now, 761 if (time_before_eq(now,
@@ -762,6 +764,7 @@ static void neigh_timer_handler(unsigned long arg)
762 neigh->nud_state = NUD_REACHABLE; 764 neigh->nud_state = NUD_REACHABLE;
763 neigh->updated = jiffies; 765 neigh->updated = jiffies;
764 neigh_connect(neigh); 766 neigh_connect(neigh);
767 notify = 1;
765 next = neigh->confirmed + neigh->parms->reachable_time; 768 next = neigh->confirmed + neigh->parms->reachable_time;
766 } else { 769 } else {
767 NEIGH_PRINTK2("neigh %p is probed.\n", neigh); 770 NEIGH_PRINTK2("neigh %p is probed.\n", neigh);
@@ -819,6 +822,8 @@ static void neigh_timer_handler(unsigned long arg)
819out: 822out:
820 write_unlock(&neigh->lock); 823 write_unlock(&neigh->lock);
821 } 824 }
825 if (notify)
826 call_netevent_notifiers(NETEVENT_NEIGH_UPDATE, neigh);
822 827
823#ifdef CONFIG_ARPD 828#ifdef CONFIG_ARPD
824 if (notify && neigh->parms->app_probes) 829 if (notify && neigh->parms->app_probes)
@@ -926,9 +931,7 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new,
926{ 931{
927 u8 old; 932 u8 old;
928 int err; 933 int err;
929#ifdef CONFIG_ARPD
930 int notify = 0; 934 int notify = 0;
931#endif
932 struct net_device *dev; 935 struct net_device *dev;
933 int update_isrouter = 0; 936 int update_isrouter = 0;
934 937
@@ -948,9 +951,7 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new,
948 neigh_suspect(neigh); 951 neigh_suspect(neigh);
949 neigh->nud_state = new; 952 neigh->nud_state = new;
950 err = 0; 953 err = 0;
951#ifdef CONFIG_ARPD
952 notify = old & NUD_VALID; 954 notify = old & NUD_VALID;
953#endif
954 goto out; 955 goto out;
955 } 956 }
956 957
@@ -1022,9 +1023,7 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new,
1022 if (!(new & NUD_CONNECTED)) 1023 if (!(new & NUD_CONNECTED))
1023 neigh->confirmed = jiffies - 1024 neigh->confirmed = jiffies -
1024 (neigh->parms->base_reachable_time << 1); 1025 (neigh->parms->base_reachable_time << 1);
1025#ifdef CONFIG_ARPD
1026 notify = 1; 1026 notify = 1;
1027#endif
1028 } 1027 }
1029 if (new == old) 1028 if (new == old)
1030 goto out; 1029 goto out;
@@ -1056,6 +1055,9 @@ out:
1056 (neigh->flags & ~NTF_ROUTER); 1055 (neigh->flags & ~NTF_ROUTER);
1057 } 1056 }
1058 write_unlock_bh(&neigh->lock); 1057 write_unlock_bh(&neigh->lock);
1058
1059 if (notify)
1060 call_netevent_notifiers(NETEVENT_NEIGH_UPDATE, neigh);
1059#ifdef CONFIG_ARPD 1061#ifdef CONFIG_ARPD
1060 if (notify && neigh->parms->app_probes) 1062 if (notify && neigh->parms->app_probes)
1061 neigh_app_notify(neigh); 1063 neigh_app_notify(neigh);
diff --git a/net/core/netevent.c b/net/core/netevent.c
new file mode 100644
index 000000000000..35d02c38554e
--- /dev/null
+++ b/net/core/netevent.c
@@ -0,0 +1,69 @@
1/*
2 * Network event notifiers
3 *
4 * Authors:
5 * Tom Tucker <tom@opengridcomputing.com>
6 * Steve Wise <swise@opengridcomputing.com>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version
11 * 2 of the License, or (at your option) any later version.
12 *
13 * Fixes:
14 */
15
16#include <linux/rtnetlink.h>
17#include <linux/notifier.h>
18
19static ATOMIC_NOTIFIER_HEAD(netevent_notif_chain);
20
21/**
22 * register_netevent_notifier - register a netevent notifier block
23 * @nb: notifier
24 *
25 * Register a notifier to be called when a netevent occurs.
26 * The notifier passed is linked into the kernel structures and must
27 * not be reused until it has been unregistered. A negative errno code
28 * is returned on a failure.
29 */
30int register_netevent_notifier(struct notifier_block *nb)
31{
32 int err;
33
34 err = atomic_notifier_chain_register(&netevent_notif_chain, nb);
35 return err;
36}
37
38/**
39 * netevent_unregister_notifier - unregister a netevent notifier block
40 * @nb: notifier
41 *
42 * Unregister a notifier previously registered by
43 * register_neigh_notifier(). The notifier is unlinked into the
44 * kernel structures and may then be reused. A negative errno code
45 * is returned on a failure.
46 */
47
48int unregister_netevent_notifier(struct notifier_block *nb)
49{
50 return atomic_notifier_chain_unregister(&netevent_notif_chain, nb);
51}
52
53/**
54 * call_netevent_notifiers - call all netevent notifier blocks
55 * @val: value passed unmodified to notifier function
56 * @v: pointer passed unmodified to notifier function
57 *
58 * Call all neighbour notifier blocks. Parameters and return value
59 * are as for notifier_call_chain().
60 */
61
62int call_netevent_notifiers(unsigned long val, void *v)
63{
64 return atomic_notifier_call_chain(&netevent_notif_chain, val, v);
65}
66
67EXPORT_SYMBOL_GPL(register_netevent_notifier);
68EXPORT_SYMBOL_GPL(unregister_netevent_notifier);
69EXPORT_SYMBOL_GPL(call_netevent_notifiers);
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 44f6a181a754..022d8894c11d 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -71,13 +71,6 @@ static kmem_cache_t *skbuff_head_cache __read_mostly;
71static kmem_cache_t *skbuff_fclone_cache __read_mostly; 71static kmem_cache_t *skbuff_fclone_cache __read_mostly;
72 72
73/* 73/*
74 * lockdep: lock class key used by skb_queue_head_init():
75 */
76struct lock_class_key skb_queue_lock_key;
77
78EXPORT_SYMBOL(skb_queue_lock_key);
79
80/*
81 * Keep out-of-line to prevent kernel bloat. 74 * Keep out-of-line to prevent kernel bloat.
82 * __builtin_return_address is not used because it is not always 75 * __builtin_return_address is not used because it is not always
83 * reliable. 76 * reliable.
@@ -256,12 +249,35 @@ nodata:
256 goto out; 249 goto out;
257} 250}
258 251
252/**
253 * __netdev_alloc_skb - allocate an skbuff for rx on a specific device
254 * @dev: network device to receive on
255 * @length: length to allocate
256 * @gfp_mask: get_free_pages mask, passed to alloc_skb
257 *
258 * Allocate a new &sk_buff and assign it a usage count of one. The
259 * buffer has unspecified headroom built in. Users should allocate
260 * the headroom they think they need without accounting for the
261 * built in space. The built in space is used for optimisations.
262 *
263 * %NULL is returned if there is no free memory.
264 */
265struct sk_buff *__netdev_alloc_skb(struct net_device *dev,
266 unsigned int length, gfp_t gfp_mask)
267{
268 struct sk_buff *skb;
269
270 skb = alloc_skb(length + NET_SKB_PAD, gfp_mask);
271 if (likely(skb))
272 skb_reserve(skb, NET_SKB_PAD);
273 return skb;
274}
259 275
260static void skb_drop_fraglist(struct sk_buff *skb) 276static void skb_drop_list(struct sk_buff **listp)
261{ 277{
262 struct sk_buff *list = skb_shinfo(skb)->frag_list; 278 struct sk_buff *list = *listp;
263 279
264 skb_shinfo(skb)->frag_list = NULL; 280 *listp = NULL;
265 281
266 do { 282 do {
267 struct sk_buff *this = list; 283 struct sk_buff *this = list;
@@ -270,6 +286,11 @@ static void skb_drop_fraglist(struct sk_buff *skb)
270 } while (list); 286 } while (list);
271} 287}
272 288
289static inline void skb_drop_fraglist(struct sk_buff *skb)
290{
291 skb_drop_list(&skb_shinfo(skb)->frag_list);
292}
293
273static void skb_clone_fraglist(struct sk_buff *skb) 294static void skb_clone_fraglist(struct sk_buff *skb)
274{ 295{
275 struct sk_buff *list; 296 struct sk_buff *list;
@@ -830,41 +851,81 @@ free_skb:
830 851
831int ___pskb_trim(struct sk_buff *skb, unsigned int len) 852int ___pskb_trim(struct sk_buff *skb, unsigned int len)
832{ 853{
854 struct sk_buff **fragp;
855 struct sk_buff *frag;
833 int offset = skb_headlen(skb); 856 int offset = skb_headlen(skb);
834 int nfrags = skb_shinfo(skb)->nr_frags; 857 int nfrags = skb_shinfo(skb)->nr_frags;
835 int i; 858 int i;
859 int err;
836 860
837 for (i = 0; i < nfrags; i++) { 861 if (skb_cloned(skb) &&
862 unlikely((err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC))))
863 return err;
864
865 i = 0;
866 if (offset >= len)
867 goto drop_pages;
868
869 for (; i < nfrags; i++) {
838 int end = offset + skb_shinfo(skb)->frags[i].size; 870 int end = offset + skb_shinfo(skb)->frags[i].size;
839 if (end > len) { 871
840 if (skb_cloned(skb)) { 872 if (end < len) {
841 if (pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) 873 offset = end;
842 return -ENOMEM; 874 continue;
843 } 875 }
844 if (len <= offset) { 876
845 put_page(skb_shinfo(skb)->frags[i].page); 877 skb_shinfo(skb)->frags[i++].size = len - offset;
846 skb_shinfo(skb)->nr_frags--; 878
847 } else { 879drop_pages:
848 skb_shinfo(skb)->frags[i].size = len - offset; 880 skb_shinfo(skb)->nr_frags = i;
849 } 881
882 for (; i < nfrags; i++)
883 put_page(skb_shinfo(skb)->frags[i].page);
884
885 if (skb_shinfo(skb)->frag_list)
886 skb_drop_fraglist(skb);
887 goto done;
888 }
889
890 for (fragp = &skb_shinfo(skb)->frag_list; (frag = *fragp);
891 fragp = &frag->next) {
892 int end = offset + frag->len;
893
894 if (skb_shared(frag)) {
895 struct sk_buff *nfrag;
896
897 nfrag = skb_clone(frag, GFP_ATOMIC);
898 if (unlikely(!nfrag))
899 return -ENOMEM;
900
901 nfrag->next = frag->next;
902 kfree_skb(frag);
903 frag = nfrag;
904 *fragp = frag;
905 }
906
907 if (end < len) {
908 offset = end;
909 continue;
850 } 910 }
851 offset = end; 911
912 if (end > len &&
913 unlikely((err = pskb_trim(frag, len - offset))))
914 return err;
915
916 if (frag->next)
917 skb_drop_list(&frag->next);
918 break;
852 } 919 }
853 920
854 if (offset < len) { 921done:
922 if (len > skb_headlen(skb)) {
855 skb->data_len -= skb->len - len; 923 skb->data_len -= skb->len - len;
856 skb->len = len; 924 skb->len = len;
857 } else { 925 } else {
858 if (len <= skb_headlen(skb)) { 926 skb->len = len;
859 skb->len = len; 927 skb->data_len = 0;
860 skb->data_len = 0; 928 skb->tail = skb->data + len;
861 skb->tail = skb->data + len;
862 if (skb_shinfo(skb)->frag_list && !skb_cloned(skb))
863 skb_drop_fraglist(skb);
864 } else {
865 skb->data_len -= skb->len - len;
866 skb->len = len;
867 }
868 } 929 }
869 930
870 return 0; 931 return 0;
@@ -2003,6 +2064,7 @@ EXPORT_SYMBOL(__kfree_skb);
2003EXPORT_SYMBOL(kfree_skb); 2064EXPORT_SYMBOL(kfree_skb);
2004EXPORT_SYMBOL(__pskb_pull_tail); 2065EXPORT_SYMBOL(__pskb_pull_tail);
2005EXPORT_SYMBOL(__alloc_skb); 2066EXPORT_SYMBOL(__alloc_skb);
2067EXPORT_SYMBOL(__netdev_alloc_skb);
2006EXPORT_SYMBOL(pskb_copy); 2068EXPORT_SYMBOL(pskb_copy);
2007EXPORT_SYMBOL(pskb_expand_head); 2069EXPORT_SYMBOL(pskb_expand_head);
2008EXPORT_SYMBOL(skb_checksum); 2070EXPORT_SYMBOL(skb_checksum);
diff --git a/net/core/stream.c b/net/core/stream.c
index e9489696f694..d1d7decf70b0 100644
--- a/net/core/stream.c
+++ b/net/core/stream.c
@@ -196,15 +196,13 @@ EXPORT_SYMBOL(sk_stream_error);
196 196
197void __sk_stream_mem_reclaim(struct sock *sk) 197void __sk_stream_mem_reclaim(struct sock *sk)
198{ 198{
199 if (sk->sk_forward_alloc >= SK_STREAM_MEM_QUANTUM) { 199 atomic_sub(sk->sk_forward_alloc / SK_STREAM_MEM_QUANTUM,
200 atomic_sub(sk->sk_forward_alloc / SK_STREAM_MEM_QUANTUM, 200 sk->sk_prot->memory_allocated);
201 sk->sk_prot->memory_allocated); 201 sk->sk_forward_alloc &= SK_STREAM_MEM_QUANTUM - 1;
202 sk->sk_forward_alloc &= SK_STREAM_MEM_QUANTUM - 1; 202 if (*sk->sk_prot->memory_pressure &&
203 if (*sk->sk_prot->memory_pressure && 203 (atomic_read(sk->sk_prot->memory_allocated) <
204 (atomic_read(sk->sk_prot->memory_allocated) < 204 sk->sk_prot->sysctl_mem[0]))
205 sk->sk_prot->sysctl_mem[0])) 205 *sk->sk_prot->memory_pressure = 0;
206 *sk->sk_prot->memory_pressure = 0;
207 }
208} 206}
209 207
210EXPORT_SYMBOL(__sk_stream_mem_reclaim); 208EXPORT_SYMBOL(__sk_stream_mem_reclaim);
diff --git a/net/core/user_dma.c b/net/core/user_dma.c
index b7c98dbcdb81..248a6b666aff 100644
--- a/net/core/user_dma.c
+++ b/net/core/user_dma.c
@@ -29,6 +29,7 @@
29#include <linux/socket.h> 29#include <linux/socket.h>
30#include <linux/rtnetlink.h> /* for BUG_TRAP */ 30#include <linux/rtnetlink.h> /* for BUG_TRAP */
31#include <net/tcp.h> 31#include <net/tcp.h>
32#include <net/netdma.h>
32 33
33#define NET_DMA_DEFAULT_COPYBREAK 4096 34#define NET_DMA_DEFAULT_COPYBREAK 4096
34 35
diff --git a/net/dccp/feat.h b/net/dccp/feat.h
index 6048373c7186..b44c45504fb6 100644
--- a/net/dccp/feat.h
+++ b/net/dccp/feat.h
@@ -26,4 +26,6 @@ extern void dccp_feat_clean(struct dccp_minisock *dmsk);
26extern int dccp_feat_clone(struct sock *oldsk, struct sock *newsk); 26extern int dccp_feat_clone(struct sock *oldsk, struct sock *newsk);
27extern int dccp_feat_init(struct dccp_minisock *dmsk); 27extern int dccp_feat_init(struct dccp_minisock *dmsk);
28 28
29extern int dccp_feat_default_sequence_window;
30
29#endif /* _DCCP_FEAT_H */ 31#endif /* _DCCP_FEAT_H */
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index c3073e7e81d3..7f56f7e8f571 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -504,8 +504,7 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
504 ireq = inet_rsk(req); 504 ireq = inet_rsk(req);
505 ireq->loc_addr = daddr; 505 ireq->loc_addr = daddr;
506 ireq->rmt_addr = saddr; 506 ireq->rmt_addr = saddr;
507 req->rcv_wnd = 100; /* Fake, option parsing will get the 507 req->rcv_wnd = dccp_feat_default_sequence_window;
508 right value */
509 ireq->opt = NULL; 508 ireq->opt = NULL;
510 509
511 /* 510 /*
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
index ff42bc43263d..610c722ac27f 100644
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -31,6 +31,7 @@
31 31
32#include "dccp.h" 32#include "dccp.h"
33#include "ipv6.h" 33#include "ipv6.h"
34#include "feat.h"
34 35
35/* Socket used for sending RSTs and ACKs */ 36/* Socket used for sending RSTs and ACKs */
36static struct socket *dccp_v6_ctl_socket; 37static struct socket *dccp_v6_ctl_socket;
@@ -229,7 +230,7 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
229 ipv6_addr_copy(&np->saddr, saddr); 230 ipv6_addr_copy(&np->saddr, saddr);
230 inet->rcv_saddr = LOOPBACK4_IPV6; 231 inet->rcv_saddr = LOOPBACK4_IPV6;
231 232
232 ip6_dst_store(sk, dst, NULL); 233 __ip6_dst_store(sk, dst, NULL);
233 234
234 icsk->icsk_ext_hdr_len = 0; 235 icsk->icsk_ext_hdr_len = 0;
235 if (np->opt != NULL) 236 if (np->opt != NULL)
@@ -707,8 +708,7 @@ static int dccp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
707 ireq = inet_rsk(req); 708 ireq = inet_rsk(req);
708 ipv6_addr_copy(&ireq6->rmt_addr, &skb->nh.ipv6h->saddr); 709 ipv6_addr_copy(&ireq6->rmt_addr, &skb->nh.ipv6h->saddr);
709 ipv6_addr_copy(&ireq6->loc_addr, &skb->nh.ipv6h->daddr); 710 ipv6_addr_copy(&ireq6->loc_addr, &skb->nh.ipv6h->daddr);
710 req->rcv_wnd = 100; /* Fake, option parsing will get the 711 req->rcv_wnd = dccp_feat_default_sequence_window;
711 right value */
712 ireq6->pktopts = NULL; 712 ireq6->pktopts = NULL;
713 713
714 if (ipv6_opt_accepted(sk, skb) || 714 if (ipv6_opt_accepted(sk, skb) ||
@@ -863,7 +863,7 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk,
863 * comment in that function for the gory details. -acme 863 * comment in that function for the gory details. -acme
864 */ 864 */
865 865
866 ip6_dst_store(newsk, dst, NULL); 866 __ip6_dst_store(newsk, dst, NULL);
867 newsk->sk_route_caps = dst->dev->features & ~(NETIF_F_IP_CSUM | 867 newsk->sk_route_caps = dst->dev->features & ~(NETIF_F_IP_CSUM |
868 NETIF_F_TSO); 868 NETIF_F_TSO);
869 newdp6 = (struct dccp6_sock *)newsk; 869 newdp6 = (struct dccp6_sock *)newsk;
diff --git a/net/dccp/options.c b/net/dccp/options.c
index c3cda1e39aa8..daf72bb671f0 100644
--- a/net/dccp/options.c
+++ b/net/dccp/options.c
@@ -29,6 +29,8 @@ int dccp_feat_default_ack_ratio = DCCPF_INITIAL_ACK_RATIO;
29int dccp_feat_default_send_ack_vector = DCCPF_INITIAL_SEND_ACK_VECTOR; 29int dccp_feat_default_send_ack_vector = DCCPF_INITIAL_SEND_ACK_VECTOR;
30int dccp_feat_default_send_ndp_count = DCCPF_INITIAL_SEND_NDP_COUNT; 30int dccp_feat_default_send_ndp_count = DCCPF_INITIAL_SEND_NDP_COUNT;
31 31
32EXPORT_SYMBOL_GPL(dccp_feat_default_sequence_window);
33
32void dccp_minisock_init(struct dccp_minisock *dmsk) 34void dccp_minisock_init(struct dccp_minisock *dmsk)
33{ 35{
34 dmsk->dccpms_sequence_window = dccp_feat_default_sequence_window; 36 dmsk->dccpms_sequence_window = dccp_feat_default_sequence_window;
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index f4f0627ea41c..6f14bb5a28d4 100644
--- a/net/dccp/proto.c
+++ b/net/dccp/proto.c
@@ -484,7 +484,7 @@ static int do_dccp_setsockopt(struct sock *sk, int level, int optname,
484 err = -EINVAL; 484 err = -EINVAL;
485 else 485 else
486 err = dccp_setsockopt_change(sk, DCCPO_CHANGE_L, 486 err = dccp_setsockopt_change(sk, DCCPO_CHANGE_L,
487 (struct dccp_so_feat *) 487 (struct dccp_so_feat __user *)
488 optval); 488 optval);
489 break; 489 break;
490 490
@@ -493,7 +493,7 @@ static int do_dccp_setsockopt(struct sock *sk, int level, int optname,
493 err = -EINVAL; 493 err = -EINVAL;
494 else 494 else
495 err = dccp_setsockopt_change(sk, DCCPO_CHANGE_R, 495 err = dccp_setsockopt_change(sk, DCCPO_CHANGE_R,
496 (struct dccp_so_feat *) 496 (struct dccp_so_feat __user *)
497 optval); 497 optval);
498 break; 498 break;
499 499
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c
index 98a25208440d..476455fbdb03 100644
--- a/net/decnet/dn_dev.c
+++ b/net/decnet/dn_dev.c
@@ -413,11 +413,7 @@ static struct dn_ifaddr *dn_dev_alloc_ifa(void)
413{ 413{
414 struct dn_ifaddr *ifa; 414 struct dn_ifaddr *ifa;
415 415
416 ifa = kmalloc(sizeof(*ifa), GFP_KERNEL); 416 ifa = kzalloc(sizeof(*ifa), GFP_KERNEL);
417
418 if (ifa) {
419 memset(ifa, 0, sizeof(*ifa));
420 }
421 417
422 return ifa; 418 return ifa;
423} 419}
@@ -1105,10 +1101,9 @@ struct dn_dev *dn_dev_create(struct net_device *dev, int *err)
1105 return NULL; 1101 return NULL;
1106 1102
1107 *err = -ENOBUFS; 1103 *err = -ENOBUFS;
1108 if ((dn_db = kmalloc(sizeof(struct dn_dev), GFP_ATOMIC)) == NULL) 1104 if ((dn_db = kzalloc(sizeof(struct dn_dev), GFP_ATOMIC)) == NULL)
1109 return NULL; 1105 return NULL;
1110 1106
1111 memset(dn_db, 0, sizeof(struct dn_dev));
1112 memcpy(&dn_db->parms, p, sizeof(struct dn_dev_parms)); 1107 memcpy(&dn_db->parms, p, sizeof(struct dn_dev_parms));
1113 smp_wmb(); 1108 smp_wmb();
1114 dev->dn_ptr = dn_db; 1109 dev->dn_ptr = dn_db;
diff --git a/net/decnet/dn_fib.c b/net/decnet/dn_fib.c
index 0375077391b7..fa20e2efcfc1 100644
--- a/net/decnet/dn_fib.c
+++ b/net/decnet/dn_fib.c
@@ -283,11 +283,10 @@ struct dn_fib_info *dn_fib_create_info(const struct rtmsg *r, struct dn_kern_rta
283 goto err_inval; 283 goto err_inval;
284 } 284 }
285 285
286 fi = kmalloc(sizeof(*fi)+nhs*sizeof(struct dn_fib_nh), GFP_KERNEL); 286 fi = kzalloc(sizeof(*fi)+nhs*sizeof(struct dn_fib_nh), GFP_KERNEL);
287 err = -ENOBUFS; 287 err = -ENOBUFS;
288 if (fi == NULL) 288 if (fi == NULL)
289 goto failure; 289 goto failure;
290 memset(fi, 0, sizeof(*fi)+nhs*sizeof(struct dn_fib_nh));
291 290
292 fi->fib_protocol = r->rtm_protocol; 291 fi->fib_protocol = r->rtm_protocol;
293 fi->fib_nhs = nhs; 292 fi->fib_nhs = nhs;
diff --git a/net/decnet/dn_neigh.c b/net/decnet/dn_neigh.c
index 5ce9c9e0565c..ff0ebe99137d 100644
--- a/net/decnet/dn_neigh.c
+++ b/net/decnet/dn_neigh.c
@@ -580,12 +580,11 @@ static int dn_neigh_seq_open(struct inode *inode, struct file *file)
580{ 580{
581 struct seq_file *seq; 581 struct seq_file *seq;
582 int rc = -ENOMEM; 582 int rc = -ENOMEM;
583 struct neigh_seq_state *s = kmalloc(sizeof(*s), GFP_KERNEL); 583 struct neigh_seq_state *s = kzalloc(sizeof(*s), GFP_KERNEL);
584 584
585 if (!s) 585 if (!s)
586 goto out; 586 goto out;
587 587
588 memset(s, 0, sizeof(*s));
589 rc = seq_open(file, &dn_neigh_seq_ops); 588 rc = seq_open(file, &dn_neigh_seq_ops);
590 if (rc) 589 if (rc)
591 goto out_kfree; 590 goto out_kfree;
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index 1355614ec11b..743e9fcf7c5a 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -925,8 +925,13 @@ static int dn_route_output_slow(struct dst_entry **pprt, const struct flowi *old
925 for(dev_out = dev_base; dev_out; dev_out = dev_out->next) { 925 for(dev_out = dev_base; dev_out; dev_out = dev_out->next) {
926 if (!dev_out->dn_ptr) 926 if (!dev_out->dn_ptr)
927 continue; 927 continue;
928 if (dn_dev_islocal(dev_out, oldflp->fld_src)) 928 if (!dn_dev_islocal(dev_out, oldflp->fld_src))
929 break; 929 continue;
930 if ((dev_out->flags & IFF_LOOPBACK) &&
931 oldflp->fld_dst &&
932 !dn_dev_islocal(dev_out, oldflp->fld_dst))
933 continue;
934 break;
930 } 935 }
931 read_unlock(&dev_base_lock); 936 read_unlock(&dev_base_lock);
932 if (dev_out == NULL) 937 if (dev_out == NULL)
diff --git a/net/decnet/dn_rules.c b/net/decnet/dn_rules.c
index 06e785fe5757..6986be754ef2 100644
--- a/net/decnet/dn_rules.c
+++ b/net/decnet/dn_rules.c
@@ -151,10 +151,9 @@ int dn_fib_rtm_newrule(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
151 } 151 }
152 } 152 }
153 153
154 new_r = kmalloc(sizeof(*new_r), GFP_KERNEL); 154 new_r = kzalloc(sizeof(*new_r), GFP_KERNEL);
155 if (!new_r) 155 if (!new_r)
156 return -ENOMEM; 156 return -ENOMEM;
157 memset(new_r, 0, sizeof(*new_r));
158 157
159 if (rta[RTA_SRC-1]) 158 if (rta[RTA_SRC-1])
160 memcpy(&new_r->r_src, RTA_DATA(rta[RTA_SRC-1]), 2); 159 memcpy(&new_r->r_src, RTA_DATA(rta[RTA_SRC-1]), 2);
@@ -399,9 +398,10 @@ int dn_fib_dump_rules(struct sk_buff *skb, struct netlink_callback *cb)
399 rcu_read_lock(); 398 rcu_read_lock();
400 hlist_for_each_entry(r, node, &dn_fib_rules, r_hlist) { 399 hlist_for_each_entry(r, node, &dn_fib_rules, r_hlist) {
401 if (idx < s_idx) 400 if (idx < s_idx)
402 continue; 401 goto next;
403 if (dn_fib_fill_rule(skb, r, cb, NLM_F_MULTI) < 0) 402 if (dn_fib_fill_rule(skb, r, cb, NLM_F_MULTI) < 0)
404 break; 403 break;
404next:
405 idx++; 405 idx++;
406 } 406 }
407 rcu_read_unlock(); 407 rcu_read_unlock();
diff --git a/net/decnet/dn_table.c b/net/decnet/dn_table.c
index 37d9d0a1ac8c..e926c952e363 100644
--- a/net/decnet/dn_table.c
+++ b/net/decnet/dn_table.c
@@ -158,12 +158,10 @@ static void dn_rehash_zone(struct dn_zone *dz)
158 break; 158 break;
159 } 159 }
160 160
161 ht = kmalloc(new_divisor*sizeof(struct dn_fib_node*), GFP_KERNEL); 161 ht = kcalloc(new_divisor, sizeof(struct dn_fib_node*), GFP_KERNEL);
162
163 if (ht == NULL) 162 if (ht == NULL)
164 return; 163 return;
165 164
166 memset(ht, 0, new_divisor*sizeof(struct dn_fib_node *));
167 write_lock_bh(&dn_fib_tables_lock); 165 write_lock_bh(&dn_fib_tables_lock);
168 old_ht = dz->dz_hash; 166 old_ht = dz->dz_hash;
169 dz->dz_hash = ht; 167 dz->dz_hash = ht;
@@ -184,11 +182,10 @@ static void dn_free_node(struct dn_fib_node *f)
184static struct dn_zone *dn_new_zone(struct dn_hash *table, int z) 182static struct dn_zone *dn_new_zone(struct dn_hash *table, int z)
185{ 183{
186 int i; 184 int i;
187 struct dn_zone *dz = kmalloc(sizeof(struct dn_zone), GFP_KERNEL); 185 struct dn_zone *dz = kzalloc(sizeof(struct dn_zone), GFP_KERNEL);
188 if (!dz) 186 if (!dz)
189 return NULL; 187 return NULL;
190 188
191 memset(dz, 0, sizeof(struct dn_zone));
192 if (z) { 189 if (z) {
193 dz->dz_divisor = 16; 190 dz->dz_divisor = 16;
194 dz->dz_hashmask = 0x0F; 191 dz->dz_hashmask = 0x0F;
@@ -197,14 +194,12 @@ static struct dn_zone *dn_new_zone(struct dn_hash *table, int z)
197 dz->dz_hashmask = 0; 194 dz->dz_hashmask = 0;
198 } 195 }
199 196
200 dz->dz_hash = kmalloc(dz->dz_divisor*sizeof(struct dn_fib_node *), GFP_KERNEL); 197 dz->dz_hash = kcalloc(dz->dz_divisor, sizeof(struct dn_fib_node *), GFP_KERNEL);
201
202 if (!dz->dz_hash) { 198 if (!dz->dz_hash) {
203 kfree(dz); 199 kfree(dz);
204 return NULL; 200 return NULL;
205 } 201 }
206 202
207 memset(dz->dz_hash, 0, dz->dz_divisor*sizeof(struct dn_fib_node*));
208 dz->dz_order = z; 203 dz->dz_order = z;
209 dz->dz_mask = dnet_make_mask(z); 204 dz->dz_mask = dnet_make_mask(z);
210 205
diff --git a/net/econet/af_econet.c b/net/econet/af_econet.c
index 309ae4c6549a..4d66aac13483 100644
--- a/net/econet/af_econet.c
+++ b/net/econet/af_econet.c
@@ -673,12 +673,11 @@ static int ec_dev_ioctl(struct socket *sock, unsigned int cmd, void __user *arg)
673 edev = dev->ec_ptr; 673 edev = dev->ec_ptr;
674 if (edev == NULL) { 674 if (edev == NULL) {
675 /* Magic up a new one. */ 675 /* Magic up a new one. */
676 edev = kmalloc(sizeof(struct ec_device), GFP_KERNEL); 676 edev = kzalloc(sizeof(struct ec_device), GFP_KERNEL);
677 if (edev == NULL) { 677 if (edev == NULL) {
678 err = -ENOMEM; 678 err = -ENOMEM;
679 break; 679 break;
680 } 680 }
681 memset(edev, 0, sizeof(struct ec_device));
682 dev->ec_ptr = edev; 681 dev->ec_ptr = edev;
683 } else 682 } else
684 net2dev_map[edev->net] = NULL; 683 net2dev_map[edev->net] = NULL;
diff --git a/net/ieee80211/Kconfig b/net/ieee80211/Kconfig
index dbb08528ddf5..f7e84e9d13ad 100644
--- a/net/ieee80211/Kconfig
+++ b/net/ieee80211/Kconfig
@@ -58,6 +58,7 @@ config IEEE80211_CRYPT_TKIP
58 depends on IEEE80211 && NET_RADIO 58 depends on IEEE80211 && NET_RADIO
59 select CRYPTO 59 select CRYPTO
60 select CRYPTO_MICHAEL_MIC 60 select CRYPTO_MICHAEL_MIC
61 select CRC32
61 ---help--- 62 ---help---
62 Include software based cipher suites in support of IEEE 802.11i 63 Include software based cipher suites in support of IEEE 802.11i
63 (aka TGi, WPA, WPA2, WPA-PSK, etc.) for use with TKIP enabled 64 (aka TGi, WPA, WPA2, WPA-PSK, etc.) for use with TKIP enabled
diff --git a/net/ieee80211/ieee80211_crypt.c b/net/ieee80211/ieee80211_crypt.c
index cb71d794a7d1..5ed0a98b2d76 100644
--- a/net/ieee80211/ieee80211_crypt.c
+++ b/net/ieee80211/ieee80211_crypt.c
@@ -110,11 +110,10 @@ int ieee80211_register_crypto_ops(struct ieee80211_crypto_ops *ops)
110 unsigned long flags; 110 unsigned long flags;
111 struct ieee80211_crypto_alg *alg; 111 struct ieee80211_crypto_alg *alg;
112 112
113 alg = kmalloc(sizeof(*alg), GFP_KERNEL); 113 alg = kzalloc(sizeof(*alg), GFP_KERNEL);
114 if (alg == NULL) 114 if (alg == NULL)
115 return -ENOMEM; 115 return -ENOMEM;
116 116
117 memset(alg, 0, sizeof(*alg));
118 alg->ops = ops; 117 alg->ops = ops;
119 118
120 spin_lock_irqsave(&ieee80211_crypto_lock, flags); 119 spin_lock_irqsave(&ieee80211_crypto_lock, flags);
diff --git a/net/ieee80211/ieee80211_crypt_ccmp.c b/net/ieee80211/ieee80211_crypt_ccmp.c
index 492647382ad0..ed90a8af1444 100644
--- a/net/ieee80211/ieee80211_crypt_ccmp.c
+++ b/net/ieee80211/ieee80211_crypt_ccmp.c
@@ -76,10 +76,9 @@ static void *ieee80211_ccmp_init(int key_idx)
76{ 76{
77 struct ieee80211_ccmp_data *priv; 77 struct ieee80211_ccmp_data *priv;
78 78
79 priv = kmalloc(sizeof(*priv), GFP_ATOMIC); 79 priv = kzalloc(sizeof(*priv), GFP_ATOMIC);
80 if (priv == NULL) 80 if (priv == NULL)
81 goto fail; 81 goto fail;
82 memset(priv, 0, sizeof(*priv));
83 priv->key_idx = key_idx; 82 priv->key_idx = key_idx;
84 83
85 priv->tfm = crypto_alloc_tfm("aes", 0); 84 priv->tfm = crypto_alloc_tfm("aes", 0);
diff --git a/net/ieee80211/ieee80211_crypt_wep.c b/net/ieee80211/ieee80211_crypt_wep.c
index c5a87724aabe..0ebf235f6939 100644
--- a/net/ieee80211/ieee80211_crypt_wep.c
+++ b/net/ieee80211/ieee80211_crypt_wep.c
@@ -39,10 +39,9 @@ static void *prism2_wep_init(int keyidx)
39{ 39{
40 struct prism2_wep_data *priv; 40 struct prism2_wep_data *priv;
41 41
42 priv = kmalloc(sizeof(*priv), GFP_ATOMIC); 42 priv = kzalloc(sizeof(*priv), GFP_ATOMIC);
43 if (priv == NULL) 43 if (priv == NULL)
44 goto fail; 44 goto fail;
45 memset(priv, 0, sizeof(*priv));
46 priv->key_idx = keyidx; 45 priv->key_idx = keyidx;
47 46
48 priv->tfm = crypto_alloc_tfm("arc4", 0); 47 priv->tfm = crypto_alloc_tfm("arc4", 0);
diff --git a/net/ieee80211/ieee80211_rx.c b/net/ieee80211/ieee80211_rx.c
index 47ccf159372c..72d4d4e04d42 100644
--- a/net/ieee80211/ieee80211_rx.c
+++ b/net/ieee80211/ieee80211_rx.c
@@ -368,6 +368,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
368 368
369 /* Put this code here so that we avoid duplicating it in all 369 /* Put this code here so that we avoid duplicating it in all
370 * Rx paths. - Jean II */ 370 * Rx paths. - Jean II */
371#ifdef CONFIG_WIRELESS_EXT
371#ifdef IW_WIRELESS_SPY /* defined in iw_handler.h */ 372#ifdef IW_WIRELESS_SPY /* defined in iw_handler.h */
372 /* If spy monitoring on */ 373 /* If spy monitoring on */
373 if (ieee->spy_data.spy_number > 0) { 374 if (ieee->spy_data.spy_number > 0) {
@@ -396,15 +397,16 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
396 wireless_spy_update(ieee->dev, hdr->addr2, &wstats); 397 wireless_spy_update(ieee->dev, hdr->addr2, &wstats);
397 } 398 }
398#endif /* IW_WIRELESS_SPY */ 399#endif /* IW_WIRELESS_SPY */
400#endif /* CONFIG_WIRELESS_EXT */
399 401
400#ifdef NOT_YET 402#ifdef NOT_YET
401 hostap_update_rx_stats(local->ap, hdr, rx_stats); 403 hostap_update_rx_stats(local->ap, hdr, rx_stats);
402#endif 404#endif
403 405
404 if (ieee->iw_mode == IW_MODE_MONITOR) { 406 if (ieee->iw_mode == IW_MODE_MONITOR) {
405 ieee80211_monitor_rx(ieee, skb, rx_stats);
406 stats->rx_packets++; 407 stats->rx_packets++;
407 stats->rx_bytes += skb->len; 408 stats->rx_bytes += skb->len;
409 ieee80211_monitor_rx(ieee, skb, rx_stats);
408 return 1; 410 return 1;
409 } 411 }
410 412
diff --git a/net/ieee80211/ieee80211_tx.c b/net/ieee80211/ieee80211_tx.c
index de148ae594f3..bf042139c7ab 100644
--- a/net/ieee80211/ieee80211_tx.c
+++ b/net/ieee80211/ieee80211_tx.c
@@ -562,10 +562,13 @@ int ieee80211_tx_frame(struct ieee80211_device *ieee,
562 struct net_device_stats *stats = &ieee->stats; 562 struct net_device_stats *stats = &ieee->stats;
563 struct sk_buff *skb_frag; 563 struct sk_buff *skb_frag;
564 int priority = -1; 564 int priority = -1;
565 int fraglen = total_len;
566 int headroom = ieee->tx_headroom;
567 struct ieee80211_crypt_data *crypt = ieee->crypt[ieee->tx_keyidx];
565 568
566 spin_lock_irqsave(&ieee->lock, flags); 569 spin_lock_irqsave(&ieee->lock, flags);
567 570
568 if (encrypt_mpdu && !ieee->sec.encrypt) 571 if (encrypt_mpdu && (!ieee->sec.encrypt || !crypt))
569 encrypt_mpdu = 0; 572 encrypt_mpdu = 0;
570 573
571 /* If there is no driver handler to take the TXB, dont' bother 574 /* If there is no driver handler to take the TXB, dont' bother
@@ -581,20 +584,24 @@ int ieee80211_tx_frame(struct ieee80211_device *ieee,
581 goto success; 584 goto success;
582 } 585 }
583 586
584 if (encrypt_mpdu) 587 if (encrypt_mpdu) {
585 frame->frame_ctl |= cpu_to_le16(IEEE80211_FCTL_PROTECTED); 588 frame->frame_ctl |= cpu_to_le16(IEEE80211_FCTL_PROTECTED);
589 fraglen += crypt->ops->extra_mpdu_prefix_len +
590 crypt->ops->extra_mpdu_postfix_len;
591 headroom += crypt->ops->extra_mpdu_prefix_len;
592 }
586 593
587 /* When we allocate the TXB we allocate enough space for the reserve 594 /* When we allocate the TXB we allocate enough space for the reserve
588 * and full fragment bytes (bytes_per_frag doesn't include prefix, 595 * and full fragment bytes (bytes_per_frag doesn't include prefix,
589 * postfix, header, FCS, etc.) */ 596 * postfix, header, FCS, etc.) */
590 txb = ieee80211_alloc_txb(1, total_len, ieee->tx_headroom, GFP_ATOMIC); 597 txb = ieee80211_alloc_txb(1, fraglen, headroom, GFP_ATOMIC);
591 if (unlikely(!txb)) { 598 if (unlikely(!txb)) {
592 printk(KERN_WARNING "%s: Could not allocate TXB\n", 599 printk(KERN_WARNING "%s: Could not allocate TXB\n",
593 ieee->dev->name); 600 ieee->dev->name);
594 goto failed; 601 goto failed;
595 } 602 }
596 txb->encrypted = 0; 603 txb->encrypted = 0;
597 txb->payload_size = total_len; 604 txb->payload_size = fraglen;
598 605
599 skb_frag = txb->fragments[0]; 606 skb_frag = txb->fragments[0];
600 607
diff --git a/net/ieee80211/ieee80211_wx.c b/net/ieee80211/ieee80211_wx.c
index a78c4f845f66..5cb9cfd35397 100644
--- a/net/ieee80211/ieee80211_wx.c
+++ b/net/ieee80211/ieee80211_wx.c
@@ -369,11 +369,10 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
369 struct ieee80211_crypt_data *new_crypt; 369 struct ieee80211_crypt_data *new_crypt;
370 370
371 /* take WEP into use */ 371 /* take WEP into use */
372 new_crypt = kmalloc(sizeof(struct ieee80211_crypt_data), 372 new_crypt = kzalloc(sizeof(struct ieee80211_crypt_data),
373 GFP_KERNEL); 373 GFP_KERNEL);
374 if (new_crypt == NULL) 374 if (new_crypt == NULL)
375 return -ENOMEM; 375 return -ENOMEM;
376 memset(new_crypt, 0, sizeof(struct ieee80211_crypt_data));
377 new_crypt->ops = ieee80211_get_crypto_ops("WEP"); 376 new_crypt->ops = ieee80211_get_crypto_ops("WEP");
378 if (!new_crypt->ops) { 377 if (!new_crypt->ops) {
379 request_module("ieee80211_crypt_wep"); 378 request_module("ieee80211_crypt_wep");
@@ -616,13 +615,11 @@ int ieee80211_wx_set_encodeext(struct ieee80211_device *ieee,
616 615
617 ieee80211_crypt_delayed_deinit(ieee, crypt); 616 ieee80211_crypt_delayed_deinit(ieee, crypt);
618 617
619 new_crypt = (struct ieee80211_crypt_data *) 618 new_crypt = kzalloc(sizeof(*new_crypt), GFP_KERNEL);
620 kmalloc(sizeof(*new_crypt), GFP_KERNEL);
621 if (new_crypt == NULL) { 619 if (new_crypt == NULL) {
622 ret = -ENOMEM; 620 ret = -ENOMEM;
623 goto done; 621 goto done;
624 } 622 }
625 memset(new_crypt, 0, sizeof(struct ieee80211_crypt_data));
626 new_crypt->ops = ops; 623 new_crypt->ops = ops;
627 if (new_crypt->ops && try_module_get(new_crypt->ops->owner)) 624 if (new_crypt->ops && try_module_get(new_crypt->ops->owner))
628 new_crypt->priv = new_crypt->ops->init(idx); 625 new_crypt->priv = new_crypt->ops->init(idx);
diff --git a/net/ieee80211/softmac/ieee80211softmac_assoc.c b/net/ieee80211/softmac/ieee80211softmac_assoc.c
index 5e9a90651d04..44215ce64d4e 100644
--- a/net/ieee80211/softmac/ieee80211softmac_assoc.c
+++ b/net/ieee80211/softmac/ieee80211softmac_assoc.c
@@ -47,9 +47,7 @@ ieee80211softmac_assoc(struct ieee80211softmac_device *mac, struct ieee80211soft
47 47
48 dprintk(KERN_INFO PFX "sent association request!\n"); 48 dprintk(KERN_INFO PFX "sent association request!\n");
49 49
50 /* Change the state to associating */
51 spin_lock_irqsave(&mac->lock, flags); 50 spin_lock_irqsave(&mac->lock, flags);
52 mac->associnfo.associating = 1;
53 mac->associated = 0; /* just to make sure */ 51 mac->associated = 0; /* just to make sure */
54 52
55 /* Set a timer for timeout */ 53 /* Set a timer for timeout */
@@ -63,6 +61,7 @@ void
63ieee80211softmac_assoc_timeout(void *d) 61ieee80211softmac_assoc_timeout(void *d)
64{ 62{
65 struct ieee80211softmac_device *mac = (struct ieee80211softmac_device *)d; 63 struct ieee80211softmac_device *mac = (struct ieee80211softmac_device *)d;
64 struct ieee80211softmac_network *n;
66 unsigned long flags; 65 unsigned long flags;
67 66
68 spin_lock_irqsave(&mac->lock, flags); 67 spin_lock_irqsave(&mac->lock, flags);
@@ -75,11 +74,12 @@ ieee80211softmac_assoc_timeout(void *d)
75 mac->associnfo.associating = 0; 74 mac->associnfo.associating = 0;
76 mac->associnfo.bssvalid = 0; 75 mac->associnfo.bssvalid = 0;
77 mac->associated = 0; 76 mac->associated = 0;
77
78 n = ieee80211softmac_get_network_by_bssid_locked(mac, mac->associnfo.bssid);
78 spin_unlock_irqrestore(&mac->lock, flags); 79 spin_unlock_irqrestore(&mac->lock, flags);
79 80
80 dprintk(KERN_INFO PFX "assoc request timed out!\n"); 81 dprintk(KERN_INFO PFX "assoc request timed out!\n");
81 /* FIXME: we need to know the network here. that requires a bit of restructuring */ 82 ieee80211softmac_call_events(mac, IEEE80211SOFTMAC_EVENT_ASSOCIATE_TIMEOUT, n);
82 ieee80211softmac_call_events(mac, IEEE80211SOFTMAC_EVENT_ASSOCIATE_TIMEOUT, NULL);
83} 83}
84 84
85void 85void
@@ -203,6 +203,10 @@ ieee80211softmac_assoc_work(void *d)
203 if (mac->associated) 203 if (mac->associated)
204 ieee80211softmac_send_disassoc_req(mac, WLAN_REASON_DISASSOC_STA_HAS_LEFT); 204 ieee80211softmac_send_disassoc_req(mac, WLAN_REASON_DISASSOC_STA_HAS_LEFT);
205 205
206 spin_lock_irqsave(&mac->lock, flags);
207 mac->associnfo.associating = 1;
208 spin_unlock_irqrestore(&mac->lock, flags);
209
206 /* try to find the requested network in our list, if we found one already */ 210 /* try to find the requested network in our list, if we found one already */
207 if (bssvalid || mac->associnfo.bssfixed) 211 if (bssvalid || mac->associnfo.bssfixed)
208 found = ieee80211softmac_get_network_by_bssid(mac, mac->associnfo.bssid); 212 found = ieee80211softmac_get_network_by_bssid(mac, mac->associnfo.bssid);
@@ -295,19 +299,32 @@ ieee80211softmac_assoc_work(void *d)
295 memcpy(mac->associnfo.associate_essid.data, found->essid.data, IW_ESSID_MAX_SIZE + 1); 299 memcpy(mac->associnfo.associate_essid.data, found->essid.data, IW_ESSID_MAX_SIZE + 1);
296 300
297 /* we found a network! authenticate (if necessary) and associate to it. */ 301 /* we found a network! authenticate (if necessary) and associate to it. */
298 if (!found->authenticated) { 302 if (found->authenticating) {
303 dprintk(KERN_INFO PFX "Already requested authentication, waiting...\n");
304 if(!mac->associnfo.assoc_wait) {
305 mac->associnfo.assoc_wait = 1;
306 ieee80211softmac_notify_internal(mac, IEEE80211SOFTMAC_EVENT_ANY, found, ieee80211softmac_assoc_notify_auth, NULL, GFP_KERNEL);
307 }
308 return;
309 }
310 if (!found->authenticated && !found->authenticating) {
299 /* This relies on the fact that _auth_req only queues the work, 311 /* This relies on the fact that _auth_req only queues the work,
300 * otherwise adding the notification would be racy. */ 312 * otherwise adding the notification would be racy. */
301 if (!ieee80211softmac_auth_req(mac, found)) { 313 if (!ieee80211softmac_auth_req(mac, found)) {
302 dprintk(KERN_INFO PFX "cannot associate without being authenticated, requested authentication\n"); 314 if(!mac->associnfo.assoc_wait) {
303 ieee80211softmac_notify_internal(mac, IEEE80211SOFTMAC_EVENT_ANY, found, ieee80211softmac_assoc_notify_auth, NULL, GFP_KERNEL); 315 dprintk(KERN_INFO PFX "Cannot associate without being authenticated, requested authentication\n");
316 mac->associnfo.assoc_wait = 1;
317 ieee80211softmac_notify_internal(mac, IEEE80211SOFTMAC_EVENT_ANY, found, ieee80211softmac_assoc_notify_auth, NULL, GFP_KERNEL);
318 }
304 } else { 319 } else {
305 printkl(KERN_WARNING PFX "Not authenticated, but requesting authentication failed. Giving up to associate\n"); 320 printkl(KERN_WARNING PFX "Not authenticated, but requesting authentication failed. Giving up to associate\n");
321 mac->associnfo.assoc_wait = 0;
306 ieee80211softmac_call_events(mac, IEEE80211SOFTMAC_EVENT_ASSOCIATE_FAILED, found); 322 ieee80211softmac_call_events(mac, IEEE80211SOFTMAC_EVENT_ASSOCIATE_FAILED, found);
307 } 323 }
308 return; 324 return;
309 } 325 }
310 /* finally! now we can start associating */ 326 /* finally! now we can start associating */
327 mac->associnfo.assoc_wait = 0;
311 ieee80211softmac_assoc(mac, found); 328 ieee80211softmac_assoc(mac, found);
312} 329}
313 330
diff --git a/net/ieee80211/softmac/ieee80211softmac_auth.c b/net/ieee80211/softmac/ieee80211softmac_auth.c
index 90b8484e509b..4cef39e171d0 100644
--- a/net/ieee80211/softmac/ieee80211softmac_auth.c
+++ b/net/ieee80211/softmac/ieee80211softmac_auth.c
@@ -36,8 +36,9 @@ ieee80211softmac_auth_req(struct ieee80211softmac_device *mac,
36 struct ieee80211softmac_auth_queue_item *auth; 36 struct ieee80211softmac_auth_queue_item *auth;
37 unsigned long flags; 37 unsigned long flags;
38 38
39 if (net->authenticating) 39 if (net->authenticating || net->authenticated)
40 return 0; 40 return 0;
41 net->authenticating = 1;
41 42
42 /* Add the network if it's not already added */ 43 /* Add the network if it's not already added */
43 ieee80211softmac_add_network(mac, net); 44 ieee80211softmac_add_network(mac, net);
@@ -92,7 +93,6 @@ ieee80211softmac_auth_queue(void *data)
92 return; 93 return;
93 } 94 }
94 net->authenticated = 0; 95 net->authenticated = 0;
95 net->authenticating = 1;
96 /* add a timeout call so we eventually give up waiting for an auth reply */ 96 /* add a timeout call so we eventually give up waiting for an auth reply */
97 schedule_delayed_work(&auth->work, IEEE80211SOFTMAC_AUTH_TIMEOUT); 97 schedule_delayed_work(&auth->work, IEEE80211SOFTMAC_AUTH_TIMEOUT);
98 auth->retry--; 98 auth->retry--;
@@ -116,6 +116,16 @@ ieee80211softmac_auth_queue(void *data)
116 kfree(auth); 116 kfree(auth);
117} 117}
118 118
119/* Sends a response to an auth challenge (for shared key auth). */
120static void
121ieee80211softmac_auth_challenge_response(void *_aq)
122{
123 struct ieee80211softmac_auth_queue_item *aq = _aq;
124
125 /* Send our response */
126 ieee80211softmac_send_mgt_frame(aq->mac, aq->net, IEEE80211_STYPE_AUTH, aq->state);
127}
128
119/* Handle the auth response from the AP 129/* Handle the auth response from the AP
120 * This should be registered with ieee80211 as handle_auth 130 * This should be registered with ieee80211 as handle_auth
121 */ 131 */
@@ -197,24 +207,30 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth)
197 case IEEE80211SOFTMAC_AUTH_SHARED_CHALLENGE: 207 case IEEE80211SOFTMAC_AUTH_SHARED_CHALLENGE:
198 /* Check to make sure we have a challenge IE */ 208 /* Check to make sure we have a challenge IE */
199 data = (u8 *)auth->info_element; 209 data = (u8 *)auth->info_element;
200 if(*data++ != MFIE_TYPE_CHALLENGE){ 210 if (*data++ != MFIE_TYPE_CHALLENGE) {
201 printkl(KERN_NOTICE PFX "Shared Key Authentication failed due to a missing challenge.\n"); 211 printkl(KERN_NOTICE PFX "Shared Key Authentication failed due to a missing challenge.\n");
202 break; 212 break;
203 } 213 }
204 /* Save the challenge */ 214 /* Save the challenge */
205 spin_lock_irqsave(&mac->lock, flags); 215 spin_lock_irqsave(&mac->lock, flags);
206 net->challenge_len = *data++; 216 net->challenge_len = *data++;
207 if(net->challenge_len > WLAN_AUTH_CHALLENGE_LEN) 217 if (net->challenge_len > WLAN_AUTH_CHALLENGE_LEN)
208 net->challenge_len = WLAN_AUTH_CHALLENGE_LEN; 218 net->challenge_len = WLAN_AUTH_CHALLENGE_LEN;
209 if(net->challenge != NULL) 219 if (net->challenge != NULL)
210 kfree(net->challenge); 220 kfree(net->challenge);
211 net->challenge = kmalloc(net->challenge_len, GFP_ATOMIC); 221 net->challenge = kmalloc(net->challenge_len, GFP_ATOMIC);
212 memcpy(net->challenge, data, net->challenge_len); 222 memcpy(net->challenge, data, net->challenge_len);
213 aq->state = IEEE80211SOFTMAC_AUTH_SHARED_RESPONSE; 223 aq->state = IEEE80211SOFTMAC_AUTH_SHARED_RESPONSE;
214 spin_unlock_irqrestore(&mac->lock, flags);
215 224
216 /* Send our response */ 225 /* We reuse the work struct from the auth request here.
217 ieee80211softmac_send_mgt_frame(mac, aq->net, IEEE80211_STYPE_AUTH, aq->state); 226 * It is safe to do so as each one is per-request, and
227 * at this point (dealing with authentication response)
228 * we have obviously already sent the initial auth
229 * request. */
230 cancel_delayed_work(&aq->work);
231 INIT_WORK(&aq->work, &ieee80211softmac_auth_challenge_response, (void *)aq);
232 schedule_work(&aq->work);
233 spin_unlock_irqrestore(&mac->lock, flags);
218 return 0; 234 return 0;
219 case IEEE80211SOFTMAC_AUTH_SHARED_PASS: 235 case IEEE80211SOFTMAC_AUTH_SHARED_PASS:
220 kfree(net->challenge); 236 kfree(net->challenge);
diff --git a/net/ieee80211/softmac/ieee80211softmac_io.c b/net/ieee80211/softmac/ieee80211softmac_io.c
index 09541611e48c..6ae5a1dc7956 100644
--- a/net/ieee80211/softmac/ieee80211softmac_io.c
+++ b/net/ieee80211/softmac/ieee80211softmac_io.c
@@ -96,8 +96,7 @@ ieee80211softmac_alloc_mgt(u32 size)
96 if(size > IEEE80211_DATA_LEN) 96 if(size > IEEE80211_DATA_LEN)
97 return NULL; 97 return NULL;
98 /* Allocate the frame */ 98 /* Allocate the frame */
99 data = kmalloc(size, GFP_ATOMIC); 99 data = kzalloc(size, GFP_ATOMIC);
100 memset(data, 0, size);
101 return data; 100 return data;
102} 101}
103 102
@@ -229,6 +228,9 @@ ieee80211softmac_assoc_req(struct ieee80211_assoc_request **pkt,
229 return 0; 228 return 0;
230 ieee80211softmac_hdr_3addr(mac, &((*pkt)->header), IEEE80211_STYPE_ASSOC_REQ, net->bssid, net->bssid); 229 ieee80211softmac_hdr_3addr(mac, &((*pkt)->header), IEEE80211_STYPE_ASSOC_REQ, net->bssid, net->bssid);
231 230
231 /* Fill in the capabilities */
232 (*pkt)->capability = ieee80211softmac_capabilities(mac, net);
233
232 /* Fill in Listen Interval (?) */ 234 /* Fill in Listen Interval (?) */
233 (*pkt)->listen_interval = cpu_to_le16(10); 235 (*pkt)->listen_interval = cpu_to_le16(10);
234 236
diff --git a/net/ieee80211/softmac/ieee80211softmac_wx.c b/net/ieee80211/softmac/ieee80211softmac_wx.c
index 0e65ff4e33fc..75320b6842ab 100644
--- a/net/ieee80211/softmac/ieee80211softmac_wx.c
+++ b/net/ieee80211/softmac/ieee80211softmac_wx.c
@@ -70,12 +70,44 @@ ieee80211softmac_wx_set_essid(struct net_device *net_dev,
70 char *extra) 70 char *extra)
71{ 71{
72 struct ieee80211softmac_device *sm = ieee80211_priv(net_dev); 72 struct ieee80211softmac_device *sm = ieee80211_priv(net_dev);
73 struct ieee80211softmac_network *n;
74 struct ieee80211softmac_auth_queue_item *authptr;
73 int length = 0; 75 int length = 0;
74 unsigned long flags; 76 unsigned long flags;
75 77
78 /* Check if we're already associating to this or another network
79 * If it's another network, cancel and start over with our new network
80 * If it's our network, ignore the change, we're already doing it!
81 */
82 if((sm->associnfo.associating || sm->associated) &&
83 (data->essid.flags && data->essid.length && extra)) {
84 /* Get the associating network */
85 n = ieee80211softmac_get_network_by_bssid(sm, sm->associnfo.bssid);
86 if(n && n->essid.len == (data->essid.length - 1) &&
87 !memcmp(n->essid.data, extra, n->essid.len)) {
88 dprintk(KERN_INFO PFX "Already associating or associated to "MAC_FMT"\n",
89 MAC_ARG(sm->associnfo.bssid));
90 return 0;
91 } else {
92 dprintk(KERN_INFO PFX "Canceling existing associate request!\n");
93 spin_lock_irqsave(&sm->lock,flags);
94 /* Cancel assoc work */
95 cancel_delayed_work(&sm->associnfo.work);
96 /* We don't have to do this, but it's a little cleaner */
97 list_for_each_entry(authptr, &sm->auth_queue, list)
98 cancel_delayed_work(&authptr->work);
99 sm->associnfo.bssvalid = 0;
100 sm->associnfo.bssfixed = 0;
101 spin_unlock_irqrestore(&sm->lock,flags);
102 flush_scheduled_work();
103 }
104 }
105
106
76 spin_lock_irqsave(&sm->lock, flags); 107 spin_lock_irqsave(&sm->lock, flags);
77 108
78 sm->associnfo.static_essid = 0; 109 sm->associnfo.static_essid = 0;
110 sm->associnfo.assoc_wait = 0;
79 111
80 if (data->essid.flags && data->essid.length && extra /*required?*/) { 112 if (data->essid.flags && data->essid.length && extra /*required?*/) {
81 length = min(data->essid.length - 1, IW_ESSID_MAX_SIZE); 113 length = min(data->essid.length - 1, IW_ESSID_MAX_SIZE);
diff --git a/net/ipv4/Kconfig b/net/ipv4/Kconfig
index da33393be45f..8514106761b0 100644
--- a/net/ipv4/Kconfig
+++ b/net/ipv4/Kconfig
@@ -572,16 +572,6 @@ config TCP_CONG_VENO
572 loss packets. 572 loss packets.
573 See http://www.ntu.edu.sg/home5/ZHOU0022/papers/CPFu03a.pdf 573 See http://www.ntu.edu.sg/home5/ZHOU0022/papers/CPFu03a.pdf
574 574
575config TCP_CONG_COMPOUND
576 tristate "TCP Compound"
577 depends on EXPERIMENTAL
578 default n
579 ---help---
580 TCP Compound is a sender-side only change to TCP that uses
581 a mixed Reno/Vegas approach to calculate the cwnd.
582 For further details look here:
583 ftp://ftp.research.microsoft.com/pub/tr/TR-2005-86.pdf
584
585endmenu 575endmenu
586 576
587config TCP_CONG_BIC 577config TCP_CONG_BIC
diff --git a/net/ipv4/Makefile b/net/ipv4/Makefile
index 38b8039bdd55..4878fc5be85f 100644
--- a/net/ipv4/Makefile
+++ b/net/ipv4/Makefile
@@ -47,7 +47,6 @@ obj-$(CONFIG_TCP_CONG_VEGAS) += tcp_vegas.o
47obj-$(CONFIG_TCP_CONG_VENO) += tcp_veno.o 47obj-$(CONFIG_TCP_CONG_VENO) += tcp_veno.o
48obj-$(CONFIG_TCP_CONG_SCALABLE) += tcp_scalable.o 48obj-$(CONFIG_TCP_CONG_SCALABLE) += tcp_scalable.o
49obj-$(CONFIG_TCP_CONG_LP) += tcp_lp.o 49obj-$(CONFIG_TCP_CONG_LP) += tcp_lp.o
50obj-$(CONFIG_TCP_CONG_COMPOUND) += tcp_compound.o
51 50
52obj-$(CONFIG_XFRM) += xfrm4_policy.o xfrm4_state.o xfrm4_input.o \ 51obj-$(CONFIG_XFRM) += xfrm4_policy.o xfrm4_state.o xfrm4_input.o \
53 xfrm4_output.o 52 xfrm4_output.o
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index 318d4674faa1..c84a32070f8d 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -1097,6 +1097,40 @@ int inet_sk_rebuild_header(struct sock *sk)
1097 1097
1098EXPORT_SYMBOL(inet_sk_rebuild_header); 1098EXPORT_SYMBOL(inet_sk_rebuild_header);
1099 1099
1100static int inet_gso_send_check(struct sk_buff *skb)
1101{
1102 struct iphdr *iph;
1103 struct net_protocol *ops;
1104 int proto;
1105 int ihl;
1106 int err = -EINVAL;
1107
1108 if (unlikely(!pskb_may_pull(skb, sizeof(*iph))))
1109 goto out;
1110
1111 iph = skb->nh.iph;
1112 ihl = iph->ihl * 4;
1113 if (ihl < sizeof(*iph))
1114 goto out;
1115
1116 if (unlikely(!pskb_may_pull(skb, ihl)))
1117 goto out;
1118
1119 skb->h.raw = __skb_pull(skb, ihl);
1120 iph = skb->nh.iph;
1121 proto = iph->protocol & (MAX_INET_PROTOS - 1);
1122 err = -EPROTONOSUPPORT;
1123
1124 rcu_read_lock();
1125 ops = rcu_dereference(inet_protos[proto]);
1126 if (likely(ops && ops->gso_send_check))
1127 err = ops->gso_send_check(skb);
1128 rcu_read_unlock();
1129
1130out:
1131 return err;
1132}
1133
1100static struct sk_buff *inet_gso_segment(struct sk_buff *skb, int features) 1134static struct sk_buff *inet_gso_segment(struct sk_buff *skb, int features)
1101{ 1135{
1102 struct sk_buff *segs = ERR_PTR(-EINVAL); 1136 struct sk_buff *segs = ERR_PTR(-EINVAL);
@@ -1162,6 +1196,7 @@ static struct net_protocol igmp_protocol = {
1162static struct net_protocol tcp_protocol = { 1196static struct net_protocol tcp_protocol = {
1163 .handler = tcp_v4_rcv, 1197 .handler = tcp_v4_rcv,
1164 .err_handler = tcp_v4_err, 1198 .err_handler = tcp_v4_err,
1199 .gso_send_check = tcp_v4_gso_send_check,
1165 .gso_segment = tcp_tso_segment, 1200 .gso_segment = tcp_tso_segment,
1166 .no_policy = 1, 1201 .no_policy = 1,
1167}; 1202};
@@ -1208,6 +1243,7 @@ static int ipv4_proc_init(void);
1208static struct packet_type ip_packet_type = { 1243static struct packet_type ip_packet_type = {
1209 .type = __constant_htons(ETH_P_IP), 1244 .type = __constant_htons(ETH_P_IP),
1210 .func = ip_rcv, 1245 .func = ip_rcv,
1246 .gso_send_check = inet_gso_send_check,
1211 .gso_segment = inet_gso_segment, 1247 .gso_segment = inet_gso_segment,
1212}; 1248};
1213 1249
diff --git a/net/ipv4/ah4.c b/net/ipv4/ah4.c
index 8e748be36c5a..1366bc6ce6a5 100644
--- a/net/ipv4/ah4.c
+++ b/net/ipv4/ah4.c
@@ -215,12 +215,10 @@ static int ah_init_state(struct xfrm_state *x)
215 if (x->encap) 215 if (x->encap)
216 goto error; 216 goto error;
217 217
218 ahp = kmalloc(sizeof(*ahp), GFP_KERNEL); 218 ahp = kzalloc(sizeof(*ahp), GFP_KERNEL);
219 if (ahp == NULL) 219 if (ahp == NULL)
220 return -ENOMEM; 220 return -ENOMEM;
221 221
222 memset(ahp, 0, sizeof(*ahp));
223
224 ahp->key = x->aalg->alg_key; 222 ahp->key = x->aalg->alg_key;
225 ahp->key_len = (x->aalg->alg_key_len+7)/8; 223 ahp->key_len = (x->aalg->alg_key_len+7)/8;
226 ahp->tfm = crypto_alloc_tfm(x->aalg->alg_name, 0); 224 ahp->tfm = crypto_alloc_tfm(x->aalg->alg_name, 0);
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 7b51b3bdb548..c8a3723bc001 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -1372,12 +1372,11 @@ static int arp_seq_open(struct inode *inode, struct file *file)
1372{ 1372{
1373 struct seq_file *seq; 1373 struct seq_file *seq;
1374 int rc = -ENOMEM; 1374 int rc = -ENOMEM;
1375 struct neigh_seq_state *s = kmalloc(sizeof(*s), GFP_KERNEL); 1375 struct neigh_seq_state *s = kzalloc(sizeof(*s), GFP_KERNEL);
1376 1376
1377 if (!s) 1377 if (!s)
1378 goto out; 1378 goto out;
1379 1379
1380 memset(s, 0, sizeof(*s));
1381 rc = seq_open(file, &arp_seq_ops); 1380 rc = seq_open(file, &arp_seq_ops);
1382 if (rc) 1381 if (rc)
1383 goto out_kfree; 1382 goto out_kfree;
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index a7c65e9e5ec9..a6cc31d911eb 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -93,10 +93,9 @@ static void devinet_sysctl_unregister(struct ipv4_devconf *p);
93 93
94static struct in_ifaddr *inet_alloc_ifa(void) 94static struct in_ifaddr *inet_alloc_ifa(void)
95{ 95{
96 struct in_ifaddr *ifa = kmalloc(sizeof(*ifa), GFP_KERNEL); 96 struct in_ifaddr *ifa = kzalloc(sizeof(*ifa), GFP_KERNEL);
97 97
98 if (ifa) { 98 if (ifa) {
99 memset(ifa, 0, sizeof(*ifa));
100 INIT_RCU_HEAD(&ifa->rcu_head); 99 INIT_RCU_HEAD(&ifa->rcu_head);
101 } 100 }
102 101
@@ -140,10 +139,9 @@ struct in_device *inetdev_init(struct net_device *dev)
140 139
141 ASSERT_RTNL(); 140 ASSERT_RTNL();
142 141
143 in_dev = kmalloc(sizeof(*in_dev), GFP_KERNEL); 142 in_dev = kzalloc(sizeof(*in_dev), GFP_KERNEL);
144 if (!in_dev) 143 if (!in_dev)
145 goto out; 144 goto out;
146 memset(in_dev, 0, sizeof(*in_dev));
147 INIT_RCU_HEAD(&in_dev->rcu_head); 145 INIT_RCU_HEAD(&in_dev->rcu_head);
148 memcpy(&in_dev->cnf, &ipv4_devconf_dflt, sizeof(in_dev->cnf)); 146 memcpy(&in_dev->cnf, &ipv4_devconf_dflt, sizeof(in_dev->cnf));
149 in_dev->cnf.sysctl = NULL; 147 in_dev->cnf.sysctl = NULL;
diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c
index 4e112738b3fa..fc2f8ce441de 100644
--- a/net/ipv4/esp4.c
+++ b/net/ipv4/esp4.c
@@ -316,12 +316,10 @@ static int esp_init_state(struct xfrm_state *x)
316 if (x->ealg == NULL) 316 if (x->ealg == NULL)
317 goto error; 317 goto error;
318 318
319 esp = kmalloc(sizeof(*esp), GFP_KERNEL); 319 esp = kzalloc(sizeof(*esp), GFP_KERNEL);
320 if (esp == NULL) 320 if (esp == NULL)
321 return -ENOMEM; 321 return -ENOMEM;
322 322
323 memset(esp, 0, sizeof(*esp));
324
325 if (x->aalg) { 323 if (x->aalg) {
326 struct xfrm_algo_desc *aalg_desc; 324 struct xfrm_algo_desc *aalg_desc;
327 325
diff --git a/net/ipv4/fib_hash.c b/net/ipv4/fib_hash.c
index 3c1d32ad35f2..72c633b357cf 100644
--- a/net/ipv4/fib_hash.c
+++ b/net/ipv4/fib_hash.c
@@ -204,11 +204,10 @@ static struct fn_zone *
204fn_new_zone(struct fn_hash *table, int z) 204fn_new_zone(struct fn_hash *table, int z)
205{ 205{
206 int i; 206 int i;
207 struct fn_zone *fz = kmalloc(sizeof(struct fn_zone), GFP_KERNEL); 207 struct fn_zone *fz = kzalloc(sizeof(struct fn_zone), GFP_KERNEL);
208 if (!fz) 208 if (!fz)
209 return NULL; 209 return NULL;
210 210
211 memset(fz, 0, sizeof(struct fn_zone));
212 if (z) { 211 if (z) {
213 fz->fz_divisor = 16; 212 fz->fz_divisor = 16;
214 } else { 213 } else {
@@ -1046,7 +1045,7 @@ static int fib_seq_open(struct inode *inode, struct file *file)
1046{ 1045{
1047 struct seq_file *seq; 1046 struct seq_file *seq;
1048 int rc = -ENOMEM; 1047 int rc = -ENOMEM;
1049 struct fib_iter_state *s = kmalloc(sizeof(*s), GFP_KERNEL); 1048 struct fib_iter_state *s = kzalloc(sizeof(*s), GFP_KERNEL);
1050 1049
1051 if (!s) 1050 if (!s)
1052 goto out; 1051 goto out;
@@ -1057,7 +1056,6 @@ static int fib_seq_open(struct inode *inode, struct file *file)
1057 1056
1058 seq = file->private_data; 1057 seq = file->private_data;
1059 seq->private = s; 1058 seq->private = s;
1060 memset(s, 0, sizeof(*s));
1061out: 1059out:
1062 return rc; 1060 return rc;
1063out_kfree: 1061out_kfree:
diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c
index 6c642d11d4ca..79b04718bdfd 100644
--- a/net/ipv4/fib_rules.c
+++ b/net/ipv4/fib_rules.c
@@ -196,10 +196,9 @@ int inet_rtm_newrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
196 } 196 }
197 } 197 }
198 198
199 new_r = kmalloc(sizeof(*new_r), GFP_KERNEL); 199 new_r = kzalloc(sizeof(*new_r), GFP_KERNEL);
200 if (!new_r) 200 if (!new_r)
201 return -ENOMEM; 201 return -ENOMEM;
202 memset(new_r, 0, sizeof(*new_r));
203 202
204 if (rta[RTA_SRC-1]) 203 if (rta[RTA_SRC-1])
205 memcpy(&new_r->r_src, RTA_DATA(rta[RTA_SRC-1]), 4); 204 memcpy(&new_r->r_src, RTA_DATA(rta[RTA_SRC-1]), 4);
@@ -457,13 +456,13 @@ int inet_dump_rules(struct sk_buff *skb, struct netlink_callback *cb)
457 456
458 rcu_read_lock(); 457 rcu_read_lock();
459 hlist_for_each_entry(r, node, &fib_rules, hlist) { 458 hlist_for_each_entry(r, node, &fib_rules, hlist) {
460
461 if (idx < s_idx) 459 if (idx < s_idx)
462 continue; 460 goto next;
463 if (inet_fill_rule(skb, r, NETLINK_CB(cb->skb).pid, 461 if (inet_fill_rule(skb, r, NETLINK_CB(cb->skb).pid,
464 cb->nlh->nlmsg_seq, 462 cb->nlh->nlmsg_seq,
465 RTM_NEWRULE, NLM_F_MULTI) < 0) 463 RTM_NEWRULE, NLM_F_MULTI) < 0)
466 break; 464 break;
465next:
467 idx++; 466 idx++;
468 } 467 }
469 rcu_read_unlock(); 468 rcu_read_unlock();
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index 5f87533684d5..9be53a8e72c3 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -709,11 +709,10 @@ fib_create_info(const struct rtmsg *r, struct kern_rta *rta,
709 goto failure; 709 goto failure;
710 } 710 }
711 711
712 fi = kmalloc(sizeof(*fi)+nhs*sizeof(struct fib_nh), GFP_KERNEL); 712 fi = kzalloc(sizeof(*fi)+nhs*sizeof(struct fib_nh), GFP_KERNEL);
713 if (fi == NULL) 713 if (fi == NULL)
714 goto failure; 714 goto failure;
715 fib_info_cnt++; 715 fib_info_cnt++;
716 memset(fi, 0, sizeof(*fi)+nhs*sizeof(struct fib_nh));
717 716
718 fi->fib_protocol = r->rtm_protocol; 717 fi->fib_protocol = r->rtm_protocol;
719 718
@@ -962,10 +961,6 @@ fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event,
962 rtm->rtm_protocol = fi->fib_protocol; 961 rtm->rtm_protocol = fi->fib_protocol;
963 if (fi->fib_priority) 962 if (fi->fib_priority)
964 RTA_PUT(skb, RTA_PRIORITY, 4, &fi->fib_priority); 963 RTA_PUT(skb, RTA_PRIORITY, 4, &fi->fib_priority);
965#ifdef CONFIG_NET_CLS_ROUTE
966 if (fi->fib_nh[0].nh_tclassid)
967 RTA_PUT(skb, RTA_FLOW, 4, &fi->fib_nh[0].nh_tclassid);
968#endif
969 if (rtnetlink_put_metrics(skb, fi->fib_metrics) < 0) 964 if (rtnetlink_put_metrics(skb, fi->fib_metrics) < 0)
970 goto rtattr_failure; 965 goto rtattr_failure;
971 if (fi->fib_prefsrc) 966 if (fi->fib_prefsrc)
@@ -975,6 +970,10 @@ fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event,
975 RTA_PUT(skb, RTA_GATEWAY, 4, &fi->fib_nh->nh_gw); 970 RTA_PUT(skb, RTA_GATEWAY, 4, &fi->fib_nh->nh_gw);
976 if (fi->fib_nh->nh_oif) 971 if (fi->fib_nh->nh_oif)
977 RTA_PUT(skb, RTA_OIF, sizeof(int), &fi->fib_nh->nh_oif); 972 RTA_PUT(skb, RTA_OIF, sizeof(int), &fi->fib_nh->nh_oif);
973#ifdef CONFIG_NET_CLS_ROUTE
974 if (fi->fib_nh[0].nh_tclassid)
975 RTA_PUT(skb, RTA_FLOW, 4, &fi->fib_nh[0].nh_tclassid);
976#endif
978 } 977 }
979#ifdef CONFIG_IP_ROUTE_MULTIPATH 978#ifdef CONFIG_IP_ROUTE_MULTIPATH
980 if (fi->fib_nhs > 1) { 979 if (fi->fib_nhs > 1) {
@@ -993,6 +992,10 @@ fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event,
993 nhp->rtnh_ifindex = nh->nh_oif; 992 nhp->rtnh_ifindex = nh->nh_oif;
994 if (nh->nh_gw) 993 if (nh->nh_gw)
995 RTA_PUT(skb, RTA_GATEWAY, 4, &nh->nh_gw); 994 RTA_PUT(skb, RTA_GATEWAY, 4, &nh->nh_gw);
995#ifdef CONFIG_NET_CLS_ROUTE
996 if (nh->nh_tclassid)
997 RTA_PUT(skb, RTA_FLOW, 4, &nh->nh_tclassid);
998#endif
996 nhp->rtnh_len = skb->tail - (unsigned char*)nhp; 999 nhp->rtnh_len = skb->tail - (unsigned char*)nhp;
997 } endfor_nexthops(fi); 1000 } endfor_nexthops(fi);
998 mp_head->rta_type = RTA_MULTIPATH; 1001 mp_head->rta_type = RTA_MULTIPATH;
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index 1cb65305e102..23fb9d9768e3 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -1252,8 +1252,8 @@ fn_trie_insert(struct fib_table *tb, struct rtmsg *r, struct kern_rta *rta,
1252 */ 1252 */
1253 1253
1254 if (!fa_head) { 1254 if (!fa_head) {
1255 fa_head = fib_insert_node(t, &err, key, plen);
1256 err = 0; 1255 err = 0;
1256 fa_head = fib_insert_node(t, &err, key, plen);
1257 if (err) 1257 if (err)
1258 goto out_free_new_fa; 1258 goto out_free_new_fa;
1259 } 1259 }
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index d299c8e547d6..9f4b752f5a33 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -1028,10 +1028,9 @@ static void igmpv3_add_delrec(struct in_device *in_dev, struct ip_mc_list *im)
1028 * for deleted items allows change reports to use common code with 1028 * for deleted items allows change reports to use common code with
1029 * non-deleted or query-response MCA's. 1029 * non-deleted or query-response MCA's.
1030 */ 1030 */
1031 pmc = kmalloc(sizeof(*pmc), GFP_KERNEL); 1031 pmc = kzalloc(sizeof(*pmc), GFP_KERNEL);
1032 if (!pmc) 1032 if (!pmc)
1033 return; 1033 return;
1034 memset(pmc, 0, sizeof(*pmc));
1035 spin_lock_bh(&im->lock); 1034 spin_lock_bh(&im->lock);
1036 pmc->interface = im->interface; 1035 pmc->interface = im->interface;
1037 in_dev_hold(in_dev); 1036 in_dev_hold(in_dev);
@@ -1529,10 +1528,9 @@ static int ip_mc_add1_src(struct ip_mc_list *pmc, int sfmode,
1529 psf_prev = psf; 1528 psf_prev = psf;
1530 } 1529 }
1531 if (!psf) { 1530 if (!psf) {
1532 psf = kmalloc(sizeof(*psf), GFP_ATOMIC); 1531 psf = kzalloc(sizeof(*psf), GFP_ATOMIC);
1533 if (!psf) 1532 if (!psf)
1534 return -ENOBUFS; 1533 return -ENOBUFS;
1535 memset(psf, 0, sizeof(*psf));
1536 psf->sf_inaddr = *psfsrc; 1534 psf->sf_inaddr = *psfsrc;
1537 if (psf_prev) { 1535 if (psf_prev) {
1538 psf_prev->sf_next = psf; 1536 psf_prev->sf_next = psf;
@@ -2380,7 +2378,7 @@ static int igmp_mc_seq_open(struct inode *inode, struct file *file)
2380{ 2378{
2381 struct seq_file *seq; 2379 struct seq_file *seq;
2382 int rc = -ENOMEM; 2380 int rc = -ENOMEM;
2383 struct igmp_mc_iter_state *s = kmalloc(sizeof(*s), GFP_KERNEL); 2381 struct igmp_mc_iter_state *s = kzalloc(sizeof(*s), GFP_KERNEL);
2384 2382
2385 if (!s) 2383 if (!s)
2386 goto out; 2384 goto out;
@@ -2390,7 +2388,6 @@ static int igmp_mc_seq_open(struct inode *inode, struct file *file)
2390 2388
2391 seq = file->private_data; 2389 seq = file->private_data;
2392 seq->private = s; 2390 seq->private = s;
2393 memset(s, 0, sizeof(*s));
2394out: 2391out:
2395 return rc; 2392 return rc;
2396out_kfree: 2393out_kfree:
@@ -2555,7 +2552,7 @@ static int igmp_mcf_seq_open(struct inode *inode, struct file *file)
2555{ 2552{
2556 struct seq_file *seq; 2553 struct seq_file *seq;
2557 int rc = -ENOMEM; 2554 int rc = -ENOMEM;
2558 struct igmp_mcf_iter_state *s = kmalloc(sizeof(*s), GFP_KERNEL); 2555 struct igmp_mcf_iter_state *s = kzalloc(sizeof(*s), GFP_KERNEL);
2559 2556
2560 if (!s) 2557 if (!s)
2561 goto out; 2558 goto out;
@@ -2565,7 +2562,6 @@ static int igmp_mcf_seq_open(struct inode *inode, struct file *file)
2565 2562
2566 seq = file->private_data; 2563 seq = file->private_data;
2567 seq->private = s; 2564 seq->private = s;
2568 memset(s, 0, sizeof(*s));
2569out: 2565out:
2570 return rc; 2566 return rc;
2571out_kfree: 2567out_kfree:
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
index 8e7e41b66c79..492858e6faf0 100644
--- a/net/ipv4/inet_diag.c
+++ b/net/ipv4/inet_diag.c
@@ -909,11 +909,10 @@ static int __init inet_diag_init(void)
909 sizeof(struct inet_diag_handler *)); 909 sizeof(struct inet_diag_handler *));
910 int err = -ENOMEM; 910 int err = -ENOMEM;
911 911
912 inet_diag_table = kmalloc(inet_diag_table_size, GFP_KERNEL); 912 inet_diag_table = kzalloc(inet_diag_table_size, GFP_KERNEL);
913 if (!inet_diag_table) 913 if (!inet_diag_table)
914 goto out; 914 goto out;
915 915
916 memset(inet_diag_table, 0, inet_diag_table_size);
917 idiagnl = netlink_kernel_create(NETLINK_INET_DIAG, 0, inet_diag_rcv, 916 idiagnl = netlink_kernel_create(NETLINK_INET_DIAG, 0, inet_diag_rcv,
918 THIS_MODULE); 917 THIS_MODULE);
919 if (idiagnl == NULL) 918 if (idiagnl == NULL)
diff --git a/net/ipv4/inetpeer.c b/net/ipv4/inetpeer.c
index 2160874ce7aa..03ff62ebcfeb 100644
--- a/net/ipv4/inetpeer.c
+++ b/net/ipv4/inetpeer.c
@@ -86,7 +86,7 @@ static struct inet_peer *peer_root = peer_avl_empty;
86static DEFINE_RWLOCK(peer_pool_lock); 86static DEFINE_RWLOCK(peer_pool_lock);
87#define PEER_MAXDEPTH 40 /* sufficient for about 2^27 nodes */ 87#define PEER_MAXDEPTH 40 /* sufficient for about 2^27 nodes */
88 88
89static volatile int peer_total; 89static int peer_total;
90/* Exported for sysctl_net_ipv4. */ 90/* Exported for sysctl_net_ipv4. */
91int inet_peer_threshold = 65536 + 128; /* start to throw entries more 91int inet_peer_threshold = 65536 + 128; /* start to throw entries more
92 * aggressively at this stage */ 92 * aggressively at this stage */
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 6ff9b10d9563..0f9b3a31997b 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -617,7 +617,6 @@ static int ipgre_rcv(struct sk_buff *skb)
617 skb->mac.raw = skb->nh.raw; 617 skb->mac.raw = skb->nh.raw;
618 skb->nh.raw = __pskb_pull(skb, offset); 618 skb->nh.raw = __pskb_pull(skb, offset);
619 skb_postpull_rcsum(skb, skb->h.raw, offset); 619 skb_postpull_rcsum(skb, skb->h.raw, offset);
620 memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options));
621 skb->pkt_type = PACKET_HOST; 620 skb->pkt_type = PACKET_HOST;
622#ifdef CONFIG_NET_IPGRE_BROADCAST 621#ifdef CONFIG_NET_IPGRE_BROADCAST
623 if (MULTICAST(iph->daddr)) { 622 if (MULTICAST(iph->daddr)) {
diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c
index e1a7dba2fa8a..212734ca238f 100644
--- a/net/ipv4/ip_input.c
+++ b/net/ipv4/ip_input.c
@@ -428,6 +428,9 @@ int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt,
428 goto drop; 428 goto drop;
429 } 429 }
430 430
431 /* Remove any debris in the socket control block */
432 memset(IPCB(skb), 0, sizeof(struct inet_skb_parm));
433
431 return NF_HOOK(PF_INET, NF_IP_PRE_ROUTING, skb, dev, NULL, 434 return NF_HOOK(PF_INET, NF_IP_PRE_ROUTING, skb, dev, NULL,
432 ip_rcv_finish); 435 ip_rcv_finish);
433 436
diff --git a/net/ipv4/ip_options.c b/net/ipv4/ip_options.c
index cbcae6544622..406056edc02b 100644
--- a/net/ipv4/ip_options.c
+++ b/net/ipv4/ip_options.c
@@ -256,7 +256,6 @@ int ip_options_compile(struct ip_options * opt, struct sk_buff * skb)
256 256
257 if (!opt) { 257 if (!opt) {
258 opt = &(IPCB(skb)->opt); 258 opt = &(IPCB(skb)->opt);
259 memset(opt, 0, sizeof(struct ip_options));
260 iph = skb->nh.raw; 259 iph = skb->nh.raw;
261 opt->optlen = ((struct iphdr *)iph)->ihl*4 - sizeof(struct iphdr); 260 opt->optlen = ((struct iphdr *)iph)->ihl*4 - sizeof(struct iphdr);
262 optptr = iph + sizeof(struct iphdr); 261 optptr = iph + sizeof(struct iphdr);
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index ca0e714613fb..9bf307a29783 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -209,7 +209,7 @@ static inline int ip_finish_output(struct sk_buff *skb)
209 return dst_output(skb); 209 return dst_output(skb);
210 } 210 }
211#endif 211#endif
212 if (skb->len > dst_mtu(skb->dst) && !skb_shinfo(skb)->gso_size) 212 if (skb->len > dst_mtu(skb->dst) && !skb_is_gso(skb))
213 return ip_fragment(skb, ip_finish_output2); 213 return ip_fragment(skb, ip_finish_output2);
214 else 214 else
215 return ip_finish_output2(skb); 215 return ip_finish_output2(skb);
@@ -526,6 +526,8 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
526 526
527 err = output(skb); 527 err = output(skb);
528 528
529 if (!err)
530 IP_INC_STATS(IPSTATS_MIB_FRAGCREATES);
529 if (err || !frag) 531 if (err || !frag)
530 break; 532 break;
531 533
@@ -649,9 +651,6 @@ slow_path:
649 /* 651 /*
650 * Put this fragment into the sending queue. 652 * Put this fragment into the sending queue.
651 */ 653 */
652
653 IP_INC_STATS(IPSTATS_MIB_FRAGCREATES);
654
655 iph->tot_len = htons(len + hlen); 654 iph->tot_len = htons(len + hlen);
656 655
657 ip_send_check(iph); 656 ip_send_check(iph);
@@ -659,6 +658,8 @@ slow_path:
659 err = output(skb2); 658 err = output(skb2);
660 if (err) 659 if (err)
661 goto fail; 660 goto fail;
661
662 IP_INC_STATS(IPSTATS_MIB_FRAGCREATES);
662 } 663 }
663 kfree_skb(skb); 664 kfree_skb(skb);
664 IP_INC_STATS(IPSTATS_MIB_FRAGOKS); 665 IP_INC_STATS(IPSTATS_MIB_FRAGOKS);
@@ -1095,7 +1096,7 @@ ssize_t ip_append_page(struct sock *sk, struct page *page,
1095 while (size > 0) { 1096 while (size > 0) {
1096 int i; 1097 int i;
1097 1098
1098 if (skb_shinfo(skb)->gso_size) 1099 if (skb_is_gso(skb))
1099 len = size; 1100 len = size;
1100 else { 1101 else {
1101 1102
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
index 84f43a3c9098..2d05c4133d3e 100644
--- a/net/ipv4/ip_sockglue.c
+++ b/net/ipv4/ip_sockglue.c
@@ -112,14 +112,19 @@ static void ip_cmsg_recv_retopts(struct msghdr *msg, struct sk_buff *skb)
112static void ip_cmsg_recv_security(struct msghdr *msg, struct sk_buff *skb) 112static void ip_cmsg_recv_security(struct msghdr *msg, struct sk_buff *skb)
113{ 113{
114 char *secdata; 114 char *secdata;
115 u32 seclen; 115 u32 seclen, secid;
116 int err; 116 int err;
117 117
118 err = security_socket_getpeersec_dgram(skb, &secdata, &seclen); 118 err = security_socket_getpeersec_dgram(NULL, skb, &secid);
119 if (err)
120 return;
121
122 err = security_secid_to_secctx(secid, &secdata, &seclen);
119 if (err) 123 if (err)
120 return; 124 return;
121 125
122 put_cmsg(msg, SOL_IP, SCM_SECURITY, seclen, secdata); 126 put_cmsg(msg, SOL_IP, SCM_SECURITY, seclen, secdata);
127 security_release_secctx(secdata, seclen);
123} 128}
124 129
125 130
diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c
index 8e0374847532..a0c28b2b756e 100644
--- a/net/ipv4/ipcomp.c
+++ b/net/ipv4/ipcomp.c
@@ -70,7 +70,8 @@ static int ipcomp_decompress(struct xfrm_state *x, struct sk_buff *skb)
70 if (err) 70 if (err)
71 goto out; 71 goto out;
72 72
73 skb_put(skb, dlen - plen); 73 skb->truesize += dlen - plen;
74 __skb_put(skb, dlen - plen);
74 memcpy(skb->data, scratch, dlen); 75 memcpy(skb->data, scratch, dlen);
75out: 76out:
76 put_cpu(); 77 put_cpu();
@@ -409,11 +410,10 @@ static int ipcomp_init_state(struct xfrm_state *x)
409 goto out; 410 goto out;
410 411
411 err = -ENOMEM; 412 err = -ENOMEM;
412 ipcd = kmalloc(sizeof(*ipcd), GFP_KERNEL); 413 ipcd = kzalloc(sizeof(*ipcd), GFP_KERNEL);
413 if (!ipcd) 414 if (!ipcd)
414 goto out; 415 goto out;
415 416
416 memset(ipcd, 0, sizeof(*ipcd));
417 x->props.header_len = 0; 417 x->props.header_len = 0;
418 if (x->props.mode) 418 if (x->props.mode)
419 x->props.header_len += sizeof(struct iphdr); 419 x->props.header_len += sizeof(struct iphdr);
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index 3291d5192aad..76ab50b0d6ef 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -487,7 +487,6 @@ static int ipip_rcv(struct sk_buff *skb)
487 487
488 skb->mac.raw = skb->nh.raw; 488 skb->mac.raw = skb->nh.raw;
489 skb->nh.raw = skb->data; 489 skb->nh.raw = skb->data;
490 memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options));
491 skb->protocol = htons(ETH_P_IP); 490 skb->protocol = htons(ETH_P_IP);
492 skb->pkt_type = PACKET_HOST; 491 skb->pkt_type = PACKET_HOST;
493 492
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index ba33f8621c67..85893eef6b16 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -1461,7 +1461,6 @@ int pim_rcv_v1(struct sk_buff * skb)
1461 skb_pull(skb, (u8*)encap - skb->data); 1461 skb_pull(skb, (u8*)encap - skb->data);
1462 skb->nh.iph = (struct iphdr *)skb->data; 1462 skb->nh.iph = (struct iphdr *)skb->data;
1463 skb->dev = reg_dev; 1463 skb->dev = reg_dev;
1464 memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options));
1465 skb->protocol = htons(ETH_P_IP); 1464 skb->protocol = htons(ETH_P_IP);
1466 skb->ip_summed = 0; 1465 skb->ip_summed = 0;
1467 skb->pkt_type = PACKET_HOST; 1466 skb->pkt_type = PACKET_HOST;
@@ -1517,7 +1516,6 @@ static int pim_rcv(struct sk_buff * skb)
1517 skb_pull(skb, (u8*)encap - skb->data); 1516 skb_pull(skb, (u8*)encap - skb->data);
1518 skb->nh.iph = (struct iphdr *)skb->data; 1517 skb->nh.iph = (struct iphdr *)skb->data;
1519 skb->dev = reg_dev; 1518 skb->dev = reg_dev;
1520 memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options));
1521 skb->protocol = htons(ETH_P_IP); 1519 skb->protocol = htons(ETH_P_IP);
1522 skb->ip_summed = 0; 1520 skb->ip_summed = 0;
1523 skb->pkt_type = PACKET_HOST; 1521 skb->pkt_type = PACKET_HOST;
@@ -1580,6 +1578,7 @@ int ipmr_get_route(struct sk_buff *skb, struct rtmsg *rtm, int nowait)
1580 cache = ipmr_cache_find(rt->rt_src, rt->rt_dst); 1578 cache = ipmr_cache_find(rt->rt_src, rt->rt_dst);
1581 1579
1582 if (cache==NULL) { 1580 if (cache==NULL) {
1581 struct sk_buff *skb2;
1583 struct net_device *dev; 1582 struct net_device *dev;
1584 int vif; 1583 int vif;
1585 1584
@@ -1593,12 +1592,18 @@ int ipmr_get_route(struct sk_buff *skb, struct rtmsg *rtm, int nowait)
1593 read_unlock(&mrt_lock); 1592 read_unlock(&mrt_lock);
1594 return -ENODEV; 1593 return -ENODEV;
1595 } 1594 }
1596 skb->nh.raw = skb_push(skb, sizeof(struct iphdr)); 1595 skb2 = skb_clone(skb, GFP_ATOMIC);
1597 skb->nh.iph->ihl = sizeof(struct iphdr)>>2; 1596 if (!skb2) {
1598 skb->nh.iph->saddr = rt->rt_src; 1597 read_unlock(&mrt_lock);
1599 skb->nh.iph->daddr = rt->rt_dst; 1598 return -ENOMEM;
1600 skb->nh.iph->version = 0; 1599 }
1601 err = ipmr_cache_unresolved(vif, skb); 1600
1601 skb2->nh.raw = skb_push(skb2, sizeof(struct iphdr));
1602 skb2->nh.iph->ihl = sizeof(struct iphdr)>>2;
1603 skb2->nh.iph->saddr = rt->rt_src;
1604 skb2->nh.iph->daddr = rt->rt_dst;
1605 skb2->nh.iph->version = 0;
1606 err = ipmr_cache_unresolved(vif, skb2);
1602 read_unlock(&mrt_lock); 1607 read_unlock(&mrt_lock);
1603 return err; 1608 return err;
1604 } 1609 }
diff --git a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c
index f28ec6882162..6a28fafe910c 100644
--- a/net/ipv4/ipvs/ip_vs_ctl.c
+++ b/net/ipv4/ipvs/ip_vs_ctl.c
@@ -735,12 +735,11 @@ ip_vs_new_dest(struct ip_vs_service *svc, struct ip_vs_dest_user *udest,
735 if (atype != RTN_LOCAL && atype != RTN_UNICAST) 735 if (atype != RTN_LOCAL && atype != RTN_UNICAST)
736 return -EINVAL; 736 return -EINVAL;
737 737
738 dest = kmalloc(sizeof(struct ip_vs_dest), GFP_ATOMIC); 738 dest = kzalloc(sizeof(struct ip_vs_dest), GFP_ATOMIC);
739 if (dest == NULL) { 739 if (dest == NULL) {
740 IP_VS_ERR("ip_vs_new_dest: kmalloc failed.\n"); 740 IP_VS_ERR("ip_vs_new_dest: kmalloc failed.\n");
741 return -ENOMEM; 741 return -ENOMEM;
742 } 742 }
743 memset(dest, 0, sizeof(struct ip_vs_dest));
744 743
745 dest->protocol = svc->protocol; 744 dest->protocol = svc->protocol;
746 dest->vaddr = svc->addr; 745 dest->vaddr = svc->addr;
@@ -1050,14 +1049,12 @@ ip_vs_add_service(struct ip_vs_service_user *u, struct ip_vs_service **svc_p)
1050 goto out_mod_dec; 1049 goto out_mod_dec;
1051 } 1050 }
1052 1051
1053 svc = (struct ip_vs_service *) 1052 svc = kzalloc(sizeof(struct ip_vs_service), GFP_ATOMIC);
1054 kmalloc(sizeof(struct ip_vs_service), GFP_ATOMIC);
1055 if (svc == NULL) { 1053 if (svc == NULL) {
1056 IP_VS_DBG(1, "ip_vs_add_service: kmalloc failed.\n"); 1054 IP_VS_DBG(1, "ip_vs_add_service: kmalloc failed.\n");
1057 ret = -ENOMEM; 1055 ret = -ENOMEM;
1058 goto out_err; 1056 goto out_err;
1059 } 1057 }
1060 memset(svc, 0, sizeof(struct ip_vs_service));
1061 1058
1062 /* I'm the first user of the service */ 1059 /* I'm the first user of the service */
1063 atomic_set(&svc->usecnt, 1); 1060 atomic_set(&svc->usecnt, 1);
@@ -1797,7 +1794,7 @@ static int ip_vs_info_open(struct inode *inode, struct file *file)
1797{ 1794{
1798 struct seq_file *seq; 1795 struct seq_file *seq;
1799 int rc = -ENOMEM; 1796 int rc = -ENOMEM;
1800 struct ip_vs_iter *s = kmalloc(sizeof(*s), GFP_KERNEL); 1797 struct ip_vs_iter *s = kzalloc(sizeof(*s), GFP_KERNEL);
1801 1798
1802 if (!s) 1799 if (!s)
1803 goto out; 1800 goto out;
@@ -1808,7 +1805,6 @@ static int ip_vs_info_open(struct inode *inode, struct file *file)
1808 1805
1809 seq = file->private_data; 1806 seq = file->private_data;
1810 seq->private = s; 1807 seq->private = s;
1811 memset(s, 0, sizeof(*s));
1812out: 1808out:
1813 return rc; 1809 return rc;
1814out_kfree: 1810out_kfree:
diff --git a/net/ipv4/ipvs/ip_vs_est.c b/net/ipv4/ipvs/ip_vs_est.c
index 4c1940381ba0..7d68b80c4c19 100644
--- a/net/ipv4/ipvs/ip_vs_est.c
+++ b/net/ipv4/ipvs/ip_vs_est.c
@@ -123,11 +123,10 @@ int ip_vs_new_estimator(struct ip_vs_stats *stats)
123{ 123{
124 struct ip_vs_estimator *est; 124 struct ip_vs_estimator *est;
125 125
126 est = kmalloc(sizeof(*est), GFP_KERNEL); 126 est = kzalloc(sizeof(*est), GFP_KERNEL);
127 if (est == NULL) 127 if (est == NULL)
128 return -ENOMEM; 128 return -ENOMEM;
129 129
130 memset(est, 0, sizeof(*est));
131 est->stats = stats; 130 est->stats = stats;
132 est->last_conns = stats->conns; 131 est->last_conns = stats->conns;
133 est->cps = stats->cps<<10; 132 est->cps = stats->cps<<10;
diff --git a/net/ipv4/netfilter/ip_conntrack_helper_h323.c b/net/ipv4/netfilter/ip_conntrack_helper_h323.c
index af35235672d5..9a39e2969712 100644
--- a/net/ipv4/netfilter/ip_conntrack_helper_h323.c
+++ b/net/ipv4/netfilter/ip_conntrack_helper_h323.c
@@ -1200,7 +1200,7 @@ static struct ip_conntrack_expect *find_expect(struct ip_conntrack *ct,
1200 tuple.dst.protonum = IPPROTO_TCP; 1200 tuple.dst.protonum = IPPROTO_TCP;
1201 1201
1202 exp = __ip_conntrack_expect_find(&tuple); 1202 exp = __ip_conntrack_expect_find(&tuple);
1203 if (exp->master == ct) 1203 if (exp && exp->master == ct)
1204 return exp; 1204 return exp;
1205 return NULL; 1205 return NULL;
1206} 1206}
diff --git a/net/ipv4/netfilter/ip_conntrack_sip.c b/net/ipv4/netfilter/ip_conntrack_sip.c
index fc87ce0da40d..4f222d6be009 100644
--- a/net/ipv4/netfilter/ip_conntrack_sip.c
+++ b/net/ipv4/netfilter/ip_conntrack_sip.c
@@ -442,7 +442,7 @@ static int __init init(void)
442 sip[i].tuple.src.u.udp.port = htons(ports[i]); 442 sip[i].tuple.src.u.udp.port = htons(ports[i]);
443 sip[i].mask.src.u.udp.port = 0xFFFF; 443 sip[i].mask.src.u.udp.port = 0xFFFF;
444 sip[i].mask.dst.protonum = 0xFF; 444 sip[i].mask.dst.protonum = 0xFF;
445 sip[i].max_expected = 1; 445 sip[i].max_expected = 2;
446 sip[i].timeout = 3 * 60; /* 3 minutes */ 446 sip[i].timeout = 3 * 60; /* 3 minutes */
447 sip[i].me = THIS_MODULE; 447 sip[i].me = THIS_MODULE;
448 sip[i].help = sip_help; 448 sip[i].help = sip_help;
diff --git a/net/ipv4/netfilter/ip_conntrack_standalone.c b/net/ipv4/netfilter/ip_conntrack_standalone.c
index 7bd3c22003a2..7a9fa04a467a 100644
--- a/net/ipv4/netfilter/ip_conntrack_standalone.c
+++ b/net/ipv4/netfilter/ip_conntrack_standalone.c
@@ -534,6 +534,8 @@ static struct nf_hook_ops ip_conntrack_ops[] = {
534 534
535/* Sysctl support */ 535/* Sysctl support */
536 536
537int ip_conntrack_checksum = 1;
538
537#ifdef CONFIG_SYSCTL 539#ifdef CONFIG_SYSCTL
538 540
539/* From ip_conntrack_core.c */ 541/* From ip_conntrack_core.c */
@@ -568,8 +570,6 @@ extern unsigned int ip_ct_generic_timeout;
568static int log_invalid_proto_min = 0; 570static int log_invalid_proto_min = 0;
569static int log_invalid_proto_max = 255; 571static int log_invalid_proto_max = 255;
570 572
571int ip_conntrack_checksum = 1;
572
573static struct ctl_table_header *ip_ct_sysctl_header; 573static struct ctl_table_header *ip_ct_sysctl_header;
574 574
575static ctl_table ip_ct_sysctl_table[] = { 575static ctl_table ip_ct_sysctl_table[] = {
diff --git a/net/ipv4/netfilter/ip_nat_snmp_basic.c b/net/ipv4/netfilter/ip_nat_snmp_basic.c
index 0b1b416759cc..18b7fbdccb61 100644
--- a/net/ipv4/netfilter/ip_nat_snmp_basic.c
+++ b/net/ipv4/netfilter/ip_nat_snmp_basic.c
@@ -1255,9 +1255,9 @@ static int help(struct sk_buff **pskb,
1255 struct udphdr *udph = (struct udphdr *)((u_int32_t *)iph + iph->ihl); 1255 struct udphdr *udph = (struct udphdr *)((u_int32_t *)iph + iph->ihl);
1256 1256
1257 /* SNMP replies and originating SNMP traps get mangled */ 1257 /* SNMP replies and originating SNMP traps get mangled */
1258 if (udph->source == ntohs(SNMP_PORT) && dir != IP_CT_DIR_REPLY) 1258 if (udph->source == htons(SNMP_PORT) && dir != IP_CT_DIR_REPLY)
1259 return NF_ACCEPT; 1259 return NF_ACCEPT;
1260 if (udph->dest == ntohs(SNMP_TRAP_PORT) && dir != IP_CT_DIR_ORIGINAL) 1260 if (udph->dest == htons(SNMP_TRAP_PORT) && dir != IP_CT_DIR_ORIGINAL)
1261 return NF_ACCEPT; 1261 return NF_ACCEPT;
1262 1262
1263 /* No NAT? */ 1263 /* No NAT? */
diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c
index cbffeae3f565..d994c5f5744c 100644
--- a/net/ipv4/netfilter/ipt_CLUSTERIP.c
+++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c
@@ -172,11 +172,10 @@ clusterip_config_init(struct ipt_clusterip_tgt_info *i, u_int32_t ip,
172 struct clusterip_config *c; 172 struct clusterip_config *c;
173 char buffer[16]; 173 char buffer[16];
174 174
175 c = kmalloc(sizeof(*c), GFP_ATOMIC); 175 c = kzalloc(sizeof(*c), GFP_ATOMIC);
176 if (!c) 176 if (!c)
177 return NULL; 177 return NULL;
178 178
179 memset(c, 0, sizeof(*c));
180 c->dev = dev; 179 c->dev = dev;
181 c->clusterip = ip; 180 c->clusterip = ip;
182 memcpy(&c->clustermac, &i->clustermac, ETH_ALEN); 181 memcpy(&c->clustermac, &i->clustermac, ETH_ALEN);
diff --git a/net/ipv4/netfilter/ipt_hashlimit.c b/net/ipv4/netfilter/ipt_hashlimit.c
index 92980ab8ce48..6b662449e825 100644
--- a/net/ipv4/netfilter/ipt_hashlimit.c
+++ b/net/ipv4/netfilter/ipt_hashlimit.c
@@ -508,6 +508,9 @@ hashlimit_checkentry(const char *tablename,
508 if (!r->cfg.expire) 508 if (!r->cfg.expire)
509 return 0; 509 return 0;
510 510
511 if (r->name[sizeof(r->name) - 1] != '\0')
512 return 0;
513
511 /* This is the best we've got: We cannot release and re-grab lock, 514 /* This is the best we've got: We cannot release and re-grab lock,
512 * since checkentry() is called before ip_tables.c grabs ipt_mutex. 515 * since checkentry() is called before ip_tables.c grabs ipt_mutex.
513 * We also cannot grab the hashtable spinlock, since htable_create will 516 * We also cannot grab the hashtable spinlock, since htable_create will
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index bd221ec3f81e..62b2762a2420 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -609,6 +609,7 @@ static int raw_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
609 if (sin) { 609 if (sin) {
610 sin->sin_family = AF_INET; 610 sin->sin_family = AF_INET;
611 sin->sin_addr.s_addr = skb->nh.iph->saddr; 611 sin->sin_addr.s_addr = skb->nh.iph->saddr;
612 sin->sin_port = 0;
612 memset(&sin->sin_zero, 0, sizeof(sin->sin_zero)); 613 memset(&sin->sin_zero, 0, sizeof(sin->sin_zero));
613 } 614 }
614 if (inet->cmsg_flags) 615 if (inet->cmsg_flags)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 2dc6dbb28467..19bd49d69d9f 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -104,6 +104,7 @@
104#include <net/icmp.h> 104#include <net/icmp.h>
105#include <net/xfrm.h> 105#include <net/xfrm.h>
106#include <net/ip_mp_alg.h> 106#include <net/ip_mp_alg.h>
107#include <net/netevent.h>
107#ifdef CONFIG_SYSCTL 108#ifdef CONFIG_SYSCTL
108#include <linux/sysctl.h> 109#include <linux/sysctl.h>
109#endif 110#endif
@@ -1125,6 +1126,7 @@ void ip_rt_redirect(u32 old_gw, u32 daddr, u32 new_gw,
1125 struct rtable *rth, **rthp; 1126 struct rtable *rth, **rthp;
1126 u32 skeys[2] = { saddr, 0 }; 1127 u32 skeys[2] = { saddr, 0 };
1127 int ikeys[2] = { dev->ifindex, 0 }; 1128 int ikeys[2] = { dev->ifindex, 0 };
1129 struct netevent_redirect netevent;
1128 1130
1129 if (!in_dev) 1131 if (!in_dev)
1130 return; 1132 return;
@@ -1216,6 +1218,11 @@ void ip_rt_redirect(u32 old_gw, u32 daddr, u32 new_gw,
1216 rt_drop(rt); 1218 rt_drop(rt);
1217 goto do_next; 1219 goto do_next;
1218 } 1220 }
1221
1222 netevent.old = &rth->u.dst;
1223 netevent.new = &rt->u.dst;
1224 call_netevent_notifiers(NETEVENT_REDIRECT,
1225 &netevent);
1219 1226
1220 rt_del(hash, rth); 1227 rt_del(hash, rth);
1221 if (!rt_intern_hash(hash, rt, &rt)) 1228 if (!rt_intern_hash(hash, rt, &rt))
@@ -1452,6 +1459,7 @@ static void ip_rt_update_pmtu(struct dst_entry *dst, u32 mtu)
1452 } 1459 }
1453 dst->metrics[RTAX_MTU-1] = mtu; 1460 dst->metrics[RTAX_MTU-1] = mtu;
1454 dst_set_expires(dst, ip_rt_mtu_expires); 1461 dst_set_expires(dst, ip_rt_mtu_expires);
1462 call_netevent_notifiers(NETEVENT_PMTU_UPDATE, dst);
1455 } 1463 }
1456} 1464}
1457 1465
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index f6a2d9223d07..934396bb1376 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1132,7 +1132,7 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
1132 tp->ucopy.dma_chan = NULL; 1132 tp->ucopy.dma_chan = NULL;
1133 preempt_disable(); 1133 preempt_disable();
1134 if ((len > sysctl_tcp_dma_copybreak) && !(flags & MSG_PEEK) && 1134 if ((len > sysctl_tcp_dma_copybreak) && !(flags & MSG_PEEK) &&
1135 !sysctl_tcp_low_latency && __get_cpu_var(softnet_data.net_dma)) { 1135 !sysctl_tcp_low_latency && __get_cpu_var(softnet_data).net_dma) {
1136 preempt_enable_no_resched(); 1136 preempt_enable_no_resched();
1137 tp->ucopy.pinned_list = dma_pin_iovec_pages(msg->msg_iov, len); 1137 tp->ucopy.pinned_list = dma_pin_iovec_pages(msg->msg_iov, len);
1138 } else 1138 } else
@@ -1659,7 +1659,8 @@ adjudge_to_death:
1659 const int tmo = tcp_fin_time(sk); 1659 const int tmo = tcp_fin_time(sk);
1660 1660
1661 if (tmo > TCP_TIMEWAIT_LEN) { 1661 if (tmo > TCP_TIMEWAIT_LEN) {
1662 inet_csk_reset_keepalive_timer(sk, tcp_fin_time(sk)); 1662 inet_csk_reset_keepalive_timer(sk,
1663 tmo - TCP_TIMEWAIT_LEN);
1663 } else { 1664 } else {
1664 tcp_time_wait(sk, TCP_FIN_WAIT2, tmo); 1665 tcp_time_wait(sk, TCP_FIN_WAIT2, tmo);
1665 goto out; 1666 goto out;
diff --git a/net/ipv4/tcp_compound.c b/net/ipv4/tcp_compound.c
deleted file mode 100644
index bc54f7e9aea9..000000000000
--- a/net/ipv4/tcp_compound.c
+++ /dev/null
@@ -1,448 +0,0 @@
1/*
2 * TCP Vegas congestion control
3 *
4 * This is based on the congestion detection/avoidance scheme described in
5 * Lawrence S. Brakmo and Larry L. Peterson.
6 * "TCP Vegas: End to end congestion avoidance on a global internet."
7 * IEEE Journal on Selected Areas in Communication, 13(8):1465--1480,
8 * October 1995. Available from:
9 * ftp://ftp.cs.arizona.edu/xkernel/Papers/jsac.ps
10 *
11 * See http://www.cs.arizona.edu/xkernel/ for their implementation.
12 * The main aspects that distinguish this implementation from the
13 * Arizona Vegas implementation are:
14 * o We do not change the loss detection or recovery mechanisms of
15 * Linux in any way. Linux already recovers from losses quite well,
16 * using fine-grained timers, NewReno, and FACK.
17 * o To avoid the performance penalty imposed by increasing cwnd
18 * only every-other RTT during slow start, we increase during
19 * every RTT during slow start, just like Reno.
20 * o Largely to allow continuous cwnd growth during slow start,
21 * we use the rate at which ACKs come back as the "actual"
22 * rate, rather than the rate at which data is sent.
23 * o To speed convergence to the right rate, we set the cwnd
24 * to achieve the right ("actual") rate when we exit slow start.
25 * o To filter out the noise caused by delayed ACKs, we use the
26 * minimum RTT sample observed during the last RTT to calculate
27 * the actual rate.
28 * o When the sender re-starts from idle, it waits until it has
29 * received ACKs for an entire flight of new data before making
30 * a cwnd adjustment decision. The original Vegas implementation
31 * assumed senders never went idle.
32 *
33 *
34 * TCP Compound based on TCP Vegas
35 *
36 * further details can be found here:
37 * ftp://ftp.research.microsoft.com/pub/tr/TR-2005-86.pdf
38 */
39
40#include <linux/config.h>
41#include <linux/mm.h>
42#include <linux/module.h>
43#include <linux/skbuff.h>
44#include <linux/inet_diag.h>
45
46#include <net/tcp.h>
47
48/* Default values of the Vegas variables, in fixed-point representation
49 * with V_PARAM_SHIFT bits to the right of the binary point.
50 */
51#define V_PARAM_SHIFT 1
52
53#define TCP_COMPOUND_ALPHA 3U
54#define TCP_COMPOUND_BETA 1U
55#define TCP_COMPOUND_GAMMA 30
56#define TCP_COMPOUND_ZETA 1
57
58/* TCP compound variables */
59struct compound {
60 u32 beg_snd_nxt; /* right edge during last RTT */
61 u32 beg_snd_una; /* left edge during last RTT */
62 u32 beg_snd_cwnd; /* saves the size of the cwnd */
63 u8 doing_vegas_now; /* if true, do vegas for this RTT */
64 u16 cntRTT; /* # of RTTs measured within last RTT */
65 u32 minRTT; /* min of RTTs measured within last RTT (in usec) */
66 u32 baseRTT; /* the min of all Vegas RTT measurements seen (in usec) */
67
68 u32 cwnd;
69 u32 dwnd;
70};
71
72/* There are several situations when we must "re-start" Vegas:
73 *
74 * o when a connection is established
75 * o after an RTO
76 * o after fast recovery
77 * o when we send a packet and there is no outstanding
78 * unacknowledged data (restarting an idle connection)
79 *
80 * In these circumstances we cannot do a Vegas calculation at the
81 * end of the first RTT, because any calculation we do is using
82 * stale info -- both the saved cwnd and congestion feedback are
83 * stale.
84 *
85 * Instead we must wait until the completion of an RTT during
86 * which we actually receive ACKs.
87 */
88static inline void vegas_enable(struct sock *sk)
89{
90 const struct tcp_sock *tp = tcp_sk(sk);
91 struct compound *vegas = inet_csk_ca(sk);
92
93 /* Begin taking Vegas samples next time we send something. */
94 vegas->doing_vegas_now = 1;
95
96 /* Set the beginning of the next send window. */
97 vegas->beg_snd_nxt = tp->snd_nxt;
98
99 vegas->cntRTT = 0;
100 vegas->minRTT = 0x7fffffff;
101}
102
103/* Stop taking Vegas samples for now. */
104static inline void vegas_disable(struct sock *sk)
105{
106 struct compound *vegas = inet_csk_ca(sk);
107
108 vegas->doing_vegas_now = 0;
109}
110
111static void tcp_compound_init(struct sock *sk)
112{
113 struct compound *vegas = inet_csk_ca(sk);
114 const struct tcp_sock *tp = tcp_sk(sk);
115
116 vegas->baseRTT = 0x7fffffff;
117 vegas_enable(sk);
118
119 vegas->dwnd = 0;
120 vegas->cwnd = tp->snd_cwnd;
121}
122
123/* Do RTT sampling needed for Vegas.
124 * Basically we:
125 * o min-filter RTT samples from within an RTT to get the current
126 * propagation delay + queuing delay (we are min-filtering to try to
127 * avoid the effects of delayed ACKs)
128 * o min-filter RTT samples from a much longer window (forever for now)
129 * to find the propagation delay (baseRTT)
130 */
131static void tcp_compound_rtt_calc(struct sock *sk, u32 usrtt)
132{
133 struct compound *vegas = inet_csk_ca(sk);
134 u32 vrtt = usrtt + 1; /* Never allow zero rtt or baseRTT */
135
136 /* Filter to find propagation delay: */
137 if (vrtt < vegas->baseRTT)
138 vegas->baseRTT = vrtt;
139
140 /* Find the min RTT during the last RTT to find
141 * the current prop. delay + queuing delay:
142 */
143
144 vegas->minRTT = min(vegas->minRTT, vrtt);
145 vegas->cntRTT++;
146}
147
148static void tcp_compound_state(struct sock *sk, u8 ca_state)
149{
150
151 if (ca_state == TCP_CA_Open)
152 vegas_enable(sk);
153 else
154 vegas_disable(sk);
155}
156
157
158/* 64bit divisor, dividend and result. dynamic precision */
159static inline u64 div64_64(u64 dividend, u64 divisor)
160{
161 u32 d = divisor;
162
163 if (divisor > 0xffffffffULL) {
164 unsigned int shift = fls(divisor >> 32);
165
166 d = divisor >> shift;
167 dividend >>= shift;
168 }
169
170 /* avoid 64 bit division if possible */
171 if (dividend >> 32)
172 do_div(dividend, d);
173 else
174 dividend = (u32) dividend / d;
175
176 return dividend;
177}
178
179/* calculate the quartic root of "a" using Newton-Raphson */
180static u32 qroot(u64 a)
181{
182 u32 x, x1;
183
184 /* Initial estimate is based on:
185 * qrt(x) = exp(log(x) / 4)
186 */
187 x = 1u << (fls64(a) >> 2);
188
189 /*
190 * Iteration based on:
191 * 3
192 * x = ( 3 * x + a / x ) / 4
193 * k+1 k k
194 */
195 do {
196 u64 x3 = x;
197
198 x1 = x;
199 x3 *= x;
200 x3 *= x;
201
202 x = (3 * x + (u32) div64_64(a, x3)) / 4;
203 } while (abs(x1 - x) > 1);
204
205 return x;
206}
207
208
209/*
210 * If the connection is idle and we are restarting,
211 * then we don't want to do any Vegas calculations
212 * until we get fresh RTT samples. So when we
213 * restart, we reset our Vegas state to a clean
214 * slate. After we get acks for this flight of
215 * packets, _then_ we can make Vegas calculations
216 * again.
217 */
218static void tcp_compound_cwnd_event(struct sock *sk, enum tcp_ca_event event)
219{
220 if (event == CA_EVENT_CWND_RESTART || event == CA_EVENT_TX_START)
221 tcp_compound_init(sk);
222}
223
224static void tcp_compound_cong_avoid(struct sock *sk, u32 ack,
225 u32 seq_rtt, u32 in_flight, int flag)
226{
227 struct tcp_sock *tp = tcp_sk(sk);
228 struct compound *vegas = inet_csk_ca(sk);
229 u8 inc = 0;
230
231 if (vegas->cwnd + vegas->dwnd > tp->snd_cwnd) {
232 if (vegas->cwnd > tp->snd_cwnd || vegas->dwnd > tp->snd_cwnd) {
233 vegas->cwnd = tp->snd_cwnd;
234 vegas->dwnd = 0;
235 } else
236 vegas->cwnd = tp->snd_cwnd - vegas->dwnd;
237
238 }
239
240 if (!tcp_is_cwnd_limited(sk, in_flight))
241 return;
242
243 if (vegas->cwnd <= tp->snd_ssthresh)
244 inc = 1;
245 else if (tp->snd_cwnd_cnt < tp->snd_cwnd)
246 tp->snd_cwnd_cnt++;
247
248 if (tp->snd_cwnd_cnt >= tp->snd_cwnd) {
249 inc = 1;
250 tp->snd_cwnd_cnt = 0;
251 }
252
253 if (inc && tp->snd_cwnd < tp->snd_cwnd_clamp)
254 vegas->cwnd++;
255
256 /* The key players are v_beg_snd_una and v_beg_snd_nxt.
257 *
258 * These are so named because they represent the approximate values
259 * of snd_una and snd_nxt at the beginning of the current RTT. More
260 * precisely, they represent the amount of data sent during the RTT.
261 * At the end of the RTT, when we receive an ACK for v_beg_snd_nxt,
262 * we will calculate that (v_beg_snd_nxt - v_beg_snd_una) outstanding
263 * bytes of data have been ACKed during the course of the RTT, giving
264 * an "actual" rate of:
265 *
266 * (v_beg_snd_nxt - v_beg_snd_una) / (rtt duration)
267 *
268 * Unfortunately, v_beg_snd_una is not exactly equal to snd_una,
269 * because delayed ACKs can cover more than one segment, so they
270 * don't line up nicely with the boundaries of RTTs.
271 *
272 * Another unfortunate fact of life is that delayed ACKs delay the
273 * advance of the left edge of our send window, so that the number
274 * of bytes we send in an RTT is often less than our cwnd will allow.
275 * So we keep track of our cwnd separately, in v_beg_snd_cwnd.
276 */
277
278 if (after(ack, vegas->beg_snd_nxt)) {
279 /* Do the Vegas once-per-RTT cwnd adjustment. */
280 u32 old_wnd, old_snd_cwnd;
281
282 /* Here old_wnd is essentially the window of data that was
283 * sent during the previous RTT, and has all
284 * been acknowledged in the course of the RTT that ended
285 * with the ACK we just received. Likewise, old_snd_cwnd
286 * is the cwnd during the previous RTT.
287 */
288 if (!tp->mss_cache)
289 return;
290
291 old_wnd = (vegas->beg_snd_nxt - vegas->beg_snd_una) /
292 tp->mss_cache;
293 old_snd_cwnd = vegas->beg_snd_cwnd;
294
295 /* Save the extent of the current window so we can use this
296 * at the end of the next RTT.
297 */
298 vegas->beg_snd_una = vegas->beg_snd_nxt;
299 vegas->beg_snd_nxt = tp->snd_nxt;
300 vegas->beg_snd_cwnd = tp->snd_cwnd;
301
302 /* We do the Vegas calculations only if we got enough RTT
303 * samples that we can be reasonably sure that we got
304 * at least one RTT sample that wasn't from a delayed ACK.
305 * If we only had 2 samples total,
306 * then that means we're getting only 1 ACK per RTT, which
307 * means they're almost certainly delayed ACKs.
308 * If we have 3 samples, we should be OK.
309 */
310
311 if (vegas->cntRTT > 2) {
312 u32 rtt, target_cwnd, diff;
313 u32 brtt, dwnd;
314
315 /* We have enough RTT samples, so, using the Vegas
316 * algorithm, we determine if we should increase or
317 * decrease cwnd, and by how much.
318 */
319
320 /* Pluck out the RTT we are using for the Vegas
321 * calculations. This is the min RTT seen during the
322 * last RTT. Taking the min filters out the effects
323 * of delayed ACKs, at the cost of noticing congestion
324 * a bit later.
325 */
326 rtt = vegas->minRTT;
327
328 /* Calculate the cwnd we should have, if we weren't
329 * going too fast.
330 *
331 * This is:
332 * (actual rate in segments) * baseRTT
333 * We keep it as a fixed point number with
334 * V_PARAM_SHIFT bits to the right of the binary point.
335 */
336 if (!rtt)
337 return;
338
339 brtt = vegas->baseRTT;
340 target_cwnd = ((old_wnd * brtt)
341 << V_PARAM_SHIFT) / rtt;
342
343 /* Calculate the difference between the window we had,
344 * and the window we would like to have. This quantity
345 * is the "Diff" from the Arizona Vegas papers.
346 *
347 * Again, this is a fixed point number with
348 * V_PARAM_SHIFT bits to the right of the binary
349 * point.
350 */
351
352 diff = (old_wnd << V_PARAM_SHIFT) - target_cwnd;
353
354 dwnd = vegas->dwnd;
355
356 if (diff < (TCP_COMPOUND_GAMMA << V_PARAM_SHIFT)) {
357 u64 v;
358 u32 x;
359
360 /*
361 * The TCP Compound paper describes the choice
362 * of "k" determines the agressiveness,
363 * ie. slope of the response function.
364 *
365 * For same value as HSTCP would be 0.8
366 * but for computaional reasons, both the
367 * original authors and this implementation
368 * use 0.75.
369 */
370 v = old_wnd;
371 x = qroot(v * v * v) >> TCP_COMPOUND_ALPHA;
372 if (x > 1)
373 dwnd = x - 1;
374 else
375 dwnd = 0;
376
377 dwnd += vegas->dwnd;
378
379 } else if ((dwnd << V_PARAM_SHIFT) <
380 (diff * TCP_COMPOUND_BETA))
381 dwnd = 0;
382 else
383 dwnd =
384 ((dwnd << V_PARAM_SHIFT) -
385 (diff *
386 TCP_COMPOUND_BETA)) >> V_PARAM_SHIFT;
387
388 vegas->dwnd = dwnd;
389
390 }
391
392 /* Wipe the slate clean for the next RTT. */
393 vegas->cntRTT = 0;
394 vegas->minRTT = 0x7fffffff;
395 }
396
397 tp->snd_cwnd = vegas->cwnd + vegas->dwnd;
398}
399
400/* Extract info for Tcp socket info provided via netlink. */
401static void tcp_compound_get_info(struct sock *sk, u32 ext, struct sk_buff *skb)
402{
403 const struct compound *ca = inet_csk_ca(sk);
404 if (ext & (1 << (INET_DIAG_VEGASINFO - 1))) {
405 struct tcpvegas_info *info;
406
407 info = RTA_DATA(__RTA_PUT(skb, INET_DIAG_VEGASINFO,
408 sizeof(*info)));
409
410 info->tcpv_enabled = ca->doing_vegas_now;
411 info->tcpv_rttcnt = ca->cntRTT;
412 info->tcpv_rtt = ca->baseRTT;
413 info->tcpv_minrtt = ca->minRTT;
414 rtattr_failure:;
415 }
416}
417
418static struct tcp_congestion_ops tcp_compound = {
419 .init = tcp_compound_init,
420 .ssthresh = tcp_reno_ssthresh,
421 .cong_avoid = tcp_compound_cong_avoid,
422 .rtt_sample = tcp_compound_rtt_calc,
423 .set_state = tcp_compound_state,
424 .cwnd_event = tcp_compound_cwnd_event,
425 .get_info = tcp_compound_get_info,
426
427 .owner = THIS_MODULE,
428 .name = "compound",
429};
430
431static int __init tcp_compound_register(void)
432{
433 BUG_ON(sizeof(struct compound) > ICSK_CA_PRIV_SIZE);
434 tcp_register_congestion_control(&tcp_compound);
435 return 0;
436}
437
438static void __exit tcp_compound_unregister(void)
439{
440 tcp_unregister_congestion_control(&tcp_compound);
441}
442
443module_init(tcp_compound_register);
444module_exit(tcp_compound_unregister);
445
446MODULE_AUTHOR("Angelo P. Castellani, Stephen Hemminger");
447MODULE_LICENSE("GPL");
448MODULE_DESCRIPTION("TCP Compound");
diff --git a/net/ipv4/tcp_highspeed.c b/net/ipv4/tcp_highspeed.c
index aaa1538c0692..fa3e1aad660c 100644
--- a/net/ipv4/tcp_highspeed.c
+++ b/net/ipv4/tcp_highspeed.c
@@ -139,14 +139,19 @@ static void hstcp_cong_avoid(struct sock *sk, u32 adk, u32 rtt,
139 tp->snd_cwnd++; 139 tp->snd_cwnd++;
140 } 140 }
141 } else { 141 } else {
142 /* Update AIMD parameters */ 142 /* Update AIMD parameters.
143 *
144 * We want to guarantee that:
145 * hstcp_aimd_vals[ca->ai-1].cwnd <
146 * snd_cwnd <=
147 * hstcp_aimd_vals[ca->ai].cwnd
148 */
143 if (tp->snd_cwnd > hstcp_aimd_vals[ca->ai].cwnd) { 149 if (tp->snd_cwnd > hstcp_aimd_vals[ca->ai].cwnd) {
144 while (tp->snd_cwnd > hstcp_aimd_vals[ca->ai].cwnd && 150 while (tp->snd_cwnd > hstcp_aimd_vals[ca->ai].cwnd &&
145 ca->ai < HSTCP_AIMD_MAX - 1) 151 ca->ai < HSTCP_AIMD_MAX - 1)
146 ca->ai++; 152 ca->ai++;
147 } else if (tp->snd_cwnd < hstcp_aimd_vals[ca->ai].cwnd) { 153 } else if (ca->ai && tp->snd_cwnd <= hstcp_aimd_vals[ca->ai-1].cwnd) {
148 while (tp->snd_cwnd > hstcp_aimd_vals[ca->ai].cwnd && 154 while (ca->ai && tp->snd_cwnd <= hstcp_aimd_vals[ca->ai-1].cwnd)
149 ca->ai > 0)
150 ca->ai--; 155 ca->ai--;
151 } 156 }
152 157
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 5a886e6efbbe..4b04c3edd4a9 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -438,7 +438,6 @@ void tcp_v4_err(struct sk_buff *skb, u32 info)
438 It can f.e. if SYNs crossed. 438 It can f.e. if SYNs crossed.
439 */ 439 */
440 if (!sock_owned_by_user(sk)) { 440 if (!sock_owned_by_user(sk)) {
441 TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS);
442 sk->sk_err = err; 441 sk->sk_err = err;
443 442
444 sk->sk_error_report(sk); 443 sk->sk_error_report(sk);
@@ -496,6 +495,24 @@ void tcp_v4_send_check(struct sock *sk, int len, struct sk_buff *skb)
496 } 495 }
497} 496}
498 497
498int tcp_v4_gso_send_check(struct sk_buff *skb)
499{
500 struct iphdr *iph;
501 struct tcphdr *th;
502
503 if (!pskb_may_pull(skb, sizeof(*th)))
504 return -EINVAL;
505
506 iph = skb->nh.iph;
507 th = skb->h.th;
508
509 th->check = 0;
510 th->check = ~tcp_v4_check(th, skb->len, iph->saddr, iph->daddr, 0);
511 skb->csum = offsetof(struct tcphdr, check);
512 skb->ip_summed = CHECKSUM_HW;
513 return 0;
514}
515
499/* 516/*
500 * This routine will send an RST to the other tcp. 517 * This routine will send an RST to the other tcp.
501 * 518 *
@@ -856,7 +873,6 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
856drop_and_free: 873drop_and_free:
857 reqsk_free(req); 874 reqsk_free(req);
858drop: 875drop:
859 TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS);
860 return 0; 876 return 0;
861} 877}
862 878
@@ -1622,10 +1638,9 @@ static int tcp_seq_open(struct inode *inode, struct file *file)
1622 if (unlikely(afinfo == NULL)) 1638 if (unlikely(afinfo == NULL))
1623 return -EINVAL; 1639 return -EINVAL;
1624 1640
1625 s = kmalloc(sizeof(*s), GFP_KERNEL); 1641 s = kzalloc(sizeof(*s), GFP_KERNEL);
1626 if (!s) 1642 if (!s)
1627 return -ENOMEM; 1643 return -ENOMEM;
1628 memset(s, 0, sizeof(*s));
1629 s->family = afinfo->family; 1644 s->family = afinfo->family;
1630 s->seq_ops.start = tcp_seq_start; 1645 s->seq_ops.start = tcp_seq_start;
1631 s->seq_ops.next = tcp_seq_next; 1646 s->seq_ops.next = tcp_seq_next;
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index 0ccb7cb22b15..624e2b2c7f53 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -589,8 +589,10 @@ struct sock *tcp_check_req(struct sock *sk,struct sk_buff *skb,
589 /* RFC793: "second check the RST bit" and 589 /* RFC793: "second check the RST bit" and
590 * "fourth, check the SYN bit" 590 * "fourth, check the SYN bit"
591 */ 591 */
592 if (flg & (TCP_FLAG_RST|TCP_FLAG_SYN)) 592 if (flg & (TCP_FLAG_RST|TCP_FLAG_SYN)) {
593 TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS);
593 goto embryonic_reset; 594 goto embryonic_reset;
595 }
594 596
595 /* ACK sequence verified above, just make sure ACK is 597 /* ACK sequence verified above, just make sure ACK is
596 * set. If ACK not set, just silently drop the packet. 598 * set. If ACK not set, just silently drop the packet.
diff --git a/net/ipv4/tcp_probe.c b/net/ipv4/tcp_probe.c
index d7d517a3a238..b3435324b573 100644
--- a/net/ipv4/tcp_probe.c
+++ b/net/ipv4/tcp_probe.c
@@ -114,7 +114,7 @@ static int tcpprobe_open(struct inode * inode, struct file * file)
114static ssize_t tcpprobe_read(struct file *file, char __user *buf, 114static ssize_t tcpprobe_read(struct file *file, char __user *buf,
115 size_t len, loff_t *ppos) 115 size_t len, loff_t *ppos)
116{ 116{
117 int error = 0, cnt; 117 int error = 0, cnt = 0;
118 unsigned char *tbuf; 118 unsigned char *tbuf;
119 119
120 if (!buf || len < 0) 120 if (!buf || len < 0)
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 9bfcddad695b..f136cec96d95 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1468,11 +1468,10 @@ static int udp_seq_open(struct inode *inode, struct file *file)
1468 struct udp_seq_afinfo *afinfo = PDE(inode)->data; 1468 struct udp_seq_afinfo *afinfo = PDE(inode)->data;
1469 struct seq_file *seq; 1469 struct seq_file *seq;
1470 int rc = -ENOMEM; 1470 int rc = -ENOMEM;
1471 struct udp_iter_state *s = kmalloc(sizeof(*s), GFP_KERNEL); 1471 struct udp_iter_state *s = kzalloc(sizeof(*s), GFP_KERNEL);
1472 1472
1473 if (!s) 1473 if (!s)
1474 goto out; 1474 goto out;
1475 memset(s, 0, sizeof(*s));
1476 s->family = afinfo->family; 1475 s->family = afinfo->family;
1477 s->seq_ops.start = udp_seq_start; 1476 s->seq_ops.start = udp_seq_start;
1478 s->seq_ops.next = udp_seq_next; 1477 s->seq_ops.next = udp_seq_next;
diff --git a/net/ipv4/xfrm4_mode_tunnel.c b/net/ipv4/xfrm4_mode_tunnel.c
index f8d880beb12f..13cafbe56ce3 100644
--- a/net/ipv4/xfrm4_mode_tunnel.c
+++ b/net/ipv4/xfrm4_mode_tunnel.c
@@ -92,7 +92,6 @@ static int xfrm4_tunnel_input(struct xfrm_state *x, struct sk_buff *skb)
92 skb->mac.raw = memmove(skb->data - skb->mac_len, 92 skb->mac.raw = memmove(skb->data - skb->mac_len,
93 skb->mac.raw, skb->mac_len); 93 skb->mac.raw, skb->mac_len);
94 skb->nh.raw = skb->data; 94 skb->nh.raw = skb->data;
95 memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options));
96 err = 0; 95 err = 0;
97 96
98out: 97out:
diff --git a/net/ipv4/xfrm4_output.c b/net/ipv4/xfrm4_output.c
index 193363e22932..d16f863cf687 100644
--- a/net/ipv4/xfrm4_output.c
+++ b/net/ipv4/xfrm4_output.c
@@ -134,7 +134,7 @@ static int xfrm4_output_finish(struct sk_buff *skb)
134 } 134 }
135#endif 135#endif
136 136
137 if (!skb_shinfo(skb)->gso_size) 137 if (!skb_is_gso(skb))
138 return xfrm4_output_finish2(skb); 138 return xfrm4_output_finish2(skb);
139 139
140 skb->protocol = htons(ETH_P_IP); 140 skb->protocol = htons(ETH_P_IP);
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index c250d0af10d7..8ea1e36bf8eb 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -508,6 +508,26 @@ void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp)
508 kfree(ifp); 508 kfree(ifp);
509} 509}
510 510
511static void
512ipv6_link_dev_addr(struct inet6_dev *idev, struct inet6_ifaddr *ifp)
513{
514 struct inet6_ifaddr *ifa, **ifap;
515 int ifp_scope = ipv6_addr_src_scope(&ifp->addr);
516
517 /*
518 * Each device address list is sorted in order of scope -
519 * global before linklocal.
520 */
521 for (ifap = &idev->addr_list; (ifa = *ifap) != NULL;
522 ifap = &ifa->if_next) {
523 if (ifp_scope >= ipv6_addr_src_scope(&ifa->addr))
524 break;
525 }
526
527 ifp->if_next = *ifap;
528 *ifap = ifp;
529}
530
511/* On success it returns ifp with increased reference count */ 531/* On success it returns ifp with increased reference count */
512 532
513static struct inet6_ifaddr * 533static struct inet6_ifaddr *
@@ -573,8 +593,7 @@ ipv6_add_addr(struct inet6_dev *idev, const struct in6_addr *addr, int pfxlen,
573 593
574 write_lock(&idev->lock); 594 write_lock(&idev->lock);
575 /* Add to inet6_dev unicast addr list. */ 595 /* Add to inet6_dev unicast addr list. */
576 ifa->if_next = idev->addr_list; 596 ipv6_link_dev_addr(idev, ifa);
577 idev->addr_list = ifa;
578 597
579#ifdef CONFIG_IPV6_PRIVACY 598#ifdef CONFIG_IPV6_PRIVACY
580 if (ifa->flags&IFA_F_TEMPORARY) { 599 if (ifa->flags&IFA_F_TEMPORARY) {
@@ -987,7 +1006,7 @@ int ipv6_dev_get_saddr(struct net_device *daddr_dev,
987 continue; 1006 continue;
988 } else if (score.scope < hiscore.scope) { 1007 } else if (score.scope < hiscore.scope) {
989 if (score.scope < daddr_scope) 1008 if (score.scope < daddr_scope)
990 continue; 1009 break; /* addresses sorted by scope */
991 else { 1010 else {
992 score.rule = 2; 1011 score.rule = 2;
993 goto record_it; 1012 goto record_it;
@@ -1850,15 +1869,21 @@ err_exit:
1850/* 1869/*
1851 * Manual configuration of address on an interface 1870 * Manual configuration of address on an interface
1852 */ 1871 */
1853static int inet6_addr_add(int ifindex, struct in6_addr *pfx, int plen) 1872static int inet6_addr_add(int ifindex, struct in6_addr *pfx, int plen,
1873 __u32 prefered_lft, __u32 valid_lft)
1854{ 1874{
1855 struct inet6_ifaddr *ifp; 1875 struct inet6_ifaddr *ifp;
1856 struct inet6_dev *idev; 1876 struct inet6_dev *idev;
1857 struct net_device *dev; 1877 struct net_device *dev;
1878 __u8 ifa_flags = 0;
1858 int scope; 1879 int scope;
1859 1880
1860 ASSERT_RTNL(); 1881 ASSERT_RTNL();
1861 1882
1883 /* check the lifetime */
1884 if (!valid_lft || prefered_lft > valid_lft)
1885 return -EINVAL;
1886
1862 if ((dev = __dev_get_by_index(ifindex)) == NULL) 1887 if ((dev = __dev_get_by_index(ifindex)) == NULL)
1863 return -ENODEV; 1888 return -ENODEV;
1864 1889
@@ -1870,10 +1895,29 @@ static int inet6_addr_add(int ifindex, struct in6_addr *pfx, int plen)
1870 1895
1871 scope = ipv6_addr_scope(pfx); 1896 scope = ipv6_addr_scope(pfx);
1872 1897
1873 ifp = ipv6_add_addr(idev, pfx, plen, scope, IFA_F_PERMANENT); 1898 if (valid_lft == INFINITY_LIFE_TIME)
1899 ifa_flags |= IFA_F_PERMANENT;
1900 else if (valid_lft >= 0x7FFFFFFF/HZ)
1901 valid_lft = 0x7FFFFFFF/HZ;
1902
1903 if (prefered_lft == 0)
1904 ifa_flags |= IFA_F_DEPRECATED;
1905 else if ((prefered_lft >= 0x7FFFFFFF/HZ) &&
1906 (prefered_lft != INFINITY_LIFE_TIME))
1907 prefered_lft = 0x7FFFFFFF/HZ;
1908
1909 ifp = ipv6_add_addr(idev, pfx, plen, scope, ifa_flags);
1910
1874 if (!IS_ERR(ifp)) { 1911 if (!IS_ERR(ifp)) {
1912 spin_lock(&ifp->lock);
1913 ifp->valid_lft = valid_lft;
1914 ifp->prefered_lft = prefered_lft;
1915 ifp->tstamp = jiffies;
1916 spin_unlock(&ifp->lock);
1917
1875 addrconf_dad_start(ifp, 0); 1918 addrconf_dad_start(ifp, 0);
1876 in6_ifa_put(ifp); 1919 in6_ifa_put(ifp);
1920 addrconf_verify(0);
1877 return 0; 1921 return 0;
1878 } 1922 }
1879 1923
@@ -1926,7 +1970,8 @@ int addrconf_add_ifaddr(void __user *arg)
1926 return -EFAULT; 1970 return -EFAULT;
1927 1971
1928 rtnl_lock(); 1972 rtnl_lock();
1929 err = inet6_addr_add(ireq.ifr6_ifindex, &ireq.ifr6_addr, ireq.ifr6_prefixlen); 1973 err = inet6_addr_add(ireq.ifr6_ifindex, &ireq.ifr6_addr, ireq.ifr6_prefixlen,
1974 INFINITY_LIFE_TIME, INFINITY_LIFE_TIME);
1930 rtnl_unlock(); 1975 rtnl_unlock();
1931 return err; 1976 return err;
1932} 1977}
@@ -2752,12 +2797,16 @@ restart:
2752 ifp->idev->nd_parms->retrans_time / HZ; 2797 ifp->idev->nd_parms->retrans_time / HZ;
2753#endif 2798#endif
2754 2799
2755 if (age >= ifp->valid_lft) { 2800 if (ifp->valid_lft != INFINITY_LIFE_TIME &&
2801 age >= ifp->valid_lft) {
2756 spin_unlock(&ifp->lock); 2802 spin_unlock(&ifp->lock);
2757 in6_ifa_hold(ifp); 2803 in6_ifa_hold(ifp);
2758 read_unlock(&addrconf_hash_lock); 2804 read_unlock(&addrconf_hash_lock);
2759 ipv6_del_addr(ifp); 2805 ipv6_del_addr(ifp);
2760 goto restart; 2806 goto restart;
2807 } else if (ifp->prefered_lft == INFINITY_LIFE_TIME) {
2808 spin_unlock(&ifp->lock);
2809 continue;
2761 } else if (age >= ifp->prefered_lft) { 2810 } else if (age >= ifp->prefered_lft) {
2762 /* jiffies - ifp->tsamp > age >= ifp->prefered_lft */ 2811 /* jiffies - ifp->tsamp > age >= ifp->prefered_lft */
2763 int deprecate = 0; 2812 int deprecate = 0;
@@ -2834,7 +2883,8 @@ inet6_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
2834 pfx = RTA_DATA(rta[IFA_ADDRESS-1]); 2883 pfx = RTA_DATA(rta[IFA_ADDRESS-1]);
2835 } 2884 }
2836 if (rta[IFA_LOCAL-1]) { 2885 if (rta[IFA_LOCAL-1]) {
2837 if (pfx && memcmp(pfx, RTA_DATA(rta[IFA_LOCAL-1]), sizeof(*pfx))) 2886 if (RTA_PAYLOAD(rta[IFA_LOCAL-1]) < sizeof(*pfx) ||
2887 (pfx && memcmp(pfx, RTA_DATA(rta[IFA_LOCAL-1]), sizeof(*pfx))))
2838 return -EINVAL; 2888 return -EINVAL;
2839 pfx = RTA_DATA(rta[IFA_LOCAL-1]); 2889 pfx = RTA_DATA(rta[IFA_LOCAL-1]);
2840 } 2890 }
@@ -2845,11 +2895,61 @@ inet6_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
2845} 2895}
2846 2896
2847static int 2897static int
2898inet6_addr_modify(int ifindex, struct in6_addr *pfx,
2899 __u32 prefered_lft, __u32 valid_lft)
2900{
2901 struct inet6_ifaddr *ifp = NULL;
2902 struct net_device *dev;
2903 int ifa_flags = 0;
2904
2905 if ((dev = __dev_get_by_index(ifindex)) == NULL)
2906 return -ENODEV;
2907
2908 if (!(dev->flags&IFF_UP))
2909 return -ENETDOWN;
2910
2911 if (!valid_lft || (prefered_lft > valid_lft))
2912 return -EINVAL;
2913
2914 ifp = ipv6_get_ifaddr(pfx, dev, 1);
2915 if (ifp == NULL)
2916 return -ENOENT;
2917
2918 if (valid_lft == INFINITY_LIFE_TIME)
2919 ifa_flags = IFA_F_PERMANENT;
2920 else if (valid_lft >= 0x7FFFFFFF/HZ)
2921 valid_lft = 0x7FFFFFFF/HZ;
2922
2923 if (prefered_lft == 0)
2924 ifa_flags = IFA_F_DEPRECATED;
2925 else if ((prefered_lft >= 0x7FFFFFFF/HZ) &&
2926 (prefered_lft != INFINITY_LIFE_TIME))
2927 prefered_lft = 0x7FFFFFFF/HZ;
2928
2929 spin_lock_bh(&ifp->lock);
2930 ifp->flags = (ifp->flags & ~(IFA_F_DEPRECATED|IFA_F_PERMANENT)) | ifa_flags;
2931
2932 ifp->tstamp = jiffies;
2933 ifp->valid_lft = valid_lft;
2934 ifp->prefered_lft = prefered_lft;
2935
2936 spin_unlock_bh(&ifp->lock);
2937 if (!(ifp->flags&IFA_F_TENTATIVE))
2938 ipv6_ifa_notify(0, ifp);
2939 in6_ifa_put(ifp);
2940
2941 addrconf_verify(0);
2942
2943 return 0;
2944}
2945
2946static int
2848inet6_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) 2947inet6_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
2849{ 2948{
2850 struct rtattr **rta = arg; 2949 struct rtattr **rta = arg;
2851 struct ifaddrmsg *ifm = NLMSG_DATA(nlh); 2950 struct ifaddrmsg *ifm = NLMSG_DATA(nlh);
2852 struct in6_addr *pfx; 2951 struct in6_addr *pfx;
2952 __u32 valid_lft = INFINITY_LIFE_TIME, prefered_lft = INFINITY_LIFE_TIME;
2853 2953
2854 pfx = NULL; 2954 pfx = NULL;
2855 if (rta[IFA_ADDRESS-1]) { 2955 if (rta[IFA_ADDRESS-1]) {
@@ -2858,14 +2958,34 @@ inet6_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
2858 pfx = RTA_DATA(rta[IFA_ADDRESS-1]); 2958 pfx = RTA_DATA(rta[IFA_ADDRESS-1]);
2859 } 2959 }
2860 if (rta[IFA_LOCAL-1]) { 2960 if (rta[IFA_LOCAL-1]) {
2861 if (pfx && memcmp(pfx, RTA_DATA(rta[IFA_LOCAL-1]), sizeof(*pfx))) 2961 if (RTA_PAYLOAD(rta[IFA_LOCAL-1]) < sizeof(*pfx) ||
2962 (pfx && memcmp(pfx, RTA_DATA(rta[IFA_LOCAL-1]), sizeof(*pfx))))
2862 return -EINVAL; 2963 return -EINVAL;
2863 pfx = RTA_DATA(rta[IFA_LOCAL-1]); 2964 pfx = RTA_DATA(rta[IFA_LOCAL-1]);
2864 } 2965 }
2865 if (pfx == NULL) 2966 if (pfx == NULL)
2866 return -EINVAL; 2967 return -EINVAL;
2867 2968
2868 return inet6_addr_add(ifm->ifa_index, pfx, ifm->ifa_prefixlen); 2969 if (rta[IFA_CACHEINFO-1]) {
2970 struct ifa_cacheinfo *ci;
2971 if (RTA_PAYLOAD(rta[IFA_CACHEINFO-1]) < sizeof(*ci))
2972 return -EINVAL;
2973 ci = RTA_DATA(rta[IFA_CACHEINFO-1]);
2974 valid_lft = ci->ifa_valid;
2975 prefered_lft = ci->ifa_prefered;
2976 }
2977
2978 if (nlh->nlmsg_flags & NLM_F_REPLACE) {
2979 int ret;
2980 ret = inet6_addr_modify(ifm->ifa_index, pfx,
2981 prefered_lft, valid_lft);
2982 if (ret == 0 || !(nlh->nlmsg_flags & NLM_F_CREATE))
2983 return ret;
2984 }
2985
2986 return inet6_addr_add(ifm->ifa_index, pfx, ifm->ifa_prefixlen,
2987 prefered_lft, valid_lft);
2988
2869} 2989}
2870 2990
2871/* Maximum length of ifa_cacheinfo attributes */ 2991/* Maximum length of ifa_cacheinfo attributes */
@@ -3102,6 +3222,62 @@ static int inet6_dump_ifacaddr(struct sk_buff *skb, struct netlink_callback *cb)
3102 return inet6_dump_addr(skb, cb, type); 3222 return inet6_dump_addr(skb, cb, type);
3103} 3223}
3104 3224
3225static int inet6_rtm_getaddr(struct sk_buff *in_skb,
3226 struct nlmsghdr* nlh, void *arg)
3227{
3228 struct rtattr **rta = arg;
3229 struct ifaddrmsg *ifm = NLMSG_DATA(nlh);
3230 struct in6_addr *addr = NULL;
3231 struct net_device *dev = NULL;
3232 struct inet6_ifaddr *ifa;
3233 struct sk_buff *skb;
3234 int size = NLMSG_SPACE(sizeof(struct ifaddrmsg) + INET6_IFADDR_RTA_SPACE);
3235 int err;
3236
3237 if (rta[IFA_ADDRESS-1]) {
3238 if (RTA_PAYLOAD(rta[IFA_ADDRESS-1]) < sizeof(*addr))
3239 return -EINVAL;
3240 addr = RTA_DATA(rta[IFA_ADDRESS-1]);
3241 }
3242 if (rta[IFA_LOCAL-1]) {
3243 if (RTA_PAYLOAD(rta[IFA_LOCAL-1]) < sizeof(*addr) ||
3244 (addr && memcmp(addr, RTA_DATA(rta[IFA_LOCAL-1]), sizeof(*addr))))
3245 return -EINVAL;
3246 addr = RTA_DATA(rta[IFA_LOCAL-1]);
3247 }
3248 if (addr == NULL)
3249 return -EINVAL;
3250
3251 if (ifm->ifa_index)
3252 dev = __dev_get_by_index(ifm->ifa_index);
3253
3254 if ((ifa = ipv6_get_ifaddr(addr, dev, 1)) == NULL)
3255 return -EADDRNOTAVAIL;
3256
3257 if ((skb = alloc_skb(size, GFP_KERNEL)) == NULL) {
3258 err = -ENOBUFS;
3259 goto out;
3260 }
3261
3262 NETLINK_CB(skb).dst_pid = NETLINK_CB(in_skb).pid;
3263 err = inet6_fill_ifaddr(skb, ifa, NETLINK_CB(in_skb).pid,
3264 nlh->nlmsg_seq, RTM_NEWADDR, 0);
3265 if (err < 0) {
3266 err = -EMSGSIZE;
3267 goto out_free;
3268 }
3269
3270 err = netlink_unicast(rtnl, skb, NETLINK_CB(in_skb).pid, MSG_DONTWAIT);
3271 if (err > 0)
3272 err = 0;
3273out:
3274 in6_ifa_put(ifa);
3275 return err;
3276out_free:
3277 kfree_skb(skb);
3278 goto out;
3279}
3280
3105static void inet6_ifa_notify(int event, struct inet6_ifaddr *ifa) 3281static void inet6_ifa_notify(int event, struct inet6_ifaddr *ifa)
3106{ 3282{
3107 struct sk_buff *skb; 3283 struct sk_buff *skb;
@@ -3344,7 +3520,8 @@ static struct rtnetlink_link inet6_rtnetlink_table[RTM_NR_MSGTYPES] = {
3344 [RTM_GETLINK - RTM_BASE] = { .dumpit = inet6_dump_ifinfo, }, 3520 [RTM_GETLINK - RTM_BASE] = { .dumpit = inet6_dump_ifinfo, },
3345 [RTM_NEWADDR - RTM_BASE] = { .doit = inet6_rtm_newaddr, }, 3521 [RTM_NEWADDR - RTM_BASE] = { .doit = inet6_rtm_newaddr, },
3346 [RTM_DELADDR - RTM_BASE] = { .doit = inet6_rtm_deladdr, }, 3522 [RTM_DELADDR - RTM_BASE] = { .doit = inet6_rtm_deladdr, },
3347 [RTM_GETADDR - RTM_BASE] = { .dumpit = inet6_dump_ifaddr, }, 3523 [RTM_GETADDR - RTM_BASE] = { .doit = inet6_rtm_getaddr,
3524 .dumpit = inet6_dump_ifaddr, },
3348 [RTM_GETMULTICAST - RTM_BASE] = { .dumpit = inet6_dump_ifmcaddr, }, 3525 [RTM_GETMULTICAST - RTM_BASE] = { .dumpit = inet6_dump_ifmcaddr, },
3349 [RTM_GETANYCAST - RTM_BASE] = { .dumpit = inet6_dump_ifacaddr, }, 3526 [RTM_GETANYCAST - RTM_BASE] = { .dumpit = inet6_dump_ifacaddr, },
3350 [RTM_NEWROUTE - RTM_BASE] = { .doit = inet6_rtm_newroute, }, 3527 [RTM_NEWROUTE - RTM_BASE] = { .doit = inet6_rtm_newroute, },
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index 5a0ba58b86cc..ac85e9c532c2 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -658,7 +658,7 @@ int inet6_sk_rebuild_header(struct sock *sk)
658 return err; 658 return err;
659 } 659 }
660 660
661 ip6_dst_store(sk, dst, NULL); 661 __ip6_dst_store(sk, dst, NULL);
662 } 662 }
663 663
664 return 0; 664 return 0;
diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c
index 5c950cc79d80..bf491077b822 100644
--- a/net/ipv6/inet6_connection_sock.c
+++ b/net/ipv6/inet6_connection_sock.c
@@ -185,7 +185,7 @@ int inet6_csk_xmit(struct sk_buff *skb, int ipfragok)
185 return err; 185 return err;
186 } 186 }
187 187
188 ip6_dst_store(sk, dst, NULL); 188 __ip6_dst_store(sk, dst, NULL);
189 } 189 }
190 190
191 skb->dst = dst_clone(dst); 191 skb->dst = dst_clone(dst);
diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c
index df8f051c0fce..25c2a9e03895 100644
--- a/net/ipv6/ip6_input.c
+++ b/net/ipv6/ip6_input.c
@@ -71,6 +71,8 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
71 goto out; 71 goto out;
72 } 72 }
73 73
74 memset(IP6CB(skb), 0, sizeof(struct inet6_skb_parm));
75
74 /* 76 /*
75 * Store incoming device index. When the packet will 77 * Store incoming device index. When the packet will
76 * be queued, we cannot refer to skb->dev anymore. 78 * be queued, we cannot refer to skb->dev anymore.
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 2c5b44575af0..69451af6abe7 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -147,7 +147,7 @@ static int ip6_output2(struct sk_buff *skb)
147 147
148int ip6_output(struct sk_buff *skb) 148int ip6_output(struct sk_buff *skb)
149{ 149{
150 if ((skb->len > dst_mtu(skb->dst) && !skb_shinfo(skb)->gso_size) || 150 if ((skb->len > dst_mtu(skb->dst) && !skb_is_gso(skb)) ||
151 dst_allfrag(skb->dst)) 151 dst_allfrag(skb->dst))
152 return ip6_fragment(skb, ip6_output2); 152 return ip6_fragment(skb, ip6_output2);
153 else 153 else
@@ -229,7 +229,7 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
229 skb->priority = sk->sk_priority; 229 skb->priority = sk->sk_priority;
230 230
231 mtu = dst_mtu(dst); 231 mtu = dst_mtu(dst);
232 if ((skb->len <= mtu) || ipfragok || skb_shinfo(skb)->gso_size) { 232 if ((skb->len <= mtu) || ipfragok || skb_is_gso(skb)) {
233 IP6_INC_STATS(IPSTATS_MIB_OUTREQUESTS); 233 IP6_INC_STATS(IPSTATS_MIB_OUTREQUESTS);
234 return NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, dst->dev, 234 return NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, dst->dev,
235 dst_output); 235 dst_output);
@@ -356,6 +356,7 @@ int ip6_forward(struct sk_buff *skb)
356 skb->dev = dst->dev; 356 skb->dev = dst->dev;
357 icmpv6_send(skb, ICMPV6_TIME_EXCEED, ICMPV6_EXC_HOPLIMIT, 357 icmpv6_send(skb, ICMPV6_TIME_EXCEED, ICMPV6_EXC_HOPLIMIT,
358 0, skb->dev); 358 0, skb->dev);
359 IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
359 360
360 kfree_skb(skb); 361 kfree_skb(skb);
361 return -ETIMEDOUT; 362 return -ETIMEDOUT;
@@ -595,6 +596,9 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
595 } 596 }
596 597
597 err = output(skb); 598 err = output(skb);
599 if(!err)
600 IP6_INC_STATS(IPSTATS_MIB_FRAGCREATES);
601
598 if (err || !frag) 602 if (err || !frag)
599 break; 603 break;
600 604
@@ -706,12 +710,11 @@ slow_path:
706 /* 710 /*
707 * Put this fragment into the sending queue. 711 * Put this fragment into the sending queue.
708 */ 712 */
709
710 IP6_INC_STATS(IPSTATS_MIB_FRAGCREATES);
711
712 err = output(frag); 713 err = output(frag);
713 if (err) 714 if (err)
714 goto fail; 715 goto fail;
716
717 IP6_INC_STATS(IPSTATS_MIB_FRAGCREATES);
715 } 718 }
716 kfree_skb(skb); 719 kfree_skb(skb);
717 IP6_INC_STATS(IPSTATS_MIB_FRAGOKS); 720 IP6_INC_STATS(IPSTATS_MIB_FRAGOKS);
@@ -723,48 +726,51 @@ fail:
723 return err; 726 return err;
724} 727}
725 728
726int ip6_dst_lookup(struct sock *sk, struct dst_entry **dst, struct flowi *fl) 729static struct dst_entry *ip6_sk_dst_check(struct sock *sk,
730 struct dst_entry *dst,
731 struct flowi *fl)
727{ 732{
728 int err = 0; 733 struct ipv6_pinfo *np = inet6_sk(sk);
734 struct rt6_info *rt = (struct rt6_info *)dst;
729 735
730 *dst = NULL; 736 if (!dst)
731 if (sk) { 737 goto out;
732 struct ipv6_pinfo *np = inet6_sk(sk); 738
733 739 /* Yes, checking route validity in not connected
734 *dst = sk_dst_check(sk, np->dst_cookie); 740 * case is not very simple. Take into account,
735 if (*dst) { 741 * that we do not support routing by source, TOS,
736 struct rt6_info *rt = (struct rt6_info*)*dst; 742 * and MSG_DONTROUTE --ANK (980726)
737 743 *
738 /* Yes, checking route validity in not connected 744 * 1. If route was host route, check that
739 * case is not very simple. Take into account, 745 * cached destination is current.
740 * that we do not support routing by source, TOS, 746 * If it is network route, we still may
741 * and MSG_DONTROUTE --ANK (980726) 747 * check its validity using saved pointer
742 * 748 * to the last used address: daddr_cache.
743 * 1. If route was host route, check that 749 * We do not want to save whole address now,
744 * cached destination is current. 750 * (because main consumer of this service
745 * If it is network route, we still may 751 * is tcp, which has not this problem),
746 * check its validity using saved pointer 752 * so that the last trick works only on connected
747 * to the last used address: daddr_cache. 753 * sockets.
748 * We do not want to save whole address now, 754 * 2. oif also should be the same.
749 * (because main consumer of this service 755 */
750 * is tcp, which has not this problem), 756 if (((rt->rt6i_dst.plen != 128 ||
751 * so that the last trick works only on connected 757 !ipv6_addr_equal(&fl->fl6_dst, &rt->rt6i_dst.addr))
752 * sockets. 758 && (np->daddr_cache == NULL ||
753 * 2. oif also should be the same. 759 !ipv6_addr_equal(&fl->fl6_dst, np->daddr_cache)))
754 */ 760 || (fl->oif && fl->oif != dst->dev->ifindex)) {
755 if (((rt->rt6i_dst.plen != 128 || 761 dst_release(dst);
756 !ipv6_addr_equal(&fl->fl6_dst, 762 dst = NULL;
757 &rt->rt6i_dst.addr))
758 && (np->daddr_cache == NULL ||
759 !ipv6_addr_equal(&fl->fl6_dst,
760 np->daddr_cache)))
761 || (fl->oif && fl->oif != (*dst)->dev->ifindex)) {
762 dst_release(*dst);
763 *dst = NULL;
764 }
765 }
766 } 763 }
767 764
765out:
766 return dst;
767}
768
769static int ip6_dst_lookup_tail(struct sock *sk,
770 struct dst_entry **dst, struct flowi *fl)
771{
772 int err;
773
768 if (*dst == NULL) 774 if (*dst == NULL)
769 *dst = ip6_route_output(sk, fl); 775 *dst = ip6_route_output(sk, fl);
770 776
@@ -773,7 +779,6 @@ int ip6_dst_lookup(struct sock *sk, struct dst_entry **dst, struct flowi *fl)
773 779
774 if (ipv6_addr_any(&fl->fl6_src)) { 780 if (ipv6_addr_any(&fl->fl6_src)) {
775 err = ipv6_get_saddr(*dst, &fl->fl6_dst, &fl->fl6_src); 781 err = ipv6_get_saddr(*dst, &fl->fl6_dst, &fl->fl6_src);
776
777 if (err) 782 if (err)
778 goto out_err_release; 783 goto out_err_release;
779 } 784 }
@@ -786,8 +791,48 @@ out_err_release:
786 return err; 791 return err;
787} 792}
788 793
794/**
795 * ip6_dst_lookup - perform route lookup on flow
796 * @sk: socket which provides route info
797 * @dst: pointer to dst_entry * for result
798 * @fl: flow to lookup
799 *
800 * This function performs a route lookup on the given flow.
801 *
802 * It returns zero on success, or a standard errno code on error.
803 */
804int ip6_dst_lookup(struct sock *sk, struct dst_entry **dst, struct flowi *fl)
805{
806 *dst = NULL;
807 return ip6_dst_lookup_tail(sk, dst, fl);
808}
789EXPORT_SYMBOL_GPL(ip6_dst_lookup); 809EXPORT_SYMBOL_GPL(ip6_dst_lookup);
790 810
811/**
812 * ip6_sk_dst_lookup - perform socket cached route lookup on flow
813 * @sk: socket which provides the dst cache and route info
814 * @dst: pointer to dst_entry * for result
815 * @fl: flow to lookup
816 *
817 * This function performs a route lookup on the given flow with the
818 * possibility of using the cached route in the socket if it is valid.
819 * It will take the socket dst lock when operating on the dst cache.
820 * As a result, this function can only be used in process context.
821 *
822 * It returns zero on success, or a standard errno code on error.
823 */
824int ip6_sk_dst_lookup(struct sock *sk, struct dst_entry **dst, struct flowi *fl)
825{
826 *dst = NULL;
827 if (sk) {
828 *dst = sk_dst_check(sk, inet6_sk(sk)->dst_cookie);
829 *dst = ip6_sk_dst_check(sk, *dst, fl);
830 }
831
832 return ip6_dst_lookup_tail(sk, dst, fl);
833}
834EXPORT_SYMBOL_GPL(ip6_sk_dst_lookup);
835
791static inline int ip6_ufo_append_data(struct sock *sk, 836static inline int ip6_ufo_append_data(struct sock *sk,
792 int getfrag(void *from, char *to, int offset, int len, 837 int getfrag(void *from, char *to, int offset, int len,
793 int odd, struct sk_buff *skb), 838 int odd, struct sk_buff *skb),
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index bc77c0e1a943..84d7ebdb9d21 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -567,10 +567,9 @@ static inline struct ipv6_txoptions *create_tel(__u8 encap_limit)
567 567
568 int opt_len = sizeof(*opt) + 8; 568 int opt_len = sizeof(*opt) + 8;
569 569
570 if (!(opt = kmalloc(opt_len, GFP_ATOMIC))) { 570 if (!(opt = kzalloc(opt_len, GFP_ATOMIC))) {
571 return NULL; 571 return NULL;
572 } 572 }
573 memset(opt, 0, opt_len);
574 opt->tot_len = opt_len; 573 opt->tot_len = opt_len;
575 opt->dst0opt = (struct ipv6_opt_hdr *) (opt + 1); 574 opt->dst0opt = (struct ipv6_opt_hdr *) (opt + 1);
576 opt->opt_nflen = 8; 575 opt->opt_nflen = 8;
diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c
index b285b0357084..7e4d1c17bfbc 100644
--- a/net/ipv6/ipcomp6.c
+++ b/net/ipv6/ipcomp6.c
@@ -109,7 +109,8 @@ static int ipcomp6_input(struct xfrm_state *x, struct sk_buff *skb)
109 goto out_put_cpu; 109 goto out_put_cpu;
110 } 110 }
111 111
112 skb_put(skb, dlen - plen); 112 skb->truesize += dlen - plen;
113 __skb_put(skb, dlen - plen);
113 memcpy(skb->data, scratch, dlen); 114 memcpy(skb->data, scratch, dlen);
114 err = ipch->nexthdr; 115 err = ipch->nexthdr;
115 116
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index 0c17dec11c8d..43327264e69c 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -57,29 +57,11 @@
57 57
58DEFINE_SNMP_STAT(struct ipstats_mib, ipv6_statistics) __read_mostly; 58DEFINE_SNMP_STAT(struct ipstats_mib, ipv6_statistics) __read_mostly;
59 59
60static struct sk_buff *ipv6_gso_segment(struct sk_buff *skb, int features) 60static struct inet6_protocol *ipv6_gso_pull_exthdrs(struct sk_buff *skb,
61 int proto)
61{ 62{
62 struct sk_buff *segs = ERR_PTR(-EINVAL); 63 struct inet6_protocol *ops = NULL;
63 struct ipv6hdr *ipv6h;
64 struct inet6_protocol *ops;
65 int proto;
66 64
67 if (unlikely(skb_shinfo(skb)->gso_type &
68 ~(SKB_GSO_UDP |
69 SKB_GSO_DODGY |
70 SKB_GSO_TCP_ECN |
71 SKB_GSO_TCPV6 |
72 0)))
73 goto out;
74
75 if (unlikely(!pskb_may_pull(skb, sizeof(*ipv6h))))
76 goto out;
77
78 ipv6h = skb->nh.ipv6h;
79 proto = ipv6h->nexthdr;
80 __skb_pull(skb, sizeof(*ipv6h));
81
82 rcu_read_lock();
83 for (;;) { 65 for (;;) {
84 struct ipv6_opt_hdr *opth; 66 struct ipv6_opt_hdr *opth;
85 int len; 67 int len;
@@ -88,30 +70,80 @@ static struct sk_buff *ipv6_gso_segment(struct sk_buff *skb, int features)
88 ops = rcu_dereference(inet6_protos[proto]); 70 ops = rcu_dereference(inet6_protos[proto]);
89 71
90 if (unlikely(!ops)) 72 if (unlikely(!ops))
91 goto unlock; 73 break;
92 74
93 if (!(ops->flags & INET6_PROTO_GSO_EXTHDR)) 75 if (!(ops->flags & INET6_PROTO_GSO_EXTHDR))
94 break; 76 break;
95 } 77 }
96 78
97 if (unlikely(!pskb_may_pull(skb, 8))) 79 if (unlikely(!pskb_may_pull(skb, 8)))
98 goto unlock; 80 break;
99 81
100 opth = (void *)skb->data; 82 opth = (void *)skb->data;
101 len = opth->hdrlen * 8 + 8; 83 len = opth->hdrlen * 8 + 8;
102 84
103 if (unlikely(!pskb_may_pull(skb, len))) 85 if (unlikely(!pskb_may_pull(skb, len)))
104 goto unlock; 86 break;
105 87
106 proto = opth->nexthdr; 88 proto = opth->nexthdr;
107 __skb_pull(skb, len); 89 __skb_pull(skb, len);
108 } 90 }
109 91
110 skb->h.raw = skb->data; 92 return ops;
111 if (likely(ops->gso_segment)) 93}
112 segs = ops->gso_segment(skb, features); 94
95static int ipv6_gso_send_check(struct sk_buff *skb)
96{
97 struct ipv6hdr *ipv6h;
98 struct inet6_protocol *ops;
99 int err = -EINVAL;
100
101 if (unlikely(!pskb_may_pull(skb, sizeof(*ipv6h))))
102 goto out;
113 103
114unlock: 104 ipv6h = skb->nh.ipv6h;
105 __skb_pull(skb, sizeof(*ipv6h));
106 err = -EPROTONOSUPPORT;
107
108 rcu_read_lock();
109 ops = ipv6_gso_pull_exthdrs(skb, ipv6h->nexthdr);
110 if (likely(ops && ops->gso_send_check)) {
111 skb->h.raw = skb->data;
112 err = ops->gso_send_check(skb);
113 }
114 rcu_read_unlock();
115
116out:
117 return err;
118}
119
120static struct sk_buff *ipv6_gso_segment(struct sk_buff *skb, int features)
121{
122 struct sk_buff *segs = ERR_PTR(-EINVAL);
123 struct ipv6hdr *ipv6h;
124 struct inet6_protocol *ops;
125
126 if (unlikely(skb_shinfo(skb)->gso_type &
127 ~(SKB_GSO_UDP |
128 SKB_GSO_DODGY |
129 SKB_GSO_TCP_ECN |
130 SKB_GSO_TCPV6 |
131 0)))
132 goto out;
133
134 if (unlikely(!pskb_may_pull(skb, sizeof(*ipv6h))))
135 goto out;
136
137 ipv6h = skb->nh.ipv6h;
138 __skb_pull(skb, sizeof(*ipv6h));
139 segs = ERR_PTR(-EPROTONOSUPPORT);
140
141 rcu_read_lock();
142 ops = ipv6_gso_pull_exthdrs(skb, ipv6h->nexthdr);
143 if (likely(ops && ops->gso_segment)) {
144 skb->h.raw = skb->data;
145 segs = ops->gso_segment(skb, features);
146 }
115 rcu_read_unlock(); 147 rcu_read_unlock();
116 148
117 if (unlikely(IS_ERR(segs))) 149 if (unlikely(IS_ERR(segs)))
@@ -130,6 +162,7 @@ out:
130static struct packet_type ipv6_packet_type = { 162static struct packet_type ipv6_packet_type = {
131 .type = __constant_htons(ETH_P_IPV6), 163 .type = __constant_htons(ETH_P_IPV6),
132 .func = ipv6_rcv, 164 .func = ipv6_rcv,
165 .gso_send_check = ipv6_gso_send_check,
133 .gso_segment = ipv6_gso_segment, 166 .gso_segment = ipv6_gso_segment,
134}; 167};
135 168
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index fa1ce0ae123e..d57e61ce4a7d 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -411,6 +411,7 @@ static int rawv6_recvmsg(struct kiocb *iocb, struct sock *sk,
411 /* Copy the address. */ 411 /* Copy the address. */
412 if (sin6) { 412 if (sin6) {
413 sin6->sin6_family = AF_INET6; 413 sin6->sin6_family = AF_INET6;
414 sin6->sin6_port = 0;
414 ipv6_addr_copy(&sin6->sin6_addr, &skb->nh.ipv6h->saddr); 415 ipv6_addr_copy(&sin6->sin6_addr, &skb->nh.ipv6h->saddr);
415 sin6->sin6_flowinfo = 0; 416 sin6->sin6_flowinfo = 0;
416 sin6->sin6_scope_id = 0; 417 sin6->sin6_scope_id = 0;
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 87c39c978cd0..4b163711f3a8 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -53,6 +53,7 @@
53#include <linux/rtnetlink.h> 53#include <linux/rtnetlink.h>
54#include <net/dst.h> 54#include <net/dst.h>
55#include <net/xfrm.h> 55#include <net/xfrm.h>
56#include <net/netevent.h>
56 57
57#include <asm/uaccess.h> 58#include <asm/uaccess.h>
58 59
@@ -742,6 +743,7 @@ static void ip6_rt_update_pmtu(struct dst_entry *dst, u32 mtu)
742 dst->metrics[RTAX_FEATURES-1] |= RTAX_FEATURE_ALLFRAG; 743 dst->metrics[RTAX_FEATURES-1] |= RTAX_FEATURE_ALLFRAG;
743 } 744 }
744 dst->metrics[RTAX_MTU-1] = mtu; 745 dst->metrics[RTAX_MTU-1] = mtu;
746 call_netevent_notifiers(NETEVENT_PMTU_UPDATE, dst);
745 } 747 }
746} 748}
747 749
@@ -1155,6 +1157,7 @@ void rt6_redirect(struct in6_addr *dest, struct in6_addr *saddr,
1155 struct rt6_info *rt, *nrt = NULL; 1157 struct rt6_info *rt, *nrt = NULL;
1156 int strict; 1158 int strict;
1157 struct fib6_node *fn; 1159 struct fib6_node *fn;
1160 struct netevent_redirect netevent;
1158 1161
1159 /* 1162 /*
1160 * Get the "current" route for this destination and 1163 * Get the "current" route for this destination and
@@ -1252,6 +1255,10 @@ restart:
1252 if (ip6_ins_rt(nrt, NULL, NULL, NULL)) 1255 if (ip6_ins_rt(nrt, NULL, NULL, NULL))
1253 goto out; 1256 goto out;
1254 1257
1258 netevent.old = &rt->u.dst;
1259 netevent.new = &nrt->u.dst;
1260 call_netevent_notifiers(NETEVENT_REDIRECT, &netevent);
1261
1255 if (rt->rt6i_flags&RTF_CACHE) { 1262 if (rt->rt6i_flags&RTF_CACHE) {
1256 ip6_del_rt(rt, NULL, NULL, NULL); 1263 ip6_del_rt(rt, NULL, NULL, NULL);
1257 return; 1264 return;
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index c56aeece2bf5..836eecd7e62b 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -380,7 +380,6 @@ static int ipip6_rcv(struct sk_buff *skb)
380 secpath_reset(skb); 380 secpath_reset(skb);
381 skb->mac.raw = skb->nh.raw; 381 skb->mac.raw = skb->nh.raw;
382 skb->nh.raw = skb->data; 382 skb->nh.raw = skb->data;
383 memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options));
384 IPCB(skb)->flags = 0; 383 IPCB(skb)->flags = 0;
385 skb->protocol = htons(ETH_P_IPV6); 384 skb->protocol = htons(ETH_P_IPV6);
386 skb->pkt_type = PACKET_HOST; 385 skb->pkt_type = PACKET_HOST;
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 5bdcb9002cf7..b843a650be71 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -270,7 +270,7 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
270 inet->rcv_saddr = LOOPBACK4_IPV6; 270 inet->rcv_saddr = LOOPBACK4_IPV6;
271 271
272 sk->sk_gso_type = SKB_GSO_TCPV6; 272 sk->sk_gso_type = SKB_GSO_TCPV6;
273 ip6_dst_store(sk, dst, NULL); 273 __ip6_dst_store(sk, dst, NULL);
274 274
275 icsk->icsk_ext_hdr_len = 0; 275 icsk->icsk_ext_hdr_len = 0;
276 if (np->opt) 276 if (np->opt)
@@ -427,7 +427,6 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
427 case TCP_SYN_RECV: /* Cannot happen. 427 case TCP_SYN_RECV: /* Cannot happen.
428 It can, it SYNs are crossed. --ANK */ 428 It can, it SYNs are crossed. --ANK */
429 if (!sock_owned_by_user(sk)) { 429 if (!sock_owned_by_user(sk)) {
430 TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS);
431 sk->sk_err = err; 430 sk->sk_err = err;
432 sk->sk_error_report(sk); /* Wake people up to see the error (see connect in sock.c) */ 431 sk->sk_error_report(sk); /* Wake people up to see the error (see connect in sock.c) */
433 432
@@ -552,6 +551,24 @@ static void tcp_v6_send_check(struct sock *sk, int len, struct sk_buff *skb)
552 } 551 }
553} 552}
554 553
554static int tcp_v6_gso_send_check(struct sk_buff *skb)
555{
556 struct ipv6hdr *ipv6h;
557 struct tcphdr *th;
558
559 if (!pskb_may_pull(skb, sizeof(*th)))
560 return -EINVAL;
561
562 ipv6h = skb->nh.ipv6h;
563 th = skb->h.th;
564
565 th->check = 0;
566 th->check = ~csum_ipv6_magic(&ipv6h->saddr, &ipv6h->daddr, skb->len,
567 IPPROTO_TCP, 0);
568 skb->csum = offsetof(struct tcphdr, check);
569 skb->ip_summed = CHECKSUM_HW;
570 return 0;
571}
555 572
556static void tcp_v6_send_reset(struct sk_buff *skb) 573static void tcp_v6_send_reset(struct sk_buff *skb)
557{ 574{
@@ -813,7 +830,6 @@ drop:
813 if (req) 830 if (req)
814 reqsk_free(req); 831 reqsk_free(req);
815 832
816 TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS);
817 return 0; /* don't send reset */ 833 return 0; /* don't send reset */
818} 834}
819 835
@@ -929,7 +945,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
929 */ 945 */
930 946
931 sk->sk_gso_type = SKB_GSO_TCPV6; 947 sk->sk_gso_type = SKB_GSO_TCPV6;
932 ip6_dst_store(newsk, dst, NULL); 948 __ip6_dst_store(newsk, dst, NULL);
933 949
934 newtcp6sk = (struct tcp6_sock *)newsk; 950 newtcp6sk = (struct tcp6_sock *)newsk;
935 inet_sk(newsk)->pinet6 = &newtcp6sk->inet6; 951 inet_sk(newsk)->pinet6 = &newtcp6sk->inet6;
@@ -1603,6 +1619,7 @@ struct proto tcpv6_prot = {
1603static struct inet6_protocol tcpv6_protocol = { 1619static struct inet6_protocol tcpv6_protocol = {
1604 .handler = tcp_v6_rcv, 1620 .handler = tcp_v6_rcv,
1605 .err_handler = tcp_v6_err, 1621 .err_handler = tcp_v6_err,
1622 .gso_send_check = tcp_v6_gso_send_check,
1606 .gso_segment = tcp_tso_segment, 1623 .gso_segment = tcp_tso_segment,
1607 .flags = INET6_PROTO_NOPOLICY|INET6_PROTO_FINAL, 1624 .flags = INET6_PROTO_NOPOLICY|INET6_PROTO_FINAL,
1608}; 1625};
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index ccc57f434cd3..3d54f246411e 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -782,7 +782,7 @@ do_udp_sendmsg:
782 connected = 0; 782 connected = 0;
783 } 783 }
784 784
785 err = ip6_dst_lookup(sk, &dst, fl); 785 err = ip6_sk_dst_lookup(sk, &dst, fl);
786 if (err) 786 if (err)
787 goto out; 787 goto out;
788 if (final_p) 788 if (final_p)
diff --git a/net/ipv6/xfrm6_output.c b/net/ipv6/xfrm6_output.c
index 48fccb1eca08..c8c8b44a0f58 100644
--- a/net/ipv6/xfrm6_output.c
+++ b/net/ipv6/xfrm6_output.c
@@ -122,10 +122,10 @@ static int xfrm6_output_finish(struct sk_buff *skb)
122{ 122{
123 struct sk_buff *segs; 123 struct sk_buff *segs;
124 124
125 if (!skb_shinfo(skb)->gso_size) 125 if (!skb_is_gso(skb))
126 return xfrm6_output_finish2(skb); 126 return xfrm6_output_finish2(skb);
127 127
128 skb->protocol = htons(ETH_P_IP); 128 skb->protocol = htons(ETH_P_IPV6);
129 segs = skb_gso_segment(skb, 0); 129 segs = skb_gso_segment(skb, 0);
130 kfree_skb(skb); 130 kfree_skb(skb);
131 if (unlikely(IS_ERR(segs))) 131 if (unlikely(IS_ERR(segs)))
diff --git a/net/ipv6/xfrm6_tunnel.c b/net/ipv6/xfrm6_tunnel.c
index 6b44fe8516c3..c8f9369c2a87 100644
--- a/net/ipv6/xfrm6_tunnel.c
+++ b/net/ipv6/xfrm6_tunnel.c
@@ -31,27 +31,6 @@
31#include <linux/icmpv6.h> 31#include <linux/icmpv6.h>
32#include <linux/mutex.h> 32#include <linux/mutex.h>
33 33
34#ifdef CONFIG_IPV6_XFRM6_TUNNEL_DEBUG
35# define X6TDEBUG 3
36#else
37# define X6TDEBUG 1
38#endif
39
40#define X6TPRINTK(fmt, args...) printk(fmt, ## args)
41#define X6TNOPRINTK(fmt, args...) do { ; } while(0)
42
43#if X6TDEBUG >= 1
44# define X6TPRINTK1 X6TPRINTK
45#else
46# define X6TPRINTK1 X6TNOPRINTK
47#endif
48
49#if X6TDEBUG >= 3
50# define X6TPRINTK3 X6TPRINTK
51#else
52# define X6TPRINTK3 X6TNOPRINTK
53#endif
54
55/* 34/*
56 * xfrm_tunnel_spi things are for allocating unique id ("spi") 35 * xfrm_tunnel_spi things are for allocating unique id ("spi")
57 * per xfrm_address_t. 36 * per xfrm_address_t.
@@ -62,15 +41,8 @@ struct xfrm6_tunnel_spi {
62 xfrm_address_t addr; 41 xfrm_address_t addr;
63 u32 spi; 42 u32 spi;
64 atomic_t refcnt; 43 atomic_t refcnt;
65#ifdef XFRM6_TUNNEL_SPI_MAGIC
66 u32 magic;
67#endif
68}; 44};
69 45
70#ifdef CONFIG_IPV6_XFRM6_TUNNEL_DEBUG
71# define XFRM6_TUNNEL_SPI_MAGIC 0xdeadbeef
72#endif
73
74static DEFINE_RWLOCK(xfrm6_tunnel_spi_lock); 46static DEFINE_RWLOCK(xfrm6_tunnel_spi_lock);
75 47
76static u32 xfrm6_tunnel_spi; 48static u32 xfrm6_tunnel_spi;
@@ -86,43 +58,15 @@ static kmem_cache_t *xfrm6_tunnel_spi_kmem __read_mostly;
86static struct hlist_head xfrm6_tunnel_spi_byaddr[XFRM6_TUNNEL_SPI_BYADDR_HSIZE]; 58static struct hlist_head xfrm6_tunnel_spi_byaddr[XFRM6_TUNNEL_SPI_BYADDR_HSIZE];
87static struct hlist_head xfrm6_tunnel_spi_byspi[XFRM6_TUNNEL_SPI_BYSPI_HSIZE]; 59static struct hlist_head xfrm6_tunnel_spi_byspi[XFRM6_TUNNEL_SPI_BYSPI_HSIZE];
88 60
89#ifdef XFRM6_TUNNEL_SPI_MAGIC
90static int x6spi_check_magic(const struct xfrm6_tunnel_spi *x6spi,
91 const char *name)
92{
93 if (unlikely(x6spi->magic != XFRM6_TUNNEL_SPI_MAGIC)) {
94 X6TPRINTK3(KERN_DEBUG "%s(): x6spi object "
95 "at %p has corrupted magic %08x "
96 "(should be %08x)\n",
97 name, x6spi, x6spi->magic, XFRM6_TUNNEL_SPI_MAGIC);
98 return -1;
99 }
100 return 0;
101}
102#else
103static int inline x6spi_check_magic(const struct xfrm6_tunnel_spi *x6spi,
104 const char *name)
105{
106 return 0;
107}
108#endif
109
110#define X6SPI_CHECK_MAGIC(x6spi) x6spi_check_magic((x6spi), __FUNCTION__)
111
112
113static unsigned inline xfrm6_tunnel_spi_hash_byaddr(xfrm_address_t *addr) 61static unsigned inline xfrm6_tunnel_spi_hash_byaddr(xfrm_address_t *addr)
114{ 62{
115 unsigned h; 63 unsigned h;
116 64
117 X6TPRINTK3(KERN_DEBUG "%s(addr=%p)\n", __FUNCTION__, addr);
118
119 h = addr->a6[0] ^ addr->a6[1] ^ addr->a6[2] ^ addr->a6[3]; 65 h = addr->a6[0] ^ addr->a6[1] ^ addr->a6[2] ^ addr->a6[3];
120 h ^= h >> 16; 66 h ^= h >> 16;
121 h ^= h >> 8; 67 h ^= h >> 8;
122 h &= XFRM6_TUNNEL_SPI_BYADDR_HSIZE - 1; 68 h &= XFRM6_TUNNEL_SPI_BYADDR_HSIZE - 1;
123 69
124 X6TPRINTK3(KERN_DEBUG "%s() = %u\n", __FUNCTION__, h);
125
126 return h; 70 return h;
127} 71}
128 72
@@ -136,19 +80,13 @@ static int xfrm6_tunnel_spi_init(void)
136{ 80{
137 int i; 81 int i;
138 82
139 X6TPRINTK3(KERN_DEBUG "%s()\n", __FUNCTION__);
140
141 xfrm6_tunnel_spi = 0; 83 xfrm6_tunnel_spi = 0;
142 xfrm6_tunnel_spi_kmem = kmem_cache_create("xfrm6_tunnel_spi", 84 xfrm6_tunnel_spi_kmem = kmem_cache_create("xfrm6_tunnel_spi",
143 sizeof(struct xfrm6_tunnel_spi), 85 sizeof(struct xfrm6_tunnel_spi),
144 0, SLAB_HWCACHE_ALIGN, 86 0, SLAB_HWCACHE_ALIGN,
145 NULL, NULL); 87 NULL, NULL);
146 if (!xfrm6_tunnel_spi_kmem) { 88 if (!xfrm6_tunnel_spi_kmem)
147 X6TPRINTK1(KERN_ERR
148 "%s(): failed to allocate xfrm6_tunnel_spi_kmem\n",
149 __FUNCTION__);
150 return -ENOMEM; 89 return -ENOMEM;
151 }
152 90
153 for (i = 0; i < XFRM6_TUNNEL_SPI_BYADDR_HSIZE; i++) 91 for (i = 0; i < XFRM6_TUNNEL_SPI_BYADDR_HSIZE; i++)
154 INIT_HLIST_HEAD(&xfrm6_tunnel_spi_byaddr[i]); 92 INIT_HLIST_HEAD(&xfrm6_tunnel_spi_byaddr[i]);
@@ -161,22 +99,16 @@ static void xfrm6_tunnel_spi_fini(void)
161{ 99{
162 int i; 100 int i;
163 101
164 X6TPRINTK3(KERN_DEBUG "%s()\n", __FUNCTION__);
165
166 for (i = 0; i < XFRM6_TUNNEL_SPI_BYADDR_HSIZE; i++) { 102 for (i = 0; i < XFRM6_TUNNEL_SPI_BYADDR_HSIZE; i++) {
167 if (!hlist_empty(&xfrm6_tunnel_spi_byaddr[i])) 103 if (!hlist_empty(&xfrm6_tunnel_spi_byaddr[i]))
168 goto err; 104 return;
169 } 105 }
170 for (i = 0; i < XFRM6_TUNNEL_SPI_BYSPI_HSIZE; i++) { 106 for (i = 0; i < XFRM6_TUNNEL_SPI_BYSPI_HSIZE; i++) {
171 if (!hlist_empty(&xfrm6_tunnel_spi_byspi[i])) 107 if (!hlist_empty(&xfrm6_tunnel_spi_byspi[i]))
172 goto err; 108 return;
173 } 109 }
174 kmem_cache_destroy(xfrm6_tunnel_spi_kmem); 110 kmem_cache_destroy(xfrm6_tunnel_spi_kmem);
175 xfrm6_tunnel_spi_kmem = NULL; 111 xfrm6_tunnel_spi_kmem = NULL;
176 return;
177err:
178 X6TPRINTK1(KERN_ERR "%s(): table is not empty\n", __FUNCTION__);
179 return;
180} 112}
181 113
182static struct xfrm6_tunnel_spi *__xfrm6_tunnel_spi_lookup(xfrm_address_t *saddr) 114static struct xfrm6_tunnel_spi *__xfrm6_tunnel_spi_lookup(xfrm_address_t *saddr)
@@ -184,19 +116,13 @@ static struct xfrm6_tunnel_spi *__xfrm6_tunnel_spi_lookup(xfrm_address_t *saddr)
184 struct xfrm6_tunnel_spi *x6spi; 116 struct xfrm6_tunnel_spi *x6spi;
185 struct hlist_node *pos; 117 struct hlist_node *pos;
186 118
187 X6TPRINTK3(KERN_DEBUG "%s(saddr=%p)\n", __FUNCTION__, saddr);
188
189 hlist_for_each_entry(x6spi, pos, 119 hlist_for_each_entry(x6spi, pos,
190 &xfrm6_tunnel_spi_byaddr[xfrm6_tunnel_spi_hash_byaddr(saddr)], 120 &xfrm6_tunnel_spi_byaddr[xfrm6_tunnel_spi_hash_byaddr(saddr)],
191 list_byaddr) { 121 list_byaddr) {
192 if (memcmp(&x6spi->addr, saddr, sizeof(x6spi->addr)) == 0) { 122 if (memcmp(&x6spi->addr, saddr, sizeof(x6spi->addr)) == 0)
193 X6SPI_CHECK_MAGIC(x6spi);
194 X6TPRINTK3(KERN_DEBUG "%s() = %p(%u)\n", __FUNCTION__, x6spi, x6spi->spi);
195 return x6spi; 123 return x6spi;
196 }
197 } 124 }
198 125
199 X6TPRINTK3(KERN_DEBUG "%s() = NULL(0)\n", __FUNCTION__);
200 return NULL; 126 return NULL;
201} 127}
202 128
@@ -205,8 +131,6 @@ u32 xfrm6_tunnel_spi_lookup(xfrm_address_t *saddr)
205 struct xfrm6_tunnel_spi *x6spi; 131 struct xfrm6_tunnel_spi *x6spi;
206 u32 spi; 132 u32 spi;
207 133
208 X6TPRINTK3(KERN_DEBUG "%s(saddr=%p)\n", __FUNCTION__, saddr);
209
210 read_lock_bh(&xfrm6_tunnel_spi_lock); 134 read_lock_bh(&xfrm6_tunnel_spi_lock);
211 x6spi = __xfrm6_tunnel_spi_lookup(saddr); 135 x6spi = __xfrm6_tunnel_spi_lookup(saddr);
212 spi = x6spi ? x6spi->spi : 0; 136 spi = x6spi ? x6spi->spi : 0;
@@ -223,8 +147,6 @@ static u32 __xfrm6_tunnel_alloc_spi(xfrm_address_t *saddr)
223 struct hlist_node *pos; 147 struct hlist_node *pos;
224 unsigned index; 148 unsigned index;
225 149
226 X6TPRINTK3(KERN_DEBUG "%s(saddr=%p)\n", __FUNCTION__, saddr);
227
228 if (xfrm6_tunnel_spi < XFRM6_TUNNEL_SPI_MIN || 150 if (xfrm6_tunnel_spi < XFRM6_TUNNEL_SPI_MIN ||
229 xfrm6_tunnel_spi >= XFRM6_TUNNEL_SPI_MAX) 151 xfrm6_tunnel_spi >= XFRM6_TUNNEL_SPI_MAX)
230 xfrm6_tunnel_spi = XFRM6_TUNNEL_SPI_MIN; 152 xfrm6_tunnel_spi = XFRM6_TUNNEL_SPI_MIN;
@@ -258,18 +180,10 @@ try_next_2:;
258 spi = 0; 180 spi = 0;
259 goto out; 181 goto out;
260alloc_spi: 182alloc_spi:
261 X6TPRINTK3(KERN_DEBUG "%s(): allocate new spi for " NIP6_FMT "\n",
262 __FUNCTION__,
263 NIP6(*(struct in6_addr *)saddr));
264 x6spi = kmem_cache_alloc(xfrm6_tunnel_spi_kmem, SLAB_ATOMIC); 183 x6spi = kmem_cache_alloc(xfrm6_tunnel_spi_kmem, SLAB_ATOMIC);
265 if (!x6spi) { 184 if (!x6spi)
266 X6TPRINTK1(KERN_ERR "%s(): kmem_cache_alloc() failed\n",
267 __FUNCTION__);
268 goto out; 185 goto out;
269 } 186
270#ifdef XFRM6_TUNNEL_SPI_MAGIC
271 x6spi->magic = XFRM6_TUNNEL_SPI_MAGIC;
272#endif
273 memcpy(&x6spi->addr, saddr, sizeof(x6spi->addr)); 187 memcpy(&x6spi->addr, saddr, sizeof(x6spi->addr));
274 x6spi->spi = spi; 188 x6spi->spi = spi;
275 atomic_set(&x6spi->refcnt, 1); 189 atomic_set(&x6spi->refcnt, 1);
@@ -278,9 +192,7 @@ alloc_spi:
278 192
279 index = xfrm6_tunnel_spi_hash_byaddr(saddr); 193 index = xfrm6_tunnel_spi_hash_byaddr(saddr);
280 hlist_add_head(&x6spi->list_byaddr, &xfrm6_tunnel_spi_byaddr[index]); 194 hlist_add_head(&x6spi->list_byaddr, &xfrm6_tunnel_spi_byaddr[index]);
281 X6SPI_CHECK_MAGIC(x6spi);
282out: 195out:
283 X6TPRINTK3(KERN_DEBUG "%s() = %u\n", __FUNCTION__, spi);
284 return spi; 196 return spi;
285} 197}
286 198
@@ -289,8 +201,6 @@ u32 xfrm6_tunnel_alloc_spi(xfrm_address_t *saddr)
289 struct xfrm6_tunnel_spi *x6spi; 201 struct xfrm6_tunnel_spi *x6spi;
290 u32 spi; 202 u32 spi;
291 203
292 X6TPRINTK3(KERN_DEBUG "%s(saddr=%p)\n", __FUNCTION__, saddr);
293
294 write_lock_bh(&xfrm6_tunnel_spi_lock); 204 write_lock_bh(&xfrm6_tunnel_spi_lock);
295 x6spi = __xfrm6_tunnel_spi_lookup(saddr); 205 x6spi = __xfrm6_tunnel_spi_lookup(saddr);
296 if (x6spi) { 206 if (x6spi) {
@@ -300,8 +210,6 @@ u32 xfrm6_tunnel_alloc_spi(xfrm_address_t *saddr)
300 spi = __xfrm6_tunnel_alloc_spi(saddr); 210 spi = __xfrm6_tunnel_alloc_spi(saddr);
301 write_unlock_bh(&xfrm6_tunnel_spi_lock); 211 write_unlock_bh(&xfrm6_tunnel_spi_lock);
302 212
303 X6TPRINTK3(KERN_DEBUG "%s() = %u\n", __FUNCTION__, spi);
304
305 return spi; 213 return spi;
306} 214}
307 215
@@ -312,8 +220,6 @@ void xfrm6_tunnel_free_spi(xfrm_address_t *saddr)
312 struct xfrm6_tunnel_spi *x6spi; 220 struct xfrm6_tunnel_spi *x6spi;
313 struct hlist_node *pos, *n; 221 struct hlist_node *pos, *n;
314 222
315 X6TPRINTK3(KERN_DEBUG "%s(saddr=%p)\n", __FUNCTION__, saddr);
316
317 write_lock_bh(&xfrm6_tunnel_spi_lock); 223 write_lock_bh(&xfrm6_tunnel_spi_lock);
318 224
319 hlist_for_each_entry_safe(x6spi, pos, n, 225 hlist_for_each_entry_safe(x6spi, pos, n,
@@ -321,12 +227,6 @@ void xfrm6_tunnel_free_spi(xfrm_address_t *saddr)
321 list_byaddr) 227 list_byaddr)
322 { 228 {
323 if (memcmp(&x6spi->addr, saddr, sizeof(x6spi->addr)) == 0) { 229 if (memcmp(&x6spi->addr, saddr, sizeof(x6spi->addr)) == 0) {
324 X6TPRINTK3(KERN_DEBUG "%s(): x6spi object for " NIP6_FMT
325 " found at %p\n",
326 __FUNCTION__,
327 NIP6(*(struct in6_addr *)saddr),
328 x6spi);
329 X6SPI_CHECK_MAGIC(x6spi);
330 if (atomic_dec_and_test(&x6spi->refcnt)) { 230 if (atomic_dec_and_test(&x6spi->refcnt)) {
331 hlist_del(&x6spi->list_byaddr); 231 hlist_del(&x6spi->list_byaddr);
332 hlist_del(&x6spi->list_byspi); 232 hlist_del(&x6spi->list_byspi);
@@ -377,20 +277,14 @@ static int xfrm6_tunnel_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
377 case ICMPV6_ADDR_UNREACH: 277 case ICMPV6_ADDR_UNREACH:
378 case ICMPV6_PORT_UNREACH: 278 case ICMPV6_PORT_UNREACH:
379 default: 279 default:
380 X6TPRINTK3(KERN_DEBUG
381 "xfrm6_tunnel: Destination Unreach.\n");
382 break; 280 break;
383 } 281 }
384 break; 282 break;
385 case ICMPV6_PKT_TOOBIG: 283 case ICMPV6_PKT_TOOBIG:
386 X6TPRINTK3(KERN_DEBUG
387 "xfrm6_tunnel: Packet Too Big.\n");
388 break; 284 break;
389 case ICMPV6_TIME_EXCEED: 285 case ICMPV6_TIME_EXCEED:
390 switch (code) { 286 switch (code) {
391 case ICMPV6_EXC_HOPLIMIT: 287 case ICMPV6_EXC_HOPLIMIT:
392 X6TPRINTK3(KERN_DEBUG
393 "xfrm6_tunnel: Too small Hoplimit.\n");
394 break; 288 break;
395 case ICMPV6_EXC_FRAGTIME: 289 case ICMPV6_EXC_FRAGTIME:
396 default: 290 default:
@@ -447,22 +341,14 @@ static struct xfrm6_tunnel xfrm6_tunnel_handler = {
447 341
448static int __init xfrm6_tunnel_init(void) 342static int __init xfrm6_tunnel_init(void)
449{ 343{
450 X6TPRINTK3(KERN_DEBUG "%s()\n", __FUNCTION__); 344 if (xfrm_register_type(&xfrm6_tunnel_type, AF_INET6) < 0)
451
452 if (xfrm_register_type(&xfrm6_tunnel_type, AF_INET6) < 0) {
453 X6TPRINTK1(KERN_ERR
454 "xfrm6_tunnel init: can't add xfrm type\n");
455 return -EAGAIN; 345 return -EAGAIN;
456 } 346
457 if (xfrm6_tunnel_register(&xfrm6_tunnel_handler)) { 347 if (xfrm6_tunnel_register(&xfrm6_tunnel_handler)) {
458 X6TPRINTK1(KERN_ERR
459 "xfrm6_tunnel init(): can't add handler\n");
460 xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6); 348 xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6);
461 return -EAGAIN; 349 return -EAGAIN;
462 } 350 }
463 if (xfrm6_tunnel_spi_init() < 0) { 351 if (xfrm6_tunnel_spi_init() < 0) {
464 X6TPRINTK1(KERN_ERR
465 "xfrm6_tunnel init: failed to initialize spi\n");
466 xfrm6_tunnel_deregister(&xfrm6_tunnel_handler); 352 xfrm6_tunnel_deregister(&xfrm6_tunnel_handler);
467 xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6); 353 xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6);
468 return -EAGAIN; 354 return -EAGAIN;
@@ -472,15 +358,9 @@ static int __init xfrm6_tunnel_init(void)
472 358
473static void __exit xfrm6_tunnel_fini(void) 359static void __exit xfrm6_tunnel_fini(void)
474{ 360{
475 X6TPRINTK3(KERN_DEBUG "%s()\n", __FUNCTION__);
476
477 xfrm6_tunnel_spi_fini(); 361 xfrm6_tunnel_spi_fini();
478 if (xfrm6_tunnel_deregister(&xfrm6_tunnel_handler)) 362 xfrm6_tunnel_deregister(&xfrm6_tunnel_handler);
479 X6TPRINTK1(KERN_ERR 363 xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6);
480 "xfrm6_tunnel close: can't remove handler\n");
481 if (xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6) < 0)
482 X6TPRINTK1(KERN_ERR
483 "xfrm6_tunnel close: can't remove xfrm type\n");
484} 364}
485 365
486module_init(xfrm6_tunnel_init); 366module_init(xfrm6_tunnel_init);
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c
index 7fae48a53bff..17699eeb64d7 100644
--- a/net/irda/af_irda.c
+++ b/net/irda/af_irda.c
@@ -308,7 +308,7 @@ static void irda_connect_response(struct irda_sock *self)
308 308
309 IRDA_ASSERT(self != NULL, return;); 309 IRDA_ASSERT(self != NULL, return;);
310 310
311 skb = dev_alloc_skb(64); 311 skb = alloc_skb(64, GFP_ATOMIC);
312 if (skb == NULL) { 312 if (skb == NULL) {
313 IRDA_DEBUG(0, "%s() Unable to allocate sk_buff!\n", 313 IRDA_DEBUG(0, "%s() Unable to allocate sk_buff!\n",
314 __FUNCTION__); 314 __FUNCTION__);
diff --git a/net/irda/ircomm/ircomm_core.c b/net/irda/ircomm/ircomm_core.c
index 9c4a902a9dba..ad6b6af3dd97 100644
--- a/net/irda/ircomm/ircomm_core.c
+++ b/net/irda/ircomm/ircomm_core.c
@@ -115,12 +115,10 @@ struct ircomm_cb *ircomm_open(notify_t *notify, __u8 service_type, int line)
115 115
116 IRDA_ASSERT(ircomm != NULL, return NULL;); 116 IRDA_ASSERT(ircomm != NULL, return NULL;);
117 117
118 self = kmalloc(sizeof(struct ircomm_cb), GFP_ATOMIC); 118 self = kzalloc(sizeof(struct ircomm_cb), GFP_ATOMIC);
119 if (self == NULL) 119 if (self == NULL)
120 return NULL; 120 return NULL;
121 121
122 memset(self, 0, sizeof(struct ircomm_cb));
123
124 self->notify = *notify; 122 self->notify = *notify;
125 self->magic = IRCOMM_MAGIC; 123 self->magic = IRCOMM_MAGIC;
126 124
diff --git a/net/irda/ircomm/ircomm_lmp.c b/net/irda/ircomm/ircomm_lmp.c
index d9097207aed3..959874b6451f 100644
--- a/net/irda/ircomm/ircomm_lmp.c
+++ b/net/irda/ircomm/ircomm_lmp.c
@@ -81,7 +81,7 @@ static int ircomm_lmp_connect_response(struct ircomm_cb *self,
81 81
82 /* Any userdata supplied? */ 82 /* Any userdata supplied? */
83 if (userdata == NULL) { 83 if (userdata == NULL) {
84 tx_skb = dev_alloc_skb(64); 84 tx_skb = alloc_skb(64, GFP_ATOMIC);
85 if (!tx_skb) 85 if (!tx_skb)
86 return -ENOMEM; 86 return -ENOMEM;
87 87
@@ -115,7 +115,7 @@ static int ircomm_lmp_disconnect_request(struct ircomm_cb *self,
115 IRDA_DEBUG(0, "%s()\n", __FUNCTION__ ); 115 IRDA_DEBUG(0, "%s()\n", __FUNCTION__ );
116 116
117 if (!userdata) { 117 if (!userdata) {
118 tx_skb = dev_alloc_skb(64); 118 tx_skb = alloc_skb(64, GFP_ATOMIC);
119 if (!tx_skb) 119 if (!tx_skb)
120 return -ENOMEM; 120 return -ENOMEM;
121 121
diff --git a/net/irda/ircomm/ircomm_param.c b/net/irda/ircomm/ircomm_param.c
index 6009bab05091..a39f5735a90b 100644
--- a/net/irda/ircomm/ircomm_param.c
+++ b/net/irda/ircomm/ircomm_param.c
@@ -121,7 +121,7 @@ int ircomm_param_request(struct ircomm_tty_cb *self, __u8 pi, int flush)
121 121
122 skb = self->ctrl_skb; 122 skb = self->ctrl_skb;
123 if (!skb) { 123 if (!skb) {
124 skb = dev_alloc_skb(256); 124 skb = alloc_skb(256, GFP_ATOMIC);
125 if (!skb) { 125 if (!skb) {
126 spin_unlock_irqrestore(&self->spinlock, flags); 126 spin_unlock_irqrestore(&self->spinlock, flags);
127 return -ENOMEM; 127 return -ENOMEM;
diff --git a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c
index b400f27851fc..3bcdb467efc5 100644
--- a/net/irda/ircomm/ircomm_tty.c
+++ b/net/irda/ircomm/ircomm_tty.c
@@ -379,12 +379,11 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp)
379 self = hashbin_lock_find(ircomm_tty, line, NULL); 379 self = hashbin_lock_find(ircomm_tty, line, NULL);
380 if (!self) { 380 if (!self) {
381 /* No, so make new instance */ 381 /* No, so make new instance */
382 self = kmalloc(sizeof(struct ircomm_tty_cb), GFP_KERNEL); 382 self = kzalloc(sizeof(struct ircomm_tty_cb), GFP_KERNEL);
383 if (self == NULL) { 383 if (self == NULL) {
384 IRDA_ERROR("%s(), kmalloc failed!\n", __FUNCTION__); 384 IRDA_ERROR("%s(), kmalloc failed!\n", __FUNCTION__);
385 return -ENOMEM; 385 return -ENOMEM;
386 } 386 }
387 memset(self, 0, sizeof(struct ircomm_tty_cb));
388 387
389 self->magic = IRCOMM_TTY_MAGIC; 388 self->magic = IRCOMM_TTY_MAGIC;
390 self->flow = FLOW_STOP; 389 self->flow = FLOW_STOP;
@@ -759,8 +758,9 @@ static int ircomm_tty_write(struct tty_struct *tty,
759 } 758 }
760 } else { 759 } else {
761 /* Prepare a full sized frame */ 760 /* Prepare a full sized frame */
762 skb = dev_alloc_skb(self->max_data_size+ 761 skb = alloc_skb(self->max_data_size+
763 self->max_header_size); 762 self->max_header_size,
763 GFP_ATOMIC);
764 if (!skb) { 764 if (!skb) {
765 spin_unlock_irqrestore(&self->spinlock, flags); 765 spin_unlock_irqrestore(&self->spinlock, flags);
766 return -ENOBUFS; 766 return -ENOBUFS;
diff --git a/net/irda/irda_device.c b/net/irda/irda_device.c
index ba40e5495f58..7e7a31798d8d 100644
--- a/net/irda/irda_device.c
+++ b/net/irda/irda_device.c
@@ -401,12 +401,10 @@ dongle_t *irda_device_dongle_init(struct net_device *dev, int type)
401 } 401 }
402 402
403 /* Allocate dongle info for this instance */ 403 /* Allocate dongle info for this instance */
404 dongle = kmalloc(sizeof(dongle_t), GFP_KERNEL); 404 dongle = kzalloc(sizeof(dongle_t), GFP_KERNEL);
405 if (!dongle) 405 if (!dongle)
406 goto out; 406 goto out;
407 407
408 memset(dongle, 0, sizeof(dongle_t));
409
410 /* Bind the registration info to this particular instance */ 408 /* Bind the registration info to this particular instance */
411 dongle->issue = reg; 409 dongle->issue = reg;
412 dongle->dev = dev; 410 dongle->dev = dev;
diff --git a/net/irda/iriap.c b/net/irda/iriap.c
index a0472652a44e..61128aa05b40 100644
--- a/net/irda/iriap.c
+++ b/net/irda/iriap.c
@@ -345,7 +345,7 @@ static void iriap_disconnect_request(struct iriap_cb *self)
345 IRDA_ASSERT(self != NULL, return;); 345 IRDA_ASSERT(self != NULL, return;);
346 IRDA_ASSERT(self->magic == IAS_MAGIC, return;); 346 IRDA_ASSERT(self->magic == IAS_MAGIC, return;);
347 347
348 tx_skb = dev_alloc_skb(64); 348 tx_skb = alloc_skb(64, GFP_ATOMIC);
349 if (tx_skb == NULL) { 349 if (tx_skb == NULL) {
350 IRDA_DEBUG(0, "%s(), Could not allocate an sk_buff of length %d\n", 350 IRDA_DEBUG(0, "%s(), Could not allocate an sk_buff of length %d\n",
351 __FUNCTION__, 64); 351 __FUNCTION__, 64);
@@ -396,7 +396,7 @@ int iriap_getvaluebyclass_request(struct iriap_cb *self,
396 attr_len = strlen(attr); /* Up to IAS_MAX_ATTRIBNAME = 60 */ 396 attr_len = strlen(attr); /* Up to IAS_MAX_ATTRIBNAME = 60 */
397 397
398 skb_len = self->max_header_size+2+name_len+1+attr_len+4; 398 skb_len = self->max_header_size+2+name_len+1+attr_len+4;
399 tx_skb = dev_alloc_skb(skb_len); 399 tx_skb = alloc_skb(skb_len, GFP_ATOMIC);
400 if (!tx_skb) 400 if (!tx_skb)
401 return -ENOMEM; 401 return -ENOMEM;
402 402
@@ -562,7 +562,8 @@ static void iriap_getvaluebyclass_response(struct iriap_cb *self,
562 * value. We add 32 bytes because of the 6 bytes for the frame and 562 * value. We add 32 bytes because of the 6 bytes for the frame and
563 * max 5 bytes for the value coding. 563 * max 5 bytes for the value coding.
564 */ 564 */
565 tx_skb = dev_alloc_skb(value->len + self->max_header_size + 32); 565 tx_skb = alloc_skb(value->len + self->max_header_size + 32,
566 GFP_ATOMIC);
566 if (!tx_skb) 567 if (!tx_skb)
567 return; 568 return;
568 569
@@ -700,7 +701,7 @@ void iriap_send_ack(struct iriap_cb *self)
700 IRDA_ASSERT(self != NULL, return;); 701 IRDA_ASSERT(self != NULL, return;);
701 IRDA_ASSERT(self->magic == IAS_MAGIC, return;); 702 IRDA_ASSERT(self->magic == IAS_MAGIC, return;);
702 703
703 tx_skb = dev_alloc_skb(64); 704 tx_skb = alloc_skb(64, GFP_ATOMIC);
704 if (!tx_skb) 705 if (!tx_skb)
705 return; 706 return;
706 707
diff --git a/net/irda/iriap_event.c b/net/irda/iriap_event.c
index a73607450de1..da17395df05a 100644
--- a/net/irda/iriap_event.c
+++ b/net/irda/iriap_event.c
@@ -365,7 +365,7 @@ static void state_r_disconnect(struct iriap_cb *self, IRIAP_EVENT event,
365 365
366 switch (event) { 366 switch (event) {
367 case IAP_LM_CONNECT_INDICATION: 367 case IAP_LM_CONNECT_INDICATION:
368 tx_skb = dev_alloc_skb(64); 368 tx_skb = alloc_skb(64, GFP_ATOMIC);
369 if (tx_skb == NULL) { 369 if (tx_skb == NULL) {
370 IRDA_WARNING("%s: unable to malloc!\n", __FUNCTION__); 370 IRDA_WARNING("%s: unable to malloc!\n", __FUNCTION__);
371 return; 371 return;
diff --git a/net/irda/irias_object.c b/net/irda/irias_object.c
index 82e665c79991..a154b1d71c0f 100644
--- a/net/irda/irias_object.c
+++ b/net/irda/irias_object.c
@@ -82,13 +82,12 @@ struct ias_object *irias_new_object( char *name, int id)
82 82
83 IRDA_DEBUG( 4, "%s()\n", __FUNCTION__); 83 IRDA_DEBUG( 4, "%s()\n", __FUNCTION__);
84 84
85 obj = kmalloc(sizeof(struct ias_object), GFP_ATOMIC); 85 obj = kzalloc(sizeof(struct ias_object), GFP_ATOMIC);
86 if (obj == NULL) { 86 if (obj == NULL) {
87 IRDA_WARNING("%s(), Unable to allocate object!\n", 87 IRDA_WARNING("%s(), Unable to allocate object!\n",
88 __FUNCTION__); 88 __FUNCTION__);
89 return NULL; 89 return NULL;
90 } 90 }
91 memset(obj, 0, sizeof( struct ias_object));
92 91
93 obj->magic = IAS_OBJECT_MAGIC; 92 obj->magic = IAS_OBJECT_MAGIC;
94 obj->name = strndup(name, IAS_MAX_CLASSNAME); 93 obj->name = strndup(name, IAS_MAX_CLASSNAME);
@@ -346,13 +345,12 @@ void irias_add_integer_attrib(struct ias_object *obj, char *name, int value,
346 IRDA_ASSERT(obj->magic == IAS_OBJECT_MAGIC, return;); 345 IRDA_ASSERT(obj->magic == IAS_OBJECT_MAGIC, return;);
347 IRDA_ASSERT(name != NULL, return;); 346 IRDA_ASSERT(name != NULL, return;);
348 347
349 attrib = kmalloc(sizeof(struct ias_attrib), GFP_ATOMIC); 348 attrib = kzalloc(sizeof(struct ias_attrib), GFP_ATOMIC);
350 if (attrib == NULL) { 349 if (attrib == NULL) {
351 IRDA_WARNING("%s: Unable to allocate attribute!\n", 350 IRDA_WARNING("%s: Unable to allocate attribute!\n",
352 __FUNCTION__); 351 __FUNCTION__);
353 return; 352 return;
354 } 353 }
355 memset(attrib, 0, sizeof( struct ias_attrib));
356 354
357 attrib->magic = IAS_ATTRIB_MAGIC; 355 attrib->magic = IAS_ATTRIB_MAGIC;
358 attrib->name = strndup(name, IAS_MAX_ATTRIBNAME); 356 attrib->name = strndup(name, IAS_MAX_ATTRIBNAME);
@@ -382,13 +380,12 @@ void irias_add_octseq_attrib(struct ias_object *obj, char *name, __u8 *octets,
382 IRDA_ASSERT(name != NULL, return;); 380 IRDA_ASSERT(name != NULL, return;);
383 IRDA_ASSERT(octets != NULL, return;); 381 IRDA_ASSERT(octets != NULL, return;);
384 382
385 attrib = kmalloc(sizeof(struct ias_attrib), GFP_ATOMIC); 383 attrib = kzalloc(sizeof(struct ias_attrib), GFP_ATOMIC);
386 if (attrib == NULL) { 384 if (attrib == NULL) {
387 IRDA_WARNING("%s: Unable to allocate attribute!\n", 385 IRDA_WARNING("%s: Unable to allocate attribute!\n",
388 __FUNCTION__); 386 __FUNCTION__);
389 return; 387 return;
390 } 388 }
391 memset(attrib, 0, sizeof( struct ias_attrib));
392 389
393 attrib->magic = IAS_ATTRIB_MAGIC; 390 attrib->magic = IAS_ATTRIB_MAGIC;
394 attrib->name = strndup(name, IAS_MAX_ATTRIBNAME); 391 attrib->name = strndup(name, IAS_MAX_ATTRIBNAME);
@@ -416,13 +413,12 @@ void irias_add_string_attrib(struct ias_object *obj, char *name, char *value,
416 IRDA_ASSERT(name != NULL, return;); 413 IRDA_ASSERT(name != NULL, return;);
417 IRDA_ASSERT(value != NULL, return;); 414 IRDA_ASSERT(value != NULL, return;);
418 415
419 attrib = kmalloc(sizeof( struct ias_attrib), GFP_ATOMIC); 416 attrib = kzalloc(sizeof( struct ias_attrib), GFP_ATOMIC);
420 if (attrib == NULL) { 417 if (attrib == NULL) {
421 IRDA_WARNING("%s: Unable to allocate attribute!\n", 418 IRDA_WARNING("%s: Unable to allocate attribute!\n",
422 __FUNCTION__); 419 __FUNCTION__);
423 return; 420 return;
424 } 421 }
425 memset(attrib, 0, sizeof( struct ias_attrib));
426 422
427 attrib->magic = IAS_ATTRIB_MAGIC; 423 attrib->magic = IAS_ATTRIB_MAGIC;
428 attrib->name = strndup(name, IAS_MAX_ATTRIBNAME); 424 attrib->name = strndup(name, IAS_MAX_ATTRIBNAME);
@@ -443,12 +439,11 @@ struct ias_value *irias_new_integer_value(int integer)
443{ 439{
444 struct ias_value *value; 440 struct ias_value *value;
445 441
446 value = kmalloc(sizeof(struct ias_value), GFP_ATOMIC); 442 value = kzalloc(sizeof(struct ias_value), GFP_ATOMIC);
447 if (value == NULL) { 443 if (value == NULL) {
448 IRDA_WARNING("%s: Unable to kmalloc!\n", __FUNCTION__); 444 IRDA_WARNING("%s: Unable to kmalloc!\n", __FUNCTION__);
449 return NULL; 445 return NULL;
450 } 446 }
451 memset(value, 0, sizeof(struct ias_value));
452 447
453 value->type = IAS_INTEGER; 448 value->type = IAS_INTEGER;
454 value->len = 4; 449 value->len = 4;
@@ -469,12 +464,11 @@ struct ias_value *irias_new_string_value(char *string)
469{ 464{
470 struct ias_value *value; 465 struct ias_value *value;
471 466
472 value = kmalloc(sizeof(struct ias_value), GFP_ATOMIC); 467 value = kzalloc(sizeof(struct ias_value), GFP_ATOMIC);
473 if (value == NULL) { 468 if (value == NULL) {
474 IRDA_WARNING("%s: Unable to kmalloc!\n", __FUNCTION__); 469 IRDA_WARNING("%s: Unable to kmalloc!\n", __FUNCTION__);
475 return NULL; 470 return NULL;
476 } 471 }
477 memset( value, 0, sizeof( struct ias_value));
478 472
479 value->type = IAS_STRING; 473 value->type = IAS_STRING;
480 value->charset = CS_ASCII; 474 value->charset = CS_ASCII;
@@ -495,12 +489,11 @@ struct ias_value *irias_new_octseq_value(__u8 *octseq , int len)
495{ 489{
496 struct ias_value *value; 490 struct ias_value *value;
497 491
498 value = kmalloc(sizeof(struct ias_value), GFP_ATOMIC); 492 value = kzalloc(sizeof(struct ias_value), GFP_ATOMIC);
499 if (value == NULL) { 493 if (value == NULL) {
500 IRDA_WARNING("%s: Unable to kmalloc!\n", __FUNCTION__); 494 IRDA_WARNING("%s: Unable to kmalloc!\n", __FUNCTION__);
501 return NULL; 495 return NULL;
502 } 496 }
503 memset(value, 0, sizeof(struct ias_value));
504 497
505 value->type = IAS_OCT_SEQ; 498 value->type = IAS_OCT_SEQ;
506 /* Check length */ 499 /* Check length */
@@ -522,12 +515,11 @@ struct ias_value *irias_new_missing_value(void)
522{ 515{
523 struct ias_value *value; 516 struct ias_value *value;
524 517
525 value = kmalloc(sizeof(struct ias_value), GFP_ATOMIC); 518 value = kzalloc(sizeof(struct ias_value), GFP_ATOMIC);
526 if (value == NULL) { 519 if (value == NULL) {
527 IRDA_WARNING("%s: Unable to kmalloc!\n", __FUNCTION__); 520 IRDA_WARNING("%s: Unable to kmalloc!\n", __FUNCTION__);
528 return NULL; 521 return NULL;
529 } 522 }
530 memset(value, 0, sizeof(struct ias_value));
531 523
532 value->type = IAS_MISSING; 524 value->type = IAS_MISSING;
533 value->len = 0; 525 value->len = 0;
diff --git a/net/irda/irlan/irlan_common.c b/net/irda/irlan/irlan_common.c
index bd659dd545ac..7dd0a2fe1d20 100644
--- a/net/irda/irlan/irlan_common.c
+++ b/net/irda/irlan/irlan_common.c
@@ -636,7 +636,7 @@ void irlan_get_provider_info(struct irlan_cb *self)
636 IRDA_ASSERT(self != NULL, return;); 636 IRDA_ASSERT(self != NULL, return;);
637 IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); 637 IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;);
638 638
639 skb = dev_alloc_skb(64); 639 skb = alloc_skb(64, GFP_ATOMIC);
640 if (!skb) 640 if (!skb)
641 return; 641 return;
642 642
@@ -668,7 +668,7 @@ void irlan_open_data_channel(struct irlan_cb *self)
668 IRDA_ASSERT(self != NULL, return;); 668 IRDA_ASSERT(self != NULL, return;);
669 IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); 669 IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;);
670 670
671 skb = dev_alloc_skb(64); 671 skb = alloc_skb(64, GFP_ATOMIC);
672 if (!skb) 672 if (!skb)
673 return; 673 return;
674 674
@@ -704,7 +704,7 @@ void irlan_close_data_channel(struct irlan_cb *self)
704 if (self->client.tsap_ctrl == NULL) 704 if (self->client.tsap_ctrl == NULL)
705 return; 705 return;
706 706
707 skb = dev_alloc_skb(64); 707 skb = alloc_skb(64, GFP_ATOMIC);
708 if (!skb) 708 if (!skb)
709 return; 709 return;
710 710
@@ -739,7 +739,7 @@ static void irlan_open_unicast_addr(struct irlan_cb *self)
739 IRDA_ASSERT(self != NULL, return;); 739 IRDA_ASSERT(self != NULL, return;);
740 IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); 740 IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;);
741 741
742 skb = dev_alloc_skb(128); 742 skb = alloc_skb(128, GFP_ATOMIC);
743 if (!skb) 743 if (!skb)
744 return; 744 return;
745 745
@@ -777,7 +777,7 @@ void irlan_set_broadcast_filter(struct irlan_cb *self, int status)
777 IRDA_ASSERT(self != NULL, return;); 777 IRDA_ASSERT(self != NULL, return;);
778 IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); 778 IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;);
779 779
780 skb = dev_alloc_skb(128); 780 skb = alloc_skb(128, GFP_ATOMIC);
781 if (!skb) 781 if (!skb)
782 return; 782 return;
783 783
@@ -816,7 +816,7 @@ void irlan_set_multicast_filter(struct irlan_cb *self, int status)
816 IRDA_ASSERT(self != NULL, return;); 816 IRDA_ASSERT(self != NULL, return;);
817 IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); 817 IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;);
818 818
819 skb = dev_alloc_skb(128); 819 skb = alloc_skb(128, GFP_ATOMIC);
820 if (!skb) 820 if (!skb)
821 return; 821 return;
822 822
@@ -856,7 +856,7 @@ static void irlan_get_unicast_addr(struct irlan_cb *self)
856 IRDA_ASSERT(self != NULL, return;); 856 IRDA_ASSERT(self != NULL, return;);
857 IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); 857 IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;);
858 858
859 skb = dev_alloc_skb(128); 859 skb = alloc_skb(128, GFP_ATOMIC);
860 if (!skb) 860 if (!skb)
861 return; 861 return;
862 862
@@ -891,7 +891,7 @@ void irlan_get_media_char(struct irlan_cb *self)
891 IRDA_ASSERT(self != NULL, return;); 891 IRDA_ASSERT(self != NULL, return;);
892 IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); 892 IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;);
893 893
894 skb = dev_alloc_skb(64); 894 skb = alloc_skb(64, GFP_ATOMIC);
895 if (!skb) 895 if (!skb)
896 return; 896 return;
897 897
diff --git a/net/irda/irlan/irlan_provider.c b/net/irda/irlan/irlan_provider.c
index 39c202d1c374..9c0df86044d7 100644
--- a/net/irda/irlan/irlan_provider.c
+++ b/net/irda/irlan/irlan_provider.c
@@ -296,7 +296,7 @@ void irlan_provider_send_reply(struct irlan_cb *self, int command,
296 IRDA_ASSERT(self != NULL, return;); 296 IRDA_ASSERT(self != NULL, return;);
297 IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); 297 IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;);
298 298
299 skb = dev_alloc_skb(128); 299 skb = alloc_skb(128, GFP_ATOMIC);
300 if (!skb) 300 if (!skb)
301 return; 301 return;
302 302
diff --git a/net/irda/irlap.c b/net/irda/irlap.c
index cade355ac8af..e7852a07495e 100644
--- a/net/irda/irlap.c
+++ b/net/irda/irlap.c
@@ -116,11 +116,10 @@ struct irlap_cb *irlap_open(struct net_device *dev, struct qos_info *qos,
116 IRDA_DEBUG(4, "%s()\n", __FUNCTION__); 116 IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
117 117
118 /* Initialize the irlap structure. */ 118 /* Initialize the irlap structure. */
119 self = kmalloc(sizeof(struct irlap_cb), GFP_KERNEL); 119 self = kzalloc(sizeof(struct irlap_cb), GFP_KERNEL);
120 if (self == NULL) 120 if (self == NULL)
121 return NULL; 121 return NULL;
122 122
123 memset(self, 0, sizeof(struct irlap_cb));
124 self->magic = LAP_MAGIC; 123 self->magic = LAP_MAGIC;
125 124
126 /* Make a binding between the layers */ 125 /* Make a binding between the layers */
@@ -882,7 +881,7 @@ static void irlap_change_speed(struct irlap_cb *self, __u32 speed, int now)
882 /* Change speed now, or just piggyback speed on frames */ 881 /* Change speed now, or just piggyback speed on frames */
883 if (now) { 882 if (now) {
884 /* Send down empty frame to trigger speed change */ 883 /* Send down empty frame to trigger speed change */
885 skb = dev_alloc_skb(0); 884 skb = alloc_skb(0, GFP_ATOMIC);
886 if (skb) 885 if (skb)
887 irlap_queue_xmit(self, skb); 886 irlap_queue_xmit(self, skb);
888 } 887 }
@@ -1222,7 +1221,7 @@ static int irlap_seq_open(struct inode *inode, struct file *file)
1222{ 1221{
1223 struct seq_file *seq; 1222 struct seq_file *seq;
1224 int rc = -ENOMEM; 1223 int rc = -ENOMEM;
1225 struct irlap_iter_state *s = kmalloc(sizeof(*s), GFP_KERNEL); 1224 struct irlap_iter_state *s = kzalloc(sizeof(*s), GFP_KERNEL);
1226 1225
1227 if (!s) 1226 if (!s)
1228 goto out; 1227 goto out;
@@ -1238,7 +1237,6 @@ static int irlap_seq_open(struct inode *inode, struct file *file)
1238 1237
1239 seq = file->private_data; 1238 seq = file->private_data;
1240 seq->private = s; 1239 seq->private = s;
1241 memset(s, 0, sizeof(*s));
1242out: 1240out:
1243 return rc; 1241 return rc;
1244out_kfree: 1242out_kfree:
diff --git a/net/irda/irlap_frame.c b/net/irda/irlap_frame.c
index 3e9a06abbdd0..ccb983bf0f4a 100644
--- a/net/irda/irlap_frame.c
+++ b/net/irda/irlap_frame.c
@@ -117,7 +117,7 @@ void irlap_send_snrm_frame(struct irlap_cb *self, struct qos_info *qos)
117 IRDA_ASSERT(self->magic == LAP_MAGIC, return;); 117 IRDA_ASSERT(self->magic == LAP_MAGIC, return;);
118 118
119 /* Allocate frame */ 119 /* Allocate frame */
120 tx_skb = dev_alloc_skb(64); 120 tx_skb = alloc_skb(64, GFP_ATOMIC);
121 if (!tx_skb) 121 if (!tx_skb)
122 return; 122 return;
123 123
@@ -210,7 +210,7 @@ void irlap_send_ua_response_frame(struct irlap_cb *self, struct qos_info *qos)
210 IRDA_ASSERT(self->magic == LAP_MAGIC, return;); 210 IRDA_ASSERT(self->magic == LAP_MAGIC, return;);
211 211
212 /* Allocate frame */ 212 /* Allocate frame */
213 tx_skb = dev_alloc_skb(64); 213 tx_skb = alloc_skb(64, GFP_ATOMIC);
214 if (!tx_skb) 214 if (!tx_skb)
215 return; 215 return;
216 216
@@ -250,7 +250,7 @@ void irlap_send_dm_frame( struct irlap_cb *self)
250 IRDA_ASSERT(self != NULL, return;); 250 IRDA_ASSERT(self != NULL, return;);
251 IRDA_ASSERT(self->magic == LAP_MAGIC, return;); 251 IRDA_ASSERT(self->magic == LAP_MAGIC, return;);
252 252
253 tx_skb = dev_alloc_skb(32); 253 tx_skb = alloc_skb(32, GFP_ATOMIC);
254 if (!tx_skb) 254 if (!tx_skb)
255 return; 255 return;
256 256
@@ -282,7 +282,7 @@ void irlap_send_disc_frame(struct irlap_cb *self)
282 IRDA_ASSERT(self != NULL, return;); 282 IRDA_ASSERT(self != NULL, return;);
283 IRDA_ASSERT(self->magic == LAP_MAGIC, return;); 283 IRDA_ASSERT(self->magic == LAP_MAGIC, return;);
284 284
285 tx_skb = dev_alloc_skb(16); 285 tx_skb = alloc_skb(16, GFP_ATOMIC);
286 if (!tx_skb) 286 if (!tx_skb)
287 return; 287 return;
288 288
@@ -315,7 +315,7 @@ void irlap_send_discovery_xid_frame(struct irlap_cb *self, int S, __u8 s,
315 IRDA_ASSERT(self->magic == LAP_MAGIC, return;); 315 IRDA_ASSERT(self->magic == LAP_MAGIC, return;);
316 IRDA_ASSERT(discovery != NULL, return;); 316 IRDA_ASSERT(discovery != NULL, return;);
317 317
318 tx_skb = dev_alloc_skb(64); 318 tx_skb = alloc_skb(64, GFP_ATOMIC);
319 if (!tx_skb) 319 if (!tx_skb)
320 return; 320 return;
321 321
@@ -422,11 +422,10 @@ static void irlap_recv_discovery_xid_rsp(struct irlap_cb *self,
422 return; 422 return;
423 } 423 }
424 424
425 if ((discovery = kmalloc(sizeof(discovery_t), GFP_ATOMIC)) == NULL) { 425 if ((discovery = kzalloc(sizeof(discovery_t), GFP_ATOMIC)) == NULL) {
426 IRDA_WARNING("%s: kmalloc failed!\n", __FUNCTION__); 426 IRDA_WARNING("%s: kmalloc failed!\n", __FUNCTION__);
427 return; 427 return;
428 } 428 }
429 memset(discovery, 0, sizeof(discovery_t));
430 429
431 discovery->data.daddr = info->daddr; 430 discovery->data.daddr = info->daddr;
432 discovery->data.saddr = self->saddr; 431 discovery->data.saddr = self->saddr;
@@ -576,7 +575,7 @@ void irlap_send_rr_frame(struct irlap_cb *self, int command)
576 struct sk_buff *tx_skb; 575 struct sk_buff *tx_skb;
577 __u8 *frame; 576 __u8 *frame;
578 577
579 tx_skb = dev_alloc_skb(16); 578 tx_skb = alloc_skb(16, GFP_ATOMIC);
580 if (!tx_skb) 579 if (!tx_skb)
581 return; 580 return;
582 581
@@ -601,7 +600,7 @@ void irlap_send_rd_frame(struct irlap_cb *self)
601 struct sk_buff *tx_skb; 600 struct sk_buff *tx_skb;
602 __u8 *frame; 601 __u8 *frame;
603 602
604 tx_skb = dev_alloc_skb(16); 603 tx_skb = alloc_skb(16, GFP_ATOMIC);
605 if (!tx_skb) 604 if (!tx_skb)
606 return; 605 return;
607 606
@@ -1215,7 +1214,7 @@ void irlap_send_test_frame(struct irlap_cb *self, __u8 caddr, __u32 daddr,
1215 struct test_frame *frame; 1214 struct test_frame *frame;
1216 __u8 *info; 1215 __u8 *info;
1217 1216
1218 tx_skb = dev_alloc_skb(cmd->len+sizeof(struct test_frame)); 1217 tx_skb = alloc_skb(cmd->len+sizeof(struct test_frame), GFP_ATOMIC);
1219 if (!tx_skb) 1218 if (!tx_skb)
1220 return; 1219 return;
1221 1220
diff --git a/net/irda/irlmp.c b/net/irda/irlmp.c
index 129ad64c15bb..c440913dee14 100644
--- a/net/irda/irlmp.c
+++ b/net/irda/irlmp.c
@@ -78,10 +78,9 @@ int __init irlmp_init(void)
78{ 78{
79 IRDA_DEBUG(1, "%s()\n", __FUNCTION__); 79 IRDA_DEBUG(1, "%s()\n", __FUNCTION__);
80 /* Initialize the irlmp structure. */ 80 /* Initialize the irlmp structure. */
81 irlmp = kmalloc( sizeof(struct irlmp_cb), GFP_KERNEL); 81 irlmp = kzalloc( sizeof(struct irlmp_cb), GFP_KERNEL);
82 if (irlmp == NULL) 82 if (irlmp == NULL)
83 return -ENOMEM; 83 return -ENOMEM;
84 memset(irlmp, 0, sizeof(struct irlmp_cb));
85 84
86 irlmp->magic = LMP_MAGIC; 85 irlmp->magic = LMP_MAGIC;
87 86
@@ -160,12 +159,11 @@ struct lsap_cb *irlmp_open_lsap(__u8 slsap_sel, notify_t *notify, __u8 pid)
160 return NULL; 159 return NULL;
161 160
162 /* Allocate new instance of a LSAP connection */ 161 /* Allocate new instance of a LSAP connection */
163 self = kmalloc(sizeof(struct lsap_cb), GFP_ATOMIC); 162 self = kzalloc(sizeof(struct lsap_cb), GFP_ATOMIC);
164 if (self == NULL) { 163 if (self == NULL) {
165 IRDA_ERROR("%s: can't allocate memory\n", __FUNCTION__); 164 IRDA_ERROR("%s: can't allocate memory\n", __FUNCTION__);
166 return NULL; 165 return NULL;
167 } 166 }
168 memset(self, 0, sizeof(struct lsap_cb));
169 167
170 self->magic = LMP_LSAP_MAGIC; 168 self->magic = LMP_LSAP_MAGIC;
171 self->slsap_sel = slsap_sel; 169 self->slsap_sel = slsap_sel;
@@ -288,12 +286,11 @@ void irlmp_register_link(struct irlap_cb *irlap, __u32 saddr, notify_t *notify)
288 /* 286 /*
289 * Allocate new instance of a LSAP connection 287 * Allocate new instance of a LSAP connection
290 */ 288 */
291 lap = kmalloc(sizeof(struct lap_cb), GFP_KERNEL); 289 lap = kzalloc(sizeof(struct lap_cb), GFP_KERNEL);
292 if (lap == NULL) { 290 if (lap == NULL) {
293 IRDA_ERROR("%s: unable to kmalloc\n", __FUNCTION__); 291 IRDA_ERROR("%s: unable to kmalloc\n", __FUNCTION__);
294 return; 292 return;
295 } 293 }
296 memset(lap, 0, sizeof(struct lap_cb));
297 294
298 lap->irlap = irlap; 295 lap->irlap = irlap;
299 lap->magic = LMP_LAP_MAGIC; 296 lap->magic = LMP_LAP_MAGIC;
@@ -395,7 +392,7 @@ int irlmp_connect_request(struct lsap_cb *self, __u8 dlsap_sel,
395 392
396 /* Any userdata? */ 393 /* Any userdata? */
397 if (tx_skb == NULL) { 394 if (tx_skb == NULL) {
398 tx_skb = dev_alloc_skb(64); 395 tx_skb = alloc_skb(64, GFP_ATOMIC);
399 if (!tx_skb) 396 if (!tx_skb)
400 return -ENOMEM; 397 return -ENOMEM;
401 398
diff --git a/net/irda/irnet/irnet_ppp.c b/net/irda/irnet/irnet_ppp.c
index e53bf9e0053e..a1e502ff9070 100644
--- a/net/irda/irnet/irnet_ppp.c
+++ b/net/irda/irnet/irnet_ppp.c
@@ -476,11 +476,10 @@ dev_irnet_open(struct inode * inode,
476#endif /* SECURE_DEVIRNET */ 476#endif /* SECURE_DEVIRNET */
477 477
478 /* Allocate a private structure for this IrNET instance */ 478 /* Allocate a private structure for this IrNET instance */
479 ap = kmalloc(sizeof(*ap), GFP_KERNEL); 479 ap = kzalloc(sizeof(*ap), GFP_KERNEL);
480 DABORT(ap == NULL, -ENOMEM, FS_ERROR, "Can't allocate struct irnet...\n"); 480 DABORT(ap == NULL, -ENOMEM, FS_ERROR, "Can't allocate struct irnet...\n");
481 481
482 /* initialize the irnet structure */ 482 /* initialize the irnet structure */
483 memset(ap, 0, sizeof(*ap));
484 ap->file = file; 483 ap->file = file;
485 484
486 /* PPP channel setup */ 485 /* PPP channel setup */
diff --git a/net/irda/irttp.c b/net/irda/irttp.c
index 49c51c5f1a86..42acf1cde737 100644
--- a/net/irda/irttp.c
+++ b/net/irda/irttp.c
@@ -85,10 +85,9 @@ static pi_param_info_t param_info = { pi_major_call_table, 1, 0x0f, 4 };
85 */ 85 */
86int __init irttp_init(void) 86int __init irttp_init(void)
87{ 87{
88 irttp = kmalloc(sizeof(struct irttp_cb), GFP_KERNEL); 88 irttp = kzalloc(sizeof(struct irttp_cb), GFP_KERNEL);
89 if (irttp == NULL) 89 if (irttp == NULL)
90 return -ENOMEM; 90 return -ENOMEM;
91 memset(irttp, 0, sizeof(struct irttp_cb));
92 91
93 irttp->magic = TTP_MAGIC; 92 irttp->magic = TTP_MAGIC;
94 93
@@ -306,7 +305,8 @@ static inline void irttp_fragment_skb(struct tsap_cb *self,
306 IRDA_DEBUG(2, "%s(), fragmenting ...\n", __FUNCTION__); 305 IRDA_DEBUG(2, "%s(), fragmenting ...\n", __FUNCTION__);
307 306
308 /* Make new segment */ 307 /* Make new segment */
309 frag = dev_alloc_skb(self->max_seg_size+self->max_header_size); 308 frag = alloc_skb(self->max_seg_size+self->max_header_size,
309 GFP_ATOMIC);
310 if (!frag) 310 if (!frag)
311 return; 311 return;
312 312
@@ -389,12 +389,11 @@ struct tsap_cb *irttp_open_tsap(__u8 stsap_sel, int credit, notify_t *notify)
389 return NULL; 389 return NULL;
390 } 390 }
391 391
392 self = kmalloc(sizeof(struct tsap_cb), GFP_ATOMIC); 392 self = kzalloc(sizeof(struct tsap_cb), GFP_ATOMIC);
393 if (self == NULL) { 393 if (self == NULL) {
394 IRDA_DEBUG(0, "%s(), unable to kmalloc!\n", __FUNCTION__); 394 IRDA_DEBUG(0, "%s(), unable to kmalloc!\n", __FUNCTION__);
395 return NULL; 395 return NULL;
396 } 396 }
397 memset(self, 0, sizeof(struct tsap_cb));
398 spin_lock_init(&self->lock); 397 spin_lock_init(&self->lock);
399 398
400 /* Initialise todo timer */ 399 /* Initialise todo timer */
@@ -805,7 +804,7 @@ static inline void irttp_give_credit(struct tsap_cb *self)
805 self->send_credit, self->avail_credit, self->remote_credit); 804 self->send_credit, self->avail_credit, self->remote_credit);
806 805
807 /* Give credit to peer */ 806 /* Give credit to peer */
808 tx_skb = dev_alloc_skb(64); 807 tx_skb = alloc_skb(64, GFP_ATOMIC);
809 if (!tx_skb) 808 if (!tx_skb)
810 return; 809 return;
811 810
@@ -1094,7 +1093,7 @@ int irttp_connect_request(struct tsap_cb *self, __u8 dtsap_sel,
1094 1093
1095 /* Any userdata supplied? */ 1094 /* Any userdata supplied? */
1096 if (userdata == NULL) { 1095 if (userdata == NULL) {
1097 tx_skb = dev_alloc_skb(64); 1096 tx_skb = alloc_skb(64, GFP_ATOMIC);
1098 if (!tx_skb) 1097 if (!tx_skb)
1099 return -ENOMEM; 1098 return -ENOMEM;
1100 1099
@@ -1342,7 +1341,7 @@ int irttp_connect_response(struct tsap_cb *self, __u32 max_sdu_size,
1342 1341
1343 /* Any userdata supplied? */ 1342 /* Any userdata supplied? */
1344 if (userdata == NULL) { 1343 if (userdata == NULL) {
1345 tx_skb = dev_alloc_skb(64); 1344 tx_skb = alloc_skb(64, GFP_ATOMIC);
1346 if (!tx_skb) 1345 if (!tx_skb)
1347 return -ENOMEM; 1346 return -ENOMEM;
1348 1347
@@ -1541,7 +1540,7 @@ int irttp_disconnect_request(struct tsap_cb *self, struct sk_buff *userdata,
1541 1540
1542 if (!userdata) { 1541 if (!userdata) {
1543 struct sk_buff *tx_skb; 1542 struct sk_buff *tx_skb;
1544 tx_skb = dev_alloc_skb(64); 1543 tx_skb = alloc_skb(64, GFP_ATOMIC);
1545 if (!tx_skb) 1544 if (!tx_skb)
1546 return -ENOMEM; 1545 return -ENOMEM;
1547 1546
@@ -1876,7 +1875,7 @@ static int irttp_seq_open(struct inode *inode, struct file *file)
1876 int rc = -ENOMEM; 1875 int rc = -ENOMEM;
1877 struct irttp_iter_state *s; 1876 struct irttp_iter_state *s;
1878 1877
1879 s = kmalloc(sizeof(*s), GFP_KERNEL); 1878 s = kzalloc(sizeof(*s), GFP_KERNEL);
1880 if (!s) 1879 if (!s)
1881 goto out; 1880 goto out;
1882 1881
@@ -1886,7 +1885,6 @@ static int irttp_seq_open(struct inode *inode, struct file *file)
1886 1885
1887 seq = file->private_data; 1886 seq = file->private_data;
1888 seq->private = s; 1887 seq->private = s;
1889 memset(s, 0, sizeof(*s));
1890out: 1888out:
1891 return rc; 1889 return rc;
1892out_kfree: 1890out_kfree:
diff --git a/net/lapb/lapb_iface.c b/net/lapb/lapb_iface.c
index aea6616cea3d..d504eed416f6 100644
--- a/net/lapb/lapb_iface.c
+++ b/net/lapb/lapb_iface.c
@@ -115,14 +115,12 @@ static struct lapb_cb *lapb_devtostruct(struct net_device *dev)
115 */ 115 */
116static struct lapb_cb *lapb_create_cb(void) 116static struct lapb_cb *lapb_create_cb(void)
117{ 117{
118 struct lapb_cb *lapb = kmalloc(sizeof(*lapb), GFP_ATOMIC); 118 struct lapb_cb *lapb = kzalloc(sizeof(*lapb), GFP_ATOMIC);
119 119
120 120
121 if (!lapb) 121 if (!lapb)
122 goto out; 122 goto out;
123 123
124 memset(lapb, 0x00, sizeof(*lapb));
125
126 skb_queue_head_init(&lapb->write_queue); 124 skb_queue_head_init(&lapb->write_queue);
127 skb_queue_head_init(&lapb->ack_queue); 125 skb_queue_head_init(&lapb->ack_queue);
128 126
diff --git a/net/llc/llc_core.c b/net/llc/llc_core.c
index bd242a49514a..d12413cff5bd 100644
--- a/net/llc/llc_core.c
+++ b/net/llc/llc_core.c
@@ -33,10 +33,9 @@ unsigned char llc_station_mac_sa[ETH_ALEN];
33 */ 33 */
34static struct llc_sap *llc_sap_alloc(void) 34static struct llc_sap *llc_sap_alloc(void)
35{ 35{
36 struct llc_sap *sap = kmalloc(sizeof(*sap), GFP_ATOMIC); 36 struct llc_sap *sap = kzalloc(sizeof(*sap), GFP_ATOMIC);
37 37
38 if (sap) { 38 if (sap) {
39 memset(sap, 0, sizeof(*sap));
40 sap->state = LLC_SAP_STATE_ACTIVE; 39 sap->state = LLC_SAP_STATE_ACTIVE;
41 memcpy(sap->laddr.mac, llc_station_mac_sa, ETH_ALEN); 40 memcpy(sap->laddr.mac, llc_station_mac_sa, ETH_ALEN);
42 rwlock_init(&sap->sk_list.lock); 41 rwlock_init(&sap->sk_list.lock);
diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig
index 42a178aa30f9..a9894ddfd72a 100644
--- a/net/netfilter/Kconfig
+++ b/net/netfilter/Kconfig
@@ -386,8 +386,8 @@ config NETFILTER_XT_MATCH_REALM
386 <file:Documentation/modules.txt>. If unsure, say `N'. 386 <file:Documentation/modules.txt>. If unsure, say `N'.
387 387
388config NETFILTER_XT_MATCH_SCTP 388config NETFILTER_XT_MATCH_SCTP
389 tristate '"sctp" protocol match support' 389 tristate '"sctp" protocol match support (EXPERIMENTAL)'
390 depends on NETFILTER_XTABLES 390 depends on NETFILTER_XTABLES && EXPERIMENTAL
391 help 391 help
392 With this option enabled, you will be able to use the 392 With this option enabled, you will be able to use the
393 `sctp' match in order to match on SCTP source/destination ports 393 `sctp' match in order to match on SCTP source/destination ports
diff --git a/net/netfilter/nf_conntrack_standalone.c b/net/netfilter/nf_conntrack_standalone.c
index 5fcab2ef231f..4ef836699962 100644
--- a/net/netfilter/nf_conntrack_standalone.c
+++ b/net/netfilter/nf_conntrack_standalone.c
@@ -428,6 +428,8 @@ static struct file_operations ct_cpu_seq_fops = {
428 428
429/* Sysctl support */ 429/* Sysctl support */
430 430
431int nf_conntrack_checksum = 1;
432
431#ifdef CONFIG_SYSCTL 433#ifdef CONFIG_SYSCTL
432 434
433/* From nf_conntrack_core.c */ 435/* From nf_conntrack_core.c */
@@ -459,8 +461,6 @@ extern unsigned int nf_ct_generic_timeout;
459static int log_invalid_proto_min = 0; 461static int log_invalid_proto_min = 0;
460static int log_invalid_proto_max = 255; 462static int log_invalid_proto_max = 255;
461 463
462int nf_conntrack_checksum = 1;
463
464static struct ctl_table_header *nf_ct_sysctl_header; 464static struct ctl_table_header *nf_ct_sysctl_header;
465 465
466static ctl_table nf_ct_sysctl_table[] = { 466static ctl_table nf_ct_sysctl_table[] = {
diff --git a/net/netfilter/nf_queue.c b/net/netfilter/nf_queue.c
index bb6fcee452ca..662a869593bf 100644
--- a/net/netfilter/nf_queue.c
+++ b/net/netfilter/nf_queue.c
@@ -219,21 +219,20 @@ void nf_reinject(struct sk_buff *skb, struct nf_info *info,
219 219
220 switch (verdict & NF_VERDICT_MASK) { 220 switch (verdict & NF_VERDICT_MASK) {
221 case NF_ACCEPT: 221 case NF_ACCEPT:
222 case NF_STOP:
222 info->okfn(skb); 223 info->okfn(skb);
224 case NF_STOLEN:
223 break; 225 break;
224
225 case NF_QUEUE: 226 case NF_QUEUE:
226 if (!nf_queue(&skb, elem, info->pf, info->hook, 227 if (!nf_queue(&skb, elem, info->pf, info->hook,
227 info->indev, info->outdev, info->okfn, 228 info->indev, info->outdev, info->okfn,
228 verdict >> NF_VERDICT_BITS)) 229 verdict >> NF_VERDICT_BITS))
229 goto next_hook; 230 goto next_hook;
230 break; 231 break;
232 default:
233 kfree_skb(skb);
231 } 234 }
232 rcu_read_unlock(); 235 rcu_read_unlock();
233
234 if (verdict == NF_DROP)
235 kfree_skb(skb);
236
237 kfree(info); 236 kfree(info);
238 return; 237 return;
239} 238}
diff --git a/net/netfilter/xt_SECMARK.c b/net/netfilter/xt_SECMARK.c
index c2ce9c4011cc..de9537ad9a7c 100644
--- a/net/netfilter/xt_SECMARK.c
+++ b/net/netfilter/xt_SECMARK.c
@@ -57,6 +57,8 @@ static int checkentry_selinux(struct xt_secmark_target_info *info)
57{ 57{
58 int err; 58 int err;
59 struct xt_secmark_target_selinux_info *sel = &info->u.sel; 59 struct xt_secmark_target_selinux_info *sel = &info->u.sel;
60
61 sel->selctx[SECMARK_SELCTX_MAX - 1] = '\0';
60 62
61 err = selinux_string_to_sid(sel->selctx, &sel->selsid); 63 err = selinux_string_to_sid(sel->selctx, &sel->selsid);
62 if (err) { 64 if (err) {
diff --git a/net/netfilter/xt_physdev.c b/net/netfilter/xt_physdev.c
index 5fe4c9df17f5..a9f4f6f3c628 100644
--- a/net/netfilter/xt_physdev.c
+++ b/net/netfilter/xt_physdev.c
@@ -113,6 +113,21 @@ checkentry(const char *tablename,
113 if (!(info->bitmask & XT_PHYSDEV_OP_MASK) || 113 if (!(info->bitmask & XT_PHYSDEV_OP_MASK) ||
114 info->bitmask & ~XT_PHYSDEV_OP_MASK) 114 info->bitmask & ~XT_PHYSDEV_OP_MASK)
115 return 0; 115 return 0;
116 if (brnf_deferred_hooks == 0 &&
117 info->bitmask & XT_PHYSDEV_OP_OUT &&
118 (!(info->bitmask & XT_PHYSDEV_OP_BRIDGED) ||
119 info->invert & XT_PHYSDEV_OP_BRIDGED) &&
120 hook_mask & ((1 << NF_IP_LOCAL_OUT) | (1 << NF_IP_FORWARD) |
121 (1 << NF_IP_POST_ROUTING))) {
122 printk(KERN_WARNING "physdev match: using --physdev-out in the "
123 "OUTPUT, FORWARD and POSTROUTING chains for non-bridged "
124 "traffic is deprecated and breaks other things, it will "
125 "be removed in January 2007. See Documentation/"
126 "feature-removal-schedule.txt for details. This doesn't "
127 "affect you in case you're using it for purely bridged "
128 "traffic.\n");
129 brnf_deferred_hooks = 1;
130 }
116 return 1; 131 return 1;
117} 132}
118 133
diff --git a/net/netfilter/xt_pkttype.c b/net/netfilter/xt_pkttype.c
index 3ac703b5cb8f..d2f5320a80bf 100644
--- a/net/netfilter/xt_pkttype.c
+++ b/net/netfilter/xt_pkttype.c
@@ -9,6 +9,8 @@
9#include <linux/skbuff.h> 9#include <linux/skbuff.h>
10#include <linux/if_ether.h> 10#include <linux/if_ether.h>
11#include <linux/if_packet.h> 11#include <linux/if_packet.h>
12#include <linux/in.h>
13#include <linux/ip.h>
12 14
13#include <linux/netfilter/xt_pkttype.h> 15#include <linux/netfilter/xt_pkttype.h>
14#include <linux/netfilter/x_tables.h> 16#include <linux/netfilter/x_tables.h>
@@ -28,9 +30,17 @@ static int match(const struct sk_buff *skb,
28 unsigned int protoff, 30 unsigned int protoff,
29 int *hotdrop) 31 int *hotdrop)
30{ 32{
33 u_int8_t type;
31 const struct xt_pkttype_info *info = matchinfo; 34 const struct xt_pkttype_info *info = matchinfo;
32 35
33 return (skb->pkt_type == info->pkttype) ^ info->invert; 36 if (skb->pkt_type == PACKET_LOOPBACK)
37 type = (MULTICAST(skb->nh.iph->daddr)
38 ? PACKET_MULTICAST
39 : PACKET_BROADCAST);
40 else
41 type = skb->pkt_type;
42
43 return (type == info->pkttype) ^ info->invert;
34} 44}
35 45
36static struct xt_match pkttype_match = { 46static struct xt_match pkttype_match = {
diff --git a/net/netfilter/xt_string.c b/net/netfilter/xt_string.c
index 0ebb6ac2c8c7..d8e3891b5f8b 100644
--- a/net/netfilter/xt_string.c
+++ b/net/netfilter/xt_string.c
@@ -55,7 +55,10 @@ static int checkentry(const char *tablename,
55 /* Damn, can't handle this case properly with iptables... */ 55 /* Damn, can't handle this case properly with iptables... */
56 if (conf->from_offset > conf->to_offset) 56 if (conf->from_offset > conf->to_offset)
57 return 0; 57 return 0;
58 58 if (conf->algo[XT_STRING_MAX_ALGO_NAME_SIZE - 1] != '\0')
59 return 0;
60 if (conf->patlen > XT_STRING_MAX_PATTERN_SIZE)
61 return 0;
59 ts_conf = textsearch_prepare(conf->algo, conf->pattern, conf->patlen, 62 ts_conf = textsearch_prepare(conf->algo, conf->pattern, conf->patlen,
60 GFP_KERNEL, TS_AUTOLOAD); 63 GFP_KERNEL, TS_AUTOLOAD);
61 if (IS_ERR(ts_conf)) 64 if (IS_ERR(ts_conf))
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 55c0adc8f115..b85c1f9f1288 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -562,10 +562,9 @@ static int netlink_alloc_groups(struct sock *sk)
562 if (err) 562 if (err)
563 return err; 563 return err;
564 564
565 nlk->groups = kmalloc(NLGRPSZ(groups), GFP_KERNEL); 565 nlk->groups = kzalloc(NLGRPSZ(groups), GFP_KERNEL);
566 if (nlk->groups == NULL) 566 if (nlk->groups == NULL)
567 return -ENOMEM; 567 return -ENOMEM;
568 memset(nlk->groups, 0, NLGRPSZ(groups));
569 nlk->ngroups = groups; 568 nlk->ngroups = groups;
570 return 0; 569 return 0;
571} 570}
@@ -1393,11 +1392,10 @@ int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
1393 struct sock *sk; 1392 struct sock *sk;
1394 struct netlink_sock *nlk; 1393 struct netlink_sock *nlk;
1395 1394
1396 cb = kmalloc(sizeof(*cb), GFP_KERNEL); 1395 cb = kzalloc(sizeof(*cb), GFP_KERNEL);
1397 if (cb == NULL) 1396 if (cb == NULL)
1398 return -ENOBUFS; 1397 return -ENOBUFS;
1399 1398
1400 memset(cb, 0, sizeof(*cb));
1401 cb->dump = dump; 1399 cb->dump = dump;
1402 cb->done = done; 1400 cb->done = done;
1403 cb->nlh = nlh; 1401 cb->nlh = nlh;
@@ -1668,7 +1666,7 @@ static int netlink_seq_open(struct inode *inode, struct file *file)
1668 struct nl_seq_iter *iter; 1666 struct nl_seq_iter *iter;
1669 int err; 1667 int err;
1670 1668
1671 iter = kmalloc(sizeof(*iter), GFP_KERNEL); 1669 iter = kzalloc(sizeof(*iter), GFP_KERNEL);
1672 if (!iter) 1670 if (!iter)
1673 return -ENOMEM; 1671 return -ENOMEM;
1674 1672
@@ -1678,7 +1676,6 @@ static int netlink_seq_open(struct inode *inode, struct file *file)
1678 return err; 1676 return err;
1679 } 1677 }
1680 1678
1681 memset(iter, 0, sizeof(*iter));
1682 seq = file->private_data; 1679 seq = file->private_data;
1683 seq->private = iter; 1680 seq->private = iter;
1684 return 0; 1681 return 0;
@@ -1747,15 +1744,13 @@ static int __init netlink_proto_init(void)
1747 if (sizeof(struct netlink_skb_parms) > sizeof(dummy_skb->cb)) 1744 if (sizeof(struct netlink_skb_parms) > sizeof(dummy_skb->cb))
1748 netlink_skb_parms_too_large(); 1745 netlink_skb_parms_too_large();
1749 1746
1750 nl_table = kmalloc(sizeof(*nl_table) * MAX_LINKS, GFP_KERNEL); 1747 nl_table = kcalloc(MAX_LINKS, sizeof(*nl_table), GFP_KERNEL);
1751 if (!nl_table) { 1748 if (!nl_table) {
1752enomem: 1749enomem:
1753 printk(KERN_CRIT "netlink_init: Cannot allocate nl_table\n"); 1750 printk(KERN_CRIT "netlink_init: Cannot allocate nl_table\n");
1754 return -ENOMEM; 1751 return -ENOMEM;
1755 } 1752 }
1756 1753
1757 memset(nl_table, 0, sizeof(*nl_table) * MAX_LINKS);
1758
1759 if (num_physpages >= (128 * 1024)) 1754 if (num_physpages >= (128 * 1024))
1760 max = num_physpages >> (21 - PAGE_SHIFT); 1755 max = num_physpages >> (21 - PAGE_SHIFT);
1761 else 1756 else
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c
index 389a4119e1b4..1d50f801f181 100644
--- a/net/netrom/af_netrom.c
+++ b/net/netrom/af_netrom.c
@@ -66,6 +66,14 @@ static DEFINE_SPINLOCK(nr_list_lock);
66static const struct proto_ops nr_proto_ops; 66static const struct proto_ops nr_proto_ops;
67 67
68/* 68/*
69 * NETROM network devices are virtual network devices encapsulating NETROM
70 * frames into AX.25 which will be sent through an AX.25 device, so form a
71 * special "super class" of normal net devices; split their locks off into a
72 * separate class since they always nest.
73 */
74static struct lock_class_key nr_netdev_xmit_lock_key;
75
76/*
69 * Socket removal during an interrupt is now safe. 77 * Socket removal during an interrupt is now safe.
70 */ 78 */
71static void nr_remove_socket(struct sock *sk) 79static void nr_remove_socket(struct sock *sk)
@@ -986,18 +994,18 @@ int nr_rx_frame(struct sk_buff *skb, struct net_device *dev)
986 nr_make->vl = 0; 994 nr_make->vl = 0;
987 nr_make->state = NR_STATE_3; 995 nr_make->state = NR_STATE_3;
988 sk_acceptq_added(sk); 996 sk_acceptq_added(sk);
989
990 nr_insert_socket(make);
991
992 skb_queue_head(&sk->sk_receive_queue, skb); 997 skb_queue_head(&sk->sk_receive_queue, skb);
993 998
994 nr_start_heartbeat(make);
995 nr_start_idletimer(make);
996
997 if (!sock_flag(sk, SOCK_DEAD)) 999 if (!sock_flag(sk, SOCK_DEAD))
998 sk->sk_data_ready(sk, skb->len); 1000 sk->sk_data_ready(sk, skb->len);
999 1001
1000 bh_unlock_sock(sk); 1002 bh_unlock_sock(sk);
1003
1004 nr_insert_socket(make);
1005
1006 nr_start_heartbeat(make);
1007 nr_start_idletimer(make);
1008
1001 return 1; 1009 return 1;
1002} 1010}
1003 1011
@@ -1382,14 +1390,12 @@ static int __init nr_proto_init(void)
1382 return -1; 1390 return -1;
1383 } 1391 }
1384 1392
1385 dev_nr = kmalloc(nr_ndevs * sizeof(struct net_device *), GFP_KERNEL); 1393 dev_nr = kzalloc(nr_ndevs * sizeof(struct net_device *), GFP_KERNEL);
1386 if (dev_nr == NULL) { 1394 if (dev_nr == NULL) {
1387 printk(KERN_ERR "NET/ROM: nr_proto_init - unable to allocate device array\n"); 1395 printk(KERN_ERR "NET/ROM: nr_proto_init - unable to allocate device array\n");
1388 return -1; 1396 return -1;
1389 } 1397 }
1390 1398
1391 memset(dev_nr, 0x00, nr_ndevs * sizeof(struct net_device *));
1392
1393 for (i = 0; i < nr_ndevs; i++) { 1399 for (i = 0; i < nr_ndevs; i++) {
1394 char name[IFNAMSIZ]; 1400 char name[IFNAMSIZ];
1395 struct net_device *dev; 1401 struct net_device *dev;
@@ -1407,6 +1413,7 @@ static int __init nr_proto_init(void)
1407 free_netdev(dev); 1413 free_netdev(dev);
1408 goto fail; 1414 goto fail;
1409 } 1415 }
1416 lockdep_set_class(&dev->_xmit_lock, &nr_netdev_xmit_lock_key);
1410 dev_nr[i] = dev; 1417 dev_nr[i] = dev;
1411 } 1418 }
1412 1419
diff --git a/net/netrom/nr_timer.c b/net/netrom/nr_timer.c
index 75b72d389ba9..ddba1c144260 100644
--- a/net/netrom/nr_timer.c
+++ b/net/netrom/nr_timer.c
@@ -138,8 +138,8 @@ static void nr_heartbeat_expiry(unsigned long param)
138 if (sock_flag(sk, SOCK_DESTROY) || 138 if (sock_flag(sk, SOCK_DESTROY) ||
139 (sk->sk_state == TCP_LISTEN && sock_flag(sk, SOCK_DEAD))) { 139 (sk->sk_state == TCP_LISTEN && sock_flag(sk, SOCK_DEAD))) {
140 sock_hold(sk); 140 sock_hold(sk);
141 nr_destroy_socket(sk);
142 bh_unlock_sock(sk); 141 bh_unlock_sock(sk);
142 nr_destroy_socket(sk);
143 sock_put(sk); 143 sock_put(sk);
144 return; 144 return;
145 } 145 }
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
index d0a67bb31363..08a542855654 100644
--- a/net/rose/af_rose.c
+++ b/net/rose/af_rose.c
@@ -67,6 +67,14 @@ static struct proto_ops rose_proto_ops;
67ax25_address rose_callsign; 67ax25_address rose_callsign;
68 68
69/* 69/*
70 * ROSE network devices are virtual network devices encapsulating ROSE
71 * frames into AX.25 which will be sent through an AX.25 device, so form a
72 * special "super class" of normal net devices; split their locks off into a
73 * separate class since they always nest.
74 */
75static struct lock_class_key rose_netdev_xmit_lock_key;
76
77/*
70 * Convert a ROSE address into text. 78 * Convert a ROSE address into text.
71 */ 79 */
72const char *rose2asc(const rose_address *addr) 80const char *rose2asc(const rose_address *addr)
@@ -1490,14 +1498,13 @@ static int __init rose_proto_init(void)
1490 1498
1491 rose_callsign = null_ax25_address; 1499 rose_callsign = null_ax25_address;
1492 1500
1493 dev_rose = kmalloc(rose_ndevs * sizeof(struct net_device *), GFP_KERNEL); 1501 dev_rose = kzalloc(rose_ndevs * sizeof(struct net_device *), GFP_KERNEL);
1494 if (dev_rose == NULL) { 1502 if (dev_rose == NULL) {
1495 printk(KERN_ERR "ROSE: rose_proto_init - unable to allocate device structure\n"); 1503 printk(KERN_ERR "ROSE: rose_proto_init - unable to allocate device structure\n");
1496 rc = -ENOMEM; 1504 rc = -ENOMEM;
1497 goto out_proto_unregister; 1505 goto out_proto_unregister;
1498 } 1506 }
1499 1507
1500 memset(dev_rose, 0x00, rose_ndevs * sizeof(struct net_device*));
1501 for (i = 0; i < rose_ndevs; i++) { 1508 for (i = 0; i < rose_ndevs; i++) {
1502 struct net_device *dev; 1509 struct net_device *dev;
1503 char name[IFNAMSIZ]; 1510 char name[IFNAMSIZ];
@@ -1516,6 +1523,7 @@ static int __init rose_proto_init(void)
1516 free_netdev(dev); 1523 free_netdev(dev);
1517 goto fail; 1524 goto fail;
1518 } 1525 }
1526 lockdep_set_class(&dev->_xmit_lock, &rose_netdev_xmit_lock_key);
1519 dev_rose[i] = dev; 1527 dev_rose[i] = dev;
1520 } 1528 }
1521 1529
diff --git a/net/rxrpc/connection.c b/net/rxrpc/connection.c
index 573b572f8f91..93d2c55ad2d5 100644
--- a/net/rxrpc/connection.c
+++ b/net/rxrpc/connection.c
@@ -58,13 +58,12 @@ static inline int __rxrpc_create_connection(struct rxrpc_peer *peer,
58 _enter("%p",peer); 58 _enter("%p",peer);
59 59
60 /* allocate and initialise a connection record */ 60 /* allocate and initialise a connection record */
61 conn = kmalloc(sizeof(struct rxrpc_connection), GFP_KERNEL); 61 conn = kzalloc(sizeof(struct rxrpc_connection), GFP_KERNEL);
62 if (!conn) { 62 if (!conn) {
63 _leave(" = -ENOMEM"); 63 _leave(" = -ENOMEM");
64 return -ENOMEM; 64 return -ENOMEM;
65 } 65 }
66 66
67 memset(conn, 0, sizeof(struct rxrpc_connection));
68 atomic_set(&conn->usage, 1); 67 atomic_set(&conn->usage, 1);
69 68
70 INIT_LIST_HEAD(&conn->link); 69 INIT_LIST_HEAD(&conn->link);
@@ -535,13 +534,12 @@ int rxrpc_conn_newmsg(struct rxrpc_connection *conn,
535 return -EINVAL; 534 return -EINVAL;
536 } 535 }
537 536
538 msg = kmalloc(sizeof(struct rxrpc_message), alloc_flags); 537 msg = kzalloc(sizeof(struct rxrpc_message), alloc_flags);
539 if (!msg) { 538 if (!msg) {
540 _leave(" = -ENOMEM"); 539 _leave(" = -ENOMEM");
541 return -ENOMEM; 540 return -ENOMEM;
542 } 541 }
543 542
544 memset(msg, 0, sizeof(*msg));
545 atomic_set(&msg->usage, 1); 543 atomic_set(&msg->usage, 1);
546 544
547 INIT_LIST_HEAD(&msg->link); 545 INIT_LIST_HEAD(&msg->link);
diff --git a/net/rxrpc/peer.c b/net/rxrpc/peer.c
index ed38f5b17c1b..8a275157a3bb 100644
--- a/net/rxrpc/peer.c
+++ b/net/rxrpc/peer.c
@@ -58,13 +58,12 @@ static int __rxrpc_create_peer(struct rxrpc_transport *trans, __be32 addr,
58 _enter("%p,%08x", trans, ntohl(addr)); 58 _enter("%p,%08x", trans, ntohl(addr));
59 59
60 /* allocate and initialise a peer record */ 60 /* allocate and initialise a peer record */
61 peer = kmalloc(sizeof(struct rxrpc_peer), GFP_KERNEL); 61 peer = kzalloc(sizeof(struct rxrpc_peer), GFP_KERNEL);
62 if (!peer) { 62 if (!peer) {
63 _leave(" = -ENOMEM"); 63 _leave(" = -ENOMEM");
64 return -ENOMEM; 64 return -ENOMEM;
65 } 65 }
66 66
67 memset(peer, 0, sizeof(struct rxrpc_peer));
68 atomic_set(&peer->usage, 1); 67 atomic_set(&peer->usage, 1);
69 68
70 INIT_LIST_HEAD(&peer->link); 69 INIT_LIST_HEAD(&peer->link);
diff --git a/net/rxrpc/transport.c b/net/rxrpc/transport.c
index dbe6105e83a5..465efc86fccf 100644
--- a/net/rxrpc/transport.c
+++ b/net/rxrpc/transport.c
@@ -68,11 +68,10 @@ int rxrpc_create_transport(unsigned short port,
68 68
69 _enter("%hu", port); 69 _enter("%hu", port);
70 70
71 trans = kmalloc(sizeof(struct rxrpc_transport), GFP_KERNEL); 71 trans = kzalloc(sizeof(struct rxrpc_transport), GFP_KERNEL);
72 if (!trans) 72 if (!trans)
73 return -ENOMEM; 73 return -ENOMEM;
74 74
75 memset(trans, 0, sizeof(struct rxrpc_transport));
76 atomic_set(&trans->usage, 1); 75 atomic_set(&trans->usage, 1);
77 INIT_LIST_HEAD(&trans->services); 76 INIT_LIST_HEAD(&trans->services);
78 INIT_LIST_HEAD(&trans->link); 77 INIT_LIST_HEAD(&trans->link);
@@ -312,13 +311,12 @@ static int rxrpc_incoming_msg(struct rxrpc_transport *trans,
312 311
313 _enter(""); 312 _enter("");
314 313
315 msg = kmalloc(sizeof(struct rxrpc_message), GFP_KERNEL); 314 msg = kzalloc(sizeof(struct rxrpc_message), GFP_KERNEL);
316 if (!msg) { 315 if (!msg) {
317 _leave(" = -ENOMEM"); 316 _leave(" = -ENOMEM");
318 return -ENOMEM; 317 return -ENOMEM;
319 } 318 }
320 319
321 memset(msg, 0, sizeof(*msg));
322 atomic_set(&msg->usage, 1); 320 atomic_set(&msg->usage, 1);
323 list_add_tail(&msg->link,msgq); 321 list_add_tail(&msg->link,msgq);
324 322
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 5b9397b33238..a2587b52e531 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -250,15 +250,17 @@ tcf_action_dump(struct sk_buff *skb, struct tc_action *act, int bind, int ref)
250 RTA_PUT(skb, a->order, 0, NULL); 250 RTA_PUT(skb, a->order, 0, NULL);
251 err = tcf_action_dump_1(skb, a, bind, ref); 251 err = tcf_action_dump_1(skb, a, bind, ref);
252 if (err < 0) 252 if (err < 0)
253 goto rtattr_failure; 253 goto errout;
254 r->rta_len = skb->tail - (u8*)r; 254 r->rta_len = skb->tail - (u8*)r;
255 } 255 }
256 256
257 return 0; 257 return 0;
258 258
259rtattr_failure: 259rtattr_failure:
260 err = -EINVAL;
261errout:
260 skb_trim(skb, b - skb->data); 262 skb_trim(skb, b - skb->data);
261 return -err; 263 return err;
262} 264}
263 265
264struct tc_action *tcf_action_init_1(struct rtattr *rta, struct rtattr *est, 266struct tc_action *tcf_action_init_1(struct rtattr *rta, struct rtattr *est,
@@ -305,14 +307,14 @@ struct tc_action *tcf_action_init_1(struct rtattr *rta, struct rtattr *est,
305 goto err_mod; 307 goto err_mod;
306 } 308 }
307#endif 309#endif
310 *err = -ENOENT;
308 goto err_out; 311 goto err_out;
309 } 312 }
310 313
311 *err = -ENOMEM; 314 *err = -ENOMEM;
312 a = kmalloc(sizeof(*a), GFP_KERNEL); 315 a = kzalloc(sizeof(*a), GFP_KERNEL);
313 if (a == NULL) 316 if (a == NULL)
314 goto err_mod; 317 goto err_mod;
315 memset(a, 0, sizeof(*a));
316 318
317 /* backward compatibility for policer */ 319 /* backward compatibility for policer */
318 if (name == NULL) 320 if (name == NULL)
@@ -489,10 +491,9 @@ tcf_action_get_1(struct rtattr *rta, struct nlmsghdr *n, u32 pid, int *err)
489 index = *(int *)RTA_DATA(tb[TCA_ACT_INDEX - 1]); 491 index = *(int *)RTA_DATA(tb[TCA_ACT_INDEX - 1]);
490 492
491 *err = -ENOMEM; 493 *err = -ENOMEM;
492 a = kmalloc(sizeof(struct tc_action), GFP_KERNEL); 494 a = kzalloc(sizeof(struct tc_action), GFP_KERNEL);
493 if (a == NULL) 495 if (a == NULL)
494 return NULL; 496 return NULL;
495 memset(a, 0, sizeof(struct tc_action));
496 497
497 *err = -EINVAL; 498 *err = -EINVAL;
498 a->ops = tc_lookup_action(tb[TCA_ACT_KIND - 1]); 499 a->ops = tc_lookup_action(tb[TCA_ACT_KIND - 1]);
@@ -528,12 +529,11 @@ static struct tc_action *create_a(int i)
528{ 529{
529 struct tc_action *act; 530 struct tc_action *act;
530 531
531 act = kmalloc(sizeof(*act), GFP_KERNEL); 532 act = kzalloc(sizeof(*act), GFP_KERNEL);
532 if (act == NULL) { 533 if (act == NULL) {
533 printk("create_a: failed to alloc!\n"); 534 printk("create_a: failed to alloc!\n");
534 return NULL; 535 return NULL;
535 } 536 }
536 memset(act, 0, sizeof(*act));
537 act->order = i; 537 act->order = i;
538 return act; 538 return act;
539} 539}
@@ -599,8 +599,8 @@ static int tca_action_flush(struct rtattr *rta, struct nlmsghdr *n, u32 pid)
599 return err; 599 return err;
600 600
601rtattr_failure: 601rtattr_failure:
602 module_put(a->ops->owner);
603nlmsg_failure: 602nlmsg_failure:
603 module_put(a->ops->owner);
604err_out: 604err_out:
605 kfree_skb(skb); 605 kfree_skb(skb);
606 kfree(a); 606 kfree(a);
@@ -776,7 +776,7 @@ replay:
776 return ret; 776 return ret;
777} 777}
778 778
779static char * 779static struct rtattr *
780find_dump_kind(struct nlmsghdr *n) 780find_dump_kind(struct nlmsghdr *n)
781{ 781{
782 struct rtattr *tb1, *tb2[TCA_ACT_MAX+1]; 782 struct rtattr *tb1, *tb2[TCA_ACT_MAX+1];
@@ -804,7 +804,7 @@ find_dump_kind(struct nlmsghdr *n)
804 return NULL; 804 return NULL;
805 kind = tb2[TCA_ACT_KIND-1]; 805 kind = tb2[TCA_ACT_KIND-1];
806 806
807 return (char *) RTA_DATA(kind); 807 return kind;
808} 808}
809 809
810static int 810static int
@@ -817,16 +817,15 @@ tc_dump_action(struct sk_buff *skb, struct netlink_callback *cb)
817 struct tc_action a; 817 struct tc_action a;
818 int ret = 0; 818 int ret = 0;
819 struct tcamsg *t = (struct tcamsg *) NLMSG_DATA(cb->nlh); 819 struct tcamsg *t = (struct tcamsg *) NLMSG_DATA(cb->nlh);
820 char *kind = find_dump_kind(cb->nlh); 820 struct rtattr *kind = find_dump_kind(cb->nlh);
821 821
822 if (kind == NULL) { 822 if (kind == NULL) {
823 printk("tc_dump_action: action bad kind\n"); 823 printk("tc_dump_action: action bad kind\n");
824 return 0; 824 return 0;
825 } 825 }
826 826
827 a_o = tc_lookup_action_n(kind); 827 a_o = tc_lookup_action(kind);
828 if (a_o == NULL) { 828 if (a_o == NULL) {
829 printk("failed to find %s\n", kind);
830 return 0; 829 return 0;
831 } 830 }
832 831
@@ -834,7 +833,7 @@ tc_dump_action(struct sk_buff *skb, struct netlink_callback *cb)
834 a.ops = a_o; 833 a.ops = a_o;
835 834
836 if (a_o->walk == NULL) { 835 if (a_o->walk == NULL) {
837 printk("tc_dump_action: %s !capable of dumping table\n", kind); 836 printk("tc_dump_action: %s !capable of dumping table\n", a_o->kind);
838 goto rtattr_failure; 837 goto rtattr_failure;
839 } 838 }
840 839
@@ -882,8 +881,6 @@ static int __init tc_action_init(void)
882 link_p[RTM_GETACTION-RTM_BASE].dumpit = tc_dump_action; 881 link_p[RTM_GETACTION-RTM_BASE].dumpit = tc_dump_action;
883 } 882 }
884 883
885 printk("TC classifier action (bugs to netdev@vger.kernel.org cc "
886 "hadi@cyberus.ca)\n");
887 return 0; 884 return 0;
888} 885}
889 886
diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c
index 58b3a8652042..f257475e0e0c 100644
--- a/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -209,10 +209,9 @@ tcf_pedit_dump(struct sk_buff *skb, struct tc_action *a,int bind, int ref)
209 s = sizeof(*opt) + p->nkeys * sizeof(struct tc_pedit_key); 209 s = sizeof(*opt) + p->nkeys * sizeof(struct tc_pedit_key);
210 210
211 /* netlink spinlocks held above us - must use ATOMIC */ 211 /* netlink spinlocks held above us - must use ATOMIC */
212 opt = kmalloc(s, GFP_ATOMIC); 212 opt = kzalloc(s, GFP_ATOMIC);
213 if (opt == NULL) 213 if (opt == NULL)
214 return -ENOBUFS; 214 return -ENOBUFS;
215 memset(opt, 0, s);
216 215
217 memcpy(opt->keys, p->keys, p->nkeys * sizeof(struct tc_pedit_key)); 216 memcpy(opt->keys, p->keys, p->nkeys * sizeof(struct tc_pedit_key));
218 opt->index = p->index; 217 opt->index = p->index;
diff --git a/net/sched/act_police.c b/net/sched/act_police.c
index 47e00bd9625e..da905d7b4b40 100644
--- a/net/sched/act_police.c
+++ b/net/sched/act_police.c
@@ -196,10 +196,9 @@ static int tcf_act_police_locate(struct rtattr *rta, struct rtattr *est,
196 return ret; 196 return ret;
197 } 197 }
198 198
199 p = kmalloc(sizeof(*p), GFP_KERNEL); 199 p = kzalloc(sizeof(*p), GFP_KERNEL);
200 if (p == NULL) 200 if (p == NULL)
201 return -ENOMEM; 201 return -ENOMEM;
202 memset(p, 0, sizeof(*p));
203 202
204 ret = ACT_P_CREATED; 203 ret = ACT_P_CREATED;
205 p->refcnt = 1; 204 p->refcnt = 1;
@@ -429,11 +428,10 @@ struct tcf_police * tcf_police_locate(struct rtattr *rta, struct rtattr *est)
429 return p; 428 return p;
430 } 429 }
431 430
432 p = kmalloc(sizeof(*p), GFP_KERNEL); 431 p = kzalloc(sizeof(*p), GFP_KERNEL);
433 if (p == NULL) 432 if (p == NULL)
434 return NULL; 433 return NULL;
435 434
436 memset(p, 0, sizeof(*p));
437 p->refcnt = 1; 435 p->refcnt = 1;
438 spin_lock_init(&p->lock); 436 spin_lock_init(&p->lock);
439 p->stats_lock = &p->lock; 437 p->stats_lock = &p->lock;
diff --git a/net/sched/cls_basic.c b/net/sched/cls_basic.c
index 61507f006b11..86cac49a0531 100644
--- a/net/sched/cls_basic.c
+++ b/net/sched/cls_basic.c
@@ -178,19 +178,17 @@ static int basic_change(struct tcf_proto *tp, unsigned long base, u32 handle,
178 178
179 err = -ENOBUFS; 179 err = -ENOBUFS;
180 if (head == NULL) { 180 if (head == NULL) {
181 head = kmalloc(sizeof(*head), GFP_KERNEL); 181 head = kzalloc(sizeof(*head), GFP_KERNEL);
182 if (head == NULL) 182 if (head == NULL)
183 goto errout; 183 goto errout;
184 184
185 memset(head, 0, sizeof(*head));
186 INIT_LIST_HEAD(&head->flist); 185 INIT_LIST_HEAD(&head->flist);
187 tp->root = head; 186 tp->root = head;
188 } 187 }
189 188
190 f = kmalloc(sizeof(*f), GFP_KERNEL); 189 f = kzalloc(sizeof(*f), GFP_KERNEL);
191 if (f == NULL) 190 if (f == NULL)
192 goto errout; 191 goto errout;
193 memset(f, 0, sizeof(*f));
194 192
195 err = -EINVAL; 193 err = -EINVAL;
196 if (handle) 194 if (handle)
diff --git a/net/sched/cls_fw.c b/net/sched/cls_fw.c
index d41de91fc4f6..e6973d9b686d 100644
--- a/net/sched/cls_fw.c
+++ b/net/sched/cls_fw.c
@@ -267,20 +267,18 @@ static int fw_change(struct tcf_proto *tp, unsigned long base,
267 return -EINVAL; 267 return -EINVAL;
268 268
269 if (head == NULL) { 269 if (head == NULL) {
270 head = kmalloc(sizeof(struct fw_head), GFP_KERNEL); 270 head = kzalloc(sizeof(struct fw_head), GFP_KERNEL);
271 if (head == NULL) 271 if (head == NULL)
272 return -ENOBUFS; 272 return -ENOBUFS;
273 memset(head, 0, sizeof(*head));
274 273
275 tcf_tree_lock(tp); 274 tcf_tree_lock(tp);
276 tp->root = head; 275 tp->root = head;
277 tcf_tree_unlock(tp); 276 tcf_tree_unlock(tp);
278 } 277 }
279 278
280 f = kmalloc(sizeof(struct fw_filter), GFP_KERNEL); 279 f = kzalloc(sizeof(struct fw_filter), GFP_KERNEL);
281 if (f == NULL) 280 if (f == NULL)
282 return -ENOBUFS; 281 return -ENOBUFS;
283 memset(f, 0, sizeof(*f));
284 282
285 f->id = handle; 283 f->id = handle;
286 284
diff --git a/net/sched/cls_route.c b/net/sched/cls_route.c
index c2e71900f7bd..d3aea730d4c8 100644
--- a/net/sched/cls_route.c
+++ b/net/sched/cls_route.c
@@ -396,10 +396,9 @@ static int route4_set_parms(struct tcf_proto *tp, unsigned long base,
396 h1 = to_hash(nhandle); 396 h1 = to_hash(nhandle);
397 if ((b = head->table[h1]) == NULL) { 397 if ((b = head->table[h1]) == NULL) {
398 err = -ENOBUFS; 398 err = -ENOBUFS;
399 b = kmalloc(sizeof(struct route4_bucket), GFP_KERNEL); 399 b = kzalloc(sizeof(struct route4_bucket), GFP_KERNEL);
400 if (b == NULL) 400 if (b == NULL)
401 goto errout; 401 goto errout;
402 memset(b, 0, sizeof(*b));
403 402
404 tcf_tree_lock(tp); 403 tcf_tree_lock(tp);
405 head->table[h1] = b; 404 head->table[h1] = b;
@@ -475,20 +474,18 @@ static int route4_change(struct tcf_proto *tp, unsigned long base,
475 474
476 err = -ENOBUFS; 475 err = -ENOBUFS;
477 if (head == NULL) { 476 if (head == NULL) {
478 head = kmalloc(sizeof(struct route4_head), GFP_KERNEL); 477 head = kzalloc(sizeof(struct route4_head), GFP_KERNEL);
479 if (head == NULL) 478 if (head == NULL)
480 goto errout; 479 goto errout;
481 memset(head, 0, sizeof(struct route4_head));
482 480
483 tcf_tree_lock(tp); 481 tcf_tree_lock(tp);
484 tp->root = head; 482 tp->root = head;
485 tcf_tree_unlock(tp); 483 tcf_tree_unlock(tp);
486 } 484 }
487 485
488 f = kmalloc(sizeof(struct route4_filter), GFP_KERNEL); 486 f = kzalloc(sizeof(struct route4_filter), GFP_KERNEL);
489 if (f == NULL) 487 if (f == NULL)
490 goto errout; 488 goto errout;
491 memset(f, 0, sizeof(*f));
492 489
493 err = route4_set_parms(tp, base, f, handle, head, tb, 490 err = route4_set_parms(tp, base, f, handle, head, tb,
494 tca[TCA_RATE-1], 1); 491 tca[TCA_RATE-1], 1);
diff --git a/net/sched/cls_rsvp.h b/net/sched/cls_rsvp.h
index ba8741971629..6e230ecfba05 100644
--- a/net/sched/cls_rsvp.h
+++ b/net/sched/cls_rsvp.h
@@ -240,9 +240,8 @@ static int rsvp_init(struct tcf_proto *tp)
240{ 240{
241 struct rsvp_head *data; 241 struct rsvp_head *data;
242 242
243 data = kmalloc(sizeof(struct rsvp_head), GFP_KERNEL); 243 data = kzalloc(sizeof(struct rsvp_head), GFP_KERNEL);
244 if (data) { 244 if (data) {
245 memset(data, 0, sizeof(struct rsvp_head));
246 tp->root = data; 245 tp->root = data;
247 return 0; 246 return 0;
248 } 247 }
@@ -446,11 +445,10 @@ static int rsvp_change(struct tcf_proto *tp, unsigned long base,
446 goto errout2; 445 goto errout2;
447 446
448 err = -ENOBUFS; 447 err = -ENOBUFS;
449 f = kmalloc(sizeof(struct rsvp_filter), GFP_KERNEL); 448 f = kzalloc(sizeof(struct rsvp_filter), GFP_KERNEL);
450 if (f == NULL) 449 if (f == NULL)
451 goto errout2; 450 goto errout2;
452 451
453 memset(f, 0, sizeof(*f));
454 h2 = 16; 452 h2 = 16;
455 if (tb[TCA_RSVP_SRC-1]) { 453 if (tb[TCA_RSVP_SRC-1]) {
456 err = -EINVAL; 454 err = -EINVAL;
@@ -532,10 +530,9 @@ insert:
532 /* No session found. Create new one. */ 530 /* No session found. Create new one. */
533 531
534 err = -ENOBUFS; 532 err = -ENOBUFS;
535 s = kmalloc(sizeof(struct rsvp_session), GFP_KERNEL); 533 s = kzalloc(sizeof(struct rsvp_session), GFP_KERNEL);
536 if (s == NULL) 534 if (s == NULL)
537 goto errout; 535 goto errout;
538 memset(s, 0, sizeof(*s));
539 memcpy(s->dst, dst, sizeof(s->dst)); 536 memcpy(s->dst, dst, sizeof(s->dst));
540 537
541 if (pinfo) { 538 if (pinfo) {
diff --git a/net/sched/cls_tcindex.c b/net/sched/cls_tcindex.c
index 7870e7bb0bac..5af8a59e1503 100644
--- a/net/sched/cls_tcindex.c
+++ b/net/sched/cls_tcindex.c
@@ -148,11 +148,10 @@ static int tcindex_init(struct tcf_proto *tp)
148 struct tcindex_data *p; 148 struct tcindex_data *p;
149 149
150 DPRINTK("tcindex_init(tp %p)\n",tp); 150 DPRINTK("tcindex_init(tp %p)\n",tp);
151 p = kmalloc(sizeof(struct tcindex_data),GFP_KERNEL); 151 p = kzalloc(sizeof(struct tcindex_data),GFP_KERNEL);
152 if (!p) 152 if (!p)
153 return -ENOMEM; 153 return -ENOMEM;
154 154
155 memset(p, 0, sizeof(*p));
156 p->mask = 0xffff; 155 p->mask = 0xffff;
157 p->hash = DEFAULT_HASH_SIZE; 156 p->hash = DEFAULT_HASH_SIZE;
158 p->fall_through = 1; 157 p->fall_through = 1;
@@ -296,16 +295,14 @@ tcindex_set_parms(struct tcf_proto *tp, unsigned long base, u32 handle,
296 err = -ENOMEM; 295 err = -ENOMEM;
297 if (!cp.perfect && !cp.h) { 296 if (!cp.perfect && !cp.h) {
298 if (valid_perfect_hash(&cp)) { 297 if (valid_perfect_hash(&cp)) {
299 cp.perfect = kmalloc(cp.hash * sizeof(*r), GFP_KERNEL); 298 cp.perfect = kcalloc(cp.hash, sizeof(*r), GFP_KERNEL);
300 if (!cp.perfect) 299 if (!cp.perfect)
301 goto errout; 300 goto errout;
302 memset(cp.perfect, 0, cp.hash * sizeof(*r));
303 balloc = 1; 301 balloc = 1;
304 } else { 302 } else {
305 cp.h = kmalloc(cp.hash * sizeof(f), GFP_KERNEL); 303 cp.h = kcalloc(cp.hash, sizeof(f), GFP_KERNEL);
306 if (!cp.h) 304 if (!cp.h)
307 goto errout; 305 goto errout;
308 memset(cp.h, 0, cp.hash * sizeof(f));
309 balloc = 2; 306 balloc = 2;
310 } 307 }
311 } 308 }
@@ -316,10 +313,9 @@ tcindex_set_parms(struct tcf_proto *tp, unsigned long base, u32 handle,
316 r = tcindex_lookup(&cp, handle) ? : &new_filter_result; 313 r = tcindex_lookup(&cp, handle) ? : &new_filter_result;
317 314
318 if (r == &new_filter_result) { 315 if (r == &new_filter_result) {
319 f = kmalloc(sizeof(*f), GFP_KERNEL); 316 f = kzalloc(sizeof(*f), GFP_KERNEL);
320 if (!f) 317 if (!f)
321 goto errout_alloc; 318 goto errout_alloc;
322 memset(f, 0, sizeof(*f));
323 } 319 }
324 320
325 if (tb[TCA_TCINDEX_CLASSID-1]) { 321 if (tb[TCA_TCINDEX_CLASSID-1]) {
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
index d712edcd1bcf..eea366966740 100644
--- a/net/sched/cls_u32.c
+++ b/net/sched/cls_u32.c
@@ -307,23 +307,21 @@ static int u32_init(struct tcf_proto *tp)
307 if (tp_c->q == tp->q) 307 if (tp_c->q == tp->q)
308 break; 308 break;
309 309
310 root_ht = kmalloc(sizeof(*root_ht), GFP_KERNEL); 310 root_ht = kzalloc(sizeof(*root_ht), GFP_KERNEL);
311 if (root_ht == NULL) 311 if (root_ht == NULL)
312 return -ENOBUFS; 312 return -ENOBUFS;
313 313
314 memset(root_ht, 0, sizeof(*root_ht));
315 root_ht->divisor = 0; 314 root_ht->divisor = 0;
316 root_ht->refcnt++; 315 root_ht->refcnt++;
317 root_ht->handle = tp_c ? gen_new_htid(tp_c) : 0x80000000; 316 root_ht->handle = tp_c ? gen_new_htid(tp_c) : 0x80000000;
318 root_ht->prio = tp->prio; 317 root_ht->prio = tp->prio;
319 318
320 if (tp_c == NULL) { 319 if (tp_c == NULL) {
321 tp_c = kmalloc(sizeof(*tp_c), GFP_KERNEL); 320 tp_c = kzalloc(sizeof(*tp_c), GFP_KERNEL);
322 if (tp_c == NULL) { 321 if (tp_c == NULL) {
323 kfree(root_ht); 322 kfree(root_ht);
324 return -ENOBUFS; 323 return -ENOBUFS;
325 } 324 }
326 memset(tp_c, 0, sizeof(*tp_c));
327 tp_c->q = tp->q; 325 tp_c->q = tp->q;
328 tp_c->next = u32_list; 326 tp_c->next = u32_list;
329 u32_list = tp_c; 327 u32_list = tp_c;
@@ -571,10 +569,9 @@ static int u32_change(struct tcf_proto *tp, unsigned long base, u32 handle,
571 if (handle == 0) 569 if (handle == 0)
572 return -ENOMEM; 570 return -ENOMEM;
573 } 571 }
574 ht = kmalloc(sizeof(*ht) + divisor*sizeof(void*), GFP_KERNEL); 572 ht = kzalloc(sizeof(*ht) + divisor*sizeof(void*), GFP_KERNEL);
575 if (ht == NULL) 573 if (ht == NULL)
576 return -ENOBUFS; 574 return -ENOBUFS;
577 memset(ht, 0, sizeof(*ht) + divisor*sizeof(void*));
578 ht->tp_c = tp_c; 575 ht->tp_c = tp_c;
579 ht->refcnt = 0; 576 ht->refcnt = 0;
580 ht->divisor = divisor; 577 ht->divisor = divisor;
@@ -617,18 +614,16 @@ static int u32_change(struct tcf_proto *tp, unsigned long base, u32 handle,
617 614
618 s = RTA_DATA(tb[TCA_U32_SEL-1]); 615 s = RTA_DATA(tb[TCA_U32_SEL-1]);
619 616
620 n = kmalloc(sizeof(*n) + s->nkeys*sizeof(struct tc_u32_key), GFP_KERNEL); 617 n = kzalloc(sizeof(*n) + s->nkeys*sizeof(struct tc_u32_key), GFP_KERNEL);
621 if (n == NULL) 618 if (n == NULL)
622 return -ENOBUFS; 619 return -ENOBUFS;
623 620
624 memset(n, 0, sizeof(*n) + s->nkeys*sizeof(struct tc_u32_key));
625#ifdef CONFIG_CLS_U32_PERF 621#ifdef CONFIG_CLS_U32_PERF
626 n->pf = kmalloc(sizeof(struct tc_u32_pcnt) + s->nkeys*sizeof(u64), GFP_KERNEL); 622 n->pf = kzalloc(sizeof(struct tc_u32_pcnt) + s->nkeys*sizeof(u64), GFP_KERNEL);
627 if (n->pf == NULL) { 623 if (n->pf == NULL) {
628 kfree(n); 624 kfree(n);
629 return -ENOBUFS; 625 return -ENOBUFS;
630 } 626 }
631 memset(n->pf, 0, sizeof(struct tc_u32_pcnt) + s->nkeys*sizeof(u64));
632#endif 627#endif
633 628
634 memcpy(&n->sel, s, sizeof(*s) + s->nkeys*sizeof(struct tc_u32_key)); 629 memcpy(&n->sel, s, sizeof(*s) + s->nkeys*sizeof(struct tc_u32_key));
diff --git a/net/sched/em_meta.c b/net/sched/em_meta.c
index 698372954f4d..61e3b740ab1a 100644
--- a/net/sched/em_meta.c
+++ b/net/sched/em_meta.c
@@ -773,10 +773,9 @@ static int em_meta_change(struct tcf_proto *tp, void *data, int len,
773 TCF_META_ID(hdr->right.kind) > TCF_META_ID_MAX) 773 TCF_META_ID(hdr->right.kind) > TCF_META_ID_MAX)
774 goto errout; 774 goto errout;
775 775
776 meta = kmalloc(sizeof(*meta), GFP_KERNEL); 776 meta = kzalloc(sizeof(*meta), GFP_KERNEL);
777 if (meta == NULL) 777 if (meta == NULL)
778 goto errout; 778 goto errout;
779 memset(meta, 0, sizeof(*meta));
780 779
781 memcpy(&meta->lvalue.hdr, &hdr->left, sizeof(hdr->left)); 780 memcpy(&meta->lvalue.hdr, &hdr->left, sizeof(hdr->left));
782 memcpy(&meta->rvalue.hdr, &hdr->right, sizeof(hdr->right)); 781 memcpy(&meta->rvalue.hdr, &hdr->right, sizeof(hdr->right));
diff --git a/net/sched/ematch.c b/net/sched/ematch.c
index 2405a86093a2..0fd0768a17c6 100644
--- a/net/sched/ematch.c
+++ b/net/sched/ematch.c
@@ -321,10 +321,9 @@ int tcf_em_tree_validate(struct tcf_proto *tp, struct rtattr *rta,
321 list_len = RTA_PAYLOAD(rt_list); 321 list_len = RTA_PAYLOAD(rt_list);
322 matches_len = tree_hdr->nmatches * sizeof(*em); 322 matches_len = tree_hdr->nmatches * sizeof(*em);
323 323
324 tree->matches = kmalloc(matches_len, GFP_KERNEL); 324 tree->matches = kzalloc(matches_len, GFP_KERNEL);
325 if (tree->matches == NULL) 325 if (tree->matches == NULL)
326 goto errout; 326 goto errout;
327 memset(tree->matches, 0, matches_len);
328 327
329 /* We do not use rtattr_parse_nested here because the maximum 328 /* We do not use rtattr_parse_nested here because the maximum
330 * number of attributes is unknown. This saves us the allocation 329 * number of attributes is unknown. This saves us the allocation
diff --git a/net/sched/estimator.c b/net/sched/estimator.c
index 5d3ae03e22a7..0ebc98e9be2d 100644
--- a/net/sched/estimator.c
+++ b/net/sched/estimator.c
@@ -139,11 +139,10 @@ int qdisc_new_estimator(struct tc_stats *stats, spinlock_t *stats_lock, struct r
139 if (parm->interval < -2 || parm->interval > 3) 139 if (parm->interval < -2 || parm->interval > 3)
140 return -EINVAL; 140 return -EINVAL;
141 141
142 est = kmalloc(sizeof(*est), GFP_KERNEL); 142 est = kzalloc(sizeof(*est), GFP_KERNEL);
143 if (est == NULL) 143 if (est == NULL)
144 return -ENOBUFS; 144 return -ENOBUFS;
145 145
146 memset(est, 0, sizeof(*est));
147 est->interval = parm->interval + 2; 146 est->interval = parm->interval + 2;
148 est->stats = stats; 147 est->stats = stats;
149 est->stats_lock = stats_lock; 148 est->stats_lock = stats_lock;
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c
index 80b7f6a8d008..bac881bfe362 100644
--- a/net/sched/sch_cbq.c
+++ b/net/sched/sch_cbq.c
@@ -1926,10 +1926,9 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct rtattr **t
1926 } 1926 }
1927 1927
1928 err = -ENOBUFS; 1928 err = -ENOBUFS;
1929 cl = kmalloc(sizeof(*cl), GFP_KERNEL); 1929 cl = kzalloc(sizeof(*cl), GFP_KERNEL);
1930 if (cl == NULL) 1930 if (cl == NULL)
1931 goto failure; 1931 goto failure;
1932 memset(cl, 0, sizeof(*cl));
1933 cl->R_tab = rtab; 1932 cl->R_tab = rtab;
1934 rtab = NULL; 1933 rtab = NULL;
1935 cl->refcnt = 1; 1934 cl->refcnt = 1;
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index d735f51686a1..0834c2ee9174 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -432,10 +432,9 @@ struct Qdisc *qdisc_alloc(struct net_device *dev, struct Qdisc_ops *ops)
432 size = QDISC_ALIGN(sizeof(*sch)); 432 size = QDISC_ALIGN(sizeof(*sch));
433 size += ops->priv_size + (QDISC_ALIGNTO - 1); 433 size += ops->priv_size + (QDISC_ALIGNTO - 1);
434 434
435 p = kmalloc(size, GFP_KERNEL); 435 p = kzalloc(size, GFP_KERNEL);
436 if (!p) 436 if (!p)
437 goto errout; 437 goto errout;
438 memset(p, 0, size);
439 sch = (struct Qdisc *) QDISC_ALIGN((unsigned long) p); 438 sch = (struct Qdisc *) QDISC_ALIGN((unsigned long) p);
440 sch->padded = (char *) sch - (char *) p; 439 sch->padded = (char *) sch - (char *) p;
441 440
diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c
index 0cafdd5feb1b..18e81a8ffb01 100644
--- a/net/sched/sch_gred.c
+++ b/net/sched/sch_gred.c
@@ -406,10 +406,9 @@ static inline int gred_change_vq(struct Qdisc *sch, int dp,
406 struct gred_sched_data *q; 406 struct gred_sched_data *q;
407 407
408 if (table->tab[dp] == NULL) { 408 if (table->tab[dp] == NULL) {
409 table->tab[dp] = kmalloc(sizeof(*q), GFP_KERNEL); 409 table->tab[dp] = kzalloc(sizeof(*q), GFP_KERNEL);
410 if (table->tab[dp] == NULL) 410 if (table->tab[dp] == NULL)
411 return -ENOMEM; 411 return -ENOMEM;
412 memset(table->tab[dp], 0, sizeof(*q));
413 } 412 }
414 413
415 q = table->tab[dp]; 414 q = table->tab[dp];
diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c
index 6b1b4a981e88..6a6735a2ed35 100644
--- a/net/sched/sch_hfsc.c
+++ b/net/sched/sch_hfsc.c
@@ -1123,10 +1123,9 @@ hfsc_change_class(struct Qdisc *sch, u32 classid, u32 parentid,
1123 if (rsc == NULL && fsc == NULL) 1123 if (rsc == NULL && fsc == NULL)
1124 return -EINVAL; 1124 return -EINVAL;
1125 1125
1126 cl = kmalloc(sizeof(struct hfsc_class), GFP_KERNEL); 1126 cl = kzalloc(sizeof(struct hfsc_class), GFP_KERNEL);
1127 if (cl == NULL) 1127 if (cl == NULL)
1128 return -ENOBUFS; 1128 return -ENOBUFS;
1129 memset(cl, 0, sizeof(struct hfsc_class));
1130 1129
1131 if (rsc != NULL) 1130 if (rsc != NULL)
1132 hfsc_change_rsc(cl, rsc, 0); 1131 hfsc_change_rsc(cl, rsc, 0);
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index 34afe41fa2f3..880a3394a51f 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -196,7 +196,7 @@ struct htb_class
196 struct qdisc_rate_table *rate; /* rate table of the class itself */ 196 struct qdisc_rate_table *rate; /* rate table of the class itself */
197 struct qdisc_rate_table *ceil; /* ceiling rate (limits borrows too) */ 197 struct qdisc_rate_table *ceil; /* ceiling rate (limits borrows too) */
198 long buffer,cbuffer; /* token bucket depth/rate */ 198 long buffer,cbuffer; /* token bucket depth/rate */
199 long mbuffer; /* max wait time */ 199 psched_tdiff_t mbuffer; /* max wait time */
200 long tokens,ctokens; /* current number of tokens */ 200 long tokens,ctokens; /* current number of tokens */
201 psched_time_t t_c; /* checkpoint time */ 201 psched_time_t t_c; /* checkpoint time */
202}; 202};
@@ -1559,10 +1559,9 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
1559 goto failure; 1559 goto failure;
1560 } 1560 }
1561 err = -ENOBUFS; 1561 err = -ENOBUFS;
1562 if ((cl = kmalloc(sizeof(*cl), GFP_KERNEL)) == NULL) 1562 if ((cl = kzalloc(sizeof(*cl), GFP_KERNEL)) == NULL)
1563 goto failure; 1563 goto failure;
1564 1564
1565 memset(cl, 0, sizeof(*cl));
1566 cl->refcnt = 1; 1565 cl->refcnt = 1;
1567 INIT_LIST_HEAD(&cl->sibling); 1566 INIT_LIST_HEAD(&cl->sibling);
1568 INIT_LIST_HEAD(&cl->hlist); 1567 INIT_LIST_HEAD(&cl->hlist);
@@ -1601,7 +1600,7 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
1601 /* set class to be in HTB_CAN_SEND state */ 1600 /* set class to be in HTB_CAN_SEND state */
1602 cl->tokens = hopt->buffer; 1601 cl->tokens = hopt->buffer;
1603 cl->ctokens = hopt->cbuffer; 1602 cl->ctokens = hopt->cbuffer;
1604 cl->mbuffer = 60000000; /* 1min */ 1603 cl->mbuffer = PSCHED_JIFFIE2US(HZ*60); /* 1min */
1605 PSCHED_GET_TIME(cl->t_c); 1604 PSCHED_GET_TIME(cl->t_c);
1606 cl->cmode = HTB_CAN_SEND; 1605 cl->cmode = HTB_CAN_SEND;
1607 1606
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
index c5bd8064e6d8..a08ec4c7c55d 100644
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@ -148,7 +148,8 @@ static long tabledist(unsigned long mu, long sigma,
148static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch) 148static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch)
149{ 149{
150 struct netem_sched_data *q = qdisc_priv(sch); 150 struct netem_sched_data *q = qdisc_priv(sch);
151 struct netem_skb_cb *cb = (struct netem_skb_cb *)skb->cb; 151 /* We don't fill cb now as skb_unshare() may invalidate it */
152 struct netem_skb_cb *cb;
152 struct sk_buff *skb2; 153 struct sk_buff *skb2;
153 int ret; 154 int ret;
154 int count = 1; 155 int count = 1;
@@ -200,6 +201,7 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch)
200 skb->data[net_random() % skb_headlen(skb)] ^= 1<<(net_random() % 8); 201 skb->data[net_random() % skb_headlen(skb)] ^= 1<<(net_random() % 8);
201 } 202 }
202 203
204 cb = (struct netem_skb_cb *)skb->cb;
203 if (q->gap == 0 /* not doing reordering */ 205 if (q->gap == 0 /* not doing reordering */
204 || q->counter < q->gap /* inside last reordering gap */ 206 || q->counter < q->gap /* inside last reordering gap */
205 || q->reorder < get_crandom(&q->reorder_cor)) { 207 || q->reorder < get_crandom(&q->reorder_cor)) {
diff --git a/net/sctp/associola.c b/net/sctp/associola.c
index 9d05e13e92f6..27329ce9c311 100644
--- a/net/sctp/associola.c
+++ b/net/sctp/associola.c
@@ -441,7 +441,8 @@ void sctp_assoc_set_primary(struct sctp_association *asoc,
441 /* If the primary path is changing, assume that the 441 /* If the primary path is changing, assume that the
442 * user wants to use this new path. 442 * user wants to use this new path.
443 */ 443 */
444 if (transport->state != SCTP_INACTIVE) 444 if ((transport->state == SCTP_ACTIVE) ||
445 (transport->state == SCTP_UNKNOWN))
445 asoc->peer.active_path = transport; 446 asoc->peer.active_path = transport;
446 447
447 /* 448 /*
@@ -532,11 +533,11 @@ struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc,
532 port = addr->v4.sin_port; 533 port = addr->v4.sin_port;
533 534
534 SCTP_DEBUG_PRINTK_IPADDR("sctp_assoc_add_peer:association %p addr: ", 535 SCTP_DEBUG_PRINTK_IPADDR("sctp_assoc_add_peer:association %p addr: ",
535 " port: %d state:%s\n", 536 " port: %d state:%d\n",
536 asoc, 537 asoc,
537 addr, 538 addr,
538 addr->v4.sin_port, 539 addr->v4.sin_port,
539 peer_state == SCTP_UNKNOWN?"UNKNOWN":"ACTIVE"); 540 peer_state);
540 541
541 /* Set the port if it has not been set yet. */ 542 /* Set the port if it has not been set yet. */
542 if (0 == asoc->peer.port) 543 if (0 == asoc->peer.port)
@@ -545,9 +546,12 @@ struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc,
545 /* Check to see if this is a duplicate. */ 546 /* Check to see if this is a duplicate. */
546 peer = sctp_assoc_lookup_paddr(asoc, addr); 547 peer = sctp_assoc_lookup_paddr(asoc, addr);
547 if (peer) { 548 if (peer) {
548 if (peer_state == SCTP_ACTIVE && 549 if (peer->state == SCTP_UNKNOWN) {
549 peer->state == SCTP_UNKNOWN) 550 if (peer_state == SCTP_ACTIVE)
550 peer->state = SCTP_ACTIVE; 551 peer->state = SCTP_ACTIVE;
552 if (peer_state == SCTP_UNCONFIRMED)
553 peer->state = SCTP_UNCONFIRMED;
554 }
551 return peer; 555 return peer;
552 } 556 }
553 557
@@ -739,7 +743,8 @@ void sctp_assoc_control_transport(struct sctp_association *asoc,
739 list_for_each(pos, &asoc->peer.transport_addr_list) { 743 list_for_each(pos, &asoc->peer.transport_addr_list) {
740 t = list_entry(pos, struct sctp_transport, transports); 744 t = list_entry(pos, struct sctp_transport, transports);
741 745
742 if (t->state == SCTP_INACTIVE) 746 if ((t->state == SCTP_INACTIVE) ||
747 (t->state == SCTP_UNCONFIRMED))
743 continue; 748 continue;
744 if (!first || t->last_time_heard > first->last_time_heard) { 749 if (!first || t->last_time_heard > first->last_time_heard) {
745 second = first; 750 second = first;
@@ -759,7 +764,8 @@ void sctp_assoc_control_transport(struct sctp_association *asoc,
759 * [If the primary is active but not most recent, bump the most 764 * [If the primary is active but not most recent, bump the most
760 * recently used transport.] 765 * recently used transport.]
761 */ 766 */
762 if (asoc->peer.primary_path->state != SCTP_INACTIVE && 767 if (((asoc->peer.primary_path->state == SCTP_ACTIVE) ||
768 (asoc->peer.primary_path->state == SCTP_UNKNOWN)) &&
763 first != asoc->peer.primary_path) { 769 first != asoc->peer.primary_path) {
764 second = first; 770 second = first;
765 first = asoc->peer.primary_path; 771 first = asoc->peer.primary_path;
@@ -1054,7 +1060,7 @@ void sctp_assoc_update(struct sctp_association *asoc,
1054 transports); 1060 transports);
1055 if (!sctp_assoc_lookup_paddr(asoc, &trans->ipaddr)) 1061 if (!sctp_assoc_lookup_paddr(asoc, &trans->ipaddr))
1056 sctp_assoc_add_peer(asoc, &trans->ipaddr, 1062 sctp_assoc_add_peer(asoc, &trans->ipaddr,
1057 GFP_ATOMIC, SCTP_ACTIVE); 1063 GFP_ATOMIC, trans->state);
1058 } 1064 }
1059 1065
1060 asoc->ctsn_ack_point = asoc->next_tsn - 1; 1066 asoc->ctsn_ack_point = asoc->next_tsn - 1;
@@ -1094,7 +1100,8 @@ void sctp_assoc_update_retran_path(struct sctp_association *asoc)
1094 1100
1095 /* Try to find an active transport. */ 1101 /* Try to find an active transport. */
1096 1102
1097 if (t->state != SCTP_INACTIVE) { 1103 if ((t->state == SCTP_ACTIVE) ||
1104 (t->state == SCTP_UNKNOWN)) {
1098 break; 1105 break;
1099 } else { 1106 } else {
1100 /* Keep track of the next transport in case 1107 /* Keep track of the next transport in case
diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c
index 2b962627f631..2b9c12a170e5 100644
--- a/net/sctp/bind_addr.c
+++ b/net/sctp/bind_addr.c
@@ -146,7 +146,7 @@ void sctp_bind_addr_free(struct sctp_bind_addr *bp)
146 146
147/* Add an address to the bind address list in the SCTP_bind_addr structure. */ 147/* Add an address to the bind address list in the SCTP_bind_addr structure. */
148int sctp_add_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *new, 148int sctp_add_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *new,
149 gfp_t gfp) 149 __u8 use_as_src, gfp_t gfp)
150{ 150{
151 struct sctp_sockaddr_entry *addr; 151 struct sctp_sockaddr_entry *addr;
152 152
@@ -163,6 +163,8 @@ int sctp_add_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *new,
163 if (!addr->a.v4.sin_port) 163 if (!addr->a.v4.sin_port)
164 addr->a.v4.sin_port = bp->port; 164 addr->a.v4.sin_port = bp->port;
165 165
166 addr->use_as_src = use_as_src;
167
166 INIT_LIST_HEAD(&addr->list); 168 INIT_LIST_HEAD(&addr->list);
167 list_add_tail(&addr->list, &bp->address_list); 169 list_add_tail(&addr->list, &bp->address_list);
168 SCTP_DBG_OBJCNT_INC(addr); 170 SCTP_DBG_OBJCNT_INC(addr);
@@ -274,7 +276,7 @@ int sctp_raw_to_bind_addrs(struct sctp_bind_addr *bp, __u8 *raw_addr_list,
274 } 276 }
275 277
276 af->from_addr_param(&addr, rawaddr, port, 0); 278 af->from_addr_param(&addr, rawaddr, port, 0);
277 retval = sctp_add_bind_addr(bp, &addr, gfp); 279 retval = sctp_add_bind_addr(bp, &addr, 1, gfp);
278 if (retval) { 280 if (retval) {
279 /* Can't finish building the list, clean up. */ 281 /* Can't finish building the list, clean up. */
280 sctp_bind_addr_clean(bp); 282 sctp_bind_addr_clean(bp);
@@ -367,7 +369,7 @@ static int sctp_copy_one_addr(struct sctp_bind_addr *dest,
367 (((AF_INET6 == addr->sa.sa_family) && 369 (((AF_INET6 == addr->sa.sa_family) &&
368 (flags & SCTP_ADDR6_ALLOWED) && 370 (flags & SCTP_ADDR6_ALLOWED) &&
369 (flags & SCTP_ADDR6_PEERSUPP)))) 371 (flags & SCTP_ADDR6_PEERSUPP))))
370 error = sctp_add_bind_addr(dest, addr, gfp); 372 error = sctp_add_bind_addr(dest, addr, 1, gfp);
371 } 373 }
372 374
373 return error; 375 return error;
diff --git a/net/sctp/endpointola.c b/net/sctp/endpointola.c
index 67bd53070ee0..ffda1d680529 100644
--- a/net/sctp/endpointola.c
+++ b/net/sctp/endpointola.c
@@ -158,6 +158,12 @@ void sctp_endpoint_add_asoc(struct sctp_endpoint *ep,
158void sctp_endpoint_free(struct sctp_endpoint *ep) 158void sctp_endpoint_free(struct sctp_endpoint *ep)
159{ 159{
160 ep->base.dead = 1; 160 ep->base.dead = 1;
161
162 ep->base.sk->sk_state = SCTP_SS_CLOSED;
163
164 /* Unlink this endpoint, so we can't find it again! */
165 sctp_unhash_endpoint(ep);
166
161 sctp_endpoint_put(ep); 167 sctp_endpoint_put(ep);
162} 168}
163 169
@@ -166,11 +172,6 @@ static void sctp_endpoint_destroy(struct sctp_endpoint *ep)
166{ 172{
167 SCTP_ASSERT(ep->base.dead, "Endpoint is not dead", return); 173 SCTP_ASSERT(ep->base.dead, "Endpoint is not dead", return);
168 174
169 ep->base.sk->sk_state = SCTP_SS_CLOSED;
170
171 /* Unlink this endpoint, so we can't find it again! */
172 sctp_unhash_endpoint(ep);
173
174 /* Free up the HMAC transform. */ 175 /* Free up the HMAC transform. */
175 sctp_crypto_free_tfm(sctp_sk(ep->base.sk)->hmac); 176 sctp_crypto_free_tfm(sctp_sk(ep->base.sk)->hmac);
176 177
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index 8ef08070c8b6..99c0cefc04e0 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -290,7 +290,8 @@ static void sctp_v6_get_saddr(struct sctp_association *asoc,
290 sctp_read_lock(addr_lock); 290 sctp_read_lock(addr_lock);
291 list_for_each(pos, &bp->address_list) { 291 list_for_each(pos, &bp->address_list) {
292 laddr = list_entry(pos, struct sctp_sockaddr_entry, list); 292 laddr = list_entry(pos, struct sctp_sockaddr_entry, list);
293 if ((laddr->a.sa.sa_family == AF_INET6) && 293 if ((laddr->use_as_src) &&
294 (laddr->a.sa.sa_family == AF_INET6) &&
294 (scope <= sctp_scope(&laddr->a))) { 295 (scope <= sctp_scope(&laddr->a))) {
295 bmatchlen = sctp_v6_addr_match_len(daddr, &laddr->a); 296 bmatchlen = sctp_v6_addr_match_len(daddr, &laddr->a);
296 if (!baddr || (matchlen < bmatchlen)) { 297 if (!baddr || (matchlen < bmatchlen)) {
diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
index e5faa351aaad..30b710c54e64 100644
--- a/net/sctp/outqueue.c
+++ b/net/sctp/outqueue.c
@@ -691,7 +691,8 @@ int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout)
691 691
692 if (!new_transport) { 692 if (!new_transport) {
693 new_transport = asoc->peer.active_path; 693 new_transport = asoc->peer.active_path;
694 } else if (new_transport->state == SCTP_INACTIVE) { 694 } else if ((new_transport->state == SCTP_INACTIVE) ||
695 (new_transport->state == SCTP_UNCONFIRMED)) {
695 /* If the chunk is Heartbeat or Heartbeat Ack, 696 /* If the chunk is Heartbeat or Heartbeat Ack,
696 * send it to chunk->transport, even if it's 697 * send it to chunk->transport, even if it's
697 * inactive. 698 * inactive.
@@ -848,7 +849,8 @@ int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout)
848 */ 849 */
849 new_transport = chunk->transport; 850 new_transport = chunk->transport;
850 if (!new_transport || 851 if (!new_transport ||
851 new_transport->state == SCTP_INACTIVE) 852 ((new_transport->state == SCTP_INACTIVE) ||
853 (new_transport->state == SCTP_UNCONFIRMED)))
852 new_transport = asoc->peer.active_path; 854 new_transport = asoc->peer.active_path;
853 855
854 /* Change packets if necessary. */ 856 /* Change packets if necessary. */
@@ -1464,7 +1466,8 @@ static void sctp_check_transmitted(struct sctp_outq *q,
1464 /* Mark the destination transport address as 1466 /* Mark the destination transport address as
1465 * active if it is not so marked. 1467 * active if it is not so marked.
1466 */ 1468 */
1467 if (transport->state == SCTP_INACTIVE) { 1469 if ((transport->state == SCTP_INACTIVE) ||
1470 (transport->state == SCTP_UNCONFIRMED)) {
1468 sctp_assoc_control_transport( 1471 sctp_assoc_control_transport(
1469 transport->asoc, 1472 transport->asoc,
1470 transport, 1473 transport,
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 816c033d7886..1ab03a27a76e 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -240,7 +240,7 @@ int sctp_copy_local_addr_list(struct sctp_bind_addr *bp, sctp_scope_t scope,
240 (((AF_INET6 == addr->a.sa.sa_family) && 240 (((AF_INET6 == addr->a.sa.sa_family) &&
241 (copy_flags & SCTP_ADDR6_ALLOWED) && 241 (copy_flags & SCTP_ADDR6_ALLOWED) &&
242 (copy_flags & SCTP_ADDR6_PEERSUPP)))) { 242 (copy_flags & SCTP_ADDR6_PEERSUPP)))) {
243 error = sctp_add_bind_addr(bp, &addr->a, 243 error = sctp_add_bind_addr(bp, &addr->a, 1,
244 GFP_ATOMIC); 244 GFP_ATOMIC);
245 if (error) 245 if (error)
246 goto end_copy; 246 goto end_copy;
@@ -486,6 +486,8 @@ static struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc,
486 list_for_each(pos, &bp->address_list) { 486 list_for_each(pos, &bp->address_list) {
487 laddr = list_entry(pos, struct sctp_sockaddr_entry, 487 laddr = list_entry(pos, struct sctp_sockaddr_entry,
488 list); 488 list);
489 if (!laddr->use_as_src)
490 continue;
489 sctp_v4_dst_saddr(&dst_saddr, dst, bp->port); 491 sctp_v4_dst_saddr(&dst_saddr, dst, bp->port);
490 if (sctp_v4_cmp_addr(&dst_saddr, &laddr->a)) 492 if (sctp_v4_cmp_addr(&dst_saddr, &laddr->a))
491 goto out_unlock; 493 goto out_unlock;
@@ -506,7 +508,8 @@ static struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc,
506 list_for_each(pos, &bp->address_list) { 508 list_for_each(pos, &bp->address_list) {
507 laddr = list_entry(pos, struct sctp_sockaddr_entry, list); 509 laddr = list_entry(pos, struct sctp_sockaddr_entry, list);
508 510
509 if (AF_INET == laddr->a.sa.sa_family) { 511 if ((laddr->use_as_src) &&
512 (AF_INET == laddr->a.sa.sa_family)) {
510 fl.fl4_src = laddr->a.v4.sin_addr.s_addr; 513 fl.fl4_src = laddr->a.v4.sin_addr.s_addr;
511 if (!ip_route_output_key(&rt, &fl)) { 514 if (!ip_route_output_key(&rt, &fl)) {
512 dst = &rt->u.dst; 515 dst = &rt->u.dst;
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index 2a8773691695..4f11f5858209 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -1493,7 +1493,7 @@ no_hmac:
1493 1493
1494 /* Also, add the destination address. */ 1494 /* Also, add the destination address. */
1495 if (list_empty(&retval->base.bind_addr.address_list)) { 1495 if (list_empty(&retval->base.bind_addr.address_list)) {
1496 sctp_add_bind_addr(&retval->base.bind_addr, &chunk->dest, 1496 sctp_add_bind_addr(&retval->base.bind_addr, &chunk->dest, 1,
1497 GFP_ATOMIC); 1497 GFP_ATOMIC);
1498 } 1498 }
1499 1499
@@ -2017,7 +2017,7 @@ static int sctp_process_param(struct sctp_association *asoc,
2017 af->from_addr_param(&addr, param.addr, asoc->peer.port, 0); 2017 af->from_addr_param(&addr, param.addr, asoc->peer.port, 0);
2018 scope = sctp_scope(peer_addr); 2018 scope = sctp_scope(peer_addr);
2019 if (sctp_in_scope(&addr, scope)) 2019 if (sctp_in_scope(&addr, scope))
2020 if (!sctp_assoc_add_peer(asoc, &addr, gfp, SCTP_ACTIVE)) 2020 if (!sctp_assoc_add_peer(asoc, &addr, gfp, SCTP_UNCONFIRMED))
2021 return 0; 2021 return 0;
2022 break; 2022 break;
2023 2023
@@ -2418,7 +2418,7 @@ static __u16 sctp_process_asconf_param(struct sctp_association *asoc,
2418 * Due to Resource Shortage'. 2418 * Due to Resource Shortage'.
2419 */ 2419 */
2420 2420
2421 peer = sctp_assoc_add_peer(asoc, &addr, GFP_ATOMIC, SCTP_ACTIVE); 2421 peer = sctp_assoc_add_peer(asoc, &addr, GFP_ATOMIC, SCTP_UNCONFIRMED);
2422 if (!peer) 2422 if (!peer)
2423 return SCTP_ERROR_RSRC_LOW; 2423 return SCTP_ERROR_RSRC_LOW;
2424 2424
@@ -2565,6 +2565,7 @@ static int sctp_asconf_param_success(struct sctp_association *asoc,
2565 union sctp_addr_param *addr_param; 2565 union sctp_addr_param *addr_param;
2566 struct list_head *pos; 2566 struct list_head *pos;
2567 struct sctp_transport *transport; 2567 struct sctp_transport *transport;
2568 struct sctp_sockaddr_entry *saddr;
2568 int retval = 0; 2569 int retval = 0;
2569 2570
2570 addr_param = (union sctp_addr_param *) 2571 addr_param = (union sctp_addr_param *)
@@ -2578,7 +2579,11 @@ static int sctp_asconf_param_success(struct sctp_association *asoc,
2578 case SCTP_PARAM_ADD_IP: 2579 case SCTP_PARAM_ADD_IP:
2579 sctp_local_bh_disable(); 2580 sctp_local_bh_disable();
2580 sctp_write_lock(&asoc->base.addr_lock); 2581 sctp_write_lock(&asoc->base.addr_lock);
2581 retval = sctp_add_bind_addr(bp, &addr, GFP_ATOMIC); 2582 list_for_each(pos, &bp->address_list) {
2583 saddr = list_entry(pos, struct sctp_sockaddr_entry, list);
2584 if (sctp_cmp_addr_exact(&saddr->a, &addr))
2585 saddr->use_as_src = 1;
2586 }
2582 sctp_write_unlock(&asoc->base.addr_lock); 2587 sctp_write_unlock(&asoc->base.addr_lock);
2583 sctp_local_bh_enable(); 2588 sctp_local_bh_enable();
2584 break; 2589 break;
@@ -2591,6 +2596,7 @@ static int sctp_asconf_param_success(struct sctp_association *asoc,
2591 list_for_each(pos, &asoc->peer.transport_addr_list) { 2596 list_for_each(pos, &asoc->peer.transport_addr_list) {
2592 transport = list_entry(pos, struct sctp_transport, 2597 transport = list_entry(pos, struct sctp_transport,
2593 transports); 2598 transports);
2599 dst_release(transport->dst);
2594 sctp_transport_route(transport, NULL, 2600 sctp_transport_route(transport, NULL,
2595 sctp_sk(asoc->base.sk)); 2601 sctp_sk(asoc->base.sk));
2596 } 2602 }
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
index c5beb2ad7ef7..9c10bdec1afe 100644
--- a/net/sctp/sm_sideeffect.c
+++ b/net/sctp/sm_sideeffect.c
@@ -430,7 +430,11 @@ static void sctp_do_8_2_transport_strike(struct sctp_association *asoc,
430 /* The check for association's overall error counter exceeding the 430 /* The check for association's overall error counter exceeding the
431 * threshold is done in the state function. 431 * threshold is done in the state function.
432 */ 432 */
433 asoc->overall_error_count++; 433 /* When probing UNCONFIRMED addresses, the association overall
434 * error count is NOT incremented
435 */
436 if (transport->state != SCTP_UNCONFIRMED)
437 asoc->overall_error_count++;
434 438
435 if (transport->state != SCTP_INACTIVE && 439 if (transport->state != SCTP_INACTIVE &&
436 (transport->error_count++ >= transport->pathmaxrxt)) { 440 (transport->error_count++ >= transport->pathmaxrxt)) {
@@ -610,7 +614,7 @@ static void sctp_cmd_transport_on(sctp_cmd_seq_t *cmds,
610 /* Mark the destination transport address as active if it is not so 614 /* Mark the destination transport address as active if it is not so
611 * marked. 615 * marked.
612 */ 616 */
613 if (t->state == SCTP_INACTIVE) 617 if ((t->state == SCTP_INACTIVE) || (t->state == SCTP_UNCONFIRMED))
614 sctp_assoc_control_transport(asoc, t, SCTP_TRANSPORT_UP, 618 sctp_assoc_control_transport(asoc, t, SCTP_TRANSPORT_UP,
615 SCTP_HEARTBEAT_SUCCESS); 619 SCTP_HEARTBEAT_SUCCESS);
616 620
@@ -620,6 +624,10 @@ static void sctp_cmd_transport_on(sctp_cmd_seq_t *cmds,
620 */ 624 */
621 hbinfo = (sctp_sender_hb_info_t *) chunk->skb->data; 625 hbinfo = (sctp_sender_hb_info_t *) chunk->skb->data;
622 sctp_transport_update_rto(t, (jiffies - hbinfo->sent_at)); 626 sctp_transport_update_rto(t, (jiffies - hbinfo->sent_at));
627
628 /* Update the heartbeat timer. */
629 if (!mod_timer(&t->hb_timer, sctp_transport_timeout(t)))
630 sctp_transport_hold(t);
623} 631}
624 632
625/* Helper function to do a transport reset at the expiry of the hearbeat 633/* Helper function to do a transport reset at the expiry of the hearbeat
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 9e58144f4851..ead3f1b0ea3d 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -846,6 +846,7 @@ static sctp_disposition_t sctp_sf_heartbeat(const struct sctp_endpoint *ep,
846 hbinfo.param_hdr.length = htons(sizeof(sctp_sender_hb_info_t)); 846 hbinfo.param_hdr.length = htons(sizeof(sctp_sender_hb_info_t));
847 hbinfo.daddr = transport->ipaddr; 847 hbinfo.daddr = transport->ipaddr;
848 hbinfo.sent_at = jiffies; 848 hbinfo.sent_at = jiffies;
849 hbinfo.hb_nonce = transport->hb_nonce;
849 850
850 /* Send a heartbeat to our peer. */ 851 /* Send a heartbeat to our peer. */
851 paylen = sizeof(sctp_sender_hb_info_t); 852 paylen = sizeof(sctp_sender_hb_info_t);
@@ -1048,6 +1049,10 @@ sctp_disposition_t sctp_sf_backbeat_8_3(const struct sctp_endpoint *ep,
1048 return SCTP_DISPOSITION_DISCARD; 1049 return SCTP_DISPOSITION_DISCARD;
1049 } 1050 }
1050 1051
1052 /* Validate the 64-bit random nonce. */
1053 if (hbinfo->hb_nonce != link->hb_nonce)
1054 return SCTP_DISPOSITION_DISCARD;
1055
1051 max_interval = link->hbinterval + link->rto; 1056 max_interval = link->hbinterval + link->rto;
1052 1057
1053 /* Check if the timestamp looks valid. */ 1058 /* Check if the timestamp looks valid. */
@@ -5278,7 +5283,6 @@ static int sctp_eat_data(const struct sctp_association *asoc,
5278 datalen -= sizeof(sctp_data_chunk_t); 5283 datalen -= sizeof(sctp_data_chunk_t);
5279 5284
5280 deliver = SCTP_CMD_CHUNK_ULP; 5285 deliver = SCTP_CMD_CHUNK_ULP;
5281 chunk->data_accepted = 1;
5282 5286
5283 /* Think about partial delivery. */ 5287 /* Think about partial delivery. */
5284 if ((datalen >= asoc->rwnd) && (!asoc->ulpq.pd_mode)) { 5288 if ((datalen >= asoc->rwnd) && (!asoc->ulpq.pd_mode)) {
@@ -5357,6 +5361,8 @@ static int sctp_eat_data(const struct sctp_association *asoc,
5357 if (SCTP_CMD_CHUNK_ULP == deliver) 5361 if (SCTP_CMD_CHUNK_ULP == deliver)
5358 sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_TSN, SCTP_U32(tsn)); 5362 sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_TSN, SCTP_U32(tsn));
5359 5363
5364 chunk->data_accepted = 1;
5365
5360 /* Note: Some chunks may get overcounted (if we drop) or overcounted 5366 /* Note: Some chunks may get overcounted (if we drop) or overcounted
5361 * if we renege and the chunk arrives again. 5367 * if we renege and the chunk arrives again.
5362 */ 5368 */
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 0a2c71d0d8aa..54722e622e6d 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -369,7 +369,7 @@ SCTP_STATIC int sctp_do_bind(struct sock *sk, union sctp_addr *addr, int len)
369 369
370 /* Use GFP_ATOMIC since BHs are disabled. */ 370 /* Use GFP_ATOMIC since BHs are disabled. */
371 addr->v4.sin_port = ntohs(addr->v4.sin_port); 371 addr->v4.sin_port = ntohs(addr->v4.sin_port);
372 ret = sctp_add_bind_addr(bp, addr, GFP_ATOMIC); 372 ret = sctp_add_bind_addr(bp, addr, 1, GFP_ATOMIC);
373 addr->v4.sin_port = htons(addr->v4.sin_port); 373 addr->v4.sin_port = htons(addr->v4.sin_port);
374 sctp_write_unlock(&ep->base.addr_lock); 374 sctp_write_unlock(&ep->base.addr_lock);
375 sctp_local_bh_enable(); 375 sctp_local_bh_enable();
@@ -491,6 +491,7 @@ static int sctp_send_asconf_add_ip(struct sock *sk,
491 struct sctp_chunk *chunk; 491 struct sctp_chunk *chunk;
492 struct sctp_sockaddr_entry *laddr; 492 struct sctp_sockaddr_entry *laddr;
493 union sctp_addr *addr; 493 union sctp_addr *addr;
494 union sctp_addr saveaddr;
494 void *addr_buf; 495 void *addr_buf;
495 struct sctp_af *af; 496 struct sctp_af *af;
496 struct list_head *pos; 497 struct list_head *pos;
@@ -558,14 +559,26 @@ static int sctp_send_asconf_add_ip(struct sock *sk,
558 } 559 }
559 560
560 retval = sctp_send_asconf(asoc, chunk); 561 retval = sctp_send_asconf(asoc, chunk);
562 if (retval)
563 goto out;
561 564
562 /* FIXME: After sending the add address ASCONF chunk, we 565 /* Add the new addresses to the bind address list with
563 * cannot append the address to the association's binding 566 * use_as_src set to 0.
564 * address list, because the new address may be used as the
565 * source of a message sent to the peer before the ASCONF
566 * chunk is received by the peer. So we should wait until
567 * ASCONF_ACK is received.
568 */ 567 */
568 sctp_local_bh_disable();
569 sctp_write_lock(&asoc->base.addr_lock);
570 addr_buf = addrs;
571 for (i = 0; i < addrcnt; i++) {
572 addr = (union sctp_addr *)addr_buf;
573 af = sctp_get_af_specific(addr->v4.sin_family);
574 memcpy(&saveaddr, addr, af->sockaddr_len);
575 saveaddr.v4.sin_port = ntohs(saveaddr.v4.sin_port);
576 retval = sctp_add_bind_addr(bp, &saveaddr, 0,
577 GFP_ATOMIC);
578 addr_buf += af->sockaddr_len;
579 }
580 sctp_write_unlock(&asoc->base.addr_lock);
581 sctp_local_bh_enable();
569 } 582 }
570 583
571out: 584out:
@@ -676,12 +689,15 @@ static int sctp_send_asconf_del_ip(struct sock *sk,
676 struct sctp_sock *sp; 689 struct sctp_sock *sp;
677 struct sctp_endpoint *ep; 690 struct sctp_endpoint *ep;
678 struct sctp_association *asoc; 691 struct sctp_association *asoc;
692 struct sctp_transport *transport;
679 struct sctp_bind_addr *bp; 693 struct sctp_bind_addr *bp;
680 struct sctp_chunk *chunk; 694 struct sctp_chunk *chunk;
681 union sctp_addr *laddr; 695 union sctp_addr *laddr;
696 union sctp_addr saveaddr;
682 void *addr_buf; 697 void *addr_buf;
683 struct sctp_af *af; 698 struct sctp_af *af;
684 struct list_head *pos; 699 struct list_head *pos, *pos1;
700 struct sctp_sockaddr_entry *saddr;
685 int i; 701 int i;
686 int retval = 0; 702 int retval = 0;
687 703
@@ -748,14 +764,42 @@ static int sctp_send_asconf_del_ip(struct sock *sk,
748 goto out; 764 goto out;
749 } 765 }
750 766
751 retval = sctp_send_asconf(asoc, chunk); 767 /* Reset use_as_src flag for the addresses in the bind address
768 * list that are to be deleted.
769 */
770 sctp_local_bh_disable();
771 sctp_write_lock(&asoc->base.addr_lock);
772 addr_buf = addrs;
773 for (i = 0; i < addrcnt; i++) {
774 laddr = (union sctp_addr *)addr_buf;
775 af = sctp_get_af_specific(laddr->v4.sin_family);
776 memcpy(&saveaddr, laddr, af->sockaddr_len);
777 saveaddr.v4.sin_port = ntohs(saveaddr.v4.sin_port);
778 list_for_each(pos1, &bp->address_list) {
779 saddr = list_entry(pos1,
780 struct sctp_sockaddr_entry,
781 list);
782 if (sctp_cmp_addr_exact(&saddr->a, &saveaddr))
783 saddr->use_as_src = 0;
784 }
785 addr_buf += af->sockaddr_len;
786 }
787 sctp_write_unlock(&asoc->base.addr_lock);
788 sctp_local_bh_enable();
752 789
753 /* FIXME: After sending the delete address ASCONF chunk, we 790 /* Update the route and saddr entries for all the transports
754 * cannot remove the addresses from the association's bind 791 * as some of the addresses in the bind address list are
755 * address list, because there maybe some packet send to 792 * about to be deleted and cannot be used as source addresses.
756 * the delete addresses, so we should wait until ASCONF_ACK
757 * packet is received.
758 */ 793 */
794 list_for_each(pos1, &asoc->peer.transport_addr_list) {
795 transport = list_entry(pos1, struct sctp_transport,
796 transports);
797 dst_release(transport->dst);
798 sctp_transport_route(transport, NULL,
799 sctp_sk(asoc->base.sk));
800 }
801
802 retval = sctp_send_asconf(asoc, chunk);
759 } 803 }
760out: 804out:
761 return retval; 805 return retval;
@@ -4977,7 +5021,7 @@ static struct sctp_bind_bucket *sctp_bucket_create(
4977/* Caller must hold hashbucket lock for this tb with local BH disabled */ 5021/* Caller must hold hashbucket lock for this tb with local BH disabled */
4978static void sctp_bucket_destroy(struct sctp_bind_bucket *pp) 5022static void sctp_bucket_destroy(struct sctp_bind_bucket *pp)
4979{ 5023{
4980 if (hlist_empty(&pp->owner)) { 5024 if (pp && hlist_empty(&pp->owner)) {
4981 if (pp->next) 5025 if (pp->next)
4982 pp->next->pprev = pp->pprev; 5026 pp->next->pprev = pp->pprev;
4983 *(pp->pprev) = pp->next; 5027 *(pp->pprev) = pp->next;
diff --git a/net/sctp/transport.c b/net/sctp/transport.c
index 160f62ad1cc5..2763aa93de1a 100644
--- a/net/sctp/transport.c
+++ b/net/sctp/transport.c
@@ -49,6 +49,7 @@
49 */ 49 */
50 50
51#include <linux/types.h> 51#include <linux/types.h>
52#include <linux/random.h>
52#include <net/sctp/sctp.h> 53#include <net/sctp/sctp.h>
53#include <net/sctp/sm.h> 54#include <net/sctp/sm.h>
54 55
@@ -85,7 +86,6 @@ static struct sctp_transport *sctp_transport_init(struct sctp_transport *peer,
85 86
86 peer->init_sent_count = 0; 87 peer->init_sent_count = 0;
87 88
88 peer->state = SCTP_ACTIVE;
89 peer->param_flags = SPP_HB_DISABLE | 89 peer->param_flags = SPP_HB_DISABLE |
90 SPP_PMTUD_ENABLE | 90 SPP_PMTUD_ENABLE |
91 SPP_SACKDELAY_ENABLE; 91 SPP_SACKDELAY_ENABLE;
@@ -109,6 +109,9 @@ static struct sctp_transport *sctp_transport_init(struct sctp_transport *peer,
109 peer->hb_timer.function = sctp_generate_heartbeat_event; 109 peer->hb_timer.function = sctp_generate_heartbeat_event;
110 peer->hb_timer.data = (unsigned long)peer; 110 peer->hb_timer.data = (unsigned long)peer;
111 111
112 /* Initialize the 64-bit random nonce sent with heartbeat. */
113 get_random_bytes(&peer->hb_nonce, sizeof(peer->hb_nonce));
114
112 atomic_set(&peer->refcnt, 1); 115 atomic_set(&peer->refcnt, 1);
113 peer->dead = 0; 116 peer->dead = 0;
114 117
@@ -517,7 +520,9 @@ void sctp_transport_lower_cwnd(struct sctp_transport *transport,
517unsigned long sctp_transport_timeout(struct sctp_transport *t) 520unsigned long sctp_transport_timeout(struct sctp_transport *t)
518{ 521{
519 unsigned long timeout; 522 unsigned long timeout;
520 timeout = t->hbinterval + t->rto + sctp_jitter(t->rto); 523 timeout = t->rto + sctp_jitter(t->rto);
524 if (t->state != SCTP_UNCONFIRMED)
525 timeout += t->hbinterval;
521 timeout += jiffies; 526 timeout += jiffies;
522 return timeout; 527 return timeout;
523} 528}
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index 519ebc17c028..4a9aa9393b97 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -225,9 +225,8 @@ gss_alloc_context(void)
225{ 225{
226 struct gss_cl_ctx *ctx; 226 struct gss_cl_ctx *ctx;
227 227
228 ctx = kmalloc(sizeof(*ctx), GFP_KERNEL); 228 ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
229 if (ctx != NULL) { 229 if (ctx != NULL) {
230 memset(ctx, 0, sizeof(*ctx));
231 ctx->gc_proc = RPC_GSS_PROC_DATA; 230 ctx->gc_proc = RPC_GSS_PROC_DATA;
232 ctx->gc_seq = 1; /* NetApp 6.4R1 doesn't accept seq. no. 0 */ 231 ctx->gc_seq = 1; /* NetApp 6.4R1 doesn't accept seq. no. 0 */
233 spin_lock_init(&ctx->gc_seq_lock); 232 spin_lock_init(&ctx->gc_seq_lock);
@@ -391,9 +390,8 @@ gss_alloc_msg(struct gss_auth *gss_auth, uid_t uid)
391{ 390{
392 struct gss_upcall_msg *gss_msg; 391 struct gss_upcall_msg *gss_msg;
393 392
394 gss_msg = kmalloc(sizeof(*gss_msg), GFP_KERNEL); 393 gss_msg = kzalloc(sizeof(*gss_msg), GFP_KERNEL);
395 if (gss_msg != NULL) { 394 if (gss_msg != NULL) {
396 memset(gss_msg, 0, sizeof(*gss_msg));
397 INIT_LIST_HEAD(&gss_msg->list); 395 INIT_LIST_HEAD(&gss_msg->list);
398 rpc_init_wait_queue(&gss_msg->rpc_waitqueue, "RPCSEC_GSS upcall waitq"); 396 rpc_init_wait_queue(&gss_msg->rpc_waitqueue, "RPCSEC_GSS upcall waitq");
399 init_waitqueue_head(&gss_msg->waitqueue); 397 init_waitqueue_head(&gss_msg->waitqueue);
@@ -776,10 +774,9 @@ gss_create_cred(struct rpc_auth *auth, struct auth_cred *acred, int flags)
776 dprintk("RPC: gss_create_cred for uid %d, flavor %d\n", 774 dprintk("RPC: gss_create_cred for uid %d, flavor %d\n",
777 acred->uid, auth->au_flavor); 775 acred->uid, auth->au_flavor);
778 776
779 if (!(cred = kmalloc(sizeof(*cred), GFP_KERNEL))) 777 if (!(cred = kzalloc(sizeof(*cred), GFP_KERNEL)))
780 goto out_err; 778 goto out_err;
781 779
782 memset(cred, 0, sizeof(*cred));
783 atomic_set(&cred->gc_count, 1); 780 atomic_set(&cred->gc_count, 1);
784 cred->gc_uid = acred->uid; 781 cred->gc_uid = acred->uid;
785 /* 782 /*
diff --git a/net/sunrpc/auth_gss/gss_krb5_mech.c b/net/sunrpc/auth_gss/gss_krb5_mech.c
index b8714a87b34c..70e1e53a632b 100644
--- a/net/sunrpc/auth_gss/gss_krb5_mech.c
+++ b/net/sunrpc/auth_gss/gss_krb5_mech.c
@@ -129,9 +129,8 @@ gss_import_sec_context_kerberos(const void *p,
129 const void *end = (const void *)((const char *)p + len); 129 const void *end = (const void *)((const char *)p + len);
130 struct krb5_ctx *ctx; 130 struct krb5_ctx *ctx;
131 131
132 if (!(ctx = kmalloc(sizeof(*ctx), GFP_KERNEL))) 132 if (!(ctx = kzalloc(sizeof(*ctx), GFP_KERNEL)))
133 goto out_err; 133 goto out_err;
134 memset(ctx, 0, sizeof(*ctx));
135 134
136 p = simple_get_bytes(p, end, &ctx->initiate, sizeof(ctx->initiate)); 135 p = simple_get_bytes(p, end, &ctx->initiate, sizeof(ctx->initiate));
137 if (IS_ERR(p)) 136 if (IS_ERR(p))
diff --git a/net/sunrpc/auth_gss/gss_mech_switch.c b/net/sunrpc/auth_gss/gss_mech_switch.c
index d88468d21c37..3db745379d06 100644
--- a/net/sunrpc/auth_gss/gss_mech_switch.c
+++ b/net/sunrpc/auth_gss/gss_mech_switch.c
@@ -237,9 +237,8 @@ gss_import_sec_context(const void *input_token, size_t bufsize,
237 struct gss_api_mech *mech, 237 struct gss_api_mech *mech,
238 struct gss_ctx **ctx_id) 238 struct gss_ctx **ctx_id)
239{ 239{
240 if (!(*ctx_id = kmalloc(sizeof(**ctx_id), GFP_KERNEL))) 240 if (!(*ctx_id = kzalloc(sizeof(**ctx_id), GFP_KERNEL)))
241 return GSS_S_FAILURE; 241 return GSS_S_FAILURE;
242 memset(*ctx_id, 0, sizeof(**ctx_id));
243 (*ctx_id)->mech_type = gss_mech_get(mech); 242 (*ctx_id)->mech_type = gss_mech_get(mech);
244 243
245 return mech->gm_ops 244 return mech->gm_ops
diff --git a/net/sunrpc/auth_gss/gss_spkm3_mech.c b/net/sunrpc/auth_gss/gss_spkm3_mech.c
index 3d0432aa45c1..88dcb52d171b 100644
--- a/net/sunrpc/auth_gss/gss_spkm3_mech.c
+++ b/net/sunrpc/auth_gss/gss_spkm3_mech.c
@@ -152,9 +152,8 @@ gss_import_sec_context_spkm3(const void *p, size_t len,
152 const void *end = (const void *)((const char *)p + len); 152 const void *end = (const void *)((const char *)p + len);
153 struct spkm3_ctx *ctx; 153 struct spkm3_ctx *ctx;
154 154
155 if (!(ctx = kmalloc(sizeof(*ctx), GFP_KERNEL))) 155 if (!(ctx = kzalloc(sizeof(*ctx), GFP_KERNEL)))
156 goto out_err; 156 goto out_err;
157 memset(ctx, 0, sizeof(*ctx));
158 157
159 p = simple_get_netobj(p, end, &ctx->ctx_id); 158 p = simple_get_netobj(p, end, &ctx->ctx_id);
160 if (IS_ERR(p)) 159 if (IS_ERR(p))
diff --git a/net/sunrpc/auth_gss/gss_spkm3_token.c b/net/sunrpc/auth_gss/gss_spkm3_token.c
index af0d7ce74686..854a983ccf26 100644
--- a/net/sunrpc/auth_gss/gss_spkm3_token.c
+++ b/net/sunrpc/auth_gss/gss_spkm3_token.c
@@ -90,10 +90,9 @@ asn1_bitstring_len(struct xdr_netobj *in, int *enclen, int *zerobits)
90int 90int
91decode_asn1_bitstring(struct xdr_netobj *out, char *in, int enclen, int explen) 91decode_asn1_bitstring(struct xdr_netobj *out, char *in, int enclen, int explen)
92{ 92{
93 if (!(out->data = kmalloc(explen,GFP_KERNEL))) 93 if (!(out->data = kzalloc(explen,GFP_KERNEL)))
94 return 0; 94 return 0;
95 out->len = explen; 95 out->len = explen;
96 memset(out->data, 0, explen);
97 memcpy(out->data, in, enclen); 96 memcpy(out->data, in, enclen);
98 return 1; 97 return 1;
99} 98}
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index aa8965e9d307..d6409e757219 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -125,10 +125,9 @@ rpc_new_client(struct rpc_xprt *xprt, char *servname,
125 goto out_err; 125 goto out_err;
126 126
127 err = -ENOMEM; 127 err = -ENOMEM;
128 clnt = kmalloc(sizeof(*clnt), GFP_KERNEL); 128 clnt = kzalloc(sizeof(*clnt), GFP_KERNEL);
129 if (!clnt) 129 if (!clnt)
130 goto out_err; 130 goto out_err;
131 memset(clnt, 0, sizeof(*clnt));
132 atomic_set(&clnt->cl_users, 0); 131 atomic_set(&clnt->cl_users, 0);
133 atomic_set(&clnt->cl_count, 1); 132 atomic_set(&clnt->cl_count, 1);
134 clnt->cl_parent = clnt; 133 clnt->cl_parent = clnt;
@@ -922,26 +921,43 @@ call_transmit(struct rpc_task *task)
922 task->tk_status = xprt_prepare_transmit(task); 921 task->tk_status = xprt_prepare_transmit(task);
923 if (task->tk_status != 0) 922 if (task->tk_status != 0)
924 return; 923 return;
924 task->tk_action = call_transmit_status;
925 /* Encode here so that rpcsec_gss can use correct sequence number. */ 925 /* Encode here so that rpcsec_gss can use correct sequence number. */
926 if (rpc_task_need_encode(task)) { 926 if (rpc_task_need_encode(task)) {
927 task->tk_rqstp->rq_bytes_sent = 0; 927 BUG_ON(task->tk_rqstp->rq_bytes_sent != 0);
928 call_encode(task); 928 call_encode(task);
929 /* Did the encode result in an error condition? */ 929 /* Did the encode result in an error condition? */
930 if (task->tk_status != 0) 930 if (task->tk_status != 0)
931 goto out_nosend; 931 return;
932 } 932 }
933 task->tk_action = call_transmit_status;
934 xprt_transmit(task); 933 xprt_transmit(task);
935 if (task->tk_status < 0) 934 if (task->tk_status < 0)
936 return; 935 return;
937 if (!task->tk_msg.rpc_proc->p_decode) { 936 /*
938 task->tk_action = rpc_exit_task; 937 * On success, ensure that we call xprt_end_transmit() before sleeping
939 rpc_wake_up_task(task); 938 * in order to allow access to the socket to other RPC requests.
940 } 939 */
941 return; 940 call_transmit_status(task);
942out_nosend: 941 if (task->tk_msg.rpc_proc->p_decode != NULL)
943 /* release socket write lock before attempting to handle error */ 942 return;
944 xprt_abort_transmit(task); 943 task->tk_action = rpc_exit_task;
944 rpc_wake_up_task(task);
945}
946
947/*
948 * 5a. Handle cleanup after a transmission
949 */
950static void
951call_transmit_status(struct rpc_task *task)
952{
953 task->tk_action = call_status;
954 /*
955 * Special case: if we've been waiting on the socket's write_space()
956 * callback, then don't call xprt_end_transmit().
957 */
958 if (task->tk_status == -EAGAIN)
959 return;
960 xprt_end_transmit(task);
945 rpc_task_force_reencode(task); 961 rpc_task_force_reencode(task);
946} 962}
947 963
@@ -993,18 +1009,7 @@ call_status(struct rpc_task *task)
993} 1009}
994 1010
995/* 1011/*
996 * 6a. Handle transmission errors. 1012 * 6a. Handle RPC timeout
997 */
998static void
999call_transmit_status(struct rpc_task *task)
1000{
1001 if (task->tk_status != -EAGAIN)
1002 rpc_task_force_reencode(task);
1003 call_status(task);
1004}
1005
1006/*
1007 * 6b. Handle RPC timeout
1008 * We do not release the request slot, so we keep using the 1013 * We do not release the request slot, so we keep using the
1009 * same XID for all retransmits. 1014 * same XID for all retransmits.
1010 */ 1015 */
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index dc6cb93c8830..a3bd2db2e024 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -667,10 +667,11 @@ rpc_mkdir(char *path, struct rpc_clnt *rpc_client)
667 RPCAUTH_info, RPCAUTH_EOF); 667 RPCAUTH_info, RPCAUTH_EOF);
668 if (error) 668 if (error)
669 goto err_depopulate; 669 goto err_depopulate;
670 dget(dentry);
670out: 671out:
671 mutex_unlock(&dir->i_mutex); 672 mutex_unlock(&dir->i_mutex);
672 rpc_release_path(&nd); 673 rpc_release_path(&nd);
673 return dget(dentry); 674 return dentry;
674err_depopulate: 675err_depopulate:
675 rpc_depopulate(dentry); 676 rpc_depopulate(dentry);
676 __rpc_rmdir(dir, dentry); 677 __rpc_rmdir(dir, dentry);
@@ -731,10 +732,11 @@ rpc_mkpipe(char *path, void *private, struct rpc_pipe_ops *ops, int flags)
731 rpci->flags = flags; 732 rpci->flags = flags;
732 rpci->ops = ops; 733 rpci->ops = ops;
733 inode_dir_notify(dir, DN_CREATE); 734 inode_dir_notify(dir, DN_CREATE);
735 dget(dentry);
734out: 736out:
735 mutex_unlock(&dir->i_mutex); 737 mutex_unlock(&dir->i_mutex);
736 rpc_release_path(&nd); 738 rpc_release_path(&nd);
737 return dget(dentry); 739 return dentry;
738err_dput: 740err_dput:
739 dput(dentry); 741 dput(dentry);
740 dentry = ERR_PTR(-ENOMEM); 742 dentry = ERR_PTR(-ENOMEM);
diff --git a/net/sunrpc/stats.c b/net/sunrpc/stats.c
index 15c2db26767b..bd98124c3a64 100644
--- a/net/sunrpc/stats.c
+++ b/net/sunrpc/stats.c
@@ -114,13 +114,8 @@ void svc_seq_show(struct seq_file *seq, const struct svc_stat *statp) {
114 */ 114 */
115struct rpc_iostats *rpc_alloc_iostats(struct rpc_clnt *clnt) 115struct rpc_iostats *rpc_alloc_iostats(struct rpc_clnt *clnt)
116{ 116{
117 unsigned int ops = clnt->cl_maxproc;
118 size_t size = ops * sizeof(struct rpc_iostats);
119 struct rpc_iostats *new; 117 struct rpc_iostats *new;
120 118 new = kcalloc(clnt->cl_maxproc, sizeof(struct rpc_iostats), GFP_KERNEL);
121 new = kmalloc(size, GFP_KERNEL);
122 if (new)
123 memset(new, 0 , size);
124 return new; 119 return new;
125} 120}
126EXPORT_SYMBOL(rpc_alloc_iostats); 121EXPORT_SYMBOL(rpc_alloc_iostats);
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 01ba60a49572..b76a227dd3ad 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -32,9 +32,8 @@ svc_create(struct svc_program *prog, unsigned int bufsize)
32 int vers; 32 int vers;
33 unsigned int xdrsize; 33 unsigned int xdrsize;
34 34
35 if (!(serv = kmalloc(sizeof(*serv), GFP_KERNEL))) 35 if (!(serv = kzalloc(sizeof(*serv), GFP_KERNEL)))
36 return NULL; 36 return NULL;
37 memset(serv, 0, sizeof(*serv));
38 serv->sv_name = prog->pg_name; 37 serv->sv_name = prog->pg_name;
39 serv->sv_program = prog; 38 serv->sv_program = prog;
40 serv->sv_nrthreads = 1; 39 serv->sv_nrthreads = 1;
@@ -159,11 +158,10 @@ svc_create_thread(svc_thread_fn func, struct svc_serv *serv)
159 struct svc_rqst *rqstp; 158 struct svc_rqst *rqstp;
160 int error = -ENOMEM; 159 int error = -ENOMEM;
161 160
162 rqstp = kmalloc(sizeof(*rqstp), GFP_KERNEL); 161 rqstp = kzalloc(sizeof(*rqstp), GFP_KERNEL);
163 if (!rqstp) 162 if (!rqstp)
164 goto out; 163 goto out;
165 164
166 memset(rqstp, 0, sizeof(*rqstp));
167 init_waitqueue_head(&rqstp->rq_wait); 165 init_waitqueue_head(&rqstp->rq_wait);
168 166
169 if (!(rqstp->rq_argp = kmalloc(serv->sv_xdrsize, GFP_KERNEL)) 167 if (!(rqstp->rq_argp = kmalloc(serv->sv_xdrsize, GFP_KERNEL))
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index a27905a0ad27..d9a95732df46 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -1322,11 +1322,10 @@ svc_setup_socket(struct svc_serv *serv, struct socket *sock,
1322 struct sock *inet; 1322 struct sock *inet;
1323 1323
1324 dprintk("svc: svc_setup_socket %p\n", sock); 1324 dprintk("svc: svc_setup_socket %p\n", sock);
1325 if (!(svsk = kmalloc(sizeof(*svsk), GFP_KERNEL))) { 1325 if (!(svsk = kzalloc(sizeof(*svsk), GFP_KERNEL))) {
1326 *errp = -ENOMEM; 1326 *errp = -ENOMEM;
1327 return NULL; 1327 return NULL;
1328 } 1328 }
1329 memset(svsk, 0, sizeof(*svsk));
1330 1329
1331 inet = sock->sk; 1330 inet = sock->sk;
1332 1331
diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c
index 49174f0d0a3e..6ac45103a272 100644
--- a/net/sunrpc/xdr.c
+++ b/net/sunrpc/xdr.c
@@ -191,7 +191,6 @@ _shift_data_right_pages(struct page **pages, size_t pgto_base,
191 do { 191 do {
192 /* Are any pointers crossing a page boundary? */ 192 /* Are any pointers crossing a page boundary? */
193 if (pgto_base == 0) { 193 if (pgto_base == 0) {
194 flush_dcache_page(*pgto);
195 pgto_base = PAGE_CACHE_SIZE; 194 pgto_base = PAGE_CACHE_SIZE;
196 pgto--; 195 pgto--;
197 } 196 }
@@ -211,11 +210,11 @@ _shift_data_right_pages(struct page **pages, size_t pgto_base,
211 vto = kmap_atomic(*pgto, KM_USER0); 210 vto = kmap_atomic(*pgto, KM_USER0);
212 vfrom = kmap_atomic(*pgfrom, KM_USER1); 211 vfrom = kmap_atomic(*pgfrom, KM_USER1);
213 memmove(vto + pgto_base, vfrom + pgfrom_base, copy); 212 memmove(vto + pgto_base, vfrom + pgfrom_base, copy);
213 flush_dcache_page(*pgto);
214 kunmap_atomic(vfrom, KM_USER1); 214 kunmap_atomic(vfrom, KM_USER1);
215 kunmap_atomic(vto, KM_USER0); 215 kunmap_atomic(vto, KM_USER0);
216 216
217 } while ((len -= copy) != 0); 217 } while ((len -= copy) != 0);
218 flush_dcache_page(*pgto);
219} 218}
220 219
221/* 220/*
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index 02060d0e7be8..e8c2bc4977f3 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -707,12 +707,9 @@ out_unlock:
707 return err; 707 return err;
708} 708}
709 709
710void 710void xprt_end_transmit(struct rpc_task *task)
711xprt_abort_transmit(struct rpc_task *task)
712{ 711{
713 struct rpc_xprt *xprt = task->tk_xprt; 712 xprt_release_write(task->tk_xprt, task);
714
715 xprt_release_write(xprt, task);
716} 713}
717 714
718/** 715/**
@@ -761,8 +758,6 @@ void xprt_transmit(struct rpc_task *task)
761 task->tk_status = -ENOTCONN; 758 task->tk_status = -ENOTCONN;
762 else if (!req->rq_received) 759 else if (!req->rq_received)
763 rpc_sleep_on(&xprt->pending, task, NULL, xprt_timer); 760 rpc_sleep_on(&xprt->pending, task, NULL, xprt_timer);
764
765 xprt->ops->release_xprt(xprt, task);
766 spin_unlock_bh(&xprt->transport_lock); 761 spin_unlock_bh(&xprt->transport_lock);
767 return; 762 return;
768 } 763 }
@@ -772,18 +767,8 @@ void xprt_transmit(struct rpc_task *task)
772 * schedq, and being picked up by a parallel run of rpciod(). 767 * schedq, and being picked up by a parallel run of rpciod().
773 */ 768 */
774 task->tk_status = status; 769 task->tk_status = status;
775 770 if (status == -ECONNREFUSED)
776 switch (status) {
777 case -ECONNREFUSED:
778 rpc_sleep_on(&xprt->sending, task, NULL, NULL); 771 rpc_sleep_on(&xprt->sending, task, NULL, NULL);
779 case -EAGAIN:
780 case -ENOTCONN:
781 return;
782 default:
783 break;
784 }
785 xprt_release_write(xprt, task);
786 return;
787} 772}
788 773
789static inline void do_xprt_reserve(struct rpc_task *task) 774static inline void do_xprt_reserve(struct rpc_task *task)
@@ -908,9 +893,8 @@ static struct rpc_xprt *xprt_setup(int proto, struct sockaddr_in *ap, struct rpc
908 struct rpc_xprt *xprt; 893 struct rpc_xprt *xprt;
909 struct rpc_rqst *req; 894 struct rpc_rqst *req;
910 895
911 if ((xprt = kmalloc(sizeof(struct rpc_xprt), GFP_KERNEL)) == NULL) 896 if ((xprt = kzalloc(sizeof(struct rpc_xprt), GFP_KERNEL)) == NULL)
912 return ERR_PTR(-ENOMEM); 897 return ERR_PTR(-ENOMEM);
913 memset(xprt, 0, sizeof(*xprt)); /* Nnnngh! */
914 898
915 xprt->addr = *ap; 899 xprt->addr = *ap;
916 900
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 21006b109101..441bd53f5eca 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -414,6 +414,33 @@ static int xs_tcp_send_request(struct rpc_task *task)
414} 414}
415 415
416/** 416/**
417 * xs_tcp_release_xprt - clean up after a tcp transmission
418 * @xprt: transport
419 * @task: rpc task
420 *
421 * This cleans up if an error causes us to abort the transmission of a request.
422 * In this case, the socket may need to be reset in order to avoid confusing
423 * the server.
424 */
425static void xs_tcp_release_xprt(struct rpc_xprt *xprt, struct rpc_task *task)
426{
427 struct rpc_rqst *req;
428
429 if (task != xprt->snd_task)
430 return;
431 if (task == NULL)
432 goto out_release;
433 req = task->tk_rqstp;
434 if (req->rq_bytes_sent == 0)
435 goto out_release;
436 if (req->rq_bytes_sent == req->rq_snd_buf.len)
437 goto out_release;
438 set_bit(XPRT_CLOSE_WAIT, &task->tk_xprt->state);
439out_release:
440 xprt_release_xprt(xprt, task);
441}
442
443/**
417 * xs_close - close a socket 444 * xs_close - close a socket
418 * @xprt: transport 445 * @xprt: transport
419 * 446 *
@@ -1250,7 +1277,7 @@ static struct rpc_xprt_ops xs_udp_ops = {
1250 1277
1251static struct rpc_xprt_ops xs_tcp_ops = { 1278static struct rpc_xprt_ops xs_tcp_ops = {
1252 .reserve_xprt = xprt_reserve_xprt, 1279 .reserve_xprt = xprt_reserve_xprt,
1253 .release_xprt = xprt_release_xprt, 1280 .release_xprt = xs_tcp_release_xprt,
1254 .set_port = xs_set_port, 1281 .set_port = xs_set_port,
1255 .connect = xs_connect, 1282 .connect = xs_connect,
1256 .buf_alloc = rpc_malloc, 1283 .buf_alloc = rpc_malloc,
@@ -1276,10 +1303,9 @@ int xs_setup_udp(struct rpc_xprt *xprt, struct rpc_timeout *to)
1276 1303
1277 xprt->max_reqs = xprt_udp_slot_table_entries; 1304 xprt->max_reqs = xprt_udp_slot_table_entries;
1278 slot_table_size = xprt->max_reqs * sizeof(xprt->slot[0]); 1305 slot_table_size = xprt->max_reqs * sizeof(xprt->slot[0]);
1279 xprt->slot = kmalloc(slot_table_size, GFP_KERNEL); 1306 xprt->slot = kzalloc(slot_table_size, GFP_KERNEL);
1280 if (xprt->slot == NULL) 1307 if (xprt->slot == NULL)
1281 return -ENOMEM; 1308 return -ENOMEM;
1282 memset(xprt->slot, 0, slot_table_size);
1283 1309
1284 xprt->prot = IPPROTO_UDP; 1310 xprt->prot = IPPROTO_UDP;
1285 xprt->port = xs_get_random_port(); 1311 xprt->port = xs_get_random_port();
@@ -1318,10 +1344,9 @@ int xs_setup_tcp(struct rpc_xprt *xprt, struct rpc_timeout *to)
1318 1344
1319 xprt->max_reqs = xprt_tcp_slot_table_entries; 1345 xprt->max_reqs = xprt_tcp_slot_table_entries;
1320 slot_table_size = xprt->max_reqs * sizeof(xprt->slot[0]); 1346 slot_table_size = xprt->max_reqs * sizeof(xprt->slot[0]);
1321 xprt->slot = kmalloc(slot_table_size, GFP_KERNEL); 1347 xprt->slot = kzalloc(slot_table_size, GFP_KERNEL);
1322 if (xprt->slot == NULL) 1348 if (xprt->slot == NULL)
1323 return -ENOMEM; 1349 return -ENOMEM;
1324 memset(xprt->slot, 0, slot_table_size);
1325 1350
1326 xprt->prot = IPPROTO_TCP; 1351 xprt->prot = IPPROTO_TCP;
1327 xprt->port = xs_get_random_port(); 1352 xprt->port = xs_get_random_port();
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c
index 7ef17a449cfd..75a5968c2139 100644
--- a/net/tipc/bearer.c
+++ b/net/tipc/bearer.c
@@ -665,11 +665,9 @@ int tipc_bearer_init(void)
665 int res; 665 int res;
666 666
667 write_lock_bh(&tipc_net_lock); 667 write_lock_bh(&tipc_net_lock);
668 tipc_bearers = kmalloc(MAX_BEARERS * sizeof(struct bearer), GFP_ATOMIC); 668 tipc_bearers = kcalloc(MAX_BEARERS, sizeof(struct bearer), GFP_ATOMIC);
669 media_list = kmalloc(MAX_MEDIA * sizeof(struct media), GFP_ATOMIC); 669 media_list = kcalloc(MAX_MEDIA, sizeof(struct media), GFP_ATOMIC);
670 if (tipc_bearers && media_list) { 670 if (tipc_bearers && media_list) {
671 memset(tipc_bearers, 0, MAX_BEARERS * sizeof(struct bearer));
672 memset(media_list, 0, MAX_MEDIA * sizeof(struct media));
673 res = TIPC_OK; 671 res = TIPC_OK;
674 } else { 672 } else {
675 kfree(tipc_bearers); 673 kfree(tipc_bearers);
diff --git a/net/tipc/cluster.c b/net/tipc/cluster.c
index 1dcb6940e338..b46b5188a9fd 100644
--- a/net/tipc/cluster.c
+++ b/net/tipc/cluster.c
@@ -57,29 +57,25 @@ struct cluster *tipc_cltr_create(u32 addr)
57 struct _zone *z_ptr; 57 struct _zone *z_ptr;
58 struct cluster *c_ptr; 58 struct cluster *c_ptr;
59 int max_nodes; 59 int max_nodes;
60 int alloc;
61 60
62 c_ptr = (struct cluster *)kmalloc(sizeof(*c_ptr), GFP_ATOMIC); 61 c_ptr = kzalloc(sizeof(*c_ptr), GFP_ATOMIC);
63 if (c_ptr == NULL) { 62 if (c_ptr == NULL) {
64 warn("Cluster creation failure, no memory\n"); 63 warn("Cluster creation failure, no memory\n");
65 return NULL; 64 return NULL;
66 } 65 }
67 memset(c_ptr, 0, sizeof(*c_ptr));
68 66
69 c_ptr->addr = tipc_addr(tipc_zone(addr), tipc_cluster(addr), 0); 67 c_ptr->addr = tipc_addr(tipc_zone(addr), tipc_cluster(addr), 0);
70 if (in_own_cluster(addr)) 68 if (in_own_cluster(addr))
71 max_nodes = LOWEST_SLAVE + tipc_max_slaves; 69 max_nodes = LOWEST_SLAVE + tipc_max_slaves;
72 else 70 else
73 max_nodes = tipc_max_nodes + 1; 71 max_nodes = tipc_max_nodes + 1;
74 alloc = sizeof(void *) * (max_nodes + 1);
75 72
76 c_ptr->nodes = (struct node **)kmalloc(alloc, GFP_ATOMIC); 73 c_ptr->nodes = kcalloc(max_nodes + 1, sizeof(void*), GFP_ATOMIC);
77 if (c_ptr->nodes == NULL) { 74 if (c_ptr->nodes == NULL) {
78 warn("Cluster creation failure, no memory for node area\n"); 75 warn("Cluster creation failure, no memory for node area\n");
79 kfree(c_ptr); 76 kfree(c_ptr);
80 return NULL; 77 return NULL;
81 } 78 }
82 memset(c_ptr->nodes, 0, alloc);
83 79
84 if (in_own_cluster(addr)) 80 if (in_own_cluster(addr))
85 tipc_local_nodes = c_ptr->nodes; 81 tipc_local_nodes = c_ptr->nodes;
diff --git a/net/tipc/discover.c b/net/tipc/discover.c
index 2b8441203120..ee94de92ae99 100644
--- a/net/tipc/discover.c
+++ b/net/tipc/discover.c
@@ -295,7 +295,7 @@ struct link_req *tipc_disc_init_link_req(struct bearer *b_ptr,
295{ 295{
296 struct link_req *req; 296 struct link_req *req;
297 297
298 req = (struct link_req *)kmalloc(sizeof(*req), GFP_ATOMIC); 298 req = kmalloc(sizeof(*req), GFP_ATOMIC);
299 if (!req) 299 if (!req)
300 return NULL; 300 return NULL;
301 301
diff --git a/net/tipc/link.c b/net/tipc/link.c
index c10e18a49b96..693f02eca6d6 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -417,12 +417,11 @@ struct link *tipc_link_create(struct bearer *b_ptr, const u32 peer,
417 struct tipc_msg *msg; 417 struct tipc_msg *msg;
418 char *if_name; 418 char *if_name;
419 419
420 l_ptr = (struct link *)kmalloc(sizeof(*l_ptr), GFP_ATOMIC); 420 l_ptr = kzalloc(sizeof(*l_ptr), GFP_ATOMIC);
421 if (!l_ptr) { 421 if (!l_ptr) {
422 warn("Link creation failed, no memory\n"); 422 warn("Link creation failed, no memory\n");
423 return NULL; 423 return NULL;
424 } 424 }
425 memset(l_ptr, 0, sizeof(*l_ptr));
426 425
427 l_ptr->addr = peer; 426 l_ptr->addr = peer;
428 if_name = strchr(b_ptr->publ.name, ':') + 1; 427 if_name = strchr(b_ptr->publ.name, ':') + 1;
diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c
index a6926ff07bcc..049242ea5c38 100644
--- a/net/tipc/name_table.c
+++ b/net/tipc/name_table.c
@@ -117,14 +117,12 @@ static struct publication *publ_create(u32 type, u32 lower, u32 upper,
117 u32 scope, u32 node, u32 port_ref, 117 u32 scope, u32 node, u32 port_ref,
118 u32 key) 118 u32 key)
119{ 119{
120 struct publication *publ = 120 struct publication *publ = kzalloc(sizeof(*publ), GFP_ATOMIC);
121 (struct publication *)kmalloc(sizeof(*publ), GFP_ATOMIC);
122 if (publ == NULL) { 121 if (publ == NULL) {
123 warn("Publication creation failure, no memory\n"); 122 warn("Publication creation failure, no memory\n");
124 return NULL; 123 return NULL;
125 } 124 }
126 125
127 memset(publ, 0, sizeof(*publ));
128 publ->type = type; 126 publ->type = type;
129 publ->lower = lower; 127 publ->lower = lower;
130 publ->upper = upper; 128 publ->upper = upper;
@@ -144,11 +142,7 @@ static struct publication *publ_create(u32 type, u32 lower, u32 upper,
144 142
145static struct sub_seq *tipc_subseq_alloc(u32 cnt) 143static struct sub_seq *tipc_subseq_alloc(u32 cnt)
146{ 144{
147 u32 sz = cnt * sizeof(struct sub_seq); 145 struct sub_seq *sseq = kcalloc(cnt, sizeof(struct sub_seq), GFP_ATOMIC);
148 struct sub_seq *sseq = (struct sub_seq *)kmalloc(sz, GFP_ATOMIC);
149
150 if (sseq)
151 memset(sseq, 0, sz);
152 return sseq; 146 return sseq;
153} 147}
154 148
@@ -160,8 +154,7 @@ static struct sub_seq *tipc_subseq_alloc(u32 cnt)
160 154
161static struct name_seq *tipc_nameseq_create(u32 type, struct hlist_head *seq_head) 155static struct name_seq *tipc_nameseq_create(u32 type, struct hlist_head *seq_head)
162{ 156{
163 struct name_seq *nseq = 157 struct name_seq *nseq = kzalloc(sizeof(*nseq), GFP_ATOMIC);
164 (struct name_seq *)kmalloc(sizeof(*nseq), GFP_ATOMIC);
165 struct sub_seq *sseq = tipc_subseq_alloc(1); 158 struct sub_seq *sseq = tipc_subseq_alloc(1);
166 159
167 if (!nseq || !sseq) { 160 if (!nseq || !sseq) {
@@ -171,7 +164,6 @@ static struct name_seq *tipc_nameseq_create(u32 type, struct hlist_head *seq_hea
171 return NULL; 164 return NULL;
172 } 165 }
173 166
174 memset(nseq, 0, sizeof(*nseq));
175 spin_lock_init(&nseq->lock); 167 spin_lock_init(&nseq->lock);
176 nseq->type = type; 168 nseq->type = type;
177 nseq->sseqs = sseq; 169 nseq->sseqs = sseq;
@@ -1060,7 +1052,7 @@ int tipc_nametbl_init(void)
1060{ 1052{
1061 int array_size = sizeof(struct hlist_head) * tipc_nametbl_size; 1053 int array_size = sizeof(struct hlist_head) * tipc_nametbl_size;
1062 1054
1063 table.types = (struct hlist_head *)kmalloc(array_size, GFP_ATOMIC); 1055 table.types = kmalloc(array_size, GFP_ATOMIC);
1064 if (!table.types) 1056 if (!table.types)
1065 return -ENOMEM; 1057 return -ENOMEM;
1066 1058
diff --git a/net/tipc/net.c b/net/tipc/net.c
index e5a359ab4930..a991bf8a7f74 100644
--- a/net/tipc/net.c
+++ b/net/tipc/net.c
@@ -160,14 +160,11 @@ void tipc_net_send_external_routes(u32 dest)
160 160
161static int net_init(void) 161static int net_init(void)
162{ 162{
163 u32 sz = sizeof(struct _zone *) * (tipc_max_zones + 1);
164
165 memset(&tipc_net, 0, sizeof(tipc_net)); 163 memset(&tipc_net, 0, sizeof(tipc_net));
166 tipc_net.zones = (struct _zone **)kmalloc(sz, GFP_ATOMIC); 164 tipc_net.zones = kcalloc(tipc_max_zones + 1, sizeof(struct _zone *), GFP_ATOMIC);
167 if (!tipc_net.zones) { 165 if (!tipc_net.zones) {
168 return -ENOMEM; 166 return -ENOMEM;
169 } 167 }
170 memset(tipc_net.zones, 0, sz);
171 return TIPC_OK; 168 return TIPC_OK;
172} 169}
173 170
diff --git a/net/tipc/port.c b/net/tipc/port.c
index 3251c8d8e53c..b9c8c6b9e94f 100644
--- a/net/tipc/port.c
+++ b/net/tipc/port.c
@@ -226,12 +226,11 @@ u32 tipc_createport_raw(void *usr_handle,
226 struct tipc_msg *msg; 226 struct tipc_msg *msg;
227 u32 ref; 227 u32 ref;
228 228
229 p_ptr = kmalloc(sizeof(*p_ptr), GFP_ATOMIC); 229 p_ptr = kzalloc(sizeof(*p_ptr), GFP_ATOMIC);
230 if (!p_ptr) { 230 if (!p_ptr) {
231 warn("Port creation failed, no memory\n"); 231 warn("Port creation failed, no memory\n");
232 return 0; 232 return 0;
233 } 233 }
234 memset(p_ptr, 0, sizeof(*p_ptr));
235 ref = tipc_ref_acquire(p_ptr, &p_ptr->publ.lock); 234 ref = tipc_ref_acquire(p_ptr, &p_ptr->publ.lock);
236 if (!ref) { 235 if (!ref) {
237 warn("Port creation failed, reference table exhausted\n"); 236 warn("Port creation failed, reference table exhausted\n");
@@ -1058,7 +1057,7 @@ int tipc_createport(u32 user_ref,
1058 struct port *p_ptr; 1057 struct port *p_ptr;
1059 u32 ref; 1058 u32 ref;
1060 1059
1061 up_ptr = (struct user_port *)kmalloc(sizeof(*up_ptr), GFP_ATOMIC); 1060 up_ptr = kmalloc(sizeof(*up_ptr), GFP_ATOMIC);
1062 if (!up_ptr) { 1061 if (!up_ptr) {
1063 warn("Port creation failed, no memory\n"); 1062 warn("Port creation failed, no memory\n");
1064 return -ENOMEM; 1063 return -ENOMEM;
diff --git a/net/tipc/ref.c b/net/tipc/ref.c
index 596d3c8ff750..e6d6ae22ea49 100644
--- a/net/tipc/ref.c
+++ b/net/tipc/ref.c
@@ -79,7 +79,7 @@ int tipc_ref_table_init(u32 requested_size, u32 start)
79 while (sz < requested_size) { 79 while (sz < requested_size) {
80 sz <<= 1; 80 sz <<= 1;
81 } 81 }
82 table = (struct reference *)vmalloc(sz * sizeof(struct reference)); 82 table = vmalloc(sz * sizeof(*table));
83 if (table == NULL) 83 if (table == NULL)
84 return -ENOMEM; 84 return -ENOMEM;
85 85
diff --git a/net/tipc/subscr.c b/net/tipc/subscr.c
index e19b4bcd67ec..c51600ba5f4a 100644
--- a/net/tipc/subscr.c
+++ b/net/tipc/subscr.c
@@ -393,12 +393,11 @@ static void subscr_named_msg_event(void *usr_handle,
393 393
394 /* Create subscriber object */ 394 /* Create subscriber object */
395 395
396 subscriber = kmalloc(sizeof(struct subscriber), GFP_ATOMIC); 396 subscriber = kzalloc(sizeof(struct subscriber), GFP_ATOMIC);
397 if (subscriber == NULL) { 397 if (subscriber == NULL) {
398 warn("Subscriber rejected, no memory\n"); 398 warn("Subscriber rejected, no memory\n");
399 return; 399 return;
400 } 400 }
401 memset(subscriber, 0, sizeof(struct subscriber));
402 INIT_LIST_HEAD(&subscriber->subscription_list); 401 INIT_LIST_HEAD(&subscriber->subscription_list);
403 INIT_LIST_HEAD(&subscriber->subscriber_list); 402 INIT_LIST_HEAD(&subscriber->subscriber_list);
404 subscriber->ref = tipc_ref_acquire(subscriber, &subscriber->lock); 403 subscriber->ref = tipc_ref_acquire(subscriber, &subscriber->lock);
diff --git a/net/tipc/user_reg.c b/net/tipc/user_reg.c
index 1e3ae57c7228..04d1b9be9c51 100644
--- a/net/tipc/user_reg.c
+++ b/net/tipc/user_reg.c
@@ -82,9 +82,8 @@ static int reg_init(void)
82 82
83 spin_lock_bh(&reg_lock); 83 spin_lock_bh(&reg_lock);
84 if (!users) { 84 if (!users) {
85 users = (struct tipc_user *)kmalloc(USER_LIST_SIZE, GFP_ATOMIC); 85 users = kzalloc(USER_LIST_SIZE, GFP_ATOMIC);
86 if (users) { 86 if (users) {
87 memset(users, 0, USER_LIST_SIZE);
88 for (i = 1; i <= MAX_USERID; i++) { 87 for (i = 1; i <= MAX_USERID; i++) {
89 users[i].next = i - 1; 88 users[i].next = i - 1;
90 } 89 }
diff --git a/net/tipc/zone.c b/net/tipc/zone.c
index 316c4872ff5b..f5b00ea2d5ac 100644
--- a/net/tipc/zone.c
+++ b/net/tipc/zone.c
@@ -52,13 +52,12 @@ struct _zone *tipc_zone_create(u32 addr)
52 return NULL; 52 return NULL;
53 } 53 }
54 54
55 z_ptr = (struct _zone *)kmalloc(sizeof(*z_ptr), GFP_ATOMIC); 55 z_ptr = kzalloc(sizeof(*z_ptr), GFP_ATOMIC);
56 if (!z_ptr) { 56 if (!z_ptr) {
57 warn("Zone creation failed, insufficient memory\n"); 57 warn("Zone creation failed, insufficient memory\n");
58 return NULL; 58 return NULL;
59 } 59 }
60 60
61 memset(z_ptr, 0, sizeof(*z_ptr));
62 z_num = tipc_zone(addr); 61 z_num = tipc_zone(addr);
63 z_ptr->addr = tipc_addr(z_num, 0, 0); 62 z_ptr->addr = tipc_addr(z_num, 0, 0);
64 tipc_net.zones[z_num] = z_ptr; 63 tipc_net.zones[z_num] = z_ptr;
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index f70475bfb62a..de6ec519272e 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -128,23 +128,17 @@ static atomic_t unix_nr_socks = ATOMIC_INIT(0);
128#define UNIX_ABSTRACT(sk) (unix_sk(sk)->addr->hash != UNIX_HASH_SIZE) 128#define UNIX_ABSTRACT(sk) (unix_sk(sk)->addr->hash != UNIX_HASH_SIZE)
129 129
130#ifdef CONFIG_SECURITY_NETWORK 130#ifdef CONFIG_SECURITY_NETWORK
131static void unix_get_peersec_dgram(struct sk_buff *skb) 131static void unix_get_secdata(struct scm_cookie *scm, struct sk_buff *skb)
132{ 132{
133 int err; 133 memcpy(UNIXSID(skb), &scm->secid, sizeof(u32));
134
135 err = security_socket_getpeersec_dgram(skb, UNIXSECDATA(skb),
136 UNIXSECLEN(skb));
137 if (err)
138 *(UNIXSECDATA(skb)) = NULL;
139} 134}
140 135
141static inline void unix_set_secdata(struct scm_cookie *scm, struct sk_buff *skb) 136static inline void unix_set_secdata(struct scm_cookie *scm, struct sk_buff *skb)
142{ 137{
143 scm->secdata = *UNIXSECDATA(skb); 138 scm->secid = *UNIXSID(skb);
144 scm->seclen = *UNIXSECLEN(skb);
145} 139}
146#else 140#else
147static inline void unix_get_peersec_dgram(struct sk_buff *skb) 141static inline void unix_get_secdata(struct scm_cookie *scm, struct sk_buff *skb)
148{ } 142{ }
149 143
150static inline void unix_set_secdata(struct scm_cookie *scm, struct sk_buff *skb) 144static inline void unix_set_secdata(struct scm_cookie *scm, struct sk_buff *skb)
@@ -663,11 +657,10 @@ static int unix_autobind(struct socket *sock)
663 goto out; 657 goto out;
664 658
665 err = -ENOMEM; 659 err = -ENOMEM;
666 addr = kmalloc(sizeof(*addr) + sizeof(short) + 16, GFP_KERNEL); 660 addr = kzalloc(sizeof(*addr) + sizeof(short) + 16, GFP_KERNEL);
667 if (!addr) 661 if (!addr)
668 goto out; 662 goto out;
669 663
670 memset(addr, 0, sizeof(*addr) + sizeof(short) + 16);
671 addr->name->sun_family = AF_UNIX; 664 addr->name->sun_family = AF_UNIX;
672 atomic_set(&addr->refcnt, 1); 665 atomic_set(&addr->refcnt, 1);
673 666
@@ -1323,8 +1316,7 @@ static int unix_dgram_sendmsg(struct kiocb *kiocb, struct socket *sock,
1323 memcpy(UNIXCREDS(skb), &siocb->scm->creds, sizeof(struct ucred)); 1316 memcpy(UNIXCREDS(skb), &siocb->scm->creds, sizeof(struct ucred));
1324 if (siocb->scm->fp) 1317 if (siocb->scm->fp)
1325 unix_attach_fds(siocb->scm, skb); 1318 unix_attach_fds(siocb->scm, skb);
1326 1319 unix_get_secdata(siocb->scm, skb);
1327 unix_get_peersec_dgram(skb);
1328 1320
1329 skb->h.raw = skb->data; 1321 skb->h.raw = skb->data;
1330 err = memcpy_fromiovec(skb_put(skb,len), msg->msg_iov, len); 1322 err = memcpy_fromiovec(skb_put(skb,len), msg->msg_iov, len);
diff --git a/net/wanrouter/af_wanpipe.c b/net/wanrouter/af_wanpipe.c
index a690cf773b6a..6f39faa15832 100644
--- a/net/wanrouter/af_wanpipe.c
+++ b/net/wanrouter/af_wanpipe.c
@@ -370,12 +370,11 @@ static int wanpipe_listen_rcv (struct sk_buff *skb, struct sock *sk)
370 * used by the ioctl call to read call information 370 * used by the ioctl call to read call information
371 * and to execute commands. 371 * and to execute commands.
372 */ 372 */
373 if ((mbox_ptr = kmalloc(sizeof(mbox_cmd_t), GFP_ATOMIC)) == NULL) { 373 if ((mbox_ptr = kzalloc(sizeof(mbox_cmd_t), GFP_ATOMIC)) == NULL) {
374 wanpipe_kill_sock_irq (newsk); 374 wanpipe_kill_sock_irq (newsk);
375 release_device(dev); 375 release_device(dev);
376 return -ENOMEM; 376 return -ENOMEM;
377 } 377 }
378 memset(mbox_ptr, 0, sizeof(mbox_cmd_t));
379 memcpy(mbox_ptr,skb->data,skb->len); 378 memcpy(mbox_ptr,skb->data,skb->len);
380 379
381 /* Register the lcn on which incoming call came 380 /* Register the lcn on which incoming call came
@@ -507,11 +506,10 @@ static struct sock *wanpipe_alloc_socket(void)
507 if ((sk = sk_alloc(PF_WANPIPE, GFP_ATOMIC, &wanpipe_proto, 1)) == NULL) 506 if ((sk = sk_alloc(PF_WANPIPE, GFP_ATOMIC, &wanpipe_proto, 1)) == NULL)
508 return NULL; 507 return NULL;
509 508
510 if ((wan_opt = kmalloc(sizeof(struct wanpipe_opt), GFP_ATOMIC)) == NULL) { 509 if ((wan_opt = kzalloc(sizeof(struct wanpipe_opt), GFP_ATOMIC)) == NULL) {
511 sk_free(sk); 510 sk_free(sk);
512 return NULL; 511 return NULL;
513 } 512 }
514 memset(wan_opt, 0x00, sizeof(struct wanpipe_opt));
515 513
516 wp_sk(sk) = wan_opt; 514 wp_sk(sk) = wan_opt;
517 515
@@ -2011,10 +2009,9 @@ static int set_ioctl_cmd (struct sock *sk, void *arg)
2011 2009
2012 dev_put(dev); 2010 dev_put(dev);
2013 2011
2014 if ((mbox_ptr = kmalloc(sizeof(mbox_cmd_t), GFP_ATOMIC)) == NULL) 2012 if ((mbox_ptr = kzalloc(sizeof(mbox_cmd_t), GFP_ATOMIC)) == NULL)
2015 return -ENOMEM; 2013 return -ENOMEM;
2016 2014
2017 memset(mbox_ptr, 0, sizeof(mbox_cmd_t));
2018 wp_sk(sk)->mbox = mbox_ptr; 2015 wp_sk(sk)->mbox = mbox_ptr;
2019 2016
2020 wanpipe_link_driver(dev,sk); 2017 wanpipe_link_driver(dev,sk);
diff --git a/net/wanrouter/wanmain.c b/net/wanrouter/wanmain.c
index ad8e8a797790..9479659277ae 100644
--- a/net/wanrouter/wanmain.c
+++ b/net/wanrouter/wanmain.c
@@ -642,18 +642,16 @@ static int wanrouter_device_new_if(struct wan_device *wandev,
642 642
643 if (cnf->config_id == WANCONFIG_MPPP) { 643 if (cnf->config_id == WANCONFIG_MPPP) {
644#ifdef CONFIG_WANPIPE_MULTPPP 644#ifdef CONFIG_WANPIPE_MULTPPP
645 pppdev = kmalloc(sizeof(struct ppp_device), GFP_KERNEL); 645 pppdev = kzalloc(sizeof(struct ppp_device), GFP_KERNEL);
646 err = -ENOBUFS; 646 err = -ENOBUFS;
647 if (pppdev == NULL) 647 if (pppdev == NULL)
648 goto out; 648 goto out;
649 memset(pppdev, 0, sizeof(struct ppp_device)); 649 pppdev->dev = kzalloc(sizeof(struct net_device), GFP_KERNEL);
650 pppdev->dev = kmalloc(sizeof(struct net_device), GFP_KERNEL);
651 if (pppdev->dev == NULL) { 650 if (pppdev->dev == NULL) {
652 kfree(pppdev); 651 kfree(pppdev);
653 err = -ENOBUFS; 652 err = -ENOBUFS;
654 goto out; 653 goto out;
655 } 654 }
656 memset(pppdev->dev, 0, sizeof(struct net_device));
657 err = wandev->new_if(wandev, (struct net_device *)pppdev, cnf); 655 err = wandev->new_if(wandev, (struct net_device *)pppdev, cnf);
658 dev = pppdev->dev; 656 dev = pppdev->dev;
659#else 657#else
@@ -663,11 +661,10 @@ static int wanrouter_device_new_if(struct wan_device *wandev,
663 goto out; 661 goto out;
664#endif 662#endif
665 } else { 663 } else {
666 dev = kmalloc(sizeof(struct net_device), GFP_KERNEL); 664 dev = kzalloc(sizeof(struct net_device), GFP_KERNEL);
667 err = -ENOBUFS; 665 err = -ENOBUFS;
668 if (dev == NULL) 666 if (dev == NULL)
669 goto out; 667 goto out;
670 memset(dev, 0, sizeof(struct net_device));
671 err = wandev->new_if(wandev, dev, cnf); 668 err = wandev->new_if(wandev, dev, cnf);
672 } 669 }
673 670
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 405b741dff43..f35bc676128c 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -307,10 +307,9 @@ struct xfrm_policy *xfrm_policy_alloc(gfp_t gfp)
307{ 307{
308 struct xfrm_policy *policy; 308 struct xfrm_policy *policy;
309 309
310 policy = kmalloc(sizeof(struct xfrm_policy), gfp); 310 policy = kzalloc(sizeof(struct xfrm_policy), gfp);
311 311
312 if (policy) { 312 if (policy) {
313 memset(policy, 0, sizeof(struct xfrm_policy));
314 atomic_set(&policy->refcnt, 1); 313 atomic_set(&policy->refcnt, 1);
315 rwlock_init(&policy->lock); 314 rwlock_init(&policy->lock);
316 init_timer(&policy->timer); 315 init_timer(&policy->timer);
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 43f00fc28a3d..0021aad5db43 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -194,10 +194,9 @@ struct xfrm_state *xfrm_state_alloc(void)
194{ 194{
195 struct xfrm_state *x; 195 struct xfrm_state *x;
196 196
197 x = kmalloc(sizeof(struct xfrm_state), GFP_ATOMIC); 197 x = kzalloc(sizeof(struct xfrm_state), GFP_ATOMIC);
198 198
199 if (x) { 199 if (x) {
200 memset(x, 0, sizeof(struct xfrm_state));
201 atomic_set(&x->refcnt, 1); 200 atomic_set(&x->refcnt, 1);
202 atomic_set(&x->tunnel_users, 0); 201 atomic_set(&x->tunnel_users, 0);
203 INIT_LIST_HEAD(&x->bydst); 202 INIT_LIST_HEAD(&x->bydst);
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 2180c88cfe89..bb19c1561f1e 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -77,14 +77,20 @@ cc-option-align = $(subst -functions=0,,\
77 77
78# cc-version 78# cc-version
79# Usage gcc-ver := $(call cc-version, $(CC)) 79# Usage gcc-ver := $(call cc-version, $(CC))
80cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh \ 80cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC))
81 $(if $(1), $(1), $(CC)))
82 81
83# cc-ifversion 82# cc-ifversion
84# Usage: EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1) 83# Usage: EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1)
85cc-ifversion = $(shell if [ $(call cc-version, $(CC)) $(1) $(2) ]; then \ 84cc-ifversion = $(shell if [ $(call cc-version, $(CC)) $(1) $(2) ]; then \
86 echo $(3); fi;) 85 echo $(3); fi;)
87 86
87# ld-option
88# Usage: ldflags += $(call ld-option, -Wl$(comma)--hash-style=both)
89ld-option = $(shell if $(CC) $(1) \
90 -nostdlib -o ldtest$$$$.out -xc /dev/null \
91 > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi; \
92 rm -f ldtest$$$$.out)
93
88### 94###
89# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj= 95# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj=
90# Usage: 96# Usage:
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index a49550205dcc..0a64688c2b5d 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -40,7 +40,7 @@ include scripts/Kbuild.include
40include scripts/Makefile.lib 40include scripts/Makefile.lib
41 41
42kernelsymfile := $(objtree)/Module.symvers 42kernelsymfile := $(objtree)/Module.symvers
43modulesymfile := $(KBUILD_EXTMOD)/Modules.symvers 43modulesymfile := $(KBUILD_EXTMOD)/Module.symvers
44 44
45# Step 1), find all modules listed in $(MODVERDIR)/ 45# Step 1), find all modules listed in $(MODVERDIR)/
46__modules := $(sort $(shell grep -h '\.ko' /dev/null $(wildcard $(MODVERDIR)/*.mod))) 46__modules := $(sort $(shell grep -h '\.ko' /dev/null $(wildcard $(MODVERDIR)/*.mod)))
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index 2ee48c377b66..a69d8acbf274 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -357,7 +357,7 @@ int conf_read(const char *name)
357 for (e = prop->expr; e; e = e->left.expr) 357 for (e = prop->expr; e; e = e->left.expr)
358 if (e->right.sym->visible != no) 358 if (e->right.sym->visible != no)
359 flags &= e->right.sym->flags; 359 flags &= e->right.sym->flags;
360 sym->flags |= flags & SYMBOL_DEF_USER; 360 sym->flags &= flags | ~SYMBOL_DEF_USER;
361 } 361 }
362 362
363 sym_change_count += conf_warnings || conf_unsaved; 363 sym_change_count += conf_warnings || conf_unsaved;
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index f9460a6218de..c9ca0c23bd91 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1518,6 +1518,7 @@ sub dump_function($$) {
1518 $prototype =~ s/^asmlinkage +//; 1518 $prototype =~ s/^asmlinkage +//;
1519 $prototype =~ s/^inline +//; 1519 $prototype =~ s/^inline +//;
1520 $prototype =~ s/^__inline__ +//; 1520 $prototype =~ s/^__inline__ +//;
1521 $prototype =~ s/__devinit +//;
1521 $prototype =~ s/^#define +//; #ak added 1522 $prototype =~ s/^#define +//; #ak added
1522 $prototype =~ s/__attribute__ \(\([a-z,]*\)\)//; 1523 $prototype =~ s/__attribute__ \(\([a-z,]*\)\)//;
1523 1524
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 37f67c23e11b..44312926b849 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -52,6 +52,23 @@ do { \
52 sprintf(str + strlen(str), "*"); \ 52 sprintf(str + strlen(str), "*"); \
53} while(0) 53} while(0)
54 54
55/**
56 * Check that sizeof(device_id type) are consistent with size of section
57 * in .o file. If in-consistent then userspace and kernel does not agree
58 * on actual size which is a bug.
59 **/
60static void device_id_size_check(const char *modname, const char *device_id,
61 unsigned long size, unsigned long id_size)
62{
63 if (size % id_size || size < id_size) {
64 fatal("%s: sizeof(struct %s_device_id)=%lu is not a modulo "
65 "of the size of section __mod_%s_device_table=%lu.\n"
66 "Fix definition of struct %s_device_id "
67 "in mod_devicetable.h\n",
68 modname, device_id, id_size, device_id, size, device_id);
69 }
70}
71
55/* USB is special because the bcdDevice can be matched against a numeric range */ 72/* USB is special because the bcdDevice can be matched against a numeric range */
56/* Looks like "usb:vNpNdNdcNdscNdpNicNiscNipN" */ 73/* Looks like "usb:vNpNdNdcNdscNdpNicNiscNipN" */
57static void do_usb_entry(struct usb_device_id *id, 74static void do_usb_entry(struct usb_device_id *id,
@@ -152,10 +169,8 @@ static void do_usb_table(void *symval, unsigned long size,
152 unsigned int i; 169 unsigned int i;
153 const unsigned long id_size = sizeof(struct usb_device_id); 170 const unsigned long id_size = sizeof(struct usb_device_id);
154 171
155 if (size % id_size || size < id_size) { 172 device_id_size_check(mod->name, "usb", size, id_size);
156 warn("%s ids %lu bad size " 173
157 "(each on %lu)\n", mod->name, size, id_size);
158 }
159 /* Leave last one: it's the terminator. */ 174 /* Leave last one: it's the terminator. */
160 size -= id_size; 175 size -= id_size;
161 176
@@ -434,6 +449,7 @@ static inline int sym_is(const char *symbol, const char *name)
434 449
435static void do_table(void *symval, unsigned long size, 450static void do_table(void *symval, unsigned long size,
436 unsigned long id_size, 451 unsigned long id_size,
452 const char *device_id,
437 void *function, 453 void *function,
438 struct module *mod) 454 struct module *mod)
439{ 455{
@@ -441,10 +457,7 @@ static void do_table(void *symval, unsigned long size,
441 char alias[500]; 457 char alias[500];
442 int (*do_entry)(const char *, void *entry, char *alias) = function; 458 int (*do_entry)(const char *, void *entry, char *alias) = function;
443 459
444 if (size % id_size || size < id_size) { 460 device_id_size_check(mod->name, device_id, size, id_size);
445 warn("%s ids %lu bad size "
446 "(each on %lu)\n", mod->name, size, id_size);
447 }
448 /* Leave last one: it's the terminator. */ 461 /* Leave last one: it's the terminator. */
449 size -= id_size; 462 size -= id_size;
450 463
@@ -476,40 +489,51 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
476 + sym->st_value; 489 + sym->st_value;
477 490
478 if (sym_is(symname, "__mod_pci_device_table")) 491 if (sym_is(symname, "__mod_pci_device_table"))
479 do_table(symval, sym->st_size, sizeof(struct pci_device_id), 492 do_table(symval, sym->st_size,
493 sizeof(struct pci_device_id), "pci",
480 do_pci_entry, mod); 494 do_pci_entry, mod);
481 else if (sym_is(symname, "__mod_usb_device_table")) 495 else if (sym_is(symname, "__mod_usb_device_table"))
482 /* special case to handle bcdDevice ranges */ 496 /* special case to handle bcdDevice ranges */
483 do_usb_table(symval, sym->st_size, mod); 497 do_usb_table(symval, sym->st_size, mod);
484 else if (sym_is(symname, "__mod_ieee1394_device_table")) 498 else if (sym_is(symname, "__mod_ieee1394_device_table"))
485 do_table(symval, sym->st_size, sizeof(struct ieee1394_device_id), 499 do_table(symval, sym->st_size,
500 sizeof(struct ieee1394_device_id), "ieee1394",
486 do_ieee1394_entry, mod); 501 do_ieee1394_entry, mod);
487 else if (sym_is(symname, "__mod_ccw_device_table")) 502 else if (sym_is(symname, "__mod_ccw_device_table"))
488 do_table(symval, sym->st_size, sizeof(struct ccw_device_id), 503 do_table(symval, sym->st_size,
504 sizeof(struct ccw_device_id), "ccw",
489 do_ccw_entry, mod); 505 do_ccw_entry, mod);
490 else if (sym_is(symname, "__mod_serio_device_table")) 506 else if (sym_is(symname, "__mod_serio_device_table"))
491 do_table(symval, sym->st_size, sizeof(struct serio_device_id), 507 do_table(symval, sym->st_size,
508 sizeof(struct serio_device_id), "serio",
492 do_serio_entry, mod); 509 do_serio_entry, mod);
493 else if (sym_is(symname, "__mod_pnp_device_table")) 510 else if (sym_is(symname, "__mod_pnp_device_table"))
494 do_table(symval, sym->st_size, sizeof(struct pnp_device_id), 511 do_table(symval, sym->st_size,
512 sizeof(struct pnp_device_id), "pnp",
495 do_pnp_entry, mod); 513 do_pnp_entry, mod);
496 else if (sym_is(symname, "__mod_pnp_card_device_table")) 514 else if (sym_is(symname, "__mod_pnp_card_device_table"))
497 do_table(symval, sym->st_size, sizeof(struct pnp_card_device_id), 515 do_table(symval, sym->st_size,
516 sizeof(struct pnp_card_device_id), "pnp_card",
498 do_pnp_card_entry, mod); 517 do_pnp_card_entry, mod);
499 else if (sym_is(symname, "__mod_pcmcia_device_table")) 518 else if (sym_is(symname, "__mod_pcmcia_device_table"))
500 do_table(symval, sym->st_size, sizeof(struct pcmcia_device_id), 519 do_table(symval, sym->st_size,
520 sizeof(struct pcmcia_device_id), "pcmcia",
501 do_pcmcia_entry, mod); 521 do_pcmcia_entry, mod);
502 else if (sym_is(symname, "__mod_of_device_table")) 522 else if (sym_is(symname, "__mod_of_device_table"))
503 do_table(symval, sym->st_size, sizeof(struct of_device_id), 523 do_table(symval, sym->st_size,
524 sizeof(struct of_device_id), "of",
504 do_of_entry, mod); 525 do_of_entry, mod);
505 else if (sym_is(symname, "__mod_vio_device_table")) 526 else if (sym_is(symname, "__mod_vio_device_table"))
506 do_table(symval, sym->st_size, sizeof(struct vio_device_id), 527 do_table(symval, sym->st_size,
528 sizeof(struct vio_device_id), "vio",
507 do_vio_entry, mod); 529 do_vio_entry, mod);
508 else if (sym_is(symname, "__mod_i2c_device_table")) 530 else if (sym_is(symname, "__mod_i2c_device_table"))
509 do_table(symval, sym->st_size, sizeof(struct i2c_device_id), 531 do_table(symval, sym->st_size,
532 sizeof(struct i2c_device_id), "i2c",
510 do_i2c_entry, mod); 533 do_i2c_entry, mod);
511 else if (sym_is(symname, "__mod_input_device_table")) 534 else if (sym_is(symname, "__mod_input_device_table"))
512 do_table(symval, sym->st_size, sizeof(struct input_device_id), 535 do_table(symval, sym->st_size,
536 sizeof(struct input_device_id), "input",
513 do_input_entry, mod); 537 do_input_entry, mod);
514} 538}
515 539
diff --git a/security/dummy.c b/security/dummy.c
index bbbfda70e131..58c6d399c844 100644
--- a/security/dummy.c
+++ b/security/dummy.c
@@ -791,8 +791,7 @@ static int dummy_socket_getpeersec_stream(struct socket *sock, char __user *optv
791 return -ENOPROTOOPT; 791 return -ENOPROTOOPT;
792} 792}
793 793
794static int dummy_socket_getpeersec_dgram(struct sk_buff *skb, char **secdata, 794static int dummy_socket_getpeersec_dgram(struct socket *sock, struct sk_buff *skb, u32 *secid)
795 u32 *seclen)
796{ 795{
797 return -ENOPROTOOPT; 796 return -ENOPROTOOPT;
798} 797}
@@ -876,6 +875,15 @@ static int dummy_setprocattr(struct task_struct *p, char *name, void *value, siz
876 return -EINVAL; 875 return -EINVAL;
877} 876}
878 877
878static int dummy_secid_to_secctx(u32 secid, char **secdata, u32 *seclen)
879{
880 return -EOPNOTSUPP;
881}
882
883static void dummy_release_secctx(char *secdata, u32 seclen)
884{
885}
886
879#ifdef CONFIG_KEYS 887#ifdef CONFIG_KEYS
880static inline int dummy_key_alloc(struct key *key, struct task_struct *ctx, 888static inline int dummy_key_alloc(struct key *key, struct task_struct *ctx,
881 unsigned long flags) 889 unsigned long flags)
@@ -1028,6 +1036,8 @@ void security_fixup_ops (struct security_operations *ops)
1028 set_to_dummy_if_null(ops, d_instantiate); 1036 set_to_dummy_if_null(ops, d_instantiate);
1029 set_to_dummy_if_null(ops, getprocattr); 1037 set_to_dummy_if_null(ops, getprocattr);
1030 set_to_dummy_if_null(ops, setprocattr); 1038 set_to_dummy_if_null(ops, setprocattr);
1039 set_to_dummy_if_null(ops, secid_to_secctx);
1040 set_to_dummy_if_null(ops, release_secctx);
1031#ifdef CONFIG_SECURITY_NETWORK 1041#ifdef CONFIG_SECURITY_NETWORK
1032 set_to_dummy_if_null(ops, unix_stream_connect); 1042 set_to_dummy_if_null(ops, unix_stream_connect);
1033 set_to_dummy_if_null(ops, unix_may_send); 1043 set_to_dummy_if_null(ops, unix_may_send);
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 24caaeec8894..5d1b8c733199 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -246,6 +246,7 @@ static int superblock_alloc_security(struct super_block *sb)
246 sbsec->sb = sb; 246 sbsec->sb = sb;
247 sbsec->sid = SECINITSID_UNLABELED; 247 sbsec->sid = SECINITSID_UNLABELED;
248 sbsec->def_sid = SECINITSID_FILE; 248 sbsec->def_sid = SECINITSID_FILE;
249 sbsec->mntpoint_sid = SECINITSID_UNLABELED;
249 sb->s_security = sbsec; 250 sb->s_security = sbsec;
250 251
251 return 0; 252 return 0;
@@ -319,19 +320,53 @@ enum {
319 Opt_context = 1, 320 Opt_context = 1,
320 Opt_fscontext = 2, 321 Opt_fscontext = 2,
321 Opt_defcontext = 4, 322 Opt_defcontext = 4,
323 Opt_rootcontext = 8,
322}; 324};
323 325
324static match_table_t tokens = { 326static match_table_t tokens = {
325 {Opt_context, "context=%s"}, 327 {Opt_context, "context=%s"},
326 {Opt_fscontext, "fscontext=%s"}, 328 {Opt_fscontext, "fscontext=%s"},
327 {Opt_defcontext, "defcontext=%s"}, 329 {Opt_defcontext, "defcontext=%s"},
330 {Opt_rootcontext, "rootcontext=%s"},
328}; 331};
329 332
330#define SEL_MOUNT_FAIL_MSG "SELinux: duplicate or incompatible mount options\n" 333#define SEL_MOUNT_FAIL_MSG "SELinux: duplicate or incompatible mount options\n"
331 334
335static int may_context_mount_sb_relabel(u32 sid,
336 struct superblock_security_struct *sbsec,
337 struct task_security_struct *tsec)
338{
339 int rc;
340
341 rc = avc_has_perm(tsec->sid, sbsec->sid, SECCLASS_FILESYSTEM,
342 FILESYSTEM__RELABELFROM, NULL);
343 if (rc)
344 return rc;
345
346 rc = avc_has_perm(tsec->sid, sid, SECCLASS_FILESYSTEM,
347 FILESYSTEM__RELABELTO, NULL);
348 return rc;
349}
350
351static int may_context_mount_inode_relabel(u32 sid,
352 struct superblock_security_struct *sbsec,
353 struct task_security_struct *tsec)
354{
355 int rc;
356 rc = avc_has_perm(tsec->sid, sbsec->sid, SECCLASS_FILESYSTEM,
357 FILESYSTEM__RELABELFROM, NULL);
358 if (rc)
359 return rc;
360
361 rc = avc_has_perm(sid, sbsec->sid, SECCLASS_FILESYSTEM,
362 FILESYSTEM__ASSOCIATE, NULL);
363 return rc;
364}
365
332static int try_context_mount(struct super_block *sb, void *data) 366static int try_context_mount(struct super_block *sb, void *data)
333{ 367{
334 char *context = NULL, *defcontext = NULL; 368 char *context = NULL, *defcontext = NULL;
369 char *fscontext = NULL, *rootcontext = NULL;
335 const char *name; 370 const char *name;
336 u32 sid; 371 u32 sid;
337 int alloc = 0, rc = 0, seen = 0; 372 int alloc = 0, rc = 0, seen = 0;
@@ -374,7 +409,7 @@ static int try_context_mount(struct super_block *sb, void *data)
374 409
375 switch (token) { 410 switch (token) {
376 case Opt_context: 411 case Opt_context:
377 if (seen) { 412 if (seen & (Opt_context|Opt_defcontext)) {
378 rc = -EINVAL; 413 rc = -EINVAL;
379 printk(KERN_WARNING SEL_MOUNT_FAIL_MSG); 414 printk(KERN_WARNING SEL_MOUNT_FAIL_MSG);
380 goto out_free; 415 goto out_free;
@@ -390,13 +425,13 @@ static int try_context_mount(struct super_block *sb, void *data)
390 break; 425 break;
391 426
392 case Opt_fscontext: 427 case Opt_fscontext:
393 if (seen & (Opt_context|Opt_fscontext)) { 428 if (seen & Opt_fscontext) {
394 rc = -EINVAL; 429 rc = -EINVAL;
395 printk(KERN_WARNING SEL_MOUNT_FAIL_MSG); 430 printk(KERN_WARNING SEL_MOUNT_FAIL_MSG);
396 goto out_free; 431 goto out_free;
397 } 432 }
398 context = match_strdup(&args[0]); 433 fscontext = match_strdup(&args[0]);
399 if (!context) { 434 if (!fscontext) {
400 rc = -ENOMEM; 435 rc = -ENOMEM;
401 goto out_free; 436 goto out_free;
402 } 437 }
@@ -405,6 +440,22 @@ static int try_context_mount(struct super_block *sb, void *data)
405 seen |= Opt_fscontext; 440 seen |= Opt_fscontext;
406 break; 441 break;
407 442
443 case Opt_rootcontext:
444 if (seen & Opt_rootcontext) {
445 rc = -EINVAL;
446 printk(KERN_WARNING SEL_MOUNT_FAIL_MSG);
447 goto out_free;
448 }
449 rootcontext = match_strdup(&args[0]);
450 if (!rootcontext) {
451 rc = -ENOMEM;
452 goto out_free;
453 }
454 if (!alloc)
455 alloc = 1;
456 seen |= Opt_rootcontext;
457 break;
458
408 case Opt_defcontext: 459 case Opt_defcontext:
409 if (sbsec->behavior != SECURITY_FS_USE_XATTR) { 460 if (sbsec->behavior != SECURITY_FS_USE_XATTR) {
410 rc = -EINVAL; 461 rc = -EINVAL;
@@ -441,6 +492,28 @@ static int try_context_mount(struct super_block *sb, void *data)
441 if (!seen) 492 if (!seen)
442 goto out; 493 goto out;
443 494
495 /* sets the context of the superblock for the fs being mounted. */
496 if (fscontext) {
497 rc = security_context_to_sid(fscontext, strlen(fscontext), &sid);
498 if (rc) {
499 printk(KERN_WARNING "SELinux: security_context_to_sid"
500 "(%s) failed for (dev %s, type %s) errno=%d\n",
501 fscontext, sb->s_id, name, rc);
502 goto out_free;
503 }
504
505 rc = may_context_mount_sb_relabel(sid, sbsec, tsec);
506 if (rc)
507 goto out_free;
508
509 sbsec->sid = sid;
510 }
511
512 /*
513 * Switch to using mount point labeling behavior.
514 * sets the label used on all file below the mountpoint, and will set
515 * the superblock context if not already set.
516 */
444 if (context) { 517 if (context) {
445 rc = security_context_to_sid(context, strlen(context), &sid); 518 rc = security_context_to_sid(context, strlen(context), &sid);
446 if (rc) { 519 if (rc) {
@@ -450,20 +523,38 @@ static int try_context_mount(struct super_block *sb, void *data)
450 goto out_free; 523 goto out_free;
451 } 524 }
452 525
453 rc = avc_has_perm(tsec->sid, sbsec->sid, SECCLASS_FILESYSTEM, 526 if (!fscontext) {
454 FILESYSTEM__RELABELFROM, NULL); 527 rc = may_context_mount_sb_relabel(sid, sbsec, tsec);
455 if (rc) 528 if (rc)
529 goto out_free;
530 sbsec->sid = sid;
531 } else {
532 rc = may_context_mount_inode_relabel(sid, sbsec, tsec);
533 if (rc)
534 goto out_free;
535 }
536 sbsec->mntpoint_sid = sid;
537
538 sbsec->behavior = SECURITY_FS_USE_MNTPOINT;
539 }
540
541 if (rootcontext) {
542 struct inode *inode = sb->s_root->d_inode;
543 struct inode_security_struct *isec = inode->i_security;
544 rc = security_context_to_sid(rootcontext, strlen(rootcontext), &sid);
545 if (rc) {
546 printk(KERN_WARNING "SELinux: security_context_to_sid"
547 "(%s) failed for (dev %s, type %s) errno=%d\n",
548 rootcontext, sb->s_id, name, rc);
456 goto out_free; 549 goto out_free;
550 }
457 551
458 rc = avc_has_perm(tsec->sid, sid, SECCLASS_FILESYSTEM, 552 rc = may_context_mount_inode_relabel(sid, sbsec, tsec);
459 FILESYSTEM__RELABELTO, NULL);
460 if (rc) 553 if (rc)
461 goto out_free; 554 goto out_free;
462 555
463 sbsec->sid = sid; 556 isec->sid = sid;
464 557 isec->initialized = 1;
465 if (seen & Opt_context)
466 sbsec->behavior = SECURITY_FS_USE_MNTPOINT;
467 } 558 }
468 559
469 if (defcontext) { 560 if (defcontext) {
@@ -478,13 +569,7 @@ static int try_context_mount(struct super_block *sb, void *data)
478 if (sid == sbsec->def_sid) 569 if (sid == sbsec->def_sid)
479 goto out_free; 570 goto out_free;
480 571
481 rc = avc_has_perm(tsec->sid, sbsec->sid, SECCLASS_FILESYSTEM, 572 rc = may_context_mount_inode_relabel(sid, sbsec, tsec);
482 FILESYSTEM__RELABELFROM, NULL);
483 if (rc)
484 goto out_free;
485
486 rc = avc_has_perm(sid, sbsec->sid, SECCLASS_FILESYSTEM,
487 FILESYSTEM__ASSOCIATE, NULL);
488 if (rc) 573 if (rc)
489 goto out_free; 574 goto out_free;
490 575
@@ -495,6 +580,8 @@ out_free:
495 if (alloc) { 580 if (alloc) {
496 kfree(context); 581 kfree(context);
497 kfree(defcontext); 582 kfree(defcontext);
583 kfree(fscontext);
584 kfree(rootcontext);
498 } 585 }
499out: 586out:
500 return rc; 587 return rc;
@@ -876,8 +963,11 @@ static int inode_doinit_with_dentry(struct inode *inode, struct dentry *opt_dent
876 goto out; 963 goto out;
877 isec->sid = sid; 964 isec->sid = sid;
878 break; 965 break;
966 case SECURITY_FS_USE_MNTPOINT:
967 isec->sid = sbsec->mntpoint_sid;
968 break;
879 default: 969 default:
880 /* Default to the fs SID. */ 970 /* Default to the fs superblock SID. */
881 isec->sid = sbsec->sid; 971 isec->sid = sbsec->sid;
882 972
883 if (sbsec->proc) { 973 if (sbsec->proc) {
@@ -1843,7 +1933,8 @@ static inline int selinux_option(char *option, int len)
1843{ 1933{
1844 return (match_prefix("context=", sizeof("context=")-1, option, len) || 1934 return (match_prefix("context=", sizeof("context=")-1, option, len) ||
1845 match_prefix("fscontext=", sizeof("fscontext=")-1, option, len) || 1935 match_prefix("fscontext=", sizeof("fscontext=")-1, option, len) ||
1846 match_prefix("defcontext=", sizeof("defcontext=")-1, option, len)); 1936 match_prefix("defcontext=", sizeof("defcontext=")-1, option, len) ||
1937 match_prefix("rootcontext=", sizeof("rootcontext=")-1, option, len));
1847} 1938}
1848 1939
1849static inline void take_option(char **to, char *from, int *first, int len) 1940static inline void take_option(char **to, char *from, int *first, int len)
@@ -3433,25 +3524,21 @@ out:
3433 return err; 3524 return err;
3434} 3525}
3435 3526
3436static int selinux_socket_getpeersec_dgram(struct sk_buff *skb, char **secdata, u32 *seclen) 3527static int selinux_socket_getpeersec_dgram(struct socket *sock, struct sk_buff *skb, u32 *secid)
3437{ 3528{
3529 u32 peer_secid = SECSID_NULL;
3438 int err = 0; 3530 int err = 0;
3439 u32 peer_sid;
3440 3531
3441 if (skb->sk->sk_family == PF_UNIX) 3532 if (sock && (sock->sk->sk_family == PF_UNIX))
3442 selinux_get_inode_sid(SOCK_INODE(skb->sk->sk_socket), 3533 selinux_get_inode_sid(SOCK_INODE(sock), &peer_secid);
3443 &peer_sid); 3534 else if (skb)
3444 else 3535 peer_secid = selinux_socket_getpeer_dgram(skb);
3445 peer_sid = selinux_socket_getpeer_dgram(skb);
3446
3447 if (peer_sid == SECSID_NULL)
3448 return -EINVAL;
3449 3536
3450 err = security_sid_to_context(peer_sid, secdata, seclen); 3537 if (peer_secid == SECSID_NULL)
3451 if (err) 3538 err = -EINVAL;
3452 return err; 3539 *secid = peer_secid;
3453 3540
3454 return 0; 3541 return err;
3455} 3542}
3456 3543
3457static int selinux_sk_alloc_security(struct sock *sk, int family, gfp_t priority) 3544static int selinux_sk_alloc_security(struct sock *sk, int family, gfp_t priority)
@@ -4316,6 +4403,17 @@ static int selinux_setprocattr(struct task_struct *p,
4316 return size; 4403 return size;
4317} 4404}
4318 4405
4406static int selinux_secid_to_secctx(u32 secid, char **secdata, u32 *seclen)
4407{
4408 return security_sid_to_context(secid, secdata, seclen);
4409}
4410
4411static void selinux_release_secctx(char *secdata, u32 seclen)
4412{
4413 if (secdata)
4414 kfree(secdata);
4415}
4416
4319#ifdef CONFIG_KEYS 4417#ifdef CONFIG_KEYS
4320 4418
4321static int selinux_key_alloc(struct key *k, struct task_struct *tsk, 4419static int selinux_key_alloc(struct key *k, struct task_struct *tsk,
@@ -4496,6 +4594,9 @@ static struct security_operations selinux_ops = {
4496 .getprocattr = selinux_getprocattr, 4594 .getprocattr = selinux_getprocattr,
4497 .setprocattr = selinux_setprocattr, 4595 .setprocattr = selinux_setprocattr,
4498 4596
4597 .secid_to_secctx = selinux_secid_to_secctx,
4598 .release_secctx = selinux_release_secctx,
4599
4499 .unix_stream_connect = selinux_socket_unix_stream_connect, 4600 .unix_stream_connect = selinux_socket_unix_stream_connect,
4500 .unix_may_send = selinux_socket_unix_may_send, 4601 .unix_may_send = selinux_socket_unix_may_send,
4501 4602
diff --git a/security/selinux/include/objsec.h b/security/selinux/include/objsec.h
index cf54a304169a..940178865fc7 100644
--- a/security/selinux/include/objsec.h
+++ b/security/selinux/include/objsec.h
@@ -57,8 +57,9 @@ struct file_security_struct {
57struct superblock_security_struct { 57struct superblock_security_struct {
58 struct super_block *sb; /* back pointer to sb object */ 58 struct super_block *sb; /* back pointer to sb object */
59 struct list_head list; /* list of superblock_security_struct */ 59 struct list_head list; /* list of superblock_security_struct */
60 u32 sid; /* SID of file system */ 60 u32 sid; /* SID of file system superblock */
61 u32 def_sid; /* default SID for labeling */ 61 u32 def_sid; /* default SID for labeling */
62 u32 mntpoint_sid; /* SECURITY_FS_USE_MNTPOINT context for files */
62 unsigned int behavior; /* labeling behavior */ 63 unsigned int behavior; /* labeling behavior */
63 unsigned char initialized; /* initialization flag */ 64 unsigned char initialized; /* initialization flag */
64 unsigned char proc; /* proc fs */ 65 unsigned char proc; /* proc fs */
diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c
index 0111990ba837..f03960e697ce 100644
--- a/security/selinux/ss/policydb.c
+++ b/security/selinux/ss/policydb.c
@@ -644,10 +644,18 @@ void policydb_destroy(struct policydb *p)
644 kfree(lra); 644 kfree(lra);
645 645
646 for (rt = p->range_tr; rt; rt = rt -> next) { 646 for (rt = p->range_tr; rt; rt = rt -> next) {
647 kfree(lrt); 647 if (lrt) {
648 ebitmap_destroy(&lrt->range.level[0].cat);
649 ebitmap_destroy(&lrt->range.level[1].cat);
650 kfree(lrt);
651 }
648 lrt = rt; 652 lrt = rt;
649 } 653 }
650 kfree(lrt); 654 if (lrt) {
655 ebitmap_destroy(&lrt->range.level[0].cat);
656 ebitmap_destroy(&lrt->range.level[1].cat);
657 kfree(lrt);
658 }
651 659
652 if (p->type_attr_map) { 660 if (p->type_attr_map) {
653 for (i = 0; i < p->p_types.nprim; i++) 661 for (i = 0; i < p->p_types.nprim; i++)
diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c
index d2e80e62ff0c..85e429884393 100644
--- a/security/selinux/ss/services.c
+++ b/security/selinux/ss/services.c
@@ -833,6 +833,8 @@ static int security_compute_sid(u32 ssid,
833 goto out; 833 goto out;
834 } 834 }
835 835
836 context_init(&newcontext);
837
836 POLICY_RDLOCK; 838 POLICY_RDLOCK;
837 839
838 scontext = sidtab_search(&sidtab, ssid); 840 scontext = sidtab_search(&sidtab, ssid);
@@ -850,8 +852,6 @@ static int security_compute_sid(u32 ssid,
850 goto out_unlock; 852 goto out_unlock;
851 } 853 }
852 854
853 context_init(&newcontext);
854
855 /* Set the user identity. */ 855 /* Set the user identity. */
856 switch (specified) { 856 switch (specified) {
857 case AVTAB_TRANSITION: 857 case AVTAB_TRANSITION:
diff --git a/sound/aoa/Makefile b/sound/aoa/Makefile
index d8de3e7df48d..a8c037f908f8 100644
--- a/sound/aoa/Makefile
+++ b/sound/aoa/Makefile
@@ -1,4 +1,4 @@
1obj-$(CONFIG_SND_AOA) += core/ 1obj-$(CONFIG_SND_AOA) += core/
2obj-$(CONFIG_SND_AOA) += codecs/
3obj-$(CONFIG_SND_AOA) += fabrics/
4obj-$(CONFIG_SND_AOA_SOUNDBUS) += soundbus/ 2obj-$(CONFIG_SND_AOA_SOUNDBUS) += soundbus/
3obj-$(CONFIG_SND_AOA) += fabrics/
4obj-$(CONFIG_SND_AOA) += codecs/
diff --git a/sound/aoa/codecs/snd-aoa-codec-tas-basstreble.h b/sound/aoa/codecs/snd-aoa-codec-tas-basstreble.h
new file mode 100644
index 000000000000..69b61136fd54
--- /dev/null
+++ b/sound/aoa/codecs/snd-aoa-codec-tas-basstreble.h
@@ -0,0 +1,134 @@
1/*
2 * This file is only included exactly once!
3 *
4 * The tables here are derived from the tas3004 datasheet,
5 * modulo typo corrections and some smoothing...
6 */
7
8#define TAS3004_TREBLE_MIN 0
9#define TAS3004_TREBLE_MAX 72
10#define TAS3004_BASS_MIN 0
11#define TAS3004_BASS_MAX 72
12#define TAS3004_TREBLE_ZERO 36
13#define TAS3004_BASS_ZERO 36
14
15static u8 tas3004_treble_table[] = {
16 150, /* -18 dB */
17 149,
18 148,
19 147,
20 146,
21 145,
22 144,
23 143,
24 142,
25 141,
26 140,
27 139,
28 138,
29 137,
30 136,
31 135,
32 134,
33 133,
34 132,
35 131,
36 130,
37 129,
38 128,
39 127,
40 126,
41 125,
42 124,
43 123,
44 122,
45 121,
46 120,
47 119,
48 118,
49 117,
50 116,
51 115,
52 114, /* 0 dB */
53 113,
54 112,
55 111,
56 109,
57 108,
58 107,
59 105,
60 104,
61 103,
62 101,
63 99,
64 98,
65 96,
66 93,
67 91,
68 89,
69 86,
70 83,
71 81,
72 77,
73 74,
74 71,
75 67,
76 63,
77 59,
78 54,
79 49,
80 44,
81 38,
82 32,
83 26,
84 19,
85 10,
86 4,
87 2,
88 1, /* +18 dB */
89};
90
91static inline u8 tas3004_treble(int idx)
92{
93 return tas3004_treble_table[idx];
94}
95
96/* I only save the difference here to the treble table
97 * so that the binary is smaller...
98 * I have also ignored completely differences of
99 * +/- 1
100 */
101static s8 tas3004_bass_diff_to_treble[] = {
102 2, /* 7 dB, offset 50 */
103 2,
104 2,
105 2,
106 2,
107 1,
108 2,
109 2,
110 2,
111 3,
112 4,
113 4,
114 5,
115 6,
116 7,
117 8,
118 9,
119 10,
120 11,
121 14,
122 13,
123 8,
124 1, /* 18 dB */
125};
126
127static inline u8 tas3004_bass(int idx)
128{
129 u8 result = tas3004_treble_table[idx];
130
131 if (idx >= 50)
132 result += tas3004_bass_diff_to_treble[idx-50];
133 return result;
134}
diff --git a/sound/aoa/codecs/snd-aoa-codec-tas.c b/sound/aoa/codecs/snd-aoa-codec-tas.c
index 2e39ff6ee349..16c0b6b0a805 100644
--- a/sound/aoa/codecs/snd-aoa-codec-tas.c
+++ b/sound/aoa/codecs/snd-aoa-codec-tas.c
@@ -72,22 +72,29 @@ MODULE_DESCRIPTION("tas codec driver for snd-aoa");
72 72
73#include "snd-aoa-codec-tas.h" 73#include "snd-aoa-codec-tas.h"
74#include "snd-aoa-codec-tas-gain-table.h" 74#include "snd-aoa-codec-tas-gain-table.h"
75#include "snd-aoa-codec-tas-basstreble.h"
75#include "../aoa.h" 76#include "../aoa.h"
76#include "../soundbus/soundbus.h" 77#include "../soundbus/soundbus.h"
77 78
78
79#define PFX "snd-aoa-codec-tas: " 79#define PFX "snd-aoa-codec-tas: "
80 80
81
81struct tas { 82struct tas {
82 struct aoa_codec codec; 83 struct aoa_codec codec;
83 struct i2c_client i2c; 84 struct i2c_client i2c;
84 u32 muted_l:1, muted_r:1, 85 u32 mute_l:1, mute_r:1 ,
85 controls_created:1; 86 controls_created:1 ,
87 drc_enabled:1,
88 hw_enabled:1;
86 u8 cached_volume_l, cached_volume_r; 89 u8 cached_volume_l, cached_volume_r;
87 u8 mixer_l[3], mixer_r[3]; 90 u8 mixer_l[3], mixer_r[3];
91 u8 bass, treble;
88 u8 acr; 92 u8 acr;
93 int drc_range;
89}; 94};
90 95
96static int tas_reset_init(struct tas *tas);
97
91static struct tas *codec_to_tas(struct aoa_codec *codec) 98static struct tas *codec_to_tas(struct aoa_codec *codec)
92{ 99{
93 return container_of(codec, struct tas, codec); 100 return container_of(codec, struct tas, codec);
@@ -101,6 +108,44 @@ static inline int tas_write_reg(struct tas *tas, u8 reg, u8 len, u8 *data)
101 return i2c_smbus_write_i2c_block_data(&tas->i2c, reg, len, data); 108 return i2c_smbus_write_i2c_block_data(&tas->i2c, reg, len, data);
102} 109}
103 110
111static void tas3004_set_drc(struct tas *tas)
112{
113 unsigned char val[6];
114
115 if (tas->drc_enabled)
116 val[0] = 0x50; /* 3:1 above threshold */
117 else
118 val[0] = 0x51; /* disabled */
119 val[1] = 0x02; /* 1:1 below threshold */
120 if (tas->drc_range > 0xef)
121 val[2] = 0xef;
122 else if (tas->drc_range < 0)
123 val[2] = 0x00;
124 else
125 val[2] = tas->drc_range;
126 val[3] = 0xb0;
127 val[4] = 0x60;
128 val[5] = 0xa0;
129
130 tas_write_reg(tas, TAS_REG_DRC, 6, val);
131}
132
133static void tas_set_treble(struct tas *tas)
134{
135 u8 tmp;
136
137 tmp = tas3004_treble(tas->treble);
138 tas_write_reg(tas, TAS_REG_TREBLE, 1, &tmp);
139}
140
141static void tas_set_bass(struct tas *tas)
142{
143 u8 tmp;
144
145 tmp = tas3004_bass(tas->bass);
146 tas_write_reg(tas, TAS_REG_BASS, 1, &tmp);
147}
148
104static void tas_set_volume(struct tas *tas) 149static void tas_set_volume(struct tas *tas)
105{ 150{
106 u8 block[6]; 151 u8 block[6];
@@ -113,8 +158,8 @@ static void tas_set_volume(struct tas *tas)
113 if (left > 177) left = 177; 158 if (left > 177) left = 177;
114 if (right > 177) right = 177; 159 if (right > 177) right = 177;
115 160
116 if (tas->muted_l) left = 0; 161 if (tas->mute_l) left = 0;
117 if (tas->muted_r) right = 0; 162 if (tas->mute_r) right = 0;
118 163
119 /* analysing the volume and mixer tables shows 164 /* analysing the volume and mixer tables shows
120 * that they are similar enough when we shift 165 * that they are similar enough when we shift
@@ -202,7 +247,8 @@ static int tas_snd_vol_put(struct snd_kcontrol *kcontrol,
202 247
203 tas->cached_volume_l = ucontrol->value.integer.value[0]; 248 tas->cached_volume_l = ucontrol->value.integer.value[0];
204 tas->cached_volume_r = ucontrol->value.integer.value[1]; 249 tas->cached_volume_r = ucontrol->value.integer.value[1];
205 tas_set_volume(tas); 250 if (tas->hw_enabled)
251 tas_set_volume(tas);
206 return 1; 252 return 1;
207} 253}
208 254
@@ -230,8 +276,8 @@ static int tas_snd_mute_get(struct snd_kcontrol *kcontrol,
230{ 276{
231 struct tas *tas = snd_kcontrol_chip(kcontrol); 277 struct tas *tas = snd_kcontrol_chip(kcontrol);
232 278
233 ucontrol->value.integer.value[0] = !tas->muted_l; 279 ucontrol->value.integer.value[0] = !tas->mute_l;
234 ucontrol->value.integer.value[1] = !tas->muted_r; 280 ucontrol->value.integer.value[1] = !tas->mute_r;
235 return 0; 281 return 0;
236} 282}
237 283
@@ -240,13 +286,14 @@ static int tas_snd_mute_put(struct snd_kcontrol *kcontrol,
240{ 286{
241 struct tas *tas = snd_kcontrol_chip(kcontrol); 287 struct tas *tas = snd_kcontrol_chip(kcontrol);
242 288
243 if (tas->muted_l == !ucontrol->value.integer.value[0] 289 if (tas->mute_l == !ucontrol->value.integer.value[0]
244 && tas->muted_r == !ucontrol->value.integer.value[1]) 290 && tas->mute_r == !ucontrol->value.integer.value[1])
245 return 0; 291 return 0;
246 292
247 tas->muted_l = !ucontrol->value.integer.value[0]; 293 tas->mute_l = !ucontrol->value.integer.value[0];
248 tas->muted_r = !ucontrol->value.integer.value[1]; 294 tas->mute_r = !ucontrol->value.integer.value[1];
249 tas_set_volume(tas); 295 if (tas->hw_enabled)
296 tas_set_volume(tas);
250 return 1; 297 return 1;
251} 298}
252 299
@@ -294,7 +341,8 @@ static int tas_snd_mixer_put(struct snd_kcontrol *kcontrol,
294 tas->mixer_l[idx] = ucontrol->value.integer.value[0]; 341 tas->mixer_l[idx] = ucontrol->value.integer.value[0];
295 tas->mixer_r[idx] = ucontrol->value.integer.value[1]; 342 tas->mixer_r[idx] = ucontrol->value.integer.value[1];
296 343
297 tas_set_mixer(tas); 344 if (tas->hw_enabled)
345 tas_set_mixer(tas);
298 return 1; 346 return 1;
299} 347}
300 348
@@ -309,9 +357,93 @@ static struct snd_kcontrol_new n##_control = { \
309 .private_value = idx, \ 357 .private_value = idx, \
310} 358}
311 359
312MIXER_CONTROL(pcm1, "PCM1", 0); 360MIXER_CONTROL(pcm1, "PCM", 0);
313MIXER_CONTROL(monitor, "Monitor", 2); 361MIXER_CONTROL(monitor, "Monitor", 2);
314 362
363static int tas_snd_drc_range_info(struct snd_kcontrol *kcontrol,
364 struct snd_ctl_elem_info *uinfo)
365{
366 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
367 uinfo->count = 1;
368 uinfo->value.integer.min = 0;
369 uinfo->value.integer.max = TAS3004_DRC_MAX;
370 return 0;
371}
372
373static int tas_snd_drc_range_get(struct snd_kcontrol *kcontrol,
374 struct snd_ctl_elem_value *ucontrol)
375{
376 struct tas *tas = snd_kcontrol_chip(kcontrol);
377
378 ucontrol->value.integer.value[0] = tas->drc_range;
379 return 0;
380}
381
382static int tas_snd_drc_range_put(struct snd_kcontrol *kcontrol,
383 struct snd_ctl_elem_value *ucontrol)
384{
385 struct tas *tas = snd_kcontrol_chip(kcontrol);
386
387 if (tas->drc_range == ucontrol->value.integer.value[0])
388 return 0;
389
390 tas->drc_range = ucontrol->value.integer.value[0];
391 if (tas->hw_enabled)
392 tas3004_set_drc(tas);
393 return 1;
394}
395
396static struct snd_kcontrol_new drc_range_control = {
397 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
398 .name = "DRC Range",
399 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
400 .info = tas_snd_drc_range_info,
401 .get = tas_snd_drc_range_get,
402 .put = tas_snd_drc_range_put,
403};
404
405static int tas_snd_drc_switch_info(struct snd_kcontrol *kcontrol,
406 struct snd_ctl_elem_info *uinfo)
407{
408 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
409 uinfo->count = 1;
410 uinfo->value.integer.min = 0;
411 uinfo->value.integer.max = 1;
412 return 0;
413}
414
415static int tas_snd_drc_switch_get(struct snd_kcontrol *kcontrol,
416 struct snd_ctl_elem_value *ucontrol)
417{
418 struct tas *tas = snd_kcontrol_chip(kcontrol);
419
420 ucontrol->value.integer.value[0] = tas->drc_enabled;
421 return 0;
422}
423
424static int tas_snd_drc_switch_put(struct snd_kcontrol *kcontrol,
425 struct snd_ctl_elem_value *ucontrol)
426{
427 struct tas *tas = snd_kcontrol_chip(kcontrol);
428
429 if (tas->drc_enabled == ucontrol->value.integer.value[0])
430 return 0;
431
432 tas->drc_enabled = ucontrol->value.integer.value[0];
433 if (tas->hw_enabled)
434 tas3004_set_drc(tas);
435 return 1;
436}
437
438static struct snd_kcontrol_new drc_switch_control = {
439 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
440 .name = "DRC Range Switch",
441 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
442 .info = tas_snd_drc_switch_info,
443 .get = tas_snd_drc_switch_get,
444 .put = tas_snd_drc_switch_put,
445};
446
315static int tas_snd_capture_source_info(struct snd_kcontrol *kcontrol, 447static int tas_snd_capture_source_info(struct snd_kcontrol *kcontrol,
316 struct snd_ctl_elem_info *uinfo) 448 struct snd_ctl_elem_info *uinfo)
317{ 449{
@@ -346,7 +478,8 @@ static int tas_snd_capture_source_put(struct snd_kcontrol *kcontrol,
346 tas->acr |= TAS_ACR_INPUT_B; 478 tas->acr |= TAS_ACR_INPUT_B;
347 if (oldacr == tas->acr) 479 if (oldacr == tas->acr)
348 return 0; 480 return 0;
349 tas_write_reg(tas, TAS_REG_ACR, 1, &tas->acr); 481 if (tas->hw_enabled)
482 tas_write_reg(tas, TAS_REG_ACR, 1, &tas->acr);
350 return 1; 483 return 1;
351} 484}
352 485
@@ -370,6 +503,89 @@ static struct snd_kcontrol_new capture_source_control = {
370 .put = tas_snd_capture_source_put, 503 .put = tas_snd_capture_source_put,
371}; 504};
372 505
506static int tas_snd_treble_info(struct snd_kcontrol *kcontrol,
507 struct snd_ctl_elem_info *uinfo)
508{
509 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
510 uinfo->count = 1;
511 uinfo->value.integer.min = TAS3004_TREBLE_MIN;
512 uinfo->value.integer.max = TAS3004_TREBLE_MAX;
513 return 0;
514}
515
516static int tas_snd_treble_get(struct snd_kcontrol *kcontrol,
517 struct snd_ctl_elem_value *ucontrol)
518{
519 struct tas *tas = snd_kcontrol_chip(kcontrol);
520
521 ucontrol->value.integer.value[0] = tas->treble;
522 return 0;
523}
524
525static int tas_snd_treble_put(struct snd_kcontrol *kcontrol,
526 struct snd_ctl_elem_value *ucontrol)
527{
528 struct tas *tas = snd_kcontrol_chip(kcontrol);
529
530 if (tas->treble == ucontrol->value.integer.value[0])
531 return 0;
532
533 tas->treble = ucontrol->value.integer.value[0];
534 if (tas->hw_enabled)
535 tas_set_treble(tas);
536 return 1;
537}
538
539static struct snd_kcontrol_new treble_control = {
540 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
541 .name = "Treble",
542 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
543 .info = tas_snd_treble_info,
544 .get = tas_snd_treble_get,
545 .put = tas_snd_treble_put,
546};
547
548static int tas_snd_bass_info(struct snd_kcontrol *kcontrol,
549 struct snd_ctl_elem_info *uinfo)
550{
551 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
552 uinfo->count = 1;
553 uinfo->value.integer.min = TAS3004_BASS_MIN;
554 uinfo->value.integer.max = TAS3004_BASS_MAX;
555 return 0;
556}
557
558static int tas_snd_bass_get(struct snd_kcontrol *kcontrol,
559 struct snd_ctl_elem_value *ucontrol)
560{
561 struct tas *tas = snd_kcontrol_chip(kcontrol);
562
563 ucontrol->value.integer.value[0] = tas->bass;
564 return 0;
565}
566
567static int tas_snd_bass_put(struct snd_kcontrol *kcontrol,
568 struct snd_ctl_elem_value *ucontrol)
569{
570 struct tas *tas = snd_kcontrol_chip(kcontrol);
571
572 if (tas->bass == ucontrol->value.integer.value[0])
573 return 0;
574
575 tas->bass = ucontrol->value.integer.value[0];
576 if (tas->hw_enabled)
577 tas_set_bass(tas);
578 return 1;
579}
580
581static struct snd_kcontrol_new bass_control = {
582 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
583 .name = "Bass",
584 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
585 .info = tas_snd_bass_info,
586 .get = tas_snd_bass_get,
587 .put = tas_snd_bass_put,
588};
373 589
374static struct transfer_info tas_transfers[] = { 590static struct transfer_info tas_transfers[] = {
375 { 591 {
@@ -399,26 +615,67 @@ static int tas_usable(struct codec_info_item *cii,
399static int tas_reset_init(struct tas *tas) 615static int tas_reset_init(struct tas *tas)
400{ 616{
401 u8 tmp; 617 u8 tmp;
618
619 tas->codec.gpio->methods->all_amps_off(tas->codec.gpio);
620 msleep(5);
402 tas->codec.gpio->methods->set_hw_reset(tas->codec.gpio, 0); 621 tas->codec.gpio->methods->set_hw_reset(tas->codec.gpio, 0);
403 msleep(1); 622 msleep(5);
404 tas->codec.gpio->methods->set_hw_reset(tas->codec.gpio, 1); 623 tas->codec.gpio->methods->set_hw_reset(tas->codec.gpio, 1);
405 msleep(1); 624 msleep(20);
406 tas->codec.gpio->methods->set_hw_reset(tas->codec.gpio, 0); 625 tas->codec.gpio->methods->set_hw_reset(tas->codec.gpio, 0);
407 msleep(1); 626 msleep(10);
408 627 tas->codec.gpio->methods->all_amps_restore(tas->codec.gpio);
409 tas->acr &= ~TAS_ACR_ANALOG_PDOWN;
410 tas->acr |= TAS_ACR_B_MONAUREAL | TAS_ACR_B_MON_SEL_RIGHT;
411 if (tas_write_reg(tas, TAS_REG_ACR, 1, &tas->acr))
412 return -ENODEV;
413 628
414 tmp = TAS_MCS_SCLK64 | TAS_MCS_SPORT_MODE_I2S | TAS_MCS_SPORT_WL_24BIT; 629 tmp = TAS_MCS_SCLK64 | TAS_MCS_SPORT_MODE_I2S | TAS_MCS_SPORT_WL_24BIT;
415 if (tas_write_reg(tas, TAS_REG_MCS, 1, &tmp)) 630 if (tas_write_reg(tas, TAS_REG_MCS, 1, &tmp))
416 return -ENODEV; 631 return -ENODEV;
417 632
633 tas->acr |= TAS_ACR_ANALOG_PDOWN | TAS_ACR_B_MONAUREAL |
634 TAS_ACR_B_MON_SEL_RIGHT;
635 if (tas_write_reg(tas, TAS_REG_ACR, 1, &tas->acr))
636 return -ENODEV;
637
418 tmp = 0; 638 tmp = 0;
419 if (tas_write_reg(tas, TAS_REG_MCS2, 1, &tmp)) 639 if (tas_write_reg(tas, TAS_REG_MCS2, 1, &tmp))
420 return -ENODEV; 640 return -ENODEV;
421 641
642 tas3004_set_drc(tas);
643
644 /* Set treble & bass to 0dB */
645 tas->treble = TAS3004_TREBLE_ZERO;
646 tas->bass = TAS3004_BASS_ZERO;
647 tas_set_treble(tas);
648 tas_set_bass(tas);
649
650 tas->acr &= ~TAS_ACR_ANALOG_PDOWN;
651 if (tas_write_reg(tas, TAS_REG_ACR, 1, &tas->acr))
652 return -ENODEV;
653
654 return 0;
655}
656
657static int tas_switch_clock(struct codec_info_item *cii, enum clock_switch clock)
658{
659 struct tas *tas = cii->codec_data;
660
661 switch(clock) {
662 case CLOCK_SWITCH_PREPARE_SLAVE:
663 /* Clocks are going away, mute mute mute */
664 tas->codec.gpio->methods->all_amps_off(tas->codec.gpio);
665 tas->hw_enabled = 0;
666 break;
667 case CLOCK_SWITCH_SLAVE:
668 /* Clocks are back, re-init the codec */
669 tas_reset_init(tas);
670 tas_set_volume(tas);
671 tas_set_mixer(tas);
672 tas->hw_enabled = 1;
673 tas->codec.gpio->methods->all_amps_restore(tas->codec.gpio);
674 break;
675 default:
676 /* doesn't happen as of now */
677 return -EINVAL;
678 }
422 return 0; 679 return 0;
423} 680}
424 681
@@ -427,6 +684,7 @@ static int tas_reset_init(struct tas *tas)
427 * our i2c device is suspended, and then take note of that! */ 684 * our i2c device is suspended, and then take note of that! */
428static int tas_suspend(struct tas *tas) 685static int tas_suspend(struct tas *tas)
429{ 686{
687 tas->hw_enabled = 0;
430 tas->acr |= TAS_ACR_ANALOG_PDOWN; 688 tas->acr |= TAS_ACR_ANALOG_PDOWN;
431 tas_write_reg(tas, TAS_REG_ACR, 1, &tas->acr); 689 tas_write_reg(tas, TAS_REG_ACR, 1, &tas->acr);
432 return 0; 690 return 0;
@@ -438,6 +696,7 @@ static int tas_resume(struct tas *tas)
438 tas_reset_init(tas); 696 tas_reset_init(tas);
439 tas_set_volume(tas); 697 tas_set_volume(tas);
440 tas_set_mixer(tas); 698 tas_set_mixer(tas);
699 tas->hw_enabled = 1;
441 return 0; 700 return 0;
442} 701}
443 702
@@ -463,6 +722,7 @@ static struct codec_info tas_codec_info = {
463 .bus_factor = 64, 722 .bus_factor = 64,
464 .owner = THIS_MODULE, 723 .owner = THIS_MODULE,
465 .usable = tas_usable, 724 .usable = tas_usable,
725 .switch_clock = tas_switch_clock,
466#ifdef CONFIG_PM 726#ifdef CONFIG_PM
467 .suspend = _tas_suspend, 727 .suspend = _tas_suspend,
468 .resume = _tas_resume, 728 .resume = _tas_resume,
@@ -483,6 +743,7 @@ static int tas_init_codec(struct aoa_codec *codec)
483 printk(KERN_ERR PFX "tas failed to initialise\n"); 743 printk(KERN_ERR PFX "tas failed to initialise\n");
484 return -ENXIO; 744 return -ENXIO;
485 } 745 }
746 tas->hw_enabled = 1;
486 747
487 if (tas->codec.soundbus_dev->attach_codec(tas->codec.soundbus_dev, 748 if (tas->codec.soundbus_dev->attach_codec(tas->codec.soundbus_dev,
488 aoa_get_card(), 749 aoa_get_card(),
@@ -515,6 +776,22 @@ static int tas_init_codec(struct aoa_codec *codec)
515 if (err) 776 if (err)
516 goto error; 777 goto error;
517 778
779 err = aoa_snd_ctl_add(snd_ctl_new1(&drc_range_control, tas));
780 if (err)
781 goto error;
782
783 err = aoa_snd_ctl_add(snd_ctl_new1(&drc_switch_control, tas));
784 if (err)
785 goto error;
786
787 err = aoa_snd_ctl_add(snd_ctl_new1(&treble_control, tas));
788 if (err)
789 goto error;
790
791 err = aoa_snd_ctl_add(snd_ctl_new1(&bass_control, tas));
792 if (err)
793 goto error;
794
518 return 0; 795 return 0;
519 error: 796 error:
520 tas->codec.soundbus_dev->detach_codec(tas->codec.soundbus_dev, tas); 797 tas->codec.soundbus_dev->detach_codec(tas->codec.soundbus_dev, tas);
@@ -548,6 +825,8 @@ static int tas_create(struct i2c_adapter *adapter,
548 tas->i2c.driver = &tas_driver; 825 tas->i2c.driver = &tas_driver;
549 tas->i2c.adapter = adapter; 826 tas->i2c.adapter = adapter;
550 tas->i2c.addr = addr; 827 tas->i2c.addr = addr;
828 /* seems that half is a saner default */
829 tas->drc_range = TAS3004_DRC_MAX / 2;
551 strlcpy(tas->i2c.name, "tas audio codec", I2C_NAME_SIZE-1); 830 strlcpy(tas->i2c.name, "tas audio codec", I2C_NAME_SIZE-1);
552 831
553 if (i2c_attach_client(&tas->i2c)) { 832 if (i2c_attach_client(&tas->i2c)) {
@@ -564,7 +843,9 @@ static int tas_create(struct i2c_adapter *adapter,
564 if (aoa_codec_register(&tas->codec)) { 843 if (aoa_codec_register(&tas->codec)) {
565 goto detach; 844 goto detach;
566 } 845 }
567 printk(KERN_DEBUG "snd-aoa-codec-tas: created and attached tas instance\n"); 846 printk(KERN_DEBUG
847 "snd-aoa-codec-tas: tas found, addr 0x%02x on %s\n",
848 addr, node->full_name);
568 return 0; 849 return 0;
569 detach: 850 detach:
570 i2c_detach_client(&tas->i2c); 851 i2c_detach_client(&tas->i2c);
diff --git a/sound/aoa/codecs/snd-aoa-codec-tas.h b/sound/aoa/codecs/snd-aoa-codec-tas.h
index daf81f45d83a..ae177e3466e6 100644
--- a/sound/aoa/codecs/snd-aoa-codec-tas.h
+++ b/sound/aoa/codecs/snd-aoa-codec-tas.h
@@ -44,4 +44,12 @@
44#define TAS_REG_LEFT_BIQUAD6 0x10 44#define TAS_REG_LEFT_BIQUAD6 0x10
45#define TAS_REG_RIGHT_BIQUAD6 0x19 45#define TAS_REG_RIGHT_BIQUAD6 0x19
46 46
47#define TAS_REG_LEFT_LOUDNESS 0x21
48#define TAS_REG_RIGHT_LOUDNESS 0x22
49#define TAS_REG_LEFT_LOUDNESS_GAIN 0x23
50#define TAS_REG_RIGHT_LOUDNESS_GAIN 0x24
51
52#define TAS3001_DRC_MAX 0x5f
53#define TAS3004_DRC_MAX 0xef
54
47#endif /* __SND_AOA_CODECTASH */ 55#endif /* __SND_AOA_CODECTASH */
diff --git a/sound/aoa/core/snd-aoa-gpio-pmf.c b/sound/aoa/core/snd-aoa-gpio-pmf.c
index 0e9b9bb2a6de..3d57fd1aec4b 100644
--- a/sound/aoa/core/snd-aoa-gpio-pmf.c
+++ b/sound/aoa/core/snd-aoa-gpio-pmf.c
@@ -14,9 +14,13 @@
14static void pmf_gpio_set_##name(struct gpio_runtime *rt, int on)\ 14static void pmf_gpio_set_##name(struct gpio_runtime *rt, int on)\
15{ \ 15{ \
16 struct pmf_args args = { .count = 1, .u[0].v = !on }; \ 16 struct pmf_args args = { .count = 1, .u[0].v = !on }; \
17 \ 17 int rc; \
18 \
18 if (unlikely(!rt)) return; \ 19 if (unlikely(!rt)) return; \
19 pmf_call_function(rt->node, #name "-mute", &args); \ 20 rc = pmf_call_function(rt->node, #name "-mute", &args); \
21 if (rc) \
22 printk(KERN_WARNING "pmf_gpio_set_" #name \
23 " failed, rc: %d\n", rc); \
20 rt->implementation_private &= ~(1<<bit); \ 24 rt->implementation_private &= ~(1<<bit); \
21 rt->implementation_private |= (!!on << bit); \ 25 rt->implementation_private |= (!!on << bit); \
22} \ 26} \
@@ -33,9 +37,13 @@ PMF_GPIO(lineout, 2);
33static void pmf_gpio_set_hw_reset(struct gpio_runtime *rt, int on) 37static void pmf_gpio_set_hw_reset(struct gpio_runtime *rt, int on)
34{ 38{
35 struct pmf_args args = { .count = 1, .u[0].v = !!on }; 39 struct pmf_args args = { .count = 1, .u[0].v = !!on };
40 int rc;
36 41
37 if (unlikely(!rt)) return; 42 if (unlikely(!rt)) return;
38 pmf_call_function(rt->node, "hw-reset", &args); 43 rc = pmf_call_function(rt->node, "hw-reset", &args);
44 if (rc)
45 printk(KERN_WARNING "pmf_gpio_set_hw_reset"
46 " failed, rc: %d\n", rc);
39} 47}
40 48
41static void pmf_gpio_all_amps_off(struct gpio_runtime *rt) 49static void pmf_gpio_all_amps_off(struct gpio_runtime *rt)
diff --git a/sound/aoa/fabrics/snd-aoa-fabric-layout.c b/sound/aoa/fabrics/snd-aoa-fabric-layout.c
index cbc8a3b5cea4..172eb95476c0 100644
--- a/sound/aoa/fabrics/snd-aoa-fabric-layout.c
+++ b/sound/aoa/fabrics/snd-aoa-fabric-layout.c
@@ -77,24 +77,39 @@ struct layout {
77 int pcmid; 77 int pcmid;
78}; 78};
79 79
80MODULE_ALIAS("sound-layout-36");
80MODULE_ALIAS("sound-layout-41"); 81MODULE_ALIAS("sound-layout-41");
81MODULE_ALIAS("sound-layout-45"); 82MODULE_ALIAS("sound-layout-45");
83MODULE_ALIAS("sound-layout-47");
84MODULE_ALIAS("sound-layout-48");
85MODULE_ALIAS("sound-layout-49");
86MODULE_ALIAS("sound-layout-50");
82MODULE_ALIAS("sound-layout-51"); 87MODULE_ALIAS("sound-layout-51");
88MODULE_ALIAS("sound-layout-56");
89MODULE_ALIAS("sound-layout-57");
83MODULE_ALIAS("sound-layout-58"); 90MODULE_ALIAS("sound-layout-58");
84MODULE_ALIAS("sound-layout-60"); 91MODULE_ALIAS("sound-layout-60");
85MODULE_ALIAS("sound-layout-61"); 92MODULE_ALIAS("sound-layout-61");
93MODULE_ALIAS("sound-layout-62");
86MODULE_ALIAS("sound-layout-64"); 94MODULE_ALIAS("sound-layout-64");
87MODULE_ALIAS("sound-layout-65"); 95MODULE_ALIAS("sound-layout-65");
96MODULE_ALIAS("sound-layout-66");
97MODULE_ALIAS("sound-layout-67");
88MODULE_ALIAS("sound-layout-68"); 98MODULE_ALIAS("sound-layout-68");
89MODULE_ALIAS("sound-layout-69"); 99MODULE_ALIAS("sound-layout-69");
90MODULE_ALIAS("sound-layout-70"); 100MODULE_ALIAS("sound-layout-70");
91MODULE_ALIAS("sound-layout-72"); 101MODULE_ALIAS("sound-layout-72");
102MODULE_ALIAS("sound-layout-76");
92MODULE_ALIAS("sound-layout-80"); 103MODULE_ALIAS("sound-layout-80");
93MODULE_ALIAS("sound-layout-82"); 104MODULE_ALIAS("sound-layout-82");
94MODULE_ALIAS("sound-layout-84"); 105MODULE_ALIAS("sound-layout-84");
95MODULE_ALIAS("sound-layout-86"); 106MODULE_ALIAS("sound-layout-86");
107MODULE_ALIAS("sound-layout-90");
96MODULE_ALIAS("sound-layout-92"); 108MODULE_ALIAS("sound-layout-92");
109MODULE_ALIAS("sound-layout-94");
97MODULE_ALIAS("sound-layout-96"); 110MODULE_ALIAS("sound-layout-96");
111MODULE_ALIAS("sound-layout-98");
112MODULE_ALIAS("sound-layout-100");
98 113
99/* onyx with all but microphone connected */ 114/* onyx with all but microphone connected */
100static struct codec_connection onyx_connections_nomic[] = { 115static struct codec_connection onyx_connections_nomic[] = {
@@ -950,11 +965,12 @@ static int aoa_fabric_layout_probe(struct soundbus_dev *sdev)
950 layout_id = (unsigned int *) get_property(sound, "layout-id", NULL); 965 layout_id = (unsigned int *) get_property(sound, "layout-id", NULL);
951 if (!layout_id) 966 if (!layout_id)
952 goto outnodev; 967 goto outnodev;
953 printk(KERN_INFO "snd-aoa-fabric-layout: found bus with layout %d ", *layout_id); 968 printk(KERN_INFO "snd-aoa-fabric-layout: found bus with layout %d\n",
969 *layout_id);
954 970
955 layout = find_layout_by_id(*layout_id); 971 layout = find_layout_by_id(*layout_id);
956 if (!layout) { 972 if (!layout) {
957 printk("(no idea how to handle)\n"); 973 printk(KERN_ERR "snd-aoa-fabric-layout: unknown layout\n");
958 goto outnodev; 974 goto outnodev;
959 } 975 }
960 976
@@ -972,15 +988,17 @@ static int aoa_fabric_layout_probe(struct soundbus_dev *sdev)
972 case 51: /* PowerBook5,4 */ 988 case 51: /* PowerBook5,4 */
973 case 58: /* Mac Mini */ 989 case 58: /* Mac Mini */
974 ldev->gpio.methods = ftr_gpio_methods; 990 ldev->gpio.methods = ftr_gpio_methods;
991 printk(KERN_DEBUG
992 "snd-aoa-fabric-layout: Using direct GPIOs\n");
975 break; 993 break;
976 default: 994 default:
977 ldev->gpio.methods = pmf_gpio_methods; 995 ldev->gpio.methods = pmf_gpio_methods;
996 printk(KERN_DEBUG
997 "snd-aoa-fabric-layout: Using PMF GPIOs\n");
978 } 998 }
979 ldev->selfptr_headphone.ptr = ldev; 999 ldev->selfptr_headphone.ptr = ldev;
980 ldev->selfptr_lineout.ptr = ldev; 1000 ldev->selfptr_lineout.ptr = ldev;
981 sdev->ofdev.dev.driver_data = ldev; 1001 sdev->ofdev.dev.driver_data = ldev;
982
983 printk("(using)\n");
984 list_add(&ldev->list, &layouts_list); 1002 list_add(&ldev->list, &layouts_list);
985 layouts_list_items++; 1003 layouts_list_items++;
986 1004
diff --git a/sound/aoa/soundbus/core.c b/sound/aoa/soundbus/core.c
index abe84a76c835..47b3e3768df0 100644
--- a/sound/aoa/soundbus/core.c
+++ b/sound/aoa/soundbus/core.c
@@ -194,16 +194,6 @@ static struct bus_type soundbus_bus_type = {
194 .dev_attrs = soundbus_dev_attrs, 194 .dev_attrs = soundbus_dev_attrs,
195}; 195};
196 196
197static int __init soundbus_init(void)
198{
199 return bus_register(&soundbus_bus_type);
200}
201
202static void __exit soundbus_exit(void)
203{
204 bus_unregister(&soundbus_bus_type);
205}
206
207int soundbus_add_one(struct soundbus_dev *dev) 197int soundbus_add_one(struct soundbus_dev *dev)
208{ 198{
209 static int devcount; 199 static int devcount;
@@ -246,5 +236,15 @@ void soundbus_unregister_driver(struct soundbus_driver *drv)
246} 236}
247EXPORT_SYMBOL_GPL(soundbus_unregister_driver); 237EXPORT_SYMBOL_GPL(soundbus_unregister_driver);
248 238
249module_init(soundbus_init); 239static int __init soundbus_init(void)
240{
241 return bus_register(&soundbus_bus_type);
242}
243
244static void __exit soundbus_exit(void)
245{
246 bus_unregister(&soundbus_bus_type);
247}
248
249subsys_initcall(soundbus_init);
250module_exit(soundbus_exit); 250module_exit(soundbus_exit);
diff --git a/sound/aoa/soundbus/i2sbus/i2sbus-control.c b/sound/aoa/soundbus/i2sbus/i2sbus-control.c
index f50407952d3c..87beb4ad4d63 100644
--- a/sound/aoa/soundbus/i2sbus/i2sbus-control.c
+++ b/sound/aoa/soundbus/i2sbus/i2sbus-control.c
@@ -6,12 +6,16 @@
6 * GPL v2, can be found in COPYING. 6 * GPL v2, can be found in COPYING.
7 */ 7 */
8 8
9#include <asm/io.h> 9#include <linux/kernel.h>
10#include <linux/delay.h> 10#include <linux/delay.h>
11
12#include <asm/io.h>
11#include <asm/prom.h> 13#include <asm/prom.h>
12#include <asm/macio.h> 14#include <asm/macio.h>
13#include <asm/pmac_feature.h> 15#include <asm/pmac_feature.h>
14#include <asm/pmac_pfunc.h> 16#include <asm/pmac_pfunc.h>
17#include <asm/keylargo.h>
18
15#include "i2sbus.h" 19#include "i2sbus.h"
16 20
17int i2sbus_control_init(struct macio_dev* dev, struct i2sbus_control **c) 21int i2sbus_control_init(struct macio_dev* dev, struct i2sbus_control **c)
@@ -22,26 +26,12 @@ int i2sbus_control_init(struct macio_dev* dev, struct i2sbus_control **c)
22 26
23 INIT_LIST_HEAD(&(*c)->list); 27 INIT_LIST_HEAD(&(*c)->list);
24 28
25 if (of_address_to_resource(dev->ofdev.node, 0, &(*c)->rsrc)) 29 (*c)->macio = dev->bus->chip;
26 goto err;
27 /* we really should be using feature calls instead of mapping
28 * these registers. It's safe for now since no one else is
29 * touching them... */
30 (*c)->controlregs = ioremap((*c)->rsrc.start,
31 sizeof(struct i2s_control_regs));
32 if (!(*c)->controlregs)
33 goto err;
34
35 return 0; 30 return 0;
36 err:
37 kfree(*c);
38 *c = NULL;
39 return -ENODEV;
40} 31}
41 32
42void i2sbus_control_destroy(struct i2sbus_control *c) 33void i2sbus_control_destroy(struct i2sbus_control *c)
43{ 34{
44 iounmap(c->controlregs);
45 kfree(c); 35 kfree(c);
46} 36}
47 37
@@ -93,19 +83,22 @@ int i2sbus_control_enable(struct i2sbus_control *c,
93 struct i2sbus_dev *i2sdev) 83 struct i2sbus_dev *i2sdev)
94{ 84{
95 struct pmf_args args = { .count = 0 }; 85 struct pmf_args args = { .count = 0 };
96 int cc; 86 struct macio_chip *macio = c->macio;
97 87
98 if (i2sdev->enable) 88 if (i2sdev->enable)
99 return pmf_call_one(i2sdev->enable, &args); 89 return pmf_call_one(i2sdev->enable, &args);
100 90
91 if (macio == NULL || macio->base == NULL)
92 return -ENODEV;
93
101 switch (i2sdev->bus_number) { 94 switch (i2sdev->bus_number) {
102 case 0: 95 case 0:
103 cc = in_le32(&c->controlregs->cell_control); 96 /* these need to be locked or done through
104 out_le32(&c->controlregs->cell_control, cc | CTRL_CLOCK_INTF_0_ENABLE); 97 * newly created feature calls! */
98 MACIO_BIS(KEYLARGO_FCR1, KL1_I2S0_ENABLE);
105 break; 99 break;
106 case 1: 100 case 1:
107 cc = in_le32(&c->controlregs->cell_control); 101 MACIO_BIS(KEYLARGO_FCR1, KL1_I2S1_ENABLE);
108 out_le32(&c->controlregs->cell_control, cc | CTRL_CLOCK_INTF_1_ENABLE);
109 break; 102 break;
110 default: 103 default:
111 return -ENODEV; 104 return -ENODEV;
@@ -118,7 +111,7 @@ int i2sbus_control_cell(struct i2sbus_control *c,
118 int enable) 111 int enable)
119{ 112{
120 struct pmf_args args = { .count = 0 }; 113 struct pmf_args args = { .count = 0 };
121 int cc; 114 struct macio_chip *macio = c->macio;
122 115
123 switch (enable) { 116 switch (enable) {
124 case 0: 117 case 0:
@@ -133,18 +126,22 @@ int i2sbus_control_cell(struct i2sbus_control *c,
133 printk(KERN_ERR "i2sbus: INVALID CELL ENABLE VALUE\n"); 126 printk(KERN_ERR "i2sbus: INVALID CELL ENABLE VALUE\n");
134 return -ENODEV; 127 return -ENODEV;
135 } 128 }
129
130 if (macio == NULL || macio->base == NULL)
131 return -ENODEV;
132
136 switch (i2sdev->bus_number) { 133 switch (i2sdev->bus_number) {
137 case 0: 134 case 0:
138 cc = in_le32(&c->controlregs->cell_control); 135 if (enable)
139 cc &= ~CTRL_CLOCK_CELL_0_ENABLE; 136 MACIO_BIS(KEYLARGO_FCR1, KL1_I2S0_CELL_ENABLE);
140 cc |= enable * CTRL_CLOCK_CELL_0_ENABLE; 137 else
141 out_le32(&c->controlregs->cell_control, cc); 138 MACIO_BIC(KEYLARGO_FCR1, KL1_I2S0_CELL_ENABLE);
142 break; 139 break;
143 case 1: 140 case 1:
144 cc = in_le32(&c->controlregs->cell_control); 141 if (enable)
145 cc &= ~CTRL_CLOCK_CELL_1_ENABLE; 142 MACIO_BIS(KEYLARGO_FCR1, KL1_I2S1_CELL_ENABLE);
146 cc |= enable * CTRL_CLOCK_CELL_1_ENABLE; 143 else
147 out_le32(&c->controlregs->cell_control, cc); 144 MACIO_BIC(KEYLARGO_FCR1, KL1_I2S1_CELL_ENABLE);
148 break; 145 break;
149 default: 146 default:
150 return -ENODEV; 147 return -ENODEV;
@@ -157,7 +154,7 @@ int i2sbus_control_clock(struct i2sbus_control *c,
157 int enable) 154 int enable)
158{ 155{
159 struct pmf_args args = { .count = 0 }; 156 struct pmf_args args = { .count = 0 };
160 int cc; 157 struct macio_chip *macio = c->macio;
161 158
162 switch (enable) { 159 switch (enable) {
163 case 0: 160 case 0:
@@ -172,18 +169,22 @@ int i2sbus_control_clock(struct i2sbus_control *c,
172 printk(KERN_ERR "i2sbus: INVALID CLOCK ENABLE VALUE\n"); 169 printk(KERN_ERR "i2sbus: INVALID CLOCK ENABLE VALUE\n");
173 return -ENODEV; 170 return -ENODEV;
174 } 171 }
172
173 if (macio == NULL || macio->base == NULL)
174 return -ENODEV;
175
175 switch (i2sdev->bus_number) { 176 switch (i2sdev->bus_number) {
176 case 0: 177 case 0:
177 cc = in_le32(&c->controlregs->cell_control); 178 if (enable)
178 cc &= ~CTRL_CLOCK_CLOCK_0_ENABLE; 179 MACIO_BIS(KEYLARGO_FCR1, KL1_I2S0_CLK_ENABLE_BIT);
179 cc |= enable * CTRL_CLOCK_CLOCK_0_ENABLE; 180 else
180 out_le32(&c->controlregs->cell_control, cc); 181 MACIO_BIC(KEYLARGO_FCR1, KL1_I2S0_CLK_ENABLE_BIT);
181 break; 182 break;
182 case 1: 183 case 1:
183 cc = in_le32(&c->controlregs->cell_control); 184 if (enable)
184 cc &= ~CTRL_CLOCK_CLOCK_1_ENABLE; 185 MACIO_BIS(KEYLARGO_FCR1, KL1_I2S1_CLK_ENABLE_BIT);
185 cc |= enable * CTRL_CLOCK_CLOCK_1_ENABLE; 186 else
186 out_le32(&c->controlregs->cell_control, cc); 187 MACIO_BIC(KEYLARGO_FCR1, KL1_I2S1_CLK_ENABLE_BIT);
187 break; 188 break;
188 default: 189 default:
189 return -ENODEV; 190 return -ENODEV;
diff --git a/sound/aoa/soundbus/i2sbus/i2sbus-control.h b/sound/aoa/soundbus/i2sbus/i2sbus-control.h
deleted file mode 100644
index bb05550f730b..000000000000
--- a/sound/aoa/soundbus/i2sbus/i2sbus-control.h
+++ /dev/null
@@ -1,37 +0,0 @@
1/*
2 * i2sbus driver -- bus register definitions
3 *
4 * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
5 *
6 * GPL v2, can be found in COPYING.
7 */
8#ifndef __I2SBUS_CONTROLREGS_H
9#define __I2SBUS_CONTROLREGS_H
10
11/* i2s control registers, at least what we know about them */
12
13#define __PAD(m,n) u8 __pad##m[n]
14#define _PAD(line, n) __PAD(line, n)
15#define PAD(n) _PAD(__LINE__, (n))
16struct i2s_control_regs {
17 PAD(0x38);
18 __le32 fcr0; /* 0x38 (unknown) */
19 __le32 cell_control; /* 0x3c (fcr1) */
20 __le32 fcr2; /* 0x40 (unknown) */
21 __le32 fcr3; /* 0x44 (fcr3) */
22 __le32 clock_control; /* 0x48 (unknown) */
23 PAD(4);
24 /* total size: 0x50 bytes */
25} __attribute__((__packed__));
26
27#define CTRL_CLOCK_CELL_0_ENABLE (1<<10)
28#define CTRL_CLOCK_CLOCK_0_ENABLE (1<<12)
29#define CTRL_CLOCK_SWRESET_0 (1<<11)
30#define CTRL_CLOCK_INTF_0_ENABLE (1<<13)
31
32#define CTRL_CLOCK_CELL_1_ENABLE (1<<17)
33#define CTRL_CLOCK_CLOCK_1_ENABLE (1<<18)
34#define CTRL_CLOCK_SWRESET_1 (1<<19)
35#define CTRL_CLOCK_INTF_1_ENABLE (1<<20)
36
37#endif /* __I2SBUS_CONTROLREGS_H */
diff --git a/sound/aoa/soundbus/i2sbus/i2sbus-core.c b/sound/aoa/soundbus/i2sbus/i2sbus-core.c
index 01c0724335a3..23190aa6bc7b 100644
--- a/sound/aoa/soundbus/i2sbus/i2sbus-core.c
+++ b/sound/aoa/soundbus/i2sbus/i2sbus-core.c
@@ -7,13 +7,16 @@
7 */ 7 */
8 8
9#include <linux/module.h> 9#include <linux/module.h>
10#include <asm/macio.h>
11#include <asm/dbdma.h>
12#include <linux/pci.h> 10#include <linux/pci.h>
13#include <linux/interrupt.h> 11#include <linux/interrupt.h>
12#include <linux/dma-mapping.h>
13
14#include <sound/driver.h> 14#include <sound/driver.h>
15#include <sound/core.h> 15#include <sound/core.h>
16#include <linux/dma-mapping.h> 16
17#include <asm/macio.h>
18#include <asm/dbdma.h>
19
17#include "../soundbus.h" 20#include "../soundbus.h"
18#include "i2sbus.h" 21#include "i2sbus.h"
19 22
@@ -24,6 +27,11 @@ MODULE_DESCRIPTION("Apple Soundbus: I2S support");
24 * string that macio puts into the relevant device */ 27 * string that macio puts into the relevant device */
25MODULE_ALIAS("of:Ni2sTi2sC"); 28MODULE_ALIAS("of:Ni2sTi2sC");
26 29
30static int force;
31module_param(force, int, 0444);
32MODULE_PARM_DESC(force, "Force loading i2sbus even when"
33 " no layout-id property is present");
34
27static struct of_device_id i2sbus_match[] = { 35static struct of_device_id i2sbus_match[] = {
28 { .name = "i2s" }, 36 { .name = "i2s" },
29 { } 37 { }
@@ -73,12 +81,12 @@ static void i2sbus_release_dev(struct device *dev)
73 if (i2sdev->intfregs) iounmap(i2sdev->intfregs); 81 if (i2sdev->intfregs) iounmap(i2sdev->intfregs);
74 if (i2sdev->out.dbdma) iounmap(i2sdev->out.dbdma); 82 if (i2sdev->out.dbdma) iounmap(i2sdev->out.dbdma);
75 if (i2sdev->in.dbdma) iounmap(i2sdev->in.dbdma); 83 if (i2sdev->in.dbdma) iounmap(i2sdev->in.dbdma);
76 for (i=0;i<3;i++) 84 for (i = aoa_resource_i2smmio; i <= aoa_resource_rxdbdma; i++)
77 if (i2sdev->allocated_resource[i]) 85 if (i2sdev->allocated_resource[i])
78 release_and_free_resource(i2sdev->allocated_resource[i]); 86 release_and_free_resource(i2sdev->allocated_resource[i]);
79 free_dbdma_descriptor_ring(i2sdev, &i2sdev->out.dbdma_ring); 87 free_dbdma_descriptor_ring(i2sdev, &i2sdev->out.dbdma_ring);
80 free_dbdma_descriptor_ring(i2sdev, &i2sdev->in.dbdma_ring); 88 free_dbdma_descriptor_ring(i2sdev, &i2sdev->in.dbdma_ring);
81 for (i=0;i<3;i++) 89 for (i = aoa_resource_i2smmio; i <= aoa_resource_rxdbdma; i++)
82 free_irq(i2sdev->interrupts[i], i2sdev); 90 free_irq(i2sdev->interrupts[i], i2sdev);
83 i2sbus_control_remove_dev(i2sdev->control, i2sdev); 91 i2sbus_control_remove_dev(i2sdev->control, i2sdev);
84 mutex_destroy(&i2sdev->lock); 92 mutex_destroy(&i2sdev->lock);
@@ -101,10 +109,49 @@ static irqreturn_t i2sbus_bus_intr(int irq, void *devid, struct pt_regs *regs)
101 return IRQ_HANDLED; 109 return IRQ_HANDLED;
102} 110}
103 111
104static int force; 112
105module_param(force, int, 0444); 113/*
106MODULE_PARM_DESC(force, "Force loading i2sbus even when" 114 * XXX FIXME: We test the layout_id's here to get the proper way of
107 " no layout-id property is present"); 115 * mapping in various registers, thanks to bugs in Apple device-trees.
116 * We could instead key off the machine model and the name of the i2s
117 * node (i2s-a). This we'll do when we move it all to macio_asic.c
118 * and have that export items for each sub-node too.
119 */
120static int i2sbus_get_and_fixup_rsrc(struct device_node *np, int index,
121 int layout, struct resource *res)
122{
123 struct device_node *parent;
124 int pindex, rc = -ENXIO;
125 u32 *reg;
126
127 /* Machines with layout 76 and 36 (K2 based) have a weird device
128 * tree what we need to special case.
129 * Normal machines just fetch the resource from the i2s-X node.
130 * Darwin further divides normal machines into old and new layouts
131 * with a subtely different code path but that doesn't seem necessary
132 * in practice, they just bloated it. In addition, even on our K2
133 * case the i2s-modem node, if we ever want to handle it, uses the
134 * normal layout
135 */
136 if (layout != 76 && layout != 36)
137 return of_address_to_resource(np, index, res);
138
139 parent = of_get_parent(np);
140 pindex = (index == aoa_resource_i2smmio) ? 0 : 1;
141 rc = of_address_to_resource(parent, pindex, res);
142 if (rc)
143 goto bail;
144 reg = (u32 *)get_property(np, "reg", NULL);
145 if (reg == NULL) {
146 rc = -ENXIO;
147 goto bail;
148 }
149 res->start += reg[index * 2];
150 res->end = res->start + reg[index * 2 + 1] - 1;
151 bail:
152 of_node_put(parent);
153 return rc;
154}
108 155
109/* FIXME: look at device node refcounting */ 156/* FIXME: look at device node refcounting */
110static int i2sbus_add_dev(struct macio_dev *macio, 157static int i2sbus_add_dev(struct macio_dev *macio,
@@ -113,7 +160,8 @@ static int i2sbus_add_dev(struct macio_dev *macio,
113{ 160{
114 struct i2sbus_dev *dev; 161 struct i2sbus_dev *dev;
115 struct device_node *child = NULL, *sound = NULL; 162 struct device_node *child = NULL, *sound = NULL;
116 int i; 163 struct resource *r;
164 int i, layout = 0, rlen;
117 static const char *rnames[] = { "i2sbus: %s (control)", 165 static const char *rnames[] = { "i2sbus: %s (control)",
118 "i2sbus: %s (tx)", 166 "i2sbus: %s (tx)",
119 "i2sbus: %s (rx)" }; 167 "i2sbus: %s (rx)" };
@@ -129,9 +177,6 @@ static int i2sbus_add_dev(struct macio_dev *macio,
129 if (strncmp(np->name, "i2s-", 4)) 177 if (strncmp(np->name, "i2s-", 4))
130 return 0; 178 return 0;
131 179
132 if (macio_irq_count(macio) != 3)
133 return 0;
134
135 dev = kzalloc(sizeof(struct i2sbus_dev), GFP_KERNEL); 180 dev = kzalloc(sizeof(struct i2sbus_dev), GFP_KERNEL);
136 if (!dev) 181 if (!dev)
137 return 0; 182 return 0;
@@ -147,8 +192,9 @@ static int i2sbus_add_dev(struct macio_dev *macio,
147 u32 *layout_id; 192 u32 *layout_id;
148 layout_id = (u32*) get_property(sound, "layout-id", NULL); 193 layout_id = (u32*) get_property(sound, "layout-id", NULL);
149 if (layout_id) { 194 if (layout_id) {
195 layout = *layout_id;
150 snprintf(dev->sound.modalias, 32, 196 snprintf(dev->sound.modalias, 32,
151 "sound-layout-%d", *layout_id); 197 "sound-layout-%d", layout);
152 force = 1; 198 force = 1;
153 } 199 }
154 } 200 }
@@ -178,23 +224,32 @@ static int i2sbus_add_dev(struct macio_dev *macio,
178 dev->bus_number = np->name[4] - 'a'; 224 dev->bus_number = np->name[4] - 'a';
179 INIT_LIST_HEAD(&dev->sound.codec_list); 225 INIT_LIST_HEAD(&dev->sound.codec_list);
180 226
181 for (i=0;i<3;i++) { 227 for (i = aoa_resource_i2smmio; i <= aoa_resource_rxdbdma; i++) {
182 dev->interrupts[i] = -1; 228 dev->interrupts[i] = -1;
183 snprintf(dev->rnames[i], sizeof(dev->rnames[i]), rnames[i], np->name); 229 snprintf(dev->rnames[i], sizeof(dev->rnames[i]),
230 rnames[i], np->name);
184 } 231 }
185 for (i=0;i<3;i++) { 232 for (i = aoa_resource_i2smmio; i <= aoa_resource_rxdbdma; i++) {
186 if (request_irq(macio_irq(macio, i), ints[i], 0, 233 int irq = irq_of_parse_and_map(np, i);
187 dev->rnames[i], dev)) 234 if (request_irq(irq, ints[i], 0, dev->rnames[i], dev))
188 goto err; 235 goto err;
189 dev->interrupts[i] = macio_irq(macio, i); 236 dev->interrupts[i] = irq;
190 } 237 }
191 238
192 for (i=0;i<3;i++) { 239
193 if (of_address_to_resource(np, i, &dev->resources[i])) 240 /* Resource handling is problematic as some device-trees contain
241 * useless crap (ugh ugh ugh). We work around that here by calling
242 * specific functions for calculating the appropriate resources.
243 *
244 * This will all be moved to macio_asic.c at one point
245 */
246 for (i = aoa_resource_i2smmio; i <= aoa_resource_rxdbdma; i++) {
247 if (i2sbus_get_and_fixup_rsrc(np,i,layout,&dev->resources[i]))
194 goto err; 248 goto err;
195 /* if only we could use our resource dev->resources[i]... 249 /* If only we could use our resource dev->resources[i]...
196 * but request_resource doesn't know about parents and 250 * but request_resource doesn't know about parents and
197 * contained resources... */ 251 * contained resources...
252 */
198 dev->allocated_resource[i] = 253 dev->allocated_resource[i] =
199 request_mem_region(dev->resources[i].start, 254 request_mem_region(dev->resources[i].start,
200 dev->resources[i].end - 255 dev->resources[i].end -
@@ -205,13 +260,25 @@ static int i2sbus_add_dev(struct macio_dev *macio,
205 goto err; 260 goto err;
206 } 261 }
207 } 262 }
208 /* should do sanity checking here about length of them */ 263
209 dev->intfregs = ioremap(dev->resources[0].start, 264 r = &dev->resources[aoa_resource_i2smmio];
210 dev->resources[0].end-dev->resources[0].start+1); 265 rlen = r->end - r->start + 1;
211 dev->out.dbdma = ioremap(dev->resources[1].start, 266 if (rlen < sizeof(struct i2s_interface_regs))
212 dev->resources[1].end-dev->resources[1].start+1); 267 goto err;
213 dev->in.dbdma = ioremap(dev->resources[2].start, 268 dev->intfregs = ioremap(r->start, rlen);
214 dev->resources[2].end-dev->resources[2].start+1); 269
270 r = &dev->resources[aoa_resource_txdbdma];
271 rlen = r->end - r->start + 1;
272 if (rlen < sizeof(struct dbdma_regs))
273 goto err;
274 dev->out.dbdma = ioremap(r->start, rlen);
275
276 r = &dev->resources[aoa_resource_rxdbdma];
277 rlen = r->end - r->start + 1;
278 if (rlen < sizeof(struct dbdma_regs))
279 goto err;
280 dev->in.dbdma = ioremap(r->start, rlen);
281
215 if (!dev->intfregs || !dev->out.dbdma || !dev->in.dbdma) 282 if (!dev->intfregs || !dev->out.dbdma || !dev->in.dbdma)
216 goto err; 283 goto err;
217 284
diff --git a/sound/aoa/soundbus/i2sbus/i2sbus.h b/sound/aoa/soundbus/i2sbus/i2sbus.h
index cfa5162e3b0f..0c69d209be50 100644
--- a/sound/aoa/soundbus/i2sbus/i2sbus.h
+++ b/sound/aoa/soundbus/i2sbus/i2sbus.h
@@ -7,20 +7,22 @@
7 */ 7 */
8#ifndef __I2SBUS_H 8#ifndef __I2SBUS_H
9#define __I2SBUS_H 9#define __I2SBUS_H
10#include <asm/dbdma.h>
11#include <linux/interrupt.h> 10#include <linux/interrupt.h>
12#include <sound/pcm.h>
13#include <linux/spinlock.h> 11#include <linux/spinlock.h>
14#include <linux/mutex.h> 12#include <linux/mutex.h>
13
14#include <sound/pcm.h>
15
15#include <asm/prom.h> 16#include <asm/prom.h>
17#include <asm/pmac_feature.h>
18#include <asm/dbdma.h>
19
16#include "i2sbus-interface.h" 20#include "i2sbus-interface.h"
17#include "i2sbus-control.h"
18#include "../soundbus.h" 21#include "../soundbus.h"
19 22
20struct i2sbus_control { 23struct i2sbus_control {
21 volatile struct i2s_control_regs __iomem *controlregs;
22 struct resource rsrc;
23 struct list_head list; 24 struct list_head list;
25 struct macio_chip *macio;
24}; 26};
25 27
26#define MAX_DBDMA_COMMANDS 32 28#define MAX_DBDMA_COMMANDS 32
@@ -45,6 +47,12 @@ struct pcm_info {
45 volatile struct dbdma_regs __iomem *dbdma; 47 volatile struct dbdma_regs __iomem *dbdma;
46}; 48};
47 49
50enum {
51 aoa_resource_i2smmio = 0,
52 aoa_resource_txdbdma,
53 aoa_resource_rxdbdma,
54};
55
48struct i2sbus_dev { 56struct i2sbus_dev {
49 struct soundbus_dev sound; 57 struct soundbus_dev sound;
50 struct macio_dev *macio; 58 struct macio_dev *macio;
diff --git a/sound/core/sound.c b/sound/core/sound.c
index 264f2efd1af8..7edd1fc58b17 100644
--- a/sound/core/sound.c
+++ b/sound/core/sound.c
@@ -244,7 +244,7 @@ int snd_register_device(int type, struct snd_card *card, int dev,
244 struct device *device = NULL; 244 struct device *device = NULL;
245 245
246 snd_assert(name, return -EINVAL); 246 snd_assert(name, return -EINVAL);
247 preg = kmalloc(sizeof(struct snd_minor) + strlen(name) + 1, GFP_KERNEL); 247 preg = kmalloc(sizeof *preg, GFP_KERNEL);
248 if (preg == NULL) 248 if (preg == NULL)
249 return -ENOMEM; 249 return -ENOMEM;
250 preg->type = type; 250 preg->type = type;
@@ -252,7 +252,6 @@ int snd_register_device(int type, struct snd_card *card, int dev,
252 preg->device = dev; 252 preg->device = dev;
253 preg->f_ops = f_ops; 253 preg->f_ops = f_ops;
254 preg->private_data = private_data; 254 preg->private_data = private_data;
255 strcpy(preg->name, name);
256 mutex_lock(&sound_mutex); 255 mutex_lock(&sound_mutex);
257#ifdef CONFIG_SND_DYNAMIC_MINORS 256#ifdef CONFIG_SND_DYNAMIC_MINORS
258 minor = snd_find_free_minor(); 257 minor = snd_find_free_minor();
diff --git a/sound/core/timer.c b/sound/core/timer.c
index 78199f58b93a..0a984e881c10 100644
--- a/sound/core/timer.c
+++ b/sound/core/timer.c
@@ -628,8 +628,9 @@ static void snd_timer_tasklet(unsigned long arg)
628 struct snd_timer_instance *ti; 628 struct snd_timer_instance *ti;
629 struct list_head *p; 629 struct list_head *p;
630 unsigned long resolution, ticks; 630 unsigned long resolution, ticks;
631 unsigned long flags;
631 632
632 spin_lock(&timer->lock); 633 spin_lock_irqsave(&timer->lock, flags);
633 /* now process all callbacks */ 634 /* now process all callbacks */
634 while (!list_empty(&timer->sack_list_head)) { 635 while (!list_empty(&timer->sack_list_head)) {
635 p = timer->sack_list_head.next; /* get first item */ 636 p = timer->sack_list_head.next; /* get first item */
@@ -649,7 +650,7 @@ static void snd_timer_tasklet(unsigned long arg)
649 spin_lock(&timer->lock); 650 spin_lock(&timer->lock);
650 ti->flags &= ~SNDRV_TIMER_IFLG_CALLBACK; 651 ti->flags &= ~SNDRV_TIMER_IFLG_CALLBACK;
651 } 652 }
652 spin_unlock(&timer->lock); 653 spin_unlock_irqrestore(&timer->lock, flags);
653} 654}
654 655
655/* 656/*
diff --git a/sound/i2c/cs8427.c b/sound/i2c/cs8427.c
index cb89f7eb9236..64388cb8d6e5 100644
--- a/sound/i2c/cs8427.c
+++ b/sound/i2c/cs8427.c
@@ -76,23 +76,28 @@ int snd_cs8427_reg_write(struct snd_i2c_device *device, unsigned char reg,
76 buf[0] = reg & 0x7f; 76 buf[0] = reg & 0x7f;
77 buf[1] = val; 77 buf[1] = val;
78 if ((err = snd_i2c_sendbytes(device, buf, 2)) != 2) { 78 if ((err = snd_i2c_sendbytes(device, buf, 2)) != 2) {
79 snd_printk(KERN_ERR "unable to send bytes 0x%02x:0x%02x to CS8427 (%i)\n", buf[0], buf[1], err); 79 snd_printk(KERN_ERR "unable to send bytes 0x%02x:0x%02x "
80 "to CS8427 (%i)\n", buf[0], buf[1], err);
80 return err < 0 ? err : -EIO; 81 return err < 0 ? err : -EIO;
81 } 82 }
82 return 0; 83 return 0;
83} 84}
84 85
86EXPORT_SYMBOL(snd_cs8427_reg_write);
87
85static int snd_cs8427_reg_read(struct snd_i2c_device *device, unsigned char reg) 88static int snd_cs8427_reg_read(struct snd_i2c_device *device, unsigned char reg)
86{ 89{
87 int err; 90 int err;
88 unsigned char buf; 91 unsigned char buf;
89 92
90 if ((err = snd_i2c_sendbytes(device, &reg, 1)) != 1) { 93 if ((err = snd_i2c_sendbytes(device, &reg, 1)) != 1) {
91 snd_printk(KERN_ERR "unable to send register 0x%x byte to CS8427\n", reg); 94 snd_printk(KERN_ERR "unable to send register 0x%x byte "
95 "to CS8427\n", reg);
92 return err < 0 ? err : -EIO; 96 return err < 0 ? err : -EIO;
93 } 97 }
94 if ((err = snd_i2c_readbytes(device, &buf, 1)) != 1) { 98 if ((err = snd_i2c_readbytes(device, &buf, 1)) != 1) {
95 snd_printk(KERN_ERR "unable to read register 0x%x byte from CS8427\n", reg); 99 snd_printk(KERN_ERR "unable to read register 0x%x byte "
100 "from CS8427\n", reg);
96 return err < 0 ? err : -EIO; 101 return err < 0 ? err : -EIO;
97 } 102 }
98 return buf; 103 return buf;
@@ -121,7 +126,8 @@ static int snd_cs8427_send_corudata(struct snd_i2c_device *device,
121 int count) 126 int count)
122{ 127{
123 struct cs8427 *chip = device->private_data; 128 struct cs8427 *chip = device->private_data;
124 char *hw_data = udata ? chip->playback.hw_udata : chip->playback.hw_status; 129 char *hw_data = udata ?
130 chip->playback.hw_udata : chip->playback.hw_status;
125 char data[32]; 131 char data[32];
126 int err, idx; 132 int err, idx;
127 133
@@ -134,11 +140,11 @@ static int snd_cs8427_send_corudata(struct snd_i2c_device *device,
134 memset(data, 0, sizeof(data)); 140 memset(data, 0, sizeof(data));
135 if (memcmp(hw_data, data, count) == 0) { 141 if (memcmp(hw_data, data, count) == 0) {
136 chip->regmap[CS8427_REG_UDATABUF] &= ~CS8427_UBMMASK; 142 chip->regmap[CS8427_REG_UDATABUF] &= ~CS8427_UBMMASK;
137 chip->regmap[CS8427_REG_UDATABUF] |= CS8427_UBMZEROS | CS8427_EFTUI; 143 chip->regmap[CS8427_REG_UDATABUF] |= CS8427_UBMZEROS |
138 if ((err = snd_cs8427_reg_write(device, CS8427_REG_UDATABUF, 144 CS8427_EFTUI;
139 chip->regmap[CS8427_REG_UDATABUF])) < 0) 145 err = snd_cs8427_reg_write(device, CS8427_REG_UDATABUF,
140 return err; 146 chip->regmap[CS8427_REG_UDATABUF]);
141 return 0; 147 return err < 0 ? err : 0;
142 } 148 }
143 } 149 }
144 data[0] = CS8427_REG_AUTOINC | CS8427_REG_CORU_DATABUF; 150 data[0] = CS8427_REG_AUTOINC | CS8427_REG_CORU_DATABUF;
@@ -161,24 +167,32 @@ int snd_cs8427_create(struct snd_i2c_bus *bus,
161{ 167{
162 static unsigned char initvals1[] = { 168 static unsigned char initvals1[] = {
163 CS8427_REG_CONTROL1 | CS8427_REG_AUTOINC, 169 CS8427_REG_CONTROL1 | CS8427_REG_AUTOINC,
164 /* CS8427_REG_CONTROL1: RMCK to OMCK, valid PCM audio, disable mutes, TCBL=output */ 170 /* CS8427_REG_CONTROL1: RMCK to OMCK, valid PCM audio, disable mutes,
171 TCBL=output */
165 CS8427_SWCLK | CS8427_TCBLDIR, 172 CS8427_SWCLK | CS8427_TCBLDIR,
166 /* CS8427_REG_CONTROL2: hold last valid audio sample, RMCK=256*Fs, normal stereo operation */ 173 /* CS8427_REG_CONTROL2: hold last valid audio sample, RMCK=256*Fs,
174 normal stereo operation */
167 0x00, 175 0x00,
168 /* CS8427_REG_DATAFLOW: output drivers normal operation, Tx<=serial, Rx=>serial */ 176 /* CS8427_REG_DATAFLOW: output drivers normal operation, Tx<=serial,
177 Rx=>serial */
169 CS8427_TXDSERIAL | CS8427_SPDAES3RECEIVER, 178 CS8427_TXDSERIAL | CS8427_SPDAES3RECEIVER,
170 /* CS8427_REG_CLOCKSOURCE: Run off, CMCK=256*Fs, output time base = OMCK, input time base = 179 /* CS8427_REG_CLOCKSOURCE: Run off, CMCK=256*Fs,
171 recovered input clock, recovered input clock source is ILRCK changed to AES3INPUT (workaround, see snd_cs8427_reset) */ 180 output time base = OMCK, input time base = recovered input clock,
181 recovered input clock source is ILRCK changed to AES3INPUT
182 (workaround, see snd_cs8427_reset) */
172 CS8427_RXDILRCK, 183 CS8427_RXDILRCK,
173 /* CS8427_REG_SERIALINPUT: Serial audio input port data format = I2S, 24-bit, 64*Fsi */ 184 /* CS8427_REG_SERIALINPUT: Serial audio input port data format = I2S,
185 24-bit, 64*Fsi */
174 CS8427_SIDEL | CS8427_SILRPOL, 186 CS8427_SIDEL | CS8427_SILRPOL,
175 /* CS8427_REG_SERIALOUTPUT: Serial audio output port data format = I2S, 24-bit, 64*Fsi */ 187 /* CS8427_REG_SERIALOUTPUT: Serial audio output port data format
188 = I2S, 24-bit, 64*Fsi */
176 CS8427_SODEL | CS8427_SOLRPOL, 189 CS8427_SODEL | CS8427_SOLRPOL,
177 }; 190 };
178 static unsigned char initvals2[] = { 191 static unsigned char initvals2[] = {
179 CS8427_REG_RECVERRMASK | CS8427_REG_AUTOINC, 192 CS8427_REG_RECVERRMASK | CS8427_REG_AUTOINC,
180 /* CS8427_REG_RECVERRMASK: unmask the input PLL clock, V, confidence, biphase, parity status bits */ 193 /* CS8427_REG_RECVERRMASK: unmask the input PLL clock, V, confidence,
181 /* CS8427_UNLOCK | CS8427_V | CS8427_CONF | CS8427_BIP | CS8427_PAR, */ 194 biphase, parity status bits */
195 /* CS8427_UNLOCK | CS8427_V | CS8427_CONF | CS8427_BIP | CS8427_PAR,*/
182 0xff, /* set everything */ 196 0xff, /* set everything */
183 /* CS8427_REG_CSDATABUF: 197 /* CS8427_REG_CSDATABUF:
184 Registers 32-55 window to CS buffer 198 Registers 32-55 window to CS buffer
@@ -201,7 +215,8 @@ int snd_cs8427_create(struct snd_i2c_bus *bus,
201 struct snd_i2c_device *device; 215 struct snd_i2c_device *device;
202 unsigned char buf[24]; 216 unsigned char buf[24];
203 217
204 if ((err = snd_i2c_device_create(bus, "CS8427", CS8427_ADDR | (addr & 7), 218 if ((err = snd_i2c_device_create(bus, "CS8427",
219 CS8427_ADDR | (addr & 7),
205 &device)) < 0) 220 &device)) < 0)
206 return err; 221 return err;
207 chip = device->private_data = kzalloc(sizeof(*chip), GFP_KERNEL); 222 chip = device->private_data = kzalloc(sizeof(*chip), GFP_KERNEL);
@@ -212,8 +227,8 @@ int snd_cs8427_create(struct snd_i2c_bus *bus,
212 device->private_free = snd_cs8427_free; 227 device->private_free = snd_cs8427_free;
213 228
214 snd_i2c_lock(bus); 229 snd_i2c_lock(bus);
215 if ((err = snd_cs8427_reg_read(device, CS8427_REG_ID_AND_VER)) != 230 err = snd_cs8427_reg_read(device, CS8427_REG_ID_AND_VER);
216 CS8427_VER8427A) { 231 if (err != CS8427_VER8427A) {
217 snd_i2c_unlock(bus); 232 snd_i2c_unlock(bus);
218 snd_printk(KERN_ERR "unable to find CS8427 signature " 233 snd_printk(KERN_ERR "unable to find CS8427 signature "
219 "(expected 0x%x, read 0x%x),\n", 234 "(expected 0x%x, read 0x%x),\n",
@@ -222,7 +237,8 @@ int snd_cs8427_create(struct snd_i2c_bus *bus,
222 return -EFAULT; 237 return -EFAULT;
223 } 238 }
224 /* turn off run bit while making changes to configuration */ 239 /* turn off run bit while making changes to configuration */
225 if ((err = snd_cs8427_reg_write(device, CS8427_REG_CLOCKSOURCE, 0x00)) < 0) 240 err = snd_cs8427_reg_write(device, CS8427_REG_CLOCKSOURCE, 0x00);
241 if (err < 0)
226 goto __fail; 242 goto __fail;
227 /* send initial values */ 243 /* send initial values */
228 memcpy(chip->regmap + (initvals1[0] & 0x7f), initvals1 + 1, 6); 244 memcpy(chip->regmap + (initvals1[0] & 0x7f), initvals1 + 1, 6);
@@ -282,6 +298,8 @@ int snd_cs8427_create(struct snd_i2c_bus *bus,
282 return err < 0 ? err : -EIO; 298 return err < 0 ? err : -EIO;
283} 299}
284 300
301EXPORT_SYMBOL(snd_cs8427_create);
302
285/* 303/*
286 * Reset the chip using run bit, also lock PLL using ILRCK and 304 * Reset the chip using run bit, also lock PLL using ILRCK and
287 * put back AES3INPUT. This workaround is described in latest 305 * put back AES3INPUT. This workaround is described in latest
@@ -296,7 +314,8 @@ static void snd_cs8427_reset(struct snd_i2c_device *cs8427)
296 snd_assert(cs8427, return); 314 snd_assert(cs8427, return);
297 chip = cs8427->private_data; 315 chip = cs8427->private_data;
298 snd_i2c_lock(cs8427->bus); 316 snd_i2c_lock(cs8427->bus);
299 if ((chip->regmap[CS8427_REG_CLOCKSOURCE] & CS8427_RXDAES3INPUT) == CS8427_RXDAES3INPUT) /* AES3 bit is set */ 317 if ((chip->regmap[CS8427_REG_CLOCKSOURCE] & CS8427_RXDAES3INPUT) ==
318 CS8427_RXDAES3INPUT) /* AES3 bit is set */
300 aes3input = 1; 319 aes3input = 1;
301 chip->regmap[CS8427_REG_CLOCKSOURCE] &= ~(CS8427_RUN | CS8427_RXDMASK); 320 chip->regmap[CS8427_REG_CLOCKSOURCE] &= ~(CS8427_RUN | CS8427_RXDMASK);
302 snd_cs8427_reg_write(cs8427, CS8427_REG_CLOCKSOURCE, 321 snd_cs8427_reg_write(cs8427, CS8427_REG_CLOCKSOURCE,
@@ -367,12 +386,15 @@ static int snd_cs8427_qsubcode_get(struct snd_kcontrol *kcontrol,
367 386
368 snd_i2c_lock(device->bus); 387 snd_i2c_lock(device->bus);
369 if ((err = snd_i2c_sendbytes(device, &reg, 1)) != 1) { 388 if ((err = snd_i2c_sendbytes(device, &reg, 1)) != 1) {
370 snd_printk(KERN_ERR "unable to send register 0x%x byte to CS8427\n", reg); 389 snd_printk(KERN_ERR "unable to send register 0x%x byte "
390 "to CS8427\n", reg);
371 snd_i2c_unlock(device->bus); 391 snd_i2c_unlock(device->bus);
372 return err < 0 ? err : -EIO; 392 return err < 0 ? err : -EIO;
373 } 393 }
374 if ((err = snd_i2c_readbytes(device, ucontrol->value.bytes.data, 10)) != 10) { 394 err = snd_i2c_readbytes(device, ucontrol->value.bytes.data, 10);
375 snd_printk(KERN_ERR "unable to read Q-subcode bytes from CS8427\n"); 395 if (err != 10) {
396 snd_printk(KERN_ERR "unable to read Q-subcode bytes "
397 "from CS8427\n");
376 snd_i2c_unlock(device->bus); 398 snd_i2c_unlock(device->bus);
377 return err < 0 ? err : -EIO; 399 return err < 0 ? err : -EIO;
378 } 400 }
@@ -380,7 +402,8 @@ static int snd_cs8427_qsubcode_get(struct snd_kcontrol *kcontrol,
380 return 0; 402 return 0;
381} 403}
382 404
383static int snd_cs8427_spdif_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) 405static int snd_cs8427_spdif_info(struct snd_kcontrol *kcontrol,
406 struct snd_ctl_elem_info *uinfo)
384{ 407{
385 uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; 408 uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
386 uinfo->count = 1; 409 uinfo->count = 1;
@@ -413,7 +436,8 @@ static int snd_cs8427_spdif_put(struct snd_kcontrol *kcontrol,
413 snd_i2c_lock(device->bus); 436 snd_i2c_lock(device->bus);
414 change = memcmp(ucontrol->value.iec958.status, status, 24) != 0; 437 change = memcmp(ucontrol->value.iec958.status, status, 24) != 0;
415 memcpy(status, ucontrol->value.iec958.status, 24); 438 memcpy(status, ucontrol->value.iec958.status, 24);
416 if (change && (kcontrol->private_value ? runtime != NULL : runtime == NULL)) { 439 if (change && (kcontrol->private_value ?
440 runtime != NULL : runtime == NULL)) {
417 err = snd_cs8427_send_corudata(device, 0, status, 24); 441 err = snd_cs8427_send_corudata(device, 0, status, 24);
418 if (err < 0) 442 if (err < 0)
419 change = err; 443 change = err;
@@ -442,7 +466,8 @@ static struct snd_kcontrol_new snd_cs8427_iec958_controls[] = {
442 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 466 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
443 .info = snd_cs8427_in_status_info, 467 .info = snd_cs8427_in_status_info,
444 .name = "IEC958 CS8427 Input Status", 468 .name = "IEC958 CS8427 Input Status",
445 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, 469 .access = (SNDRV_CTL_ELEM_ACCESS_READ |
470 SNDRV_CTL_ELEM_ACCESS_VOLATILE),
446 .get = snd_cs8427_in_status_get, 471 .get = snd_cs8427_in_status_get,
447 .private_value = 15, 472 .private_value = 15,
448}, 473},
@@ -450,7 +475,8 @@ static struct snd_kcontrol_new snd_cs8427_iec958_controls[] = {
450 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 475 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
451 .info = snd_cs8427_in_status_info, 476 .info = snd_cs8427_in_status_info,
452 .name = "IEC958 CS8427 Error Status", 477 .name = "IEC958 CS8427 Error Status",
453 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, 478 .access = (SNDRV_CTL_ELEM_ACCESS_READ |
479 SNDRV_CTL_ELEM_ACCESS_VOLATILE),
454 .get = snd_cs8427_in_status_get, 480 .get = snd_cs8427_in_status_get,
455 .private_value = 16, 481 .private_value = 16,
456}, 482},
@@ -470,7 +496,8 @@ static struct snd_kcontrol_new snd_cs8427_iec958_controls[] = {
470 .private_value = 0 496 .private_value = 0
471}, 497},
472{ 498{
473 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE, 499 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
500 SNDRV_CTL_ELEM_ACCESS_INACTIVE),
474 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 501 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
475 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM), 502 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM),
476 .info = snd_cs8427_spdif_info, 503 .info = snd_cs8427_spdif_info,
@@ -482,7 +509,8 @@ static struct snd_kcontrol_new snd_cs8427_iec958_controls[] = {
482 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 509 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
483 .info = snd_cs8427_qsubcode_info, 510 .info = snd_cs8427_qsubcode_info,
484 .name = "IEC958 Q-subcode Capture Default", 511 .name = "IEC958 Q-subcode Capture Default",
485 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, 512 .access = (SNDRV_CTL_ELEM_ACCESS_READ |
513 SNDRV_CTL_ELEM_ACCESS_VOLATILE),
486 .get = snd_cs8427_qsubcode_get 514 .get = snd_cs8427_qsubcode_get
487}}; 515}};
488 516
@@ -505,7 +533,8 @@ int snd_cs8427_iec958_build(struct snd_i2c_device *cs8427,
505 err = snd_ctl_add(cs8427->bus->card, kctl); 533 err = snd_ctl_add(cs8427->bus->card, kctl);
506 if (err < 0) 534 if (err < 0)
507 return err; 535 return err;
508 if (!strcmp(kctl->id.name, SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM))) 536 if (! strcmp(kctl->id.name,
537 SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM)))
509 chip->playback.pcm_ctl = kctl; 538 chip->playback.pcm_ctl = kctl;
510 } 539 }
511 540
@@ -515,6 +544,8 @@ int snd_cs8427_iec958_build(struct snd_i2c_device *cs8427,
515 return 0; 544 return 0;
516} 545}
517 546
547EXPORT_SYMBOL(snd_cs8427_iec958_build);
548
518int snd_cs8427_iec958_active(struct snd_i2c_device *cs8427, int active) 549int snd_cs8427_iec958_active(struct snd_i2c_device *cs8427, int active)
519{ 550{
520 struct cs8427 *chip; 551 struct cs8427 *chip;
@@ -522,13 +553,17 @@ int snd_cs8427_iec958_active(struct snd_i2c_device *cs8427, int active)
522 snd_assert(cs8427, return -ENXIO); 553 snd_assert(cs8427, return -ENXIO);
523 chip = cs8427->private_data; 554 chip = cs8427->private_data;
524 if (active) 555 if (active)
525 memcpy(chip->playback.pcm_status, chip->playback.def_status, 24); 556 memcpy(chip->playback.pcm_status,
557 chip->playback.def_status, 24);
526 chip->playback.pcm_ctl->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE; 558 chip->playback.pcm_ctl->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE;
527 snd_ctl_notify(cs8427->bus->card, SNDRV_CTL_EVENT_MASK_VALUE | 559 snd_ctl_notify(cs8427->bus->card,
528 SNDRV_CTL_EVENT_MASK_INFO, &chip->playback.pcm_ctl->id); 560 SNDRV_CTL_EVENT_MASK_VALUE | SNDRV_CTL_EVENT_MASK_INFO,
561 &chip->playback.pcm_ctl->id);
529 return 0; 562 return 0;
530} 563}
531 564
565EXPORT_SYMBOL(snd_cs8427_iec958_active);
566
532int snd_cs8427_iec958_pcm(struct snd_i2c_device *cs8427, unsigned int rate) 567int snd_cs8427_iec958_pcm(struct snd_i2c_device *cs8427, unsigned int rate)
533{ 568{
534 struct cs8427 *chip; 569 struct cs8427 *chip;
@@ -568,6 +603,8 @@ int snd_cs8427_iec958_pcm(struct snd_i2c_device *cs8427, unsigned int rate)
568 return err < 0 ? err : 0; 603 return err < 0 ? err : 0;
569} 604}
570 605
606EXPORT_SYMBOL(snd_cs8427_iec958_pcm);
607
571static int __init alsa_cs8427_module_init(void) 608static int __init alsa_cs8427_module_init(void)
572{ 609{
573 return 0; 610 return 0;
@@ -579,10 +616,3 @@ static void __exit alsa_cs8427_module_exit(void)
579 616
580module_init(alsa_cs8427_module_init) 617module_init(alsa_cs8427_module_init)
581module_exit(alsa_cs8427_module_exit) 618module_exit(alsa_cs8427_module_exit)
582
583EXPORT_SYMBOL(snd_cs8427_create);
584EXPORT_SYMBOL(snd_cs8427_reset);
585EXPORT_SYMBOL(snd_cs8427_reg_write);
586EXPORT_SYMBOL(snd_cs8427_iec958_build);
587EXPORT_SYMBOL(snd_cs8427_iec958_active);
588EXPORT_SYMBOL(snd_cs8427_iec958_pcm);
diff --git a/sound/isa/cs423x/Makefile b/sound/isa/cs423x/Makefile
index d2afaea30cbc..2fb4f7409d7c 100644
--- a/sound/isa/cs423x/Makefile
+++ b/sound/isa/cs423x/Makefile
@@ -11,6 +11,7 @@ snd-cs4236-objs := cs4236.o
11 11
12# Toplevel Module Dependency 12# Toplevel Module Dependency
13obj-$(CONFIG_SND_AZT2320) += snd-cs4231-lib.o 13obj-$(CONFIG_SND_AZT2320) += snd-cs4231-lib.o
14obj-$(CONFIG_SND_MIRO) += snd-cs4231-lib.o
14obj-$(CONFIG_SND_OPL3SA2) += snd-cs4231-lib.o 15obj-$(CONFIG_SND_OPL3SA2) += snd-cs4231-lib.o
15obj-$(CONFIG_SND_CS4231) += snd-cs4231.o snd-cs4231-lib.o 16obj-$(CONFIG_SND_CS4231) += snd-cs4231.o snd-cs4231-lib.o
16obj-$(CONFIG_SND_CS4232) += snd-cs4232.o snd-cs4231-lib.o 17obj-$(CONFIG_SND_CS4232) += snd-cs4232.o snd-cs4231-lib.o
diff --git a/sound/isa/gus/gusextreme.c b/sound/isa/gus/gusextreme.c
index 22cdddbfd824..532c56e35ca4 100644
--- a/sound/isa/gus/gusextreme.c
+++ b/sound/isa/gus/gusextreme.c
@@ -87,7 +87,7 @@ MODULE_PARM_DESC(channels, "GF1 channels for GUS Extreme driver.");
87module_param_array(pcm_channels, int, NULL, 0444); 87module_param_array(pcm_channels, int, NULL, 0444);
88MODULE_PARM_DESC(pcm_channels, "Reserved PCM channels for GUS Extreme driver."); 88MODULE_PARM_DESC(pcm_channels, "Reserved PCM channels for GUS Extreme driver.");
89 89
90struct platform_device *devices[SNDRV_CARDS]; 90static struct platform_device *devices[SNDRV_CARDS];
91 91
92 92
93#define PFX "gusextreme: " 93#define PFX "gusextreme: "
diff --git a/sound/isa/wavefront/wavefront_fx.c b/sound/isa/wavefront/wavefront_fx.c
index 180661c5ffdc..4f0846feb73f 100644
--- a/sound/isa/wavefront/wavefront_fx.c
+++ b/sound/isa/wavefront/wavefront_fx.c
@@ -34,7 +34,7 @@
34 34
35/* weird stuff, derived from port I/O tracing with dosemu */ 35/* weird stuff, derived from port I/O tracing with dosemu */
36 36
37static unsigned char page_zero[] __initdata = { 37static unsigned char page_zero[] __devinitdata = {
380x01, 0x7c, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf5, 0x00, 380x01, 0x7c, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf5, 0x00,
390x11, 0x00, 0x20, 0x00, 0x32, 0x00, 0x40, 0x00, 0x13, 0x00, 0x00, 390x11, 0x00, 0x20, 0x00, 0x32, 0x00, 0x40, 0x00, 0x13, 0x00, 0x00,
400x00, 0x14, 0x02, 0x76, 0x00, 0x60, 0x00, 0x80, 0x02, 0x00, 0x00, 400x00, 0x14, 0x02, 0x76, 0x00, 0x60, 0x00, 0x80, 0x02, 0x00, 0x00,
@@ -61,7 +61,7 @@ static unsigned char page_zero[] __initdata = {
610x1d, 0x02, 0xdf 610x1d, 0x02, 0xdf
62}; 62};
63 63
64static unsigned char page_one[] __initdata = { 64static unsigned char page_one[] __devinitdata = {
650x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x19, 0x00, 650x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x19, 0x00,
660x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xd8, 0x00, 0x00, 660x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xd8, 0x00, 0x00,
670x02, 0x20, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x01, 670x02, 0x20, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x01,
@@ -88,7 +88,7 @@ static unsigned char page_one[] __initdata = {
880x60, 0x00, 0x1b 880x60, 0x00, 0x1b
89}; 89};
90 90
91static unsigned char page_two[] __initdata = { 91static unsigned char page_two[] __devinitdata = {
920xc4, 0x00, 0x44, 0x07, 0x44, 0x00, 0x40, 0x25, 0x01, 0x06, 0xc4, 920xc4, 0x00, 0x44, 0x07, 0x44, 0x00, 0x40, 0x25, 0x01, 0x06, 0xc4,
930x07, 0x40, 0x25, 0x01, 0x00, 0x46, 0x46, 0x00, 0x00, 0x00, 0x00, 930x07, 0x40, 0x25, 0x01, 0x00, 0x46, 0x46, 0x00, 0x00, 0x00, 0x00,
940x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 940x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -103,7 +103,7 @@ static unsigned char page_two[] __initdata = {
1030x46, 0x05, 0x46, 0x07, 0x46, 0x07, 0x44 1030x46, 0x05, 0x46, 0x07, 0x46, 0x07, 0x44
104}; 104};
105 105
106static unsigned char page_three[] __initdata = { 106static unsigned char page_three[] __devinitdata = {
1070x07, 0x40, 0x00, 0x00, 0x00, 0x47, 0x00, 0x40, 0x00, 0x40, 0x06, 1070x07, 0x40, 0x00, 0x00, 0x00, 0x47, 0x00, 0x40, 0x00, 0x40, 0x06,
1080x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 1080x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1090x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 1090x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -118,7 +118,7 @@ static unsigned char page_three[] __initdata = {
1180x02, 0x00, 0x42, 0x00, 0xc0, 0x00, 0x40 1180x02, 0x00, 0x42, 0x00, 0xc0, 0x00, 0x40
119}; 119};
120 120
121static unsigned char page_four[] __initdata = { 121static unsigned char page_four[] __devinitdata = {
1220x63, 0x03, 0x26, 0x02, 0x2c, 0x00, 0x24, 0x00, 0x2e, 0x02, 0x02, 1220x63, 0x03, 0x26, 0x02, 0x2c, 0x00, 0x24, 0x00, 0x2e, 0x02, 0x02,
1230x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 1230x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1240x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 1240x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -133,7 +133,7 @@ static unsigned char page_four[] __initdata = {
1330x02, 0x62, 0x02, 0x20, 0x01, 0x21, 0x01 1330x02, 0x62, 0x02, 0x20, 0x01, 0x21, 0x01
134}; 134};
135 135
136static unsigned char page_six[] __initdata = { 136static unsigned char page_six[] __devinitdata = {
1370x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x04, 0x00, 0x00, 0x06, 0x00, 1370x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x04, 0x00, 0x00, 0x06, 0x00,
1380x00, 0x08, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x0e, 1380x00, 0x08, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x0e,
1390x00, 0x00, 0x10, 0x00, 0x00, 0x12, 0x00, 0x00, 0x14, 0x00, 0x00, 1390x00, 0x00, 0x10, 0x00, 0x00, 0x12, 0x00, 0x00, 0x14, 0x00, 0x00,
@@ -154,7 +154,7 @@ static unsigned char page_six[] __initdata = {
1540x80, 0x00, 0x7e, 0x80, 0x80 1540x80, 0x00, 0x7e, 0x80, 0x80
155}; 155};
156 156
157static unsigned char page_seven[] __initdata = { 157static unsigned char page_seven[] __devinitdata = {
1580x0f, 0xff, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x02, 0x00, 0x00, 1580x0f, 0xff, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x02, 0x00, 0x00,
1590x00, 0x00, 0x00, 0x0f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 1590x00, 0x00, 0x00, 0x0f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,
1600x08, 0x00, 0x00, 0x00, 0x0f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x0f, 1600x08, 0x00, 0x00, 0x00, 0x0f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x0f,
@@ -181,7 +181,7 @@ static unsigned char page_seven[] __initdata = {
1810x00, 0x02, 0x00 1810x00, 0x02, 0x00
182}; 182};
183 183
184static unsigned char page_zero_v2[] __initdata = { 184static unsigned char page_zero_v2[] __devinitdata = {
1850x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 1850x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1860x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 1860x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1870x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 1870x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -193,7 +193,7 @@ static unsigned char page_zero_v2[] __initdata = {
1930x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 1930x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
194}; 194};
195 195
196static unsigned char page_one_v2[] __initdata = { 196static unsigned char page_one_v2[] __devinitdata = {
1970x01, 0xc0, 0x01, 0xfa, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 1970x01, 0xc0, 0x01, 0xfa, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00,
1980x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 1980x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1990x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 1990x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -205,21 +205,21 @@ static unsigned char page_one_v2[] __initdata = {
2050x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 2050x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
206}; 206};
207 207
208static unsigned char page_two_v2[] __initdata = { 208static unsigned char page_two_v2[] __devinitdata = {
2090x46, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 2090x46, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2100x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 2100x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2110x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 2110x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2120x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 2120x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2130x00, 0x00, 0x00, 0x00 2130x00, 0x00, 0x00, 0x00
214}; 214};
215static unsigned char page_three_v2[] __initdata = { 215static unsigned char page_three_v2[] __devinitdata = {
2160x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 2160x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2170x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 2170x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2180x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 2180x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2190x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 2190x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2200x00, 0x00, 0x00, 0x00 2200x00, 0x00, 0x00, 0x00
221}; 221};
222static unsigned char page_four_v2[] __initdata = { 222static unsigned char page_four_v2[] __devinitdata = {
2230x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 2230x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2240x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 2240x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2250x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 2250x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -227,7 +227,7 @@ static unsigned char page_four_v2[] __initdata = {
2270x00, 0x00, 0x00, 0x00 2270x00, 0x00, 0x00, 0x00
228}; 228};
229 229
230static unsigned char page_seven_v2[] __initdata = { 230static unsigned char page_seven_v2[] __devinitdata = {
2310x0f, 0xff, 0x0f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 2310x0f, 0xff, 0x0f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2320x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 2320x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2330x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 2330x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -239,7 +239,7 @@ static unsigned char page_seven_v2[] __initdata = {
2390x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 2390x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
240}; 240};
241 241
242static unsigned char mod_v2[] __initdata = { 242static unsigned char mod_v2[] __devinitdata = {
2430x01, 0x00, 0x02, 0x00, 0x01, 0x01, 0x02, 0x00, 0x01, 0x02, 0x02, 2430x01, 0x00, 0x02, 0x00, 0x01, 0x01, 0x02, 0x00, 0x01, 0x02, 0x02,
2440x00, 0x01, 0x03, 0x02, 0x00, 0x01, 0x04, 0x02, 0x00, 0x01, 0x05, 2440x00, 0x01, 0x03, 0x02, 0x00, 0x01, 0x04, 0x02, 0x00, 0x01, 0x05,
2450x02, 0x00, 0x01, 0x06, 0x02, 0x00, 0x01, 0x07, 0x02, 0x00, 0xb0, 2450x02, 0x00, 0x01, 0x06, 0x02, 0x00, 0x01, 0x07, 0x02, 0x00, 0xb0,
@@ -269,7 +269,7 @@ static unsigned char mod_v2[] __initdata = {
2690x02, 0x01, 0x01, 0x04, 0x02, 0x01, 0x01, 0x05, 0x02, 0x01, 0x01, 2690x02, 0x01, 0x01, 0x04, 0x02, 0x01, 0x01, 0x05, 0x02, 0x01, 0x01,
2700x06, 0x02, 0x01, 0x01, 0x07, 0x02, 0x01 2700x06, 0x02, 0x01, 0x01, 0x07, 0x02, 0x01
271}; 271};
272static unsigned char coefficients[] __initdata = { 272static unsigned char coefficients[] __devinitdata = {
2730x07, 0x46, 0x00, 0x00, 0x07, 0x49, 0x00, 0x00, 0x00, 0x4b, 0x03, 2730x07, 0x46, 0x00, 0x00, 0x07, 0x49, 0x00, 0x00, 0x00, 0x4b, 0x03,
2740x11, 0x00, 0x4d, 0x01, 0x32, 0x07, 0x46, 0x00, 0x00, 0x07, 0x49, 2740x11, 0x00, 0x4d, 0x01, 0x32, 0x07, 0x46, 0x00, 0x00, 0x07, 0x49,
2750x00, 0x00, 0x07, 0x40, 0x00, 0x00, 0x07, 0x41, 0x00, 0x00, 0x01, 2750x00, 0x00, 0x07, 0x40, 0x00, 0x00, 0x07, 0x41, 0x00, 0x00, 0x01,
@@ -305,14 +305,14 @@ static unsigned char coefficients[] __initdata = {
3050x06, 0x6c, 0x4c, 0x6c, 0x06, 0x50, 0x52, 0xe2, 0x06, 0x42, 0x02, 3050x06, 0x6c, 0x4c, 0x6c, 0x06, 0x50, 0x52, 0xe2, 0x06, 0x42, 0x02,
3060xba 3060xba
307}; 307};
308static unsigned char coefficients2[] __initdata = { 308static unsigned char coefficients2[] __devinitdata = {
3090x07, 0x46, 0x00, 0x00, 0x07, 0x49, 0x00, 0x00, 0x07, 0x45, 0x0f, 3090x07, 0x46, 0x00, 0x00, 0x07, 0x49, 0x00, 0x00, 0x07, 0x45, 0x0f,
3100xff, 0x07, 0x48, 0x0f, 0xff, 0x07, 0x7b, 0x04, 0xcc, 0x07, 0x7d, 3100xff, 0x07, 0x48, 0x0f, 0xff, 0x07, 0x7b, 0x04, 0xcc, 0x07, 0x7d,
3110x04, 0xcc, 0x07, 0x7c, 0x00, 0x00, 0x07, 0x7e, 0x00, 0x00, 0x07, 3110x04, 0xcc, 0x07, 0x7c, 0x00, 0x00, 0x07, 0x7e, 0x00, 0x00, 0x07,
3120x46, 0x00, 0x00, 0x07, 0x49, 0x00, 0x00, 0x07, 0x47, 0x00, 0x00, 3120x46, 0x00, 0x00, 0x07, 0x49, 0x00, 0x00, 0x07, 0x47, 0x00, 0x00,
3130x07, 0x4a, 0x00, 0x00, 0x07, 0x4c, 0x00, 0x00, 0x07, 0x4e, 0x00, 0x00 3130x07, 0x4a, 0x00, 0x00, 0x07, 0x4c, 0x00, 0x00, 0x07, 0x4e, 0x00, 0x00
314}; 314};
315static unsigned char coefficients3[] __initdata = { 315static unsigned char coefficients3[] __devinitdata = {
3160x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x28, 0x00, 0x51, 0x00, 3160x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x28, 0x00, 0x51, 0x00,
3170x51, 0x00, 0x7a, 0x00, 0x7a, 0x00, 0xa3, 0x00, 0xa3, 0x00, 0xcc, 3170x51, 0x00, 0x7a, 0x00, 0x7a, 0x00, 0xa3, 0x00, 0xa3, 0x00, 0xcc,
3180x00, 0xcc, 0x00, 0xf5, 0x00, 0xf5, 0x01, 0x1e, 0x01, 0x1e, 0x01, 3180x00, 0xcc, 0x00, 0xf5, 0x00, 0xf5, 0x01, 0x1e, 0x01, 0x1e, 0x01,
@@ -563,7 +563,7 @@ snd_wavefront_fx_ioctl (struct snd_hwdep *sdev, struct file *file,
563*/ 563*/
564 564
565 565
566int __init 566int __devinit
567snd_wavefront_fx_start (snd_wavefront_t *dev) 567snd_wavefront_fx_start (snd_wavefront_t *dev)
568 568
569{ 569{
diff --git a/sound/isa/wavefront/wavefront_midi.c b/sound/isa/wavefront/wavefront_midi.c
index 15888ba2169b..cb3460094324 100644
--- a/sound/isa/wavefront/wavefront_midi.c
+++ b/sound/isa/wavefront/wavefront_midi.c
@@ -474,7 +474,7 @@ snd_wavefront_midi_disable_virtual (snd_wavefront_card_t *card)
474 spin_unlock_irqrestore (&card->wavefront.midi.virtual, flags); 474 spin_unlock_irqrestore (&card->wavefront.midi.virtual, flags);
475} 475}
476 476
477int __init 477int __devinit
478snd_wavefront_midi_start (snd_wavefront_card_t *card) 478snd_wavefront_midi_start (snd_wavefront_card_t *card)
479 479
480{ 480{
diff --git a/sound/isa/wavefront/wavefront_synth.c b/sound/isa/wavefront/wavefront_synth.c
index 68aa091e8961..bed329edbdd7 100644
--- a/sound/isa/wavefront/wavefront_synth.c
+++ b/sound/isa/wavefront/wavefront_synth.c
@@ -1738,7 +1738,7 @@ snd_wavefront_internal_interrupt (snd_wavefront_card_t *card)
17387 Unused 17387 Unused
1739*/ 1739*/
1740 1740
1741static int __init 1741static int __devinit
1742snd_wavefront_interrupt_bits (int irq) 1742snd_wavefront_interrupt_bits (int irq)
1743 1743
1744{ 1744{
@@ -1766,7 +1766,7 @@ snd_wavefront_interrupt_bits (int irq)
1766 return bits; 1766 return bits;
1767} 1767}
1768 1768
1769static void __init 1769static void __devinit
1770wavefront_should_cause_interrupt (snd_wavefront_t *dev, 1770wavefront_should_cause_interrupt (snd_wavefront_t *dev,
1771 int val, int port, int timeout) 1771 int val, int port, int timeout)
1772 1772
@@ -1787,7 +1787,7 @@ wavefront_should_cause_interrupt (snd_wavefront_t *dev,
1787 } 1787 }
1788} 1788}
1789 1789
1790static int __init 1790static int __devinit
1791wavefront_reset_to_cleanliness (snd_wavefront_t *dev) 1791wavefront_reset_to_cleanliness (snd_wavefront_t *dev)
1792 1792
1793{ 1793{
@@ -1946,7 +1946,7 @@ wavefront_reset_to_cleanliness (snd_wavefront_t *dev)
1946#include <asm/uaccess.h> 1946#include <asm/uaccess.h>
1947 1947
1948 1948
1949static int __init 1949static int __devinit
1950wavefront_download_firmware (snd_wavefront_t *dev, char *path) 1950wavefront_download_firmware (snd_wavefront_t *dev, char *path)
1951 1951
1952{ 1952{
@@ -2047,7 +2047,7 @@ wavefront_download_firmware (snd_wavefront_t *dev, char *path)
2047} 2047}
2048 2048
2049 2049
2050static int __init 2050static int __devinit
2051wavefront_do_reset (snd_wavefront_t *dev) 2051wavefront_do_reset (snd_wavefront_t *dev)
2052 2052
2053{ 2053{
@@ -2136,7 +2136,7 @@ wavefront_do_reset (snd_wavefront_t *dev)
2136 return 1; 2136 return 1;
2137} 2137}
2138 2138
2139int __init 2139int __devinit
2140snd_wavefront_start (snd_wavefront_t *dev) 2140snd_wavefront_start (snd_wavefront_t *dev)
2141 2141
2142{ 2142{
@@ -2178,7 +2178,7 @@ snd_wavefront_start (snd_wavefront_t *dev)
2178 return (0); 2178 return (0);
2179} 2179}
2180 2180
2181int __init 2181int __devinit
2182snd_wavefront_detect (snd_wavefront_card_t *card) 2182snd_wavefront_detect (snd_wavefront_card_t *card)
2183 2183
2184{ 2184{
diff --git a/sound/pci/Kconfig b/sound/pci/Kconfig
index 23e54cedfd4a..d7ad32f514da 100644
--- a/sound/pci/Kconfig
+++ b/sound/pci/Kconfig
@@ -460,17 +460,19 @@ config SND_FM801
460 To compile this driver as a module, choose M here: the module 460 To compile this driver as a module, choose M here: the module
461 will be called snd-fm801. 461 will be called snd-fm801.
462 462
463config SND_FM801_TEA575X 463config SND_FM801_TEA575X_BOOL
464 tristate "ForteMedia FM801 + TEA5757 tuner" 464 bool "ForteMedia FM801 + TEA5757 tuner"
465 depends on SND_FM801 465 depends on SND_FM801
466 select VIDEO_DEV
467 help 466 help
468 Say Y here to include support for soundcards based on the ForteMedia 467 Say Y here to include support for soundcards based on the ForteMedia
469 FM801 chip with a TEA5757 tuner connected to GPIO1-3 pins (Media 468 FM801 chip with a TEA5757 tuner connected to GPIO1-3 pins (Media
470 Forte SF256-PCS-02). 469 Forte SF256-PCS-02) into the snd-fm801 driver.
471 470
472 To compile this driver as a module, choose M here: the module 471config SND_FM801_TEA575X
473 will be called snd-fm801-tea575x. 472 tristate
473 depends on SND_FM801_TEA575X_BOOL
474 default SND_FM801
475 select VIDEO_DEV
474 476
475config SND_HDA_INTEL 477config SND_HDA_INTEL
476 tristate "Intel HD Audio" 478 tristate "Intel HD Audio"
diff --git a/sound/pci/ad1889.c b/sound/pci/ad1889.c
index f7aef8c9cf43..0786d0edaca5 100644
--- a/sound/pci/ad1889.c
+++ b/sound/pci/ad1889.c
@@ -241,14 +241,14 @@ ad1889_channel_reset(struct snd_ad1889 *chip, unsigned int channel)
241 } 241 }
242} 242}
243 243
244static inline u16 244static u16
245snd_ad1889_ac97_read(struct snd_ac97 *ac97, unsigned short reg) 245snd_ad1889_ac97_read(struct snd_ac97 *ac97, unsigned short reg)
246{ 246{
247 struct snd_ad1889 *chip = ac97->private_data; 247 struct snd_ad1889 *chip = ac97->private_data;
248 return ad1889_readw(chip, AD_AC97_BASE + reg); 248 return ad1889_readw(chip, AD_AC97_BASE + reg);
249} 249}
250 250
251static inline void 251static void
252snd_ad1889_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigned short val) 252snd_ad1889_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigned short val)
253{ 253{
254 struct snd_ad1889 *chip = ac97->private_data; 254 struct snd_ad1889 *chip = ac97->private_data;
@@ -873,7 +873,7 @@ skip_hw:
873 return 0; 873 return 0;
874} 874}
875 875
876static inline int 876static int
877snd_ad1889_dev_free(struct snd_device *device) 877snd_ad1889_dev_free(struct snd_device *device)
878{ 878{
879 struct snd_ad1889 *chip = device->device_data; 879 struct snd_ad1889 *chip = device->device_data;
@@ -1051,7 +1051,7 @@ snd_ad1889_remove(struct pci_dev *pci)
1051 pci_set_drvdata(pci, NULL); 1051 pci_set_drvdata(pci, NULL);
1052} 1052}
1053 1053
1054static struct pci_device_id snd_ad1889_ids[] __devinitdata = { 1054static struct pci_device_id snd_ad1889_ids[] = {
1055 { PCI_DEVICE(PCI_VENDOR_ID_ANALOG_DEVICES, PCI_DEVICE_ID_AD1889JS) }, 1055 { PCI_DEVICE(PCI_VENDOR_ID_ANALOG_DEVICES, PCI_DEVICE_ID_AD1889JS) },
1056 { 0, }, 1056 { 0, },
1057}; 1057};
diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c
index e0a815e53d1c..74668398eac5 100644
--- a/sound/pci/ali5451/ali5451.c
+++ b/sound/pci/ali5451/ali5451.c
@@ -279,7 +279,7 @@ struct snd_ali {
279#endif 279#endif
280}; 280};
281 281
282static struct pci_device_id snd_ali_ids[] __devinitdata = { 282static struct pci_device_id snd_ali_ids[] = {
283 {PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M5451), 0, 0, 0}, 283 {PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M5451), 0, 0, 0},
284 {0, } 284 {0, }
285}; 285};
diff --git a/sound/pci/als300.c b/sound/pci/als300.c
index a9c38963188a..96cfb8ae5055 100644
--- a/sound/pci/als300.c
+++ b/sound/pci/als300.c
@@ -146,7 +146,7 @@ struct snd_als300_substream_data {
146 int block_counter_register; 146 int block_counter_register;
147}; 147};
148 148
149static struct pci_device_id snd_als300_ids[] __devinitdata = { 149static struct pci_device_id snd_als300_ids[] = {
150 { 0x4005, 0x0300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_ALS300 }, 150 { 0x4005, 0x0300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_ALS300 },
151 { 0x4005, 0x0308, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_ALS300_PLUS }, 151 { 0x4005, 0x0308, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_ALS300_PLUS },
152 { 0, } 152 { 0, }
diff --git a/sound/pci/als4000.c b/sound/pci/als4000.c
index a9f08066459a..9e596f750cbd 100644
--- a/sound/pci/als4000.c
+++ b/sound/pci/als4000.c
@@ -116,7 +116,7 @@ struct snd_card_als4000 {
116#endif 116#endif
117}; 117};
118 118
119static struct pci_device_id snd_als4000_ids[] __devinitdata = { 119static struct pci_device_id snd_als4000_ids[] = {
120 { 0x4005, 0x4000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* ALS4000 */ 120 { 0x4005, 0x4000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* ALS4000 */
121 { 0, } 121 { 0, }
122}; 122};
diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c
index 9fbb065a810b..347e25ff073d 100644
--- a/sound/pci/atiixp.c
+++ b/sound/pci/atiixp.c
@@ -284,7 +284,7 @@ struct atiixp {
284 284
285/* 285/*
286 */ 286 */
287static struct pci_device_id snd_atiixp_ids[] __devinitdata = { 287static struct pci_device_id snd_atiixp_ids[] = {
288 { 0x1002, 0x4341, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB200 */ 288 { 0x1002, 0x4341, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB200 */
289 { 0x1002, 0x4361, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB300 */ 289 { 0x1002, 0x4361, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB300 */
290 { 0x1002, 0x4370, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB400 */ 290 { 0x1002, 0x4370, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB400 */
diff --git a/sound/pci/atiixp_modem.c b/sound/pci/atiixp_modem.c
index 7dcf4941dce2..a89d67c4598b 100644
--- a/sound/pci/atiixp_modem.c
+++ b/sound/pci/atiixp_modem.c
@@ -262,7 +262,7 @@ struct atiixp_modem {
262 262
263/* 263/*
264 */ 264 */
265static struct pci_device_id snd_atiixp_ids[] __devinitdata = { 265static struct pci_device_id snd_atiixp_ids[] = {
266 { 0x1002, 0x434d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB200 */ 266 { 0x1002, 0x434d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB200 */
267 { 0x1002, 0x4378, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB400 */ 267 { 0x1002, 0x4378, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB400 */
268 { 0, } 268 { 0, }
diff --git a/sound/pci/au88x0/au8810.c b/sound/pci/au88x0/au8810.c
index bd3352998ad0..fce22c7af0ea 100644
--- a/sound/pci/au88x0/au8810.c
+++ b/sound/pci/au88x0/au8810.c
@@ -1,6 +1,6 @@
1#include "au8810.h" 1#include "au8810.h"
2#include "au88x0.h" 2#include "au88x0.h"
3static struct pci_device_id snd_vortex_ids[] __devinitdata = { 3static struct pci_device_id snd_vortex_ids[] = {
4 {PCI_VENDOR_ID_AUREAL, PCI_DEVICE_ID_AUREAL_ADVANTAGE, 4 {PCI_VENDOR_ID_AUREAL, PCI_DEVICE_ID_AUREAL_ADVANTAGE,
5 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1,}, 5 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1,},
6 {0,} 6 {0,}
diff --git a/sound/pci/au88x0/au8820.c b/sound/pci/au88x0/au8820.c
index 7e3fd8372d8d..d1fbcce07257 100644
--- a/sound/pci/au88x0/au8820.c
+++ b/sound/pci/au88x0/au8820.c
@@ -1,6 +1,6 @@
1#include "au8820.h" 1#include "au8820.h"
2#include "au88x0.h" 2#include "au88x0.h"
3static struct pci_device_id snd_vortex_ids[] __devinitdata = { 3static struct pci_device_id snd_vortex_ids[] = {
4 {PCI_VENDOR_ID_AUREAL, PCI_DEVICE_ID_AUREAL_VORTEX_1, 4 {PCI_VENDOR_ID_AUREAL, PCI_DEVICE_ID_AUREAL_VORTEX_1,
5 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,}, 5 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,},
6 {0,} 6 {0,}
diff --git a/sound/pci/au88x0/au8830.c b/sound/pci/au88x0/au8830.c
index b840f6608a61..d4f2717c14fb 100644
--- a/sound/pci/au88x0/au8830.c
+++ b/sound/pci/au88x0/au8830.c
@@ -1,6 +1,6 @@
1#include "au8830.h" 1#include "au8830.h"
2#include "au88x0.h" 2#include "au88x0.h"
3static struct pci_device_id snd_vortex_ids[] __devinitdata = { 3static struct pci_device_id snd_vortex_ids[] = {
4 {PCI_VENDOR_ID_AUREAL, PCI_DEVICE_ID_AUREAL_VORTEX_2, 4 {PCI_VENDOR_ID_AUREAL, PCI_DEVICE_ID_AUREAL_VORTEX_2,
5 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,}, 5 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,},
6 {0,} 6 {0,}
diff --git a/sound/pci/au88x0/au88x0.h b/sound/pci/au88x0/au88x0.h
index f078b716d2b0..b1cfc3c79d07 100644
--- a/sound/pci/au88x0/au88x0.h
+++ b/sound/pci/au88x0/au88x0.h
@@ -270,7 +270,8 @@ static void vortex_mix_setvolumebyte(vortex_t * vortex, unsigned char mix,
270 270
271/* A3D functions. */ 271/* A3D functions. */
272#ifndef CHIP_AU8820 272#ifndef CHIP_AU8820
273static void vortex_Vort3D(vortex_t * v, int en); 273static void vortex_Vort3D_enable(vortex_t * v);
274static void vortex_Vort3D_disable(vortex_t * v);
274static void vortex_Vort3D_connect(vortex_t * vortex, int en); 275static void vortex_Vort3D_connect(vortex_t * vortex, int en);
275static void vortex_Vort3D_InitializeSource(a3dsrc_t * a, int en); 276static void vortex_Vort3D_InitializeSource(a3dsrc_t * a, int en);
276#endif 277#endif
diff --git a/sound/pci/au88x0/au88x0_a3d.c b/sound/pci/au88x0/au88x0_a3d.c
index d215f393ea64..649849e540d3 100644
--- a/sound/pci/au88x0/au88x0_a3d.c
+++ b/sound/pci/au88x0/au88x0_a3d.c
@@ -593,24 +593,23 @@ static int Vort3DRend_Initialize(vortex_t * v, unsigned short mode)
593static int vortex_a3d_register_controls(vortex_t * vortex); 593static int vortex_a3d_register_controls(vortex_t * vortex);
594static void vortex_a3d_unregister_controls(vortex_t * vortex); 594static void vortex_a3d_unregister_controls(vortex_t * vortex);
595/* A3D base support init/shudown */ 595/* A3D base support init/shudown */
596static void vortex_Vort3D(vortex_t * v, int en) 596static void __devinit vortex_Vort3D_enable(vortex_t * v)
597{ 597{
598 int i; 598 int i;
599 if (en) { 599
600 Vort3DRend_Initialize(v, XT_HEADPHONE); 600 Vort3DRend_Initialize(v, XT_HEADPHONE);
601 for (i = 0; i < NR_A3D; i++) { 601 for (i = 0; i < NR_A3D; i++) {
602 vortex_A3dSourceHw_Initialize(v, i % 4, i >> 2); 602 vortex_A3dSourceHw_Initialize(v, i % 4, i >> 2);
603 a3dsrc_ZeroStateA3D(&(v->a3d[0])); 603 a3dsrc_ZeroStateA3D(&(v->a3d[0]));
604 }
605 } else {
606 vortex_XtalkHw_Disable(v);
607 } 604 }
608 /* Register ALSA controls */ 605 /* Register ALSA controls */
609 if (en) { 606 vortex_a3d_register_controls(v);
610 vortex_a3d_register_controls(v); 607}
611 } else { 608
612 vortex_a3d_unregister_controls(v); 609static void vortex_Vort3D_disable(vortex_t * v)
613 } 610{
611 vortex_XtalkHw_Disable(v);
612 vortex_a3d_unregister_controls(v);
614} 613}
615 614
616/* Make A3D subsystem connections. */ 615/* Make A3D subsystem connections. */
@@ -855,7 +854,7 @@ static struct snd_kcontrol_new vortex_a3d_kcontrol __devinitdata = {
855}; 854};
856 855
857/* Control (un)registration. */ 856/* Control (un)registration. */
858static int vortex_a3d_register_controls(vortex_t * vortex) 857static int __devinit vortex_a3d_register_controls(vortex_t * vortex)
859{ 858{
860 struct snd_kcontrol *kcontrol; 859 struct snd_kcontrol *kcontrol;
861 int err, i; 860 int err, i;
diff --git a/sound/pci/au88x0/au88x0_core.c b/sound/pci/au88x0/au88x0_core.c
index 4347e6abc1d5..5299cce583d3 100644
--- a/sound/pci/au88x0/au88x0_core.c
+++ b/sound/pci/au88x0/au88x0_core.c
@@ -2690,7 +2690,7 @@ static int __devinit vortex_core_init(vortex_t * vortex)
2690#ifndef CHIP_AU8820 2690#ifndef CHIP_AU8820
2691 vortex_eq_init(vortex); 2691 vortex_eq_init(vortex);
2692 vortex_spdif_init(vortex, 48000, 1); 2692 vortex_spdif_init(vortex, 48000, 1);
2693 vortex_Vort3D(vortex, 1); 2693 vortex_Vort3D_enable(vortex);
2694#endif 2694#endif
2695#ifndef CHIP_AU8810 2695#ifndef CHIP_AU8810
2696 vortex_wt_init(vortex); 2696 vortex_wt_init(vortex);
@@ -2718,7 +2718,7 @@ static int vortex_core_shutdown(vortex_t * vortex)
2718 printk(KERN_INFO "Vortex: shutdown..."); 2718 printk(KERN_INFO "Vortex: shutdown...");
2719#ifndef CHIP_AU8820 2719#ifndef CHIP_AU8820
2720 vortex_eq_free(vortex); 2720 vortex_eq_free(vortex);
2721 vortex_Vort3D(vortex, 0); 2721 vortex_Vort3D_disable(vortex);
2722#endif 2722#endif
2723 //vortex_disable_timer_int(vortex); 2723 //vortex_disable_timer_int(vortex);
2724 vortex_disable_int(vortex); 2724 vortex_disable_int(vortex);
diff --git a/sound/pci/azt3328.c b/sound/pci/azt3328.c
index 15447a3216dd..bac8e9cfd921 100644
--- a/sound/pci/azt3328.c
+++ b/sound/pci/azt3328.c
@@ -238,7 +238,7 @@ struct snd_azf3328 {
238#endif 238#endif
239}; 239};
240 240
241static const struct pci_device_id snd_azf3328_ids[] __devinitdata = { 241static const struct pci_device_id snd_azf3328_ids[] = {
242 { 0x122D, 0x50DC, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* PCI168/3328 */ 242 { 0x122D, 0x50DC, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* PCI168/3328 */
243 { 0x122D, 0x80DA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* 3328 */ 243 { 0x122D, 0x80DA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* 3328 */
244 { 0, } 244 { 0, }
diff --git a/sound/pci/bt87x.c b/sound/pci/bt87x.c
index 4d4277d045aa..97a280a246cb 100644
--- a/sound/pci/bt87x.c
+++ b/sound/pci/bt87x.c
@@ -774,7 +774,7 @@ static int __devinit snd_bt87x_create(struct snd_card *card,
774 .driver_data = rate } 774 .driver_data = rate }
775 775
776/* driver_data is the default digital_rate value for that device */ 776/* driver_data is the default digital_rate value for that device */
777static struct pci_device_id snd_bt87x_ids[] __devinitdata = { 777static struct pci_device_id snd_bt87x_ids[] = {
778 /* Hauppauge WinTV series */ 778 /* Hauppauge WinTV series */
779 BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_878, 0x0070, 0x13eb, 32000), 779 BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_878, 0x0070, 0x13eb, 32000),
780 /* Hauppauge WinTV series */ 780 /* Hauppauge WinTV series */
diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c
index a30c019bab64..12bbbb6afd2d 100644
--- a/sound/pci/ca0106/ca0106_main.c
+++ b/sound/pci/ca0106/ca0106_main.c
@@ -1602,7 +1602,7 @@ static void __devexit snd_ca0106_remove(struct pci_dev *pci)
1602} 1602}
1603 1603
1604// PCI IDs 1604// PCI IDs
1605static struct pci_device_id snd_ca0106_ids[] __devinitdata = { 1605static struct pci_device_id snd_ca0106_ids[] = {
1606 { 0x1102, 0x0007, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* Audigy LS or Live 24bit */ 1606 { 0x1102, 0x0007, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* Audigy LS or Live 24bit */
1607 { 0, } 1607 { 0, }
1608}; 1608};
diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c
index 03766ad74998..876b64464b6f 100644
--- a/sound/pci/cmipci.c
+++ b/sound/pci/cmipci.c
@@ -2609,7 +2609,7 @@ static inline void snd_cmipci_proc_init(struct cmipci *cm) {}
2609#endif 2609#endif
2610 2610
2611 2611
2612static struct pci_device_id snd_cmipci_ids[] __devinitdata = { 2612static struct pci_device_id snd_cmipci_ids[] = {
2613 {PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8338A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 2613 {PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8338A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
2614 {PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8338B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 2614 {PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8338B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
2615 {PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8738, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 2615 {PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8738, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
diff --git a/sound/pci/cs4281.c b/sound/pci/cs4281.c
index d1802487f5be..9631456ec3de 100644
--- a/sound/pci/cs4281.c
+++ b/sound/pci/cs4281.c
@@ -494,7 +494,7 @@ struct cs4281 {
494 494
495static irqreturn_t snd_cs4281_interrupt(int irq, void *dev_id, struct pt_regs *regs); 495static irqreturn_t snd_cs4281_interrupt(int irq, void *dev_id, struct pt_regs *regs);
496 496
497static struct pci_device_id snd_cs4281_ids[] __devinitdata = { 497static struct pci_device_id snd_cs4281_ids[] = {
498 { 0x1013, 0x6005, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CS4281 */ 498 { 0x1013, 0x6005, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CS4281 */
499 { 0, } 499 { 0, }
500}; 500};
diff --git a/sound/pci/cs46xx/cs46xx.c b/sound/pci/cs46xx/cs46xx.c
index 772dc52bfeb2..8b6cd144d101 100644
--- a/sound/pci/cs46xx/cs46xx.c
+++ b/sound/pci/cs46xx/cs46xx.c
@@ -65,7 +65,7 @@ MODULE_PARM_DESC(thinkpad, "Force to enable Thinkpad's CLKRUN control.");
65module_param_array(mmap_valid, bool, NULL, 0444); 65module_param_array(mmap_valid, bool, NULL, 0444);
66MODULE_PARM_DESC(mmap_valid, "Support OSS mmap."); 66MODULE_PARM_DESC(mmap_valid, "Support OSS mmap.");
67 67
68static struct pci_device_id snd_cs46xx_ids[] __devinitdata = { 68static struct pci_device_id snd_cs46xx_ids[] = {
69 { 0x1013, 0x6001, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CS4280 */ 69 { 0x1013, 0x6001, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CS4280 */
70 { 0x1013, 0x6003, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CS4612 */ 70 { 0x1013, 0x6003, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CS4612 */
71 { 0x1013, 0x6004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CS4615 */ 71 { 0x1013, 0x6004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CS4615 */
diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c
index 894545ea41fd..4851847180d2 100644
--- a/sound/pci/cs46xx/cs46xx_lib.c
+++ b/sound/pci/cs46xx/cs46xx_lib.c
@@ -2317,7 +2317,7 @@ static struct snd_kcontrol_new snd_cs46xx_front_dup_ctl = {
2317 2317
2318#ifdef CONFIG_SND_CS46XX_NEW_DSP 2318#ifdef CONFIG_SND_CS46XX_NEW_DSP
2319/* Only available on the Hercules Game Theater XP soundcard */ 2319/* Only available on the Hercules Game Theater XP soundcard */
2320static struct snd_kcontrol_new snd_hercules_controls[] __devinitdata = { 2320static struct snd_kcontrol_new snd_hercules_controls[] = {
2321{ 2321{
2322 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2322 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2323 .name = "Optical/Coaxial SPDIF Input Switch", 2323 .name = "Optical/Coaxial SPDIF Input Switch",
@@ -3458,6 +3458,9 @@ static void hercules_mixer_init (struct snd_cs46xx *chip)
3458 snd_printdd ("initializing Hercules mixer\n"); 3458 snd_printdd ("initializing Hercules mixer\n");
3459 3459
3460#ifdef CONFIG_SND_CS46XX_NEW_DSP 3460#ifdef CONFIG_SND_CS46XX_NEW_DSP
3461 if (chip->in_suspend)
3462 return;
3463
3461 for (idx = 0 ; idx < ARRAY_SIZE(snd_hercules_controls); idx++) { 3464 for (idx = 0 ; idx < ARRAY_SIZE(snd_hercules_controls); idx++) {
3462 struct snd_kcontrol *kctl; 3465 struct snd_kcontrol *kctl;
3463 3466
@@ -3669,6 +3672,7 @@ int snd_cs46xx_suspend(struct pci_dev *pci, pm_message_t state)
3669 int amp_saved; 3672 int amp_saved;
3670 3673
3671 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); 3674 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
3675 chip->in_suspend = 1;
3672 snd_pcm_suspend_all(chip->pcm); 3676 snd_pcm_suspend_all(chip->pcm);
3673 // chip->ac97_powerdown = snd_cs46xx_codec_read(chip, AC97_POWER_CONTROL); 3677 // chip->ac97_powerdown = snd_cs46xx_codec_read(chip, AC97_POWER_CONTROL);
3674 // chip->ac97_general_purpose = snd_cs46xx_codec_read(chip, BA0_AC97_GENERAL_PURPOSE); 3678 // chip->ac97_general_purpose = snd_cs46xx_codec_read(chip, BA0_AC97_GENERAL_PURPOSE);
@@ -3722,6 +3726,7 @@ int snd_cs46xx_resume(struct pci_dev *pci)
3722 else 3726 else
3723 chip->active_ctrl(chip, -1); /* disable CLKRUN */ 3727 chip->active_ctrl(chip, -1); /* disable CLKRUN */
3724 chip->amplifier = amp_saved; 3728 chip->amplifier = amp_saved;
3729 chip->in_suspend = 0;
3725 snd_power_change_state(card, SNDRV_CTL_POWER_D0); 3730 snd_power_change_state(card, SNDRV_CTL_POWER_D0);
3726 return 0; 3731 return 0;
3727} 3732}
diff --git a/sound/pci/cs5535audio/cs5535audio.c b/sound/pci/cs5535audio/cs5535audio.c
index c12b24c679f2..64c7826e8b8c 100644
--- a/sound/pci/cs5535audio/cs5535audio.c
+++ b/sound/pci/cs5535audio/cs5535audio.c
@@ -67,7 +67,7 @@ MODULE_PARM_DESC(id, "ID string for " DRIVER_NAME);
67module_param_array(enable, bool, NULL, 0444); 67module_param_array(enable, bool, NULL, 0444);
68MODULE_PARM_DESC(enable, "Enable " DRIVER_NAME); 68MODULE_PARM_DESC(enable, "Enable " DRIVER_NAME);
69 69
70static struct pci_device_id snd_cs5535audio_ids[] __devinitdata = { 70static struct pci_device_id snd_cs5535audio_ids[] = {
71 { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_CS5535_AUDIO) }, 71 { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_CS5535_AUDIO) },
72 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CS5536_AUDIO) }, 72 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CS5536_AUDIO) },
73 {} 73 {}
diff --git a/sound/pci/emu10k1/emu10k1.c b/sound/pci/emu10k1/emu10k1.c
index 549673ea14a9..289bcd99c19c 100644
--- a/sound/pci/emu10k1/emu10k1.c
+++ b/sound/pci/emu10k1/emu10k1.c
@@ -77,7 +77,7 @@ MODULE_PARM_DESC(subsystem, "Force card subsystem model.");
77/* 77/*
78 * Class 0401: 1102:0008 (rev 00) Subsystem: 1102:1001 -> Audigy2 Value Model:SB0400 78 * Class 0401: 1102:0008 (rev 00) Subsystem: 1102:1001 -> Audigy2 Value Model:SB0400
79 */ 79 */
80static struct pci_device_id snd_emu10k1_ids[] __devinitdata = { 80static struct pci_device_id snd_emu10k1_ids[] = {
81 { 0x1102, 0x0002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* EMU10K1 */ 81 { 0x1102, 0x0002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* EMU10K1 */
82 { 0x1102, 0x0004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 }, /* Audigy */ 82 { 0x1102, 0x0004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 }, /* Audigy */
83 { 0x1102, 0x0008, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 }, /* Audigy 2 Value SB0400 */ 83 { 0x1102, 0x0008, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 }, /* Audigy 2 Value SB0400 */
diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c
index d6f135fe2958..f9b5c3dc3b34 100644
--- a/sound/pci/emu10k1/emu10k1_main.c
+++ b/sound/pci/emu10k1/emu10k1_main.c
@@ -531,7 +531,7 @@ static void snd_emu10k1_ecard_setadcgain(struct snd_emu10k1 * emu,
531 snd_emu10k1_ecard_write(emu, emu->ecard_ctrl); 531 snd_emu10k1_ecard_write(emu, emu->ecard_ctrl);
532} 532}
533 533
534static int __devinit snd_emu10k1_ecard_init(struct snd_emu10k1 * emu) 534static int snd_emu10k1_ecard_init(struct snd_emu10k1 * emu)
535{ 535{
536 unsigned int hc_value; 536 unsigned int hc_value;
537 537
@@ -571,7 +571,7 @@ static int __devinit snd_emu10k1_ecard_init(struct snd_emu10k1 * emu)
571 return 0; 571 return 0;
572} 572}
573 573
574static int __devinit snd_emu10k1_cardbus_init(struct snd_emu10k1 * emu) 574static int snd_emu10k1_cardbus_init(struct snd_emu10k1 * emu)
575{ 575{
576 unsigned long special_port; 576 unsigned long special_port;
577 unsigned int value; 577 unsigned int value;
@@ -633,7 +633,7 @@ static int snd_emu1212m_fpga_netlist_write(struct snd_emu10k1 * emu, int reg, in
633 return 0; 633 return 0;
634} 634}
635 635
636static int __devinit snd_emu10k1_emu1212m_init(struct snd_emu10k1 * emu) 636static int snd_emu10k1_emu1212m_init(struct snd_emu10k1 * emu)
637{ 637{
638 unsigned int i; 638 unsigned int i;
639 int tmp; 639 int tmp;
@@ -1430,6 +1430,10 @@ void snd_emu10k1_resume_init(struct snd_emu10k1 *emu)
1430{ 1430{
1431 if (emu->card_capabilities->ecard) 1431 if (emu->card_capabilities->ecard)
1432 snd_emu10k1_ecard_init(emu); 1432 snd_emu10k1_ecard_init(emu);
1433 else if (emu->card_capabilities->ca_cardbus_chip)
1434 snd_emu10k1_cardbus_init(emu);
1435 else if (emu->card_capabilities->emu1212m)
1436 snd_emu10k1_emu1212m_init(emu);
1433 else 1437 else
1434 snd_emu10k1_ptr_write(emu, AC97SLOT, 0, AC97SLOT_CNTR|AC97SLOT_LFE); 1438 snd_emu10k1_ptr_write(emu, AC97SLOT, 0, AC97SLOT_CNTR|AC97SLOT_LFE);
1435 snd_emu10k1_init(emu, emu->enable_ir, 1); 1439 snd_emu10k1_init(emu, emu->enable_ir, 1);
diff --git a/sound/pci/emu10k1/emu10k1x.c b/sound/pci/emu10k1/emu10k1x.c
index 2167279429b8..bda8bdf59935 100644
--- a/sound/pci/emu10k1/emu10k1x.c
+++ b/sound/pci/emu10k1/emu10k1x.c
@@ -1286,7 +1286,7 @@ static void snd_emu10k1x_midi_interrupt(struct emu10k1x *emu, unsigned int statu
1286 do_emu10k1x_midi_interrupt(emu, &emu->midi, status); 1286 do_emu10k1x_midi_interrupt(emu, &emu->midi, status);
1287} 1287}
1288 1288
1289static void snd_emu10k1x_midi_cmd(struct emu10k1x * emu, 1289static int snd_emu10k1x_midi_cmd(struct emu10k1x * emu,
1290 struct emu10k1x_midi *midi, unsigned char cmd, int ack) 1290 struct emu10k1x_midi *midi, unsigned char cmd, int ack)
1291{ 1291{
1292 unsigned long flags; 1292 unsigned long flags;
@@ -1312,11 +1312,14 @@ static void snd_emu10k1x_midi_cmd(struct emu10k1x * emu,
1312 ok = 1; 1312 ok = 1;
1313 } 1313 }
1314 spin_unlock_irqrestore(&midi->input_lock, flags); 1314 spin_unlock_irqrestore(&midi->input_lock, flags);
1315 if (!ok) 1315 if (!ok) {
1316 snd_printk(KERN_ERR "midi_cmd: 0x%x failed at 0x%lx (status = 0x%x, data = 0x%x)!!!\n", 1316 snd_printk(KERN_ERR "midi_cmd: 0x%x failed at 0x%lx (status = 0x%x, data = 0x%x)!!!\n",
1317 cmd, emu->port, 1317 cmd, emu->port,
1318 mpu401_read_stat(emu, midi), 1318 mpu401_read_stat(emu, midi),
1319 mpu401_read_data(emu, midi)); 1319 mpu401_read_data(emu, midi));
1320 return 1;
1321 }
1322 return 0;
1320} 1323}
1321 1324
1322static int snd_emu10k1x_midi_input_open(struct snd_rawmidi_substream *substream) 1325static int snd_emu10k1x_midi_input_open(struct snd_rawmidi_substream *substream)
@@ -1332,12 +1335,17 @@ static int snd_emu10k1x_midi_input_open(struct snd_rawmidi_substream *substream)
1332 midi->substream_input = substream; 1335 midi->substream_input = substream;
1333 if (!(midi->midi_mode & EMU10K1X_MIDI_MODE_OUTPUT)) { 1336 if (!(midi->midi_mode & EMU10K1X_MIDI_MODE_OUTPUT)) {
1334 spin_unlock_irqrestore(&midi->open_lock, flags); 1337 spin_unlock_irqrestore(&midi->open_lock, flags);
1335 snd_emu10k1x_midi_cmd(emu, midi, MPU401_RESET, 1); 1338 if (snd_emu10k1x_midi_cmd(emu, midi, MPU401_RESET, 1))
1336 snd_emu10k1x_midi_cmd(emu, midi, MPU401_ENTER_UART, 1); 1339 goto error_out;
1340 if (snd_emu10k1x_midi_cmd(emu, midi, MPU401_ENTER_UART, 1))
1341 goto error_out;
1337 } else { 1342 } else {
1338 spin_unlock_irqrestore(&midi->open_lock, flags); 1343 spin_unlock_irqrestore(&midi->open_lock, flags);
1339 } 1344 }
1340 return 0; 1345 return 0;
1346
1347error_out:
1348 return -EIO;
1341} 1349}
1342 1350
1343static int snd_emu10k1x_midi_output_open(struct snd_rawmidi_substream *substream) 1351static int snd_emu10k1x_midi_output_open(struct snd_rawmidi_substream *substream)
@@ -1353,12 +1361,17 @@ static int snd_emu10k1x_midi_output_open(struct snd_rawmidi_substream *substream
1353 midi->substream_output = substream; 1361 midi->substream_output = substream;
1354 if (!(midi->midi_mode & EMU10K1X_MIDI_MODE_INPUT)) { 1362 if (!(midi->midi_mode & EMU10K1X_MIDI_MODE_INPUT)) {
1355 spin_unlock_irqrestore(&midi->open_lock, flags); 1363 spin_unlock_irqrestore(&midi->open_lock, flags);
1356 snd_emu10k1x_midi_cmd(emu, midi, MPU401_RESET, 1); 1364 if (snd_emu10k1x_midi_cmd(emu, midi, MPU401_RESET, 1))
1357 snd_emu10k1x_midi_cmd(emu, midi, MPU401_ENTER_UART, 1); 1365 goto error_out;
1366 if (snd_emu10k1x_midi_cmd(emu, midi, MPU401_ENTER_UART, 1))
1367 goto error_out;
1358 } else { 1368 } else {
1359 spin_unlock_irqrestore(&midi->open_lock, flags); 1369 spin_unlock_irqrestore(&midi->open_lock, flags);
1360 } 1370 }
1361 return 0; 1371 return 0;
1372
1373error_out:
1374 return -EIO;
1362} 1375}
1363 1376
1364static int snd_emu10k1x_midi_input_close(struct snd_rawmidi_substream *substream) 1377static int snd_emu10k1x_midi_input_close(struct snd_rawmidi_substream *substream)
@@ -1366,6 +1379,7 @@ static int snd_emu10k1x_midi_input_close(struct snd_rawmidi_substream *substream
1366 struct emu10k1x *emu; 1379 struct emu10k1x *emu;
1367 struct emu10k1x_midi *midi = substream->rmidi->private_data; 1380 struct emu10k1x_midi *midi = substream->rmidi->private_data;
1368 unsigned long flags; 1381 unsigned long flags;
1382 int err = 0;
1369 1383
1370 emu = midi->emu; 1384 emu = midi->emu;
1371 snd_assert(emu, return -ENXIO); 1385 snd_assert(emu, return -ENXIO);
@@ -1375,11 +1389,11 @@ static int snd_emu10k1x_midi_input_close(struct snd_rawmidi_substream *substream
1375 midi->substream_input = NULL; 1389 midi->substream_input = NULL;
1376 if (!(midi->midi_mode & EMU10K1X_MIDI_MODE_OUTPUT)) { 1390 if (!(midi->midi_mode & EMU10K1X_MIDI_MODE_OUTPUT)) {
1377 spin_unlock_irqrestore(&midi->open_lock, flags); 1391 spin_unlock_irqrestore(&midi->open_lock, flags);
1378 snd_emu10k1x_midi_cmd(emu, midi, MPU401_RESET, 0); 1392 err = snd_emu10k1x_midi_cmd(emu, midi, MPU401_RESET, 0);
1379 } else { 1393 } else {
1380 spin_unlock_irqrestore(&midi->open_lock, flags); 1394 spin_unlock_irqrestore(&midi->open_lock, flags);
1381 } 1395 }
1382 return 0; 1396 return err;
1383} 1397}
1384 1398
1385static int snd_emu10k1x_midi_output_close(struct snd_rawmidi_substream *substream) 1399static int snd_emu10k1x_midi_output_close(struct snd_rawmidi_substream *substream)
@@ -1387,6 +1401,7 @@ static int snd_emu10k1x_midi_output_close(struct snd_rawmidi_substream *substrea
1387 struct emu10k1x *emu; 1401 struct emu10k1x *emu;
1388 struct emu10k1x_midi *midi = substream->rmidi->private_data; 1402 struct emu10k1x_midi *midi = substream->rmidi->private_data;
1389 unsigned long flags; 1403 unsigned long flags;
1404 int err = 0;
1390 1405
1391 emu = midi->emu; 1406 emu = midi->emu;
1392 snd_assert(emu, return -ENXIO); 1407 snd_assert(emu, return -ENXIO);
@@ -1396,11 +1411,11 @@ static int snd_emu10k1x_midi_output_close(struct snd_rawmidi_substream *substrea
1396 midi->substream_output = NULL; 1411 midi->substream_output = NULL;
1397 if (!(midi->midi_mode & EMU10K1X_MIDI_MODE_INPUT)) { 1412 if (!(midi->midi_mode & EMU10K1X_MIDI_MODE_INPUT)) {
1398 spin_unlock_irqrestore(&midi->open_lock, flags); 1413 spin_unlock_irqrestore(&midi->open_lock, flags);
1399 snd_emu10k1x_midi_cmd(emu, midi, MPU401_RESET, 0); 1414 err = snd_emu10k1x_midi_cmd(emu, midi, MPU401_RESET, 0);
1400 } else { 1415 } else {
1401 spin_unlock_irqrestore(&midi->open_lock, flags); 1416 spin_unlock_irqrestore(&midi->open_lock, flags);
1402 } 1417 }
1403 return 0; 1418 return err;
1404} 1419}
1405 1420
1406static void snd_emu10k1x_midi_input_trigger(struct snd_rawmidi_substream *substream, int up) 1421static void snd_emu10k1x_midi_input_trigger(struct snd_rawmidi_substream *substream, int up)
@@ -1594,7 +1609,7 @@ static void __devexit snd_emu10k1x_remove(struct pci_dev *pci)
1594} 1609}
1595 1610
1596// PCI IDs 1611// PCI IDs
1597static struct pci_device_id snd_emu10k1x_ids[] __devinitdata = { 1612static struct pci_device_id snd_emu10k1x_ids[] = {
1598 { 0x1102, 0x0006, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* Dell OEM version (EMU10K1) */ 1613 { 0x1102, 0x0006, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* Dell OEM version (EMU10K1) */
1599 { 0, } 1614 { 0, }
1600}; 1615};
diff --git a/sound/pci/emu10k1/emumpu401.c b/sound/pci/emu10k1/emumpu401.c
index d96eb455103f..950c6bcd6b7d 100644
--- a/sound/pci/emu10k1/emumpu401.c
+++ b/sound/pci/emu10k1/emumpu401.c
@@ -116,7 +116,7 @@ static void snd_emu10k1_midi_interrupt2(struct snd_emu10k1 *emu, unsigned int st
116 do_emu10k1_midi_interrupt(emu, &emu->midi2, status); 116 do_emu10k1_midi_interrupt(emu, &emu->midi2, status);
117} 117}
118 118
119static void snd_emu10k1_midi_cmd(struct snd_emu10k1 * emu, struct snd_emu10k1_midi *midi, unsigned char cmd, int ack) 119static int snd_emu10k1_midi_cmd(struct snd_emu10k1 * emu, struct snd_emu10k1_midi *midi, unsigned char cmd, int ack)
120{ 120{
121 unsigned long flags; 121 unsigned long flags;
122 int timeout, ok; 122 int timeout, ok;
@@ -141,11 +141,14 @@ static void snd_emu10k1_midi_cmd(struct snd_emu10k1 * emu, struct snd_emu10k1_mi
141 ok = 1; 141 ok = 1;
142 } 142 }
143 spin_unlock_irqrestore(&midi->input_lock, flags); 143 spin_unlock_irqrestore(&midi->input_lock, flags);
144 if (!ok) 144 if (!ok) {
145 snd_printk(KERN_ERR "midi_cmd: 0x%x failed at 0x%lx (status = 0x%x, data = 0x%x)!!!\n", 145 snd_printk(KERN_ERR "midi_cmd: 0x%x failed at 0x%lx (status = 0x%x, data = 0x%x)!!!\n",
146 cmd, emu->port, 146 cmd, emu->port,
147 mpu401_read_stat(emu, midi), 147 mpu401_read_stat(emu, midi),
148 mpu401_read_data(emu, midi)); 148 mpu401_read_data(emu, midi));
149 return 1;
150 }
151 return 0;
149} 152}
150 153
151static int snd_emu10k1_midi_input_open(struct snd_rawmidi_substream *substream) 154static int snd_emu10k1_midi_input_open(struct snd_rawmidi_substream *substream)
@@ -161,12 +164,17 @@ static int snd_emu10k1_midi_input_open(struct snd_rawmidi_substream *substream)
161 midi->substream_input = substream; 164 midi->substream_input = substream;
162 if (!(midi->midi_mode & EMU10K1_MIDI_MODE_OUTPUT)) { 165 if (!(midi->midi_mode & EMU10K1_MIDI_MODE_OUTPUT)) {
163 spin_unlock_irqrestore(&midi->open_lock, flags); 166 spin_unlock_irqrestore(&midi->open_lock, flags);
164 snd_emu10k1_midi_cmd(emu, midi, MPU401_RESET, 1); 167 if (snd_emu10k1_midi_cmd(emu, midi, MPU401_RESET, 1))
165 snd_emu10k1_midi_cmd(emu, midi, MPU401_ENTER_UART, 1); 168 goto error_out;
169 if (snd_emu10k1_midi_cmd(emu, midi, MPU401_ENTER_UART, 1))
170 goto error_out;
166 } else { 171 } else {
167 spin_unlock_irqrestore(&midi->open_lock, flags); 172 spin_unlock_irqrestore(&midi->open_lock, flags);
168 } 173 }
169 return 0; 174 return 0;
175
176error_out:
177 return -EIO;
170} 178}
171 179
172static int snd_emu10k1_midi_output_open(struct snd_rawmidi_substream *substream) 180static int snd_emu10k1_midi_output_open(struct snd_rawmidi_substream *substream)
@@ -182,12 +190,17 @@ static int snd_emu10k1_midi_output_open(struct snd_rawmidi_substream *substream)
182 midi->substream_output = substream; 190 midi->substream_output = substream;
183 if (!(midi->midi_mode & EMU10K1_MIDI_MODE_INPUT)) { 191 if (!(midi->midi_mode & EMU10K1_MIDI_MODE_INPUT)) {
184 spin_unlock_irqrestore(&midi->open_lock, flags); 192 spin_unlock_irqrestore(&midi->open_lock, flags);
185 snd_emu10k1_midi_cmd(emu, midi, MPU401_RESET, 1); 193 if (snd_emu10k1_midi_cmd(emu, midi, MPU401_RESET, 1))
186 snd_emu10k1_midi_cmd(emu, midi, MPU401_ENTER_UART, 1); 194 goto error_out;
195 if (snd_emu10k1_midi_cmd(emu, midi, MPU401_ENTER_UART, 1))
196 goto error_out;
187 } else { 197 } else {
188 spin_unlock_irqrestore(&midi->open_lock, flags); 198 spin_unlock_irqrestore(&midi->open_lock, flags);
189 } 199 }
190 return 0; 200 return 0;
201
202error_out:
203 return -EIO;
191} 204}
192 205
193static int snd_emu10k1_midi_input_close(struct snd_rawmidi_substream *substream) 206static int snd_emu10k1_midi_input_close(struct snd_rawmidi_substream *substream)
@@ -195,6 +208,7 @@ static int snd_emu10k1_midi_input_close(struct snd_rawmidi_substream *substream)
195 struct snd_emu10k1 *emu; 208 struct snd_emu10k1 *emu;
196 struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data; 209 struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data;
197 unsigned long flags; 210 unsigned long flags;
211 int err = 0;
198 212
199 emu = midi->emu; 213 emu = midi->emu;
200 snd_assert(emu, return -ENXIO); 214 snd_assert(emu, return -ENXIO);
@@ -204,11 +218,11 @@ static int snd_emu10k1_midi_input_close(struct snd_rawmidi_substream *substream)
204 midi->substream_input = NULL; 218 midi->substream_input = NULL;
205 if (!(midi->midi_mode & EMU10K1_MIDI_MODE_OUTPUT)) { 219 if (!(midi->midi_mode & EMU10K1_MIDI_MODE_OUTPUT)) {
206 spin_unlock_irqrestore(&midi->open_lock, flags); 220 spin_unlock_irqrestore(&midi->open_lock, flags);
207 snd_emu10k1_midi_cmd(emu, midi, MPU401_RESET, 0); 221 err = snd_emu10k1_midi_cmd(emu, midi, MPU401_RESET, 0);
208 } else { 222 } else {
209 spin_unlock_irqrestore(&midi->open_lock, flags); 223 spin_unlock_irqrestore(&midi->open_lock, flags);
210 } 224 }
211 return 0; 225 return err;
212} 226}
213 227
214static int snd_emu10k1_midi_output_close(struct snd_rawmidi_substream *substream) 228static int snd_emu10k1_midi_output_close(struct snd_rawmidi_substream *substream)
@@ -216,6 +230,7 @@ static int snd_emu10k1_midi_output_close(struct snd_rawmidi_substream *substream
216 struct snd_emu10k1 *emu; 230 struct snd_emu10k1 *emu;
217 struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data; 231 struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data;
218 unsigned long flags; 232 unsigned long flags;
233 int err = 0;
219 234
220 emu = midi->emu; 235 emu = midi->emu;
221 snd_assert(emu, return -ENXIO); 236 snd_assert(emu, return -ENXIO);
@@ -225,11 +240,11 @@ static int snd_emu10k1_midi_output_close(struct snd_rawmidi_substream *substream
225 midi->substream_output = NULL; 240 midi->substream_output = NULL;
226 if (!(midi->midi_mode & EMU10K1_MIDI_MODE_INPUT)) { 241 if (!(midi->midi_mode & EMU10K1_MIDI_MODE_INPUT)) {
227 spin_unlock_irqrestore(&midi->open_lock, flags); 242 spin_unlock_irqrestore(&midi->open_lock, flags);
228 snd_emu10k1_midi_cmd(emu, midi, MPU401_RESET, 0); 243 err = snd_emu10k1_midi_cmd(emu, midi, MPU401_RESET, 0);
229 } else { 244 } else {
230 spin_unlock_irqrestore(&midi->open_lock, flags); 245 spin_unlock_irqrestore(&midi->open_lock, flags);
231 } 246 }
232 return 0; 247 return err;
233} 248}
234 249
235static void snd_emu10k1_midi_input_trigger(struct snd_rawmidi_substream *substream, int up) 250static void snd_emu10k1_midi_input_trigger(struct snd_rawmidi_substream *substream, int up)
diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c
index 7a985c868007..a8a601fc781f 100644
--- a/sound/pci/ens1370.c
+++ b/sound/pci/ens1370.c
@@ -446,7 +446,7 @@ struct ensoniq {
446 446
447static irqreturn_t snd_audiopci_interrupt(int irq, void *dev_id, struct pt_regs *regs); 447static irqreturn_t snd_audiopci_interrupt(int irq, void *dev_id, struct pt_regs *regs);
448 448
449static struct pci_device_id snd_audiopci_ids[] __devinitdata = { 449static struct pci_device_id snd_audiopci_ids[] = {
450#ifdef CHIP1370 450#ifdef CHIP1370
451 { 0x1274, 0x5000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* ES1370 */ 451 { 0x1274, 0x5000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* ES1370 */
452#endif 452#endif
diff --git a/sound/pci/es1938.c b/sound/pci/es1938.c
index 1113b10259cf..cc0f34f68185 100644
--- a/sound/pci/es1938.c
+++ b/sound/pci/es1938.c
@@ -242,7 +242,7 @@ struct es1938 {
242 242
243static irqreturn_t snd_es1938_interrupt(int irq, void *dev_id, struct pt_regs *regs); 243static irqreturn_t snd_es1938_interrupt(int irq, void *dev_id, struct pt_regs *regs);
244 244
245static struct pci_device_id snd_es1938_ids[] __devinitdata = { 245static struct pci_device_id snd_es1938_ids[] = {
246 { 0x125d, 0x1969, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* Solo-1 */ 246 { 0x125d, 0x1969, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* Solo-1 */
247 { 0, } 247 { 0, }
248}; 248};
diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c
index a491c8f8a6a8..3c5ab7c2e72d 100644
--- a/sound/pci/es1968.c
+++ b/sound/pci/es1968.c
@@ -592,7 +592,7 @@ struct es1968 {
592 592
593static irqreturn_t snd_es1968_interrupt(int irq, void *dev_id, struct pt_regs *regs); 593static irqreturn_t snd_es1968_interrupt(int irq, void *dev_id, struct pt_regs *regs);
594 594
595static struct pci_device_id snd_es1968_ids[] __devinitdata = { 595static struct pci_device_id snd_es1968_ids[] = {
596 /* Maestro 1 */ 596 /* Maestro 1 */
597 { 0x1285, 0x0100, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, TYPE_MAESTRO }, 597 { 0x1285, 0x0100, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, TYPE_MAESTRO },
598 /* Maestro 2 */ 598 /* Maestro 2 */
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c
index 3aed27eace2c..13868c985126 100644
--- a/sound/pci/fm801.c
+++ b/sound/pci/fm801.c
@@ -35,7 +35,7 @@
35 35
36#include <asm/io.h> 36#include <asm/io.h>
37 37
38#if (defined(CONFIG_SND_FM801_TEA575X) || defined(CONFIG_SND_FM801_TEA575X_MODULE)) && (defined(CONFIG_VIDEO_DEV) || defined(CONFIG_VIDEO_DEV_MODULE)) 38#ifdef CONFIG_SND_FM801_TEA575X_BOOL
39#include <sound/tea575x-tuner.h> 39#include <sound/tea575x-tuner.h>
40#define TEA575X_RADIO 1 40#define TEA575X_RADIO 1
41#endif 41#endif
@@ -199,7 +199,7 @@ struct fm801 {
199#endif 199#endif
200}; 200};
201 201
202static struct pci_device_id snd_fm801_ids[] __devinitdata = { 202static struct pci_device_id snd_fm801_ids[] = {
203 { 0x1319, 0x0801, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0, }, /* FM801 */ 203 { 0x1319, 0x0801, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0, }, /* FM801 */
204 { 0x5213, 0x0510, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0, }, /* Gallant Odyssey Sound 4 */ 204 { 0x5213, 0x0510, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0, }, /* Gallant Odyssey Sound 4 */
205 { 0, } 205 { 0, }
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 025af7c0c6e1..79d63c99f092 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -1629,7 +1629,7 @@ static void __devexit azx_remove(struct pci_dev *pci)
1629} 1629}
1630 1630
1631/* PCI IDs */ 1631/* PCI IDs */
1632static struct pci_device_id azx_ids[] __devinitdata = { 1632static struct pci_device_id azx_ids[] = {
1633 { 0x8086, 0x2668, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ICH6 */ 1633 { 0x8086, 0x2668, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ICH6 */
1634 { 0x8086, 0x27d8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ICH7 */ 1634 { 0x8086, 0x27d8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ICH7 */
1635 { 0x8086, 0x269a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ESB2 */ 1635 { 0x8086, 0x269a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ESB2 */
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index 33b7d5806469..6823f2bc10b3 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -1545,6 +1545,9 @@ enum {
1545/* reivision id to check workarounds */ 1545/* reivision id to check workarounds */
1546#define AD1988A_REV2 0x100200 1546#define AD1988A_REV2 0x100200
1547 1547
1548#define is_rev2(codec) \
1549 ((codec)->vendor_id == 0x11d41988 && \
1550 (codec)->revision_id == AD1988A_REV2)
1548 1551
1549/* 1552/*
1550 * mixers 1553 * mixers
@@ -1636,6 +1639,7 @@ static struct snd_kcontrol_new ad1988_6stack_mixers1[] = {
1636 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x05, 1, 0x0, HDA_OUTPUT), 1639 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x05, 1, 0x0, HDA_OUTPUT),
1637 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x05, 2, 0x0, HDA_OUTPUT), 1640 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x05, 2, 0x0, HDA_OUTPUT),
1638 HDA_CODEC_VOLUME("Side Playback Volume", 0x0a, 0x0, HDA_OUTPUT), 1641 HDA_CODEC_VOLUME("Side Playback Volume", 0x0a, 0x0, HDA_OUTPUT),
1642 { } /* end */
1639}; 1643};
1640 1644
1641static struct snd_kcontrol_new ad1988_6stack_mixers1_rev2[] = { 1645static struct snd_kcontrol_new ad1988_6stack_mixers1_rev2[] = {
@@ -1644,6 +1648,7 @@ static struct snd_kcontrol_new ad1988_6stack_mixers1_rev2[] = {
1644 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0a, 1, 0x0, HDA_OUTPUT), 1648 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0a, 1, 0x0, HDA_OUTPUT),
1645 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0a, 2, 0x0, HDA_OUTPUT), 1649 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0a, 2, 0x0, HDA_OUTPUT),
1646 HDA_CODEC_VOLUME("Side Playback Volume", 0x06, 0x0, HDA_OUTPUT), 1650 HDA_CODEC_VOLUME("Side Playback Volume", 0x06, 0x0, HDA_OUTPUT),
1651 { } /* end */
1647}; 1652};
1648 1653
1649static struct snd_kcontrol_new ad1988_6stack_mixers2[] = { 1654static struct snd_kcontrol_new ad1988_6stack_mixers2[] = {
@@ -1682,6 +1687,7 @@ static struct snd_kcontrol_new ad1988_3stack_mixers1[] = {
1682 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0a, 0x0, HDA_OUTPUT), 1687 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0a, 0x0, HDA_OUTPUT),
1683 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x05, 1, 0x0, HDA_OUTPUT), 1688 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x05, 1, 0x0, HDA_OUTPUT),
1684 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x05, 2, 0x0, HDA_OUTPUT), 1689 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x05, 2, 0x0, HDA_OUTPUT),
1690 { } /* end */
1685}; 1691};
1686 1692
1687static struct snd_kcontrol_new ad1988_3stack_mixers1_rev2[] = { 1693static struct snd_kcontrol_new ad1988_3stack_mixers1_rev2[] = {
@@ -1689,6 +1695,7 @@ static struct snd_kcontrol_new ad1988_3stack_mixers1_rev2[] = {
1689 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0a, 0x0, HDA_OUTPUT), 1695 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0a, 0x0, HDA_OUTPUT),
1690 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x06, 1, 0x0, HDA_OUTPUT), 1696 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x06, 1, 0x0, HDA_OUTPUT),
1691 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x06, 2, 0x0, HDA_OUTPUT), 1697 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x06, 2, 0x0, HDA_OUTPUT),
1698 { } /* end */
1692}; 1699};
1693 1700
1694static struct snd_kcontrol_new ad1988_3stack_mixers2[] = { 1701static struct snd_kcontrol_new ad1988_3stack_mixers2[] = {
@@ -2195,7 +2202,7 @@ static inline hda_nid_t ad1988_idx_to_dac(struct hda_codec *codec, int idx)
2195 /* A B C D E F G H */ 2202 /* A B C D E F G H */
2196 0x04, 0x05, 0x0a, 0x04, 0x06, 0x05, 0x0a, 0x06 2203 0x04, 0x05, 0x0a, 0x04, 0x06, 0x05, 0x0a, 0x06
2197 }; 2204 };
2198 if (codec->revision_id == AD1988A_REV2) 2205 if (is_rev2(codec))
2199 return idx_to_dac_rev2[idx]; 2206 return idx_to_dac_rev2[idx];
2200 else 2207 else
2201 return idx_to_dac[idx]; 2208 return idx_to_dac[idx];
@@ -2564,7 +2571,7 @@ static int patch_ad1988(struct hda_codec *codec)
2564 mutex_init(&spec->amp_mutex); 2571 mutex_init(&spec->amp_mutex);
2565 codec->spec = spec; 2572 codec->spec = spec;
2566 2573
2567 if (codec->revision_id == AD1988A_REV2) 2574 if (is_rev2(codec))
2568 snd_printk(KERN_INFO "patch_analog: AD1988A rev.2 is detected, enable workarounds\n"); 2575 snd_printk(KERN_INFO "patch_analog: AD1988A rev.2 is detected, enable workarounds\n");
2569 2576
2570 board_config = snd_hda_check_board_config(codec, ad1988_cfg_tbl); 2577 board_config = snd_hda_check_board_config(codec, ad1988_cfg_tbl);
@@ -2590,13 +2597,13 @@ static int patch_ad1988(struct hda_codec *codec)
2590 case AD1988_6STACK_DIG: 2597 case AD1988_6STACK_DIG:
2591 spec->multiout.max_channels = 8; 2598 spec->multiout.max_channels = 8;
2592 spec->multiout.num_dacs = 4; 2599 spec->multiout.num_dacs = 4;
2593 if (codec->revision_id == AD1988A_REV2) 2600 if (is_rev2(codec))
2594 spec->multiout.dac_nids = ad1988_6stack_dac_nids_rev2; 2601 spec->multiout.dac_nids = ad1988_6stack_dac_nids_rev2;
2595 else 2602 else
2596 spec->multiout.dac_nids = ad1988_6stack_dac_nids; 2603 spec->multiout.dac_nids = ad1988_6stack_dac_nids;
2597 spec->input_mux = &ad1988_6stack_capture_source; 2604 spec->input_mux = &ad1988_6stack_capture_source;
2598 spec->num_mixers = 2; 2605 spec->num_mixers = 2;
2599 if (codec->revision_id == AD1988A_REV2) 2606 if (is_rev2(codec))
2600 spec->mixers[0] = ad1988_6stack_mixers1_rev2; 2607 spec->mixers[0] = ad1988_6stack_mixers1_rev2;
2601 else 2608 else
2602 spec->mixers[0] = ad1988_6stack_mixers1; 2609 spec->mixers[0] = ad1988_6stack_mixers1;
@@ -2612,7 +2619,7 @@ static int patch_ad1988(struct hda_codec *codec)
2612 case AD1988_3STACK_DIG: 2619 case AD1988_3STACK_DIG:
2613 spec->multiout.max_channels = 6; 2620 spec->multiout.max_channels = 6;
2614 spec->multiout.num_dacs = 3; 2621 spec->multiout.num_dacs = 3;
2615 if (codec->revision_id == AD1988A_REV2) 2622 if (is_rev2(codec))
2616 spec->multiout.dac_nids = ad1988_3stack_dac_nids_rev2; 2623 spec->multiout.dac_nids = ad1988_3stack_dac_nids_rev2;
2617 else 2624 else
2618 spec->multiout.dac_nids = ad1988_3stack_dac_nids; 2625 spec->multiout.dac_nids = ad1988_3stack_dac_nids;
@@ -2620,7 +2627,7 @@ static int patch_ad1988(struct hda_codec *codec)
2620 spec->channel_mode = ad1988_3stack_modes; 2627 spec->channel_mode = ad1988_3stack_modes;
2621 spec->num_channel_mode = ARRAY_SIZE(ad1988_3stack_modes); 2628 spec->num_channel_mode = ARRAY_SIZE(ad1988_3stack_modes);
2622 spec->num_mixers = 2; 2629 spec->num_mixers = 2;
2623 if (codec->revision_id == AD1988A_REV2) 2630 if (is_rev2(codec))
2624 spec->mixers[0] = ad1988_3stack_mixers1_rev2; 2631 spec->mixers[0] = ad1988_3stack_mixers1_rev2;
2625 else 2632 else
2626 spec->mixers[0] = ad1988_3stack_mixers1; 2633 spec->mixers[0] = ad1988_3stack_mixers1;
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index fb4bed0759d1..ea99083a1024 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -351,6 +351,7 @@ static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = {
351 [STAC_REF] = ref922x_pin_configs, 351 [STAC_REF] = ref922x_pin_configs,
352 [STAC_D945GTP3] = d945gtp3_pin_configs, 352 [STAC_D945GTP3] = d945gtp3_pin_configs,
353 [STAC_D945GTP5] = d945gtp5_pin_configs, 353 [STAC_D945GTP5] = d945gtp5_pin_configs,
354 [STAC_MACMINI] = d945gtp5_pin_configs,
354 [STAC_D965_2112] = d965_2112_pin_configs, 355 [STAC_D965_2112] = d965_2112_pin_configs,
355}; 356};
356 357
diff --git a/sound/pci/ice1712/aureon.c b/sound/pci/ice1712/aureon.c
index ca74f5b85f42..9492f3d2455b 100644
--- a/sound/pci/ice1712/aureon.c
+++ b/sound/pci/ice1712/aureon.c
@@ -2131,7 +2131,7 @@ struct snd_ice1712_card_info snd_vt1724_aureon_cards[] __devinitdata = {
2131 .build_controls = aureon_add_controls, 2131 .build_controls = aureon_add_controls,
2132 .eeprom_size = sizeof(aureon71_eeprom), 2132 .eeprom_size = sizeof(aureon71_eeprom),
2133 .eeprom_data = aureon71_eeprom, 2133 .eeprom_data = aureon71_eeprom,
2134 .driver = "Aureon71Universe", 2134 .driver = "Aureon71Univ", /* keep in 15 letters */
2135 }, 2135 },
2136 { 2136 {
2137 .subvendor = VT1724_SUBDEVICE_PRODIGY71, 2137 .subvendor = VT1724_SUBDEVICE_PRODIGY71,
diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c
index 89a06dec4365..bf20858d9f19 100644
--- a/sound/pci/ice1712/ice1712.c
+++ b/sound/pci/ice1712/ice1712.c
@@ -106,7 +106,7 @@ module_param_array(dxr_enable, int, NULL, 0444);
106MODULE_PARM_DESC(dxr_enable, "Enable DXR support for Terratec DMX6FIRE."); 106MODULE_PARM_DESC(dxr_enable, "Enable DXR support for Terratec DMX6FIRE.");
107 107
108 108
109static struct pci_device_id snd_ice1712_ids[] __devinitdata = { 109static struct pci_device_id snd_ice1712_ids[] = {
110 { PCI_VENDOR_ID_ICE, PCI_DEVICE_ID_ICE_1712, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* ICE1712 */ 110 { PCI_VENDOR_ID_ICE, PCI_DEVICE_ID_ICE_1712, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* ICE1712 */
111 { 0, } 111 { 0, }
112}; 112};
diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c
index ad69ed7c1b81..71d6aedc0749 100644
--- a/sound/pci/ice1712/ice1724.c
+++ b/sound/pci/ice1712/ice1724.c
@@ -86,7 +86,7 @@ MODULE_PARM_DESC(model, "Use the given board model.");
86 86
87 87
88/* Both VT1720 and VT1724 have the same PCI IDs */ 88/* Both VT1720 and VT1724 have the same PCI IDs */
89static struct pci_device_id snd_vt1724_ids[] __devinitdata = { 89static struct pci_device_id snd_vt1724_ids[] = {
90 { PCI_VENDOR_ID_ICE, PCI_DEVICE_ID_VT1724, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 90 { PCI_VENDOR_ID_ICE, PCI_DEVICE_ID_VT1724, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
91 { 0, } 91 { 0, }
92}; 92};
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
index 5634bc349257..6874263f1681 100644
--- a/sound/pci/intel8x0.c
+++ b/sound/pci/intel8x0.c
@@ -413,7 +413,7 @@ struct intel8x0 {
413 u32 int_sta_mask; /* interrupt status mask */ 413 u32 int_sta_mask; /* interrupt status mask */
414}; 414};
415 415
416static struct pci_device_id snd_intel8x0_ids[] __devinitdata = { 416static struct pci_device_id snd_intel8x0_ids[] = {
417 { 0x8086, 0x2415, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82801AA */ 417 { 0x8086, 0x2415, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82801AA */
418 { 0x8086, 0x2425, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82901AB */ 418 { 0x8086, 0x2425, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82901AB */
419 { 0x8086, 0x2445, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82801BA */ 419 { 0x8086, 0x2445, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82801BA */
@@ -1956,6 +1956,12 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = {
1956 .type = AC97_TUNE_HP_ONLY 1956 .type = AC97_TUNE_HP_ONLY
1957 }, 1957 },
1958 { 1958 {
1959 .subvendor = 0x10f1,
1960 .subdevice = 0x2895,
1961 .name = "Tyan Thunder K8WE",
1962 .type = AC97_TUNE_HP_ONLY
1963 },
1964 {
1959 .subvendor = 0x110a, 1965 .subvendor = 0x110a,
1960 .subdevice = 0x0056, 1966 .subdevice = 0x0056,
1961 .name = "Fujitsu-Siemens Scenic", /* AD1981? */ 1967 .name = "Fujitsu-Siemens Scenic", /* AD1981? */
diff --git a/sound/pci/intel8x0m.c b/sound/pci/intel8x0m.c
index f28e273ae276..91850281f89b 100644
--- a/sound/pci/intel8x0m.c
+++ b/sound/pci/intel8x0m.c
@@ -224,7 +224,7 @@ struct intel8x0m {
224 unsigned int pcm_pos_shift; 224 unsigned int pcm_pos_shift;
225}; 225};
226 226
227static struct pci_device_id snd_intel8x0m_ids[] __devinitdata = { 227static struct pci_device_id snd_intel8x0m_ids[] = {
228 { 0x8086, 0x2416, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82801AA */ 228 { 0x8086, 0x2416, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82801AA */
229 { 0x8086, 0x2426, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82901AB */ 229 { 0x8086, 0x2426, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82901AB */
230 { 0x8086, 0x2446, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82801BA */ 230 { 0x8086, 0x2446, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82801BA */
diff --git a/sound/pci/korg1212/korg1212.c b/sound/pci/korg1212/korg1212.c
index 2b4ce002794a..cfea51f44784 100644
--- a/sound/pci/korg1212/korg1212.c
+++ b/sound/pci/korg1212/korg1212.c
@@ -424,7 +424,7 @@ module_param_array(enable, bool, NULL, 0444);
424MODULE_PARM_DESC(enable, "Enable Korg 1212 soundcard."); 424MODULE_PARM_DESC(enable, "Enable Korg 1212 soundcard.");
425MODULE_AUTHOR("Haroldo Gamal <gamal@alternex.com.br>"); 425MODULE_AUTHOR("Haroldo Gamal <gamal@alternex.com.br>");
426 426
427static struct pci_device_id snd_korg1212_ids[] __devinitdata = { 427static struct pci_device_id snd_korg1212_ids[] = {
428 { 428 {
429 .vendor = 0x10b5, 429 .vendor = 0x10b5,
430 .device = 0x906d, 430 .device = 0x906d,
diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c
index 828eab59253a..45214b3b81be 100644
--- a/sound/pci/maestro3.c
+++ b/sound/pci/maestro3.c
@@ -869,7 +869,7 @@ struct snd_m3 {
869/* 869/*
870 * pci ids 870 * pci ids
871 */ 871 */
872static struct pci_device_id snd_m3_ids[] __devinitdata = { 872static struct pci_device_id snd_m3_ids[] = {
873 {PCI_VENDOR_ID_ESS, PCI_DEVICE_ID_ESS_ALLEGRO_1, PCI_ANY_ID, PCI_ANY_ID, 873 {PCI_VENDOR_ID_ESS, PCI_DEVICE_ID_ESS_ALLEGRO_1, PCI_ANY_ID, PCI_ANY_ID,
874 PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0}, 874 PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0},
875 {PCI_VENDOR_ID_ESS, PCI_DEVICE_ID_ESS_ALLEGRO, PCI_ANY_ID, PCI_ANY_ID, 875 {PCI_VENDOR_ID_ESS, PCI_DEVICE_ID_ESS_ALLEGRO, PCI_ANY_ID, PCI_ANY_ID,
@@ -2137,7 +2137,7 @@ static int __devinit snd_m3_mixer(struct snd_m3 *chip)
2137 * DSP Code images 2137 * DSP Code images
2138 */ 2138 */
2139 2139
2140static const u16 assp_kernel_image[] __devinitdata = { 2140static const u16 assp_kernel_image[] = {
2141 0x7980, 0x0030, 0x7980, 0x03B4, 0x7980, 0x03B4, 0x7980, 0x00FB, 0x7980, 0x00DD, 0x7980, 0x03B4, 2141 0x7980, 0x0030, 0x7980, 0x03B4, 0x7980, 0x03B4, 0x7980, 0x00FB, 0x7980, 0x00DD, 0x7980, 0x03B4,
2142 0x7980, 0x0332, 0x7980, 0x0287, 0x7980, 0x03B4, 0x7980, 0x03B4, 0x7980, 0x03B4, 0x7980, 0x03B4, 2142 0x7980, 0x0332, 0x7980, 0x0287, 0x7980, 0x03B4, 0x7980, 0x03B4, 0x7980, 0x03B4, 0x7980, 0x03B4,
2143 0x7980, 0x031A, 0x7980, 0x03B4, 0x7980, 0x022F, 0x7980, 0x03B4, 0x7980, 0x03B4, 0x7980, 0x03B4, 2143 0x7980, 0x031A, 0x7980, 0x03B4, 0x7980, 0x022F, 0x7980, 0x03B4, 0x7980, 0x03B4, 0x7980, 0x03B4,
@@ -2224,7 +2224,7 @@ static const u16 assp_kernel_image[] __devinitdata = {
2224 * Mini sample rate converter code image 2224 * Mini sample rate converter code image
2225 * that is to be loaded at 0x400 on the DSP. 2225 * that is to be loaded at 0x400 on the DSP.
2226 */ 2226 */
2227static const u16 assp_minisrc_image[] __devinitdata = { 2227static const u16 assp_minisrc_image[] = {
2228 2228
2229 0xBF80, 0x101E, 0x906E, 0x006E, 0x8B88, 0x6980, 0xEF88, 0x906F, 0x0D6F, 0x6900, 0xEB08, 0x0412, 2229 0xBF80, 0x101E, 0x906E, 0x006E, 0x8B88, 0x6980, 0xEF88, 0x906F, 0x0D6F, 0x6900, 0xEB08, 0x0412,
2230 0xBC20, 0x696E, 0xB801, 0x906E, 0x7980, 0x0403, 0xB90E, 0x8807, 0xBE43, 0xBF01, 0xBE47, 0xBE41, 2230 0xBC20, 0x696E, 0xB801, 0x906E, 0x7980, 0x0403, 0xB90E, 0x8807, 0xBE43, 0xBF01, 0xBE47, 0xBE41,
@@ -2267,12 +2267,12 @@ static const u16 assp_minisrc_image[] __devinitdata = {
2267 */ 2267 */
2268 2268
2269#define MINISRC_LPF_LEN 10 2269#define MINISRC_LPF_LEN 10
2270static const u16 minisrc_lpf[MINISRC_LPF_LEN] __devinitdata = { 2270static const u16 minisrc_lpf[MINISRC_LPF_LEN] = {
2271 0X0743, 0X1104, 0X0A4C, 0XF88D, 0X242C, 2271 0X0743, 0X1104, 0X0A4C, 0XF88D, 0X242C,
2272 0X1023, 0X1AA9, 0X0B60, 0XEFDD, 0X186F 2272 0X1023, 0X1AA9, 0X0B60, 0XEFDD, 0X186F
2273}; 2273};
2274 2274
2275static void __devinit snd_m3_assp_init(struct snd_m3 *chip) 2275static void snd_m3_assp_init(struct snd_m3 *chip)
2276{ 2276{
2277 unsigned int i; 2277 unsigned int i;
2278 2278
diff --git a/sound/pci/mixart/mixart.c b/sound/pci/mixart/mixart.c
index a4aaa7b9a231..cc43ecd67906 100644
--- a/sound/pci/mixart/mixart.c
+++ b/sound/pci/mixart/mixart.c
@@ -61,7 +61,7 @@ MODULE_PARM_DESC(enable, "Enable Digigram " CARD_NAME " soundcard.");
61/* 61/*
62 */ 62 */
63 63
64static struct pci_device_id snd_mixart_ids[] __devinitdata = { 64static struct pci_device_id snd_mixart_ids[] = {
65 { 0x1057, 0x0003, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* MC8240 */ 65 { 0x1057, 0x0003, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* MC8240 */
66 { 0, } 66 { 0, }
67}; 67};
diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c
index 56d7282e6651..101eee0aa018 100644
--- a/sound/pci/nm256/nm256.c
+++ b/sound/pci/nm256/nm256.c
@@ -263,7 +263,7 @@ struct nm256 {
263/* 263/*
264 * PCI ids 264 * PCI ids
265 */ 265 */
266static struct pci_device_id snd_nm256_ids[] __devinitdata = { 266static struct pci_device_id snd_nm256_ids[] = {
267 {PCI_VENDOR_ID_NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256AV_AUDIO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 267 {PCI_VENDOR_ID_NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256AV_AUDIO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
268 {PCI_VENDOR_ID_NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 268 {PCI_VENDOR_ID_NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
269 {PCI_VENDOR_ID_NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256XL_PLUS_AUDIO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 269 {PCI_VENDOR_ID_NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256XL_PLUS_AUDIO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
diff --git a/sound/pci/pcxhr/pcxhr.c b/sound/pci/pcxhr/pcxhr.c
index ae980e11827f..533c672ae8f3 100644
--- a/sound/pci/pcxhr/pcxhr.c
+++ b/sound/pci/pcxhr/pcxhr.c
@@ -73,7 +73,7 @@ enum {
73 PCI_ID_LAST 73 PCI_ID_LAST
74}; 74};
75 75
76static struct pci_device_id pcxhr_ids[] __devinitdata = { 76static struct pci_device_id pcxhr_ids[] = {
77 { 0x10b5, 0x9656, 0x1369, 0xb001, 0, 0, PCI_ID_VX882HR, }, /* VX882HR */ 77 { 0x10b5, 0x9656, 0x1369, 0xb001, 0, 0, PCI_ID_VX882HR, }, /* VX882HR */
78 { 0x10b5, 0x9656, 0x1369, 0xb101, 0, 0, PCI_ID_PCX882HR, }, /* PCX882HR */ 78 { 0x10b5, 0x9656, 0x1369, 0xb101, 0, 0, PCI_ID_PCX882HR, }, /* PCX882HR */
79 { 0x10b5, 0x9656, 0x1369, 0xb201, 0, 0, PCI_ID_VX881HR, }, /* VX881HR */ 79 { 0x10b5, 0x9656, 0x1369, 0xb201, 0, 0, PCI_ID_VX881HR, }, /* VX881HR */
diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c
index 5501a08ca23a..f435fcd6dca9 100644
--- a/sound/pci/riptide/riptide.c
+++ b/sound/pci/riptide/riptide.c
@@ -506,7 +506,7 @@ static int riptide_reset(struct cmdif *cif, struct snd_riptide *chip);
506/* 506/*
507 */ 507 */
508 508
509static struct pci_device_id snd_riptide_ids[] __devinitdata = { 509static struct pci_device_id snd_riptide_ids[] = {
510 { 510 {
511 .vendor = 0x127a,.device = 0x4310, 511 .vendor = 0x127a,.device = 0x4310,
512 .subvendor = PCI_ANY_ID,.subdevice = PCI_ANY_ID, 512 .subvendor = PCI_ANY_ID,.subdevice = PCI_ANY_ID,
diff --git a/sound/pci/rme32.c b/sound/pci/rme32.c
index 2e24b68d07aa..2a71499242fa 100644
--- a/sound/pci/rme32.c
+++ b/sound/pci/rme32.c
@@ -227,7 +227,7 @@ struct rme32 {
227 struct snd_kcontrol *spdif_ctl; 227 struct snd_kcontrol *spdif_ctl;
228}; 228};
229 229
230static struct pci_device_id snd_rme32_ids[] __devinitdata = { 230static struct pci_device_id snd_rme32_ids[] = {
231 {PCI_VENDOR_ID_XILINX_RME, PCI_DEVICE_ID_RME_DIGI32, 231 {PCI_VENDOR_ID_XILINX_RME, PCI_DEVICE_ID_RME_DIGI32,
232 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,}, 232 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,},
233 {PCI_VENDOR_ID_XILINX_RME, PCI_DEVICE_ID_RME_DIGI32_8, 233 {PCI_VENDOR_ID_XILINX_RME, PCI_DEVICE_ID_RME_DIGI32_8,
diff --git a/sound/pci/rme96.c b/sound/pci/rme96.c
index fde0f3e20530..f8de7c997017 100644
--- a/sound/pci/rme96.c
+++ b/sound/pci/rme96.c
@@ -232,7 +232,7 @@ struct rme96 {
232 struct snd_kcontrol *spdif_ctl; 232 struct snd_kcontrol *spdif_ctl;
233}; 233};
234 234
235static struct pci_device_id snd_rme96_ids[] __devinitdata = { 235static struct pci_device_id snd_rme96_ids[] = {
236 { PCI_VENDOR_ID_XILINX, PCI_DEVICE_ID_RME_DIGI96, 236 { PCI_VENDOR_ID_XILINX, PCI_DEVICE_ID_RME_DIGI96,
237 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, 237 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },
238 { PCI_VENDOR_ID_XILINX, PCI_DEVICE_ID_RME_DIGI96_8, 238 { PCI_VENDOR_ID_XILINX, PCI_DEVICE_ID_RME_DIGI96_8,
diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c
index 99cf86244acb..e5a52da77b85 100644
--- a/sound/pci/rme9652/hdsp.c
+++ b/sound/pci/rme9652/hdsp.c
@@ -568,7 +568,7 @@ static void snd_hammerfall_free_buffer(struct snd_dma_buffer *dmab, struct pci_d
568} 568}
569 569
570 570
571static struct pci_device_id snd_hdsp_ids[] __devinitdata = { 571static struct pci_device_id snd_hdsp_ids[] = {
572 { 572 {
573 .vendor = PCI_VENDOR_ID_XILINX, 573 .vendor = PCI_VENDOR_ID_XILINX,
574 .device = PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP, 574 .device = PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP,
@@ -1356,7 +1356,7 @@ static struct snd_rawmidi_ops snd_hdsp_midi_input =
1356 .trigger = snd_hdsp_midi_input_trigger, 1356 .trigger = snd_hdsp_midi_input_trigger,
1357}; 1357};
1358 1358
1359static int __devinit snd_hdsp_create_midi (struct snd_card *card, struct hdsp *hdsp, int id) 1359static int snd_hdsp_create_midi (struct snd_card *card, struct hdsp *hdsp, int id)
1360{ 1360{
1361 char buf[32]; 1361 char buf[32];
1362 1362
diff --git a/sound/pci/rme9652/rme9652.c b/sound/pci/rme9652/rme9652.c
index 9534e1834138..fc15f61ad5d1 100644
--- a/sound/pci/rme9652/rme9652.c
+++ b/sound/pci/rme9652/rme9652.c
@@ -315,7 +315,7 @@ static void snd_hammerfall_free_buffer(struct snd_dma_buffer *dmab, struct pci_d
315} 315}
316 316
317 317
318static struct pci_device_id snd_rme9652_ids[] __devinitdata = { 318static struct pci_device_id snd_rme9652_ids[] = {
319 { 319 {
320 .vendor = 0x10ee, 320 .vendor = 0x10ee,
321 .device = 0x3fc4, 321 .device = 0x3fc4,
diff --git a/sound/pci/sonicvibes.c b/sound/pci/sonicvibes.c
index c4303418668b..e5d4def1aa6f 100644
--- a/sound/pci/sonicvibes.c
+++ b/sound/pci/sonicvibes.c
@@ -243,7 +243,7 @@ struct sonicvibes {
243#endif 243#endif
244}; 244};
245 245
246static struct pci_device_id snd_sonic_ids[] __devinitdata = { 246static struct pci_device_id snd_sonic_ids[] = {
247 { 0x5333, 0xca00, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, 247 { 0x5333, 0xca00, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },
248 { 0, } 248 { 0, }
249}; 249};
diff --git a/sound/pci/trident/trident.c b/sound/pci/trident/trident.c
index 5629b7eba96d..9145f7c57fb0 100644
--- a/sound/pci/trident/trident.c
+++ b/sound/pci/trident/trident.c
@@ -63,7 +63,7 @@ MODULE_PARM_DESC(pcm_channels, "Number of hardware channels assigned for PCM.");
63module_param_array(wavetable_size, int, NULL, 0444); 63module_param_array(wavetable_size, int, NULL, 0444);
64MODULE_PARM_DESC(wavetable_size, "Maximum memory size in kB for wavetable synth."); 64MODULE_PARM_DESC(wavetable_size, "Maximum memory size in kB for wavetable synth.");
65 65
66static struct pci_device_id snd_trident_ids[] __devinitdata = { 66static struct pci_device_id snd_trident_ids[] = {
67 {PCI_DEVICE(PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_DX), 67 {PCI_DEVICE(PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_DX),
68 PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0}, 68 PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0},
69 {PCI_DEVICE(PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_NX), 69 {PCI_DEVICE(PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_NX),
diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c
index 37bd5eb7a380..08da9234efb3 100644
--- a/sound/pci/via82xx.c
+++ b/sound/pci/via82xx.c
@@ -396,7 +396,7 @@ struct via82xx {
396#endif 396#endif
397}; 397};
398 398
399static struct pci_device_id snd_via82xx_ids[] __devinitdata = { 399static struct pci_device_id snd_via82xx_ids[] = {
400 /* 0x1106, 0x3058 */ 400 /* 0x1106, 0x3058 */
401 { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TYPE_CARD_VIA686, }, /* 686A */ 401 { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TYPE_CARD_VIA686, }, /* 686A */
402 /* 0x1106, 0x3059 */ 402 /* 0x1106, 0x3059 */
diff --git a/sound/pci/via82xx_modem.c b/sound/pci/via82xx_modem.c
index c1ede6c2a6d4..016f9dac253f 100644
--- a/sound/pci/via82xx_modem.c
+++ b/sound/pci/via82xx_modem.c
@@ -261,7 +261,7 @@ struct via82xx_modem {
261 struct snd_info_entry *proc_entry; 261 struct snd_info_entry *proc_entry;
262}; 262};
263 263
264static struct pci_device_id snd_via82xx_modem_ids[] __devinitdata = { 264static struct pci_device_id snd_via82xx_modem_ids[] = {
265 { 0x1106, 0x3068, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TYPE_CARD_VIA82XX_MODEM, }, 265 { 0x1106, 0x3068, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TYPE_CARD_VIA82XX_MODEM, },
266 { 0, } 266 { 0, }
267}; 267};
diff --git a/sound/pci/vx222/vx222.c b/sound/pci/vx222/vx222.c
index 7deda25f7adc..9c03c6b4e490 100644
--- a/sound/pci/vx222/vx222.c
+++ b/sound/pci/vx222/vx222.c
@@ -60,7 +60,7 @@ enum {
60 VX_PCI_VX222_NEW 60 VX_PCI_VX222_NEW
61}; 61};
62 62
63static struct pci_device_id snd_vx222_ids[] __devinitdata = { 63static struct pci_device_id snd_vx222_ids[] = {
64 { 0x10b5, 0x9050, 0x1369, PCI_ANY_ID, 0, 0, VX_PCI_VX222_OLD, }, /* PLX */ 64 { 0x10b5, 0x9050, 0x1369, PCI_ANY_ID, 0, 0, VX_PCI_VX222_OLD, }, /* PLX */
65 { 0x10b5, 0x9030, 0x1369, PCI_ANY_ID, 0, 0, VX_PCI_VX222_NEW, }, /* PLX */ 65 { 0x10b5, 0x9030, 0x1369, PCI_ANY_ID, 0, 0, VX_PCI_VX222_NEW, }, /* PLX */
66 { 0, } 66 { 0, }
diff --git a/sound/pci/ymfpci/ymfpci.c b/sound/pci/ymfpci/ymfpci.c
index 26aa775b7b69..186453f7abe7 100644
--- a/sound/pci/ymfpci/ymfpci.c
+++ b/sound/pci/ymfpci/ymfpci.c
@@ -70,7 +70,7 @@ MODULE_PARM_DESC(rear_switch, "Enable shared rear/line-in switch");
70module_param_array(rear_swap, bool, NULL, 0444); 70module_param_array(rear_swap, bool, NULL, 0444);
71MODULE_PARM_DESC(rear_swap, "Swap rear channels (must be enabled for correct IEC958 (S/PDIF)) output"); 71MODULE_PARM_DESC(rear_swap, "Swap rear channels (must be enabled for correct IEC958 (S/PDIF)) output");
72 72
73static struct pci_device_id snd_ymfpci_ids[] __devinitdata = { 73static struct pci_device_id snd_ymfpci_ids[] = {
74 { 0x1073, 0x0004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* YMF724 */ 74 { 0x1073, 0x0004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* YMF724 */
75 { 0x1073, 0x000d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* YMF724F */ 75 { 0x1073, 0x000d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* YMF724F */
76 { 0x1073, 0x000a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* YMF740 */ 76 { 0x1073, 0x000a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* YMF740 */
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.c b/sound/pcmcia/pdaudiocf/pdaudiocf.c
index adfdce7499d1..1c09e5f49da8 100644
--- a/sound/pcmcia/pdaudiocf/pdaudiocf.c
+++ b/sound/pcmcia/pdaudiocf/pdaudiocf.c
@@ -241,12 +241,13 @@ static int pdacf_config(struct pcmcia_device *link)
241 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, parse)); 241 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, parse));
242 link->conf.ConfigBase = parse->config.base; 242 link->conf.ConfigBase = parse->config.base;
243 link->conf.ConfigIndex = 0x5; 243 link->conf.ConfigIndex = 0x5;
244 kfree(parse);
245 244
246 CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io)); 245 CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io));
247 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 246 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
248 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 247 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
249 248
249 kfree(parse);
250
250 if (snd_pdacf_assign_resources(pdacf, link->io.BasePort1, link->irq.AssignedIRQ) < 0) 251 if (snd_pdacf_assign_resources(pdacf, link->io.BasePort1, link->irq.AssignedIRQ) < 0)
251 goto failed; 252 goto failed;
252 253
@@ -254,6 +255,7 @@ static int pdacf_config(struct pcmcia_device *link)
254 return 0; 255 return 0;
255 256
256cs_failed: 257cs_failed:
258 kfree(parse);
257 cs_error(link, last_fn, last_ret); 259 cs_error(link, last_fn, last_ret);
258failed: 260failed:
259 pcmcia_disable_device(link); 261 pcmcia_disable_device(link);