]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy...
authorLinus Torvalds <torvalds@g5.osdl.org>
Mon, 23 Oct 2006 15:25:00 +0000 (08:25 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 23 Oct 2006 15:25:00 +0000 (08:25 -0700)
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6:
  JFS: pageno needs to be long

764 files changed:
Documentation/HOWTO
Documentation/MSI-HOWTO.txt
Documentation/cpu-hotplug.txt
Documentation/feature-removal-schedule.txt
Documentation/hwmon/adm9240
Documentation/hwmon/f71805f
Documentation/hwmon/k8temp
Documentation/hwmon/smsc47m1
Documentation/hwmon/w83627ehf
Documentation/ibm-acpi.txt
Documentation/input/xpad.txt
Documentation/kernel-parameters.txt
Documentation/memory-barriers.txt
Documentation/mips/time.README
Documentation/s390/CommonIO
Documentation/s390/cds.txt
Documentation/s390/driver-model.txt
Documentation/video4linux/CARDLIST.cx88
MAINTAINERS
Makefile
arch/arm/mach-footbridge/dc21285.c
arch/arm/mach-ixp2000/ixdp2400.c
arch/arm/mach-ixp2000/ixdp2800.c
arch/arm/mach-ixp2000/ixdp2x00.c
arch/arm/mach-lh7a40x/common.h
arch/arm/mach-pxa/lubbock.c
arch/arm/mach-sa1100/cpu-sa1110.c
arch/arm/oprofile/op_model_xscale.c
arch/arm/tools/mach-types
arch/i386/Makefile
arch/i386/defconfig
arch/i386/kernel/acpi/boot.c
arch/i386/kernel/acpi/cstate.c
arch/i386/kernel/alternative.c
arch/i386/kernel/apm.c
arch/i386/kernel/head.S
arch/i386/kernel/i8253.c
arch/i386/kernel/i8259.c
arch/i386/kernel/io_apic.c
arch/i386/kernel/irq.c
arch/i386/kernel/nmi.c
arch/i386/kernel/process.c
arch/i386/kernel/tsc.c
arch/i386/lib/usercopy.c
arch/i386/pci/common.c
arch/i386/pci/fixup.c
arch/i386/pci/pci.h
arch/ia64/configs/sn2_defconfig
arch/ia64/kernel/acpi.c
arch/ia64/kernel/irq_ia64.c
arch/ia64/kernel/pal.S
arch/ia64/kernel/perfmon.c
arch/ia64/kernel/time.c
arch/ia64/sn/kernel/setup.c
arch/mips/au1000/common/dbdma.c
arch/mips/configs/pnx8550-jbs_defconfig
arch/mips/configs/pnx8550-v2pci_defconfig
arch/mips/configs/tb0287_defconfig
arch/mips/kernel/linux32.c
arch/mips/kernel/process.c
arch/mips/kernel/scall32-o32.S
arch/mips/kernel/scall64-64.S
arch/mips/kernel/scall64-n32.S
arch/mips/kernel/scall64-o32.S
arch/mips/kernel/stacktrace.c
arch/mips/mips-boards/generic/time.c
arch/mips/mips-boards/malta/malta_int.c
arch/mips/mips-boards/sim/sim_time.c
arch/mips/mm/init.c
arch/mips/mm/ioremap.c
arch/mips/mm/pgtable-32.c
arch/mips/mm/pgtable-64.c
arch/mips/oprofile/op_impl.h
arch/mips/oprofile/op_model_rm9000.c
arch/mips/sgi-ip32/ip32-reset.c
arch/mips/sibyte/sb1250/bcm1250_tbprof.c
arch/mips/sibyte/sb1250/bus_watcher.c
arch/powerpc/Kconfig
arch/powerpc/configs/mpc834x_itx_defconfig
arch/powerpc/configs/pseries_defconfig
arch/powerpc/kernel/cputable.c
arch/powerpc/kernel/pci_32.c
arch/powerpc/kernel/pci_64.c
arch/powerpc/kernel/process.c
arch/powerpc/kernel/traps.c
arch/powerpc/platforms/83xx/Kconfig
arch/powerpc/platforms/83xx/Makefile
arch/powerpc/platforms/83xx/mpc8360e_pb.c
arch/powerpc/platforms/cell/spu_base.c
arch/powerpc/platforms/cell/spufs/file.c
arch/ppc/kernel/time.c
arch/ppc/platforms/mpc8272ads_setup.c
arch/ppc/platforms/mpc866ads_setup.c
arch/ppc/platforms/mpc885ads_setup.c
arch/s390/defconfig
arch/s390/kernel/compat_linux.c
arch/s390/kernel/syscalls.S
arch/sh/boards/hp6xx/hp6xx_apm.c
arch/sh/boards/hp6xx/pm.c
arch/sh/boards/hp6xx/setup.c
arch/sh/boards/renesas/hs7751rvoip/io.c
arch/sh/boards/renesas/hs7751rvoip/irq.c
arch/sh/boards/renesas/hs7751rvoip/setup.c
arch/sh/boards/renesas/r7780rp/io.c
arch/sh/boards/renesas/r7780rp/irq.c
arch/sh/boards/renesas/r7780rp/setup.c
arch/sh/boards/renesas/rts7751r2d/io.c
arch/sh/boards/renesas/rts7751r2d/irq.c
arch/sh/boards/renesas/rts7751r2d/led.c
arch/sh/boards/renesas/rts7751r2d/setup.c
arch/sh/boards/shmin/setup.c
arch/sh/cchips/voyagergx/irq.c
arch/sh/drivers/pci/ops-r7780rp.c
arch/sh/drivers/pci/ops-rts7751r2d.c
arch/sh/kernel/cpu/irq/intc2.c
arch/sh/kernel/cpu/irq/ipr.c
arch/sh/kernel/cpu/sh3/ex.S
arch/sh/kernel/cpu/sh4/ex.S
arch/sh/kernel/cpu/sh4/setup-sh7760.c
arch/sh/kernel/cpu/sh4/setup-sh7780.c
arch/sh/kernel/irq.c
arch/sh/kernel/process.c
arch/sh/kernel/traps.c
arch/sparc/Kconfig
arch/sparc/Makefile
arch/sparc/kernel/irq.c
arch/sparc/kernel/setup.c
arch/sparc/kernel/time.c
arch/sparc/oprofile/Kconfig [new file with mode: 0644]
arch/sparc/oprofile/Makefile [new file with mode: 0644]
arch/sparc/oprofile/init.c [new file with mode: 0644]
arch/sparc64/defconfig
arch/sparc64/kernel/of_device.c
arch/sparc64/kernel/pci_common.c
arch/sparc64/kernel/pci_sabre.c
arch/sparc64/kernel/setup.c
arch/um/Kconfig
arch/um/Kconfig.char
arch/um/drivers/cow_sys.h
arch/um/drivers/daemon_user.c
arch/um/drivers/fd.c
arch/um/drivers/mcast_user.c
arch/um/drivers/mmapper_kern.c
arch/um/drivers/net_user.c
arch/um/drivers/pcap_user.c
arch/um/drivers/port_user.c
arch/um/drivers/pty.c
arch/um/drivers/slip_user.c
arch/um/drivers/tty.c
arch/um/drivers/xterm.c
arch/um/include/kern_util.h
arch/um/include/um_malloc.h [new file with mode: 0644]
arch/um/include/user.h
arch/um/include/user_util.h
arch/um/kernel/irq.c
arch/um/kernel/process.c
arch/um/os-Linux/drivers/ethertap_user.c
arch/um/os-Linux/helper.c
arch/um/os-Linux/irq.c
arch/um/os-Linux/main.c
arch/um/os-Linux/sigio.c
arch/um/os-Linux/time.c
arch/um/sys-x86_64/stub_segv.c
arch/x86_64/Makefile
arch/x86_64/defconfig
arch/x86_64/kernel/e820.c
arch/x86_64/kernel/early-quirks.c
arch/x86_64/kernel/entry.S
arch/x86_64/kernel/genapic_flat.c
arch/x86_64/kernel/i8259.c
arch/x86_64/kernel/io_apic.c
arch/x86_64/kernel/irq.c
arch/x86_64/kernel/pci-calgary.c
arch/x86_64/kernel/process.c
arch/x86_64/kernel/time.c
arch/x86_64/kernel/vmlinux.lds.S
arch/x86_64/mm/srat.c
arch/x86_64/pci/Makefile
block/ll_rw_blk.c
crypto/Kconfig
crypto/api.c
drivers/Kconfig
drivers/acpi/acpi_memhotplug.c
drivers/acpi/asus_acpi.c
drivers/acpi/battery.c
drivers/acpi/ec.c
drivers/acpi/events/evmisc.c
drivers/acpi/events/evrgnini.c
drivers/acpi/ibm_acpi.c
drivers/acpi/motherboard.c
drivers/acpi/osl.c
drivers/acpi/pci_link.c
drivers/acpi/power.c
drivers/acpi/processor_core.c
drivers/acpi/processor_idle.c
drivers/acpi/sbs.c
drivers/acpi/tables/tbget.c
drivers/acpi/tables/tbrsdt.c
drivers/ata/Kconfig
drivers/ata/ahci.c
drivers/ata/ata_piix.c
drivers/ata/libata-sff.c
drivers/atm/ambassador.c
drivers/atm/firestream.c
drivers/atm/horizon.c
drivers/atm/nicstar.c
drivers/base/bus.c
drivers/base/class.c
drivers/base/core.c
drivers/base/dd.c
drivers/base/dmapool.c
drivers/base/topology.c
drivers/block/aoe/aoe.h
drivers/block/aoe/aoeblk.c
drivers/block/aoe/aoechr.c
drivers/block/aoe/aoecmd.c
drivers/block/aoe/aoedev.c
drivers/block/aoe/aoemain.c
drivers/block/aoe/aoenet.c
drivers/block/cciss.c
drivers/block/rd.c
drivers/bluetooth/bcm203x.c
drivers/bluetooth/dtl1_cs.c
drivers/bluetooth/hci_usb.c
drivers/char/Kconfig
drivers/char/agp/uninorth-agp.c
drivers/char/epca.c
drivers/char/ipmi/ipmi_si_intf.c
drivers/char/moxa.c
drivers/char/random.c
drivers/char/rio/host.h
drivers/char/rio/rio_linux.c
drivers/char/rio/rioctrl.c
drivers/char/serial167.c
drivers/char/specialix.c
drivers/char/sx.c
drivers/char/synclink.c
drivers/char/watchdog/alim7101_wdt.c
drivers/clocksource/acpi_pm.c
drivers/firmware/dcdbas.c
drivers/firmware/dmi_scan.c
drivers/hwmon/Kconfig
drivers/hwmon/adm9240.c
drivers/hwmon/lm78.c
drivers/hwmon/smsc47m1.c
drivers/hwmon/w83627ehf.c
drivers/hwmon/w83781d.c
drivers/hwmon/w83791d.c
drivers/i2c/busses/i2c-isa.c
drivers/ide/ide-taskfile.c
drivers/ide/pci/generic.c
drivers/ide/pci/sgiioc4.c
drivers/infiniband/hw/amso1100/c2.c
drivers/infiniband/hw/amso1100/c2_rnic.c
drivers/infiniband/hw/ipath/ipath_diag.c
drivers/infiniband/hw/ipath/ipath_driver.c
drivers/infiniband/hw/ipath/ipath_kernel.h
drivers/infiniband/hw/mthca/mthca_cq.c
drivers/infiniband/hw/mthca/mthca_qp.c
drivers/infiniband/hw/mthca/mthca_srq.c
drivers/input/gameport/fm801-gp.c
drivers/input/gameport/gameport.c
drivers/input/keyboard/atkbd.c
drivers/input/keyboard/corgikbd.c
drivers/input/keyboard/locomokbd.c
drivers/input/keyboard/spitzkbd.c
drivers/input/misc/hp_sdc_rtc.c
drivers/input/serio/hil_mlc.c
drivers/input/serio/hp_sdc.c
drivers/input/serio/i8042.c
drivers/input/serio/libps2.c
drivers/input/serio/serio.c
drivers/input/touchscreen/corgi_ts.c
drivers/input/touchscreen/hp680_ts_input.c
drivers/isdn/capi/capidrv.c
drivers/isdn/hisax/config.c
drivers/isdn/hisax/diva.c
drivers/isdn/hysdn/boardergo.c
drivers/isdn/hysdn/hysdn_defs.h
drivers/isdn/hysdn/hysdn_proclog.c
drivers/isdn/hysdn/hysdn_sched.c
drivers/isdn/i4l/isdn_common.c
drivers/isdn/icn/icn.c
drivers/isdn/isdnloop/isdnloop.c
drivers/isdn/isdnloop/isdnloop.h
drivers/isdn/pcbit/drv.c
drivers/leds/led-class.c
drivers/leds/ledtrig-timer.c
drivers/md/bitmap.c
drivers/md/dm-crypt.c
drivers/md/md.c
drivers/md/multipath.c
drivers/md/raid10.c
drivers/media/dvb/bt8xx/dvb-bt8xx.c
drivers/media/dvb/dvb-core/Kconfig
drivers/media/dvb/dvb-usb/dibusb-common.c
drivers/media/dvb/dvb-usb/dibusb.h
drivers/media/dvb/dvb-usb/nova-t-usb2.c
drivers/media/dvb/frontends/dib3000mc.c
drivers/media/dvb/frontends/dib3000mc.h
drivers/media/dvb/frontends/tda10086.h
drivers/media/dvb/frontends/tda826x.h
drivers/media/video/Kconfig
drivers/media/video/cx25840/cx25840-vbi.c
drivers/media/video/cx88/cx88-cards.c
drivers/media/video/cx88/cx88-dvb.c
drivers/media/video/cx88/cx88-input.c
drivers/media/video/et61x251/et61x251_core.c
drivers/media/video/ov511.c
drivers/media/video/pwc/pwc-if.c
drivers/media/video/saa7115.c
drivers/media/video/saa7134/saa7134-video.c
drivers/media/video/sn9c102/sn9c102_core.c
drivers/media/video/stv680.c
drivers/media/video/tuner-types.c
drivers/media/video/videodev.c
drivers/media/video/vivi.c
drivers/message/i2o/bus-osm.c
drivers/message/i2o/exec-osm.c
drivers/misc/Kconfig
drivers/misc/Makefile
drivers/misc/ioc4.c [moved from drivers/sn/ioc4.c with 92% similarity]
drivers/misc/msi-laptop.c [new file with mode: 0644]
drivers/net/Kconfig
drivers/net/e100.c
drivers/net/e1000/e1000_main.c
drivers/net/ibmveth.c
drivers/net/ioc3-eth.c
drivers/net/loopback.c
drivers/net/myri_code.h
drivers/net/myri_sbus.c
drivers/net/r8169.c
drivers/net/sb1250-mac.c
drivers/net/sky2.c
drivers/net/sky2.h
drivers/net/smc91x.h
drivers/net/sunbmac.c
drivers/net/tg3.c
drivers/net/ucc_geth.c
drivers/net/ucc_geth.h
drivers/net/ucc_geth_phy.c
drivers/net/ucc_geth_phy.h
drivers/net/wan/pc300_drv.c
drivers/net/wireless/airo.c
drivers/net/wireless/atmel.c
drivers/net/wireless/bcm43xx/bcm43xx_dma.c
drivers/net/wireless/bcm43xx/bcm43xx_dma.h
drivers/net/wireless/bcm43xx/bcm43xx_leds.c
drivers/net/wireless/bcm43xx/bcm43xx_main.c
drivers/net/wireless/bcm43xx/bcm43xx_wx.c
drivers/net/wireless/orinoco.c
drivers/net/wireless/ray_cs.c
drivers/net/wireless/zd1201.c
drivers/net/wireless/zd1211rw/zd_mac.c
drivers/pci/hotplug/acpi_pcihp.c
drivers/pci/hotplug/acpiphp.h
drivers/pci/hotplug/acpiphp_core.c
drivers/pci/hotplug/acpiphp_glue.c
drivers/pci/hotplug/acpiphp_ibm.c
drivers/pci/hotplug/cpci_hotplug_core.c
drivers/pci/hotplug/cpci_hotplug_pci.c
drivers/pci/hotplug/cpcihp_generic.c
drivers/pci/hotplug/cpqphp.h
drivers/pci/hotplug/cpqphp_core.c
drivers/pci/hotplug/cpqphp_ctrl.c
drivers/pci/hotplug/cpqphp_nvram.c
drivers/pci/hotplug/cpqphp_pci.c
drivers/pci/hotplug/cpqphp_sysfs.c
drivers/pci/hotplug/fakephp.c
drivers/pci/hotplug/ibmphp.h
drivers/pci/hotplug/pci_hotplug_core.c
drivers/pci/hotplug/pciehp.h
drivers/pci/hotplug/pciehp_core.c
drivers/pci/hotplug/pciehp_ctrl.c
drivers/pci/hotplug/pciehp_hpc.c
drivers/pci/hotplug/pcihp_skeleton.c
drivers/pci/hotplug/rpadlpar_sysfs.c
drivers/pci/hotplug/rpaphp.h
drivers/pci/hotplug/rpaphp_core.c
drivers/pci/hotplug/sgi_hotplug.c
drivers/pci/hotplug/shpchp.h
drivers/pci/hotplug/shpchp_hpc.c
drivers/pci/msi.c
drivers/pci/pcie/portdrv.h
drivers/pci/pcie/portdrv_core.c
drivers/pci/pcie/portdrv_pci.c
drivers/pci/probe.c
drivers/pci/quirks.c
drivers/pci/rom.c
drivers/pci/search.c
drivers/pnp/pnpacpi/rsparser.c
drivers/rtc/rtc-max6902.c
drivers/rtc/rtc-v3020.c
drivers/s390/block/dasd.c
drivers/s390/char/monwriter.c
drivers/s390/cio/device_fsm.c
drivers/s390/cio/qdio.c
drivers/sbus/char/bbc_envctrl.c
drivers/sbus/char/envctrl.c
drivers/scsi/BusLogic.c
drivers/scsi/eata_pio.c
drivers/scsi/fdomain.c
drivers/scsi/initio.c
drivers/scsi/megaraid/megaraid_mbox.c
drivers/scsi/qlogicpti.c
drivers/scsi/qlogicpti_asm.c
drivers/serial/Kconfig
drivers/serial/ioc4_serial.c
drivers/sn/Kconfig
drivers/sn/Makefile
drivers/telephony/ixj.c
drivers/usb/Makefile
drivers/usb/atm/cxacru.c
drivers/usb/atm/speedtch.c
drivers/usb/atm/ueagle-atm.c
drivers/usb/atm/usbatm.c
drivers/usb/class/cdc-acm.c
drivers/usb/class/usblp.c
drivers/usb/core/devio.c
drivers/usb/core/endpoint.c
drivers/usb/gadget/net2280.c
drivers/usb/gadget/pxa2xx_udc.c
drivers/usb/host/ehci-dbg.c
drivers/usb/host/ehci-hcd.c
drivers/usb/host/ehci-hub.c
drivers/usb/host/ehci-pci.c
drivers/usb/host/ehci-q.c
drivers/usb/host/ehci.h
drivers/usb/host/ohci-pnx4008.c
drivers/usb/host/uhci-hcd.c
drivers/usb/input/Kconfig
drivers/usb/input/Makefile
drivers/usb/input/hid-core.c
drivers/usb/input/usbtouchscreen.c
drivers/usb/input/wacom.h
drivers/usb/input/wacom_sys.c
drivers/usb/input/wacom_wac.c
drivers/usb/input/wacom_wac.h
drivers/usb/input/xpad.c
drivers/usb/misc/Kconfig
drivers/usb/misc/Makefile
drivers/usb/misc/adutux.c
drivers/usb/misc/ftdi-elan.c
drivers/usb/misc/trancevibrator.c [moved from drivers/usb/input/trancevibrator.c with 100% similarity]
drivers/usb/net/Kconfig
drivers/usb/net/Makefile
drivers/usb/net/asix.c
drivers/usb/net/cdc_ether.c
drivers/usb/net/kaweth.c
drivers/usb/net/mcs7830.c [new file with mode: 0644]
drivers/usb/net/usbnet.c
drivers/usb/net/usbnet.h
drivers/usb/serial/Kconfig
drivers/usb/serial/Makefile
drivers/usb/serial/airprime.c
drivers/usb/serial/cp2101.c
drivers/usb/serial/ftdi_sio.c
drivers/usb/serial/mos7720.c [new file with mode: 0644]
drivers/usb/serial/mos7840.c
drivers/usb/serial/sierra.c
drivers/usb/storage/unusual_devs.h
drivers/video/controlfb.c
drivers/video/hitfb.c
drivers/video/igafb.c
drivers/video/platinumfb.c
drivers/video/valkyriefb.c
drivers/w1/Kconfig
fs/Kconfig
fs/autofs/autofs_i.h
fs/autofs/dirhash.c
fs/autofs/init.c
fs/autofs/inode.c
fs/binfmt_elf.c
fs/buffer.c
fs/cifs/cifssmb.c
fs/configfs/file.c
fs/dcache.c
fs/dlm/lowcomms.c
fs/ecryptfs/main.c
fs/fat/file.c
fs/fuse/dir.c
fs/fuse/file.c
fs/fuse/fuse_i.h
fs/fuse/inode.c
fs/gfs2/bmap.c
fs/gfs2/bmap.h
fs/gfs2/dir.c
fs/gfs2/log.c
fs/gfs2/ops_address.c
fs/gfs2/ops_fstype.c
fs/gfs2/quota.c
fs/gfs2/recovery.c
fs/inode.c
fs/jbd/transaction.c
fs/jbd2/journal.c
fs/jbd2/transaction.c
fs/lockd/clntlock.c
fs/lockd/mon.c
fs/lockd/svc4proc.c
fs/lockd/svclock.c
fs/lockd/svcproc.c
fs/lockd/svcshare.c
fs/lockd/svcsubs.c
fs/lockd/xdr.c
fs/lockd/xdr4.c
fs/nfs/callback.h
fs/nfs/callback_proc.c
fs/nfs/callback_xdr.c
fs/nfs/client.c
fs/nfs/dir.c
fs/nfs/direct.c
fs/nfs/inode.c
fs/nfs/internal.h
fs/nfs/mount_clnt.c
fs/nfs/nfs2xdr.c
fs/nfs/nfs3proc.c
fs/nfs/nfs3xdr.c
fs/nfs/nfs4_fs.h
fs/nfs/nfs4proc.c
fs/nfs/nfs4xdr.c
fs/nfs/super.c
fs/nfs/write.c
fs/nfs_common/nfsacl.c
fs/nfsd/export.c
fs/nfsd/lockd.c
fs/nfsd/nfs2acl.c
fs/nfsd/nfs3acl.c
fs/nfsd/nfs3proc.c
fs/nfsd/nfs3xdr.c
fs/nfsd/nfs4callback.c
fs/nfsd/nfs4proc.c
fs/nfsd/nfs4recover.c
fs/nfsd/nfs4state.c
fs/nfsd/nfs4xdr.c
fs/nfsd/nfscache.c
fs/nfsd/nfsfh.c
fs/nfsd/nfsproc.c
fs/nfsd/nfssvc.c
fs/nfsd/nfsxdr.c
fs/nfsd/vfs.c
fs/ocfs2/cluster/nodemanager.c
fs/ocfs2/file.c
fs/ocfs2/namei.c
fs/partitions/check.c
fs/proc/base.c
fs/reiserfs/journal.c
fs/splice.c
fs/sysfs/file.c
fs/xfs/linux-2.6/kmem.c
fs/xfs/linux-2.6/xfs_buf.c
include/acpi/pdc_intel.h
include/acpi/processor.h
include/asm-arm/arch-pxa/pxa-regs.h
include/asm-arm/arch-sa1100/jornada720.h
include/asm-frv/highmem.h
include/asm-generic/bug.h
include/asm-generic/vmlinux.lds.h
include/asm-i386/processor.h
include/asm-ia64/io.h
include/asm-ia64/pal.h
include/asm-m68k/sun3mmu.h
include/asm-mips/cacheflush.h
include/asm-mips/fixmap.h
include/asm-mips/io.h
include/asm-mips/unistd.h
include/asm-mips/vr41xx/vr41xx.h
include/asm-s390/pgtable.h
include/asm-s390/unistd.h
include/asm-sh/edosk7705.h [moved from include/asm-sh/edosk7705/io.h with 100% similarity]
include/asm-sh/hp6xx.h [moved from include/asm-sh/hp6xx/hp6xx.h with 100% similarity]
include/asm-sh/hp6xx/ide.h [deleted file]
include/asm-sh/hp6xx/io.h [deleted file]
include/asm-sh/hs7751rvoip.h [moved from include/asm-sh/hs7751rvoip/hs7751rvoip.h with 100% similarity]
include/asm-sh/hs7751rvoip/ide.h [deleted file]
include/asm-sh/irq-sh7780.h
include/asm-sh/irq.h
include/asm-sh/landisk/ide.h [deleted file]
include/asm-sh/processor.h
include/asm-sh/r7780rp.h [moved from include/asm-sh/r7780rp/r7780rp.h with 96% similarity]
include/asm-sh/r7780rp/ide.h [deleted file]
include/asm-sh/rts7751r2d.h [moved from include/asm-sh/rts7751r2d/rts7751r2d.h with 100% similarity]
include/asm-sh/rts7751r2d/ide.h [deleted file]
include/asm-sh/sh03/ide.h [deleted file]
include/asm-sh/shmin.h [moved from include/asm-sh/shmin/shmin.h with 100% similarity]
include/asm-sh/system.h
include/asm-sparc/elf.h
include/asm-sparc64/compat.h
include/asm-um/archparam-ppc.h
include/asm-x86_64/pgtable.h
include/asm-x86_64/processor.h
include/asm-x86_64/proto.h
include/linux/Kbuild
include/linux/acpi.h
include/linux/backing-dev.h
include/linux/blkdev.h
include/linux/buffer_head.h
include/linux/compat_ioctl.h
include/linux/dmi.h
include/linux/fs.h
include/linux/irq.h
include/linux/libata.h
include/linux/lockd/bind.h
include/linux/lockd/lockd.h
include/linux/lockd/share.h
include/linux/lockd/xdr.h
include/linux/lockd/xdr4.h
include/linux/lockdep.h
include/linux/mempolicy.h
include/linux/mm.h
include/linux/mmzone.h
include/linux/net.h
include/linux/nfs_fs.h
include/linux/nfs_xdr.h
include/linux/nfsd/cache.h
include/linux/nfsd/export.h
include/linux/nfsd/nfsd.h
include/linux/nfsd/nfsfh.h
include/linux/nfsd/state.h
include/linux/nfsd/xdr.h
include/linux/nfsd/xdr3.h
include/linux/nfsd/xdr4.h
include/linux/oom.h [new file with mode: 0644]
include/linux/pci.h
include/linux/pci_hotplug.h [moved from drivers/pci/hotplug/pci_hotplug.h with 99% similarity]
include/linux/pci_ids.h
include/linux/personality.h
include/linux/raid/bitmap.h
include/linux/raid/md_p.h
include/linux/random.h
include/linux/serio.h
include/linux/sunrpc/msg_prot.h
include/linux/sunrpc/svc.h
include/linux/sunrpc/xdr.h
include/linux/tcp.h
include/linux/tipc.h
include/linux/unwind.h
include/linux/videodev2.h
include/linux/writeback.h
include/net/bluetooth/hci_core.h
include/net/dn.h
include/net/flow.h
include/net/ieee80211softmac.h
include/net/inetpeer.h
include/net/ip6_route.h
include/net/ip_fib.h
include/net/netlabel.h
include/net/sock.h
init/Kconfig
init/main.c
kernel/cpu.c
kernel/fork.c
kernel/irq/chip.c
kernel/lockdep.c
kernel/mutex-debug.c
kernel/nsproxy.c
kernel/posix-cpu-timers.c
kernel/power/swap.c
kernel/sched.c
kernel/sys_ni.c
kernel/sysctl.c
kernel/time/jiffies.c
kernel/unwind.c
lib/Makefile
lib/carta_random32.c [deleted file]
lib/cpumask.c
lib/kobject.c
lib/random32.c [new file with mode: 0644]
lib/rwsem-spinlock.c
lib/rwsem.c
lib/spinlock_debug.c
mm/Makefile
mm/backing-dev.c [new file with mode: 0644]
mm/filemap.c
mm/memory.c
mm/mmap.c
mm/oom_kill.c
mm/page-writeback.c
mm/page_alloc.c
mm/rmap.c
mm/shmem.c
mm/slab.c
mm/truncate.c
mm/vmalloc.c
mm/vmscan.c
net/atm/atm_sysfs.c
net/bluetooth/af_bluetooth.c
net/bluetooth/bnep/core.c
net/bluetooth/bnep/sock.c
net/bluetooth/cmtp/sock.c
net/bluetooth/hci_conn.c
net/bluetooth/hci_event.c
net/bluetooth/hci_sock.c
net/bluetooth/hci_sysfs.c
net/bluetooth/hidp/core.c
net/bluetooth/hidp/sock.c
net/bluetooth/l2cap.c
net/bluetooth/rfcomm/core.c
net/bluetooth/rfcomm/sock.c
net/bluetooth/rfcomm/tty.c
net/bluetooth/sco.c
net/bridge/br_fdb.c
net/bridge/br_if.c
net/bridge/br_private.h
net/bridge/br_stp_if.c
net/core/dev.c
net/core/netpoll.c
net/core/sock.c
net/core/utils.c
net/core/wireless.c
net/dccp/ipv4.c
net/dccp/ipv6.c
net/decnet/dn_route.c
net/ieee80211/softmac/ieee80211softmac_assoc.c
net/ieee80211/softmac/ieee80211softmac_io.c
net/ieee80211/softmac/ieee80211softmac_module.c
net/ieee80211/softmac/ieee80211softmac_wx.c
net/ipv4/cipso_ipv4.c
net/ipv4/fib_frontend.c
net/ipv4/inetpeer.c
net/ipv4/netfilter/arp_tables.c
net/ipv4/netfilter/ip_conntrack_netlink.c
net/ipv4/netfilter/ip_tables.c
net/ipv4/netfilter/ipt_ECN.c
net/ipv4/netfilter/ipt_TOS.c
net/ipv4/tcp_ipv4.c
net/ipv4/tcp_output.c
net/ipv6/Kconfig
net/ipv6/fib6_rules.c
net/ipv6/ip6_fib.c
net/ipv6/ndisc.c
net/ipv6/route.c
net/ipv6/sit.c
net/ipv6/xfrm6_policy.c
net/netfilter/Kconfig
net/netfilter/nf_conntrack_netlink.c
net/netfilter/xt_NFQUEUE.c
net/netfilter/xt_connmark.c
net/sched/sch_netem.c
net/sctp/ipv6.c
net/sctp/socket.c
net/sunrpc/pmap_clnt.c
net/sunrpc/svc.c
net/sunrpc/svcsock.c
net/sunrpc/xprtsock.c
net/tipc/bearer.c
net/tipc/config.c
net/tipc/core.c
net/tipc/core.h
net/tipc/dbg.c
net/tipc/dbg.h
net/tipc/discover.c
net/tipc/link.c
net/tipc/name_distr.c
net/tipc/node.c
net/tipc/port.c
net/tipc/socket.c
net/tipc/subscr.c
net/xfrm/xfrm_state.c
scripts/Makefile.headersinst
scripts/Makefile.modpost
security/selinux/ss/ebitmap.c
security/selinux/ss/mls.c
security/selinux/ss/services.c
sound/oss/sh_dac_audio.c

index d6f3dd1a3464f0cd6950e1c6dcecc4f7bcb6c84f..8d51c148f72117b707792a65c9c5ad025364a03a 100644 (file)
@@ -395,6 +395,26 @@ bugme-janitor mailing list (every change in the bugzilla is mailed here)
 
 
 
+Managing bug reports
+--------------------
+
+One of the best ways to put into practice your hacking skills is by fixing
+bugs reported by other people. Not only you will help to make the kernel
+more stable, you'll learn to fix real world problems and you will improve
+your skills, and other developers will be aware of your presence. Fixing
+bugs is one of the best ways to get merits among other developers, because
+not many people like wasting time fixing other people's bugs.
+
+To work in the already reported bug reports, go to http://bugzilla.kernel.org.
+If you want to be advised of the future bug reports, you can subscribe to the
+bugme-new mailing list (only new bug reports are mailed here) or to the
+bugme-janitor mailing list (every change in the bugzilla is mailed here)
+
+       http://lists.osdl.org/mailman/listinfo/bugme-new
+       http://lists.osdl.org/mailman/listinfo/bugme-janitors
+
+
+
 Mailing lists
 -------------
 
index c70306abb7b2e2c4fc306bdc70447b47c9e9878e..5c34910665d1d8514fb77c07e310f91b2b7f59bd 100644 (file)
@@ -470,7 +470,68 @@ LOC:     324553     325068
 ERR:          0
 MIS:          0
 
-6. FAQ
+6. MSI quirks
+
+Several PCI chipsets or devices are known to not support MSI.
+The PCI stack provides 3 possible levels of MSI disabling:
+* on a single device
+* on all devices behind a specific bridge
+* globally
+
+6.1. Disabling MSI on a single device
+
+Under some circumstances, it might be required to disable MSI on a
+single device, It may be achived by either not calling pci_enable_msi()
+or all, or setting the pci_dev->no_msi flag before (most of the time
+in a quirk).
+
+6.2. Disabling MSI below a bridge
+
+The vast majority of MSI quirks are required by PCI bridges not
+being able to route MSI between busses. In this case, MSI have to be
+disabled on all devices behind this bridge. It is achieves by setting
+the PCI_BUS_FLAGS_NO_MSI flag in the pci_bus->bus_flags of the bridge
+subordinate bus. There is no need to set the same flag on bridges that
+are below the broken brigde. When pci_enable_msi() is called to enable
+MSI on a device, pci_msi_supported() takes care of checking the NO_MSI
+flag in all parent busses of the device.
+
+Some bridges actually support dynamic MSI support enabling/disabling
+by changing some bits in their PCI configuration space (especially
+the Hypertransport chipsets such as the nVidia nForce and Serverworks
+HT2000). It may then be required to update the NO_MSI flag on the
+corresponding devices in the sysfs hierarchy. To enable MSI support
+on device "0000:00:0e", do:
+
+       echo 1 > /sys/bus/pci/devices/0000:00:0e/msi_bus
+
+To disable MSI support, echo 0 instead of 1. Note that it should be
+used with caution since changing this value might break interrupts.
+
+6.3. Disabling MSI globally
+
+Some extreme cases may require to disable MSI globally on the system.
+For now, the only known case is a Serverworks PCI-X chipsets (MSI are
+not supported on several busses that are not all connected to the
+chipset in the Linux PCI hierarchy). In the vast majority of other
+cases, disabling only behind a specific bridge is enough.
+
+For debugging purpose, the user may also pass pci=nomsi on the kernel
+command-line to explicitly disable MSI globally. But, once the appro-
+priate quirks are added to the kernel, this option should not be
+required anymore.
+
+6.4. Finding why MSI cannot be enabled on a device
+
+Assuming that MSI are not enabled on a device, you should look at
+dmesg to find messages that quirks may output when disabling MSI
+on some devices, some bridges or even globally.
+Then, lspci -t gives the list of bridges above a device. Reading
+/sys/bus/pci/devices/0000:00:0e/msi_bus will tell you whether MSI
+are enabled (1) or disabled (0). In 0 is found in a single bridge
+msi_bus file above the device, MSI cannot be enabled.
+
+7. FAQ
 
 Q1. Are there any limitations on using the MSI?
 
index bc107cb157a8bba060ce65bb9ded734bfbdd15a8..4868c34f75090fe75b4f6bb28f70c7638540c4cd 100644 (file)
@@ -46,7 +46,7 @@ maxcpus=n    Restrict boot time cpus to n. Say if you have 4 cpus, using
              maxcpus=2 will only boot 2. You can choose to bring the
              other cpus later online, read FAQ's for more info.
 
-additional_cpus*=n     Use this to limit hotpluggable cpus. This option sets
+additional_cpus=n (*)  Use this to limit hotpluggable cpus. This option sets
                        cpu_possible_map = cpu_present_map + additional_cpus
 
 (*) Option valid only for following architectures
@@ -101,15 +101,15 @@ cpu_possible_map/for_each_possible_cpu() to iterate.
 
 Never use anything other than cpumask_t to represent bitmap of CPUs.
 
-#include <linux/cpumask.h>
+       #include <linux/cpumask.h>
 
-for_each_possible_cpu     - Iterate over cpu_possible_map
-for_each_online_cpu       - Iterate over cpu_online_map
-for_each_present_cpu      - Iterate over cpu_present_map
-for_each_cpu_mask(x,mask) - Iterate over some random collection of cpu mask.
+       for_each_possible_cpu     - Iterate over cpu_possible_map
+       for_each_online_cpu       - Iterate over cpu_online_map
+       for_each_present_cpu      - Iterate over cpu_present_map
+       for_each_cpu_mask(x,mask) - Iterate over some random collection of cpu mask.
 
-#include <linux/cpu.h>
-lock_cpu_hotplug() and unlock_cpu_hotplug():
+       #include <linux/cpu.h>
+       lock_cpu_hotplug() and unlock_cpu_hotplug():
 
 The above calls are used to inhibit cpu hotplug operations. While holding the
 cpucontrol mutex, cpu_online_map will not change. If you merely need to avoid
@@ -120,7 +120,7 @@ will work as long as stop_machine_run() is used to take a cpu down.
 
 CPU Hotplug - Frequently Asked Questions.
 
-Q: How to enable my kernel to support CPU hotplug?
+Q: How to enable my kernel to support CPU hotplug?
 A: When doing make defconfig, Enable CPU hotplug support
 
    "Processor type and Features" -> Support for Hotpluggable CPUs
@@ -141,39 +141,39 @@ A: You should now notice an entry in sysfs.
 Check if sysfs is mounted, using the "mount" command. You should notice
 an entry as shown below in the output.
 
-....
-none on /sys type sysfs (rw)
-....
+       ....
+       none on /sys type sysfs (rw)
+       ....
 
-if this is not mounted, do the following.
+If this is not mounted, do the following.
 
-#mkdir /sysfs
-#mount -t sysfs sys /sys
+        #mkdir /sysfs
+       #mount -t sysfs sys /sys
 
-now you should see entries for all present cpu, the following is an example
+Now you should see entries for all present cpu, the following is an example
 in a 8-way system.
 
-#pwd
-#/sys/devices/system/cpu
-#ls -l
-total 0
-drwxr-xr-x  10 root root 0 Sep 19 07:44 .
-drwxr-xr-x  13 root root 0 Sep 19 07:45 ..
-drwxr-xr-x   3 root root 0 Sep 19 07:44 cpu0
-drwxr-xr-x   3 root root 0 Sep 19 07:44 cpu1
-drwxr-xr-x   3 root root 0 Sep 19 07:44 cpu2
-drwxr-xr-x   3 root root 0 Sep 19 07:44 cpu3
-drwxr-xr-x   3 root root 0 Sep 19 07:44 cpu4
-drwxr-xr-x   3 root root 0 Sep 19 07:44 cpu5
-drwxr-xr-x   3 root root 0 Sep 19 07:44 cpu6
-drwxr-xr-x   3 root root 0 Sep 19 07:48 cpu7
+       #pwd
+       #/sys/devices/system/cpu
+       #ls -l
+       total 0
+       drwxr-xr-x  10 root root 0 Sep 19 07:44 .
+       drwxr-xr-x  13 root root 0 Sep 19 07:45 ..
+       drwxr-xr-x   3 root root 0 Sep 19 07:44 cpu0
+       drwxr-xr-x   3 root root 0 Sep 19 07:44 cpu1
+       drwxr-xr-x   3 root root 0 Sep 19 07:44 cpu2
+       drwxr-xr-x   3 root root 0 Sep 19 07:44 cpu3
+       drwxr-xr-x   3 root root 0 Sep 19 07:44 cpu4
+       drwxr-xr-x   3 root root 0 Sep 19 07:44 cpu5
+       drwxr-xr-x   3 root root 0 Sep 19 07:44 cpu6
+       drwxr-xr-x   3 root root 0 Sep 19 07:48 cpu7
 
 Under each directory you would find an "online" file which is the control
 file to logically online/offline a processor.
 
 Q: Does hot-add/hot-remove refer to physical add/remove of cpus?
 A: The usage of hot-add/remove may not be very consistently used in the code.
-CONFIG_CPU_HOTPLUG enables logical online/offline capability in the kernel.
+CONFIG_HOTPLUG_CPU enables logical online/offline capability in the kernel.
 To support physical addition/removal, one would need some BIOS hooks and
 the platform should have something like an attention button in PCI hotplug.
 CONFIG_ACPI_HOTPLUG_CPU enables ACPI support for physical add/remove of CPUs.
@@ -181,17 +181,17 @@ CONFIG_ACPI_HOTPLUG_CPU enables ACPI support for physical add/remove of CPUs.
 Q: How do i logically offline a CPU?
 A: Do the following.
 
-#echo 0 > /sys/devices/system/cpu/cpuX/online
+       #echo 0 > /sys/devices/system/cpu/cpuX/online
 
-once the logical offline is successful, check
+Once the logical offline is successful, check
 
-#cat /proc/interrupts
+       #cat /proc/interrupts
 
-you should now not see the CPU that you removed. Also online file will report
+You should now not see the CPU that you removed. Also online file will report
 the state as 0 when a cpu if offline and 1 when its online.
 
-#To display the current cpu state.
-#cat /sys/devices/system/cpu/cpuX/online
+       #To display the current cpu state.
+       #cat /sys/devices/system/cpu/cpuX/online
 
 Q: Why cant i remove CPU0 on some systems?
 A: Some architectures may have some special dependency on a certain CPU.
@@ -234,8 +234,8 @@ Q: If i have some kernel code that needs to be aware of CPU arrival and
    departure, how to i arrange for proper notification?
 A: This is what you would need in your kernel code to receive notifications.
 
-    #include <linux/cpu.h>
-    static int __cpuinit foobar_cpu_callback(struct notifier_block *nfb,
+       #include <linux/cpu.h>
+       static int __cpuinit foobar_cpu_callback(struct notifier_block *nfb,
                                            unsigned long action, void *hcpu)
        {
                unsigned int cpu = (unsigned long)hcpu;
@@ -279,10 +279,10 @@ Q: I don't see my action being called for all CPUs already up and running?
 A: Yes, CPU notifiers are called only when new CPUs are on-lined or offlined.
    If you need to perform some action for each cpu already in the system, then
 
-  for_each_online_cpu(i) {
+       for_each_online_cpu(i) {
                foobar_cpu_callback(&foobar_cpu_notifier, CPU_UP_PREPARE, i);
-               foobar_cpu_callback(&foobar-cpu_notifier, CPU_ONLINE, i);
-  }
+               foobar_cpu_callback(&foobar_cpu_notifier, CPU_ONLINE, i);
+       }
 
 Q: If i would like to develop cpu hotplug support for a new architecture,
    what do i need at a minimum?
@@ -307,38 +307,38 @@ Q: I need to ensure that a particular cpu is not removed when there is some
    work specific to this cpu is in progress.
 A: First switch the current thread context to preferred cpu
 
-   int my_func_on_cpu(int cpu)
-   {
-       cpumask_t saved_mask, new_mask = CPU_MASK_NONE;
-       int curr_cpu, err = 0;
-
-       saved_mask = current->cpus_allowed;
-       cpu_set(cpu, new_mask);
-       err = set_cpus_allowed(current, new_mask);
-
-       if (err)
-           return err;
-
-       /*
-        * If we got scheduled out just after the return from
-        * set_cpus_allowed() before running the work, this ensures
-        * we stay locked.
-        */
-       curr_cpu = get_cpu();
-
-       if (curr_cpu != cpu) {
-          err = -EAGAIN;
-           goto ret;
-       } else {
-                  /*
-           * Do work : But cant sleep, since get_cpu() disables preempt
-           */
-       }
-    ret:
-       put_cpu();
-       set_cpus_allowed(current, saved_mask);
-       return err;
-    }
+       int my_func_on_cpu(int cpu)
+       {
+               cpumask_t saved_mask, new_mask = CPU_MASK_NONE;
+               int curr_cpu, err = 0;
+
+               saved_mask = current->cpus_allowed;
+               cpu_set(cpu, new_mask);
+               err = set_cpus_allowed(current, new_mask);
+
+               if (err)
+                       return err;
+
+               /*
+                * If we got scheduled out just after the return from
+                * set_cpus_allowed() before running the work, this ensures
+                * we stay locked.
+                */
+               curr_cpu = get_cpu();
+
+               if (curr_cpu != cpu) {
+                       err = -EAGAIN;
+                       goto ret;
+               } else {
+                       /*
+                        * Do work : But cant sleep, since get_cpu() disables preempt
+                        */
+               }
+               ret:
+                       put_cpu();
+                       set_cpus_allowed(current, saved_mask);
+                       return err;
+               }
 
 
 Q: How do we determine how many CPUs are available for hotplug.
index 24f3c63b301710ba461e04e9fc353c9f4a5eabcd..1ac3c74646e3fc29fac85e767eaec8ad4e350330 100644 (file)
@@ -255,7 +255,7 @@ Who:        Stephen Hemminger <shemminger@osdl.org>
 
 
 What:  PHYSDEVPATH, PHYSDEVBUS, PHYSDEVDRIVER in the uevent environment
-When:  Oktober 2008
+When:  October 2008
 Why:   The stacking of class devices makes these values misleading and
        inconsistent.
        Class devices should not carry any of these properties, and bus
index 35f618f32896c9228c8a32a3c62b5392043237ac..2c6f1fed4618df3949d76173057c9eda3f4f7762 100644 (file)
@@ -24,7 +24,7 @@ Authors:
     Frodo Looijaard <frodol@dds.nl>,
     Philip Edelbrock <phil@netroedge.com>,
     Michiel Rook <michiel@grendelproject.nl>,
-    Grant Coady <gcoady@gmail.com> with guidance
+    Grant Coady <gcoady.lk@gmail.com> with guidance
         from Jean Delvare <khali@linux-fr.org>
 
 Interface
index 28c5b7d1eb90f0ccd8e0307c170f89bd7954dc9c..2ca69df669c3a615601aec996fb8f977aa485180 100644 (file)
@@ -17,7 +17,7 @@ Thanks to Kris Chen from Fintek for answering technical questions and
 providing additional documentation.
 
 Thanks to Chris Lin from Jetway for providing wiring schematics and
-anwsering technical questions.
+answering technical questions.
 
 
 Description
index bab445ab0f523fc627c24aa0c5da11aa11d51523..30d123b8d92022180b4f0cd2ae32cffc47ba4f6e 100644 (file)
@@ -2,7 +2,7 @@ Kernel driver k8temp
 ====================
 
 Supported chips:
-  * AMD K8 CPU
+  * AMD Athlon64/FX or Opteron CPUs
     Prefix: 'k8temp'
     Addresses scanned: PCI space
     Datasheet: http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/32559.pdf
@@ -13,10 +13,13 @@ Contact: Rudolf Marek <r.marek@sh.cvut.cz>
 Description
 -----------
 
-This driver permits reading temperature sensor(s) embedded inside AMD K8 CPUs.
-Official documentation says that it works from revision F of K8 core, but
-in fact it seems to be implemented for all revisions of K8 except the first
-two revisions (SH-B0 and SH-B3).
+This driver permits reading temperature sensor(s) embedded inside AMD K8
+family CPUs (Athlon64/FX, Opteron). Official documentation says that it works
+from revision F of K8 core, but in fact it seems to be implemented for all
+revisions of K8 except the first two revisions (SH-B0 and SH-B3).
+
+Please note that you will need at least lm-sensors 2.10.1 for proper userspace
+support.
 
 There can be up to four temperature sensors inside single CPU. The driver
 will auto-detect the sensors and will display only temperatures from
index c15bbe68264ee514861197726b2dddea2b4bcbbd..04a11124f667756b9a4225b81624d9d9225eb1ae 100644 (file)
@@ -2,12 +2,14 @@ Kernel driver smsc47m1
 ======================
 
 Supported chips:
-  * SMSC LPC47B27x, LPC47M10x, LPC47M13x, LPC47M14x, LPC47M15x and LPC47M192
+  * SMSC LPC47B27x, LPC47M112, LPC47M10x, LPC47M13x, LPC47M14x,
+    LPC47M15x and LPC47M192
     Addresses scanned: none, address read from Super I/O config space
     Prefix: 'smsc47m1'
     Datasheets:
         http://www.smsc.com/main/datasheets/47b27x.pdf
         http://www.smsc.com/main/datasheets/47m10x.pdf
+        http://www.smsc.com/main/datasheets/47m112.pdf
         http://www.smsc.com/main/tools/discontinued/47m13x.pdf
         http://www.smsc.com/main/datasheets/47m14x.pdf
         http://www.smsc.com/main/tools/discontinued/47m15x.pdf
index fae3b781d82d48f6f91a5b261601499ee450e127..caa610a297e8a349f586f15a4b1279903179e47d 100644 (file)
@@ -26,7 +26,7 @@ fan control mode).
 Temperatures are measured in degrees Celsius and measurement resolution is 1
 degC for temp1 and 0.5 degC for temp2 and temp3. An alarm is triggered when
 the temperature gets higher than high limit; it stays on until the temperature
-falls below the Hysteresis value.
+falls below the hysteresis value.
 
 Fan rotation speeds are reported in RPM (rotations per minute). An alarm is
 triggered if the rotation speed has dropped below a programmable limit. Fan
@@ -67,9 +67,9 @@ Thermal Cruise mode
 
 If the temperature is in the range defined by:
 
-pwm[1-4]_target    - set target temperature, unit millidegree Celcius
+pwm[1-4]_target    - set target temperature, unit millidegree Celsius
                     (range 0 - 127000)
-pwm[1-4]_tolerance - tolerance, unit millidegree Celcius (range 0 - 15000)
+pwm[1-4]_tolerance - tolerance, unit millidegree Celsius (range 0 - 15000)
 
 there are no changes to fan speed. Once the temperature leaves the interval,
 fan speed increases (temp is higher) or decreases if lower than desired.
index 71aa403452722348f2a1668db3b6b35699e833df..e50595bfd8ea63e0cfc15c0c4cadd94e01ea1224 100644 (file)
@@ -30,9 +30,10 @@ detailed description):
        - ACPI sounds
        - temperature sensors
        - Experimental: embedded controller register dump
-       - Experimental: LCD brightness control
-       - Experimental: volume control
+       - LCD brightness control
+       - Volume control
        - Experimental: fan speed, fan enable/disable
+       - Experimental: WAN enable and disable
 
 A compatibility table by model and feature is maintained on the web
 site, http://ibm-acpi.sf.net/. I appreciate any success or failure
@@ -52,40 +53,7 @@ Installation
 
 If you are compiling this driver as included in the Linux kernel
 sources, simply enable the CONFIG_ACPI_IBM option (Power Management /
-ACPI / IBM ThinkPad Laptop Extras). The rest of this section describes
-how to install this driver when downloaded from the web site.
-
-First, you need to get a kernel with ACPI support up and running.
-Please refer to http://acpi.sourceforge.net/ for help with this
-step. How successful you will be depends a lot on you ThinkPad model,
-the kernel you are using and any additional patches applied. The
-kernel provided with your distribution may not be good enough. I
-needed to compile a 2.6.7 kernel with the 20040715 ACPI patch to get
-ACPI working reliably on my ThinkPad X40. Old ThinkPad models may not
-be supported at all.
-
-Assuming you have the basic ACPI support working (e.g. you can see the
-/proc/acpi directory), follow the following steps to install this
-driver:
-
-       - unpack the archive:
-
-               tar xzvf ibm-acpi-x.y.tar.gz; cd ibm-acpi-x.y
-
-       - compile the driver:
-
-               make
-
-       - install the module in your kernel modules directory:
-
-               make install
-
-       - load the module:
-
-               modprobe ibm_acpi
-
-After loading the module, check the "dmesg" output for any error messages.
-
+ACPI / IBM ThinkPad Laptop Extras).
 
 Features
 --------
@@ -523,13 +491,8 @@ registers contain the current battery capacity, etc. If you experiment
 with this, do send me your results (including some complete dumps with
 a description of the conditions when they were taken.)
 
-EXPERIMENTAL: LCD brightness control -- /proc/acpi/ibm/brightness
------------------------------------------------------------------
-
-This feature is marked EXPERIMENTAL because the implementation
-directly accesses hardware registers and may not work as expected. USE
-WITH CAUTION! To use this feature, you need to supply the
-experimental=1 parameter when loading the module.
+LCD brightness control -- /proc/acpi/ibm/brightness
+---------------------------------------------------
 
 This feature allows software control of the LCD brightness on ThinkPad
 models which don't have a hardware brightness slider. The available
@@ -542,13 +505,8 @@ commands are:
 The <level> number range is 0 to 7, although not all of them may be
 distinct. The current brightness level is shown in the file.
 
-EXPERIMENTAL: Volume control -- /proc/acpi/ibm/volume
------------------------------------------------------
-
-This feature is marked EXPERIMENTAL because the implementation
-directly accesses hardware registers and may not work as expected. USE
-WITH CAUTION! To use this feature, you need to supply the
-experimental=1 parameter when loading the module.
+Volume control -- /proc/acpi/ibm/volume
+---------------------------------------
 
 This feature allows volume control on ThinkPad models which don't have
 a hardware volume knob. The available commands are:
@@ -611,6 +569,23 @@ with the following command:
 
        echo 'level <level>' > /proc/acpi/ibm/thermal
 
+EXPERIMENTAL: WAN -- /proc/acpi/ibm/wan
+---------------------------------------
+
+This feature is marked EXPERIMENTAL because the implementation
+directly accesses hardware registers and may not work as expected. USE
+WITH CAUTION! To use this feature, you need to supply the
+experimental=1 parameter when loading the module.
+
+This feature shows the presence and current state of a WAN (Sierra
+Wireless EV-DO) device. If WAN is installed, the following commands can
+be used:
+
+       echo enable > /proc/acpi/ibm/wan
+       echo disable > /proc/acpi/ibm/wan
+
+It was tested on a Lenovo Thinkpad X60. It should probably work on other
+Thinkpad models which come with this module installed.
 
 Multiple Commands, Module Parameters
 ------------------------------------
index b9111a703ce0c37a8a3ad59cc442da283629a0b2..5427bdf225ed0392372ff6ce428dd1e68a2aab83 100644 (file)
@@ -3,20 +3,37 @@ xpad - Linux USB driver for X-Box gamepads
 This is the very first release of a driver for X-Box gamepads.
 Basically, this was hacked away in just a few hours, so don't expect
 miracles.
+
 In particular, there is currently NO support for the rumble pack.
 You won't find many ff-aware linux applications anyway.
 
 
-0. Status
----------
+0. Notes
+--------
+
+Driver updated for kernel 2.6.17.11. (Based on a patch for 2.6.11.4.)
 
-For now, this driver has only been tested on just one Linux-Box.
-This one is running a 2.4.18 kernel with usb-uhci on an amd athlon 600.
+The number of buttons/axes reported varies based on 3 things:
+- if you are using a known controller
+- if you are using a known dance pad
+- if using an unknown device (one not listed below), what you set in the
+  module configuration for "Map D-PAD to buttons rather than axes for unknown
+  pads" (module option dpad_to_buttons)
 
-The jstest-program from joystick-1.2.15 (jstest-version 2.1.0) reports
-8 axes and 10 buttons.
+If you set dpad_to_buttons to 0 and you are using an unknown device (one
+not listed below), the driver will map the directional pad to axes (X/Y),
+if you said N it will map the d-pad to buttons, which is needed for dance
+style games to function correctly.  The default is Y.
+
+dpad_to_buttons has no effect for known pads.
+
+0.1 Normal Controllers
+----------------------
+With a normal controller, the directional pad is mapped to its own X/Y axes.
+The jstest-program from joystick-1.2.15 (jstest-version 2.1.0) will report 8
+axes and 10 buttons.
 
-Alls 8 axes work, though they all have the same range (-32768..32767)
+All 8 axes work, though they all have the same range (-32768..32767)
 and the zero-setting is not correct for the triggers (I don't know if that
 is some limitation of jstest, since the input device setup should be fine. I
 didn't have a look at jstest itself yet).
@@ -30,16 +47,50 @@ in game functionality were OK. However, I find it rather difficult to
 play first person shooters with a pad. Your mileage may vary.
 
 
+0.2 Xbox Dance Pads
+-------------------
+When using a known dance pad, jstest will report 6 axes and 14 buttons.
+
+For dance style pads (like the redoctane pad) several changes
+have been made.  The old driver would map the d-pad to axes, resulting
+in the driver being unable to report when the user was pressing both
+left+right or up+down, making DDR style games unplayable.
+
+Known dance pads automatically map the d-pad to buttons and will work
+correctly out of the box.
+
+If your dance pad is recognized by the driver but is using axes instead
+of buttons, see section 0.3 - Unknown Controllers
+
+I've tested this with Stepmania, and it works quite well.
+
+
+0.3 Unkown Controllers
+----------------------
+If you have an unkown xbox controller, it should work just fine with
+the default settings.
+
+HOWEVER if you have an unknown dance pad not listed below, it will not
+work UNLESS you set "dpad_to_buttons" to 1 in the module configuration.
+
+PLEASE if you have an unkown controller, email Dom <binary1230@yahoo.com> with
+a dump from /proc/bus/usb and a description of the pad (manufacturer, country,
+whether it is a dance pad or normal controller) so that we can add your pad
+to the list of supported devices, ensuring that it will work out of the
+box in the future.
+
+
 1. USB adapter
 --------------
 
 Before you can actually use the driver, you need to get yourself an
-adapter cable to connect the X-Box controller to your Linux-Box.
+adapter cable to connect the X-Box controller to your Linux-Box. You
+can buy these online fairly cheap, or build your own.
 
-Such a cable is pretty easy to build. The Controller itself is a USB compound
-device (a hub with three ports for two expansion slots and the controller
-device) with the only difference in a nonstandard connector (5 pins vs. 4 on
-standard USB connector).
+Such a cable is pretty easy to build. The Controller itself is a USB
+compound device (a hub with three ports for two expansion slots and
+the controller device) with the only difference in a nonstandard connector
+(5 pins vs. 4 on standard USB connector).
 
 You just need to solder a USB connector onto the cable and keep the
 yellow wire unconnected. The other pins have the same order on both
@@ -51,36 +102,36 @@ original one. You can buy an extension cable and cut that instead. That way,
 you can still use the controller with your X-Box, if you have one ;)
 
 
-2. driver installation
+2. Driver Installation
 ----------------------
 
 Once you have the adapter cable and the controller is connected, you need
 to load your USB subsystem and should cat /proc/bus/usb/devices.
 There should be an entry like the one at the end [4].
 
-Currently (as of version 0.0.4), the following three devices are included:
+Currently (as of version 0.0.6), the following devices are included:
  original Microsoft XBOX controller (US), vendor=0x045e, product=0x0202
+ smaller  Microsoft XBOX controller (US), vendor=0x045e, product=0x0289
  original Microsoft XBOX controller (Japan), vendor=0x045e, product=0x0285
  InterAct PowerPad Pro (Germany), vendor=0x05fd, product=0x107a
+ RedOctane Xbox Dance Pad (US), vendor=0x0c12, product=0x8809
 
-If you have another controller that is not listed above and is not recognized
-by the driver, please drop me a line with the appropriate info (that is, include
-the name, vendor and product ID, as well as the country where you bought it;
-sending the whole dump out of /proc/bus/usb/devices along would be even better).
+The driver should work with xbox pads not listed above as well, however
+you will need to do something extra for dance pads to work.
 
-In theory, the driver should work with other controllers than mine
-(InterAct PowerPad pro, bought in Germany) just fine, but I cannot test this
-for I only have this one controller.
+If you have a controller not listed above, see 0.3 - Unknown Controllers
 
 If you compiled and installed the driver, test the functionality:
 > modprobe xpad
 > modprobe joydev
 > jstest /dev/js0
 
-There should be a single line showing 18 inputs (8 axes, 10 buttons), and
-it's values should change if you move the sticks and push the buttons.
+If you're using a normal controller, there should be a single line showing
+18 inputs (8 axes, 10 buttons), and its values should change if you move
+the sticks and push the buttons.  If you're using a dance pad, it should
+show 20 inputs (6 axes, 14 buttons).
 
-It works? Voila, your done ;)
+It works? Voila, you're done ;)
 
 
 3. Thanks
@@ -111,6 +162,22 @@ I:  If#= 0 Alt= 0 #EPs= 2 Cls=58(unk. ) Sub=42 Prot=00 Driver=(none)
 E:  Ad=81(I) Atr=03(Int.) MxPS=  32 Ivl= 10ms
 E:  Ad=02(O) Atr=03(Int.) MxPS=  32 Ivl= 10ms
 
+5. /proc/bus/usb/devices - dump from Redoctane Xbox Dance Pad (US):
+
+T:  Bus=01 Lev=02 Prnt=09 Port=00 Cnt=01 Dev#= 10 Spd=12  MxCh= 0
+D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
+P:  Vendor=0c12 ProdID=8809 Rev= 0.01
+S:  Product=XBOX DDR
+C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
+I:  If#= 0 Alt= 0 #EPs= 2 Cls=58(unk. ) Sub=42 Prot=00 Driver=xpad
+E:  Ad=82(I) Atr=03(Int.) MxPS=  32 Ivl=4ms
+E:  Ad=02(O) Atr=03(Int.) MxPS=  32 Ivl=4ms
+
 -- 
 Marko Friedemann <mfr@bmx-chemnitz.de>
 2002-07-16
+ - original doc
+
+Dominic Cerquetti <binary1230@yahoo.com>
+2005-03-19
+ - added stuff for dance pads, new d-pad->axes mappings
index ff571f9298e0530bb38d3ffdaabea01f1b4aec17..dd00fd556a60abad15662319d5c46fd0f166b26a 100644 (file)
@@ -1231,6 +1231,11 @@ and is between 256 and 4096 characters. It is defined in the file
                                machine check when some devices' config space
                                is read. But various workarounds are disabled
                                and some IOMMU drivers will not work.
+               bfsort          Sort PCI devices into breadth-first order.
+                               This sorting is done to get a device
+                               order compatible with older (<= 2.4) kernels.
+               nobfsort        Don't sort PCI devices into breadth-first order.
+
        pcmv=           [HW,PCMCIA] BadgePAD 4
 
        pd.             [PARIDE]
index 994355b0cd19087654d8cab690597944ed633a0a..7f790f66ec68528776852d15a3f60ab60dcd94b6 100644 (file)
@@ -1898,7 +1898,7 @@ queue before processing any further requests:
        smp_wmb();
        <A:modify v=2>  <C:busy>
                        <C:queue v=2>
-       p = &b;         q = p;
+       p = &v;         q = p;
                        <D:request p>
        <B:modify p=&v> <D:commit p=&v>
                        <D:read p>
index 69ddc5c14b7990592a1710957985fd9b6e01369b..e1304b6bc48349d518472ce94e37b581ec03d521 100644 (file)
@@ -63,7 +63,7 @@ the following functions or values:
   a) board_time_init - a function pointer.  Invoked at the beginnig of
      time_init().  It is optional.
        1. (optional) set up RTC routines
-       2. (optional) calibrate and set the mips_counter_frequency
+       2. (optional) calibrate and set the mips_hpt_frequency
 
   b) plat_timer_setup - a function pointer.  Invoked at the end of time_init()
        1. (optional) over-ride any decisions made in time_init()
@@ -72,7 +72,7 @@ the following functions or values:
 
   c) (optional) board-specific RTC routines.
 
-  d) (optional) mips_counter_frequency - It must be definied if the board
+  d) (optional) mips_hpt_frequency - It must be definied if the board
      is using CPU counter for timer interrupt or it is using fixed rate
      gettimeoffset().
 
@@ -104,7 +104,7 @@ Step 1: decide how you like to implement the time services.
      or use an exnternal timer?
 
      In order to use CPU counter register as the timer interrupt source, you
-     must know the counter speed (mips_counter_frequency).  It is usually the
+     must know the counter speed (mips_hpt_frequency).  It is usually the
      same as the CPU speed or an integral divisor of it.
 
   d) decide on whether you want to use high-level or low-level timer
@@ -121,8 +121,8 @@ Step 3: implement rtc routines, board_time_init() and plat_timer_setup()
   if needed.
 
   board_time_init() -
-       a) (optional) set up RTC routines, 
-        b) (optional) calibrate and set the mips_counter_frequency
+       a) (optional) set up RTC routines,
+        b) (optional) calibrate and set the mips_hpt_frequency
            (only needed if you intended to use fixed_rate_gettimeoffset
             or use cpu counter as timer interrupt source)
 
index 59d1166d41eeebc095528a84a24fa584ea0c953d..d684a6ac69a8ec2b8e06016f31e23bef2faf5130 100644 (file)
@@ -66,7 +66,7 @@ Command line parameters
 
   When a device is un-ignored, device recognition and sensing is performed and 
   the device driver will be notified if possible, so the device will become
-  available to the system.
+  available to the system. Note that un-ignoring is performed asynchronously.
 
   You can also add ranges of devices to be ignored by piping to 
   /proc/cio_ignore; "add <device range>, <device range>, ..." will ignore the
index d80e5733827d2ae0ac58a82f166baf08a7a7daef..32a96cc392151abf7e04f505069e5a6499c80860 100644 (file)
@@ -174,14 +174,10 @@ read_dev_chars() - Read Device Characteristics
 
 This routine returns the characteristics for the device specified.
 
-The function is meant to be called with an irq handler in place; that is,
+The function is meant to be called with the device already enabled; that is,
 at earliest during set_online() processing.
 
-While the request is processed synchronously, the device interrupt
-handler is called for final ending status. In case of error situations the
-interrupt handler may recover appropriately. The device irq handler can
-recognize the corresponding interrupts by the interruption parameter be
-0x00524443. The ccw_device must not be locked prior to calling read_dev_chars().
+The ccw_device must not be locked prior to calling read_dev_chars().
 
 The function may be called enabled or disabled.
 
@@ -410,26 +406,7 @@ individual flag meanings.
 
 Usage Notes :
 
-Prior to call ccw_device_start() the device driver must assure disabled state,
-i.e. the I/O mask value in the PSW must be disabled. This can be accomplished
-by calling local_save_flags( flags). The current PSW flags are preserved and
-can be restored by local_irq_restore( flags) at a later time.
-
-If the device driver violates this rule while running in a uni-processor
-environment an interrupt might be presented prior to the ccw_device_start()
-routine returning to the device driver main path. In this case we will end in a
-deadlock situation as the interrupt handler will try to obtain the irq
-lock the device driver still owns (see below) !
-
-The driver must assure to hold the device specific lock. This can be
-accomplished by
-
-(i)  spin_lock(get_ccwdev_lock(cdev)), or
-(ii) spin_lock_irqsave(get_ccwdev_lock(cdev), flags)
-
-Option (i) should be used if the calling routine is running disabled for
-I/O interrupts (see above) already. Option (ii) obtains the device gate und
-puts the CPU into I/O disabled state by preserving the current PSW flags.
+ccw_device_start() must be called disabled and with the ccw device lock held.
 
 The device driver is allowed to issue the next ccw_device_start() call from
 within its interrupt handler already. It is not required to schedule a
@@ -488,7 +465,7 @@ int ccw_device_resume(struct ccw_device *cdev);
 
 cdev - ccw_device the resume operation is requested for
 
-The resume_IO() function returns:
+The ccw_device_resume() function returns:
 
         0  - suspended channel program is resumed
 -EBUSY     - status pending
@@ -507,6 +484,8 @@ a long-running channel program or the device might require to initially issue
 a halt subchannel (HSCH) I/O command. For those purposes the ccw_device_halt()
 command is provided.
 
+ccw_device_halt() must be called disabled and with the ccw device lock held.
+
 int ccw_device_halt(struct ccw_device *cdev,
                     unsigned long intparm);
 
@@ -517,7 +496,7 @@ intparm : interruption parameter; value is only used if no I/O
 
 The ccw_device_halt() function returns :
 
-      0 - successful completion or request successfully initiated
+      0 - request successfully initiated
 -EBUSY  - the device is currently busy, or status pending.
 -ENODEV - cdev invalid.
 -EINVAL - The device is not operational or the ccw device is not online.
@@ -533,6 +512,23 @@ can then perform an appropriate action. Prior to interrupt of an outstanding
 read to a network device (with or without PCI flag) a ccw_device_halt()
 is required to end the pending operation.
 
+ccw_device_clear() - Terminage I/O Request Processing
+
+In order to terminate all I/O processing at the subchannel, the clear subchannel
+(CSCH) command is used. It can be issued via ccw_device_clear().
+
+ccw_device_clear() must be called disabled and with the ccw device lock held.
+
+int ccw_device_clear(struct ccw_device *cdev, unsigned long intparm);
+
+cdev:   ccw_device the clear operation is requested for
+intparm: interruption parameter (see ccw_device_halt())
+
+The ccw_device_clear() function returns:
+
+      0 - request successfully initiated
+-ENODEV - cdev invalid
+-EINVAL - The device is not operational or the ccw device is not online.
 
 Miscellaneous Support Routines
 
index 62c082387aea294ca627f9e0f9cd6514fb4c6983..77bf450ec39be579ae422916c569e2f31bf344a9 100644 (file)
@@ -239,6 +239,9 @@ status - Can be 'online' or 'offline'.
 
 type - The physical type of the channel path.
 
+shared - Whether the channel path is shared.
+
+cmg - The channel measurement group.
 
 3. System devices
 -----------------
index 126e59d935cd2348f162fc06aefe2538478584c4..8755b3e7b09e500446d99800e8abc90df96c2b85 100644 (file)
@@ -51,7 +51,7 @@
  50 -> NPG Tech Real TV FM Top 10                          [14f1:0842]
  51 -> WinFast DTV2000 H                                   [107d:665e]
  52 -> Geniatech DVB-S                                     [14f1:0084]
- 53 -> Hauppauge WinTV-HVR3000 TriMode Analog/DVB-S/DVB-T  [0070:1404]
+ 53 -> Hauppauge WinTV-HVR3000 TriMode Analog/DVB-S/DVB-T  [0070:1404,0070:1400,0070:1401,0070:1402]
  54 -> Norwood Micro TV Tuner
  55 -> Shenzhen Tungsten Ages Tech TE-DTV-250 / Swann OEM  [c180:c980]
  56 -> Hauppauge WinTV-HVR1300 DVB-T/Hybrid MPEG Encoder   [0070:9600,0070:9601,0070:9602]
index 1b5430a49fdd0dc39fac28f385628f7e14ba8e8d..d708702aba2f292b83bc62fb20274d18f3389716 100644 (file)
@@ -1668,6 +1668,12 @@ M:       sct@redhat.com, akpm@osdl.org
 L:     ext2-devel@lists.sourceforge.net
 S:     Maintained
 
+K8TEMP HARDWARE MONITORING DRIVER
+P:     Rudolf Marek
+M:     r.marek@assembler.cz
+L:     lm-sensors@lm-sensors.org
+S:     Maintained
+
 KCONFIG
 P:     Roman Zippel
 M:     zippel@linux-m68k.org
@@ -1998,6 +2004,13 @@ M:       rubini@ipvvis.unipv.it
 L:     linux-kernel@vger.kernel.org
 S:     Maintained
 
+MSI LAPTOP SUPPORT
+P:     Lennart Poettering
+M:     mzxreary@0pointer.de
+L:     https://tango.0pointer.de/mailman/listinfo/s270-linux
+W:     http://0pointer.de/lennart/tchibo.html
+S:     Maintained
+
 MTRR AND SIMILAR SUPPORT [i386]
 P:     Richard Gooch
 M:     rgooch@atnf.csiro.au
@@ -2005,8 +2018,11 @@ L:       linux-kernel@vger.kernel.org
 W:     http://www.atnf.csiro.au/~rgooch/linux/kernel-patches.html
 S:     Maintained
 
-MULTIMEDIA CARD (MMC) SUBSYSTEM
-S:     Orphan
+MULTIMEDIA CARD (MMC) AND SECURE DIGITAL (SD) SUBSYSTEM
+P:     Pierre Ossman
+M:     drzeus-mmc@drzeus.cx
+L:     linux-kernel@vger.kernel.org
+S:     Maintained
 
 MULTISOUND SOUND DRIVER
 P:     Andrew Veliath
@@ -2042,11 +2058,13 @@ P:      Marc Boucher
 P:     James Morris
 P:     Harald Welte
 P:     Jozsef Kadlecsik
-M:     coreteam@netfilter.org
+P:     Patrick McHardy
+M:     kaber@trash.net
+L:     netfilter-devel@lists.netfilter.org
+L:     netfilter@lists.netfilter.org
+L:     coreteam@netfilter.org
 W:     http://www.netfilter.org/
 W:     http://www.iptables.org/
-L:     netfilter@lists.netfilter.org
-L:     netfilter-devel@lists.netfilter.org
 S:     Supported
 
 NETLABEL
@@ -2297,8 +2315,8 @@ T:        quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/
 S:     Supported
 
 PCI HOTPLUG CORE
-P:     Greg Kroah-Hartman
-M:     gregkh@suse.de
+P:     Kristen Carlson Accardi
+M:     kristen.c.accardi@intel.com
 S:     Supported
 
 PCI HOTPLUG COMPAQ DRIVER
index 703d40a65e7e230b4d7d70b246ff93b1306ae85c..389ff0cca9a7f3e0f3a5c8dba0c8f6539e79763c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -499,6 +499,7 @@ endif
 
 ifdef CONFIG_UNWIND_INFO
 CFLAGS         += -fasynchronous-unwind-tables
+LDFLAGS_vmlinux        += --eh-frame-hdr
 endif
 
 ifdef CONFIG_DEBUG_INFO
@@ -1319,7 +1320,8 @@ define xtags
            $(all-sources) | xargs $1 -a \
                -I __initdata,__exitdata,__acquires,__releases \
                -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \
-               --extra=+f --c-kinds=+px; \
+               --extra=+f --c-kinds=+px \
+               --regex-asm='/ENTRY\(([^)]*)\).*/\1/'; \
            $(all-kconfigs) | xargs $1 -a \
                --langdef=kconfig \
                --language-force=kconfig \
index fa5d4976f514e6b8469813452da1c79b7a10527f..1463330ed8ee6b441991f9ca801194f644499edf 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/ioport.h>
+#include <linux/irq.h>
 
 #include <asm/io.h>
 #include <asm/irq.h>
index a6f14801872d3aa73f75b26dd2d4bb31d45f4f7b..9ee63834e6031839a7776492adaa734d5a27347b 100644 (file)
@@ -133,11 +133,13 @@ static void ixdp2400_pci_postinit(void)
        struct pci_dev *dev;
 
        if (ixdp2x00_master_npu()) {
-               dev = pci_find_slot(1, IXDP2400_SLAVE_ENET_DEVFN);
+               dev = pci_get_bus_and_slot(1, IXDP2400_SLAVE_ENET_DEVFN);
                pci_remove_bus_device(dev);
+               pci_dev_put(dev)
        } else {
-               dev = pci_find_slot(1, IXDP2400_MASTER_ENET_DEVFN);
+               dev = pci_get_bus_and_slot(1, IXDP2400_MASTER_ENET_DEVFN);
                pci_remove_bus_device(dev);
+               pci_dev_put(dev)
 
                ixdp2x00_slave_pci_postinit();
        }
index 91d36d91dac03f501a4a3c4377a9802ac13d7082..70d247f09a7ecebe5451f4290efdea4c362b0bbb 100644 (file)
@@ -261,14 +261,16 @@ int __init ixdp2800_pci_init(void)
 
                pci_common_init(&ixdp2800_pci);
                if (ixdp2x00_master_npu()) {
-                       dev = pci_find_slot(1, IXDP2800_SLAVE_ENET_DEVFN);
+                       dev = pci_get_bus_and_slot(1, IXDP2800_SLAVE_ENET_DEVFN);
                        pci_remove_bus_device(dev);
+                       pci_dev_put(dev);
 
                        ixdp2800_master_enable_slave();
                        ixdp2800_master_wait_for_slave_bus_scan();
                } else {
-                       dev = pci_find_slot(1, IXDP2800_MASTER_ENET_DEVFN);
+                       dev = pci_get_bus_and_slot(1, IXDP2800_MASTER_ENET_DEVFN);
                        pci_remove_bus_device(dev);
+                       pci_dev_put(dev);
                }
        }
 
index af48cb52dfc47b48378308e37c2c41c9b542f520..aa2655092d2dc728805609969a7bbf43331e4ef8 100644 (file)
@@ -241,11 +241,14 @@ void ixdp2x00_slave_pci_postinit(void)
        /*
         * Remove PMC device is there is one
         */
-       if((dev = pci_find_slot(1, IXDP2X00_PMC_DEVFN)))
+       if((dev = pci_get_bus_and_slot(1, IXDP2X00_PMC_DEVFN))) {
                pci_remove_bus_device(dev);
+               pci_dev_put(dev);
+       }
 
-       dev = pci_find_slot(0, IXDP2X00_21555_DEVFN);
+       dev = pci_get_bus_and_slot(0, IXDP2X00_21555_DEVFN);
        pci_remove_bus_device(dev);
+       pci_dev_put(dev);
 }
 
 /**************************************************************************
index 18e8bb4eb202280446f251f20dc7f5f006a20d35..0ca20c6c83b7be253e4ae897f6ba2b01af90f496 100644 (file)
@@ -15,4 +15,4 @@ extern void lh7a404_init_irq (void);
 extern void lh7a40x_clcd_init (void);
 extern void lh7a40x_init_board_irq (void);
 
-#define IRQ_DISPATCH(irq) desc_handle_irq((irq),(irq_desc + irq), regs)
+#define IRQ_DISPATCH(irq) desc_handle_irq((irq),(irq_desc + irq))
index ee80d62119d353d61e0fa48db55ff21c591fc550..142c33c3dff57ab4233ef0b4db002c12906c33a3 100644 (file)
@@ -397,7 +397,7 @@ static void lubbock_mmc_poll(unsigned long data)
        if (LUB_IRQ_SET_CLR & (1 << 0))
                mod_timer(&mmc_timer, jiffies + MMC_POLL_RATE);
        else {
-               (void) mmc_detect_int(LUBBOCK_SD_IRQ, (void *)data, NULL);
+               (void) mmc_detect_int(LUBBOCK_SD_IRQ, (void *)data);
                enable_irq(LUBBOCK_SD_IRQ);
        }
 }
index 639597729932e5ce821569f03fcd19184b4515fc..90a4130114a61dcc555139359a3848e1d845f288 100644 (file)
@@ -82,6 +82,14 @@ static struct sdram_params sdram_tbl[] __initdata = {
                .twr            = 9,
                .refresh        = 64000,
                .cas_latency    = 3,
+       }, {    /* Samsung K4S281632B-1H */
+               .name           = "K4S281632b-1H",
+               .rows           = 12,
+               .tck            = 10,
+               .trp            = 20,
+               .twr            = 10,
+               .refresh        = 64000,
+               .cas_latency    = 3,
        }, {    /* Samsung KM416S4030CT */
                .name           = "KM416S4030CT",
                .rows           = 13,
@@ -366,6 +374,8 @@ static int __init sa1110_clk_init(void)
 
                if (machine_is_h3100())
                        name = "KM416S4030CT";
+               if (machine_is_jornada720())
+                       name = "K4S281632B-1H";
        }
 
        sdram = sa1110_find_sdram(name);
index 7899d3ca75a367da1b3a61958668514900122d77..7c3289c2acd7d4b2add8364c502b368ac9e88d9e 100644 (file)
@@ -20,7 +20,8 @@
 #include <linux/sched.h>
 #include <linux/oprofile.h>
 #include <linux/interrupt.h>
-#include <asm/irq.h>
+#include <linux/irq.h>
+
 #include <asm/system.h>
 
 #include "op_counter.h"
index b02af1d740fab56b1f28c7525f7ac97f3006829f..579c69ae9ff78ac47d3b2e01b2830f6da88d80c2 100644 (file)
@@ -4,7 +4,7 @@
 #
 # Up to date versions of this file can be obtained from:
 #
-#   http://www.arm.linux.org.uk/developer/machines/?action=download
+#   http://www.arm.linux.org.uk/developer/machines/download.php
 #
 # Please do not send patches to this file; it is automatically generated!
 # To add an entry into this database, please see Documentation/arm/README,
@@ -12,7 +12,7 @@
 #
 #   http://www.arm.linux.org.uk/developer/machines/?action=new
 #
-# Last update: Sat Sep 23 13:20:43 2006
+# Last update: Mon Oct 16 21:13:36 2006
 #
 # machine_is_xxx       CONFIG_xxxx             MACH_TYPE_xxx           number
 #
@@ -1157,3 +1157,17 @@ adsturboxb               MACH_ADSTURBOXB         ADSTURBOXB              1143
 oti4110                        MACH_OTI4110            OTI4110                 1144
 hme_pxa                        MACH_HME_PXA            HME_PXA                 1145
 deisterdca             MACH_DEISTERDCA         DEISTERDCA              1146
+ces_ssem2              MACH_CES_SSEM2          CES_SSEM2               1147
+ces_mtr                        MACH_CES_MTR            CES_MTR                 1148
+tds_avng_sbc           MACH_TDS_AVNG_SBC       TDS_AVNG_SBC            1149
+everest                        MACH_EVEREST            EVEREST                 1150
+pnx4010                        MACH_PNX4010            PNX4010                 1151
+oxnas                  MACH_OXNAS              OXNAS                   1152
+fiori                  MACH_FIORI              FIORI                   1153
+ml1200                 MACH_ML1200             ML1200                  1154
+cactus                 MACH_CACTUS             CACTUS                  1155
+nb2xxx                 MACH_NB2XXX             NB2XXX                  1156
+hw6900                 MACH_HW6900             HW6900                  1157
+cdcs_quoll             MACH_CDCS_QUOLL         CDCS_QUOLL              1158
+quicksilver            MACH_QUICKSILVER        QUICKSILVER             1159
+uplat926               MACH_UPLAT926           UPLAT926                1160
index 7cc0b189b82baa80d83d813a11ec256243a6cb0c..0677908dfa0600dd3f5cf9e315d4ad62154aca3f 100644 (file)
@@ -42,6 +42,10 @@ cflags-$(CONFIG_REGPARM) += -mregparm=3
 # temporary until string.h is fixed
 cflags-y += -ffreestanding
 
+# this works around some issues with generating unwind tables in older gccs
+# newer gccs do it by default
+cflags-y += -maccumulate-outgoing-args
+
 # Disable unit-at-a-time mode on pre-gcc-4.0 compilers, it makes gcc use
 # a lot more stack due to the lack of sharing of stacklots:
 CFLAGS                         += $(shell if [ $(call cc-version) -lt 0400 ] ; then echo $(call cc-option,-fno-unit-at-a-time); fi ;)
@@ -51,8 +55,8 @@ cflags-y += $(call as-instr,.cfi_startproc\n.cfi_endproc,-DCONFIG_AS_CFI=1,)
 AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_endproc,-DCONFIG_AS_CFI=1,)
 
 # is .cfi_signal_frame supported too?
-cflags-y += $(call as-instr,.cfi_startproc\n.cfi_endproc,-DCONFIG_AS_CFI=1,)
-AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_endproc,-DCONFIG_AS_CFI=1,)
+cflags-y += $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONFIG_AS_CFI_SIGNAL_FRAME=1,)
+AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONFIG_AS_CFI_SIGNAL_FRAME=1,)
 
 CFLAGS += $(cflags-y)
 
index 60c0c02574f08c7edad60a99e0125d5c96a8539a..97aacd6bd7d810a85c15f9d96811167b5b680165 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.19-rc1
-# Thu Oct  5 13:04:53 2006
+# Linux kernel version: 2.6.19-rc2-git4
+# Sat Oct 21 03:38:56 2006
 #
 CONFIG_X86_32=y
 CONFIG_GENERIC_TIME=y
@@ -380,8 +380,8 @@ CONFIG_INET6_XFRM_MODE_TRANSPORT=y
 CONFIG_INET6_XFRM_MODE_TUNNEL=y
 # CONFIG_INET6_XFRM_MODE_BEET is not set
 # CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
+CONFIG_IPV6_SIT=y
 # CONFIG_IPV6_TUNNEL is not set
-# CONFIG_IPV6_SUBTREES is not set
 # CONFIG_IPV6_MULTIPLE_TABLES is not set
 # CONFIG_NETWORK_SECMARK is not set
 # CONFIG_NETFILTER is not set
@@ -482,6 +482,13 @@ CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
 
+#
+# Misc devices
+#
+# CONFIG_IBM_ASM is not set
+# CONFIG_SGI_IOC4 is not set
+# CONFIG_TIFM_CORE is not set
+
 #
 # ATA/ATAPI/MFM/RLL support
 #
@@ -1024,6 +1031,7 @@ CONFIG_HANGCHECK_TIMER=y
 #
 # Dallas's 1-wire bus
 #
+# CONFIG_W1 is not set
 
 #
 # Hardware Monitoring support
@@ -1031,12 +1039,6 @@ CONFIG_HANGCHECK_TIMER=y
 # CONFIG_HWMON is not set
 # CONFIG_HWMON_VID is not set
 
-#
-# Misc devices
-#
-# CONFIG_IBM_ASM is not set
-# CONFIG_TIFM_CORE is not set
-
 #
 # Multimedia devices
 #
@@ -1169,7 +1171,6 @@ CONFIG_USB_HIDINPUT=y
 # CONFIG_USB_ATI_REMOTE2 is not set
 # CONFIG_USB_KEYSPAN_REMOTE is not set
 # CONFIG_USB_APPLETOUCH is not set
-# CONFIG_USB_TRANCEVIBRATOR is not set
 
 #
 # USB Imaging devices
@@ -1215,6 +1216,7 @@ CONFIG_USB_MON=y
 # CONFIG_USB_APPLEDISPLAY is not set
 # CONFIG_USB_SISUSBVGA is not set
 # CONFIG_USB_LD is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
 # CONFIG_USB_TEST is not set
 
 #
@@ -1284,6 +1286,7 @@ CONFIG_EXT3_FS=y
 CONFIG_EXT3_FS_XATTR=y
 CONFIG_EXT3_FS_POSIX_ACL=y
 # CONFIG_EXT3_FS_SECURITY is not set
+# CONFIG_EXT4DEV_FS is not set
 CONFIG_JBD=y
 # CONFIG_JBD_DEBUG is not set
 CONFIG_FS_MBCACHE=y
@@ -1307,6 +1310,7 @@ CONFIG_DNOTIFY=y
 # CONFIG_AUTOFS_FS is not set
 CONFIG_AUTOFS4_FS=y
 # CONFIG_FUSE_FS is not set
+CONFIG_GENERIC_ACL=y
 
 #
 # CD-ROM/DVD Filesystems
@@ -1384,7 +1388,6 @@ CONFIG_SUNRPC=y
 # CONFIG_CODA_FS is not set
 # CONFIG_AFS_FS is not set
 # CONFIG_9P_FS is not set
-CONFIG_GENERIC_ACL=y
 
 #
 # Partition Types
@@ -1436,10 +1439,6 @@ CONFIG_NLS_ISO8859_15=y
 # CONFIG_NLS_KOI8_U is not set
 CONFIG_NLS_UTF8=y
 
-#
-# Distributed Lock Manager
-#
-
 #
 # Instrumentation Support
 #
@@ -1480,6 +1479,7 @@ CONFIG_DEBUG_BUGVERBOSE=y
 CONFIG_UNWIND_INFO=y
 CONFIG_STACK_UNWIND=y
 # CONFIG_FORCED_INLINING is not set
+# CONFIG_HEADERS_CHECK is not set
 # CONFIG_RCU_TORTURE_TEST is not set
 # CONFIG_LKDTM is not set
 CONFIG_EARLY_PRINTK=y
index 92f79cdd9a48c97aebb8a207a211cf28e421707a..ab974ff970730ec48300a2db994d1c9628f07d00 100644 (file)
@@ -332,7 +332,7 @@ acpi_parse_ioapic(acpi_table_entry_header * header, const unsigned long end)
 /*
  * Parse Interrupt Source Override for the ACPI SCI
  */
-static void acpi_sci_ioapic_setup(u32 gsi, u16 polarity, u16 trigger)
+static void acpi_sci_ioapic_setup(u32 bus_irq, u32 gsi, u16 polarity, u16 trigger)
 {
        if (trigger == 0)       /* compatible SCI trigger is level */
                trigger = 3;
@@ -352,13 +352,13 @@ static void acpi_sci_ioapic_setup(u32 gsi, u16 polarity, u16 trigger)
         * If GSI is < 16, this will update its flags,
         * else it will create a new mp_irqs[] entry.
         */
-       mp_override_legacy_irq(gsi, polarity, trigger, gsi);
+       mp_override_legacy_irq(bus_irq, polarity, trigger, gsi);
 
        /*
         * stash over-ride to indicate we've been here
         * and for later update of acpi_fadt
         */
-       acpi_sci_override_gsi = gsi;
+       acpi_sci_override_gsi = bus_irq;
        return;
 }
 
@@ -376,7 +376,7 @@ acpi_parse_int_src_ovr(acpi_table_entry_header * header,
        acpi_table_print_madt_entry(header);
 
        if (intsrc->bus_irq == acpi_fadt.sci_int) {
-               acpi_sci_ioapic_setup(intsrc->global_irq,
+               acpi_sci_ioapic_setup(intsrc->bus_irq, intsrc->global_irq,
                                      intsrc->flags.polarity,
                                      intsrc->flags.trigger);
                return 0;
@@ -879,7 +879,7 @@ static int __init acpi_parse_madt_ioapic_entries(void)
         * pretend we got one so we can set the SCI flags.
         */
        if (!acpi_sci_override_gsi)
-               acpi_sci_ioapic_setup(acpi_fadt.sci_int, 0, 0);
+               acpi_sci_ioapic_setup(acpi_fadt.sci_int, acpi_fadt.sci_int, 0, 0);
 
        /* Fill in identity legacy mapings where no override */
        mp_config_acpi_legacy_irqs();
index 25db49ef1770aa11ce148f1d35789e85bc125151..20563e52c62248853e9d4fbc9af48461c27696bd 100644 (file)
@@ -10,6 +10,7 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/acpi.h>
+#include <linux/cpu.h>
 
 #include <acpi/processor.h>
 #include <asm/acpi.h>
@@ -41,5 +42,124 @@ void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags,
                flags->bm_check = 1;
        }
 }
-
 EXPORT_SYMBOL(acpi_processor_power_init_bm_check);
+
+/* The code below handles cstate entry with monitor-mwait pair on Intel*/
+
+struct cstate_entry_s {
+       struct {
+               unsigned int eax;
+               unsigned int ecx;
+       } states[ACPI_PROCESSOR_MAX_POWER];
+};
+static struct cstate_entry_s *cpu_cstate_entry;        /* per CPU ptr */
+
+static short mwait_supported[ACPI_PROCESSOR_MAX_POWER];
+
+#define MWAIT_SUBSTATE_MASK    (0xf)
+#define MWAIT_SUBSTATE_SIZE    (4)
+
+#define CPUID_MWAIT_LEAF (5)
+#define CPUID5_ECX_EXTENSIONS_SUPPORTED (0x1)
+#define CPUID5_ECX_INTERRUPT_BREAK     (0x2)
+
+#define MWAIT_ECX_INTERRUPT_BREAK      (0x1)
+
+#define NATIVE_CSTATE_BEYOND_HALT      (2)
+
+int acpi_processor_ffh_cstate_probe(unsigned int cpu,
+               struct acpi_processor_cx *cx, struct acpi_power_register *reg)
+{
+       struct cstate_entry_s *percpu_entry;
+       struct cpuinfo_x86 *c = cpu_data + cpu;
+
+       cpumask_t saved_mask;
+       int retval;
+       unsigned int eax, ebx, ecx, edx;
+       unsigned int edx_part;
+       unsigned int cstate_type; /* C-state type and not ACPI C-state type */
+       unsigned int num_cstate_subtype;
+
+       if (!cpu_cstate_entry || c->cpuid_level < CPUID_MWAIT_LEAF )
+               return -1;
+
+       if (reg->bit_offset != NATIVE_CSTATE_BEYOND_HALT)
+               return -1;
+
+       percpu_entry = per_cpu_ptr(cpu_cstate_entry, cpu);
+       percpu_entry->states[cx->index].eax = 0;
+       percpu_entry->states[cx->index].ecx = 0;
+
+       /* Make sure we are running on right CPU */
+       saved_mask = current->cpus_allowed;
+       retval = set_cpus_allowed(current, cpumask_of_cpu(cpu));
+       if (retval)
+               return -1;
+
+       cpuid(CPUID_MWAIT_LEAF, &eax, &ebx, &ecx, &edx);
+
+       /* Check whether this particular cx_type (in CST) is supported or not */
+       cstate_type = (cx->address >> MWAIT_SUBSTATE_SIZE) + 1;
+       edx_part = edx >> (cstate_type * MWAIT_SUBSTATE_SIZE);
+       num_cstate_subtype = edx_part & MWAIT_SUBSTATE_MASK;
+
+       retval = 0;
+       if (num_cstate_subtype < (cx->address & MWAIT_SUBSTATE_MASK)) {
+               retval = -1;
+               goto out;
+       }
+
+       /* mwait ecx extensions INTERRUPT_BREAK should be supported for C2/C3 */
+       if (!(ecx & CPUID5_ECX_EXTENSIONS_SUPPORTED) ||
+           !(ecx & CPUID5_ECX_INTERRUPT_BREAK)) {
+               retval = -1;
+               goto out;
+       }
+       percpu_entry->states[cx->index].ecx = MWAIT_ECX_INTERRUPT_BREAK;
+
+       /* Use the hint in CST */
+       percpu_entry->states[cx->index].eax = cx->address;
+
+       if (!mwait_supported[cstate_type]) {
+               mwait_supported[cstate_type] = 1;
+               printk(KERN_DEBUG "Monitor-Mwait will be used to enter C-%d "
+                      "state\n", cx->type);
+       }
+
+out:
+       set_cpus_allowed(current, saved_mask);
+       return retval;
+}
+EXPORT_SYMBOL_GPL(acpi_processor_ffh_cstate_probe);
+
+void acpi_processor_ffh_cstate_enter(struct acpi_processor_cx *cx)
+{
+       unsigned int cpu = smp_processor_id();
+       struct cstate_entry_s *percpu_entry;
+
+       percpu_entry = per_cpu_ptr(cpu_cstate_entry, cpu);
+       mwait_idle_with_hints(percpu_entry->states[cx->index].eax,
+                             percpu_entry->states[cx->index].ecx);
+}
+EXPORT_SYMBOL_GPL(acpi_processor_ffh_cstate_enter);
+
+static int __init ffh_cstate_init(void)
+{
+       struct cpuinfo_x86 *c = &boot_cpu_data;
+       if (c->x86_vendor != X86_VENDOR_INTEL)
+               return -1;
+
+       cpu_cstate_entry = alloc_percpu(struct cstate_entry_s);
+       return 0;
+}
+
+static void __exit ffh_cstate_exit(void)
+{
+       if (cpu_cstate_entry) {
+               free_percpu(cpu_cstate_entry);
+               cpu_cstate_entry = NULL;
+       }
+}
+
+arch_initcall(ffh_cstate_init);
+__exitcall(ffh_cstate_exit);
index 28ab8064976421ffab42ed3ba07b3063f8fee86b..583c238e17fb2e9550fbbcb490ba1a41288b97dc 100644 (file)
@@ -344,6 +344,7 @@ void alternatives_smp_switch(int smp)
 
 void __init alternative_instructions(void)
 {
+       unsigned long flags;
        if (no_replacement) {
                printk(KERN_INFO "(SMP-)alternatives turned off\n");
                free_init_pages("SMP alternatives",
@@ -351,6 +352,8 @@ void __init alternative_instructions(void)
                                (unsigned long)__smp_alt_end);
                return;
        }
+
+       local_irq_save(flags);
        apply_alternatives(__alt_instructions, __alt_instructions_end);
 
        /* switch to patch-once-at-boottime-only mode and free the
@@ -386,4 +389,5 @@ void __init alternative_instructions(void)
                alternatives_smp_switch(0);
        }
 #endif
+       local_irq_restore(flags);
 }
index b42f2d914af3bb15eada724c854bc92581f47169..2af65858d3229b29cad60a7d25dc88a5a927bb5c 100644 (file)
@@ -540,11 +540,30 @@ static inline void apm_restore_cpus(cpumask_t mask)
  * Also, we KNOW that for the non error case of apm_bios_call, there
  * is no useful data returned in the low order 8 bits of eax.
  */
-#define APM_DO_CLI     \
-       if (apm_info.allow_ints) \
-               local_irq_enable(); \
-       else \
+
+static inline unsigned long __apm_irq_save(void)
+{
+       unsigned long flags;
+       local_save_flags(flags);
+       if (apm_info.allow_ints) {
+               if (irqs_disabled_flags(flags))
+                       local_irq_enable();
+       } else
+               local_irq_disable();
+
+       return flags;
+}
+
+#define apm_irq_save(flags) \
+       do { flags = __apm_irq_save(); } while (0)
+
+static inline void apm_irq_restore(unsigned long flags)
+{
+       if (irqs_disabled_flags(flags))
                local_irq_disable();
+       else if (irqs_disabled())
+               local_irq_enable();
+}
 
 #ifdef APM_ZERO_SEGS
 #      define APM_DECL_SEGS \
@@ -596,12 +615,11 @@ static u8 apm_bios_call(u32 func, u32 ebx_in, u32 ecx_in,
        save_desc_40 = gdt[0x40 / 8];
        gdt[0x40 / 8] = bad_bios_desc;
 
-       local_save_flags(flags);
-       APM_DO_CLI;
+       apm_irq_save(flags);
        APM_DO_SAVE_SEGS;
        apm_bios_call_asm(func, ebx_in, ecx_in, eax, ebx, ecx, edx, esi);
        APM_DO_RESTORE_SEGS;
-       local_irq_restore(flags);
+       apm_irq_restore(flags);
        gdt[0x40 / 8] = save_desc_40;
        put_cpu();
        apm_restore_cpus(cpus);
@@ -640,12 +658,11 @@ static u8 apm_bios_call_simple(u32 func, u32 ebx_in, u32 ecx_in, u32 *eax)
        save_desc_40 = gdt[0x40 / 8];
        gdt[0x40 / 8] = bad_bios_desc;
 
-       local_save_flags(flags);
-       APM_DO_CLI;
+       apm_irq_save(flags);
        APM_DO_SAVE_SEGS;
        error = apm_bios_call_simple_asm(func, ebx_in, ecx_in, eax);
        APM_DO_RESTORE_SEGS;
-       local_irq_restore(flags);
+       apm_irq_restore(flags);
        gdt[0x40 / 8] = save_desc_40;
        put_cpu();
        apm_restore_cpus(cpus);
index be9d883c62ce0302995b56c830530670902a7fe6..ca31f18d277c5487e3afab809783f9d79beb4fbe 100644 (file)
@@ -317,7 +317,7 @@ is386:      movl $2,%ecx            # set MP
        movl %eax,%gs
        lldt %ax
        cld                     # gcc2 wants the direction flag cleared at all times
-       pushl %eax              # fake return address
+       pushl $0                # fake return address for unwinder
 #ifdef CONFIG_SMP
        movb ready, %cl
        movb $1, ready
index 477b24daff539bf3d5a1ab6be6e10f6f10dedc22..9a0060b92e32ace2911ae839a9d8b710e7458ec4 100644 (file)
@@ -109,7 +109,7 @@ static struct clocksource clocksource_pit = {
 
 static int __init init_pit_clocksource(void)
 {
-       if (num_possible_cpus() > 4) /* PIT does not scale! */
+       if (num_possible_cpus() > 1) /* PIT does not scale! */
                return 0;
 
        clocksource_pit.mult = clocksource_hz2mult(CLOCK_TICK_RATE, 20);
index d53eafb6daa70f99c35b9b937acdea5a2a861500..62996cd17084245dafd53bcfab9555c20cc38c60 100644 (file)
@@ -113,7 +113,8 @@ void make_8259A_irq(unsigned int irq)
 {
        disable_irq_nosync(irq);
        io_apic_irqs &= ~(1<<irq);
-       set_irq_chip_and_handler(irq, &i8259A_chip, handle_level_irq);
+       set_irq_chip_and_handler_name(irq, &i8259A_chip, handle_level_irq,
+                                     "XT");
        enable_irq(irq);
 }
 
@@ -369,8 +370,8 @@ void __init init_ISA_irqs (void)
                        /*
                         * 16 old-style INTA-cycle interrupts:
                         */
-                       set_irq_chip_and_handler(i, &i8259A_chip,
-                                                handle_level_irq);
+                       set_irq_chip_and_handler_name(i, &i8259A_chip,
+                                                     handle_level_irq, "XT");
                } else {
                        /*
                         * 'high' PCI IRQs filled in on demand
index 27bceaf5ce40e3e5750cd0a183d3d4b537598bc5..350192d6ab986f70314abb98e7e2a68a04d0b9e7 100644 (file)
@@ -1225,11 +1225,11 @@ static void ioapic_register_intr(int irq, int vector, unsigned long trigger)
 {
        if ((trigger == IOAPIC_AUTO && IO_APIC_irq_trigger(irq)) ||
                        trigger == IOAPIC_LEVEL)
-               set_irq_chip_and_handler(irq, &ioapic_chip,
-                                        handle_fasteoi_irq);
+               set_irq_chip_and_handler_name(irq, &ioapic_chip,
+                                        handle_fasteoi_irq, "fasteoi");
        else
-               set_irq_chip_and_handler(irq, &ioapic_chip,
-                                        handle_edge_irq);
+               set_irq_chip_and_handler_name(irq, &ioapic_chip,
+                                        handle_edge_irq, "edge");
        set_intr_gate(vector, interrupt[irq]);
 }
 
@@ -2235,7 +2235,8 @@ static inline void check_timer(void)
        printk(KERN_INFO "...trying to set up timer as Virtual Wire IRQ...");
 
        disable_8259A_irq(0);
-       set_irq_chip_and_handler(0, &lapic_chip, handle_fasteoi_irq);
+       set_irq_chip_and_handler_name(0, &lapic_chip, handle_fasteoi_irq,
+                                     "fasteio");
        apic_write_around(APIC_LVT0, APIC_DM_FIXED | vector);   /* Fixed mode */
        enable_8259A_irq(0);
 
@@ -2541,7 +2542,8 @@ int arch_setup_msi_irq(unsigned int irq, struct pci_dev *dev)
 
        write_msi_msg(irq, &msg);
 
-       set_irq_chip_and_handler(irq, &msi_chip, handle_edge_irq);
+       set_irq_chip_and_handler_name(irq, &msi_chip, handle_edge_irq,
+                                     "edge");
 
        return 0;
 }
@@ -2636,7 +2638,8 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev)
                write_ht_irq_low(irq, low);
                write_ht_irq_high(irq, high);
 
-               set_irq_chip_and_handler(irq, &ht_irq_chip, handle_edge_irq);
+               set_irq_chip_and_handler_name(irq, &ht_irq_chip,
+                                             handle_edge_irq, "edge");
        }
        return vector;
 }
index 8cfc7dbec7b9f006118d49f1d6c7c65e6ab82213..3201d421090a0d2cf5237f4d55ef070d41bc48b9 100644 (file)
@@ -258,7 +258,7 @@ int show_interrupts(struct seq_file *p, void *v)
                        seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
 #endif
                seq_printf(p, " %8s", irq_desc[i].chip->name);
-               seq_printf(p, "-%s", handle_irq_name(irq_desc[i].handle_irq));
+               seq_printf(p, "-%-8s", irq_desc[i].name);
                seq_printf(p, "  %s", action->name);
 
                for (action=action->next; action; action = action->next)
index 3e8e3adb04896243323922cc0dadf3b94429c0c1..eaafe233a5da83f4abbb2c17e670b8a46fa4edaa 100644 (file)
@@ -219,11 +219,11 @@ static int __init check_nmi_watchdog(void)
        int cpu;
 
        /* Enable NMI watchdog for newer systems.
-           Actually it should be safe for most systems before 2004 too except
-          for some IBM systems that corrupt registers when NMI happens
-          during SMM. Unfortunately we don't have more exact information
-          on these and use this coarse check. */
-       if (nmi_watchdog == NMI_DEFAULT && dmi_get_year(DMI_BIOS_DATE) >= 2004)
+          Probably safe on most older systems too, but let's be careful.
+          IBM ThinkPads use INT10 inside SMM and that allows early NMI inside SMM
+          which hangs the system. Disable watchdog for all thinkpads */
+       if (nmi_watchdog == NMI_DEFAULT && dmi_get_year(DMI_BIOS_DATE) >= 2004 &&
+               !dmi_name_in_vendors("ThinkPad"))
                nmi_watchdog = NMI_LOCAL_APIC;
 
        if ((nmi_watchdog == NMI_NONE) || (nmi_watchdog == NMI_DEFAULT))
index b0a07801d9df90abf71f923fa27e55269cacf319..1e1fa3e391a3889ec822c869c19bd9feb76e5e36 100644 (file)
@@ -236,20 +236,28 @@ EXPORT_SYMBOL_GPL(cpu_idle_wait);
  * We execute MONITOR against need_resched and enter optimized wait state
  * through MWAIT. Whenever someone changes need_resched, we would be woken
  * up from MWAIT (without an IPI).
+ *
+ * New with Core Duo processors, MWAIT can take some hints based on CPU
+ * capability.
  */
-static void mwait_idle(void)
+void mwait_idle_with_hints(unsigned long eax, unsigned long ecx)
 {
-       local_irq_enable();
-
-       while (!need_resched()) {
+       if (!need_resched()) {
                __monitor((void *)&current_thread_info()->flags, 0, 0);
                smp_mb();
-               if (need_resched())
-                       break;
-               __mwait(0, 0);
+               if (!need_resched())
+                       __mwait(eax, ecx);
        }
 }
 
+/* Default MONITOR/MWAIT with no hints, used for default C1 state */
+static void mwait_idle(void)
+{
+       local_irq_enable();
+       while (!need_resched())
+               mwait_idle_with_hints(0, 0);
+}
+
 void __devinit select_idle_routine(const struct cpuinfo_x86 *c)
 {
        if (cpu_has(c, X86_FEATURE_MWAIT)) {
@@ -328,7 +336,6 @@ extern void kernel_thread_helper(void);
 int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
 {
        struct pt_regs regs;
-       int err;
 
        memset(&regs, 0, sizeof(regs));
 
@@ -343,10 +350,7 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
        regs.eflags = X86_EFLAGS_IF | X86_EFLAGS_SF | X86_EFLAGS_PF | 0x2;
 
        /* Ok, create the new process.. */
-       err = do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL, NULL);
-       if (err == 0) /* terminate kernel stack */
-               task_pt_regs(current)->eip = 0;
-       return err;
+       return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL, NULL);
 }
 EXPORT_SYMBOL(kernel_thread);
 
index b8fa0a8b2e4733170d0b72cff576d7ddb8c750cd..fbc95828cd7493082aeeedc0396a762db056097b 100644 (file)
@@ -349,8 +349,8 @@ static int tsc_update_callback(void)
        int change = 0;
 
        /* check to see if we should switch to the safe clocksource: */
-       if (clocksource_tsc.rating != 50 && check_tsc_unstable()) {
-               clocksource_tsc.rating = 50;
+       if (clocksource_tsc.rating != 0 && check_tsc_unstable()) {
+               clocksource_tsc.rating = 0;
                clocksource_reselect();
                change = 1;
        }
@@ -461,7 +461,7 @@ static int __init init_tsc_clocksource(void)
                                                        clocksource_tsc.shift);
                /* lower the rating if we already know its unstable: */
                if (check_tsc_unstable())
-                       clocksource_tsc.rating = 50;
+                       clocksource_tsc.rating = 0;
 
                init_timer(&verify_tsc_freq_timer);
                verify_tsc_freq_timer.function = verify_tsc_freq;
index 258df6b4d7d7646ec5bd7a9843c669be14327928..d22cfc9d656ca39317d68a1a2a0f6ec6b13bf2df 100644 (file)
@@ -9,6 +9,7 @@
 #include <linux/highmem.h>
 #include <linux/blkdev.h>
 #include <linux/module.h>
+#include <linux/backing-dev.h>
 #include <asm/uaccess.h>
 #include <asm/mmx.h>
 
@@ -741,7 +742,7 @@ survive:
 
                        if (retval == -ENOMEM && is_init(current)) {
                                up_read(&current->mm->mmap_sem);
-                               blk_congestion_wait(WRITE, HZ/50);
+                               congestion_wait(WRITE, HZ/50);
                                goto survive;
                        }
 
index 68bce194e688a1903480425b3db8dc37802127f0..6d5ace845e445b2eca6a25452e100e380e0467b4 100644 (file)
@@ -20,6 +20,7 @@
 unsigned int pci_probe = PCI_PROBE_BIOS | PCI_PROBE_CONF1 | PCI_PROBE_CONF2 |
                                PCI_PROBE_MMCONF;
 
+int pci_bf_sort;
 int pci_routeirq;
 int pcibios_last_bus = -1;
 unsigned long pirq_table_addr;
@@ -117,6 +118,20 @@ void __devinit  pcibios_fixup_bus(struct pci_bus *b)
        pci_read_bridge_bases(b);
 }
 
+/*
+ * Only use DMI information to set this if nothing was passed
+ * on the kernel command line (which was parsed earlier).
+ */
+
+static int __devinit set_bf_sort(struct dmi_system_id *d)
+{
+       if (pci_bf_sort == pci_bf_sort_default) {
+               pci_bf_sort = pci_dmi_bf;
+               printk(KERN_INFO "PCI: %s detected, enabling pci=bfsort.\n", d->ident);
+       }
+       return 0;
+}
+
 /*
  * Enable renumbering of PCI bus# ranges to reach all PCI busses (Cardbus)
  */
@@ -130,11 +145,11 @@ static int __devinit assign_all_busses(struct dmi_system_id *d)
 }
 #endif
 
+static struct dmi_system_id __devinitdata pciprobe_dmi_table[] = {
+#ifdef __i386__
 /*
  * Laptops which need pci=assign-busses to see Cardbus cards
  */
-static struct dmi_system_id __devinitdata pciprobe_dmi_table[] = {
-#ifdef __i386__
        {
                .callback = assign_all_busses,
                .ident = "Samsung X20 Laptop",
@@ -144,6 +159,38 @@ static struct dmi_system_id __devinitdata pciprobe_dmi_table[] = {
                },
        },
 #endif         /* __i386__ */
+       {
+               .callback = set_bf_sort,
+               .ident = "Dell PowerEdge 1950",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "Dell"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 1950"),
+               },
+       },
+       {
+               .callback = set_bf_sort,
+               .ident = "Dell PowerEdge 1955",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "Dell"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 1955"),
+               },
+       },
+       {
+               .callback = set_bf_sort,
+               .ident = "Dell PowerEdge 2900",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "Dell"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 2900"),
+               },
+       },
+       {
+               .callback = set_bf_sort,
+               .ident = "Dell PowerEdge 2950",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "Dell"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 2950"),
+               },
+       },
        {}
 };
 
@@ -189,6 +236,8 @@ static int __init pcibios_init(void)
 
        pcibios_resource_survey();
 
+       if (pci_bf_sort >= pci_force_bf)
+               pci_sort_breadthfirst();
 #ifdef CONFIG_PCI_BIOS
        if ((pci_probe & PCI_BIOS_SORT) && !(pci_probe & PCI_NO_SORT))
                pcibios_sort();
@@ -203,6 +252,12 @@ char * __devinit  pcibios_setup(char *str)
        if (!strcmp(str, "off")) {
                pci_probe = 0;
                return NULL;
+       } else if (!strcmp(str, "bfsort")) {
+               pci_bf_sort = pci_force_bf;
+               return NULL;
+       } else if (!strcmp(str, "nobfsort")) {
+               pci_bf_sort = pci_force_nobf;
+               return NULL;
        }
 #ifdef CONFIG_PCI_BIOS
        else if (!strcmp(str, "bios")) {
index b60d7e8689ede9fcb6d1ca4d0fb055d1750603f3..908b410f4c931c1ac62e562d2828ccd68714600f 100644 (file)
@@ -342,51 +342,6 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,       PCI_DEVICE_ID_INTEL_MCH_PB1,    pcie_r
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_MCH_PC,     pcie_rootport_aspm_quirk );
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_MCH_PC1,    pcie_rootport_aspm_quirk );
 
-/*
- * Fixup to mark boot BIOS video selected by BIOS before it changes
- *
- * From information provided by "Jon Smirl" <jonsmirl@gmail.com>
- *
- * The standard boot ROM sequence for an x86 machine uses the BIOS
- * to select an initial video card for boot display. This boot video 
- * card will have it's BIOS copied to C0000 in system RAM. 
- * IORESOURCE_ROM_SHADOW is used to associate the boot video
- * card with this copy. On laptops this copy has to be used since
- * the main ROM may be compressed or combined with another image.
- * See pci_map_rom() for use of this flag. IORESOURCE_ROM_SHADOW
- * is marked here since the boot video device will be the only enabled
- * video device at this point.
- */
-
-static void __devinit pci_fixup_video(struct pci_dev *pdev)
-{
-       struct pci_dev *bridge;
-       struct pci_bus *bus;
-       u16 config;
-
-       if ((pdev->class >> 8) != PCI_CLASS_DISPLAY_VGA)
-               return;
-
-       /* Is VGA routed to us? */
-       bus = pdev->bus;
-       while (bus) {
-               bridge = bus->self;
-               if (bridge) {
-                       pci_read_config_word(bridge, PCI_BRIDGE_CONTROL,
-                                               &config);
-                       if (!(config & PCI_BRIDGE_CTL_VGA))
-                               return;
-               }
-               bus = bus->parent;
-       }
-       pci_read_config_word(pdev, PCI_COMMAND, &config);
-       if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) {
-               pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW;
-               printk(KERN_DEBUG "Boot video device is %s\n", pci_name(pdev));
-       }
-}
-DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pci_fixup_video);
-
 /*
  * Some Toshiba laptops need extra code to enable their TI TSB43AB22/A.
  *
index 1814f74569c63efd415bdfa4393a9471107a3742..ad065cebd7b9e1d94fb665c147d01cc90f36412d 100644 (file)
 extern unsigned int pci_probe;
 extern unsigned long pirq_table_addr;
 
+enum pci_bf_sort_state {
+       pci_bf_sort_default,
+       pci_force_nobf,
+       pci_force_bf,
+       pci_dmi_bf,
+};
+
 /* pci-i386.c */
 
 extern unsigned int pcibios_max_latency;
index 0f14a82b856e500b72aa4277ddea084ae242a8f7..64e951de4e5749b64ca721601f0bddfd4dd7a886 100644 (file)
@@ -1,8 +1,9 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.17-rc3
-# Thu Apr 27 11:48:23 2006
+# Linux kernel version: 2.6.19-rc1
+# Mon Oct  9 10:53:59 2006
 #
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
 # Code maturity level options
@@ -18,16 +19,22 @@ CONFIG_LOCALVERSION=""
 # CONFIG_LOCALVERSION_AUTO is not set
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_IPC_NS is not set
 CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
-CONFIG_SYSCTL=y
+CONFIG_TASKSTATS=y
+# CONFIG_TASK_DELAY_ACCT is not set
+# CONFIG_UTS_NS is not set
 # CONFIG_AUDIT is not set
 # CONFIG_IKCONFIG is not set
 CONFIG_CPUSETS=y
 CONFIG_RELAY=y
 CONFIG_INITRAMFS_SOURCE=""
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_TASK_XACCT=y
+CONFIG_SYSCTL=y
 # CONFIG_EMBEDDED is not set
+# CONFIG_SYSCTL_SYSCALL is not set
 CONFIG_KALLSYMS=y
 CONFIG_KALLSYMS_ALL=y
 # CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -40,6 +47,8 @@ CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_SHMEM=y
 CONFIG_SLAB=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
 # CONFIG_SLOB is not set
@@ -58,6 +67,7 @@ CONFIG_STOP_MACHINE=y
 #
 # Block layer
 #
+CONFIG_BLOCK=y
 # CONFIG_BLK_DEV_IO_TRACE is not set
 
 #
@@ -89,7 +99,7 @@ CONFIG_EFI=y
 CONFIG_GENERIC_IOMAP=y
 CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
 CONFIG_IA64_UNCACHED_ALLOCATOR=y
-CONFIG_DMA_IS_DMA32=y
+CONFIG_AUDIT_ARCH=y
 # CONFIG_IA64_GENERIC is not set
 # CONFIG_IA64_DIG is not set
 # CONFIG_IA64_HP_ZX1 is not set
@@ -116,6 +126,7 @@ CONFIG_FORCE_MAX_ZONEORDER=17
 CONFIG_SMP=y
 CONFIG_NR_CPUS=1024
 # CONFIG_HOTPLUG_CPU is not set
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
 CONFIG_SCHED_SMT=y
 CONFIG_PREEMPT=y
 CONFIG_SELECT_MEMORY_MODEL=y
@@ -128,6 +139,7 @@ CONFIG_NEED_MULTIPLE_NODES=y
 # CONFIG_SPARSEMEM_STATIC is not set
 CONFIG_SPLIT_PTLOCK_CPUS=4
 CONFIG_MIGRATION=y
+CONFIG_RESOURCES_64BIT=y
 CONFIG_ARCH_SELECT_MEMORY_MODEL=y
 CONFIG_ARCH_DISCONTIGMEM_ENABLE=y
 CONFIG_ARCH_FLATMEM_ENABLE=y
@@ -135,15 +147,24 @@ CONFIG_ARCH_SPARSEMEM_ENABLE=y
 CONFIG_ARCH_DISCONTIGMEM_DEFAULT=y
 CONFIG_NUMA=y
 CONFIG_NODES_SHIFT=10
+CONFIG_ARCH_POPULATES_NODE_MAP=y
 CONFIG_VIRTUAL_MEM_MAP=y
 CONFIG_HOLES_IN_ZONE=y
 CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y
+CONFIG_HAVE_ARCH_NODEDATA_EXTENSION=y
 CONFIG_IA32_SUPPORT=y
 CONFIG_COMPAT=y
 CONFIG_IA64_MCA_RECOVERY=y
 CONFIG_PERFMON=y
 CONFIG_IA64_PALINFO=y
 CONFIG_SGI_SN=y
+# CONFIG_IA64_ESI is not set
+
+#
+# SN Devices
+#
+CONFIG_SGI_IOC4=y
+CONFIG_SGI_IOC3=y
 
 #
 # Firmware Drivers
@@ -159,6 +180,7 @@ CONFIG_BINFMT_ELF=y
 CONFIG_PM=y
 # CONFIG_PM_LEGACY is not set
 # CONFIG_PM_DEBUG is not set
+# CONFIG_PM_SYSFS_DEPRECATED is not set
 
 #
 # ACPI (Advanced Configuration and Power Interface) Support
@@ -166,6 +188,7 @@ CONFIG_PM=y
 CONFIG_ACPI=y
 # CONFIG_ACPI_BUTTON is not set
 # CONFIG_ACPI_FAN is not set
+# CONFIG_ACPI_DOCK is not set
 # CONFIG_ACPI_PROCESSOR is not set
 CONFIG_ACPI_NUMA=y
 CONFIG_ACPI_BLACKLIST_YEAR=0
@@ -185,7 +208,12 @@ CONFIG_ACPI_SYSTEM=y
 #
 CONFIG_PCI=y
 CONFIG_PCI_DOMAINS=y
+CONFIG_PCIEPORTBUS=y
+CONFIG_HOTPLUG_PCI_PCIE=y
+# CONFIG_HOTPLUG_PCI_PCIE_POLL_EVENT_MODE is not set
+CONFIG_PCIEAER=y
 # CONFIG_PCI_MSI is not set
+# CONFIG_PCI_MULTITHREAD_PROBE is not set
 # CONFIG_PCI_DEBUG is not set
 
 #
@@ -215,6 +243,9 @@ CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_PACKET_MMAP=y
 CONFIG_UNIX=y
+CONFIG_XFRM=y
+# CONFIG_XFRM_USER is not set
+# CONFIG_XFRM_SUB_POLICY is not set
 # CONFIG_NET_KEY is not set
 CONFIG_INET=y
 CONFIG_IP_MULTICAST=y
@@ -231,19 +262,31 @@ CONFIG_SYN_COOKIES=y
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_INET_XFRM_TUNNEL is not set
 # CONFIG_INET_TUNNEL is not set
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
 CONFIG_INET_DIAG=m
 CONFIG_INET_TCP_DIAG=m
 # CONFIG_TCP_CONG_ADVANCED is not set
-CONFIG_TCP_CONG_BIC=y
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_IPV6=m
 # CONFIG_IPV6_PRIVACY is not set
 # CONFIG_IPV6_ROUTER_PREF is not set
 # CONFIG_INET6_AH is not set
 # CONFIG_INET6_ESP is not set
 # CONFIG_INET6_IPCOMP is not set
+# CONFIG_IPV6_MIP6 is not set
 # CONFIG_INET6_XFRM_TUNNEL is not set
 # CONFIG_INET6_TUNNEL is not set
+CONFIG_INET6_XFRM_MODE_TRANSPORT=m
+CONFIG_INET6_XFRM_MODE_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_BEET=m
+# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
 # CONFIG_IPV6_TUNNEL is not set
+# CONFIG_IPV6_SUBTREES is not set
+# CONFIG_IPV6_MULTIPLE_TABLES is not set
+# CONFIG_NETWORK_SECMARK is not set
 # CONFIG_NETFILTER is not set
 
 #
@@ -269,7 +312,6 @@ CONFIG_IPV6=m
 # CONFIG_ATALK is not set
 # CONFIG_X25 is not set
 # CONFIG_LAPB is not set
-# CONFIG_NET_DIVERT is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
 
@@ -298,6 +340,7 @@ CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=y
 # CONFIG_DEBUG_DRIVER is not set
+# CONFIG_SYS_HYPERVISOR is not set
 
 #
 # Connector - unified userspace <-> kernelspace linker
@@ -335,6 +378,7 @@ CONFIG_BLK_DEV_NBD=m
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=4096
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CDROM_PKTCDVD is not set
 CONFIG_ATA_OVER_ETH=m
@@ -381,6 +425,7 @@ CONFIG_IDEDMA_PCI_AUTO=y
 # CONFIG_BLK_DEV_CS5530 is not set
 # CONFIG_BLK_DEV_HPT34X is not set
 # CONFIG_BLK_DEV_HPT366 is not set
+# CONFIG_BLK_DEV_JMICRON is not set
 # CONFIG_BLK_DEV_SC1200 is not set
 # CONFIG_BLK_DEV_PIIX is not set
 # CONFIG_BLK_DEV_IT821X is not set
@@ -404,6 +449,7 @@ CONFIG_IDEDMA_AUTO=y
 #
 # CONFIG_RAID_ATTRS is not set
 CONFIG_SCSI=y
+CONFIG_SCSI_NETLINK=y
 CONFIG_SCSI_PROC_FS=y
 
 #
@@ -425,12 +471,14 @@ CONFIG_SCSI_CONSTANTS=y
 # CONFIG_SCSI_LOGGING is not set
 
 #
-# SCSI Transport Attributes
+# SCSI Transports
 #
 CONFIG_SCSI_SPI_ATTRS=y
 CONFIG_SCSI_FC_ATTRS=y
 CONFIG_SCSI_ISCSI_ATTRS=m
 CONFIG_SCSI_SAS_ATTRS=y
+CONFIG_SCSI_SAS_LIBSAS=y
+# CONFIG_SCSI_SAS_LIBSAS_DEBUG is not set
 
 #
 # SCSI low-level drivers
@@ -443,45 +491,81 @@ CONFIG_ISCSI_TCP=m
 # CONFIG_SCSI_AIC7XXX is not set
 # CONFIG_SCSI_AIC7XXX_OLD is not set
 # CONFIG_SCSI_AIC79XX is not set
+# CONFIG_SCSI_AIC94XX is not set
+# CONFIG_SCSI_ARCMSR is not set
 # CONFIG_MEGARAID_NEWGEN is not set
 # CONFIG_MEGARAID_LEGACY is not set
 # CONFIG_MEGARAID_SAS is not set
-CONFIG_SCSI_SATA=y
-# CONFIG_SCSI_SATA_AHCI is not set
-# CONFIG_SCSI_SATA_SVW is not set
-# CONFIG_SCSI_ATA_PIIX is not set
-# CONFIG_SCSI_SATA_MV is not set
-# CONFIG_SCSI_SATA_NV is not set
-# CONFIG_SCSI_PDC_ADMA is not set
-# CONFIG_SCSI_SATA_QSTOR is not set
-# CONFIG_SCSI_SATA_PROMISE is not set
-# CONFIG_SCSI_SATA_SX4 is not set
-# CONFIG_SCSI_SATA_SIL is not set
-# CONFIG_SCSI_SATA_SIL24 is not set
-# CONFIG_SCSI_SATA_SIS is not set
-# CONFIG_SCSI_SATA_ULI is not set
-# CONFIG_SCSI_SATA_VIA is not set
-CONFIG_SCSI_SATA_VITESSE=y
+# CONFIG_SCSI_HPTIOP is not set
 # CONFIG_SCSI_DMX3191D is not set
 # CONFIG_SCSI_FUTURE_DOMAIN is not set
 # CONFIG_SCSI_IPS is not set
 # CONFIG_SCSI_INITIO is not set
 # CONFIG_SCSI_INIA100 is not set
+# CONFIG_SCSI_STEX is not set
 # CONFIG_SCSI_SYM53C8XX_2 is not set
 # CONFIG_SCSI_IPR is not set
 CONFIG_SCSI_QLOGIC_1280=y
 CONFIG_SCSI_QLA_FC=y
-CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE=y
-# CONFIG_SCSI_QLA21XX is not set
-CONFIG_SCSI_QLA22XX=y
-CONFIG_SCSI_QLA2300=y
-CONFIG_SCSI_QLA2322=y
-# CONFIG_SCSI_QLA24XX is not set
+# CONFIG_SCSI_QLA_ISCSI is not set
 # CONFIG_SCSI_LPFC is not set
 # CONFIG_SCSI_DC395x is not set
 # CONFIG_SCSI_DC390T is not set
 # CONFIG_SCSI_DEBUG is not set
 
+#
+# Serial ATA (prod) and Parallel ATA (experimental) drivers
+#
+CONFIG_ATA=y
+# CONFIG_SATA_AHCI is not set
+# CONFIG_SATA_SVW is not set
+# CONFIG_ATA_PIIX is not set
+# CONFIG_SATA_MV is not set
+# CONFIG_SATA_NV is not set
+# CONFIG_PDC_ADMA is not set
+# CONFIG_SATA_QSTOR is not set
+# CONFIG_SATA_PROMISE is not set
+# CONFIG_SATA_SX4 is not set
+# CONFIG_SATA_SIL is not set
+# CONFIG_SATA_SIL24 is not set
+# CONFIG_SATA_SIS is not set
+# CONFIG_SATA_ULI is not set
+# CONFIG_SATA_VIA is not set
+CONFIG_SATA_VITESSE=y
+# CONFIG_PATA_ALI is not set
+# CONFIG_PATA_AMD is not set
+# CONFIG_PATA_ARTOP is not set
+# CONFIG_PATA_ATIIXP is not set
+# CONFIG_PATA_CMD64X is not set
+# CONFIG_PATA_CS5520 is not set
+# CONFIG_PATA_CS5530 is not set
+# CONFIG_PATA_CYPRESS is not set
+# CONFIG_PATA_EFAR is not set
+# CONFIG_ATA_GENERIC is not set
+# CONFIG_PATA_HPT366 is not set
+# CONFIG_PATA_HPT37X is not set
+# CONFIG_PATA_HPT3X2N is not set
+# CONFIG_PATA_HPT3X3 is not set
+# CONFIG_PATA_IT821X is not set
+# CONFIG_PATA_JMICRON is not set
+# CONFIG_PATA_TRIFLEX is not set
+# CONFIG_PATA_MPIIX is not set
+# CONFIG_PATA_OLDPIIX is not set
+# CONFIG_PATA_NETCELL is not set
+# CONFIG_PATA_NS87410 is not set
+# CONFIG_PATA_OPTI is not set
+# CONFIG_PATA_OPTIDMA is not set
+# CONFIG_PATA_PDC_OLD is not set
+# CONFIG_PATA_RADISYS is not set
+# CONFIG_PATA_RZ1000 is not set
+# CONFIG_PATA_SC1200 is not set
+# CONFIG_PATA_SERVERWORKS is not set
+# CONFIG_PATA_PDC2027X is not set
+# CONFIG_PATA_SIL680 is not set
+# CONFIG_PATA_SIS is not set
+# CONFIG_PATA_VIA is not set
+# CONFIG_PATA_WINBOND is not set
+
 #
 # Multi-device support (RAID and LVM)
 #
@@ -491,12 +575,12 @@ CONFIG_MD_LINEAR=y
 CONFIG_MD_RAID0=y
 CONFIG_MD_RAID1=y
 # CONFIG_MD_RAID10 is not set
-CONFIG_MD_RAID5=y
+CONFIG_MD_RAID456=y
 # CONFIG_MD_RAID5_RESHAPE is not set
-# CONFIG_MD_RAID6 is not set
 CONFIG_MD_MULTIPATH=y
 # CONFIG_MD_FAULTY is not set
 CONFIG_BLK_DEV_DM=y
+# CONFIG_DM_DEBUG is not set
 CONFIG_DM_CRYPT=m
 CONFIG_DM_SNAPSHOT=m
 CONFIG_DM_MIRROR=m
@@ -563,6 +647,7 @@ CONFIG_NETDEVICES=y
 # CONFIG_SK98LIN is not set
 CONFIG_TIGON3=y
 # CONFIG_BNX2 is not set
+# CONFIG_QLA3XXX is not set
 
 #
 # Ethernet (10000 Mbit)
@@ -571,6 +656,7 @@ CONFIG_CHELSIO_T1=m
 # CONFIG_IXGB is not set
 CONFIG_S2IO=m
 # CONFIG_S2IO_NAPI is not set
+# CONFIG_MYRI10GE is not set
 
 #
 # Token Ring devices
@@ -612,6 +698,7 @@ CONFIG_NET_POLL_CONTROLLER=y
 # Input device support
 #
 CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
 
 #
 # Userland interfaces
@@ -646,6 +733,7 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 CONFIG_VT=y
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
 CONFIG_SERIAL_NONSTANDARD=y
 # CONFIG_COMPUTONE is not set
 # CONFIG_ROCKETPORT is not set
@@ -659,10 +747,12 @@ CONFIG_SERIAL_NONSTANDARD=y
 # CONFIG_N_HDLC is not set
 # CONFIG_SPECIALIX is not set
 # CONFIG_SX is not set
+# CONFIG_RIO is not set
 # CONFIG_STALDRV is not set
 CONFIG_SGI_SNSC=y
 CONFIG_SGI_TIOCX=y
 CONFIG_SGI_MBCS=m
+CONFIG_MSPEC=y
 
 #
 # Serial drivers
@@ -701,6 +791,7 @@ CONFIG_EFI_RTC=y
 # Ftape, the floppy tape device driver
 #
 CONFIG_AGP=y
+# CONFIG_AGP_SIS is not set
 # CONFIG_AGP_VIA is not set
 CONFIG_AGP_SGI_TIOCA=y
 # CONFIG_DRM is not set
@@ -730,7 +821,6 @@ CONFIG_MMTIMER=y
 #
 # Dallas's 1-wire bus
 #
-# CONFIG_W1 is not set
 
 #
 # Hardware Monitoring support
@@ -741,6 +831,7 @@ CONFIG_MMTIMER=y
 #
 # Misc devices
 #
+# CONFIG_TIFM_CORE is not set
 
 #
 # Multimedia devices
@@ -756,6 +847,7 @@ CONFIG_MMTIMER=y
 #
 # Graphics support
 #
+CONFIG_FIRMWARE_EDID=y
 # CONFIG_FB is not set
 
 #
@@ -764,6 +856,7 @@ CONFIG_MMTIMER=y
 CONFIG_VGA_CONSOLE=y
 # CONFIG_VGACON_SOFT_SCROLLBACK is not set
 CONFIG_DUMMY_CONSOLE=y
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 
 #
 # Sound
@@ -794,6 +887,7 @@ CONFIG_USB=m
 CONFIG_USB_EHCI_HCD=m
 # CONFIG_USB_EHCI_SPLIT_ISO is not set
 # CONFIG_USB_EHCI_ROOT_HUB_TT is not set
+# CONFIG_USB_EHCI_TT_NEWSCHED is not set
 # CONFIG_USB_ISP116X_HCD is not set
 CONFIG_USB_OHCI_HCD=m
 # CONFIG_USB_OHCI_BIG_ENDIAN is not set
@@ -843,6 +937,7 @@ CONFIG_USB_HIDINPUT=y
 # CONFIG_USB_ATI_REMOTE2 is not set
 # CONFIG_USB_KEYSPAN_REMOTE is not set
 # CONFIG_USB_APPLETOUCH is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
 
 #
 # USB Imaging devices
@@ -874,15 +969,18 @@ CONFIG_USB_MON=y
 #
 # CONFIG_USB_EMI62 is not set
 # CONFIG_USB_EMI26 is not set
+# CONFIG_USB_ADUTUX is not set
 # CONFIG_USB_AUERSWALD is not set
 # CONFIG_USB_RIO500 is not set
 # CONFIG_USB_LEGOTOWER is not set
 # CONFIG_USB_LCD is not set
 # CONFIG_USB_LED is not set
+# CONFIG_USB_CYPRESS_CY7C63 is not set
 # CONFIG_USB_CYTHERM is not set
-# CONFIG_USB_PHIDGETKIT is not set
-# CONFIG_USB_PHIDGETSERVO is not set
+# CONFIG_USB_PHIDGET is not set
 # CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_FTDI_ELAN is not set
+# CONFIG_USB_APPLEDISPLAY is not set
 # CONFIG_USB_SISUSBVGA is not set
 # CONFIG_USB_LD is not set
 
@@ -919,18 +1017,15 @@ CONFIG_USB_MON=y
 CONFIG_INFINIBAND=m
 # CONFIG_INFINIBAND_USER_MAD is not set
 CONFIG_INFINIBAND_USER_ACCESS=m
+CONFIG_INFINIBAND_ADDR_TRANS=y
 CONFIG_INFINIBAND_MTHCA=m
 CONFIG_INFINIBAND_MTHCA_DEBUG=y
+# CONFIG_INFINIBAND_AMSO1100 is not set
 CONFIG_INFINIBAND_IPOIB=m
 CONFIG_INFINIBAND_IPOIB_DEBUG=y
 # CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set
 CONFIG_INFINIBAND_SRP=m
-
-#
-# SN Devices
-#
-CONFIG_SGI_IOC4=y
-CONFIG_SGI_IOC3=y
+# CONFIG_INFINIBAND_ISER is not set
 
 #
 # EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
@@ -941,6 +1036,19 @@ CONFIG_SGI_IOC3=y
 #
 # CONFIG_RTC_CLASS is not set
 
+#
+# DMA Engine support
+#
+# CONFIG_DMA_ENGINE is not set
+
+#
+# DMA Clients
+#
+
+#
+# DMA Devices
+#
+
 #
 # File systems
 #
@@ -965,15 +1073,16 @@ CONFIG_REISERFS_FS_SECURITY=y
 # CONFIG_JFS_FS is not set
 CONFIG_FS_POSIX_ACL=y
 CONFIG_XFS_FS=y
-CONFIG_XFS_EXPORT=y
 CONFIG_XFS_QUOTA=y
 # CONFIG_XFS_SECURITY is not set
 CONFIG_XFS_POSIX_ACL=y
 CONFIG_XFS_RT=y
+# CONFIG_GFS2_FS is not set
 # CONFIG_OCFS2_FS is not set
 # CONFIG_MINIX_FS is not set
 # CONFIG_ROMFS_FS is not set
 CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
 CONFIG_QUOTA=y
 # CONFIG_QFMT_V1 is not set
 # CONFIG_QFMT_V2 is not set
@@ -1007,8 +1116,10 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_PROC_SYSCTL=y
 CONFIG_SYSFS=y
 CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
 CONFIG_HUGETLBFS=y
 CONFIG_HUGETLB_PAGE=y
 CONFIG_RAMFS=y
@@ -1046,7 +1157,7 @@ CONFIG_NFSD_V4=y
 CONFIG_NFSD_TCP=y
 CONFIG_LOCKD=m
 CONFIG_LOCKD_V4=y
-CONFIG_EXPORTFS=y
+CONFIG_EXPORTFS=m
 CONFIG_NFS_COMMON=y
 CONFIG_SUNRPC=m
 CONFIG_SUNRPC_GSS=m
@@ -1056,7 +1167,9 @@ CONFIG_SMB_FS=m
 # CONFIG_SMB_NLS_DEFAULT is not set
 CONFIG_CIFS=m
 # CONFIG_CIFS_STATS is not set
+# CONFIG_CIFS_WEAK_PW_HASH is not set
 # CONFIG_CIFS_XATTR is not set
+# CONFIG_CIFS_DEBUG2 is not set
 # CONFIG_CIFS_EXPERIMENTAL is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
@@ -1128,6 +1241,10 @@ CONFIG_NLS_ISO8859_1=y
 # CONFIG_NLS_KOI8_U is not set
 CONFIG_NLS_UTF8=y
 
+#
+# Distributed Lock Manager
+#
+
 #
 # Library routines
 #
@@ -1138,9 +1255,11 @@ CONFIG_LIBCRC32C=m
 CONFIG_ZLIB_INFLATE=m
 CONFIG_ZLIB_DEFLATE=m
 CONFIG_GENERIC_ALLOCATOR=y
+CONFIG_PLIST=y
 CONFIG_GENERIC_HARDIRQS=y
 CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_GENERIC_PENDING_IRQ=y
+CONFIG_IRQ_PER_CPU=y
 
 #
 # Instrumentation Support
@@ -1152,20 +1271,26 @@ CONFIG_GENERIC_PENDING_IRQ=y
 # Kernel hacking
 #
 # CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_MUST_CHECK=y
 CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
 CONFIG_DEBUG_KERNEL=y
 CONFIG_LOG_BUF_SHIFT=20
 CONFIG_DETECT_SOFTLOCKUP=y
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_DEBUG_SLAB is not set
-CONFIG_DEBUG_PREEMPT=y
-# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
 # CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_RWSEMS is not set
 # CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
 # CONFIG_DEBUG_KOBJECT is not set
 CONFIG_DEBUG_INFO=y
 # CONFIG_DEBUG_FS is not set
 # CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_LIST is not set
 CONFIG_FORCED_INLINING=y
 # CONFIG_RCU_TORTURE_TEST is not set
 CONFIG_IA64_GRANULE_16MB=y
@@ -1186,6 +1311,10 @@ CONFIG_SYSVIPC_COMPAT=y
 # Cryptographic options
 #
 CONFIG_CRYPTO=y
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_BLKCIPHER=m
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_MANAGER=m
 CONFIG_CRYPTO_HMAC=y
 # CONFIG_CRYPTO_NULL is not set
 # CONFIG_CRYPTO_MD4 is not set
@@ -1195,6 +1324,8 @@ CONFIG_CRYPTO_SHA1=m
 # CONFIG_CRYPTO_SHA512 is not set
 # CONFIG_CRYPTO_WP512 is not set
 # CONFIG_CRYPTO_TGR192 is not set
+CONFIG_CRYPTO_ECB=m
+CONFIG_CRYPTO_CBC=m
 CONFIG_CRYPTO_DES=m
 # CONFIG_CRYPTO_BLOWFISH is not set
 # CONFIG_CRYPTO_TWOFISH is not set
index 32c3abededc69aac74e522b9d06687066a716ccb..73ef4a85b861df136c132c7b3ab4df76d54b8eb5 100644 (file)
@@ -64,9 +64,6 @@ EXPORT_SYMBOL(pm_idle);
 void (*pm_power_off) (void);
 EXPORT_SYMBOL(pm_power_off);
 
-unsigned char acpi_kbd_controller_present = 1;
-unsigned char acpi_legacy_devices;
-
 unsigned int acpi_cpei_override;
 unsigned int acpi_cpei_phys_cpuid;
 
@@ -628,12 +625,6 @@ static int __init acpi_parse_fadt(unsigned long phys_addr, unsigned long size)
 
        fadt = (struct fadt_descriptor *)fadt_header;
 
-       if (!(fadt->iapc_boot_arch & BAF_8042_KEYBOARD_CONTROLLER))
-               acpi_kbd_controller_present = 0;
-
-       if (fadt->iapc_boot_arch & BAF_LEGACY_DEVICES)
-               acpi_legacy_devices = 1;
-
        acpi_register_gsi(fadt->sci_int, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW);
        return 0;
 }
index 68339dd0c9e2045c22bbdbf028595114118b6521..9c6dafa2d0df613e95ee0d776672c85bac6d14b1 100644 (file)
@@ -180,7 +180,9 @@ ia64_handle_irq (ia64_vector vector, struct pt_regs *regs)
        saved_tpr = ia64_getreg(_IA64_REG_CR_TPR);
        ia64_srlz_d();
        while (vector != IA64_SPURIOUS_INT_VECTOR) {
-               if (!IS_RESCHEDULE(vector)) {
+               if (unlikely(IS_RESCHEDULE(vector)))
+                        kstat_this_cpu.irqs[vector]++;
+               else {
                        ia64_setreg(_IA64_REG_CR_TPR, vector);
                        ia64_srlz_d();
 
@@ -225,7 +227,9 @@ void ia64_process_pending_intr(void)
          * Perform normal interrupt style processing
          */
        while (vector != IA64_SPURIOUS_INT_VECTOR) {
-               if (!IS_RESCHEDULE(vector)) {
+               if (unlikely(IS_RESCHEDULE(vector)))
+                        kstat_this_cpu.irqs[vector]++;
+               else {
                        struct pt_regs *old_regs = set_irq_regs(NULL);
 
                        ia64_setreg(_IA64_REG_CR_TPR, vector);
@@ -258,11 +262,22 @@ void ia64_process_pending_intr(void)
 #ifdef CONFIG_SMP
 extern irqreturn_t handle_IPI (int irq, void *dev_id);
 
+static irqreturn_t dummy_handler (int irq, void *dev_id)
+{
+       BUG();
+}
+
 static struct irqaction ipi_irqaction = {
        .handler =      handle_IPI,
        .flags =        IRQF_DISABLED,
        .name =         "IPI"
 };
+
+static struct irqaction resched_irqaction = {
+       .handler =      dummy_handler,
+       .flags =        SA_INTERRUPT,
+       .name =         "resched"
+};
 #endif
 
 void
@@ -287,6 +302,7 @@ init_IRQ (void)
        register_percpu_irq(IA64_SPURIOUS_INT_VECTOR, NULL);
 #ifdef CONFIG_SMP
        register_percpu_irq(IA64_IPI_VECTOR, &ipi_irqaction);
+       register_percpu_irq(IA64_IPI_RESCHEDULE, &resched_irqaction);
 #endif
 #ifdef CONFIG_PERFMON
        pfm_init_percpu();
index ebaf1e685f5e350312bf72f3efbcb47288f58f1e..0b533441c3c9b2fc434315c23f45dc0924e64b4c 100644 (file)
@@ -21,11 +21,12 @@ pal_entry_point:
        .text
 
 /*
- * Set the PAL entry point address.  This could be written in C code, but we do it here
- * to keep it all in one module (besides, it's so trivial that it's
+ * Set the PAL entry point address.  This could be written in C code, but we
+ * do it here to keep it all in one module (besides, it's so trivial that it's
  * not a big deal).
  *
- * in0         Address of the PAL entry point (text address, NOT a function descriptor).
+ * in0         Address of the PAL entry point (text address, NOT a function
+ *             descriptor).
  */
 GLOBAL_ENTRY(ia64_pal_handler_init)
        alloc r3=ar.pfs,1,0,0,0
@@ -36,9 +37,9 @@ GLOBAL_ENTRY(ia64_pal_handler_init)
 END(ia64_pal_handler_init)
 
 /*
- * Default PAL call handler.  This needs to be coded in assembly because it uses
- * the static calling convention, i.e., the RSE may not be used and calls are
- * done via "br.cond" (not "br.call").
+ * Default PAL call handler.  This needs to be coded in assembly because it
+ * uses the static calling convention, i.e., the RSE may not be used and
+ * calls are done via "br.cond" (not "br.call").
  */
 GLOBAL_ENTRY(ia64_pal_default_handler)
        mov r8=-1
@@ -50,12 +51,10 @@ END(ia64_pal_default_handler)
  *
  * in0         Index of PAL service
  * in1 - in3   Remaining PAL arguments
- * in4        1 ==> clear psr.ic,  0 ==> don't clear psr.ic
- *
  */
 GLOBAL_ENTRY(ia64_pal_call_static)
-       .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(5)
-       alloc loc1 = ar.pfs,5,5,0,0
+       .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(4)
+       alloc loc1 = ar.pfs,4,5,0,0
        movl loc2 = pal_entry_point
 1:     {
          mov r28 = in0
@@ -64,7 +63,6 @@ GLOBAL_ENTRY(ia64_pal_call_static)
        }
        ;;
        ld8 loc2 = [loc2]               // loc2 <- entry point
-       tbit.nz p6,p7 = in4, 0
        adds r8 = 1f-1b,r8
        mov loc4=ar.rsc                 // save RSE configuration
        ;;
@@ -74,13 +72,11 @@ GLOBAL_ENTRY(ia64_pal_call_static)
        .body
        mov r30 = in2
 
-(p6)   rsm psr.i | psr.ic
        mov r31 = in3
        mov b7 = loc2
 
-(p7)   rsm psr.i
+       rsm psr.i
        ;;
-(p6)   srlz.i
        mov rp = r8
        br.cond.sptk.many b7
 1:     mov psr.l = loc3
@@ -96,8 +92,8 @@ END(ia64_pal_call_static)
  * Make a PAL call using the stacked registers calling convention.
  *
  * Inputs:
- *     in0         Index of PAL service
- *     in2 - in3   Remaning PAL arguments
+ *     in0         Index of PAL service
+ *     in2 - in3   Remaining PAL arguments
  */
 GLOBAL_ENTRY(ia64_pal_call_stacked)
        .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(4)
@@ -131,18 +127,18 @@ END(ia64_pal_call_stacked)
  * Make a physical mode PAL call using the static registers calling convention.
  *
  * Inputs:
- *     in0         Index of PAL service
- *     in2 - in3   Remaning PAL arguments
+ *     in0         Index of PAL service
+ *     in2 - in3   Remaining PAL arguments
  *
  * PSR_LP, PSR_TB, PSR_ID, PSR_DA are never set by the kernel.
  * So we don't need to clear them.
  */
-#define PAL_PSR_BITS_TO_CLEAR                                                  \
-       (IA64_PSR_I | IA64_PSR_IT | IA64_PSR_DT  | IA64_PSR_DB | IA64_PSR_RT |  \
-        IA64_PSR_DD | IA64_PSR_SS | IA64_PSR_RI | IA64_PSR_ED |                \
+#define PAL_PSR_BITS_TO_CLEAR                                                \
+       (IA64_PSR_I | IA64_PSR_IT | IA64_PSR_DT  | IA64_PSR_DB | IA64_PSR_RT |\
+        IA64_PSR_DD | IA64_PSR_SS | IA64_PSR_RI | IA64_PSR_ED |              \
         IA64_PSR_DFL | IA64_PSR_DFH)
 
-#define PAL_PSR_BITS_TO_SET                                                    \
+#define PAL_PSR_BITS_TO_SET                                                  \
        (IA64_PSR_BN)
 
 
@@ -178,7 +174,7 @@ GLOBAL_ENTRY(ia64_pal_call_phys_static)
        ;;
        andcm r16=loc3,r16              // removes bits to clear from psr
        br.call.sptk.many rp=ia64_switch_mode_phys
-.ret1: mov rp = r8                     // install return address (physical)
+       mov rp = r8                     // install return address (physical)
        mov loc5 = r19
        mov loc6 = r20
        br.cond.sptk.many b7
@@ -188,7 +184,6 @@ GLOBAL_ENTRY(ia64_pal_call_phys_static)
        mov r19=loc5
        mov r20=loc6
        br.call.sptk.many rp=ia64_switch_mode_virt // return to virtual mode
-.ret2:
        mov psr.l = loc3                // restore init PSR
 
        mov ar.pfs = loc1
@@ -203,8 +198,8 @@ END(ia64_pal_call_phys_static)
  * Make a PAL call using the stacked registers in physical mode.
  *
  * Inputs:
- *     in0         Index of PAL service
- *     in2 - in3   Remaning PAL arguments
+ *     in0         Index of PAL service
+ *     in2 - in3   Remaining PAL arguments
  */
 GLOBAL_ENTRY(ia64_pal_call_phys_stacked)
        .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(5)
@@ -212,7 +207,7 @@ GLOBAL_ENTRY(ia64_pal_call_phys_stacked)
        movl    loc2 = pal_entry_point
 1:     {
          mov r28  = in0                // copy procedure index
-         mov loc0 = rp         // save rp
+         mov loc0 = rp                 // save rp
        }
        .body
        ;;
@@ -245,7 +240,7 @@ GLOBAL_ENTRY(ia64_pal_call_phys_stacked)
        mov r16=loc3                    // r16= original psr
        mov r19=loc5
        mov r20=loc6
-       br.call.sptk.many rp=ia64_switch_mode_virt      // return to virtual mode
+       br.call.sptk.many rp=ia64_switch_mode_virt // return to virtual mode
 
        mov psr.l  = loc3               // restore init PSR
        mov ar.pfs = loc1
@@ -257,10 +252,11 @@ GLOBAL_ENTRY(ia64_pal_call_phys_stacked)
 END(ia64_pal_call_phys_stacked)
 
 /*
- * Save scratch fp scratch regs which aren't saved in pt_regs already (fp10-fp15).
+ * Save scratch fp scratch regs which aren't saved in pt_regs already
+ * (fp10-fp15).
  *
- * NOTE: We need to do this since firmware (SAL and PAL) may use any of the scratch
- * regs fp-low partition.
+ * NOTE: We need to do this since firmware (SAL and PAL) may use any of the
+ * scratch regs fp-low partition.
  *
  * Inputs:
  *      in0    Address of stack storage for fp regs
index 281004ff7b00b87a46de5f91c05c90c706827474..3aaede0d6981783037b1eaec5d0a0b7e364d57ef 100644 (file)
@@ -5558,12 +5558,13 @@ report_spurious2:
 }
 
 static irqreturn_t
-pfm_interrupt_handler(int irq, void *arg, struct pt_regs *regs)
+pfm_interrupt_handler(int irq, void *arg)
 {
        unsigned long start_cycles, total_cycles;
        unsigned long min, max;
        int this_cpu;
        int ret;
+       struct pt_regs *regs = get_irq_regs();
 
        this_cpu = get_cpu();
        if (likely(!pfm_alt_intr_handler)) {
index 41169a9bc30138be685b5decacc088412018050f..39e0cd3a0884e84e1c60b279a8090e6bfb611cd0 100644 (file)
@@ -84,6 +84,12 @@ timer_interrupt (int irq, void *dev_id)
 
                if (time_after(new_itm, ia64_get_itc()))
                        break;
+
+               /*
+                * Allow IPIs to interrupt the timer loop.
+                */
+               local_irq_enable();
+               local_irq_disable();
        }
 
        do {
index 5f2dcba7fa8da12a5d2827e6e414dbe2b0f85fbf..7a2d824c5ce3976be558a445d04af8d06a11b72f 100644 (file)
@@ -65,7 +65,6 @@ extern void sn_timer_init(void);
 extern unsigned long last_time_offset;
 extern void (*ia64_mark_idle) (int);
 extern void snidle(int);
-extern unsigned char acpi_kbd_controller_present;
 extern unsigned long long (*ia64_printk_clock)(void);
 
 unsigned long sn_rtc_cycles_per_second;
@@ -452,17 +451,6 @@ void __init sn_setup(char **cmdline_p)
 
        ia64_printk_clock = ia64_sn2_printk_clock;
 
-       /*
-        * Old PROMs do not provide an ACPI FADT. Disable legacy keyboard
-        * support here so we don't have to listen to failed keyboard probe
-        * messages.
-        */
-       if (is_shub1() && version <= 0x0209 && acpi_kbd_controller_present) {
-               printk(KERN_INFO "Disabling legacy keyboard support as prom "
-                      "is too old and doesn't provide FADT\n");
-               acpi_kbd_controller_present = 0;
-       }
-
        printk("SGI SAL version %x.%02x\n", version >> 8, version & 0x00FF);
 
        /*
index c4fae8ff4671564a6fbf07f49fe46be736d822b0..626de44bd888c67c08fd2b0bcc6ec176c9e112fc 100644 (file)
@@ -849,7 +849,7 @@ au1xxx_dbdma_chan_free(u32 chanid)
 EXPORT_SYMBOL(au1xxx_dbdma_chan_free);
 
 static irqreturn_t
-dbdma_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+dbdma_interrupt(int irq, void *dev_id)
 {
        u32 intstat;
        u32 chan_index;
index 26b0b9883496d8af2246a01f3b2f7c9ec8bc4e74..280a8001eacfd0a907261697db0f6721c0ddf976 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.18-rc1
-# Thu Jul  6 10:04:18 2006
+# Linux kernel version: 2.6.19-rc2
+# Sat Oct 14 23:01:16 2006
 #
 CONFIG_MIPS=y
 
@@ -25,8 +25,6 @@ CONFIG_MIPS=y
 # CONFIG_MIPS_COBALT is not set
 # CONFIG_MACH_DECSTATION is not set
 # CONFIG_MIPS_EV64120 is not set
-# CONFIG_MIPS_IVR is not set
-# CONFIG_MIPS_ITE8172 is not set
 # CONFIG_MACH_JAZZ is not set
 # CONFIG_LASAT is not set
 # CONFIG_MIPS_ATLAS is not set
@@ -41,13 +39,13 @@ CONFIG_MIPS=y
 # CONFIG_MOMENCO_OCELOT_G is not set
 # CONFIG_MIPS_XXS1500 is not set
 # CONFIG_PNX8550_V2PCI is not set
-# CONFIG_PNX8550_JBS is not set
+CONFIG_PNX8550_JBS=y
 # CONFIG_DDB5477 is not set
 # CONFIG_MACH_VR41XX is not set
 # CONFIG_PMC_YOSEMITE is not set
 # CONFIG_QEMU is not set
 # CONFIG_MARKEINS is not set
-CONFIG_SGI_IP22=y
+# CONFIG_SGI_IP22 is not set
 # CONFIG_SGI_IP27 is not set
 # CONFIG_SGI_IP32 is not set
 # CONFIG_SIBYTE_BIGSUR is not set
@@ -67,25 +65,21 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_TIME=y
 CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
-CONFIG_ARC=y
 CONFIG_DMA_NONCOHERENT=y
 CONFIG_DMA_NEED_PCI_MAP_STATE=y
-CONFIG_CPU_BIG_ENDIAN=y
-# CONFIG_CPU_LITTLE_ENDIAN is not set
-CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
-CONFIG_IRQ_CPU=y
-CONFIG_SWAP_IO_SPACE=y
-CONFIG_ARC32=y
-CONFIG_BOOT_ELF32=y
+# CONFIG_CPU_BIG_ENDIAN is not set
+CONFIG_CPU_LITTLE_ENDIAN=y
+CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
+CONFIG_PNX8550=y
+CONFIG_SOC_PNX8550=y
 CONFIG_MIPS_L1_CACHE_SHIFT=5
-# CONFIG_ARC_CONSOLE is not set
-CONFIG_ARC_PROMLIB=y
 
 #
 # CPU selection
 #
-# CONFIG_CPU_MIPS32_R1 is not set
+CONFIG_CPU_MIPS32_R1=y
 # CONFIG_CPU_MIPS32_R2 is not set
 # CONFIG_CPU_MIPS64_R1 is not set
 # CONFIG_CPU_MIPS64_R2 is not set
@@ -93,7 +87,7 @@ CONFIG_ARC_PROMLIB=y
 # CONFIG_CPU_TX39XX is not set
 # CONFIG_CPU_VR41XX is not set
 # CONFIG_CPU_R4300 is not set
-CONFIG_CPU_R4X00=y
+# CONFIG_CPU_R4X00 is not set
 # CONFIG_CPU_TX49XX is not set
 # CONFIG_CPU_R5000 is not set
 # CONFIG_CPU_R5432 is not set
@@ -104,12 +98,11 @@ CONFIG_CPU_R4X00=y
 # CONFIG_CPU_RM7000 is not set
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
-CONFIG_SYS_HAS_CPU_R4X00=y
-CONFIG_SYS_HAS_CPU_R5000=y
+CONFIG_SYS_HAS_CPU_MIPS32_R1=y
+CONFIG_CPU_MIPS32=y
+CONFIG_CPU_MIPSR1=y
 CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
-CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
 CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
-CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
 
 #
 # Kernel type
@@ -120,17 +113,17 @@ CONFIG_PAGE_SIZE_4KB=y
 # CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
-CONFIG_BOARD_SCACHE=y
-CONFIG_IP22_CPU_SCACHE=y
+CONFIG_CPU_HAS_PREFETCH=y
 CONFIG_MIPS_MT_DISABLED=y
-# CONFIG_MIPS_MT_SMTC is not set
 # CONFIG_MIPS_MT_SMP is not set
+# CONFIG_MIPS_MT_SMTC is not set
 # CONFIG_MIPS_VPE_LOADER is not set
 # CONFIG_64BIT_PHYS_ADDR is not set
 CONFIG_CPU_HAS_LLSC=y
 CONFIG_CPU_HAS_SYNC=y
 CONFIG_GENERIC_HARDIRQS=y
 CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_CPU_SUPPORTS_HIGHMEM=y
 CONFIG_ARCH_FLATMEM_ENABLE=y
 CONFIG_SELECT_MEMORY_MODEL=y
 CONFIG_FLATMEM_MANUAL=y
@@ -144,12 +137,12 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_HZ_48 is not set
 # CONFIG_HZ_100 is not set
 # CONFIG_HZ_128 is not set
-# CONFIG_HZ_250 is not set
+CONFIG_HZ_250=y
 # CONFIG_HZ_256 is not set
-CONFIG_HZ_1000=y
+# CONFIG_HZ_1000 is not set
 # CONFIG_HZ_1024 is not set
 CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
-CONFIG_HZ=1000
+CONFIG_HZ=250
 CONFIG_PREEMPT_NONE=y
 # CONFIG_PREEMPT_VOLUNTARY is not set
 # CONFIG_PREEMPT is not set
@@ -171,16 +164,20 @@ CONFIG_LOCALVERSION=""
 CONFIG_LOCALVERSION_AUTO=y
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_IPC_NS is not set
 # CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
-CONFIG_SYSCTL=y
+# CONFIG_TASKSTATS is not set
+# CONFIG_UTS_NS is not set
 # CONFIG_AUDIT is not set
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 # CONFIG_RELAY is not set
 CONFIG_INITRAMFS_SOURCE=""
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
 CONFIG_EMBEDDED=y
+# CONFIG_SYSCTL_SYSCALL is not set
 CONFIG_KALLSYMS=y
 # CONFIG_KALLSYMS_ALL is not set
 # CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -189,12 +186,12 @@ CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
 CONFIG_BASE_FULL=y
-CONFIG_RT_MUTEXES=y
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_SHMEM=y
 CONFIG_SLAB=y
 CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
 # CONFIG_SLOB is not set
@@ -211,6 +208,7 @@ CONFIG_KMOD=y
 #
 # Block layer
 #
+CONFIG_BLOCK=y
 # CONFIG_LBD is not set
 # CONFIG_BLK_DEV_IO_TRACE is not set
 # CONFIG_LSF is not set
@@ -231,8 +229,10 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
 #
 # Bus options (PCI, PCMCIA, EISA, ISA, TC)
 #
-CONFIG_HW_HAS_EISA=y
-# CONFIG_EISA is not set
+CONFIG_HW_HAS_PCI=y
+CONFIG_PCI=y
+# CONFIG_PCI_MULTITHREAD_PROBE is not set
+# CONFIG_PCI_DEBUG is not set
 CONFIG_MMU=y
 
 #
@@ -243,6 +243,7 @@ CONFIG_MMU=y
 #
 # PCI Hotplug Support
 #
+# CONFIG_HOTPLUG_PCI is not set
 
 #
 # Executable file formats
@@ -265,6 +266,7 @@ CONFIG_PACKET=y
 CONFIG_UNIX=y
 CONFIG_XFRM=y
 # CONFIG_XFRM_USER is not set
+# CONFIG_XFRM_SUB_POLICY is not set
 # CONFIG_NET_KEY is not set
 CONFIG_INET=y
 # CONFIG_IP_MULTICAST is not set
@@ -283,16 +285,18 @@ CONFIG_IP_PNP_BOOTP=y
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_INET_XFRM_TUNNEL is not set
 # CONFIG_INET_TUNNEL is not set
-CONFIG_INET_XFRM_MODE_TRANSPORT=m
-CONFIG_INET_XFRM_MODE_TUNNEL=m
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
 CONFIG_INET_DIAG=y
 CONFIG_INET_TCP_DIAG=y
 # CONFIG_TCP_CONG_ADVANCED is not set
-CONFIG_TCP_CONG_BIC=y
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_IPV6 is not set
 # CONFIG_INET6_XFRM_TUNNEL is not set
 # CONFIG_INET6_TUNNEL is not set
-CONFIG_NETWORK_SECMARK=y
+# CONFIG_NETWORK_SECMARK is not set
 # CONFIG_NETFILTER is not set
 
 #
@@ -318,7 +322,6 @@ CONFIG_NETWORK_SECMARK=y
 # CONFIG_ATALK is not set
 # CONFIG_X25 is not set
 # CONFIG_LAPB is not set
-# CONFIG_NET_DIVERT is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
 
@@ -371,13 +374,20 @@ CONFIG_FW_LOADER=y
 #
 # Block devices
 #
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_COW_COMMON is not set
 CONFIG_BLK_DEV_LOOP=y
 # CONFIG_BLK_DEV_CRYPTOLOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_SX8 is not set
+# CONFIG_BLK_DEV_UB is not set
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=8192
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
@@ -386,6 +396,7 @@ CONFIG_BLK_DEV_INITRD=y
 # ATA/ATAPI/MFM/RLL support
 #
 CONFIG_IDE=y
+CONFIG_IDE_MAX_HWIFS=4
 CONFIG_BLK_DEV_IDE=y
 
 #
@@ -404,8 +415,39 @@ CONFIG_BLK_DEV_IDESCSI=y
 # IDE chipset support/bugfixes
 #
 CONFIG_IDE_GENERIC=y
+CONFIG_BLK_DEV_IDEPCI=y
+CONFIG_IDEPCI_SHARE_IRQ=y
+CONFIG_BLK_DEV_OFFBOARD=y
+CONFIG_BLK_DEV_GENERIC=y
+# CONFIG_BLK_DEV_OPTI621 is not set
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
+# CONFIG_IDEDMA_PCI_AUTO is not set
+# CONFIG_BLK_DEV_AEC62XX is not set
+# CONFIG_BLK_DEV_ALI15X3 is not set
+# CONFIG_BLK_DEV_AMD74XX is not set
+# CONFIG_BLK_DEV_CMD64X is not set
+# CONFIG_BLK_DEV_TRIFLEX is not set
+# CONFIG_BLK_DEV_CY82C693 is not set
+# CONFIG_BLK_DEV_CS5520 is not set
+# CONFIG_BLK_DEV_CS5530 is not set
+# CONFIG_BLK_DEV_HPT34X is not set
+CONFIG_BLK_DEV_HPT366=y
+# CONFIG_BLK_DEV_JMICRON is not set
+# CONFIG_BLK_DEV_SC1200 is not set
+# CONFIG_BLK_DEV_PIIX is not set
+# CONFIG_BLK_DEV_IT821X is not set
+# CONFIG_BLK_DEV_NS87415 is not set
+# CONFIG_BLK_DEV_PDC202XX_OLD is not set
+# CONFIG_BLK_DEV_PDC202XX_NEW is not set
+# CONFIG_BLK_DEV_SVWKS is not set
+# CONFIG_BLK_DEV_SIIMAGE is not set
+# CONFIG_BLK_DEV_SLC90E66 is not set
+# CONFIG_BLK_DEV_TRM290 is not set
+# CONFIG_BLK_DEV_VIA82CXXX is not set
 # CONFIG_IDE_ARM is not set
-# CONFIG_BLK_DEV_IDEDMA is not set
+CONFIG_BLK_DEV_IDEDMA=y
+# CONFIG_IDEDMA_IVB is not set
 # CONFIG_IDEDMA_AUTO is not set
 # CONFIG_BLK_DEV_HD is not set
 
@@ -414,6 +456,7 @@ CONFIG_IDE_GENERIC=y
 #
 # CONFIG_RAID_ATTRS is not set
 CONFIG_SCSI=y
+CONFIG_SCSI_NETLINK=y
 CONFIG_SCSI_PROC_FS=y
 
 #
@@ -434,21 +477,53 @@ CONFIG_SCSI_CONSTANTS=y
 # CONFIG_SCSI_LOGGING is not set
 
 #
-# SCSI Transport Attributes
+# SCSI Transports
 #
 # CONFIG_SCSI_SPI_ATTRS is not set
 CONFIG_SCSI_FC_ATTRS=y
 CONFIG_SCSI_ISCSI_ATTRS=m
 # CONFIG_SCSI_SAS_ATTRS is not set
+# CONFIG_SCSI_SAS_LIBSAS is not set
 
 #
 # SCSI low-level drivers
 #
 CONFIG_ISCSI_TCP=m
-# CONFIG_SGIWD93_SCSI is not set
-# CONFIG_SCSI_SATA is not set
+# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
+# CONFIG_SCSI_3W_9XXX is not set
+# CONFIG_SCSI_ACARD is not set
+# CONFIG_SCSI_AACRAID is not set
+# CONFIG_SCSI_AIC7XXX is not set
+# CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_AIC79XX is not set
+# CONFIG_SCSI_AIC94XX is not set
+# CONFIG_SCSI_DPT_I2O is not set
+# CONFIG_SCSI_ARCMSR is not set
+# CONFIG_MEGARAID_NEWGEN is not set
+# CONFIG_MEGARAID_LEGACY is not set
+# CONFIG_MEGARAID_SAS is not set
+# CONFIG_SCSI_HPTIOP is not set
+# CONFIG_SCSI_DMX3191D is not set
+# CONFIG_SCSI_FUTURE_DOMAIN is not set
+# CONFIG_SCSI_IPS is not set
+# CONFIG_SCSI_INITIO is not set
+# CONFIG_SCSI_INIA100 is not set
+# CONFIG_SCSI_STEX is not set
+# CONFIG_SCSI_SYM53C8XX_2 is not set
+# CONFIG_SCSI_QLOGIC_1280 is not set
+# CONFIG_SCSI_QLA_FC is not set
+# CONFIG_SCSI_QLA_ISCSI is not set
+# CONFIG_SCSI_LPFC is not set
+# CONFIG_SCSI_DC395x is not set
+# CONFIG_SCSI_DC390T is not set
+# CONFIG_SCSI_NSP32 is not set
 # CONFIG_SCSI_DEBUG is not set
 
+#
+# Serial ATA (prod) and Parallel ATA (experimental) drivers
+#
+# CONFIG_ATA is not set
+
 #
 # Multi-device support (RAID and LVM)
 #
@@ -458,14 +533,19 @@ CONFIG_ISCSI_TCP=m
 # Fusion MPT device support
 #
 # CONFIG_FUSION is not set
+# CONFIG_FUSION_SPI is not set
+# CONFIG_FUSION_FC is not set
+# CONFIG_FUSION_SAS is not set
 
 #
 # IEEE 1394 (FireWire) support
 #
+# CONFIG_IEEE1394 is not set
 
 #
 # I2O device support
 #
+# CONFIG_I2O is not set
 
 #
 # Network device support
@@ -476,6 +556,11 @@ CONFIG_NETDEVICES=y
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
 
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
 #
 # PHY device support
 #
@@ -486,20 +571,73 @@ CONFIG_NETDEVICES=y
 #
 CONFIG_NET_ETHERNET=y
 CONFIG_MII=y
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
+# CONFIG_NET_VENDOR_3COM is not set
 # CONFIG_DM9000 is not set
-# CONFIG_SGISEEQ is not set
+
+#
+# Tulip family network device support
+#
+# CONFIG_NET_TULIP is not set
+# CONFIG_HP100 is not set
+CONFIG_NET_PCI=y
+# CONFIG_PCNET32 is not set
+# CONFIG_AMD8111_ETH is not set
+# CONFIG_ADAPTEC_STARFIRE is not set
+# CONFIG_B44 is not set
+# CONFIG_FORCEDETH is not set
+# CONFIG_DGRS is not set
+# CONFIG_EEPRO100 is not set
+# CONFIG_E100 is not set
+# CONFIG_FEALNX is not set
+# CONFIG_NATSEMI is not set
+# CONFIG_NE2K_PCI is not set
+# CONFIG_8139CP is not set
+CONFIG_8139TOO=y
+# CONFIG_8139TOO_PIO is not set
+CONFIG_8139TOO_TUNE_TWISTER=y
+CONFIG_8139TOO_8129=y
+# CONFIG_8139_OLD_RX_RESET is not set
+# CONFIG_SIS900 is not set
+# CONFIG_EPIC100 is not set
+# CONFIG_SUNDANCE is not set
+# CONFIG_TLAN is not set
+# CONFIG_VIA_RHINE is not set
+# CONFIG_LAN_SAA9730 is not set
 
 #
 # Ethernet (1000 Mbit)
 #
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_E1000 is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_R8169 is not set
+# CONFIG_SIS190 is not set
+# CONFIG_SKGE is not set
+# CONFIG_SKY2 is not set
+# CONFIG_SK98LIN is not set
+# CONFIG_VIA_VELOCITY is not set
+# CONFIG_TIGON3 is not set
+# CONFIG_BNX2 is not set
+# CONFIG_QLA3XXX is not set
 
 #
 # Ethernet (10000 Mbit)
 #
+# CONFIG_CHELSIO_T1 is not set
+# CONFIG_IXGB is not set
+# CONFIG_S2IO is not set
+# CONFIG_MYRI10GE is not set
 
 #
 # Token Ring devices
 #
+# CONFIG_TR is not set
 
 #
 # Wireless LAN (non-hamradio)
@@ -510,8 +648,11 @@ CONFIG_MII=y
 # Wan interfaces
 #
 # CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
+# CONFIG_NET_FC is not set
 # CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 # CONFIG_NETPOLL is not set
@@ -531,6 +672,7 @@ CONFIG_MII=y
 # Input device support
 #
 CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
 
 #
 # Userland interfaces
@@ -556,6 +698,7 @@ CONFIG_INPUT=y
 CONFIG_SERIO=y
 # CONFIG_SERIO_I8042 is not set
 # CONFIG_SERIO_SERPORT is not set
+# CONFIG_SERIO_PCIPS2 is not set
 CONFIG_SERIO_LIBPS2=y
 # CONFIG_SERIO_RAW is not set
 # CONFIG_GAMEPORT is not set
@@ -566,7 +709,7 @@ CONFIG_SERIO_LIBPS2=y
 CONFIG_VT=y
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
-CONFIG_VT_HW_CONSOLE_BINDING=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
 # CONFIG_SERIAL_NONSTANDARD is not set
 
 #
@@ -577,7 +720,8 @@ CONFIG_VT_HW_CONSOLE_BINDING=y
 #
 # Non-8250 serial port support
 #
-# CONFIG_SERIAL_IP22_ZILOG is not set
+# CONFIG_SERIAL_IP3106 is not set
+# CONFIG_SERIAL_JSM is not set
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
@@ -591,16 +735,17 @@ CONFIG_LEGACY_PTY_COUNT=256
 # Watchdog Cards
 #
 # CONFIG_WATCHDOG is not set
-# CONFIG_HW_RANDOM is not set
+CONFIG_HW_RANDOM=y
 # CONFIG_RTC is not set
-# CONFIG_SGI_DS1286 is not set
 # CONFIG_GEN_RTC is not set
 # CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
 
 #
 # Ftape, the floppy tape device driver
 #
+# CONFIG_DRM is not set
 # CONFIG_RAW_DRIVER is not set
 
 #
@@ -631,35 +776,37 @@ CONFIG_HWMON=y
 # CONFIG_HWMON_VID is not set
 # CONFIG_SENSORS_ABITUGURU is not set
 # CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_VT1211 is not set
 # CONFIG_HWMON_DEBUG_CHIP is not set
 
 #
 # Misc devices
 #
+# CONFIG_TIFM_CORE is not set
 
 #
 # Multimedia devices
 #
 # CONFIG_VIDEO_DEV is not set
-CONFIG_VIDEO_V4L2=y
 
 #
 # Digital Video Broadcasting Devices
 #
 # CONFIG_DVB is not set
+# CONFIG_USB_DABUSB is not set
 
 #
 # Graphics support
 #
-# CONFIG_FIRMWARE_EDID is not set
+CONFIG_FIRMWARE_EDID=y
 # CONFIG_FB is not set
 
 #
 # Console display driver support
 #
 # CONFIG_VGA_CONSOLE is not set
-# CONFIG_SGI_NEWPORT_CONSOLE is not set
 CONFIG_DUMMY_CONSOLE=y
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 
 #
 # Sound
@@ -669,14 +816,130 @@ CONFIG_DUMMY_CONSOLE=y
 #
 # USB support
 #
-# CONFIG_USB_ARCH_HAS_HCD is not set
-# CONFIG_USB_ARCH_HAS_OHCI is not set
-# CONFIG_USB_ARCH_HAS_EHCI is not set
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB_ARCH_HAS_EHCI=y
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+# CONFIG_USB_DEVICEFS is not set
+# CONFIG_USB_BANDWIDTH is not set
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_EHCI_HCD is not set
+# CONFIG_USB_ISP116X_HCD is not set
+CONFIG_USB_OHCI_HCD=y
+# CONFIG_USB_OHCI_BIG_ENDIAN is not set
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+# CONFIG_USB_UHCI_HCD is not set
+# CONFIG_USB_SL811_HCD is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
 
 #
 # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
 #
 
+#
+# may also be needed; see USB_STORAGE Help for more information
+#
+CONFIG_USB_STORAGE=y
+# CONFIG_USB_STORAGE_DEBUG is not set
+CONFIG_USB_STORAGE_DATAFAB=y
+CONFIG_USB_STORAGE_FREECOM=y
+CONFIG_USB_STORAGE_ISD200=y
+CONFIG_USB_STORAGE_DPCM=y
+CONFIG_USB_STORAGE_USBAT=y
+CONFIG_USB_STORAGE_SDDR09=y
+CONFIG_USB_STORAGE_SDDR55=y
+CONFIG_USB_STORAGE_JUMPSHOT=y
+# CONFIG_USB_STORAGE_ALAUDA is not set
+# CONFIG_USB_STORAGE_KARMA is not set
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Input Devices
+#
+# CONFIG_USB_HID is not set
+
+#
+# USB HID Boot Protocol drivers
+#
+# CONFIG_USB_KBD is not set
+# CONFIG_USB_MOUSE is not set
+# CONFIG_USB_AIPTEK is not set
+# CONFIG_USB_WACOM is not set
+# CONFIG_USB_ACECAD is not set
+# CONFIG_USB_KBTAB is not set
+# CONFIG_USB_POWERMATE is not set
+# CONFIG_USB_TOUCHSCREEN is not set
+# CONFIG_USB_YEALINK is not set
+# CONFIG_USB_XPAD is not set
+# CONFIG_USB_ATI_REMOTE is not set
+# CONFIG_USB_ATI_REMOTE2 is not set
+# CONFIG_USB_KEYSPAN_REMOTE is not set
+# CONFIG_USB_APPLETOUCH is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB Network Adapters
+#
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET is not set
+CONFIG_USB_MON=y
+
+#
+# USB port drivers
+#
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
+# CONFIG_USB_ADUTUX is not set
+# CONFIG_USB_AUERSWALD is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYPRESS_CY7C63 is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGET is not set
+# CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_FTDI_ELAN is not set
+# CONFIG_USB_APPLEDISPLAY is not set
+# CONFIG_USB_LD is not set
+
+#
+# USB DSL modem support
+#
+
 #
 # USB Gadget Support
 #
@@ -703,6 +966,7 @@ CONFIG_DUMMY_CONSOLE=y
 #
 # InfiniBand support
 #
+# CONFIG_INFINIBAND is not set
 
 #
 # EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
@@ -733,10 +997,12 @@ CONFIG_EXT2_FS=y
 # CONFIG_EXT2_FS_XATTR is not set
 # CONFIG_EXT2_FS_XIP is not set
 # CONFIG_EXT3_FS is not set
+# CONFIG_EXT4DEV_FS is not set
 # CONFIG_REISERFS_FS is not set
 # CONFIG_JFS_FS is not set
 # CONFIG_FS_POSIX_ACL is not set
 # CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
 # CONFIG_OCFS2_FS is not set
 # CONFIG_MINIX_FS is not set
 # CONFIG_ROMFS_FS is not set
@@ -769,8 +1035,10 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
 #
 CONFIG_PROC_FS=y
 # CONFIG_PROC_KCORE is not set
+CONFIG_PROC_SYSCTL=y
 CONFIG_SYSFS=y
 CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
 # CONFIG_HUGETLB_PAGE is not set
 CONFIG_RAMFS=y
 # CONFIG_CONFIGFS_FS is not set
@@ -813,7 +1081,6 @@ CONFIG_SUNRPC=y
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 # CONFIG_SMB_FS is not set
 # CONFIG_CIFS is not set
-# CONFIG_CIFS_DEBUG2 is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
 # CONFIG_AFS_FS is not set
@@ -824,7 +1091,6 @@ CONFIG_SUNRPC=y
 #
 # CONFIG_PARTITION_ADVANCED is not set
 CONFIG_MSDOS_PARTITION=y
-CONFIG_SGI_PARTITION=y
 
 #
 # Native Language Support
@@ -880,6 +1146,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
 #
 CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 # CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_MUST_CHECK=y
 CONFIG_MAGIC_SYSRQ=y
 # CONFIG_UNUSED_SYMBOLS is not set
 CONFIG_DEBUG_KERNEL=y
@@ -893,13 +1160,17 @@ CONFIG_DEBUG_SLAB=y
 # CONFIG_DEBUG_SPINLOCK is not set
 CONFIG_DEBUG_MUTEXES=y
 # CONFIG_DEBUG_RWSEMS is not set
+# CONFIG_DEBUG_LOCK_ALLOC is not set
+# CONFIG_PROVE_LOCKING is not set
 # CONFIG_DEBUG_SPINLOCK_SLEEP is not set
 # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
 # CONFIG_DEBUG_KOBJECT is not set
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_DEBUG_FS is not set
 # CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_LIST is not set
 CONFIG_FORCED_INLINING=y
+# CONFIG_HEADERS_CHECK is not set
 # CONFIG_RCU_TORTURE_TEST is not set
 CONFIG_CROSSCOMPILE=y
 CONFIG_CMDLINE="console=ttyS1,38400n8 kgdb=ttyS0 root=/dev/nfs ip=bootp"
@@ -918,6 +1189,9 @@ CONFIG_CMDLINE="console=ttyS1,38400n8 kgdb=ttyS0 root=/dev/nfs ip=bootp"
 # Cryptographic options
 #
 CONFIG_CRYPTO=y
+CONFIG_CRYPTO_ALGAPI=m
+CONFIG_CRYPTO_BLKCIPHER=m
+CONFIG_CRYPTO_MANAGER=m
 # CONFIG_CRYPTO_HMAC is not set
 # CONFIG_CRYPTO_NULL is not set
 # CONFIG_CRYPTO_MD4 is not set
@@ -927,6 +1201,8 @@ CONFIG_CRYPTO_MD5=m
 # CONFIG_CRYPTO_SHA512 is not set
 # CONFIG_CRYPTO_WP512 is not set
 # CONFIG_CRYPTO_TGR192 is not set
+CONFIG_CRYPTO_ECB=m
+CONFIG_CRYPTO_CBC=m
 # CONFIG_CRYPTO_DES is not set
 # CONFIG_CRYPTO_BLOWFISH is not set
 # CONFIG_CRYPTO_TWOFISH is not set
index e93266b37dd918a9e752aba99dbcc1c503d52d90..64b9fbf44a64dce63f4f55c43cf5fa08e148a3bb 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.18-rc1
-# Thu Jul  6 10:04:18 2006
+# Linux kernel version: 2.6.19-rc2
+# Sat Oct 14 23:12:15 2006
 #
 CONFIG_MIPS=y
 
@@ -25,8 +25,6 @@ CONFIG_MIPS=y
 # CONFIG_MIPS_COBALT is not set
 # CONFIG_MACH_DECSTATION is not set
 # CONFIG_MIPS_EV64120 is not set
-# CONFIG_MIPS_IVR is not set
-# CONFIG_MIPS_ITE8172 is not set
 # CONFIG_MACH_JAZZ is not set
 # CONFIG_LASAT is not set
 # CONFIG_MIPS_ATLAS is not set
@@ -40,14 +38,14 @@ CONFIG_MIPS=y
 # CONFIG_MOMENCO_OCELOT_C is not set
 # CONFIG_MOMENCO_OCELOT_G is not set
 # CONFIG_MIPS_XXS1500 is not set
-# CONFIG_PNX8550_V2PCI is not set
+CONFIG_PNX8550_V2PCI=y
 # CONFIG_PNX8550_JBS is not set
 # CONFIG_DDB5477 is not set
 # CONFIG_MACH_VR41XX is not set
 # CONFIG_PMC_YOSEMITE is not set
 # CONFIG_QEMU is not set
 # CONFIG_MARKEINS is not set
-CONFIG_SGI_IP22=y
+# CONFIG_SGI_IP22 is not set
 # CONFIG_SGI_IP27 is not set
 # CONFIG_SGI_IP32 is not set
 # CONFIG_SIBYTE_BIGSUR is not set
@@ -67,25 +65,21 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_TIME=y
 CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
-CONFIG_ARC=y
 CONFIG_DMA_NONCOHERENT=y
 CONFIG_DMA_NEED_PCI_MAP_STATE=y
-CONFIG_CPU_BIG_ENDIAN=y
-# CONFIG_CPU_LITTLE_ENDIAN is not set
-CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
-CONFIG_IRQ_CPU=y
-CONFIG_SWAP_IO_SPACE=y
-CONFIG_ARC32=y
-CONFIG_BOOT_ELF32=y
+# CONFIG_CPU_BIG_ENDIAN is not set
+CONFIG_CPU_LITTLE_ENDIAN=y
+CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
+CONFIG_PNX8550=y
+CONFIG_SOC_PNX8550=y
 CONFIG_MIPS_L1_CACHE_SHIFT=5
-# CONFIG_ARC_CONSOLE is not set
-CONFIG_ARC_PROMLIB=y
 
 #
 # CPU selection
 #
-# CONFIG_CPU_MIPS32_R1 is not set
+CONFIG_CPU_MIPS32_R1=y
 # CONFIG_CPU_MIPS32_R2 is not set
 # CONFIG_CPU_MIPS64_R1 is not set
 # CONFIG_CPU_MIPS64_R2 is not set
@@ -93,7 +87,7 @@ CONFIG_ARC_PROMLIB=y
 # CONFIG_CPU_TX39XX is not set
 # CONFIG_CPU_VR41XX is not set
 # CONFIG_CPU_R4300 is not set
-CONFIG_CPU_R4X00=y
+# CONFIG_CPU_R4X00 is not set
 # CONFIG_CPU_TX49XX is not set
 # CONFIG_CPU_R5000 is not set
 # CONFIG_CPU_R5432 is not set
@@ -104,12 +98,11 @@ CONFIG_CPU_R4X00=y
 # CONFIG_CPU_RM7000 is not set
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
-CONFIG_SYS_HAS_CPU_R4X00=y
-CONFIG_SYS_HAS_CPU_R5000=y
+CONFIG_SYS_HAS_CPU_MIPS32_R1=y
+CONFIG_CPU_MIPS32=y
+CONFIG_CPU_MIPSR1=y
 CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
-CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
 CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
-CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
 
 #
 # Kernel type
@@ -120,17 +113,17 @@ CONFIG_PAGE_SIZE_4KB=y
 # CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
-CONFIG_BOARD_SCACHE=y
-CONFIG_IP22_CPU_SCACHE=y
+CONFIG_CPU_HAS_PREFETCH=y
 CONFIG_MIPS_MT_DISABLED=y
-# CONFIG_MIPS_MT_SMTC is not set
 # CONFIG_MIPS_MT_SMP is not set
+# CONFIG_MIPS_MT_SMTC is not set
 # CONFIG_MIPS_VPE_LOADER is not set
 # CONFIG_64BIT_PHYS_ADDR is not set
 CONFIG_CPU_HAS_LLSC=y
 CONFIG_CPU_HAS_SYNC=y
 CONFIG_GENERIC_HARDIRQS=y
 CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_CPU_SUPPORTS_HIGHMEM=y
 CONFIG_ARCH_FLATMEM_ENABLE=y
 CONFIG_SELECT_MEMORY_MODEL=y
 CONFIG_FLATMEM_MANUAL=y
@@ -144,12 +137,12 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_HZ_48 is not set
 # CONFIG_HZ_100 is not set
 # CONFIG_HZ_128 is not set
-# CONFIG_HZ_250 is not set
+CONFIG_HZ_250=y
 # CONFIG_HZ_256 is not set
-CONFIG_HZ_1000=y
+# CONFIG_HZ_1000 is not set
 # CONFIG_HZ_1024 is not set
 CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
-CONFIG_HZ=1000
+CONFIG_HZ=250
 CONFIG_PREEMPT_NONE=y
 # CONFIG_PREEMPT_VOLUNTARY is not set
 # CONFIG_PREEMPT is not set
@@ -171,16 +164,20 @@ CONFIG_LOCALVERSION=""
 CONFIG_LOCALVERSION_AUTO=y
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_IPC_NS is not set
 # CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
-CONFIG_SYSCTL=y
+# CONFIG_TASKSTATS is not set
+# CONFIG_UTS_NS is not set
 # CONFIG_AUDIT is not set
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 # CONFIG_RELAY is not set
 CONFIG_INITRAMFS_SOURCE=""
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
 CONFIG_EMBEDDED=y
+# CONFIG_SYSCTL_SYSCALL is not set
 CONFIG_KALLSYMS=y
 # CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_HOTPLUG=y
@@ -188,12 +185,12 @@ CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
 CONFIG_BASE_FULL=y
-CONFIG_RT_MUTEXES=y
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_SHMEM=y
 CONFIG_SLAB=y
 CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
 # CONFIG_SLOB is not set
@@ -210,6 +207,7 @@ CONFIG_KMOD=y
 #
 # Block layer
 #
+CONFIG_BLOCK=y
 # CONFIG_LBD is not set
 # CONFIG_BLK_DEV_IO_TRACE is not set
 # CONFIG_LSF is not set
@@ -230,8 +228,9 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
 #
 # Bus options (PCI, PCMCIA, EISA, ISA, TC)
 #
-CONFIG_HW_HAS_EISA=y
-# CONFIG_EISA is not set
+CONFIG_HW_HAS_PCI=y
+CONFIG_PCI=y
+# CONFIG_PCI_MULTITHREAD_PROBE is not set
 CONFIG_MMU=y
 
 #
@@ -242,6 +241,7 @@ CONFIG_MMU=y
 #
 # PCI Hotplug Support
 #
+# CONFIG_HOTPLUG_PCI is not set
 
 #
 # Executable file formats
@@ -264,6 +264,7 @@ CONFIG_PACKET=y
 CONFIG_UNIX=y
 CONFIG_XFRM=y
 # CONFIG_XFRM_USER is not set
+# CONFIG_XFRM_SUB_POLICY is not set
 # CONFIG_NET_KEY is not set
 CONFIG_INET=y
 # CONFIG_IP_MULTICAST is not set
@@ -282,12 +283,14 @@ CONFIG_IP_PNP=y
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_INET_XFRM_TUNNEL is not set
 # CONFIG_INET_TUNNEL is not set
-CONFIG_INET_XFRM_MODE_TRANSPORT=m
-CONFIG_INET_XFRM_MODE_TUNNEL=m
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
 CONFIG_INET_DIAG=y
 CONFIG_INET_TCP_DIAG=y
 # CONFIG_TCP_CONG_ADVANCED is not set
-CONFIG_TCP_CONG_BIC=y
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
 
 #
 # IP: Virtual Server Configuration
@@ -300,12 +303,18 @@ CONFIG_IPV6_ROUTE_INFO=y
 # CONFIG_INET6_AH is not set
 # CONFIG_INET6_ESP is not set
 # CONFIG_INET6_IPCOMP is not set
+# CONFIG_IPV6_MIP6 is not set
 # CONFIG_INET6_XFRM_TUNNEL is not set
 # CONFIG_INET6_TUNNEL is not set
 CONFIG_INET6_XFRM_MODE_TRANSPORT=m
 CONFIG_INET6_XFRM_MODE_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_BEET=m
+# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
+CONFIG_IPV6_SIT=m
 # CONFIG_IPV6_TUNNEL is not set
-CONFIG_NETWORK_SECMARK=y
+# CONFIG_IPV6_SUBTREES is not set
+# CONFIG_IPV6_MULTIPLE_TABLES is not set
+# CONFIG_NETWORK_SECMARK is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
 
@@ -318,9 +327,9 @@ CONFIG_NETFILTER_XTABLES=m
 CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
 CONFIG_NETFILTER_XT_TARGET_MARK=m
 CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
-CONFIG_NETFILTER_XT_TARGET_SECMARK=m
 CONFIG_NETFILTER_XT_MATCH_COMMENT=m
 CONFIG_NETFILTER_XT_MATCH_DCCP=m
+# CONFIG_NETFILTER_XT_MATCH_DSCP is not set
 CONFIG_NETFILTER_XT_MATCH_ESP=m
 CONFIG_NETFILTER_XT_MATCH_LENGTH=m
 CONFIG_NETFILTER_XT_MATCH_LIMIT=m
@@ -329,10 +338,10 @@ CONFIG_NETFILTER_XT_MATCH_MARK=m
 # CONFIG_NETFILTER_XT_MATCH_POLICY is not set
 CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
 CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
-CONFIG_NETFILTER_XT_MATCH_QUOTA=m
+# CONFIG_NETFILTER_XT_MATCH_QUOTA is not set
 CONFIG_NETFILTER_XT_MATCH_REALM=m
 CONFIG_NETFILTER_XT_MATCH_SCTP=m
-CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
+# CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set
 CONFIG_NETFILTER_XT_MATCH_STRING=m
 CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
 
@@ -373,7 +382,6 @@ CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
 # CONFIG_ATALK is not set
 # CONFIG_X25 is not set
 # CONFIG_LAPB is not set
-# CONFIG_NET_DIVERT is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
 
@@ -426,13 +434,20 @@ CONFIG_FW_LOADER=y
 #
 # Block devices
 #
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_COW_COMMON is not set
 CONFIG_BLK_DEV_LOOP=y
 # CONFIG_BLK_DEV_CRYPTOLOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_SX8 is not set
+# CONFIG_BLK_DEV_UB is not set
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=8192
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
@@ -441,6 +456,7 @@ CONFIG_BLK_DEV_INITRD=y
 # ATA/ATAPI/MFM/RLL support
 #
 CONFIG_IDE=y
+CONFIG_IDE_MAX_HWIFS=4
 CONFIG_BLK_DEV_IDE=y
 
 #
@@ -459,9 +475,41 @@ CONFIG_IDEDISK_MULTI_MODE=y
 # IDE chipset support/bugfixes
 #
 CONFIG_IDE_GENERIC=y
+CONFIG_BLK_DEV_IDEPCI=y
+CONFIG_IDEPCI_SHARE_IRQ=y
+# CONFIG_BLK_DEV_OFFBOARD is not set
+# CONFIG_BLK_DEV_GENERIC is not set
+# CONFIG_BLK_DEV_OPTI621 is not set
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
+CONFIG_IDEDMA_PCI_AUTO=y
+# CONFIG_IDEDMA_ONLYDISK is not set
+# CONFIG_BLK_DEV_AEC62XX is not set
+# CONFIG_BLK_DEV_ALI15X3 is not set
+# CONFIG_BLK_DEV_AMD74XX is not set
+CONFIG_BLK_DEV_CMD64X=y
+# CONFIG_BLK_DEV_TRIFLEX is not set
+# CONFIG_BLK_DEV_CY82C693 is not set
+# CONFIG_BLK_DEV_CS5520 is not set
+# CONFIG_BLK_DEV_CS5530 is not set
+# CONFIG_BLK_DEV_HPT34X is not set
+# CONFIG_BLK_DEV_HPT366 is not set
+# CONFIG_BLK_DEV_JMICRON is not set
+# CONFIG_BLK_DEV_SC1200 is not set
+# CONFIG_BLK_DEV_PIIX is not set
+# CONFIG_BLK_DEV_IT821X is not set
+# CONFIG_BLK_DEV_NS87415 is not set
+# CONFIG_BLK_DEV_PDC202XX_OLD is not set
+# CONFIG_BLK_DEV_PDC202XX_NEW is not set
+# CONFIG_BLK_DEV_SVWKS is not set
+# CONFIG_BLK_DEV_SIIMAGE is not set
+# CONFIG_BLK_DEV_SLC90E66 is not set
+# CONFIG_BLK_DEV_TRM290 is not set
+# CONFIG_BLK_DEV_VIA82CXXX is not set
 # CONFIG_IDE_ARM is not set
-# CONFIG_BLK_DEV_IDEDMA is not set
-# CONFIG_IDEDMA_AUTO is not set
+CONFIG_BLK_DEV_IDEDMA=y
+# CONFIG_IDEDMA_IVB is not set
+CONFIG_IDEDMA_AUTO=y
 # CONFIG_BLK_DEV_HD is not set
 
 #
@@ -469,6 +517,7 @@ CONFIG_IDE_GENERIC=y
 #
 # CONFIG_RAID_ATTRS is not set
 CONFIG_SCSI=y
+CONFIG_SCSI_NETLINK=y
 CONFIG_SCSI_PROC_FS=y
 
 #
@@ -489,21 +538,58 @@ CONFIG_BLK_DEV_SD=y
 # CONFIG_SCSI_LOGGING is not set
 
 #
-# SCSI Transport Attributes
+# SCSI Transports
 #
 CONFIG_SCSI_SPI_ATTRS=m
 CONFIG_SCSI_FC_ATTRS=y
 CONFIG_SCSI_ISCSI_ATTRS=m
 # CONFIG_SCSI_SAS_ATTRS is not set
+# CONFIG_SCSI_SAS_LIBSAS is not set
 
 #
 # SCSI low-level drivers
 #
 CONFIG_ISCSI_TCP=m
-# CONFIG_SGIWD93_SCSI is not set
-# CONFIG_SCSI_SATA is not set
+# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
+# CONFIG_SCSI_3W_9XXX is not set
+# CONFIG_SCSI_ACARD is not set
+# CONFIG_SCSI_AACRAID is not set
+CONFIG_SCSI_AIC7XXX=m
+CONFIG_AIC7XXX_CMDS_PER_DEVICE=32
+CONFIG_AIC7XXX_RESET_DELAY_MS=15000
+# CONFIG_AIC7XXX_DEBUG_ENABLE is not set
+CONFIG_AIC7XXX_DEBUG_MASK=0
+# CONFIG_AIC7XXX_REG_PRETTY_PRINT is not set
+# CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_AIC79XX is not set
+# CONFIG_SCSI_AIC94XX is not set
+# CONFIG_SCSI_DPT_I2O is not set
+# CONFIG_SCSI_ARCMSR is not set
+# CONFIG_MEGARAID_NEWGEN is not set
+# CONFIG_MEGARAID_LEGACY is not set
+# CONFIG_MEGARAID_SAS is not set
+# CONFIG_SCSI_HPTIOP is not set
+# CONFIG_SCSI_DMX3191D is not set
+# CONFIG_SCSI_FUTURE_DOMAIN is not set
+# CONFIG_SCSI_IPS is not set
+# CONFIG_SCSI_INITIO is not set
+# CONFIG_SCSI_INIA100 is not set
+# CONFIG_SCSI_STEX is not set
+# CONFIG_SCSI_SYM53C8XX_2 is not set
+# CONFIG_SCSI_QLOGIC_1280 is not set
+# CONFIG_SCSI_QLA_FC is not set
+# CONFIG_SCSI_QLA_ISCSI is not set
+# CONFIG_SCSI_LPFC is not set
+# CONFIG_SCSI_DC395x is not set
+# CONFIG_SCSI_DC390T is not set
+# CONFIG_SCSI_NSP32 is not set
 # CONFIG_SCSI_DEBUG is not set
 
+#
+# Serial ATA (prod) and Parallel ATA (experimental) drivers
+#
+# CONFIG_ATA is not set
+
 #
 # Multi-device support (RAID and LVM)
 #
@@ -513,14 +599,19 @@ CONFIG_ISCSI_TCP=m
 # Fusion MPT device support
 #
 # CONFIG_FUSION is not set
+# CONFIG_FUSION_SPI is not set
+# CONFIG_FUSION_FC is not set
+# CONFIG_FUSION_SAS is not set
 
 #
 # IEEE 1394 (FireWire) support
 #
+# CONFIG_IEEE1394 is not set
 
 #
 # I2O device support
 #
+# CONFIG_I2O is not set
 
 #
 # Network device support
@@ -531,6 +622,11 @@ CONFIG_NETDEVICES=y
 # CONFIG_EQUALIZER is not set
 CONFIG_TUN=m
 
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
 #
 # PHY device support
 #
@@ -541,20 +637,73 @@ CONFIG_TUN=m
 #
 CONFIG_NET_ETHERNET=y
 CONFIG_MII=y
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
+# CONFIG_NET_VENDOR_3COM is not set
 # CONFIG_DM9000 is not set
-# CONFIG_SGISEEQ is not set
+
+#
+# Tulip family network device support
+#
+# CONFIG_NET_TULIP is not set
+# CONFIG_HP100 is not set
+CONFIG_NET_PCI=y
+# CONFIG_PCNET32 is not set
+# CONFIG_AMD8111_ETH is not set
+# CONFIG_ADAPTEC_STARFIRE is not set
+# CONFIG_B44 is not set
+# CONFIG_FORCEDETH is not set
+# CONFIG_DGRS is not set
+# CONFIG_EEPRO100 is not set
+# CONFIG_E100 is not set
+# CONFIG_FEALNX is not set
+CONFIG_NATSEMI=y
+# CONFIG_NE2K_PCI is not set
+# CONFIG_8139CP is not set
+CONFIG_8139TOO=y
+# CONFIG_8139TOO_PIO is not set
+# CONFIG_8139TOO_TUNE_TWISTER is not set
+# CONFIG_8139TOO_8129 is not set
+# CONFIG_8139_OLD_RX_RESET is not set
+# CONFIG_SIS900 is not set
+# CONFIG_EPIC100 is not set
+# CONFIG_SUNDANCE is not set
+# CONFIG_TLAN is not set
+# CONFIG_VIA_RHINE is not set
+# CONFIG_LAN_SAA9730 is not set
 
 #
 # Ethernet (1000 Mbit)
 #
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_E1000 is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_R8169 is not set
+# CONFIG_SIS190 is not set
+# CONFIG_SKGE is not set
+# CONFIG_SKY2 is not set
+# CONFIG_SK98LIN is not set
+# CONFIG_VIA_VELOCITY is not set
+# CONFIG_TIGON3 is not set
+# CONFIG_BNX2 is not set
+# CONFIG_QLA3XXX is not set
 
 #
 # Ethernet (10000 Mbit)
 #
+# CONFIG_CHELSIO_T1 is not set
+# CONFIG_IXGB is not set
+# CONFIG_S2IO is not set
+# CONFIG_MYRI10GE is not set
 
 #
 # Token Ring devices
 #
+# CONFIG_TR is not set
 
 #
 # Wireless LAN (non-hamradio)
@@ -565,6 +714,8 @@ CONFIG_MII=y
 # Wan interfaces
 #
 # CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
 CONFIG_PPP=m
 # CONFIG_PPP_MULTILINK is not set
 # CONFIG_PPP_FILTER is not set
@@ -575,6 +726,8 @@ CONFIG_PPP_DEFLATE=m
 CONFIG_PPP_MPPE=m
 # CONFIG_PPPOE is not set
 # CONFIG_SLIP is not set
+CONFIG_SLHC=m
+# CONFIG_NET_FC is not set
 # CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 # CONFIG_NETPOLL is not set
@@ -594,6 +747,7 @@ CONFIG_PPP_MPPE=m
 # Input device support
 #
 CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
 
 #
 # Userland interfaces
@@ -616,6 +770,7 @@ CONFIG_KEYBOARD_ATKBD=y
 # CONFIG_KEYBOARD_LKKBD is not set
 # CONFIG_KEYBOARD_XTKBD is not set
 # CONFIG_KEYBOARD_NEWTON is not set
+# CONFIG_KEYBOARD_STOWAWAY is not set
 CONFIG_INPUT_MOUSE=y
 CONFIG_MOUSE_PS2=y
 # CONFIG_MOUSE_SERIAL is not set
@@ -630,6 +785,7 @@ CONFIG_MOUSE_PS2=y
 CONFIG_SERIO=y
 CONFIG_SERIO_I8042=y
 CONFIG_SERIO_SERPORT=y
+# CONFIG_SERIO_PCIPS2 is not set
 CONFIG_SERIO_LIBPS2=y
 # CONFIG_SERIO_RAW is not set
 # CONFIG_GAMEPORT is not set
@@ -640,7 +796,7 @@ CONFIG_SERIO_LIBPS2=y
 CONFIG_VT=y
 # CONFIG_VT_CONSOLE is not set
 CONFIG_HW_CONSOLE=y
-CONFIG_VT_HW_CONSOLE_BINDING=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
 CONFIG_SERIAL_NONSTANDARD=y
 # CONFIG_COMPUTONE is not set
 # CONFIG_ROCKETPORT is not set
@@ -650,6 +806,7 @@ CONFIG_SERIAL_NONSTANDARD=y
 # CONFIG_MOXA_SMARTIO is not set
 # CONFIG_ISI is not set
 # CONFIG_SYNCLINKMP is not set
+# CONFIG_SYNCLINK_GT is not set
 # CONFIG_N_HDLC is not set
 # CONFIG_RISCOM8 is not set
 # CONFIG_SPECIALIX is not set
@@ -665,7 +822,8 @@ CONFIG_SERIAL_NONSTANDARD=y
 #
 # Non-8250 serial port support
 #
-# CONFIG_SERIAL_IP22_ZILOG is not set
+# CONFIG_SERIAL_IP3106 is not set
+# CONFIG_SERIAL_JSM is not set
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
@@ -679,16 +837,17 @@ CONFIG_LEGACY_PTY_COUNT=256
 # Watchdog Cards
 #
 # CONFIG_WATCHDOG is not set
-# CONFIG_HW_RANDOM is not set
+CONFIG_HW_RANDOM=y
 # CONFIG_RTC is not set
-# CONFIG_SGI_DS1286 is not set
 # CONFIG_GEN_RTC is not set
 # CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
 
 #
 # Ftape, the floppy tape device driver
 #
+# CONFIG_DRM is not set
 # CONFIG_RAW_DRIVER is not set
 
 #
@@ -709,14 +868,30 @@ CONFIG_I2C_CHARDEV=m
 CONFIG_I2C_ALGOBIT=m
 # CONFIG_I2C_ALGOPCF is not set
 # CONFIG_I2C_ALGOPCA is not set
-# CONFIG_I2C_ALGO_SGI is not set
 
 #
 # I2C Hardware Bus support
 #
+# CONFIG_I2C_ALI1535 is not set
+# CONFIG_I2C_ALI1563 is not set
+# CONFIG_I2C_ALI15X3 is not set
+# CONFIG_I2C_AMD756 is not set
+# CONFIG_I2C_AMD8111 is not set
+# CONFIG_I2C_I801 is not set
+# CONFIG_I2C_I810 is not set
+# CONFIG_I2C_PIIX4 is not set
+# CONFIG_I2C_NFORCE2 is not set
 # CONFIG_I2C_OCORES is not set
 # CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_PROSAVAGE is not set
+# CONFIG_I2C_SAVAGE4 is not set
+# CONFIG_I2C_SIS5595 is not set
+# CONFIG_I2C_SIS630 is not set
+# CONFIG_I2C_SIS96X is not set
 # CONFIG_I2C_STUB is not set
+# CONFIG_I2C_VIA is not set
+# CONFIG_I2C_VIAPRO is not set
+# CONFIG_I2C_VOODOO3 is not set
 # CONFIG_I2C_PCA_ISA is not set
 
 #
@@ -776,9 +951,13 @@ CONFIG_HWMON=y
 # CONFIG_SENSORS_LM92 is not set
 # CONFIG_SENSORS_MAX1619 is not set
 # CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_SIS5595 is not set
 # CONFIG_SENSORS_SMSC47M1 is not set
 # CONFIG_SENSORS_SMSC47M192 is not set
 # CONFIG_SENSORS_SMSC47B397 is not set
+# CONFIG_SENSORS_VIA686A is not set
+# CONFIG_SENSORS_VT1211 is not set
+# CONFIG_SENSORS_VT8231 is not set
 # CONFIG_SENSORS_W83781D is not set
 # CONFIG_SENSORS_W83791D is not set
 # CONFIG_SENSORS_W83792D is not set
@@ -790,23 +969,25 @@ CONFIG_HWMON=y
 #
 # Misc devices
 #
+# CONFIG_TIFM_CORE is not set
 
 #
 # Multimedia devices
 #
 # CONFIG_VIDEO_DEV is not set
-CONFIG_VIDEO_V4L2=y
 
 #
 # Digital Video Broadcasting Devices
 #
 # CONFIG_DVB is not set
+# CONFIG_USB_DABUSB is not set
 
 #
 # Graphics support
 #
-# CONFIG_FIRMWARE_EDID is not set
+CONFIG_FIRMWARE_EDID=y
 CONFIG_FB=y
+# CONFIG_FB_DDC is not set
 # CONFIG_FB_CFB_FILLRECT is not set
 # CONFIG_FB_CFB_COPYAREA is not set
 # CONFIG_FB_CFB_IMAGEBLIT is not set
@@ -814,14 +995,32 @@ CONFIG_FB=y
 # CONFIG_FB_BACKLIGHT is not set
 # CONFIG_FB_MODE_HELPERS is not set
 # CONFIG_FB_TILEBLITTING is not set
+# CONFIG_FB_CIRRUS is not set
+# CONFIG_FB_PM2 is not set
+# CONFIG_FB_CYBER2000 is not set
+# CONFIG_FB_ASILIANT is not set
+# CONFIG_FB_IMSTT is not set
 # CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_NVIDIA is not set
+# CONFIG_FB_RIVA is not set
+# CONFIG_FB_MATROX is not set
+# CONFIG_FB_RADEON is not set
+# CONFIG_FB_ATY128 is not set
+# CONFIG_FB_ATY is not set
+# CONFIG_FB_SAVAGE is not set
+# CONFIG_FB_SIS is not set
+# CONFIG_FB_NEOMAGIC is not set
+# CONFIG_FB_KYRO is not set
+# CONFIG_FB_3DFX is not set
+# CONFIG_FB_VOODOO1 is not set
+# CONFIG_FB_SMIVGX is not set
+# CONFIG_FB_TRIDENT is not set
 # CONFIG_FB_VIRTUAL is not set
 
 #
 # Console display driver support
 #
 # CONFIG_VGA_CONSOLE is not set
-# CONFIG_SGI_NEWPORT_CONSOLE is not set
 CONFIG_DUMMY_CONSOLE=y
 # CONFIG_FRAMEBUFFER_CONSOLE is not set
 
@@ -839,14 +1038,128 @@ CONFIG_DUMMY_CONSOLE=y
 #
 # USB support
 #
-# CONFIG_USB_ARCH_HAS_HCD is not set
-# CONFIG_USB_ARCH_HAS_OHCI is not set
-# CONFIG_USB_ARCH_HAS_EHCI is not set
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB_ARCH_HAS_EHCI=y
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_BANDWIDTH is not set
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_EHCI_HCD is not set
+# CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_OHCI_HCD is not set
+# CONFIG_USB_UHCI_HCD is not set
+# CONFIG_USB_SL811_HCD is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
 
 #
 # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
 #
 
+#
+# may also be needed; see USB_STORAGE Help for more information
+#
+CONFIG_USB_STORAGE=y
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_USBAT is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_SDDR55 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_ALAUDA is not set
+# CONFIG_USB_STORAGE_ONETOUCH is not set
+# CONFIG_USB_STORAGE_KARMA is not set
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=y
+CONFIG_USB_HIDINPUT=y
+# CONFIG_USB_HIDINPUT_POWERBOOK is not set
+# CONFIG_HID_FF is not set
+CONFIG_USB_HIDDEV=y
+# CONFIG_USB_AIPTEK is not set
+# CONFIG_USB_WACOM is not set
+# CONFIG_USB_ACECAD is not set
+# CONFIG_USB_KBTAB is not set
+# CONFIG_USB_POWERMATE is not set
+# CONFIG_USB_TOUCHSCREEN is not set
+# CONFIG_USB_YEALINK is not set
+# CONFIG_USB_XPAD is not set
+# CONFIG_USB_ATI_REMOTE is not set
+# CONFIG_USB_ATI_REMOTE2 is not set
+# CONFIG_USB_KEYSPAN_REMOTE is not set
+# CONFIG_USB_APPLETOUCH is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB Network Adapters
+#
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET is not set
+CONFIG_USB_MON=y
+
+#
+# USB port drivers
+#
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
+# CONFIG_USB_ADUTUX is not set
+# CONFIG_USB_AUERSWALD is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYPRESS_CY7C63 is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGET is not set
+# CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_FTDI_ELAN is not set
+# CONFIG_USB_APPLEDISPLAY is not set
+# CONFIG_USB_LD is not set
+# CONFIG_USB_TEST is not set
+
+#
+# USB DSL modem support
+#
+
 #
 # USB Gadget Support
 #
@@ -873,6 +1186,7 @@ CONFIG_DUMMY_CONSOLE=y
 #
 # InfiniBand support
 #
+# CONFIG_INFINIBAND is not set
 
 #
 # EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
@@ -906,6 +1220,7 @@ CONFIG_EXT3_FS=y
 CONFIG_EXT3_FS_XATTR=y
 # CONFIG_EXT3_FS_POSIX_ACL is not set
 # CONFIG_EXT3_FS_SECURITY is not set
+# CONFIG_EXT4DEV_FS is not set
 CONFIG_JBD=y
 # CONFIG_JBD_DEBUG is not set
 CONFIG_FS_MBCACHE=y
@@ -917,6 +1232,7 @@ CONFIG_XFS_FS=m
 # CONFIG_XFS_SECURITY is not set
 # CONFIG_XFS_POSIX_ACL is not set
 # CONFIG_XFS_RT is not set
+# CONFIG_GFS2_FS is not set
 # CONFIG_OCFS2_FS is not set
 # CONFIG_MINIX_FS is not set
 # CONFIG_ROMFS_FS is not set
@@ -949,8 +1265,10 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
 #
 CONFIG_PROC_FS=y
 # CONFIG_PROC_KCORE is not set
+CONFIG_PROC_SYSCTL=y
 CONFIG_SYSFS=y
 CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
 # CONFIG_HUGETLB_PAGE is not set
 CONFIG_RAMFS=y
 # CONFIG_CONFIGFS_FS is not set
@@ -994,7 +1312,6 @@ CONFIG_SUNRPC=y
 CONFIG_SMB_FS=m
 # CONFIG_SMB_NLS_DEFAULT is not set
 # CONFIG_CIFS is not set
-# CONFIG_CIFS_DEBUG2 is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
 # CONFIG_AFS_FS is not set
@@ -1005,7 +1322,6 @@ CONFIG_SMB_FS=m
 #
 # CONFIG_PARTITION_ADVANCED is not set
 CONFIG_MSDOS_PARTITION=y
-CONFIG_SGI_PARTITION=y
 
 #
 # Native Language Support
@@ -1061,11 +1377,13 @@ CONFIG_NLS_DEFAULT="iso8859-1"
 #
 CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 # CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_MUST_CHECK=y
 # CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_UNUSED_SYMBOLS is not set
 # CONFIG_DEBUG_KERNEL is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
 CONFIG_CROSSCOMPILE=y
 CONFIG_CMDLINE=""
 
@@ -1079,6 +1397,9 @@ CONFIG_CMDLINE=""
 # Cryptographic options
 #
 CONFIG_CRYPTO=y
+CONFIG_CRYPTO_ALGAPI=m
+CONFIG_CRYPTO_BLKCIPHER=m
+CONFIG_CRYPTO_MANAGER=m
 # CONFIG_CRYPTO_HMAC is not set
 # CONFIG_CRYPTO_NULL is not set
 # CONFIG_CRYPTO_MD4 is not set
@@ -1088,6 +1409,8 @@ CONFIG_CRYPTO_SHA1=m
 # CONFIG_CRYPTO_SHA512 is not set
 # CONFIG_CRYPTO_WP512 is not set
 # CONFIG_CRYPTO_TGR192 is not set
+CONFIG_CRYPTO_ECB=m
+CONFIG_CRYPTO_CBC=m
 # CONFIG_CRYPTO_DES is not set
 # CONFIG_CRYPTO_BLOWFISH is not set
 # CONFIG_CRYPTO_TWOFISH is not set
index ad7271b3f2666dee49c35463b85ebf800cd23ac2..f7e8194809a143cce88097282da1eadc2e74bb55 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.18-rc1
-# Thu Jul  6 10:04:21 2006
+# Linux kernel version: 2.6.19-rc2
+# Wed Oct 18 12:57:11 2006
 #
 CONFIG_MIPS=y
 
@@ -25,8 +25,6 @@ CONFIG_MIPS=y
 # CONFIG_MIPS_COBALT is not set
 # CONFIG_MACH_DECSTATION is not set
 # CONFIG_MIPS_EV64120 is not set
-# CONFIG_MIPS_IVR is not set
-# CONFIG_MIPS_ITE8172 is not set
 # CONFIG_MACH_JAZZ is not set
 # CONFIG_LASAT is not set
 # CONFIG_MIPS_ATLAS is not set
@@ -72,11 +70,11 @@ CONFIG_TANBAC_TB0287=y
 # CONFIG_VICTOR_MPC30X is not set
 # CONFIG_ZAO_CAPCELLA is not set
 CONFIG_PCI_VR41XX=y
-# CONFIG_VRC4173 is not set
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_TIME=y
 CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
 CONFIG_DMA_NONCOHERENT=y
 CONFIG_DMA_NEED_PCI_MAP_STATE=y
@@ -123,8 +121,8 @@ CONFIG_PAGE_SIZE_4KB=y
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 CONFIG_MIPS_MT_DISABLED=y
-# CONFIG_MIPS_MT_SMTC is not set
 # CONFIG_MIPS_MT_SMP is not set
+# CONFIG_MIPS_MT_SMTC is not set
 # CONFIG_MIPS_VPE_LOADER is not set
 CONFIG_CPU_HAS_SYNC=y
 CONFIG_GENERIC_HARDIRQS=y
@@ -169,15 +167,19 @@ CONFIG_LOCALVERSION=""
 CONFIG_LOCALVERSION_AUTO=y
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_IPC_NS is not set
 # CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
-CONFIG_SYSCTL=y
+# CONFIG_TASKSTATS is not set
+# CONFIG_UTS_NS is not set
 # CONFIG_AUDIT is not set
 # CONFIG_IKCONFIG is not set
 # CONFIG_RELAY is not set
 CONFIG_INITRAMFS_SOURCE=""
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
 CONFIG_EMBEDDED=y
+# CONFIG_SYSCTL_SYSCALL is not set
 CONFIG_KALLSYMS=y
 # CONFIG_KALLSYMS_EXTRA_PASS is not set
 # CONFIG_HOTPLUG is not set
@@ -185,12 +187,12 @@ CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
 CONFIG_BASE_FULL=y
-CONFIG_RT_MUTEXES=y
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_SHMEM=y
 CONFIG_SLAB=y
 CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
 # CONFIG_SLOB is not set
@@ -208,6 +210,7 @@ CONFIG_KMOD=y
 #
 # Block layer
 #
+CONFIG_BLOCK=y
 # CONFIG_LBD is not set
 # CONFIG_BLK_DEV_IO_TRACE is not set
 # CONFIG_LSF is not set
@@ -230,17 +233,16 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
 #
 CONFIG_HW_HAS_PCI=y
 CONFIG_PCI=y
+# CONFIG_PCI_MULTITHREAD_PROBE is not set
 CONFIG_MMU=y
 
 #
 # PCCARD (PCMCIA/CardBus) support
 #
-# CONFIG_PCCARD is not set
 
 #
 # PCI Hotplug Support
 #
-# CONFIG_HOTPLUG_PCI is not set
 
 #
 # Executable file formats
@@ -263,6 +265,7 @@ CONFIG_PACKET=y
 CONFIG_UNIX=y
 CONFIG_XFRM=y
 # CONFIG_XFRM_USER is not set
+# CONFIG_XFRM_SUB_POLICY is not set
 # CONFIG_NET_KEY is not set
 CONFIG_INET=y
 CONFIG_IP_MULTICAST=y
@@ -291,13 +294,10 @@ CONFIG_SYN_COOKIES=y
 CONFIG_INET_TUNNEL=m
 CONFIG_INET_XFRM_MODE_TRANSPORT=m
 CONFIG_INET_XFRM_MODE_TUNNEL=m
+CONFIG_INET_XFRM_MODE_BEET=y
 CONFIG_INET_DIAG=y
 CONFIG_INET_TCP_DIAG=y
 CONFIG_TCP_CONG_ADVANCED=y
-
-#
-# TCP congestion control
-#
 CONFIG_TCP_CONG_BIC=y
 CONFIG_TCP_CONG_CUBIC=m
 CONFIG_TCP_CONG_WESTWOOD=m
@@ -308,7 +308,13 @@ CONFIG_TCP_CONG_HTCP=m
 # CONFIG_TCP_CONG_SCALABLE is not set
 # CONFIG_TCP_CONG_LP is not set
 # CONFIG_TCP_CONG_VENO is not set
-# CONFIG_TCP_CONG_COMPOUND is not set
+CONFIG_DEFAULT_BIC=y
+# CONFIG_DEFAULT_CUBIC is not set
+# CONFIG_DEFAULT_HTCP is not set
+# CONFIG_DEFAULT_VEGAS is not set
+# CONFIG_DEFAULT_WESTWOOD is not set
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="bic"
 # CONFIG_IPV6 is not set
 # CONFIG_INET6_XFRM_TUNNEL is not set
 # CONFIG_INET6_TUNNEL is not set
@@ -338,7 +344,6 @@ CONFIG_NETWORK_SECMARK=y
 # CONFIG_ATALK is not set
 # CONFIG_X25 is not set
 # CONFIG_LAPB is not set
-# CONFIG_NET_DIVERT is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
 
@@ -355,6 +360,7 @@ CONFIG_NETWORK_SECMARK=y
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
 # CONFIG_IEEE80211 is not set
+CONFIG_FIB_RULES=y
 
 #
 # Device Drivers
@@ -365,7 +371,6 @@ CONFIG_NETWORK_SECMARK=y
 #
 CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
-# CONFIG_FW_LOADER is not set
 # CONFIG_SYS_HYPERVISOR is not set
 
 #
@@ -403,6 +408,7 @@ CONFIG_BLK_DEV_NBD=m
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=4096
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
 # CONFIG_BLK_DEV_INITRD is not set
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
@@ -410,65 +416,14 @@ CONFIG_BLK_DEV_RAM_SIZE=4096
 #
 # ATA/ATAPI/MFM/RLL support
 #
-CONFIG_IDE=y
-CONFIG_BLK_DEV_IDE=y
-
-#
-# Please see Documentation/ide.txt for help/info on IDE drives
-#
-# CONFIG_BLK_DEV_IDE_SATA is not set
-CONFIG_BLK_DEV_IDEDISK=y
-# CONFIG_IDEDISK_MULTI_MODE is not set
-# CONFIG_BLK_DEV_IDECD is not set
-# CONFIG_BLK_DEV_IDETAPE is not set
-# CONFIG_BLK_DEV_IDEFLOPPY is not set
-# CONFIG_BLK_DEV_IDESCSI is not set
-# CONFIG_IDE_TASK_IOCTL is not set
-
-#
-# IDE chipset support/bugfixes
-#
-CONFIG_IDE_GENERIC=y
-CONFIG_BLK_DEV_IDEPCI=y
-# CONFIG_IDEPCI_SHARE_IRQ is not set
-# CONFIG_BLK_DEV_OFFBOARD is not set
-# CONFIG_BLK_DEV_GENERIC is not set
-# CONFIG_BLK_DEV_OPTI621 is not set
-CONFIG_BLK_DEV_IDEDMA_PCI=y
-# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
-# CONFIG_IDEDMA_PCI_AUTO is not set
-# CONFIG_BLK_DEV_AEC62XX is not set
-# CONFIG_BLK_DEV_ALI15X3 is not set
-# CONFIG_BLK_DEV_AMD74XX is not set
-# CONFIG_BLK_DEV_CMD64X is not set
-# CONFIG_BLK_DEV_TRIFLEX is not set
-# CONFIG_BLK_DEV_CY82C693 is not set
-# CONFIG_BLK_DEV_CS5520 is not set
-# CONFIG_BLK_DEV_CS5530 is not set
-# CONFIG_BLK_DEV_HPT34X is not set
-# CONFIG_BLK_DEV_HPT366 is not set
-# CONFIG_BLK_DEV_SC1200 is not set
-# CONFIG_BLK_DEV_PIIX is not set
-# CONFIG_BLK_DEV_IT821X is not set
-# CONFIG_BLK_DEV_NS87415 is not set
-# CONFIG_BLK_DEV_PDC202XX_OLD is not set
-# CONFIG_BLK_DEV_PDC202XX_NEW is not set
-# CONFIG_BLK_DEV_SVWKS is not set
-CONFIG_BLK_DEV_SIIMAGE=y
-# CONFIG_BLK_DEV_SLC90E66 is not set
-# CONFIG_BLK_DEV_TRM290 is not set
-# CONFIG_BLK_DEV_VIA82CXXX is not set
-# CONFIG_IDE_ARM is not set
-CONFIG_BLK_DEV_IDEDMA=y
-# CONFIG_IDEDMA_IVB is not set
-# CONFIG_IDEDMA_AUTO is not set
-# CONFIG_BLK_DEV_HD is not set
+# CONFIG_IDE is not set
 
 #
 # SCSI device support
 #
 # CONFIG_RAID_ATTRS is not set
 CONFIG_SCSI=y
+# CONFIG_SCSI_NETLINK is not set
 CONFIG_SCSI_PROC_FS=y
 
 #
@@ -489,12 +444,13 @@ CONFIG_BLK_DEV_SD=y
 # CONFIG_SCSI_LOGGING is not set
 
 #
-# SCSI Transport Attributes
+# SCSI Transports
 #
 # CONFIG_SCSI_SPI_ATTRS is not set
 # CONFIG_SCSI_FC_ATTRS is not set
 # CONFIG_SCSI_ISCSI_ATTRS is not set
 # CONFIG_SCSI_SAS_ATTRS is not set
+# CONFIG_SCSI_SAS_LIBSAS is not set
 
 #
 # SCSI low-level drivers
@@ -507,27 +463,83 @@ CONFIG_BLK_DEV_SD=y
 # CONFIG_SCSI_AIC7XXX is not set
 # CONFIG_SCSI_AIC7XXX_OLD is not set
 # CONFIG_SCSI_AIC79XX is not set
+# CONFIG_SCSI_AIC94XX is not set
 # CONFIG_SCSI_DPT_I2O is not set
+# CONFIG_SCSI_ARCMSR is not set
 # CONFIG_MEGARAID_NEWGEN is not set
 # CONFIG_MEGARAID_LEGACY is not set
 # CONFIG_MEGARAID_SAS is not set
-# CONFIG_SCSI_SATA is not set
 # CONFIG_SCSI_HPTIOP is not set
 # CONFIG_SCSI_DMX3191D is not set
 # CONFIG_SCSI_FUTURE_DOMAIN is not set
 # CONFIG_SCSI_IPS is not set
 # CONFIG_SCSI_INITIO is not set
 # CONFIG_SCSI_INIA100 is not set
+# CONFIG_SCSI_STEX is not set
 # CONFIG_SCSI_SYM53C8XX_2 is not set
 # CONFIG_SCSI_IPR is not set
 # CONFIG_SCSI_QLOGIC_1280 is not set
 # CONFIG_SCSI_QLA_FC is not set
+# CONFIG_SCSI_QLA_ISCSI is not set
 # CONFIG_SCSI_LPFC is not set
 # CONFIG_SCSI_DC395x is not set
 # CONFIG_SCSI_DC390T is not set
 # CONFIG_SCSI_NSP32 is not set
 # CONFIG_SCSI_DEBUG is not set
 
+#
+# Serial ATA (prod) and Parallel ATA (experimental) drivers
+#
+CONFIG_ATA=y
+# CONFIG_SATA_AHCI is not set
+# CONFIG_SATA_SVW is not set
+# CONFIG_ATA_PIIX is not set
+# CONFIG_SATA_MV is not set
+# CONFIG_SATA_NV is not set
+# CONFIG_PDC_ADMA is not set
+# CONFIG_SATA_QSTOR is not set
+# CONFIG_SATA_PROMISE is not set
+# CONFIG_SATA_SX4 is not set
+# CONFIG_SATA_SIL is not set
+# CONFIG_SATA_SIL24 is not set
+# CONFIG_SATA_SIS is not set
+# CONFIG_SATA_ULI is not set
+# CONFIG_SATA_VIA is not set
+# CONFIG_SATA_VITESSE is not set
+# CONFIG_PATA_ALI is not set
+# CONFIG_PATA_AMD is not set
+# CONFIG_PATA_ARTOP is not set
+# CONFIG_PATA_ATIIXP is not set
+# CONFIG_PATA_CMD64X is not set
+# CONFIG_PATA_CS5520 is not set
+# CONFIG_PATA_CS5530 is not set
+# CONFIG_PATA_CYPRESS is not set
+# CONFIG_PATA_EFAR is not set
+# CONFIG_ATA_GENERIC is not set
+# CONFIG_PATA_HPT366 is not set
+# CONFIG_PATA_HPT37X is not set
+# CONFIG_PATA_HPT3X2N is not set
+# CONFIG_PATA_HPT3X3 is not set
+# CONFIG_PATA_IT821X is not set
+# CONFIG_PATA_JMICRON is not set
+# CONFIG_PATA_TRIFLEX is not set
+# CONFIG_PATA_MPIIX is not set
+# CONFIG_PATA_OLDPIIX is not set
+# CONFIG_PATA_NETCELL is not set
+# CONFIG_PATA_NS87410 is not set
+# CONFIG_PATA_OPTI is not set
+# CONFIG_PATA_OPTIDMA is not set
+# CONFIG_PATA_PDC_OLD is not set
+# CONFIG_PATA_RADISYS is not set
+# CONFIG_PATA_RZ1000 is not set
+# CONFIG_PATA_SC1200 is not set
+# CONFIG_PATA_SERVERWORKS is not set
+# CONFIG_PATA_PDC2027X is not set
+CONFIG_PATA_SIL680=y
+# CONFIG_PATA_SIS is not set
+# CONFIG_PATA_VIA is not set
+# CONFIG_PATA_WINBOND is not set
+
 #
 # Multi-device support (RAID and LVM)
 #
@@ -632,6 +644,7 @@ CONFIG_R8169=y
 # CONFIG_SK98LIN is not set
 # CONFIG_TIGON3 is not set
 # CONFIG_BNX2 is not set
+# CONFIG_QLA3XXX is not set
 
 #
 # Ethernet (10000 Mbit)
@@ -679,6 +692,7 @@ CONFIG_R8169=y
 # Input device support
 #
 CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
 
 #
 # Userland interfaces
@@ -758,7 +772,6 @@ CONFIG_GPIO_VR41XX=y
 # TPM devices
 #
 # CONFIG_TCG_TPM is not set
-# CONFIG_TELCLOCK is not set
 
 #
 # I2C support
@@ -784,12 +797,12 @@ CONFIG_GPIO_VR41XX=y
 #
 # Misc devices
 #
+# CONFIG_TIFM_CORE is not set
 
 #
 # Multimedia devices
 #
 # CONFIG_VIDEO_DEV is not set
-CONFIG_VIDEO_V4L2=y
 
 #
 # Digital Video Broadcasting Devices
@@ -897,13 +910,13 @@ CONFIG_USB_STORAGE=m
 # CONFIG_USB_STORAGE_DEBUG is not set
 # CONFIG_USB_STORAGE_DATAFAB is not set
 # CONFIG_USB_STORAGE_FREECOM is not set
-# CONFIG_USB_STORAGE_ISD200 is not set
 # CONFIG_USB_STORAGE_DPCM is not set
 # CONFIG_USB_STORAGE_USBAT is not set
 # CONFIG_USB_STORAGE_SDDR09 is not set
 # CONFIG_USB_STORAGE_SDDR55 is not set
 # CONFIG_USB_STORAGE_JUMPSHOT is not set
 # CONFIG_USB_STORAGE_ALAUDA is not set
+# CONFIG_USB_STORAGE_KARMA is not set
 # CONFIG_USB_LIBUSUAL is not set
 
 #
@@ -932,6 +945,7 @@ CONFIG_USB_HIDINPUT=y
 # CONFIG_USB_ATI_REMOTE2 is not set
 # CONFIG_USB_KEYSPAN_REMOTE is not set
 # CONFIG_USB_APPLETOUCH is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
 
 #
 # USB Imaging devices
@@ -963,16 +977,17 @@ CONFIG_USB_MON=y
 #
 # CONFIG_USB_EMI62 is not set
 # CONFIG_USB_EMI26 is not set
+# CONFIG_USB_ADUTUX is not set
 # CONFIG_USB_AUERSWALD is not set
 # CONFIG_USB_RIO500 is not set
 # CONFIG_USB_LEGOTOWER is not set
 # CONFIG_USB_LCD is not set
 # CONFIG_USB_LED is not set
-# CONFIG_USB_CY7C63 is not set
+# CONFIG_USB_CYPRESS_CY7C63 is not set
 # CONFIG_USB_CYTHERM is not set
-# CONFIG_USB_PHIDGETKIT is not set
-# CONFIG_USB_PHIDGETSERVO is not set
+# CONFIG_USB_PHIDGET is not set
 # CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_FTDI_ELAN is not set
 # CONFIG_USB_APPLEDISPLAY is not set
 # CONFIG_USB_SISUSBVGA is not set
 # CONFIG_USB_LD is not set
@@ -1041,6 +1056,7 @@ CONFIG_EXT3_FS=y
 CONFIG_EXT3_FS_XATTR=y
 # CONFIG_EXT3_FS_POSIX_ACL is not set
 # CONFIG_EXT3_FS_SECURITY is not set
+# CONFIG_EXT4DEV_FS is not set
 CONFIG_JBD=y
 # CONFIG_JBD_DEBUG is not set
 CONFIG_FS_MBCACHE=y
@@ -1052,6 +1068,7 @@ CONFIG_XFS_QUOTA=y
 # CONFIG_XFS_SECURITY is not set
 CONFIG_XFS_POSIX_ACL=y
 # CONFIG_XFS_RT is not set
+# CONFIG_GFS2_FS is not set
 # CONFIG_OCFS2_FS is not set
 # CONFIG_MINIX_FS is not set
 CONFIG_ROMFS_FS=m
@@ -1082,8 +1099,10 @@ CONFIG_AUTOFS4_FS=y
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_PROC_SYSCTL=y
 CONFIG_SYSFS=y
 CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
 # CONFIG_HUGETLB_PAGE is not set
 CONFIG_RAMFS=y
 # CONFIG_CONFIGFS_FS is not set
@@ -1123,7 +1142,6 @@ CONFIG_SUNRPC=y
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 # CONFIG_SMB_FS is not set
 # CONFIG_CIFS is not set
-# CONFIG_CIFS_DEBUG2 is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
 # CONFIG_AFS_FS is not set
@@ -1150,11 +1168,13 @@ CONFIG_MSDOS_PARTITION=y
 #
 CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 # CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_MUST_CHECK=y
 # CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_UNUSED_SYMBOLS is not set
 # CONFIG_DEBUG_KERNEL is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
 CONFIG_CROSSCOMPILE=y
 CONFIG_CMDLINE="mem=64M console=ttyVR0,115200 ip=any root=/dev/nfs"
 
@@ -1169,10 +1189,6 @@ CONFIG_CMDLINE="mem=64M console=ttyVR0,115200 ip=any root=/dev/nfs"
 #
 # CONFIG_CRYPTO is not set
 
-#
-# Hardware crypto devices
-#
-
 #
 # Library routines
 #
index 53f4171fc188a9695eb094b6a4ddda7977af349c..7a3ebbeba1f3aa036fd583e7472aa838595b10aa 100644 (file)
@@ -1055,7 +1055,9 @@ asmlinkage long sys32_newuname(struct new_utsname __user * name)
 asmlinkage int sys32_personality(unsigned long personality)
 {
        int ret;
-       if (current->personality == PER_LINUX32 && personality == PER_LINUX)
+       personality &= 0xffffffff;
+       if (personality(current->personality) == PER_LINUX32 &&
+           personality == PER_LINUX)
                personality = PER_LINUX32;
        ret = sys_personality(personality);
        if (ret == PER_LINUX32)
index 9f307eb1a31ec79fa9f8331573df09d00da608c9..ec8209f3a0c68af6c70df1e43403ab23687f62f6 100644 (file)
@@ -358,10 +358,8 @@ static int __init frame_info_init(void)
        unsigned long size = 0;
 #ifdef CONFIG_KALLSYMS
        unsigned long ofs;
-       char *modname;
-       char namebuf[KSYM_NAME_LEN + 1];
 
-       kallsyms_lookup((unsigned long)schedule, &size, &ofs, &modname, namebuf);
+       kallsyms_lookup_size_offset((unsigned long)schedule, &size, &ofs);
 #endif
        schedule_mfi.func = schedule;
        schedule_mfi.func_size = size;
@@ -403,8 +401,6 @@ unsigned long unwind_stack(struct task_struct *task, unsigned long *sp,
 {
        unsigned long stack_page;
        struct mips_frame_info info;
-       char *modname;
-       char namebuf[KSYM_NAME_LEN + 1];
        unsigned long size, ofs;
        int leaf;
        extern void ret_from_irq(void);
@@ -433,7 +429,7 @@ unsigned long unwind_stack(struct task_struct *task, unsigned long *sp,
                }
                return 0;
        }
-       if (!kallsyms_lookup(pc, &size, &ofs, &modname, namebuf))
+       if (!kallsyms_lookup_size_offset(pc, &size, &ofs))
                return 0;
        /*
         * Return ra if an exception occured at the first instruction
index 61362e6fa9eccfbfb79b8abfde01d57b431f6e08..720fac3435d5aa9d49c1e2393fc476c7949c1168 100644 (file)
@@ -652,7 +652,8 @@ einval:     li      v0, -EINVAL
        sys     sys_vmsplice            4
        sys     sys_move_pages          6
        sys     sys_set_robust_list     2
-       sys     sys_get_robust_list     3
+       sys     sys_get_robust_list     3       /* 4310 */
+       sys     sys_ni_syscall          0
        .endm
 
        /* We pre-compute the number of _instruction_ bytes needed to
index 6c7b5ed0ea6e0ccec04ebfff052e0e9fd2fc780e..3a34f62c8b1b3152b9fb3ac68911a47484eb3743 100644 (file)
@@ -468,3 +468,4 @@ sys_call_table:
        PTR     sys_move_pages
        PTR     sys_set_robust_list
        PTR     sys_get_robust_list
+       PTR     sys_ni_syscall                  /* 5270 */
index 6d9f18727ac51e5baf3232f4624f733c8789732b..67b92a1d6c72268aa2ba12120011fd8754db4a71 100644 (file)
@@ -280,7 +280,7 @@ EXPORT(sysn32_call_table)
        PTR     sys_sync
        PTR     sys_acct
        PTR     sys32_settimeofday
-       PTR     sys_mount                       /* 6160 */
+       PTR     compat_sys_mount                /* 6160 */
        PTR     sys_umount
        PTR     sys_swapon
        PTR     sys_swapoff
@@ -394,3 +394,4 @@ EXPORT(sysn32_call_table)
        PTR     sys_move_pages
        PTR     compat_sys_set_robust_list
        PTR     compat_sys_get_robust_list
+       PTR     sys_ni_syscall
index 2e6d0673163e1896cc2ac05d3299755f77f43aac..2875c4a3fa5801f8d5b87f1b895d91003b85f510 100644 (file)
@@ -226,7 +226,7 @@ sys_call_table:
        PTR     sys_ni_syscall                  /* was sys_stat */
        PTR     sys_lseek
        PTR     sys_getpid                      /* 4020 */
-       PTR     sys_mount
+       PTR     compat_sys_mount
        PTR     sys_oldumount
        PTR     sys_setuid
        PTR     sys_getuid
@@ -516,4 +516,5 @@ sys_call_table:
        PTR     compat_sys_move_pages
        PTR     compat_sys_set_robust_list
        PTR     compat_sys_get_robust_list      /* 4310 */
+       PTR     sys_ni_syscall
        .size   sys_call_table,.-sys_call_table
index 4aabe526a68e3e38b9eb4a59670168d695255b15..a586aba337a7afcbd0f93f50c36c59167face762 100644 (file)
@@ -57,7 +57,7 @@ static void save_context_stack(struct stack_trace *trace,
                pc = unwind_stack(task, &sp, pc, &ra);
        } while (pc);
 #else
-       save_raw_context_stack(sp);
+       save_raw_context_stack(trace, sp);
 #endif
 }
 
index 6f8a9fe7c1e3e52d569ff75fd9cdba44ec8d6790..c079e2ae02a1d0484884005f779f6d5e323815e0 100644 (file)
@@ -187,7 +187,7 @@ out:
 }
 
 /*
- * Estimate CPU frequency.  Sets mips_counter_frequency as a side-effect
+ * Estimate CPU frequency.  Sets mips_hpt_frequency as a side-effect
  */
 static unsigned int __init estimate_cpu_frequency(void)
 {
index 6244d0e2c7de371a4d48d95a04fe39f0d5b53e6b..90ad5bf3e2f175c8dd3c5ab055860ae988c3fdb2 100644 (file)
@@ -32,6 +32,7 @@
 #include <asm/i8259.h>
 #include <asm/irq_cpu.h>
 #include <asm/io.h>
+#include <asm/irq_regs.h>
 #include <asm/mips-boards/malta.h>
 #include <asm/mips-boards/maltaint.h>
 #include <asm/mips-boards/piix4.h>
@@ -131,7 +132,7 @@ static void corehi_irqdispatch(void)
        unsigned int intedge, intsteer, pcicmd, pcibadaddr;
         unsigned int pcimstat, intisr, inten, intpol;
        unsigned int intrcause,datalo,datahi;
-       struct pt_regs *regs;
+       struct pt_regs *regs = get_irq_regs();
 
         printk("CoreHI interrupt, shouldn't happen, so we die here!!!\n");
         printk("epc   : %08lx\nStatus: %08lx\n"
index c566b9bd0427e64deb4182e188280edc87f8eae6..24a4ed00cc0a0f39786a5e6749dadff0aee6296d 100644 (file)
@@ -102,7 +102,7 @@ irqreturn_t sim_timer_interrupt(int irq, void *dev_id)
 
 
 /*
- * Estimate CPU frequency.  Sets mips_counter_frequency as a side-effect
+ * Estimate CPU frequency.  Sets mips_hpt_frequency as a side-effect
  */
 static unsigned int __init estimate_cpu_frequency(void)
 {
index 88b72c9a84957f2ac787ccf83fa46c4dbb0818d2..2de4d3c367a2c2da9adb6bcf29b5105c46c01f78 100644 (file)
 #include <asm/cachectl.h>
 #include <asm/cpu.h>
 #include <asm/dma.h>
+#include <asm/kmap_types.h>
 #include <asm/mmu_context.h>
 #include <asm/sections.h>
 #include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/tlb.h>
+#include <asm/fixmap.h>
+
+/* Atomicity and interruptability */
+#ifdef CONFIG_MIPS_MT_SMTC
+
+#include <asm/mipsmtregs.h>
+
+#define ENTER_CRITICAL(flags) \
+       { \
+       unsigned int mvpflags; \
+       local_irq_save(flags);\
+       mvpflags = dvpe()
+#define EXIT_CRITICAL(flags) \
+       evpe(mvpflags); \
+       local_irq_restore(flags); \
+       }
+#else
+
+#define ENTER_CRITICAL(flags) local_irq_save(flags)
+#define EXIT_CRITICAL(flags) local_irq_restore(flags)
+
+#endif /* CONFIG_MIPS_MT_SMTC */
 
 DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
 
@@ -80,13 +103,142 @@ unsigned long setup_zero_pages(void)
        return 1UL << order;
 }
 
-#ifdef CONFIG_HIGHMEM
-pte_t *kmap_pte;
-pgprot_t kmap_prot;
+/*
+ * These are almost like kmap_atomic / kunmap_atmic except they take an
+ * additional address argument as the hint.
+ */
 
 #define kmap_get_fixmap_pte(vaddr)                                     \
        pte_offset_kernel(pmd_offset(pud_offset(pgd_offset_k(vaddr), (vaddr)), (vaddr)), (vaddr))
 
+#ifdef CONFIG_MIPS_MT_SMTC
+static pte_t *kmap_coherent_pte;
+static void __init kmap_coherent_init(void)
+{
+       unsigned long vaddr;
+
+       /* cache the first coherent kmap pte */
+       vaddr = __fix_to_virt(FIX_CMAP_BEGIN);
+       kmap_coherent_pte = kmap_get_fixmap_pte(vaddr);
+}
+#else
+static inline void kmap_coherent_init(void) {}
+#endif
+
+static inline void *kmap_coherent(struct page *page, unsigned long addr)
+{
+       enum fixed_addresses idx;
+       unsigned long vaddr, flags, entrylo;
+       unsigned long old_ctx;
+       pte_t pte;
+       int tlbidx;
+
+       inc_preempt_count();
+       idx = (addr >> PAGE_SHIFT) & (FIX_N_COLOURS - 1);
+#ifdef CONFIG_MIPS_MT_SMTC
+       idx += FIX_N_COLOURS * smp_processor_id();
+#endif
+       vaddr = __fix_to_virt(FIX_CMAP_END - idx);
+       pte = mk_pte(page, PAGE_KERNEL);
+#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1)
+       entrylo = pte.pte_high;
+#else
+       entrylo = pte_val(pte) >> 6;
+#endif
+
+       ENTER_CRITICAL(flags);
+       old_ctx = read_c0_entryhi();
+       write_c0_entryhi(vaddr & (PAGE_MASK << 1));
+       write_c0_entrylo0(entrylo);
+       write_c0_entrylo1(entrylo);
+#ifdef CONFIG_MIPS_MT_SMTC
+       set_pte(kmap_coherent_pte - (FIX_CMAP_END - idx), pte);
+       /* preload TLB instead of local_flush_tlb_one() */
+       mtc0_tlbw_hazard();
+       tlb_probe();
+       tlb_probe_hazard();
+       tlbidx = read_c0_index();
+       mtc0_tlbw_hazard();
+       if (tlbidx < 0)
+               tlb_write_random();
+       else
+               tlb_write_indexed();
+#else
+       tlbidx = read_c0_wired();
+       write_c0_wired(tlbidx + 1);
+       write_c0_index(tlbidx);
+       mtc0_tlbw_hazard();
+       tlb_write_indexed();
+#endif
+       tlbw_use_hazard();
+       write_c0_entryhi(old_ctx);
+       EXIT_CRITICAL(flags);
+
+       return (void*) vaddr;
+}
+
+#define UNIQUE_ENTRYHI(idx) (CKSEG0 + ((idx) << (PAGE_SHIFT + 1)))
+
+static inline void kunmap_coherent(struct page *page)
+{
+#ifndef CONFIG_MIPS_MT_SMTC
+       unsigned int wired;
+       unsigned long flags, old_ctx;
+
+       ENTER_CRITICAL(flags);
+       old_ctx = read_c0_entryhi();
+       wired = read_c0_wired() - 1;
+       write_c0_wired(wired);
+       write_c0_index(wired);
+       write_c0_entryhi(UNIQUE_ENTRYHI(wired));
+       write_c0_entrylo0(0);
+       write_c0_entrylo1(0);
+       mtc0_tlbw_hazard();
+       tlb_write_indexed();
+       tlbw_use_hazard();
+       write_c0_entryhi(old_ctx);
+       EXIT_CRITICAL(flags);
+#endif
+       dec_preempt_count();
+       preempt_check_resched();
+}
+
+void copy_to_user_page(struct vm_area_struct *vma,
+       struct page *page, unsigned long vaddr, void *dst, const void *src,
+       unsigned long len)
+{
+       if (cpu_has_dc_aliases) {
+               void *vto = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK);
+               memcpy(vto, src, len);
+               kunmap_coherent(page);
+       } else
+               memcpy(dst, src, len);
+       if ((vma->vm_flags & VM_EXEC) && !cpu_has_ic_fills_f_dc)
+               flush_cache_page(vma, vaddr, page_to_pfn(page));
+}
+
+EXPORT_SYMBOL(copy_to_user_page);
+
+void copy_from_user_page(struct vm_area_struct *vma,
+       struct page *page, unsigned long vaddr, void *dst, const void *src,
+       unsigned long len)
+{
+       if (cpu_has_dc_aliases) {
+               void *vfrom =
+                       kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK);
+               memcpy(dst, vfrom, len);
+               kunmap_coherent(page);
+       } else
+               memcpy(dst, src, len);
+}
+
+EXPORT_SYMBOL(copy_from_user_page);
+
+
+#ifdef CONFIG_HIGHMEM
+pte_t *kmap_pte;
+pgprot_t kmap_prot;
+
 static void __init kmap_init(void)
 {
        unsigned long kmap_vstart;
@@ -97,11 +249,12 @@ static void __init kmap_init(void)
 
        kmap_prot = PAGE_KERNEL;
 }
+#endif /* CONFIG_HIGHMEM */
 
-#ifdef CONFIG_32BIT
 void __init fixrange_init(unsigned long start, unsigned long end,
        pgd_t *pgd_base)
 {
+#if defined(CONFIG_HIGHMEM) || defined(CONFIG_MIPS_MT_SMTC)
        pgd_t *pgd;
        pud_t *pud;
        pmd_t *pmd;
@@ -122,7 +275,7 @@ void __init fixrange_init(unsigned long start, unsigned long end,
                        for (; (k < PTRS_PER_PMD) && (vaddr != end); pmd++, k++) {
                                if (pmd_none(*pmd)) {
                                        pte = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE);
-                                       set_pmd(pmd, __pmd(pte));
+                                       set_pmd(pmd, __pmd((unsigned long)pte));
                                        if (pte != pte_offset_kernel(pmd, 0))
                                                BUG();
                                }
@@ -132,9 +285,8 @@ void __init fixrange_init(unsigned long start, unsigned long end,
                }
                j = 0;
        }
+#endif
 }
-#endif /* CONFIG_32BIT */
-#endif /* CONFIG_HIGHMEM */
 
 #ifndef CONFIG_NEED_MULTIPLE_NODES
 extern void pagetable_init(void);
@@ -175,6 +327,7 @@ void __init paging_init(void)
 #ifdef CONFIG_HIGHMEM
        kmap_init();
 #endif
+       kmap_coherent_init();
 
        max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
        low = max_low_pfn;
index 3101d1db55921b3c195351be551a39623c34d19b..cea7d0ea36e44c42b30d1a4b36bf7c461f7b4b66 100644 (file)
@@ -176,7 +176,7 @@ void __iomem * __ioremap(phys_t phys_addr, phys_t size, unsigned long flags)
 
 #define IS_KSEG1(addr) (((unsigned long)(addr) & ~0x1fffffffUL) == CKSEG1)
 
-void __iounmap(volatile void __iomem *addr)
+void __iounmap(const volatile void __iomem *addr)
 {
        struct vm_struct *p;
 
index 4bdaa05f485b446e0d66587015cbd8378abf4a69..4a61e624b0ecfcd921a560d426e92e1df2df1de2 100644 (file)
@@ -31,9 +31,10 @@ void pgd_init(unsigned long page)
 
 void __init pagetable_init(void)
 {
-#ifdef CONFIG_HIGHMEM
        unsigned long vaddr;
-       pgd_t *pgd, *pgd_base;
+       pgd_t *pgd_base;
+#ifdef CONFIG_HIGHMEM
+       pgd_t *pgd;
        pud_t *pud;
        pmd_t *pmd;
        pte_t *pte;
@@ -44,7 +45,6 @@ void __init pagetable_init(void)
        pgd_init((unsigned long)swapper_pg_dir
                 + sizeof(pgd_t) * USER_PTRS_PER_PGD);
 
-#ifdef CONFIG_HIGHMEM
        pgd_base = swapper_pg_dir;
 
        /*
@@ -53,6 +53,7 @@ void __init pagetable_init(void)
        vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK;
        fixrange_init(vaddr, 0, pgd_base);
 
+#ifdef CONFIG_HIGHMEM
        /*
         * Permanent kmaps:
         */
index 44b5e97fff65f75286fdd15f33c2bcf40841082a..8d600d307d5ddb3f617ffc34929ea98d4613b4a7 100644 (file)
@@ -8,6 +8,7 @@
  */
 #include <linux/init.h>
 #include <linux/mm.h>
+#include <asm/fixmap.h>
 #include <asm/pgtable.h>
 
 void pgd_init(unsigned long page)
@@ -52,7 +53,17 @@ void pmd_init(unsigned long addr, unsigned long pagetable)
 
 void __init pagetable_init(void)
 {
+       unsigned long vaddr;
+       pgd_t *pgd_base;
+
        /* Initialize the entire pgd.  */
        pgd_init((unsigned long)swapper_pg_dir);
        pmd_init((unsigned long)invalid_pmd_table, (unsigned long)invalid_pte_table);
+
+       pgd_base = swapper_pg_dir;
+       /*
+        * Fixed mappings:
+        */
+       vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK;
+       fixrange_init(vaddr, 0, pgd_base);
 }
index 354e5449640682135fa2ebac3d04c88f6e1340ff..fa6b4aae75233f764d1979f7b1f0e5fd9944545e 100644 (file)
@@ -10,8 +10,6 @@
 #ifndef OP_IMPL_H
 #define OP_IMPL_H 1
 
-struct pt_regs;
-
 extern int null_perf_irq(void);
 extern int (*perf_irq)(void);
 
index b7063fefa65b46d80c658697fbe629f9e95bd4f4..7dc9bf6f132183ede615e84742bff4c41fe84fe0 100644 (file)
@@ -80,8 +80,7 @@ static void rm9000_cpu_stop(void *args)
        write_c0_perfcontrol(0);
 }
 
-static irqreturn_t rm9000_perfcount_handler(int irq, void * dev_id,
-       struct pt_regs *regs)
+static irqreturn_t rm9000_perfcount_handler(int irq, void * dev_id)
 {
        unsigned int control = read_c0_perfcontrol();
        uint32_t counter1, counter2;
index fd0932b2d5218ef58a08a79056c5f2af68c23d61..db8084411538bc3bcdfa6ef047eca8f1d835c2ed 100644 (file)
@@ -135,7 +135,7 @@ static inline void ip32_power_button(void)
        add_timer(&power_timer);
 }
 
-static irqreturn_t ip32_rtc_int(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t ip32_rtc_int(int irq, void *dev_id)
 {
        volatile unsigned char reg_c;
 
index 992e0d8dbb67599cd10a66c95008c07759632cbb..d1a906e683b2aa2c63ffe89d884b0056f4abcd47 100644 (file)
@@ -88,7 +88,7 @@ static void arm_tb(void)
        sbp.tb_armed = 1;
 }
 
-static irqreturn_t sbprof_tb_intr(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t sbprof_tb_intr(int irq, void *dev_id)
 {
        int i;
        DBG(printk(DEVNAME ": tb_intr\n"));
@@ -138,7 +138,7 @@ static irqreturn_t sbprof_tb_intr(int irq, void *dev_id, struct pt_regs *regs)
        return IRQ_HANDLED;
 }
 
-static irqreturn_t sbprof_pc_intr(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t sbprof_pc_intr(int irq, void *dev_id)
 {
        printk(DEVNAME ": unexpected pc_intr");
        return IRQ_NONE;
index bb90649fbc485b79ea3a04c17f6dc9a72d9f985e..45274bd3cd8b8958643cfd7fb1750db0620ad55a 100644 (file)
@@ -171,7 +171,7 @@ static void create_proc_decoder(struct bw_stats_struct *stats)
  * notes: possible re-entry due to multiple sources
  *        should check/indicate saturation
  */
-static irqreturn_t sibyte_bw_int(int irq, void *data, struct pt_regs *regs)
+static irqreturn_t sibyte_bw_int(int irq, void *data)
 {
        struct bw_stats_struct *stats = data;
        unsigned long cntr;
index 8b6910465578b02cf8d00b9c9326f302d7ef5b5e..2bd9b7fb0f6c91cc7e35bdedf3bafed7f897e7a3 100644 (file)
@@ -751,6 +751,15 @@ config ARCH_MEMORY_PROBE
        def_bool y
        depends on MEMORY_HOTPLUG
 
+# Some NUMA nodes have memory ranges that span
+# other nodes.  Even though a pfn is valid and
+# between a node's start and end pfns, it may not
+# reside on that node.  See memmap_init_zone()
+# for details.
+config NODES_SPAN_OTHER_NODES
+       def_bool y
+       depends on NEED_MULTIPLE_NODES
+
 config PPC_64K_PAGES
        bool "64k page size"
        depends on PPC64
index cd3535e1a09558d323b351fd52b87c7c2831c692..0561b73a918f5c3545f7850e40f1fed7dbea2795 100644 (file)
@@ -1248,7 +1248,7 @@ CONFIG_PARTITION_ADVANCED=y
 # CONFIG_AMIGA_PARTITION is not set
 # CONFIG_ATARI_PARTITION is not set
 # CONFIG_MAC_PARTITION is not set
-# CONFIG_MSDOS_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
 # CONFIG_LDM_PARTITION is not set
 # CONFIG_SGI_PARTITION is not set
 # CONFIG_ULTRIX_PARTITION is not set
index 9828663652e9eb8eaa79d6983b7ad233550e6bb0..d2833c1a1f3d784f7b0b37302fb9728a64516dea 100644 (file)
@@ -184,6 +184,7 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
 CONFIG_MIGRATION=y
 CONFIG_RESOURCES_64BIT=y
 CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y
+CONFIG_NODES_SPAN_OTHER_NODES=y
 # CONFIG_PPC_64K_PAGES is not set
 CONFIG_SCHED_SMT=y
 CONFIG_PROC_DEVICETREE=y
index 47a613cdd775ce11535dbc214886bb446f9437f3..95382f99440475b097420a322031b5293858492a 100644 (file)
@@ -268,7 +268,7 @@ struct cpu_spec     cpu_specs[] = {
                .cpu_user_features      = COMMON_USER_POWER6,
                .icache_bsize           = 128,
                .dcache_bsize           = 128,
-               .num_pmcs               = 8,
+               .num_pmcs               = 6,
                .oprofile_cpu_type      = "ppc64/power6",
                .oprofile_type          = PPC_OPROFILE_POWER4,
                .oprofile_mmcra_sihv    = POWER6_MMCRA_SIHV,
index 9b49f8691d29d8a28451e8b4d6d6e858c7cb693f..0d9ff72e28526a7d2f2990388354a5fd37be13ef 100644 (file)
@@ -441,14 +441,14 @@ update_bridge_base(struct pci_bus *bus, int i)
                end = res->end - off;
                io_base_lo = (start >> 8) & PCI_IO_RANGE_MASK;
                io_limit_lo = (end >> 8) & PCI_IO_RANGE_MASK;
-               if (end > 0xffff) {
-                       pci_write_config_word(dev, PCI_IO_BASE_UPPER16,
-                                             start >> 16);
-                       pci_write_config_word(dev, PCI_IO_LIMIT_UPPER16,
-                                             end >> 16);
+               if (end > 0xffff)
                        io_base_lo |= PCI_IO_RANGE_TYPE_32;
-               else
+               else
                        io_base_lo |= PCI_IO_RANGE_TYPE_16;
+               pci_write_config_word(dev, PCI_IO_BASE_UPPER16,
+                               start >> 16);
+               pci_write_config_word(dev, PCI_IO_LIMIT_UPPER16,
+                               end >> 16);
                pci_write_config_byte(dev, PCI_IO_BASE, io_base_lo);
                pci_write_config_byte(dev, PCI_IO_LIMIT, io_limit_lo);
 
index 78d3c0fc8dfbfd1254f77fa44d680c4cdcc27b56..9bae8a5bf671344a6c5dce261272a6159a64a181 100644 (file)
@@ -199,8 +199,14 @@ struct pci_controller * pcibios_alloc_controller(struct device_node *dev)
        pci_setup_pci_controller(phb);
        phb->arch_data = dev;
        phb->is_dynamic = mem_init_done;
-       if (dev)
-               PHB_SET_NODE(phb, of_node_to_nid(dev));
+       if (dev) {
+               int nid = of_node_to_nid(dev);
+
+               if (nid < 0 || !node_online(nid))
+                       nid = -1;
+
+               PHB_SET_NODE(phb, nid);
+       }
        return phb;
 }
 
index 7b2f6452ba7252caa11c377553392446d44c02e0..f3d4dd580dd69fe20a04dd4762866ad0f82d51ea 100644 (file)
@@ -341,13 +341,6 @@ struct task_struct *__switch_to(struct task_struct *prev,
 
 static int instructions_to_print = 16;
 
-#ifdef CONFIG_PPC64
-#define BAD_PC(pc)     ((REGION_ID(pc) != KERNEL_REGION_ID) && \
-                        (REGION_ID(pc) != VMALLOC_REGION_ID))
-#else
-#define BAD_PC(pc)     ((pc) < KERNELBASE)
-#endif
-
 static void show_instructions(struct pt_regs *regs)
 {
        int i;
@@ -366,7 +359,8 @@ static void show_instructions(struct pt_regs *regs)
                 * bad address because the pc *should* only be a
                 * kernel address.
                 */
-               if (BAD_PC(pc) || __get_user(instr, (unsigned int __user *)pc)) {
+               if (!__kernel_text_address(pc) ||
+                    __get_user(instr, (unsigned int __user *)pc)) {
                        printk("XXXXXXXX ");
                } else {
                        if (regs->nip == pc)
index d9f10f2fc372b2ebde2bb24dbbb82267383295d7..5ed4c2ceb5caa8632c11f229193afe0596893650 100644 (file)
@@ -900,14 +900,13 @@ void kernel_fp_unavailable_exception(struct pt_regs *regs)
 
 void altivec_unavailable_exception(struct pt_regs *regs)
 {
-#if !defined(CONFIG_ALTIVEC)
        if (user_mode(regs)) {
                /* A user program has executed an altivec instruction,
                   but this kernel doesn't support altivec. */
                _exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
                return;
        }
-#endif
+
        printk(KERN_EMERG "Unrecoverable VMX/Altivec Unavailable Exception "
                        "%lx at %lx\n", regs->trap, regs->nip);
        die("Unrecoverable VMX/Altivec Unavailable Exception", regs, SIGABRT);
index 0975e94ac7c469bc416b0f9fab57de41e4ff0a52..7edb6b461382b407203b5c1929ae0fd7e4ba2487 100644 (file)
@@ -32,6 +32,13 @@ config MPC834x_ITX
          Be aware that PCI initialization is the bootloader's
          responsiblilty.
 
+config MPC8360E_PB
+       bool "Freescale MPC8360E PB"
+       select DEFAULT_UIMAGE
+       select QUICC_ENGINE
+       help
+         This option enables support for the MPC836x EMDS Processor Board.
+
 endchoice
 
 config PPC_MPC832x
@@ -46,4 +53,10 @@ config MPC834x
        select PPC_INDIRECT_PCI
        default y if MPC834x_SYS || MPC834x_ITX
 
+config PPC_MPC836x
+       bool
+       select PPC_UDBG_16550
+       select PPC_INDIRECT_PCI
+       default y if MPC8360E_PB
+
 endmenu
index 9387a110d28aa4f410b9f226648c9277e0ca9b07..f1aa7e24a9382de1f18153dca7ce5a4da2c305fe 100644 (file)
@@ -5,3 +5,5 @@ obj-y                           := misc.o
 obj-$(CONFIG_PCI)              += pci.o
 obj-$(CONFIG_MPC834x_SYS)      += mpc834x_sys.o
 obj-$(CONFIG_MPC834x_ITX)      += mpc834x_itx.o
+obj-$(CONFIG_MPC8360E_PB)      += mpc8360e_pb.o
+obj-$(CONFIG_MPC832x_MDS)      += mpc832x_mds.o
index c0191900fc251b974cac3a2b7735768d915a8caa..1a523c81c06e528de4ac67bfe05d384ff054d6f5 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/root_dev.h>
 #include <linux/initrd.h>
 
+#include <asm/of_device.h>
 #include <asm/system.h>
 #include <asm/atomic.h>
 #include <asm/time.h>
@@ -141,6 +142,24 @@ static void __init mpc8360_sys_setup_arch(void)
 #endif
 }
 
+static int __init mpc8360_declare_of_platform_devices(void)
+{
+       struct device_node *np;
+
+       for (np = NULL; (np = of_find_compatible_node(np, "network",
+                                       "ucc_geth")) != NULL;) {
+               int ucc_num;
+               char bus_id[BUS_ID_SIZE];
+
+               ucc_num = *((uint *) get_property(np, "device-id", NULL)) - 1;
+               snprintf(bus_id, BUS_ID_SIZE, "ucc_geth.%u", ucc_num);
+               of_platform_device_create(np, bus_id, NULL);
+       }
+
+       return 0;
+}
+device_initcall(mpc8360_declare_of_platform_devices);
+
 void __init mpc8360_sys_init_IRQ(void)
 {
 
index ccfd0c4db87441398bbd9519f5780dcfc3354d76..d0fb959e3ef113b117d4972c373067baab96aa29 100644 (file)
@@ -781,6 +781,17 @@ static int __init create_spu(struct device_node *spe)
        if (!spu)
                goto out;
 
+       spu->node = find_spu_node_id(spe);
+       if (spu->node >= MAX_NUMNODES) {
+               printk(KERN_WARNING "SPE %s on node %d ignored,"
+                      " node number too big\n", spe->full_name, spu->node);
+               printk(KERN_WARNING "Check if CONFIG_NUMA is enabled.\n");
+               return -ENODEV;
+       }
+       spu->nid = of_node_to_nid(spe);
+       if (spu->nid == -1)
+               spu->nid = 0;
+
        ret = spu_map_device(spu, spe);
        /* try old method */
        if (ret)
@@ -788,10 +799,6 @@ static int __init create_spu(struct device_node *spe)
        if (ret)
                goto out_free;
 
-       spu->node = find_spu_node_id(spe);
-       spu->nid = of_node_to_nid(spe);
-       if (spu->nid == -1)
-               spu->nid = 0;
        ret = spu_map_interrupts(spu, spe);
        if (ret)
                ret = spu_map_interrupts_old(spu, spe);
index e0d730045260aeb00e399024485af2197fb39bd2..0de8e114e6b68355b26c2f2ef4de546367792dbc 100644 (file)
@@ -246,6 +246,7 @@ static int spufs_cntl_open(struct inode *inode, struct file *file)
 
 static struct file_operations spufs_cntl_fops = {
        .open = spufs_cntl_open,
+       .release = simple_attr_close,
        .read = simple_attr_read,
        .write = simple_attr_write,
        .mmap = spufs_cntl_mmap,
index d4b2cf74da6aa177ecb6d598f29571b53e89817c..18ee851e33e387675ae6d9e7ab5fb18091732247 100644 (file)
@@ -62,6 +62,7 @@
 #include <asm/cache.h>
 #include <asm/8xx_immap.h>
 #include <asm/machdep.h>
+#include <asm/irq_regs.h>
 
 #include <asm/time.h>
 
@@ -129,6 +130,7 @@ void wakeup_decrementer(void)
  */
 void timer_interrupt(struct pt_regs * regs)
 {
+       struct pt_regs *old_regs;
        int next_dec;
        unsigned long cpu = smp_processor_id();
        unsigned jiffy_stamp = last_jiffy_stamp(cpu);
@@ -137,6 +139,7 @@ void timer_interrupt(struct pt_regs * regs)
        if (atomic_read(&ppc_n_lost_interrupts) != 0)
                do_IRQ(regs);
 
+       old_regs = set_irq_regs(regs);
        irq_enter();
 
        while ((next_dec = tb_ticks_per_jiffy - tb_delta(&jiffy_stamp)) <= 0) {
@@ -188,6 +191,7 @@ void timer_interrupt(struct pt_regs * regs)
                ppc_md.heartbeat();
 
        irq_exit();
+       set_irq_regs(old_regs);
 }
 
 /*
index d7b3a6afa78f86dc4209f562f9ebdedb75da34b5..1f9ea36837b1aff30544607bbdd69bf4bdb1769a 100644 (file)
@@ -196,7 +196,7 @@ static void __init mpc8272ads_fixup_enet_pdata(struct platform_device *pdev,
        bd_t* bi = (void*)__res;
        int fs_no = fsid_fcc1+pdev->id-1;
 
-       if(fs_no > ARRAY_SIZE(mpc82xx_enet_pdata)) {
+       if(fs_no >= ARRAY_SIZE(mpc82xx_enet_pdata)) {
                return;
        }
 
@@ -222,7 +222,7 @@ static void mpc8272ads_fixup_uart_pdata(struct platform_device *pdev,
        int id = fs_uart_id_scc2fsid(idx);
 
        /* no need to alter anything if console */
-       if ((id <= num) && (!pdev->dev.platform_data)) {
+       if ((id < num) && (!pdev->dev.platform_data)) {
                pinfo = &mpc8272_uart_pdata[id];
                pinfo->uart_clk = bd->bi_intfreq;
                pdev->dev.platform_data = pinfo;
index 5f130dca377009cbe3d13d8294f9ce9ee62b025b..e95d2c1117476d35d09dcb0f699192b697353727 100644 (file)
@@ -259,7 +259,7 @@ static void mpc866ads_fixup_enet_pdata(struct platform_device *pdev, int fs_no)
        /* Get pointer to Communication Processor */
        cp = cpmp;
 
-       if(fs_no > ARRAY_SIZE(mpc8xx_enet_pdata)) {
+       if(fs_no >= ARRAY_SIZE(mpc8xx_enet_pdata)) {
                printk(KERN_ERR"No network-suitable #%d device on bus", fs_no);
                return;
        }
@@ -305,7 +305,7 @@ static void __init mpc866ads_fixup_uart_pdata(struct platform_device *pdev,
        int id = fs_uart_id_smc2fsid(idx);
 
        /* no need to alter anything if console */
-       if ((id <= num) && (!pdev->dev.platform_data)) {
+       if ((id < num) && (!pdev->dev.platform_data)) {
                pinfo = &mpc866_uart_pdata[id];
                pinfo->uart_clk = bd->bi_intfreq;
                pdev->dev.platform_data = pinfo;
index 02293141efb5871c26f788f3a57a04cb6240cf46..f8161f3557f5df414b79ff046b7d927f99fd03a8 100644 (file)
@@ -263,7 +263,7 @@ static void mpc885ads_fixup_enet_pdata(struct platform_device *pdev, int fs_no)
        char *e;
        int i;
 
-       if(fs_no > ARRAY_SIZE(mpc8xx_enet_pdata)) {
+       if(fs_no >= ARRAY_SIZE(mpc8xx_enet_pdata)) {
                printk(KERN_ERR"No network-suitable #%d device on bus", fs_no);
                return;
        }
@@ -371,7 +371,7 @@ static void __init mpc885ads_fixup_uart_pdata(struct platform_device *pdev,
        int id = fs_uart_id_smc2fsid(idx);
 
        /* no need to alter anything if console */
-       if ((id <= num) && (!pdev->dev.platform_data)) {
+       if ((id < num) && (!pdev->dev.platform_data)) {
                pinfo = &mpc885_uart_pdata[id];
                pinfo->uart_clk = bd->bi_intfreq;
                pdev->dev.platform_data = pinfo;
index a3257398ea8dd119fbb0e8d2bed6e72a49a93849..c313e9a9304f57a035807351eb5d09811e490e33 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.18
-# Wed Oct  4 19:45:46 2006
+# Linux kernel version: 2.6.19-rc2
+# Wed Oct 18 17:11:10 2006
 #
 CONFIG_MMU=y
 CONFIG_LOCKDEP_SUPPORT=y
@@ -211,6 +211,7 @@ CONFIG_INET6_XFRM_MODE_TRANSPORT=y
 CONFIG_INET6_XFRM_MODE_TUNNEL=y
 CONFIG_INET6_XFRM_MODE_BEET=y
 # CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
+CONFIG_IPV6_SIT=y
 # CONFIG_IPV6_TUNNEL is not set
 # CONFIG_IPV6_SUBTREES is not set
 # CONFIG_IPV6_MULTIPLE_TABLES is not set
@@ -528,6 +529,7 @@ CONFIG_EXT3_FS=y
 CONFIG_EXT3_FS_XATTR=y
 # CONFIG_EXT3_FS_POSIX_ACL is not set
 # CONFIG_EXT3_FS_SECURITY is not set
+# CONFIG_EXT4DEV_FS is not set
 CONFIG_JBD=y
 # CONFIG_JBD_DEBUG is not set
 CONFIG_FS_MBCACHE=y
@@ -645,10 +647,6 @@ CONFIG_MSDOS_PARTITION=y
 #
 # CONFIG_NLS is not set
 
-#
-# Distributed Lock Manager
-#
-
 #
 # Instrumentation Support
 #
@@ -669,7 +667,6 @@ CONFIG_MAGIC_SYSRQ=y
 # CONFIG_UNUSED_SYMBOLS is not set
 CONFIG_DEBUG_KERNEL=y
 CONFIG_LOG_BUF_SHIFT=17
-# CONFIG_DETECT_SOFTLOCKUP is not set
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_DEBUG_SLAB is not set
 CONFIG_DEBUG_PREEMPT=y
@@ -690,6 +687,7 @@ CONFIG_DEBUG_FS=y
 # CONFIG_FRAME_POINTER is not set
 # CONFIG_UNWIND_INFO is not set
 CONFIG_FORCED_INLINING=y
+CONFIG_HEADERS_CHECK=y
 # CONFIG_RCU_TORTURE_TEST is not set
 # CONFIG_LKDTM is not set
 
index e15e1489aef56b5c89b54f52822234ba84a64935..2001767e1dc7aa2fa40020f1874f84d3b7055173 100644 (file)
@@ -295,6 +295,7 @@ static inline long put_tv32(struct compat_timeval __user *o, struct timeval *i)
  *
  * This is really horribly ugly.
  */
+#ifdef CONFIG_SYSVIPC
 asmlinkage long sys32_ipc(u32 call, int first, int second, int third, u32 ptr)
 {
        if (call >> 16)         /* hack for backward compatibility */
@@ -338,6 +339,7 @@ asmlinkage long sys32_ipc(u32 call, int first, int second, int third, u32 ptr)
 
        return -ENOSYS;
 }
+#endif
 
 asmlinkage long sys32_truncate64(const char __user * path, unsigned long high, unsigned long low)
 {
index e59baec565208e6dad4761365943c87bc5392a56..a4ceae3dbcf1b5fe8ed8ae27b931a56d8791b346 100644 (file)
@@ -320,3 +320,4 @@ SYSCALL(sys_tee,sys_tee,sys_tee_wrapper)
 SYSCALL(sys_vmsplice,sys_vmsplice,compat_sys_vmsplice_wrapper)
 NI_SYSCALL                                                     /* 310 sys_move_pages */
 SYSCALL(sys_getcpu,sys_getcpu,sys_getcpu_wrapper)
+SYSCALL(sys_epoll_pwait,sys_epoll_pwait,sys_ni_syscall)
index 219179114f0fe6fda9faf5b610c7e2a17781a5cf..d146cdaa0b8b03897b5f09e68aec42f2acd4abd4 100644 (file)
@@ -14,7 +14,7 @@
 #include <asm/io.h>
 #include <asm/apm.h>
 #include <asm/adc.h>
-#include <asm/hp6xx/hp6xx.h>
+#include <asm/hp6xx.h>
 
 #define SH7709_PGDR                    0xa400012c
 
index 83d3272120645d149c16965e46d0f90b2f5c1183..d1947732fb3e5013e0b8d00f6f8ce42bf31e090a 100644 (file)
@@ -12,7 +12,7 @@
 #include <linux/time.h>
 #include <asm/io.h>
 #include <asm/hd64461.h>
-#include <asm/hp6xx/hp6xx.h>
+#include <asm/hp6xx.h>
 #include <asm/cpu/dac.h>
 #include <asm/pm.h>
 
index 2d3a5b4faf585b5dedcc201234cbf2efdfc3481d..b5a96649ed2692fc9a8b591171376809b7c61193 100644 (file)
@@ -13,7 +13,7 @@
 #include <asm/hd64461.h>
 #include <asm/io.h>
 #include <asm/irq.h>
-#include <asm/hp6xx/hp6xx.h>
+#include <asm/hp6xx.h>
 #include <asm/cpu/dac.h>
 
 #define        SCPCR   0xa4000116
index 51f3f6574210c712fb98adbc1d7165977c8366d8..bb9aa0d62852379d05aefa16a327650c2721d815 100644 (file)
@@ -15,7 +15,7 @@
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <asm/io.h>
-#include <asm/hs7751rvoip/hs7751rvoip.h>
+#include <asm/hs7751rvoip.h>
 #include <asm/addrspace.h>
 
 extern void *area6_io8_base;   /* Area 6 8bit I/O Base address */
index c617b188258a0e4a27bbb731f4ec99e48c0cdad3..943f93aa6052cc8ddc5a3723c804819b52a84bd7 100644 (file)
@@ -14,7 +14,7 @@
 #include <linux/irq.h>
 #include <asm/io.h>
 #include <asm/irq.h>
-#include <asm/hs7751rvoip/hs7751rvoip.h>
+#include <asm/hs7751rvoip.h>
 
 static int mask_pos[] = {8, 9, 10, 11, 12, 13, 0, 1, 2, 3, 4, 5, 6, 7};
 
index 0414c15c3458da63969f97c7cf3ddb923646bbdb..1d997ffd7931d859053cbd30ed16efddd5524c79 100644 (file)
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <linux/mm.h>
-#include <linux/vmalloc.h>
-#include <linux/hdreg.h>
-#include <linux/ide.h>
 #include <linux/pm.h>
+#include <asm/hs7751rvoip.h>
 #include <asm/io.h>
-#include <asm/hs7751rvoip/hs7751rvoip.h>
 #include <asm/machvec.h>
-#include <asm/rtc.h>
-#include <asm/irq.h>
 
 static void __init hs7751rvoip_init_irq(void)
 {
index db92d6e6ae9936cea200bcc6faee4adcb6fbf071..311ccccba718c48e7665403b6b1b722732c9a339 100644 (file)
@@ -11,7 +11,7 @@
 #include <linux/pci.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
-#include <asm/r7780rp/r7780rp.h>
+#include <asm/r7780rp.h>
 #include <asm/addrspace.h>
 #include <asm/io.h>
 
index b544772cbc72c61ae31aa12c643d586f90d0a2ae..aa15ec5bc69ee42cf26b776f20562520277f1f46 100644 (file)
@@ -10,7 +10,8 @@
  */
 #include <linux/init.h>
 #include <linux/irq.h>
-#include <asm/io.h>
+#include <linux/io.h>
+#include <asm/r7780rp.h>
 
 #ifdef CONFIG_SH_R7780MP
 static int mask_pos[] = {12, 11, 9, 14, 15, 8, 13, 6, 5, 4, 3, 2, 0, 0, 1, 0};
@@ -32,7 +33,7 @@ static void disable_r7780rp_irq(unsigned int irq)
 }
 
 static struct irq_chip r7780rp_irq_chip __read_mostly = {
-       .name           = "r7780rp",
+       .name           = "R7780RP",
        .mask           = disable_r7780rp_irq,
        .unmask         = enable_r7780rp_irq,
        .mask_ack       = disable_r7780rp_irq,
@@ -47,8 +48,8 @@ void __init init_r7780rp_IRQ(void)
 
        for (i = 0; i < 15; i++) {
                disable_irq_nosync(i);
-               set_irq_chip_and_handler(i, &r7780rp_irq_chip,
-                                        handle_level_irq);
+               set_irq_chip_and_handler_name(i, &r7780rp_irq_chip,
+                                             handle_level_irq, "level");
                enable_r7780rp_irq(i);
        }
 }
index b941aa0aa34e60b8397e235ed5260cd87e932516..c331caeb694b681658639d5a8e75a3f765afa36c 100644 (file)
@@ -13,7 +13,7 @@
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <asm/machvec.h>
-#include <asm/r7780rp/r7780rp.h>
+#include <asm/r7780rp.h>
 #include <asm/clock.h>
 #include <asm/io.h>
 
index 135aa0b5e62dcc926d7df4f3c4996c70c1433c96..f2507a804979a35f0b3a2bedb696986c06d1a689 100644 (file)
@@ -11,8 +11,8 @@
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/pci.h>
-#include <asm/rts7751r2d/rts7751r2d.h>
-#include <asm/io.h>
+#include <linux/io.h>
+#include <asm/rts7751r2d.h>
 #include <asm/addrspace.h>
 
 /*
index c915e7a3693a0648b8f52e090cdc4add9b72ac09..cb0eb20d1b4348fbd58a81c54a88bf7be7973399 100644 (file)
@@ -8,12 +8,10 @@
  * Modified for RTS7751R2D by
  * Atom Create Engineering Co., Ltd. 2002.
  */
-
 #include <linux/init.h>
 #include <linux/irq.h>
-#include <asm/io.h>
-#include <asm/irq.h>
-#include <asm/rts7751r2d/rts7751r2d.h>
+#include <linux/io.h>
+#include <asm/rts7751r2d.h>
 
 #if defined(CONFIG_RTS7751R2D_REV11)
 static int mask_pos[] = {11, 9, 8, 12, 10, 6, 5, 4, 7, 14, 13, 0, 0, 0, 0};
index a7ce66c1e4f04ceb5a39d0dbd1c95050bffe879f..509f548bdce037e12eebdb4a5179515ade7dce0b 100644 (file)
@@ -8,13 +8,9 @@
  *
  * This file contains Renesas Technology Sales RTS7751R2D specific LED code.
  */
-
-#include <asm/io.h>
-#include <asm/rts7751r2d/rts7751r2d.h>
-
-#ifdef CONFIG_HEARTBEAT
-
+#include <linux/io.h>
 #include <linux/sched.h>
+#include <asm/rts7751r2d.h>
 
 /* Cycle the LED's in the clasic Knightriger/Sun pattern */
 void heartbeat_rts7751r2d(void)
@@ -46,10 +42,3 @@ void heartbeat_rts7751r2d(void)
        else
                bit--;
 }
-#endif /* CONFIG_HEARTBEAT */
-
-void rts7751r2d_led(unsigned short value)
-{
-       ctrl_outw(value, PA_OUTPORT);
-}
-
index 20597a6e6702c40e76f5cab65a2b396f668b3c08..5c042d35ec91768d5255d2cba2ddf8c48f59fcb8 100644 (file)
@@ -12,9 +12,9 @@
 #include <linux/platform_device.h>
 #include <linux/serial_8250.h>
 #include <linux/pm.h>
-#include <asm/io.h>
 #include <asm/machvec.h>
 #include <asm/mach/rts7751r2d.h>
+#include <asm/io.h>
 #include <asm/voyagergx.h>
 
 extern void heartbeat_rts7751r2d(void);
index 2f0c19706cf9ad3e144b57fada06bbd83ac15eef..a31a1d1e2681f06e16dff61cf2eef069977949ab 100644 (file)
@@ -7,7 +7,7 @@
  */
 #include <linux/init.h>
 #include <asm/machvec.h>
-#include <asm/shmin/shmin.h>
+#include <asm/shmin.h>
 #include <asm/clock.h>
 #include <asm/irq.h>
 #include <asm/io.h>
index bf1b28feca06d7222ca5c5f53e272b753a0d6a3f..f7ea700d05ae53c022493c791f601aa25266f7e5 100644 (file)
 
     Copyright 2003 (c) Lineo uSolutions,Inc.
 */
-/* -------------------------------------------------------------------- */
-
-#undef DEBUG
-
-#include <linux/sched.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/param.h>
-#include <linux/ioport.h>
 #include <linux/interrupt.h>
 #include <linux/init.h>
-#include <linux/irq.h>
-
-#include <asm/io.h>
-#include <asm/irq.h>
+#include <linux/io.h>
 #include <asm/voyagergx.h>
+#include <asm/rts7751r2d.h>
 
 static void disable_voyagergx_irq(unsigned int irq)
 {
        unsigned long val;
        unsigned long mask = 1 << (irq - VOYAGER_IRQ_BASE);
 
-       pr_debug("disable_voyagergx_irq(%d): mask=%x\n", irq, mask);
+       pr_debug("disable_voyagergx_irq(%d): mask=%lx\n", irq, mask);
         val = inl(VOYAGER_INT_MASK);
         val &= ~mask;
         outl(val, VOYAGER_INT_MASK);
@@ -50,7 +39,7 @@ static void enable_voyagergx_irq(unsigned int irq)
         unsigned long val;
         unsigned long mask = 1 << (irq - VOYAGER_IRQ_BASE);
 
-        pr_debug("disable_voyagergx_irq(%d): mask=%x\n", irq, mask);
+        pr_debug("disable_voyagergx_irq(%d): mask=%lx\n", irq, mask);
         val = inl(VOYAGER_INT_MASK);
         val |= mask;
         outl(val, VOYAGER_INT_MASK);
@@ -137,7 +126,7 @@ int voyagergx_irq_demux(int irq)
                } else {
                        printk("Unexpected IRQ irq = %d status = 0x%08lx\n", irq, val);
                }
-               pr_debug("voyagergx_irq_demux %\n", i);
+               pr_debug("voyagergx_irq_demux %ld\n", i);
 #else
                for (bit = 1, i = 0 ; i < VOYAGER_IRQ_NUM ; bit <<= 1, i++)
                        if (val & bit)
@@ -185,4 +174,3 @@ void __init setup_voyagergx_irq(void)
 
        setup_irq(IRQ_VOYAGER, &irq0);
 }
-
index 6e3ba9c65b40534de3d65f3c9a358d52d3476853..eeea1577e112727d6afd32d018ced0681788e65f 100644 (file)
@@ -13,7 +13,7 @@
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <linux/pci.h>
-#include <asm/r7780rp/r7780rp.h>
+#include <asm/r7780rp.h>
 #include <asm/io.h>
 #include "pci-sh4.h"
 
index b68824c8b81e72684946ac2f36628c70bd613a4c..4a518d948049b41ff150a82303b3b69ee58fa691 100644 (file)
  *
  * PCI initialization for the Renesas SH7751R RTS7751R2D board
  */
-
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/init.h>
-#include <linux/delay.h>
 #include <linux/pci.h>
-#include <linux/module.h>
-#include <asm/rts7751r2d/rts7751r2d.h>
-#include <asm/io.h>
+#include <linux/io.h>
+#include <asm/rts7751r2d.h>
 #include "pci-sh4.h"
 
+static u8 rts7751r2d_irq_tab[] __initdata = {
+       IRQ_PCISLOT1,
+       IRQ_PCISLOT2,
+       IRQ_PCMCIA,
+       IRQ_PCIETH,
+};
+
 int __init pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin)
 {
-        switch (slot) {
-       case 0: return IRQ_PCISLOT1;    /* PCI Extend slot #1 */
-       case 1: return IRQ_PCISLOT2;    /* PCI Extend slot #2 */
-       case 2: return IRQ_PCMCIA;      /* PCI Cardbus Bridge */
-       case 3: return IRQ_PCIETH;      /* Realtek Ethernet controller */
-       default:
-               printk("PCI: Bad IRQ mapping request for slot %d\n", slot);
-               return -1;
-       }
+       return rts7751r2d_irq_tab[slot];
 }
 
 static struct resource sh7751_io_resource = {
index d4b2bb7e08c706772df81f9f79766c68a8bbefbf..74ca576a7ce502984e26cf8511a7808acaf65c03 100644 (file)
  * Hitachi 7751, the STM ST40 STB1, SH7760, and SH7780.
  */
 #include <linux/kernel.h>
-#include <linux/init.h>
 #include <linux/irq.h>
+#include <linux/io.h>
 #include <asm/system.h>
-#include <asm/io.h>
 
 static void disable_intc2_irq(unsigned int irq)
 {
@@ -31,7 +30,7 @@ static void enable_intc2_irq(unsigned int irq)
 }
 
 static struct irq_chip intc2_irq_chip = {
-       .typename       = "intc2",
+       .name           = "INTC2",
        .mask           = disable_intc2_irq,
        .unmask         = enable_intc2_irq,
        .mask_ack       = disable_intc2_irq,
@@ -45,150 +44,36 @@ static struct irq_chip intc2_irq_chip = {
  *    PIO1 which is INTPRI00[19,16] and INTMSK00[13]
  * would be:               ^     ^             ^  ^
  *                         |     |             |  |
- *    make_intc2_irq(84,   0,   16,            0, 13);
+ *     { 84,              0,   16,            0, 13 },
+ *
+ * in the intc2_data table.
  */
-void make_intc2_irq(struct intc2_data *p)
+void make_intc2_irq(struct intc2_data *table, unsigned int nr_irqs)
 {
-       unsigned int flags;
-       unsigned long ipr;
-
-       disable_irq_nosync(p->irq);
-
-       /* Set the priority level */
-       local_irq_save(flags);
-
-       ipr = ctrl_inl(INTC2_BASE + INTC2_INTPRI_OFFSET + p->ipr_offset);
-       ipr &= ~(0xf << p->ipr_shift);
-       ipr |= p->priority << p->ipr_shift;
-       ctrl_outl(ipr, INTC2_BASE + INTC2_INTPRI_OFFSET + p->ipr_offset);
-
-       local_irq_restore(flags);
+       int i;
 
-       set_irq_chip_and_handler(p->irq, &intc2_irq_chip, handle_level_irq);
-       set_irq_chip_data(p->irq, p);
+       for (i = 0; i < nr_irqs; i++) {
+               unsigned long ipr, flags;
+               struct intc2_data *p = table + i;
 
-       enable_intc2_irq(p->irq);
-}
+               disable_irq_nosync(p->irq);
 
-static struct intc2_data intc2_irq_table[] = {
-#if defined(CONFIG_CPU_SUBTYPE_ST40)
-       {64,  0,  0, 0,  0, 13},        /* PCI serr */
-       {65,  0,  4, 0,  1, 13},        /* PCI err */
-       {66,  0,  4, 0,  2, 13},        /* PCI ad */
-       {67,  0,  4, 0,  3, 13},        /* PCI pwd down */
-       {72,  0,  8, 0,  5, 13},        /* DMAC INT0 */
-       {73,  0,  8, 0,  6, 13},        /* DMAC INT1 */
-       {74,  0,  8, 0,  7, 13},        /* DMAC INT2 */
-       {75,  0,  8, 0,  8, 13},        /* DMAC INT3 */
-       {76,  0,  8, 0,  9, 13},        /* DMAC INT4 */
-       {78,  0,  8, 0, 11, 13},        /* DMAC ERR */
-       {80,  0, 12, 0, 12, 13},        /* PIO0 */
-       {84,  0, 16, 0, 13, 13},        /* PIO1 */
-       {88,  0, 20, 0, 14, 13},        /* PIO2 */
-       {112, 4,  0, 4,  0, 13},        /* Mailbox */
- #ifdef CONFIG_CPU_SUBTYPE_ST40GX1
-       {116, 4,  4, 4,  4, 13},        /* SSC0 */
-       {120, 4,  8, 4,  8, 13},        /* IR Blaster */
-       {124, 4, 12, 4, 12, 13},        /* USB host */
-       {128, 4, 16, 4, 16, 13},        /* Video processor BLITTER */
-       {132, 4, 20, 4, 20, 13},        /* UART0 */
-       {134, 4, 20, 4, 22, 13},        /* UART2 */
-       {136, 4, 24, 4, 24, 13},        /* IO_PIO0 */
-       {140, 4, 28, 4, 28, 13},        /* EMPI */
-       {144, 8,  0, 8,  0, 13},        /* MAFE */
-       {148, 8,  4, 8,  4, 13},        /* PWM */
-       {152, 8,  8, 8,  8, 13},        /* SSC1 */
-       {156, 8, 12, 8, 12, 13},        /* IO_PIO1 */
-       {160, 8, 16, 8, 16, 13},        /* USB target */
-       {164, 8, 20, 8, 20, 13},        /* UART1 */
-       {168, 8, 24, 8, 24, 13},        /* Teletext */
-       {172, 8, 28, 8, 28, 13},        /* VideoSync VTG */
-       {173, 8, 28, 8, 29, 13},        /* VideoSync DVP0 */
-       {174, 8, 28, 8, 30, 13},        /* VideoSync DVP1 */
-#endif
-#elif defined(CONFIG_CPU_SUBTYPE_SH7760)
-/*
- * SH7760 INTC2-Style interrupts, vectors IRQ48-111 INTEVT 0x800-0xFE0
- */
-       /* INTPRIO0 | INTMSK0 */
-       {48,  0, 28, 0, 31,  3},        /* IRQ 4 */
-       {49,  0, 24, 0, 30,  3},        /* IRQ 3 */
-       {50,  0, 20, 0, 29,  3},        /* IRQ 2 */
-       {51,  0, 16, 0, 28,  3},        /* IRQ 1 */
-       /* 52-55 (INTEVT 0x880-0x8E0) unused/reserved */
-       /* INTPRIO4 | INTMSK0 */
-       {56,  4, 28, 0, 25,  3},        /* HCAN2_CHAN0 */
-       {57,  4, 24, 0, 24,  3},        /* HCAN2_CHAN1 */
-       {58,  4, 20, 0, 23,  3},        /* I2S_CHAN0   */
-       {59,  4, 16, 0, 22,  3},        /* I2S_CHAN1   */
-       {60,  4, 12, 0, 21,  3},        /* AC97_CHAN0  */
-       {61,  4,  8, 0, 20,  3},        /* AC97_CHAN1  */
-       {62,  4,  4, 0, 19,  3},        /* I2C_CHAN0   */
-       {63,  4,  0, 0, 18,  3},        /* I2C_CHAN1   */
-       /* INTPRIO8 | INTMSK0 */
-       {52,  8, 16, 0, 11,  3},        /* SCIF0_ERI_IRQ */
-       {53,  8, 16, 0, 10,  3},        /* SCIF0_RXI_IRQ */
-       {54,  8, 16, 0,  9,  3},        /* SCIF0_BRI_IRQ */
-       {55,  8, 16, 0,  8,  3},        /* SCIF0_TXI_IRQ */
-       {64,  8, 28, 0, 17,  3},        /* USBHI_IRQ */
-       {65,  8, 24, 0, 16,  3},        /* LCDC      */
-       /* 66, 67 unused */
-       {68,  8, 20, 0, 14, 13},        /* DMABRGI0_IRQ */
-       {69,  8, 20, 0, 13, 13},        /* DMABRGI1_IRQ */
-       {70,  8, 20, 0, 12, 13},        /* DMABRGI2_IRQ */
-       /* 71 unused */
-       {72,  8, 12, 0,  7,  3},        /* SCIF1_ERI_IRQ */
-       {73,  8, 12, 0,  6,  3},        /* SCIF1_RXI_IRQ */
-       {74,  8, 12, 0,  5,  3},        /* SCIF1_BRI_IRQ */
-       {75,  8, 12, 0,  4,  3},        /* SCIF1_TXI_IRQ */
-       {76,  8,  8, 0,  3,  3},        /* SCIF2_ERI_IRQ */
-       {77,  8,  8, 0,  2,  3},        /* SCIF2_RXI_IRQ */
-       {78,  8,  8, 0,  1,  3},        /* SCIF2_BRI_IRQ */
-       {79,  8,  8, 0,  0,  3},        /* SCIF2_TXI_IRQ */
-       /*          | INTMSK4 */
-       {80,  8,  4, 4, 23,  3},        /* SIM_ERI */
-       {81,  8,  4, 4, 22,  3},        /* SIM_RXI */
-       {82,  8,  4, 4, 21,  3},        /* SIM_TXI */
-       {83,  8,  4, 4, 20,  3},        /* SIM_TEI */
-       {84,  8,  0, 4, 19,  3},        /* HSPII */
-       /* INTPRIOC | INTMSK4 */
-       /* 85-87 unused/reserved */
-       {88, 12, 20, 4, 18,  3},        /* MMCI0 */
-       {89, 12, 20, 4, 17,  3},        /* MMCI1 */
-       {90, 12, 20, 4, 16,  3},        /* MMCI2 */
-       {91, 12, 20, 4, 15,  3},        /* MMCI3 */
-       {92, 12, 12, 4,  6,  3},        /* MFI (unsure, bug? in my 7760 manual*/
-       /* 93-107 reserved/undocumented */
-       {108,12,  4, 4,  1,  3},        /* ADC  */
-       {109,12,  0, 4,  0,  3},        /* CMTI */
-       /* 110-111 reserved/unused */
-#elif defined(CONFIG_CPU_SUBTYPE_SH7780)
-       { TIMER_IRQ, 0, 24, 0, INTC_TMU0_MSK, 2},
-       { 21, 1, 0, 0, INTC_RTC_MSK, TIMER_PRIORITY },
-       { 22, 1, 1, 0, INTC_RTC_MSK, TIMER_PRIORITY },
-       { 23, 1, 2, 0, INTC_RTC_MSK, TIMER_PRIORITY },
-       { SCIF0_ERI_IRQ, 8, 24, 0, INTC_SCIF0_MSK, SCIF0_PRIORITY },
-       { SCIF0_RXI_IRQ, 8, 24, 0, INTC_SCIF0_MSK, SCIF0_PRIORITY },
-       { SCIF0_BRI_IRQ, 8, 24, 0, INTC_SCIF0_MSK, SCIF0_PRIORITY },
-       { SCIF0_TXI_IRQ, 8, 24, 0, INTC_SCIF0_MSK, SCIF0_PRIORITY },
+               /* Set the priority level */
+               local_irq_save(flags);
 
-       { SCIF1_ERI_IRQ, 8, 16, 0, INTC_SCIF1_MSK, SCIF1_PRIORITY },
-       { SCIF1_RXI_IRQ, 8, 16, 0, INTC_SCIF1_MSK, SCIF1_PRIORITY },
-       { SCIF1_BRI_IRQ, 8, 16, 0, INTC_SCIF1_MSK, SCIF1_PRIORITY },
-       { SCIF1_TXI_IRQ, 8, 16, 0, INTC_SCIF1_MSK, SCIF1_PRIORITY },
+               ipr = ctrl_inl(INTC2_BASE + INTC2_INTPRI_OFFSET +
+                              p->ipr_offset);
+               ipr &= ~(0xf << p->ipr_shift);
+               ipr |= p->priority << p->ipr_shift;
+               ctrl_outl(ipr, INTC2_BASE + INTC2_INTPRI_OFFSET +
+                         p->ipr_offset);
 
-       { PCIC0_IRQ, 0x10,  8, 0, INTC_PCIC0_MSK, PCIC0_PRIORITY },
-       { PCIC1_IRQ, 0x10,  0, 0, INTC_PCIC1_MSK, PCIC1_PRIORITY },
-       { PCIC2_IRQ, 0x14, 24, 0, INTC_PCIC2_MSK, PCIC2_PRIORITY },
-       { PCIC3_IRQ, 0x14, 16, 0, INTC_PCIC3_MSK, PCIC3_PRIORITY },
-       { PCIC4_IRQ, 0x14,  8, 0, INTC_PCIC4_MSK, PCIC4_PRIORITY },
-#endif
-};
+               local_irq_restore(flags);
 
-void __init init_IRQ_intc2(void)
-{
-       int i;
+               set_irq_chip_and_handler_name(p->irq, &intc2_irq_chip,
+                                             handle_level_irq, "level");
+               set_irq_chip_data(p->irq, p);
 
-       for (i = 0; i < ARRAY_SIZE(intc2_irq_table); i++)
-               make_intc2_irq(intc2_irq_table + i);
+               enable_intc2_irq(p->irq);
+       }
 }
index 8944abdf6e1c27bd6177458159202dc2661f9bb3..f7997312ef988e4016aa72411494eae994c34af6 100644 (file)
@@ -44,7 +44,7 @@ static void enable_ipr_irq(unsigned int irq)
 }
 
 static struct irq_chip ipr_irq_chip = {
-       .name           = "ipr",
+       .name           = "IPR",
        .mask           = disable_ipr_irq,
        .unmask         = enable_ipr_irq,
        .mask_ack       = disable_ipr_irq,
@@ -60,7 +60,8 @@ void make_ipr_irq(unsigned int irq, unsigned int addr, int pos, int priority)
        ipr_data.shift = pos*4; /* POSition (0-3) x 4 means shift */
        ipr_data.priority = priority;
 
-       set_irq_chip_and_handler(irq, &ipr_irq_chip, handle_level_irq);
+       set_irq_chip_and_handler_name(irq, &ipr_irq_chip,
+                                     handle_level_irq, "level");
        set_irq_chip_data(irq, &ipr_data);
 
        enable_ipr_irq(irq);
index 6be46f0686b77c1c8110185afd4b91d8fe67178a..ba3082d640b5f1d06191a7cc9671ee62a4bb111e 100644 (file)
@@ -4,7 +4,7 @@
  *  The SH-3 exception vector table.
 
  *  Copyright (C) 1999, 2000, 2002  Niibe Yutaka
- *  Copyright (C) 2003  Paul Mundt
+ *  Copyright (C) 2003 - 2006  Paul Mundt
  *
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
@@ -49,3 +49,10 @@ ENTRY(nmi_slot)
 #endif
 ENTRY(user_break_point_trap)
        .long   break_point_trap        /* 1E0 */
+
+       /*
+        * Pad the remainder of the table out, exceptions residing in far
+        * away offsets can be manually inserted in to their appropriate
+        * location via set_exception_table_{evt,vec}().
+        */
+       .balign 4096,0,4096
index 3f4cd043e900ef5ae6cde1094d506598246d98a3..ac8ab57413cced9e802c5f77485be6e4b844d299 100644 (file)
@@ -4,7 +4,7 @@
  *  The SH-4 exception vector table.
 
  *  Copyright (C) 1999, 2000, 2002  Niibe Yutaka
- *  Copyright (C) 2003  Paul Mundt
+ *  Copyright (C) 2003 - 2006  Paul Mundt
  *
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
@@ -53,3 +53,10 @@ ENTRY(nmi_slot)
 #endif
 ENTRY(user_break_point_trap)
        .long   break_point_trap        /* 1E0 */
+
+       /*
+        * Pad the remainder of the table out, exceptions residing in far
+        * away offsets can be manually inserted in to their appropriate
+        * location via set_exception_table_{evt,vec}().
+        */
+       .balign 4096,0,4096
index 97f1c9af35d652b46bc06af385477724816aa8b9..07e5377bf55016edfb299b52a9a0e2896db386df 100644 (file)
@@ -51,3 +51,66 @@ static int __init sh7760_devices_setup(void)
                                    ARRAY_SIZE(sh7760_devices));
 }
 __initcall(sh7760_devices_setup);
+
+/*
+ * SH7760 INTC2-Style interrupts, vectors IRQ48-111 INTEVT 0x800-0xFE0
+ */
+static struct intc2_data intc2_irq_table[] = {
+       /* INTPRIO0 | INTMSK0 */
+       {48,  0, 28, 0, 31,  3},        /* IRQ 4 */
+       {49,  0, 24, 0, 30,  3},        /* IRQ 3 */
+       {50,  0, 20, 0, 29,  3},        /* IRQ 2 */
+       {51,  0, 16, 0, 28,  3},        /* IRQ 1 */
+       /* 52-55 (INTEVT 0x880-0x8E0) unused/reserved */
+       /* INTPRIO4 | INTMSK0 */
+       {56,  4, 28, 0, 25,  3},        /* HCAN2_CHAN0 */
+       {57,  4, 24, 0, 24,  3},        /* HCAN2_CHAN1 */
+       {58,  4, 20, 0, 23,  3},        /* I2S_CHAN0   */
+       {59,  4, 16, 0, 22,  3},        /* I2S_CHAN1   */
+       {60,  4, 12, 0, 21,  3},        /* AC97_CHAN0  */
+       {61,  4,  8, 0, 20,  3},        /* AC97_CHAN1  */
+       {62,  4,  4, 0, 19,  3},        /* I2C_CHAN0   */
+       {63,  4,  0, 0, 18,  3},        /* I2C_CHAN1   */
+       /* INTPRIO8 | INTMSK0 */
+       {52,  8, 16, 0, 11,  3},        /* SCIF0_ERI_IRQ */
+       {53,  8, 16, 0, 10,  3},        /* SCIF0_RXI_IRQ */
+       {54,  8, 16, 0,  9,  3},        /* SCIF0_BRI_IRQ */
+       {55,  8, 16, 0,  8,  3},        /* SCIF0_TXI_IRQ */
+       {64,  8, 28, 0, 17,  3},        /* USBHI_IRQ */
+       {65,  8, 24, 0, 16,  3},        /* LCDC      */
+       /* 66, 67 unused */
+       {68,  8, 20, 0, 14, 13},        /* DMABRGI0_IRQ */
+       {69,  8, 20, 0, 13, 13},        /* DMABRGI1_IRQ */
+       {70,  8, 20, 0, 12, 13},        /* DMABRGI2_IRQ */
+       /* 71 unused */
+       {72,  8, 12, 0,  7,  3},        /* SCIF1_ERI_IRQ */
+       {73,  8, 12, 0,  6,  3},        /* SCIF1_RXI_IRQ */
+       {74,  8, 12, 0,  5,  3},        /* SCIF1_BRI_IRQ */
+       {75,  8, 12, 0,  4,  3},        /* SCIF1_TXI_IRQ */
+       {76,  8,  8, 0,  3,  3},        /* SCIF2_ERI_IRQ */
+       {77,  8,  8, 0,  2,  3},        /* SCIF2_RXI_IRQ */
+       {78,  8,  8, 0,  1,  3},        /* SCIF2_BRI_IRQ */
+       {79,  8,  8, 0,  0,  3},        /* SCIF2_TXI_IRQ */
+       /*          | INTMSK4 */
+       {80,  8,  4, 4, 23,  3},        /* SIM_ERI */
+       {81,  8,  4, 4, 22,  3},        /* SIM_RXI */
+       {82,  8,  4, 4, 21,  3},        /* SIM_TXI */
+       {83,  8,  4, 4, 20,  3},        /* SIM_TEI */
+       {84,  8,  0, 4, 19,  3},        /* HSPII */
+       /* INTPRIOC | INTMSK4 */
+       /* 85-87 unused/reserved */
+       {88, 12, 20, 4, 18,  3},        /* MMCI0 */
+       {89, 12, 20, 4, 17,  3},        /* MMCI1 */
+       {90, 12, 20, 4, 16,  3},        /* MMCI2 */
+       {91, 12, 20, 4, 15,  3},        /* MMCI3 */
+       {92, 12, 12, 4,  6,  3},        /* MFI (unsure, bug? in my 7760 manual*/
+       /* 93-107 reserved/undocumented */
+       {108,12,  4, 4,  1,  3},        /* ADC  */
+       {109,12,  0, 4,  0,  3},        /* CMTI */
+       /* 110-111 reserved/unused */
+};
+
+void __init init_IRQ_intc2(void)
+{
+       make_intc2_irq(intc2_irq_table, ARRAY_SIZE(intc2_irq_table));
+}
index 72493f259edccf63e6e187328c6dd5270d481622..814ddb226531c26c92ed78efd27aea24b5cd98db 100644 (file)
@@ -77,3 +77,30 @@ static int __init sh7780_devices_setup(void)
                                    ARRAY_SIZE(sh7780_devices));
 }
 __initcall(sh7780_devices_setup);
+
+static struct intc2_data intc2_irq_table[] = {
+       { TIMER_IRQ, 0, 24, 0, INTC_TMU0_MSK, 2 },
+       { 21, 1, 0, 0, INTC_RTC_MSK, TIMER_PRIORITY },
+       { 22, 1, 1, 0, INTC_RTC_MSK, TIMER_PRIORITY },
+       { 23, 1, 2, 0, INTC_RTC_MSK, TIMER_PRIORITY },
+       { SCIF0_ERI_IRQ, 8, 24, 0, INTC_SCIF0_MSK, SCIF0_PRIORITY },
+       { SCIF0_RXI_IRQ, 8, 24, 0, INTC_SCIF0_MSK, SCIF0_PRIORITY },
+       { SCIF0_BRI_IRQ, 8, 24, 0, INTC_SCIF0_MSK, SCIF0_PRIORITY },
+       { SCIF0_TXI_IRQ, 8, 24, 0, INTC_SCIF0_MSK, SCIF0_PRIORITY },
+
+       { SCIF1_ERI_IRQ, 8, 16, 0, INTC_SCIF1_MSK, SCIF1_PRIORITY },
+       { SCIF1_RXI_IRQ, 8, 16, 0, INTC_SCIF1_MSK, SCIF1_PRIORITY },
+       { SCIF1_BRI_IRQ, 8, 16, 0, INTC_SCIF1_MSK, SCIF1_PRIORITY },
+       { SCIF1_TXI_IRQ, 8, 16, 0, INTC_SCIF1_MSK, SCIF1_PRIORITY },
+
+       { PCIC0_IRQ, 0x10,  8, 0, INTC_PCIC0_MSK, PCIC0_PRIORITY },
+       { PCIC1_IRQ, 0x10,  0, 0, INTC_PCIC1_MSK, PCIC1_PRIORITY },
+       { PCIC2_IRQ, 0x14, 24, 0, INTC_PCIC2_MSK, PCIC2_PRIORITY },
+       { PCIC3_IRQ, 0x14, 16, 0, INTC_PCIC3_MSK, PCIC3_PRIORITY },
+       { PCIC4_IRQ, 0x14,  8, 0, INTC_PCIC4_MSK, PCIC4_PRIORITY },
+};
+
+void __init init_IRQ_intc2(void)
+{
+       make_intc2_irq(intc2_irq_table, ARRAY_SIZE(intc2_irq_table));
+}
index acf2602569c4928a5ecd6dc023ede793afd64d2e..944128ce97066ff46bc67cae6a5ce98a3717e9d6 100644 (file)
@@ -54,7 +54,7 @@ int show_interrupts(struct seq_file *p, void *v)
                for_each_online_cpu(j)
                        seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
                seq_printf(p, " %14s", irq_desc[i].chip->name);
-               seq_printf(p, "-%s", handle_irq_name(irq_desc[i].handle_irq));
+               seq_printf(p, "-%-8s", irq_desc[i].name);
                seq_printf(p, "  %s", action->name);
 
                for (action=action->next; action; action = action->next)
index 91516dca4a857180dacb51bd37b68c72ab3630e4..a52b13ac6b7f80a32e81a5daeef04a115de406da 100644 (file)
@@ -105,7 +105,7 @@ void show_regs(struct pt_regs * regs)
 {
        printk("\n");
        printk("Pid : %d, Comm: %20s\n", current->pid, current->comm);
-       print_symbol("PC is at %s\n", regs->pc);
+       print_symbol("PC is at %s\n", instruction_pointer(regs));
        printk("PC  : %08lx SP  : %08lx SR  : %08lx ",
               regs->pc, regs->regs[15], regs->sr);
 #ifdef CONFIG_MMU
@@ -130,15 +130,7 @@ void show_regs(struct pt_regs * regs)
        printk("MACH: %08lx MACL: %08lx GBR : %08lx PR  : %08lx\n",
               regs->mach, regs->macl, regs->gbr, regs->pr);
 
-       /*
-        * If we're in kernel mode, dump the stack too..
-        */
-       if (!user_mode(regs)) {
-               extern void show_task(unsigned long *sp);
-               unsigned long sp = regs->regs[15];
-
-               show_task((unsigned long *)sp);
-       }
+       show_trace(NULL, (unsigned long *)regs->regs[15], regs);
 }
 
 /*
index c2c597e0948242c780d4d369dff64c69dee14c59..53dfa55f3156b40327e977aef77d7fef08d5351e 100644 (file)
@@ -1,38 +1,25 @@
-/* $Id: traps.c,v 1.17 2004/05/02 01:46:30 sugioka Exp $
- *
- *  linux/arch/sh/traps.c
+/*
+ * 'traps.c' handles hardware traps and faults after we have saved some
+ * state in 'entry.S'.
  *
  *  SuperH version: Copyright (C) 1999 Niibe Yutaka
  *                  Copyright (C) 2000 Philipp Rumpf
  *                  Copyright (C) 2000 David Howells
- *                  Copyright (C) 2002, 2003 Paul Mundt
- */
-
-/*
- * 'Traps.c' handles hardware traps and faults after we have saved some
- * state in 'entry.S'.
+ *                  Copyright (C) 2002 - 2006 Paul Mundt
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
  */
-#include <linux/sched.h>
 #include <linux/kernel.h>
-#include <linux/string.h>
-#include <linux/errno.h>
 #include <linux/ptrace.h>
-#include <linux/timer.h>
-#include <linux/mm.h>
-#include <linux/smp.h>
-#include <linux/smp_lock.h>
 #include <linux/init.h>
-#include <linux/delay.h>
 #include <linux/spinlock.h>
 #include <linux/module.h>
 #include <linux/kallsyms.h>
-
+#include <linux/io.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
-#include <asm/io.h>
-#include <asm/atomic.h>
-#include <asm/processor.h>
-#include <asm/sections.h>
 
 #ifdef CONFIG_SH_KGDB
 #include <asm/kgdb.h>
 #define TRAP_ILLEGAL_SLOT_INST 13
 #endif
 
-/*
- * These constants are for searching for possible module text
- * segments.  VMALLOC_OFFSET comes from mm/vmalloc.c; MODULE_RANGE is
- * a guess of how much space is likely to be vmalloced.
- */
-#define VMALLOC_OFFSET (8*1024*1024)
-#define MODULE_RANGE (8*1024*1024)
+static void dump_mem(const char *str, unsigned long bottom, unsigned long top)
+{
+       unsigned long p;
+       int i;
+
+       printk("%s(0x%08lx to 0x%08lx)\n", str, bottom, top);
+
+       for (p = bottom & ~31; p < top; ) {
+               printk("%04lx: ", p & 0xffff);
+
+               for (i = 0; i < 8; i++, p += 4) {
+                       unsigned int val;
+
+                       if (p < bottom || p >= top)
+                               printk("         ");
+                       else {
+                               if (__get_user(val, (unsigned int __user *)p)) {
+                                       printk("\n");
+                                       return;
+                               }
+                               printk("%08x ", val);
+                       }
+               }
+               printk("\n");
+       }
+}
 
 DEFINE_SPINLOCK(die_lock);
 
@@ -69,14 +75,28 @@ void die(const char * str, struct pt_regs * regs, long err)
 
        console_verbose();
        spin_lock_irq(&die_lock);
+       bust_spinlocks(1);
+
        printk("%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter);
+
        CHK_REMOTE_DEBUG(regs);
+       print_modules();
        show_regs(regs);
+
+       printk("Process: %s (pid: %d, stack limit = %p)\n",
+              current->comm, current->pid, task_stack_page(current) + 1);
+
+       if (!user_mode(regs) || in_interrupt())
+               dump_mem("Stack: ", regs->regs[15], THREAD_SIZE +
+                        (unsigned long)task_stack_page(current));
+
+       bust_spinlocks(0);
        spin_unlock_irq(&die_lock);
        do_exit(SIGSEGV);
 }
 
-static inline void die_if_kernel(const char * str, struct pt_regs * regs, long err)
+static inline void die_if_kernel(const char *str, struct pt_regs *regs,
+                                long err)
 {
        if (!user_mode(regs))
                die(str, regs, err);
@@ -93,8 +113,7 @@ static int handle_unaligned_notify_count = 10;
  */
 static int die_if_no_fixup(const char * str, struct pt_regs * regs, long err)
 {
-       if (!user_mode(regs))
-       {
+       if (!user_mode(regs)) {
                const struct exception_table_entry *fixup;
                fixup = search_exception_tables(regs->pc);
                if (fixup) {
@@ -550,7 +569,10 @@ int is_dsp_inst(struct pt_regs *regs)
 #define is_dsp_inst(regs)      (0)
 #endif /* CONFIG_SH_DSP */
 
-extern int do_fpu_inst(unsigned short, struct pt_regs*);
+/* arch/sh/kernel/cpu/sh4/fpu.c */
+extern int do_fpu_inst(unsigned short, struct pt_regs *);
+extern asmlinkage void do_fpu_state_restore(unsigned long r4, unsigned long r5,
+               unsigned long r6, unsigned long r7, struct pt_regs regs);
 
 asmlinkage void do_reserved_inst(unsigned long r4, unsigned long r5,
                                unsigned long r6, unsigned long r7,
@@ -709,14 +731,20 @@ void __init per_cpu_trap_init(void)
                     : "memory");
 }
 
-void __init trap_init(void)
+void *set_exception_table_vec(unsigned int vec, void *handler)
 {
        extern void *exception_handling_table[];
+       void *old_handler;
+       
+       old_handler = exception_handling_table[vec];
+       exception_handling_table[vec] = handler;
+       return old_handler;
+}
 
-       exception_handling_table[TRAP_RESERVED_INST]
-               = (void *)do_reserved_inst;
-       exception_handling_table[TRAP_ILLEGAL_SLOT_INST]
-               = (void *)do_illegal_slot_inst;
+void __init trap_init(void)
+{
+       set_exception_table_vec(TRAP_RESERVED_INST, do_reserved_inst);
+       set_exception_table_vec(TRAP_ILLEGAL_SLOT_INST, do_illegal_slot_inst);
 
 #if defined(CONFIG_CPU_SH4) && !defined(CONFIG_SH_FPU) || \
     defined(CONFIG_SH_FPU_EMU)
@@ -725,61 +753,54 @@ void __init trap_init(void)
         * reserved. They'll be handled in the math-emu case, or faulted on
         * otherwise.
         */
-       /* entry 64 corresponds to EXPEVT=0x800 */
-       exception_handling_table[64] = (void *)do_reserved_inst;
-       exception_handling_table[65] = (void *)do_illegal_slot_inst;
+       set_exception_table_evt(0x800, do_reserved_inst);
+       set_exception_table_evt(0x820, do_illegal_slot_inst);
+#elif defined(CONFIG_SH_FPU)
+       set_exception_table_evt(0x800, do_fpu_state_restore);
+       set_exception_table_evt(0x820, do_fpu_state_restore);
 #endif
                
        /* Setup VBR for boot cpu */
        per_cpu_trap_init();
 }
 
-void show_stack(struct task_struct *tsk, unsigned long *sp)
+void show_trace(struct task_struct *tsk, unsigned long *sp,
+               struct pt_regs *regs)
 {
-       unsigned long *stack, addr;
-       unsigned long module_start = VMALLOC_START;
-       unsigned long module_end = VMALLOC_END;
-       int i = 1;
-
-       if (!tsk)
-               tsk = current;
-       if (tsk == current)
-               sp = (unsigned long *)current_stack_pointer;
-       else
-               sp = (unsigned long *)tsk->thread.sp;
+       unsigned long addr;
 
-       stack = sp;
+       if (regs && user_mode(regs))
+               return;
 
        printk("\nCall trace: ");
 #ifdef CONFIG_KALLSYMS
        printk("\n");
 #endif
 
-       while (!kstack_end(stack)) {
-               addr = *stack++;
-               if (((addr >= (unsigned long)_text) &&
-                    (addr <= (unsigned long)_etext)) ||
-                   ((addr >= module_start) && (addr <= module_end))) {
-                       /*
-                        * For 80-columns display, 6 entry is maximum.
-                        * NOTE: '[<8c00abcd>] ' consumes 13 columns .
-                        */
-#ifndef CONFIG_KALLSYMS
-                       if (i && ((i % 6) == 0))
-                               printk("\n       ");
-#endif
-                       printk("[<%08lx>] ", addr);
-                       print_symbol("%s\n", addr);
-                       i++;
-               }
+       while (!kstack_end(sp)) {
+               addr = *sp++;
+               if (kernel_text_address(addr))
+                       print_ip_sym(addr);
        }
 
        printk("\n");
 }
 
-void show_task(unsigned long *sp)
+void show_stack(struct task_struct *tsk, unsigned long *sp)
 {
-       show_stack(NULL, sp);
+       unsigned long stack;
+
+       if (!tsk)
+               tsk = current;
+       if (tsk == current)
+               sp = (unsigned long *)current_stack_pointer;
+       else
+               sp = (unsigned long *)tsk->thread.sp;
+
+       stack = (unsigned long)sp;
+       dump_mem("Stack: ", stack, THREAD_SIZE +
+                (unsigned long)task_stack_page(tsk));
+       show_trace(tsk, sp, NULL);
 }
 
 void dump_stack(void)
index 9431e967aa455000e218dddc99681518418cebe8..2f96610a83e961fc3e6a539c09aac98e9e39bb56 100644 (file)
@@ -289,6 +289,13 @@ endmenu
 
 source "fs/Kconfig"
 
+menu "Instrumentation Support"
+       depends on EXPERIMENTAL
+
+source "arch/sparc/oprofile/Kconfig"
+
+endmenu
+
 source "arch/sparc/Kconfig.debug"
 
 source "security/Kconfig"
index 4cdbb2d59ed0a3e04c5e1d10a5bcf308c8ee7f22..f33c3817f01446810095d86727f79ad48eaa81ee 100644 (file)
@@ -30,6 +30,8 @@ HEAD_Y := $(head-y)
 core-y += arch/sparc/kernel/ arch/sparc/mm/ arch/sparc/math-emu/
 libs-y += arch/sparc/prom/ arch/sparc/lib/
 
+drivers-$(CONFIG_OPROFILE)     += arch/sparc/oprofile/
+
 # Export what is needed by arch/sparc/boot/Makefile
 # Renaming is done to avoid confusing pattern matching rules in 2.5.45 (multy-)
 INIT_Y         := $(patsubst %/, %/built-in.o, $(init-y))
index b3b6680a2a30171483670780b5f64a0851c8666d..c8cb211b90728741877f0326a96803c37ba07527 100644 (file)
@@ -351,7 +351,7 @@ void handler_irq(int irq, struct pt_regs * regs)
 }
 
 #ifdef CONFIG_BLK_DEV_FD
-extern void floppy_interrupt(int irq, void *dev_id)
+extern void floppy_interrupt(int irq, void *dev_id);
 
 void sparc_floppy_irq(int irq, void *dev_id, struct pt_regs *regs)
 {
index f5ee1ac834bcf38c58de7f799d5054e734507fa1..383526ad94fccb61f9176a51233bcce62d4c5d3a 100644 (file)
@@ -103,7 +103,6 @@ void prom_sync_me(void)
 
 unsigned int boot_flags __initdata = 0;
 #define BOOTME_DEBUG  0x1
-#define BOOTME_SINGLE 0x2
 
 /* Exported for mm/init.c:paging_init. */
 unsigned long cmdline_memory_size __initdata = 0;
@@ -132,7 +131,6 @@ static void __init process_switch(char c)
                boot_flags |= BOOTME_DEBUG;
                break;
        case 's':
-               boot_flags |= BOOTME_SINGLE;
                break;
        case 'h':
                prom_printf("boot_flags_init: Halt!\n");
index 7dcd1a16c6e4213167c0ac8db3a6759de6a05a9e..6c7aa51b590fd5c7d0d10d457698d9c9146a157b 100644 (file)
@@ -95,6 +95,8 @@ unsigned long profile_pc(struct pt_regs *regs)
        return pc;
 }
 
+EXPORT_SYMBOL(profile_pc);
+
 __volatile__ unsigned int *master_l10_counter;
 __volatile__ unsigned int *master_l10_limit;
 
diff --git a/arch/sparc/oprofile/Kconfig b/arch/sparc/oprofile/Kconfig
new file mode 100644 (file)
index 0000000..d8a8408
--- /dev/null
@@ -0,0 +1,17 @@
+config PROFILING
+       bool "Profiling support (EXPERIMENTAL)"
+       help
+         Say Y here to enable the extended profiling support mechanisms used
+         by profilers such as OProfile.
+         
+
+config OPROFILE
+       tristate "OProfile system profiling (EXPERIMENTAL)"
+       depends on PROFILING
+       help
+         OProfile is a profiling system capable of profiling the
+         whole system, include the kernel, kernel modules, libraries,
+         and applications.
+
+         If unsure, say N.
+
diff --git a/arch/sparc/oprofile/Makefile b/arch/sparc/oprofile/Makefile
new file mode 100644 (file)
index 0000000..e9feca1
--- /dev/null
@@ -0,0 +1,9 @@
+obj-$(CONFIG_OPROFILE) += oprofile.o
+
+DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \
+               oprof.o cpu_buffer.o buffer_sync.o \
+               event_buffer.o oprofile_files.o \
+               oprofilefs.o oprofile_stats.o \
+               timer_int.o )
+
+oprofile-y                             := $(DRIVER_OBJS) init.o
diff --git a/arch/sparc/oprofile/init.c b/arch/sparc/oprofile/init.c
new file mode 100644 (file)
index 0000000..9ab815b
--- /dev/null
@@ -0,0 +1,23 @@
+/**
+ * @file init.c
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon <levon@movementarian.org>
+ */
+
+#include <linux/kernel.h>
+#include <linux/oprofile.h>
+#include <linux/errno.h>
+#include <linux/init.h>
+int __init oprofile_arch_init(struct oprofile_operations * ops)
+{
+       return -ENODEV;
+}
+
+
+void oprofile_arch_exit(void)
+{
+}
index dcae559879ae692b6e713e311d844880ffb72ea6..2f4612fa81f274e5b61982c350c69f6654118bb7 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.19-rc1
-# Thu Oct  5 02:08:41 2006
+# Linux kernel version: 2.6.19-rc2
+# Tue Oct 17 19:29:20 2006
 #
 CONFIG_SPARC=y
 CONFIG_SPARC64=y
@@ -217,6 +217,7 @@ CONFIG_INET6_XFRM_MODE_TRANSPORT=m
 CONFIG_INET6_XFRM_MODE_TUNNEL=m
 CONFIG_INET6_XFRM_MODE_BEET=m
 # CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
+CONFIG_IPV6_SIT=m
 CONFIG_IPV6_TUNNEL=m
 # CONFIG_IPV6_SUBTREES is not set
 # CONFIG_IPV6_MULTIPLE_TABLES is not set
@@ -333,6 +334,12 @@ CONFIG_CDROM_PKTCDVD_BUFFERS=8
 CONFIG_CDROM_PKTCDVD_WCACHE=y
 CONFIG_ATA_OVER_ETH=m
 
+#
+# Misc devices
+#
+# CONFIG_SGI_IOC4 is not set
+# CONFIG_TIFM_CORE is not set
+
 #
 # ATA/ATAPI/MFM/RLL support
 #
@@ -728,7 +735,6 @@ CONFIG_RTC=y
 # TPM devices
 #
 # CONFIG_TCG_TPM is not set
-# CONFIG_TELCLOCK is not set
 
 #
 # I2C support
@@ -841,11 +847,6 @@ CONFIG_HWMON=y
 # CONFIG_SENSORS_W83627EHF is not set
 # CONFIG_HWMON_DEBUG_CHIP is not set
 
-#
-# Misc devices
-#
-# CONFIG_TIFM_CORE is not set
-
 #
 # Multimedia devices
 #
@@ -1104,7 +1105,6 @@ CONFIG_USB_HIDDEV=y
 # CONFIG_USB_ATI_REMOTE2 is not set
 # CONFIG_USB_KEYSPAN_REMOTE is not set
 # CONFIG_USB_APPLETOUCH is not set
-# CONFIG_USB_TRANCEVIBRATOR is not set
 
 #
 # USB Imaging devices
@@ -1150,6 +1150,7 @@ CONFIG_USB_HIDDEV=y
 # CONFIG_USB_APPLEDISPLAY is not set
 # CONFIG_USB_SISUSBVGA is not set
 # CONFIG_USB_LD is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
 # CONFIG_USB_TEST is not set
 
 #
@@ -1234,6 +1235,7 @@ CONFIG_EXT3_FS=y
 CONFIG_EXT3_FS_XATTR=y
 CONFIG_EXT3_FS_POSIX_ACL=y
 CONFIG_EXT3_FS_SECURITY=y
+# CONFIG_EXT4DEV_FS is not set
 CONFIG_JBD=y
 # CONFIG_JBD_DEBUG is not set
 CONFIG_FS_MBCACHE=y
@@ -1361,10 +1363,6 @@ CONFIG_NLS_DEFAULT="iso8859-1"
 # CONFIG_NLS_KOI8_U is not set
 # CONFIG_NLS_UTF8 is not set
 
-#
-# Distributed Lock Manager
-#
-
 #
 # Instrumentation Support
 #
@@ -1399,6 +1397,7 @@ CONFIG_DEBUG_FS=y
 # CONFIG_DEBUG_LIST is not set
 # CONFIG_UNWIND_INFO is not set
 CONFIG_FORCED_INLINING=y
+# CONFIG_HEADERS_CHECK is not set
 # CONFIG_RCU_TORTURE_TEST is not set
 # CONFIG_LKDTM is not set
 # CONFIG_DEBUG_STACK_USAGE is not set
index d822c7c18e1f9e5b92ddb8add7ce2bd6586b72ef..d3dfb2a36d477584d8722430e07f01f701f9f01a 100644 (file)
@@ -131,8 +131,13 @@ static int of_device_resume(struct device * dev)
 void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name)
 {
        unsigned long ret = res->start + offset;
+       struct resource *r;
 
-       if (!request_region(ret, size, name))
+       if (res->flags & IORESOURCE_MEM)
+               r = request_mem_region(ret, size, name);
+       else
+               r = request_region(ret, size, name);
+       if (!r)
                ret = 0;
 
        return (void __iomem *) ret;
index 7a59cc72c844c438188f5fef41bb4adcc08ea523..827ae30aa4971e5306e1f8c0ed6db494e65b71ec 100644 (file)
@@ -330,19 +330,6 @@ __init get_device_resource(struct linux_prom_pci_registers *ap,
        return res;
 }
 
-static int __init pdev_resource_collisions_expected(struct pci_dev *pdev)
-{
-       if (pdev->vendor != PCI_VENDOR_ID_SUN)
-               return 0;
-
-       if (pdev->device == PCI_DEVICE_ID_SUN_RIO_EBUS ||
-           pdev->device == PCI_DEVICE_ID_SUN_RIO_1394 ||
-           pdev->device == PCI_DEVICE_ID_SUN_RIO_USB)
-               return 1;
-
-       return 0;
-}
-
 static void __init pdev_record_assignments(struct pci_pbm_info *pbm,
                                           struct pci_dev *pdev)
 {
@@ -400,19 +387,23 @@ static void __init pdev_record_assignments(struct pci_pbm_info *pbm,
                pbm->parent->resource_adjust(pdev, res, root);
 
                if (request_resource(root, res) < 0) {
+                       int rnum;
+
                        /* OK, there is some conflict.  But this is fine
                         * since we'll reassign it in the fixup pass.
                         *
-                        * We notify the user that OBP made an error if it
-                        * is a case we don't expect.
+                        * Do not print the warning for ROM resources
+                        * as such a conflict is quite common and
+                        * harmless as the ROM bar is disabled.
                         */
-                       if (!pdev_resource_collisions_expected(pdev)) {
-                               printk(KERN_ERR "PCI: Address space collision on region %ld "
+                       rnum = (res - &pdev->resource[0]);
+                       if (rnum != PCI_ROM_RESOURCE)
+                               printk(KERN_ERR "PCI: Resource collision, "
+                                      "region %d "
                                       "[%016lx:%016lx] of device %s\n",
-                                      (res - &pdev->resource[0]),
+                                      rnum,
                                       res->start, res->end,
                                       pci_name(pdev));
-                       }
                }
        }
 }
index 6ec569828c29c46371055b9f17ed0d83d8cf1a22..94bb681f232379bf05a77df690c4e9944369d8d5 100644 (file)
@@ -1196,7 +1196,7 @@ static void pbm_register_toplevel_resources(struct pci_controller_info *p,
                                            &pbm->mem_space);
 }
 
-static void sabre_pbm_init(struct pci_controller_info *p, struct device_node *dp, u32 dma_begin)
+static void sabre_pbm_init(struct pci_controller_info *p, struct device_node *dp, u32 dma_start, u32 dma_end)
 {
        struct pci_pbm_info *pbm;
        struct device_node *node;
@@ -1261,6 +1261,8 @@ static void sabre_pbm_init(struct pci_controller_info *p, struct device_node *dp
                node = node->sibling;
        }
        if (simbas_found == 0) {
+               struct resource *rp;
+
                /* No APBs underneath, probably this is a hummingbird
                 * system.
                 */
@@ -1302,8 +1304,10 @@ static void sabre_pbm_init(struct pci_controller_info *p, struct device_node *dp
                pbm->io_space.end   = pbm->io_space.start + (1UL << 24) - 1UL;
                pbm->io_space.flags = IORESOURCE_IO;
 
-               pbm->mem_space.start = p->pbm_A.controller_regs + SABRE_MEMSPACE;
-               pbm->mem_space.end   = pbm->mem_space.start + (unsigned long)dma_begin - 1UL;
+               pbm->mem_space.start =
+                       (p->pbm_A.controller_regs + SABRE_MEMSPACE);
+               pbm->mem_space.end =
+                       (pbm->mem_space.start + ((1UL << 32UL) - 1UL));
                pbm->mem_space.flags = IORESOURCE_MEM;
 
                if (request_resource(&ioport_resource, &pbm->io_space) < 0) {
@@ -1315,6 +1319,17 @@ static void sabre_pbm_init(struct pci_controller_info *p, struct device_node *dp
                        prom_halt();
                }
 
+               rp = kmalloc(sizeof(*rp), GFP_KERNEL);
+               if (!rp) {
+                       prom_printf("Cannot allocate IOMMU resource.\n");
+                       prom_halt();
+               }
+               rp->name = "IOMMU";
+               rp->start = pbm->mem_space.start + (unsigned long) dma_start;
+               rp->end = pbm->mem_space.start + (unsigned long) dma_end - 1UL;
+               rp->flags = IORESOURCE_BUSY;
+               request_resource(&pbm->mem_space, rp);
+
                pci_register_legacy_regions(&pbm->io_space,
                                            &pbm->mem_space);
        }
@@ -1450,5 +1465,5 @@ void sabre_init(struct device_node *dp, char *model_name)
        /*
         * Look for APB underneath.
         */
-       sabre_pbm_init(p, dp, vdma[0]);
+       sabre_pbm_init(p, dp, vdma[0], vdma[0] + vdma[1]);
 }
index cc8ad480a204152256f97c8b44e15f3f3144c6b4..bf033b31d4376341a8cce56b9ec77e9127f6986b 100644 (file)
@@ -74,7 +74,6 @@ prom_console_write(struct console *con, const char *s, unsigned n)
 
 unsigned int boot_flags = 0;
 #define BOOTME_DEBUG  0x1
-#define BOOTME_SINGLE 0x2
 
 /* Exported for mm/init.c:paging_init. */
 unsigned long cmdline_memory_size = 0;
@@ -102,7 +101,6 @@ static void __init process_switch(char c)
                boot_flags |= BOOTME_DEBUG;
                break;
        case 's':
-               boot_flags |= BOOTME_SINGLE;
                break;
        case 'h':
                prom_printf("boot_flags_init: Halt!\n");
index 78fb619bdb732fcf2bd6de5e99894840af5a3db8..5ac1f2963ae383e391cb601c730ed645e0707b6a 100644 (file)
@@ -1,3 +1,8 @@
+config DEFCONFIG_LIST
+       string
+       option defconfig_list
+       default "arch/$ARCH/defconfig"
+
 # UML uses the generic IRQ sugsystem
 config GENERIC_HARDIRQS
        bool
@@ -52,6 +57,7 @@ menu "UML-specific options"
 config MODE_TT
        bool "Tracing thread support (DEPRECATED)"
        default n
+       depends on BROKEN
        help
        This option controls whether tracing thread support is compiled
        into UML. This option is largely obsolete, given that skas0 provides
index 62d87b71179b5b63497d6183c6b2f3c66c994fc1..e03e40c7aac35472e5139152a2158b0285c76bd8 100644 (file)
@@ -190,6 +190,11 @@ config HOSTAUDIO
        tristate
        default UML_SOUND
 
+#It is selected elsewhere, so kconfig would warn without this.
+config HW_RANDOM
+       tristate
+       default n
+
 config UML_RANDOM
        tristate "Hardware random number generator"
        help
index 7a5b4afde6929474f8422ab681076dd430ebaed1..c6a308464acb600f3705c4e3a6e0c9fa9c848430 100644 (file)
@@ -5,6 +5,7 @@
 #include "user_util.h"
 #include "os.h"
 #include "user.h"
+#include "um_malloc.h"
 
 static inline void *cow_malloc(int size)
 {
index 77954ea77043796217b22f83e3ef0d9d3b8c7c14..310af0f1e49e4a7fa2b78609ed5e46c200cba721 100644 (file)
@@ -17,6 +17,7 @@
 #include "user_util.h"
 #include "user.h"
 #include "os.h"
+#include "um_malloc.h"
 
 #define MAX_PACKET (ETH_MAX_PACKET + ETH_HEADER_OTHER)
 
index 108b7dafbd0e99a6d0cf9a9d82ca26ed6d1ac5f1..218aa0e9b792b6f0351e084f8640e472ecdf5c9f 100644 (file)
@@ -12,6 +12,7 @@
 #include "user_util.h"
 #include "chan_user.h"
 #include "os.h"
+#include "um_malloc.h"
 
 struct fd_chan {
        int fd;
index 4d2bd39a85bc16ff7dc685b908dad366fa82cac0..8138f5ea1bf7516272de7b086ead9ca8295306ea 100644 (file)
@@ -23,6 +23,7 @@
 #include "user_util.h"
 #include "user.h"
 #include "os.h"
+#include "um_malloc.h"
 
 #define MAX_PACKET (ETH_MAX_PACKET + ETH_HEADER_OTHER)
 
index 9a3b5daf6250784c1359f8997e115eac3ab8f29b..df3516e47d4d534bae0f10022717cff6bc541297 100644 (file)
@@ -95,7 +95,8 @@ static const struct file_operations mmapper_fops = {
        .release        = mmapper_release,
 };
 
-static const struct miscdevice mmapper_dev = {
+/* No locking needed - only used (and modified) by below initcall and exitcall. */
+static struct miscdevice mmapper_dev = {
        .minor          = MISC_DYNAMIC_MINOR,
        .name           = "mmapper",
        .fops           = &mmapper_fops
index f3a3f8a29c7af877d327692f2f30f89a7ef6f081..0ffd7ac295d45e0fd5bdc0e4e8c36eab42c517cd 100644 (file)
@@ -18,6 +18,7 @@
 #include "kern_util.h"
 #include "net_user.h"
 #include "os.h"
+#include "um_malloc.h"
 
 int tap_open_common(void *dev, char *gate_addr)
 {
index 2ef641ded960a96670456b5d2f1b56914a689c42..11921a7baa7b14066d2c2f7d7f653063535e516e 100644 (file)
@@ -12,6 +12,7 @@
 #include "net_user.h"
 #include "pcap_user.h"
 #include "user.h"
+#include "um_malloc.h"
 
 #define MAX_PACKET (ETH_MAX_PACKET + ETH_HEADER_OTHER)
 
index f2e8fc42ecc2df4a2ec7bfe247ab7ec12fe1659c..bc6afaf74c1a8123ace69f94c5d2d9a340bc6347 100644 (file)
@@ -19,6 +19,7 @@
 #include "chan_user.h"
 #include "port.h"
 #include "os.h"
+#include "um_malloc.h"
 
 struct port_chan {
        int raw;
index abec620e838030d43e7a01626cb82c5c041ed63f..829a5eca8c07606b9b44ea393df4e4f32b94fd99 100644 (file)
@@ -13,6 +13,7 @@
 #include "user_util.h"
 #include "kern_util.h"
 #include "os.h"
+#include "um_malloc.h"
 
 struct pty_chan {
        void (*announce)(char *dev_name, int dev);
index 8460285c69a5cea3e0b842d0b5cd792d84c38aef..7eddacc53b6ec2168a581685b4e11bf6523eeedf 100644 (file)
@@ -15,6 +15,7 @@
 #include "slip.h"
 #include "slip_common.h"
 #include "os.h"
+#include "um_malloc.h"
 
 void slip_user_init(void *data, void *dev)
 {
index 11de3ac1eb5c787512b4c1a71f6ac1a16cd6725b..d95d64309eaf3defc373ba6195a0b5fc03cbea45 100644 (file)
@@ -11,6 +11,7 @@
 #include "user_util.h"
 #include "user.h"
 #include "os.h"
+#include "um_malloc.h"
 
 struct tty_chan {
        char *dev;
index 386f8b952982e4317f5254e4016a2e7ba18597d1..850221d9b4c953306d87817bfd455551dc4aee67 100644 (file)
@@ -136,8 +136,6 @@ int xterm_open(int input, int output, int primary, void *d,
                return(pid);
        }
 
-       if(data->stack == 0) free_stack(stack, 0);
-
        if (data->direct_rcv) {
                new = os_rcv_fd(fd, &data->helper_pid);
        } else {
index 59cfa9e0cad034739c3add89720269c01f0177c2..cec9fcc57bf51f5169cbee6cf7fdc6f60555d5f8 100644 (file)
@@ -6,7 +6,6 @@
 #ifndef __KERN_UTIL_H__
 #define __KERN_UTIL_H__
 
-#include "linux/threads.h"
 #include "sysdep/ptrace.h"
 #include "sysdep/faultinfo.h"
 
diff --git a/arch/um/include/um_malloc.h b/arch/um/include/um_malloc.h
new file mode 100644 (file)
index 0000000..0363a9b
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * Copyright (C) 2005 Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
+ * Licensed under the GPL
+ */
+
+#ifndef __UM_MALLOC_H__
+#define __UM_MALLOC_H__
+
+extern void *um_kmalloc(int size);
+extern void *um_kmalloc_atomic(int size);
+extern void kfree(const void *ptr);
+
+extern void *um_vmalloc(int size);
+extern void *um_vmalloc_atomic(int size);
+extern void vfree(void *ptr);
+
+#endif /* __UM_MALLOC_H__ */
index 39f8c8801076351de6b0c2cfc3d7b070a2c7dba4..acadce3f271f05d2833790c82922140b539d4dc4 100644 (file)
@@ -11,17 +11,11 @@ extern void panic(const char *fmt, ...)
 extern int printk(const char *fmt, ...)
        __attribute__ ((format (printf, 1, 2)));
 extern void schedule(void);
-extern void *um_kmalloc(int size);
-extern void *um_kmalloc_atomic(int size);
-extern void kfree(void *ptr);
 extern int in_aton(char *str);
 extern int open_gdb_chan(void);
 /* These use size_t, however unsigned long is correct on both i386 and x86_64. */
 extern unsigned long strlcpy(char *, const char *, unsigned long);
 extern unsigned long strlcat(char *, const char *, unsigned long);
-extern void *um_vmalloc(int size);
-extern void *um_vmalloc_atomic(int size);
-extern void vfree(void *ptr);
 
 #endif
 
index 802d7842514d25ad63b5be204a573363a6992b60..06625fefef3387b2aac94471361cf59139042b34 100644 (file)
@@ -52,7 +52,6 @@ extern int linux_main(int argc, char **argv);
 extern void set_cmdline(char *cmd);
 extern void input_cb(void (*proc)(void *), void *arg, int arg_len);
 extern int get_pty(void);
-extern void *um_kmalloc(int size);
 extern int switcheroo(int fd, int prot, void *from, void *to, int size);
 extern void do_exec(int old_pid, int new_pid);
 extern void tracer_panic(char *msg, ...)
index ef259569fd8c003cc0c5c671eaab7af536805d90..5c1e611f628d548fed1716c75d5537c39d6b8cc4 100644 (file)
@@ -31,6 +31,7 @@
 #include "irq_kern.h"
 #include "os.h"
 #include "sigio.h"
+#include "um_malloc.h"
 #include "misc_constants.h"
 
 /*
index fe6c64abda5b029d3f3b1c2a2b891471cf52f3c2..348b272bb766a5305f54ba3d35874b5b3caa45e6 100644 (file)
@@ -46,6 +46,7 @@
 #include "mode.h"
 #include "mode_kern.h"
 #include "choose-mode.h"
+#include "um_malloc.h"
 
 /* This is a per-cpu array.  A processor only modifies its entry and it only
  * cares about its entry, so it's OK if another processor is modifying its
index f559bdf746e6099bfb7593215ded118626a899df..863981ba14687684ab8bcbae3d7606945468afeb 100644 (file)
@@ -20,6 +20,7 @@
 #include "net_user.h"
 #include "etap.h"
 #include "os.h"
+#include "um_malloc.h"
 
 #define MAX_PACKET ETH_MAX_PACKET
 
index cd15b9df5b5c1a195eae1f34439a0d4004636786..d13299cfa31878e6b725e3ad86d5ac9fdd50922d 100644 (file)
@@ -35,22 +35,23 @@ static int helper_child(void *arg)
        char **argv = data->argv;
        int errval;
 
-       if(helper_pause){
+       if (helper_pause){
                signal(SIGHUP, helper_hup);
                pause();
        }
-       if(data->pre_exec != NULL)
+       if (data->pre_exec != NULL)
                (*data->pre_exec)(data->pre_data);
        execvp(argv[0], argv);
        errval = -errno;
        printk("helper_child - execve of '%s' failed - errno = %d\n", argv[0], errno);
        os_write_file(data->fd, &errval, sizeof(errval));
        kill(os_getpid(), SIGKILL);
-       return(0);
+       return 0;
 }
 
 /* Returns either the pid of the child process we run or -E* on failure.
- * XXX The alloc_stack here breaks if this is called in the tracing thread */
+ * XXX The alloc_stack here breaks if this is called in the tracing thread, so
+ * we need to receive a preallocated stack (a local buffer is ok). */
 int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv,
               unsigned long *stack_out)
 {
@@ -58,20 +59,21 @@ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv,
        unsigned long stack, sp;
        int pid, fds[2], ret, n;
 
-       if((stack_out != NULL) && (*stack_out != 0))
+       if ((stack_out != NULL) && (*stack_out != 0))
                stack = *stack_out;
-       else stack = alloc_stack(0, __cant_sleep());
-       if(stack == 0)
+       else
+               stack = alloc_stack(0, __cant_sleep());
+       if (stack == 0)
                return -ENOMEM;
 
        ret = os_pipe(fds, 1, 0);
-       if(ret < 0){
+       if (ret < 0) {
                printk("run_helper : pipe failed, ret = %d\n", -ret);
                goto out_free;
        }
 
        ret = os_set_exec_close(fds[1], 1);
-       if(ret < 0){
+       if (ret < 0) {
                printk("run_helper : setting FD_CLOEXEC failed, ret = %d\n",
                       -ret);
                goto out_close;
@@ -83,7 +85,7 @@ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv,
        data.argv = argv;
        data.fd = fds[1];
        pid = clone(helper_child, (void *) sp, CLONE_VM | SIGCHLD, &data);
-       if(pid < 0){
+       if (pid < 0) {
                ret = -errno;
                printk("run_helper : clone failed, errno = %d\n", errno);
                goto out_close;
@@ -95,10 +97,10 @@ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv,
        /* Read the errno value from the child, if the exec failed, or get 0 if
         * the exec succeeded because the pipe fd was set as close-on-exec. */
        n = os_read_file(fds[0], &ret, sizeof(ret));
-       if(n == 0)
+       if (n == 0) {
                ret = pid;
-       else {
-               if(n < 0){
+       else {
+               if (n < 0) {
                        printk("run_helper : read on pipe failed, ret = %d\n",
                               -n);
                        ret = n;
@@ -112,10 +114,9 @@ out_close:
                close(fds[1]);
        close(fds[0]);
 out_free:
-       if(stack_out == NULL)
+       if ((stack_out == NULL) || (*stack_out == 0))
                free_stack(stack, 0);
-       else *stack_out = stack;
-       return(ret);
+       return ret;
 }
 
 int run_helper_thread(int (*proc)(void *), void *arg, unsigned int flags,
@@ -125,31 +126,32 @@ int run_helper_thread(int (*proc)(void *), void *arg, unsigned int flags,
        int pid, status, err;
 
        stack = alloc_stack(stack_order, __cant_sleep());
-       if(stack == 0) return(-ENOMEM);
+       if (stack == 0)
+               return -ENOMEM;
 
        sp = stack + (page_size() << stack_order) - sizeof(void *);
        pid = clone(proc, (void *) sp, flags | SIGCHLD, arg);
-       if(pid < 0){
+       if (pid < 0) {
                err = -errno;
                printk("run_helper_thread : clone failed, errno = %d\n",
                       errno);
                return err;
        }
-       if(stack_out == NULL){
+       if (stack_out == NULL) {
                CATCH_EINTR(pid = waitpid(pid, &status, 0));
-               if(pid < 0){
+               if (pid < 0) {
                        err = -errno;
                        printk("run_helper_thread - wait failed, errno = %d\n",
                               errno);
                        pid = err;
                }
-               if(!WIFEXITED(status) || (WEXITSTATUS(status) != 0))
+               if (!WIFEXITED(status) || (WEXITSTATUS(status) != 0))
                        printk("run_helper_thread - thread returned status "
                               "0x%x\n", status);
                free_stack(stack, stack_order);
-       }
-       else *stack_out = stack;
-       return(pid);
+       } else
+               *stack_out = stack;
+       return pid;
 }
 
 int helper_wait(int pid)
@@ -157,9 +159,9 @@ int helper_wait(int pid)
        int ret;
 
        CATCH_EINTR(ret = waitpid(pid, NULL, WNOHANG));
-       if(ret < 0){
+       if (ret < 0) {
                ret = -errno;
                printk("helper_wait : waitpid failed, errno = %d\n", errno);
        }
-       return(ret);
+       return ret;
 }
index a97206df5b52068ffe20b3b0979653c4e384d28b..d46b818c1311258934679b82fdd0685afeaecbca 100644 (file)
@@ -18,6 +18,7 @@
 #include "sigio.h"
 #include "irq_user.h"
 #include "os.h"
+#include "um_malloc.h"
 
 static struct pollfd *pollfds = NULL;
 static int pollfds_num = 0;
index d1c5670787dca8edb9ad9b6aede68e22c6e24cd4..685feaab65d239efa4931af9838e63b54f62d702 100644 (file)
@@ -23,6 +23,7 @@
 #include "choose-mode.h"
 #include "uml-config.h"
 #include "os.h"
+#include "um_malloc.h"
 
 /* Set in set_stklim, which is called from main and __wrap_malloc.
  * __wrap_malloc only calls it if main hasn't started.
index f6457765b17db86c7b03c3879e11e8f1da16934b..925a65240cfec96c0f6c424e6009bf24a2012f90 100644 (file)
@@ -19,6 +19,7 @@
 #include "user_util.h"
 #include "sigio.h"
 #include "os.h"
+#include "um_malloc.h"
 
 /* Protected by sigio_lock(), also used by sigio_cleanup, which is an
  * exitcall.
index 38be096e750f0ec98d4887275f9f48abc274be3b..2115b8beb54167ffe9c522a5fbe6727b1e547137 100644 (file)
@@ -16,6 +16,7 @@
 #include "process.h"
 #include "kern_constants.h"
 #include "os.h"
+#include "uml-config.h"
 
 int set_interval(int is_virtual)
 {
@@ -30,7 +31,7 @@ int set_interval(int is_virtual)
        return 0;
 }
 
-#ifdef CONFIG_MODE_TT
+#ifdef UML_CONFIG_MODE_TT
 void enable_timer(void)
 {
        set_interval(1);
index 1c967026c957dd08e4b81406a82712b60ada8ee6..652fa34c2cd3d3f0a3f7a8074cfb4ca890e56488 100644 (file)
@@ -5,7 +5,6 @@
 
 #include <stddef.h>
 #include <signal.h>
-#include <linux/compiler.h>
 #include <asm/unistd.h>
 #include "uml-config.h"
 #include "sysdep/sigcontext.h"
index 1c0f18d4f887a574734df7b6302ef8c362b8533d..13972148058dac9cae6c7e2829bf4c5b73b78bd9 100644 (file)
@@ -54,6 +54,10 @@ endif
 cflags-y += $(call cc-option,-funit-at-a-time)
 # prevent gcc from generating any FP code by mistake
 cflags-y += $(call cc-option,-mno-sse -mno-mmx -mno-sse2 -mno-3dnow,)
+# this works around some issues with generating unwind tables in older gccs
+# newer gccs do it by default
+cflags-y += -maccumulate-outgoing-args
+
 # do binutils support CFI?
 cflags-y += $(call as-instr,.cfi_startproc\n.cfi_endproc,-DCONFIG_AS_CFI=1,)
 AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_endproc,-DCONFIG_AS_CFI=1,)
index 47bfba6e9dc4d3d93ce8110d2eb13bf8b984eecb..0f5d44e86be56d8b3f61a2f204d24a720b6ef92d 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.19-rc1
-# Thu Oct  5 13:04:43 2006
+# Linux kernel version: 2.6.19-rc2-git4
+# Sat Oct 21 03:38:52 2006
 #
 CONFIG_X86_64=y
 CONFIG_64BIT=y
@@ -335,8 +335,8 @@ CONFIG_IPV6=y
 # CONFIG_INET6_XFRM_MODE_TUNNEL is not set
 # CONFIG_INET6_XFRM_MODE_BEET is not set
 # CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
+CONFIG_IPV6_SIT=y
 # CONFIG_IPV6_TUNNEL is not set
-# CONFIG_IPV6_SUBTREES is not set
 # CONFIG_IPV6_MULTIPLE_TABLES is not set
 # CONFIG_NETWORK_SECMARK is not set
 # CONFIG_NETFILTER is not set
@@ -437,6 +437,13 @@ CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
 
+#
+# Misc devices
+#
+# CONFIG_IBM_ASM is not set
+# CONFIG_SGI_IOC4 is not set
+# CONFIG_TIFM_CORE is not set
+
 #
 # ATA/ATAPI/MFM/RLL support
 #
@@ -1008,6 +1015,7 @@ CONFIG_I2C_ISA=m
 #
 # Dallas's 1-wire bus
 #
+# CONFIG_W1 is not set
 
 #
 # Hardware Monitoring support
@@ -1058,12 +1066,6 @@ CONFIG_SENSORS_SMSC47B397=m
 # CONFIG_SENSORS_HDAPS is not set
 # CONFIG_HWMON_DEBUG_CHIP is not set
 
-#
-# Misc devices
-#
-# CONFIG_IBM_ASM is not set
-# CONFIG_TIFM_CORE is not set
-
 #
 # Multimedia devices
 #
@@ -1196,7 +1198,6 @@ CONFIG_USB_HIDINPUT=y
 # CONFIG_USB_ATI_REMOTE2 is not set
 # CONFIG_USB_KEYSPAN_REMOTE is not set
 # CONFIG_USB_APPLETOUCH is not set
-# CONFIG_USB_TRANCEVIBRATOR is not set
 
 #
 # USB Imaging devices
@@ -1242,6 +1243,7 @@ CONFIG_USB_MON=y
 # CONFIG_USB_APPLEDISPLAY is not set
 # CONFIG_USB_SISUSBVGA is not set
 # CONFIG_USB_LD is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
 # CONFIG_USB_TEST is not set
 
 #
@@ -1318,6 +1320,7 @@ CONFIG_EXT3_FS=y
 CONFIG_EXT3_FS_XATTR=y
 CONFIG_EXT3_FS_POSIX_ACL=y
 # CONFIG_EXT3_FS_SECURITY is not set
+# CONFIG_EXT4DEV_FS is not set
 CONFIG_JBD=y
 # CONFIG_JBD_DEBUG is not set
 CONFIG_FS_MBCACHE=y
@@ -1341,6 +1344,7 @@ CONFIG_DNOTIFY=y
 # CONFIG_AUTOFS_FS is not set
 CONFIG_AUTOFS4_FS=y
 # CONFIG_FUSE_FS is not set
+CONFIG_GENERIC_ACL=y
 
 #
 # CD-ROM/DVD Filesystems
@@ -1418,7 +1422,6 @@ CONFIG_SUNRPC=y
 # CONFIG_CODA_FS is not set
 # CONFIG_AFS_FS is not set
 # CONFIG_9P_FS is not set
-CONFIG_GENERIC_ACL=y
 
 #
 # Partition Types
@@ -1470,10 +1473,6 @@ CONFIG_NLS_ISO8859_15=y
 # CONFIG_NLS_KOI8_U is not set
 CONFIG_NLS_UTF8=y
 
-#
-# Distributed Lock Manager
-#
-
 #
 # Instrumentation Support
 #
@@ -1512,6 +1511,7 @@ CONFIG_DEBUG_FS=y
 CONFIG_UNWIND_INFO=y
 CONFIG_STACK_UNWIND=y
 # CONFIG_FORCED_INLINING is not set
+# CONFIG_HEADERS_CHECK is not set
 # CONFIG_RCU_TORTURE_TEST is not set
 # CONFIG_LKDTM is not set
 # CONFIG_DEBUG_RODATA is not set
index b3f0908668ece23c11fc4d42675f011aab808821..a75c829c2b02b16bf23ea495a326d0307cd9685b 100644 (file)
@@ -54,13 +54,13 @@ static inline int bad_addr(unsigned long *addrp, unsigned long size)
 
        /* various gunk below that needed for SMP startup */
        if (addr < 0x8000) { 
-               *addrp = 0x8000;
+               *addrp = PAGE_ALIGN(0x8000);
                return 1; 
        }
 
        /* direct mapping tables of the kernel */
        if (last >= table_start<<PAGE_SHIFT && addr < table_end<<PAGE_SHIFT) { 
-               *addrp = table_end << PAGE_SHIFT; 
+               *addrp = PAGE_ALIGN(table_end << PAGE_SHIFT);
                return 1;
        } 
 
@@ -68,18 +68,18 @@ static inline int bad_addr(unsigned long *addrp, unsigned long size)
 #ifdef CONFIG_BLK_DEV_INITRD
        if (LOADER_TYPE && INITRD_START && last >= INITRD_START && 
            addr < INITRD_START+INITRD_SIZE) { 
-               *addrp = INITRD_START + INITRD_SIZE; 
+               *addrp = PAGE_ALIGN(INITRD_START + INITRD_SIZE);
                return 1;
        } 
 #endif
        /* kernel code */
-       if (last >= __pa_symbol(&_text) && last < __pa_symbol(&_end)) {
-               *addrp = __pa_symbol(&_end);
+       if (last >= __pa_symbol(&_text) && addr < __pa_symbol(&_end)) {
+               *addrp = PAGE_ALIGN(__pa_symbol(&_end));
                return 1;
        }
 
        if (last >= ebda_addr && addr < ebda_addr + ebda_size) {
-               *addrp = ebda_addr + ebda_size;
+               *addrp = PAGE_ALIGN(ebda_addr + ebda_size);
                return 1;
        }
 
@@ -152,7 +152,7 @@ unsigned long __init find_e820_area(unsigned long start, unsigned long end, unsi
                        continue; 
                while (bad_addr(&addr, size) && addr+size <= ei->addr+ei->size)
                        ;
-               last = addr + size;
+               last = PAGE_ALIGN(addr) + size;
                if (last > ei->addr + ei->size)
                        continue;
                if (last > end) 
index 208e38a372c107f0704dd16e77f56437c404f1e4..2b1245d8625849de6033eda814ed72b860faf232 100644 (file)
@@ -61,10 +61,11 @@ static void nvidia_bugs(void)
 
 static void ati_bugs(void)
 {
-#if 1 /* for testing */
-       printk("ATI board detected\n");
-#endif
-       /* No bugs right now */
+       if (timer_over_8254 == 1) {
+               timer_over_8254 = 0;
+               printk(KERN_INFO
+               "ATI board detected. Disabling timer routing over 8254.\n");
+       }
 }
 
 struct chipset {
index 38a7b2d528e2e537b78d13bc83e36dbb25f79c10..7d401b00d8227dbd6182524259a402822a903db6 100644 (file)
@@ -315,6 +315,8 @@ tracesys:
        LOAD_ARGS ARGOFFSET  /* reload args from stack in case ptrace changed it */
        RESTORE_REST
        cmpq $__NR_syscall_max,%rax
+       movq $-ENOSYS,%rcx
+       cmova %rcx,%rax
        ja  1f
        movq %r10,%rcx  /* fixup for C */
        call *sys_call_table(,%rax,8)
@@ -535,8 +537,6 @@ END(stub_rt_sigreturn)
 1:     incl    %gs:pda_irqcount
        cmoveq %gs:pda_irqstackptr,%rsp
        push    %rbp                    # backlink for old unwinder
-       CFI_ADJUST_CFA_OFFSET 8
-       CFI_REL_OFFSET rbp,0
        /*
         * We entered an interrupt context - irqs are off:
         */
@@ -980,11 +980,6 @@ ENTRY(kernel_thread)
        call do_fork
        movq %rax,RAX(%rsp)
        xorl %edi,%edi
-       test %rax,%rax
-       jnz  1f
-       /* terminate stack in child */
-       movq %rdi,RIP(%rsp)
-1:
 
        /*
         * It isn't worth to check for reschedule here,
@@ -1176,7 +1171,6 @@ ENTRY(call_softirq)
        incl %gs:pda_irqcount
        cmove %gs:pda_irqstackptr,%rsp
        push  %rbp                      # backlink for old unwinder
-       CFI_ADJUST_CFA_OFFSET    8
        call __do_softirq
        leaveq
        CFI_DEF_CFA_REGISTER    rsp
index 0dfc223c1839c9bbd58473f108b63f517177d2a4..7c01db8fa9d122eaf2adcff1e0927ec98a2e17e3 100644 (file)
@@ -153,7 +153,7 @@ struct genapic apic_flat =  {
 
 static cpumask_t physflat_target_cpus(void)
 {
-       return cpumask_of_cpu(0);
+       return cpu_online_map;
 }
 
 static cpumask_t physflat_vector_allocation_domain(int cpu)
index 0612a33bb896bb818001d3229c6af6652332c1df..c4ef801b765b8004033c83d2f6b1ac94b822fb9f 100644 (file)
@@ -178,7 +178,8 @@ void make_8259A_irq(unsigned int irq)
 {
        disable_irq_nosync(irq);
        io_apic_irqs &= ~(1<<irq);
-       set_irq_chip_and_handler(irq, &i8259A_chip, handle_level_irq);
+       set_irq_chip_and_handler_name(irq, &i8259A_chip, handle_level_irq,
+                                     "XT");
        enable_irq(irq);
 }
 
@@ -431,8 +432,8 @@ void __init init_ISA_irqs (void)
                        /*
                         * 16 old-style INTA-cycle interrupts:
                         */
-                       set_irq_chip_and_handler(i, &i8259A_chip,
-                                                handle_level_irq);
+                       set_irq_chip_and_handler_name(i, &i8259A_chip,
+                                                     handle_level_irq, "XT");
                } else {
                        /*
                         * 'high' PCI IRQs filled in on demand
index 44b55f8338750c9b610983c12b3bcce6fa3f013b..b000017e4b5da80f336588e321982217599cf848 100644 (file)
@@ -57,7 +57,7 @@ static int no_timer_check;
 
 static int disable_timer_pin_1 __initdata;
 
-int timer_over_8254 __initdata = 0;
+int timer_over_8254 __initdata = 1;
 
 /* Where if anywhere is the i8259 connect in external int mode */
 static struct { int pin, apic; } ioapic_i8259 = { -1, -1 };
@@ -651,12 +651,12 @@ next:
                if (vector == IA32_SYSCALL_VECTOR)
                        goto next;
                for_each_cpu_mask(new_cpu, domain)
-                       if (per_cpu(vector_irq, cpu)[vector] != -1)
+                       if (per_cpu(vector_irq, new_cpu)[vector] != -1)
                                goto next;
                /* Found one! */
                for_each_cpu_mask(new_cpu, domain) {
-                       pos[cpu].vector = vector;
-                       pos[cpu].offset = offset;
+                       pos[new_cpu].vector = vector;
+                       pos[new_cpu].offset = offset;
                }
                if (old_vector >= 0) {
                        int old_cpu;
@@ -696,11 +696,11 @@ static void ioapic_register_intr(int irq, int vector, unsigned long trigger)
 {
        if ((trigger == IOAPIC_AUTO && IO_APIC_irq_trigger(irq)) ||
                        trigger == IOAPIC_LEVEL)
-               set_irq_chip_and_handler(irq, &ioapic_chip,
-                                        handle_fasteoi_irq);
+               set_irq_chip_and_handler_name(irq, &ioapic_chip,
+                                             handle_fasteoi_irq, "fasteoi");
        else
-               set_irq_chip_and_handler(irq, &ioapic_chip,
-                                        handle_edge_irq);
+               set_irq_chip_and_handler_name(irq, &ioapic_chip,
+                                             handle_edge_irq, "edge");
 }
 
 static void __init setup_IO_APIC_irqs(void)
@@ -806,7 +806,7 @@ static void __init setup_ExtINT_IRQ0_pin(unsigned int apic, unsigned int pin, in
         * The timer IRQ doesn't have to know that behind the
         * scene we have a 8259A-master in AEOI mode ...
         */
-       set_irq_chip_and_handler(0, &ioapic_chip, handle_edge_irq);
+       set_irq_chip_and_handler_name(0, &ioapic_chip, handle_edge_irq, "edge");
 
        /*
         * Add it to the IO-APIC irq-routing table:
@@ -1255,12 +1255,15 @@ static int ioapic_retrigger_irq(unsigned int irq)
 {
        cpumask_t mask;
        unsigned vector;
+       unsigned long flags;
 
+       spin_lock_irqsave(&vector_lock, flags);
        vector = irq_vector[irq];
        cpus_clear(mask);
-       cpu_set(vector >> 8, mask);
+       cpu_set(first_cpu(irq_domain[irq]), mask);
 
-       send_IPI_mask(mask, vector & 0xff);
+       send_IPI_mask(mask, vector);
+       spin_unlock_irqrestore(&vector_lock, flags);
 
        return 1;
 }
@@ -1839,7 +1842,7 @@ int arch_setup_msi_irq(unsigned int irq, struct pci_dev *dev)
 
        write_msi_msg(irq, &msg);
 
-       set_irq_chip_and_handler(irq, &msi_chip, handle_edge_irq);
+       set_irq_chip_and_handler_name(irq, &msi_chip, handle_edge_irq, "edge");
 
        return 0;
 }
@@ -1936,7 +1939,8 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev)
                write_ht_irq_low(irq, low);
                write_ht_irq_high(irq, high);
 
-               set_irq_chip_and_handler(irq, &ht_irq_chip, handle_edge_irq);
+               set_irq_chip_and_handler_name(irq, &ht_irq_chip,
+                                             handle_edge_irq, "edge");
        }
        return vector;
 }
index dff68eb2b7878dae6279338035d72d2ec61e4884..e46c55856d40ae6fb85daf785ca438dccba1b042 100644 (file)
@@ -75,7 +75,7 @@ int show_interrupts(struct seq_file *p, void *v)
                        seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
 #endif
                seq_printf(p, " %8s", irq_desc[i].chip->name);
-               seq_printf(p, "-%s", handle_irq_name(irq_desc[i].handle_irq));
+               seq_printf(p, "-%-8s", irq_desc[i].name);
 
                seq_printf(p, "  %s", action->name);
                for (action=action->next; action; action = action->next)
index b3296cc2f2f2fd3b7ea84bb17abfec30ee877625..37a770859e7180ae38e06c22d6064fbe1a4ebeab 100644 (file)
@@ -52,7 +52,8 @@
 #define ONE_BASED_CHASSIS_NUM   1
 
 /* register offsets inside the host bridge space */
-#define PHB_CSR_OFFSET         0x0110
+#define CALGARY_CONFIG_REG     0x0108
+#define PHB_CSR_OFFSET         0x0110 /* Channel Status */
 #define PHB_PLSSR_OFFSET       0x0120
 #define PHB_CONFIG_RW_OFFSET   0x0160
 #define PHB_IOBASE_BAR_LOW     0x0170
@@ -83,6 +84,8 @@
 #define TAR_VALID              0x0000000000000008UL
 /* CSR (Channel/DMA Status Register) */
 #define CSR_AGENT_MASK         0xffe0ffff
+/* CCR (Calgary Configuration Register) */
+#define CCR_2SEC_TIMEOUT        0x000000000000000EUL
 
 #define MAX_NUM_OF_PHBS                8 /* how many PHBs in total? */
 #define MAX_NUM_CHASSIS                8 /* max number of chassis */
@@ -732,6 +735,38 @@ static void calgary_watchdog(unsigned long data)
        }
 }
 
+static void __init calgary_increase_split_completion_timeout(void __iomem *bbar,
+       unsigned char busnum)
+{
+       u64 val64;
+       void __iomem *target;
+       unsigned long phb_shift = -1;
+       u64 mask;
+
+       switch (busno_to_phbid(busnum)) {
+       case 0: phb_shift = (63 - 19);
+               break;
+       case 1: phb_shift = (63 - 23);
+               break;
+       case 2: phb_shift = (63 - 27);
+               break;
+       case 3: phb_shift = (63 - 35);
+               break;
+       default:
+               BUG_ON(busno_to_phbid(busnum));
+       }
+
+       target = calgary_reg(bbar, CALGARY_CONFIG_REG);
+       val64 = be64_to_cpu(readq(target));
+
+       /* zero out this PHB's timer bits */
+       mask = ~(0xFUL << phb_shift);
+       val64 &= mask;
+       val64 |= (CCR_2SEC_TIMEOUT << phb_shift);
+       writeq(cpu_to_be64(val64), target);
+       readq(target); /* flush */
+}
+
 static void __init calgary_enable_translation(struct pci_dev *dev)
 {
        u32 val32;
@@ -756,6 +791,13 @@ static void __init calgary_enable_translation(struct pci_dev *dev)
        writel(cpu_to_be32(val32), target);
        readl(target); /* flush */
 
+       /*
+        * Give split completion a longer timeout on bus 1 for aic94xx
+        * http://bugzilla.kernel.org/show_bug.cgi?id=7180
+        */
+       if (busnum == 1)
+               calgary_increase_split_completion_timeout(bbar, busnum);
+
        init_timer(&tbl->watchdog_timer);
        tbl->watchdog_timer.function = &calgary_watchdog;
        tbl->watchdog_timer.data = (unsigned long)dev;
index 5e95b257ee26208612b8f28229612e8ce6796660..49f7fac6229e5f4e920d58fcdec1fd5e49e8667b 100644 (file)
@@ -238,20 +238,28 @@ void cpu_idle (void)
  * We execute MONITOR against need_resched and enter optimized wait state
  * through MWAIT. Whenever someone changes need_resched, we would be woken
  * up from MWAIT (without an IPI).
+ *
+ * New with Core Duo processors, MWAIT can take some hints based on CPU
+ * capability.
  */
-static void mwait_idle(void)
+void mwait_idle_with_hints(unsigned long eax, unsigned long ecx)
 {
-       local_irq_enable();
-
-       while (!need_resched()) {
+       if (!need_resched()) {
                __monitor((void *)&current_thread_info()->flags, 0, 0);
                smp_mb();
-               if (need_resched())
-                       break;
-               __mwait(0, 0);
+               if (!need_resched())
+                       __mwait(eax, ecx);
        }
 }
 
+/* Default MONITOR/MWAIT with no hints, used for default C1 state */
+static void mwait_idle(void)
+{
+       local_irq_enable();
+       while (!need_resched())
+               mwait_idle_with_hints(0,0);
+}
+
 void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c)
 {
        static int printed;
index 1ba5a442ac323a9dc121fabbe92c46527fcb2745..88722f11ca132595cf11704e8e65cdb47e2790f9 100644 (file)
@@ -948,7 +948,7 @@ __cpuinit int unsynchronized_tsc(void)
        if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) {
 #ifdef CONFIG_ACPI
                /* But TSC doesn't tick in C3 so don't use it there */
-               if (acpi_fadt.length > 0 && acpi_fadt.plvl3_lat < 100)
+               if (acpi_fadt.length > 0 && acpi_fadt.plvl3_lat < 1000)
                        return 1;
 #endif
                return 0;
index b9df2ab6529fc8286b00f41d2081d393bbb2b444..1283614c9b247674ee75fd865744c9a95d902379 100644 (file)
@@ -17,6 +17,7 @@ PHDRS {
        text PT_LOAD FLAGS(5);  /* R_E */
        data PT_LOAD FLAGS(7);  /* RWE */
        user PT_LOAD FLAGS(7);  /* RWE */
+       data.init PT_LOAD FLAGS(7);     /* RWE */
        note PT_NOTE FLAGS(4);  /* R__ */
 }
 SECTIONS
@@ -131,7 +132,7 @@ SECTIONS
   . = ALIGN(8192);             /* init_task */
   .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {
        *(.data.init_task)
-  } :data
+  }:data.init
 
   . = ALIGN(4096);
   .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
index 3cc0544e25f5a8569af1a727c3f819b252fe3635..1087e150a21896d1abfaadfccfe7fc4de98728ef 100644 (file)
@@ -207,7 +207,7 @@ static inline int save_add_info(void)
        return hotadd_percent > 0;
 }
 #else
-int update_end_of_memory(unsigned long end) {return 0;}
+int update_end_of_memory(unsigned long end) {return -1;}
 static int hotadd_enough_memory(struct bootnode *nd) {return 1;}
 #ifdef CONFIG_MEMORY_HOTPLUG_SPARSE
 static inline int save_add_info(void) {return 1;}
@@ -337,7 +337,7 @@ acpi_numa_memory_affinity_init(struct acpi_table_memory_affinity *ma)
        push_node_boundaries(node, nd->start >> PAGE_SHIFT,
                                                nd->end >> PAGE_SHIFT);
 
-       if (ma->flags.hot_pluggable && !reserve_hotadd(node, start, end) < 0) {
+       if (ma->flags.hot_pluggable && (reserve_hotadd(node, start, end) < 0)) {
                /* Ignore hotadd region. Undo damage */
                printk(KERN_NOTICE "SRAT: Hotplug region ignored\n");
                *nd = oldnode;
index 1eb18f421edff11924187e8242781bd68116a168..149aba05a5b8e70c6abb22dd17e21b1f1994adf4 100644 (file)
@@ -3,7 +3,7 @@
 #
 # Reuse the i386 PCI subsystem
 #
-CFLAGS += -Iarch/i386/pci
+EXTRA_CFLAGS += -Iarch/i386/pci
 
 obj-y          := i386.o
 obj-$(CONFIG_PCI_DIRECT)+= direct.o
index c847e17e5caa3dbf894631c321b3608c2417ca40..136066583c6810b6520c9a090f428427819d44c2 100644 (file)
@@ -56,11 +56,6 @@ static kmem_cache_t *requestq_cachep;
  */
 static kmem_cache_t *iocontext_cachep;
 
-static wait_queue_head_t congestion_wqh[2] = {
-               __WAIT_QUEUE_HEAD_INITIALIZER(congestion_wqh[0]),
-               __WAIT_QUEUE_HEAD_INITIALIZER(congestion_wqh[1])
-       };
-
 /*
  * Controlling structure to kblockd
  */
@@ -112,35 +107,6 @@ static void blk_queue_congestion_threshold(struct request_queue *q)
        q->nr_congestion_off = nr;
 }
 
-/*
- * A queue has just exitted congestion.  Note this in the global counter of
- * congested queues, and wake up anyone who was waiting for requests to be
- * put back.
- */
-static void clear_queue_congested(request_queue_t *q, int rw)
-{
-       enum bdi_state bit;
-       wait_queue_head_t *wqh = &congestion_wqh[rw];
-
-       bit = (rw == WRITE) ? BDI_write_congested : BDI_read_congested;
-       clear_bit(bit, &q->backing_dev_info.state);
-       smp_mb__after_clear_bit();
-       if (waitqueue_active(wqh))
-               wake_up(wqh);
-}
-
-/*
- * A queue has just entered congestion.  Flag that in the queue's VM-visible
- * state flags and increment the global gounter of congested queues.
- */
-static void set_queue_congested(request_queue_t *q, int rw)
-{
-       enum bdi_state bit;
-
-       bit = (rw == WRITE) ? BDI_write_congested : BDI_read_congested;
-       set_bit(bit, &q->backing_dev_info.state);
-}
-
 /**
  * blk_get_backing_dev_info - get the address of a queue's backing_dev_info
  * @bdev:      device
@@ -159,7 +125,6 @@ struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev)
                ret = &q->backing_dev_info;
        return ret;
 }
-
 EXPORT_SYMBOL(blk_get_backing_dev_info);
 
 void blk_queue_activity_fn(request_queue_t *q, activity_fn *fn, void *data)
@@ -167,7 +132,6 @@ void blk_queue_activity_fn(request_queue_t *q, activity_fn *fn, void *data)
        q->activity_fn = fn;
        q->activity_data = data;
 }
-
 EXPORT_SYMBOL(blk_queue_activity_fn);
 
 /**
@@ -2067,7 +2031,7 @@ static void __freed_request(request_queue_t *q, int rw)
        struct request_list *rl = &q->rq;
 
        if (rl->count[rw] < queue_congestion_off_threshold(q))
-               clear_queue_congested(q, rw);
+               blk_clear_queue_congested(q, rw);
 
        if (rl->count[rw] + 1 <= q->nr_requests) {
                if (waitqueue_active(&rl->wait[rw]))
@@ -2137,7 +2101,7 @@ static struct request *get_request(request_queue_t *q, int rw, struct bio *bio,
                                }
                        }
                }
-               set_queue_congested(q, rw);
+               blk_set_queue_congested(q, rw);
        }
 
        /*
@@ -2755,41 +2719,6 @@ void blk_end_sync_rq(struct request *rq, int error)
 }
 EXPORT_SYMBOL(blk_end_sync_rq);
 
-/**
- * blk_congestion_wait - wait for a queue to become uncongested
- * @rw: READ or WRITE
- * @timeout: timeout in jiffies
- *
- * Waits for up to @timeout jiffies for a queue (any queue) to exit congestion.
- * If no queues are congested then just wait for the next request to be
- * returned.
- */
-long blk_congestion_wait(int rw, long timeout)
-{
-       long ret;
-       DEFINE_WAIT(wait);
-       wait_queue_head_t *wqh = &congestion_wqh[rw];
-
-       prepare_to_wait(wqh, &wait, TASK_UNINTERRUPTIBLE);
-       ret = io_schedule_timeout(timeout);
-       finish_wait(wqh, &wait);
-       return ret;
-}
-
-EXPORT_SYMBOL(blk_congestion_wait);
-
-/**
- * blk_congestion_end - wake up sleepers on a congestion queue
- * @rw: READ or WRITE
- */
-void blk_congestion_end(int rw)
-{
-       wait_queue_head_t *wqh = &congestion_wqh[rw];
-
-       if (waitqueue_active(wqh))
-               wake_up(wqh);
-}
-
 /*
  * Has to be called with the request spinlock acquired
  */
@@ -3765,14 +3694,14 @@ queue_requests_store(struct request_queue *q, const char *page, size_t count)
        blk_queue_congestion_threshold(q);
 
        if (rl->count[READ] >= queue_congestion_on_threshold(q))
-               set_queue_congested(q, READ);
+               blk_set_queue_congested(q, READ);
        else if (rl->count[READ] < queue_congestion_off_threshold(q))
-               clear_queue_congested(q, READ);
+               blk_clear_queue_congested(q, READ);
 
        if (rl->count[WRITE] >= queue_congestion_on_threshold(q))
-               set_queue_congested(q, WRITE);
+               blk_set_queue_congested(q, WRITE);
        else if (rl->count[WRITE] < queue_congestion_off_threshold(q))
-               clear_queue_congested(q, WRITE);
+               blk_clear_queue_congested(q, WRITE);
 
        if (rl->count[READ] >= q->nr_requests) {
                blk_set_queue_full(q, READ);
index 1e2f39c211801adb4a8d80eaa288647cc524ba3d..cbae8392ce11b848e5573194eb8591a175815822 100644 (file)
@@ -27,7 +27,6 @@ config CRYPTO_HASH
 config CRYPTO_MANAGER
        tristate "Cryptographic algorithm manager"
        select CRYPTO_ALGAPI
-       default m
        help
          Create default cryptographic template instantiations such as
          cbc(aes).
@@ -35,6 +34,7 @@ config CRYPTO_MANAGER
 config CRYPTO_HMAC
        tristate "HMAC support"
        select CRYPTO_HASH
+       select CRYPTO_MANAGER
        help
          HMAC: Keyed-Hashing for Message Authentication (RFC2104).
          This is required for IPSec.
@@ -131,6 +131,7 @@ config CRYPTO_TGR192
 config CRYPTO_ECB
        tristate "ECB support"
        select CRYPTO_BLKCIPHER
+       select CRYPTO_MANAGER
        default m
        help
          ECB: Electronic CodeBook mode
@@ -140,6 +141,7 @@ config CRYPTO_ECB
 config CRYPTO_CBC
        tristate "CBC support"
        select CRYPTO_BLKCIPHER
+       select CRYPTO_MANAGER
        default m
        help
          CBC: Cipher Block Chaining mode
index 2e84d4b547902d9e4827ad0f0a26a4d6e5939dbd..4fb7fa45cb0de649194262c5f6061669b3391a80 100644 (file)
@@ -331,7 +331,7 @@ struct crypto_tfm *__crypto_alloc_tfm(struct crypto_alg *alg, u32 flags)
        tfm_size = sizeof(*tfm) + crypto_ctxsize(alg, flags);
        tfm = kzalloc(tfm_size, GFP_KERNEL);
        if (tfm == NULL)
-               goto out;
+               goto out_err;
 
        tfm->__crt_alg = alg;
 
@@ -355,6 +355,7 @@ cra_init_failed:
        crypto_exit_ops(tfm);
 out_free_tfm:
        kfree(tfm);
+out_err:
        tfm = ERR_PTR(err);
 out:
        return tfm;
@@ -414,14 +415,14 @@ struct crypto_tfm *crypto_alloc_base(const char *alg_name, u32 type, u32 mask)
                struct crypto_alg *alg;
 
                alg = crypto_alg_mod_lookup(alg_name, type, mask);
-               err = PTR_ERR(alg);
-               tfm = ERR_PTR(err);
-               if (IS_ERR(alg))
+               if (IS_ERR(alg)) {
+                       err = PTR_ERR(alg);
                        goto err;
+               }
 
                tfm = __crypto_alloc_tfm(alg, 0);
                if (!IS_ERR(tfm))
-                       break;
+                       return tfm;
 
                crypto_mod_put(alg);
                err = PTR_ERR(tfm);
@@ -433,9 +434,9 @@ err:
                        err = -EINTR;
                        break;
                }
-       };
+       }
 
-       return tfm;
+       return ERR_PTR(err);
 }
 EXPORT_SYMBOL_GPL(crypto_alloc_base);
  
index 263e86ddc1a4d0740b3e524ced6703d3a991f3d2..f39463418904f0777e105911edfec32b0331dc7a 100644 (file)
@@ -14,6 +14,10 @@ source "drivers/pnp/Kconfig"
 
 source "drivers/block/Kconfig"
 
+# misc before ide - BLK_DEV_SGIIOC4 depends on SGI_IOC4
+
+source "drivers/misc/Kconfig"
+
 source "drivers/ide/Kconfig"
 
 source "drivers/scsi/Kconfig"
@@ -52,8 +56,6 @@ source "drivers/w1/Kconfig"
 
 source "drivers/hwmon/Kconfig"
 
-source "drivers/misc/Kconfig"
-
 source "drivers/mfd/Kconfig"
 
 source "drivers/media/Kconfig"
index 98099de59b45bcfec5ee8636650c5eb29ee5fbd0..6bcd9e8e7bcb2b081df4262a20489f9fd7ec0779 100644 (file)
@@ -85,6 +85,8 @@ struct acpi_memory_device {
        struct list_head res_list;
 };
 
+static int acpi_hotmem_initialized;
+
 static acpi_status
 acpi_memory_get_resource(struct acpi_resource *resource, void *context)
 {
@@ -414,7 +416,7 @@ static int acpi_memory_device_add(struct acpi_device *device)
        /* Set the device state */
        mem_device->state = MEMORY_POWER_ON_STATE;
 
-       printk(KERN_INFO "%s \n", acpi_device_name(device));
+       printk(KERN_DEBUG "%s \n", acpi_device_name(device));
 
        return result;
 }
@@ -438,6 +440,15 @@ static int acpi_memory_device_start (struct acpi_device *device)
        struct acpi_memory_device *mem_device;
        int result = 0;
 
+       /*
+        * Early boot code has recognized memory area by EFI/E820.
+        * If DSDT shows these memory devices on boot, hotplug is not necessary
+        * for them. So, it just returns until completion of this driver's
+        * start up.
+        */
+       if (!acpi_hotmem_initialized)
+               return 0;
+
        mem_device = acpi_driver_data(device);
 
        if (!acpi_memory_check_device(mem_device)) {
@@ -537,6 +548,7 @@ static int __init acpi_memory_device_init(void)
                return -ENODEV;
        }
 
+       acpi_hotmem_initialized = 1;
        return 0;
 }
 
index e9ee4c52a5f6266a7edc5df20d80aad2647338ea..c7ac9297a20499893da15a4f2c766285310d6f1b 100644 (file)
@@ -138,6 +138,7 @@ struct asus_hotk {
                S2x,            //S200 (J1 reported), Victor MP-XP7210
                W1N,            //W1000N
                W5A,            //W5A
+               W3V,            //W3030V
                xxN,            //M2400N, M3700N, M5200N, M6800N, S1300N, S5200N
                //(Centrino)
                END_MODEL
@@ -376,6 +377,17 @@ static struct model_data model_conf[END_MODEL] = {
         .display_get = "\\ADVG"},
 
        {
+        .name = "W3V",
+        .mt_mled = "MLED",
+        .mt_wled = "WLED",
+        .mt_lcd_switch = xxN_PREFIX "_Q10",
+        .lcd_status = "\\BKLT",
+        .brightness_set = "SPLV",
+        .brightness_get = "GPLV",
+        .display_set = "SDSP",
+        .display_get = "\\INFB"},
+
+       {
         .name = "xxN",
         .mt_mled = "MLED",
 /* WLED present, but not controlled by ACPI */
@@ -555,11 +567,11 @@ static int
 write_led(const char __user * buffer, unsigned long count,
          char *ledname, int ledmask, int invert)
 {
-       int value;
+       int rv, value;
        int led_out = 0;
 
-       count = parse_arg(buffer, count, &value);
-       if (count > 0)
+       rv = parse_arg(buffer, count, &value);
+       if (rv > 0)
                led_out = value ? 1 : 0;
 
        hotk->status =
@@ -572,7 +584,7 @@ write_led(const char __user * buffer, unsigned long count,
                printk(KERN_WARNING "Asus ACPI: LED (%s) write failed\n",
                       ledname);
 
-       return count;
+       return rv;
 }
 
 /*
@@ -607,20 +619,18 @@ static int
 proc_write_ledd(struct file *file, const char __user * buffer,
                unsigned long count, void *data)
 {
-       int value;
+       int rv, value;
 
-       count = parse_arg(buffer, count, &value);
-       if (count > 0) {
+       rv = parse_arg(buffer, count, &value);
+       if (rv > 0) {
                if (!write_acpi_int
                    (hotk->handle, hotk->methods->mt_ledd, value, NULL))
                        printk(KERN_WARNING
                               "Asus ACPI: LED display write failed\n");
                else
                        hotk->ledd_status = (u32) value;
-       } else if (count < 0)
-               printk(KERN_WARNING "Asus ACPI: Error reading user input\n");
-
-       return count;
+       }
+       return rv;
 }
 
 /*
@@ -761,12 +771,12 @@ static int
 proc_write_lcd(struct file *file, const char __user * buffer,
               unsigned long count, void *data)
 {
-       int value;
+       int rv, value;
 
-       count = parse_arg(buffer, count, &value);
-       if (count > 0)
+       rv = parse_arg(buffer, count, &value);
+       if (rv > 0)
                set_lcd_state(value);
-       return count;
+       return rv;
 }
 
 static int read_brightness(void)
@@ -830,18 +840,15 @@ static int
 proc_write_brn(struct file *file, const char __user * buffer,
               unsigned long count, void *data)
 {
-       int value;
+       int rv, value;
 
-       count = parse_arg(buffer, count, &value);
-       if (count > 0) {
+       rv = parse_arg(buffer, count, &value);
+       if (rv > 0) {
                value = (0 < value) ? ((15 < value) ? 15 : value) : 0;
                /* 0 <= value <= 15 */
                set_brightness(value);
-       } else if (count < 0) {
-               printk(KERN_WARNING "Asus ACPI: Error reading user input\n");
        }
-
-       return count;
+       return rv;
 }
 
 static void set_display(int value)
@@ -880,15 +887,12 @@ static int
 proc_write_disp(struct file *file, const char __user * buffer,
                unsigned long count, void *data)
 {
-       int value;
+       int rv, value;
 
-       count = parse_arg(buffer, count, &value);
-       if (count > 0)
+       rv = parse_arg(buffer, count, &value);
+       if (rv > 0)
                set_display(value);
-       else if (count < 0)
-               printk(KERN_WARNING "Asus ACPI: Error reading user input\n");
-
-       return count;
+       return rv;
 }
 
 typedef int (proc_readfunc) (char *page, char **start, off_t off, int count,
@@ -1097,6 +1101,8 @@ static int asus_model_match(char *model)
                return A4G;
        else if (strncmp(model, "W1N", 3) == 0)
                return W1N;
+       else if (strncmp(model, "W3V", 3) == 0)
+               return W3V;
        else if (strncmp(model, "W5A", 3) == 0)
                return W5A;
        else
@@ -1200,9 +1206,10 @@ static int asus_hotk_get_info(void)
                hotk->methods->mt_wled = NULL;
        /* L5D's WLED is not controlled by ACPI */
        else if (strncmp(string, "M2N", 3) == 0 ||
+                strncmp(string, "W3V", 3) == 0 ||
                 strncmp(string, "S1N", 3) == 0)
                hotk->methods->mt_wled = "WLED";
-       /* M2N and S1N have a usable WLED */
+       /* M2N, S1N and W3V have a usable WLED */
        else if (asus_info) {
                if (strncmp(asus_info->oem_table_id, "L1", 2) == 0)
                        hotk->methods->mled_status = NULL;
index 9810e2a55d0adf3fb77758b20b9b670f3e2f5342..026e40755cdd7b0780c4832aade6a9601fb9db83 100644 (file)
@@ -64,6 +64,7 @@ extern void *acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir);
 
 static int acpi_battery_add(struct acpi_device *device);
 static int acpi_battery_remove(struct acpi_device *device, int type);
+static int acpi_battery_resume(struct acpi_device *device, int status);
 
 static struct acpi_driver acpi_battery_driver = {
        .name = ACPI_BATTERY_DRIVER_NAME,
@@ -71,6 +72,7 @@ static struct acpi_driver acpi_battery_driver = {
        .ids = ACPI_BATTERY_HID,
        .ops = {
                .add = acpi_battery_add,
+               .resume = acpi_battery_resume,
                .remove = acpi_battery_remove,
                },
 };
@@ -753,6 +755,18 @@ static int acpi_battery_remove(struct acpi_device *device, int type)
        return 0;
 }
 
+/* this is needed to learn about changes made in suspended state */
+static int acpi_battery_resume(struct acpi_device *device, int state)
+{
+       struct acpi_battery *battery;
+
+       if (!device)
+               return -EINVAL;
+
+       battery = device->driver_data;
+       return acpi_battery_check(battery);
+}
+
 static int __init acpi_battery_init(void)
 {
        int result;
index e5d7963628543edd9eb6d91042d795df11433e19..e6d4b084dca2eeb40213074998ccdfde52278260 100644 (file)
@@ -45,206 +45,143 @@ ACPI_MODULE_NAME("acpi_ec")
 #define ACPI_EC_DRIVER_NAME            "ACPI Embedded Controller Driver"
 #define ACPI_EC_DEVICE_NAME            "Embedded Controller"
 #define ACPI_EC_FILE_INFO              "info"
+
+/* EC status register */
 #define ACPI_EC_FLAG_OBF       0x01    /* Output buffer full */
 #define ACPI_EC_FLAG_IBF       0x02    /* Input buffer full */
 #define ACPI_EC_FLAG_BURST     0x10    /* burst mode */
 #define ACPI_EC_FLAG_SCI       0x20    /* EC-SCI occurred */
-#define ACPI_EC_EVENT_OBF      0x01    /* Output buffer full */
-#define ACPI_EC_EVENT_IBE      0x02    /* Input buffer empty */
-#define ACPI_EC_DELAY          50      /* Wait 50ms max. during EC ops */
-#define ACPI_EC_UDELAY_GLK     1000    /* Wait 1ms max. to get global lock */
-#define ACPI_EC_UDELAY         100     /* Poll @ 100us increments */
-#define ACPI_EC_UDELAY_COUNT   1000    /* Wait 10ms max. during EC ops */
+
+/* EC commands */
 #define ACPI_EC_COMMAND_READ   0x80
 #define ACPI_EC_COMMAND_WRITE  0x81
 #define ACPI_EC_BURST_ENABLE   0x82
 #define ACPI_EC_BURST_DISABLE  0x83
 #define ACPI_EC_COMMAND_QUERY  0x84
-#define EC_POLL                        0xFF
-#define EC_INTR                        0x00
+
+/* EC events */
+enum {
+       ACPI_EC_EVENT_OBF_1 = 1,        /* Output buffer full */
+       ACPI_EC_EVENT_IBF_0,            /* Input buffer empty */
+};
+
+#define ACPI_EC_DELAY          50      /* Wait 50ms max. during EC ops */
+#define ACPI_EC_UDELAY_GLK     1000    /* Wait 1ms max. to get global lock */
+#define ACPI_EC_UDELAY         100     /* Poll @ 100us increments */
+#define ACPI_EC_UDELAY_COUNT   1000    /* Wait 10ms max. during EC ops */
+
+enum {
+       EC_INTR = 1,    /* Output buffer full */
+       EC_POLL,        /* Input buffer empty */
+};
+
 static int acpi_ec_remove(struct acpi_device *device, int type);
 static int acpi_ec_start(struct acpi_device *device);
 static int acpi_ec_stop(struct acpi_device *device, int type);
-static int acpi_ec_intr_add(struct acpi_device *device);
-static int acpi_ec_poll_add(struct acpi_device *device);
+static int acpi_ec_add(struct acpi_device *device);
 
 static struct acpi_driver acpi_ec_driver = {
        .name = ACPI_EC_DRIVER_NAME,
        .class = ACPI_EC_CLASS,
        .ids = ACPI_EC_HID,
        .ops = {
-               .add = acpi_ec_intr_add,
+               .add = acpi_ec_add,
                .remove = acpi_ec_remove,
                .start = acpi_ec_start,
                .stop = acpi_ec_stop,
                },
 };
-union acpi_ec {
-       struct {
-               u32 mode;
-               acpi_handle handle;
-               unsigned long uid;
-               unsigned long gpe_bit;
-               struct acpi_generic_address status_addr;
-               struct acpi_generic_address command_addr;
-               struct acpi_generic_address data_addr;
-               unsigned long global_lock;
-       } common;
-
-       struct {
-               u32 mode;
-               acpi_handle handle;
-               unsigned long uid;
-               unsigned long gpe_bit;
-               struct acpi_generic_address status_addr;
-               struct acpi_generic_address command_addr;
-               struct acpi_generic_address data_addr;
-               unsigned long global_lock;
-               unsigned int expect_event;
-               atomic_t leaving_burst; /* 0 : No, 1 : Yes, 2: abort */
-               atomic_t pending_gpe;
-               struct semaphore sem;
-               wait_queue_head_t wait;
-       } intr;
-
-       struct {
-               u32 mode;
-               acpi_handle handle;
-               unsigned long uid;
-               unsigned long gpe_bit;
-               struct acpi_generic_address status_addr;
-               struct acpi_generic_address command_addr;
-               struct acpi_generic_address data_addr;
-               unsigned long global_lock;
-               struct semaphore sem;
-       } poll;
-};
 
-static int acpi_ec_poll_wait(union acpi_ec *ec, u8 event);
-static int acpi_ec_intr_wait(union acpi_ec *ec, unsigned int event);
-static int acpi_ec_poll_read(union acpi_ec *ec, u8 address, u32 * data);
-static int acpi_ec_intr_read(union acpi_ec *ec, u8 address, u32 * data);
-static int acpi_ec_poll_write(union acpi_ec *ec, u8 address, u8 data);
-static int acpi_ec_intr_write(union acpi_ec *ec, u8 address, u8 data);
-static int acpi_ec_poll_query(union acpi_ec *ec, u32 * data);
-static int acpi_ec_intr_query(union acpi_ec *ec, u32 * data);
-static void acpi_ec_gpe_poll_query(void *ec_cxt);
-static void acpi_ec_gpe_intr_query(void *ec_cxt);
-static u32 acpi_ec_gpe_poll_handler(void *data);
-static u32 acpi_ec_gpe_intr_handler(void *data);
-static acpi_status __init
-acpi_fake_ecdt_poll_callback(acpi_handle handle,
-                               u32 Level, void *context, void **retval);
-
-static acpi_status __init
-acpi_fake_ecdt_intr_callback(acpi_handle handle,
-                             u32 Level, void *context, void **retval);
-
-static int __init acpi_ec_poll_get_real_ecdt(void);
-static int __init acpi_ec_intr_get_real_ecdt(void);
 /* If we find an EC via the ECDT, we need to keep a ptr to its context */
-static union acpi_ec *ec_ecdt;
+struct acpi_ec {
+       acpi_handle handle;
+       unsigned long uid;
+       unsigned long gpe_bit;
+       unsigned long command_addr;
+       unsigned long data_addr;
+       unsigned long global_lock;
+       struct semaphore sem;
+       unsigned int expect_event;
+       atomic_t leaving_burst; /* 0 : No, 1 : Yes, 2: abort */
+       wait_queue_head_t wait;
+} *ec_ecdt;
 
 /* External interfaces use first EC only, so remember */
 static struct acpi_device *first_ec;
-static int acpi_ec_poll_mode = EC_INTR;
+static int acpi_ec_mode = EC_INTR;
 
 /* --------------------------------------------------------------------------
                              Transaction Management
    -------------------------------------------------------------------------- */
 
-static u32 acpi_ec_read_status(union acpi_ec *ec)
+static inline u8 acpi_ec_read_status(struct acpi_ec *ec)
 {
-       u32 status = 0;
-
-       acpi_hw_low_level_read(8, &status, &ec->common.status_addr);
-       return status;
+       return inb(ec->command_addr);
 }
 
-static int acpi_ec_wait(union acpi_ec *ec, u8 event)
+static inline u8 acpi_ec_read_data(struct acpi_ec *ec)
 {
-       if (acpi_ec_poll_mode)
-               return acpi_ec_poll_wait(ec, event);
-       else
-               return acpi_ec_intr_wait(ec, event);
+       return inb(ec->data_addr);
 }
 
-static int acpi_ec_poll_wait(union acpi_ec *ec, u8 event)
+static inline void acpi_ec_write_cmd(struct acpi_ec *ec, u8 command)
 {
-       u32 acpi_ec_status = 0;
-       u32 i = ACPI_EC_UDELAY_COUNT;
+       outb(command, ec->command_addr);
+}
 
-       if (!ec)
-               return -EINVAL;
+static inline void acpi_ec_write_data(struct acpi_ec *ec, u8 data)
+{
+       outb(data, ec->data_addr);
+}
 
-       /* Poll the EC status register waiting for the event to occur. */
+static int acpi_ec_check_status(u8 status, u8 event)
+{
        switch (event) {
-       case ACPI_EC_EVENT_OBF:
-               do {
-                       acpi_hw_low_level_read(8, &acpi_ec_status,
-                                              &ec->common.status_addr);
-                       if (acpi_ec_status & ACPI_EC_FLAG_OBF)
-                               return 0;
-                       udelay(ACPI_EC_UDELAY);
-               } while (--i > 0);
+       case ACPI_EC_EVENT_OBF_1:
+               if (status & ACPI_EC_FLAG_OBF)
+                       return 1;
                break;
-       case ACPI_EC_EVENT_IBE:
-               do {
-                       acpi_hw_low_level_read(8, &acpi_ec_status,
-                                              &ec->common.status_addr);
-                       if (!(acpi_ec_status & ACPI_EC_FLAG_IBF))
-                               return 0;
-                       udelay(ACPI_EC_UDELAY);
-               } while (--i > 0);
+       case ACPI_EC_EVENT_IBF_0:
+               if (!(status & ACPI_EC_FLAG_IBF))
+                       return 1;
                break;
        default:
-               return -EINVAL;
+               break;
        }
 
-       return -ETIME;
+       return 0;
 }
-static int acpi_ec_intr_wait(union acpi_ec *ec, unsigned int event)
-{
-       int result = 0;
-
 
-       ec->intr.expect_event = event;
-       smp_mb();
+static int acpi_ec_wait(struct acpi_ec *ec, u8 event)
+{
+       int i = (acpi_ec_mode == EC_POLL) ? ACPI_EC_UDELAY_COUNT : 0;
+       long time_left;
 
-       switch (event) {
-       case ACPI_EC_EVENT_IBE:
-               if (~acpi_ec_read_status(ec) & ACPI_EC_FLAG_IBF) {
-                       ec->intr.expect_event = 0;
-                       return 0;
-               }
-               break;
-       default:
-               break;
+       ec->expect_event = event;
+       if (acpi_ec_check_status(acpi_ec_read_status(ec), event)) {
+               ec->expect_event = 0;
+               return 0;
        }
 
-       result = wait_event_timeout(ec->intr.wait,
-                                   !ec->intr.expect_event,
+       do {
+               if (acpi_ec_mode == EC_POLL) {
+                       udelay(ACPI_EC_UDELAY);
+               } else {
+                       time_left = wait_event_timeout(ec->wait,
+                                   !ec->expect_event,
                                    msecs_to_jiffies(ACPI_EC_DELAY));
-
-       ec->intr.expect_event = 0;
-       smp_mb();
-
-       /*
-        * Verify that the event in question has actually happened by
-        * querying EC status. Do the check even if operation timed-out
-        * to make sure that we did not miss interrupt.
-        */
-       switch (event) {
-       case ACPI_EC_EVENT_OBF:
-               if (acpi_ec_read_status(ec) & ACPI_EC_FLAG_OBF)
+                       if (time_left > 0) {
+                               ec->expect_event = 0;
+                               return 0;
+                       }
+               }
+               if (acpi_ec_check_status(acpi_ec_read_status(ec), event)) {
+                       ec->expect_event = 0;
                        return 0;
-               break;
+               }
+       } while (--i > 0);
 
-       case ACPI_EC_EVENT_IBE:
-               if (~acpi_ec_read_status(ec) & ACPI_EC_FLAG_IBF)
-                       return 0;
-               break;
-       }
+       ec->expect_event = 0;
 
        return -ETIME;
 }
@@ -254,272 +191,150 @@ static int acpi_ec_intr_wait(union acpi_ec *ec, unsigned int event)
  * Note: samsung nv5000 doesn't work with ec burst mode.
  * http://bugzilla.kernel.org/show_bug.cgi?id=4980
  */
-int acpi_ec_enter_burst_mode(union acpi_ec *ec)
+int acpi_ec_enter_burst_mode(struct acpi_ec *ec)
 {
-       u32 tmp = 0;
-       int status = 0;
+       u8 tmp = 0;
+       u8 status = 0;
 
 
        status = acpi_ec_read_status(ec);
        if (status != -EINVAL && !(status & ACPI_EC_FLAG_BURST)) {
-               status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE);
+               status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0);
                if (status)
                        goto end;
-               acpi_hw_low_level_write(8, ACPI_EC_BURST_ENABLE,
-                                       &ec->common.command_addr);
-               status = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF);
-               acpi_hw_low_level_read(8, &tmp, &ec->common.data_addr);
+               acpi_ec_write_cmd(ec, ACPI_EC_BURST_ENABLE);
+               status = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF_1);
+               tmp = acpi_ec_read_data(ec);
                if (tmp != 0x90) {      /* Burst ACK byte */
                        return -EINVAL;
                }
        }
 
-       atomic_set(&ec->intr.leaving_burst, 0);
+       atomic_set(&ec->leaving_burst, 0);
        return 0;
-      end:
-       ACPI_EXCEPTION ((AE_INFO, status, "EC wait, burst mode");
+  end:
+       ACPI_EXCEPTION((AE_INFO, status, "EC wait, burst mode"));
        return -1;
 }
 
-int acpi_ec_leave_burst_mode(union acpi_ec *ec)
+int acpi_ec_leave_burst_mode(struct acpi_ec *ec)
 {
-       int status = 0;
+       u8 status = 0;
 
 
        status = acpi_ec_read_status(ec);
        if (status != -EINVAL && (status & ACPI_EC_FLAG_BURST)){
-               status = acpi_ec_wait(ec, ACPI_EC_FLAG_IBF);
+               status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0);
                if(status)
                        goto end;
-               acpi_hw_low_level_write(8, ACPI_EC_BURST_DISABLE, &ec->common.command_addr);
-               acpi_ec_wait(ec, ACPI_EC_FLAG_IBF);
-       } 
-       atomic_set(&ec->intr.leaving_burst, 1);
+               acpi_ec_write_cmd(ec, ACPI_EC_BURST_DISABLE);
+               acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0);
+       }
+       atomic_set(&ec->leaving_burst, 1);
        return 0;
-end:
-       ACPI_EXCEPTION((AE_INFO, status, "EC leave burst mode");
+  end:
+       ACPI_EXCEPTION((AE_INFO, status, "EC leave burst mode"));
        return -1;
 }
 #endif /* ACPI_FUTURE_USAGE */
 
-static int acpi_ec_read(union acpi_ec *ec, u8 address, u32 * data)
-{
-       if (acpi_ec_poll_mode)
-               return acpi_ec_poll_read(ec, address, data);
-       else
-               return acpi_ec_intr_read(ec, address, data);
-}
-static int acpi_ec_write(union acpi_ec *ec, u8 address, u8 data)
-{
-       if (acpi_ec_poll_mode)
-               return acpi_ec_poll_write(ec, address, data);
-       else
-               return acpi_ec_intr_write(ec, address, data);
-}
-static int acpi_ec_poll_read(union acpi_ec *ec, u8 address, u32 * data)
+static int acpi_ec_transaction_unlocked(struct acpi_ec *ec, u8 command,
+                                       const u8 *wdata, unsigned wdata_len,
+                                       u8 *rdata, unsigned rdata_len)
 {
-       acpi_status status = AE_OK;
-       int result = 0;
-       u32 glk = 0;
+       int result;
 
+       acpi_ec_write_cmd(ec, command);
 
-       if (!ec || !data)
-               return -EINVAL;
-
-       *data = 0;
-
-       if (ec->common.global_lock) {
-               status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk);
-               if (ACPI_FAILURE(status))
-                       return -ENODEV;
+       for (; wdata_len > 0; wdata_len --) {
+               result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0);
+               if (result)
+                       return result;
+               acpi_ec_write_data(ec, *(wdata++));
        }
 
-       if (down_interruptible(&ec->poll.sem)) {
-               result = -ERESTARTSYS;
-               goto end_nosem;
+       if (command == ACPI_EC_COMMAND_WRITE) {
+               result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0);
+               if (result)
+                       return result;
        }
-       
-       acpi_hw_low_level_write(8, ACPI_EC_COMMAND_READ,
-                               &ec->common.command_addr);
-       result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE);
-       if (result)
-               goto end;
-
-       acpi_hw_low_level_write(8, address, &ec->common.data_addr);
-       result = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF);
-       if (result)
-               goto end;
-
-       acpi_hw_low_level_read(8, data, &ec->common.data_addr);
-
-       ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Read [%02x] from address [%02x]\n",
-                         *data, address));
-
-      end:
-       up(&ec->poll.sem);
-end_nosem:
-       if (ec->common.global_lock)
-               acpi_release_global_lock(glk);
-
-       return result;
-}
-
-static int acpi_ec_poll_write(union acpi_ec *ec, u8 address, u8 data)
-{
-       int result = 0;
-       acpi_status status = AE_OK;
-       u32 glk = 0;
 
+       for (; rdata_len > 0; rdata_len --) {
+               result = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF_1);
+               if (result)
+                       return result;
 
-       if (!ec)
-               return -EINVAL;
-
-       if (ec->common.global_lock) {
-               status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk);
-               if (ACPI_FAILURE(status))
-                       return -ENODEV;
-       }
-
-       if (down_interruptible(&ec->poll.sem)) {
-               result = -ERESTARTSYS;
-               goto end_nosem;
+               *(rdata++) = acpi_ec_read_data(ec);
        }
-       
-       acpi_hw_low_level_write(8, ACPI_EC_COMMAND_WRITE,
-                               &ec->common.command_addr);
-       result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE);
-       if (result)
-               goto end;
-
-       acpi_hw_low_level_write(8, address, &ec->common.data_addr);
-       result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE);
-       if (result)
-               goto end;
-
-       acpi_hw_low_level_write(8, data, &ec->common.data_addr);
-       result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE);
-       if (result)
-               goto end;
 
-       ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Wrote [%02x] to address [%02x]\n",
-                         data, address));
-
-      end:
-       up(&ec->poll.sem);
-end_nosem:
-       if (ec->common.global_lock)
-               acpi_release_global_lock(glk);
-
-       return result;
+       return 0;
 }
 
-static int acpi_ec_intr_read(union acpi_ec *ec, u8 address, u32 * data)
+static int acpi_ec_transaction(struct acpi_ec *ec, u8 command,
+                               const u8 *wdata, unsigned wdata_len,
+                               u8 *rdata, unsigned rdata_len)
 {
-       int status = 0;
+       int status;
        u32 glk;
 
-
-       if (!ec || !data)
+       if (!ec || (wdata_len && !wdata) || (rdata_len && !rdata))
                return -EINVAL;
 
-       *data = 0;
+        if (rdata)
+                memset(rdata, 0, rdata_len);
 
-       if (ec->common.global_lock) {
+       if (ec->global_lock) {
                status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk);
                if (ACPI_FAILURE(status))
                        return -ENODEV;
        }
+       down(&ec->sem);
 
-       WARN_ON(in_interrupt());
-       down(&ec->intr.sem);
-
-       status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE);
+       status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0);
        if (status) {
                printk(KERN_DEBUG PREFIX "read EC, IB not empty\n");
                goto end;
        }
-       acpi_hw_low_level_write(8, ACPI_EC_COMMAND_READ,
-                               &ec->common.command_addr);
-       status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE);
-       if (status) {
-               printk(KERN_DEBUG PREFIX "read EC, IB not empty\n");
-       }
 
-       acpi_hw_low_level_write(8, address, &ec->common.data_addr);
-       status = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF);
-       if (status) {
-               printk(KERN_DEBUG PREFIX "read EC, OB not full\n");
-               goto end;
-       }
-       acpi_hw_low_level_read(8, data, &ec->common.data_addr);
-       ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Read [%02x] from address [%02x]\n",
-                         *data, address));
+        status = acpi_ec_transaction_unlocked(ec, command,
+                                              wdata, wdata_len,
+                                              rdata, rdata_len);
 
-      end:
-       up(&ec->intr.sem);
+end:
+       up(&ec->sem);
 
-       if (ec->common.global_lock)
+       if (ec->global_lock)
                acpi_release_global_lock(glk);
 
        return status;
 }
 
-static int acpi_ec_intr_write(union acpi_ec *ec, u8 address, u8 data)
+static int acpi_ec_read(struct acpi_ec *ec, u8 address, u8 *data)
 {
-       int status = 0;
-       u32 glk;
-
-
-       if (!ec)
-               return -EINVAL;
-
-       if (ec->common.global_lock) {
-               status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk);
-               if (ACPI_FAILURE(status))
-                       return -ENODEV;
-       }
-
-       WARN_ON(in_interrupt());
-       down(&ec->intr.sem);
-
-       status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE);
-       if (status) {
-               printk(KERN_DEBUG PREFIX "write EC, IB not empty\n");
-       }
-       acpi_hw_low_level_write(8, ACPI_EC_COMMAND_WRITE,
-                               &ec->common.command_addr);
-       status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE);
-       if (status) {
-               printk(KERN_DEBUG PREFIX "write EC, IB not empty\n");
-       }
-
-       acpi_hw_low_level_write(8, address, &ec->common.data_addr);
-       status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE);
-       if (status) {
-               printk(KERN_DEBUG PREFIX "write EC, IB not empty\n");
-       }
-
-       acpi_hw_low_level_write(8, data, &ec->common.data_addr);
+       int result;
+       u8 d;
 
-       ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Wrote [%02x] to address [%02x]\n",
-                         data, address));
-
-       up(&ec->intr.sem);
-
-       if (ec->common.global_lock)
-               acpi_release_global_lock(glk);
+       result = acpi_ec_transaction(ec, ACPI_EC_COMMAND_READ,
+                                    &address, 1, &d, 1);
+       *data = d;
+       return result;
+}
 
-       return status;
+static int acpi_ec_write(struct acpi_ec *ec, u8 address, u8 data)
+{
+        u8 wdata[2] = { address, data };
+        return acpi_ec_transaction(ec, ACPI_EC_COMMAND_WRITE,
+                                  wdata, 2, NULL, 0);
 }
 
 /*
  * Externally callable EC access functions. For now, assume 1 EC only
  */
-int ec_read(u8 addr, u8 * val)
+int ec_read(u8 addr, u8 *val)
 {
-       union acpi_ec *ec;
+       struct acpi_ec *ec;
        int err;
-       u32 temp_data;
+       u8 temp_data;
 
        if (!first_ec)
                return -ENODEV;
@@ -539,7 +354,7 @@ EXPORT_SYMBOL(ec_read);
 
 int ec_write(u8 addr, u8 val)
 {
-       union acpi_ec *ec;
+       struct acpi_ec *ec;
        int err;
 
        if (!first_ec)
@@ -554,255 +369,106 @@ int ec_write(u8 addr, u8 val)
 
 EXPORT_SYMBOL(ec_write);
 
-static int acpi_ec_query(union acpi_ec *ec, u32 * data)
-{
-       if (acpi_ec_poll_mode)
-               return acpi_ec_poll_query(ec, data);
-       else
-               return acpi_ec_intr_query(ec, data);
-}
-static int acpi_ec_poll_query(union acpi_ec *ec, u32 * data)
+extern int ec_transaction(u8 command,
+                          const u8 *wdata, unsigned wdata_len,
+                          u8 *rdata, unsigned rdata_len)
 {
-       int result = 0;
-       acpi_status status = AE_OK;
-       u32 glk = 0;
-
-
-       if (!ec || !data)
-               return -EINVAL;
-
-       *data = 0;
-
-       if (ec->common.global_lock) {
-               status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk);
-               if (ACPI_FAILURE(status))
-                       return -ENODEV;
-       }
+       struct acpi_ec *ec;
 
-       /*
-        * Query the EC to find out which _Qxx method we need to evaluate.
-        * Note that successful completion of the query causes the ACPI_EC_SCI
-        * bit to be cleared (and thus clearing the interrupt source).
-        */
-       if (down_interruptible(&ec->poll.sem)) {
-               result = -ERESTARTSYS;
-               goto end_nosem;
-       }
-       
-       acpi_hw_low_level_write(8, ACPI_EC_COMMAND_QUERY,
-                               &ec->common.command_addr);
-       result = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF);
-       if (result)
-               goto end;
-
-       acpi_hw_low_level_read(8, data, &ec->common.data_addr);
-       if (!*data)
-               result = -ENODATA;
+       if (!first_ec)
+               return -ENODEV;
 
-      end:
-       up(&ec->poll.sem);
-end_nosem:
-       if (ec->common.global_lock)
-               acpi_release_global_lock(glk);
+       ec = acpi_driver_data(first_ec);
 
-       return result;
+       return acpi_ec_transaction(ec, command, wdata,
+                                  wdata_len, rdata, rdata_len);
 }
-static int acpi_ec_intr_query(union acpi_ec *ec, u32 * data)
-{
-       int status = 0;
-       u32 glk;
-
 
-       if (!ec || !data)
-               return -EINVAL;
-       *data = 0;
-
-       if (ec->common.global_lock) {
-               status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk);
-               if (ACPI_FAILURE(status))
-                       return -ENODEV;
-       }
+EXPORT_SYMBOL(ec_transaction);
 
-       down(&ec->intr.sem);
+static int acpi_ec_query(struct acpi_ec *ec, u8 *data)
+{
+       int result;
+        u8 d;
 
-       status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE);
-       if (status) {
-               printk(KERN_DEBUG PREFIX "query EC, IB not empty\n");
-               goto end;
-       }
-       /*
-        * Query the EC to find out which _Qxx method we need to evaluate.
-        * Note that successful completion of the query causes the ACPI_EC_SCI
-        * bit to be cleared (and thus clearing the interrupt source).
-        */
-       acpi_hw_low_level_write(8, ACPI_EC_COMMAND_QUERY,
-                               &ec->common.command_addr);
-       status = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF);
-       if (status) {
-               printk(KERN_DEBUG PREFIX "query EC, OB not full\n");
-               goto end;
-       }
+        if (!ec || !data)
+                return -EINVAL;
 
-       acpi_hw_low_level_read(8, data, &ec->common.data_addr);
-       if (!*data)
-               status = -ENODATA;
+        /*
+         * Query the EC to find out which _Qxx method we need to evaluate.
+         * Note that successful completion of the query causes the ACPI_EC_SCI
+         * bit to be cleared (and thus clearing the interrupt source).
+         */
 
-      end:
-       up(&ec->intr.sem);
+        result = acpi_ec_transaction(ec, ACPI_EC_COMMAND_QUERY, NULL, 0, &d, 1);
+        if (result)
+                return result;
 
-       if (ec->common.global_lock)
-               acpi_release_global_lock(glk);
+        if (!d)
+                return -ENODATA;
 
-       return status;
+        *data = d;
+        return 0;
 }
 
 /* --------------------------------------------------------------------------
                                 Event Management
    -------------------------------------------------------------------------- */
 
-union acpi_ec_query_data {
+struct acpi_ec_query_data {
        acpi_handle handle;
        u8 data;
 };
 
 static void acpi_ec_gpe_query(void *ec_cxt)
 {
-       if (acpi_ec_poll_mode)
-               acpi_ec_gpe_poll_query(ec_cxt);
-       else
-               acpi_ec_gpe_intr_query(ec_cxt);
-}
-
-static void acpi_ec_gpe_poll_query(void *ec_cxt)
-{
-       union acpi_ec *ec = (union acpi_ec *)ec_cxt;
-       u32 value = 0;
-       static char object_name[5] = { '_', 'Q', '0', '0', '\0' };
-       const char hex[] = { '0', '1', '2', '3', '4', '5', '6', '7',
-               '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
-       };
-
+       struct acpi_ec *ec = (struct acpi_ec *)ec_cxt;
+       u8 value = 0;
+       static char object_name[8];
 
-       if (!ec_cxt)
+       if (!ec)
                goto end;
 
-       if (down_interruptible (&ec->poll.sem)) {
-               return;
-       }
-       acpi_hw_low_level_read(8, &value, &ec->common.command_addr);
-       up(&ec->poll.sem);
-
-       /* TBD: Implement asynch events!
-        * NOTE: All we care about are EC-SCI's.  Other EC events are
-        * handled via polling (yuck!).  This is because some systems
-        * treat EC-SCIs as level (versus EDGE!) triggered, preventing
-        *  a purely interrupt-driven approach (grumble, grumble).
-        */
+       value = acpi_ec_read_status(ec);
+
        if (!(value & ACPI_EC_FLAG_SCI))
                goto end;
 
        if (acpi_ec_query(ec, &value))
                goto end;
 
-       object_name[2] = hex[((value >> 4) & 0x0F)];
-       object_name[3] = hex[(value & 0x0F)];
-
-       ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Evaluating %s\n", object_name));
+       snprintf(object_name, 8, "_Q%2.2X", value);
 
-       acpi_evaluate_object(ec->common.handle, object_name, NULL, NULL);
+       ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Evaluating %s", object_name));
 
-      end:
-       acpi_enable_gpe(NULL, ec->common.gpe_bit, ACPI_NOT_ISR);
-}
-static void acpi_ec_gpe_intr_query(void *ec_cxt)
-{
-       union acpi_ec *ec = (union acpi_ec *)ec_cxt;
-       u32 value;
-       int result = -ENODATA;
-       static char object_name[5] = { '_', 'Q', '0', '0', '\0' };
-       const char hex[] = { '0', '1', '2', '3', '4', '5', '6', '7',
-               '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
-       };
+       acpi_evaluate_object(ec->handle, object_name, NULL, NULL);
 
-
-       if (acpi_ec_read_status(ec) & ACPI_EC_FLAG_SCI)
-               result = acpi_ec_query(ec, &value);
-
-       if (result)
-               goto end;
-
-       object_name[2] = hex[((value >> 4) & 0x0F)];
-       object_name[3] = hex[(value & 0x0F)];
-
-       ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Evaluating %s\n", object_name));
-
-       acpi_evaluate_object(ec->common.handle, object_name, NULL, NULL);
       end:
-       atomic_dec(&ec->intr.pending_gpe);
-       return;
+       acpi_enable_gpe(NULL, ec->gpe_bit, ACPI_NOT_ISR);
 }
 
 static u32 acpi_ec_gpe_handler(void *data)
-{
-       if (acpi_ec_poll_mode)
-               return acpi_ec_gpe_poll_handler(data);
-       else
-               return acpi_ec_gpe_intr_handler(data);
-}
-static u32 acpi_ec_gpe_poll_handler(void *data)
 {
        acpi_status status = AE_OK;
-       union acpi_ec *ec = (union acpi_ec *)data;
-
-       if (!ec)
-               return ACPI_INTERRUPT_NOT_HANDLED;
-
-       acpi_disable_gpe(NULL, ec->common.gpe_bit, ACPI_ISR);
-
-       status = acpi_os_execute(OSL_EC_POLL_HANDLER, acpi_ec_gpe_query, ec);
-
-       if (status == AE_OK)
-               return ACPI_INTERRUPT_HANDLED;
-       else
-               return ACPI_INTERRUPT_NOT_HANDLED;
-}
-static u32 acpi_ec_gpe_intr_handler(void *data)
-{
-       acpi_status status = AE_OK;
-       u32 value;
-       union acpi_ec *ec = (union acpi_ec *)data;
-
-       if (!ec)
-               return ACPI_INTERRUPT_NOT_HANDLED;
+       u8 value;
+       struct acpi_ec *ec = (struct acpi_ec *)data;
 
-       acpi_clear_gpe(NULL, ec->common.gpe_bit, ACPI_ISR);
+       acpi_clear_gpe(NULL, ec->gpe_bit, ACPI_ISR);
        value = acpi_ec_read_status(ec);
 
-       switch (ec->intr.expect_event) {
-       case ACPI_EC_EVENT_OBF:
-               if (!(value & ACPI_EC_FLAG_OBF))
-                       break;
-               ec->intr.expect_event = 0;
-               wake_up(&ec->intr.wait);
-               break;
-       case ACPI_EC_EVENT_IBE:
-               if ((value & ACPI_EC_FLAG_IBF))
-                       break;
-               ec->intr.expect_event = 0;
-               wake_up(&ec->intr.wait);
-               break;
-       default:
-               break;
+       if (acpi_ec_mode == EC_INTR) {
+               if (acpi_ec_check_status(value, ec->expect_event)) {
+                       ec->expect_event = 0;
+                       wake_up(&ec->wait);
+               }
        }
 
        if (value & ACPI_EC_FLAG_SCI) {
-               atomic_add(1, &ec->intr.pending_gpe);
-               status = acpi_os_execute(OSL_EC_BURST_HANDLER,
-                                                    acpi_ec_gpe_query, ec);
+               status = acpi_os_execute(OSL_EC_BURST_HANDLER, acpi_ec_gpe_query, ec);
                return status == AE_OK ?
                    ACPI_INTERRUPT_HANDLED : ACPI_INTERRUPT_NOT_HANDLED;
        }
-       acpi_enable_gpe(NULL, ec->common.gpe_bit, ACPI_ISR);
+       acpi_enable_gpe(NULL, ec->gpe_bit, ACPI_ISR);
        return status == AE_OK ?
            ACPI_INTERRUPT_HANDLED : ACPI_INTERRUPT_NOT_HANDLED;
 }
@@ -833,7 +499,7 @@ acpi_ec_space_handler(u32 function,
                      void *handler_context, void *region_context)
 {
        int result = 0;
-       union acpi_ec *ec = NULL;
+       struct acpi_ec *ec = NULL;
        u64 temp = *value;
        acpi_integer f_v = 0;
        int i = 0;
@@ -843,18 +509,16 @@ acpi_ec_space_handler(u32 function,
                return AE_BAD_PARAMETER;
 
        if (bit_width != 8 && acpi_strict) {
-               printk(KERN_WARNING PREFIX
-                      "acpi_ec_space_handler: bit_width should be 8\n");
                return AE_BAD_PARAMETER;
        }
 
-       ec = (union acpi_ec *)handler_context;
+       ec = (struct acpi_ec *)handler_context;
 
       next_byte:
        switch (function) {
        case ACPI_READ:
                temp = 0;
-               result = acpi_ec_read(ec, (u8) address, (u32 *) & temp);
+               result = acpi_ec_read(ec, (u8) address, (u8 *) &temp);
                break;
        case ACPI_WRITE:
                result = acpi_ec_write(ec, (u8) address, (u8) temp);
@@ -905,20 +569,20 @@ static struct proc_dir_entry *acpi_ec_dir;
 
 static int acpi_ec_read_info(struct seq_file *seq, void *offset)
 {
-       union acpi_ec *ec = (union acpi_ec *)seq->private;
+       struct acpi_ec *ec = (struct acpi_ec *)seq->private;
 
 
        if (!ec)
                goto end;
 
        seq_printf(seq, "gpe bit:                 0x%02x\n",
-                  (u32) ec->common.gpe_bit);
+                  (u32) ec->gpe_bit);
        seq_printf(seq, "ports:                   0x%02x, 0x%02x\n",
-                  (u32) ec->common.status_addr.address,
-                  (u32) ec->common.data_addr.address);
+                  (u32) ec->command_addr,
+                  (u32) ec->data_addr);
        seq_printf(seq, "use global lock:         %s\n",
-                  ec->common.global_lock ? "yes" : "no");
-       acpi_enable_gpe(NULL, ec->common.gpe_bit, ACPI_NOT_ISR);
+                  ec->global_lock ? "yes" : "no");
+       acpi_enable_gpe(NULL, ec->gpe_bit, ACPI_NOT_ISR);
 
       end:
        return 0;
@@ -929,7 +593,7 @@ static int acpi_ec_info_open_fs(struct inode *inode, struct file *file)
        return single_open(file, acpi_ec_read_info, PDE(inode)->data);
 }
 
-static const struct file_operations acpi_ec_info_ops = {
+static struct file_operations acpi_ec_info_ops = {
        .open = acpi_ec_info_open_fs,
        .read = seq_read,
        .llseek = seq_lseek,
@@ -978,101 +642,35 @@ static int acpi_ec_remove_fs(struct acpi_device *device)
                                Driver Interface
    -------------------------------------------------------------------------- */
 
-static int acpi_ec_poll_add(struct acpi_device *device)
+static int acpi_ec_add(struct acpi_device *device)
 {
        int result = 0;
        acpi_status status = AE_OK;
-       union acpi_ec *ec = NULL;
+       struct acpi_ec *ec = NULL;
 
 
        if (!device)
                return -EINVAL;
 
-       ec = kmalloc(sizeof(union acpi_ec), GFP_KERNEL);
+       ec = kmalloc(sizeof(struct acpi_ec), GFP_KERNEL);
        if (!ec)
                return -ENOMEM;
-       memset(ec, 0, sizeof(union acpi_ec));
-
-       ec->common.handle = device->handle;
-       ec->common.uid = -1;
-       init_MUTEX(&ec->poll.sem);
-       strcpy(acpi_device_name(device), ACPI_EC_DEVICE_NAME);
-       strcpy(acpi_device_class(device), ACPI_EC_CLASS);
-       acpi_driver_data(device) = ec;
-
-       /* Use the global lock for all EC transactions? */
-       acpi_evaluate_integer(ec->common.handle, "_GLK", NULL,
-                             &ec->common.global_lock);
-
-       /* XXX we don't test uids, because on some boxes ecdt uid = 0, see:
-          http://bugzilla.kernel.org/show_bug.cgi?id=6111 */
-       if (ec_ecdt) {
-               acpi_remove_address_space_handler(ACPI_ROOT_OBJECT,
-                                                 ACPI_ADR_SPACE_EC,
-                                                 &acpi_ec_space_handler);
-
-               acpi_remove_gpe_handler(NULL, ec_ecdt->common.gpe_bit,
-                                       &acpi_ec_gpe_handler);
-
-               kfree(ec_ecdt);
+       memset(ec, 0, sizeof(struct acpi_ec));
+
+       ec->handle = device->handle;
+       ec->uid = -1;
+       init_MUTEX(&ec->sem);
+       if (acpi_ec_mode == EC_INTR) {
+               atomic_set(&ec->leaving_burst, 1);
+               init_waitqueue_head(&ec->wait);
        }
-
-       /* Get GPE bit assignment (EC events). */
-       /* TODO: Add support for _GPE returning a package */
-       status =
-           acpi_evaluate_integer(ec->common.handle, "_GPE", NULL,
-                                 &ec->common.gpe_bit);
-       if (ACPI_FAILURE(status)) {
-               ACPI_EXCEPTION((AE_INFO, status, "Obtaining GPE bit"));
-               result = -ENODEV;
-               goto end;
-       }
-
-       result = acpi_ec_add_fs(device);
-       if (result)
-               goto end;
-
-       printk(KERN_INFO PREFIX "%s [%s] (gpe %d) polling mode.\n",
-              acpi_device_name(device), acpi_device_bid(device),
-              (u32) ec->common.gpe_bit);
-
-       if (!first_ec)
-               first_ec = device;
-
-      end:
-       if (result)
-               kfree(ec);
-
-       return result;
-}
-static int acpi_ec_intr_add(struct acpi_device *device)
-{
-       int result = 0;
-       acpi_status status = AE_OK;
-       union acpi_ec *ec = NULL;
-
-
-       if (!device)
-               return -EINVAL;
-
-       ec = kmalloc(sizeof(union acpi_ec), GFP_KERNEL);
-       if (!ec)
-               return -ENOMEM;
-       memset(ec, 0, sizeof(union acpi_ec));
-
-       ec->common.handle = device->handle;
-       ec->common.uid = -1;
-       atomic_set(&ec->intr.pending_gpe, 0);
-       atomic_set(&ec->intr.leaving_burst, 1);
-       init_MUTEX(&ec->intr.sem);
-       init_waitqueue_head(&ec->intr.wait);
        strcpy(acpi_device_name(device), ACPI_EC_DEVICE_NAME);
        strcpy(acpi_device_class(device), ACPI_EC_CLASS);
        acpi_driver_data(device) = ec;
 
        /* Use the global lock for all EC transactions? */
-       acpi_evaluate_integer(ec->common.handle, "_GLK", NULL,
-                             &ec->common.global_lock);
+       acpi_evaluate_integer(ec->handle, "_GLK", NULL,
+                             &ec->global_lock);
 
        /* XXX we don't test uids, because on some boxes ecdt uid = 0, see:
           http://bugzilla.kernel.org/show_bug.cgi?id=6111 */
@@ -1081,7 +679,7 @@ static int acpi_ec_intr_add(struct acpi_device *device)
                                                  ACPI_ADR_SPACE_EC,
                                                  &acpi_ec_space_handler);
 
-               acpi_remove_gpe_handler(NULL, ec_ecdt->common.gpe_bit,
+               acpi_remove_gpe_handler(NULL, ec_ecdt->gpe_bit,
                                        &acpi_ec_gpe_handler);
 
                kfree(ec_ecdt);
@@ -1090,10 +688,10 @@ static int acpi_ec_intr_add(struct acpi_device *device)
        /* Get GPE bit assignment (EC events). */
        /* TODO: Add support for _GPE returning a package */
        status =
-           acpi_evaluate_integer(ec->common.handle, "_GPE", NULL,
-                                 &ec->common.gpe_bit);
+           acpi_evaluate_integer(ec->handle, "_GPE", NULL,
+                                 &ec->gpe_bit);
        if (ACPI_FAILURE(status)) {
-               printk(KERN_ERR PREFIX "Obtaining GPE bit assignment\n");
+               ACPI_EXCEPTION((AE_INFO, status, "Obtaining GPE bit assignment"));
                result = -ENODEV;
                goto end;
        }
@@ -1102,14 +700,14 @@ static int acpi_ec_intr_add(struct acpi_device *device)
        if (result)
                goto end;
 
-       printk(KERN_INFO PREFIX "%s [%s] (gpe %d) interrupt mode.\n",
+       ACPI_DEBUG_PRINT((ACPI_DB_INFO, "%s [%s] (gpe %d) interrupt mode.",
               acpi_device_name(device), acpi_device_bid(device),
-              (u32) ec->common.gpe_bit);
+              (u32) ec->gpe_bit));
 
        if (!first_ec)
                first_ec = device;
 
-      end:
+  end:
        if (result)
                kfree(ec);
 
@@ -1118,7 +716,7 @@ static int acpi_ec_intr_add(struct acpi_device *device)
 
 static int acpi_ec_remove(struct acpi_device *device, int type)
 {
-       union acpi_ec *ec = NULL;
+       struct acpi_ec *ec = NULL;
 
 
        if (!device)
@@ -1136,8 +734,7 @@ static int acpi_ec_remove(struct acpi_device *device, int type)
 static acpi_status
 acpi_ec_io_ports(struct acpi_resource *resource, void *context)
 {
-       union acpi_ec *ec = (union acpi_ec *)context;
-       struct acpi_generic_address *addr;
+       struct acpi_ec *ec = (struct acpi_ec *)context;
 
        if (resource->type != ACPI_RESOURCE_TYPE_IO) {
                return AE_OK;
@@ -1148,26 +745,21 @@ acpi_ec_io_ports(struct acpi_resource *resource, void *context)
         * the second address region returned is the status/command
         * port.
         */
-       if (ec->common.data_addr.register_bit_width == 0) {
-               addr = &ec->common.data_addr;
-       } else if (ec->common.command_addr.register_bit_width == 0) {
-               addr = &ec->common.command_addr;
+       if (ec->data_addr == 0) {
+               ec->data_addr = resource->data.io.minimum;
+       } else if (ec->command_addr == 0) {
+               ec->command_addr = resource->data.io.minimum;
        } else {
                return AE_CTRL_TERMINATE;
        }
 
-       addr->address_space_id = ACPI_ADR_SPACE_SYSTEM_IO;
-       addr->register_bit_width = 8;
-       addr->register_bit_offset = 0;
-       addr->address = resource->data.io.minimum;
-
        return AE_OK;
 }
 
 static int acpi_ec_start(struct acpi_device *device)
 {
        acpi_status status = AE_OK;
-       union acpi_ec *ec = NULL;
+       struct acpi_ec *ec = NULL;
 
 
        if (!device)
@@ -1181,39 +773,35 @@ static int acpi_ec_start(struct acpi_device *device)
        /*
         * Get I/O port addresses. Convert to GAS format.
         */
-       status = acpi_walk_resources(ec->common.handle, METHOD_NAME__CRS,
+       status = acpi_walk_resources(ec->handle, METHOD_NAME__CRS,
                                     acpi_ec_io_ports, ec);
-       if (ACPI_FAILURE(status)
-           || ec->common.command_addr.register_bit_width == 0) {
-               printk(KERN_ERR PREFIX "Error getting I/O port addresses\n");
+       if (ACPI_FAILURE(status) || ec->command_addr == 0) {
+               ACPI_EXCEPTION((AE_INFO, status,
+                               "Error getting I/O port addresses"));
                return -ENODEV;
        }
 
-       ec->common.status_addr = ec->common.command_addr;
-
-       ACPI_DEBUG_PRINT((ACPI_DB_INFO, "gpe=0x%02x, ports=0x%2x,0x%2x\n",
-                         (u32) ec->common.gpe_bit,
-                         (u32) ec->common.command_addr.address,
-                         (u32) ec->common.data_addr.address));
+       ACPI_DEBUG_PRINT((ACPI_DB_INFO, "gpe=0x%02lx, ports=0x%2lx,0x%2lx",
+                         ec->gpe_bit, ec->command_addr, ec->data_addr));
 
        /*
         * Install GPE handler
         */
-       status = acpi_install_gpe_handler(NULL, ec->common.gpe_bit,
+       status = acpi_install_gpe_handler(NULL, ec->gpe_bit,
                                          ACPI_GPE_EDGE_TRIGGERED,
                                          &acpi_ec_gpe_handler, ec);
        if (ACPI_FAILURE(status)) {
                return -ENODEV;
        }
-       acpi_set_gpe_type(NULL, ec->common.gpe_bit, ACPI_GPE_TYPE_RUNTIME);
-       acpi_enable_gpe(NULL, ec->common.gpe_bit, ACPI_NOT_ISR);
+       acpi_set_gpe_type(NULL, ec->gpe_bit, ACPI_GPE_TYPE_RUNTIME);
+       acpi_enable_gpe(NULL, ec->gpe_bit, ACPI_NOT_ISR);
 
-       status = acpi_install_address_space_handler(ec->common.handle,
+       status = acpi_install_address_space_handler(ec->handle,
                                                    ACPI_ADR_SPACE_EC,
                                                    &acpi_ec_space_handler,
                                                    &acpi_ec_space_setup, ec);
        if (ACPI_FAILURE(status)) {
-               acpi_remove_gpe_handler(NULL, ec->common.gpe_bit,
+               acpi_remove_gpe_handler(NULL, ec->gpe_bit,
                                        &acpi_ec_gpe_handler);
                return -ENODEV;
        }
@@ -1224,7 +812,7 @@ static int acpi_ec_start(struct acpi_device *device)
 static int acpi_ec_stop(struct acpi_device *device, int type)
 {
        acpi_status status = AE_OK;
-       union acpi_ec *ec = NULL;
+       struct acpi_ec *ec = NULL;
 
 
        if (!device)
@@ -1232,14 +820,14 @@ static int acpi_ec_stop(struct acpi_device *device, int type)
 
        ec = acpi_driver_data(device);
 
-       status = acpi_remove_address_space_handler(ec->common.handle,
+       status = acpi_remove_address_space_handler(ec->handle,
                                                   ACPI_ADR_SPACE_EC,
                                                   &acpi_ec_space_handler);
        if (ACPI_FAILURE(status))
                return -ENODEV;
 
        status =
-           acpi_remove_gpe_handler(NULL, ec->common.gpe_bit,
+           acpi_remove_gpe_handler(NULL, ec->gpe_bit,
                                    &acpi_ec_gpe_handler);
        if (ACPI_FAILURE(status))
                return -ENODEV;
@@ -1251,76 +839,30 @@ static acpi_status __init
 acpi_fake_ecdt_callback(acpi_handle handle,
                        u32 Level, void *context, void **retval)
 {
-
-       if (acpi_ec_poll_mode)
-               return acpi_fake_ecdt_poll_callback(handle,
-                                                      Level, context, retval);
-       else
-               return acpi_fake_ecdt_intr_callback(handle,
-                                                    Level, context, retval);
-}
-
-static acpi_status __init
-acpi_fake_ecdt_poll_callback(acpi_handle handle,
-                               u32 Level, void *context, void **retval)
-{
-       acpi_status status;
-
-       status = acpi_walk_resources(handle, METHOD_NAME__CRS,
-                                    acpi_ec_io_ports, ec_ecdt);
-       if (ACPI_FAILURE(status))
-               return status;
-       ec_ecdt->common.status_addr = ec_ecdt->common.command_addr;
-
-       ec_ecdt->common.uid = -1;
-       acpi_evaluate_integer(handle, "_UID", NULL, &ec_ecdt->common.uid);
-
-       status =
-           acpi_evaluate_integer(handle, "_GPE", NULL,
-                                 &ec_ecdt->common.gpe_bit);
-       if (ACPI_FAILURE(status))
-               return status;
-       init_MUTEX(&ec_ecdt->poll.sem);
-       ec_ecdt->common.global_lock = TRUE;
-       ec_ecdt->common.handle = handle;
-
-       printk(KERN_INFO PREFIX "GPE=0x%02x, ports=0x%2x, 0x%2x\n",
-              (u32) ec_ecdt->common.gpe_bit,
-              (u32) ec_ecdt->common.command_addr.address,
-              (u32) ec_ecdt->common.data_addr.address);
-
-       return AE_CTRL_TERMINATE;
-}
-
-static acpi_status __init
-acpi_fake_ecdt_intr_callback(acpi_handle handle,
-                             u32 Level, void *context, void **retval)
-{
        acpi_status status;
 
-       init_MUTEX(&ec_ecdt->intr.sem);
-       init_waitqueue_head(&ec_ecdt->intr.wait);
+       init_MUTEX(&ec_ecdt->sem);
+       if (acpi_ec_mode == EC_INTR) {
+               init_waitqueue_head(&ec_ecdt->wait);
+       }
        status = acpi_walk_resources(handle, METHOD_NAME__CRS,
                                     acpi_ec_io_ports, ec_ecdt);
        if (ACPI_FAILURE(status))
                return status;
-       ec_ecdt->common.status_addr = ec_ecdt->common.command_addr;
 
-       ec_ecdt->common.uid = -1;
-       acpi_evaluate_integer(handle, "_UID", NULL, &ec_ecdt->common.uid);
+       ec_ecdt->uid = -1;
+       acpi_evaluate_integer(handle, "_UID", NULL, &ec_ecdt->uid);
 
        status =
            acpi_evaluate_integer(handle, "_GPE", NULL,
-                                 &ec_ecdt->common.gpe_bit);
+                                 &ec_ecdt->gpe_bit);
        if (ACPI_FAILURE(status))
                return status;
-       ec_ecdt->common.global_lock = TRUE;
-       ec_ecdt->common.handle = handle;
+       ec_ecdt->global_lock = TRUE;
+       ec_ecdt->handle = handle;
 
-       printk(KERN_INFO PREFIX "GPE=0x%02x, ports=0x%2x, 0x%2x\n",
-              (u32) ec_ecdt->common.gpe_bit,
-              (u32) ec_ecdt->common.command_addr.address,
-              (u32) ec_ecdt->common.data_addr.address);
+       ACPI_DEBUG_PRINT((ACPI_DB_INFO, "GPE=0x%02lx, ports=0x%2lx, 0x%2lx",
+              ec_ecdt->gpe_bit, ec_ecdt->command_addr, ec_ecdt->data_addr));
 
        return AE_CTRL_TERMINATE;
 }
@@ -1340,14 +882,14 @@ static int __init acpi_ec_fake_ecdt(void)
        acpi_status status;
        int ret = 0;
 
-       printk(KERN_INFO PREFIX "Try to make an fake ECDT\n");
+       ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Try to make an fake ECDT"));
 
-       ec_ecdt = kmalloc(sizeof(union acpi_ec), GFP_KERNEL);
+       ec_ecdt = kmalloc(sizeof(struct acpi_ec), GFP_KERNEL);
        if (!ec_ecdt) {
                ret = -ENOMEM;
                goto error;
        }
-       memset(ec_ecdt, 0, sizeof(union acpi_ec));
+       memset(ec_ecdt, 0, sizeof(struct acpi_ec));
 
        status = acpi_get_devices(ACPI_EC_HID,
                                  acpi_fake_ecdt_callback, NULL, NULL);
@@ -1355,23 +897,15 @@ static int __init acpi_ec_fake_ecdt(void)
                kfree(ec_ecdt);
                ec_ecdt = NULL;
                ret = -ENODEV;
+               ACPI_EXCEPTION((AE_INFO, status, "Can't make an fake ECDT"));
                goto error;
        }
        return 0;
-      error:
-       printk(KERN_ERR PREFIX "Can't make an fake ECDT\n");
+  error:
        return ret;
 }
 
 static int __init acpi_ec_get_real_ecdt(void)
-{
-       if (acpi_ec_poll_mode)
-               return acpi_ec_poll_get_real_ecdt();
-       else
-               return acpi_ec_intr_get_real_ecdt();
-}
-
-static int __init acpi_ec_poll_get_real_ecdt(void)
 {
        acpi_status status;
        struct acpi_table_ecdt *ecdt_ptr;
@@ -1382,80 +916,36 @@ static int __init acpi_ec_poll_get_real_ecdt(void)
        if (ACPI_FAILURE(status))
                return -ENODEV;
 
-       printk(KERN_INFO PREFIX "Found ECDT\n");
+       ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found ECDT"));
 
        /*
         * Generate a temporary ec context to use until the namespace is scanned
         */
-       ec_ecdt = kmalloc(sizeof(union acpi_ec), GFP_KERNEL);
+       ec_ecdt = kmalloc(sizeof(struct acpi_ec), GFP_KERNEL);
        if (!ec_ecdt)
                return -ENOMEM;
-       memset(ec_ecdt, 0, sizeof(union acpi_ec));
-
-       ec_ecdt->common.command_addr = ecdt_ptr->ec_control;
-       ec_ecdt->common.status_addr = ecdt_ptr->ec_control;
-       ec_ecdt->common.data_addr = ecdt_ptr->ec_data;
-       ec_ecdt->common.gpe_bit = ecdt_ptr->gpe_bit;
-       init_MUTEX(&ec_ecdt->poll.sem);
-       /* use the GL just to be safe */
-       ec_ecdt->common.global_lock = TRUE;
-       ec_ecdt->common.uid = ecdt_ptr->uid;
+       memset(ec_ecdt, 0, sizeof(struct acpi_ec));
 
-       status =
-           acpi_get_handle(NULL, ecdt_ptr->ec_id, &ec_ecdt->common.handle);
-       if (ACPI_FAILURE(status)) {
-               goto error;
+       init_MUTEX(&ec_ecdt->sem);
+       if (acpi_ec_mode == EC_INTR) {
+               init_waitqueue_head(&ec_ecdt->wait);
        }
-
-       return 0;
-      error:
-       printk(KERN_ERR PREFIX "Could not use ECDT\n");
-       kfree(ec_ecdt);
-       ec_ecdt = NULL;
-
-       return -ENODEV;
-}
-
-static int __init acpi_ec_intr_get_real_ecdt(void)
-{
-       acpi_status status;
-       struct acpi_table_ecdt *ecdt_ptr;
-
-       status = acpi_get_firmware_table("ECDT", 1, ACPI_LOGICAL_ADDRESSING,
-                                        (struct acpi_table_header **)
-                                        &ecdt_ptr);
-       if (ACPI_FAILURE(status))
-               return -ENODEV;
-
-       printk(KERN_INFO PREFIX "Found ECDT\n");
-
-       /*
-        * Generate a temporary ec context to use until the namespace is scanned
-        */
-       ec_ecdt = kmalloc(sizeof(union acpi_ec), GFP_KERNEL);
-       if (!ec_ecdt)
-               return -ENOMEM;
-       memset(ec_ecdt, 0, sizeof(union acpi_ec));
-
-       init_MUTEX(&ec_ecdt->intr.sem);
-       init_waitqueue_head(&ec_ecdt->intr.wait);
-       ec_ecdt->common.command_addr = ecdt_ptr->ec_control;
-       ec_ecdt->common.status_addr = ecdt_ptr->ec_control;
-       ec_ecdt->common.data_addr = ecdt_ptr->ec_data;
-       ec_ecdt->common.gpe_bit = ecdt_ptr->gpe_bit;
+       ec_ecdt->command_addr = ecdt_ptr->ec_control.address;
+       ec_ecdt->data_addr = ecdt_ptr->ec_data.address;
+       ec_ecdt->gpe_bit = ecdt_ptr->gpe_bit;
        /* use the GL just to be safe */
-       ec_ecdt->common.global_lock = TRUE;
-       ec_ecdt->common.uid = ecdt_ptr->uid;
+       ec_ecdt->global_lock = TRUE;
+       ec_ecdt->uid = ecdt_ptr->uid;
 
        status =
-           acpi_get_handle(NULL, ecdt_ptr->ec_id, &ec_ecdt->common.handle);
+           acpi_get_handle(NULL, ecdt_ptr->ec_id, &ec_ecdt->handle);
        if (ACPI_FAILURE(status)) {
                goto error;
        }
 
        return 0;
-      error:
-       printk(KERN_ERR PREFIX "Could not use ECDT\n");
+  error:
+       ACPI_EXCEPTION((AE_INFO, status, "Could not use ECDT"));
        kfree(ec_ecdt);
        ec_ecdt = NULL;
 
@@ -1480,14 +970,14 @@ int __init acpi_ec_ecdt_probe(void)
        /*
         * Install GPE handler
         */
-       status = acpi_install_gpe_handler(NULL, ec_ecdt->common.gpe_bit,
+       status = acpi_install_gpe_handler(NULL, ec_ecdt->gpe_bit,
                                          ACPI_GPE_EDGE_TRIGGERED,
                                          &acpi_ec_gpe_handler, ec_ecdt);
        if (ACPI_FAILURE(status)) {
                goto error;
        }
-       acpi_set_gpe_type(NULL, ec_ecdt->common.gpe_bit, ACPI_GPE_TYPE_RUNTIME);
-       acpi_enable_gpe(NULL, ec_ecdt->common.gpe_bit, ACPI_NOT_ISR);
+       acpi_set_gpe_type(NULL, ec_ecdt->gpe_bit, ACPI_GPE_TYPE_RUNTIME);
+       acpi_enable_gpe(NULL, ec_ecdt->gpe_bit, ACPI_NOT_ISR);
 
        status = acpi_install_address_space_handler(ACPI_ROOT_OBJECT,
                                                    ACPI_ADR_SPACE_EC,
@@ -1495,7 +985,7 @@ int __init acpi_ec_ecdt_probe(void)
                                                    &acpi_ec_space_setup,
                                                    ec_ecdt);
        if (ACPI_FAILURE(status)) {
-               acpi_remove_gpe_handler(NULL, ec_ecdt->common.gpe_bit,
+               acpi_remove_gpe_handler(NULL, ec_ecdt->gpe_bit,
                                        &acpi_ec_gpe_handler);
                goto error;
        }
@@ -1503,7 +993,7 @@ int __init acpi_ec_ecdt_probe(void)
        return 0;
 
       error:
-       printk(KERN_ERR PREFIX "Could not use ECDT\n");
+       ACPI_EXCEPTION((AE_INFO, status, "Could not use ECDT"));
        kfree(ec_ecdt);
        ec_ecdt = NULL;
 
@@ -1562,13 +1052,13 @@ static int __init acpi_ec_set_intr_mode(char *str)
                return 0;
 
        if (intr) {
-               acpi_ec_poll_mode = EC_INTR;
-               acpi_ec_driver.ops.add = acpi_ec_intr_add;
+               acpi_ec_mode = EC_INTR;
        } else {
-               acpi_ec_poll_mode = EC_POLL;
-               acpi_ec_driver.ops.add = acpi_ec_poll_add;
+               acpi_ec_mode = EC_POLL;
        }
-       printk(KERN_INFO PREFIX "EC %s mode.\n", intr ? "interrupt" : "polling");
+       acpi_ec_driver.ops.add = acpi_ec_add;
+       ACPI_DEBUG_PRINT((ACPI_DB_INFO, "EC %s mode.\n", intr ? "interrupt" : "polling"));
+
        return 1;
 }
 
index 6eef4efddcf62b0f83fba9f2014b61403e4564fe..ee2a10bf907745ceef823a5d9a2ecd637ae51b2c 100644 (file)
@@ -342,20 +342,8 @@ static u32 acpi_ev_global_lock_handler(void *context)
        if (acquired) {
 
                /* Got the lock, now wake all threads waiting for it */
-
                acpi_gbl_global_lock_acquired = TRUE;
-
-               /* Run the Global Lock thread which will signal all waiting threads */
-
-               status =
-                   acpi_os_execute(OSL_GLOBAL_LOCK_HANDLER,
-                                   acpi_ev_global_lock_thread, context);
-               if (ACPI_FAILURE(status)) {
-                       ACPI_EXCEPTION((AE_INFO, status,
-                                       "Could not queue Global Lock thread"));
-
-                       return (ACPI_INTERRUPT_NOT_HANDLED);
-               }
+               acpi_ev_global_lock_thread(context);
        }
 
        return (ACPI_INTERRUPT_HANDLED);
index 5b3c7a85eb9a609e7e1fcbc8910f15e95e5f1f26..203d1359190af2c8d52f694f506eda23d75de4bd 100644 (file)
@@ -225,13 +225,12 @@ acpi_ev_pci_config_region_setup(acpi_handle handle,
                                if (!
                                    (ACPI_STRNCMP
                                     (object_hID.value, PCI_ROOT_HID_STRING,
-                                     sizeof(PCI_ROOT_HID_STRING))
-                                    ||
-                                    !(ACPI_STRNCMP
-                                      (object_hID.value,
-                                       PCI_EXPRESS_ROOT_HID_STRING,
-                                       sizeof(PCI_EXPRESS_ROOT_HID_STRING)))))
-                               {
+                                     sizeof(PCI_ROOT_HID_STRING)))
+                                   ||
+                                   !(ACPI_STRNCMP
+                                     (object_hID.value,
+                                      PCI_EXPRESS_ROOT_HID_STRING,
+                                      sizeof(PCI_EXPRESS_ROOT_HID_STRING)))) {
 
                                        /* Install a handler for this PCI root bridge */
 
index 15fc12482ba0ab723b8121f13b9562e128e9cc32..003a9876c9683bee7de662e5959f06ec42ed91f9 100644 (file)
@@ -1702,13 +1702,11 @@ static struct ibm_struct ibms[] = {
         .name = "brightness",
         .read = brightness_read,
         .write = brightness_write,
-        .experimental = 1,
         },
        {
         .name = "volume",
         .read = volume_read,
         .write = volume_write,
-        .experimental = 1,
         },
        {
         .name = "fan",
index ec6b7f9ede34d911818075d75eb11f7d95f02b87..2e17ec75af03e84756689ce8bca915f2b0e3c2d5 100644 (file)
@@ -48,6 +48,12 @@ ACPI_MODULE_NAME("acpi_motherboard")
  * the io ports if they really know they can use it, while
  * still preventing hotplug PCI devices from using it.
  */
+
+/*
+ * When CONFIG_PNP is enabled, pnp/system.c binds to PNP0C01
+ * and PNP0C02, redundant with acpi_reserve_io_ranges().
+ * But acpi_reserve_io_ranges() is necessary for !CONFIG_PNP.
+ */
 static acpi_status acpi_reserve_io_ranges(struct acpi_resource *res, void *data)
 {
        struct resource *requested_res = NULL;
index 068fe4f100b0f8e609cd73576f53930c66bdbb4c..c84286cbbe2571e3c5b4fb62bf60b93942ff941a 100644 (file)
@@ -73,6 +73,7 @@ static unsigned int acpi_irq_irq;
 static acpi_osd_handler acpi_irq_handler;
 static void *acpi_irq_context;
 static struct workqueue_struct *kacpid_wq;
+static struct workqueue_struct *kacpi_notify_wq;
 
 acpi_status acpi_os_initialize(void)
 {
@@ -91,8 +92,9 @@ acpi_status acpi_os_initialize1(void)
                return AE_NULL_ENTRY;
        }
        kacpid_wq = create_singlethread_workqueue("kacpid");
+       kacpi_notify_wq = create_singlethread_workqueue("kacpi_notify");
        BUG_ON(!kacpid_wq);
-
+       BUG_ON(!kacpi_notify_wq);
        return AE_OK;
 }
 
@@ -104,6 +106,7 @@ acpi_status acpi_os_terminate(void)
        }
 
        destroy_workqueue(kacpid_wq);
+       destroy_workqueue(kacpi_notify_wq);
 
        return AE_OK;
 }
@@ -566,10 +569,7 @@ void acpi_os_derive_pci_id(acpi_handle rhandle,    /* upper bound  */
 
 static void acpi_os_execute_deferred(void *context)
 {
-       struct acpi_os_dpc *dpc = NULL;
-
-
-       dpc = (struct acpi_os_dpc *)context;
+       struct acpi_os_dpc *dpc = (struct acpi_os_dpc *)context;
        if (!dpc) {
                printk(KERN_ERR PREFIX "Invalid (NULL) context\n");
                return;
@@ -604,14 +604,12 @@ acpi_status acpi_os_execute(acpi_execute_type type,
        struct acpi_os_dpc *dpc;
        struct work_struct *task;
 
-       ACPI_FUNCTION_TRACE("os_queue_for_execution");
-
        ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
                          "Scheduling function [%p(%p)] for deferred execution.\n",
                          function, context));
 
        if (!function)
-               return_ACPI_STATUS(AE_BAD_PARAMETER);
+               return AE_BAD_PARAMETER;
 
        /*
         * Allocate/initialize DPC structure.  Note that this memory will be
@@ -624,26 +622,20 @@ acpi_status acpi_os_execute(acpi_execute_type type,
         * from the same memory.
         */
 
-       dpc =
-           kmalloc(sizeof(struct acpi_os_dpc) + sizeof(struct work_struct),
-                   GFP_ATOMIC);
+       dpc = kmalloc(sizeof(struct acpi_os_dpc) +
+                       sizeof(struct work_struct), GFP_ATOMIC);
        if (!dpc)
-               return_ACPI_STATUS(AE_NO_MEMORY);
-
+               return AE_NO_MEMORY;
        dpc->function = function;
        dpc->context = context;
-
        task = (void *)(dpc + 1);
        INIT_WORK(task, acpi_os_execute_deferred, (void *)dpc);
-
-       if (!queue_work(kacpid_wq, task)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Call to queue_work() failed.\n"));
-               kfree(dpc);
+       if (!queue_work((type == OSL_NOTIFY_HANDLER)?
+                       kacpi_notify_wq : kacpid_wq, task)) {
                status = AE_ERROR;
+               kfree(dpc);
        }
-
-       return_ACPI_STATUS(status);
+       return status;
 }
 
 EXPORT_SYMBOL(acpi_os_execute);
index 7f3e7e77e79436e9984c52a4d6c80345f3f3265d..d53bd9878ca2ccddcee6cde058d8781c74b698ba 100644 (file)
@@ -307,7 +307,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
        if (!link || !irq)
                return -EINVAL;
 
-       resource = kmalloc(sizeof(*resource) + 1, GFP_ATOMIC);
+       resource = kmalloc(sizeof(*resource) + 1, irqs_disabled() ? GFP_ATOMIC: GFP_KERNEL);
        if (!resource)
                return -ENOMEM;
 
index fec225d1b6b74520f6b132c2bcefd5dcb600b484..fe67a8af520ecdb715e020511b028c3b6d7f865c 100644 (file)
@@ -216,10 +216,8 @@ static int acpi_power_off_device(acpi_handle handle)
 {
        int result = 0;
        acpi_status status = AE_OK;
-       struct acpi_device *device = NULL;
        struct acpi_power_resource *resource = NULL;
 
-
        result = acpi_power_get_context(handle, &resource);
        if (result)
                return result;
@@ -230,13 +228,13 @@ static int acpi_power_off_device(acpi_handle handle)
        if (resource->references) {
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                                  "Resource [%s] is still in use, dereferencing\n",
-                                 device->pnp.bus_id));
+                                 resource->device->pnp.bus_id));
                return 0;
        }
 
        if (resource->state == ACPI_POWER_RESOURCE_STATE_OFF) {
                ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] already off\n",
-                                 device->pnp.bus_id));
+                                 resource->device->pnp.bus_id));
                return 0;
        }
 
@@ -251,8 +249,7 @@ static int acpi_power_off_device(acpi_handle handle)
                return -ENOEXEC;
 
        /* Update the power resource's _device_ power state */
-       device = resource->device;
-       device->power.state = ACPI_STATE_D3;
+       resource->device->power.state = ACPI_STATE_D3;
 
        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] turned off\n",
                          resource->name));
index b13d64415b7ab651fc42be5b13351427d9dad6a3..1908e0d202226a47b0f839439a84f599d91649b1 100644 (file)
@@ -519,7 +519,7 @@ static int acpi_processor_get_info(struct acpi_processor *pr)
 
 static void *processor_device_array[NR_CPUS];
 
-static int acpi_processor_start(struct acpi_device *device)
+static int __cpuinit acpi_processor_start(struct acpi_device *device)
 {
        int result = 0;
        acpi_status status = AE_OK;
index 0a395fca843b46686b748ffe1583515cc863e9af..65b3f056ad895a7d0f524f7412ff861ce9298649 100644 (file)
@@ -219,6 +219,23 @@ static void acpi_safe_halt(void)
 
 static atomic_t c3_cpu_count;
 
+/* Common C-state entry for C2, C3, .. */
+static void acpi_cstate_enter(struct acpi_processor_cx *cstate)
+{
+       if (cstate->space_id == ACPI_CSTATE_FFH) {
+               /* Call into architectural FFH based C-state */
+               acpi_processor_ffh_cstate_enter(cstate);
+       } else {
+               int unused;
+               /* IO port based C-state */
+               inb(cstate->address);
+               /* Dummy wait op - must do something useless after P_LVL2 read
+                  because chipsets cannot guarantee that STPCLK# signal
+                  gets asserted in time to freeze execution properly. */
+               unused = inl(acpi_fadt.xpm_tmr_blk.address);
+       }
+}
+
 static void acpi_processor_idle(void)
 {
        struct acpi_processor *pr = NULL;
@@ -361,11 +378,7 @@ static void acpi_processor_idle(void)
                /* Get start time (ticks) */
                t1 = inl(acpi_fadt.xpm_tmr_blk.address);
                /* Invoke C2 */
-               inb(cx->address);
-               /* Dummy wait op - must do something useless after P_LVL2 read
-                  because chipsets cannot guarantee that STPCLK# signal
-                  gets asserted in time to freeze execution properly. */
-               t2 = inl(acpi_fadt.xpm_tmr_blk.address);
+               acpi_cstate_enter(cx);
                /* Get end time (ticks) */
                t2 = inl(acpi_fadt.xpm_tmr_blk.address);
 
@@ -401,9 +414,7 @@ static void acpi_processor_idle(void)
                /* Get start time (ticks) */
                t1 = inl(acpi_fadt.xpm_tmr_blk.address);
                /* Invoke C3 */
-               inb(cx->address);
-               /* Dummy wait op (see above) */
-               t2 = inl(acpi_fadt.xpm_tmr_blk.address);
+               acpi_cstate_enter(cx);
                /* Get end time (ticks) */
                t2 = inl(acpi_fadt.xpm_tmr_blk.address);
                if (pr->flags.bm_check) {
@@ -628,20 +639,16 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr)
        return 0;
 }
 
-static int acpi_processor_get_power_info_default_c1(struct acpi_processor *pr)
+static int acpi_processor_get_power_info_default(struct acpi_processor *pr)
 {
-
-       /* Zero initialize all the C-states info. */
-       memset(pr->power.states, 0, sizeof(pr->power.states));
-
-       /* set the first C-State to C1 */
-       pr->power.states[ACPI_STATE_C1].type = ACPI_STATE_C1;
-
-       /* the C0 state only exists as a filler in our array,
-        * and all processors need to support C1 */
+       if (!pr->power.states[ACPI_STATE_C1].valid) {
+               /* set the first C-State to C1 */
+               /* all processors need to support C1 */
+               pr->power.states[ACPI_STATE_C1].type = ACPI_STATE_C1;
+               pr->power.states[ACPI_STATE_C1].valid = 1;
+       }
+       /* the C0 state only exists as a filler in our array */
        pr->power.states[ACPI_STATE_C0].valid = 1;
-       pr->power.states[ACPI_STATE_C1].valid = 1;
-
        return 0;
 }
 
@@ -658,12 +665,7 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
        if (nocst)
                return -ENODEV;
 
-       current_count = 1;
-
-       /* Zero initialize C2 onwards and prepare for fresh CST lookup */
-       for (i = 2; i < ACPI_PROCESSOR_MAX_POWER; i++)
-               memset(&(pr->power.states[i]), 0, 
-                               sizeof(struct acpi_processor_cx));
+       current_count = 0;
 
        status = acpi_evaluate_object(pr->handle, "_CST", NULL, &buffer);
        if (ACPI_FAILURE(status)) {
@@ -718,22 +720,39 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
                    (reg->space_id != ACPI_ADR_SPACE_FIXED_HARDWARE))
                        continue;
 
-               cx.address = (reg->space_id == ACPI_ADR_SPACE_FIXED_HARDWARE) ?
-                   0 : reg->address;
-
                /* There should be an easy way to extract an integer... */
                obj = (union acpi_object *)&(element->package.elements[1]);
                if (obj->type != ACPI_TYPE_INTEGER)
                        continue;
 
                cx.type = obj->integer.value;
-
-               if ((cx.type != ACPI_STATE_C1) &&
-                   (reg->space_id != ACPI_ADR_SPACE_SYSTEM_IO))
-                       continue;
-
-               if ((cx.type < ACPI_STATE_C2) || (cx.type > ACPI_STATE_C3))
-                       continue;
+               /*
+                * Some buggy BIOSes won't list C1 in _CST -
+                * Let acpi_processor_get_power_info_default() handle them later
+                */
+               if (i == 1 && cx.type != ACPI_STATE_C1)
+                       current_count++;
+
+               cx.address = reg->address;
+               cx.index = current_count + 1;
+
+               cx.space_id = ACPI_CSTATE_SYSTEMIO;
+               if (reg->space_id == ACPI_ADR_SPACE_FIXED_HARDWARE) {
+                       if (acpi_processor_ffh_cstate_probe
+                                       (pr->id, &cx, reg) == 0) {
+                               cx.space_id = ACPI_CSTATE_FFH;
+                       } else if (cx.type != ACPI_STATE_C1) {
+                               /*
+                                * C1 is a special case where FIXED_HARDWARE
+                                * can be handled in non-MWAIT way as well.
+                                * In that case, save this _CST entry info.
+                                * That is, we retain space_id of SYSTEM_IO for
+                                * halt based C1.
+                                * Otherwise, ignore this info and continue.
+                                */
+                               continue;
+                       }
+               }
 
                obj = (union acpi_object *)&(element->package.elements[2]);
                if (obj->type != ACPI_TYPE_INTEGER)
@@ -938,11 +957,17 @@ static int acpi_processor_get_power_info(struct acpi_processor *pr)
        /* NOTE: the idle thread may not be running while calling
         * this function */
 
-       /* Adding C1 state */
-       acpi_processor_get_power_info_default_c1(pr);
+       /* Zero initialize all the C-states info. */
+       memset(pr->power.states, 0, sizeof(pr->power.states));
+
        result = acpi_processor_get_power_info_cst(pr);
        if (result == -ENODEV)
-               acpi_processor_get_power_info_fadt(pr);
+               result = acpi_processor_get_power_info_fadt(pr);
+
+       if (result)
+               return result;
+
+       acpi_processor_get_power_info_default(pr);
 
        pr->power.count = acpi_processor_power_verify(pr);
 
@@ -1083,6 +1108,7 @@ static const struct file_operations acpi_processor_power_fops = {
        .release = single_release,
 };
 
+#ifdef CONFIG_SMP
 static void smp_callback(void *v)
 {
        /* we already woke the CPU up, nothing more to do */
@@ -1104,8 +1130,9 @@ static int acpi_processor_latency_notify(struct notifier_block *b,
 static struct notifier_block acpi_processor_latency_notifier = {
        .notifier_call = acpi_processor_latency_notify,
 };
+#endif
 
-int acpi_processor_power_init(struct acpi_processor *pr,
+int __cpuinit acpi_processor_power_init(struct acpi_processor *pr,
                              struct acpi_device *device)
 {
        acpi_status status = 0;
@@ -1121,7 +1148,9 @@ int acpi_processor_power_init(struct acpi_processor *pr,
                               "ACPI: processor limited to max C-state %d\n",
                               max_cstate);
                first_run++;
+#ifdef CONFIG_SMP
                register_latency_notifier(&acpi_processor_latency_notifier);
+#endif
        }
 
        if (!pr)
@@ -1193,7 +1222,9 @@ int acpi_processor_power_exit(struct acpi_processor *pr,
                 * copies of pm_idle before proceeding.
                 */
                cpu_idle_wait();
+#ifdef CONFIG_SMP
                unregister_latency_notifier(&acpi_processor_latency_notifier);
+#endif
        }
 
        return 0;
index 62bef0b3b614aef8d10742cd3494e9ecca149675..8908a975e5753ca028179298e008502b774eb3f2 100644 (file)
@@ -98,11 +98,11 @@ static int update_info_mode = UPDATE_INFO_MODE;
 static int update_time = UPDATE_TIME;
 static int update_time2 = UPDATE_TIME2;
 
-module_param(capacity_mode, int, CAPACITY_UNIT);
-module_param(update_mode, int, UPDATE_MODE);
-module_param(update_info_mode, int, UPDATE_INFO_MODE);
-module_param(update_time, int, UPDATE_TIME);
-module_param(update_time2, int, UPDATE_TIME2);
+module_param(capacity_mode, int, 0);
+module_param(update_mode, int, 0);
+module_param(update_info_mode, int, 0);
+module_param(update_time, int, 0);
+module_param(update_time2, int, 0);
 
 static int acpi_sbs_add(struct acpi_device *device);
 static int acpi_sbs_remove(struct acpi_device *device, int type);
@@ -1685,10 +1685,16 @@ static int acpi_sbs_add(struct acpi_device *device)
 
 int acpi_sbs_remove(struct acpi_device *device, int type)
 {
-       struct acpi_sbs *sbs = (struct acpi_sbs *)acpi_driver_data(device);
+       struct acpi_sbs *sbs = NULL;
        int id;
 
-       if (!device || !sbs) {
+       if (!device) {
+               return -EINVAL;
+       }
+
+       sbs = (struct acpi_sbs *)acpi_driver_data(device);
+
+       if (!sbs) {
                return -EINVAL;
        }
 
index 7856db759af0be7579abcd1733e74d1782455dbe..11e2d4454e053f6ece5f8d6aab31e5b6491e8f0a 100644 (file)
@@ -324,7 +324,7 @@ acpi_tb_get_this_table(struct acpi_pointer *address,
 
        if (header->length < sizeof(struct acpi_table_header)) {
                ACPI_ERROR((AE_INFO,
-                           "Table length (%X) is smaller than minimum (%X)",
+                           "Table length (%X) is smaller than minimum (%zX)",
                            header->length, sizeof(struct acpi_table_header)));
 
                return_ACPI_STATUS(AE_INVALID_TABLE_LENGTH);
index 0ad3dbb9ebca377563a6a177ab092704f63545f8..86a5fca9b739de2b9d42344dc6c5406c55f17f73 100644 (file)
@@ -187,7 +187,7 @@ acpi_status acpi_tb_validate_rsdt(struct acpi_table_header *table_ptr)
 
        if (table_ptr->length < sizeof(struct acpi_table_header)) {
                ACPI_ERROR((AE_INFO,
-                           "RSDT/XSDT length (%X) is smaller than minimum (%X)",
+                           "RSDT/XSDT length (%X) is smaller than minimum (%zX)",
                            table_ptr->length,
                            sizeof(struct acpi_table_header)));
 
index 3f4aa0c99ee4dccaf096330732887bc5be153f79..03f6338acc8fb7223e040078b1f196d28835c444 100644 (file)
@@ -6,6 +6,7 @@ menu "Serial ATA (prod) and Parallel ATA (experimental) drivers"
 
 config ATA
        tristate "ATA device support"
+       depends on BLOCK
        depends on !(M32R || M68K) || BROKEN
        depends on !SUN4 || BROKEN
        select SCSI
index 25929123ffff3fdd6a927aa4113a232c2c074708..cef2e70d64f8d57d2e62bbec19a5fda752e05d40 100644 (file)
@@ -1041,7 +1041,7 @@ static void ahci_host_intr(struct ata_port *ap)
        /* hmmm... a spurious interupt */
 
        /* some devices send D2H reg with I bit set during NCQ command phase */
-       if (ap->sactive && status & PORT_IRQ_D2H_REG_FIS)
+       if (ap->sactive && (status & PORT_IRQ_D2H_REG_FIS))
                return;
 
        /* ignore interim PIO setup fis interrupts */
index 5719704eb0ee5a6d5699399cf2edb3b12f174f18..5250187ffce2a610f456e3814d019bc3a4b656b6 100644 (file)
@@ -432,9 +432,9 @@ static const struct piix_map_db ich8_map_db = {
        .present_shift = 8,
        .map = {
                /* PM   PS   SM   SS       MAP */
-               {  P0,  NA,  P1,  NA }, /* 00b (hardwired) */
+               {  P0,  P2,  P1,  P3 }, /* 00b (hardwired when in AHCI) */
                {  RV,  RV,  RV,  RV },
-               {  RV,  RV,  RV,  RV }, /* 10b (never) */
+               {  IDE,  IDE,  NA,  NA }, /* 10b (IDE mode) */
                {  RV,  RV,  RV,  RV },
        },
 };
index 06daaa3736a2cbcd35efde2e377d0ad90cfc5d98..7645f2b30ccf2f35547025ed3f07e85700dcf9eb 100644 (file)
@@ -981,6 +981,15 @@ int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info,
                mask = (1 << 2) | (1 << 0);
                if ((tmp8 & mask) != mask)
                        legacy_mode = (1 << 3);
+#if defined(CONFIG_NO_ATA_LEGACY)
+               /* Some platforms with PCI limits cannot address compat
+                  port space. In that case we punt if their firmware has
+                  left a device in compatibility mode */
+               if (legacy_mode) {
+                       printk(KERN_ERR "ata: Compatibility mode ATA is not supported on this platform, skipping.\n");
+                       return -EOPNOTSUPP;
+               }
+#endif
        }
 
        rc = pci_request_regions(pdev, DRV_NAME);
index 323592de047b5fecc58c13f382b05e2da985c27e..9fffa7af6db1f5c2feaf448fd7dec744e41ab308 100644 (file)
@@ -2452,8 +2452,8 @@ static int __init amb_module_init (void)
 static void __exit amb_module_exit (void)
 {
   PRINTD (DBG_FLOW|DBG_INIT, "cleanup_module");
-  
-  return pci_unregister_driver(&amb_driver);
+
+  pci_unregister_driver(&amb_driver);
 }
 
 module_init(amb_module_init);
index 40ab9b65fae9ecc57aeea36a35b99cd0b38bedac..697ad82f6634e2f74e4c3298d17f6ac13d0162cc 100644 (file)
@@ -1002,6 +1002,10 @@ static int fs_open(struct atm_vcc *atm_vcc)
                                        r = ROUND_UP;
                                }
                                error = make_rate (pcr, r, &tmc0, NULL);
+                               if (error) {
+                                       kfree(tc);
+                                       return error;
+                               }
                        }
                        fs_dprintk (FS_DEBUG_OPEN, "pcr = %d.\n", pcr);
                }
index f59349206dd29f9a918cad1531dfc26ce07e91a5..44268cba5a5a215c3f8de6a78af1ada1653cd393 100644 (file)
@@ -2932,8 +2932,8 @@ static int __init hrz_module_init (void) {
 
 static void __exit hrz_module_exit (void) {
   PRINTD (DBG_FLOW, "cleanup_module");
-  
-  return pci_unregister_driver(&hrz_driver);
+
+  pci_unregister_driver(&hrz_driver);
 }
 
 module_init(hrz_module_init);
index 632ede552761cb92c7276b16542e998a5f1d0db5..bd09045948054ab836fe3b14f9f0384a85b08f86 100644 (file)
@@ -2759,7 +2759,7 @@ static int ns_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg)
 {
    ns_dev *card;
    pool_levels pl;
-   int btype;
+   long btype;
    unsigned long flags;
 
    card = dev->dev_data;
@@ -2859,7 +2859,7 @@ static int ns_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg)
       case NS_ADJBUFLEV:
          if (!capable(CAP_NET_ADMIN))
            return -EPERM;
-         btype = (int) arg;    /* an int is the same size as a pointer */
+         btype = (long) arg;   /* a long is the same size as a pointer or bigger */
          switch (btype)
         {
            case NS_BUFTYPE_SMALL:
index 12173d16bea7332b9b76e8f19d6568dc01c5a2fd..7d8a7ce73fb314a22d8d2ec51c8717b2ab10cc0b 100644 (file)
@@ -372,19 +372,30 @@ int bus_add_device(struct device * dev)
                pr_debug("bus %s: add device %s\n", bus->name, dev->bus_id);
                error = device_add_attrs(bus, dev);
                if (error)
-                       goto out;
+                       goto out_put;
                error = sysfs_create_link(&bus->devices.kobj,
                                                &dev->kobj, dev->bus_id);
                if (error)
-                       goto out;
+                       goto out_id;
                error = sysfs_create_link(&dev->kobj,
                                &dev->bus->subsys.kset.kobj, "subsystem");
                if (error)
-                       goto out;
+                       goto out_subsys;
                error = sysfs_create_link(&dev->kobj,
                                &dev->bus->subsys.kset.kobj, "bus");
+               if (error)
+                       goto out_deprecated;
        }
-out:
+       return 0;
+
+out_deprecated:
+       sysfs_remove_link(&dev->kobj, "subsystem");
+out_subsys:
+       sysfs_remove_link(&bus->devices.kobj, dev->bus_id);
+out_id:
+       device_remove_attrs(bus, dev);
+out_put:
+       put_bus(dev->bus);
        return error;
 }
 
@@ -428,8 +439,10 @@ void bus_remove_device(struct device * dev)
                sysfs_remove_link(&dev->kobj, "bus");
                sysfs_remove_link(&dev->bus->devices.kobj, dev->bus_id);
                device_remove_attrs(dev->bus, dev);
-               dev->is_registered = 0;
-               klist_del(&dev->knode_bus);
+               if (dev->is_registered) {
+                       dev->is_registered = 0;
+                       klist_del(&dev->knode_bus);
+               }
                pr_debug("bus %s: remove device %s\n", dev->bus->name, dev->bus_id);
                device_release_driver(dev);
                put_bus(dev->bus);
@@ -505,34 +518,36 @@ int bus_add_driver(struct device_driver *drv)
        struct bus_type * bus = get_bus(drv->bus);
        int error = 0;
 
-       if (bus) {
-               pr_debug("bus %s: add driver %s\n", bus->name, drv->name);
-               error = kobject_set_name(&drv->kobj, "%s", drv->name);
-               if (error)
-                       goto out_put_bus;
-               drv->kobj.kset = &bus->drivers;
-               if ((error = kobject_register(&drv->kobj)))
-                       goto out_put_bus;
-
-               error = driver_attach(drv);
-               if (error)
-                       goto out_unregister;
-               klist_add_tail(&drv->knode_bus, &bus->klist_drivers);
-               module_add_driver(drv->owner, drv);
-
-               error = driver_add_attrs(bus, drv);
-               if (error) {
-                       /* How the hell do we get out of this pickle? Give up */
-                       printk(KERN_ERR "%s: driver_add_attrs(%s) failed\n",
-                               __FUNCTION__, drv->name);
-               }
-               error = add_bind_files(drv);
-               if (error) {
-                       /* Ditto */
-                       printk(KERN_ERR "%s: add_bind_files(%s) failed\n",
-                               __FUNCTION__, drv->name);
-               }
+       if (!bus)
+               return 0;
+
+       pr_debug("bus %s: add driver %s\n", bus->name, drv->name);
+       error = kobject_set_name(&drv->kobj, "%s", drv->name);
+       if (error)
+               goto out_put_bus;
+       drv->kobj.kset = &bus->drivers;
+       if ((error = kobject_register(&drv->kobj)))
+               goto out_put_bus;
+
+       error = driver_attach(drv);
+       if (error)
+               goto out_unregister;
+       klist_add_tail(&drv->knode_bus, &bus->klist_drivers);
+       module_add_driver(drv->owner, drv);
+
+       error = driver_add_attrs(bus, drv);
+       if (error) {
+               /* How the hell do we get out of this pickle? Give up */
+               printk(KERN_ERR "%s: driver_add_attrs(%s) failed\n",
+                       __FUNCTION__, drv->name);
        }
+       error = add_bind_files(drv);
+       if (error) {
+               /* Ditto */
+               printk(KERN_ERR "%s: add_bind_files(%s) failed\n",
+                       __FUNCTION__, drv->name);
+       }
+
        return error;
 out_unregister:
        kobject_unregister(&drv->kobj);
@@ -552,16 +567,17 @@ out_put_bus:
 
 void bus_remove_driver(struct device_driver * drv)
 {
-       if (drv->bus) {
-               remove_bind_files(drv);
-               driver_remove_attrs(drv->bus, drv);
-               klist_remove(&drv->knode_bus);
-               pr_debug("bus %s: remove driver %s\n", drv->bus->name, drv->name);
-               driver_detach(drv);
-               module_remove_driver(drv);
-               kobject_unregister(&drv->kobj);
-               put_bus(drv->bus);
-       }
+       if (!drv->bus)
+               return;
+
+       remove_bind_files(drv);
+       driver_remove_attrs(drv->bus, drv);
+       klist_remove(&drv->knode_bus);
+       pr_debug("bus %s: remove driver %s\n", drv->bus->name, drv->name);
+       driver_detach(drv);
+       module_remove_driver(drv);
+       kobject_unregister(&drv->kobj);
+       put_bus(drv->bus);
 }
 
 
@@ -732,11 +748,15 @@ int bus_register(struct bus_type * bus)
 
        klist_init(&bus->klist_devices, klist_devices_get, klist_devices_put);
        klist_init(&bus->klist_drivers, NULL, NULL);
-       bus_add_attrs(bus);
+       retval = bus_add_attrs(bus);
+       if (retval)
+               goto bus_attrs_fail;
 
        pr_debug("bus type '%s' registered\n", bus->name);
        return 0;
 
+bus_attrs_fail:
+       kset_unregister(&bus->drivers);
 bus_drivers_fail:
        kset_unregister(&bus->devices);
 bus_devices_fail:
index b32b77ff2dcd7c1814c66318a477b74840b88e2f..0ff267a248dba8ff5e215a380a54ea0f4221c7ce 100644 (file)
@@ -562,7 +562,10 @@ int class_device_add(struct class_device *class_dev)
                goto out2;
 
        /* add the needed attributes to this device */
-       sysfs_create_link(&class_dev->kobj, &parent_class->subsys.kset.kobj, "subsystem");
+       error = sysfs_create_link(&class_dev->kobj,
+                                 &parent_class->subsys.kset.kobj, "subsystem");
+       if (error)
+               goto out3;
        class_dev->uevent_attr.attr.name = "uevent";
        class_dev->uevent_attr.attr.mode = S_IWUSR;
        class_dev->uevent_attr.attr.owner = parent_class->owner;
index b224bb43ff638f812694efe1e4c8eaa5bbd47967..68ad11af22b41e307277f3826be989c37dbe2bbf 100644 (file)
@@ -44,7 +44,7 @@ const char *dev_driver_string(struct device *dev)
        return dev->driver ? dev->driver->name :
                        (dev->bus ? dev->bus->name : "");
 }
-EXPORT_SYMBOL_GPL(dev_driver_string);
+EXPORT_SYMBOL(dev_driver_string);
 
 #define to_dev(obj) container_of(obj, struct device, kobj)
 #define to_dev_attr(_attr) container_of(_attr, struct device_attribute, attr)
@@ -433,14 +433,16 @@ int device_add(struct device *dev)
        if (dev->driver)
                dev->uevent_attr.attr.owner = dev->driver->owner;
        dev->uevent_attr.store = store_uevent;
-       device_create_file(dev, &dev->uevent_attr);
+       error = device_create_file(dev, &dev->uevent_attr);
+       if (error)
+               goto attrError;
 
        if (MAJOR(dev->devt)) {
                struct device_attribute *attr;
                attr = kzalloc(sizeof(*attr), GFP_KERNEL);
                if (!attr) {
                        error = -ENOMEM;
-                       goto PMError;
+                       goto ueventattrError;
                }
                attr->attr.name = "dev";
                attr->attr.mode = S_IRUGO;
@@ -450,7 +452,7 @@ int device_add(struct device *dev)
                error = device_create_file(dev, attr);
                if (error) {
                        kfree(attr);
-                       goto attrError;
+                       goto ueventattrError;
                }
 
                dev->devt_attr = attr;
@@ -477,7 +479,8 @@ int device_add(struct device *dev)
        if ((error = bus_add_device(dev)))
                goto BusError;
        kobject_uevent(&dev->kobj, KOBJ_ADD);
-       bus_attach_device(dev);
+       if ((error = bus_attach_device(dev)))
+               goto AttachError;
        if (parent)
                klist_add_tail(&dev->knode_parent, &parent->klist_children);
 
@@ -496,6 +499,8 @@ int device_add(struct device *dev)
        kfree(class_name);
        put_device(dev);
        return error;
+ AttachError:
+       bus_remove_device(dev);
  BusError:
        device_pm_remove(dev);
  PMError:
@@ -507,6 +512,8 @@ int device_add(struct device *dev)
                device_remove_file(dev, dev->devt_attr);
                kfree(dev->devt_attr);
        }
+ ueventattrError:
+       device_remove_file(dev, &dev->uevent_attr);
  attrError:
        kobject_uevent(&dev->kobj, KOBJ_REMOVE);
        kobject_del(&dev->kobj);
@@ -805,8 +812,10 @@ int device_rename(struct device *dev, char *new_name)
 
        if (dev->class) {
                old_symlink_name = kmalloc(BUS_ID_SIZE, GFP_KERNEL);
-               if (!old_symlink_name)
-                       return -ENOMEM;
+               if (!old_symlink_name) {
+                       error = -ENOMEM;
+                       goto out_free_old_class;
+               }
                strlcpy(old_symlink_name, dev->bus_id, BUS_ID_SIZE);
        }
 
@@ -830,9 +839,10 @@ int device_rename(struct device *dev, char *new_name)
        }
        put_device(dev);
 
-       kfree(old_class_name);
        kfree(new_class_name);
        kfree(old_symlink_name);
+ out_free_old_class:
+       kfree(old_class_name);
 
        return error;
 }
index b5f43c3e44fa2a5c9d5bf23898ea57472e7b38ae..db01b95a47a501d5976c04d66052a8809f026f29 100644 (file)
@@ -171,6 +171,8 @@ int driver_probe_device(struct device_driver * drv, struct device * dev)
                 drv->bus->name, dev->bus_id, drv->name);
 
        data = kmalloc(sizeof(*data), GFP_KERNEL);
+       if (!data)
+               return -ENOMEM;
        data->drv = drv;
        data->dev = dev;
 
@@ -178,7 +180,7 @@ int driver_probe_device(struct device_driver * drv, struct device * dev)
                probe_task = kthread_run(really_probe, data,
                                         "probe-%s", dev->bus_id);
                if (IS_ERR(probe_task))
-                       ret = PTR_ERR(probe_task);
+                       ret = really_probe(data);
        } else
                ret = really_probe(data);
 
index 33c5cce1560b261b767fa56faa410e19ed47d5e4..b2efbd4cf710d9d0ce79474c2280d04c6bbd7c42 100644 (file)
@@ -141,11 +141,20 @@ dma_pool_create (const char *name, struct device *dev,
        init_waitqueue_head (&retval->waitq);
 
        if (dev) {
+               int ret;
+
                down (&pools_lock);
                if (list_empty (&dev->dma_pools))
-                       device_create_file (dev, &dev_attr_pools);
+                       ret = device_create_file (dev, &dev_attr_pools);
+               else
+                       ret = 0;
                /* note:  not currently insisting "name" be unique */
-               list_add (&retval->pools, &dev->dma_pools);
+               if (!ret)
+                       list_add (&retval->pools, &dev->dma_pools);
+               else {
+                       kfree(retval);
+                       retval = NULL;
+               }
                up (&pools_lock);
        } else
                INIT_LIST_HEAD (&retval->pools);
index 3ef9d514b916985af339d2af7067903daf9a881e..28dccb730af99032a9bf653990b604df35ff29b9 100644 (file)
@@ -97,8 +97,7 @@ static struct attribute_group topology_attr_group = {
 /* Add/Remove cpu_topology interface for CPU device */
 static int __cpuinit topology_add_dev(struct sys_device * sys_dev)
 {
-       sysfs_create_group(&sys_dev->kobj, &topology_attr_group);
-       return 0;
+       return sysfs_create_group(&sys_dev->kobj, &topology_attr_group);
 }
 
 static int __cpuinit topology_remove_dev(struct sys_device * sys_dev)
index 6eebcb7be97e82fc0f83cb9411c039f5a826cc02..6d111228cfac1848fad99d9687b01e03e1230f7c 100644 (file)
@@ -1,5 +1,5 @@
-/* Copyright (c) 2004 Coraid, Inc.  See COPYING for GPL terms. */
-#define VERSION "22"
+/* Copyright (c) 2006 Coraid, Inc.  See COPYING for GPL terms. */
+#define VERSION "32"
 #define AOE_MAJOR 152
 #define DEVICE_NAME "aoe"
 
@@ -65,7 +65,7 @@ struct aoe_atahdr {
 struct aoe_cfghdr {
        __be16 bufcnt;
        __be16 fwver;
-       unsigned char res;
+       unsigned char scnt;
        unsigned char aoeccmd;
        unsigned char cslen[2];
 };
@@ -78,12 +78,14 @@ enum {
        DEVFL_GDALLOC = (1<<4), /* need to alloc gendisk */
        DEVFL_PAUSE = (1<<5),
        DEVFL_NEWSIZE = (1<<6), /* need to update dev size in block layer */
+       DEVFL_MAXBCNT = (1<<7), /* d->maxbcnt is not changeable */
+       DEVFL_KICKME = (1<<8),
 
        BUFFL_FAIL = 1,
 };
 
 enum {
-       MAXATADATA = 1024,
+       DEFAULTBCNT = 2 * 512,  /* 2 sectors */
        NPERSHELF = 16,         /* number of slots per shelf address */
        FREETAG = -1,
        MIN_BUFS = 8,
@@ -107,11 +109,9 @@ struct frame {
        ulong waited;
        struct buf *buf;
        char *bufaddr;
-       int writedatalen;
-       int ndata;
-
-       /* largest possible */
-       unsigned char data[sizeof(struct aoe_hdr) + sizeof(struct aoe_atahdr)];
+       ulong bcnt;
+       sector_t lba;
+       struct sk_buff *skb;
 };
 
 struct aoedev {
@@ -121,9 +121,12 @@ struct aoedev {
        ulong sysminor;
        ulong aoemajor;
        ulong aoeminor;
-       ulong nopen;            /* (bd_openers isn't available without sleeping) */
-       ulong rttavg;           /* round trip average of requests/responses */
+       u16 nopen;              /* (bd_openers isn't available without sleeping) */
+       u16 lasttag;            /* last tag sent */
+       u16 rttavg;             /* round trip average of requests/responses */
+       u16 mintimer;
        u16 fw_ver;             /* version of blade's firmware */
+       u16 maxbcnt;
        struct work_struct work;/* disk create work struct */
        struct gendisk *gd;
        request_queue_t blkq;
@@ -137,8 +140,8 @@ struct aoedev {
        mempool_t *bufpool;     /* for deadlock-free Buf allocation */
        struct list_head bufq;  /* queue of bios to work on */
        struct buf *inprocess;  /* the one we're currently working on */
-       ulong lasttag;          /* last tag sent */
-       ulong nframes;          /* number of frames below */
+       ushort lostjumbo;
+       ushort nframes;         /* number of frames below */
        struct frame *frames;
 };
 
@@ -157,6 +160,7 @@ void aoecmd_cfg(ushort aoemajor, unsigned char aoeminor);
 void aoecmd_ata_rsp(struct sk_buff *);
 void aoecmd_cfg_rsp(struct sk_buff *);
 void aoecmd_sleepwork(void *vp);
+struct sk_buff *new_skb(ulong);
 
 int aoedev_init(void);
 void aoedev_exit(void);
index 393b86a3dbf8e189ca26913aef7692d38c3072a3..d433f27e0ce2529c1617a6584e42abe55be62d36 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004 Coraid, Inc.  See COPYING for GPL terms. */
+/* Copyright (c) 2006 Coraid, Inc.  See COPYING for GPL terms. */
 /*
  * aoeblk.c
  * block device routines
@@ -14,7 +14,6 @@
 
 static kmem_cache_t *buf_pool_cache;
 
-/* add attributes for our block devices in sysfs */
 static ssize_t aoedisk_show_state(struct gendisk * disk, char *page)
 {
        struct aoedev *d = disk->private_data;
@@ -64,21 +63,26 @@ static struct disk_attribute disk_attr_fwver = {
        .show = aoedisk_show_fwver
 };
 
-static void
+static struct attribute *aoe_attrs[] = {
+       &disk_attr_state.attr,
+       &disk_attr_mac.attr,
+       &disk_attr_netif.attr,
+       &disk_attr_fwver.attr,
+};
+
+static const struct attribute_group attr_group = {
+       .attrs = aoe_attrs,
+};
+
+static int
 aoedisk_add_sysfs(struct aoedev *d)
 {
-       sysfs_create_file(&d->gd->kobj, &disk_attr_state.attr);
-       sysfs_create_file(&d->gd->kobj, &disk_attr_mac.attr);
-       sysfs_create_file(&d->gd->kobj, &disk_attr_netif.attr);
-       sysfs_create_file(&d->gd->kobj, &disk_attr_fwver.attr);
+       return sysfs_create_group(&d->gd->kobj, &attr_group);
 }
 void
 aoedisk_rm_sysfs(struct aoedev *d)
 {
-       sysfs_remove_link(&d->gd->kobj, "state");
-       sysfs_remove_link(&d->gd->kobj, "mac");
-       sysfs_remove_link(&d->gd->kobj, "netif");
-       sysfs_remove_link(&d->gd->kobj, "firmware-version");
+       sysfs_remove_group(&d->gd->kobj, &attr_group);
 }
 
 static int
@@ -132,8 +136,7 @@ aoeblk_make_request(request_queue_t *q, struct bio *bio)
        d = bio->bi_bdev->bd_disk->private_data;
        buf = mempool_alloc(d->bufpool, GFP_NOIO);
        if (buf == NULL) {
-               printk(KERN_INFO "aoe: aoeblk_make_request: buf allocation "
-                       "failure\n");
+               printk(KERN_INFO "aoe: buf allocation failure\n");
                bio_endio(bio, bio->bi_size, -ENOMEM);
                return 0;
        }
@@ -143,14 +146,15 @@ aoeblk_make_request(request_queue_t *q, struct bio *bio)
        buf->bio = bio;
        buf->resid = bio->bi_size;
        buf->sector = bio->bi_sector;
-       buf->bv = buf->bio->bi_io_vec;
+       buf->bv = &bio->bi_io_vec[bio->bi_idx];
+       WARN_ON(buf->bv->bv_len == 0);
        buf->bv_resid = buf->bv->bv_len;
        buf->bufaddr = page_address(buf->bv->bv_page) + buf->bv->bv_offset;
 
        spin_lock_irqsave(&d->lock, flags);
 
        if ((d->flags & DEVFL_UP) == 0) {
-               printk(KERN_INFO "aoe: aoeblk_make_request: device %ld.%ld is not up\n",
+               printk(KERN_INFO "aoe: device %ld.%ld is not up\n",
                        d->aoemajor, d->aoeminor);
                spin_unlock_irqrestore(&d->lock, flags);
                mempool_free(buf, d->bufpool);
@@ -176,7 +180,7 @@ aoeblk_getgeo(struct block_device *bdev, struct hd_geometry *geo)
        struct aoedev *d = bdev->bd_disk->private_data;
 
        if ((d->flags & DEVFL_UP) == 0) {
-               printk(KERN_ERR "aoe: aoeblk_ioctl: disk not up\n");
+               printk(KERN_ERR "aoe: disk not up\n");
                return -ENODEV;
        }
 
@@ -203,8 +207,8 @@ aoeblk_gdalloc(void *vp)
 
        gd = alloc_disk(AOE_PARTITIONS);
        if (gd == NULL) {
-               printk(KERN_ERR "aoe: aoeblk_gdalloc: cannot allocate disk "
-                       "structure for %ld.%ld\n", d->aoemajor, d->aoeminor);
+               printk(KERN_ERR "aoe: cannot allocate disk structure for %ld.%ld\n",
+                       d->aoemajor, d->aoeminor);
                spin_lock_irqsave(&d->lock, flags);
                d->flags &= ~DEVFL_GDALLOC;
                spin_unlock_irqrestore(&d->lock, flags);
@@ -213,8 +217,8 @@ aoeblk_gdalloc(void *vp)
 
        d->bufpool = mempool_create_slab_pool(MIN_BUFS, buf_pool_cache);
        if (d->bufpool == NULL) {
-               printk(KERN_ERR "aoe: aoeblk_gdalloc: cannot allocate bufpool "
-                       "for %ld.%ld\n", d->aoemajor, d->aoeminor);
+               printk(KERN_ERR "aoe: cannot allocate bufpool for %ld.%ld\n",
+                       d->aoemajor, d->aoeminor);
                put_disk(gd);
                spin_lock_irqsave(&d->lock, flags);
                d->flags &= ~DEVFL_GDALLOC;
index 1bc1cf9603f19c4e4975bb63c1ff5ccbeb09a7cb..e22b4c9520a9fdecee3317636bb532ea6404cda6 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004 Coraid, Inc.  See COPYING for GPL terms. */
+/* Copyright (c) 2006 Coraid, Inc.  See COPYING for GPL terms. */
 /*
  * aoechr.c
  * AoE character device driver
@@ -15,7 +15,6 @@ enum {
        MINOR_INTERFACES,
        MINOR_REVALIDATE,
        MSGSZ = 2048,
-       NARGS = 10,
        NMSG = 100,             /* message backlog to retain */
 };
 
@@ -56,9 +55,8 @@ static int
 interfaces(const char __user *str, size_t size)
 {
        if (set_aoe_iflist(str, size)) {
-               printk(KERN_CRIT
-                      "%s: could not set interface list: %s\n",
-                      __FUNCTION__, "too many interfaces");
+               printk(KERN_ERR
+                       "aoe: could not set interface list: too many interfaces\n");
                return -EINVAL;
        }
        return 0;
@@ -81,8 +79,7 @@ revalidate(const char __user *str, size_t size)
        /* should be e%d.%d format */
        n = sscanf(buf, "e%d.%d", &major, &minor);
        if (n != 2) {
-               printk(KERN_ERR "aoe: %s: invalid device specification\n",
-                       __FUNCTION__);
+               printk(KERN_ERR "aoe: invalid device specification\n");
                return -EINVAL;
        }
        d = aoedev_by_aoeaddr(major, minor);
@@ -90,6 +87,7 @@ revalidate(const char __user *str, size_t size)
                return -EINVAL;
 
        spin_lock_irqsave(&d->lock, flags);
+       d->flags &= ~DEVFL_MAXBCNT;
        d->flags |= DEVFL_PAUSE;
        spin_unlock_irqrestore(&d->lock, flags);
        aoecmd_cfg(major, minor);
@@ -116,7 +114,7 @@ bail:               spin_unlock_irqrestore(&emsgs_lock, flags);
 
        mp = kmalloc(n, GFP_ATOMIC);
        if (mp == NULL) {
-               printk(KERN_CRIT "aoe: aoechr_error: allocation failure, len=%ld\n", n);
+               printk(KERN_ERR "aoe: allocation failure, len=%ld\n", n);
                goto bail;
        }
 
@@ -141,7 +139,7 @@ aoechr_write(struct file *filp, const char __user *buf, size_t cnt, loff_t *offp
 
        switch ((unsigned long) filp->private_data) {
        default:
-               printk(KERN_INFO "aoe: aoechr_write: can't write to that file.\n");
+               printk(KERN_INFO "aoe: can't write to that file.\n");
                break;
        case MINOR_DISCOVER:
                ret = discover();
@@ -250,7 +248,7 @@ aoechr_init(void)
 
        n = register_chrdev(AOE_MAJOR, "aoechr", &aoe_fops);
        if (n < 0) { 
-               printk(KERN_ERR "aoe: aoechr_init: can't register char device\n");
+               printk(KERN_ERR "aoe: can't register char device\n");
                return n;
        }
        sema_init(&emsgs_sema, 0);
index 39da28d344fe9465186f6bed89be04ff449a7f77..8a13b1af8babdde7468af212794fa874b0a2745e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004 Coraid, Inc.  See COPYING for GPL terms. */
+/* Copyright (c) 2006 Coraid, Inc.  See COPYING for GPL terms. */
 /*
  * aoecmd.c
  * Filesystem request handling methods
 #define TIMERTICK (HZ / 10)
 #define MINTIMER (2 * TIMERTICK)
 #define MAXTIMER (HZ << 1)
-#define MAXWAIT (60 * 3)       /* After MAXWAIT seconds, give up and fail dev */
 
-static struct sk_buff *
-new_skb(struct net_device *if_dev, ulong len)
+static int aoe_deadsecs = 60 * 3;
+module_param(aoe_deadsecs, int, 0644);
+MODULE_PARM_DESC(aoe_deadsecs, "After aoe_deadsecs seconds, give up and fail dev.");
+
+struct sk_buff *
+new_skb(ulong len)
 {
        struct sk_buff *skb;
 
        skb = alloc_skb(len, GFP_ATOMIC);
        if (skb) {
                skb->nh.raw = skb->mac.raw = skb->data;
-               skb->dev = if_dev;
                skb->protocol = __constant_htons(ETH_P_AOE);
                skb->priority = 0;
                skb_put(skb, len);
@@ -40,29 +42,6 @@ new_skb(struct net_device *if_dev, ulong len)
        return skb;
 }
 
-static struct sk_buff *
-skb_prepare(struct aoedev *d, struct frame *f)
-{
-       struct sk_buff *skb;
-       char *p;
-
-       skb = new_skb(d->ifp, f->ndata + f->writedatalen);
-       if (!skb) {
-               printk(KERN_INFO "aoe: skb_prepare: failure to allocate skb\n");
-               return NULL;
-       }
-
-       p = skb->mac.raw;
-       memcpy(p, f->data, f->ndata);
-
-       if (f->writedatalen) {
-               p += sizeof(struct aoe_hdr) + sizeof(struct aoe_atahdr);
-               memcpy(p, f->bufaddr, f->writedatalen);
-       }
-
-       return skb;
-}
-
 static struct frame *
 getframe(struct aoedev *d, int tag)
 {
@@ -107,6 +86,17 @@ aoehdr_atainit(struct aoedev *d, struct aoe_hdr *h)
        return host_tag;
 }
 
+static inline void
+put_lba(struct aoe_atahdr *ah, sector_t lba)
+{
+       ah->lba0 = lba;
+       ah->lba1 = lba >>= 8;
+       ah->lba2 = lba >>= 8;
+       ah->lba3 = lba >>= 8;
+       ah->lba4 = lba >>= 8;
+       ah->lba5 = lba >>= 8;
+}
+
 static void
 aoecmd_ata_rw(struct aoedev *d, struct frame *f)
 {
@@ -125,29 +115,27 @@ aoecmd_ata_rw(struct aoedev *d, struct frame *f)
 
        sector = buf->sector;
        bcnt = buf->bv_resid;
-       if (bcnt > MAXATADATA)
-               bcnt = MAXATADATA;
+       if (bcnt > d->maxbcnt)
+               bcnt = d->maxbcnt;
 
        /* initialize the headers & frame */
-       h = (struct aoe_hdr *) f->data;
+       skb = f->skb;
+       h = (struct aoe_hdr *) skb->mac.raw;
        ah = (struct aoe_atahdr *) (h+1);
-       f->ndata = sizeof *h + sizeof *ah;
-       memset(h, 0, f->ndata);
+       skb->len = sizeof *h + sizeof *ah;
+       memset(h, 0, ETH_ZLEN);
        f->tag = aoehdr_atainit(d, h);
        f->waited = 0;
        f->buf = buf;
        f->bufaddr = buf->bufaddr;
+       f->bcnt = bcnt;
+       f->lba = sector;
 
        /* set up ata header */
        ah->scnt = bcnt >> 9;
-       ah->lba0 = sector;
-       ah->lba1 = sector >>= 8;
-       ah->lba2 = sector >>= 8;
-       ah->lba3 = sector >>= 8;
+       put_lba(ah, sector);
        if (d->flags & DEVFL_EXT) {
                ah->aflags |= AOEAFL_EXT;
-               ah->lba4 = sector >>= 8;
-               ah->lba5 = sector >>= 8;
        } else {
                extbit = 0;
                ah->lba3 &= 0x0f;
@@ -155,11 +143,14 @@ aoecmd_ata_rw(struct aoedev *d, struct frame *f)
        }
 
        if (bio_data_dir(buf->bio) == WRITE) {
+               skb_fill_page_desc(skb, 0, virt_to_page(f->bufaddr),
+                       offset_in_page(f->bufaddr), bcnt);
                ah->aflags |= AOEAFL_WRITE;
-               f->writedatalen = bcnt;
+               skb->len += bcnt;
+               skb->data_len = bcnt;
        } else {
+               skb->len = ETH_ZLEN;
                writebit = 0;
-               f->writedatalen = 0;
        }
 
        ah->cmdstat = WIN_READ | writebit | extbit;
@@ -168,26 +159,27 @@ aoecmd_ata_rw(struct aoedev *d, struct frame *f)
        buf->nframesout += 1;
        buf->bufaddr += bcnt;
        buf->bv_resid -= bcnt;
-/* printk(KERN_INFO "aoe: bv_resid=%ld\n", buf->bv_resid); */
+/* printk(KERN_DEBUG "aoe: bv_resid=%ld\n", buf->bv_resid); */
        buf->resid -= bcnt;
        buf->sector += bcnt >> 9;
        if (buf->resid == 0) {
                d->inprocess = NULL;
        } else if (buf->bv_resid == 0) {
                buf->bv++;
+               WARN_ON(buf->bv->bv_len == 0);
                buf->bv_resid = buf->bv->bv_len;
                buf->bufaddr = page_address(buf->bv->bv_page) + buf->bv->bv_offset;
        }
 
-       skb = skb_prepare(d, f);
-       if (skb) {
-               skb->next = NULL;
-               if (d->sendq_hd)
-                       d->sendq_tl->next = skb;
-               else
-                       d->sendq_hd = skb;
-               d->sendq_tl = skb;
-       }
+       skb->dev = d->ifp;
+       skb = skb_clone(skb, GFP_ATOMIC);
+       if (skb == NULL)
+               return;
+       if (d->sendq_hd)
+               d->sendq_tl->next = skb;
+       else
+               d->sendq_hd = skb;
+       d->sendq_tl = skb;
 }
 
 /* some callers cannot sleep, and they can call this function,
@@ -209,11 +201,12 @@ aoecmd_cfg_pkts(ushort aoemajor, unsigned char aoeminor, struct sk_buff **tail)
                if (!is_aoe_netif(ifp))
                        continue;
 
-               skb = new_skb(ifp, sizeof *h + sizeof *ch);
+               skb = new_skb(sizeof *h + sizeof *ch);
                if (skb == NULL) {
-                       printk(KERN_INFO "aoe: aoecmd_cfg: skb alloc failure\n");
+                       printk(KERN_INFO "aoe: skb alloc failure\n");
                        continue;
                }
+               skb->dev = ifp;
                if (sl_tail == NULL)
                        sl_tail = skb;
                h = (struct aoe_hdr *) skb->mac.raw;
@@ -237,6 +230,29 @@ aoecmd_cfg_pkts(ushort aoemajor, unsigned char aoeminor, struct sk_buff **tail)
        return sl;
 }
 
+static struct frame *
+freeframe(struct aoedev *d)
+{
+       struct frame *f, *e;
+       int n = 0;
+
+       f = d->frames;
+       e = f + d->nframes;
+       for (; f<e; f++) {
+               if (f->tag != FREETAG)
+                       continue;
+               if (atomic_read(&skb_shinfo(f->skb)->dataref) == 1) {
+                       skb_shinfo(f->skb)->nr_frags = f->skb->data_len = 0;
+                       return f;
+               }
+               n++;
+       }
+       if (n == d->nframes)    /* wait for network layer */
+               d->flags |= DEVFL_KICKME;
+
+       return NULL;
+}
+
 /* enters with d->lock held */
 void
 aoecmd_work(struct aoedev *d)
@@ -252,7 +268,7 @@ aoecmd_work(struct aoedev *d)
        }
 
 loop:
-       f = getframe(d, FREETAG);
+       f = freeframe(d);
        if (f == NULL)
                return;
        if (d->inprocess == NULL) {
@@ -260,7 +276,7 @@ loop:
                        return;
                buf = container_of(d->bufq.next, struct buf, bufs);
                list_del(d->bufq.next);
-/*printk(KERN_INFO "aoecmd_work: bi_size=%ld\n", buf->bio->bi_size); */
+/*printk(KERN_DEBUG "aoe: bi_size=%ld\n", buf->bio->bi_size); */
                d->inprocess = buf;
        }
        aoecmd_ata_rw(d, f);
@@ -272,6 +288,7 @@ rexmit(struct aoedev *d, struct frame *f)
 {
        struct sk_buff *skb;
        struct aoe_hdr *h;
+       struct aoe_atahdr *ah;
        char buf[128];
        u32 n;
 
@@ -283,21 +300,41 @@ rexmit(struct aoedev *d, struct frame *f)
                d->aoemajor, d->aoeminor, f->tag, jiffies, n);
        aoechr_error(buf);
 
-       h = (struct aoe_hdr *) f->data;
+       skb = f->skb;
+       h = (struct aoe_hdr *) skb->mac.raw;
+       ah = (struct aoe_atahdr *) (h+1);
        f->tag = n;
        h->tag = cpu_to_be32(n);
        memcpy(h->dst, d->addr, sizeof h->dst);
        memcpy(h->src, d->ifp->dev_addr, sizeof h->src);
 
-       skb = skb_prepare(d, f);
-       if (skb) {
-               skb->next = NULL;
-               if (d->sendq_hd)
-                       d->sendq_tl->next = skb;
-               else
-                       d->sendq_hd = skb;
-               d->sendq_tl = skb;
+       n = DEFAULTBCNT / 512;
+       if (ah->scnt > n) {
+               ah->scnt = n;
+               if (ah->aflags & AOEAFL_WRITE) {
+                       skb_fill_page_desc(skb, 0, virt_to_page(f->bufaddr),
+                               offset_in_page(f->bufaddr), DEFAULTBCNT);
+                       skb->len = sizeof *h + sizeof *ah + DEFAULTBCNT;
+                       skb->data_len = DEFAULTBCNT;
+               }
+               if (++d->lostjumbo > (d->nframes << 1))
+               if (d->maxbcnt != DEFAULTBCNT) {
+                       printk(KERN_INFO "aoe: e%ld.%ld: too many lost jumbo on %s - using 1KB frames.\n",
+                               d->aoemajor, d->aoeminor, d->ifp->name);
+                       d->maxbcnt = DEFAULTBCNT;
+                       d->flags |= DEVFL_MAXBCNT;
+               }
        }
+
+       skb->dev = d->ifp;
+       skb = skb_clone(skb, GFP_ATOMIC);
+       if (skb == NULL)
+               return;
+       if (d->sendq_hd)
+               d->sendq_tl->next = skb;
+       else
+               d->sendq_hd = skb;
+       d->sendq_tl = skb;
 }
 
 static int
@@ -340,13 +377,17 @@ rexmit_timer(ulong vp)
                if (f->tag != FREETAG && tsince(f->tag) >= timeout) {
                        n = f->waited += timeout;
                        n /= HZ;
-                       if (n > MAXWAIT) { /* waited too long.  device failure. */
+                       if (n > aoe_deadsecs) { /* waited too long for response */
                                aoedev_downdev(d);
                                break;
                        }
                        rexmit(d, f);
                }
        }
+       if (d->flags & DEVFL_KICKME) {
+               d->flags &= ~DEVFL_KICKME;
+               aoecmd_work(d);
+       }
 
        sl = d->sendq_hd;
        d->sendq_hd = d->sendq_tl = NULL;
@@ -431,8 +472,8 @@ ataid_complete(struct aoedev *d, unsigned char *id)
        }
 
        if (d->ssize != ssize)
-               printk(KERN_INFO "aoe: %012llx e%lu.%lu v%04x has %llu "
-                       "sectors\n", (unsigned long long)mac_addr(d->addr),
+               printk(KERN_INFO "aoe: %012llx e%lu.%lu v%04x has %llu sectors\n",
+                       (unsigned long long)mac_addr(d->addr),
                        d->aoemajor, d->aoeminor,
                        d->fw_ver, (long long)ssize);
        d->ssize = ssize;
@@ -442,11 +483,9 @@ ataid_complete(struct aoedev *d, unsigned char *id)
                d->flags |= DEVFL_NEWSIZE;
        } else {
                if (d->flags & DEVFL_GDALLOC) {
-                       printk(KERN_INFO "aoe: %s: %s e%lu.%lu, %s\n",
-                              __FUNCTION__,
-                              "can't schedule work for",
+                       printk(KERN_ERR "aoe: can't schedule work for e%lu.%lu, %s\n",
                               d->aoemajor, d->aoeminor,
-                              "it's already on! (This really shouldn't happen).\n");
+                              "it's already on!  This shouldn't happen.\n");
                        return;
                }
                d->flags |= DEVFL_GDALLOC;
@@ -460,8 +499,15 @@ calc_rttavg(struct aoedev *d, int rtt)
        register long n;
 
        n = rtt;
-       if (n < MINTIMER)
-               n = MINTIMER;
+       if (n < 0) {
+               n = -rtt;
+               if (n < MINTIMER)
+                       n = MINTIMER;
+               else if (n > MAXTIMER)
+                       n = MAXTIMER;
+               d->mintimer += (n - d->mintimer) >> 1;
+       } else if (n < d->mintimer)
+               n = d->mintimer;
        else if (n > MAXTIMER)
                n = MAXTIMER;
 
@@ -474,7 +520,7 @@ void
 aoecmd_ata_rsp(struct sk_buff *skb)
 {
        struct aoedev *d;
-       struct aoe_hdr *hin;
+       struct aoe_hdr *hin, *hout;
        struct aoe_atahdr *ahin, *ahout;
        struct frame *f;
        struct buf *buf;
@@ -497,8 +543,10 @@ aoecmd_ata_rsp(struct sk_buff *skb)
 
        spin_lock_irqsave(&d->lock, flags);
 
-       f = getframe(d, be32_to_cpu(hin->tag));
+       n = be32_to_cpu(hin->tag);
+       f = getframe(d, n);
        if (f == NULL) {
+               calc_rttavg(d, -tsince(n));
                spin_unlock_irqrestore(&d->lock, flags);
                snprintf(ebuf, sizeof ebuf,
                        "%15s e%d.%d    tag=%08x@%08lx\n",
@@ -514,26 +562,27 @@ aoecmd_ata_rsp(struct sk_buff *skb)
        calc_rttavg(d, tsince(f->tag));
 
        ahin = (struct aoe_atahdr *) (hin+1);
-       ahout = (struct aoe_atahdr *) (f->data + sizeof(struct aoe_hdr));
+       hout = (struct aoe_hdr *) f->skb->mac.raw;
+       ahout = (struct aoe_atahdr *) (hout+1);
        buf = f->buf;
 
        if (ahout->cmdstat == WIN_IDENTIFY)
                d->flags &= ~DEVFL_PAUSE;
        if (ahin->cmdstat & 0xa9) {     /* these bits cleared on success */
-               printk(KERN_CRIT "aoe: aoecmd_ata_rsp: ata error cmd=%2.2Xh "
-                       "stat=%2.2Xh from e%ld.%ld\n", 
+               printk(KERN_ERR
+                       "aoe: ata error cmd=%2.2Xh stat=%2.2Xh from e%ld.%ld\n",
                        ahout->cmdstat, ahin->cmdstat,
                        d->aoemajor, d->aoeminor);
                if (buf)
                        buf->flags |= BUFFL_FAIL;
        } else {
+               n = ahout->scnt << 9;
                switch (ahout->cmdstat) {
                case WIN_READ:
                case WIN_READ_EXT:
-                       n = ahout->scnt << 9;
                        if (skb->len - sizeof *hin - sizeof *ahin < n) {
-                               printk(KERN_CRIT "aoe: aoecmd_ata_rsp: runt "
-                                       "ata data size in read.  skb->len=%d\n",
+                               printk(KERN_ERR
+                                       "aoe: runt data size in read.  skb->len=%d\n",
                                        skb->len);
                                /* fail frame f?  just returning will rexmit. */
                                spin_unlock_irqrestore(&d->lock, flags);
@@ -542,22 +591,49 @@ aoecmd_ata_rsp(struct sk_buff *skb)
                        memcpy(f->bufaddr, ahin+1, n);
                case WIN_WRITE:
                case WIN_WRITE_EXT:
+                       if (f->bcnt -= n) {
+                               skb = f->skb;
+                               f->bufaddr += n;
+                               put_lba(ahout, f->lba += ahout->scnt);
+                               n = f->bcnt;
+                               if (n > DEFAULTBCNT)
+                                       n = DEFAULTBCNT;
+                               ahout->scnt = n >> 9;
+                               if (ahout->aflags & AOEAFL_WRITE) {
+                                       skb_fill_page_desc(skb, 0,
+                                               virt_to_page(f->bufaddr),
+                                               offset_in_page(f->bufaddr), n);
+                                       skb->len = sizeof *hout + sizeof *ahout + n;
+                                       skb->data_len = n;
+                               }
+                               f->tag = newtag(d);
+                               hout->tag = cpu_to_be32(f->tag);
+                               skb->dev = d->ifp;
+                               skb = skb_clone(skb, GFP_ATOMIC);
+                               spin_unlock_irqrestore(&d->lock, flags);
+                               if (skb)
+                                       aoenet_xmit(skb);
+                               return;
+                       }
+                       if (n > DEFAULTBCNT)
+                               d->lostjumbo = 0;
                        break;
                case WIN_IDENTIFY:
                        if (skb->len - sizeof *hin - sizeof *ahin < 512) {
-                               printk(KERN_INFO "aoe: aoecmd_ata_rsp: runt data size "
-                                       "in ataid.  skb->len=%d\n", skb->len);
+                               printk(KERN_INFO
+                                       "aoe: runt data size in ataid.  skb->len=%d\n",
+                                       skb->len);
                                spin_unlock_irqrestore(&d->lock, flags);
                                return;
                        }
                        ataid_complete(d, (char *) (ahin+1));
                        break;
                default:
-                       printk(KERN_INFO "aoe: aoecmd_ata_rsp: unrecognized "
-                              "outbound ata command %2.2Xh for %d.%d\n", 
-                              ahout->cmdstat,
-                              be16_to_cpu(hin->major),
-                              hin->minor);
+                       printk(KERN_INFO
+                               "aoe: unrecognized ata command %2.2Xh for %d.%d\n",
+                               ahout->cmdstat,
+                               be16_to_cpu(hin->major),
+                               hin->minor);
                }
        }
 
@@ -612,33 +688,32 @@ aoecmd_ata_id(struct aoedev *d)
        struct frame *f;
        struct sk_buff *skb;
 
-       f = getframe(d, FREETAG);
+       f = freeframe(d);
        if (f == NULL) {
-               printk(KERN_CRIT "aoe: aoecmd_ata_id: can't get a frame.  "
-                       "This shouldn't happen.\n");
+               printk(KERN_ERR "aoe: can't get a frame. This shouldn't happen.\n");
                return NULL;
        }
 
        /* initialize the headers & frame */
-       h = (struct aoe_hdr *) f->data;
+       skb = f->skb;
+       h = (struct aoe_hdr *) skb->mac.raw;
        ah = (struct aoe_atahdr *) (h+1);
-       f->ndata = sizeof *h + sizeof *ah;
-       memset(h, 0, f->ndata);
+       skb->len = ETH_ZLEN;
+       memset(h, 0, ETH_ZLEN);
        f->tag = aoehdr_atainit(d, h);
        f->waited = 0;
-       f->writedatalen = 0;
 
        /* set up ata header */
        ah->scnt = 1;
        ah->cmdstat = WIN_IDENTIFY;
        ah->lba3 = 0xa0;
 
-       skb = skb_prepare(d, f);
+       skb->dev = d->ifp;
 
        d->rttavg = MAXTIMER;
        d->timer.function = rexmit_timer;
 
-       return skb;
+       return skb_clone(skb, GFP_ATOMIC);
 }
  
 void
@@ -648,9 +723,9 @@ aoecmd_cfg_rsp(struct sk_buff *skb)
        struct aoe_hdr *h;
        struct aoe_cfghdr *ch;
        ulong flags, sysminor, aoemajor;
-       u16 bufcnt;
        struct sk_buff *sl;
        enum { MAXFRAMES = 16 };
+       u16 n;
 
        h = (struct aoe_hdr *) skb->mac.raw;
        ch = (struct aoe_cfghdr *) (h+1);
@@ -661,26 +736,25 @@ aoecmd_cfg_rsp(struct sk_buff *skb)
         */
        aoemajor = be16_to_cpu(h->major);
        if (aoemajor == 0xfff) {
-               printk(KERN_CRIT "aoe: aoecmd_cfg_rsp: Warning: shelf "
-                       "address is all ones.  Check shelf dip switches\n");
+               printk(KERN_ERR "aoe: Warning: shelf address is all ones.  "
+                       "Check shelf dip switches.\n");
                return;
        }
 
        sysminor = SYSMINOR(aoemajor, h->minor);
        if (sysminor * AOE_PARTITIONS + AOE_PARTITIONS > MINORMASK) {
-               printk(KERN_INFO
-                       "aoe: e%ld.%d: minor number too large\n", 
+               printk(KERN_INFO "aoe: e%ld.%d: minor number too large\n",
                        aoemajor, (int) h->minor);
                return;
        }
 
-       bufcnt = be16_to_cpu(ch->bufcnt);
-       if (bufcnt > MAXFRAMES) /* keep it reasonable */
-               bufcnt = MAXFRAMES;
+       n = be16_to_cpu(ch->bufcnt);
+       if (n > MAXFRAMES)      /* keep it reasonable */
+               n = MAXFRAMES;
 
-       d = aoedev_by_sysminor_m(sysminor, bufcnt);
+       d = aoedev_by_sysminor_m(sysminor, n);
        if (d == NULL) {
-               printk(KERN_INFO "aoe: aoecmd_cfg_rsp: device sysminor_m failure\n");
+               printk(KERN_INFO "aoe: device sysminor_m failure\n");
                return;
        }
 
@@ -689,6 +763,20 @@ aoecmd_cfg_rsp(struct sk_buff *skb)
        /* permit device to migrate mac and network interface */
        d->ifp = skb->dev;
        memcpy(d->addr, h->src, sizeof d->addr);
+       if (!(d->flags & DEVFL_MAXBCNT)) {
+               n = d->ifp->mtu;
+               n -= sizeof (struct aoe_hdr) + sizeof (struct aoe_atahdr);
+               n /= 512;
+               if (n > ch->scnt)
+                       n = ch->scnt;
+               n = n ? n * 512 : DEFAULTBCNT;
+               if (n != d->maxbcnt) {
+                       printk(KERN_INFO
+                               "aoe: e%ld.%ld: setting %d byte data frames on %s\n",
+                               d->aoemajor, d->aoeminor, n, d->ifp->name);
+                       d->maxbcnt = n;
+               }
+       }
 
        /* don't change users' perspective */
        if (d->nopen && !(d->flags & DEVFL_PAUSE)) {
@@ -696,6 +784,7 @@ aoecmd_cfg_rsp(struct sk_buff *skb)
                return;
        }
        d->flags |= DEVFL_PAUSE;        /* force pause */
+       d->mintimer = MINTIMER;
        d->fw_ver = be16_to_cpu(ch->fwver);
 
        /* check for already outstanding ataid */
index ed4258a62df5a889028cf6f131d4276cf436a768..6125921bbec4d971534947fa53dc4cf5cc750838 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004 Coraid, Inc.  See COPYING for GPL terms. */
+/* Copyright (c) 2006 Coraid, Inc.  See COPYING for GPL terms. */
 /*
  * aoedev.c
  * AoE device utility functions; maintains device list.
@@ -20,11 +20,8 @@ aoedev_isbusy(struct aoedev *d)
        f = d->frames;
        e = f + d->nframes;
        do {
-               if (f->tag != FREETAG) {
-                       printk(KERN_DEBUG "aoe: %ld.%ld isbusy\n",
-                               d->aoemajor, d->aoeminor);
+               if (f->tag != FREETAG)
                        return 1;
-               }
        } while (++f < e);
 
        return 0;
@@ -66,22 +63,32 @@ aoedev_newdev(ulong nframes)
        struct frame *f, *e;
 
        d = kzalloc(sizeof *d, GFP_ATOMIC);
-       if (d == NULL)
-               return NULL;
        f = kcalloc(nframes, sizeof *f, GFP_ATOMIC);
-       if (f == NULL) {
-               kfree(d);
+       switch (!d || !f) {
+       case 0:
+               d->nframes = nframes;
+               d->frames = f;
+               e = f + nframes;
+               for (; f<e; f++) {
+                       f->tag = FREETAG;
+                       f->skb = new_skb(ETH_ZLEN);
+                       if (!f->skb)
+                               break;
+               }
+               if (f == e)
+                       break;
+               while (f > d->frames) {
+                       f--;
+                       dev_kfree_skb(f->skb);
+               }
+       default:
+               if (f)
+                       kfree(f);
+               if (d)
+                       kfree(d);
                return NULL;
        }
-
        INIT_WORK(&d->work, aoecmd_sleepwork, d);
-
-       d->nframes = nframes;
-       d->frames = f;
-       e = f + nframes;
-       for (; f<e; f++)
-               f->tag = FREETAG;
-
        spin_lock_init(&d->lock);
        init_timer(&d->timer);
        d->timer.data = (ulong) d;
@@ -114,6 +121,7 @@ aoedev_downdev(struct aoedev *d)
                        mempool_free(buf, d->bufpool);
                        bio_endio(bio, bio->bi_size, -EIO);
                }
+               skb_shinfo(f->skb)->nr_frags = f->skb->data_len = 0;
        }
        d->inprocess = NULL;
 
@@ -148,7 +156,7 @@ aoedev_by_sysminor_m(ulong sysminor, ulong bufcnt)
                d = aoedev_newdev(bufcnt);
                if (d == NULL) {
                        spin_unlock_irqrestore(&devlist_lock, flags);
-                       printk(KERN_INFO "aoe: aoedev_set: aoedev_newdev failure.\n");
+                       printk(KERN_INFO "aoe: aoedev_newdev failure.\n");
                        return NULL;
                }
                d->sysminor = sysminor;
@@ -163,11 +171,19 @@ aoedev_by_sysminor_m(ulong sysminor, ulong bufcnt)
 static void
 aoedev_freedev(struct aoedev *d)
 {
+       struct frame *f, *e;
+
        if (d->gd) {
                aoedisk_rm_sysfs(d);
                del_gendisk(d->gd);
                put_disk(d->gd);
        }
+       f = d->frames;
+       e = f + d->nframes;
+       for (; f<e; f++) {
+               skb_shinfo(f->skb)->nr_frags = 0;
+               dev_kfree_skb(f->skb);
+       }
        kfree(d->frames);
        if (d->bufpool)
                mempool_destroy(d->bufpool);
index de08491ebe666a12b25e432a6657d4ee288c1295..a04b7d613299dfc3ae73ba6ec456acdf187d2626 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004 Coraid, Inc.  See COPYING for GPL terms. */
+/* Copyright (c) 2006 Coraid, Inc.  See COPYING for GPL terms. */
 /*
  * aoemain.c
  * Module initialization routines, discover timer
@@ -84,13 +84,11 @@ aoe_init(void)
                goto net_fail;
        ret = register_blkdev(AOE_MAJOR, DEVICE_NAME);
        if (ret < 0) {
-               printk(KERN_ERR "aoe: aoeblk_init: can't register major\n");
+               printk(KERN_ERR "aoe: can't register major\n");
                goto blkreg_fail;
        }
 
-       printk(KERN_INFO
-              "aoe: aoe_init: AoE v%s initialised.\n",
-              VERSION);
+       printk(KERN_INFO "aoe: AoE v%s initialised.\n", VERSION);
        discover_timer(TINIT);
        return 0;
 
@@ -103,7 +101,7 @@ aoe_init(void)
  chr_fail:
        aoedev_exit();
        
-       printk(KERN_INFO "aoe: aoe_init: initialisation failure.\n");
+       printk(KERN_INFO "aoe: initialisation failure.\n");
        return ret;
 }
 
index c1434ed118808999a3b05f148ef3b76b0590360f..9626e0f5da9dd4edc73d7ab559b3aa6d233e0836 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004 Coraid, Inc.  See COPYING for GPL terms. */
+/* Copyright (c) 2006 Coraid, Inc.  See COPYING for GPL terms. */
 /*
  * aoenet.c
  * Ethernet portion of AoE driver
@@ -74,7 +74,7 @@ set_aoe_iflist(const char __user *user_str, size_t size)
                return -EINVAL;
 
        if (copy_from_user(aoe_iflist, user_str, size)) {
-               printk(KERN_INFO "aoe: %s: copy from user failed\n", __FUNCTION__);
+               printk(KERN_INFO "aoe: copy from user failed\n");
                return -EFAULT;
        }
        aoe_iflist[size] = 0x00;
@@ -132,8 +132,7 @@ aoenet_rcv(struct sk_buff *skb, struct net_device *ifp, struct packet_type *pt,
                if (n > NECODES)
                        n = 0;
                if (net_ratelimit())
-                       printk(KERN_ERR "aoe: aoenet_rcv: error packet from %d.%d; "
-                              "ecode=%d '%s'\n",
+                       printk(KERN_ERR "aoe: error packet from %d.%d; ecode=%d '%s'\n",
                               be16_to_cpu(h->major), h->minor, 
                               h->err, aoe_errlist[n]);
                goto exit;
@@ -147,7 +146,7 @@ aoenet_rcv(struct sk_buff *skb, struct net_device *ifp, struct packet_type *pt,
                aoecmd_cfg_rsp(skb);
                break;
        default:
-               printk(KERN_INFO "aoe: aoenet_rcv: unknown cmd %d\n", h->cmd);
+               printk(KERN_INFO "aoe: unknown cmd %d\n", h->cmd);
        }
 exit:
        dev_kfree_skb(skb);
index dcccaf2782f350cd68efa6fd431a0dc90cd05289..bc6602606fb541726f1537f610cc4d80d340ca2d 100644 (file)
@@ -1923,7 +1923,6 @@ static void cciss_geometry_inquiry(int ctlr, int logvol,
 {
        int return_code;
        unsigned long t;
-       unsigned long rem;
 
        memset(inq_buff, 0, sizeof(InquiryData_struct));
        if (withirq)
@@ -1939,26 +1938,23 @@ static void cciss_geometry_inquiry(int ctlr, int logvol,
                        printk(KERN_WARNING
                               "cciss: reading geometry failed, volume "
                               "does not support reading geometry\n");
-                       drv->block_size = block_size;
-                       drv->nr_blocks = total_size;
                        drv->heads = 255;
                        drv->sectors = 32;      // Sectors per track
-                       t = drv->heads * drv->sectors;
-                       drv->cylinders = total_size;
-                       rem = do_div(drv->cylinders, t);
                } else {
-                       drv->block_size = block_size;
-                       drv->nr_blocks = total_size;
                        drv->heads = inq_buff->data_byte[6];
                        drv->sectors = inq_buff->data_byte[7];
                        drv->cylinders = (inq_buff->data_byte[4] & 0xff) << 8;
                        drv->cylinders += inq_buff->data_byte[5];
                        drv->raid_level = inq_buff->data_byte[8];
-                       t = drv->heads * drv->sectors;
-                       if (t > 1) {
-                               drv->cylinders = total_size;
-                               rem = do_div(drv->cylinders, t);
-                       }
+               }
+               drv->block_size = block_size;
+               drv->nr_blocks = total_size;
+               t = drv->heads * drv->sectors;
+               if (t > 1) {
+                       unsigned rem = sector_div(total_size, t);
+                       if (rem)
+                               total_size++;
+                       drv->cylinders = total_size;
                }
        } else {                /* Get geometry failed */
                printk(KERN_WARNING "cciss: reading geometry failed\n");
index a3f64bfe6b5870eb52229cdd9e9dd36fd6289aaf..485aa87e9bcd6069b7c17a72d2fe946a95100db5 100644 (file)
@@ -432,6 +432,12 @@ static int __init rd_init(void)
                rd_disks[i] = alloc_disk(1);
                if (!rd_disks[i])
                        goto out;
+
+               rd_queue[i] = blk_alloc_queue(GFP_KERNEL);
+               if (!rd_queue[i]) {
+                       put_disk(rd_disks[i]);
+                       goto out;
+               }
        }
 
        if (register_blkdev(RAMDISK_MAJOR, "ramdisk")) {
@@ -442,10 +448,6 @@ static int __init rd_init(void)
        for (i = 0; i < CONFIG_BLK_DEV_RAM_COUNT; i++) {
                struct gendisk *disk = rd_disks[i];
 
-               rd_queue[i] = blk_alloc_queue(GFP_KERNEL);
-               if (!rd_queue[i])
-                       goto out_queue;
-
                blk_queue_make_request(rd_queue[i], &rd_make_request);
                blk_queue_hardsect_size(rd_queue[i], rd_blocksize);
 
@@ -466,8 +468,6 @@ static int __init rd_init(void)
                CONFIG_BLK_DEV_RAM_COUNT, rd_size, rd_blocksize);
 
        return 0;
-out_queue:
-       unregister_blkdev(RAMDISK_MAJOR, "ramdisk");
 out:
        while (i--) {
                put_disk(rd_disks[i]);
index 67cdda43f22990fbdd0e5a9a3b4727fb350876ba..516751754aa9e6d33b4b139f84bcb10edaecb239 100644 (file)
@@ -29,7 +29,6 @@
 #include <linux/slab.h>
 #include <linux/types.h>
 #include <linux/errno.h>
-#include <linux/timer.h>
 
 #include <linux/device.h>
 #include <linux/firmware.h>
@@ -43,7 +42,7 @@
 #define BT_DBG(D...)
 #endif
 
-#define VERSION "1.0"
+#define VERSION "1.1"
 
 static int ignore = 0;
 
@@ -72,7 +71,7 @@ struct bcm203x_data {
 
        unsigned long           state;
 
-       struct timer_list       timer;
+       struct work_struct      work;
 
        struct urb              *urb;
        unsigned char           *buffer;
@@ -105,7 +104,7 @@ static void bcm203x_complete(struct urb *urb)
 
                data->state = BCM203X_SELECT_MEMORY;
 
-               mod_timer(&data->timer, jiffies + (HZ / 10));
+               schedule_work(&data->work);
                break;
 
        case BCM203X_SELECT_MEMORY:
@@ -158,9 +157,9 @@ static void bcm203x_complete(struct urb *urb)
        }
 }
 
-static void bcm203x_timer(unsigned long user_data)
+static void bcm203x_work(void *user_data)
 {
-       struct bcm203x_data *data = (struct bcm203x_data *) user_data;
+       struct bcm203x_data *data = user_data;
 
        if (usb_submit_urb(data->urb, GFP_ATOMIC) < 0)
                BT_ERR("Can't submit URB");
@@ -247,13 +246,11 @@ static int bcm203x_probe(struct usb_interface *intf, const struct usb_device_id
 
        release_firmware(firmware);
 
-       init_timer(&data->timer);
-       data->timer.function = bcm203x_timer;
-       data->timer.data = (unsigned long) data;
+       INIT_WORK(&data->work, bcm203x_work, (void *) data);
 
        usb_set_intfdata(intf, data);
 
-       mod_timer(&data->timer, jiffies + HZ);
+       schedule_work(&data->work);
 
        return 0;
 }
index e7c800f4c3ad9b0418d3bc36f8970688a3c0d6f7..07eafbc5dc3a7571ee42b8dfc48c6a75973fd137 100644 (file)
@@ -711,6 +711,7 @@ static void dtl1_release(struct pcmcia_device *link)
 
 static struct pcmcia_device_id dtl1_ids[] = {
        PCMCIA_DEVICE_PROD_ID12("Nokia Mobile Phones", "DTL-1", 0xe1bfdd64, 0xe168480d),
+       PCMCIA_DEVICE_PROD_ID12("Nokia Mobile Phones", "DTL-4", 0xe1bfdd64, 0x9102bc82),
        PCMCIA_DEVICE_PROD_ID12("Socket", "CF", 0xb38bcc2e, 0x44ebf863),
        PCMCIA_DEVICE_PROD_ID12("Socket", "CF+ Personal Network Card", 0xb38bcc2e, 0xe732bae3),
        PCMCIA_DEVICE_NULL
index 7565642a007ab1f9d36051153e87ca009a6f8987..fdea58ae16b23c31dcb7cb24ecf57e5dab9ecc77 100644 (file)
@@ -118,6 +118,9 @@ static struct usb_device_id blacklist_ids[] = {
        /* IBM/Lenovo ThinkPad with Broadcom chip */
        { USB_DEVICE(0x0a5c, 0x201e), .driver_info = HCI_WRONG_SCO_MTU },
 
+       /* ANYCOM Bluetooth USB-200 and USB-250 */
+       { USB_DEVICE(0x0a5c, 0x2111), .driver_info = HCI_RESET },
+
        /* Microsoft Wireless Transceiver for Bluetooth 2.0 */
        { USB_DEVICE(0x045e, 0x009c), .driver_info = HCI_RESET },
 
index 0e6f35fcc2ebf9ed0fd36ddaa74c5faf3b8cedac..39a9f8cc6412a0faa1ed80df4ff12fbf56693f91 100644 (file)
@@ -1046,7 +1046,7 @@ source "drivers/char/tpm/Kconfig"
 
 config TELCLOCK
        tristate "Telecom clock driver for MPBL0010 ATCA SBC"
-       depends on EXPERIMENTAL
+       depends on EXPERIMENTAL && X86
        default n
        help
          The telecom clock device is specific to the MPBL0010 ATCA computer and
index 91b71e750ee15f16a0372a3f7d8559c4fa2d6d72..dffc19382f7eb828f73426e91b7524f5ffce3305 100644 (file)
 static int uninorth_rev;
 static int is_u3;
 
+static char __devinitdata *aperture = NULL;
 
 static int uninorth_fetch_size(void)
 {
-       int i;
-       u32 temp;
-       struct aper_size_info_32 *values;
-
-       pci_read_config_dword(agp_bridge->dev, UNI_N_CFG_GART_BASE, &temp);
-       temp &= ~(0xfffff000);
-       values = A_SIZE_32(agp_bridge->driver->aperture_sizes);
-
-       for (i = 0; i < agp_bridge->driver->num_aperture_sizes; i++) {
-               if (temp == values[i].size_value) {
-                       agp_bridge->previous_size =
-                           agp_bridge->current_size = (void *) (values + i);
-                       agp_bridge->aperture_size_idx = i;
-                       return values[i].size;
+       int i, size = 0;
+       struct aper_size_info_32 *values =
+           A_SIZE_32(agp_bridge->driver->aperture_sizes);
+
+       if (aperture) {
+               char *save = aperture;
+
+               size = memparse(aperture, &aperture) >> 20;
+               aperture = save;
+
+               for (i = 0; i < agp_bridge->driver->num_aperture_sizes; i++)
+                       if (size == values[i].size)
+                               break;
+
+               if (i == agp_bridge->driver->num_aperture_sizes) {
+                       printk(KERN_ERR PFX "Invalid aperture size, using"
+                              " default\n");
+                       size = 0;
+                       aperture = NULL;
                }
        }
 
-       agp_bridge->previous_size =
-           agp_bridge->current_size = (void *) (values + 1);
-       agp_bridge->aperture_size_idx = 1;
-       return values[1].size;
+       if (!size) {
+               for (i = 0; i < agp_bridge->driver->num_aperture_sizes; i++)
+                       if (values[i].size == 32)
+                               break;
+       }
 
-       return 0;
+       agp_bridge->previous_size =
+           agp_bridge->current_size = (void *)(values + i);
+       agp_bridge->aperture_size_idx = i;
+       return values[i].size;
 }
 
 static void uninorth_tlbflush(struct agp_memory *mem)
@@ -683,5 +693,11 @@ static void __exit agp_uninorth_cleanup(void)
 module_init(agp_uninorth_init);
 module_exit(agp_uninorth_cleanup);
 
+module_param(aperture, charp, 0);
+MODULE_PARM_DESC(aperture,
+                "Aperture size, must be power of two between 4MB and an\n"
+                "\t\tupper limit specific to the UniNorth revision.\n"
+                "\t\tDefault: 32M");
+
 MODULE_AUTHOR("Ben Herrenschmidt & Paul Mackerras");
 MODULE_LICENSE("GPL");
index c3f95583a120ca1ca89ebd7d3d4259f024255df7..706733c0b36a7e7af833f97580fb978454dc0ed1 100644 (file)
@@ -1157,6 +1157,7 @@ static int __init pc_init(void)
        int crd;
        struct board_info *bd;
        unsigned char board_id = 0;
+       int err = -ENOMEM;
 
        int pci_boards_found, pci_count;
 
@@ -1164,13 +1165,11 @@ static int __init pc_init(void)
 
        pc_driver = alloc_tty_driver(MAX_ALLOC);
        if (!pc_driver)
-               return -ENOMEM;
+               goto out1;
 
        pc_info = alloc_tty_driver(MAX_ALLOC);
-       if (!pc_info) {
-               put_tty_driver(pc_driver);
-               return -ENOMEM;
-       }
+       if (!pc_info)
+               goto out2;
 
        /* -----------------------------------------------------------------------
                If epca_setup has not been ran by LILO set num_cards to defaults; copy
@@ -1370,11 +1369,17 @@ static int __init pc_init(void)
 
        } /* End for each card */
 
-       if (tty_register_driver(pc_driver))
-               panic("Couldn't register Digi PC/ driver");
+       err = tty_register_driver(pc_driver);
+       if (err) {
+               printk(KERN_ERR "Couldn't register Digi PC/ driver");
+               goto out3;
+       }
 
-       if (tty_register_driver(pc_info))
-               panic("Couldn't register Digi PC/ info ");
+       err = tty_register_driver(pc_info);
+       if (err) {
+               printk(KERN_ERR "Couldn't register Digi PC/ info ");
+               goto out4;
+       }
 
        /* -------------------------------------------------------------------
           Start up the poller to check for events on all enabled boards
@@ -1385,6 +1390,15 @@ static int __init pc_init(void)
        mod_timer(&epca_timer, jiffies + HZ/25);
        return 0;
 
+out4:
+       tty_unregister_driver(pc_driver);
+out3:
+       put_tty_driver(pc_info);
+out2:
+       put_tty_driver(pc_driver);
+out1:
+       return err;
+
 } /* End pc_init */
 
 /* ------------------ Begin post_fep_init  ---------------------- */
index 24825bdca8f4f7ce40f9c2c15e2b58cb719bba9a..e5cfb1fa47d173a93c6817b30851935b5ad71353 100644 (file)
@@ -1789,7 +1789,7 @@ static int __devinit ipmi_pci_probe(struct pci_dev *pdev,
 
        info = kzalloc(sizeof(*info), GFP_KERNEL);
        if (!info)
-               return ENOMEM;
+               return -ENOMEM;
 
        info->addr_source = "PCI";
 
@@ -1810,7 +1810,7 @@ static int __devinit ipmi_pci_probe(struct pci_dev *pdev,
                kfree(info);
                printk(KERN_INFO "ipmi_si: %s: Unknown IPMI type: %d\n",
                       pci_name(pdev), class_type);
-               return ENOMEM;
+               return -ENOMEM;
        }
 
        rv = pci_enable_device(pdev);
index b401383808c26ac4c16ce38f15fc129b4dafd56a..96cb1f07332b68e5fb5b77dfb68a74d6356c6b64 100644 (file)
@@ -130,6 +130,7 @@ static moxa_isa_board_conf moxa_isa_boards[] =
 typedef struct _moxa_pci_devinfo {
        ushort busNum;
        ushort devNum;
+       struct pci_dev *pdev;
 } moxa_pci_devinfo;
 
 typedef struct _moxa_board_conf {
@@ -324,6 +325,9 @@ static int moxa_get_PCI_conf(struct pci_dev *p, int board_type, moxa_board_conf
        board->busType = MOXA_BUS_TYPE_PCI;
        board->pciInfo.busNum = p->bus->number;
        board->pciInfo.devNum = p->devfn >> 3;
+       board->pciInfo.pdev = p;
+       /* don't lose the reference in the next pci_get_device iteration */
+       pci_dev_get(p);
 
        return (0);
 }
@@ -493,6 +497,11 @@ static void __exit moxa_exit(void)
        if (tty_unregister_driver(moxaDriver))
                printk("Couldn't unregister MOXA Intellio family serial driver\n");
        put_tty_driver(moxaDriver);
+
+       for (i = 0; i < MAX_BOARDS; i++)
+               if (moxa_boards[i].busType == MOXA_BUS_TYPE_PCI)
+                       pci_dev_put(moxa_boards[i].pciInfo.pdev);
+
        if (verbose)
                printk("Done\n");
 }
index 07f47a0208a7200b4e0ba1f32bd747d82ae1db6b..eb6b13f4211aed23994734537ecc81a3919dfcb2 100644 (file)
@@ -645,6 +645,7 @@ void add_input_randomness(unsigned int type, unsigned int code,
        add_timer_randomness(&input_timer_state,
                             (type << 4) ^ code ^ (code >> 4) ^ value);
 }
+EXPORT_SYMBOL_GPL(add_input_randomness);
 
 void add_interrupt_randomness(int irq)
 {
index ee2ddea7a63a838e084f1103f7df5147f2b417f0..23d0681fe491abffeb08795f4028cc017c297b16 100644 (file)
@@ -44,6 +44,7 @@
 **    the host.
 */
 struct Host {
+       struct pci_dev *pdev;
        unsigned char Type;             /* RIO_EISA, RIO_MCA, ... */
        unsigned char Ivec;             /* POLLED or ivec number */
        unsigned char Mode;             /* Control stuff */
index c382df0f82f60957efd73391cc69c17e1577e0b7..7ac68cb3beddfa61df80e8ca0cfb22a3b53cf70b 100644 (file)
@@ -1017,6 +1017,10 @@ static int __init rio_init(void)
                        rio_dprintk(RIO_DEBUG_PROBE, "Hmm Tested ok, uniqid = %x.\n", p->RIOHosts[p->RIONumHosts].UniqueNum);
 
                        fix_rio_pci(pdev);
+
+                       p->RIOHosts[p->RIONumHosts].pdev = pdev;
+                       pci_dev_get(pdev);
+
                        p->RIOLastPCISearch = 0;
                        p->RIONumHosts++;
                        found++;
@@ -1066,6 +1070,9 @@ static int __init rio_init(void)
                            ((readb(&p->RIOHosts[p->RIONumHosts].Unique[1]) & 0xFF) << 8) | ((readb(&p->RIOHosts[p->RIONumHosts].Unique[2]) & 0xFF) << 16) | ((readb(&p->RIOHosts[p->RIONumHosts].Unique[3]) & 0xFF) << 24);
                        rio_dprintk(RIO_DEBUG_PROBE, "Hmm Tested ok, uniqid = %x.\n", p->RIOHosts[p->RIONumHosts].UniqueNum);
 
+                       p->RIOHosts[p->RIONumHosts].pdev = pdev;
+                       pci_dev_get(pdev);
+
                        p->RIOLastPCISearch = 0;
                        p->RIONumHosts++;
                        found++;
@@ -1181,6 +1188,8 @@ static void __exit rio_exit(void)
                }
                /* It is safe/allowed to del_timer a non-active timer */
                del_timer(&hp->timer);
+               if (hp->Type == RIO_PCI)
+                       pci_dev_put(hp->pdev);
        }
 
        if (misc_deregister(&rio_fw_device) < 0) {
index 052e8120a4713ccc2008e8f2f88988bc1adb0985..7ce77619707cf2f4fa1db2480d1acaebaf968ca9 100644 (file)
@@ -662,7 +662,7 @@ int riocontrol(struct rio_info *p, dev_t dev, int cmd, unsigned long arg, int su
                        p->RIOError.Error = COPYIN_FAILED;
                        return -EFAULT;
                }
-               if (portStats.port >= RIO_PORTS) {
+               if (portStats.port < 0 || portStats.port >= RIO_PORTS) {
                        p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE;
                        return -ENXIO;
                }
@@ -702,7 +702,7 @@ int riocontrol(struct rio_info *p, dev_t dev, int cmd, unsigned long arg, int su
                        p->RIOError.Error = COPYIN_FAILED;
                        return -EFAULT;
                }
-               if (portStats.port >= RIO_PORTS) {
+               if (portStats.port < 0 || portStats.port >= RIO_PORTS) {
                        p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE;
                        return -ENXIO;
                }
index 461bfe0234c932a615ae56781cade91a161a0948..3af7f0958c5d85a6a49a96ca8562eb2e31e122d3 100644 (file)
@@ -839,7 +839,7 @@ shutdown(struct cyclades_port * info)
     local_irq_save(flags);
        if (info->xmit_buf){
            free_page((unsigned long) info->xmit_buf);
-           info->xmit_buf = 0;
+           info->xmit_buf = NULL;
        }
 
        base_addr[CyCAR] = (u_char)channel;
@@ -1354,7 +1354,7 @@ cy_unthrottle(struct tty_struct * tty)
 
 static int
 get_serial_info(struct cyclades_port * info,
-                           struct serial_struct * retinfo)
+                           struct serial_struct __user * retinfo)
 {
   struct serial_struct tmp;
 
@@ -1376,7 +1376,7 @@ get_serial_info(struct cyclades_port * info,
 
 static int
 set_serial_info(struct cyclades_port * info,
-                           struct serial_struct * new_info)
+                           struct serial_struct __user * new_info)
 {
   struct serial_struct new_serial;
   struct cyclades_port old_info;
@@ -1503,7 +1503,7 @@ send_break( struct cyclades_port * info, int duration)
 } /* send_break */
 
 static int
-get_mon_info(struct cyclades_port * info, struct cyclades_monitor * mon)
+get_mon_info(struct cyclades_port * info, struct cyclades_monitor __user * mon)
 {
 
    if (copy_to_user(mon, &info->mon, sizeof(struct cyclades_monitor)))
@@ -1516,7 +1516,7 @@ get_mon_info(struct cyclades_port * info, struct cyclades_monitor * mon)
 }
 
 static int
-set_threshold(struct cyclades_port * info, unsigned long *arg)
+set_threshold(struct cyclades_port * info, unsigned long __user *arg)
 {
    volatile unsigned char *base_addr = (u_char *)BASE_ADDR;
    unsigned long value;
@@ -1533,7 +1533,7 @@ set_threshold(struct cyclades_port * info, unsigned long *arg)
 }
 
 static int
-get_threshold(struct cyclades_port * info, unsigned long *value)
+get_threshold(struct cyclades_port * info, unsigned long __user *value)
 {
    volatile unsigned char *base_addr = (u_char *)BASE_ADDR;
    int channel;
@@ -1546,7 +1546,7 @@ get_threshold(struct cyclades_port * info, unsigned long *value)
 }
 
 static int
-set_default_threshold(struct cyclades_port * info, unsigned long *arg)
+set_default_threshold(struct cyclades_port * info, unsigned long __user *arg)
 {
    unsigned long value;
 
@@ -1558,13 +1558,13 @@ set_default_threshold(struct cyclades_port * info, unsigned long *arg)
 }
 
 static int
-get_default_threshold(struct cyclades_port * info, unsigned long *value)
+get_default_threshold(struct cyclades_port * info, unsigned long __user *value)
 {
    return put_user(info->default_threshold,value);
 }
 
 static int
-set_timeout(struct cyclades_port * info, unsigned long *arg)
+set_timeout(struct cyclades_port * info, unsigned long __user *arg)
 {
    volatile unsigned char *base_addr = (u_char *)BASE_ADDR;
    int channel;
@@ -1581,7 +1581,7 @@ set_timeout(struct cyclades_port * info, unsigned long *arg)
 }
 
 static int
-get_timeout(struct cyclades_port * info, unsigned long *value)
+get_timeout(struct cyclades_port * info, unsigned long __user *value)
 {
    volatile unsigned char *base_addr = (u_char *)BASE_ADDR;
    int channel;
@@ -1601,7 +1601,7 @@ set_default_timeout(struct cyclades_port * info, unsigned long value)
 }
 
 static int
-get_default_timeout(struct cyclades_port * info, unsigned long *value)
+get_default_timeout(struct cyclades_port * info, unsigned long __user *value)
 {
    return put_user(info->default_timeout,value);
 }
@@ -1613,6 +1613,7 @@ cy_ioctl(struct tty_struct *tty, struct file * file,
   unsigned long val;
   struct cyclades_port * info = (struct cyclades_port *)tty->driver_data;
   int ret_val = 0;
+  void __user *argp = (void __user *)arg;
 
 #ifdef SERIAL_DEBUG_OTHER
     printk("cy_ioctl %s, cmd = %x arg = %lx\n", tty->name, cmd, arg); /* */
@@ -1620,28 +1621,28 @@ cy_ioctl(struct tty_struct *tty, struct file * file,
 
     switch (cmd) {
         case CYGETMON:
-            ret_val = get_mon_info(info, (struct cyclades_monitor *)arg);
+            ret_val = get_mon_info(info, argp);
            break;
         case CYGETTHRESH:
-           ret_val = get_threshold(info, (unsigned long *)arg);
+           ret_val = get_threshold(info, argp);
            break;
         case CYSETTHRESH:
-            ret_val = set_threshold(info, (unsigned long *)arg);
+            ret_val = set_threshold(info, argp);
            break;
         case CYGETDEFTHRESH:
-           ret_val = get_default_threshold(info, (unsigned long *)arg);
+           ret_val = get_default_threshold(info, argp);
            break;
         case CYSETDEFTHRESH:
-            ret_val = set_default_threshold(info, (unsigned long *)arg);
+            ret_val = set_default_threshold(info, argp);
            break;
         case CYGETTIMEOUT:
-           ret_val = get_timeout(info, (unsigned long *)arg);
+           ret_val = get_timeout(info, argp);
            break;
         case CYSETTIMEOUT:
-            ret_val = set_timeout(info, (unsigned long *)arg);
+            ret_val = set_timeout(info, argp);
            break;
         case CYGETDEFTIMEOUT:
-           ret_val = get_default_timeout(info, (unsigned long *)arg);
+           ret_val = get_default_timeout(info, argp);
            break;
         case CYSETDEFTIMEOUT:
             ret_val = set_default_timeout(info, (unsigned long)arg);
@@ -1664,21 +1665,20 @@ cy_ioctl(struct tty_struct *tty, struct file * file,
 
 /* The following commands are incompletely implemented!!! */
         case TIOCGSOFTCAR:
-            ret_val = put_user(C_CLOCAL(tty) ? 1 : 0, (unsigned long *) arg);
+            ret_val = put_user(C_CLOCAL(tty) ? 1 : 0, (unsigned long __user *) argp);
             break;
         case TIOCSSOFTCAR:
-            ret_val = get_user(val, (unsigned long *) arg);
+            ret_val = get_user(val, (unsigned long __user *) argp);
            if (ret_val)
                    break;
             tty->termios->c_cflag =
                     ((tty->termios->c_cflag & ~CLOCAL) | (val ? CLOCAL : 0));
             break;
         case TIOCGSERIAL:
-            ret_val = get_serial_info(info, (struct serial_struct *) arg);
+            ret_val = get_serial_info(info, argp);
             break;
         case TIOCSSERIAL:
-            ret_val = set_serial_info(info,
-                                   (struct serial_struct *) arg);
+            ret_val = set_serial_info(info, argp);
             break;
         default:
            ret_val = -ENOIOCTLCMD;
@@ -1773,7 +1773,7 @@ cy_close(struct tty_struct * tty, struct file * filp)
        tty->driver->flush_buffer(tty);
     tty_ldisc_flush(tty);
     info->event = 0;
-    info->tty = 0;
+    info->tty = NULL;
     if (info->blocked_open) {
        if (info->close_delay) {
            msleep_interruptible(jiffies_to_msecs(info->close_delay));
@@ -2250,7 +2250,7 @@ scrn[1] = '\0';
                info->card = index;
                info->line = port_num;
                info->flags = STD_COM_FLAGS;
-               info->tty = 0;
+               info->tty = NULL;
                info->xmit_fifo_size = 12;
                info->cor1 = CyPARITY_NONE|Cy_8_BITS;
                info->cor2 = CyETC;
index d0b88d0e87fdd5f72f5b6d992efafafadf877ea5..7e1bd9562c2ac3c2e63b40fb50dc92019b5231f8 100644 (file)
@@ -183,11 +183,6 @@ static int sx_poll = HZ;
 
 static struct tty_driver *specialix_driver;
 
-static unsigned long baud_table[] =  {
-       0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800,
-       9600, 19200, 38400, 57600, 115200, 0,
-};
-
 static struct specialix_board sx_board[SX_NBOARD] =  {
        { 0, SX_IOBASE1,  9, },
        { 0, SX_IOBASE2, 11, },
@@ -1090,9 +1085,9 @@ static void sx_change_speed(struct specialix_board *bp, struct specialix_port *p
 
        if (baud == 38400) {
                if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI)
-                       baud ++;
+                       baud = 57600;
                if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI)
-                       baud += 2;
+                       baud = 115200;
        }
 
        if (!baud) {
@@ -1150,11 +1145,9 @@ static void sx_change_speed(struct specialix_board *bp, struct specialix_port *p
        sx_out(bp, CD186x_RBPRL, tmp & 0xff);
        sx_out(bp, CD186x_TBPRL, tmp & 0xff);
        spin_unlock_irqrestore(&bp->lock, flags);
-       if (port->custom_divisor) {
+       if (port->custom_divisor)
                baud = (SX_OSCFREQ + port->custom_divisor/2) / port->custom_divisor;
-               baud = ( baud + 5 ) / 10;
-       } else
-               baud = (baud_table[baud] + 5) / 10;   /* Estimated CPS */
+       baud = (baud + 5) / 10;         /* Estimated CPS */
 
        /* Two timer ticks seems enough to wakeup something like SLIP driver */
        tmp = ((baud + HZ/2) / HZ) * 2 - CD186x_NFIFO;
index 5fec626598cd26b117a4518761ea40abc19be053..cc10af08cb059b7f587586518011613541bf028b 100644 (file)
@@ -2602,7 +2602,7 @@ static void __exit sx_exit (void)
                }
        }
        if (misc_deregister(&sx_fw_device) < 0) {
-               printk (KERN_INFO "sx: couldn't deregister firmware loader devic\n");
+               printk (KERN_INFO "sx: couldn't deregister firmware loader device\n");
        }
        sx_dprintk (SX_DEBUG_CLEANUP, "Cleaning up drivers (%d)\n", sx_initialized);
        if (sx_initialized)
index f2864cc64240d36ad637755bbd30cfdbfb31cfd9..06784adcc35c78f7f17650aa69722359b11129a2 100644 (file)
@@ -133,8 +133,8 @@ static MGSL_PARAMS default_params = {
 };
 
 #define SHARED_MEM_ADDRESS_SIZE 0x40000
-#define BUFFERLISTSIZE (PAGE_SIZE)
-#define DMABUFFERSIZE (PAGE_SIZE)
+#define BUFFERLISTSIZE 4096
+#define DMABUFFERSIZE 4096
 #define MAXRXFRAMES 7
 
 typedef struct _DMABUFFERENTRY
index 5948863b592b7434d57117dadc381a7584c113be..bf25d0a55a9954f9683a28c301a918cff349c5e1 100644 (file)
@@ -77,7 +77,8 @@ static struct pci_dev *alim7101_pmu;
 
 static int nowayout = WATCHDOG_NOWAYOUT;
 module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
+                __stringify(CONFIG_WATCHDOG_NOWAYOUT) ")");
 
 /*
  *     Whack the dog
@@ -415,6 +416,16 @@ err_out:
 module_init(alim7101_wdt_init);
 module_exit(alim7101_wdt_unload);
 
+static struct pci_device_id alim7101_pci_tbl[] __devinitdata = {
+       { PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533,
+         PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+       { PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101,
+         PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+       { }
+};
+
+MODULE_DEVICE_TABLE(pci, alim7101_pci_tbl);
+
 MODULE_AUTHOR("Steve Hill");
 MODULE_DESCRIPTION("ALi M7101 PMU Computer Watchdog Timer driver");
 MODULE_LICENSE("GPL");
index 7ad3be8c0f49e4f0bfc1722418ba377e9712de74..7fcb77a9d0111855948d5a02003c2845e8f5a8b3 100644 (file)
@@ -54,8 +54,8 @@ static cycle_t acpi_pm_read_verified(void)
                v1 = read_pmtmr();
                v2 = read_pmtmr();
                v3 = read_pmtmr();
-       } while ((v1 > v2 && v1 < v3) || (v2 > v3 && v2 < v1)
-                       || (v3 > v1 && v3 < v2));
+       } while (unlikely((v1 > v2 && v1 < v3) || (v2 > v3 && v2 < v1)
+                         || (v3 > v1 && v3 < v2)));
 
        return (cycle_t)v2;
 }
@@ -138,6 +138,8 @@ static void __devinit acpi_pm_check_graylist(struct pci_dev *dev)
 }
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_0,
                        acpi_pm_check_graylist);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_LE,
+                       acpi_pm_check_graylist);
 #endif
 
 
index 8bcb58cd4ac0f93daf7b4bdc3924e2ef4caa2e2a..1865b56fb141643878b50b4874c4be56f612ff0c 100644 (file)
@@ -8,7 +8,7 @@
  *
  *  See Documentation/dcdbas.txt for more information.
  *
- *  Copyright (C) 1995-2005 Dell Inc.
+ *  Copyright (C) 1995-2006 Dell Inc.
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License v2.0 as published by
@@ -40,7 +40,7 @@
 #include "dcdbas.h"
 
 #define DRIVER_NAME            "dcdbas"
-#define DRIVER_VERSION         "5.6.0-2"
+#define DRIVER_VERSION         "5.6.0-3.2"
 #define DRIVER_DESCRIPTION     "Dell Systems Management Base Driver"
 
 static struct platform_device *dcdbas_pdev;
@@ -175,6 +175,9 @@ static ssize_t smi_data_write(struct kobject *kobj, char *buf, loff_t pos,
 {
        ssize_t ret;
 
+       if ((pos + count) > MAX_SMI_DATA_BUF_SIZE)
+               return -EINVAL;
+
        mutex_lock(&smi_data_lock);
 
        ret = smi_data_buf_realloc(pos + count);
index b8b596d5778dbe03295395eccbad2176a25c3bfa..37deee6c0c1cc5aa4ca575797dea77d6ad792243 100644 (file)
@@ -326,6 +326,26 @@ char *dmi_get_system_info(int field)
 }
 EXPORT_SYMBOL(dmi_get_system_info);
 
+
+/**
+ *     dmi_name_in_vendors - Check if string is anywhere in the DMI vendor information.
+ *     @str:   Case sensitive Name
+ */
+int dmi_name_in_vendors(char *str)
+{
+       static int fields[] = { DMI_BIOS_VENDOR, DMI_BIOS_VERSION, DMI_SYS_VENDOR,
+                               DMI_PRODUCT_NAME, DMI_PRODUCT_VERSION, DMI_BOARD_VENDOR,
+                               DMI_BOARD_NAME, DMI_BOARD_VERSION, DMI_NONE };
+       int i;
+       for (i = 0; fields[i] != DMI_NONE; i++) {
+               int f = fields[i];
+               if (dmi_ident[f] && strstr(dmi_ident[f], str))
+                       return 1;
+       }
+       return 0;
+}
+EXPORT_SYMBOL(dmi_name_in_vendors);
+
 /**
  *     dmi_find_device - find onboard device by type/name
  *     @type: device type or %DMI_DEV_TYPE_ANY to match all device types
index 9b88b25b6edbdfb098dc189c1e54c0efb60e5b4b..e76d91906c99a3ab671dbb9e0736e3e197901efc 100644 (file)
@@ -95,11 +95,13 @@ config SENSORS_ADM9240
          will be called adm9240.
 
 config SENSORS_K8TEMP
-       tristate "AMD K8 processor sensor"
+       tristate "AMD Athlon64/FX or Opteron temperature sensor"
        depends on HWMON && X86 && PCI && EXPERIMENTAL
        help
          If you say yes here you get support for the temperature
-         sensor(s) inside your AMD K8 CPU.
+         sensor(s) inside your CPU. Supported is whole AMD K8
+         microarchitecture. Please note that you will need at least
+         lm-sensors 2.10.1 for proper userspace support.
 
          This driver can also be built as a module.  If so, the module
          will be called k8temp.
@@ -369,8 +371,8 @@ config SENSORS_SMSC47M1
        help
          If you say yes here you get support for the integrated fan
          monitoring and control capabilities of the SMSC LPC47B27x,
-         LPC47M10x, LPC47M13x, LPC47M14x, LPC47M15x, LPC47M192 and
-         LPC47M997 chips.
+         LPC47M10x, LPC47M112, LPC47M13x, LPC47M14x, LPC47M15x,
+         LPC47M192 and LPC47M997 chips.
 
          The temperature and voltage sensor features of the LPC47M192
          and LPC47M997 are supported by another driver, select also
index 377961c4a41eb7f737681388418324757a48e0e1..aad594adf0c726ab220967562ae89d99e5c0937d 100644 (file)
@@ -5,7 +5,7 @@
  * Copyright (C) 1999  Frodo Looijaard <frodol@dds.nl>
  *                     Philip Edelbrock <phil@netroedge.com>
  * Copyright (C) 2003  Michiel Rook <michiel@grendelproject.nl>
- * Copyright (C) 2005  Grant Coady <gcoady@gmail.com> with valuable
+ * Copyright (C) 2005  Grant Coady <gcoady.lk@gmail.com> with valuable
  *                             guidance from Jean Delvare
  *
  * Driver supports     Analog Devices          ADM9240
@@ -774,7 +774,7 @@ static void __exit sensors_adm9240_exit(void)
 }
 
 MODULE_AUTHOR("Michiel Rook <michiel@grendelproject.nl>, "
-               "Grant Coady <gcoady@gmail.com> and others");
+               "Grant Coady <gcoady.lk@gmail.com> and others");
 MODULE_DESCRIPTION("ADM9240/DS1780/LM81 driver");
 MODULE_LICENSE("GPL");
 
index ac1b746df6d0ad765b97bcb2fd77cb5bb99dabcb..73bc2ffc598d2cabf66664f34b43b9f9dbb2d9ce 100644 (file)
@@ -815,18 +815,18 @@ static int __init sm_lm78_init(void)
        if (res)
                return res;
 
-       res = i2c_isa_add_driver(&lm78_isa_driver);
-       if (res) {
-               i2c_del_driver(&lm78_driver);
-               return res;
-       }
+       /* Don't exit if this one fails, we still want the I2C variants
+          to work! */
+       if (i2c_isa_add_driver(&lm78_isa_driver))
+               isa_address = 0;
 
        return 0;
 }
 
 static void __exit sm_lm78_exit(void)
 {
-       i2c_isa_del_driver(&lm78_isa_driver);
+       if (isa_address)
+               i2c_isa_del_driver(&lm78_isa_driver);
        i2c_del_driver(&lm78_driver);
 }
 
index 47132fd26b1bf9a4f1948864fe95a34ecb5afdf2..beb881c4b2e8ce1f2c191f6ce2343655a0e57200 100644 (file)
@@ -2,8 +2,8 @@
     smsc47m1.c - Part of lm_sensors, Linux kernel modules
                  for hardware monitoring
 
-    Supports the SMSC LPC47B27x, LPC47M10x, LPC47M13x, LPC47M14x,
-    LPC47M15x, LPC47M192 and LPC47M997 Super-I/O chips.
+    Supports the SMSC LPC47B27x, LPC47M10x, LPC47M112, LPC47M13x,
+    LPC47M14x, LPC47M15x, LPC47M192 and LPC47M997 Super-I/O chips.
 
     Copyright (C) 2002 Mark D. Studebaker <mdsxyz123@yahoo.com>
     Copyright (C) 2004 Jean Delvare <khali@linux-fr.org>
@@ -380,8 +380,8 @@ static int __init smsc47m1_find(unsigned short *addr)
        val = superio_inb(SUPERIO_REG_DEVID);
 
        /*
-        * SMSC LPC47M10x/LPC47M13x (device id 0x59), LPC47M14x (device id
-        * 0x5F) and LPC47B27x (device id 0x51) have fan control.
+        * SMSC LPC47M10x/LPC47M112/LPC47M13x (device id 0x59), LPC47M14x
+        * (device id 0x5F) and LPC47B27x (device id 0x51) have fan control.
         * The LPC47M15x and LPC47M192 chips "with hardware monitoring block"
         * can do much more besides (device id 0x60).
         * The LPC47M997 is undocumented, but seems to be compatible with
@@ -390,7 +390,8 @@ static int __init smsc47m1_find(unsigned short *addr)
        if (val == 0x51)
                printk(KERN_INFO "smsc47m1: Found SMSC LPC47B27x\n");
        else if (val == 0x59)
-               printk(KERN_INFO "smsc47m1: Found SMSC LPC47M10x/LPC47M13x\n");
+               printk(KERN_INFO "smsc47m1: Found SMSC "
+                      "LPC47M10x/LPC47M112/LPC47M13x\n");
        else if (val == 0x5F)
                printk(KERN_INFO "smsc47m1: Found SMSC LPC47M14x\n");
        else if (val == 0x60)
index 833faa275ffaed22b8eb5caa57172a965595ca7a..2257806d0102b203bff43aa3e3c73530c7ef49dc 100644 (file)
@@ -354,6 +354,8 @@ static void w83627ehf_write_fan_div(struct i2c_client *client, int nr)
        case 0:
                reg = (w83627ehf_read_value(client, W83627EHF_REG_FANDIV1) & 0xcf)
                    | ((data->fan_div[0] & 0x03) << 4);
+               /* fan5 input control bit is write only, compute the value */
+               reg |= (data->has_fan & (1 << 4)) ? 1 : 0;
                w83627ehf_write_value(client, W83627EHF_REG_FANDIV1, reg);
                reg = (w83627ehf_read_value(client, W83627EHF_REG_VBAT) & 0xdf)
                    | ((data->fan_div[0] & 0x04) << 3);
@@ -362,6 +364,8 @@ static void w83627ehf_write_fan_div(struct i2c_client *client, int nr)
        case 1:
                reg = (w83627ehf_read_value(client, W83627EHF_REG_FANDIV1) & 0x3f)
                    | ((data->fan_div[1] & 0x03) << 6);
+               /* fan5 input control bit is write only, compute the value */
+               reg |= (data->has_fan & (1 << 4)) ? 1 : 0;
                w83627ehf_write_value(client, W83627EHF_REG_FANDIV1, reg);
                reg = (w83627ehf_read_value(client, W83627EHF_REG_VBAT) & 0xbf)
                    | ((data->fan_div[1] & 0x04) << 4);
@@ -1216,13 +1220,16 @@ static int w83627ehf_detect(struct i2c_adapter *adapter)
        superio_exit();
 
        /* It looks like fan4 and fan5 pins can be alternatively used
-          as fan on/off switches */
+          as fan on/off switches, but fan5 control is write only :/
+          We assume that if the serial interface is disabled, designers
+          connected fan5 as input unless they are emitting log 1, which
+          is not the default. */
 
        data->has_fan = 0x07; /* fan1, fan2 and fan3 */
        i = w83627ehf_read_value(client, W83627EHF_REG_FANDIV1);
        if ((i & (1 << 2)) && (!fan4pin))
                data->has_fan |= (1 << 3);
-       if ((i & (1 << 0)) && (!fan5pin))
+       if (!(i & (1 << 1)) && (!fan5pin))
                data->has_fan |= (1 << 4);
 
        /* Register sysfs hooks */
index a4584ec69842fba9910d234fc6c80bb58b2a357f..1232171c3aad804a97320e0a909bd1fa6ee3d362 100644 (file)
@@ -1099,7 +1099,8 @@ w83781d_detect(struct i2c_adapter *adapter, int address, int kind)
           bank. */
        if (kind < 0) {
                if (w83781d_read_value(client, W83781D_REG_CONFIG) & 0x80) {
-                       dev_dbg(dev, "Detection failed at step 3\n");
+                       dev_dbg(&adapter->dev, "Detection of w83781d chip "
+                               "failed at step 3\n");
                        err = -ENODEV;
                        goto ERROR2;
                }
@@ -1109,7 +1110,8 @@ w83781d_detect(struct i2c_adapter *adapter, int address, int kind)
                if ((!(val1 & 0x07)) &&
                    (((!(val1 & 0x80)) && (val2 != 0xa3) && (val2 != 0xc3))
                     || ((val1 & 0x80) && (val2 != 0x5c) && (val2 != 0x12)))) {
-                       dev_dbg(dev, "Detection failed at step 4\n");
+                       dev_dbg(&adapter->dev, "Detection of w83781d chip "
+                               "failed at step 4\n");
                        err = -ENODEV;
                        goto ERROR2;
                }
@@ -1119,7 +1121,8 @@ w83781d_detect(struct i2c_adapter *adapter, int address, int kind)
                                  ((val1 & 0x80) && (val2 == 0x5c)))) {
                        if (w83781d_read_value
                            (client, W83781D_REG_I2C_ADDR) != address) {
-                               dev_dbg(dev, "Detection failed at step 5\n");
+                               dev_dbg(&adapter->dev, "Detection of w83781d "
+                                       "chip failed at step 5\n");
                                err = -ENODEV;
                                goto ERROR2;
                        }
@@ -1141,8 +1144,8 @@ w83781d_detect(struct i2c_adapter *adapter, int address, int kind)
                else if (val2 == 0x12)
                        vendid = asus;
                else {
-                       dev_dbg(dev, "Chip was made by neither "
-                               "Winbond nor Asus?\n");
+                       dev_dbg(&adapter->dev, "w83781d chip vendor is "
+                               "neither Winbond nor Asus\n");
                        err = -ENODEV;
                        goto ERROR2;
                }
@@ -1161,10 +1164,9 @@ w83781d_detect(struct i2c_adapter *adapter, int address, int kind)
                        kind = as99127f;
                else {
                        if (kind == 0)
-                               dev_warn(dev, "Ignoring 'force' "
+                               dev_warn(&adapter->dev, "Ignoring 'force' "
                                         "parameter for unknown chip at "
-                                        "adapter %d, address 0x%02x\n",
-                                        i2c_adapter_id(adapter), address);
+                                        "address 0x%02x\n", address);
                        err = -EINVAL;
                        goto ERROR2;
                }
@@ -1685,11 +1687,10 @@ sensors_w83781d_init(void)
        if (res)
                return res;
 
-       res = i2c_isa_add_driver(&w83781d_isa_driver);
-       if (res) {
-               i2c_del_driver(&w83781d_driver);
-               return res;
-       }
+       /* Don't exit if this one fails, we still want the I2C variants
+          to work! */
+       if (i2c_isa_add_driver(&w83781d_isa_driver))
+               isa_address = 0;
 
        return 0;
 }
@@ -1697,7 +1698,8 @@ sensors_w83781d_init(void)
 static void __exit
 sensors_w83781d_exit(void)
 {
-       i2c_isa_del_driver(&w83781d_isa_driver);
+       if (isa_address)
+               i2c_isa_del_driver(&w83781d_isa_driver);
        i2c_del_driver(&w83781d_driver);
 }
 
index 371ed4f69a97ea9f122b65ad489d74a2c60f210a..9e5f885368b4e3f8e697be2ef0138f9bc8eb03f0 100644 (file)
@@ -746,6 +746,52 @@ static ssize_t store_vrm_reg(struct device *dev,
 
 static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg);
 
+#define IN_UNIT_ATTRS(X) \
+       &sda_in_input[X].dev_attr.attr, \
+       &sda_in_min[X].dev_attr.attr,   \
+       &sda_in_max[X].dev_attr.attr
+
+#define FAN_UNIT_ATTRS(X) \
+       &sda_fan_input[X].dev_attr.attr,        \
+       &sda_fan_min[X].dev_attr.attr,          \
+       &sda_fan_div[X].dev_attr.attr
+
+#define TEMP_UNIT_ATTRS(X) \
+       &sda_temp_input[X].dev_attr.attr,       \
+       &sda_temp_max[X].dev_attr.attr,         \
+       &sda_temp_max_hyst[X].dev_attr.attr
+
+static struct attribute *w83791d_attributes[] = {
+       IN_UNIT_ATTRS(0),
+       IN_UNIT_ATTRS(1),
+       IN_UNIT_ATTRS(2),
+       IN_UNIT_ATTRS(3),
+       IN_UNIT_ATTRS(4),
+       IN_UNIT_ATTRS(5),
+       IN_UNIT_ATTRS(6),
+       IN_UNIT_ATTRS(7),
+       IN_UNIT_ATTRS(8),
+       IN_UNIT_ATTRS(9),
+       FAN_UNIT_ATTRS(0),
+       FAN_UNIT_ATTRS(1),
+       FAN_UNIT_ATTRS(2),
+       FAN_UNIT_ATTRS(3),
+       FAN_UNIT_ATTRS(4),
+       TEMP_UNIT_ATTRS(0),
+       TEMP_UNIT_ATTRS(1),
+       TEMP_UNIT_ATTRS(2),
+       &dev_attr_alarms.attr,
+       &sda_beep_ctrl[0].dev_attr.attr,
+       &sda_beep_ctrl[1].dev_attr.attr,
+       &dev_attr_cpu0_vid.attr,
+       &dev_attr_vrm.attr,
+       NULL
+};
+
+static const struct attribute_group w83791d_group = {
+       .attrs = w83791d_attributes,
+};
+
 /* This function is called when:
      * w83791d_driver is inserted (when this module is loaded), for each
        available adapter
@@ -967,41 +1013,20 @@ static int w83791d_detect(struct i2c_adapter *adapter, int address, int kind)
        }
 
        /* Register sysfs hooks */
+       if ((err = sysfs_create_group(&client->dev.kobj, &w83791d_group)))
+               goto error3;
+
+       /* Everything is ready, now register the working device */
        data->class_dev = hwmon_device_register(dev);
        if (IS_ERR(data->class_dev)) {
                err = PTR_ERR(data->class_dev);
-               goto error3;
+               goto error4;
        }
 
-       for (i = 0; i < NUMBER_OF_VIN; i++) {
-               device_create_file(dev, &sda_in_input[i].dev_attr);
-               device_create_file(dev, &sda_in_min[i].dev_attr);
-               device_create_file(dev, &sda_in_max[i].dev_attr);
-       }
-
-       for (i = 0; i < NUMBER_OF_FANIN; i++) {
-               device_create_file(dev, &sda_fan_input[i].dev_attr);
-               device_create_file(dev, &sda_fan_div[i].dev_attr);
-               device_create_file(dev, &sda_fan_min[i].dev_attr);
-       }
-
-       for (i = 0; i < NUMBER_OF_TEMPIN; i++) {
-               device_create_file(dev, &sda_temp_input[i].dev_attr);
-               device_create_file(dev, &sda_temp_max[i].dev_attr);
-               device_create_file(dev, &sda_temp_max_hyst[i].dev_attr);
-       }
-
-       device_create_file(dev, &dev_attr_alarms);
-
-       for (i = 0; i < ARRAY_SIZE(sda_beep_ctrl); i++) {
-               device_create_file(dev, &sda_beep_ctrl[i].dev_attr);
-       }
-
-       device_create_file(dev, &dev_attr_cpu0_vid);
-       device_create_file(dev, &dev_attr_vrm);
-
        return 0;
 
+error4:
+       sysfs_remove_group(&client->dev.kobj, &w83791d_group);
 error3:
        if (data->lm75[0] != NULL) {
                i2c_detach_client(data->lm75[0]);
@@ -1025,8 +1050,10 @@ static int w83791d_detach_client(struct i2c_client *client)
        int err;
 
        /* main client */
-       if (data)
+       if (data) {
                hwmon_device_unregister(data->class_dev);
+               sysfs_remove_group(&client->dev.kobj, &w83791d_group);
+       }
 
        if ((err = i2c_detach_client(client)))
                return err;
index 4380653748a4c155065bb057148f91e1e1b7eddd..8ed59a2dff532124afc6e899f1df3d6a4622f106 100644 (file)
@@ -91,7 +91,7 @@ int i2c_isa_add_driver(struct i2c_driver *driver)
        /* Now look for clients */
        res = driver->attach_adapter(&isa_adapter);
        if (res) {
-               dev_err(&isa_adapter.dev,
+               dev_dbg(&isa_adapter.dev,
                        "Driver %s failed to attach adapter, unregistering\n",
                        driver->driver.name);
                driver_unregister(&driver->driver);
index 1d0470c1f9579d262f0e93c2fcebab6dd89ad399..30175c7688e877016e0bd666bcfa4b8ca5e92ad4 100644 (file)
@@ -524,8 +524,8 @@ int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
        task_ioreg_t *hobsptr   = args.hobRegister;
        int err                 = 0;
        int tasksize            = sizeof(struct ide_task_request_s);
-       int taskin              = 0;
-       int taskout             = 0;
+       unsigned int taskin     = 0;
+       unsigned int taskout    = 0;
        u8 io_32bit             = drive->io_32bit;
        char __user *buf = (char __user *)arg;
 
@@ -538,8 +538,13 @@ int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
                return -EFAULT;
        }
 
-       taskout = (int) req_task->out_size;
-       taskin  = (int) req_task->in_size;
+       taskout = req_task->out_size;
+       taskin  = req_task->in_size;
+       
+       if (taskin > 65536 || taskout > 65536) {
+               err = -EINVAL;
+               goto abort;
+       }
 
        if (taskout) {
                int outtotal = tasksize;
index 5b77a5bcbf0c113b7a95f8ffc04bfa302292677a..ad418ce882cae837a77537fc8e54f2b909bfac7f 100644 (file)
 
 static int ide_generic_all;            /* Set to claim all devices */
 
+/*
+ * the module_param_named() was added for the modular case
+ * the __setup() is left as compatibility for existing setups
+ */
+#ifndef MODULE
+static int __init ide_generic_all_on(char *unused)
+{
+       ide_generic_all = 1;
+       printk(KERN_INFO "IDE generic will claim all unknown PCI IDE storage controllers.");
+       return 1;
+}
+__setup("all-generic-ide", ide_generic_all_on);
+#endif
 module_param_named(all_generic_ide, ide_generic_all, bool, 0444);
 MODULE_PARM_DESC(all_generic_ide, "IDE generic will claim all unknown PCI IDE storage controllers.");
 
index f3fe287fbd89ba6b5d65deb92b42ba1ca9f875e2..244f7eb7006d43ea5f7f691a170e93ff057fc6c0 100644 (file)
@@ -774,7 +774,7 @@ ioc4_ide_exit(void)
        ioc4_unregister_submodule(&ioc4_ide_submodule);
 }
 
-module_init(ioc4_ide_init);
+late_initcall(ioc4_ide_init); /* Call only after IDE init is done */
 module_exit(ioc4_ide_exit);
 
 MODULE_AUTHOR("Aniket Malatpure/Jeremy Higdon");
index dc1ebeac35c7d74b2e480b3362d5742a2f2f1d07..9e7bd94b958ad528b28b0d06e2bd7f02e4855c76 100644 (file)
@@ -1243,7 +1243,7 @@ static struct pci_driver c2_pci_driver = {
 
 static int __init c2_init_module(void)
 {
-       return pci_module_init(&c2_pci_driver);
+       return pci_register_driver(&c2_pci_driver);
 }
 
 static void __exit c2_exit_module(void)
index e37c5688c2146c969a609cc9a913d01319b86700..30409e179606e0b5d05609bf96b8b671910ac558 100644 (file)
@@ -150,8 +150,8 @@ static int c2_rnic_query(struct c2_dev *c2dev, struct ib_device_attr *props)
            (struct c2wr_rnic_query_rep *) (unsigned long) (vq_req->reply_msg);
        if (!reply)
                err = -ENOMEM;
-
-       err = c2_errno(reply);
+       else
+               err = c2_errno(reply);
        if (err)
                goto bail2;
 
index 29958b6e0214a672905bab6dc61a50e7f8a021d0..28c087b824c2846c7d6e971e59359295618587b0 100644 (file)
@@ -67,19 +67,54 @@ static struct file_operations diag_file_ops = {
        .release = ipath_diag_release
 };
 
+static ssize_t ipath_diagpkt_write(struct file *fp,
+                                  const char __user *data,
+                                  size_t count, loff_t *off);
+
+static struct file_operations diagpkt_file_ops = {
+       .owner = THIS_MODULE,
+       .write = ipath_diagpkt_write,
+};
+
+static atomic_t diagpkt_count = ATOMIC_INIT(0);
+static struct cdev *diagpkt_cdev;
+static struct class_device *diagpkt_class_dev;
+
 int ipath_diag_add(struct ipath_devdata *dd)
 {
        char name[16];
+       int ret = 0;
+
+       if (atomic_inc_return(&diagpkt_count) == 1) {
+               ret = ipath_cdev_init(IPATH_DIAGPKT_MINOR,
+                                     "ipath_diagpkt", &diagpkt_file_ops,
+                                     &diagpkt_cdev, &diagpkt_class_dev);
+
+               if (ret) {
+                       ipath_dev_err(dd, "Couldn't create ipath_diagpkt "
+                                     "device: %d", ret);
+                       goto done;
+               }
+       }
 
        snprintf(name, sizeof(name), "ipath_diag%d", dd->ipath_unit);
 
-       return ipath_cdev_init(IPATH_DIAG_MINOR_BASE + dd->ipath_unit, name,
-                              &diag_file_ops, &dd->diag_cdev,
-                              &dd->diag_class_dev);
+       ret = ipath_cdev_init(IPATH_DIAG_MINOR_BASE + dd->ipath_unit, name,
+                             &diag_file_ops, &dd->diag_cdev,
+                             &dd->diag_class_dev);
+       if (ret)
+               ipath_dev_err(dd, "Couldn't create %s device: %d",
+                             name, ret);
+
+done:
+       return ret;
 }
 
 void ipath_diag_remove(struct ipath_devdata *dd)
 {
+       if (atomic_dec_and_test(&diagpkt_count))
+               ipath_cdev_cleanup(&diagpkt_cdev, &diagpkt_class_dev);
+
        ipath_cdev_cleanup(&dd->diag_cdev, &dd->diag_class_dev);
 }
 
@@ -275,30 +310,6 @@ bail:
        return ret;
 }
 
-static ssize_t ipath_diagpkt_write(struct file *fp,
-                                  const char __user *data,
-                                  size_t count, loff_t *off);
-
-static struct file_operations diagpkt_file_ops = {
-       .owner = THIS_MODULE,
-       .write = ipath_diagpkt_write,
-};
-
-static struct cdev *diagpkt_cdev;
-static struct class_device *diagpkt_class_dev;
-
-int __init ipath_diagpkt_add(void)
-{
-       return ipath_cdev_init(IPATH_DIAGPKT_MINOR,
-                              "ipath_diagpkt", &diagpkt_file_ops,
-                              &diagpkt_cdev, &diagpkt_class_dev);
-}
-
-void __exit ipath_diagpkt_remove(void)
-{
-       ipath_cdev_cleanup(&diagpkt_cdev, &diagpkt_class_dev);
-}
-
 /**
  * ipath_diagpkt_write - write an IB packet
  * @fp: the diag data device file pointer
index 12cefa658f3ba888f808c79b902f9fb018fb380c..b4ffaa7bcbb752467591e384d052041fcdf1b2f4 100644 (file)
@@ -2005,18 +2005,8 @@ static int __init infinipath_init(void)
                goto bail_group;
        }
 
-       ret = ipath_diagpkt_add();
-       if (ret < 0) {
-               printk(KERN_ERR IPATH_DRV_NAME ": Unable to create "
-                      "diag data device: error %d\n", -ret);
-               goto bail_ipathfs;
-       }
-
        goto bail;
 
-bail_ipathfs:
-       ipath_exit_ipathfs();
-
 bail_group:
        ipath_driver_remove_group(&ipath_driver.driver);
 
index 7c436697d0e43df1be4e69074cdcc208737cca6a..06d5020a2f60625882920c1b52c74d680fa15660 100644 (file)
@@ -869,9 +869,6 @@ int ipath_device_create_group(struct device *, struct ipath_devdata *);
 void ipath_device_remove_group(struct device *, struct ipath_devdata *);
 int ipath_expose_reset(struct device *);
 
-int ipath_diagpkt_add(void);
-void ipath_diagpkt_remove(void);
-
 int ipath_init_ipathfs(void);
 void ipath_exit_ipathfs(void);
 int ipathfs_add_device(struct ipath_devdata *);
index e393681ba7d46a1988508c3f5d25e27b2cd4261d..149b3690123968ced42384ca1173be972ef710be 100644 (file)
@@ -39,6 +39,8 @@
 #include <linux/init.h>
 #include <linux/hardirq.h>
 
+#include <asm/io.h>
+
 #include <rdma/ib_pack.h>
 
 #include "mthca_dev.h"
@@ -210,6 +212,11 @@ static inline void update_cons_index(struct mthca_dev *dev, struct mthca_cq *cq,
                mthca_write64(doorbell,
                              dev->kar + MTHCA_CQ_DOORBELL,
                              MTHCA_GET_DOORBELL_LOCK(&dev->doorbell_lock));
+               /*
+                * Make sure doorbells don't leak out of CQ spinlock
+                * and reach the HCA out of order:
+                */
+               mmiowb();
        }
 }
 
index 5e5c58b9920b5c3d53b6d0a61a3afcaee037e281..6a7822e0fc19a94ca67fc306d5207aabdc865466 100644 (file)
@@ -39,6 +39,8 @@
 #include <linux/string.h>
 #include <linux/slab.h>
 
+#include <asm/io.h>
+
 #include <rdma/ib_verbs.h>
 #include <rdma/ib_cache.h>
 #include <rdma/ib_pack.h>
@@ -1732,6 +1734,11 @@ out:
                mthca_write64(doorbell,
                              dev->kar + MTHCA_SEND_DOORBELL,
                              MTHCA_GET_DOORBELL_LOCK(&dev->doorbell_lock));
+               /*
+                * Make sure doorbells don't leak out of SQ spinlock
+                * and reach the HCA out of order:
+                */
+               mmiowb();
        }
 
        qp->sq.next_ind = ind;
@@ -1851,6 +1858,12 @@ out:
        qp->rq.next_ind = ind;
        qp->rq.head    += nreq;
 
+       /*
+        * Make sure doorbells don't leak out of RQ spinlock and reach
+        * the HCA out of order:
+        */
+       mmiowb();
+
        spin_unlock_irqrestore(&qp->rq.lock, flags);
        return err;
 }
@@ -2112,6 +2125,12 @@ out:
                              MTHCA_GET_DOORBELL_LOCK(&dev->doorbell_lock));
        }
 
+       /*
+        * Make sure doorbells don't leak out of SQ spinlock and reach
+        * the HCA out of order:
+        */
+       mmiowb();
+
        spin_unlock_irqrestore(&qp->sq.lock, flags);
        return err;
 }
index 92a72f5215286493250283b89b7aed2ab096af9a..f5d7677d107969ee59b68b815d4926d7a5685cbf 100644 (file)
@@ -35,6 +35,8 @@
 #include <linux/slab.h>
 #include <linux/string.h>
 
+#include <asm/io.h>
+
 #include "mthca_dev.h"
 #include "mthca_cmd.h"
 #include "mthca_memfree.h"
@@ -595,6 +597,12 @@ int mthca_tavor_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr,
                              MTHCA_GET_DOORBELL_LOCK(&dev->doorbell_lock));
        }
 
+       /*
+        * Make sure doorbells don't leak out of SRQ spinlock and
+        * reach the HCA out of order:
+        */
+       mmiowb();
+
        spin_unlock_irqrestore(&srq->lock, flags);
        return err;
 }
index 90de5afe03c21a40c95383d01f919e2b15699eb8..1dec00e20dbc0f28c2274bec2984d28bb947ac44 100644 (file)
@@ -82,17 +82,19 @@ static int __devinit fm801_gp_probe(struct pci_dev *pci, const struct pci_device
 {
        struct fm801_gp *gp;
        struct gameport *port;
+       int error;
 
        gp = kzalloc(sizeof(struct fm801_gp), GFP_KERNEL);
        port = gameport_allocate_port();
        if (!gp || !port) {
                printk(KERN_ERR "fm801-gp: Memory allocation failed\n");
-               kfree(gp);
-               gameport_free_port(port);
-               return -ENOMEM;
+               error = -ENOMEM;
+               goto err_out_free;
        }
 
-       pci_enable_device(pci);
+       error = pci_enable_device(pci);
+       if (error)
+               goto err_out_free;
 
        port->open = fm801_gp_open;
 #ifdef HAVE_COOKED
@@ -108,9 +110,8 @@ static int __devinit fm801_gp_probe(struct pci_dev *pci, const struct pci_device
        if (!gp->res_port) {
                printk(KERN_DEBUG "fm801-gp: unable to grab region 0x%x-0x%x\n",
                        port->io, port->io + 0x0f);
-               gameport_free_port(port);
-               kfree(gp);
-               return -EBUSY;
+               error = -EBUSY;
+               goto err_out_disable_dev;
        }
 
        pci_set_drvdata(pci, gp);
@@ -119,6 +120,13 @@ static int __devinit fm801_gp_probe(struct pci_dev *pci, const struct pci_device
        gameport_register_port(port);
 
        return 0;
+
+ err_out_disable_dev:
+       pci_disable_device(pci);
+ err_out_free:
+       gameport_free_port(port);
+       kfree(gp);
+       return error;
 }
 
 static void __devexit fm801_gp_remove(struct pci_dev *pci)
index 3f47ae55c6f3892f7c6b6952e9cf38ccf7d8585f..a0af97efe6ac0e23fd440cc1608db170890a005d 100644 (file)
@@ -191,6 +191,8 @@ static void gameport_run_poll_handler(unsigned long d)
 
 static void gameport_bind_driver(struct gameport *gameport, struct gameport_driver *drv)
 {
+       int error;
+
        down_write(&gameport_bus.subsys.rwsem);
 
        gameport->dev.driver = &drv->driver;
@@ -198,8 +200,20 @@ static void gameport_bind_driver(struct gameport *gameport, struct gameport_driv
                gameport->dev.driver = NULL;
                goto out;
        }
-       device_bind_driver(&gameport->dev);
-out:
+
+       error = device_bind_driver(&gameport->dev);
+       if (error) {
+               printk(KERN_WARNING
+                       "gameport: device_bind_driver() failed "
+                       "for %s (%s) and %s, error: %d\n",
+                       gameport->phys, gameport->name,
+                       drv->description, error);
+               drv->disconnect(gameport);
+               gameport->dev.driver = NULL;
+               goto out;
+       }
+
+ out:
        up_write(&gameport_bus.subsys.rwsem);
 }
 
index b6ef9eaad1dc25d686a0950cc72f96ce57539265..cbb93669d1cef7b9a3188ee74a008de927c1f2c7 100644 (file)
@@ -221,6 +221,7 @@ struct atkbd {
        unsigned long xl_bit;
        unsigned int last;
        unsigned long time;
+       unsigned long err_count;
 
        struct work_struct event_work;
        struct mutex event_mutex;
@@ -234,11 +235,13 @@ static ssize_t atkbd_attr_set_helper(struct device *dev, const char *buf, size_t
 #define ATKBD_DEFINE_ATTR(_name)                                               \
 static ssize_t atkbd_show_##_name(struct atkbd *, char *);                     \
 static ssize_t atkbd_set_##_name(struct atkbd *, const char *, size_t);                \
-static ssize_t atkbd_do_show_##_name(struct device *d, struct device_attribute *attr, char *b)                 \
+static ssize_t atkbd_do_show_##_name(struct device *d,                         \
+                               struct device_attribute *attr, char *b)         \
 {                                                                              \
        return atkbd_attr_show_helper(d, b, atkbd_show_##_name);                \
 }                                                                              \
-static ssize_t atkbd_do_set_##_name(struct device *d, struct device_attribute *attr, const char *b, size_t s)  \
+static ssize_t atkbd_do_set_##_name(struct device *d,                          \
+                       struct device_attribute *attr, const char *b, size_t s) \
 {                                                                              \
        return atkbd_attr_set_helper(d, b, s, atkbd_set_##_name);               \
 }                                                                              \
@@ -251,6 +254,32 @@ ATKBD_DEFINE_ATTR(set);
 ATKBD_DEFINE_ATTR(softrepeat);
 ATKBD_DEFINE_ATTR(softraw);
 
+#define ATKBD_DEFINE_RO_ATTR(_name)                                            \
+static ssize_t atkbd_show_##_name(struct atkbd *, char *);                     \
+static ssize_t atkbd_do_show_##_name(struct device *d,                         \
+                               struct device_attribute *attr, char *b)         \
+{                                                                              \
+       return atkbd_attr_show_helper(d, b, atkbd_show_##_name);                \
+}                                                                              \
+static struct device_attribute atkbd_attr_##_name =                            \
+       __ATTR(_name, S_IRUGO, atkbd_do_show_##_name, NULL);
+
+ATKBD_DEFINE_RO_ATTR(err_count);
+
+static struct attribute *atkbd_attributes[] = {
+       &atkbd_attr_extra.attr,
+       &atkbd_attr_scroll.attr,
+       &atkbd_attr_set.attr,
+       &atkbd_attr_softrepeat.attr,
+       &atkbd_attr_softraw.attr,
+       &atkbd_attr_err_count.attr,
+       NULL
+};
+
+static struct attribute_group atkbd_attribute_group = {
+       .attrs  = atkbd_attributes,
+};
+
 static const unsigned int xl_table[] = {
        ATKBD_RET_BAT, ATKBD_RET_ERR, ATKBD_RET_ACK,
        ATKBD_RET_NAK, ATKBD_RET_HANJA, ATKBD_RET_HANGEUL,
@@ -396,7 +425,10 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data,
                        add_release_event = 1;
                        break;
                case ATKBD_RET_ERR:
+                       atkbd->err_count++;
+#ifdef ATKBD_DEBUG
                        printk(KERN_DEBUG "atkbd.c: Keyboard on %s reports too many keys pressed.\n", serio->phys);
+#endif
                        goto out;
        }
 
@@ -786,12 +818,7 @@ static void atkbd_disconnect(struct serio *serio)
        synchronize_sched();  /* Allow atkbd_interrupt()s to complete. */
        flush_scheduled_work();
 
-       device_remove_file(&serio->dev, &atkbd_attr_extra);
-       device_remove_file(&serio->dev, &atkbd_attr_scroll);
-       device_remove_file(&serio->dev, &atkbd_attr_set);
-       device_remove_file(&serio->dev, &atkbd_attr_softrepeat);
-       device_remove_file(&serio->dev, &atkbd_attr_softraw);
-
+       sysfs_remove_group(&serio->dev.kobj, &atkbd_attribute_group);
        input_unregister_device(atkbd->dev);
        serio_close(serio);
        serio_set_drvdata(serio, NULL);
@@ -961,11 +988,7 @@ static int atkbd_connect(struct serio *serio, struct serio_driver *drv)
        atkbd_set_keycode_table(atkbd);
        atkbd_set_device_attrs(atkbd);
 
-       device_create_file(&serio->dev, &atkbd_attr_extra);
-       device_create_file(&serio->dev, &atkbd_attr_scroll);
-       device_create_file(&serio->dev, &atkbd_attr_set);
-       device_create_file(&serio->dev, &atkbd_attr_softrepeat);
-       device_create_file(&serio->dev, &atkbd_attr_softraw);
+       sysfs_create_group(&serio->dev.kobj, &atkbd_attribute_group);
 
        atkbd_enable(atkbd);
 
@@ -1259,6 +1282,11 @@ static ssize_t atkbd_set_softraw(struct atkbd *atkbd, const char *buf, size_t co
        return count;
 }
 
+static ssize_t atkbd_show_err_count(struct atkbd *atkbd, char *buf)
+{
+       return sprintf(buf, "%lu\n", atkbd->err_count);
+}
+
 
 static int __init atkbd_init(void)
 {
index cb70970625b5b9f05cd4dbe05d66c312e9cec824..befdd6006b500d093be9036386b491da39496c9b 100644 (file)
@@ -207,7 +207,7 @@ static irqreturn_t corgikbd_interrupt(int irq, void *dev_id)
 static void corgikbd_timer_callback(unsigned long data)
 {
        struct corgikbd *corgikbd_data = (struct corgikbd *) data;
-       corgikbd_scankeyboard(corgikbd_data, NULL);
+       corgikbd_scankeyboard(corgikbd_data);
 }
 
 /*
index fd33c9cc3272ac78972e31dd566c193564e0681f..5788dbc317bba3226266b28e78dc0890fe7125e7 100644 (file)
@@ -186,7 +186,7 @@ static irqreturn_t locomokbd_interrupt(int irq, void *dev_id)
 static void locomokbd_timer_callback(unsigned long data)
 {
        struct locomokbd *locomokbd = (struct locomokbd *) data;
-       locomokbd_scankeyboard(locomokbd, NULL);
+       locomokbd_scankeyboard(locomokbd);
 }
 
 static int locomokbd_probe(struct locomo_dev *dev)
index 8b18c009e3e027b42889d3ee8d2827263b393ad4..28b2748e82d087bf4255d40c9ecca17f779811d6 100644 (file)
@@ -257,7 +257,7 @@ static void spitzkbd_timer_callback(unsigned long data)
 {
        struct spitzkbd *spitzkbd_data = (struct spitzkbd *) data;
 
-       spitzkbd_scankeyboard(spitzkbd_data, NULL);
+       spitzkbd_scankeyboard(spitzkbd_data);
 }
 
 /*
index 1be963961c15734bfd923c07c589ab6a1a8f2a47..ab4da79ee560d9279afc989d129715c45dd1593c 100644 (file)
@@ -60,7 +60,7 @@ static struct fasync_struct *hp_sdc_rtc_async_queue;
 
 static DECLARE_WAIT_QUEUE_HEAD(hp_sdc_rtc_wait);
 
-static ssize_t hp_sdc_rtc_read(struct file *file, char *buf,
+static ssize_t hp_sdc_rtc_read(struct file *file, char __user *buf,
                               size_t count, loff_t *ppos);
 
 static int hp_sdc_rtc_ioctl(struct inode *inode, struct file *file,
@@ -385,14 +385,14 @@ static int hp_sdc_rtc_set_i8042timer (struct timeval *setto, uint8_t setcmd)
        return 0;
 }
 
-static ssize_t hp_sdc_rtc_read(struct file *file, char *buf,
+static ssize_t hp_sdc_rtc_read(struct file *file, char __user *buf,
                               size_t count, loff_t *ppos) {
        ssize_t retval;
 
         if (count < sizeof(unsigned long))
                 return -EINVAL;
 
-       retval = put_user(68, (unsigned long *)buf);
+       retval = put_user(68, (unsigned long __user *)buf);
        return retval;
 }
 
@@ -696,7 +696,7 @@ static int __init hp_sdc_rtc_init(void)
        if ((ret = hp_sdc_request_timer_irq(&hp_sdc_rtc_isr)))
                return ret;
        misc_register(&hp_sdc_rtc_dev);
-        create_proc_read_entry ("driver/rtc", 0, 0, 
+        create_proc_read_entry ("driver/rtc", 0, NULL,
                                hp_sdc_rtc_read_proc, NULL);
 
        printk(KERN_INFO "HP i8042 SDC + MSM-58321 RTC support loaded "
index bdfde046b7410b0df4370b92c7913f96fe1c9823..49e11e2c1d5dd24e08c8c0caab91d270e805c19e 100644 (file)
@@ -391,23 +391,23 @@ static int hilse_operate(hil_mlc *mlc, int repoll) {
 }
 
 #define FUNC(funct, funct_arg, zero_rc, neg_rc, pos_rc) \
-{ HILSE_FUNC,          { func: &funct }, funct_arg, zero_rc, neg_rc, pos_rc },
+{ HILSE_FUNC,          { .func = funct }, funct_arg, zero_rc, neg_rc, pos_rc },
 #define OUT(pack) \
-{ HILSE_OUT,           { packet: pack }, 0, HILSEN_NEXT, HILSEN_DOZE, 0 },
+{ HILSE_OUT,           { .packet = pack }, 0, HILSEN_NEXT, HILSEN_DOZE, 0 },
 #define CTS \
-{ HILSE_CTS,           { packet: 0    }, 0, HILSEN_NEXT | HILSEN_SCHED | HILSEN_BREAK, HILSEN_DOZE, 0 },
+{ HILSE_CTS,           { .packet = 0    }, 0, HILSEN_NEXT | HILSEN_SCHED | HILSEN_BREAK, HILSEN_DOZE, 0 },
 #define EXPECT(comp, to, got, got_wrong, timed_out) \
-{ HILSE_EXPECT,                { packet: comp }, to, got, got_wrong, timed_out },
+{ HILSE_EXPECT,                { .packet = comp }, to, got, got_wrong, timed_out },
 #define EXPECT_LAST(comp, to, got, got_wrong, timed_out) \
-{ HILSE_EXPECT_LAST,   { packet: comp }, to, got, got_wrong, timed_out },
+{ HILSE_EXPECT_LAST,   { .packet = comp }, to, got, got_wrong, timed_out },
 #define EXPECT_DISC(comp, to, got, got_wrong, timed_out) \
-{ HILSE_EXPECT_DISC,   { packet: comp }, to, got, got_wrong, timed_out },
+{ HILSE_EXPECT_DISC,   { .packet = comp }, to, got, got_wrong, timed_out },
 #define IN(to, got, got_error, timed_out) \
-{ HILSE_IN,            { packet: 0    }, to, got, got_error, timed_out },
+{ HILSE_IN,            { .packet = 0    }, to, got, got_error, timed_out },
 #define OUT_DISC(pack) \
-{ HILSE_OUT_DISC,      { packet: pack }, 0, 0, 0, 0 },
+{ HILSE_OUT_DISC,      { .packet = pack }, 0, 0, 0, 0 },
 #define OUT_LAST(pack) \
-{ HILSE_OUT_LAST,      { packet: pack }, 0, 0, 0, 0 },
+{ HILSE_OUT_LAST,      { .packet = pack }, 0, 0, 0, 0 },
 
 struct hilse_node hil_mlc_se[HILSEN_END] = {
 
index ba7b920347e3f11c5b2e2b889b5c8e4d2987545c..9907ad3bea23252547a6a26c6cfd4d4dafae1269 100644 (file)
@@ -310,7 +310,7 @@ static void hp_sdc_tasklet(unsigned long foo) {
                                 * in tasklet/bh context.
                                 */
                                if (curr->act.irqhook) 
-                                       curr->act.irqhook(0, 0, 0, 0);
+                                       curr->act.irqhook(0, NULL, 0, 0);
                        }
                        curr->actidx = curr->idx;
                        curr->idx++;
@@ -525,7 +525,7 @@ actdone:
                up(curr->act.semaphore);
        }
        else if (act & HP_SDC_ACT_CALLBACK) {
-               curr->act.irqhook(0,0,0,0);
+               curr->act.irqhook(0,NULL,0,0);
        }
        if (curr->idx >= curr->endidx) { /* This transaction is over. */
                if (act & HP_SDC_ACT_DEALLOC) kfree(curr);
index 09b06e605b509d25cb91ca3818c6fa4833810453..7e3141f37e32a7907fa2d00b15266652b2b6bb9e 100644 (file)
@@ -106,6 +106,7 @@ static unsigned char i8042_ctr;
 static unsigned char i8042_mux_present;
 static unsigned char i8042_kbd_irq_registered;
 static unsigned char i8042_aux_irq_registered;
+static unsigned char i8042_suppress_kbd_ack;
 static struct platform_device *i8042_platform_device;
 
 static irqreturn_t i8042_interrupt(int irq, void *dev_id);
@@ -316,7 +317,7 @@ static irqreturn_t i8042_interrupt(int irq, void *dev_id)
        unsigned char str, data;
        unsigned int dfl;
        unsigned int port_no;
-       int ret;
+       int ret = 1;
 
        spin_lock_irqsave(&i8042_lock, flags);
        str = i8042_read_status();
@@ -378,10 +379,16 @@ static irqreturn_t i8042_interrupt(int irq, void *dev_id)
            dfl & SERIO_PARITY ? ", bad parity" : "",
            dfl & SERIO_TIMEOUT ? ", timeout" : "");
 
+       if (unlikely(i8042_suppress_kbd_ack))
+               if (port_no == I8042_KBD_PORT_NO &&
+                   (data == 0xfa || data == 0xfe)) {
+                       i8042_suppress_kbd_ack = 0;
+                       goto out;
+               }
+
        if (likely(port->exists))
                serio_interrupt(port->serio, data, dfl);
 
-       ret = 1;
  out:
        return IRQ_RETVAL(ret);
 }
@@ -842,11 +849,13 @@ static long i8042_panic_blink(long count)
        led ^= 0x01 | 0x04;
        while (i8042_read_status() & I8042_STR_IBF)
                DELAY;
+       i8042_suppress_kbd_ack = 1;
        i8042_write_data(0xed); /* set leds */
        DELAY;
        while (i8042_read_status() & I8042_STR_IBF)
                DELAY;
        DELAY;
+       i8042_suppress_kbd_ack = 1;
        i8042_write_data(led);
        DELAY;
        last_blink = count;
index dcb16b5cbec084716050232f88c16fc53942b19f..e5b1b60757bb8d7a965aa92a87ffbae2e0264042 100644 (file)
@@ -189,7 +189,7 @@ int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command)
                return -1;
        }
 
-       mutex_lock_nested(&ps2dev->cmd_mutex, SINGLE_DEPTH_NESTING);
+       mutex_lock(&ps2dev->cmd_mutex);
 
        serio_pause_rx(ps2dev->serio);
        ps2dev->flags = command == PS2_CMD_GETID ? PS2_FLAG_WAITID : 0;
@@ -296,6 +296,7 @@ EXPORT_SYMBOL(ps2_schedule_command);
 void ps2_init(struct ps2dev *ps2dev, struct serio *serio)
 {
        mutex_init(&ps2dev->cmd_mutex);
+       lockdep_set_subclass(&ps2dev->cmd_mutex, serio->depth);
        init_waitqueue_head(&ps2dev->wait);
        ps2dev->serio = serio;
 }
index 960fae3c3ceadfec39309fb7429f67a495ce4b0d..211943f85cb66e1dee2b77aac5c3e30ce3d6c07a 100644 (file)
@@ -118,6 +118,8 @@ static int serio_match_port(const struct serio_device_id *ids, struct serio *ser
 
 static void serio_bind_driver(struct serio *serio, struct serio_driver *drv)
 {
+       int error;
+
        down_write(&serio_bus.subsys.rwsem);
 
        if (serio_match_port(drv->id_table, serio)) {
@@ -126,9 +128,19 @@ static void serio_bind_driver(struct serio *serio, struct serio_driver *drv)
                        serio->dev.driver = NULL;
                        goto out;
                }
-               device_bind_driver(&serio->dev);
+               error = device_bind_driver(&serio->dev);
+               if (error) {
+                       printk(KERN_WARNING
+                               "serio: device_bind_driver() failed "
+                               "for %s (%s) and %s, error: %d\n",
+                               serio->phys, serio->name,
+                               drv->description, error);
+                       serio_disconnect_driver(serio);
+                       serio->dev.driver = NULL;
+                       goto out;
+               }
        }
-out:
+ out:
        up_write(&serio_bus.subsys.rwsem);
 }
 
@@ -538,8 +550,12 @@ static void serio_init_port(struct serio *serio)
                 "serio%ld", (long)atomic_inc_return(&serio_no) - 1);
        serio->dev.bus = &serio_bus;
        serio->dev.release = serio_release_port;
-       if (serio->parent)
+       if (serio->parent) {
                serio->dev.parent = &serio->parent->dev;
+               serio->depth = serio->parent->depth + 1;
+       } else
+               serio->depth = 0;
+       lockdep_set_subclass(&serio->lock, serio->depth);
 }
 
 /*
index ca79b2246195c910509d6b72a4e9104f57419af3..66121f6a89ad1969ad54dab4e9233b9e275d3a0e 100644 (file)
@@ -219,7 +219,7 @@ static void ts_interrupt_main(struct corgi_ts *corgi_ts, int isTimer)
 static void corgi_ts_timer(unsigned long data)
 {
        struct corgi_ts *corgits_data = (struct corgi_ts *) data;
-       ts_interrupt_main(corgits_data, 1, NULL);
+       ts_interrupt_main(corgits_data, 1);
 }
 
 static irqreturn_t ts_interrupt(int irq, void *dev_id)
@@ -237,7 +237,7 @@ static int corgits_suspend(struct platform_device *dev, pm_message_t state)
        if (corgi_ts->pendown) {
                del_timer_sync(&corgi_ts->timer);
                corgi_ts->tc.pressure = 0;
-               new_data(corgi_ts, NULL);
+               new_data(corgi_ts);
                corgi_ts->pendown = 0;
        }
        corgi_ts->power_mode = PWR_MODE_SUSPEND;
index e31c6c55b2e2158a8723fc33ccf581ba601198c6..58fca316786c274a8d5ef473abd7ad12414b4642 100644 (file)
@@ -6,7 +6,7 @@
 #include <asm/io.h>
 #include <asm/delay.h>
 #include <asm/adc.h>
-#include <asm/hp6xx/hp6xx.h>
+#include <asm/hp6xx.h>
 
 #define MODNAME "hp680_ts_input"
 
index d10c8b82e6aaeac3587361efb531cb92de5ef150..b6f9476c0501d75abd98916098726d070c1436be 100644 (file)
@@ -1907,7 +1907,8 @@ static int if_readstat(u8 __user *buf, int len, int id, int channel)
        }
 
        for (p=buf, count=0; count < len; p++, count++) {
-               put_user(*card->q931_read++, p);
+               if (put_user(*card->q931_read++, p))
+                       return -EFAULT;
                if (card->q931_read > card->q931_end)
                        card->q931_read = card->q931_buf;
        }
index e4823ab2b12702b6085a48cec68ac1ad077c9dbc..785b08554fcaa3685a3115a965be95bccc1d72e1 100644 (file)
@@ -631,7 +631,8 @@ static int HiSax_readstatus(u_char __user *buf, int len, int id, int channel)
                count = cs->status_end - cs->status_read + 1;
                if (count >= len)
                        count = len;
-               copy_to_user(p, cs->status_read, count);
+               if (copy_to_user(p, cs->status_read, count))
+                       return -EFAULT;
                cs->status_read += count;
                if (cs->status_read > cs->status_end)
                        cs->status_read = cs->status_buf;
@@ -642,7 +643,8 @@ static int HiSax_readstatus(u_char __user *buf, int len, int id, int channel)
                                cnt = HISAX_STATUS_BUFSIZE;
                        else
                                cnt = count;
-                       copy_to_user(p, cs->status_read, cnt);
+                       if (copy_to_user(p, cs->status_read, cnt))
+                               return -EFAULT;
                        p += cnt;
                        cs->status_read += cnt % HISAX_STATUS_BUFSIZE;
                        count -= cnt;
index 7e95f04f13da0b9b845d80a0b15e02ca64fea30d..3dacfff93f5fb6c51ff0c873278f800bfed9c8e6 100644 (file)
@@ -716,8 +716,10 @@ release_io_diva(struct IsdnCardState *cs)
 
                *cfg = 0; /* disable INT0/1 */ 
                *cfg = 2; /* reset pending INT0 */
-               iounmap((void *)cs->hw.diva.cfg_reg);
-               iounmap((void *)cs->hw.diva.pci_cfg);
+               if (cs->hw.diva.cfg_reg)
+                       iounmap((void *)cs->hw.diva.cfg_reg);
+               if (cs->hw.diva.pci_cfg)
+                       iounmap((void *)cs->hw.diva.pci_cfg);
                return;
        } else if (cs->subtyp != DIVA_IPAC_ISA) {
                del_timer(&cs->hw.diva.tl);
@@ -733,6 +735,23 @@ release_io_diva(struct IsdnCardState *cs)
        }
 }
 
+static void
+iounmap_diva(struct IsdnCardState *cs)
+{
+       if ((cs->subtyp == DIVA_IPAC_PCI) || (cs->subtyp == DIVA_IPACX_PCI)) {
+               if (cs->hw.diva.cfg_reg) {
+                       iounmap((void *)cs->hw.diva.cfg_reg);
+                       cs->hw.diva.cfg_reg = 0;
+               }
+               if (cs->hw.diva.pci_cfg) {
+                       iounmap((void *)cs->hw.diva.pci_cfg);
+                       cs->hw.diva.pci_cfg = 0;
+               }
+       }
+
+       return;
+}
+
 static void
 reset_diva(struct IsdnCardState *cs)
 {
@@ -1069,11 +1088,13 @@ setup_diva(struct IsdnCard *card)
 
                if (!cs->irq) {
                        printk(KERN_WARNING "Diva: No IRQ for PCI card found\n");
+                       iounmap_diva(cs);
                        return(0);
                }
 
                if (!cs->hw.diva.cfg_reg) {
                        printk(KERN_WARNING "Diva: No IO-Adr for PCI card found\n");
+                       iounmap_diva(cs);
                        return(0);
                }
                cs->irq_flags |= IRQF_SHARED;
@@ -1123,6 +1144,7 @@ ready:
                               CardType[card->typ],
                               cs->hw.diva.cfg_reg,
                               cs->hw.diva.cfg_reg + bytecnt);
+                       iounmap_diva(cs);
                        return (0);
                }
        }
index 160f22fa594176551c8d5d7bc1a04224463f72bf..82e42a80dc4b01f24deafa97e4eaadfcd32de798 100644 (file)
@@ -45,11 +45,10 @@ ergo_interrupt(int intno, void *dev_id)
        if (!card->irq_enabled)
                return IRQ_NONE;                /* other device interrupting or irq switched off */
 
-       save_flags(flags);
-       cli();                  /* no further irqs allowed */
+       spin_lock_irqsave(&card->hysdn_lock, flags); /* no further irqs allowed */
 
        if (!(bytein(card->iobase + PCI9050_INTR_REG) & PCI9050_INTR_REG_STAT1)) {
-               restore_flags(flags);   /* restore old state */
+               spin_unlock_irqrestore(&card->hysdn_lock, flags);       /* restore old state */
                return IRQ_NONE;                /* no interrupt requested by E1 */
        }
        /* clear any pending ints on the board */
@@ -61,7 +60,7 @@ ergo_interrupt(int intno, void *dev_id)
        /* start kernel task immediately after leaving all interrupts */
        if (!card->hw_lock)
                schedule_work(&card->irq_queue);
-       restore_flags(flags);
+       spin_unlock_irqrestore(&card->hysdn_lock, flags);
        return IRQ_HANDLED;
 }                              /* ergo_interrupt */
 
@@ -83,10 +82,9 @@ ergo_irq_bh(hysdn_card * card)
 
        dpr = card->dpram;      /* point to DPRAM */
 
-       save_flags(flags);
-       cli();
+       spin_lock_irqsave(&card->hysdn_lock, flags);
        if (card->hw_lock) {
-               restore_flags(flags);   /* hardware currently unavailable */
+               spin_unlock_irqrestore(&card->hysdn_lock, flags);       /* hardware currently unavailable */
                return;
        }
        card->hw_lock = 1;      /* we now lock the hardware */
@@ -120,7 +118,7 @@ ergo_irq_bh(hysdn_card * card)
                        card->hw_lock = 0;      /* free hardware again */
        } while (again);        /* until nothing more to do */
 
-       restore_flags(flags);
+       spin_unlock_irqrestore(&card->hysdn_lock, flags);
 }                              /* ergo_irq_bh */
 
 
@@ -137,8 +135,7 @@ ergo_stopcard(hysdn_card * card)
 #ifdef CONFIG_HYSDN_CAPI
        hycapi_capi_stop(card);
 #endif /* CONFIG_HYSDN_CAPI */
-       save_flags(flags);
-       cli();
+       spin_lock_irqsave(&card->hysdn_lock, flags);
        val = bytein(card->iobase + PCI9050_INTR_REG);  /* get actual value */
        val &= ~(PCI9050_INTR_REG_ENPCI | PCI9050_INTR_REG_EN1);        /* mask irq */
        byteout(card->iobase + PCI9050_INTR_REG, val);
@@ -147,7 +144,7 @@ ergo_stopcard(hysdn_card * card)
        card->state = CARD_STATE_UNUSED;
        card->err_log_state = ERRLOG_STATE_OFF;         /* currently no log active */
 
-       restore_flags(flags);
+       spin_unlock_irqrestore(&card->hysdn_lock, flags);
 }                              /* ergo_stopcard */
 
 /**************************************************************************/
@@ -162,12 +159,11 @@ ergo_set_errlog_state(hysdn_card * card, int on)
                card->err_log_state = ERRLOG_STATE_OFF;         /* must be off */
                return;
        }
-       save_flags(flags);
-       cli();
+       spin_lock_irqsave(&card->hysdn_lock, flags);
 
        if (((card->err_log_state == ERRLOG_STATE_OFF) && !on) ||
            ((card->err_log_state == ERRLOG_STATE_ON) && on)) {
-               restore_flags(flags);
+               spin_unlock_irqrestore(&card->hysdn_lock, flags);
                return;         /* nothing to do */
        }
        if (on)
@@ -175,7 +171,7 @@ ergo_set_errlog_state(hysdn_card * card, int on)
        else
                card->err_log_state = ERRLOG_STATE_STOP;        /* request stop */
 
-       restore_flags(flags);
+       spin_unlock_irqrestore(&card->hysdn_lock, flags);
        schedule_work(&card->irq_queue);
 }                              /* ergo_set_errlog_state */
 
@@ -356,8 +352,7 @@ ergo_waitpofready(struct HYSDN_CARD *card)
 
                        if (card->debug_flags & LOG_POF_RECORD)
                                hysdn_addlog(card, "ERGO: pof boot success");
-                       save_flags(flags);
-                       cli();
+                       spin_lock_irqsave(&card->hysdn_lock, flags);
 
                        card->state = CARD_STATE_RUN;   /* now card is running */
                        /* enable the cards interrupt */
@@ -370,7 +365,7 @@ ergo_waitpofready(struct HYSDN_CARD *card)
                        dpr->ToHyInt = 1;
                        dpr->ToPcInt = 1;       /* interrupt to E1 for all cards */
 
-                       restore_flags(flags);
+                       spin_unlock_irqrestore(&card->hysdn_lock, flags);
                        if ((hynet_enable & (1 << card->myid)) 
                            && (i = hysdn_net_create(card))) 
                        {
@@ -408,7 +403,7 @@ ergo_releasehardware(hysdn_card * card)
        free_irq(card->irq, card);      /* release interrupt */
        release_region(card->iobase + PCI9050_INTR_REG, 1);     /* release all io ports */
        release_region(card->iobase + PCI9050_USER_IO, 1);
-       vfree(card->dpram);
+       iounmap(card->dpram);
        card->dpram = NULL;     /* release shared mem */
 }                              /* ergo_releasehardware */
 
@@ -448,6 +443,7 @@ ergo_inithardware(hysdn_card * card)
        card->waitpofready = ergo_waitpofready;
        card->set_errlog_state = ergo_set_errlog_state;
        INIT_WORK(&card->irq_queue, (void *) (void *) ergo_irq_bh, card);
+       card->hysdn_lock = SPIN_LOCK_UNLOCKED;
 
        return (0);
 }                              /* ergo_inithardware */
index 461e831592ddd28710c36c8d422ae0f286645445..729df40893857789284f831afe43fe4bf0a943de 100644 (file)
@@ -188,6 +188,8 @@ typedef struct HYSDN_CARD {
        /* init and deinit stopcard for booting, too */
        void (*stopcard) (struct HYSDN_CARD *);
        void (*releasehardware) (struct HYSDN_CARD *);
+
+       spinlock_t hysdn_lock;
 #ifdef CONFIG_HYSDN_CAPI
        struct hycapictrl_info {
                char cardname[32];
index c4301e8338eff58a4a01fc7f2120fbfeefe5dd3a..fcd49920b2203ab9d33359a204e1c35f082337bd 100644 (file)
@@ -116,8 +116,7 @@ put_log_buffer(hysdn_card * card, char *cp)
        strcpy(ib->log_start, cp);      /* set output string */
        ib->next = NULL;
        ib->proc_ctrl = pd;     /* point to own control structure */
-       save_flags(flags);
-       cli();
+       spin_lock_irqsave(&card->hysdn_lock, flags);
        ib->usage_cnt = pd->if_used;
        if (!pd->log_head)
                pd->log_head = ib;      /* new head */
@@ -125,7 +124,7 @@ put_log_buffer(hysdn_card * card, char *cp)
                pd->log_tail->next = ib;        /* follows existing messages */
        pd->log_tail = ib;      /* new tail */
        i = pd->del_lock++;     /* get lock state */
-       restore_flags(flags);
+       spin_unlock_irqrestore(&card->hysdn_lock, flags);
 
        /* delete old entrys */
        if (!i)
@@ -270,14 +269,13 @@ hysdn_log_open(struct inode *ino, struct file *filep)
        } else if ((filep->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ) {
 
                /* read access -> log/debug read */
-               save_flags(flags);
-               cli();
+               spin_lock_irqsave(&card->hysdn_lock, flags);
                pd->if_used++;
                if (pd->log_head)
                        filep->private_data = &pd->log_tail->next;
                else
                        filep->private_data = &pd->log_head;
-               restore_flags(flags);
+               spin_unlock_irqrestore(&card->hysdn_lock, flags);
        } else {                /* simultaneous read/write access forbidden ! */
                unlock_kernel();
                return (-EPERM);        /* no permission this time */
@@ -301,7 +299,7 @@ hysdn_log_close(struct inode *ino, struct file *filep)
        hysdn_card *card;
        int retval = 0;
        unsigned long flags;
-
+       spinlock_t hysdn_lock = SPIN_LOCK_UNLOCKED;
 
        lock_kernel();
        if ((filep->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_WRITE) {
@@ -311,8 +309,7 @@ hysdn_log_close(struct inode *ino, struct file *filep)
                /* read access -> log/debug read, mark one further file as closed */
 
                pd = NULL;
-               save_flags(flags);
-               cli();
+               spin_lock_irqsave(&hysdn_lock, flags);
                inf = *((struct log_data **) filep->private_data);      /* get first log entry */
                if (inf)
                        pd = (struct procdata *) inf->proc_ctrl;        /* still entries there */
@@ -335,7 +332,7 @@ hysdn_log_close(struct inode *ino, struct file *filep)
                        inf->usage_cnt--;       /* decrement usage count for buffers */
                        inf = inf->next;
                }
-               restore_flags(flags);
+               spin_unlock_irqrestore(&hysdn_lock, flags);
 
                if (pd)
                        if (pd->if_used <= 0)   /* delete buffers if last file closed */
index 1c0d54ac12abeb8cb2686ea87adea4619b51e24f..1fadf0133e9b6355e4e994b03e6f795d955bc130 100644 (file)
@@ -155,8 +155,7 @@ hysdn_tx_cfgline(hysdn_card *card, unsigned char *line, unsigned short chan)
        if (card->debug_flags & LOG_SCHED_ASYN)
                hysdn_addlog(card, "async tx-cfg chan=%d len=%d", chan, strlen(line) + 1);
 
-       save_flags(flags);
-       cli();
+       spin_lock_irqsave(&card->hysdn_lock, flags);
        while (card->async_busy) {
                sti();
 
@@ -165,7 +164,7 @@ hysdn_tx_cfgline(hysdn_card *card, unsigned char *line, unsigned short chan)
 
                msleep_interruptible(20);               /* Timeout 20ms */
                if (!--cnt) {
-                       restore_flags(flags);
+                       spin_unlock_irqrestore(&card->hysdn_lock, flags);
                        return (-ERR_ASYNC_TIME);       /* timed out */
                }
                cli();
@@ -194,13 +193,13 @@ hysdn_tx_cfgline(hysdn_card *card, unsigned char *line, unsigned short chan)
 
                msleep_interruptible(20);               /* Timeout 20ms */
                if (!--cnt) {
-                       restore_flags(flags);
+                       spin_unlock_irqrestore(&card->hysdn_lock, flags);
                        return (-ERR_ASYNC_TIME);       /* timed out */
                }
                cli();
        }                       /* wait for buffer to become free again */
 
-       restore_flags(flags);
+       spin_unlock_irqrestore(&card->hysdn_lock, flags);
 
        if (card->debug_flags & LOG_SCHED_ASYN)
                hysdn_addlog(card, "async tx-cfg data send");
index c3d79eef9e3245ef0f8e8a28b015dd2bb8db39d7..69aee2602aa62aac22a3c6e41442a4d1810a7ee5 100644 (file)
@@ -1134,9 +1134,12 @@ isdn_read(struct file *file, char __user *buf, size_t count, loff_t * off)
                if (dev->drv[drvidx]->interface->readstat) {
                        if (count > dev->drv[drvidx]->stavail)
                                count = dev->drv[drvidx]->stavail;
-                       len = dev->drv[drvidx]->interface->
-                               readstat(buf, count, drvidx,
-                                        isdn_minor2chan(minor));
+                       len = dev->drv[drvidx]->interface->readstat(buf, count,
+                                               drvidx, isdn_minor2chan(minor));
+                       if (len < 0) {
+                               retval = len;
+                               goto out;
+                       }
                } else {
                        len = 0;
                }
index 6649f8bc99512247cdbfb6142dbfcce40f0669b0..730bbd07ebc7ca2e842e5cde6080fdd466203027 100644 (file)
@@ -1010,7 +1010,8 @@ icn_readstatus(u_char __user *buf, int len, icn_card * card)
        for (p = buf, count = 0; count < len; p++, count++) {
                if (card->msg_buf_read == card->msg_buf_write)
                        return count;
-               put_user(*card->msg_buf_read++, p);
+               if (put_user(*card->msg_buf_read++, p))
+                       return -EFAULT;
                if (card->msg_buf_read > card->msg_buf_end)
                        card->msg_buf_read = card->msg_buf;
        }
index fabbd461603e217befac34687aa5eb08f7ebb575..c3ae2edaf6fa5812cf039ef00ef8e7b467aed901 100644 (file)
@@ -100,12 +100,11 @@ isdnloop_pollbchan(unsigned long data)
                isdnloop_bchan_send(card, 1);
        if (card->flags & (ISDNLOOP_FLAGS_B1ACTIVE | ISDNLOOP_FLAGS_B2ACTIVE)) {
                /* schedule b-channel polling again */
-               save_flags(flags);
-               cli();
+               spin_lock_irqsave(&card->isdnloop_lock, flags);
                card->rb_timer.expires = jiffies + ISDNLOOP_TIMER_BCREAD;
                add_timer(&card->rb_timer);
                card->flags |= ISDNLOOP_FLAGS_RBTIMER;
-               restore_flags(flags);
+               spin_unlock_irqrestore(&card->isdnloop_lock, flags);
        } else
                card->flags &= ~ISDNLOOP_FLAGS_RBTIMER;
 }
@@ -281,8 +280,7 @@ isdnloop_putmsg(isdnloop_card * card, unsigned char c)
 {
        ulong flags;
 
-       save_flags(flags);
-       cli();
+       spin_lock_irqsave(&card->isdnloop_lock, flags);
        *card->msg_buf_write++ = (c == 0xff) ? '\n' : c;
        if (card->msg_buf_write == card->msg_buf_read) {
                if (++card->msg_buf_read > card->msg_buf_end)
@@ -290,7 +288,7 @@ isdnloop_putmsg(isdnloop_card * card, unsigned char c)
        }
        if (card->msg_buf_write > card->msg_buf_end)
                card->msg_buf_write = card->msg_buf;
-       restore_flags(flags);
+       spin_unlock_irqrestore(&card->isdnloop_lock, flags);
 }
 
 /*
@@ -372,21 +370,19 @@ isdnloop_polldchan(unsigned long data)
                if (!(card->flags & ISDNLOOP_FLAGS_RBTIMER)) {
                        /* schedule b-channel polling */
                        card->flags |= ISDNLOOP_FLAGS_RBTIMER;
-                       save_flags(flags);
-                       cli();
+                       spin_lock_irqsave(&card->isdnloop_lock, flags);
                        del_timer(&card->rb_timer);
                        card->rb_timer.function = isdnloop_pollbchan;
                        card->rb_timer.data = (unsigned long) card;
                        card->rb_timer.expires = jiffies + ISDNLOOP_TIMER_BCREAD;
                        add_timer(&card->rb_timer);
-                       restore_flags(flags);
+                       spin_unlock_irqrestore(&card->isdnloop_lock, flags);
                }
        /* schedule again */
-       save_flags(flags);
-       cli();
+       spin_lock_irqsave(&card->isdnloop_lock, flags);
        card->st_timer.expires = jiffies + ISDNLOOP_TIMER_DCREAD;
        add_timer(&card->st_timer);
-       restore_flags(flags);
+       spin_unlock_irqrestore(&card->isdnloop_lock, flags);
 }
 
 /*
@@ -416,8 +412,7 @@ isdnloop_sendbuf(int channel, struct sk_buff *skb, isdnloop_card * card)
                        return 0;
                if (card->sndcount[channel] > ISDNLOOP_MAX_SQUEUE)
                        return 0;
-               save_flags(flags);
-               cli();
+               spin_lock_irqsave(&card->isdnloop_lock, flags);
                nskb = dev_alloc_skb(skb->len);
                if (nskb) {
                        memcpy(skb_put(nskb, len), skb->data, len);
@@ -426,7 +421,7 @@ isdnloop_sendbuf(int channel, struct sk_buff *skb, isdnloop_card * card)
                } else
                        len = 0;
                card->sndcount[channel] += len;
-               restore_flags(flags);
+               spin_unlock_irqrestore(&card->isdnloop_lock, flags);
        }
        return len;
 }
@@ -451,7 +446,8 @@ isdnloop_readstatus(u_char __user *buf, int len, isdnloop_card * card)
        for (p = buf, count = 0; count < len; p++, count++) {
                if (card->msg_buf_read == card->msg_buf_write)
                        return count;
-               put_user(*card->msg_buf_read++, p);
+               if (put_user(*card->msg_buf_read++, p))
+                       return -EFAULT;
                if (card->msg_buf_read > card->msg_buf_end)
                        card->msg_buf_read = card->msg_buf;
        }
@@ -576,8 +572,7 @@ isdnloop_atimeout(isdnloop_card * card, int ch)
        unsigned long flags;
        char buf[60];
 
-       save_flags(flags);
-       cli();
+       spin_lock_irqsave(&card->isdnloop_lock, flags);
        if (card->rcard) {
                isdnloop_fake(card->rcard[ch], "DDIS_I", card->rch[ch] + 1);
                card->rcard[ch]->rcard[card->rch[ch]] = NULL;
@@ -587,7 +582,7 @@ isdnloop_atimeout(isdnloop_card * card, int ch)
        /* No user responding */
        sprintf(buf, "CAU%s", isdnloop_unicause(card, 1, 3));
        isdnloop_fake(card, buf, ch + 1);
-       restore_flags(flags);
+       spin_unlock_irqrestore(&card->isdnloop_lock, flags);
 }
 
 /*
@@ -622,8 +617,7 @@ isdnloop_start_ctimer(isdnloop_card * card, int ch)
 {
        unsigned long flags;
 
-       save_flags(flags);
-       cli();
+       spin_lock_irqsave(&card->isdnloop_lock, flags);
        init_timer(&card->c_timer[ch]);
        card->c_timer[ch].expires = jiffies + ISDNLOOP_TIMER_ALERTWAIT;
        if (ch)
@@ -632,7 +626,7 @@ isdnloop_start_ctimer(isdnloop_card * card, int ch)
                card->c_timer[ch].function = isdnloop_atimeout0;
        card->c_timer[ch].data = (unsigned long) card;
        add_timer(&card->c_timer[ch]);
-       restore_flags(flags);
+       spin_unlock_irqrestore(&card->isdnloop_lock, flags);
 }
 
 /*
@@ -647,10 +641,9 @@ isdnloop_kill_ctimer(isdnloop_card * card, int ch)
 {
        unsigned long flags;
 
-       save_flags(flags);
-       cli();
+       spin_lock_irqsave(&card->isdnloop_lock, flags);
        del_timer(&card->c_timer[ch]);
-       restore_flags(flags);
+       spin_unlock_irqrestore(&card->isdnloop_lock, flags);
 }
 
 static u_char si2bit[] =
@@ -706,13 +699,12 @@ isdnloop_try_call(isdnloop_card * card, char *p, int lch, isdn_ctrl * cmd)
                                        }
                        }
                        if (num_match) {
-                               save_flags(flags);
-                               cli();
+                               spin_lock_irqsave(&card->isdnloop_lock, flags);
                                /* channel idle? */
                                if (!(cc->rcard[ch])) {
                                        /* Check SI */
                                        if (!(si2bit[cmd->parm.setup.si1] & cc->sil[ch])) {
-                                               restore_flags(flags);
+                                               spin_unlock_irqrestore(&card->isdnloop_lock, flags);
                                                return 3;
                                        }
                                        /* ch is idle, si and number matches */
@@ -720,10 +712,10 @@ isdnloop_try_call(isdnloop_card * card, char *p, int lch, isdn_ctrl * cmd)
                                        cc->rch[ch] = lch;
                                        card->rcard[lch] = cc;
                                        card->rch[lch] = ch;
-                                       restore_flags(flags);
+                                       spin_unlock_irqrestore(&card->isdnloop_lock, flags);
                                        return 0;
                                } else {
-                                       restore_flags(flags);
+                                       spin_unlock_irqrestore(&card->isdnloop_lock, flags);
                                        /* num matches, but busy */
                                        if (ch == 1)
                                                return 1;
@@ -1027,8 +1019,7 @@ isdnloop_stopcard(isdnloop_card * card)
        unsigned long flags;
        isdn_ctrl cmd;
 
-       save_flags(flags);
-       cli();
+       spin_lock_irqsave(&card->isdnloop_lock, flags);
        if (card->flags & ISDNLOOP_FLAGS_RUNNING) {
                card->flags &= ~ISDNLOOP_FLAGS_RUNNING;
                del_timer(&card->st_timer);
@@ -1039,7 +1030,7 @@ isdnloop_stopcard(isdnloop_card * card)
                cmd.driver = card->myid;
                card->interface.statcallb(&cmd);
        }
-       restore_flags(flags);
+       spin_unlock_irqrestore(&card->isdnloop_lock, flags);
 }
 
 /*
@@ -1078,18 +1069,17 @@ isdnloop_start(isdnloop_card * card, isdnloop_sdef * sdefp)
                return -EBUSY;
        if (copy_from_user((char *) &sdef, (char *) sdefp, sizeof(sdef)))
                return -EFAULT;
-       save_flags(flags);
-       cli();
+       spin_lock_irqsave(&card->isdnloop_lock, flags);
        switch (sdef.ptype) {
                case ISDN_PTYPE_EURO:
                        if (isdnloop_fake(card, "DRV1.23EC-Q.931-CAPI-CNS-BASIS-20.02.96",
                                          -1)) {
-                               restore_flags(flags);
+                               spin_unlock_irqrestore(&card->isdnloop_lock, flags);
                                return -ENOMEM;
                        }
                        card->sil[0] = card->sil[1] = 4;
                        if (isdnloop_fake(card, "TEI OK", 0)) {
-                               restore_flags(flags);
+                               spin_unlock_irqrestore(&card->isdnloop_lock, flags);
                                return -ENOMEM;
                        }
                        for (i = 0; i < 3; i++)
@@ -1098,12 +1088,12 @@ isdnloop_start(isdnloop_card * card, isdnloop_sdef * sdefp)
                case ISDN_PTYPE_1TR6:
                        if (isdnloop_fake(card, "DRV1.04TC-1TR6-CAPI-CNS-BASIS-29.11.95",
                                          -1)) {
-                               restore_flags(flags);
+                               spin_unlock_irqrestore(&card->isdnloop_lock, flags);
                                return -ENOMEM;
                        }
                        card->sil[0] = card->sil[1] = 4;
                        if (isdnloop_fake(card, "TEI OK", 0)) {
-                               restore_flags(flags);
+                               spin_unlock_irqrestore(&card->isdnloop_lock, flags);
                                return -ENOMEM;
                        }
                        strcpy(card->s0num[0], sdef.num[0]);
@@ -1111,7 +1101,7 @@ isdnloop_start(isdnloop_card * card, isdnloop_sdef * sdefp)
                        card->s0num[2][0] = '\0';
                        break;
                default:
-                       restore_flags(flags);
+                       spin_unlock_irqrestore(&card->isdnloop_lock, flags);
                        printk(KERN_WARNING "isdnloop: Illegal D-channel protocol %d\n",
                               sdef.ptype);
                        return -EINVAL;
@@ -1122,7 +1112,7 @@ isdnloop_start(isdnloop_card * card, isdnloop_sdef * sdefp)
        card->st_timer.data = (unsigned long) card;
        add_timer(&card->st_timer);
        card->flags |= ISDNLOOP_FLAGS_RUNNING;
-       restore_flags(flags);
+       spin_unlock_irqrestore(&card->isdnloop_lock, flags);
        return 0;
 }
 
@@ -1472,6 +1462,7 @@ isdnloop_initcard(char *id)
                skb_queue_head_init(&card->bqueue[i]);
        }
        skb_queue_head_init(&card->dqueue);
+       card->isdnloop_lock = SPIN_LOCK_UNLOCKED;
        card->next = cards;
        cards = card;
        if (!register_isdn(&card->interface)) {
index d699fe53e1c37a4ae906323aa415e89f420cf4ec..0d458a86f5299b086e6b5792b9814b35915e2c4f 100644 (file)
@@ -94,6 +94,7 @@ typedef struct isdnloop_card {
        struct sk_buff_head
         bqueue[ISDNLOOP_BCH];  /* B-Channel queues                 */
        struct sk_buff_head dqueue;     /* D-Channel queue                  */
+       spinlock_t isdnloop_lock;
 } isdnloop_card;
 
 /*
index 94f21486bb24d667b4c22b29e2c507e30262919b..6ead5e1508b705fd682c28c2a57c9a581ab5e611 100644 (file)
@@ -725,23 +725,27 @@ static int pcbit_stat(u_char __user *buf, int len, int driver, int channel)
 
        if (stat_st < stat_end)
        {
-               copy_to_user(buf, statbuf + stat_st, len);
+               if (copy_to_user(buf, statbuf + stat_st, len))
+                       return -EFAULT;
                stat_st += len;    
        }
        else
        {
                if (len > STATBUF_LEN - stat_st)
                {
-                       copy_to_user(buf, statbuf + stat_st, 
-                                      STATBUF_LEN - stat_st);
-                       copy_to_user(buf, statbuf, 
-                                      len - (STATBUF_LEN - stat_st));
+                       if (copy_to_user(buf, statbuf + stat_st,
+                                      STATBUF_LEN - stat_st))
+                               return -EFAULT;
+                       if (copy_to_user(buf, statbuf,
+                                      len - (STATBUF_LEN - stat_st)))
+                               return -EFAULT;
 
                        stat_st = len - (STATBUF_LEN - stat_st);
                }
                else
                {
-                       copy_to_user(buf, statbuf + stat_st, len);
+                       if (copy_to_user(buf, statbuf + stat_st, len))
+                               return -EFAULT;
 
                        stat_st += len;
                        
index aecbbe2e89a92673fb600e0d0500194cde5dcff9..3c1711210e38a375f7ec1064c6bd59aeb7d74206 100644 (file)
@@ -91,6 +91,8 @@ EXPORT_SYMBOL_GPL(led_classdev_resume);
  */
 int led_classdev_register(struct device *parent, struct led_classdev *led_cdev)
 {
+       int rc;
+
        led_cdev->class_dev = class_device_create(leds_class, NULL, 0,
                                                parent, "%s", led_cdev->name);
        if (unlikely(IS_ERR(led_cdev->class_dev)))
@@ -99,8 +101,10 @@ int led_classdev_register(struct device *parent, struct led_classdev *led_cdev)
        class_set_devdata(led_cdev->class_dev, led_cdev);
 
        /* register the attributes */
-       class_device_create_file(led_cdev->class_dev,
-                               &class_device_attr_brightness);
+       rc = class_device_create_file(led_cdev->class_dev,
+                                     &class_device_attr_brightness);
+       if (rc)
+               goto err_out;
 
        /* add to the list of leds */
        write_lock(&leds_list_lock);
@@ -110,16 +114,28 @@ int led_classdev_register(struct device *parent, struct led_classdev *led_cdev)
 #ifdef CONFIG_LEDS_TRIGGERS
        rwlock_init(&led_cdev->trigger_lock);
 
-       led_trigger_set_default(led_cdev);
+       rc = class_device_create_file(led_cdev->class_dev,
+                                     &class_device_attr_trigger);
+       if (rc)
+               goto err_out_led_list;
 
-       class_device_create_file(led_cdev->class_dev,
-                               &class_device_attr_trigger);
+       led_trigger_set_default(led_cdev);
 #endif
 
        printk(KERN_INFO "Registered led device: %s\n",
                        led_cdev->class_dev->class_id);
 
        return 0;
+
+#ifdef CONFIG_LEDS_TRIGGERS
+err_out_led_list:
+       class_device_remove_file(led_cdev->class_dev,
+                               &class_device_attr_brightness);
+       list_del(&led_cdev->node);
+#endif
+err_out:
+       class_device_unregister(led_cdev->class_dev);
+       return rc;
 }
 EXPORT_SYMBOL_GPL(led_classdev_register);
 
index 179c2876b5416cf871dbb7c3c3ce08ecebe8b137..29a8818a32ec23e71fda137f1e634e46de538559 100644 (file)
@@ -123,6 +123,7 @@ static CLASS_DEVICE_ATTR(delay_off, 0644, led_delay_off_show,
 static void timer_trig_activate(struct led_classdev *led_cdev)
 {
        struct timer_trig_data *timer_data;
+       int rc;
 
        timer_data = kzalloc(sizeof(struct timer_trig_data), GFP_KERNEL);
        if (!timer_data)
@@ -134,10 +135,21 @@ static void timer_trig_activate(struct led_classdev *led_cdev)
        timer_data->timer.function = led_timer_function;
        timer_data->timer.data = (unsigned long) led_cdev;
 
-       class_device_create_file(led_cdev->class_dev,
+       rc = class_device_create_file(led_cdev->class_dev,
                                &class_device_attr_delay_on);
-       class_device_create_file(led_cdev->class_dev,
+       if (rc) goto err_out;
+       rc = class_device_create_file(led_cdev->class_dev,
                                &class_device_attr_delay_off);
+       if (rc) goto err_out_delayon;
+
+       return;
+
+err_out_delayon:
+       class_device_remove_file(led_cdev->class_dev,
+                               &class_device_attr_delay_on);
+err_out:
+       led_cdev->trigger_data = NULL;
+       kfree(timer_data);
 }
 
 static void timer_trig_deactivate(struct led_classdev *led_cdev)
index d47d38ac71b16f31f530d1bfd9656eb0e288f401..d6f614738bbd732e24cd039af3a05ffb01e01373 100644 (file)
@@ -536,7 +536,7 @@ static int bitmap_read_sb(struct bitmap *bitmap)
                printk(KERN_INFO "%s: bitmap file is out of date (%llu < %llu) "
                        "-- forcing full recovery\n", bmname(bitmap), events,
                        (unsigned long long) bitmap->mddev->events);
-               sb->state |= BITMAP_STALE;
+               sb->state |= cpu_to_le32(BITMAP_STALE);
        }
 success:
        /* assign fields using values from superblock */
@@ -544,11 +544,11 @@ success:
        bitmap->daemon_sleep = daemon_sleep;
        bitmap->daemon_lastrun = jiffies;
        bitmap->max_write_behind = write_behind;
-       bitmap->flags |= sb->state;
+       bitmap->flags |= le32_to_cpu(sb->state);
        if (le32_to_cpu(sb->version) == BITMAP_MAJOR_HOSTENDIAN)
                bitmap->flags |= BITMAP_HOSTENDIAN;
        bitmap->events_cleared = le64_to_cpu(sb->events_cleared);
-       if (sb->state & BITMAP_STALE)
+       if (sb->state & cpu_to_le32(BITMAP_STALE))
                bitmap->events_cleared = bitmap->mddev->events;
        err = 0;
 out:
@@ -578,9 +578,9 @@ static void bitmap_mask_state(struct bitmap *bitmap, enum bitmap_state bits,
        spin_unlock_irqrestore(&bitmap->lock, flags);
        sb = (bitmap_super_t *)kmap_atomic(bitmap->sb_page, KM_USER0);
        switch (op) {
-               case MASK_SET: sb->state |= bits;
+               case MASK_SET: sb->state |= cpu_to_le32(bits);
                                break;
-               case MASK_UNSET: sb->state &= ~bits;
+               case MASK_UNSET: sb->state &= cpu_to_le32(~bits);
                                break;
                default: BUG();
        }
index 655d816760e591f0d007a6721fd557265004a791..a625576fdeeb3eb5c5ac1c7ebc15f3aea841df39 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/slab.h>
 #include <linux/crypto.h>
 #include <linux/workqueue.h>
+#include <linux/backing-dev.h>
 #include <asm/atomic.h>
 #include <linux/scatterlist.h>
 #include <asm/page.h>
@@ -602,7 +603,7 @@ static void process_write(struct crypt_io *io)
 
                /* out of memory -> run queues */
                if (remaining)
-                       blk_congestion_wait(bio_data_dir(clone), HZ/100);
+                       congestion_wait(bio_data_dir(clone), HZ/100);
        }
 }
 
index 57fa64f93e5f1815ce57c398d8f1ae9cc64d32b1..7daa7b1e145f32d3736a48e7e9ee6e81f94c5bb8 100644 (file)
@@ -974,12 +974,13 @@ static void super_90_sync(mddev_t *mddev, mdk_rdev_t *rdev)
  * version 1 superblock
  */
 
-static unsigned int calc_sb_1_csum(struct mdp_superblock_1 * sb)
+static __le32 calc_sb_1_csum(struct mdp_superblock_1 * sb)
 {
-       unsigned int disk_csum, csum;
+       __le32 disk_csum;
+       u32 csum;
        unsigned long long newcsum;
        int size = 256 + le32_to_cpu(sb->max_dev)*2;
-       unsigned int *isuper = (unsigned int*)sb;
+       __le32 *isuper = (__le32*)sb;
        int i;
 
        disk_csum = sb->sb_csum;
@@ -989,7 +990,7 @@ static unsigned int calc_sb_1_csum(struct mdp_superblock_1 * sb)
                newcsum += le32_to_cpu(*isuper++);
 
        if (size == 2)
-               newcsum += le16_to_cpu(*(unsigned short*) isuper);
+               newcsum += le16_to_cpu(*(__le16*) isuper);
 
        csum = (newcsum & 0xffffffff) + (newcsum >> 32);
        sb->sb_csum = disk_csum;
@@ -1106,7 +1107,7 @@ static int super_1_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version)
        if (le32_to_cpu(sb->chunksize))
                rdev->size &= ~((sector_t)le32_to_cpu(sb->chunksize)/2 - 1);
 
-       if (le32_to_cpu(sb->size) > rdev->size*2)
+       if (le64_to_cpu(sb->size) > rdev->size*2)
                return -EINVAL;
        return ret;
 }
@@ -1228,7 +1229,7 @@ static void super_1_sync(mddev_t *mddev, mdk_rdev_t *rdev)
        else
                sb->resync_offset = cpu_to_le64(0);
 
-       sb->cnt_corrected_read = atomic_read(&rdev->corrected_errors);
+       sb->cnt_corrected_read = cpu_to_le32(atomic_read(&rdev->corrected_errors));
 
        sb->raid_disks = cpu_to_le32(mddev->raid_disks);
        sb->size = cpu_to_le64(mddev->size<<1);
@@ -4912,6 +4913,7 @@ static unsigned int mdstat_poll(struct file *filp, poll_table *wait)
 }
 
 static struct file_operations md_seq_fops = {
+       .owner          = THIS_MODULE,
        .open           = md_seq_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
index 171ff41b52b053e7acdc2f6c78e0ef34ed2bd695..a6260f0e3b9e57bf756ac32c8e75f15c37d47f12 100644 (file)
@@ -501,7 +501,7 @@ static int multipath_run (mddev_t *mddev)
                        mdname(mddev));
                goto out_free_conf;
        }
-       mddev->degraded = conf->raid_disks = conf->working_disks;
+       mddev->degraded = conf->raid_disks - conf->working_disks;
 
        conf->pool = mempool_create_kzalloc_pool(NR_RESERVED_BUFS,
                                                 sizeof(struct multipath_bh));
index 1250f0eab4afaf7b2c946a3c3767c25efc062bfc..74f17a9a6ebb78cca440a4c08b317b3f74a414a3 100644 (file)
@@ -2079,7 +2079,7 @@ static int run(mddev_t *mddev)
                disk = conf->mirrors + i;
 
                if (!disk->rdev ||
-                   !test_bit(In_sync, &rdev->flags)) {
+                   !test_bit(In_sync, &disk->rdev->flags)) {
                        disk->head_position = 0;
                        mddev->degraded++;
                }
index fb6c4cc8477db818d04fb061f0893584b428690e..14e69a736edae5f50bf3207b9c1b0a205199faff 100644 (file)
@@ -665,6 +665,10 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type)
        case BTTV_BOARD_TWINHAN_DST:
                /*      DST is not a frontend driver !!!                */
                state = (struct dst_state *) kmalloc(sizeof (struct dst_state), GFP_KERNEL);
+               if (!state) {
+                       printk("dvb_bt8xx: No memory\n");
+                       break;
+               }
                /*      Setup the Card                                  */
                state->config = &dst_config;
                state->i2c = card->i2c_adapter;
index e46eae3b9be2624690746413bbb2c74601e2af54..1990eda10c469a52471495d8c865d7fa6d908985 100644 (file)
@@ -19,6 +19,6 @@ config DVB_CORE_ATTACH
          allow the card drivers to only load the frontend modules
          they require. This saves several KBytes of memory.
 
-         Note: You will need moudule-init-tools v3.2 or later for this feature.
+         Note: You will need module-init-tools v3.2 or later for this feature.
 
          If unsure say Y.
index fd3a9902f98d472662f69ee96690c5d11d673814..5143e426d283cc539043e0234d108f8eb7d7915c 100644 (file)
@@ -169,7 +169,7 @@ EXPORT_SYMBOL(dibusb_read_eeprom_byte);
 // Config Adjacent channels  Perf -cal22
 static struct dibx000_agc_config dib3000p_mt2060_agc_config = {
        .band_caps = BAND_VHF | BAND_UHF,
-       .setup     = (0 << 15) | (0 << 14) | (1 << 13) | (1 << 12) | (29 << 0),
+       .setup     = (1 << 8) | (5 << 5) | (1 << 4) | (1 << 3) | (0 << 2) | (2 << 0),
 
        .agc1_max = 48497,
        .agc1_min = 23593,
@@ -196,10 +196,14 @@ static struct dib3000mc_config stk3000p_dib3000p_config = {
        .ln_adc_level = 0x1cc7,
 
        .output_mpeg2_in_188_bytes = 1,
+
+       .agc_command1 = 1,
+       .agc_command2 = 1,
 };
 
 static struct dibx000_agc_config dib3000p_panasonic_agc_config = {
-       .setup    = (0 << 15) | (0 << 14) | (1 << 13) | (1 << 12) | (29 << 0),
+       .band_caps = BAND_VHF | BAND_UHF,
+       .setup     = (1 << 8) | (5 << 5) | (1 << 4) | (1 << 3) | (0 << 2) | (2 << 0),
 
        .agc1_max = 56361,
        .agc1_min = 22282,
@@ -226,6 +230,9 @@ static struct dib3000mc_config mod3000p_dib3000p_config = {
        .ln_adc_level = 0x1cc7,
 
        .output_mpeg2_in_188_bytes = 1,
+
+       .agc_command1 = 1,
+       .agc_command2 = 1,
 };
 
 int dibusb_dib3000mc_frontend_attach(struct dvb_usb_adapter *adap)
index 5153fb943da1fce0e429648acb495d644e2cba7c..b607810327426f17bdc7a961974971b815da5253 100644 (file)
@@ -99,7 +99,9 @@
 struct dibusb_state {
        struct dib_fe_xfer_ops ops;
        int mt2060_present;
+};
 
+struct dibusb_device_state {
        /* for RC5 remote control */
        int old_toggle;
        int last_repeat_count;
index a9219bf69b8927faf0da389c1dddddc06742ef7e..a58874c790b20505d7db03213995b8bb14b66bcc 100644 (file)
@@ -75,7 +75,7 @@ static int nova_t_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
        u8 key[5],cmd[2] = { DIBUSB_REQ_POLL_REMOTE, 0x35 }, data,toggle,custom;
        u16 raw;
        int i;
-       struct dibusb_state *st = d->priv;
+       struct dibusb_device_state *st = d->priv;
 
        dvb_usb_generic_rw(d,cmd,2,key,5,0);
 
@@ -184,6 +184,7 @@ static struct dvb_usb_device_properties nova_t_properties = {
                        .size_of_priv     = sizeof(struct dibusb_state),
                }
        },
+       .size_of_priv     = sizeof(struct dibusb_device_state),
 
        .power_ctrl       = dibusb2_0_power_ctrl,
        .read_mac_address = nova_t_read_mac_address,
index ccc813b525d6d084217bc952a7bffe3bc2d63302..3561a777568c8cd3cee259c2db59c559744a8332 100644 (file)
@@ -345,7 +345,7 @@ static int dib3000mc_init(struct dvb_frontend *demod)
 
        /* agc */
        dib3000mc_write_word(state, 36, state->cfg->max_time);
-       dib3000mc_write_word(state, 37, agc->setup);
+       dib3000mc_write_word(state, 37, (state->cfg->agc_command1 << 13) | (state->cfg->agc_command2 << 12) | (0x1d << 0));
        dib3000mc_write_word(state, 38, state->cfg->pwm3_value);
        dib3000mc_write_word(state, 39, state->cfg->ln_adc_level);
 
index b198cd5b18436c65890bcef1a507f3a53dc0f6fe..0d6fdef775385e2269ae378d02afe0215ac4ee36 100644 (file)
@@ -28,6 +28,9 @@ struct dib3000mc_config {
        u16 max_time;
        u16 ln_adc_level;
 
+       u8 agc_command1 :1;
+       u8 agc_command2 :1;
+
        u8 mobile_mode;
 
        u8 output_mpeg2_in_188_bytes;
index e8061db1112361c4ff910b38b4a28cbd8eef6358..18457adee30bd08511394098fb2d55ae07e194ca 100644 (file)
@@ -35,7 +35,16 @@ struct tda10086_config
        u8 invert;
 };
 
+#if defined(CONFIG_DVB_TDA10086) || defined(CONFIG_DVB_TDA10086_MODULE)
 extern struct dvb_frontend* tda10086_attach(const struct tda10086_config* config,
                                            struct i2c_adapter* i2c);
+#else
+static inline struct dvb_frontend* tda10086_attach(const struct tda10086_config* config,
+                                                  struct i2c_adapter* i2c)
+{
+       printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __FUNCTION__);
+       return NULL;
+}
+#endif // CONFIG_DVB_TDA10086
 
 #endif // TDA10086_H
index 3307607632b0c2e4872a08e46d3f09cc74b7597a..83998c001196659deb242cf3161a76e77022bef0 100644 (file)
  * @param has_loopthrough Set to 1 if the card has a loopthrough RF connector.
  * @return FE pointer on success, NULL on failure.
  */
-extern struct dvb_frontend *tda826x_attach(struct dvb_frontend *fe, int addr, struct i2c_adapter *i2c, int has_loopthrough);
-
-#endif
+#if defined(CONFIG_DVB_TDA826X) || defined(CONFIG_DVB_TDA826X_MODULE)
+extern struct dvb_frontend* tda826x_attach(struct dvb_frontend *fe, int addr,
+                                          struct i2c_adapter *i2c,
+                                          int has_loopthrough);
+#else
+static inline struct dvb_frontend* tda826x_attach(struct dvb_frontend *fe,
+                                                 int addr,
+                                                 struct i2c_adapter *i2c,
+                                                 int has_loopthrough)
+{
+       printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __FUNCTION__);
+       return NULL;
+}
+#endif // CONFIG_DVB_TDA826X
+
+#endif // __DVB_TDA826X_H__
index afb734df6e0591ac461572c9d998f670a633aac5..fbe5b6168cc29c287416926ae42bbb26b587725c 100644 (file)
@@ -677,6 +677,8 @@ config VIDEO_M32R_AR_M64278
 menu "V4L USB devices"
        depends on USB && VIDEO_DEV
 
+source "drivers/media/video/pvrusb2/Kconfig"
+
 source "drivers/media/video/em28xx/Kconfig"
 
 source "drivers/media/video/usbvideo/Kconfig"
index 48014a254e15fdcf10b31c2ac255d5543083643d..f85f2084324fb9ec9f8189de75f0a6f74f41649d 100644 (file)
@@ -235,6 +235,7 @@ int cx25840_vbi(struct i2c_client *client, unsigned int cmd, void *arg)
                        0, 0, V4L2_SLICED_VPS, 0, 0,    /* 9 */
                        0, 0, 0, 0
                };
+               int is_pal = !(cx25840_get_v4lstd(client) & V4L2_STD_525_60);
                int i;
 
                fmt = arg;
@@ -246,13 +247,25 @@ int cx25840_vbi(struct i2c_client *client, unsigned int cmd, void *arg)
                if ((cx25840_read(client, 0x404) & 0x10) == 0)
                        break;
 
-               for (i = 7; i <= 23; i++) {
-                       u8 v = cx25840_read(client, 0x424 + i - 7);
+               if (is_pal) {
+                       for (i = 7; i <= 23; i++) {
+                               u8 v = cx25840_read(client, 0x424 + i - 7);
+
+                               svbi->service_lines[0][i] = lcr2vbi[v >> 4];
+                               svbi->service_lines[1][i] = lcr2vbi[v & 0xf];
+                               svbi->service_set |=
+                                       svbi->service_lines[0][i] | svbi->service_lines[1][i];
+                       }
+               }
+               else {
+                       for (i = 10; i <= 21; i++) {
+                               u8 v = cx25840_read(client, 0x424 + i - 10);
 
-                       svbi->service_lines[0][i] = lcr2vbi[v >> 4];
-                       svbi->service_lines[1][i] = lcr2vbi[v & 0xf];
-                       svbi->service_set |=
-                                svbi->service_lines[0][i] | svbi->service_lines[1][i];
+                               svbi->service_lines[0][i] = lcr2vbi[v >> 4];
+                               svbi->service_lines[1][i] = lcr2vbi[v & 0xf];
+                               svbi->service_set |=
+                                       svbi->service_lines[0][i] | svbi->service_lines[1][i];
+                       }
                }
                break;
        }
index af71d4225c763eefafa18907a9efd4c8c805a133..f764a57c56be53abdca042ad26211cdc80c7ec90 100644 (file)
@@ -1230,6 +1230,7 @@ struct cx88_board cx88_boards[] = {
                        .vmux   = 2,
                        .gpio0  = 0x84bf,
                }},
+               .mpeg           = CX88_MPEG_DVB,
        },
        [CX88_BOARD_NORWOOD_MICRO] = {
                .name           = "Norwood Micro TV Tuner",
@@ -1590,6 +1591,18 @@ struct cx88_subid cx88_subids[] = {
                .subvendor = 0x0070,
                .subdevice = 0x9000,
                .card      = CX88_BOARD_HAUPPAUGE_DVB_T1,
+       },{
+               .subvendor = 0x0070,
+               .subdevice = 0x1400,
+               .card      = CX88_BOARD_HAUPPAUGE_HVR3000,
+       },{
+               .subvendor = 0x0070,
+               .subdevice = 0x1401,
+               .card      = CX88_BOARD_HAUPPAUGE_HVR3000,
+       },{
+               .subvendor = 0x0070,
+               .subdevice = 0x1402,
+               .card      = CX88_BOARD_HAUPPAUGE_HVR3000,
        },
 };
 const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids);
@@ -1633,7 +1646,15 @@ static void hauppauge_eeprom(struct cx88_core *core, u8 *eeprom_data)
        /* Make sure we support the board model */
        switch (tv.model)
        {
+       case 14009: /* WinTV-HVR3000 (Retail, IR, b/panel video, 3.5mm audio in) */
+       case 14019: /* WinTV-HVR3000 (Retail, IR Blaster, b/panel video, 3.5mm audio in) */
+       case 14029: /* WinTV-HVR3000 (Retail, IR, b/panel video, 3.5mm audio in - 880 bridge) */
+       case 14109: /* WinTV-HVR3000 (Retail, IR, b/panel video, 3.5mm audio in - low profile) */
+       case 14129: /* WinTV-HVR3000 (Retail, IR, b/panel video, 3.5mm audio in - 880 bridge - LP) */
+       case 14559: /* WinTV-HVR3000 (OEM, no IR, b/panel video, 3.5mm audio in) */
        case 14569: /* WinTV-HVR3000 (OEM, no IR, no back panel video) */
+       case 14659: /* WinTV-HVR3000 (OEM, no IR, b/panel video, RCA audio in - Low profile) */
+       case 14669: /* WinTV-HVR3000 (OEM, no IR, no b/panel video - Low profile) */
        case 28552: /* WinTV-PVR 'Roslyn' (No IR) */
        case 34519: /* WinTV-PCI-FM */
        case 90002: /* Nova-T-PCI (9002) */
index bd0c8797f26d6289898dcf1de0e5480a4b02c7b6..0ef13e7efa2ee2efc6841913338ed48c2f22fe29 100644 (file)
@@ -315,15 +315,22 @@ static struct cx22702_config hauppauge_novat_config = {
        .demod_address = 0x43,
        .output_mode   = CX22702_SERIAL_OUTPUT,
 };
+
 static struct cx22702_config hauppauge_hvr1100_config = {
        .demod_address = 0x63,
        .output_mode   = CX22702_SERIAL_OUTPUT,
 };
+
 static struct cx22702_config hauppauge_hvr1300_config = {
        .demod_address = 0x63,
        .output_mode   = CX22702_SERIAL_OUTPUT,
 };
 
+static struct cx22702_config hauppauge_hvr3000_config = {
+       .demod_address = 0x63,
+       .output_mode = CX22702_SERIAL_OUTPUT,
+};
+
 static int or51132_set_ts_param(struct dvb_frontend* fe,
                                int is_punctured)
 {
@@ -558,6 +565,16 @@ static int dvb_register(struct cx8802_dev *dev)
                                   &dvb_pll_fmd1216me);
                }
                break;
+       case CX88_BOARD_HAUPPAUGE_HVR3000:
+               dev->dvb.frontend = dvb_attach(cx22702_attach,
+                                              &hauppauge_hvr3000_config,
+                                              &dev->core->i2c_adap);
+               if (dev->dvb.frontend != NULL) {
+                       dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61,
+                                  &dev->core->i2c_adap,
+                                  &dvb_pll_fmd1216me);
+               }
+               break;
        case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS:
                dev->dvb.frontend = dvb_attach(mt352_attach,
                                               &dvico_fusionhdtv,
index 83ebf7a3c054a9bfa44d384175bdba3d72acae48..ee48995a4ab5e92d350d119dfb4f4aa5eff66394 100644 (file)
@@ -196,6 +196,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
        case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1:
        case CX88_BOARD_HAUPPAUGE_HVR1100:
        case CX88_BOARD_HAUPPAUGE_HVR1300:
+       case CX88_BOARD_HAUPPAUGE_HVR3000:
                ir_codes = ir_codes_hauppauge_new;
                ir_type = IR_TYPE_RC5;
                ir->sampling = 1;
@@ -419,6 +420,7 @@ void cx88_ir_irq(struct cx88_core *core)
        case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1:
        case CX88_BOARD_HAUPPAUGE_HVR1100:
        case CX88_BOARD_HAUPPAUGE_HVR1300:
+       case CX88_BOARD_HAUPPAUGE_HVR3000:
                ircode = ir_decode_biphase(ir->samples, ir->scount, 5, 7);
                ir_dprintk("biphase decoded: %x\n", ircode);
                if ((ircode & 0xfffff000) != 0x3000)
index bc544cc7ccb80154f378b050eaf46c10077e6501..f786ab11d2cd9b1a48cb0aff6bd70f85c19abd2f 100644 (file)
@@ -973,16 +973,32 @@ static CLASS_DEVICE_ATTR(i2c_val, S_IRUGO | S_IWUSR,
                         et61x251_show_i2c_val, et61x251_store_i2c_val);
 
 
-static void et61x251_create_sysfs(struct et61x251_device* cam)
+static int et61x251_create_sysfs(struct et61x251_device* cam)
 {
        struct video_device *v4ldev = cam->v4ldev;
+       int rc;
 
-       video_device_create_file(v4ldev, &class_device_attr_reg);
-       video_device_create_file(v4ldev, &class_device_attr_val);
+       rc = video_device_create_file(v4ldev, &class_device_attr_reg);
+       if (rc) goto err;
+       rc = video_device_create_file(v4ldev, &class_device_attr_val);
+       if (rc) goto err_reg;
        if (cam->sensor.sysfs_ops) {
-               video_device_create_file(v4ldev, &class_device_attr_i2c_reg);
-               video_device_create_file(v4ldev, &class_device_attr_i2c_val);
+               rc = video_device_create_file(v4ldev, &class_device_attr_i2c_reg);
+               if (rc) goto err_val;
+               rc = video_device_create_file(v4ldev, &class_device_attr_i2c_val);
+               if (rc) goto err_i2c_reg;
        }
+
+       return 0;
+
+err_i2c_reg:
+       video_device_remove_file(v4ldev, &class_device_attr_i2c_reg);
+err_val:
+       video_device_remove_file(v4ldev, &class_device_attr_val);
+err_reg:
+       video_device_remove_file(v4ldev, &class_device_attr_reg);
+err:
+       return rc;
 }
 #endif /* CONFIG_VIDEO_ADV_DEBUG */
 
@@ -2534,7 +2550,9 @@ et61x251_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
        dev_nr = (dev_nr < ET61X251_MAX_DEVICES-1) ? dev_nr+1 : 0;
 
 #ifdef CONFIG_VIDEO_ADV_DEBUG
-       et61x251_create_sysfs(cam);
+       err = et61x251_create_sysfs(cam);
+       if (err)
+               goto fail2;
        DBG(2, "Optional device control through 'sysfs' interface ready");
 #endif
 
@@ -2544,6 +2562,13 @@ et61x251_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
 
        return 0;
 
+#ifdef CONFIG_VIDEO_ADV_DEBUG
+fail2:
+       video_nr[dev_nr] = -1;
+       dev_nr = (dev_nr < ET61X251_MAX_DEVICES-1) ? dev_nr+1 : 0;
+       mutex_unlock(&cam->dev_mutex);
+       video_unregister_device(cam->v4ldev);
+#endif
 fail:
        if (cam) {
                kfree(cam->control_buffer);
index ce4886f1528dd322c3762f98608920c350d48f3d..b4db2cbb5a84246151e0d39ca589e7ceb50f915e 100644 (file)
@@ -5648,17 +5648,49 @@ static ssize_t show_exposure(struct class_device *cd, char *buf)
 }
 static CLASS_DEVICE_ATTR(exposure, S_IRUGO, show_exposure, NULL);
 
-static void ov_create_sysfs(struct video_device *vdev)
+static int ov_create_sysfs(struct video_device *vdev)
 {
-       video_device_create_file(vdev, &class_device_attr_custom_id);
-       video_device_create_file(vdev, &class_device_attr_model);
-       video_device_create_file(vdev, &class_device_attr_bridge);
-       video_device_create_file(vdev, &class_device_attr_sensor);
-       video_device_create_file(vdev, &class_device_attr_brightness);
-       video_device_create_file(vdev, &class_device_attr_saturation);
-       video_device_create_file(vdev, &class_device_attr_contrast);
-       video_device_create_file(vdev, &class_device_attr_hue);
-       video_device_create_file(vdev, &class_device_attr_exposure);
+       int rc;
+
+       rc = video_device_create_file(vdev, &class_device_attr_custom_id);
+       if (rc) goto err;
+       rc = video_device_create_file(vdev, &class_device_attr_model);
+       if (rc) goto err_id;
+       rc = video_device_create_file(vdev, &class_device_attr_bridge);
+       if (rc) goto err_model;
+       rc = video_device_create_file(vdev, &class_device_attr_sensor);
+       if (rc) goto err_bridge;
+       rc = video_device_create_file(vdev, &class_device_attr_brightness);
+       if (rc) goto err_sensor;
+       rc = video_device_create_file(vdev, &class_device_attr_saturation);
+       if (rc) goto err_bright;
+       rc = video_device_create_file(vdev, &class_device_attr_contrast);
+       if (rc) goto err_sat;
+       rc = video_device_create_file(vdev, &class_device_attr_hue);
+       if (rc) goto err_contrast;
+       rc = video_device_create_file(vdev, &class_device_attr_exposure);
+       if (rc) goto err_hue;
+
+       return 0;
+
+err_hue:
+       video_device_remove_file(vdev, &class_device_attr_hue);
+err_contrast:
+       video_device_remove_file(vdev, &class_device_attr_contrast);
+err_sat:
+       video_device_remove_file(vdev, &class_device_attr_saturation);
+err_bright:
+       video_device_remove_file(vdev, &class_device_attr_brightness);
+err_sensor:
+       video_device_remove_file(vdev, &class_device_attr_sensor);
+err_bridge:
+       video_device_remove_file(vdev, &class_device_attr_bridge);
+err_model:
+       video_device_remove_file(vdev, &class_device_attr_model);
+err_id:
+       video_device_remove_file(vdev, &class_device_attr_custom_id);
+err:
+       return rc;
 }
 
 /****************************************************************************
@@ -5817,7 +5849,11 @@ ov51x_probe(struct usb_interface *intf, const struct usb_device_id *id)
             ov->vdev->minor);
 
        usb_set_intfdata(intf, ov);
-       ov_create_sysfs(ov->vdev);
+       if (ov_create_sysfs(ov->vdev)) {
+               err("ov_create_sysfs failed");
+               goto error;
+       }
+
        return 0;
 
 error:
index c77b85cf3d8056a9a1d67534c064da9b2740138f..46c1148308843a4d8ed3e0db02d6f20fd8f73c76 100644 (file)
@@ -1024,12 +1024,25 @@ static ssize_t show_snapshot_button_status(struct class_device *class_dev, char
 static CLASS_DEVICE_ATTR(button, S_IRUGO | S_IWUSR, show_snapshot_button_status,
                         NULL);
 
-static void pwc_create_sysfs_files(struct video_device *vdev)
+static int pwc_create_sysfs_files(struct video_device *vdev)
 {
        struct pwc_device *pdev = video_get_drvdata(vdev);
-       if (pdev->features & FEATURE_MOTOR_PANTILT)
-               video_device_create_file(vdev, &class_device_attr_pan_tilt);
-       video_device_create_file(vdev, &class_device_attr_button);
+       int rc;
+
+       rc = video_device_create_file(vdev, &class_device_attr_button);
+       if (rc)
+               goto err;
+       if (pdev->features & FEATURE_MOTOR_PANTILT) {
+               rc = video_device_create_file(vdev,&class_device_attr_pan_tilt);
+               if (rc) goto err_button;
+       }
+
+       return 0;
+
+err_button:
+       video_device_remove_file(vdev, &class_device_attr_button);
+err:
+       return rc;
 }
 
 static void pwc_remove_sysfs_files(struct video_device *vdev)
@@ -1408,7 +1421,7 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
        struct usb_device *udev = interface_to_usbdev(intf);
        struct pwc_device *pdev = NULL;
        int vendor_id, product_id, type_id;
-       int i, hint;
+       int i, hint, rc;
        int features = 0;
        int video_nr = -1; /* default: use next available device */
        char serial_number[30], *name;
@@ -1709,9 +1722,8 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
        i = video_register_device(pdev->vdev, VFL_TYPE_GRABBER, video_nr);
        if (i < 0) {
                PWC_ERROR("Failed to register as video device (%d).\n", i);
-               video_device_release(pdev->vdev); /* Drip... drip... drip... */
-               kfree(pdev); /* Oops, no memory leaks please */
-               return -EIO;
+               rc = i;
+               goto err;
        }
        else {
                PWC_INFO("Registered as /dev/video%d.\n", pdev->vdev->minor & 0x3F);
@@ -1723,13 +1735,24 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
 
        PWC_DEBUG_PROBE("probe() function returning struct at 0x%p.\n", pdev);
        usb_set_intfdata (intf, pdev);
-       pwc_create_sysfs_files(pdev->vdev);
+       rc = pwc_create_sysfs_files(pdev->vdev);
+       if (rc)
+               goto err_unreg;
 
        /* Set the leds off */
        pwc_set_leds(pdev, 0, 0);
        pwc_camera_power(pdev, 0);
 
        return 0;
+
+err_unreg:
+       if (hint < MAX_DEV_HINTS)
+               device_hint[hint].pdev = NULL;
+       video_unregister_device(pdev->vdev);
+err:
+       video_device_release(pdev->vdev); /* Drip... drip... drip... */
+       kfree(pdev); /* Oops, no memory leaks please */
+       return rc;
 }
 
 /* The user janked out the cable... */
index 974179d4d3895b2dd3135b245d1e5158c4a8e213..c5719f7bd1acafbaee6f53c8553363c35f1b5bf2 100644 (file)
@@ -960,6 +960,8 @@ static void saa711x_set_v4lstd(struct i2c_client *client, v4l2_std_id std)
                        reg |= 0x10;
                } else if (std == V4L2_STD_NTSC_M_JP) {
                        reg |= 0x40;
+               } else if (std == V4L2_STD_SECAM) {
+                       reg |= 0x50;
                }
                saa711x_write(client, R_0E_CHROMA_CNTL_1, reg);
        } else {
index 203302f21827e5104e8b7d1b2485afbb369b76c2..830617ea81cc5ca0b6c68fce66fe45be112a1fc8 100644 (file)
@@ -2248,7 +2248,11 @@ static int radio_do_ioctl(struct inode *inode, struct file *file,
                t->type = V4L2_TUNER_RADIO;
 
                saa7134_i2c_call_clients(dev, VIDIOC_G_TUNER, t);
-
+               if (dev->input->amux == TV) {
+                       t->signal = 0xf800 - ((saa_readb(0x581) & 0x1f) << 11);
+                       t->rxsubchans = (saa_readb(0x529) & 0x08) ?
+                                       V4L2_TUNER_SUB_STEREO : V4L2_TUNER_SUB_MONO;
+               }
                return 0;
        }
        case VIDIOC_S_TUNER:
index 3e0ff8a78468a0eb41ea31d4e8a5d30fbbdf3eda..a4702d3c2aca4f295faa28dff8ca5c9c37bf49e1 100644 (file)
@@ -1240,23 +1240,53 @@ static CLASS_DEVICE_ATTR(frame_header, S_IRUGO,
                         sn9c102_show_frame_header, NULL);
 
 
-static void sn9c102_create_sysfs(struct sn9c102_device* cam)
+static int sn9c102_create_sysfs(struct sn9c102_device* cam)
 {
        struct video_device *v4ldev = cam->v4ldev;
+       int rc;
+
+       rc = video_device_create_file(v4ldev, &class_device_attr_reg);
+       if (rc) goto err;
+       rc = video_device_create_file(v4ldev, &class_device_attr_val);
+       if (rc) goto err_reg;
+       rc = video_device_create_file(v4ldev, &class_device_attr_frame_header);
+       if (rc) goto err_val;
 
-       video_device_create_file(v4ldev, &class_device_attr_reg);
-       video_device_create_file(v4ldev, &class_device_attr_val);
-       video_device_create_file(v4ldev, &class_device_attr_frame_header);
-       if (cam->bridge == BRIDGE_SN9C101 || cam->bridge == BRIDGE_SN9C102)
-               video_device_create_file(v4ldev, &class_device_attr_green);
-       else if (cam->bridge == BRIDGE_SN9C103) {
-               video_device_create_file(v4ldev, &class_device_attr_blue);
-               video_device_create_file(v4ldev, &class_device_attr_red);
-       }
        if (cam->sensor.sysfs_ops) {
-               video_device_create_file(v4ldev, &class_device_attr_i2c_reg);
-               video_device_create_file(v4ldev, &class_device_attr_i2c_val);
+               rc = video_device_create_file(v4ldev, &class_device_attr_i2c_reg);
+               if (rc) goto err_frhead;
+               rc = video_device_create_file(v4ldev, &class_device_attr_i2c_val);
+               if (rc) goto err_i2c_reg;
+       }
+
+       if (cam->bridge == BRIDGE_SN9C101 || cam->bridge == BRIDGE_SN9C102) {
+               rc = video_device_create_file(v4ldev, &class_device_attr_green);
+               if (rc) goto err_i2c_val;
+       } else if (cam->bridge == BRIDGE_SN9C103) {
+               rc = video_device_create_file(v4ldev, &class_device_attr_blue);
+               if (rc) goto err_i2c_val;
+               rc = video_device_create_file(v4ldev, &class_device_attr_red);
+               if (rc) goto err_blue;
        }
+
+       return 0;
+
+err_blue:
+       video_device_remove_file(v4ldev, &class_device_attr_blue);
+err_i2c_val:
+       if (cam->sensor.sysfs_ops)
+               video_device_remove_file(v4ldev, &class_device_attr_i2c_val);
+err_i2c_reg:
+       if (cam->sensor.sysfs_ops)
+               video_device_remove_file(v4ldev, &class_device_attr_i2c_reg);
+err_frhead:
+       video_device_remove_file(v4ldev, &class_device_attr_frame_header);
+err_val:
+       video_device_remove_file(v4ldev, &class_device_attr_val);
+err_reg:
+       video_device_remove_file(v4ldev, &class_device_attr_reg);
+err:
+       return rc;
 }
 #endif /* CONFIG_VIDEO_ADV_DEBUG */
 
@@ -2809,10 +2839,7 @@ sn9c102_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
                DBG(1, "V4L2 device registration failed");
                if (err == -ENFILE && video_nr[dev_nr] == -1)
                        DBG(1, "Free /dev/videoX node not found");
-               video_nr[dev_nr] = -1;
-               dev_nr = (dev_nr < SN9C102_MAX_DEVICES-1) ? dev_nr+1 : 0;
-               mutex_unlock(&cam->dev_mutex);
-               goto fail;
+               goto fail2;
        }
 
        DBG(2, "V4L2 device registered as /dev/video%d", cam->v4ldev->minor);
@@ -2823,7 +2850,9 @@ sn9c102_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
        dev_nr = (dev_nr < SN9C102_MAX_DEVICES-1) ? dev_nr+1 : 0;
 
 #ifdef CONFIG_VIDEO_ADV_DEBUG
-       sn9c102_create_sysfs(cam);
+       err = sn9c102_create_sysfs(cam);
+       if (err)
+               goto fail3;
        DBG(2, "Optional device control through 'sysfs' interface ready");
 #endif
 
@@ -2833,6 +2862,14 @@ sn9c102_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
 
        return 0;
 
+#ifdef CONFIG_VIDEO_ADV_DEBUG
+fail3:
+       video_unregister_device(cam->v4ldev);
+#endif
+fail2:
+       video_nr[dev_nr] = -1;
+       dev_nr = (dev_nr < SN9C102_MAX_DEVICES-1) ? dev_nr+1 : 0;
+       mutex_unlock(&cam->dev_mutex);
 fail:
        if (cam) {
                kfree(cam->control_buffer);
index 87e11300181dd26b708c4f73bd4b1f2ab8daba8f..6d1ef1e2e8efd9dbf8be48763ee7283b3cf42021 100644 (file)
@@ -516,16 +516,45 @@ stv680_file(frames_read, framecount, "%d\n");
 stv680_file(packets_dropped, dropped, "%d\n");
 stv680_file(decoding_errors, error, "%d\n");
 
-static void stv680_create_sysfs_files(struct video_device *vdev)
+static int stv680_create_sysfs_files(struct video_device *vdev)
 {
-       video_device_create_file(vdev, &class_device_attr_model);
-       video_device_create_file(vdev, &class_device_attr_in_use);
-       video_device_create_file(vdev, &class_device_attr_streaming);
-       video_device_create_file(vdev, &class_device_attr_palette);
-       video_device_create_file(vdev, &class_device_attr_frames_total);
-       video_device_create_file(vdev, &class_device_attr_frames_read);
-       video_device_create_file(vdev, &class_device_attr_packets_dropped);
-       video_device_create_file(vdev, &class_device_attr_decoding_errors);
+       int rc;
+
+       rc = video_device_create_file(vdev, &class_device_attr_model);
+       if (rc) goto err;
+       rc = video_device_create_file(vdev, &class_device_attr_in_use);
+       if (rc) goto err_model;
+       rc = video_device_create_file(vdev, &class_device_attr_streaming);
+       if (rc) goto err_inuse;
+       rc = video_device_create_file(vdev, &class_device_attr_palette);
+       if (rc) goto err_stream;
+       rc = video_device_create_file(vdev, &class_device_attr_frames_total);
+       if (rc) goto err_pal;
+       rc = video_device_create_file(vdev, &class_device_attr_frames_read);
+       if (rc) goto err_framtot;
+       rc = video_device_create_file(vdev, &class_device_attr_packets_dropped);
+       if (rc) goto err_framread;
+       rc = video_device_create_file(vdev, &class_device_attr_decoding_errors);
+       if (rc) goto err_dropped;
+
+       return 0;
+
+err_dropped:
+       video_device_remove_file(vdev, &class_device_attr_packets_dropped);
+err_framread:
+       video_device_remove_file(vdev, &class_device_attr_frames_read);
+err_framtot:
+       video_device_remove_file(vdev, &class_device_attr_frames_total);
+err_pal:
+       video_device_remove_file(vdev, &class_device_attr_palette);
+err_stream:
+       video_device_remove_file(vdev, &class_device_attr_streaming);
+err_inuse:
+       video_device_remove_file(vdev, &class_device_attr_in_use);
+err_model:
+       video_device_remove_file(vdev, &class_device_attr_model);
+err:
+       return rc;
 }
 
 static void stv680_remove_sysfs_files(struct video_device *vdev)
@@ -1418,9 +1447,13 @@ static int stv680_probe (struct usb_interface *intf, const struct usb_device_id
        PDEBUG (0, "STV(i): registered new video device: video%d", stv680->vdev->minor);
 
        usb_set_intfdata (intf, stv680);
-       stv680_create_sysfs_files(stv680->vdev);
+       retval = stv680_create_sysfs_files(stv680->vdev);
+       if (retval)
+               goto error_unreg;
        return 0;
 
+error_unreg:
+       video_unregister_device(stv680->vdev);
 error_vdev:
        video_device_release(stv680->vdev);
 error:
index 8fff642fad56fa8e2579c2741d96818ea6850d94..781682373b61f3992d36ac9e938a62451cd61608 100644 (file)
@@ -1046,7 +1046,6 @@ static struct tuner_params tuner_samsung_tcpn_2121p30a_params[] = {
                .type   = TUNER_PARAM_TYPE_NTSC,
                .ranges = tuner_samsung_tcpn_2121p30a_ntsc_ranges,
                .count  = ARRAY_SIZE(tuner_samsung_tcpn_2121p30a_ntsc_ranges),
-               .has_tda9887 = 1,
        },
 };
 
index 479a0675cf60bf8ddfc7b6a372077be03063b35a..d424a4129d69ba188772282ec9f29a95374218c9 100644 (file)
  */
 
 #define dbgarg(cmd, fmt, arg...) \
-               if (vfd->debug & V4L2_DEBUG_IOCTL_ARG)                  \
+               if (vfd->debug & V4L2_DEBUG_IOCTL_ARG) {                \
                        printk (KERN_DEBUG "%s: ",  vfd->name);         \
                        v4l_printk_ioctl(cmd);                          \
-                       printk (KERN_DEBUG "%s: " fmt, vfd->name, ## arg);
+                       printk (KERN_DEBUG "%s: " fmt, vfd->name, ## arg); \
+               }
 
 #define dbgarg2(fmt, arg...) \
                if (vfd->debug & V4L2_DEBUG_IOCTL_ARG)                  \
@@ -1287,6 +1288,7 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
                        ret=vfd->vidioc_g_parm(file, fh, p);
                } else {
                        struct v4l2_standard s;
+                       int i;
 
                        if (!vfd->tvnormsize) {
                                printk (KERN_WARNING "%s: no TV norms defined!\n",
@@ -1297,8 +1299,14 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
                        if (p->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
                                return -EINVAL;
 
-                       v4l2_video_std_construct(&s, vfd->tvnorms[vfd->current_norm].id,
-                                                vfd->tvnorms[vfd->current_norm].name);
+                       for (i = 0; i < vfd->tvnormsize; i++)
+                               if (vfd->tvnorms[i].id == vfd->current_norm)
+                                       break;
+                       if (i >= vfd->tvnormsize)
+                               return -EINVAL;
+
+                       v4l2_video_std_construct(&s, vfd->current_norm,
+                                                vfd->tvnorms[i].name);
 
                        memset(p,0,sizeof(*p));
 
index e7c01d560b6460f1dd6de8ab19a87ed651556782..3c8dc72dc8e971662b7267d545ee71e8e98a22b9 100644 (file)
@@ -272,7 +272,7 @@ static void gen_line(struct sg_to_addr to_addr[],int inipos,int pages,int wmax,
 
        /* Get first addr pointed to pixel position */
        oldpg=get_addr_pos(pos,pages,to_addr);
-       pg=pfn_to_page(to_addr[oldpg].sg->dma_address >> PAGE_SHIFT);
+       pg=pfn_to_page(sg_dma_address(to_addr[oldpg].sg) >> PAGE_SHIFT);
        basep = kmap_atomic(pg, KM_BOUNCE_READ)+to_addr[oldpg].sg->offset;
 
        /* We will just duplicate the second pixel at the packet */
@@ -287,7 +287,7 @@ static void gen_line(struct sg_to_addr to_addr[],int inipos,int pages,int wmax,
                for (color=0;color<4;color++) {
                        pgpos=get_addr_pos(pos,pages,to_addr);
                        if (pgpos!=oldpg) {
-                               pg=pfn_to_page(to_addr[pgpos].sg->dma_address >> PAGE_SHIFT);
+                               pg=pfn_to_page(sg_dma_address(to_addr[pgpos].sg) >> PAGE_SHIFT);
                                kunmap_atomic(basep, KM_BOUNCE_READ);
                                basep= kmap_atomic(pg, KM_BOUNCE_READ)+to_addr[pgpos].sg->offset;
                                oldpg=pgpos;
@@ -339,8 +339,8 @@ static void gen_line(struct sg_to_addr to_addr[],int inipos,int pages,int wmax,
                                for (color=0;color<4;color++) {
                                        pgpos=get_addr_pos(pos,pages,to_addr);
                                        if (pgpos!=oldpg) {
-                                               pg=pfn_to_page(to_addr[pgpos].
-                                                               sg->dma_address
+                                               pg=pfn_to_page(sg_dma_address(
+                                                               to_addr[pgpos].sg)
                                                                >> PAGE_SHIFT);
                                                kunmap_atomic(basep,
                                                                KM_BOUNCE_READ);
@@ -386,7 +386,7 @@ static void vivi_fillbuff(struct vivi_dev *dev,struct vivi_buffer *buf)
        struct timeval ts;
 
        /* Test if DMA mapping is ready */
-       if (!vb->dma.sglist[0].dma_address)
+       if (!sg_dma_address(&vb->dma.sglist[0]))
                return;
 
        prep_to_addr(to_addr,vb);
@@ -783,7 +783,7 @@ static int vivi_map_sg(void *dev, struct scatterlist *sg, int nents,
        for (i = 0; i < nents; i++ ) {
                BUG_ON(!sg[i].page);
 
-               sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset;
+               sg_dma_address(&sg[i]) = page_to_phys(sg[i].page) + sg[i].offset;
        }
 
        return nents;
index ac06f10c54ec1416c1a9b75fdbde20e23051be22..d96c687aee9373fe7638fa61bb88e335b58b65ea 100644 (file)
@@ -80,18 +80,26 @@ static DEVICE_ATTR(scan, S_IWUSR, NULL, i2o_bus_store_scan);
  *     @dev: device to verify if it is a I2O Bus Adapter device
  *
  *     Because we want all Bus Adapters always return 0.
+ *     Except when we fail.  Then we are sad.
  *
- *     Returns 0.
+ *     Returns 0, except when we fail to excel.
  */
 static int i2o_bus_probe(struct device *dev)
 {
        struct i2o_device *i2o_dev = to_i2o_device(get_device(dev));
+       int rc;
 
-       device_create_file(dev, &dev_attr_scan);
+       rc = device_create_file(dev, &dev_attr_scan);
+       if (rc)
+               goto err_out;
 
        osm_info("device added (TID: %03x)\n", i2o_dev->lct_data.tid);
 
        return 0;
+
+err_out:
+       put_device(dev);
+       return rc;
 };
 
 /**
index 7bd4d85d0b42db6af28def4072cbd11fbadbec86..01a5a702b037e9c12e22fd1ef43ebd211b8f4204 100644 (file)
@@ -127,7 +127,7 @@ int i2o_msg_post_wait_mem(struct i2o_controller *c, struct i2o_message *msg,
        DECLARE_WAIT_QUEUE_HEAD(wq);
        struct i2o_exec_wait *wait;
        static u32 tcntxt = 0x80000000;
-       long flags;
+       unsigned long flags;
        int rc = 0;
 
        wait = i2o_exec_wait_alloc();
@@ -325,13 +325,24 @@ static DEVICE_ATTR(product_id, S_IRUGO, i2o_exec_show_product_id, NULL);
 static int i2o_exec_probe(struct device *dev)
 {
        struct i2o_device *i2o_dev = to_i2o_device(dev);
+       int rc;
 
-       i2o_event_register(i2o_dev, &i2o_exec_driver, 0, 0xffffffff);
+       rc = i2o_event_register(i2o_dev, &i2o_exec_driver, 0, 0xffffffff);
+       if (rc) goto err_out;
 
-       device_create_file(dev, &dev_attr_vendor_id);
-       device_create_file(dev, &dev_attr_product_id);
+       rc = device_create_file(dev, &dev_attr_vendor_id);
+       if (rc) goto err_evtreg;
+       rc = device_create_file(dev, &dev_attr_product_id);
+       if (rc) goto err_vid;
 
        return 0;
+
+err_vid:
+       device_remove_file(dev, &dev_attr_vendor_id);
+err_evtreg:
+       i2o_event_register(to_i2o_device(dev), &i2o_exec_driver, 0, 0);
+err_out:
+       return rc;
 };
 
 /**
index 3df0e7a07c46c31be7e6635f09f51f5fd489955e..b6c045dc97b4e1331e426323aa4010daffe67e0f 100644 (file)
@@ -28,6 +28,17 @@ config IBM_ASM
 
          If unsure, say N.
 
+config SGI_IOC4
+       tristate "SGI IOC4 Base IO support"
+       ---help---
+         This option enables basic support for the IOC4 chip on certain
+         SGI IO controller cards (IO9, IO10, and PCI-RT).  This option
+         does not enable any specific functions on such a card, but provides
+         necessary infrastructure for other drivers to utilize.
+
+         If you have an SGI Altix with an IOC4-based card say Y.
+         Otherwise say N.
+
 config TIFM_CORE
        tristate "TI Flash Media interface support (EXPERIMENTAL)"
        depends on EXPERIMENTAL
@@ -57,4 +68,23 @@ config TIFM_7XX1
           To compile this driver as a module, choose M here: the module will
          be called tifm_7xx1.
 
+config MSI_LAPTOP
+        tristate "MSI Laptop Extras"
+        depends on X86
+        depends on ACPI_EC
+        depends on BACKLIGHT_CLASS_DEVICE
+        ---help---
+         This is a driver for laptops built by MSI (MICRO-STAR
+         INTERNATIONAL):
+
+         MSI MegaBook S270 (MS-1013)
+         Cytron/TCM/Medion/Tchibo MD96100/SAM2000
+
+         It adds support for Bluetooth, WLAN and LCD brightness control.
+
+         More information about this driver is available at
+         <http://0pointer.de/lennart/tchibo.html>.
+
+         If you have an MSI S270 laptop, say Y or M here.
+
 endmenu
index d65ece76095a43283de2714a8c7dc0ac9a0f1625..c9e98ab021c5b096658012057a8e58542bbb1eef 100644 (file)
@@ -5,6 +5,8 @@ obj- := misc.o  # Dummy rule to force built-in.o to be made
 
 obj-$(CONFIG_IBM_ASM)          += ibmasm/
 obj-$(CONFIG_HDPU_FEATURES)    += hdpuftrs/
+obj-$(CONFIG_MSI_LAPTOP)     += msi-laptop.o
 obj-$(CONFIG_LKDTM)            += lkdtm.o
 obj-$(CONFIG_TIFM_CORE)        += tifm_core.o
 obj-$(CONFIG_TIFM_7XX1)        += tifm_7xx1.o
+obj-$(CONFIG_SGI_IOC4)         += ioc4.o
similarity index 92%
rename from drivers/sn/ioc4.c
rename to drivers/misc/ioc4.c
index 8562821e6498be2324f8763f17d1292c70f105a7..1c3c14a3839cff9d7a0f2a990ef0fa683b8d83d5 100644 (file)
@@ -3,7 +3,7 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 2005 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (C) 2005-2006 Silicon Graphics, Inc.  All Rights Reserved.
  */
 
 /* This file contains the master driver module for use by SGI IOC4 subdrivers.
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/ioc4.h>
-#include <linux/mmtimer.h>
-#include <linux/rtc.h>
+#include <linux/ktime.h>
 #include <linux/mutex.h>
-#include <asm/sn/addrs.h>
-#include <asm/sn/clksupport.h>
-#include <asm/sn/shub_mmr.h>
+#include <linux/time.h>
 
 /***************
  * Definitions *
@@ -43,7 +40,7 @@
 /* Tweakable values */
 
 /* PCI bus speed detection/calibration */
-#define IOC4_CALIBRATE_COUNT 63        /* Calibration cycle period */
+#define IOC4_CALIBRATE_COUNT 63                /* Calibration cycle period */
 #define IOC4_CALIBRATE_CYCLES 256      /* Average over this many cycles */
 #define IOC4_CALIBRATE_DISCARD 2       /* Discard first few cycles */
 #define IOC4_CALIBRATE_LOW_MHZ 25      /* Lower bound on bus speed sanity */
@@ -143,11 +140,11 @@ ioc4_unregister_submodule(struct ioc4_submodule *is)
 static void
 ioc4_clock_calibrate(struct ioc4_driver_data *idd)
 {
-       extern unsigned long sn_rtc_cycles_per_second;
        union ioc4_int_out int_out;
        union ioc4_gpcr gpcr;
        unsigned int state, last_state = 1;
-       uint64_t start = 0, end, period;
+       struct timespec start_ts, end_ts;
+       uint64_t start, end, period;
        unsigned int count = 0;
 
        /* Enable output */
@@ -175,30 +172,28 @@ ioc4_clock_calibrate(struct ioc4_driver_data *idd)
                if (!last_state && state) {
                        count++;
                        if (count == IOC4_CALIBRATE_END) {
-                               end = rtc_time();
+                               ktime_get_ts(&end_ts);
                                break;
                        } else if (count == IOC4_CALIBRATE_DISCARD)
-                               start = rtc_time();
+                               ktime_get_ts(&start_ts);
                }
                last_state = state;
        } while (1);
 
        /* Calculation rearranged to preserve intermediate precision.
         * Logically:
-        * 1. "end - start" gives us number of RTC cycles over all the
-        *    square wave cycles measured.
-        * 2. Divide by number of square wave cycles to get number of
-        *    RTC cycles per square wave cycle.
+        * 1. "end - start" gives us the measurement period over all
+        *    the square wave cycles.
+        * 2. Divide by number of square wave cycles to get the period
+        *    of a square wave cycle.
         * 3. Divide by 2*(int_out.fields.count+1), which is the formula
         *    by which the IOC4 generates the square wave, to get the
-        *    number of RTC cycles per IOC4 INT_OUT count.
-        * 4. Divide by sn_rtc_cycles_per_second to get seconds per
-        *    count.
-        * 5. Multiply by 1E9 to get nanoseconds per count.
+        *    period of an IOC4 INT_OUT count.
         */
-       period = ((end - start) * 1000000000) /
-           (IOC4_CALIBRATE_CYCLES * 2 * (IOC4_CALIBRATE_COUNT + 1)
-            * sn_rtc_cycles_per_second);
+       end = end_ts.tv_sec * NSEC_PER_SEC + end_ts.tv_nsec;
+       start = start_ts.tv_sec * NSEC_PER_SEC + start_ts.tv_nsec;
+       period = (end - start) /
+               (IOC4_CALIBRATE_CYCLES * 2 * (IOC4_CALIBRATE_COUNT + 1));
 
        /* Bounds check the result. */
        if (period > IOC4_CALIBRATE_LOW_LIMIT ||
@@ -210,10 +205,12 @@ ioc4_clock_calibrate(struct ioc4_driver_data *idd)
                       IOC4_CALIBRATE_DEFAULT / IOC4_EXTINT_COUNT_DIVISOR);
                period = IOC4_CALIBRATE_DEFAULT;
        } else {
+               u64 ns = period;
+
+               do_div(ns, IOC4_EXTINT_COUNT_DIVISOR);
                printk(KERN_DEBUG
-                      "IOC4 %s: PCI clock is %ld ns.\n",
-                      pci_name(idd->idd_pdev),
-                      period / IOC4_EXTINT_COUNT_DIVISOR);
+                      "IOC4 %s: PCI clock is %lld ns.\n",
+                      pci_name(idd->idd_pdev), ns);
        }
 
        /* Remember results.  We store the extint clock period rather
diff --git a/drivers/misc/msi-laptop.c b/drivers/misc/msi-laptop.c
new file mode 100644 (file)
index 0000000..fdb7153
--- /dev/null
@@ -0,0 +1,395 @@
+/*-*-linux-c-*-*/
+
+/*
+  Copyright (C) 2006 Lennart Poettering <mzxreary (at) 0pointer (dot) de>
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or
+  (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+  02110-1301, USA.
+ */
+
+/*
+ * msi-laptop.c - MSI S270 laptop support. This laptop is sold under
+ * various brands, including "Cytron/TCM/Medion/Tchibo MD96100".
+ *
+ * This driver exports a few files in /sys/devices/platform/msi-laptop-pf/:
+ *
+ *   lcd_level - Screen brightness: contains a single integer in the
+ *   range 0..8. (rw)
+ *
+ *   auto_brightness - Enable automatic brightness control: contains
+ *   either 0 or 1. If set to 1 the hardware adjusts the screen
+ *   brightness automatically when the power cord is
+ *   plugged/unplugged. (rw)
+ *
+ *   wlan - WLAN subsystem enabled: contains either 0 or 1. (ro)
+ *
+ *   bluetooth - Bluetooth subsystem enabled: contains either 0 or 1
+ *   Please note that this file is constantly 0 if no Bluetooth
+ *   hardware is available. (ro)
+ *
+ * In addition to these platform device attributes the driver
+ * registers itself in the Linux backlight control subsystem and is
+ * available to userspace under /sys/class/backlight/msi-laptop-bl/.
+ *
+ * This driver might work on other laptops produced by MSI. If you
+ * want to try it you can pass force=1 as argument to the module which
+ * will force it to load even when the DMI data doesn't identify the
+ * laptop as MSI S270. YMMV.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/acpi.h>
+#include <linux/dmi.h>
+#include <linux/backlight.h>
+#include <linux/platform_device.h>
+#include <linux/autoconf.h>
+
+#define MSI_DRIVER_VERSION "0.5"
+
+#define MSI_LCD_LEVEL_MAX 9
+
+#define MSI_EC_COMMAND_WIRELESS 0x10
+#define MSI_EC_COMMAND_LCD_LEVEL 0x11
+
+static int force;
+module_param(force, bool, 0);
+MODULE_PARM_DESC(force, "Force driver load, ignore DMI data");
+
+static int auto_brightness;
+module_param(auto_brightness, int, 0);
+MODULE_PARM_DESC(auto_brightness, "Enable automatic brightness control (0: disabled; 1: enabled; 2: don't touch)");
+
+/* Hardware access */
+
+static int set_lcd_level(int level)
+{
+       u8 buf[2];
+
+       if (level < 0 || level >= MSI_LCD_LEVEL_MAX)
+               return -EINVAL;
+
+       buf[0] = 0x80;
+       buf[1] = (u8) (level*31);
+
+       return ec_transaction(MSI_EC_COMMAND_LCD_LEVEL, buf, sizeof(buf), NULL, 0);
+}
+
+static int get_lcd_level(void)
+{
+       u8 wdata = 0, rdata;
+       int result;
+
+       result = ec_transaction(MSI_EC_COMMAND_LCD_LEVEL, &wdata, 1, &rdata, 1);
+       if (result < 0)
+               return result;
+
+       return (int) rdata / 31;
+}
+
+static int get_auto_brightness(void)
+{
+       u8 wdata = 4, rdata;
+       int result;
+
+       result = ec_transaction(MSI_EC_COMMAND_LCD_LEVEL, &wdata, 1, &rdata, 1);
+       if (result < 0)
+               return result;
+
+       return !!(rdata & 8);
+}
+
+static int set_auto_brightness(int enable)
+{
+       u8 wdata[2], rdata;
+       int result;
+
+       wdata[0] = 4;
+
+       result = ec_transaction(MSI_EC_COMMAND_LCD_LEVEL, wdata, 1, &rdata, 1);
+       if (result < 0)
+               return result;
+
+       wdata[0] = 0x84;
+       wdata[1] = (rdata & 0xF7) | (enable ? 8 : 0);
+
+       return ec_transaction(MSI_EC_COMMAND_LCD_LEVEL, wdata, 2, NULL, 0);
+}
+
+static int get_wireless_state(int *wlan, int *bluetooth)
+{
+       u8 wdata = 0, rdata;
+       int result;
+
+       result = ec_transaction(MSI_EC_COMMAND_WIRELESS, &wdata, 1, &rdata, 1);
+       if (result < 0)
+               return -1;
+
+       if (wlan)
+               *wlan = !!(rdata & 8);
+
+       if (bluetooth)
+               *bluetooth = !!(rdata & 128);
+
+       return 0;
+}
+
+/* Backlight device stuff */
+
+static int bl_get_brightness(struct backlight_device *b)
+{
+       return get_lcd_level();
+}
+
+
+static int bl_update_status(struct backlight_device *b)
+{
+       return set_lcd_level(b->props->brightness);
+}
+
+static struct backlight_properties msibl_props = {
+       .owner          = THIS_MODULE,
+       .get_brightness = bl_get_brightness,
+       .update_status  = bl_update_status,
+       .max_brightness = MSI_LCD_LEVEL_MAX-1,
+};
+
+static struct backlight_device *msibl_device;
+
+/* Platform device */
+
+static ssize_t show_wlan(struct device *dev,
+       struct device_attribute *attr, char *buf)
+{
+
+       int ret, enabled;
+
+       ret = get_wireless_state(&enabled, NULL);
+       if (ret < 0)
+               return ret;
+
+       return sprintf(buf, "%i\n", enabled);
+}
+
+static ssize_t show_bluetooth(struct device *dev,
+       struct device_attribute *attr, char *buf)
+{
+
+       int ret, enabled;
+
+       ret = get_wireless_state(NULL, &enabled);
+       if (ret < 0)
+               return ret;
+
+       return sprintf(buf, "%i\n", enabled);
+}
+
+static ssize_t show_lcd_level(struct device *dev,
+       struct device_attribute *attr, char *buf)
+{
+
+       int ret;
+
+       ret = get_lcd_level();
+       if (ret < 0)
+               return ret;
+
+       return sprintf(buf, "%i\n", ret);
+}
+
+static ssize_t store_lcd_level(struct device *dev,
+       struct device_attribute *attr, const char *buf, size_t count)
+{
+
+       int level, ret;
+
+       if (sscanf(buf, "%i", &level) != 1 || (level < 0 || level >= MSI_LCD_LEVEL_MAX))
+               return -EINVAL;
+
+       ret = set_lcd_level(level);
+       if (ret < 0)
+               return ret;
+
+       return count;
+}
+
+static ssize_t show_auto_brightness(struct device *dev,
+       struct device_attribute *attr, char *buf)
+{
+
+       int ret;
+
+       ret = get_auto_brightness();
+       if (ret < 0)
+               return ret;
+
+       return sprintf(buf, "%i\n", ret);
+}
+
+static ssize_t store_auto_brightness(struct device *dev,
+       struct device_attribute *attr, const char *buf, size_t count)
+{
+
+       int enable, ret;
+
+       if (sscanf(buf, "%i", &enable) != 1 || (enable != (enable & 1)))
+               return -EINVAL;
+
+       ret = set_auto_brightness(enable);
+       if (ret < 0)
+               return ret;
+
+       return count;
+}
+
+static DEVICE_ATTR(lcd_level, 0644, show_lcd_level, store_lcd_level);
+static DEVICE_ATTR(auto_brightness, 0644, show_auto_brightness, store_auto_brightness);
+static DEVICE_ATTR(bluetooth, 0444, show_bluetooth, NULL);
+static DEVICE_ATTR(wlan, 0444, show_wlan, NULL);
+
+static struct attribute *msipf_attributes[] = {
+       &dev_attr_lcd_level.attr,
+       &dev_attr_auto_brightness.attr,
+       &dev_attr_bluetooth.attr,
+       &dev_attr_wlan.attr,
+       NULL
+};
+
+static struct attribute_group msipf_attribute_group = {
+       .attrs = msipf_attributes
+};
+
+static struct platform_driver msipf_driver = {
+       .driver = {
+               .name = "msi-laptop-pf",
+               .owner = THIS_MODULE,
+       }
+};
+
+static struct platform_device *msipf_device;
+
+/* Initialization */
+
+static struct dmi_system_id __initdata msi_dmi_table[] = {
+       {
+               .ident = "MSI S270",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "MICRO-STAR INT'L CO.,LTD"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "MS-1013"),
+               }
+       },
+       {
+               .ident = "Medion MD96100",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "NOTEBOOK"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "SAM2000"),
+               }
+       },
+       { }
+};
+
+
+static int __init msi_init(void)
+{
+       int ret;
+
+       if (acpi_disabled)
+               return -ENODEV;
+
+       if (!force && !dmi_check_system(msi_dmi_table))
+               return -ENODEV;
+
+       if (auto_brightness < 0 || auto_brightness > 2)
+               return -EINVAL;
+
+       /* Register backlight stuff */
+
+       msibl_device = backlight_device_register("msi-laptop-bl", NULL, &msibl_props);
+       if (IS_ERR(msibl_device))
+               return PTR_ERR(msibl_device);
+
+       ret = platform_driver_register(&msipf_driver);
+       if (ret)
+               goto fail_backlight;
+
+       /* Register platform stuff */
+
+       msipf_device = platform_device_alloc("msi-laptop-pf", -1);
+       if (!msipf_device) {
+               ret = -ENOMEM;
+               goto fail_platform_driver;
+       }
+
+       ret = platform_device_add(msipf_device);
+       if (ret)
+               goto fail_platform_device1;
+
+       ret = sysfs_create_group(&msipf_device->dev.kobj, &msipf_attribute_group);
+       if (ret)
+               goto fail_platform_device2;
+
+       /* Disable automatic brightness control by default because
+        * this module was probably loaded to do brightness control in
+        * software. */
+
+       if (auto_brightness != 2)
+               set_auto_brightness(auto_brightness);
+
+       printk(KERN_INFO "msi-laptop: driver "MSI_DRIVER_VERSION" successfully loaded.\n");
+
+       return 0;
+
+fail_platform_device2:
+
+       platform_device_del(msipf_device);
+
+fail_platform_device1:
+
+       platform_device_put(msipf_device);
+
+fail_platform_driver:
+
+       platform_driver_unregister(&msipf_driver);
+
+fail_backlight:
+
+       backlight_device_unregister(msibl_device);
+
+       return ret;
+}
+
+static void __exit msi_cleanup(void)
+{
+
+       sysfs_remove_group(&msipf_device->dev.kobj, &msipf_attribute_group);
+       platform_device_unregister(msipf_device);
+       platform_driver_unregister(&msipf_driver);
+       backlight_device_unregister(msibl_device);
+
+       /* Enable automatic brightness control again */
+       if (auto_brightness != 2)
+               set_auto_brightness(1);
+
+       printk(KERN_INFO "msi-laptop: driver unloaded.\n");
+}
+
+module_init(msi_init);
+module_exit(msi_cleanup);
+
+MODULE_AUTHOR("Lennart Poettering");
+MODULE_DESCRIPTION("MSI Laptop Support");
+MODULE_VERSION(MSI_DRIVER_VERSION);
+MODULE_LICENSE("GPL");
index ab92cc794c64d85363b98d1bf3aa76585c68ccc8..e2ed24918a589fd7f0d0414597f8cc974a4d48fc 100644 (file)
@@ -2288,7 +2288,7 @@ config UGETH_TX_ON_DEMOND
 
 config UGETH_HAS_GIGA
        bool
-       depends on UCC_GETH && MPC836x
+       depends on UCC_GETH && PPC_MPC836x
 
 config MV643XX_ETH
        tristate "MV-643XX Ethernet support"
index 27d5d2f02533ea49c87ed10b049b0f0cdaabd911..a3a08a5dd1853bdf0516f0f5745dbbcdf26f068b 100644 (file)
@@ -2039,7 +2039,6 @@ static int e100_change_mtu(struct net_device *netdev, int new_mtu)
        return 0;
 }
 
-#ifdef CONFIG_PM
 static int e100_asf(struct nic *nic)
 {
        /* ASF can be enabled from eeprom */
@@ -2048,7 +2047,6 @@ static int e100_asf(struct nic *nic)
           !(nic->eeprom[eeprom_config_asf] & eeprom_gcl) &&
           ((nic->eeprom[eeprom_smbus_addr] & 0xFF) != 0xFE));
 }
-#endif
 
 static int e100_up(struct nic *nic)
 {
@@ -2715,34 +2713,32 @@ static void __devexit e100_remove(struct pci_dev *pdev)
        }
 }
 
+#ifdef CONFIG_PM
 static int e100_suspend(struct pci_dev *pdev, pm_message_t state)
 {
        struct net_device *netdev = pci_get_drvdata(pdev);
        struct nic *nic = netdev_priv(netdev);
 
-       if (netif_running(netdev))
-               e100_down(nic);
-       e100_hw_reset(nic);
-       netif_device_detach(netdev);
+       netif_poll_disable(nic->netdev);
+       del_timer_sync(&nic->watchdog);
+       netif_carrier_off(nic->netdev);
 
-#ifdef CONFIG_PM
        pci_save_state(pdev);
-       if (nic->flags & (wol_magic | e100_asf(nic)))
-#else
-       if (nic->flags & (wol_magic))
-#endif
-               pci_enable_wake(pdev, pci_choose_state(pdev, state), 1);
-       else
-               /* disable PME */
-               pci_enable_wake(pdev, 0, 0);
+
+       if ((nic->flags & wol_magic) | e100_asf(nic)) {
+               pci_enable_wake(pdev, PCI_D3hot, 1);
+               pci_enable_wake(pdev, PCI_D3cold, 1);
+       } else {
+               pci_enable_wake(pdev, PCI_D3hot, 0);
+               pci_enable_wake(pdev, PCI_D3cold, 0);
+       }
 
        pci_disable_device(pdev);
-       pci_set_power_state(pdev, pci_choose_state(pdev, state));
+       pci_set_power_state(pdev, PCI_D3hot);
 
        return 0;
 }
 
-#ifdef CONFIG_PM
 static int e100_resume(struct pci_dev *pdev)
 {
        struct net_device *netdev = pci_get_drvdata(pdev);
@@ -2764,7 +2760,23 @@ static int e100_resume(struct pci_dev *pdev)
 
 static void e100_shutdown(struct pci_dev *pdev)
 {
-       e100_suspend(pdev, PMSG_SUSPEND);
+       struct net_device *netdev = pci_get_drvdata(pdev);
+       struct nic *nic = netdev_priv(netdev);
+
+       netif_poll_disable(nic->netdev);
+       del_timer_sync(&nic->watchdog);
+       netif_carrier_off(nic->netdev);
+
+       if ((nic->flags & wol_magic) | e100_asf(nic)) {
+               pci_enable_wake(pdev, PCI_D3hot, 1);
+               pci_enable_wake(pdev, PCI_D3cold, 1);
+       } else {
+               pci_enable_wake(pdev, PCI_D3hot, 0);
+               pci_enable_wake(pdev, PCI_D3cold, 0);
+       }
+
+       pci_disable_device(pdev);
+       pci_set_power_state(pdev, PCI_D3hot);
 }
 
 /* ------------------ PCI Error Recovery infrastructure  -------------- */
@@ -2848,9 +2860,9 @@ static struct pci_driver e100_driver = {
        .id_table =     e100_id_table,
        .probe =        e100_probe,
        .remove =       __devexit_p(e100_remove),
+#ifdef CONFIG_PM
        /* Power Management hooks */
        .suspend =      e100_suspend,
-#ifdef CONFIG_PM
        .resume =       e100_resume,
 #endif
        .shutdown =     e100_shutdown,
index ce0d35fe3947ecde15afea7cd56d77bbc8577e7a..fa849831d0998ead7db0fbe09f6b20c5398a0018 100644 (file)
@@ -4914,10 +4914,6 @@ static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev)
        pci_enable_wake(pdev, PCI_D3hot, 0);
        pci_enable_wake(pdev, PCI_D3cold, 0);
 
-       /* Perform card reset only on one instance of the card */
-       if (PCI_FUNC (pdev->devfn) != 0)
-               return PCI_ERS_RESULT_RECOVERED;
-
        e1000_reset(adapter);
        E1000_WRITE_REG(&adapter->hw, WUS, ~0);
 
index 2802db23d3cb4be01239f580f91eb54c3b12010a..44c9f993dcc4fbe657b216e3c3a8e7a3276c6d97 100644 (file)
@@ -212,8 +212,8 @@ static void ibmveth_replenish_buffer_pool(struct ibmveth_adapter *adapter, struc
                        break;
                }
 
-               free_index = pool->consumer_index++ % pool->size;
-               pool->consumer_index = free_index;
+               free_index = pool->consumer_index;
+               pool->consumer_index = (pool->consumer_index + 1) % pool->size;
                index = pool->free_map[free_index];
 
                ibmveth_assert(index != IBM_VETH_INVALID_MAP);
@@ -329,8 +329,10 @@ static void ibmveth_remove_buffer_from_pool(struct ibmveth_adapter *adapter, u64
                         adapter->rx_buff_pool[pool].buff_size,
                         DMA_FROM_DEVICE);
 
-       free_index = adapter->rx_buff_pool[pool].producer_index++ % adapter->rx_buff_pool[pool].size;
-       adapter->rx_buff_pool[pool].producer_index = free_index;
+       free_index = adapter->rx_buff_pool[pool].producer_index;
+       adapter->rx_buff_pool[pool].producer_index
+               = (adapter->rx_buff_pool[pool].producer_index + 1)
+               % adapter->rx_buff_pool[pool].size;
        adapter->rx_buff_pool[pool].free_map[free_index] = index;
 
        mb();
index e963dbf816bef71bc99f9dbbb637a070182e9a15..f56b00ee385e339198e950e060558dcba9418788 100644 (file)
@@ -1017,7 +1017,7 @@ static void ioc3_init(struct net_device *dev)
        struct ioc3_private *ip = netdev_priv(dev);
        struct ioc3 *ioc3 = ip->regs;
 
-       del_timer(&ip->ioc3_timer);             /* Kill if running      */
+       del_timer_sync(&ip->ioc3_timer);        /* Kill if running      */
 
        ioc3_w_emcr(EMCR_RST);                  /* Reset                */
        (void) ioc3_r_emcr();                   /* Flush WB             */
@@ -1081,7 +1081,7 @@ static int ioc3_close(struct net_device *dev)
 {
        struct ioc3_private *ip = netdev_priv(dev);
 
-       del_timer(&ip->ioc3_timer);
+       del_timer_sync(&ip->ioc3_timer);
 
        netif_stop_queue(dev);
 
index 4178b4b1d2df544a5b7c20fe90a0c0b02727ddcf..82c10dec1b5ac9d739578aa4d4874573d4ad11c4 100644 (file)
 #include <linux/tcp.h>
 #include <linux/percpu.h>
 
-static DEFINE_PER_CPU(struct net_device_stats, loopback_stats);
+struct pcpu_lstats {
+       unsigned long packets;
+       unsigned long bytes;
+};
+static DEFINE_PER_CPU(struct pcpu_lstats, pcpu_lstats);
 
 #define LOOPBACK_OVERHEAD (128 + MAX_HEADER + 16 + 16)
 
@@ -128,7 +132,7 @@ static void emulate_large_send_offload(struct sk_buff *skb)
  */
 static int loopback_xmit(struct sk_buff *skb, struct net_device *dev)
 {
-       struct net_device_stats *lb_stats;
+       struct pcpu_lstats *lb_stats;
 
        skb_orphan(skb);
 
@@ -149,16 +153,14 @@ static int loopback_xmit(struct sk_buff *skb, struct net_device *dev)
 #endif
        dev->last_rx = jiffies;
 
-       lb_stats = &per_cpu(loopback_stats, get_cpu());
-       lb_stats->rx_bytes += skb->len;
-       lb_stats->tx_bytes = lb_stats->rx_bytes;
-       lb_stats->rx_packets++;
-       lb_stats->tx_packets = lb_stats->rx_packets;
-       put_cpu();
+       /* it's OK to use __get_cpu_var() because BHs are off */
+       lb_stats = &__get_cpu_var(pcpu_lstats);
+       lb_stats->bytes += skb->len;
+       lb_stats->packets++;
 
        netif_rx(skb);
 
-       return(0);
+       return 0;
 }
 
 static struct net_device_stats loopback_stats;
@@ -166,20 +168,21 @@ static struct net_device_stats loopback_stats;
 static struct net_device_stats *get_stats(struct net_device *dev)
 {
        struct net_device_stats *stats = &loopback_stats;
+       unsigned long bytes = 0;
+       unsigned long packets = 0;
        int i;
 
-       memset(stats, 0, sizeof(struct net_device_stats));
-
        for_each_possible_cpu(i) {
-               struct net_device_stats *lb_stats;
+               const struct pcpu_lstats *lb_stats;
 
-               lb_stats = &per_cpu(loopback_stats, i);
-               stats->rx_bytes   += lb_stats->rx_bytes;
-               stats->tx_bytes   += lb_stats->tx_bytes;
-               stats->rx_packets += lb_stats->rx_packets;
-               stats->tx_packets += lb_stats->tx_packets;
+               lb_stats = &per_cpu(pcpu_lstats, i);
+               bytes   += lb_stats->bytes;
+               packets += lb_stats->packets;
        }
-
+       stats->rx_packets = packets;
+       stats->tx_packets = packets;
+       stats->rx_bytes = bytes;
+       stats->tx_bytes = bytes;
        return stats;
 }
 
index e21ec9b2c706ceb72e92eff05b3ed9b3a8fcf5f9..ba7b8652c5013813808da694801c9c36c6005451 100644 (file)
@@ -1,8 +1,8 @@
 /* This is the Myrinet MCP code for LANai4.x */
 /* Generated by  cat $MYRI_HOME/lib/lanai/mcp4.dat > myri_code4.h */
 
-static unsigned int lanai4_code_off = 0x0000; /* half-word offset */
-static unsigned char lanai4_code[76256] __initdata = {
+static unsigned int __devinitdata lanai4_code_off = 0x0000; /* half-word offset */
+static unsigned char __devinitdata lanai4_code[76256] = {
 0xF2,0x0E,
 0xFE,0x00, 0xC2,0x90, 0x00,0x00, 0x07,0x88, 0x00,0x08, 0xE0,0x01, 0x01,0x4C, 0x97,0x93,
 0xFF,0xFC, 0xE0,0x00, 0x00,0x14, 0x00,0x00, 0x00,0x01, 0x00,0x00, 0x00,0x00, 0x92,0x93,
@@ -4774,8 +4774,8 @@ static unsigned char lanai4_code[76256] __initdata = {
 
 /* This is the LANai data */
 
-static unsigned int lanai4_data_off = 0x94F0; /* half-word offset */
-static unsigned char lanai4_data[20472] __initdata;
+static unsigned int __devinitdata lanai4_data_off = 0x94F0; /* half-word offset */
+static unsigned char __devinitdata lanai4_data[20472];
 
 
 #ifdef SYMBOL_DEFINES_COMPILED
index 466b484c9fa40dd19dfdd00180f7a3f6c3fceac0..7747bfd99f916a8b084623ba48e00e40a275c8af 100644 (file)
@@ -168,7 +168,7 @@ static int myri_do_handshake(struct myri_eth *mp)
        return 0;
 }
 
-static int myri_load_lanai(struct myri_eth *mp)
+static int __devinit myri_load_lanai(struct myri_eth *mp)
 {
        struct net_device       *dev = mp->dev;
        struct myri_shmem __iomem *shmem = mp->shmem;
@@ -891,7 +891,7 @@ static void dump_eeprom(struct myri_eth *mp)
 }
 #endif
 
-static int __init myri_ether_init(struct sbus_dev *sdev)
+static int __devinit myri_ether_init(struct sbus_dev *sdev)
 {
        static int num;
        static unsigned version_printed;
index f1c75751cab7a4a55e7ba3c6a0800bd50874ef4a..d132fe7d475e99afe10d73cc02963923c1efadbc 100644 (file)
@@ -214,6 +214,7 @@ static struct pci_device_id rtl8169_pci_tbl[] = {
        { PCI_DEVICE(PCI_VENDOR_ID_REALTEK,     0x8168), 0, 0, RTL_CFG_2 },
        { PCI_DEVICE(PCI_VENDOR_ID_REALTEK,     0x8169), 0, 0, RTL_CFG_0 },
        { PCI_DEVICE(PCI_VENDOR_ID_DLINK,       0x4300), 0, 0, RTL_CFG_0 },
+       { PCI_DEVICE(0x1259,                    0xc107), 0, 0, RTL_CFG_0 },
        { PCI_DEVICE(0x16ec,                    0x0116), 0, 0, RTL_CFG_0 },
        { PCI_VENDOR_ID_LINKSYS,                0x1032,
                PCI_ANY_ID, 0x0024, 0, 0, RTL_CFG_0 },
@@ -2700,6 +2701,7 @@ static void rtl8169_down(struct net_device *dev)
        struct rtl8169_private *tp = netdev_priv(dev);
        void __iomem *ioaddr = tp->mmio_addr;
        unsigned int poll_locked = 0;
+       unsigned int intrmask;
 
        rtl8169_delete_timer(dev);
 
@@ -2738,8 +2740,11 @@ core_down:
         * 2) dev->change_mtu
         *    -> rtl8169_poll can not be issued again and re-enable the
         *       interruptions. Let's simply issue the IRQ down sequence again.
+        *
+        * No loop if hotpluged or major error (0xffff).
         */
-       if (RTL_R16(IntrMask))
+       intrmask = RTL_R16(IntrMask);
+       if (intrmask && (intrmask != 0xffff))
                goto core_down;
 
        rtl8169_tx_clear(tp);
index db2324939b69ec7fef2bad39e7be0cfa62d5af72..1eae16b72b4b71122c47284d9a3902af2c63485e 100644 (file)
@@ -2903,7 +2903,7 @@ sbmac_init_module(void)
 
                dev = alloc_etherdev(sizeof(struct sbmac_softc));
                if (!dev)
-                       return -ENOMEM; /* return ENOMEM */
+                       return -ENOMEM;
 
                printk(KERN_DEBUG "sbmac: configuring MAC at %lx\n", port);
 
index c10e7f5faa5f59be42894b51bf6a74e76c812714..95efdb5bbbe10da3a1932c3614d09ce85cadda09 100644 (file)
@@ -50,7 +50,7 @@
 #include "sky2.h"
 
 #define DRV_NAME               "sky2"
-#define DRV_VERSION            "1.9"
+#define DRV_VERSION            "1.10"
 #define PFX                    DRV_NAME " "
 
 /*
@@ -96,9 +96,9 @@ static int disable_msi = 0;
 module_param(disable_msi, int, 0);
 MODULE_PARM_DESC(disable_msi, "Disable Message Signaled Interrupt (MSI)");
 
-static int idle_timeout = 100;
+static int idle_timeout = 0;
 module_param(idle_timeout, int, 0);
-MODULE_PARM_DESC(idle_timeout, "Idle timeout workaround for lost interrupts (ms)");
+MODULE_PARM_DESC(idle_timeout, "Watchdog timer for lost interrupts (ms)");
 
 static const struct pci_device_id sky2_id_table[] = {
        { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9000) },
@@ -284,6 +284,31 @@ static void sky2_gmac_reset(struct sky2_hw *hw, unsigned port)
        gma_write16(hw, port, GM_RX_CTRL, reg);
 }
 
+/* flow control to advertise bits */
+static const u16 copper_fc_adv[] = {
+       [FC_NONE]       = 0,
+       [FC_TX]         = PHY_M_AN_ASP,
+       [FC_RX]         = PHY_M_AN_PC,
+       [FC_BOTH]       = PHY_M_AN_PC | PHY_M_AN_ASP,
+};
+
+/* flow control to advertise bits when using 1000BaseX */
+static const u16 fiber_fc_adv[] = {
+       [FC_BOTH] = PHY_M_P_BOTH_MD_X,
+       [FC_TX]   = PHY_M_P_ASYM_MD_X,
+       [FC_RX]   = PHY_M_P_SYM_MD_X,
+       [FC_NONE] = PHY_M_P_NO_PAUSE_X,
+};
+
+/* flow control to GMA disable bits */
+static const u16 gm_fc_disable[] = {
+       [FC_NONE] = GM_GPCR_FC_RX_DIS | GM_GPCR_FC_TX_DIS,
+       [FC_TX]   = GM_GPCR_FC_RX_DIS,
+       [FC_RX]   = GM_GPCR_FC_TX_DIS,
+       [FC_BOTH] = 0,
+};
+
+
 static void sky2_phy_init(struct sky2_hw *hw, unsigned port)
 {
        struct sky2_port *sky2 = netdev_priv(hw->dev[port]);
@@ -356,16 +381,7 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port)
                gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg);
        }
 
-       ctrl = gm_phy_read(hw, port, PHY_MARV_CTRL);
-       if (sky2->autoneg == AUTONEG_DISABLE)
-               ctrl &= ~PHY_CT_ANE;
-       else
-               ctrl |= PHY_CT_ANE;
-
-       ctrl |= PHY_CT_RESET;
-       gm_phy_write(hw, port, PHY_MARV_CTRL, ctrl);
-
-       ctrl = 0;
+       ctrl = PHY_CT_RESET;
        ct1000 = 0;
        adv = PHY_AN_CSMA;
        reg = 0;
@@ -384,20 +400,16 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port)
                                adv |= PHY_M_AN_10_FD;
                        if (sky2->advertising & ADVERTISED_10baseT_Half)
                                adv |= PHY_M_AN_10_HD;
+
+                       adv |= copper_fc_adv[sky2->flow_mode];
                } else {        /* special defines for FIBER (88E1040S only) */
                        if (sky2->advertising & ADVERTISED_1000baseT_Full)
                                adv |= PHY_M_AN_1000X_AFD;
                        if (sky2->advertising & ADVERTISED_1000baseT_Half)
                                adv |= PHY_M_AN_1000X_AHD;
-               }
 
-               /* Set Flow-control capabilities */
-               if (sky2->tx_pause && sky2->rx_pause)
-                       adv |= PHY_AN_PAUSE_CAP;        /* symmetric */
-               else if (sky2->rx_pause && !sky2->tx_pause)
-                       adv |= PHY_AN_PAUSE_ASYM | PHY_AN_PAUSE_CAP;
-               else if (!sky2->rx_pause && sky2->tx_pause)
-                       adv |= PHY_AN_PAUSE_ASYM;       /* local */
+                       adv |= fiber_fc_adv[sky2->flow_mode];
+               }
 
                /* Restart Auto-negotiation */
                ctrl |= PHY_CT_ANE | PHY_CT_RE_CFG;
@@ -422,25 +434,17 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port)
                if (sky2->duplex == DUPLEX_FULL) {
                        reg |= GM_GPCR_DUP_FULL;
                        ctrl |= PHY_CT_DUP_MD;
-               } else if (sky2->speed != SPEED_1000 && hw->chip_id != CHIP_ID_YUKON_EC_U) {
-                       /* Turn off flow control for 10/100mbps */
-                       sky2->rx_pause = 0;
-                       sky2->tx_pause = 0;
-               }
+               } else if (sky2->speed < SPEED_1000)
+                       sky2->flow_mode = FC_NONE;
 
-               if (!sky2->rx_pause)
-                       reg |= GM_GPCR_FC_RX_DIS;
 
-               if (!sky2->tx_pause)
-                       reg |= GM_GPCR_FC_TX_DIS;
+               reg |= gm_fc_disable[sky2->flow_mode];
 
                /* Forward pause packets to GMAC? */
-               if (sky2->tx_pause || sky2->rx_pause)
+               if (sky2->flow_mode & FC_RX)
                        sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_PAUSE_ON);
                else
                        sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_PAUSE_OFF);
-
-               ctrl |= PHY_CT_RESET;
        }
 
        gma_write16(hw, port, GM_GP_CTRL, reg);
@@ -695,16 +699,10 @@ static void sky2_mac_init(struct sky2_hw *hw, unsigned port)
 
 }
 
-/* Assign Ram Buffer allocation.
- * start and end are in units of 4k bytes
- * ram registers are in units of 64bit words
- */
-static void sky2_ramset(struct sky2_hw *hw, u16 q, u8 startk, u8 endk)
+/* Assign Ram Buffer allocation in units of 64bit (8 bytes) */
+static void sky2_ramset(struct sky2_hw *hw, u16 q, u32 start, u32 end)
 {
-       u32 start, end;
-
-       start = startk * 4096/8;
-       end = (endk * 4096/8) - 1;
+       pr_debug(PFX "q %d %#x %#x\n", q, start, end);
 
        sky2_write8(hw, RB_ADDR(q, RB_CTRL), RB_RST_CLR);
        sky2_write32(hw, RB_ADDR(q, RB_START), start);
@@ -713,7 +711,7 @@ static void sky2_ramset(struct sky2_hw *hw, u16 q, u8 startk, u8 endk)
        sky2_write32(hw, RB_ADDR(q, RB_RP), start);
 
        if (q == Q_R1 || q == Q_R2) {
-               u32 space = (endk - startk) * 4096/8;
+               u32 space = end - start + 1;
                u32 tp = space - space/4;
 
                /* On receive queue's set the thresholds
@@ -1195,19 +1193,16 @@ static int sky2_up(struct net_device *dev)
 
        sky2_mac_init(hw, port);
 
-       /* Determine available ram buffer space (in 4K blocks).
-        * Note: not sure about the FE setting below yet
-        */
-       if (hw->chip_id == CHIP_ID_YUKON_FE)
-               ramsize = 4;
-       else
-               ramsize = sky2_read8(hw, B2_E_0);
+       /* Determine available ram buffer space in qwords.  */
+       ramsize = sky2_read8(hw, B2_E_0) * 4096/8;
 
-       /* Give transmitter one third (rounded up) */
-       rxspace = ramsize - (ramsize + 2) / 3;
+       if (ramsize > 6*1024/8)
+               rxspace = ramsize - (ramsize + 2) / 3;
+       else
+               rxspace = ramsize / 2;
 
-       sky2_ramset(hw, rxqaddr[port], 0, rxspace);
-       sky2_ramset(hw, txqaddr[port], rxspace, ramsize);
+       sky2_ramset(hw, rxqaddr[port], 0, rxspace-1);
+       sky2_ramset(hw, txqaddr[port], rxspace, ramsize-1);
 
        /* Make sure SyncQ is disabled */
        sky2_write8(hw, RB_ADDR(port == 0 ? Q_XS1 : Q_XS2, RB_CTRL),
@@ -1499,6 +1494,11 @@ static int sky2_down(struct net_device *dev)
        /* Stop more packets from being queued */
        netif_stop_queue(dev);
 
+       /* Disable port IRQ */
+       imask = sky2_read32(hw, B0_IMSK);
+       imask &= ~portirq_msk[port];
+       sky2_write32(hw, B0_IMSK, imask);
+
        sky2_gmac_reset(hw, port);
 
        /* Stop transmitter */
@@ -1549,11 +1549,6 @@ static int sky2_down(struct net_device *dev)
        sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_SET);
        sky2_write8(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_RST_SET);
 
-       /* Disable port IRQ */
-       imask = sky2_read32(hw, B0_IMSK);
-       imask &= ~portirq_msk[port];
-       sky2_write32(hw, B0_IMSK, imask);
-
        sky2_phy_power(hw, port, 0);
 
        /* turn off LED's */
@@ -1605,6 +1600,12 @@ static void sky2_link_up(struct sky2_port *sky2)
        struct sky2_hw *hw = sky2->hw;
        unsigned port = sky2->port;
        u16 reg;
+       static const char *fc_name[] = {
+               [FC_NONE]       = "none",
+               [FC_TX]         = "tx",
+               [FC_RX]         = "rx",
+               [FC_BOTH]       = "both",
+       };
 
        /* enable Rx/Tx */
        reg = gma_read16(hw, port, GM_GP_CTRL);
@@ -1648,8 +1649,7 @@ static void sky2_link_up(struct sky2_port *sky2)
                       "%s: Link is up at %d Mbps, %s duplex, flow control %s\n",
                       sky2->netdev->name, sky2->speed,
                       sky2->duplex == DUPLEX_FULL ? "full" : "half",
-                      (sky2->tx_pause && sky2->rx_pause) ? "both" :
-                      sky2->tx_pause ? "tx" : sky2->rx_pause ? "rx" : "none");
+                      fc_name[sky2->flow_status]);
 }
 
 static void sky2_link_down(struct sky2_port *sky2)
@@ -1664,7 +1664,7 @@ static void sky2_link_down(struct sky2_port *sky2)
        reg &= ~(GM_GPCR_RX_ENA | GM_GPCR_TX_ENA);
        gma_write16(hw, port, GM_GP_CTRL, reg);
 
-       if (sky2->rx_pause && !sky2->tx_pause) {
+       if (sky2->flow_status == FC_RX) {
                /* restore Asymmetric Pause bit */
                gm_phy_write(hw, port, PHY_MARV_AUNE_ADV,
                             gm_phy_read(hw, port, PHY_MARV_AUNE_ADV)
@@ -1683,6 +1683,14 @@ static void sky2_link_down(struct sky2_port *sky2)
        sky2_phy_init(hw, port);
 }
 
+static enum flow_control sky2_flow(int rx, int tx)
+{
+       if (rx)
+               return tx ? FC_BOTH : FC_RX;
+       else
+               return tx ? FC_TX : FC_NONE;
+}
+
 static int sky2_autoneg_done(struct sky2_port *sky2, u16 aux)
 {
        struct sky2_hw *hw = sky2->hw;
@@ -1703,39 +1711,20 @@ static int sky2_autoneg_done(struct sky2_port *sky2, u16 aux)
        }
 
        sky2->speed = sky2_phy_speed(hw, aux);
-       if (sky2->speed == SPEED_1000) {
-               u16 ctl2 = gm_phy_read(hw, port, PHY_MARV_1000T_CTRL);
-               u16 lpa2 = gm_phy_read(hw, port, PHY_MARV_1000T_STAT);
-               if (lpa2  & PHY_B_1000S_MSF) {
-                       printk(KERN_ERR PFX "%s: master/slave fault",
-                              sky2->netdev->name);
-                       return -1;
-               }
-
-               if ((ctl2 & PHY_M_1000C_AFD) && (lpa2 & PHY_B_1000S_LP_FD))
-                       sky2->duplex = DUPLEX_FULL;
-               else
-                       sky2->duplex = DUPLEX_HALF;
-       } else {
-               u16 adv = gm_phy_read(hw, port, PHY_MARV_AUNE_ADV);
-               if ((aux & adv) & PHY_AN_FULL)
-                       sky2->duplex = DUPLEX_FULL;
-               else
-                       sky2->duplex = DUPLEX_HALF;
-       }
+       sky2->duplex = (aux & PHY_M_PS_FULL_DUP) ? DUPLEX_FULL : DUPLEX_HALF;
 
        /* Pause bits are offset (9..8) */
        if (hw->chip_id == CHIP_ID_YUKON_XL || hw->chip_id == CHIP_ID_YUKON_EC_U)
                aux >>= 6;
 
-       sky2->rx_pause = (aux & PHY_M_PS_RX_P_EN) != 0;
-       sky2->tx_pause = (aux & PHY_M_PS_TX_P_EN) != 0;
+       sky2->flow_status = sky2_flow(aux & PHY_M_PS_RX_P_EN,
+                                     aux & PHY_M_PS_TX_P_EN);
 
-       if (sky2->duplex == DUPLEX_HALF && sky2->speed != SPEED_1000
+       if (sky2->duplex == DUPLEX_HALF && sky2->speed < SPEED_1000
            && hw->chip_id != CHIP_ID_YUKON_EC_U)
-               sky2->rx_pause = sky2->tx_pause = 0;
+               sky2->flow_status = FC_NONE;
 
-       if (sky2->rx_pause || sky2->tx_pause)
+       if (aux & PHY_M_PS_RX_P_EN)
                sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_PAUSE_ON);
        else
                sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_PAUSE_OFF);
@@ -1750,13 +1739,13 @@ static void sky2_phy_intr(struct sky2_hw *hw, unsigned port)
        struct sky2_port *sky2 = netdev_priv(dev);
        u16 istatus, phystat;
 
+       if (!netif_running(dev))
+               return;
+
        spin_lock(&sky2->phy_lock);
        istatus = gm_phy_read(hw, port, PHY_MARV_INT_STAT);
        phystat = gm_phy_read(hw, port, PHY_MARV_PHY_STAT);
 
-       if (!netif_running(dev))
-               goto out;
-
        if (netif_msg_intr(sky2))
                printk(KERN_INFO PFX "%s: phy interrupt status 0x%x 0x%x\n",
                       sky2->netdev->name, istatus, phystat);
@@ -2016,6 +2005,10 @@ oversize:
 
 error:
        ++sky2->net_stats.rx_errors;
+       if (status & GMR_FS_RX_FF_OV) {
+               sky2->net_stats.rx_fifo_errors++;
+               goto resubmit;
+       }
 
        if (netif_msg_rx_err(sky2) && net_ratelimit())
                printk(KERN_INFO PFX "%s: rx error, status 0x%x length %d\n",
@@ -2027,8 +2020,6 @@ error:
                sky2->net_stats.rx_frame_errors++;
        if (status & GMR_FS_CRC_ERR)
                sky2->net_stats.rx_crc_errors++;
-       if (status & GMR_FS_RX_FF_OV)
-               sky2->net_stats.rx_fifo_errors++;
 
        goto resubmit;
 }
@@ -2748,7 +2739,7 @@ static int sky2_nway_reset(struct net_device *dev)
 {
        struct sky2_port *sky2 = netdev_priv(dev);
 
-       if (sky2->autoneg != AUTONEG_ENABLE)
+       if (!netif_running(dev) || sky2->autoneg != AUTONEG_ENABLE)
                return -EINVAL;
 
        sky2_phy_reinit(sky2);
@@ -2850,6 +2841,14 @@ static int sky2_set_mac_address(struct net_device *dev, void *p)
        return 0;
 }
 
+static void inline sky2_add_filter(u8 filter[8], const u8 *addr)
+{
+       u32 bit;
+
+       bit = ether_crc(ETH_ALEN, addr) & 63;
+       filter[bit >> 3] |= 1 << (bit & 7);
+}
+
 static void sky2_set_multicast(struct net_device *dev)
 {
        struct sky2_port *sky2 = netdev_priv(dev);
@@ -2858,7 +2857,10 @@ static void sky2_set_multicast(struct net_device *dev)
        struct dev_mc_list *list = dev->mc_list;
        u16 reg;
        u8 filter[8];
+       int rx_pause;
+       static const u8 pause_mc_addr[ETH_ALEN] = { 0x1, 0x80, 0xc2, 0x0, 0x0, 0x1 };
 
+       rx_pause = (sky2->flow_status == FC_RX || sky2->flow_status == FC_BOTH);
        memset(filter, 0, sizeof(filter));
 
        reg = gma_read16(hw, port, GM_RX_CTRL);
@@ -2866,18 +2868,19 @@ static void sky2_set_multicast(struct net_device *dev)
 
        if (dev->flags & IFF_PROMISC)   /* promiscuous */
                reg &= ~(GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA);
-       else if ((dev->flags & IFF_ALLMULTI) || dev->mc_count > 16)     /* all multicast */
+       else if (dev->flags & IFF_ALLMULTI)
                memset(filter, 0xff, sizeof(filter));
-       else if (dev->mc_count == 0)    /* no multicast */
+       else if (dev->mc_count == 0 && !rx_pause)
                reg &= ~GM_RXCR_MCF_ENA;
        else {
                int i;
                reg |= GM_RXCR_MCF_ENA;
 
-               for (i = 0; list && i < dev->mc_count; i++, list = list->next) {
-                       u32 bit = ether_crc(ETH_ALEN, list->dmi_addr) & 0x3f;
-                       filter[bit / 8] |= 1 << (bit % 8);
-               }
+               if (rx_pause)
+                       sky2_add_filter(filter, pause_mc_addr);
+
+               for (i = 0; list && i < dev->mc_count; i++, list = list->next)
+                       sky2_add_filter(filter, list->dmi_addr);
        }
 
        gma_write16(hw, port, GM_MC_ADDR_H1,
@@ -2990,8 +2993,20 @@ static void sky2_get_pauseparam(struct net_device *dev,
 {
        struct sky2_port *sky2 = netdev_priv(dev);
 
-       ecmd->tx_pause = sky2->tx_pause;
-       ecmd->rx_pause = sky2->rx_pause;
+       switch (sky2->flow_mode) {
+       case FC_NONE:
+               ecmd->tx_pause = ecmd->rx_pause = 0;
+               break;
+       case FC_TX:
+               ecmd->tx_pause = 1, ecmd->rx_pause = 0;
+               break;
+       case FC_RX:
+               ecmd->tx_pause = 0, ecmd->rx_pause = 1;
+               break;
+       case FC_BOTH:
+               ecmd->tx_pause = ecmd->rx_pause = 1;
+       }
+
        ecmd->autoneg = sky2->autoneg;
 }
 
@@ -3001,10 +3016,10 @@ static int sky2_set_pauseparam(struct net_device *dev,
        struct sky2_port *sky2 = netdev_priv(dev);
 
        sky2->autoneg = ecmd->autoneg;
-       sky2->tx_pause = ecmd->tx_pause != 0;
-       sky2->rx_pause = ecmd->rx_pause != 0;
+       sky2->flow_mode = sky2_flow(ecmd->rx_pause, ecmd->tx_pause);
 
-       sky2_phy_reinit(sky2);
+       if (netif_running(dev))
+               sky2_phy_reinit(sky2);
 
        return 0;
 }
@@ -3234,8 +3249,8 @@ static __devinit struct net_device *sky2_init_netdev(struct sky2_hw *hw,
 
        /* Auto speed and flow control */
        sky2->autoneg = AUTONEG_ENABLE;
-       sky2->tx_pause = 1;
-       sky2->rx_pause = 1;
+       sky2->flow_mode = FC_BOTH;
+
        sky2->duplex = -1;
        sky2->speed = -1;
        sky2->advertising = sky2_supported_modes(hw);
@@ -3326,9 +3341,8 @@ static int __devinit sky2_test_msi(struct sky2_hw *hw)
 
        if (!hw->msi_detected) {
                /* MSI test failed, go back to INTx mode */
-               printk(KERN_WARNING PFX "%s: No interrupt was generated using MSI, "
-                      "switching to INTx mode. Please report this failure to "
-                      "the PCI maintainer and include system chipset information.\n",
+               printk(KERN_INFO PFX "%s: No interrupt generated using MSI, "
+                      "switching to INTx mode.\n",
                       pci_name(pdev));
 
                err = -EOPNOTSUPP;
@@ -3336,6 +3350,7 @@ static int __devinit sky2_test_msi(struct sky2_hw *hw)
        }
 
        sky2_write32(hw, B0_IMSK, 0);
+       sky2_read32(hw, B0_IMSK);
 
        free_irq(pdev->irq, hw);
 
index 43d2accf60e12ccdbfaf57c4e166c30492936dd3..6d2a23f66c9ae1e8ca41879ecc8134a86b56edf2 100644 (file)
@@ -1576,7 +1576,7 @@ enum {
 
        GMR_FS_ANY_ERR  = GMR_FS_RX_FF_OV | GMR_FS_CRC_ERR |
                          GMR_FS_FRAGMENT | GMR_FS_LONG_ERR |
-                         GMR_FS_MII_ERR | GMR_FS_BAD_FC |
+                         GMR_FS_MII_ERR | GMR_FS_GOOD_FC | GMR_FS_BAD_FC |
                          GMR_FS_UN_SIZE | GMR_FS_JABBER,
 };
 
@@ -1828,6 +1828,13 @@ struct rx_ring_info {
        dma_addr_t      frag_addr[ETH_JUMBO_MTU >> PAGE_SHIFT];
 };
 
+enum flow_control {
+       FC_NONE = 0,
+       FC_TX   = 1,
+       FC_RX   = 2,
+       FC_BOTH = 3,
+};
+
 struct sky2_port {
        struct sky2_hw       *hw;
        struct net_device    *netdev;
@@ -1860,13 +1867,13 @@ struct sky2_port {
 
        dma_addr_t           rx_le_map;
        dma_addr_t           tx_le_map;
-       u32                  advertising;       /* ADVERTISED_ bits */
+       u16                  advertising;       /* ADVERTISED_ bits */
        u16                  speed;     /* SPEED_1000, SPEED_100, ... */
        u8                   autoneg;   /* AUTONEG_ENABLE, AUTONEG_DISABLE */
        u8                   duplex;    /* DUPLEX_HALF, DUPLEX_FULL */
-       u8                   rx_pause;
-       u8                   tx_pause;
        u8                   rx_csum;
+       enum flow_control    flow_mode;
+       enum flow_control    flow_status;
 
        struct net_device_stats net_stats;
 
index 0c9f1e7dab2e8de01277bef61c3f7b072792ca9b..a8640169fc77afede8c7f28376ccc8967b214668 100644 (file)
@@ -416,6 +416,24 @@ static inline void LPD7_SMC_outsw (unsigned char* a, int r,
 
 #define SMC_IRQ_FLAGS          (0)
 
+#elif  defined(CONFIG_ARCH_VERSATILE)
+
+#define SMC_CAN_USE_8BIT       1
+#define SMC_CAN_USE_16BIT      1
+#define SMC_CAN_USE_32BIT      1
+#define SMC_NOWAIT             1
+
+#define SMC_inb(a, r)          readb((a) + (r))
+#define SMC_inw(a, r)          readw((a) + (r))
+#define SMC_inl(a, r)          readl((a) + (r))
+#define SMC_outb(v, a, r)      writeb(v, (a) + (r))
+#define SMC_outw(v, a, r)      writew(v, (a) + (r))
+#define SMC_outl(v, a, r)      writel(v, (a) + (r))
+#define SMC_insl(a, r, p, l)   readsl((a) + (r), p, l)
+#define SMC_outsl(a, r, p, l)  writesl((a) + (r), p, l)
+
+#define SMC_IRQ_FLAGS          (0)
+
 #else
 
 #define SMC_CAN_USE_8BIT       1
index 6439b0cef1e4ba9f0124d43eaa196256f1c73095..18f88853e1e583efd38b1f8368dd17ecff873489 100644 (file)
@@ -42,7 +42,7 @@
 #define DRV_RELDATE    "11/24/03"
 #define DRV_AUTHOR     "David S. Miller (davem@redhat.com)"
 
-static char version[] __initdata =
+static char version[] =
        DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " " DRV_AUTHOR "\n";
 
 MODULE_VERSION(DRV_VERSION);
index 327836b1014e76fc55a8ec7e3c87d20b5070e808..8e398499c0456ab2ea07b2d63acf702aaa2498dd 100644 (file)
@@ -68,8 +68,8 @@
 
 #define DRV_MODULE_NAME                "tg3"
 #define PFX DRV_MODULE_NAME    ": "
-#define DRV_MODULE_VERSION     "3.66"
-#define DRV_MODULE_RELDATE     "September 23, 2006"
+#define DRV_MODULE_VERSION     "3.67"
+#define DRV_MODULE_RELDATE     "October 18, 2006"
 
 #define TG3_DEF_MAC_MODE       0
 #define TG3_DEF_RX_MODE                0
 #define RX_JUMBO_PKT_BUF_SZ    (9046 + tp->rx_offset + 64)
 
 /* minimum number of free TX descriptors required to wake up TX process */
-#define TG3_TX_WAKEUP_THRESH           (TG3_TX_RING_SIZE / 4)
+#define TG3_TX_WAKEUP_THRESH(tp)               ((tp)->tx_pending / 4)
 
 /* number of ETHTOOL_GSTATS u64's */
 #define TG3_NUM_STATS          (sizeof(struct tg3_ethtool_stats)/sizeof(u64))
@@ -3075,10 +3075,10 @@ static void tg3_tx(struct tg3 *tp)
        smp_mb();
 
        if (unlikely(netif_queue_stopped(tp->dev) &&
-                    (tg3_tx_avail(tp) > TG3_TX_WAKEUP_THRESH))) {
+                    (tg3_tx_avail(tp) > TG3_TX_WAKEUP_THRESH(tp)))) {
                netif_tx_lock(tp->dev);
                if (netif_queue_stopped(tp->dev) &&
-                   (tg3_tx_avail(tp) > TG3_TX_WAKEUP_THRESH))
+                   (tg3_tx_avail(tp) > TG3_TX_WAKEUP_THRESH(tp)))
                        netif_wake_queue(tp->dev);
                netif_tx_unlock(tp->dev);
        }
@@ -3928,7 +3928,7 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
        tp->tx_prod = entry;
        if (unlikely(tg3_tx_avail(tp) <= (MAX_SKB_FRAGS + 1))) {
                netif_stop_queue(dev);
-               if (tg3_tx_avail(tp) > TG3_TX_WAKEUP_THRESH)
+               if (tg3_tx_avail(tp) > TG3_TX_WAKEUP_THRESH(tp))
                        netif_wake_queue(tp->dev);
        }
 
@@ -4143,7 +4143,7 @@ static int tg3_start_xmit_dma_bug(struct sk_buff *skb, struct net_device *dev)
        tp->tx_prod = entry;
        if (unlikely(tg3_tx_avail(tp) <= (MAX_SKB_FRAGS + 1))) {
                netif_stop_queue(dev);
-               if (tg3_tx_avail(tp) > TG3_TX_WAKEUP_THRESH)
+               if (tg3_tx_avail(tp) > TG3_TX_WAKEUP_THRESH(tp))
                        netif_wake_queue(tp->dev);
        }
 
@@ -8106,7 +8106,10 @@ static int tg3_set_ringparam(struct net_device *dev, struct ethtool_ringparam *e
 
        if ((ering->rx_pending > TG3_RX_RING_SIZE - 1) ||
            (ering->rx_jumbo_pending > TG3_RX_JUMBO_RING_SIZE - 1) ||
-           (ering->tx_pending > TG3_TX_RING_SIZE - 1))
+           (ering->tx_pending > TG3_TX_RING_SIZE - 1) ||
+           (ering->tx_pending <= MAX_SKB_FRAGS) ||
+           ((tp->tg3_flags2 & TG3_FLG2_HW_TSO_1_BUG) &&
+            (ering->tx_pending <= (MAX_SKB_FRAGS * 3))))
                return -EINVAL;
 
        if (netif_running(dev)) {
index 12cd7b561f35aba401769575f34d17a13883c32e..b37888011067f2711b8b954213a7e86243ac788c 100644 (file)
@@ -2,14 +2,11 @@
  * Copyright (C) Freescale Semicondutor, Inc. 2006. All rights reserved.
  *
  * Author: Shlomi Gridish <gridish@freescale.com>
+ *        Li Yang <leoli@freescale.com>
  *
  * Description:
  * QE UCC Gigabit Ethernet Driver
  *
- * Changelog:
- * Jul 6, 2006 Li Yang <LeoLi@freescale.com>
- * - Rearrange code and style fixes
- *
  * This program is free software; you can redistribute  it and/or modify it
  * under  the terms of  the GNU General  Public License as published by the
  * Free Software Foundation;  either version 2 of the  License, or (at your
@@ -31,9 +28,9 @@
 #include <linux/dma-mapping.h>
 #include <linux/fsl_devices.h>
 #include <linux/ethtool.h>
-#include <linux/platform_device.h>
 #include <linux/mii.h>
 
+#include <asm/of_device.h>
 #include <asm/uaccess.h>
 #include <asm/irq.h>
 #include <asm/io.h>
@@ -70,7 +67,7 @@
 
 static DEFINE_SPINLOCK(ugeth_lock);
 
-static ucc_geth_info_t ugeth_primary_info = {
+static struct ucc_geth_info ugeth_primary_info = {
        .uf_info = {
                    .bd_mem_part = MEM_PART_SYSTEM,
                    .rtsm = UCC_FAST_SEND_IDLES_BETWEEN_FRAMES,
@@ -163,7 +160,7 @@ static ucc_geth_info_t ugeth_primary_info = {
        .riscRx = QE_RISC_ALLOCATION_RISC1_AND_RISC2,
 };
 
-static ucc_geth_info_t ugeth_info[8];
+static struct ucc_geth_info ugeth_info[8];
 
 #ifdef DEBUG
 static void mem_disp(u8 *addr, int size)
@@ -219,8 +216,8 @@ static struct list_head *dequeue(struct list_head *lh)
        }
 }
 
-static int get_interface_details(enet_interface_e enet_interface,
-                                enet_speed_e *speed,
+static int get_interface_details(enum enet_interface enet_interface,
+                                enum enet_speed *speed,
                                 int *r10m,
                                 int *rmm,
                                 int *rpm,
@@ -283,7 +280,7 @@ static int get_interface_details(enet_interface_e enet_interface,
        return 0;
 }
 
-static struct sk_buff *get_new_skb(ucc_geth_private_t *ugeth, u8 *bd)
+static struct sk_buff *get_new_skb(struct ucc_geth_private *ugeth, u8 *bd)
 {
        struct sk_buff *skb = NULL;
 
@@ -303,21 +300,19 @@ static struct sk_buff *get_new_skb(ucc_geth_private_t *ugeth, u8 *bd)
 
        skb->dev = ugeth->dev;
 
-       BD_BUFFER_SET(bd,
+       out_be32(&((struct qe_bd *)bd)->buf,
                      dma_map_single(NULL,
                                     skb->data,
                                     ugeth->ug_info->uf_info.max_rx_buf_length +
                                     UCC_GETH_RX_DATA_BUF_ALIGNMENT,
                                     DMA_FROM_DEVICE));
 
-       BD_STATUS_AND_LENGTH_SET(bd,
-                                (R_E | R_I |
-                                 (BD_STATUS_AND_LENGTH(bd) & R_W)));
+       out_be32((u32 *)bd, (R_E | R_I | (in_be32((u32 *)bd) & R_W)));
 
        return skb;
 }
 
-static int rx_bd_buffer_set(ucc_geth_private_t *ugeth, u8 rxQ)
+static int rx_bd_buffer_set(struct ucc_geth_private *ugeth, u8 rxQ)
 {
        u8 *bd;
        u32 bd_status;
@@ -328,7 +323,7 @@ static int rx_bd_buffer_set(ucc_geth_private_t *ugeth, u8 rxQ)
        i = 0;
 
        do {
-               bd_status = BD_STATUS_AND_LENGTH(bd);
+               bd_status = in_be32((u32*)bd);
                skb = get_new_skb(ugeth, bd);
 
                if (!skb)       /* If can not allocate data buffer,
@@ -338,19 +333,19 @@ static int rx_bd_buffer_set(ucc_geth_private_t *ugeth, u8 rxQ)
                ugeth->rx_skbuff[rxQ][i] = skb;
 
                /* advance the BD pointer */
-               bd += UCC_GETH_SIZE_OF_BD;
+               bd += sizeof(struct qe_bd);
                i++;
        } while (!(bd_status & R_W));
 
        return 0;
 }
 
-static int fill_init_enet_entries(ucc_geth_private_t *ugeth,
+static int fill_init_enet_entries(struct ucc_geth_private *ugeth,
                                  volatile u32 *p_start,
                                  u8 num_entries,
                                  u32 thread_size,
                                  u32 thread_alignment,
-                                 qe_risc_allocation_e risc,
+                                 enum qe_risc_allocation risc,
                                  int skip_page_for_first_entry)
 {
        u32 init_enet_offset;
@@ -383,10 +378,10 @@ static int fill_init_enet_entries(ucc_geth_private_t *ugeth,
        return 0;
 }
 
-static int return_init_enet_entries(ucc_geth_private_t *ugeth,
+static int return_init_enet_entries(struct ucc_geth_private *ugeth,
                                    volatile u32 *p_start,
                                    u8 num_entries,
-                                   qe_risc_allocation_e risc,
+                                   enum qe_risc_allocation risc,
                                    int skip_page_for_first_entry)
 {
        u32 init_enet_offset;
@@ -416,11 +411,11 @@ static int return_init_enet_entries(ucc_geth_private_t *ugeth,
 }
 
 #ifdef DEBUG
-static int dump_init_enet_entries(ucc_geth_private_t *ugeth,
+static int dump_init_enet_entries(struct ucc_geth_private *ugeth,
                                  volatile u32 *p_start,
                                  u8 num_entries,
                                  u32 thread_size,
-                                 qe_risc_allocation_e risc,
+                                 enum qe_risc_allocation risc,
                                  int skip_page_for_first_entry)
 {
        u32 init_enet_offset;
@@ -456,14 +451,14 @@ static int dump_init_enet_entries(ucc_geth_private_t *ugeth,
 #endif
 
 #ifdef CONFIG_UGETH_FILTERING
-static enet_addr_container_t *get_enet_addr_container(void)
+static struct enet_addr_container *get_enet_addr_container(void)
 {
-       enet_addr_container_t *enet_addr_cont;
+       struct enet_addr_container *enet_addr_cont;
 
        /* allocate memory */
-       enet_addr_cont = kmalloc(sizeof(enet_addr_container_t), GFP_KERNEL);
+       enet_addr_cont = kmalloc(sizeof(struct enet_addr_container), GFP_KERNEL);
        if (!enet_addr_cont) {
-               ugeth_err("%s: No memory for enet_addr_container_t object.",
+               ugeth_err("%s: No memory for enet_addr_container object.",
                          __FUNCTION__);
                return NULL;
        }
@@ -472,45 +467,43 @@ static enet_addr_container_t *get_enet_addr_container(void)
 }
 #endif /* CONFIG_UGETH_FILTERING */
 
-static void put_enet_addr_container(enet_addr_container_t *enet_addr_cont)
+static void put_enet_addr_container(struct enet_addr_container *enet_addr_cont)
 {
        kfree(enet_addr_cont);
 }
 
+static int set_mac_addr(__be16 __iomem *reg, u8 *mac)
+{
+       out_be16(&reg[0], ((u16)mac[5] << 8) | mac[4]);
+       out_be16(&reg[1], ((u16)mac[3] << 8) | mac[2]);
+       out_be16(&reg[2], ((u16)mac[1] << 8) | mac[0]);
+}
+
 #ifdef CONFIG_UGETH_FILTERING
-static int hw_add_addr_in_paddr(ucc_geth_private_t *ugeth,
-                               enet_addr_t *p_enet_addr, u8 paddr_num)
+static int hw_add_addr_in_paddr(struct ucc_geth_private *ugeth,
+                                u8 *p_enet_addr, u8 paddr_num)
 {
-       ucc_geth_82xx_address_filtering_pram_t *p_82xx_addr_filt;
+       struct ucc_geth_82xx_address_filtering_pram *p_82xx_addr_filt;
 
        if (!(paddr_num < NUM_OF_PADDRS)) {
-               ugeth_warn("%s: Illagel paddr_num.", __FUNCTION__);
+               ugeth_warn("%s: Illegal paddr_num.", __FUNCTION__);
                return -EINVAL;
        }
 
        p_82xx_addr_filt =
-           (ucc_geth_82xx_address_filtering_pram_t *) ugeth->p_rx_glbl_pram->
+           (struct ucc_geth_82xx_address_filtering_pram *) ugeth->p_rx_glbl_pram->
            addressfiltering;
 
        /* Ethernet frames are defined in Little Endian mode,    */
        /* therefore to insert the address we reverse the bytes. */
-       out_be16(&p_82xx_addr_filt->paddr[paddr_num].h,
-                (u16) (((u16) (((u16) ((*p_enet_addr)[5])) << 8)) |
-                       (u16) (*p_enet_addr)[4]));
-       out_be16(&p_82xx_addr_filt->paddr[paddr_num].m,
-                (u16) (((u16) (((u16) ((*p_enet_addr)[3])) << 8)) |
-                       (u16) (*p_enet_addr)[2]));
-       out_be16(&p_82xx_addr_filt->paddr[paddr_num].l,
-                (u16) (((u16) (((u16) ((*p_enet_addr)[1])) << 8)) |
-                       (u16) (*p_enet_addr)[0]));
-
+       set_mac_addr(&p_82xx_addr_filt->paddr[paddr_num].h, p_enet_addr);
        return 0;
 }
 #endif /* CONFIG_UGETH_FILTERING */
 
-static int hw_clear_addr_in_paddr(ucc_geth_private_t *ugeth, u8 paddr_num)
+static int hw_clear_addr_in_paddr(struct ucc_geth_private *ugeth, u8 paddr_num)
 {
-       ucc_geth_82xx_address_filtering_pram_t *p_82xx_addr_filt;
+       struct ucc_geth_82xx_address_filtering_pram *p_82xx_addr_filt;
 
        if (!(paddr_num < NUM_OF_PADDRS)) {
                ugeth_warn("%s: Illagel paddr_num.", __FUNCTION__);
@@ -518,7 +511,7 @@ static int hw_clear_addr_in_paddr(ucc_geth_private_t *ugeth, u8 paddr_num)
        }
 
        p_82xx_addr_filt =
-           (ucc_geth_82xx_address_filtering_pram_t *) ugeth->p_rx_glbl_pram->
+           (struct ucc_geth_82xx_address_filtering_pram *) ugeth->p_rx_glbl_pram->
            addressfiltering;
 
        /* Writing address ff.ff.ff.ff.ff.ff disables address
@@ -530,14 +523,14 @@ static int hw_clear_addr_in_paddr(ucc_geth_private_t *ugeth, u8 paddr_num)
        return 0;
 }
 
-static void hw_add_addr_in_hash(ucc_geth_private_t *ugeth,
-                               enet_addr_t *p_enet_addr)
+static void hw_add_addr_in_hash(struct ucc_geth_private *ugeth,
+                                u8 *p_enet_addr)
 {
-       ucc_geth_82xx_address_filtering_pram_t *p_82xx_addr_filt;
+       struct ucc_geth_82xx_address_filtering_pram *p_82xx_addr_filt;
        u32 cecr_subblock;
 
        p_82xx_addr_filt =
-           (ucc_geth_82xx_address_filtering_pram_t *) ugeth->p_rx_glbl_pram->
+           (struct ucc_geth_82xx_address_filtering_pram *) ugeth->p_rx_glbl_pram->
            addressfiltering;
 
        cecr_subblock =
@@ -546,25 +539,18 @@ static void hw_add_addr_in_hash(ucc_geth_private_t *ugeth,
        /* Ethernet frames are defined in Little Endian mode,
        therefor to insert */
        /* the address to the hash (Big Endian mode), we reverse the bytes.*/
-       out_be16(&p_82xx_addr_filt->taddr.h,
-                (u16) (((u16) (((u16) ((*p_enet_addr)[5])) << 8)) |
-                       (u16) (*p_enet_addr)[4]));
-       out_be16(&p_82xx_addr_filt->taddr.m,
-                (u16) (((u16) (((u16) ((*p_enet_addr)[3])) << 8)) |
-                       (u16) (*p_enet_addr)[2]));
-       out_be16(&p_82xx_addr_filt->taddr.l,
-                (u16) (((u16) (((u16) ((*p_enet_addr)[1])) << 8)) |
-                       (u16) (*p_enet_addr)[0]));
+
+       set_mac_addr(&p_82xx_addr_filt->taddr.h, p_enet_addr);
 
        qe_issue_cmd(QE_SET_GROUP_ADDRESS, cecr_subblock,
-                    (u8) QE_CR_PROTOCOL_ETHERNET, 0);
+                    QE_CR_PROTOCOL_ETHERNET, 0);
 }
 
 #ifdef CONFIG_UGETH_MAGIC_PACKET
-static void magic_packet_detection_enable(ucc_geth_private_t *ugeth)
+static void magic_packet_detection_enable(struct ucc_geth_private *ugeth)
 {
-       ucc_fast_private_t *uccf;
-       ucc_geth_t *ug_regs;
+       struct ucc_fast_private *uccf;
+       struct ucc_geth *ug_regs;
        u32 maccfg2, uccm;
 
        uccf = ugeth->uccf;
@@ -581,10 +567,10 @@ static void magic_packet_detection_enable(ucc_geth_private_t *ugeth)
        out_be32(&ug_regs->maccfg2, maccfg2);
 }
 
-static void magic_packet_detection_disable(ucc_geth_private_t *ugeth)
+static void magic_packet_detection_disable(struct ucc_geth_private *ugeth)
 {
-       ucc_fast_private_t *uccf;
-       ucc_geth_t *ug_regs;
+       struct ucc_fast_private *uccf;
+       struct ucc_geth *ug_regs;
        u32 maccfg2, uccm;
 
        uccf = ugeth->uccf;
@@ -602,26 +588,26 @@ static void magic_packet_detection_disable(ucc_geth_private_t *ugeth)
 }
 #endif /* MAGIC_PACKET */
 
-static inline int compare_addr(enet_addr_t *addr1, enet_addr_t *addr2)
+static inline int compare_addr(u8 **addr1, u8 **addr2)
 {
        return memcmp(addr1, addr2, ENET_NUM_OCTETS_PER_ADDRESS);
 }
 
 #ifdef DEBUG
-static void get_statistics(ucc_geth_private_t *ugeth,
-                          ucc_geth_tx_firmware_statistics_t *
+static void get_statistics(struct ucc_geth_private *ugeth,
+                          struct ucc_geth_tx_firmware_statistics *
                           tx_firmware_statistics,
-                          ucc_geth_rx_firmware_statistics_t *
+                          struct ucc_geth_rx_firmware_statistics *
                           rx_firmware_statistics,
-                          ucc_geth_hardware_statistics_t *hardware_statistics)
+                          struct ucc_geth_hardware_statistics *hardware_statistics)
 {
-       ucc_fast_t *uf_regs;
-       ucc_geth_t *ug_regs;
-       ucc_geth_tx_firmware_statistics_pram_t *p_tx_fw_statistics_pram;
-       ucc_geth_rx_firmware_statistics_pram_t *p_rx_fw_statistics_pram;
+       struct ucc_fast *uf_regs;
+       struct ucc_geth *ug_regs;
+       struct ucc_geth_tx_firmware_statistics_pram *p_tx_fw_statistics_pram;
+       struct ucc_geth_rx_firmware_statistics_pram *p_rx_fw_statistics_pram;
 
        ug_regs = ugeth->ug_regs;
-       uf_regs = (ucc_fast_t *) ug_regs;
+       uf_regs = (struct ucc_fast *) ug_regs;
        p_tx_fw_statistics_pram = ugeth->p_tx_fw_statistics_pram;
        p_rx_fw_statistics_pram = ugeth->p_rx_fw_statistics_pram;
 
@@ -727,7 +713,7 @@ static void get_statistics(ucc_geth_private_t *ugeth,
        }
 }
 
-static void dump_bds(ucc_geth_private_t *ugeth)
+static void dump_bds(struct ucc_geth_private *ugeth)
 {
        int i;
        int length;
@@ -736,7 +722,7 @@ static void dump_bds(ucc_geth_private_t *ugeth)
                if (ugeth->p_tx_bd_ring[i]) {
                        length =
                            (ugeth->ug_info->bdRingLenTx[i] *
-                            UCC_GETH_SIZE_OF_BD);
+                            sizeof(struct qe_bd));
                        ugeth_info("TX BDs[%d]", i);
                        mem_disp(ugeth->p_tx_bd_ring[i], length);
                }
@@ -745,14 +731,14 @@ static void dump_bds(ucc_geth_private_t *ugeth)
                if (ugeth->p_rx_bd_ring[i]) {
                        length =
                            (ugeth->ug_info->bdRingLenRx[i] *
-                            UCC_GETH_SIZE_OF_BD);
+                            sizeof(struct qe_bd));
                        ugeth_info("RX BDs[%d]", i);
                        mem_disp(ugeth->p_rx_bd_ring[i], length);
                }
        }
 }
 
-static void dump_regs(ucc_geth_private_t *ugeth)
+static void dump_regs(struct ucc_geth_private *ugeth)
 {
        int i;
 
@@ -893,7 +879,7 @@ static void dump_regs(ucc_geth_private_t *ugeth)
                        ugeth_info("Base address: 0x%08x",
                                   (u32) & ugeth->p_thread_data_tx[i]);
                        mem_disp((u8 *) & ugeth->p_thread_data_tx[i],
-                                sizeof(ucc_geth_thread_data_tx_t));
+                                sizeof(struct ucc_geth_thread_data_tx));
                }
        }
        if (ugeth->p_thread_data_rx) {
@@ -927,7 +913,7 @@ static void dump_regs(ucc_geth_private_t *ugeth)
                        ugeth_info("Base address: 0x%08x",
                                   (u32) & ugeth->p_thread_data_rx[i]);
                        mem_disp((u8 *) & ugeth->p_thread_data_rx[i],
-                                sizeof(ucc_geth_thread_data_rx_t));
+                                sizeof(struct ucc_geth_thread_data_rx));
                }
        }
        if (ugeth->p_exf_glbl_param) {
@@ -1105,7 +1091,7 @@ static void dump_regs(ucc_geth_private_t *ugeth)
                        ugeth_info("Base address: 0x%08x",
                                   (u32) & ugeth->p_send_q_mem_reg->sqqd[i]);
                        mem_disp((u8 *) & ugeth->p_send_q_mem_reg->sqqd[i],
-                                sizeof(ucc_geth_send_queue_qd_t));
+                                sizeof(struct ucc_geth_send_queue_qd));
                }
        }
        if (ugeth->p_scheduler) {
@@ -1187,7 +1173,7 @@ static void dump_regs(ucc_geth_private_t *ugeth)
                                 qe_muram_addr(in_be32
                                               (&ugeth->p_rx_bd_qs_tbl[i].
                                                bdbaseptr)),
-                                sizeof(ucc_geth_rx_prefetched_bds_t));
+                                sizeof(struct ucc_geth_rx_prefetched_bds));
                }
        }
        if (ugeth->p_init_enet_param_shadow) {
@@ -1198,7 +1184,7 @@ static void dump_regs(ucc_geth_private_t *ugeth)
                mem_disp((u8 *) ugeth->p_init_enet_param_shadow,
                         sizeof(*ugeth->p_init_enet_param_shadow));
 
-               size = sizeof(ucc_geth_thread_rx_pram_t);
+               size = sizeof(struct ucc_geth_thread_rx_pram);
                if (ugeth->ug_info->rxExtendedFiltering) {
                        size +=
                            THREAD_RX_PRAM_ADDITIONAL_FOR_EXTENDED_FILTERING;
@@ -1216,7 +1202,7 @@ static void dump_regs(ucc_geth_private_t *ugeth)
                                       &(ugeth->p_init_enet_param_shadow->
                                         txthread[0]),
                                       ENET_INIT_PARAM_MAX_ENTRIES_TX,
-                                      sizeof(ucc_geth_thread_tx_pram_t),
+                                      sizeof(struct ucc_geth_thread_tx_pram),
                                       ugeth->ug_info->riscTx, 0);
                dump_init_enet_entries(ugeth,
                                       &(ugeth->p_init_enet_param_shadow->
@@ -1578,12 +1564,12 @@ static int init_min_frame_len(u16 min_frame_length,
        return 0;
 }
 
-static int adjust_enet_interface(ucc_geth_private_t *ugeth)
+static int adjust_enet_interface(struct ucc_geth_private *ugeth)
 {
-       ucc_geth_info_t *ug_info;
-       ucc_geth_t *ug_regs;
-       ucc_fast_t *uf_regs;
-       enet_speed_e speed;
+       struct ucc_geth_info *ug_info;
+       struct ucc_geth *ug_regs;
+       struct ucc_fast *uf_regs;
+       enum enet_speed speed;
        int ret_val, rpm = 0, tbi = 0, r10m = 0, rmm =
            0, limited_to_full_duplex = 0;
        u32 upsmr, maccfg2, utbipar, tbiBaseAddress;
@@ -1691,8 +1677,8 @@ static int adjust_enet_interface(ucc_geth_private_t *ugeth)
  */
 static void adjust_link(struct net_device *dev)
 {
-       ucc_geth_private_t *ugeth = netdev_priv(dev);
-       ucc_geth_t *ug_regs;
+       struct ucc_geth_private *ugeth = netdev_priv(dev);
+       struct ucc_geth *ug_regs;
        u32 tempval;
        struct ugeth_mii_info *mii_info = ugeth->mii_info;
 
@@ -1722,7 +1708,7 @@ static void adjust_link(struct net_device *dev)
                if (mii_info->speed != ugeth->oldspeed) {
                        switch (mii_info->speed) {
                        case 1000:
-#ifdef CONFIG_MPC836x
+#ifdef CONFIG_PPC_MPC836x
 /* FIXME: This code is for 100Mbs BUG fixing,
 remove this when it is fixed!!! */
                                if (ugeth->ug_info->enet_interface ==
@@ -1768,7 +1754,7 @@ remove this when it is fixed!!! */
                                break;
                        case 100:
                        case 10:
-#ifdef CONFIG_MPC836x
+#ifdef CONFIG_PPC_MPC836x
 /* FIXME: This code is for 100Mbs BUG fixing,
 remove this lines when it will be fixed!!! */
                                ugeth->ug_info->enet_interface = ENET_100_RGMII;
@@ -1827,9 +1813,9 @@ remove this lines when it will be fixed!!! */
  */
 static int init_phy(struct net_device *dev)
 {
-       ucc_geth_private_t *ugeth = netdev_priv(dev);
+       struct ucc_geth_private *ugeth = netdev_priv(dev);
        struct phy_info *curphy;
-       ucc_mii_mng_t *mii_regs;
+       struct ucc_mii_mng *mii_regs;
        struct ugeth_mii_info *mii_info;
        int err;
 
@@ -1914,17 +1900,17 @@ static int init_phy(struct net_device *dev)
 }
 
 #ifdef CONFIG_UGETH_TX_ON_DEMOND
-static int ugeth_transmit_on_demand(ucc_geth_private_t *ugeth)
+static int ugeth_transmit_on_demand(struct ucc_geth_private *ugeth)
 {
-       ucc_fast_transmit_on_demand(ugeth->uccf);
+       struct ucc_fastransmit_on_demand(ugeth->uccf);
 
        return 0;
 }
 #endif
 
-static int ugeth_graceful_stop_tx(ucc_geth_private_t *ugeth)
+static int ugeth_graceful_stop_tx(struct ucc_geth_private *ugeth)
 {
-       ucc_fast_private_t *uccf;
+       struct ucc_fast_private *uccf;
        u32 cecr_subblock;
        u32 temp;
 
@@ -1940,7 +1926,7 @@ static int ugeth_graceful_stop_tx(ucc_geth_private_t *ugeth)
        cecr_subblock =
            ucc_fast_get_qe_cr_subblock(ugeth->ug_info->uf_info.ucc_num);
        qe_issue_cmd(QE_GRACEFUL_STOP_TX, cecr_subblock,
-                    (u8) QE_CR_PROTOCOL_ETHERNET, 0);
+                    QE_CR_PROTOCOL_ETHERNET, 0);
 
        /* Wait for command to complete */
        do {
@@ -1952,9 +1938,9 @@ static int ugeth_graceful_stop_tx(ucc_geth_private_t *ugeth)
        return 0;
 }
 
-static int ugeth_graceful_stop_rx(ucc_geth_private_t * ugeth)
+static int ugeth_graceful_stop_rx(struct ucc_geth_private * ugeth)
 {
-       ucc_fast_private_t *uccf;
+       struct ucc_fast_private *uccf;
        u32 cecr_subblock;
        u8 temp;
 
@@ -1973,7 +1959,7 @@ static int ugeth_graceful_stop_rx(ucc_geth_private_t * ugeth)
                    ucc_fast_get_qe_cr_subblock(ugeth->ug_info->uf_info.
                                                ucc_num);
                qe_issue_cmd(QE_GRACEFUL_STOP_RX, cecr_subblock,
-                            (u8) QE_CR_PROTOCOL_ETHERNET, 0);
+                            QE_CR_PROTOCOL_ETHERNET, 0);
 
                temp = ugeth->p_rx_glbl_pram->rxgstpack;
        } while (!(temp & GRACEFUL_STOP_ACKNOWLEDGE_RX));
@@ -1983,41 +1969,40 @@ static int ugeth_graceful_stop_rx(ucc_geth_private_t * ugeth)
        return 0;
 }
 
-static int ugeth_restart_tx(ucc_geth_private_t *ugeth)
+static int ugeth_restart_tx(struct ucc_geth_private *ugeth)
 {
-       ucc_fast_private_t *uccf;
+       struct ucc_fast_private *uccf;
        u32 cecr_subblock;
 
        uccf = ugeth->uccf;
 
        cecr_subblock =
            ucc_fast_get_qe_cr_subblock(ugeth->ug_info->uf_info.ucc_num);
-       qe_issue_cmd(QE_RESTART_TX, cecr_subblock, (u8) QE_CR_PROTOCOL_ETHERNET,
-                    0);
+       qe_issue_cmd(QE_RESTART_TX, cecr_subblock, QE_CR_PROTOCOL_ETHERNET, 0);
        uccf->stopped_tx = 0;
 
        return 0;
 }
 
-static int ugeth_restart_rx(ucc_geth_private_t *ugeth)
+static int ugeth_restart_rx(struct ucc_geth_private *ugeth)
 {
-       ucc_fast_private_t *uccf;
+       struct ucc_fast_private *uccf;
        u32 cecr_subblock;
 
        uccf = ugeth->uccf;
 
        cecr_subblock =
            ucc_fast_get_qe_cr_subblock(ugeth->ug_info->uf_info.ucc_num);
-       qe_issue_cmd(QE_RESTART_RX, cecr_subblock, (u8) QE_CR_PROTOCOL_ETHERNET,
+       qe_issue_cmd(QE_RESTART_RX, cecr_subblock, QE_CR_PROTOCOL_ETHERNET,
                     0);
        uccf->stopped_rx = 0;
 
        return 0;
 }
 
-static int ugeth_enable(ucc_geth_private_t *ugeth, comm_dir_e mode)
+static int ugeth_enable(struct ucc_geth_private *ugeth, enum comm_dir mode)
 {
-       ucc_fast_private_t *uccf;
+       struct ucc_fast_private *uccf;
        int enabled_tx, enabled_rx;
 
        uccf = ugeth->uccf;
@@ -2044,9 +2029,9 @@ static int ugeth_enable(ucc_geth_private_t *ugeth, comm_dir_e mode)
 
 }
 
-static int ugeth_disable(ucc_geth_private_t * ugeth, comm_dir_e mode)
+static int ugeth_disable(struct ucc_geth_private * ugeth, enum comm_dir mode)
 {
-       ucc_fast_private_t *uccf;
+       struct ucc_fast_private *uccf;
 
        uccf = ugeth->uccf;
 
@@ -2069,7 +2054,7 @@ static int ugeth_disable(ucc_geth_private_t * ugeth, comm_dir_e mode)
        return 0;
 }
 
-static void ugeth_dump_regs(ucc_geth_private_t *ugeth)
+static void ugeth_dump_regs(struct ucc_geth_private *ugeth)
 {
 #ifdef DEBUG
        ucc_fast_dump_regs(ugeth->uccf);
@@ -2079,9 +2064,9 @@ static void ugeth_dump_regs(ucc_geth_private_t *ugeth)
 }
 
 #ifdef CONFIG_UGETH_FILTERING
-static int ugeth_ext_filtering_serialize_tad(ucc_geth_tad_params_t *
+static int ugeth_ext_filtering_serialize_tad(struct ucc_geth_tad_params *
                                             p_UccGethTadParams,
-                                            qe_fltr_tad_t *qe_fltr_tad)
+                                            struct qe_fltr_tad *qe_fltr_tad)
 {
        u16 temp;
 
@@ -2119,11 +2104,11 @@ static int ugeth_ext_filtering_serialize_tad(ucc_geth_tad_params_t *
        return 0;
 }
 
-static enet_addr_container_t
-    *ugeth_82xx_filtering_get_match_addr_in_hash(ucc_geth_private_t *ugeth,
-                                                enet_addr_t *p_enet_addr)
+static struct enet_addr_container_t
+    *ugeth_82xx_filtering_get_match_addr_in_hash(struct ucc_geth_private *ugeth,
+                                                struct enet_addr *p_enet_addr)
 {
-       enet_addr_container_t *enet_addr_cont;
+       struct enet_addr_container *enet_addr_cont;
        struct list_head *p_lh;
        u16 i, num;
        int32_t j;
@@ -2144,7 +2129,7 @@ static enet_addr_container_t
 
        for (i = 0; i < num; i++) {
                enet_addr_cont =
-                   (enet_addr_container_t *)
+                   (struct enet_addr_container *)
                    ENET_ADDR_CONT_ENTRY(dequeue(p_lh));
                for (j = ENET_NUM_OCTETS_PER_ADDRESS - 1; j >= 0; j--) {
                        if ((*p_enet_addr)[j] != (enet_addr_cont->address)[j])
@@ -2157,11 +2142,11 @@ static enet_addr_container_t
        return NULL;
 }
 
-static int ugeth_82xx_filtering_add_addr_in_hash(ucc_geth_private_t *ugeth,
-                                                enet_addr_t *p_enet_addr)
+static int ugeth_82xx_filtering_add_addr_in_hash(struct ucc_geth_private *ugeth,
+                                                struct enet_addr *p_enet_addr)
 {
-       ucc_geth_enet_address_recognition_location_e location;
-       enet_addr_container_t *enet_addr_cont;
+       enum ucc_geth_enet_address_recognition_location location;
+       struct enet_addr_container *enet_addr_cont;
        struct list_head *p_lh;
        u8 i;
        u32 limit;
@@ -2196,18 +2181,17 @@ static int ugeth_82xx_filtering_add_addr_in_hash(ucc_geth_private_t *ugeth,
        enqueue(p_lh, &enet_addr_cont->node);   /* Put it back */
        ++(*p_counter);
 
-       hw_add_addr_in_hash(ugeth, &(enet_addr_cont->address));
-
+       hw_add_addr_in_hash(ugeth, enet_addr_cont->address);
        return 0;
 }
 
-static int ugeth_82xx_filtering_clear_addr_in_hash(ucc_geth_private_t *ugeth,
-                                                  enet_addr_t *p_enet_addr)
+static int ugeth_82xx_filtering_clear_addr_in_hash(struct ucc_geth_private *ugeth,
+                                                  struct enet_addr *p_enet_addr)
 {
-       ucc_geth_82xx_address_filtering_pram_t *p_82xx_addr_filt;
-       enet_addr_container_t *enet_addr_cont;
-       ucc_fast_private_t *uccf;
-       comm_dir_e comm_dir;
+       struct ucc_geth_82xx_address_filtering_pram *p_82xx_addr_filt;
+       struct enet_addr_container *enet_addr_cont;
+       struct ucc_fast_private *uccf;
+       enum comm_dir comm_dir;
        u16 i, num;
        struct list_head *p_lh;
        u32 *addr_h, *addr_l;
@@ -2216,7 +2200,7 @@ static int ugeth_82xx_filtering_clear_addr_in_hash(ucc_geth_private_t *ugeth,
        uccf = ugeth->uccf;
 
        p_82xx_addr_filt =
-           (ucc_geth_82xx_address_filtering_pram_t *) ugeth->p_rx_glbl_pram->
+           (struct ucc_geth_82xx_address_filtering_pram *) ugeth->p_rx_glbl_pram->
            addressfiltering;
 
        if (!
@@ -2256,9 +2240,9 @@ static int ugeth_82xx_filtering_clear_addr_in_hash(ucc_geth_private_t *ugeth,
        num = --(*p_counter);
        for (i = 0; i < num; i++) {
                enet_addr_cont =
-                   (enet_addr_container_t *)
+                   (struct enet_addr_container *)
                    ENET_ADDR_CONT_ENTRY(dequeue(p_lh));
-               hw_add_addr_in_hash(ugeth, &(enet_addr_cont->address));
+               hw_add_addr_in_hash(ugeth, enet_addr_cont->address);
                enqueue(p_lh, &enet_addr_cont->node);   /* Put it back */
        }
 
@@ -2269,14 +2253,14 @@ static int ugeth_82xx_filtering_clear_addr_in_hash(ucc_geth_private_t *ugeth,
 }
 #endif /* CONFIG_UGETH_FILTERING */
 
-static int ugeth_82xx_filtering_clear_all_addr_in_hash(ucc_geth_private_t *
+static int ugeth_82xx_filtering_clear_all_addr_in_hash(struct ucc_geth_private *
                                                       ugeth,
-                                                      enet_addr_type_e
+                                                      enum enet_addr_type
                                                       enet_addr_type)
 {
-       ucc_geth_82xx_address_filtering_pram_t *p_82xx_addr_filt;
-       ucc_fast_private_t *uccf;
-       comm_dir_e comm_dir;
+       struct ucc_geth_82xx_address_filtering_pram *p_82xx_addr_filt;
+       struct ucc_fast_private *uccf;
+       enum comm_dir comm_dir;
        struct list_head *p_lh;
        u16 i, num;
        u32 *addr_h, *addr_l;
@@ -2285,7 +2269,7 @@ static int ugeth_82xx_filtering_clear_all_addr_in_hash(ucc_geth_private_t *
        uccf = ugeth->uccf;
 
        p_82xx_addr_filt =
-           (ucc_geth_82xx_address_filtering_pram_t *) ugeth->p_rx_glbl_pram->
+           (struct ucc_geth_82xx_address_filtering_pram *) ugeth->p_rx_glbl_pram->
            addressfiltering;
 
        if (enet_addr_type == ENET_ADDR_TYPE_GROUP) {
@@ -2331,8 +2315,8 @@ static int ugeth_82xx_filtering_clear_all_addr_in_hash(ucc_geth_private_t *
 }
 
 #ifdef CONFIG_UGETH_FILTERING
-static int ugeth_82xx_filtering_add_addr_in_paddr(ucc_geth_private_t *ugeth,
-                                                 enet_addr_t *p_enet_addr,
+static int ugeth_82xx_filtering_add_addr_in_paddr(struct ucc_geth_private *ugeth,
+                                                 struct enet_addr *p_enet_addr,
                                                  u8 paddr_num)
 {
        int i;
@@ -2352,14 +2336,14 @@ static int ugeth_82xx_filtering_add_addr_in_paddr(ucc_geth_private_t *ugeth,
 }
 #endif /* CONFIG_UGETH_FILTERING */
 
-static int ugeth_82xx_filtering_clear_addr_in_paddr(ucc_geth_private_t *ugeth,
+static int ugeth_82xx_filtering_clear_addr_in_paddr(struct ucc_geth_private *ugeth,
                                                    u8 paddr_num)
 {
        ugeth->indAddrRegUsed[paddr_num] = 0; /* mark this paddr as not used */
        return hw_clear_addr_in_paddr(ugeth, paddr_num);/* clear in hardware */
 }
 
-static void ucc_geth_memclean(ucc_geth_private_t *ugeth)
+static void ucc_geth_memclean(struct ucc_geth_private *ugeth)
 {
        u16 i, j;
        u8 *bd;
@@ -2433,8 +2417,8 @@ static void ucc_geth_memclean(ucc_geth_private_t *ugeth)
                for (j = 0; j < ugeth->ug_info->bdRingLenTx[i]; j++) {
                        if (ugeth->tx_skbuff[i][j]) {
                                dma_unmap_single(NULL,
-                                                BD_BUFFER_ARG(bd),
-                                                (BD_STATUS_AND_LENGTH(bd) &
+                                                ((qe_bd_t *)bd)->buf,
+                                                (in_be32((u32 *)bd) &
                                                  BD_LENGTH_MASK),
                                                 DMA_TO_DEVICE);
                                dev_kfree_skb_any(ugeth->tx_skbuff[i][j]);
@@ -2460,18 +2444,17 @@ static void ucc_geth_memclean(ucc_geth_private_t *ugeth)
                        bd = ugeth->p_rx_bd_ring[i];
                        for (j = 0; j < ugeth->ug_info->bdRingLenRx[i]; j++) {
                                if (ugeth->rx_skbuff[i][j]) {
-                                       dma_unmap_single(NULL, BD_BUFFER(bd),
-                                                ugeth->ug_info->
-                                                uf_info.
-                                                max_rx_buf_length +
-                                                UCC_GETH_RX_DATA_BUF_ALIGNMENT,
-                                                DMA_FROM_DEVICE);
-
-                                       dev_kfree_skb_any(ugeth->
-                                                         rx_skbuff[i][j]);
+                                       dma_unmap_single(NULL,
+                                               ((struct qe_bd *)bd)->buf,
+                                               ugeth->ug_info->
+                                               uf_info.max_rx_buf_length +
+                                               UCC_GETH_RX_DATA_BUF_ALIGNMENT,
+                                               DMA_FROM_DEVICE);
+                                       dev_kfree_skb_any(
+                                               ugeth->rx_skbuff[i][j]);
                                        ugeth->rx_skbuff[i][j] = NULL;
                                }
-                               bd += UCC_GETH_SIZE_OF_BD;
+                               bd += sizeof(struct qe_bd);
                        }
 
                        kfree(ugeth->rx_skbuff[i]);
@@ -2496,11 +2479,11 @@ static void ucc_geth_memclean(ucc_geth_private_t *ugeth)
 
 static void ucc_geth_set_multi(struct net_device *dev)
 {
-       ucc_geth_private_t *ugeth;
+       struct ucc_geth_private *ugeth;
        struct dev_mc_list *dmi;
-       ucc_fast_t *uf_regs;
-       ucc_geth_82xx_address_filtering_pram_t *p_82xx_addr_filt;
-       enet_addr_t tempaddr;
+       struct ucc_fast *uf_regs;
+       struct ucc_geth_82xx_address_filtering_pram *p_82xx_addr_filt;
+       u8 tempaddr[6];
        u8 *mcptr, *tdptr;
        int i, j;
 
@@ -2517,7 +2500,7 @@ static void ucc_geth_set_multi(struct net_device *dev)
                uf_regs->upsmr &= ~UPSMR_PRO;
 
                p_82xx_addr_filt =
-                   (ucc_geth_82xx_address_filtering_pram_t *) ugeth->
+                   (struct ucc_geth_82xx_address_filtering_pram *) ugeth->
                    p_rx_glbl_pram->addressfiltering;
 
                if (dev->flags & IFF_ALLMULTI) {
@@ -2546,23 +2529,22 @@ static void ucc_geth_set_multi(struct net_device *dev)
                                 * copy bytes MSB first from dmi_addr.
                                 */
                                mcptr = (u8 *) dmi->dmi_addr + 5;
-                               tdptr = (u8 *) tempaddr;
+                               tdptr = (u8 *) tempaddr;
                                for (j = 0; j < 6; j++)
                                        *tdptr++ = *mcptr--;
 
                                /* Ask CPM to run CRC and set bit in
                                 * filter mask.
                                 */
-                               hw_add_addr_in_hash(ugeth, &tempaddr);
-
+                               hw_add_addr_in_hash(ugeth, tempaddr);
                        }
                }
        }
 }
 
-static void ucc_geth_stop(ucc_geth_private_t *ugeth)
+static void ucc_geth_stop(struct ucc_geth_private *ugeth)
 {
-       ucc_geth_t *ug_regs = ugeth->ug_regs;
+       struct ucc_geth *ug_regs = ugeth->ug_regs;
        u32 tempval;
 
        ugeth_vdbg("%s: IN", __FUNCTION__);
@@ -2605,15 +2587,15 @@ static void ucc_geth_stop(ucc_geth_private_t *ugeth)
        ucc_geth_memclean(ugeth);
 }
 
-static int ucc_geth_startup(ucc_geth_private_t *ugeth)
+static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 {
-       ucc_geth_82xx_address_filtering_pram_t *p_82xx_addr_filt;
-       ucc_geth_init_pram_t *p_init_enet_pram;
-       ucc_fast_private_t *uccf;
-       ucc_geth_info_t *ug_info;
-       ucc_fast_info_t *uf_info;
-       ucc_fast_t *uf_regs;
-       ucc_geth_t *ug_regs;
+       struct ucc_geth_82xx_address_filtering_pram *p_82xx_addr_filt;
+       struct ucc_geth_init_pram *p_init_enet_pram;
+       struct ucc_fast_private *uccf;
+       struct ucc_geth_info *ug_info;
+       struct ucc_fast_info *uf_info;
+       struct ucc_fast *uf_regs;
+       struct ucc_geth *ug_regs;
        int ret_val = -EINVAL;
        u32 remoder = UCC_GETH_REMODER_INIT;
        u32 init_enet_pram_offset, cecr_subblock, command, maccfg1;
@@ -2788,7 +2770,7 @@ static int ucc_geth_startup(ucc_geth_private_t *ugeth)
                UCC_GETH_VLAN_OPERATION_NON_TAGGED_NOP);
 
        uf_regs = uccf->uf_regs;
-       ug_regs = (ucc_geth_t *) (uccf->uf_regs);
+       ug_regs = (struct ucc_geth *) (uccf->uf_regs);
        ugeth->ug_regs = ug_regs;
 
        init_default_reg_vals(&uf_regs->upsmr,
@@ -2869,10 +2851,10 @@ static int ucc_geth_startup(ucc_geth_private_t *ugeth)
                /* Allocate in multiple of
                   UCC_GETH_TX_BD_RING_SIZE_MEMORY_ALIGNMENT,
                   according to spec */
-               length = ((ug_info->bdRingLenTx[j] * UCC_GETH_SIZE_OF_BD)
+               length = ((ug_info->bdRingLenTx[j] * sizeof(struct qe_bd))
                          / UCC_GETH_TX_BD_RING_SIZE_MEMORY_ALIGNMENT)
                    * UCC_GETH_TX_BD_RING_SIZE_MEMORY_ALIGNMENT;
-               if ((ug_info->bdRingLenTx[j] * UCC_GETH_SIZE_OF_BD) %
+               if ((ug_info->bdRingLenTx[j] * sizeof(struct qe_bd)) %
                    UCC_GETH_TX_BD_RING_SIZE_MEMORY_ALIGNMENT)
                        length += UCC_GETH_TX_BD_RING_SIZE_MEMORY_ALIGNMENT;
                if (uf_info->bd_mem_part == MEM_PART_SYSTEM) {
@@ -2904,13 +2886,13 @@ static int ucc_geth_startup(ucc_geth_private_t *ugeth)
                }
                /* Zero unused end of bd ring, according to spec */
                memset(ugeth->p_tx_bd_ring[j] +
-                      ug_info->bdRingLenTx[j] * UCC_GETH_SIZE_OF_BD, 0,
-                      length - ug_info->bdRingLenTx[j] * UCC_GETH_SIZE_OF_BD);
+                      ug_info->bdRingLenTx[j] * sizeof(struct qe_bd), 0,
+                      length - ug_info->bdRingLenTx[j] * sizeof(struct qe_bd));
        }
 
        /* Allocate Rx bds */
        for (j = 0; j < ug_info->numQueuesRx; j++) {
-               length = ug_info->bdRingLenRx[j] * UCC_GETH_SIZE_OF_BD;
+               length = ug_info->bdRingLenRx[j] * sizeof(struct qe_bd);
                if (uf_info->bd_mem_part == MEM_PART_SYSTEM) {
                        u32 align = 4;
                        if (UCC_GETH_RX_BD_RING_ALIGNMENT > 4)
@@ -2960,12 +2942,15 @@ static int ucc_geth_startup(ucc_geth_private_t *ugeth)
                ugeth->skb_curtx[j] = ugeth->skb_dirtytx[j] = 0;
                bd = ugeth->confBd[j] = ugeth->txBd[j] = ugeth->p_tx_bd_ring[j];
                for (i = 0; i < ug_info->bdRingLenTx[j]; i++) {
-                       BD_BUFFER_CLEAR(bd);
-                       BD_STATUS_AND_LENGTH_SET(bd, 0);
-                       bd += UCC_GETH_SIZE_OF_BD;
+                       /* clear bd buffer */
+                       out_be32(&((struct qe_bd *)bd)->buf, 0);
+                       /* set bd status and length */
+                       out_be32((u32 *)bd, 0);
+                       bd += sizeof(struct qe_bd);
                }
-               bd -= UCC_GETH_SIZE_OF_BD;
-               BD_STATUS_AND_LENGTH_SET(bd, T_W);/* for last BD set Wrap bit */
+               bd -= sizeof(struct qe_bd);
+               /* set bd status and length */
+               out_be32((u32 *)bd, T_W);       /* for last BD set Wrap bit */
        }
 
        /* Init Rx bds */
@@ -2989,12 +2974,15 @@ static int ucc_geth_startup(ucc_geth_private_t *ugeth)
                ugeth->skb_currx[j] = 0;
                bd = ugeth->rxBd[j] = ugeth->p_rx_bd_ring[j];
                for (i = 0; i < ug_info->bdRingLenRx[j]; i++) {
-                       BD_STATUS_AND_LENGTH_SET(bd, R_I);
-                       BD_BUFFER_CLEAR(bd);
-                       bd += UCC_GETH_SIZE_OF_BD;
+                       /* set bd status and length */
+                       out_be32((u32 *)bd, R_I);
+                       /* clear bd buffer */
+                       out_be32(&((struct qe_bd *)bd)->buf, 0);
+                       bd += sizeof(struct qe_bd);
                }
-               bd -= UCC_GETH_SIZE_OF_BD;
-               BD_STATUS_AND_LENGTH_SET(bd, R_W);/* for last BD set Wrap bit */
+               bd -= sizeof(struct qe_bd);
+               /* set bd status and length */
+               out_be32((u32 *)bd, R_W); /* for last BD set Wrap bit */
        }
 
        /*
@@ -3003,7 +2991,7 @@ static int ucc_geth_startup(ucc_geth_private_t *ugeth)
        /* Tx global PRAM */
        /* Allocate global tx parameter RAM page */
        ugeth->tx_glbl_pram_offset =
-           qe_muram_alloc(sizeof(ucc_geth_tx_global_pram_t),
+           qe_muram_alloc(sizeof(struct ucc_geth_tx_global_pram),
                           UCC_GETH_TX_GLOBAL_PRAM_ALIGNMENT);
        if (IS_MURAM_ERR(ugeth->tx_glbl_pram_offset)) {
                ugeth_err
@@ -3013,10 +3001,10 @@ static int ucc_geth_startup(ucc_geth_private_t *ugeth)
                return -ENOMEM;
        }
        ugeth->p_tx_glbl_pram =
-           (ucc_geth_tx_global_pram_t *) qe_muram_addr(ugeth->
+           (struct ucc_geth_tx_global_pram *) qe_muram_addr(ugeth->
                                                        tx_glbl_pram_offset);
        /* Zero out p_tx_glbl_pram */
-       memset(ugeth->p_tx_glbl_pram, 0, sizeof(ucc_geth_tx_global_pram_t));
+       memset(ugeth->p_tx_glbl_pram, 0, sizeof(struct ucc_geth_tx_global_pram));
 
        /* Fill global PRAM */
 
@@ -3024,7 +3012,7 @@ static int ucc_geth_startup(ucc_geth_private_t *ugeth)
        /* Size varies with number of Tx threads */
        ugeth->thread_dat_tx_offset =
            qe_muram_alloc(numThreadsTxNumerical *
-                          sizeof(ucc_geth_thread_data_tx_t) +
+                          sizeof(struct ucc_geth_thread_data_tx) +
                           32 * (numThreadsTxNumerical == 1),
                           UCC_GETH_THREAD_DATA_ALIGNMENT);
        if (IS_MURAM_ERR(ugeth->thread_dat_tx_offset)) {
@@ -3036,7 +3024,7 @@ static int ucc_geth_startup(ucc_geth_private_t *ugeth)
        }
 
        ugeth->p_thread_data_tx =
-           (ucc_geth_thread_data_tx_t *) qe_muram_addr(ugeth->
+           (struct ucc_geth_thread_data_tx *) qe_muram_addr(ugeth->
                                                        thread_dat_tx_offset);
        out_be32(&ugeth->p_tx_glbl_pram->tqptr, ugeth->thread_dat_tx_offset);
 
@@ -3053,7 +3041,7 @@ static int ucc_geth_startup(ucc_geth_private_t *ugeth)
        /* Size varies with number of Tx queues */
        ugeth->send_q_mem_reg_offset =
            qe_muram_alloc(ug_info->numQueuesTx *
-                          sizeof(ucc_geth_send_queue_qd_t),
+                          sizeof(struct ucc_geth_send_queue_qd),
                           UCC_GETH_SEND_QUEUE_QUEUE_DESCRIPTOR_ALIGNMENT);
        if (IS_MURAM_ERR(ugeth->send_q_mem_reg_offset)) {
                ugeth_err
@@ -3064,7 +3052,7 @@ static int ucc_geth_startup(ucc_geth_private_t *ugeth)
        }
 
        ugeth->p_send_q_mem_reg =
-           (ucc_geth_send_queue_mem_region_t *) qe_muram_addr(ugeth->
+           (struct ucc_geth_send_queue_mem_region *) qe_muram_addr(ugeth->
                        send_q_mem_reg_offset);
        out_be32(&ugeth->p_tx_glbl_pram->sqptr, ugeth->send_q_mem_reg_offset);
 
@@ -3073,7 +3061,7 @@ static int ucc_geth_startup(ucc_geth_private_t *ugeth)
        for (i = 0; i < ug_info->numQueuesTx; i++) {
                endOfRing =
                    ugeth->p_tx_bd_ring[i] + (ug_info->bdRingLenTx[i] -
-                                             1) * UCC_GETH_SIZE_OF_BD;
+                                             1) * sizeof(struct qe_bd);
                if (ugeth->ug_info->uf_info.bd_mem_part == MEM_PART_SYSTEM) {
                        out_be32(&ugeth->p_send_q_mem_reg->sqqd[i].bd_ring_base,
                                 (u32) virt_to_phys(ugeth->p_tx_bd_ring[i]));
@@ -3096,7 +3084,7 @@ static int ucc_geth_startup(ucc_geth_private_t *ugeth)
        if (ug_info->numQueuesTx > 1) {
        /* scheduler exists only if more than 1 tx queue */
                ugeth->scheduler_offset =
-                   qe_muram_alloc(sizeof(ucc_geth_scheduler_t),
+                   qe_muram_alloc(sizeof(struct ucc_geth_scheduler),
                                   UCC_GETH_SCHEDULER_ALIGNMENT);
                if (IS_MURAM_ERR(ugeth->scheduler_offset)) {
                        ugeth_err
@@ -3107,12 +3095,12 @@ static int ucc_geth_startup(ucc_geth_private_t *ugeth)
                }
 
                ugeth->p_scheduler =
-                   (ucc_geth_scheduler_t *) qe_muram_addr(ugeth->
+                   (struct ucc_geth_scheduler *) qe_muram_addr(ugeth->
                                                           scheduler_offset);
                out_be32(&ugeth->p_tx_glbl_pram->schedulerbasepointer,
                         ugeth->scheduler_offset);
                /* Zero out p_scheduler */
-               memset(ugeth->p_scheduler, 0, sizeof(ucc_geth_scheduler_t));
+               memset(ugeth->p_scheduler, 0, sizeof(struct ucc_geth_scheduler));
 
                /* Set values in scheduler */
                out_be32(&ugeth->p_scheduler->mblinterval,
@@ -3144,7 +3132,7 @@ static int ucc_geth_startup(ucc_geth_private_t *ugeth)
            statisticsMode & UCC_GETH_STATISTICS_GATHERING_MODE_FIRMWARE_TX) {
                ugeth->tx_fw_statistics_pram_offset =
                    qe_muram_alloc(sizeof
-                                  (ucc_geth_tx_firmware_statistics_pram_t),
+                                  (struct ucc_geth_tx_firmware_statistics_pram),
                                   UCC_GETH_TX_STATISTICS_ALIGNMENT);
                if (IS_MURAM_ERR(ugeth->tx_fw_statistics_pram_offset)) {
                        ugeth_err
@@ -3154,11 +3142,11 @@ static int ucc_geth_startup(ucc_geth_private_t *ugeth)
                        return -ENOMEM;
                }
                ugeth->p_tx_fw_statistics_pram =
-                   (ucc_geth_tx_firmware_statistics_pram_t *)
+                   (struct ucc_geth_tx_firmware_statistics_pram *)
                    qe_muram_addr(ugeth->tx_fw_statistics_pram_offset);
                /* Zero out p_tx_fw_statistics_pram */
                memset(ugeth->p_tx_fw_statistics_pram,
-                      0, sizeof(ucc_geth_tx_firmware_statistics_pram_t));
+                      0, sizeof(struct ucc_geth_tx_firmware_statistics_pram));
        }
 
        /* temoder */
@@ -3183,7 +3171,7 @@ static int ucc_geth_startup(ucc_geth_private_t *ugeth)
        /* Rx global PRAM */
        /* Allocate global rx parameter RAM page */
        ugeth->rx_glbl_pram_offset =
-           qe_muram_alloc(sizeof(ucc_geth_rx_global_pram_t),
+           qe_muram_alloc(sizeof(struct ucc_geth_rx_global_pram),
                           UCC_GETH_RX_GLOBAL_PRAM_ALIGNMENT);
        if (IS_MURAM_ERR(ugeth->rx_glbl_pram_offset)) {
                ugeth_err
@@ -3193,10 +3181,10 @@ static int ucc_geth_startup(ucc_geth_private_t *ugeth)
                return -ENOMEM;
        }
        ugeth->p_rx_glbl_pram =
-           (ucc_geth_rx_global_pram_t *) qe_muram_addr(ugeth->
+           (struct ucc_geth_rx_global_pram *) qe_muram_addr(ugeth->
                                                        rx_glbl_pram_offset);
        /* Zero out p_rx_glbl_pram */
-       memset(ugeth->p_rx_glbl_pram, 0, sizeof(ucc_geth_rx_global_pram_t));
+       memset(ugeth->p_rx_glbl_pram, 0, sizeof(struct ucc_geth_rx_global_pram));
 
        /* Fill global PRAM */
 
@@ -3204,7 +3192,7 @@ static int ucc_geth_startup(ucc_geth_private_t *ugeth)
        /* Size varies with number of Rx threads */
        ugeth->thread_dat_rx_offset =
            qe_muram_alloc(numThreadsRxNumerical *
-                          sizeof(ucc_geth_thread_data_rx_t),
+                          sizeof(struct ucc_geth_thread_data_rx),
                           UCC_GETH_THREAD_DATA_ALIGNMENT);
        if (IS_MURAM_ERR(ugeth->thread_dat_rx_offset)) {
                ugeth_err
@@ -3215,7 +3203,7 @@ static int ucc_geth_startup(ucc_geth_private_t *ugeth)
        }
 
        ugeth->p_thread_data_rx =
-           (ucc_geth_thread_data_rx_t *) qe_muram_addr(ugeth->
+           (struct ucc_geth_thread_data_rx *) qe_muram_addr(ugeth->
                                                        thread_dat_rx_offset);
        out_be32(&ugeth->p_rx_glbl_pram->rqptr, ugeth->thread_dat_rx_offset);
 
@@ -3227,7 +3215,7 @@ static int ucc_geth_startup(ucc_geth_private_t *ugeth)
            statisticsMode & UCC_GETH_STATISTICS_GATHERING_MODE_FIRMWARE_RX) {
                ugeth->rx_fw_statistics_pram_offset =
                    qe_muram_alloc(sizeof
-                                  (ucc_geth_rx_firmware_statistics_pram_t),
+                                  (struct ucc_geth_rx_firmware_statistics_pram),
                                   UCC_GETH_RX_STATISTICS_ALIGNMENT);
                if (IS_MURAM_ERR(ugeth->rx_fw_statistics_pram_offset)) {
                        ugeth_err
@@ -3237,11 +3225,11 @@ static int ucc_geth_startup(ucc_geth_private_t *ugeth)
                        return -ENOMEM;
                }
                ugeth->p_rx_fw_statistics_pram =
-                   (ucc_geth_rx_firmware_statistics_pram_t *)
+                   (struct ucc_geth_rx_firmware_statistics_pram *)
                    qe_muram_addr(ugeth->rx_fw_statistics_pram_offset);
                /* Zero out p_rx_fw_statistics_pram */
                memset(ugeth->p_rx_fw_statistics_pram, 0,
-                      sizeof(ucc_geth_rx_firmware_statistics_pram_t));
+                      sizeof(struct ucc_geth_rx_firmware_statistics_pram));
        }
 
        /* intCoalescingPtr */
@@ -3249,7 +3237,7 @@ static int ucc_geth_startup(ucc_geth_private_t *ugeth)
        /* Size varies with number of Rx queues */
        ugeth->rx_irq_coalescing_tbl_offset =
            qe_muram_alloc(ug_info->numQueuesRx *
-                          sizeof(ucc_geth_rx_interrupt_coalescing_entry_t),
+                          sizeof(struct ucc_geth_rx_interrupt_coalescing_entry),
                           UCC_GETH_RX_INTERRUPT_COALESCING_ALIGNMENT);
        if (IS_MURAM_ERR(ugeth->rx_irq_coalescing_tbl_offset)) {
                ugeth_err
@@ -3260,7 +3248,7 @@ static int ucc_geth_startup(ucc_geth_private_t *ugeth)
        }
 
        ugeth->p_rx_irq_coalescing_tbl =
-           (ucc_geth_rx_interrupt_coalescing_table_t *)
+           (struct ucc_geth_rx_interrupt_coalescing_table *)
            qe_muram_addr(ugeth->rx_irq_coalescing_tbl_offset);
        out_be32(&ugeth->p_rx_glbl_pram->intcoalescingptr,
                 ugeth->rx_irq_coalescing_tbl_offset);
@@ -3300,7 +3288,7 @@ static int ucc_geth_startup(ucc_geth_private_t *ugeth)
                l3qt = 0;
                for (i = 0; i < 8; i++)
                        l3qt |= (ug_info->l3qt[j + i] << (28 - 4 * i));
-               out_be32(&ugeth->p_rx_glbl_pram->l3qt[j], l3qt);
+               out_be32(&ugeth->p_rx_glbl_pram->l3qt[j/8], l3qt);
        }
 
        /* vlantype */
@@ -3316,8 +3304,8 @@ static int ucc_geth_startup(ucc_geth_private_t *ugeth)
        /* Size varies with number of Rx queues */
        ugeth->rx_bd_qs_tbl_offset =
            qe_muram_alloc(ug_info->numQueuesRx *
-                          (sizeof(ucc_geth_rx_bd_queues_entry_t) +
-                           sizeof(ucc_geth_rx_prefetched_bds_t)),
+                          (sizeof(struct ucc_geth_rx_bd_queues_entry) +
+                           sizeof(struct ucc_geth_rx_prefetched_bds)),
                           UCC_GETH_RX_BD_QUEUES_ALIGNMENT);
        if (IS_MURAM_ERR(ugeth->rx_bd_qs_tbl_offset)) {
                ugeth_err
@@ -3328,14 +3316,14 @@ static int ucc_geth_startup(ucc_geth_private_t *ugeth)
        }
 
        ugeth->p_rx_bd_qs_tbl =
-           (ucc_geth_rx_bd_queues_entry_t *) qe_muram_addr(ugeth->
+           (struct ucc_geth_rx_bd_queues_entry *) qe_muram_addr(ugeth->
                                    rx_bd_qs_tbl_offset);
        out_be32(&ugeth->p_rx_glbl_pram->rbdqptr, ugeth->rx_bd_qs_tbl_offset);
        /* Zero out p_rx_bd_qs_tbl */
        memset(ugeth->p_rx_bd_qs_tbl,
               0,
-              ug_info->numQueuesRx * (sizeof(ucc_geth_rx_bd_queues_entry_t) +
-                                      sizeof(ucc_geth_rx_prefetched_bds_t)));
+              ug_info->numQueuesRx * (sizeof(struct ucc_geth_rx_bd_queues_entry) +
+                                      sizeof(struct ucc_geth_rx_prefetched_bds)));
 
        /* Setup the table */
        /* Assume BD rings are already established */
@@ -3406,7 +3394,7 @@ static int ucc_geth_startup(ucc_geth_private_t *ugeth)
                /* Allocate memory for extended filtering Mode Global
                Parameters */
                ugeth->exf_glbl_param_offset =
-                   qe_muram_alloc(sizeof(ucc_geth_exf_global_pram_t),
+                   qe_muram_alloc(sizeof(struct ucc_geth_exf_global_pram),
                UCC_GETH_RX_EXTENDED_FILTERING_GLOBAL_PARAMETERS_ALIGNMENT);
                if (IS_MURAM_ERR(ugeth->exf_glbl_param_offset)) {
                        ugeth_err
@@ -3417,7 +3405,7 @@ static int ucc_geth_startup(ucc_geth_private_t *ugeth)
                }
 
                ugeth->p_exf_glbl_param =
-                   (ucc_geth_exf_global_pram_t *) qe_muram_addr(ugeth->
+                   (struct ucc_geth_exf_global_pram *) qe_muram_addr(ugeth->
                                 exf_glbl_param_offset);
                out_be32(&ugeth->p_rx_glbl_pram->exfGlobalParam,
                         ugeth->exf_glbl_param_offset);
@@ -3439,7 +3427,7 @@ static int ucc_geth_startup(ucc_geth_private_t *ugeth)
                        INIT_LIST_HEAD(&ugeth->ind_hash_q);
                }
                p_82xx_addr_filt =
-                   (ucc_geth_82xx_address_filtering_pram_t *) ugeth->
+                   (struct ucc_geth_82xx_address_filtering_pram *) ugeth->
                    p_rx_glbl_pram->addressfiltering;
 
                ugeth_82xx_filtering_clear_all_addr_in_hash(ugeth,
@@ -3462,7 +3450,7 @@ static int ucc_geth_startup(ucc_geth_private_t *ugeth)
         * allocated resources can be released when the channel is freed.
         */
        if (!(ugeth->p_init_enet_param_shadow =
-            (ucc_geth_init_pram_t *) kmalloc(sizeof(ucc_geth_init_pram_t),
+            (struct ucc_geth_init_pram *) kmalloc(sizeof(struct ucc_geth_init_pram),
                                              GFP_KERNEL))) {
                ugeth_err
                    ("%s: Can not allocate memory for"
@@ -3472,7 +3460,7 @@ static int ucc_geth_startup(ucc_geth_private_t *ugeth)
        }
        /* Zero out *p_init_enet_param_shadow */
        memset((char *)ugeth->p_init_enet_param_shadow,
-              0, sizeof(ucc_geth_init_pram_t));
+              0, sizeof(struct ucc_geth_init_pram));
 
        /* Fill shadow InitEnet command parameter structure */
 
@@ -3506,7 +3494,7 @@ static int ucc_geth_startup(ucc_geth_private_t *ugeth)
        }
        ugeth->p_init_enet_param_shadow->largestexternallookupkeysize =
            ug_info->largestexternallookupkeysize;
-       size = sizeof(ucc_geth_thread_rx_pram_t);
+       size = sizeof(struct ucc_geth_thread_rx_pram);
        if (ug_info->rxExtendedFiltering) {
                size += THREAD_RX_PRAM_ADDITIONAL_FOR_EXTENDED_FILTERING;
                if (ug_info->largestexternallookupkeysize ==
@@ -3537,7 +3525,7 @@ static int ucc_geth_startup(ucc_geth_private_t *ugeth)
             fill_init_enet_entries(ugeth,
                                    &(ugeth->p_init_enet_param_shadow->
                                      txthread[0]), numThreadsTxNumerical,
-                                   sizeof(ucc_geth_thread_tx_pram_t),
+                                   sizeof(struct ucc_geth_thread_tx_pram),
                                    UCC_GETH_THREAD_TX_PRAM_ALIGNMENT,
                                    ug_info->riscTx, 0)) != 0) {
                ugeth_err("%s: Can not fill p_init_enet_param_shadow.",
@@ -3557,7 +3545,7 @@ static int ucc_geth_startup(ucc_geth_private_t *ugeth)
        }
 
        /* Allocate InitEnet command parameter structure */
-       init_enet_pram_offset = qe_muram_alloc(sizeof(ucc_geth_init_pram_t), 4);
+       init_enet_pram_offset = qe_muram_alloc(sizeof(struct ucc_geth_init_pram), 4);
        if (IS_MURAM_ERR(init_enet_pram_offset)) {
                ugeth_err
                    ("%s: Can not allocate DPRAM memory for p_init_enet_pram.",
@@ -3566,7 +3554,7 @@ static int ucc_geth_startup(ucc_geth_private_t *ugeth)
                return -ENOMEM;
        }
        p_init_enet_pram =
-           (ucc_geth_init_pram_t *) qe_muram_addr(init_enet_pram_offset);
+           (struct ucc_geth_init_pram *) qe_muram_addr(init_enet_pram_offset);
 
        /* Copy shadow InitEnet command parameter structure into PRAM */
        p_init_enet_pram->resinit1 = ugeth->p_init_enet_param_shadow->resinit1;
@@ -3591,7 +3579,7 @@ static int ucc_geth_startup(ucc_geth_private_t *ugeth)
        /* Issue QE command */
        cecr_subblock =
            ucc_fast_get_qe_cr_subblock(ugeth->ug_info->uf_info.ucc_num);
-       qe_issue_cmd(command, cecr_subblock, (u8) QE_CR_PROTOCOL_ETHERNET,
+       qe_issue_cmd(command, cecr_subblock, QE_CR_PROTOCOL_ETHERNET,
                     init_enet_pram_offset);
 
        /* Free InitEnet command parameter */
@@ -3603,7 +3591,7 @@ static int ucc_geth_startup(ucc_geth_private_t *ugeth)
 /* returns a net_device_stats structure pointer */
 static struct net_device_stats *ucc_geth_get_stats(struct net_device *dev)
 {
-       ucc_geth_private_t *ugeth = netdev_priv(dev);
+       struct ucc_geth_private *ugeth = netdev_priv(dev);
 
        return &(ugeth->stats);
 }
@@ -3614,7 +3602,7 @@ static struct net_device_stats *ucc_geth_get_stats(struct net_device *dev)
  * starting over will fix the problem. */
 static void ucc_geth_timeout(struct net_device *dev)
 {
-       ucc_geth_private_t *ugeth = netdev_priv(dev);
+       struct ucc_geth_private *ugeth = netdev_priv(dev);
 
        ugeth_vdbg("%s: IN", __FUNCTION__);
 
@@ -3634,7 +3622,7 @@ static void ucc_geth_timeout(struct net_device *dev)
 /* It is pointed to by the dev->hard_start_xmit function pointer */
 static int ucc_geth_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
-       ucc_geth_private_t *ugeth = netdev_priv(dev);
+       struct ucc_geth_private *ugeth = netdev_priv(dev);
        u8 *bd;                 /* BD pointer */
        u32 bd_status;
        u8 txQ = 0;
@@ -3647,7 +3635,7 @@ static int ucc_geth_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
        /* Start from the next BD that should be filled */
        bd = ugeth->txBd[txQ];
-       bd_status = BD_STATUS_AND_LENGTH(bd);
+       bd_status = in_be32((u32 *)bd);
        /* Save the skb pointer so we can free it later */
        ugeth->tx_skbuff[txQ][ugeth->skb_curtx[txQ]] = skb;
 
@@ -3657,20 +3645,21 @@ static int ucc_geth_start_xmit(struct sk_buff *skb, struct net_device *dev)
             1) & TX_RING_MOD_MASK(ugeth->ug_info->bdRingLenTx[txQ]);
 
        /* set up the buffer descriptor */
-       BD_BUFFER_SET(bd,
+       out_be32(&((struct qe_bd *)bd)->buf,
                      dma_map_single(NULL, skb->data, skb->len, DMA_TO_DEVICE));
 
-       //printk(KERN_DEBUG"skb->data is 0x%x\n",skb->data);
+       /* printk(KERN_DEBUG"skb->data is 0x%x\n",skb->data); */
 
        bd_status = (bd_status & T_W) | T_R | T_I | T_L | skb->len;
 
-       BD_STATUS_AND_LENGTH_SET(bd, bd_status);
+       /* set bd status and length */
+       out_be32((u32 *)bd, bd_status);
 
        dev->trans_start = jiffies;
 
        /* Move to next BD in the ring */
        if (!(bd_status & T_W))
-               ugeth->txBd[txQ] = bd + UCC_GETH_SIZE_OF_BD;
+               ugeth->txBd[txQ] = bd + sizeof(struct qe_bd);
        else
                ugeth->txBd[txQ] = ugeth->p_tx_bd_ring[txQ];
 
@@ -3695,7 +3684,7 @@ static int ucc_geth_start_xmit(struct sk_buff *skb, struct net_device *dev)
        return 0;
 }
 
-static int ucc_geth_rx(ucc_geth_private_t *ugeth, u8 rxQ, int rx_work_limit)
+static int ucc_geth_rx(struct ucc_geth_private *ugeth, u8 rxQ, int rx_work_limit)
 {
        struct sk_buff *skb;
        u8 *bd;
@@ -3709,11 +3698,11 @@ static int ucc_geth_rx(ucc_geth_private_t *ugeth, u8 rxQ, int rx_work_limit)
        /* collect received buffers */
        bd = ugeth->rxBd[rxQ];
 
-       bd_status = BD_STATUS_AND_LENGTH(bd);
+       bd_status = in_be32((u32 *)bd);
 
        /* while there are received buffers and BD is full (~R_E) */
        while (!((bd_status & (R_E)) || (--rx_work_limit < 0))) {
-               bdBuffer = (u8 *) BD_BUFFER(bd);
+               bdBuffer = (u8 *) in_be32(&((struct qe_bd *)bd)->buf);
                length = (u16) ((bd_status & BD_LENGTH_MASK) - 4);
                skb = ugeth->rx_skbuff[rxQ][ugeth->skb_currx[rxQ]];
 
@@ -3768,9 +3757,9 @@ static int ucc_geth_rx(ucc_geth_private_t *ugeth, u8 rxQ, int rx_work_limit)
                if (bd_status & R_W)
                        bd = ugeth->p_rx_bd_ring[rxQ];
                else
-                       bd += UCC_GETH_SIZE_OF_BD;
+                       bd += sizeof(struct qe_bd);
 
-               bd_status = BD_STATUS_AND_LENGTH(bd);
+               bd_status = in_be32((u32 *)bd);
        }
 
        ugeth->rxBd[rxQ] = bd;
@@ -3781,12 +3770,12 @@ static int ucc_geth_rx(ucc_geth_private_t *ugeth, u8 rxQ, int rx_work_limit)
 static int ucc_geth_tx(struct net_device *dev, u8 txQ)
 {
        /* Start from the next BD that should be filled */
-       ucc_geth_private_t *ugeth = netdev_priv(dev);
+       struct ucc_geth_private *ugeth = netdev_priv(dev);
        u8 *bd;                 /* BD pointer */
        u32 bd_status;
 
        bd = ugeth->confBd[txQ];
-       bd_status = BD_STATUS_AND_LENGTH(bd);
+       bd_status = in_be32((u32 *)bd);
 
        /* Normal processing. */
        while ((bd_status & T_R) == 0) {
@@ -3813,7 +3802,7 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ)
 
                /* Advance the confirmation BD pointer */
                if (!(bd_status & T_W))
-                       ugeth->confBd[txQ] += UCC_GETH_SIZE_OF_BD;
+                       ugeth->confBd[txQ] += sizeof(struct qe_bd);
                else
                        ugeth->confBd[txQ] = ugeth->p_tx_bd_ring[txQ];
        }
@@ -3823,7 +3812,7 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ)
 #ifdef CONFIG_UGETH_NAPI
 static int ucc_geth_poll(struct net_device *dev, int *budget)
 {
-       ucc_geth_private_t *ugeth = netdev_priv(dev);
+       struct ucc_geth_private *ugeth = netdev_priv(dev);
        int howmany;
        int rx_work_limit = *budget;
        u8 rxQ = 0;
@@ -3847,9 +3836,9 @@ static int ucc_geth_poll(struct net_device *dev, int *budget)
 static irqreturn_t ucc_geth_irq_handler(int irq, void *info)
 {
        struct net_device *dev = (struct net_device *)info;
-       ucc_geth_private_t *ugeth = netdev_priv(dev);
-       ucc_fast_private_t *uccf;
-       ucc_geth_info_t *ug_info;
+       struct ucc_geth_private *ugeth = netdev_priv(dev);
+       struct ucc_fast_private *uccf;
+       struct ucc_geth_info *ug_info;
        register u32 ucce = 0;
        register u32 bit_mask = UCCE_RXBF_SINGLE_MASK;
        register u32 tx_mask = UCCE_TXBF_SINGLE_MASK;
@@ -3912,7 +3901,7 @@ static irqreturn_t ucc_geth_irq_handler(int irq, void *info)
 static irqreturn_t phy_interrupt(int irq, void *dev_id)
 {
        struct net_device *dev = (struct net_device *)dev_id;
-       ucc_geth_private_t *ugeth = netdev_priv(dev);
+       struct ucc_geth_private *ugeth = netdev_priv(dev);
 
        ugeth_vdbg("%s: IN", __FUNCTION__);
 
@@ -3932,8 +3921,8 @@ static irqreturn_t phy_interrupt(int irq, void *dev_id)
 static void ugeth_phy_change(void *data)
 {
        struct net_device *dev = (struct net_device *)data;
-       ucc_geth_private_t *ugeth = netdev_priv(dev);
-       ucc_geth_t *ug_regs;
+       struct ucc_geth_private *ugeth = netdev_priv(dev);
+       struct ucc_geth *ug_regs;
        int result = 0;
 
        ugeth_vdbg("%s: IN", __FUNCTION__);
@@ -3963,7 +3952,7 @@ static void ugeth_phy_change(void *data)
 static void ugeth_phy_timer(unsigned long data)
 {
        struct net_device *dev = (struct net_device *)data;
-       ucc_geth_private_t *ugeth = netdev_priv(dev);
+       struct ucc_geth_private *ugeth = netdev_priv(dev);
 
        schedule_work(&ugeth->tq);
 
@@ -3979,7 +3968,7 @@ static void ugeth_phy_timer(unsigned long data)
 static void ugeth_phy_startup_timer(unsigned long data)
 {
        struct ugeth_mii_info *mii_info = (struct ugeth_mii_info *)data;
-       ucc_geth_private_t *ugeth = netdev_priv(mii_info->dev);
+       struct ucc_geth_private *ugeth = netdev_priv(mii_info->dev);
        static int secondary = UGETH_AN_TIMEOUT;
        int result;
 
@@ -4034,7 +4023,7 @@ static void ugeth_phy_startup_timer(unsigned long data)
 /* Returns 0 for success. */
 static int ucc_geth_open(struct net_device *dev)
 {
-       ucc_geth_private_t *ugeth = netdev_priv(dev);
+       struct ucc_geth_private *ugeth = netdev_priv(dev);
        int err;
 
        ugeth_vdbg("%s: IN", __FUNCTION__);
@@ -4111,7 +4100,7 @@ static int ucc_geth_open(struct net_device *dev)
 /* Stops the kernel queue, and halts the controller */
 static int ucc_geth_close(struct net_device *dev)
 {
-       ucc_geth_private_t *ugeth = netdev_priv(dev);
+       struct ucc_geth_private *ugeth = netdev_priv(dev);
 
        ugeth_vdbg("%s: IN", __FUNCTION__);
 
@@ -4130,30 +4119,53 @@ static int ucc_geth_close(struct net_device *dev)
 
 const struct ethtool_ops ucc_geth_ethtool_ops = { };
 
-static int ucc_geth_probe(struct device *device)
+static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *match)
 {
-       struct platform_device *pdev = to_platform_device(device);
-       struct ucc_geth_platform_data *ugeth_pdata;
+       struct device *device = &ofdev->dev;
+       struct device_node *np = ofdev->node;
        struct net_device *dev = NULL;
        struct ucc_geth_private *ugeth = NULL;
        struct ucc_geth_info *ug_info;
-       int err;
+       struct resource res;
+       struct device_node *phy;
+       int err, ucc_num, phy_interface;
        static int mii_mng_configured = 0;
+       const phandle *ph;
+       const unsigned int *prop;
 
        ugeth_vdbg("%s: IN", __FUNCTION__);
 
-       ugeth_pdata = (struct ucc_geth_platform_data *)pdev->dev.platform_data;
+       prop = get_property(np, "device-id", NULL);
+       ucc_num = *prop - 1;
+       if ((ucc_num < 0) || (ucc_num > 7))
+               return -ENODEV;
+
+       ug_info = &ugeth_info[ucc_num];
+       ug_info->uf_info.ucc_num = ucc_num;
+       prop = get_property(np, "rx-clock", NULL);
+       ug_info->uf_info.rx_clock = *prop;
+       prop = get_property(np, "tx-clock", NULL);
+       ug_info->uf_info.tx_clock = *prop;
+       err = of_address_to_resource(np, 0, &res);
+       if (err)
+               return -EINVAL;
+
+       ug_info->uf_info.regs = res.start;
+       ug_info->uf_info.irq = irq_of_parse_and_map(np, 0);
+
+       ph = get_property(np, "phy-handle", NULL);
+       phy = of_find_node_by_phandle(*ph);
 
-       ug_info = &ugeth_info[pdev->id];
-       ug_info->uf_info.ucc_num = pdev->id;
-       ug_info->uf_info.rx_clock = ugeth_pdata->rx_clock;
-       ug_info->uf_info.tx_clock = ugeth_pdata->tx_clock;
-       ug_info->uf_info.regs = ugeth_pdata->phy_reg_addr;
-       ug_info->uf_info.irq = platform_get_irq(pdev, 0);
-       ug_info->phy_address = ugeth_pdata->phy_id;
-       ug_info->enet_interface = ugeth_pdata->phy_interface;
-       ug_info->board_flags = ugeth_pdata->board_flags;
-       ug_info->phy_interrupt = ugeth_pdata->phy_interrupt;
+       if (phy == NULL)
+               return -ENODEV;
+
+       prop = get_property(phy, "reg", NULL);
+       ug_info->phy_address = *prop;
+       prop = get_property(phy, "interface", NULL);
+       ug_info->enet_interface = *prop;
+       ug_info->phy_interrupt = irq_of_parse_and_map(phy, 0);
+       ug_info->board_flags = (ug_info->phy_interrupt == NO_IRQ)?
+                       0:FSL_UGETH_BRD_HAS_PHY_INTR;
 
        printk(KERN_INFO "ucc_geth: UCC%1d at 0x%8x (irq = %d) \n",
                ug_info->uf_info.ucc_num + 1, ug_info->uf_info.regs,
@@ -4161,12 +4173,44 @@ static int ucc_geth_probe(struct device *device)
 
        if (ug_info == NULL) {
                ugeth_err("%s: [%d] Missing additional data!", __FUNCTION__,
-                         pdev->id);
+                         ucc_num);
                return -ENODEV;
        }
 
+       /* FIXME: Work around for early chip rev.               */
+       /* There's a bug in initial chip rev(s) in the RGMII ac */
+       /* timing.                                              */
+       /* The following compensates by writing to the reserved */
+       /* QE Port Output Hold Registers (CPOH1?).              */
+       prop = get_property(phy, "interface", NULL);
+       phy_interface = *prop;
+       if ((phy_interface == ENET_1000_RGMII) ||
+                       (phy_interface == ENET_100_RGMII) ||
+                       (phy_interface == ENET_10_RGMII)) {
+               struct device_node *soc;
+               phys_addr_t immrbase = -1;
+               u32 *tmp_reg;
+               u32 tmp_val;
+
+               soc = of_find_node_by_type(NULL, "soc");
+               if (soc) {
+                       unsigned int size;
+                       const void *prop = get_property(soc, "reg", &size);
+                       immrbase = of_translate_address(soc, prop);
+                       of_node_put(soc);
+               };
+
+               tmp_reg = (u32 *) ioremap(immrbase + 0x14A8, 0x4);
+               tmp_val = in_be32(tmp_reg);
+               if (ucc_num == 1)
+                       out_be32(tmp_reg, tmp_val | 0x00003000);
+               else if (ucc_num == 2)
+                       out_be32(tmp_reg, tmp_val | 0x0c000000);
+               iounmap(tmp_reg);
+       }
+
        if (!mii_mng_configured) {
-               ucc_set_qe_mux_mii_mng(ug_info->uf_info.ucc_num);
+               ucc_set_qe_mux_mii_mng(ucc_num);
                mii_mng_configured = 1;
        }
 
@@ -4213,13 +4257,14 @@ static int ucc_geth_probe(struct device *device)
 
        ugeth->ug_info = ug_info;
        ugeth->dev = dev;
-       memcpy(dev->dev_addr, ugeth_pdata->mac_addr, 6);
+       memcpy(dev->dev_addr, get_property(np, "mac-address", NULL), 6);
 
        return 0;
 }
 
-static int ucc_geth_remove(struct device *device)
+static int ucc_geth_remove(struct of_device* ofdev)
 {
+       struct device *device = &ofdev->dev;
        struct net_device *dev = dev_get_drvdata(device);
        struct ucc_geth_private *ugeth = netdev_priv(dev);
 
@@ -4230,28 +4275,38 @@ static int ucc_geth_remove(struct device *device)
        return 0;
 }
 
-/* Structure for a device driver */
-static struct device_driver ucc_geth_driver = {
-       .name = DRV_NAME,
-       .bus = &platform_bus_type,
-       .probe = ucc_geth_probe,
-       .remove = ucc_geth_remove,
+static struct of_device_id ucc_geth_match[] = {
+       {
+               .type = "network",
+               .compatible = "ucc_geth",
+       },
+       {},
+};
+
+MODULE_DEVICE_TABLE(of, ucc_geth_match);
+
+static struct of_platform_driver ucc_geth_driver = {
+       .name           = DRV_NAME,
+       .match_table    = ucc_geth_match,
+       .probe          = ucc_geth_probe,
+       .remove         = ucc_geth_remove,
 };
 
 static int __init ucc_geth_init(void)
 {
        int i;
+
        printk(KERN_INFO "ucc_geth: " DRV_DESC "\n");
        for (i = 0; i < 8; i++)
                memcpy(&(ugeth_info[i]), &ugeth_primary_info,
                       sizeof(ugeth_primary_info));
 
-       return driver_register(&ucc_geth_driver);
+       return of_register_driver(&ucc_geth_driver);
 }
 
 static void __exit ucc_geth_exit(void)
 {
-       driver_unregister(&ucc_geth_driver);
+       of_unregister_driver(&ucc_geth_driver);
 }
 
 module_init(ucc_geth_init);
index 005965f5dd9beaa4fb209b50986c3716aad1aede..a66561253593c3a43ac6c6b8727f739c0918b042 100644 (file)
 #define ENET_INIT_PARAM_MAX_ENTRIES_RX  9
 #define ENET_INIT_PARAM_MAX_ENTRIES_TX  8
 
-typedef struct ucc_mii_mng {
+struct ucc_mii_mng {
        u32 miimcfg;            /* MII management configuration reg */
        u32 miimcom;            /* MII management command reg */
        u32 miimadd;            /* MII management address reg */
        u32 miimcon;            /* MII management control reg */
        u32 miimstat;           /* MII management status reg */
        u32 miimind;            /* MII management indication reg */
-} __attribute__ ((packed)) ucc_mii_mng_t;
+} __attribute__ ((packed));
 
-typedef struct ucc_geth {
-       ucc_fast_t uccf;
+struct ucc_geth {
+       struct ucc_fast uccf;
 
        u32 maccfg1;            /* mac configuration reg. 1 */
        u32 maccfg2;            /* mac configuration reg. 2 */
        u32 ipgifg;             /* interframe gap reg.  */
        u32 hafdup;             /* half-duplex reg.  */
        u8 res1[0x10];
-       ucc_mii_mng_t miimng;   /* MII management structure */
+       struct ucc_mii_mng miimng;      /* MII management structure */
        u32 ifctl;              /* interface control reg */
        u32 ifstat;             /* interface statux reg */
        u32 macstnaddr1;        /* mac station address part 1 reg */
@@ -111,7 +111,7 @@ typedef struct ucc_geth {
        u32 scar;               /* Statistics carry register */
        u32 scam;               /* Statistics caryy mask register */
        u8 res5[0x200 - 0x1c4];
-} __attribute__ ((packed)) ucc_geth_t;
+} __attribute__ ((packed));
 
 /* UCC GETH TEMODR Register */
 #define TEMODER_TX_RMON_STATISTICS_ENABLE       0x0100 /* enable Tx statistics
@@ -508,39 +508,39 @@ typedef struct ucc_geth {
 /* UCC GETH UDSR (Data Synchronization Register) */
 #define UDSR_MAGIC                              0x067E
 
-typedef struct ucc_geth_thread_data_tx {
+struct ucc_geth_thread_data_tx {
        u8 res0[104];
-} __attribute__ ((packed)) ucc_geth_thread_data_tx_t;
+} __attribute__ ((packed));
 
-typedef struct ucc_geth_thread_data_rx {
+struct ucc_geth_thread_data_rx {
        u8 res0[40];
-} __attribute__ ((packed)) ucc_geth_thread_data_rx_t;
+} __attribute__ ((packed));
 
 /* Send Queue Queue-Descriptor */
-typedef struct ucc_geth_send_queue_qd {
+struct ucc_geth_send_queue_qd {
        u32 bd_ring_base;       /* pointer to BD ring base address */
        u8 res0[0x8];
        u32 last_bd_completed_address;/* initialize to last entry in BD ring */
        u8 res1[0x30];
-} __attribute__ ((packed)) ucc_geth_send_queue_qd_t;
+} __attribute__ ((packed));
 
-typedef struct ucc_geth_send_queue_mem_region {
-       ucc_geth_send_queue_qd_t sqqd[NUM_TX_QUEUES];
-} __attribute__ ((packed)) ucc_geth_send_queue_mem_region_t;
+struct ucc_geth_send_queue_mem_region {
+       struct ucc_geth_send_queue_qd sqqd[NUM_TX_QUEUES];
+} __attribute__ ((packed));
 
-typedef struct ucc_geth_thread_tx_pram {
+struct ucc_geth_thread_tx_pram {
        u8 res0[64];
-} __attribute__ ((packed)) ucc_geth_thread_tx_pram_t;
+} __attribute__ ((packed));
 
-typedef struct ucc_geth_thread_rx_pram {
+struct ucc_geth_thread_rx_pram {
        u8 res0[128];
-} __attribute__ ((packed)) ucc_geth_thread_rx_pram_t;
+} __attribute__ ((packed));
 
 #define THREAD_RX_PRAM_ADDITIONAL_FOR_EXTENDED_FILTERING        64
 #define THREAD_RX_PRAM_ADDITIONAL_FOR_EXTENDED_FILTERING_8      64
 #define THREAD_RX_PRAM_ADDITIONAL_FOR_EXTENDED_FILTERING_16     96
 
-typedef struct ucc_geth_scheduler {
+struct ucc_geth_scheduler {
        u16 cpucount0;          /* CPU packet counter */
        u16 cpucount1;          /* CPU packet counter */
        u16 cecount0;           /* QE packet counter */
@@ -574,9 +574,9 @@ typedef struct ucc_geth_scheduler {
                                      /**< weight factor for queues   */
        u32 minw;               /* temporary variable handled by QE */
        u8 res1[0x70 - 0x64];
-} __attribute__ ((packed)) ucc_geth_scheduler_t;
+} __attribute__ ((packed));
 
-typedef struct ucc_geth_tx_firmware_statistics_pram {
+struct ucc_geth_tx_firmware_statistics_pram {
        u32 sicoltx;            /* single collision */
        u32 mulcoltx;           /* multiple collision */
        u32 latecoltxfr;        /* late collision */
@@ -596,9 +596,9 @@ typedef struct ucc_geth_tx_firmware_statistics_pram {
                                   and 1518 octets */
        u32 txpktsjumbo;        /* total packets (including bad) between 1024
                                   and MAXLength octets */
-} __attribute__ ((packed)) ucc_geth_tx_firmware_statistics_pram_t;
+} __attribute__ ((packed));
 
-typedef struct ucc_geth_rx_firmware_statistics_pram {
+struct ucc_geth_rx_firmware_statistics_pram {
        u32 frrxfcser;          /* frames with crc error */
        u32 fraligner;          /* frames with alignment error */
        u32 inrangelenrxer;     /* in range length error */
@@ -630,33 +630,33 @@ typedef struct ucc_geth_rx_firmware_statistics_pram {
                                   replaced */
        u32 insertvlan;         /* total frames that had their VLAN tag
                                   inserted */
-} __attribute__ ((packed)) ucc_geth_rx_firmware_statistics_pram_t;
+} __attribute__ ((packed));
 
-typedef struct ucc_geth_rx_interrupt_coalescing_entry {
+struct ucc_geth_rx_interrupt_coalescing_entry {
        u32 interruptcoalescingmaxvalue;        /* interrupt coalescing max
                                                   value */
        u32 interruptcoalescingcounter; /* interrupt coalescing counter,
                                           initialize to
                                           interruptcoalescingmaxvalue */
-} __attribute__ ((packed)) ucc_geth_rx_interrupt_coalescing_entry_t;
+} __attribute__ ((packed));
 
-typedef struct ucc_geth_rx_interrupt_coalescing_table {
-       ucc_geth_rx_interrupt_coalescing_entry_t coalescingentry[NUM_RX_QUEUES];
+struct ucc_geth_rx_interrupt_coalescing_table {
+       struct ucc_geth_rx_interrupt_coalescing_entry coalescingentry[NUM_RX_QUEUES];
                                       /**< interrupt coalescing entry */
-} __attribute__ ((packed)) ucc_geth_rx_interrupt_coalescing_table_t;
+} __attribute__ ((packed));
 
-typedef struct ucc_geth_rx_prefetched_bds {
-       qe_bd_t bd[NUM_BDS_IN_PREFETCHED_BDS];  /* prefetched bd */
-} __attribute__ ((packed)) ucc_geth_rx_prefetched_bds_t;
+struct ucc_geth_rx_prefetched_bds {
+       struct qe_bd bd[NUM_BDS_IN_PREFETCHED_BDS];     /* prefetched bd */
+} __attribute__ ((packed));
 
-typedef struct ucc_geth_rx_bd_queues_entry {
+struct ucc_geth_rx_bd_queues_entry {
        u32 bdbaseptr;          /* BD base pointer */
        u32 bdptr;              /* BD pointer */
        u32 externalbdbaseptr;  /* external BD base pointer */
        u32 externalbdptr;      /* external BD pointer */
-} __attribute__ ((packed)) ucc_geth_rx_bd_queues_entry_t;
+} __attribute__ ((packed));
 
-typedef struct ucc_geth_tx_global_pram {
+struct ucc_geth_tx_global_pram {
        u16 temoder;
        u8 res0[0x38 - 0x02];
        u32 sqptr;              /* a base pointer to send queue memory region */
@@ -670,15 +670,15 @@ typedef struct ucc_geth_tx_global_pram {
        u32 tqptr;              /* a base pointer to the Tx Queues Memory
                                   Region */
        u8 res2[0x80 - 0x74];
-} __attribute__ ((packed)) ucc_geth_tx_global_pram_t;
+} __attribute__ ((packed));
 
 /* structure representing Extended Filtering Global Parameters in PRAM */
-typedef struct ucc_geth_exf_global_pram {
+struct ucc_geth_exf_global_pram {
        u32 l2pcdptr;           /* individual address filter, high */
        u8 res0[0x10 - 0x04];
-} __attribute__ ((packed)) ucc_geth_exf_global_pram_t;
+} __attribute__ ((packed));
 
-typedef struct ucc_geth_rx_global_pram {
+struct ucc_geth_rx_global_pram {
        u32 remoder;            /* ethernet mode reg. */
        u32 rqptr;              /* base pointer to the Rx Queues Memory Region*/
        u32 res0[0x1];
@@ -710,12 +710,12 @@ typedef struct ucc_geth_rx_global_pram {
        u32 exfGlobalParam;     /* base address for extended filtering global
                                   parameters */
        u8 res6[0x100 - 0xC4];  /* Initialize to zero */
-} __attribute__ ((packed)) ucc_geth_rx_global_pram_t;
+} __attribute__ ((packed));
 
 #define GRACEFUL_STOP_ACKNOWLEDGE_RX            0x01
 
 /* structure representing InitEnet command */
-typedef struct ucc_geth_init_pram {
+struct ucc_geth_init_pram {
        u8 resinit1;
        u8 resinit2;
        u8 resinit3;
@@ -729,7 +729,7 @@ typedef struct ucc_geth_init_pram {
        u32 txglobal;           /* tx global */
        u32 txthread[ENET_INIT_PARAM_MAX_ENTRIES_TX];   /* tx threads */
        u8 res3[0x1];
-} __attribute__ ((packed)) ucc_geth_init_pram_t;
+} __attribute__ ((packed));
 
 #define ENET_INIT_PARAM_RGF_SHIFT               (32 - 4)
 #define ENET_INIT_PARAM_TGF_SHIFT               (32 - 8)
@@ -746,27 +746,27 @@ typedef struct ucc_geth_init_pram {
 #define ENET_INIT_PARAM_MAGIC_RES_INIT5         0x0400
 
 /* structure representing 82xx Address Filtering Enet Address in PRAM */
-typedef struct ucc_geth_82xx_enet_address {
+struct ucc_geth_82xx_enet_address {
        u8 res1[0x2];
        u16 h;                  /* address (MSB) */
        u16 m;                  /* address */
        u16 l;                  /* address (LSB) */
-} __attribute__ ((packed)) ucc_geth_82xx_enet_address_t;
+} __attribute__ ((packed));
 
 /* structure representing 82xx Address Filtering PRAM */
-typedef struct ucc_geth_82xx_address_filtering_pram {
+struct ucc_geth_82xx_address_filtering_pram {
        u32 iaddr_h;            /* individual address filter, high */
        u32 iaddr_l;            /* individual address filter, low */
        u32 gaddr_h;            /* group address filter, high */
        u32 gaddr_l;            /* group address filter, low */
-       ucc_geth_82xx_enet_address_t taddr;
-       ucc_geth_82xx_enet_address_t paddr[NUM_OF_PADDRS];
+       struct ucc_geth_82xx_enet_address taddr;
+       struct ucc_geth_82xx_enet_address paddr[NUM_OF_PADDRS];
        u8 res0[0x40 - 0x38];
-} __attribute__ ((packed)) ucc_geth_82xx_address_filtering_pram_t;
+} __attribute__ ((packed));
 
 /* GETH Tx firmware statistics structure, used when calling
    UCC_GETH_GetStatistics. */
-typedef struct ucc_geth_tx_firmware_statistics {
+struct ucc_geth_tx_firmware_statistics {
        u32 sicoltx;            /* single collision */
        u32 mulcoltx;           /* multiple collision */
        u32 latecoltxfr;        /* late collision */
@@ -786,11 +786,11 @@ typedef struct ucc_geth_tx_firmware_statistics {
                                   and 1518 octets */
        u32 txpktsjumbo;        /* total packets (including bad) between 1024
                                   and MAXLength octets */
-} __attribute__ ((packed)) ucc_geth_tx_firmware_statistics_t;
+} __attribute__ ((packed));
 
 /* GETH Rx firmware statistics structure, used when calling
    UCC_GETH_GetStatistics. */
-typedef struct ucc_geth_rx_firmware_statistics {
+struct ucc_geth_rx_firmware_statistics {
        u32 frrxfcser;          /* frames with crc error */
        u32 fraligner;          /* frames with alignment error */
        u32 inrangelenrxer;     /* in range length error */
@@ -822,11 +822,11 @@ typedef struct ucc_geth_rx_firmware_statistics {
                                   replaced */
        u32 insertvlan;         /* total frames that had their VLAN tag
                                   inserted */
-} __attribute__ ((packed)) ucc_geth_rx_firmware_statistics_t;
+} __attribute__ ((packed));
 
 /* GETH hardware statistics structure, used when calling
    UCC_GETH_GetStatistics. */
-typedef struct ucc_geth_hardware_statistics {
+struct ucc_geth_hardware_statistics {
        u32 tx64;               /* Total number of frames (including bad
                                   frames) transmitted that were exactly of the
                                   minimal length (64 for un tagged, 68 for
@@ -871,7 +871,7 @@ typedef struct ucc_geth_hardware_statistics {
        u32 rbca;               /* Total number of frames received succesfully
                                   that had destination address equal to the
                                   broadcast address */
-} __attribute__ ((packed)) ucc_geth_hardware_statistics_t;
+} __attribute__ ((packed));
 
 /* UCC GETH Tx errors returned via TxConf callback */
 #define TX_ERRORS_DEF      0x0200
@@ -1013,21 +1013,21 @@ typedef struct ucc_geth_hardware_statistics {
                                (MIIMCFG_MANAGEMENT_CLOCK_DIVIDE_BY_112)
 
 /* Ethernet speed */
-typedef enum enet_speed {
+enum enet_speed {
        ENET_SPEED_10BT,        /* 10 Base T */
        ENET_SPEED_100BT,       /* 100 Base T */
        ENET_SPEED_1000BT       /* 1000 Base T */
-} enet_speed_e;
+};
 
 /* Ethernet Address Type. */
-typedef enum enet_addr_type {
+enum enet_addr_type {
        ENET_ADDR_TYPE_INDIVIDUAL,
        ENET_ADDR_TYPE_GROUP,
        ENET_ADDR_TYPE_BROADCAST
-} enet_addr_type_e;
+};
 
 /* TBI / MII Set Register */
-typedef enum enet_tbi_mii_reg {
+enum enet_tbi_mii_reg {
        ENET_TBI_MII_CR = 0x00, /* Control (CR ) */
        ENET_TBI_MII_SR = 0x01, /* Status (SR ) */
        ENET_TBI_MII_ANA = 0x04,        /* AN advertisement (ANA ) */
@@ -1040,10 +1040,10 @@ typedef enum enet_tbi_mii_reg {
        ENET_TBI_MII_EXST = 0x0F,       /* Extended status (EXST ) */
        ENET_TBI_MII_JD = 0x10, /* Jitter diagnostics (JD ) */
        ENET_TBI_MII_TBICON = 0x11      /* TBI control (TBICON ) */
-} enet_tbi_mii_reg_e;
+};
 
 /* UCC GETH 82xx Ethernet Address Recognition Location */
-typedef enum ucc_geth_enet_address_recognition_location {
+enum ucc_geth_enet_address_recognition_location {
        UCC_GETH_ENET_ADDRESS_RECOGNITION_LOCATION_STATION_ADDRESS,/* station
                                                                      address */
        UCC_GETH_ENET_ADDRESS_RECOGNITION_LOCATION_PADDR_FIRST, /* additional
@@ -1065,10 +1065,10 @@ typedef enum ucc_geth_enet_address_recognition_location {
        UCC_GETH_ENET_ADDRESS_RECOGNITION_LOCATION_GROUP_HASH,  /* group hash */
        UCC_GETH_ENET_ADDRESS_RECOGNITION_LOCATION_INDIVIDUAL_HASH /* individual
                                                                      hash */
-} ucc_geth_enet_address_recognition_location_e;
+};
 
 /* UCC GETH vlan operation tagged */
-typedef enum ucc_geth_vlan_operation_tagged {
+enum ucc_geth_vlan_operation_tagged {
        UCC_GETH_VLAN_OPERATION_TAGGED_NOP = 0x0,       /* Tagged - nop */
        UCC_GETH_VLAN_OPERATION_TAGGED_REPLACE_VID_PORTION_OF_Q_TAG
                = 0x1,  /* Tagged - replace vid portion of q tag */
@@ -1076,18 +1076,18 @@ typedef enum ucc_geth_vlan_operation_tagged {
                = 0x2,  /* Tagged - if vid0 replace vid with default value  */
        UCC_GETH_VLAN_OPERATION_TAGGED_EXTRACT_Q_TAG_FROM_FRAME
                = 0x3   /* Tagged - extract q tag from frame */
-} ucc_geth_vlan_operation_tagged_e;
+};
 
 /* UCC GETH vlan operation non-tagged */
-typedef enum ucc_geth_vlan_operation_non_tagged {
+enum ucc_geth_vlan_operation_non_tagged {
        UCC_GETH_VLAN_OPERATION_NON_TAGGED_NOP = 0x0,   /* Non tagged - nop */
        UCC_GETH_VLAN_OPERATION_NON_TAGGED_Q_TAG_INSERT = 0x1   /* Non tagged -
                                                                   q tag insert
                                                                 */
-} ucc_geth_vlan_operation_non_tagged_e;
+};
 
 /* UCC GETH Rx Quality of Service Mode */
-typedef enum ucc_geth_qos_mode {
+enum ucc_geth_qos_mode {
        UCC_GETH_QOS_MODE_DEFAULT = 0x0,        /* default queue */
        UCC_GETH_QOS_MODE_QUEUE_NUM_FROM_L2_CRITERIA = 0x1,     /* queue
                                                                   determined
@@ -1097,11 +1097,11 @@ typedef enum ucc_geth_qos_mode {
                                                                   determined
                                                                   by L3
                                                                   criteria */
-} ucc_geth_qos_mode_e;
+};
 
 /* UCC GETH Statistics Gathering Mode - These are bit flags, 'or' them together
    for combined functionality */
-typedef enum ucc_geth_statistics_gathering_mode {
+enum ucc_geth_statistics_gathering_mode {
        UCC_GETH_STATISTICS_GATHERING_MODE_NONE = 0x00000000,   /* No
                                                                   statistics
                                                                   gathering */
@@ -1122,10 +1122,10 @@ typedef enum ucc_geth_statistics_gathering_mode {
                                                                      statistics
                                                                      gathering
                                                                    */
-} ucc_geth_statistics_gathering_mode_e;
+};
 
 /* UCC GETH Pad and CRC Mode - Note, Padding without CRC is not possible */
-typedef enum ucc_geth_maccfg2_pad_and_crc_mode {
+enum ucc_geth_maccfg2_pad_and_crc_mode {
        UCC_GETH_PAD_AND_CRC_MODE_NONE
                = MACCFG2_PAD_AND_CRC_MODE_NONE,        /* Neither Padding
                                                           short frames
@@ -1135,61 +1135,59 @@ typedef enum ucc_geth_maccfg2_pad_and_crc_mode {
                                                           CRC only */
        UCC_GETH_PAD_AND_CRC_MODE_PAD_AND_CRC =
            MACCFG2_PAD_AND_CRC_MODE_PAD_AND_CRC
-} ucc_geth_maccfg2_pad_and_crc_mode_e;
+};
 
 /* UCC GETH upsmr Flow Control Mode */
-typedef enum ucc_geth_flow_control_mode {
+enum ucc_geth_flow_control_mode {
        UPSMR_AUTOMATIC_FLOW_CONTROL_MODE_NONE = 0x00000000,    /* No automatic
                                                                   flow control
                                                                 */
        UPSMR_AUTOMATIC_FLOW_CONTROL_MODE_PAUSE_WHEN_EMERGENCY
                = 0x00004000    /* Send pause frame when RxFIFO reaches its
                                   emergency threshold */
-} ucc_geth_flow_control_mode_e;
+};
 
 /* UCC GETH number of threads */
-typedef enum ucc_geth_num_of_threads {
+enum ucc_geth_num_of_threads {
        UCC_GETH_NUM_OF_THREADS_1 = 0x1,        /* 1 */
        UCC_GETH_NUM_OF_THREADS_2 = 0x2,        /* 2 */
        UCC_GETH_NUM_OF_THREADS_4 = 0x0,        /* 4 */
        UCC_GETH_NUM_OF_THREADS_6 = 0x3,        /* 6 */
        UCC_GETH_NUM_OF_THREADS_8 = 0x4 /* 8 */
-} ucc_geth_num_of_threads_e;
+};
 
 /* UCC GETH number of station addresses */
-typedef enum ucc_geth_num_of_station_addresses {
+enum ucc_geth_num_of_station_addresses {
        UCC_GETH_NUM_OF_STATION_ADDRESSES_1,    /* 1 */
        UCC_GETH_NUM_OF_STATION_ADDRESSES_5     /* 5 */
-} ucc_geth_num_of_station_addresses_e;
-
-typedef u8 enet_addr_t[ENET_NUM_OCTETS_PER_ADDRESS];
+};
 
 /* UCC GETH 82xx Ethernet Address Container */
-typedef struct enet_addr_container {
-       enet_addr_t address;    /* ethernet address */
-       ucc_geth_enet_address_recognition_location_e location;  /* location in
+struct enet_addr_container {
+       u8 address[ENET_NUM_OCTETS_PER_ADDRESS];        /* ethernet address */
+       enum ucc_geth_enet_address_recognition_location location;       /* location in
                                                                   82xx address
                                                                   recognition
                                                                   hardware */
        struct list_head node;
-} enet_addr_container_t;
+};
 
-#define ENET_ADDR_CONT_ENTRY(ptr) list_entry(ptr, enet_addr_container_t, node)
+#define ENET_ADDR_CONT_ENTRY(ptr) list_entry(ptr, struct enet_addr_container, node)
 
 /* UCC GETH Termination Action Descriptor (TAD) structure. */
-typedef struct ucc_geth_tad_params {
+struct ucc_geth_tad_params {
        int rx_non_dynamic_extended_features_mode;
        int reject_frame;
-       ucc_geth_vlan_operation_tagged_e vtag_op;
-       ucc_geth_vlan_operation_non_tagged_e vnontag_op;
-       ucc_geth_qos_mode_e rqos;
+       enum ucc_geth_vlan_operation_tagged vtag_op;
+       enum ucc_geth_vlan_operation_non_tagged vnontag_op;
+       enum ucc_geth_qos_mode rqos;
        u8 vpri;
        u16 vid;
-} ucc_geth_tad_params_t;
+};
 
 /* GETH protocol initialization structure */
-typedef struct ucc_geth_info {
-       ucc_fast_info_t uf_info;
+struct ucc_geth_info {
+       struct ucc_fast_info uf_info;
        u8 numQueuesTx;
        u8 numQueuesRx;
        int ipCheckSumCheck;
@@ -1251,51 +1249,51 @@ typedef struct ucc_geth_info {
        u8 iphoffset[TX_IP_OFFSET_ENTRY_MAX];
        u16 bdRingLenTx[NUM_TX_QUEUES];
        u16 bdRingLenRx[NUM_RX_QUEUES];
-       enet_interface_e enet_interface;
-       ucc_geth_num_of_station_addresses_e numStationAddresses;
-        qe_fltr_largest_external_tbl_lookup_key_size_e
+       enum enet_interface enet_interface;
+       enum ucc_geth_num_of_station_addresses numStationAddresses;
+       enum qe_fltr_largest_external_tbl_lookup_key_size
            largestexternallookupkeysize;
-       ucc_geth_statistics_gathering_mode_e statisticsMode;
-       ucc_geth_vlan_operation_tagged_e vlanOperationTagged;
-       ucc_geth_vlan_operation_non_tagged_e vlanOperationNonTagged;
-       ucc_geth_qos_mode_e rxQoSMode;
-       ucc_geth_flow_control_mode_e aufc;
-       ucc_geth_maccfg2_pad_and_crc_mode_e padAndCrc;
-       ucc_geth_num_of_threads_e numThreadsTx;
-       ucc_geth_num_of_threads_e numThreadsRx;
-       qe_risc_allocation_e riscTx;
-       qe_risc_allocation_e riscRx;
-} ucc_geth_info_t;
+       enum ucc_geth_statistics_gathering_mode statisticsMode;
+       enum ucc_geth_vlan_operation_tagged vlanOperationTagged;
+       enum ucc_geth_vlan_operation_non_tagged vlanOperationNonTagged;
+       enum ucc_geth_qos_mode rxQoSMode;
+       enum ucc_geth_flow_control_mode aufc;
+       enum ucc_geth_maccfg2_pad_and_crc_mode padAndCrc;
+       enum ucc_geth_num_of_threads numThreadsTx;
+       enum ucc_geth_num_of_threads numThreadsRx;
+       enum qe_risc_allocation riscTx;
+       enum qe_risc_allocation riscRx;
+};
 
 /* structure representing UCC GETH */
-typedef struct ucc_geth_private {
-       ucc_geth_info_t *ug_info;
-       ucc_fast_private_t *uccf;
+struct ucc_geth_private {
+       struct ucc_geth_info *ug_info;
+       struct ucc_fast_private *uccf;
        struct net_device *dev;
        struct net_device_stats stats;  /* linux network statistics */
-       ucc_geth_t *ug_regs;
-       ucc_geth_init_pram_t *p_init_enet_param_shadow;
-       ucc_geth_exf_global_pram_t *p_exf_glbl_param;
+       struct ucc_geth *ug_regs;
+       struct ucc_geth_init_pram *p_init_enet_param_shadow;
+       struct ucc_geth_exf_global_pram *p_exf_glbl_param;
        u32 exf_glbl_param_offset;
-       ucc_geth_rx_global_pram_t *p_rx_glbl_pram;
+       struct ucc_geth_rx_global_pram *p_rx_glbl_pram;
        u32 rx_glbl_pram_offset;
-       ucc_geth_tx_global_pram_t *p_tx_glbl_pram;
+       struct ucc_geth_tx_global_pram *p_tx_glbl_pram;
        u32 tx_glbl_pram_offset;
-       ucc_geth_send_queue_mem_region_t *p_send_q_mem_reg;
+       struct ucc_geth_send_queue_mem_region *p_send_q_mem_reg;
        u32 send_q_mem_reg_offset;
-       ucc_geth_thread_data_tx_t *p_thread_data_tx;
+       struct ucc_geth_thread_data_tx *p_thread_data_tx;
        u32 thread_dat_tx_offset;
-       ucc_geth_thread_data_rx_t *p_thread_data_rx;
+       struct ucc_geth_thread_data_rx *p_thread_data_rx;
        u32 thread_dat_rx_offset;
-       ucc_geth_scheduler_t *p_scheduler;
+       struct ucc_geth_scheduler *p_scheduler;
        u32 scheduler_offset;
-       ucc_geth_tx_firmware_statistics_pram_t *p_tx_fw_statistics_pram;
+       struct ucc_geth_tx_firmware_statistics_pram *p_tx_fw_statistics_pram;
        u32 tx_fw_statistics_pram_offset;
-       ucc_geth_rx_firmware_statistics_pram_t *p_rx_fw_statistics_pram;
+       struct ucc_geth_rx_firmware_statistics_pram *p_rx_fw_statistics_pram;
        u32 rx_fw_statistics_pram_offset;
-       ucc_geth_rx_interrupt_coalescing_table_t *p_rx_irq_coalescing_tbl;
+       struct ucc_geth_rx_interrupt_coalescing_table *p_rx_irq_coalescing_tbl;
        u32 rx_irq_coalescing_tbl_offset;
-       ucc_geth_rx_bd_queues_entry_t *p_rx_bd_qs_tbl;
+       struct ucc_geth_rx_bd_queues_entry *p_rx_bd_qs_tbl;
        u32 rx_bd_qs_tbl_offset;
        u8 *p_tx_bd_ring[NUM_TX_QUEUES];
        u32 tx_bd_ring_offset[NUM_TX_QUEUES];
@@ -1308,7 +1306,7 @@ typedef struct ucc_geth_private {
        u16 cpucount[NUM_TX_QUEUES];
        volatile u16 *p_cpucount[NUM_TX_QUEUES];
        int indAddrRegUsed[NUM_OF_PADDRS];
-       enet_addr_t paddr[NUM_OF_PADDRS];
+       u8 paddr[NUM_OF_PADDRS][ENET_NUM_OCTETS_PER_ADDRESS];   /* ethernet address */
        u8 numGroupAddrInHash;
        u8 numIndAddrInHash;
        u8 numIndAddrInReg;
@@ -1334,6 +1332,6 @@ typedef struct ucc_geth_private {
        int oldspeed;
        int oldduplex;
        int oldlink;
-} ucc_geth_private_t;
+};
 
 #endif                         /* __UCC_GETH_H__ */
index 67260eb3188af2d771e1966af647a118b789fa1d..5360ec05eaa331b256f199714caba1df0b2c60e8 100644 (file)
@@ -42,7 +42,6 @@
 
 #include "ucc_geth.h"
 #include "ucc_geth_phy.h"
-#include <platforms/83xx/mpc8360e_pb.h>
 
 #define ugphy_printk(level, format, arg...)  \
         printk(level format "\n", ## arg)
@@ -72,16 +71,14 @@ static int genmii_read_status(struct ugeth_mii_info *mii_info);
 u16 phy_read(struct ugeth_mii_info *mii_info, u16 regnum);
 void phy_write(struct ugeth_mii_info *mii_info, u16 regnum, u16 val);
 
-static u8 *bcsr_regs = NULL;
-
 /* Write value to the PHY for this device to the register at regnum, */
 /* waiting until the write is done before it returns.  All PHY */
 /* configuration has to be done through the TSEC1 MIIM regs */
 void write_phy_reg(struct net_device *dev, int mii_id, int regnum, int value)
 {
-       ucc_geth_private_t *ugeth = netdev_priv(dev);
-       ucc_mii_mng_t *mii_regs;
-       enet_tbi_mii_reg_e mii_reg = (enet_tbi_mii_reg_e) regnum;
+       struct ucc_geth_private *ugeth = netdev_priv(dev);
+       struct ucc_mii_mng *mii_regs;
+       enum enet_tbi_mii_reg mii_reg = (enum enet_tbi_mii_reg) regnum;
        u32 tmp_reg;
 
        ugphy_vdbg("%s: IN", __FUNCTION__);
@@ -116,9 +113,9 @@ void write_phy_reg(struct net_device *dev, int mii_id, int regnum, int value)
 /* configuration has to be done through the TSEC1 MIIM regs */
 int read_phy_reg(struct net_device *dev, int mii_id, int regnum)
 {
-       ucc_geth_private_t *ugeth = netdev_priv(dev);
-       ucc_mii_mng_t *mii_regs;
-       enet_tbi_mii_reg_e mii_reg = (enet_tbi_mii_reg_e) regnum;
+       struct ucc_geth_private *ugeth = netdev_priv(dev);
+       struct ucc_mii_mng *mii_regs;
+       enum enet_tbi_mii_reg mii_reg = (enum enet_tbi_mii_reg) regnum;
        u32 tmp_reg;
        u16 value;
 
@@ -634,11 +631,6 @@ static void dm9161_close(struct ugeth_mii_info *mii_info)
 
 static int dm9161_ack_interrupt(struct ugeth_mii_info *mii_info)
 {
-/* FIXME: This lines are for BUG fixing in the mpc8325.
-Remove this from here when it's fixed */
-       if (bcsr_regs == NULL)
-               bcsr_regs = (u8 *) ioremap(BCSR_PHYS_ADDR, BCSR_SIZE);
-       bcsr_regs[14] |= 0x40;
        ugphy_vdbg("%s: IN", __FUNCTION__);
 
        /* Clear the interrupts by reading the reg */
@@ -650,12 +642,6 @@ Remove this from here when it's fixed */
 
 static int dm9161_config_intr(struct ugeth_mii_info *mii_info)
 {
-/* FIXME: This lines are for BUG fixing in the mpc8325.
-Remove this from here when it's fixed */
-       if (bcsr_regs == NULL) {
-               bcsr_regs = (u8 *) ioremap(BCSR_PHYS_ADDR, BCSR_SIZE);
-               bcsr_regs[14] &= ~0x40;
-       }
        ugphy_vdbg("%s: IN", __FUNCTION__);
 
        if (mii_info->interrupts == MII_INTERRUPT_ENABLED)
index 2f98b8f1bb0ad16c84af7c07ef5b136f9ae1d6c2..f5740783670ff540e553fd0c23cc54a3603ba8a3 100644 (file)
@@ -126,7 +126,7 @@ struct ugeth_mii_info {
        /* And management functions */
        struct phy_info *phyinfo;
 
-       ucc_mii_mng_t *mii_regs;
+       struct ucc_mii_mng *mii_regs;
 
        /* forced speed & duplex (no autoneg)
         * partner speed & duplex & pause (autoneg)
index 5823e3bca178e85e5dbd760020f6d281c08b3d56..36d1c3ff7078d28c91827e5af3d99644df09c0e0 100644 (file)
@@ -2867,7 +2867,6 @@ static int ch_config(pc300dev_t * d)
        uclong clktype = chan->conf.phys_settings.clock_type;
        ucshort encoding = chan->conf.proto_settings.encoding;
        ucshort parity = chan->conf.proto_settings.parity;   
-       int tmc, br;
        ucchar md0, md2;
     
        /* Reset the channel */
@@ -2940,8 +2939,12 @@ static int ch_config(pc300dev_t * d)
                case PC300_RSV:
                case PC300_X21:
                        if (clktype == CLOCK_INT || clktype == CLOCK_TXINT) {
+                               int tmc, br;
+
                                /* Calculate the clkrate parameters */
                                tmc = clock_rate_calc(clkrate, card->hw.clock, &br);
+                               if (tmc < 0)
+                                       return -EIO;
                                cpc_writeb(scabase + M_REG(TMCT, ch), tmc);
                                cpc_writeb(scabase + M_REG(TXS, ch),
                                           (TXS_DTRXC | TXS_IBRG | br));
@@ -3097,14 +3100,16 @@ static int cpc_attach(struct net_device *dev, unsigned short encoding,
        return 0;
 }
 
-static void cpc_opench(pc300dev_t * d)
+static int cpc_opench(pc300dev_t * d)
 {
        pc300ch_t *chan = (pc300ch_t *) d->chan;
        pc300_t *card = (pc300_t *) chan->card;
-       int ch = chan->channel;
+       int ch = chan->channel, rc;
        void __iomem *scabase = card->hw.scabase;
 
-       ch_config(d);
+       rc = ch_config(d);
+       if (rc)
+               return rc;
 
        rx_config(d);
 
@@ -3113,6 +3118,8 @@ static void cpc_opench(pc300dev_t * d)
        /* Assert RTS and DTR */
        cpc_writeb(scabase + M_REG(CTL, ch),
                   cpc_readb(scabase + M_REG(CTL, ch)) & ~(CTL_RTS | CTL_DTR));
+
+       return 0;
 }
 
 static void cpc_closech(pc300dev_t * d)
@@ -3168,9 +3175,16 @@ int cpc_open(struct net_device *dev)
        }
 
        sprintf(ifr.ifr_name, "%s", dev->name);
-       cpc_opench(d);
+       result = cpc_opench(d);
+       if (result)
+               goto err_out;
+
        netif_start_queue(dev);
        return 0;
+
+err_out:
+       hdlc_close(dev);
+       return result;
 }
 
 static int cpc_close(struct net_device *dev)
index 0a33c8a56e13b061f0d1a6b7a96ae0e4848cf149..efcdaf1c5f735fd7b5619a2c39ae221b6e0708f4 100644 (file)
@@ -2897,6 +2897,8 @@ static struct net_device *_init_airo_card( unsigned short irq, int port,
                goto err_out_map;
        }
        ai->wifidev = init_wifidev(ai, dev);
+       if (!ai->wifidev)
+               goto err_out_reg;
 
        set_bit(FLAG_REGISTERED,&ai->flags);
        airo_print_info(dev->name, "MAC enabled %x:%x:%x:%x:%x:%x",
@@ -2908,11 +2910,18 @@ static struct net_device *_init_airo_card( unsigned short irq, int port,
                for( i = 0; i < MAX_FIDS; i++ )
                        ai->fids[i] = transmit_allocate(ai,AIRO_DEF_MTU,i>=MAX_FIDS/2);
 
-       setup_proc_entry( dev, dev->priv ); /* XXX check for failure */
+       if (setup_proc_entry(dev, dev->priv) < 0)
+               goto err_out_wifi;
+
        netif_start_queue(dev);
        SET_MODULE_OWNER(dev);
        return dev;
 
+err_out_wifi:
+       unregister_netdev(ai->wifidev);
+       free_netdev(ai->wifidev);
+err_out_reg:
+       unregister_netdev(dev);
 err_out_map:
        if (test_bit(FLAG_MPI,&ai->flags) && pci) {
                pci_free_consistent(pci, PCI_SHARED_LEN, ai->shared, ai->shared_dma);
@@ -3089,7 +3098,8 @@ static int airo_thread(void *data) {
                                                set_bit(JOB_AUTOWEP, &ai->jobs);
                                                break;
                                        }
-                                       if (!kthread_should_stop()) {
+                                       if (!kthread_should_stop() &&
+                                           !freezing(current)) {
                                                unsigned long wake_at;
                                                if (!ai->expires || !ai->scan_timeout) {
                                                        wake_at = max(ai->expires,
@@ -3101,7 +3111,8 @@ static int airo_thread(void *data) {
                                                schedule_timeout(wake_at - jiffies);
                                                continue;
                                        }
-                               } else if (!kthread_should_stop()) {
+                               } else if (!kthread_should_stop() &&
+                                          !freezing(current)) {
                                        schedule();
                                        continue;
                                }
@@ -4495,91 +4506,128 @@ static int setup_proc_entry( struct net_device *dev,
        apriv->proc_entry = create_proc_entry(apriv->proc_name,
                                              S_IFDIR|airo_perm,
                                              airo_entry);
-        apriv->proc_entry->uid = proc_uid;
-        apriv->proc_entry->gid = proc_gid;
-        apriv->proc_entry->owner = THIS_MODULE;
+       if (!apriv->proc_entry)
+               goto fail;
+       apriv->proc_entry->uid = proc_uid;
+       apriv->proc_entry->gid = proc_gid;
+       apriv->proc_entry->owner = THIS_MODULE;
 
        /* Setup the StatsDelta */
        entry = create_proc_entry("StatsDelta",
                                  S_IFREG | (S_IRUGO&proc_perm),
                                  apriv->proc_entry);
-        entry->uid = proc_uid;
-        entry->gid = proc_gid;
+       if (!entry)
+               goto fail_stats_delta;
+       entry->uid = proc_uid;
+       entry->gid = proc_gid;
        entry->data = dev;
-        entry->owner = THIS_MODULE;
+       entry->owner = THIS_MODULE;
        SETPROC_OPS(entry, proc_statsdelta_ops);
 
        /* Setup the Stats */
        entry = create_proc_entry("Stats",
                                  S_IFREG | (S_IRUGO&proc_perm),
                                  apriv->proc_entry);
-        entry->uid = proc_uid;
-        entry->gid = proc_gid;
+       if (!entry)
+               goto fail_stats;
+       entry->uid = proc_uid;
+       entry->gid = proc_gid;
        entry->data = dev;
-        entry->owner = THIS_MODULE;
+       entry->owner = THIS_MODULE;
        SETPROC_OPS(entry, proc_stats_ops);
 
        /* Setup the Status */
        entry = create_proc_entry("Status",
                                  S_IFREG | (S_IRUGO&proc_perm),
                                  apriv->proc_entry);
-        entry->uid = proc_uid;
-        entry->gid = proc_gid;
+       if (!entry)
+               goto fail_status;
+       entry->uid = proc_uid;
+       entry->gid = proc_gid;
        entry->data = dev;
-        entry->owner = THIS_MODULE;
+       entry->owner = THIS_MODULE;
        SETPROC_OPS(entry, proc_status_ops);
 
        /* Setup the Config */
        entry = create_proc_entry("Config",
                                  S_IFREG | proc_perm,
                                  apriv->proc_entry);
-        entry->uid = proc_uid;
-        entry->gid = proc_gid;
+       if (!entry)
+               goto fail_config;
+       entry->uid = proc_uid;
+       entry->gid = proc_gid;
        entry->data = dev;
-        entry->owner = THIS_MODULE;
+       entry->owner = THIS_MODULE;
        SETPROC_OPS(entry, proc_config_ops);
 
        /* Setup the SSID */
        entry = create_proc_entry("SSID",
                                  S_IFREG | proc_perm,
                                  apriv->proc_entry);
-        entry->uid = proc_uid;
-        entry->gid = proc_gid;
+       if (!entry)
+               goto fail_ssid;
+       entry->uid = proc_uid;
+       entry->gid = proc_gid;
        entry->data = dev;
-        entry->owner = THIS_MODULE;
+       entry->owner = THIS_MODULE;
        SETPROC_OPS(entry, proc_SSID_ops);
 
        /* Setup the APList */
        entry = create_proc_entry("APList",
                                  S_IFREG | proc_perm,
                                  apriv->proc_entry);
-        entry->uid = proc_uid;
-        entry->gid = proc_gid;
+       if (!entry)
+               goto fail_aplist;
+       entry->uid = proc_uid;
+       entry->gid = proc_gid;
        entry->data = dev;
-        entry->owner = THIS_MODULE;
+       entry->owner = THIS_MODULE;
        SETPROC_OPS(entry, proc_APList_ops);
 
        /* Setup the BSSList */
        entry = create_proc_entry("BSSList",
                                  S_IFREG | proc_perm,
                                  apriv->proc_entry);
+       if (!entry)
+               goto fail_bsslist;
        entry->uid = proc_uid;
        entry->gid = proc_gid;
        entry->data = dev;
-        entry->owner = THIS_MODULE;
+       entry->owner = THIS_MODULE;
        SETPROC_OPS(entry, proc_BSSList_ops);
 
        /* Setup the WepKey */
        entry = create_proc_entry("WepKey",
                                  S_IFREG | proc_perm,
                                  apriv->proc_entry);
-        entry->uid = proc_uid;
-        entry->gid = proc_gid;
+       if (!entry)
+               goto fail_wepkey;
+       entry->uid = proc_uid;
+       entry->gid = proc_gid;
        entry->data = dev;
-        entry->owner = THIS_MODULE;
+       entry->owner = THIS_MODULE;
        SETPROC_OPS(entry, proc_wepkey_ops);
 
        return 0;
+
+fail_wepkey:
+       remove_proc_entry("BSSList", apriv->proc_entry);
+fail_bsslist:
+       remove_proc_entry("APList", apriv->proc_entry);
+fail_aplist:
+       remove_proc_entry("SSID", apriv->proc_entry);
+fail_ssid:
+       remove_proc_entry("Config", apriv->proc_entry);
+fail_config:
+       remove_proc_entry("Status", apriv->proc_entry);
+fail_status:
+       remove_proc_entry("Stats", apriv->proc_entry);
+fail_stats:
+       remove_proc_entry("StatsDelta", apriv->proc_entry);
+fail_stats_delta:
+       remove_proc_entry(apriv->proc_name, airo_entry);
+fail:
+       return -ENOMEM;
 }
 
 static int takedown_proc_entry( struct net_device *dev,
@@ -5924,7 +5972,6 @@ static int airo_get_essid(struct net_device *dev,
 
        /* Get the current SSID */
        memcpy(extra, status_rid.SSID, status_rid.SSIDlen);
-       extra[status_rid.SSIDlen] = '\0';
        /* If none, we may want to get the one that was set */
 
        /* Push it out ! */
index 31eed85de60f198c33db0c536592c68ec323a02a..0c07b8b7250d604b8ffd453b947020c9aec3ae46 100644 (file)
@@ -1678,11 +1678,9 @@ static int atmel_get_essid(struct net_device *dev,
        /* Get the current SSID */
        if (priv->new_SSID_size != 0) {
                memcpy(extra, priv->new_SSID, priv->new_SSID_size);
-               extra[priv->new_SSID_size] = '\0';
                dwrq->length = priv->new_SSID_size;
        } else {
                memcpy(extra, priv->SSID, priv->SSID_size);
-               extra[priv->SSID_size] = '\0';
                dwrq->length = priv->SSID_size;
        }
 
index 76e3aed4b4711893a4cd96fc8ef6a06af20fc35d..978ed099e2852e45fa20c08a3bebf2011b927a0e 100644 (file)
@@ -705,11 +705,30 @@ int bcm43xx_dma_init(struct bcm43xx_private *bcm)
        struct bcm43xx_dmaring *ring;
        int err = -ENOMEM;
        int dma64 = 0;
-       u32 sbtmstatehi;
+       u64 mask = bcm43xx_get_supported_dma_mask(bcm);
+       int nobits;
 
-       sbtmstatehi = bcm43xx_read32(bcm, BCM43xx_CIR_SBTMSTATEHIGH);
-       if (sbtmstatehi & BCM43xx_SBTMSTATEHIGH_DMA64BIT)
+       if (mask == DMA_64BIT_MASK) {
                dma64 = 1;
+               nobits = 64;
+       } else if (mask == DMA_32BIT_MASK)
+               nobits = 32;
+       else
+               nobits = 30;
+       err = pci_set_dma_mask(bcm->pci_dev, mask);
+       err |= pci_set_consistent_dma_mask(bcm->pci_dev, mask);
+       if (err) {
+#ifdef CONFIG_BCM43XX_PIO
+               printk(KERN_WARNING PFX "DMA not supported on this device."
+                                       " Falling back to PIO.\n");
+               bcm->__using_pio = 1;
+               return -ENOSYS;
+#else
+               printk(KERN_ERR PFX "FATAL: DMA not supported and PIO not configured. "
+                                   "Please recompile the driver with PIO support.\n");
+               return -ENODEV;
+#endif /* CONFIG_BCM43XX_PIO */
+       }
 
        /* setup TX DMA channels. */
        ring = bcm43xx_setup_dmaring(bcm, 0, 1, dma64);
@@ -755,8 +774,7 @@ int bcm43xx_dma_init(struct bcm43xx_private *bcm)
                dma->rx_ring3 = ring;
        }
 
-       dprintk(KERN_INFO PFX "%s DMA initialized\n",
-                       dma64 ? "64-bit" : "32-bit");
+       dprintk(KERN_INFO PFX "%d-bit DMA initialized\n", nobits);
        err = 0;
 out:
        return err;
index e04bcaddd1d004d1b514a39bf047f11a963e1bbf..ea16078cfe98bd95169e626b203a77194a935ace 100644 (file)
@@ -314,6 +314,23 @@ int bcm43xx_dma_tx(struct bcm43xx_private *bcm,
                   struct ieee80211_txb *txb);
 void bcm43xx_dma_rx(struct bcm43xx_dmaring *ring);
 
+/* Helper function that returns the dma mask for this device. */
+static inline
+u64 bcm43xx_get_supported_dma_mask(struct bcm43xx_private *bcm)
+{
+       int dma64 = bcm43xx_read32(bcm, BCM43xx_CIR_SBTMSTATEHIGH) &
+                                  BCM43xx_SBTMSTATEHIGH_DMA64BIT;
+       u16 mmio_base = bcm43xx_dmacontroller_base(dma64, 0);
+       u32 mask = BCM43xx_DMA32_TXADDREXT_MASK;
+
+       if (dma64)
+               return DMA_64BIT_MASK;
+       bcm43xx_write32(bcm, mmio_base + BCM43xx_DMA32_TXCTL, mask);
+       if (bcm43xx_read32(bcm, mmio_base + BCM43xx_DMA32_TXCTL) & mask)
+               return DMA_32BIT_MASK;
+       return DMA_30BIT_MASK;
+}
+
 #else /* CONFIG_BCM43XX_DMA */
 
 
index c3f90c8563d915ee4175afe6ca8cd6a4a41627fb..2ddbec6bf15b878449e1e15b0d06e3e18d36dbbc 100644 (file)
@@ -242,7 +242,7 @@ void bcm43xx_leds_update(struct bcm43xx_private *bcm, int activity)
                        //TODO
                        break;
                case BCM43xx_LED_ASSOC:
-                       if (bcm->softmac->associated)
+                       if (bcm->softmac->associnfo.associated)
                                turn_on = 1;
                        break;
 #ifdef CONFIG_BCM43XX_DEBUG
index bad3452ea8930479af96d3791f905855e89f8bf1..a94c6d8826f874e7c4606fa6884491da897a45cf 100644 (file)
@@ -2925,10 +2925,13 @@ static int bcm43xx_wireless_core_init(struct bcm43xx_private *bcm,
                bcm43xx_write16(bcm, 0x043C, 0x000C);
 
        if (active_wlcore) {
-               if (bcm43xx_using_pio(bcm))
+               if (bcm43xx_using_pio(bcm)) {
                        err = bcm43xx_pio_init(bcm);
-               else
+               } else {
                        err = bcm43xx_dma_init(bcm);
+                       if (err == -ENOSYS)
+                               err = bcm43xx_pio_init(bcm);
+               }
                if (err)
                        goto err_chip_cleanup;
        }
@@ -3164,12 +3167,12 @@ static void bcm43xx_periodic_work_handler(void *d)
        u32 savedirqs = 0;
        int badness;
 
+       mutex_lock(&bcm->mutex);
        badness = estimate_periodic_work_badness(bcm->periodic_state);
        if (badness > BADNESS_LIMIT) {
                /* Periodic work will take a long time, so we want it to
                 * be preemtible.
                 */
-               mutex_lock(&bcm->mutex);
                netif_tx_disable(bcm->net_dev);
                spin_lock_irqsave(&bcm->irq_lock, flags);
                bcm43xx_mac_suspend(bcm);
@@ -3182,7 +3185,6 @@ static void bcm43xx_periodic_work_handler(void *d)
                /* Periodic work should take short time, so we want low
                 * locking overhead.
                 */
-               mutex_lock(&bcm->mutex);
                spin_lock_irqsave(&bcm->irq_lock, flags);
        }
 
@@ -3993,8 +3995,6 @@ static int bcm43xx_init_private(struct bcm43xx_private *bcm,
                                struct net_device *net_dev,
                                struct pci_dev *pci_dev)
 {
-       int err;
-
        bcm43xx_set_status(bcm, BCM43xx_STAT_UNINIT);
        bcm->ieee = netdev_priv(net_dev);
        bcm->softmac = ieee80211_priv(net_dev);
@@ -4012,22 +4012,8 @@ static int bcm43xx_init_private(struct bcm43xx_private *bcm,
                     (void (*)(unsigned long))bcm43xx_interrupt_tasklet,
                     (unsigned long)bcm);
        tasklet_disable_nosync(&bcm->isr_tasklet);
-       if (modparam_pio) {
+       if (modparam_pio)
                bcm->__using_pio = 1;
-       } else {
-               err = pci_set_dma_mask(pci_dev, DMA_30BIT_MASK);
-               err |= pci_set_consistent_dma_mask(pci_dev, DMA_30BIT_MASK);
-               if (err) {
-#ifdef CONFIG_BCM43XX_PIO
-                       printk(KERN_WARNING PFX "DMA not supported. Falling back to PIO.\n");
-                       bcm->__using_pio = 1;
-#else
-                       printk(KERN_ERR PFX "FATAL: DMA not supported and PIO not configured. "
-                                           "Recompile the driver with PIO support, please.\n");
-                       return -ENODEV;
-#endif /* CONFIG_BCM43XX_PIO */
-               }
-       }
        bcm->rts_threshold = BCM43xx_DEFAULT_RTS_THRESHOLD;
 
        /* default to sw encryption for now */
@@ -4208,7 +4194,11 @@ static int bcm43xx_resume(struct pci_dev *pdev)
        dprintk(KERN_INFO PFX "Resuming...\n");
 
        pci_set_power_state(pdev, 0);
-       pci_enable_device(pdev);
+       err = pci_enable_device(pdev);
+       if (err) {
+               printk(KERN_ERR PFX "Failure with pci_enable_device!\n");
+               return err;
+       }
        pci_restore_state(pdev);
 
        bcm43xx_chipset_attach(bcm);
index 9b7b15cf656153b20d99633019b1885a1b87513c..d27016f8c736bb77def6401028716808d870bdaa 100644 (file)
@@ -847,7 +847,7 @@ static struct iw_statistics *bcm43xx_get_wireless_stats(struct net_device *net_d
        unsigned long flags;
 
        wstats = &bcm->stats.wstats;
-       if (!mac->associated) {
+       if (!mac->associnfo.associated) {
                wstats->miss.beacon = 0;
 //             bcm->ieee->ieee_stats.tx_retry_limit_exceeded = 0; // FIXME: should this be cleared here?
                wstats->discard.retries = 0;
index b779c7dcc1a84b55e7eafa8285b3038fc015ad2e..336cabac13b392a584259f2a045bc7e673275be1 100644 (file)
@@ -2457,6 +2457,7 @@ void free_orinocodev(struct net_device *dev)
 /* Wireless extensions                                              */
 /********************************************************************/
 
+/* Return : < 0 -> error code ; >= 0 -> length */
 static int orinoco_hw_get_essid(struct orinoco_private *priv, int *active,
                                char buf[IW_ESSID_MAX_SIZE+1])
 {
@@ -2501,9 +2502,9 @@ static int orinoco_hw_get_essid(struct orinoco_private *priv, int *active,
        len = le16_to_cpu(essidbuf.len);
        BUG_ON(len > IW_ESSID_MAX_SIZE);
 
-       memset(buf, 0, IW_ESSID_MAX_SIZE+1);
+       memset(buf, 0, IW_ESSID_MAX_SIZE);
        memcpy(buf, p, len);
-       buf[len] = '\0';
+       err = len;
 
  fail_unlock:
        orinoco_unlock(priv, &flags);
@@ -3027,17 +3028,18 @@ static int orinoco_ioctl_getessid(struct net_device *dev,
 
        if (netif_running(dev)) {
                err = orinoco_hw_get_essid(priv, &active, essidbuf);
-               if (err)
+               if (err < 0)
                        return err;
+               erq->length = err;
        } else {
                if (orinoco_lock(priv, &flags) != 0)
                        return -EBUSY;
-               memcpy(essidbuf, priv->desired_essid, IW_ESSID_MAX_SIZE + 1);
+               memcpy(essidbuf, priv->desired_essid, IW_ESSID_MAX_SIZE);
+               erq->length = strlen(priv->desired_essid);
                orinoco_unlock(priv, &flags);
        }
 
        erq->flags = 1;
-       erq->length = strlen(essidbuf);
 
        return 0;
 }
@@ -3075,10 +3077,10 @@ static int orinoco_ioctl_getnick(struct net_device *dev,
        if (orinoco_lock(priv, &flags) != 0)
                return -EBUSY;
 
-       memcpy(nickbuf, priv->nick, IW_ESSID_MAX_SIZE+1);
+       memcpy(nickbuf, priv->nick, IW_ESSID_MAX_SIZE);
        orinoco_unlock(priv, &flags);
 
-       nrq->length = strlen(nickbuf);
+       nrq->length = strlen(priv->nick);
 
        return 0;
 }
index 0b381d77015c99981f04862ed3a707d40f2798d7..7fbfc9e41d07b804dea4c7704d95da10f459f69c 100644 (file)
@@ -1198,7 +1198,6 @@ static int ray_get_essid(struct net_device *dev,
 
        /* Get the essid that was set */
        memcpy(extra, local->sparm.b5.a_current_ess_id, IW_ESSID_MAX_SIZE);
-       extra[IW_ESSID_MAX_SIZE] = '\0';
 
        /* Push it out ! */
        dwrq->length = strlen(extra);
index 30057a335a7bc6ccb17b6e645f718485fa70453d..36b29ff058141a712619e55184566b39ce414efd 100644 (file)
@@ -193,10 +193,8 @@ static void zd1201_usbrx(struct urb *urb)
        struct sk_buff *skb;
        unsigned char type;
 
-       if (!zd) {
-               free = 1;
-               goto exit;
-       }
+       if (!zd)
+               return;
 
        switch(urb->status) {
                case -EILSEQ:
index 2d12837052b03f35f49e1f4ae21aa99c831653f7..a7d29bddb298a7a7d41cc1edeb3753d15bae7037 100644 (file)
@@ -1099,7 +1099,7 @@ static void link_led_handler(void *p)
        int r;
 
        spin_lock_irq(&mac->lock);
-       is_associated = sm->associated != 0;
+       is_associated = sm->associnfo.associated != 0;
        spin_unlock_irq(&mac->lock);
 
        r = zd_chip_control_leds(chip,
index 51cb9f817c22a6f8ec6c25db2b8f9a57c97b1d65..270a33cc08f6185dddde35c79ad5f9f1364831e9 100644 (file)
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/pci.h>
+#include <linux/pci_hotplug.h>
 #include <acpi/acpi.h>
 #include <acpi/acpi_bus.h>
 #include <acpi/actypes.h>
-#include "pci_hotplug.h"
 
 #define MY_NAME        "acpi_pcihp"
 
index 7fff07e877c71982b89b672eea06b7617d89e13e..59c5b242d86de99054f0c0486cc602e337c1db00 100644 (file)
@@ -38,7 +38,7 @@
 #include <linux/acpi.h>
 #include <linux/kobject.h>     /* for KOBJ_NAME_LEN */
 #include <linux/mutex.h>
-#include "pci_hotplug.h"
+#include <linux/pci_hotplug.h>
 
 #define dbg(format, arg...)                                    \
        do {                                                    \
index e2fef60c2d06133818c413e2d37db98617e320d9..c57d9d5ce84e572e0ff39ada8fe81a6439d637e0 100644 (file)
 
 #include <linux/kernel.h>
 #include <linux/pci.h>
+#include <linux/pci_hotplug.h>
 #include <linux/slab.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
-#include "pci_hotplug.h"
 #include "acpiphp.h"
 
 #define MY_NAME        "acpiphp"
index 83e8e4412de5834fff05c3558cf911d94146f48f..c44311ac2fd36ee1de1693e8fc7695acbd2e6101 100644 (file)
 
 #include <linux/kernel.h>
 #include <linux/pci.h>
+#include <linux/pci_hotplug.h>
 #include <linux/smp_lock.h>
 #include <linux/mutex.h>
 
 #include "../pci.h"
-#include "pci_hotplug.h"
 #include "acpiphp.h"
 
 static LIST_HEAD(bridge_list);
index d0a07d9ab30c8e314dad00a2eab0becbf118d788..bd40aee10e16442b585ee374fc01ef2df476798a 100644 (file)
@@ -35,7 +35,6 @@
 #include <linux/moduleparam.h>
 
 #include "acpiphp.h"
-#include "pci_hotplug.h"
 
 #define DRIVER_VERSION "1.0.1"
 #define DRIVER_AUTHOR  "Irene Zubarev <zubarev@us.ibm.com>, Vernon Mauery <vernux@us.ibm.com>"
index d06ab4045134a5898d41d38fab9926b79b835346..684551559d4420b7b9f436ee879ceb75cf15a296 100644 (file)
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/pci.h>
+#include <linux/pci_hotplug.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/smp_lock.h>
 #include <asm/atomic.h>
 #include <linux/delay.h>
-#include "pci_hotplug.h"
 #include "cpci_hotplug.h"
 
 #define DRIVER_AUTHOR  "Scott Murray <scottm@somanetworks.com>"
index 4afcaffd031c04b3e10251101a39e29f89c03fd4..7b1beaad2752ef731a41e2be9d91e5189ce41fe8 100644 (file)
@@ -26,9 +26,9 @@
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
+#include <linux/pci_hotplug.h>
 #include <linux/proc_fs.h>
 #include "../pci.h"
-#include "pci_hotplug.h"
 #include "cpci_hotplug.h"
 
 #define MY_NAME        "cpci_hotplug"
index e847f0d6c7fea74dd00e3a757a7c2ea8b4e2d159..f3852a6b74eada8b19bc732faf27b383897a9075 100644 (file)
@@ -84,7 +84,7 @@ static int __init validate_parameters(void)
 
        if(!bridge) {
                info("not configured, disabling.");
-               return 1;
+               return -EINVAL;
        }
        str = bridge;
        if(!*str)
@@ -147,7 +147,7 @@ static int __init cpcihp_generic_init(void)
 
        info(DRIVER_DESC " version: " DRIVER_VERSION);
        status = validate_parameters();
-       if(status != 0)
+       if (status)
                return status;
 
        r = request_region(port, 1, "#ENUM hotswap signal register");
index ea040c32f47dd169e6b4de841bf06b4c90093a63..298ad7f3f4f43aada7d324f97a12d39c082fc37e 100644 (file)
@@ -28,7 +28,6 @@
 #ifndef _CPQPHP_H
 #define _CPQPHP_H
 
-#include "pci_hotplug.h"
 #include <linux/interrupt.h>
 #include <asm/io.h>            /* for read? and write? functions */
 #include <linux/delay.h>       /* for delays */
index 1fc259913b68448b5a0b7e798d0b68ca08ae57e8..5617cfdadc5c64b19b49a08c041b28fb78c52919 100644 (file)
@@ -37,6 +37,7 @@
 #include <linux/slab.h>
 #include <linux/workqueue.h>
 #include <linux/pci.h>
+#include <linux/pci_hotplug.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 
index 3ec2ad7db49aa632f06f50155143271aef6ad60d..79ff6b4de3a61ea9f9b21262074625c49c563d52 100644 (file)
@@ -36,6 +36,7 @@
 #include <linux/wait.h>
 #include <linux/smp_lock.h>
 #include <linux/pci.h>
+#include <linux/pci_hotplug.h>
 #include "cpqphp.h"
 
 static u32 configure_new_device(struct controller* ctrl, struct pci_func *func,
index cf0878917537e912425b8f619c0564765da39f94..298a6cfd84069fce3845a9ad9c14989449a9450d 100644 (file)
@@ -33,6 +33,7 @@
 #include <linux/slab.h>
 #include <linux/workqueue.h>
 #include <linux/pci.h>
+#include <linux/pci_hotplug.h>
 #include <linux/init.h>
 #include <asm/uaccess.h>
 #include "cpqphp.h"
index 0d9688952f4af4cba74e1dfb296da89693d08934..fc7c74d725955794141093e7a41217bd3964dd06 100644 (file)
@@ -33,6 +33,7 @@
 #include <linux/workqueue.h>
 #include <linux/proc_fs.h>
 #include <linux/pci.h>
+#include <linux/pci_hotplug.h>
 #include "../pci.h"
 #include "cpqphp.h"
 #include "cpqphp_nvram.h"
index 5bab666cd67e138015657f23ef837bea332c5a6e..634f74d919d3d1c8fbc9e0bc5dadc99d5bb5d5b5 100644 (file)
@@ -32,6 +32,7 @@
 #include <linux/proc_fs.h>
 #include <linux/workqueue.h>
 #include <linux/pci.h>
+#include <linux/pci_hotplug.h>
 #include <linux/debugfs.h>
 #include "cpqphp.h"
 
index 05a4f0f9018620b5f6999c701d8a73ffbb477659..e27907c91d9232ab99e7fd8261d1983c19f71680 100644 (file)
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/pci.h>
+#include <linux/pci_hotplug.h>
 #include <linux/init.h>
 #include <linux/string.h>
 #include <linux/slab.h>
-#include "pci_hotplug.h"
 #include "../pci.h"
 
 #if !defined(MODULE)
@@ -181,7 +181,9 @@ static void pci_rescan_slot(struct pci_dev *temp)
 
        if (!pci_read_config_byte(temp, PCI_HEADER_TYPE, &hdr_type)) {
                temp->hdr_type = hdr_type & 0x7f;
-               if (!pci_find_slot(bus->number, temp->devfn)) {
+               if ((dev = pci_get_slot(bus, temp->devfn)) != NULL)
+                       pci_dev_put(dev);
+               else {
                        dev = pci_scan_single_device(bus, temp->devfn);
                        if (dev) {
                                dbg("New device on %s function %x:%x\n",
@@ -205,7 +207,9 @@ static void pci_rescan_slot(struct pci_dev *temp)
                                continue;
                        temp->hdr_type = hdr_type & 0x7f;
 
-                       if (!pci_find_slot(bus->number, temp->devfn)) {
+                       if ((dev = pci_get_slot(bus, temp->devfn)) != NULL)
+                               pci_dev_put(dev);
+                       else {
                                dev = pci_scan_single_device(bus, temp->devfn);
                                if (dev) {
                                        dbg("New device on %s function %x:%x\n",
@@ -305,7 +309,7 @@ static int disable_slot(struct hotplug_slot *slot)
        /* search for subfunctions and disable them first */
        if (!(dslot->dev->devfn & 7)) {
                for (func = 1; func < 8; func++) {
-                       dev = pci_find_slot(dslot->dev->bus->number,
+                       dev = pci_get_slot(dslot->dev->bus,
                                        dslot->dev->devfn + func);
                        if (dev) {
                                hslot = get_slot_from_dev(dev);
@@ -315,6 +319,7 @@ static int disable_slot(struct hotplug_slot *slot)
                                        err("Hotplug slot not found for subfunction of PCI device\n");
                                        return -ENODEV;
                                }
+                               pci_dev_put(dev);
                        } else
                                dbg("No device in slot found\n");
                }
index dba6d8ca9bda291dd08e1651ae554ff212313d00..612d96301509c8e9d2fbb003d1a751b46e339cd7 100644 (file)
@@ -30,7 +30,7 @@
  *
  */
 
-#include "pci_hotplug.h"
+#include <linux/pci_hotplug.h>
 
 extern int ibmphp_debug;
 
index e2823ea9c4ed829ffda3298da97ac3574dc40312..f5d632e723236b556289e5af2b12ae32ad6abc78 100644 (file)
@@ -21,9 +21,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * Send feedback to <greg@kroah.com>
- *
- * Filesystem portion based on work done by Pat Mochel on ddfs/driverfs
+ * Send feedback to <kristen.c.accardi@intel.com>
  *
  */
 
@@ -32,6 +30,8 @@
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/list.h>
+#include <linux/kobject.h>
+#include <linux/sysfs.h>
 #include <linux/pagemap.h>
 #include <linux/slab.h>
 #include <linux/smp_lock.h>
 #include <linux/mount.h>
 #include <linux/namei.h>
 #include <linux/pci.h>
+#include <linux/pci_hotplug.h>
 #include <asm/uaccess.h>
-#include <linux/kobject.h>
-#include <linux/sysfs.h>
-#include "pci_hotplug.h"
-
 
 #define MY_NAME        "pci_hotplug"
 
index eaea9d36a1bb2096104372b751decf81163efad7..4fb12fcda563efb2f581a3f65156a6b759b681c6 100644 (file)
 
 #include <linux/types.h>
 #include <linux/pci.h>
+#include <linux/pci_hotplug.h>
 #include <linux/delay.h>
 #include <linux/sched.h>               /* signal_pending() */
 #include <linux/pcieport_if.h>
 #include <linux/mutex.h>
-#include "pci_hotplug.h"
 
 #define MY_NAME        "pciehp"
 
@@ -92,6 +92,7 @@ struct php_ctlr_state_s {
 struct controller {
        struct controller *next;
        struct mutex crit_sect;         /* critical section mutex */
+       struct mutex ctrl_lock;         /* controller lock */
        struct php_ctlr_state_s *hpc_ctlr_handle; /* HPC controller handle */
        int num_slots;                  /* Number of slots on ctlr */
        int slot_num_inc;               /* 1 or -1 */
@@ -166,10 +167,10 @@ struct controller {
  * error Messages
  */
 #define msg_initialization_err "Initialization failure, error=%d\n"
-#define msg_button_on          "PCI slot #%d - powering on due to button press.\n"
-#define msg_button_off         "PCI slot #%d - powering off due to button press.\n"
-#define msg_button_cancel      "PCI slot #%d - action canceled due to button press.\n"
-#define msg_button_ignore      "PCI slot #%d - button press ignored.  (action in progress...)\n"
+#define msg_button_on          "PCI slot #%s - powering on due to button press.\n"
+#define msg_button_off         "PCI slot #%s - powering off due to button press.\n"
+#define msg_button_cancel      "PCI slot #%s - action canceled due to button press.\n"
+#define msg_button_ignore      "PCI slot #%s - button press ignored.  (action in progress...)\n"
 
 /* controller functions */
 extern int     pciehp_event_start_thread       (void);
index c67b7c3f1ddf3e485df6b5c820c6338214b5c670..f93e81e2d2c7873d408eca03365d88474ec1451d 100644 (file)
@@ -448,7 +448,7 @@ static int pciehp_probe(struct pcie_device *dev, const struct pcie_port_service_
        }
 
        /* Wait for exclusive access to hardware */
-       mutex_lock(&ctrl->crit_sect);
+       mutex_lock(&ctrl->ctrl_lock);
 
        t_slot->hpc_ops->get_adapter_status(t_slot, &value); /* Check if slot is occupied */
        
@@ -456,7 +456,7 @@ static int pciehp_probe(struct pcie_device *dev, const struct pcie_port_service_
                rc = t_slot->hpc_ops->power_off_slot(t_slot); /* Power off slot if not occupied*/
                if (rc) {
                        /* Done with exclusive hardware access */
-                       mutex_unlock(&ctrl->crit_sect);
+                       mutex_unlock(&ctrl->ctrl_lock);
                        goto err_out_free_ctrl_slot;
                } else
                        /* Wait for the command to complete */
@@ -464,7 +464,7 @@ static int pciehp_probe(struct pcie_device *dev, const struct pcie_port_service_
        }
 
        /* Done with exclusive hardware access */
-       mutex_unlock(&ctrl->crit_sect);
+       mutex_unlock(&ctrl->ctrl_lock);
 
        return 0;
 
index 41290a106bd8c4661fd1f1204c213a5db64c32ef..372c63e35aa99b47561c746f11fe00dbd661d9c3 100644 (file)
@@ -43,6 +43,11 @@ static int event_finished;
 static unsigned long pushbutton_pending;       /* = 0 */
 static unsigned long surprise_rm_pending;      /* = 0 */
 
+static inline char *slot_name(struct slot *p_slot)
+{
+       return p_slot->hotplug_slot->name;
+}
+
 u8 pciehp_handle_attention_button(u8 hp_slot, void *inst_id)
 {
        struct controller *ctrl = (struct controller *) inst_id;
@@ -68,7 +73,7 @@ u8 pciehp_handle_attention_button(u8 hp_slot, void *inst_id)
        /*
         *  Button pressed - See if need to TAKE ACTION!!!
         */
-       info("Button pressed on Slot(%d)\n", ctrl->first_slot + hp_slot);
+       info("Button pressed on Slot(%s)\n", slot_name(p_slot));
        taskInfo->event_type = INT_BUTTON_PRESS;
 
        if ((p_slot->state == BLINKINGON_STATE)
@@ -78,7 +83,7 @@ u8 pciehp_handle_attention_button(u8 hp_slot, void *inst_id)
                 * or hot-remove
                 */
                taskInfo->event_type = INT_BUTTON_CANCEL;
-               info("Button cancel on Slot(%d)\n", ctrl->first_slot + hp_slot);
+               info("Button cancel on Slot(%s)\n", slot_name(p_slot));
        } else if ((p_slot->state == POWERON_STATE)
                   || (p_slot->state == POWEROFF_STATE)) {
                /* Ignore if the slot is on power-on or power-off state; this 
@@ -86,7 +91,7 @@ u8 pciehp_handle_attention_button(u8 hp_slot, void *inst_id)
                 * hot-remove is undergoing
                 */
                taskInfo->event_type = INT_BUTTON_IGNORE;
-               info("Button ignore on Slot(%d)\n", ctrl->first_slot + hp_slot);
+               info("Button ignore on Slot(%s)\n", slot_name(p_slot));
        }
 
        if (rc)
@@ -122,13 +127,13 @@ u8 pciehp_handle_switch_change(u8 hp_slot, void *inst_id)
                /*
                 * Switch opened
                 */
-               info("Latch open on Slot(%d)\n", ctrl->first_slot + hp_slot);
+               info("Latch open on Slot(%s)\n", slot_name(p_slot));
                taskInfo->event_type = INT_SWITCH_OPEN;
        } else {
                /*
                 *  Switch closed
                 */
-               info("Latch close on Slot(%d)\n", ctrl->first_slot + hp_slot);
+               info("Latch close on Slot(%s)\n", slot_name(p_slot));
                taskInfo->event_type = INT_SWITCH_CLOSE;
        }
 
@@ -166,13 +171,13 @@ u8 pciehp_handle_presence_change(u8 hp_slot, void *inst_id)
                /*
                 * Card Present
                 */
-               info("Card present on Slot(%d)\n", ctrl->first_slot + hp_slot);
+               info("Card present on Slot(%s)\n", slot_name(p_slot));
                taskInfo->event_type = INT_PRESENCE_ON;
        } else {
                /*
                 * Not Present
                 */
-               info("Card not present on Slot(%d)\n", ctrl->first_slot + hp_slot);
+               info("Card not present on Slot(%s)\n", slot_name(p_slot));
                taskInfo->event_type = INT_PRESENCE_OFF;
        }
 
@@ -206,13 +211,13 @@ u8 pciehp_handle_power_fault(u8 hp_slot, void *inst_id)
                /*
                 * power fault Cleared
                 */
-               info("Power fault cleared on Slot(%d)\n", ctrl->first_slot + hp_slot);
+               info("Power fault cleared on Slot(%s)\n", slot_name(p_slot));
                taskInfo->event_type = INT_POWER_FAULT_CLEAR;
        } else {
                /*
                 *   power fault
                 */
-               info("Power fault on Slot(%d)\n", ctrl->first_slot + hp_slot);
+               info("Power fault on Slot(%s)\n", slot_name(p_slot));
                taskInfo->event_type = INT_POWER_FAULT;
                info("power fault bit %x set\n", hp_slot);
        }
@@ -229,13 +234,13 @@ u8 pciehp_handle_power_fault(u8 hp_slot, void *inst_id)
 static void set_slot_off(struct controller *ctrl, struct slot * pslot)
 {
        /* Wait for exclusive access to hardware */
-       mutex_lock(&ctrl->crit_sect);
+       mutex_lock(&ctrl->ctrl_lock);
 
        /* turn off slot, turn on Amber LED, turn off Green LED if supported*/
        if (POWER_CTRL(ctrl->ctrlcap)) {
                if (pslot->hpc_ops->power_off_slot(pslot)) {   
                        err("%s: Issue of Slot Power Off command failed\n", __FUNCTION__);
-                       mutex_unlock(&ctrl->crit_sect);
+                       mutex_unlock(&ctrl->ctrl_lock);
                        return;
                }
                wait_for_ctrl_irq (ctrl);
@@ -249,14 +254,14 @@ static void set_slot_off(struct controller *ctrl, struct slot * pslot)
        if (ATTN_LED(ctrl->ctrlcap)) { 
                if (pslot->hpc_ops->set_attention_status(pslot, 1)) {   
                        err("%s: Issue of Set Attention Led command failed\n", __FUNCTION__);
-                       mutex_unlock(&ctrl->crit_sect);
+                       mutex_unlock(&ctrl->ctrl_lock);
                        return;
                }
                wait_for_ctrl_irq (ctrl);
        }
 
        /* Done with exclusive hardware access */
-       mutex_unlock(&ctrl->crit_sect);
+       mutex_unlock(&ctrl->ctrl_lock);
 }
 
 /**
@@ -279,13 +284,13 @@ static int board_added(struct slot *p_slot)
                        ctrl->slot_device_offset, hp_slot);
 
        /* Wait for exclusive access to hardware */
-       mutex_lock(&ctrl->crit_sect);
+       mutex_lock(&ctrl->ctrl_lock);
 
        if (POWER_CTRL(ctrl->ctrlcap)) {
                /* Power on slot */
                rc = p_slot->hpc_ops->power_on_slot(p_slot);
                if (rc) {
-                       mutex_unlock(&ctrl->crit_sect);
+                       mutex_unlock(&ctrl->ctrl_lock);
                        return -1;
                }
 
@@ -301,7 +306,7 @@ static int board_added(struct slot *p_slot)
        }
 
        /* Done with exclusive hardware access */
-       mutex_unlock(&ctrl->crit_sect);
+       mutex_unlock(&ctrl->ctrl_lock);
 
        /* Wait for ~1 second */
        wait_for_ctrl_irq (ctrl);
@@ -335,7 +340,7 @@ static int board_added(struct slot *p_slot)
                pci_fixup_device(pci_fixup_final, ctrl->pci_dev);
        if (PWR_LED(ctrl->ctrlcap)) {
                /* Wait for exclusive access to hardware */
-               mutex_lock(&ctrl->crit_sect);
+               mutex_lock(&ctrl->ctrl_lock);
 
                p_slot->hpc_ops->green_led_on(p_slot);
   
@@ -343,7 +348,7 @@ static int board_added(struct slot *p_slot)
                wait_for_ctrl_irq (ctrl);
        
                /* Done with exclusive hardware access */
-               mutex_unlock(&ctrl->crit_sect);
+               mutex_unlock(&ctrl->ctrl_lock);
        }
        return 0;
 
@@ -375,14 +380,14 @@ static int remove_board(struct slot *p_slot)
        dbg("In %s, hp_slot = %d\n", __FUNCTION__, hp_slot);
 
        /* Wait for exclusive access to hardware */
-       mutex_lock(&ctrl->crit_sect);
+       mutex_lock(&ctrl->ctrl_lock);
 
        if (POWER_CTRL(ctrl->ctrlcap)) {
                /* power off slot */
                rc = p_slot->hpc_ops->power_off_slot(p_slot);
                if (rc) {
                        err("%s: Issue of Slot Disable command failed\n", __FUNCTION__);
-                       mutex_unlock(&ctrl->crit_sect);
+                       mutex_unlock(&ctrl->ctrl_lock);
                        return rc;
                }
                /* Wait for the command to complete */
@@ -398,7 +403,7 @@ static int remove_board(struct slot *p_slot)
        }
 
        /* Done with exclusive hardware access */
-       mutex_unlock(&ctrl->crit_sect);
+       mutex_unlock(&ctrl->ctrl_lock);
 
        return 0;
 }
@@ -445,7 +450,7 @@ static void pciehp_pushbutton_thread(unsigned long slot)
 
                if (pciehp_enable_slot(p_slot) && PWR_LED(p_slot->ctrl->ctrlcap)) {
                        /* Wait for exclusive access to hardware */
-                       mutex_lock(&p_slot->ctrl->crit_sect);
+                       mutex_lock(&p_slot->ctrl->ctrl_lock);
 
                        p_slot->hpc_ops->green_led_off(p_slot);
 
@@ -453,7 +458,7 @@ static void pciehp_pushbutton_thread(unsigned long slot)
                        wait_for_ctrl_irq (p_slot->ctrl);
 
                        /* Done with exclusive hardware access */
-                       mutex_unlock(&p_slot->ctrl->crit_sect);
+                       mutex_unlock(&p_slot->ctrl->ctrl_lock);
                }
                p_slot->state = STATIC_STATE;
        }
@@ -495,7 +500,7 @@ static void pciehp_surprise_rm_thread(unsigned long slot)
 
                if (pciehp_enable_slot(p_slot) && PWR_LED(p_slot->ctrl->ctrlcap)) {
                        /* Wait for exclusive access to hardware */
-                       mutex_lock(&p_slot->ctrl->crit_sect);
+                       mutex_lock(&p_slot->ctrl->ctrl_lock);
 
                        p_slot->hpc_ops->green_led_off(p_slot);
 
@@ -503,7 +508,7 @@ static void pciehp_surprise_rm_thread(unsigned long slot)
                        wait_for_ctrl_irq (p_slot->ctrl);
 
                        /* Done with exclusive hardware access */
-                       mutex_unlock(&p_slot->ctrl->crit_sect);
+                       mutex_unlock(&p_slot->ctrl->ctrl_lock);
                }
                p_slot->state = STATIC_STATE;
        }
@@ -616,7 +621,7 @@ static void interrupt_event_handler(struct controller *ctrl)
                                        switch (p_slot->state) {
                                        case BLINKINGOFF_STATE:
                                                /* Wait for exclusive access to hardware */
-                                               mutex_lock(&ctrl->crit_sect);
+                                               mutex_lock(&ctrl->ctrl_lock);
                                                
                                                if (PWR_LED(ctrl->ctrlcap)) {
                                                        p_slot->hpc_ops->green_led_on(p_slot);
@@ -630,11 +635,11 @@ static void interrupt_event_handler(struct controller *ctrl)
                                                        wait_for_ctrl_irq (ctrl);
                                                }
                                                /* Done with exclusive hardware access */
-                                               mutex_unlock(&ctrl->crit_sect);
+                                               mutex_unlock(&ctrl->ctrl_lock);
                                                break;
                                        case BLINKINGON_STATE:
                                                /* Wait for exclusive access to hardware */
-                                               mutex_lock(&ctrl->crit_sect);
+                                               mutex_lock(&ctrl->ctrl_lock);
 
                                                if (PWR_LED(ctrl->ctrlcap)) {
                                                        p_slot->hpc_ops->green_led_off(p_slot);
@@ -647,14 +652,14 @@ static void interrupt_event_handler(struct controller *ctrl)
                                                        wait_for_ctrl_irq (ctrl);
                                                }
                                                /* Done with exclusive hardware access */
-                                               mutex_unlock(&ctrl->crit_sect);
+                                               mutex_unlock(&ctrl->ctrl_lock);
 
                                                break;
                                        default:
                                                warn("Not a valid state\n");
                                                return;
                                        }
-                                       info(msg_button_cancel, p_slot->number);
+                                       info(msg_button_cancel, slot_name(p_slot));
                                        p_slot->state = STATIC_STATE;
                                }
                                /* ***********Button Pressed (No action on 1st press...) */
@@ -667,16 +672,16 @@ static void interrupt_event_handler(struct controller *ctrl)
                                                        /* slot is on */
                                                        dbg("slot is on\n");
                                                        p_slot->state = BLINKINGOFF_STATE;
-                                                       info(msg_button_off, p_slot->number);
+                                                       info(msg_button_off, slot_name(p_slot));
                                                } else {
                                                        /* slot is off */
                                                        dbg("slot is off\n");
                                                        p_slot->state = BLINKINGON_STATE;
-                                                       info(msg_button_on, p_slot->number);
+                                                       info(msg_button_on, slot_name(p_slot));
                                                }
 
                                                /* Wait for exclusive access to hardware */
-                                               mutex_lock(&ctrl->crit_sect);
+                                               mutex_lock(&ctrl->ctrl_lock);
 
                                                /* blink green LED and turn off amber */
                                                if (PWR_LED(ctrl->ctrlcap)) {
@@ -693,7 +698,7 @@ static void interrupt_event_handler(struct controller *ctrl)
                                                }
 
                                                /* Done with exclusive hardware access */
-                                               mutex_unlock(&ctrl->crit_sect);
+                                               mutex_unlock(&ctrl->ctrl_lock);
 
                                                init_timer(&p_slot->task_event);
                                                p_slot->task_event.expires = jiffies + 5 * HZ;   /* 5 second delay */
@@ -708,7 +713,7 @@ static void interrupt_event_handler(struct controller *ctrl)
                                        if (POWER_CTRL(ctrl->ctrlcap)) {
                                                dbg("power fault\n");
                                                /* Wait for exclusive access to hardware */
-                                               mutex_lock(&ctrl->crit_sect);
+                                               mutex_lock(&ctrl->ctrl_lock);
 
                                                if (ATTN_LED(ctrl->ctrlcap)) {
                                                        p_slot->hpc_ops->set_attention_status(p_slot, 1);
@@ -721,7 +726,7 @@ static void interrupt_event_handler(struct controller *ctrl)
                                                }
 
                                                /* Done with exclusive hardware access */
-                                               mutex_unlock(&ctrl->crit_sect);
+                                               mutex_unlock(&ctrl->ctrl_lock);
                                        }
                                }
                                /***********SURPRISE REMOVAL********************/
@@ -760,14 +765,16 @@ int pciehp_enable_slot(struct slot *p_slot)
 
        rc = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus);
        if (rc || !getstatus) {
-               info("%s: no adapter on slot(%x)\n", __FUNCTION__, p_slot->number);
+               info("%s: no adapter on slot(%s)\n", __FUNCTION__,
+                    slot_name(p_slot));
                mutex_unlock(&p_slot->ctrl->crit_sect);
                return -ENODEV;
        }
        if (MRL_SENS(p_slot->ctrl->ctrlcap)) {  
                rc = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus);
                if (rc || getstatus) {
-                       info("%s: latch open on slot(%x)\n", __FUNCTION__, p_slot->number);
+                       info("%s: latch open on slot(%s)\n", __FUNCTION__,
+                            slot_name(p_slot));
                        mutex_unlock(&p_slot->ctrl->crit_sect);
                        return -ENODEV;
                }
@@ -776,12 +783,12 @@ int pciehp_enable_slot(struct slot *p_slot)
        if (POWER_CTRL(p_slot->ctrl->ctrlcap)) {        
                rc = p_slot->hpc_ops->get_power_status(p_slot, &getstatus);
                if (rc || getstatus) {
-                       info("%s: already enabled on slot(%x)\n", __FUNCTION__, p_slot->number);
+                       info("%s: already enabled on slot(%s)\n", __FUNCTION__,
+                            slot_name(p_slot));
                        mutex_unlock(&p_slot->ctrl->crit_sect);
                        return -EINVAL;
                }
        }
-       mutex_unlock(&p_slot->ctrl->crit_sect);
 
        p_slot->hpc_ops->get_latch_status(p_slot, &getstatus);
 
@@ -790,9 +797,9 @@ int pciehp_enable_slot(struct slot *p_slot)
                p_slot->hpc_ops->get_latch_status(p_slot, &getstatus);
        }
 
-       if (p_slot)
-               update_slot_info(p_slot);
+       update_slot_info(p_slot);
 
+       mutex_unlock(&p_slot->ctrl->crit_sect);
        return rc;
 }
 
@@ -811,7 +818,8 @@ int pciehp_disable_slot(struct slot *p_slot)
        if (!HP_SUPR_RM(p_slot->ctrl->ctrlcap)) {       
                ret = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus);
                if (ret || !getstatus) {
-                       info("%s: no adapter on slot(%x)\n", __FUNCTION__, p_slot->number);
+                       info("%s: no adapter on slot(%s)\n", __FUNCTION__,
+                            slot_name(p_slot));
                        mutex_unlock(&p_slot->ctrl->crit_sect);
                        return -ENODEV;
                }
@@ -820,7 +828,8 @@ int pciehp_disable_slot(struct slot *p_slot)
        if (MRL_SENS(p_slot->ctrl->ctrlcap)) {  
                ret = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus);
                if (ret || getstatus) {
-                       info("%s: latch open on slot(%x)\n", __FUNCTION__, p_slot->number);
+                       info("%s: latch open on slot(%s)\n", __FUNCTION__,
+                            slot_name(p_slot));
                        mutex_unlock(&p_slot->ctrl->crit_sect);
                        return -ENODEV;
                }
@@ -829,16 +838,17 @@ int pciehp_disable_slot(struct slot *p_slot)
        if (POWER_CTRL(p_slot->ctrl->ctrlcap)) {        
                ret = p_slot->hpc_ops->get_power_status(p_slot, &getstatus);
                if (ret || !getstatus) {
-                       info("%s: already disabled slot(%x)\n", __FUNCTION__, p_slot->number);
+                       info("%s: already disabled slot(%s)\n", __FUNCTION__,
+                            slot_name(p_slot));
                        mutex_unlock(&p_slot->ctrl->crit_sect);
                        return -EINVAL;
                }
        }
 
-       mutex_unlock(&p_slot->ctrl->crit_sect);
-
        ret = remove_board(p_slot);
        update_slot_info(p_slot);
+
+       mutex_unlock(&p_slot->ctrl->crit_sect);
        return ret;
 }
 
index 703a64a39fe8aef068eed99e9b6035f234e4c524..1c551c697c35bd8207ce349595850ddd8f8eefc9 100644 (file)
@@ -1402,6 +1402,8 @@ int pcie_init(struct controller * ctrl, struct pcie_device *dev)
                pdev->subsystem_vendor, pdev->subsystem_device);
 
        mutex_init(&ctrl->crit_sect);
+       mutex_init(&ctrl->ctrl_lock);
+
        /* setup wait queue */
        init_waitqueue_head(&ctrl->queue);
 
index 2b9e10e38613327bee8c6767609c2522892d12f8..50bcd3fe61da75d1eed921221726266b76a03f4e 100644 (file)
@@ -33,8 +33,8 @@
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/pci.h>
+#include <linux/pci_hotplug.h>
 #include <linux/init.h>
-#include "pci_hotplug.h"
 
 #define SLOT_NAME_SIZE 10
 struct slot {
index db69be85b4583100907368d580d03c35779a7576..6c5be3ff578c24b7a2755557b28f4b9602e17dda 100644 (file)
@@ -14,7 +14,7 @@
  */
 #include <linux/kobject.h>
 #include <linux/string.h>
-#include "pci_hotplug.h"
+#include <linux/pci_hotplug.h>
 #include "rpadlpar.h"
 
 #define DLPAR_KOBJ_NAME       "control"
index 310b6186c0e5f45aa19f11654a49c38fcb839458..2e7accf0f734fbfd2837b7635ce24d002548f7dd 100644 (file)
@@ -28,7 +28,7 @@
 #define _PPC64PHP_H
 
 #include <linux/pci.h>
-#include "pci_hotplug.h"
+#include <linux/pci_hotplug.h>
 
 #define DR_INDICATOR 9002
 #define DR_ENTITY_SENSE 9003
index 7288a3eccfb3e34b1bab1a8d2d9e6a762858d746..141486df235b6ec8ef60908086661778f031c3c3 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/pci.h>
+#include <linux/pci_hotplug.h>
 #include <linux/slab.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
@@ -36,7 +37,6 @@
 #include "../pci.h"            /* for pci_add_new_bus */
                                /* and pci_do_scan_bus */
 #include "rpaphp.h"
-#include "pci_hotplug.h"
 
 int debug;
 static struct semaphore rpaphp_sem;
index f31d83c2c633c678d040190ff57b2f7246cce626..b62ad31a9739934e1c38b6138cf12f65e6629ee2 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/pci.h>
+#include <linux/pci_hotplug.h>
 #include <linux/proc_fs.h>
 #include <linux/types.h>
 #include <linux/mutex.h>
@@ -29,7 +30,6 @@
 #include <asm/sn/types.h>
 
 #include "../pci.h"
-#include "pci_hotplug.h"
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("SGI (prarit@sgi.com, dickie@sgi.com, habeck@sgi.com)");
index c7103ac5cd06b76da2c0ec60381003601bd98bc1..ea2087c34149f23244401e480b9cf491693b8a7c 100644 (file)
 
 #include <linux/types.h>
 #include <linux/pci.h>
+#include <linux/pci_hotplug.h>
 #include <linux/delay.h>
 #include <linux/sched.h>       /* signal_pending(), struct timer_list */
 #include <linux/mutex.h>
 
-#include "pci_hotplug.h"
-
 #if !defined(MODULE)
        #define MY_NAME "shpchp"
 #else
@@ -103,7 +102,6 @@ struct controller {
        u32 cap_offset;
        unsigned long mmio_base;
        unsigned long mmio_size;
-       volatile int cmd_busy;
 };
 
 
index 4d8aee11913466768cc2ae53480d2a015d234c51..83a5226ba9ed4918c4e46fb8f964aaf9a1b90922 100644 (file)
@@ -302,21 +302,51 @@ static void start_int_poll_timer(struct php_ctlr_state_s *php_ctlr, int sec)
        add_timer(&php_ctlr->int_poll_timer);
 }
 
+static inline int is_ctrl_busy(struct controller *ctrl)
+{
+       u16 cmd_status = shpc_readw(ctrl, CMD_STATUS);
+       return cmd_status & 0x1;
+}
+
+/*
+ * Returns 1 if SHPC finishes executing a command within 1 sec,
+ * otherwise returns 0.
+ */
+static inline int shpc_poll_ctrl_busy(struct controller *ctrl)
+{
+       int i;
+
+       if (!is_ctrl_busy(ctrl))
+               return 1;
+
+       /* Check every 0.1 sec for a total of 1 sec */
+       for (i = 0; i < 10; i++) {
+               msleep(100);
+               if (!is_ctrl_busy(ctrl))
+                       return 1;
+       }
+
+       return 0;
+}
+
 static inline int shpc_wait_cmd(struct controller *ctrl)
 {
        int retval = 0;
-       unsigned int timeout_msec = shpchp_poll_mode ? 2000 : 1000;
-       unsigned long timeout = msecs_to_jiffies(timeout_msec);
-       int rc = wait_event_interruptible_timeout(ctrl->queue,
-                                                 !ctrl->cmd_busy, timeout);
-       if (!rc) {
+       unsigned long timeout = msecs_to_jiffies(1000);
+       int rc;
+
+       if (shpchp_poll_mode)
+               rc = shpc_poll_ctrl_busy(ctrl);
+       else
+               rc = wait_event_interruptible_timeout(ctrl->queue,
+                                               !is_ctrl_busy(ctrl), timeout);
+       if (!rc && is_ctrl_busy(ctrl)) {
                retval = -EIO;
-               err("Command not completed in %d msec\n", timeout_msec);
+               err("Command not completed in 1000 msec\n");
        } else if (rc < 0) {
                retval = -EINTR;
                info("Command was interrupted by a signal\n");
        }
-       ctrl->cmd_busy = 0;
 
        return retval;
 }
@@ -327,26 +357,15 @@ static int shpc_write_cmd(struct slot *slot, u8 t_slot, u8 cmd)
        u16 cmd_status;
        int retval = 0;
        u16 temp_word;
-       int i;
 
        DBG_ENTER_ROUTINE 
 
        mutex_lock(&slot->ctrl->cmd_lock);
 
-       for (i = 0; i < 10; i++) {
-               cmd_status = shpc_readw(ctrl, CMD_STATUS);
-               
-               if (!(cmd_status & 0x1))
-                       break;
-               /*  Check every 0.1 sec for a total of 1 sec*/
-               msleep(100);
-       }
-
-       cmd_status = shpc_readw(ctrl, CMD_STATUS);
-       
-       if (cmd_status & 0x1) { 
+       if (!shpc_poll_ctrl_busy(ctrl)) {
                /* After 1 sec and and the controller is still busy */
-               err("%s : Controller is still busy after 1 sec.\n", __FUNCTION__);
+               err("%s : Controller is still busy after 1 sec.\n",
+                   __FUNCTION__);
                retval = -EBUSY;
                goto out;
        }
@@ -358,7 +377,6 @@ static int shpc_write_cmd(struct slot *slot, u8 t_slot, u8 cmd)
        /* To make sure the Controller Busy bit is 0 before we send out the
         * command. 
         */
-       slot->ctrl->cmd_busy = 1;
        shpc_writew(ctrl, CMD, temp_word);
 
        /*
@@ -908,7 +926,6 @@ static irqreturn_t shpc_isr(int irq, void *dev_id)
                serr_int &= ~SERR_INTR_RSVDZ_MASK;
                shpc_writel(ctrl, SERR_INTR_ENABLE, serr_int);
 
-               ctrl->cmd_busy = 0;
                wake_up_interruptible(&ctrl->queue);
        }
 
@@ -1101,7 +1118,7 @@ int shpc_init(struct controller * ctrl, struct pci_dev * pdev)
 {
        struct php_ctlr_state_s *php_ctlr, *p;
        void *instance_id = ctrl;
-       int rc, num_slots = 0;
+       int rc = -1, num_slots = 0;
        u8 hp_slot;
        u32 shpc_base_offset;
        u32 tempdword, slot_reg, slot_config;
@@ -1167,11 +1184,15 @@ int shpc_init(struct controller * ctrl, struct pci_dev * pdev)
        info("HPC vendor_id %x device_id %x ss_vid %x ss_did %x\n", pdev->vendor, pdev->device, pdev->subsystem_vendor, 
                pdev->subsystem_device);
        
-       if (pci_enable_device(pdev))
+       rc = pci_enable_device(pdev);
+       if (rc) {
+               err("%s: pci_enable_device failed\n", __FUNCTION__);
                goto abort_free_ctlr;
+       }
 
        if (!request_mem_region(ctrl->mmio_base, ctrl->mmio_size, MY_NAME)) {
                err("%s: cannot reserve MMIO region\n", __FUNCTION__);
+               rc = -1;
                goto abort_free_ctlr;
        }
 
@@ -1180,6 +1201,7 @@ int shpc_init(struct controller * ctrl, struct pci_dev * pdev)
                err("%s: cannot remap MMIO region %lx @ %lx\n", __FUNCTION__,
                    ctrl->mmio_size, ctrl->mmio_base);
                release_mem_region(ctrl->mmio_base, ctrl->mmio_size);
+               rc = -1;
                goto abort_free_ctlr;
        }
        dbg("%s: php_ctlr->creg %p\n", __FUNCTION__, php_ctlr->creg);
@@ -1282,8 +1304,10 @@ int shpc_init(struct controller * ctrl, struct pci_dev * pdev)
         */
        if (atomic_add_return(1, &shpchp_num_controllers) == 1) {
                shpchp_wq = create_singlethread_workqueue("shpchpd");
-               if (!shpchp_wq)
-                       return -ENOMEM;
+               if (!shpchp_wq) {
+                       rc = -ENOMEM;
+                       goto abort_free_ctlr;
+               }
        }
 
        /*
@@ -1313,8 +1337,10 @@ int shpc_init(struct controller * ctrl, struct pci_dev * pdev)
 
        /* We end up here for the many possible ways to fail this API.  */
 abort_free_ctlr:
+       if (php_ctlr->creg)
+               iounmap(php_ctlr->creg);
        kfree(php_ctlr);
 abort:
        DBG_LEAVE_ROUTINE
-       return -1;
+       return rc;
 }
index f9fdc54473c4aed27a7f0e865dae74017c352563..9fc9a34ef24a28e74ec07ca725eb0c6db91f29ac 100644 (file)
@@ -627,22 +627,24 @@ static int msix_capability_init(struct pci_dev *dev,
  * pci_msi_supported - check whether MSI may be enabled on device
  * @dev: pointer to the pci_dev data structure of MSI device function
  *
- * MSI must be globally enabled and supported by the device and its root
- * bus. But, the root bus is not easy to find since some architectures
- * have virtual busses on top of the PCI hierarchy (for instance the
- * hypertransport bus), while the actual bus where MSI must be supported
- * is below. So we test the MSI flag on all parent busses and assume
- * that no quirk will ever set the NO_MSI flag on a non-root bus.
+ * Look at global flags, the device itself, and its parent busses
+ * to return 0 if MSI are supported for the device.
  **/
 static
 int pci_msi_supported(struct pci_dev * dev)
 {
        struct pci_bus *bus;
 
+       /* MSI must be globally enabled and supported by the device */
        if (!pci_msi_enable || !dev || dev->no_msi)
                return -EINVAL;
 
-       /* check MSI flags of all parent busses */
+       /* Any bridge which does NOT route MSI transactions from it's
+        * secondary bus to it's primary bus must set NO_MSI flag on
+        * the secondary pci_bus.
+        * We expect only arch-specific PCI host bus controller driver
+        * or quirks for specific PCI bridges to be setting NO_MSI.
+        */
        for (bus = dev->bus; bus; bus = bus->parent)
                if (bus->bus_flags & PCI_BUS_FLAGS_NO_MSI)
                        return -EINVAL;
index 67fcd176babdb8182242d9d038f5b665364654d6..3656e0349dd1d6ee4c6917203298b0d3b635d486 100644 (file)
@@ -9,6 +9,8 @@
 #ifndef _PORTDRV_H_
 #define _PORTDRV_H_
 
+#include <linux/compiler.h>
+
 #if !defined(PCI_CAP_ID_PME)
 #define PCI_CAP_ID_PME                 1
 #endif
@@ -39,7 +41,7 @@ extern int pcie_port_device_suspend(struct pci_dev *dev, pm_message_t state);
 extern int pcie_port_device_resume(struct pci_dev *dev);
 #endif
 extern void pcie_port_device_remove(struct pci_dev *dev);
-extern int pcie_port_bus_register(void);
+extern int __must_check pcie_port_bus_register(void);
 extern void pcie_port_bus_unregister(void);
 
 #endif /* _PORTDRV_H_ */
index bd6615b4d40eb7546521a41898b39bd3a0da47d1..b20a9b81dae2df5e9cca491b4c1504def575858c 100644 (file)
@@ -6,7 +6,6 @@
  * Copyright (C) Tom Long Nguyen (tom.l.nguyen@intel.com)
  */
 
-#include <linux/compiler.h>
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/kernel.h>
@@ -401,7 +400,7 @@ void pcie_port_device_remove(struct pci_dev *dev)
                pci_disable_msi(dev);
 }
 
-int __must_check pcie_port_bus_register(void)
+int pcie_port_bus_register(void)
 {
        return bus_register(&pcie_port_bus_type);
 }
index 037690e08f5f023a0e012806efbe9627b2450c7c..b4da7954611e2388025afe2fb80e8bb19ebb92cc 100644 (file)
@@ -37,7 +37,6 @@ static int pcie_portdrv_save_config(struct pci_dev *dev)
        return pci_save_state(dev);
 }
 
-#ifdef CONFIG_PM
 static int pcie_portdrv_restore_config(struct pci_dev *dev)
 {
        int retval;
@@ -50,6 +49,7 @@ static int pcie_portdrv_restore_config(struct pci_dev *dev)
        return 0;
 }
 
+#ifdef CONFIG_PM
 static int pcie_portdrv_suspend(struct pci_dev *dev, pm_message_t state)
 {
        int ret = pcie_port_device_suspend(dev, state);
index a3b0a5eb5054fefcc0e76e72b838fac1146fd310..e159d6604494acd62a617efcca0b6a3b26a8d4d4 100644 (file)
@@ -1067,3 +1067,95 @@ EXPORT_SYMBOL(pci_scan_bridge);
 EXPORT_SYMBOL(pci_scan_single_device);
 EXPORT_SYMBOL_GPL(pci_scan_child_bus);
 #endif
+
+static int __init pci_sort_bf_cmp(const struct pci_dev *a, const struct pci_dev *b)
+{
+       if      (pci_domain_nr(a->bus) < pci_domain_nr(b->bus)) return -1;
+       else if (pci_domain_nr(a->bus) > pci_domain_nr(b->bus)) return  1;
+
+       if      (a->bus->number < b->bus->number) return -1;
+       else if (a->bus->number > b->bus->number) return  1;
+
+       if      (a->devfn < b->devfn) return -1;
+       else if (a->devfn > b->devfn) return  1;
+
+       return 0;
+}
+
+/*
+ * Yes, this forcably breaks the klist abstraction temporarily.  It
+ * just wants to sort the klist, not change reference counts and
+ * take/drop locks rapidly in the process.  It does all this while
+ * holding the lock for the list, so objects can't otherwise be
+ * added/removed while we're swizzling.
+ */
+static void __init pci_insertion_sort_klist(struct pci_dev *a, struct list_head *list)
+{
+       struct list_head *pos;
+       struct klist_node *n;
+       struct device *dev;
+       struct pci_dev *b;
+
+       list_for_each(pos, list) {
+               n = container_of(pos, struct klist_node, n_node);
+               dev = container_of(n, struct device, knode_bus);
+               b = to_pci_dev(dev);
+               if (pci_sort_bf_cmp(a, b) <= 0) {
+                       list_move_tail(&a->dev.knode_bus.n_node, &b->dev.knode_bus.n_node);
+                       return;
+               }
+       }
+       list_move_tail(&a->dev.knode_bus.n_node, list);
+}
+
+static void __init pci_sort_breadthfirst_klist(void)
+{
+       LIST_HEAD(sorted_devices);
+       struct list_head *pos, *tmp;
+       struct klist_node *n;
+       struct device *dev;
+       struct pci_dev *pdev;
+
+       spin_lock(&pci_bus_type.klist_devices.k_lock);
+       list_for_each_safe(pos, tmp, &pci_bus_type.klist_devices.k_list) {
+               n = container_of(pos, struct klist_node, n_node);
+               dev = container_of(n, struct device, knode_bus);
+               pdev = to_pci_dev(dev);
+               pci_insertion_sort_klist(pdev, &sorted_devices);
+       }
+       list_splice(&sorted_devices, &pci_bus_type.klist_devices.k_list);
+       spin_unlock(&pci_bus_type.klist_devices.k_lock);
+}
+
+static void __init pci_insertion_sort_devices(struct pci_dev *a, struct list_head *list)
+{
+       struct pci_dev *b;
+
+       list_for_each_entry(b, list, global_list) {
+               if (pci_sort_bf_cmp(a, b) <= 0) {
+                       list_move_tail(&a->global_list, &b->global_list);
+                       return;
+               }
+       }
+       list_move_tail(&a->global_list, list);
+}
+
+static void __init pci_sort_breadthfirst_devices(void)
+{
+       LIST_HEAD(sorted_devices);
+       struct pci_dev *dev, *tmp;
+
+       down_write(&pci_bus_sem);
+       list_for_each_entry_safe(dev, tmp, &pci_devices, global_list) {
+               pci_insertion_sort_devices(dev, &sorted_devices);
+       }
+       list_splice(&sorted_devices, &pci_devices);
+       up_write(&pci_bus_sem);
+}
+
+void __init pci_sort_breadthfirst(void)
+{
+       pci_sort_breadthfirst_devices();
+       pci_sort_breadthfirst_klist();
+}
+
index 23b599d6a9d540db8b2727533f74ffcd7e72f06d..ecf8e4d6b9da5ae32ef2e7540942c8b1266dcc07 100644 (file)
@@ -453,6 +453,12 @@ static void __devinit quirk_ich6_lpc_acpi(struct pci_dev *dev)
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,  PCI_DEVICE_ID_INTEL_ICH6_0, quirk_ich6_lpc_acpi );
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,  PCI_DEVICE_ID_INTEL_ICH6_1, quirk_ich6_lpc_acpi );
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,  PCI_DEVICE_ID_INTEL_ICH7_0, quirk_ich6_lpc_acpi );
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,  PCI_DEVICE_ID_INTEL_ICH7_1, quirk_ich6_lpc_acpi );
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,  PCI_DEVICE_ID_INTEL_ICH7_31, quirk_ich6_lpc_acpi );
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,  PCI_DEVICE_ID_INTEL_ICH8_0, quirk_ich6_lpc_acpi );
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,  PCI_DEVICE_ID_INTEL_ICH8_2, quirk_ich6_lpc_acpi );
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,  PCI_DEVICE_ID_INTEL_ICH8_3, quirk_ich6_lpc_acpi );
 
 /*
  * VIA ACPI: One IO region pointed to by longword at
@@ -648,11 +654,43 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA,       PCI_DEVICE_ID_VIA_82C686_4,     quirk_vi
  * Some of the on-chip devices are actually '586 devices' so they are
  * listed here.
  */
+
+static int via_irq_fixup_needed = -1;
+
+/*
+ * As some VIA hardware is available in PCI-card form, we need to restrict
+ * this quirk to VIA PCI hardware built onto VIA-based motherboards only.
+ * We try to locate a VIA southbridge before deciding whether the quirk
+ * should be applied.
+ */
+static const struct pci_device_id via_irq_fixup_tbl[] = {
+       {
+               .vendor         = PCI_VENDOR_ID_VIA,
+               .device         = PCI_ANY_ID,
+               .subvendor      = PCI_ANY_ID,
+               .subdevice      = PCI_ANY_ID,
+               .class          = PCI_CLASS_BRIDGE_ISA << 8,
+               .class_mask     = 0xffff00,
+       },
+       { 0, },
+};
+
 static void quirk_via_irq(struct pci_dev *dev)
 {
        u8 irq, new_irq;
 
-       new_irq = dev->irq & 0xf;
+       if (via_irq_fixup_needed == -1)
+               via_irq_fixup_needed = pci_dev_present(via_irq_fixup_tbl);
+
+       if (!via_irq_fixup_needed)
+               return;
+
+       new_irq = dev->irq;
+
+       /* Don't quirk interrupts outside the legacy IRQ range */
+       if (!new_irq || new_irq > 15)
+               return;
+
        pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq);
        if (new_irq != irq) {
                printk(KERN_INFO "PCI: VIA IRQ fixup for %s, from %d to %d\n",
@@ -661,14 +699,7 @@ static void quirk_via_irq(struct pci_dev *dev)
                pci_write_config_byte(dev, PCI_INTERRUPT_LINE, new_irq);
        }
 }
-DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_0, quirk_via_irq);
-DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1, quirk_via_irq);
-DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_2, quirk_via_irq);
-DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_3, quirk_via_irq);
-DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8235_USB_2, quirk_via_irq);
-DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686, quirk_via_irq);
-DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4, quirk_via_irq);
-DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_5, quirk_via_irq);
+DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_ANY_ID, quirk_via_irq);
 
 /*
  * VIA VT82C598 has its device ID settable and many BIOSes
@@ -1588,6 +1619,51 @@ static void __devinit fixup_rev1_53c810(struct pci_dev* dev)
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NCR, PCI_DEVICE_ID_NCR_53C810, fixup_rev1_53c810);
 
+/*
+ * Fixup to mark boot BIOS video selected by BIOS before it changes
+ *
+ * From information provided by "Jon Smirl" <jonsmirl@gmail.com>
+ *
+ * The standard boot ROM sequence for an x86 machine uses the BIOS
+ * to select an initial video card for boot display. This boot video
+ * card will have it's BIOS copied to C0000 in system RAM.
+ * IORESOURCE_ROM_SHADOW is used to associate the boot video
+ * card with this copy. On laptops this copy has to be used since
+ * the main ROM may be compressed or combined with another image.
+ * See pci_map_rom() for use of this flag. IORESOURCE_ROM_SHADOW
+ * is marked here since the boot video device will be the only enabled
+ * video device at this point.
+ */
+#if 0
+static void __devinit fixup_video(struct pci_dev *pdev)
+{
+       struct pci_dev *bridge;
+       struct pci_bus *bus;
+       u16 config;
+
+       if ((pdev->class >> 8) != PCI_CLASS_DISPLAY_VGA)
+               return;
+
+       /* Is VGA routed to us? */
+       bus = pdev->bus;
+       while (bus) {
+               bridge = bus->self;
+               if (bridge) {
+                       pci_read_config_word(bridge, PCI_BRIDGE_CONTROL,
+                                               &config);
+                       if (!(config & PCI_BRIDGE_CTL_VGA))
+                               return;
+               }
+               bus = bus->parent;
+       }
+       pci_read_config_word(pdev, PCI_COMMAND, &config);
+       if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) {
+               pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW;
+               printk(KERN_DEBUG "Boot video device is %s\n", pci_name(pdev));
+       }
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, fixup_video);
+#endif
 
 static void pci_do_fixups(struct pci_dev *dev, struct pci_fixup *f, struct pci_fixup *end)
 {
@@ -1764,7 +1840,7 @@ static void __devinit quirk_nvidia_ck804_msi_ht_cap(struct pci_dev *dev)
        /* check HT MSI cap on this chipset and the root one.
         * a single one having MSI is enough to be sure that MSI are supported.
         */
-       pdev = pci_find_slot(dev->bus->number, 0);
+       pdev = pci_get_slot(dev->bus, 0);
        if (dev->subordinate && !msi_ht_cap_enabled(dev)
            && !msi_ht_cap_enabled(pdev)) {
                printk(KERN_WARNING "PCI: MSI quirk detected. "
@@ -1772,6 +1848,7 @@ static void __devinit quirk_nvidia_ck804_msi_ht_cap(struct pci_dev *dev)
                       pci_name(dev));
                dev->subordinate->bus_flags |= PCI_BUS_FLAGS_NO_MSI;
        }
+       pci_dev_put(pdev);
 }
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_CK804_PCIE,
                        quirk_nvidia_ck804_msi_ht_cap);
index f5ee7ce16fa61ea6fc4c3e096edc86140fa4e668..43e4a49f2cc428275cc77a74bb52c61fe9d428b3 100644 (file)
@@ -71,7 +71,10 @@ void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size)
        void __iomem *image;
        int last_image;
 
-       /* IORESOURCE_ROM_SHADOW only set on x86 */
+       /*
+        * IORESOURCE_ROM_SHADOW set if the VGA enable bit of the Bridge Control
+        * register is set for embedded VGA.
+        */
        if (res->flags & IORESOURCE_ROM_SHADOW) {
                /* primary video rom always starts here */
                start = (loff_t)0xC0000;
index d529462d1b53e6b8083aab301eca87f02ebac35a..2f13eba5d5aebf9c7a9f0930cbc1022bde441f75 100644 (file)
@@ -139,6 +139,31 @@ struct pci_dev * pci_get_slot(struct pci_bus *bus, unsigned int devfn)
        return dev;
 }
 
+/**
+ * pci_get_bus_and_slot - locate PCI device from a given PCI slot
+ * @bus: number of PCI bus on which desired PCI device resides
+ * @devfn: encodes number of PCI slot in which the desired PCI
+ * device resides and the logical device number within that slot
+ * in case of multi-function devices.
+ *
+ * Given a PCI bus and slot/function number, the desired PCI device
+ * is located in system global list of PCI devices.  If the device
+ * is found, a pointer to its data structure is returned.  If no
+ * device is found, %NULL is returned. The returned device has its
+ * reference count bumped by one.
+ */
+
+struct pci_dev * pci_get_bus_and_slot(unsigned int bus, unsigned int devfn)
+{
+       struct pci_dev *dev = NULL;
+
+       while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
+               if (dev->bus->number == bus && dev->devfn == devfn)
+                       return dev;
+       }
+       return NULL;
+}
+
 /**
  * pci_find_subsys - begin or continue searching for a PCI device by vendor/subvendor/device/subdevice id
  * @vendor: PCI vendor id to match, or %PCI_ANY_ID to match all vendor ids
@@ -274,6 +299,45 @@ pci_get_device(unsigned int vendor, unsigned int device, struct pci_dev *from)
        return pci_get_subsys(vendor, device, PCI_ANY_ID, PCI_ANY_ID, from);
 }
 
+/**
+ * pci_get_device_reverse - begin or continue searching for a PCI device by vendor/device id
+ * @vendor: PCI vendor id to match, or %PCI_ANY_ID to match all vendor ids
+ * @device: PCI device id to match, or %PCI_ANY_ID to match all device ids
+ * @from: Previous PCI device found in search, or %NULL for new search.
+ *
+ * Iterates through the list of known PCI devices in the reverse order of
+ * pci_get_device.
+ * If a PCI device is found with a matching @vendor and @device, the reference
+ * count to the  device is incremented and a pointer to its device structure
+ * is returned Otherwise, %NULL is returned.  A new search is initiated by
+ * passing %NULL as the @from argument.  Otherwise if @from is not %NULL,
+ * searches continue from next device on the global list.  The reference
+ * count for @from is always decremented if it is not %NULL.
+ */
+struct pci_dev *
+pci_get_device_reverse(unsigned int vendor, unsigned int device, struct pci_dev *from)
+{
+       struct list_head *n;
+       struct pci_dev *dev;
+
+       WARN_ON(in_interrupt());
+       down_read(&pci_bus_sem);
+       n = from ? from->global_list.prev : pci_devices.prev;
+
+       while (n && (n != &pci_devices)) {
+               dev = pci_dev_g(n);
+               if ((vendor == PCI_ANY_ID || dev->vendor == vendor) &&
+                   (device == PCI_ANY_ID || dev->device == device))
+                       goto exit;
+               n = n->prev;
+       }
+       dev = NULL;
+exit:
+       dev = pci_dev_get(dev);
+       up_read(&pci_bus_sem);
+       pci_dev_put(from);
+       return dev;
+}
 
 /**
  * pci_find_device_reverse - begin or continue searching for a PCI device by vendor/device id
@@ -382,12 +446,16 @@ exit:
 }
 EXPORT_SYMBOL(pci_dev_present);
 
-EXPORT_SYMBOL(pci_find_bus);
-EXPORT_SYMBOL(pci_find_next_bus);
 EXPORT_SYMBOL(pci_find_device);
 EXPORT_SYMBOL(pci_find_device_reverse);
 EXPORT_SYMBOL(pci_find_slot);
+/* For boot time work */
+EXPORT_SYMBOL(pci_find_bus);
+EXPORT_SYMBOL(pci_find_next_bus);
+/* For everyone */
 EXPORT_SYMBOL(pci_get_device);
+EXPORT_SYMBOL(pci_get_device_reverse);
 EXPORT_SYMBOL(pci_get_subsys);
 EXPORT_SYMBOL(pci_get_slot);
+EXPORT_SYMBOL(pci_get_bus_and_slot);
 EXPORT_SYMBOL(pci_get_class);
index dc79b0a0059f6206c22dd6a611c591d62b83aa7a..379048fdf05dccf01575a5727219529ac7d39fac 100644 (file)
@@ -776,21 +776,32 @@ static void pnpacpi_encode_dma(struct acpi_resource *resource,
        struct resource *p)
 {
        /* Note: pnp_assign_dma will copy pnp_dma->flags into p->flags */
-       if (p->flags & IORESOURCE_DMA_COMPATIBLE)
-               resource->data.dma.type = ACPI_COMPATIBILITY;
-       else if (p->flags & IORESOURCE_DMA_TYPEA)
-               resource->data.dma.type = ACPI_TYPE_A;
-       else if (p->flags & IORESOURCE_DMA_TYPEB)
-               resource->data.dma.type = ACPI_TYPE_B;
-       else if (p->flags & IORESOURCE_DMA_TYPEF)
-               resource->data.dma.type = ACPI_TYPE_F;
-       if (p->flags & IORESOURCE_DMA_8BIT)
-               resource->data.dma.transfer = ACPI_TRANSFER_8;
-       else if (p->flags & IORESOURCE_DMA_8AND16BIT)
-               resource->data.dma.transfer = ACPI_TRANSFER_8_16;
-       else if (p->flags & IORESOURCE_DMA_16BIT)
-               resource->data.dma.transfer = ACPI_TRANSFER_16;
-       resource->data.dma.bus_master = p->flags & IORESOURCE_DMA_MASTER;
+       switch (p->flags & IORESOURCE_DMA_SPEED_MASK) {
+               case IORESOURCE_DMA_TYPEA:
+                       resource->data.dma.type = ACPI_TYPE_A;
+                       break;
+               case IORESOURCE_DMA_TYPEB:
+                       resource->data.dma.type = ACPI_TYPE_B;
+                       break;
+               case IORESOURCE_DMA_TYPEF:
+                       resource->data.dma.type = ACPI_TYPE_F;
+                       break;
+               default:
+                       resource->data.dma.type = ACPI_COMPATIBILITY;
+       }
+
+       switch (p->flags & IORESOURCE_DMA_TYPE_MASK) {
+               case IORESOURCE_DMA_8BIT:
+                       resource->data.dma.transfer = ACPI_TRANSFER_8;
+                       break;
+               case IORESOURCE_DMA_8AND16BIT:
+                       resource->data.dma.transfer = ACPI_TRANSFER_8_16;
+                       break;
+               default:
+                       resource->data.dma.transfer = ACPI_TRANSFER_16;
+       }
+
+       resource->data.dma.bus_master = !!(p->flags & IORESOURCE_DMA_MASTER);
        resource->data.dma.channel_count = 1;
        resource->data.dma.channels[0] = p->start;
 }
index 0b20dfacbf595c6fcc1c00855771688582f3780c..d9417072807506771280912c887d5c8c9da27877 100644 (file)
@@ -136,7 +136,7 @@ static int max6902_get_datetime(struct device *dev, struct rtc_time *dt)
        dt->tm_min      = BCD2BIN(chip->buf[2]);
        dt->tm_hour     = BCD2BIN(chip->buf[3]);
        dt->tm_mday     = BCD2BIN(chip->buf[4]);
-       dt->tm_mon      = BCD2BIN(chip->buf[5] - 1);
+       dt->tm_mon      = BCD2BIN(chip->buf[5]) - 1;
        dt->tm_wday     = BCD2BIN(chip->buf[6]);
        dt->tm_year = BCD2BIN(chip->buf[7]);
 
index 09b714f1cdc39f9dedb4cad38b5b036677a0d9dd..3b58d3d5d38a703ebc658564199d3644e016d0d3 100644 (file)
@@ -195,9 +195,9 @@ static int rtc_probe(struct platform_device *pdev)
         * are all disabled */
        v3020_set_reg(chip, V3020_STATUS_0, 0x0);
 
-       dev_info(&pdev->dev, "Chip available at physical address 0x%p,"
+       dev_info(&pdev->dev, "Chip available at physical address 0x%llx,"
                "data connected to D%d\n",
-               (void*)pdev->resource[0].start,
+               (unsigned long long)pdev->resource[0].start,
                chip->leftshift);
 
        platform_set_drvdata(pdev, chip);
index d0647d116eaa1da8fa5474d982270043b2569290..79ffef6bfaf8a02a802659392e599bbd11f1e468 100644 (file)
@@ -203,6 +203,7 @@ dasd_state_basic_to_known(struct dasd_device * device)
        rc = dasd_flush_ccw_queue(device, 1);
        if (rc)
                return rc;
+       dasd_clear_timer(device);
 
        DBF_DEV_EVENT(DBF_EMERG, device, "%p debug area deleted", device);
        if (device->debug_area != NULL) {
index abd02ed501cbe52cab031dadebf8087bf8290cf4..b9b0fc3f812bf6350c88dd6a89f2bcc139e0c08d 100644 (file)
@@ -73,12 +73,15 @@ static inline struct mon_buf *monwrite_find_hdr(struct mon_private *monpriv,
        struct mon_buf *entry, *next;
 
        list_for_each_entry_safe(entry, next, &monpriv->list, list)
-               if (entry->hdr.applid == monhdr->applid &&
+               if ((entry->hdr.mon_function == monhdr->mon_function ||
+                    monhdr->mon_function == MONWRITE_STOP_INTERVAL) &&
+                   entry->hdr.applid == monhdr->applid &&
                    entry->hdr.record_num == monhdr->record_num &&
                    entry->hdr.version == monhdr->version &&
                    entry->hdr.release == monhdr->release &&
                    entry->hdr.mod_level == monhdr->mod_level)
                        return entry;
+
        return NULL;
 }
 
@@ -92,7 +95,9 @@ static int monwrite_new_hdr(struct mon_private *monpriv)
            monhdr->mon_function > MONWRITE_START_CONFIG ||
            monhdr->hdrlen != sizeof(struct monwrite_hdr))
                return -EINVAL;
-       monbuf = monwrite_find_hdr(monpriv, monhdr);
+       monbuf = NULL;
+       if (monhdr->mon_function != MONWRITE_GEN_EVENT)
+               monbuf = monwrite_find_hdr(monpriv, monhdr);
        if (monbuf) {
                if (monhdr->mon_function == MONWRITE_STOP_INTERVAL) {
                        monhdr->datalen = monbuf->hdr.datalen;
@@ -104,7 +109,7 @@ static int monwrite_new_hdr(struct mon_private *monpriv)
                        kfree(monbuf);
                        monbuf = NULL;
                }
-       } else {
+       } else if (monhdr->mon_function != MONWRITE_STOP_INTERVAL) {
                if (mon_buf_count >= mon_max_bufs)
                        return -ENOSPC;
                monbuf = kzalloc(sizeof(struct mon_buf), GFP_KERNEL);
@@ -118,7 +123,8 @@ static int monwrite_new_hdr(struct mon_private *monpriv)
                }
                monbuf->hdr = *monhdr;
                list_add_tail(&monbuf->list, &monpriv->list);
-               mon_buf_count++;
+               if (monhdr->mon_function != MONWRITE_GEN_EVENT)
+                       mon_buf_count++;
        }
        monpriv->current_buf = monbuf;
        return 0;
index fcaf28d7b4eb6486f2addf5b462d8551bffb2072..de3d0857db9fb83b3526a5d0557876d35dc2b154 100644 (file)
@@ -578,9 +578,13 @@ ccw_device_verify_done(struct ccw_device *cdev, int err)
                }
                break;
        case -ETIME:
+               /* Reset oper notify indication after verify error. */
+               cdev->private->flags.donotify = 0;
                ccw_device_done(cdev, DEV_STATE_BOXED);
                break;
        default:
+               /* Reset oper notify indication after verify error. */
+               cdev->private->flags.donotify = 0;
                PREPARE_WORK(&cdev->private->kick_work,
                             ccw_device_nopath_notify, cdev);
                queue_work(ccw_device_notify_work, &cdev->private->kick_work);
index 0648ce5bb684219c551ce03b610c9df512a612a5..476aa1da5cbcc0cd8e4e27ecccfc6f50c18f4935 100644 (file)
@@ -3529,7 +3529,7 @@ do_QDIO(struct ccw_device *cdev,unsigned int callflags,
 #ifdef CONFIG_QDIO_DEBUG
        char dbf_text[20];
 
-       sprintf(dbf_text,"doQD%04x",cdev->private->sch_no);
+       sprintf(dbf_text,"doQD%04x",cdev->private->schid.sch_no);
        QDIO_DBF_TEXT3(0,trace,dbf_text);
 #endif /* CONFIG_QDIO_DEBUG */
 
index 0d3660c28f7d496840598b908ff909ec753c8c7a..a54e4140683aea238d28e48f50621e801c7d9450 100644 (file)
@@ -5,8 +5,8 @@
  */
 
 #include <linux/kthread.h>
-#include <linux/syscalls.h>
 #include <linux/delay.h>
+#include <linux/kmod.h>
 #include <asm/oplib.h>
 #include <asm/ebus.h>
 
@@ -195,7 +195,7 @@ static void do_envctrl_shutdown(struct bbc_cpu_temperature *tp)
        printk(KERN_CRIT "kenvctrld: Shutting down the system now.\n");
 
        shutting_down = 1;
-       if (kernel_execve("/sbin/shutdown", argv, envp) < 0)
+       if (call_usermodehelper("/sbin/shutdown", argv, envp, 0) < 0)
                printk(KERN_CRIT "envctrl: shutdown execution failed\n");
 }
 
index 6b6a855f3795d8cea72822c0b3bb8f5786b83581..fff4660cdf96e34880f7242d0fdecc588c05536a 100644 (file)
@@ -25,7 +25,7 @@
 #include <linux/delay.h>
 #include <linux/ioport.h>
 #include <linux/miscdevice.h>
-#include <linux/syscalls.h>
+#include <linux/kmod.h>
 
 #include <asm/ebus.h>
 #include <asm/uaccess.h>
@@ -976,7 +976,7 @@ static void envctrl_do_shutdown(void)
 
        inprog = 1;
        printk(KERN_CRIT "kenvctrld: WARNING: Shutting down the system now.\n");
-       ret = kernel_execve("/sbin/shutdown", argv, envp);
+       ret = call_usermodehelper("/sbin/shutdown", argv, envp, 0);
        if (ret < 0) {
                printk(KERN_CRIT "kenvctrld: WARNING: system shutdown failed!\n"); 
                inprog = 0;  /* unlikely to succeed, but we could try again */
index 7c59bba9879812ece3757651ce4c34f686aef0a2..cdd03372478617f3e13a2220cc715fb836f7d0b7 100644 (file)
@@ -3600,5 +3600,16 @@ static void __exit BusLogic_exit(void)
 
 __setup("BusLogic=", BusLogic_Setup);
 
+static struct pci_device_id BusLogic_pci_tbl[] __devinitdata = {
+       { PCI_VENDOR_ID_BUSLOGIC, PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER,
+         PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+       { PCI_VENDOR_ID_BUSLOGIC, PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC,
+         PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+       { PCI_VENDOR_ID_BUSLOGIC, PCI_DEVICE_ID_BUSLOGIC_FLASHPOINT,
+         PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+       { }
+};
+MODULE_DEVICE_TABLE(pci, BusLogic_pci_tbl);
+
 module_init(BusLogic_init);
 module_exit(BusLogic_exit);
index 811d8840707eb8f846ed02d03b3d819c200af6c7..2dbb66d2f0a7398c791e3f51be5f256d06182cf9 100644 (file)
@@ -203,7 +203,7 @@ static irqreturn_t do_eata_pio_int_handler(int irq, void *dev_id)
        irqreturn_t ret;
 
        spin_lock_irqsave(dev->host_lock, flags);
-       ret = eata_pio_int_handler(irq, dev_id, regs);
+       ret = eata_pio_int_handler(irq, dev_id);
        spin_unlock_irqrestore(dev->host_lock, flags);
        return ret;
 }
index 72794a7b6dcc5557bf5b3c5d4b67164e44da573d..65e6e7b7ba07e5ab0ed0b1f5211ecb8e44b7198a 100644 (file)
@@ -1736,6 +1736,15 @@ struct scsi_host_template fdomain_driver_template = {
 };
 
 #ifndef PCMCIA
+
+static struct pci_device_id fdomain_pci_tbl[] __devinitdata = {
+       { PCI_VENDOR_ID_FD, PCI_DEVICE_ID_FD_36C70,
+         PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
+       { }
+};
+MODULE_DEVICE_TABLE(pci, fdomain_pci_tbl);
+
 #define driver_template fdomain_driver_template
 #include "scsi_module.c"
+
 #endif
index 911f2ff4a1f220dc4fb5d8abc12d2b3e31dc74b7..afed293dd7b99137bc4f57ee8819fc1248fbeec6 100644 (file)
 #define i91u_MAXQUEUE          2
 #define i91u_REVID "Initio INI-9X00U/UW SCSI device driver; Revision: 1.04a"
 
-#define INI_VENDOR_ID   0x1101 /* Initio's PCI vendor ID       */
-#define DMX_VENDOR_ID  0x134a  /* Domex's PCI vendor ID        */
 #define I950_DEVICE_ID 0x9500  /* Initio's inic-950 product ID   */
 #define I940_DEVICE_ID 0x9400  /* Initio's inic-940 product ID   */
 #define I935_DEVICE_ID 0x9401  /* Initio's inic-935 product ID   */
@@ -171,13 +169,16 @@ static int setup_debug = 0;
 
 static void i91uSCBPost(BYTE * pHcb, BYTE * pScb);
 
-static const PCI_ID i91u_pci_devices[] = {
-       { INI_VENDOR_ID, I950_DEVICE_ID },
-       { INI_VENDOR_ID, I940_DEVICE_ID },
-       { INI_VENDOR_ID, I935_DEVICE_ID },
-       { INI_VENDOR_ID, I920_DEVICE_ID },
-       { DMX_VENDOR_ID, I920_DEVICE_ID },
+/* PCI Devices supported by this driver */
+static struct pci_device_id i91u_pci_devices[] __devinitdata = {
+       { PCI_VENDOR_ID_INIT,  I950_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+       { PCI_VENDOR_ID_INIT,  I940_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+       { PCI_VENDOR_ID_INIT,  I935_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+       { PCI_VENDOR_ID_INIT,  I920_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+       { PCI_VENDOR_ID_DOMEX, I920_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+       { }
 };
+MODULE_DEVICE_TABLE(pci, i91u_pci_devices);
 
 #define DEBUG_INTERRUPT 0
 #define DEBUG_QUEUE     0
@@ -2771,7 +2772,7 @@ static int tul_NewReturnNumberOfAdapters(void)
 
        for (i = 0; i < ARRAY_SIZE(i91u_pci_devices); i++)
        {
-               while ((pDev = pci_find_device(i91u_pci_devices[i].vendor_id, i91u_pci_devices[i].device_id, pDev)) != NULL) {
+               while ((pDev = pci_find_device(i91u_pci_devices[i].vendor, i91u_pci_devices[i].device, pDev)) != NULL) {
                        if (pci_enable_device(pDev))
                                continue;
                        pci_read_config_dword(pDev, 0x44, (u32 *) & dRegValue);
index c0edb662d863e232a9f45d7fcb6b431f00a985b3..7bac86dda88f9fdc053105ae149e9c9753125421 100644 (file)
@@ -884,7 +884,7 @@ megaraid_init_mbox(adapter_t *adapter)
 
        if (((magic64 == HBA_SIGNATURE_64_BIT) &&
                ((adapter->pdev->subsystem_device !=
-               PCI_SUBSYS_ID_MEGARAID_SATA_150_6) ||
+               PCI_SUBSYS_ID_MEGARAID_SATA_150_6) &&
                (adapter->pdev->subsystem_device !=
                PCI_SUBSYS_ID_MEGARAID_SATA_150_4))) ||
                (adapter->pdev->vendor == PCI_VENDOR_ID_LSI_LOGIC &&
index ed58bb489889acdc85228055351e6753e3b8027f..9b827ceec50125734cd6ef3cafebb6f87949d4fe 100644 (file)
@@ -461,7 +461,7 @@ static int qlogicpti_reset_hardware(struct Scsi_Host *host)
 
 #define PTI_RESET_LIMIT 400
 
-static int __init qlogicpti_load_firmware(struct qlogicpti *qpti)
+static int __devinit qlogicpti_load_firmware(struct qlogicpti *qpti)
 {
        struct Scsi_Host *host = qpti->qhost;
        unsigned short csum = 0;
index 1545b30681b4f1b93a3d2f0b6988438d0d69ffc5..19aa84f460182c5dba50deccc3e9684a7d08082e 100644 (file)
@@ -1,5 +1,5 @@
 /* Version 1.31.00 ISP1000 Initiator RISC firmware */
-unsigned short sbus_risc_code01[] __initdata = {
+unsigned short sbus_risc_code01[] __devinitdata = {
        0x0078, 0x1030, 0x0000, 0x2419, 0x0000, 0x12ff, 0x2043, 0x4f50,
        0x5952, 0x4947, 0x4854, 0x2031, 0x3939, 0x312c, 0x3139, 0x3932,
        0x2c31, 0x3939, 0x332c, 0x3139, 0x3934, 0x2051, 0x4c4f, 0x4749,
@@ -1157,4 +1157,4 @@ unsigned short sbus_risc_code01[] __initdata = {
        0x003c, 0x0040, 0x3415, 0x2019, 0x2626, 0x7b22, 0x7b26, 0x007c,
        0x92a7
 };
-unsigned short sbus_risc_code_length01 = 0x2419;
+unsigned short __devinitdata sbus_risc_code_length01 = 0x2419;
index b0d502622d9452c9cdfa091d282d36e612104205..0b71e7d18903ddd6d36e1d859cde23beee02c891 100644 (file)
@@ -767,37 +767,37 @@ config SERIAL_CPM_SCC1
        bool "Support for SCC1 serial port"
        depends on SERIAL_CPM=y
        help
-         Select this option to use SCC1 as a serial port
+         Select this option to use SCC1 as a serial port
 
 config SERIAL_CPM_SCC2
        bool "Support for SCC2 serial port"
        depends on SERIAL_CPM=y
        help
-         Select this option to use SCC2 as a serial port
+         Select this option to use SCC2 as a serial port
 
 config SERIAL_CPM_SCC3
        bool "Support for SCC3 serial port"
        depends on SERIAL_CPM=y
        help
-         Select this option to use SCC3 as a serial port
+         Select this option to use SCC3 as a serial port
 
 config SERIAL_CPM_SCC4
        bool "Support for SCC4 serial port"
        depends on SERIAL_CPM=y
        help
-         Select this option to use SCC4 as a serial port
+         Select this option to use SCC4 as a serial port
 
 config SERIAL_CPM_SMC1
        bool "Support for SMC1 serial port"
        depends on SERIAL_CPM=y
        help
-         Select this option to use SMC1 as a serial port
+         Select this option to use SMC1 as a serial port
 
 config SERIAL_CPM_SMC2
        bool "Support for SMC2 serial port"
        depends on SERIAL_CPM=y
        help
-         Select this option to use SMC2 as a serial port
+         Select this option to use SMC2 as a serial port
 
 config SERIAL_SGI_L1_CONSOLE
        bool "SGI Altix L1 serial console support"
index 98ce88d802075b74d01f96b6259149e23958db1e..ff4fa25f9fd12cdac405130e096c2200d9eb40fc 100644 (file)
@@ -2935,7 +2935,7 @@ static void __devexit ioc4_serial_exit(void)
        uart_unregister_driver(&ioc4_uart_rs422);
 }
 
-module_init(ioc4_serial_init);
+late_initcall(ioc4_serial_init); /* Call only after tty init is done */
 module_exit(ioc4_serial_exit);
 
 MODULE_AUTHOR("Pat Gefre - Silicon Graphics Inc. (SGI) <pfg@sgi.com>");
index a3473162587745dc276f632537bd60cdd9732e4f..c66ba9ad833df2d4f4dd141e2246d9fb6ccdd901 100644 (file)
@@ -5,19 +5,6 @@
 menu "SN Devices"
        depends on SGI_SN
 
-config SGI_IOC4
-       tristate "SGI IOC4 Base IO support"
-       depends on MMTIMER
-       default m
-       ---help---
-       This option enables basic support for the SGI IOC4-based Base IO
-       controller card.  This option does not enable any specific
-       functions on such a card, but provides necessary infrastructure
-       for other drivers to utilize.
-
-       If you have an SGI Altix with an IOC4-based
-       I/O controller say Y.  Otherwise say N.
-
 config SGI_IOC3
        tristate "SGI IOC3 Base IO support"
        default m
index 2cda011597c0e018ea931a2393f59526effeba9a..693db8bb8d9c0659ceb94a0ae98c81bd6bc9f423 100644 (file)
@@ -3,5 +3,4 @@
 #
 #
 
-obj-$(CONFIG_SGI_IOC4) += ioc4.o
 obj-$(CONFIG_SGI_IOC3) += ioc3.o
index f6b2948ab28856dad684763d2e9e4c52102bf54e..1b601b6cf2a2b78c148395d641955523e07b7515 100644 (file)
@@ -284,6 +284,14 @@ static int samplerate = 100;
 
 module_param(ixjdebug, int, 0);
 
+static struct pci_device_id ixj_pci_tbl[] __devinitdata = {
+       { PCI_VENDOR_ID_QUICKNET, PCI_DEVICE_ID_QUICKNET_XJ,
+         PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+       { }
+};
+
+MODULE_DEVICE_TABLE(pci, ixj_pci_tbl);
+
 /************************************************************************
 *
 * ixjdebug meanings are now bit mapped instead of level based
@@ -7683,7 +7691,8 @@ static int __init ixj_probe_pci(int *cnt)
        IXJ *j = NULL;
 
        for (i = 0; i < IXJMAX - *cnt; i++) {
-               pci = pci_find_device(0x15E2, 0x0500, pci);
+               pci = pci_find_device(PCI_VENDOR_ID_QUICKNET,
+                                     PCI_DEVICE_ID_QUICKNET_XJ, pci);
                if (!pci)
                        break;
 
index 97d57cfc343b628fb81f78820c2ad6cea9e5b958..825bf884537a2204ecdd6019093be9f52bfe4e96 100644 (file)
@@ -33,7 +33,6 @@ obj-$(CONFIG_USB_KBTAB)               += input/
 obj-$(CONFIG_USB_MOUSE)                += input/
 obj-$(CONFIG_USB_MTOUCH)       += input/
 obj-$(CONFIG_USB_POWERMATE)    += input/
-obj-$(CONFIG_USB_TRANCEVIBRATOR)+= input/
 obj-$(CONFIG_USB_WACOM)                += input/
 obj-$(CONFIG_USB_XPAD)         += input/
 
@@ -66,6 +65,7 @@ obj-$(CONFIG_USB_PHIDGETSERVO)        += misc/
 obj-$(CONFIG_USB_RIO500)       += misc/
 obj-$(CONFIG_USB_SISUSBVGA)    += misc/
 obj-$(CONFIG_USB_TEST)         += misc/
+obj-$(CONFIG_USB_TRANCEVIBRATOR)+= misc/
 obj-$(CONFIG_USB_USS720)       += misc/
 
 obj-$(CONFIG_USB_ATM)          += atm/
index 3892a9e9aee3941ca48c9b7f4a3c6e9b6aa79f9d..e6565633ba0fa7801fa8687ff0580fbb1c92b879 100644 (file)
@@ -793,6 +793,9 @@ static const struct usb_device_id cxacru_usb_ids[] = {
        { /* V = Conexant                       P = ADSL modem                          */
                USB_DEVICE(0x0572, 0xcb06),     .driver_info = (unsigned long) &cxacru_cb00
        },
+       { /* V = Conexant                       P = ADSL modem (ZTE ZXDSL 852)          */
+               USB_DEVICE(0x0572, 0xcb07),     .driver_info = (unsigned long) &cxacru_cb00
+       },
        { /* V = Olitec                         P = ADSL modem version 2                */
                USB_DEVICE(0x08e3, 0x0100),     .driver_info = (unsigned long) &cxacru_cafe
        },
index 7c7b507af29df72524adf3816f2952aaffbf07ad..c870c804470fb09d9a286764b7fc09b8db415a50 100644 (file)
@@ -55,7 +55,6 @@ static const char speedtch_driver_name[] = "speedtch";
 #define OFFSET_d       9               /* size 4 */
 #define OFFSET_e       13              /* size 1 */
 #define OFFSET_f       14              /* size 1 */
-#define TOTAL          15
 
 #define SIZE_7         1
 #define SIZE_b         8
@@ -79,6 +78,18 @@ static int dl_512_first = DEFAULT_DL_512_FIRST;
 static int enable_isoc = DEFAULT_ENABLE_ISOC;
 static int sw_buffering = DEFAULT_SW_BUFFERING;
 
+#define DEFAULT_B_MAX_DSL      8128
+#define DEFAULT_MODEM_MODE     11
+#define MODEM_OPTION_LENGTH    16
+static const unsigned char DEFAULT_MODEM_OPTION[MODEM_OPTION_LENGTH] = {
+       0x10, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+static unsigned int BMaxDSL = DEFAULT_B_MAX_DSL;
+static unsigned char ModemMode = DEFAULT_MODEM_MODE;
+static unsigned char ModemOption[MODEM_OPTION_LENGTH];
+static int num_ModemOption;
+
 module_param(altsetting, uint, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(altsetting,
                "Alternative setting for data interface (bulk_default: "
@@ -100,6 +111,17 @@ MODULE_PARM_DESC(sw_buffering,
                 "Enable software buffering (default: "
                 __MODULE_STRING(DEFAULT_SW_BUFFERING) ")");
 
+module_param(BMaxDSL, uint, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(BMaxDSL,
+               "default: " __MODULE_STRING(DEFAULT_B_MAX_DSL));
+
+module_param(ModemMode, byte, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(ModemMode,
+               "default: " __MODULE_STRING(DEFAULT_MODEM_MODE));
+
+module_param_array(ModemOption, byte, &num_ModemOption, S_IRUGO);
+MODULE_PARM_DESC(ModemOption, "default: 0x10,0x00,0x00,0x00,0x20");
+
 #define INTERFACE_DATA         1
 #define ENDPOINT_INT           0x81
 #define ENDPOINT_BULK_DATA     0x07
@@ -108,10 +130,17 @@ MODULE_PARM_DESC(sw_buffering,
 
 #define hex2int(c) ( (c >= '0') && (c <= '9') ? (c - '0') : ((c & 0xf) + 9) )
 
+struct speedtch_params {
+       unsigned int altsetting;
+       unsigned int BMaxDSL;
+       unsigned char ModemMode;
+       unsigned char ModemOption[MODEM_OPTION_LENGTH];
+};
+
 struct speedtch_instance_data {
        struct usbatm_data *usbatm;
 
-       unsigned int altsetting;
+       struct speedtch_params params; /* set in probe, constant afterwards */
 
        struct work_struct status_checker;
 
@@ -123,7 +152,7 @@ struct speedtch_instance_data {
        struct urb *int_urb;
        unsigned char int_data[16];
 
-       unsigned char scratch_buffer[TOTAL];
+       unsigned char scratch_buffer[16];
 };
 
 /***************
@@ -186,6 +215,34 @@ static void speedtch_test_sequence(struct speedtch_instance_data *instance)
                              0x01, 0x40, 0x04, 0x00, buf, 3, CTRL_TIMEOUT);
        if (ret < 0)
                usb_warn(usbatm, "%s failed on URB150: %d\n", __func__, ret);
+
+       /* Extra initialisation in recent drivers - gives higher speeds */
+
+       /* URBext1 */
+       buf[0] = instance->params.ModemMode;
+       ret = usb_control_msg(usb_dev, usb_sndctrlpipe(usb_dev, 0),
+                             0x01, 0x40, 0x11, 0x00, buf, 1, CTRL_TIMEOUT);
+       if (ret < 0)
+               usb_warn(usbatm, "%s failed on URBext1: %d\n", __func__, ret);
+
+       /* URBext2 */
+       /* This seems to be the one which actually triggers the higher sync
+          rate -- it does require the new firmware too, although it works OK
+          with older firmware */
+       ret = usb_control_msg(usb_dev, usb_sndctrlpipe(usb_dev, 0),
+                             0x01, 0x40, 0x14, 0x00,
+                             instance->params.ModemOption,
+                             MODEM_OPTION_LENGTH, CTRL_TIMEOUT);
+       if (ret < 0)
+               usb_warn(usbatm, "%s failed on URBext2: %d\n", __func__, ret);
+
+       /* URBext3 */
+       buf[0] = instance->params.BMaxDSL & 0xff;
+       buf[1] = instance->params.BMaxDSL >> 8;
+       ret = usb_control_msg(usb_dev, usb_sndctrlpipe(usb_dev, 0),
+                             0x01, 0x40, 0x12, 0x00, buf, 2, CTRL_TIMEOUT);
+       if (ret < 0)
+               usb_warn(usbatm, "%s failed on URBext3: %d\n", __func__, ret);
 }
 
 static int speedtch_upload_firmware(struct speedtch_instance_data *instance,
@@ -285,8 +342,8 @@ static int speedtch_upload_firmware(struct speedtch_instance_data *instance,
           because we're in our own kernel thread anyway. */
        msleep_interruptible(1000);
 
-       if ((ret = usb_set_interface(usb_dev, INTERFACE_DATA, instance->altsetting)) < 0) {
-               usb_err(usbatm, "%s: setting interface to %d failed (%d)!\n", __func__, instance->altsetting, ret);
+       if ((ret = usb_set_interface(usb_dev, INTERFACE_DATA, instance->params.altsetting)) < 0) {
+               usb_err(usbatm, "%s: setting interface to %d failed (%d)!\n", __func__, instance->params.altsetting, ret);
                goto out_free;
        }
 
@@ -372,7 +429,7 @@ static int speedtch_read_status(struct speedtch_instance_data *instance)
        unsigned char *buf = instance->scratch_buffer;
        int ret;
 
-       memset(buf, 0, TOTAL);
+       memset(buf, 0, 16);
 
        ret = usb_control_msg(usb_dev, usb_rcvctrlpipe(usb_dev, 0),
                              0x12, 0xc0, 0x07, 0x00, buf + OFFSET_7, SIZE_7,
@@ -746,17 +803,21 @@ static int speedtch_bind(struct usbatm_data *usbatm,
 
        instance->usbatm = usbatm;
 
-       /* altsetting and enable_isoc may change at any moment, so take a snapshot */
-       instance->altsetting = altsetting;
+       /* module parameters may change at any moment, so take a snapshot */
+       instance->params.altsetting = altsetting;
+       instance->params.BMaxDSL = BMaxDSL;
+       instance->params.ModemMode = ModemMode;
+       memcpy(instance->params.ModemOption, DEFAULT_MODEM_OPTION, MODEM_OPTION_LENGTH);
+       memcpy(instance->params.ModemOption, ModemOption, num_ModemOption);
        use_isoc = enable_isoc;
 
-       if (instance->altsetting)
-               if ((ret = usb_set_interface(usb_dev, INTERFACE_DATA, instance->altsetting)) < 0) {
-                       usb_err(usbatm, "%s: setting interface to %2d failed (%d)!\n", __func__, instance->altsetting, ret);
-                       instance->altsetting = 0; /* fall back to default */
+       if (instance->params.altsetting)
+               if ((ret = usb_set_interface(usb_dev, INTERFACE_DATA, instance->params.altsetting)) < 0) {
+                       usb_err(usbatm, "%s: setting interface to %2d failed (%d)!\n", __func__, instance->params.altsetting, ret);
+                       instance->params.altsetting = 0; /* fall back to default */
                }
 
-       if (!instance->altsetting && use_isoc)
+       if (!instance->params.altsetting && use_isoc)
                if ((ret = usb_set_interface(usb_dev, INTERFACE_DATA, DEFAULT_ISOC_ALTSETTING)) < 0) {
                        usb_dbg(usbatm, "%s: setting interface to %2d failed (%d)!\n", __func__, DEFAULT_ISOC_ALTSETTING, ret);
                        use_isoc = 0; /* fall back to bulk */
@@ -783,14 +844,14 @@ static int speedtch_bind(struct usbatm_data *usbatm,
                        usb_info(usbatm, "isochronous transfer not supported - using bulk\n");
        }
 
-       if (!use_isoc && !instance->altsetting)
+       if (!use_isoc && !instance->params.altsetting)
                if ((ret = usb_set_interface(usb_dev, INTERFACE_DATA, DEFAULT_BULK_ALTSETTING)) < 0) {
                        usb_err(usbatm, "%s: setting interface to %2d failed (%d)!\n", __func__, DEFAULT_BULK_ALTSETTING, ret);
                        goto fail_free;
                }
 
-       if (!instance->altsetting)
-               instance->altsetting = use_isoc ? DEFAULT_ISOC_ALTSETTING : DEFAULT_BULK_ALTSETTING;
+       if (!instance->params.altsetting)
+               instance->params.altsetting = use_isoc ? DEFAULT_ISOC_ALTSETTING : DEFAULT_BULK_ALTSETTING;
 
        usbatm->flags |= (use_isoc ? UDSL_USE_ISOC : 0);
 
index f5434b1cbb1e0bba726cdd8ff3303f42c0d73594..f6b9f7e1f716d5dd05c84b4bf836cfc57212adff 100644 (file)
@@ -68,7 +68,7 @@
 
 #include "usbatm.h"
 
-#define EAGLEUSBVERSION "ueagle 1.3"
+#define EAGLEUSBVERSION "ueagle 1.4"
 
 
 /*
                        dev_dbg(&(usb_dev)->dev, \
                                "[ueagle-atm dbg] %s: " format, \
                                        __FUNCTION__, ##args); \
-       } while (0)
+       } while (0)
 
 #define uea_vdbg(usb_dev, format, args...)     \
        do { \
                if (debug >= 2) \
                        dev_dbg(&(usb_dev)->dev, \
                                "[ueagle-atm vdbg]  " format, ##args); \
-       } while (0)
+       } while (0)
 
 #define uea_enters(usb_dev) \
        uea_vdbg(usb_dev, "entering %s\n", __FUNCTION__)
@@ -218,8 +218,8 @@ enum {
 #define UEA_CHIP_VERSION(x) \
        ((x)->driver_info & 0xf)
 
-#define IS_ISDN(sc) \
-       (le16_to_cpu(sc->usb_dev->descriptor.bcdDevice) & 0x80)
+#define IS_ISDN(usb_dev) \
+       (le16_to_cpu((usb_dev)->descriptor.bcdDevice) & 0x80)
 
 #define INS_TO_USBDEV(ins) ins->usb_dev
 
@@ -625,12 +625,12 @@ static int request_dsp(struct uea_softc *sc)
        char *dsp_name;
 
        if (UEA_CHIP_VERSION(sc) == ADI930) {
-               if (IS_ISDN(sc))
+               if (IS_ISDN(sc->usb_dev))
                        dsp_name = FW_DIR "DSP9i.bin";
                else
                        dsp_name = FW_DIR "DSP9p.bin";
        } else {
-               if (IS_ISDN(sc))
+               if (IS_ISDN(sc->usb_dev))
                        dsp_name = FW_DIR "DSPei.bin";
                else
                        dsp_name = FW_DIR "DSPep.bin";
@@ -744,7 +744,7 @@ static inline void wake_up_cmv_ack(struct uea_softc *sc)
 
 static inline int wait_cmv_ack(struct uea_softc *sc)
 {
-       int ret = wait_event_timeout(sc->cmv_ack_wait,
+       int ret = wait_event_interruptible_timeout(sc->cmv_ack_wait,
                                                   sc->cmv_ack, ACK_TIMEOUT);
        sc->cmv_ack = 0;
 
@@ -885,7 +885,8 @@ static int uea_stat(struct uea_softc *sc)
                break;
 
        case 3:         /* fail ... */
-               uea_info(INS_TO_USBDEV(sc), "modem synchronization failed\n");
+               uea_info(INS_TO_USBDEV(sc), "modem synchronization failed"
+                               " (may be try other cmv/dsp)\n");
                return -EAGAIN;
 
        case 4 ... 6:   /* test state */
@@ -913,12 +914,6 @@ static int uea_stat(struct uea_softc *sc)
                        release_firmware(sc->dsp_firm);
                        sc->dsp_firm = NULL;
                }
-
-               ret = uea_read_cmv(sc, SA_INFO, 10, &sc->stats.phy.firmid);
-               if (ret < 0)
-                       return ret;
-               uea_info(INS_TO_USBDEV(sc), "ATU-R firmware version : %x\n",
-                               sc->stats.phy.firmid);
        }
 
        /* always update it as atm layer could not be init when we switch to
@@ -1033,9 +1028,9 @@ static int request_cmvs(struct uea_softc *sc,
 
        if (cmv_file[sc->modem_index] == NULL) {
                if (UEA_CHIP_VERSION(sc) == ADI930)
-                       file = (IS_ISDN(sc)) ? "CMV9i.bin" : "CMV9p.bin";
+                       file = (IS_ISDN(sc->usb_dev)) ? "CMV9i.bin" : "CMV9p.bin";
                else
-                       file = (IS_ISDN(sc)) ? "CMVei.bin" : "CMVep.bin";
+                       file = (IS_ISDN(sc->usb_dev)) ? "CMVei.bin" : "CMVep.bin";
        } else
                file = cmv_file[sc->modem_index];
 
@@ -1131,6 +1126,13 @@ static int uea_start_reset(struct uea_softc *sc)
        if (ret < 0)
                return ret;
 
+       /* Dump firmware version */
+       ret = uea_read_cmv(sc, SA_INFO, 10, &sc->stats.phy.firmid);
+       if (ret < 0)
+               return ret;
+       uea_info(INS_TO_USBDEV(sc), "ATU-R firmware version : %x\n",
+                       sc->stats.phy.firmid);
+
        /* get options */
        ret = len = request_cmvs(sc, &cmvs, &cmvs_fw);
        if (ret < 0)
@@ -1147,6 +1149,8 @@ static int uea_start_reset(struct uea_softc *sc)
        /* Enter in R-ACT-REQ */
        ret = uea_write_cmv(sc, SA_CNTL, 0, 2);
        uea_vdbg(INS_TO_USBDEV(sc), "Entering in R-ACT-REQ state\n");
+       uea_info(INS_TO_USBDEV(sc), "Modem started, "
+               "waiting synchronization\n");
 out:
        release_firmware(cmvs_fw);
        sc->reset = 0;
@@ -1172,7 +1176,10 @@ static int uea_kthread(void *data)
                if (!ret)
                        ret = uea_stat(sc);
                if (ret != -EAGAIN)
-                       msleep(1000);
+                       msleep_interruptible(1000);
+               if (try_to_freeze())
+                       uea_err(INS_TO_USBDEV(sc), "suspend/resume not supported, "
+                               "please unplug/replug your modem\n");
        }
        uea_leaves(INS_TO_USBDEV(sc));
        return ret;
@@ -1566,6 +1573,7 @@ UEA_ATTR(uscorr, 0);
 UEA_ATTR(dscorr, 0);
 UEA_ATTR(usunc, 0);
 UEA_ATTR(dsunc, 0);
+UEA_ATTR(firmid, 0);
 
 /* Retrieve the device End System Identifier (MAC) */
 
@@ -1597,7 +1605,7 @@ static int uea_heavy(struct usbatm_data *usbatm, struct usb_interface *intf)
 {
        struct uea_softc *sc = usbatm->driver_data;
 
-       wait_event(sc->sync_q, IS_OPERATIONAL(sc));
+       wait_event_interruptible(sc->sync_q, IS_OPERATIONAL(sc));
 
        return 0;
 
@@ -1639,16 +1647,13 @@ static struct attribute *attrs[] = {
        &dev_attr_stat_dscorr.attr,
        &dev_attr_stat_usunc.attr,
        &dev_attr_stat_dsunc.attr,
+       &dev_attr_stat_firmid.attr,
+       NULL,
 };
 static struct attribute_group attr_grp = {
        .attrs = attrs,
 };
 
-static int create_fs_entries(struct usb_interface *intf)
-{
-       return sysfs_create_group(&intf->dev.kobj, &attr_grp);
-}
-
 static int uea_bind(struct usbatm_data *usbatm, struct usb_interface *intf,
                   const struct usb_device_id *id)
 {
@@ -1708,31 +1713,25 @@ static int uea_bind(struct usbatm_data *usbatm, struct usb_interface *intf,
                }
        }
 
+       ret = sysfs_create_group(&intf->dev.kobj, &attr_grp);
+       if (ret < 0)
+               goto error;
+
        ret = uea_boot(sc);
-       if (ret < 0) {
-               kfree(sc);
-               return ret;
-       }
+       if (ret < 0)
+               goto error;
 
-       ret = create_fs_entries(intf);
-       if (ret) {
-               uea_stop(sc);
-               kfree(sc);
-               return ret;
-       }
        return 0;
-}
-
-static void destroy_fs_entries(struct usb_interface *intf)
-{
-       sysfs_remove_group(&intf->dev.kobj, &attr_grp);
+error:
+       kfree(sc);
+       return ret;
 }
 
 static void uea_unbind(struct usbatm_data *usbatm, struct usb_interface *intf)
 {
        struct uea_softc *sc = usbatm->driver_data;
 
-       destroy_fs_entries(intf);
+       sysfs_remove_group(&intf->dev.kobj, &attr_grp);
        uea_stop(sc);
        kfree(sc);
 }
@@ -1753,10 +1752,10 @@ static int uea_probe(struct usb_interface *intf, const struct usb_device_id *id)
        struct usb_device *usb = interface_to_usbdev(intf);
 
        uea_enters(usb);
-       uea_info(usb, "ADSL device founded vid (%#X) pid (%#X) : %s\n",
+       uea_info(usb, "ADSL device founded vid (%#X) pid (%#X) : %s %s\n",
               le16_to_cpu(usb->descriptor.idVendor),
               le16_to_cpu(usb->descriptor.idProduct),
-              chip_name[UEA_CHIP_VERSION(id)]);
+              chip_name[UEA_CHIP_VERSION(id)], IS_ISDN(usb)?"isdn":"pots");
 
        usb_reset_device(usb);
 
index 309073f6433a73d02b8355e4605e0ab8187a3a87..ec63b0ee07437312f8c9abc6a4f3dfbe057d7d70 100644 (file)
@@ -1001,6 +1001,7 @@ static int usbatm_do_heavy_init(void *arg)
 
        daemonize(instance->driver->driver_name);
        allow_signal(SIGTERM);
+       instance->thread_pid = current->pid;
 
        complete(&instance->thread_started);
 
@@ -1025,10 +1026,6 @@ static int usbatm_heavy_init(struct usbatm_data *instance)
                return ret;
        }
 
-       mutex_lock(&instance->serialize);
-       instance->thread_pid = ret;
-       mutex_unlock(&instance->serialize);
-
        wait_for_completion(&instance->thread_started);
 
        return 0;
index ec4d1d756725001e7296361b611d5c744317499d..9a9012fd284b48668e7feb7d46b32bcfd97810f2 100644 (file)
@@ -325,7 +325,7 @@ static void acm_rx_tasklet(unsigned long _acm)
        struct acm_rb *buf;
        struct tty_struct *tty = acm->tty;
        struct acm_ru *rcv;
-       //unsigned long flags;
+       unsigned long flags;
        int i = 0;
        dbg("Entering acm_rx_tasklet");
 
@@ -333,15 +333,15 @@ static void acm_rx_tasklet(unsigned long _acm)
                return;
 
 next_buffer:
-       spin_lock(&acm->read_lock);
+       spin_lock_irqsave(&acm->read_lock, flags);
        if (list_empty(&acm->filled_read_bufs)) {
-               spin_unlock(&acm->read_lock);
+               spin_unlock_irqrestore(&acm->read_lock, flags);
                goto urbs;
        }
        buf = list_entry(acm->filled_read_bufs.next,
                         struct acm_rb, list);
        list_del(&buf->list);
-       spin_unlock(&acm->read_lock);
+       spin_unlock_irqrestore(&acm->read_lock, flags);
 
        dbg("acm_rx_tasklet: procesing buf 0x%p, size = %d", buf, buf->size);
 
@@ -356,29 +356,29 @@ next_buffer:
                memmove(buf->base, buf->base + i, buf->size - i);
                buf->size -= i;
                spin_unlock(&acm->throttle_lock);
-               spin_lock(&acm->read_lock);
+               spin_lock_irqsave(&acm->read_lock, flags);
                list_add(&buf->list, &acm->filled_read_bufs);
-               spin_unlock(&acm->read_lock);
+               spin_unlock_irqrestore(&acm->read_lock, flags);
                return;
        }
        spin_unlock(&acm->throttle_lock);
 
-       spin_lock(&acm->read_lock);
+       spin_lock_irqsave(&acm->read_lock, flags);
        list_add(&buf->list, &acm->spare_read_bufs);
-       spin_unlock(&acm->read_lock);
+       spin_unlock_irqrestore(&acm->read_lock, flags);
        goto next_buffer;
 
 urbs:
        while (!list_empty(&acm->spare_read_bufs)) {
-               spin_lock(&acm->read_lock);
+               spin_lock_irqsave(&acm->read_lock, flags);
                if (list_empty(&acm->spare_read_urbs)) {
-                       spin_unlock(&acm->read_lock);
+                       spin_unlock_irqrestore(&acm->read_lock, flags);
                        return;
                }
                rcv = list_entry(acm->spare_read_urbs.next,
                                 struct acm_ru, list);
                list_del(&rcv->list);
-               spin_unlock(&acm->read_lock);
+               spin_unlock_irqrestore(&acm->read_lock, flags);
 
                buf = list_entry(acm->spare_read_bufs.next,
                                 struct acm_rb, list);
@@ -400,9 +400,9 @@ urbs:
                   free-urbs-pool and resubmited ASAP */
                if (usb_submit_urb(rcv->urb, GFP_ATOMIC) < 0) {
                        list_add(&buf->list, &acm->spare_read_bufs);
-                       spin_lock(&acm->read_lock);
+                       spin_lock_irqsave(&acm->read_lock, flags);
                        list_add(&rcv->list, &acm->spare_read_urbs);
-                       spin_unlock(&acm->read_lock);
+                       spin_unlock_irqrestore(&acm->read_lock, flags);
                        return;
                }
        }
@@ -1083,6 +1083,9 @@ static struct usb_device_id acm_ids[] = {
        { USB_DEVICE(0x0482, 0x0203), /* KYOCERA AH-K3001V */
        .driver_info = NO_UNION_NORMAL, /* has no union descriptor */
        },
+       { USB_DEVICE(0x079b, 0x000f), /* BT On-Air USB MODEM */
+       .driver_info = NO_UNION_NORMAL, /* has no union descriptor */
+       },
        { USB_DEVICE(0x0ace, 0x1608), /* ZyDAS 56K USB MODEM */
        .driver_info = SINGLE_RX_URB, /* firmware bug */
        },
index a161d70e1e42c3af7800581ec182333739f1ef27..809d465eb25726dfd0806869f99f4725f8089c43 100644 (file)
@@ -154,6 +154,7 @@ struct usblp {
        unsigned char           used;                   /* True if open */
        unsigned char           present;                /* True if not disconnected */
        unsigned char           bidir;                  /* interface is bidirectional */
+       unsigned char           sleeping;               /* interface is suspended */
        unsigned char           *device_id_string;      /* IEEE 1284 DEVICE ID string (ptr) */
                                                        /* first 2 bytes are (big-endian) length */
 };
@@ -183,6 +184,7 @@ static void usblp_dump(struct usblp *usblp) {
        dbg("quirks=%d", usblp->quirks);
        dbg("used=%d", usblp->used);
        dbg("bidir=%d", usblp->bidir);
+       dbg("sleeping=%d", usblp->sleeping);
        dbg("device_id_string=\"%s\"",
                usblp->device_id_string ?
                        usblp->device_id_string + 2 :
@@ -338,6 +340,20 @@ static int usblp_check_status(struct usblp *usblp, int err)
        return newerr;
 }
 
+static int handle_bidir (struct usblp *usblp)
+{
+       if (usblp->bidir && usblp->used && !usblp->sleeping) {
+               usblp->readcount = 0;
+               usblp->readurb->dev = usblp->dev;
+               if (usb_submit_urb(usblp->readurb, GFP_KERNEL) < 0) {
+                       usblp->used = 0;
+                       return -EIO;
+               }
+       }
+
+       return 0;
+}
+
 /*
  * File op functions.
  */
@@ -390,14 +406,9 @@ static int usblp_open(struct inode *inode, struct file *file)
        usblp->writeurb->status = 0;
        usblp->readurb->status = 0;
 
-       if (usblp->bidir) {
-               usblp->readcount = 0;
-               usblp->readurb->dev = usblp->dev;
-               if (usb_submit_urb(usblp->readurb, GFP_KERNEL) < 0) {
-                       retval = -EIO;
-                       usblp->used = 0;
-                       file->private_data = NULL;
-               }
+       if (handle_bidir(usblp) < 0) {
+               file->private_data = NULL;
+               retval = -EIO;
        }
 out:
        mutex_unlock (&usblp_mutex);
@@ -460,6 +471,11 @@ static long usblp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                goto done;
        }
 
+       if (usblp->sleeping) {
+               retval = -ENODEV;
+               goto done;
+       }
+
        dbg("usblp_ioctl: cmd=0x%x (%c nr=%d len=%d dir=%d)", cmd, _IOC_TYPE(cmd),
                _IOC_NR(cmd), _IOC_SIZE(cmd), _IOC_DIR(cmd) );
 
@@ -658,6 +674,11 @@ static ssize_t usblp_write(struct file *file, const char __user *buffer, size_t
                        return -ENODEV;
                }
 
+               if (usblp->sleeping) {
+                       up (&usblp->sem);
+                       return writecount ? writecount : -ENODEV;
+               }
+
                if (usblp->writeurb->status != 0) {
                        if (usblp->quirks & USBLP_QUIRK_BIDIR) {
                                if (!usblp->wcomplete)
@@ -749,6 +770,11 @@ static ssize_t usblp_read(struct file *file, char __user *buffer, size_t count,
                goto done;
        }
 
+       if (usblp->sleeping) {
+               count = -ENODEV;
+               goto done;
+       }
+
        if (usblp->readurb->status) {
                err("usblp%d: error %d reading from printer",
                        usblp->minor, usblp->readurb->status);
@@ -1167,6 +1193,41 @@ static void usblp_disconnect(struct usb_interface *intf)
        mutex_unlock (&usblp_mutex);
 }
 
+static int usblp_suspend (struct usb_interface *intf, pm_message_t message)
+{
+       struct usblp *usblp = usb_get_intfdata (intf);
+
+       /* this races against normal access and open */
+       mutex_lock (&usblp_mutex);
+       down (&usblp->sem);
+       /* we take no more IO */
+       usblp->sleeping = 1;
+       /* we wait for anything printing */
+       wait_event (usblp->wait, usblp->wcomplete || !usblp->present);
+       usblp_unlink_urbs(usblp);
+       up (&usblp->sem);
+       mutex_unlock (&usblp_mutex);
+
+       return 0;
+}
+
+static int usblp_resume (struct usb_interface *intf)
+{
+       struct usblp *usblp = usb_get_intfdata (intf);
+       int r;
+
+       mutex_lock (&usblp_mutex);
+       down (&usblp->sem);
+
+       usblp->sleeping = 0;
+       r = handle_bidir (usblp);
+
+       up (&usblp->sem);
+       mutex_unlock (&usblp_mutex);
+
+       return r;
+}
+
 static struct usb_device_id usblp_ids [] = {
        { USB_DEVICE_INFO(7, 1, 1) },
        { USB_DEVICE_INFO(7, 1, 2) },
@@ -1183,6 +1244,8 @@ static struct usb_driver usblp_driver = {
        .name =         "usblp",
        .probe =        usblp_probe,
        .disconnect =   usblp_disconnect,
+       .suspend =      usblp_suspend,
+       .resume =       usblp_resume,
        .id_table =     usblp_ids,
 };
 
index 724822cac2b1091894e63053af410777f29a8049..fed92be63b5ebf2ff0f5247b23b7bd349f4dcd85 100644 (file)
@@ -1588,15 +1588,18 @@ const struct file_operations usbfs_device_file_operations = {
        .release =      usbdev_release,
 };
 
-static void usbdev_add(struct usb_device *dev)
+static int usbdev_add(struct usb_device *dev)
 {
        int minor = ((dev->bus->busnum-1) * 128) + (dev->devnum-1);
 
        dev->class_dev = class_device_create(usb_device_class, NULL,
                                MKDEV(USB_DEVICE_MAJOR, minor), &dev->dev,
                                "usbdev%d.%d", dev->bus->busnum, dev->devnum);
+       if (IS_ERR(dev->class_dev))
+               return PTR_ERR(dev->class_dev);
 
        dev->class_dev->class_data = dev;
+       return 0;
 }
 
 static void usbdev_remove(struct usb_device *dev)
@@ -1609,7 +1612,8 @@ static int usbdev_notify(struct notifier_block *self, unsigned long action,
 {
        switch (action) {
        case USB_DEVICE_ADD:
-               usbdev_add(dev);
+               if (usbdev_add(dev))
+                       return NOTIFY_BAD;
                break;
        case USB_DEVICE_REMOVE:
                usbdev_remove(dev);
index 3ebb90149e93ef7319ae529c22da546032172730..3b2d137912beb6dce921d925adccff2873bb6f86 100644 (file)
@@ -223,7 +223,7 @@ int usb_create_ep_files(struct device *parent,
        ep_dev = kzalloc(sizeof(*ep_dev), GFP_KERNEL);
        if (!ep_dev) {
                retval = -ENOMEM;
-               goto exit;
+               goto error_alloc;
        }
 
        /* fun calculation to determine the minor of this endpoint */
@@ -241,33 +241,31 @@ int usb_create_ep_files(struct device *parent,
 
        retval = device_register(&ep_dev->dev);
        if (retval)
-               goto error;
+               goto error_register;
        retval = sysfs_create_group(&ep_dev->dev.kobj, &ep_dev_attr_grp);
        if (retval)
                goto error_group;
 
-       endpoint->ep_dev = ep_dev;
-
        /* create the symlink to the old-style "ep_XX" directory */
        sprintf(name, "ep_%02x", endpoint->desc.bEndpointAddress);
-       retval = sysfs_create_link(&parent->kobj,
-                                  &endpoint->ep_dev->dev.kobj, name);
+       retval = sysfs_create_link(&parent->kobj, &ep_dev->dev.kobj, name);
        if (retval)
                goto error_link;
-exit:
+       endpoint->ep_dev = ep_dev;
        return retval;
 
 error_link:
        sysfs_remove_group(&ep_dev->dev.kobj, &ep_dev_attr_grp);
-
 error_group:
        device_unregister(&ep_dev->dev);
-       endpoint->ep_dev = NULL;
        destroy_endpoint_class();
        return retval;
-error:
+
+error_register:
        kfree(ep_dev);
+error_alloc:
        destroy_endpoint_class();
+exit:
        return retval;
 }
 
@@ -282,8 +280,6 @@ void usb_remove_ep_files(struct usb_host_endpoint *endpoint)
                sysfs_remove_group(&endpoint->ep_dev->dev.kobj, &ep_dev_attr_grp);
                device_unregister(&endpoint->ep_dev->dev);
                endpoint->ep_dev = NULL;
+               destroy_endpoint_class();
        }
-       destroy_endpoint_class();
 }
-
-
index d954daa8e9e072688a33554ca9e8969b6c7cadf2..3acc896a5d4c4abc08e6df1149d575ec52438da5 100644 (file)
@@ -1774,8 +1774,8 @@ static DEVICE_ATTR (queues, S_IRUGO, show_queues, NULL);
 
 #else
 
-#define device_create_file(a,b)        do {} while (0)
-#define device_remove_file     device_create_file
+#define device_create_file(a,b)        (0)
+#define device_remove_file(a,b)        do { } while (0)
 
 #endif
 
@@ -2044,8 +2044,10 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver)
                return retval;
        }
 
-       device_create_file (&dev->pdev->dev, &dev_attr_function);
-       device_create_file (&dev->pdev->dev, &dev_attr_queues);
+       retval = device_create_file (&dev->pdev->dev, &dev_attr_function);
+       if (retval) goto err_unbind;
+       retval = device_create_file (&dev->pdev->dev, &dev_attr_queues);
+       if (retval) goto err_func;
 
        /* ... then enable host detection and ep0; and we're ready
         * for set_configuration as well as eventual disconnect.
@@ -2060,6 +2062,14 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver)
 
        /* pci writes may still be posted */
        return 0;
+
+err_func:
+       device_remove_file (&dev->pdev->dev, &dev_attr_function);
+err_unbind:
+       driver->unbind (&dev->gadget);
+       dev->gadget.dev.driver = NULL;
+       dev->driver = NULL;
+       return retval;
 }
 EXPORT_SYMBOL (usb_gadget_register_driver);
 
@@ -2974,8 +2984,10 @@ static int net2280_probe (struct pci_dev *pdev, const struct pci_device_id *id)
                                : "disabled");
        the_controller = dev;
 
-       device_register (&dev->gadget.dev);
-       device_create_file (&pdev->dev, &dev_attr_registers);
+       retval = device_register (&dev->gadget.dev);
+       if (retval) goto done;
+       retval = device_create_file (&pdev->dev, &dev_attr_registers);
+       if (retval) goto done;
 
        return 0;
 
index f42c00ef0bca3b53c64478095419ac562c06525e..671c24bc6d75361f670e3dc172eca76fd9eedf18 100644 (file)
 #include <linux/mm.h>
 #include <linux/platform_device.h>
 #include <linux/dma-mapping.h>
+#include <linux/irq.h>
 
 #include <asm/byteorder.h>
 #include <asm/dma.h>
 #include <asm/io.h>
-#include <asm/irq.h>
 #include <asm/system.h>
 #include <asm/mach-types.h>
 #include <asm/unaligned.h>
index 23b95b2bfe1572e7788a6422e4a09f3a60261d2e..34b7a31cd85b90900a45a8626c186084a16f234f 100644 (file)
@@ -754,7 +754,9 @@ show_registers (struct class_device *class_dev, char *buf)
        }
 
        if (ehci->reclaim) {
-               temp = scnprintf (next, size, "reclaim qh %p\n", ehci->reclaim);
+               temp = scnprintf (next, size, "reclaim qh %p%s\n",
+                               ehci->reclaim,
+                               ehci->reclaim_ready ? " ready" : "");
                size -= temp;
                next += temp;
        }
index aac6ec5dd7cf5f70f0281affdd2ed2c38faeed0e..9030994aba985b5d2fd23b8e967a290263e30d42 100644 (file)
@@ -111,7 +111,7 @@ static const char   hcd_name [] = "ehci_hcd";
 #define        EHCI_TUNE_MULT_TT       1
 #define        EHCI_TUNE_FLS           2       /* (small) 256 frame schedule */
 
-#define EHCI_IAA_MSECS         10              /* arbitrary */
+#define EHCI_IAA_JIFFIES       (HZ/100)        /* arbitrary; ~10 msec */
 #define EHCI_IO_JIFFIES                (HZ/10)         /* io watchdog > irq_thresh */
 #define EHCI_ASYNC_JIFFIES     (HZ/20)         /* async idle timeout */
 #define EHCI_SHRINK_JIFFIES    (HZ/200)        /* async qh unlink delay */
@@ -254,7 +254,6 @@ static void ehci_quiesce (struct ehci_hcd *ehci)
 
 /*-------------------------------------------------------------------------*/
 
-static void end_unlink_async (struct ehci_hcd *ehci);
 static void ehci_work(struct ehci_hcd *ehci);
 
 #include "ehci-hub.c"
@@ -264,37 +263,25 @@ static void ehci_work(struct ehci_hcd *ehci);
 
 /*-------------------------------------------------------------------------*/
 
-static void ehci_iaa_watchdog (unsigned long param)
+static void ehci_watchdog (unsigned long param)
 {
        struct ehci_hcd         *ehci = (struct ehci_hcd *) param;
        unsigned long           flags;
-       u32                     status;
 
        spin_lock_irqsave (&ehci->lock, flags);
-       WARN_ON(!ehci->reclaim);
 
-       /* lost IAA irqs wedge things badly; seen first with a vt8235 */
+       /* lost IAA irqs wedge things badly; seen with a vt8235 */
        if (ehci->reclaim) {
-               status = readl (&ehci->regs->status);
+               u32             status = readl (&ehci->regs->status);
                if (status & STS_IAA) {
                        ehci_vdbg (ehci, "lost IAA\n");
                        COUNT (ehci->stats.lost_iaa);
                        writel (STS_IAA, &ehci->regs->status);
-                       end_unlink_async (ehci);
+                       ehci->reclaim_ready = 1;
                }
        }
 
-       spin_unlock_irqrestore (&ehci->lock, flags);
-}
-
-static void ehci_watchdog (unsigned long param)
-{
-       struct ehci_hcd         *ehci = (struct ehci_hcd *) param;
-       unsigned long           flags;
-
-       spin_lock_irqsave (&ehci->lock, flags);
-
-       /* stop async processing after it's idled a bit */
+       /* stop async processing after it's idled a bit */
        if (test_bit (TIMER_ASYNC_OFF, &ehci->actions))
                start_unlink_async (ehci, ehci->async);
 
@@ -345,6 +332,8 @@ static void ehci_port_power (struct ehci_hcd *ehci, int is_on)
 static void ehci_work (struct ehci_hcd *ehci)
 {
        timer_action_done (ehci, TIMER_IO_WATCHDOG);
+       if (ehci->reclaim_ready)
+               end_unlink_async (ehci);
 
        /* another CPU may drop ehci->lock during a schedule scan while
         * it reports urb completions.  this flag guards against bogus
@@ -379,7 +368,6 @@ static void ehci_stop (struct usb_hcd *hcd)
 
        /* no more interrupts ... */
        del_timer_sync (&ehci->watchdog);
-       del_timer_sync (&ehci->iaa_watchdog);
 
        spin_lock_irq(&ehci->lock);
        if (HC_IS_RUNNING (hcd->state))
@@ -426,10 +414,6 @@ static int ehci_init(struct usb_hcd *hcd)
        ehci->watchdog.function = ehci_watchdog;
        ehci->watchdog.data = (unsigned long) ehci;
 
-       init_timer(&ehci->iaa_watchdog);
-       ehci->iaa_watchdog.function = ehci_iaa_watchdog;
-       ehci->iaa_watchdog.data = (unsigned long) ehci;
-
        /*
         * hw default: 1K periodic list heads, one per frame.
         * periodic_size can shrink by USBCMD update if hcc_params allows.
@@ -446,6 +430,7 @@ static int ehci_init(struct usb_hcd *hcd)
                ehci->i_thresh = 2 + HCC_ISOC_THRES(hcc_params);
 
        ehci->reclaim = NULL;
+       ehci->reclaim_ready = 0;
        ehci->next_uframe = -1;
 
        /*
@@ -619,7 +604,7 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd)
        /* complete the unlinking of some qh [4.15.2.3] */
        if (status & STS_IAA) {
                COUNT (ehci->stats.reclaim);
-               end_unlink_async (ehci);
+               ehci->reclaim_ready = 1;
                bh = 1;
        }
 
@@ -723,14 +708,10 @@ static int ehci_urb_enqueue (
 
 static void unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
 {
-       // BUG_ON(qh->qh_state != QH_STATE_LINKED);
-
-       /* failfast */
-       if (!HC_IS_RUNNING (ehci_to_hcd(ehci)->state))
-               end_unlink_async (ehci);
-
-       /* defer till later if busy */
-       else if (ehci->reclaim) {
+       /* if we need to use IAA and it's busy, defer */
+       if (qh->qh_state == QH_STATE_LINKED
+                       && ehci->reclaim
+                       && HC_IS_RUNNING (ehci_to_hcd(ehci)->state)) {
                struct ehci_qh          *last;
 
                for (last = ehci->reclaim;
@@ -740,8 +721,12 @@ static void unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
                qh->qh_state = QH_STATE_UNLINK_WAIT;
                last->reclaim = qh;
 
-       /* start IAA cycle */
-       } else
+       /* bypass IAA if the hc can't care */
+       } else if (!HC_IS_RUNNING (ehci_to_hcd(ehci)->state) && ehci->reclaim)
+               end_unlink_async (ehci);
+
+       /* something else might have unlinked the qh by now */
+       if (qh->qh_state == QH_STATE_LINKED)
                start_unlink_async (ehci, qh);
 }
 
@@ -763,19 +748,7 @@ static int ehci_urb_dequeue (struct usb_hcd *hcd, struct urb *urb)
                qh = (struct ehci_qh *) urb->hcpriv;
                if (!qh)
                        break;
-               switch (qh->qh_state) {
-               case QH_STATE_LINKED:
-               case QH_STATE_COMPLETING:
-                       unlink_async (ehci, qh);
-                       break;
-               case QH_STATE_UNLINK:
-               case QH_STATE_UNLINK_WAIT:
-                       /* already started */
-                       break;
-               case QH_STATE_IDLE:
-                       WARN_ON(1);
-                       break;
-               }
+               unlink_async (ehci, qh);
                break;
 
        case PIPE_INTERRUPT:
@@ -867,7 +840,6 @@ rescan:
                unlink_async (ehci, qh);
                /* FALL THROUGH */
        case QH_STATE_UNLINK:           /* wait for hw to finish? */
-       case QH_STATE_UNLINK_WAIT:
 idle_timeout:
                spin_unlock_irqrestore (&ehci->lock, flags);
                schedule_timeout_uninterruptible(1);
index 2012213c0a254c719738c9a7ddd0f2bd46f002fb..1b20722c102b5ad5c936252a6c5f1243fc443de9 100644 (file)
@@ -48,7 +48,7 @@ static int ehci_bus_suspend (struct usb_hcd *hcd)
        }
        ehci->command = readl (&ehci->regs->command);
        if (ehci->reclaim)
-               end_unlink_async (ehci);
+               ehci->reclaim_ready = 1;
        ehci_work(ehci);
 
        /* suspend any active/unsuspended ports, maybe allow wakeup */
index 35e3fab6fc4e85e23a8119424409c15e6b3c3333..e51c1ed81ac463cdc677c1a84883ede4e6a2ec9c 100644 (file)
@@ -303,7 +303,7 @@ restart:
        /* emptying the schedule aborts any urbs */
        spin_lock_irq(&ehci->lock);
        if (ehci->reclaim)
-               end_unlink_async (ehci);
+               ehci->reclaim_ready = 1;
        ehci_work(ehci);
        spin_unlock_irq(&ehci->lock);
 
index 46327272f6148b7c044bec6c8d5c4f0737546310..62e46dc60e86d6cbb3a6b36d28052f375b4aecfb 100644 (file)
@@ -967,7 +967,7 @@ static void end_unlink_async (struct ehci_hcd *ehci)
        struct ehci_qh          *qh = ehci->reclaim;
        struct ehci_qh          *next;
 
-       iaa_watchdog_done (ehci);
+       timer_action_done (ehci, TIMER_IAA_WATCHDOG);
 
        // qh->hw_next = cpu_to_le32 (qh->qh_dma);
        qh->qh_state = QH_STATE_IDLE;
@@ -977,6 +977,7 @@ static void end_unlink_async (struct ehci_hcd *ehci)
        /* other unlink(s) may be pending (in QH_STATE_UNLINK_WAIT) */
        next = qh->reclaim;
        ehci->reclaim = next;
+       ehci->reclaim_ready = 0;
        qh->reclaim = NULL;
 
        qh_completions (ehci, qh);
@@ -1051,10 +1052,11 @@ static void start_unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
                return;
        }
 
+       ehci->reclaim_ready = 0;
        cmd |= CMD_IAAD;
        writel (cmd, &ehci->regs->command);
        (void) readl (&ehci->regs->command);
-       iaa_watchdog_start (ehci);
+       timer_action (ehci, TIMER_IAA_WATCHDOG);
 }
 
 /*-------------------------------------------------------------------------*/
index 6aac39f50e0734d35e33f2fb3cfd5c6e2fcec627..bbc3082a73d752ae359b4c45fb1ae59cd0764699 100644 (file)
@@ -58,6 +58,7 @@ struct ehci_hcd {                     /* one per controller */
        /* async schedule support */
        struct ehci_qh          *async;
        struct ehci_qh          *reclaim;
+       unsigned                reclaim_ready : 1;
        unsigned                scanning : 1;
 
        /* periodic schedule support */
@@ -80,7 +81,6 @@ struct ehci_hcd {                     /* one per controller */
        struct dma_pool         *itd_pool;      /* itd per iso urb */
        struct dma_pool         *sitd_pool;     /* sitd per split iso urb */
 
-       struct timer_list       iaa_watchdog;
        struct timer_list       watchdog;
        unsigned long           actions;
        unsigned                stamp;
@@ -114,21 +114,9 @@ static inline struct usb_hcd *ehci_to_hcd (struct ehci_hcd *ehci)
 }
 
 
-static inline void
-iaa_watchdog_start (struct ehci_hcd *ehci)
-{
-       WARN_ON(timer_pending(&ehci->iaa_watchdog));
-       mod_timer (&ehci->iaa_watchdog,
-                       jiffies + msecs_to_jiffies(EHCI_IAA_MSECS));
-}
-
-static inline void iaa_watchdog_done (struct ehci_hcd *ehci)
-{
-       del_timer (&ehci->iaa_watchdog);
-}
-
 enum ehci_timer_action {
        TIMER_IO_WATCHDOG,
+       TIMER_IAA_WATCHDOG,
        TIMER_ASYNC_SHRINK,
        TIMER_ASYNC_OFF,
 };
@@ -146,6 +134,9 @@ timer_action (struct ehci_hcd *ehci, enum ehci_timer_action action)
                unsigned long t;
 
                switch (action) {
+               case TIMER_IAA_WATCHDOG:
+                       t = EHCI_IAA_JIFFIES;
+                       break;
                case TIMER_IO_WATCHDOG:
                        t = EHCI_IO_JIFFIES;
                        break;
@@ -162,7 +153,8 @@ timer_action (struct ehci_hcd *ehci, enum ehci_timer_action action)
                // async queue SHRINK often precedes IAA.  while it's ready
                // to go OFF neither can matter, and afterwards the IO
                // watchdog stops unless there's still periodic traffic.
-               if (time_before_eq(t, ehci->watchdog.expires)
+               if (action != TIMER_IAA_WATCHDOG
+                               && t > ehci->watchdog.expires
                                && timer_pending (&ehci->watchdog))
                        return;
                mod_timer (&ehci->watchdog, t);
index 82cb22f002e775a3d9078ed8f475d99cc2b667f3..2dbb77414905209969e86724c5a15f80791c061c 100644 (file)
@@ -262,6 +262,7 @@ static const struct hc_driver ohci_pnx4008_hc_driver = {
         */
        .start = ohci_pnx4008_start,
        .stop = ohci_stop,
+       .shutdown = ohci_shutdown,
 
        /*
         * managing i/o requests and associated device resources
@@ -280,7 +281,11 @@ static const struct hc_driver ohci_pnx4008_hc_driver = {
         */
        .hub_status_data = ohci_hub_status_data,
        .hub_control = ohci_hub_control,
-
+       .hub_irq_enable = ohci_rhsc_enable,
+#ifdef CONFIG_PM
+       .bus_suspend = ohci_bus_suspend,
+       .bus_resume = ohci_bus_resume,
+#endif
        .start_port_reset = ohci_start_port_reset,
 };
 
@@ -410,8 +415,6 @@ static int __devinit usb_hcd_pnx4008_probe(struct platform_device *pdev)
                goto out4;
        }
 
-       hcd->self.hcpriv = (void *)hcd;
-
        pnx4008_start_hc();
        platform_set_drvdata(pdev, hcd);
        ohci = hcd_to_ohci(hcd);
index 45ee6920a850b6369ec7ecd883d2278ecc815830..226bf3de8edd5ce092c551f0a90daa96ba2fc9e4 100644 (file)
@@ -40,6 +40,7 @@
 #include <linux/dma-mapping.h>
 #include <linux/usb.h>
 #include <linux/bitops.h>
+#include <linux/dmi.h>
 
 #include <asm/uaccess.h>
 #include <asm/io.h>
@@ -196,12 +197,42 @@ static int resume_detect_interrupts_are_broken(struct uhci_hcd *uhci)
        return 0;
 }
 
+static int remote_wakeup_is_broken(struct uhci_hcd *uhci)
+{
+       static struct dmi_system_id broken_wakeup_table[] = {
+               {
+                       .ident = "Asus A7V8X",
+                       .matches = {
+                               DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK"),
+                               DMI_MATCH(DMI_BOARD_NAME, "A7V8X"),
+                               DMI_MATCH(DMI_BOARD_VERSION, "REV 1.xx"),
+                       }
+               },
+               { }
+       };
+       int port;
+
+       /* One of Asus's motherboards has a bug which causes it to
+        * wake up immediately from suspend-to-RAM if any of the ports
+        * are connected.  In such cases we will not set EGSM.
+        */
+       if (dmi_check_system(broken_wakeup_table)) {
+               for (port = 0; port < uhci->rh_numports; ++port) {
+                       if (inw(uhci->io_addr + USBPORTSC1 + port * 2) &
+                                       USBPORTSC_CCS)
+                               return 1;
+               }
+       }
+
+       return 0;
+}
+
 static void suspend_rh(struct uhci_hcd *uhci, enum uhci_rh_state new_state)
 __releases(uhci->lock)
 __acquires(uhci->lock)
 {
        int auto_stop;
-       int int_enable;
+       int int_enable, egsm_enable;
 
        auto_stop = (new_state == UHCI_RH_AUTO_STOPPED);
        dev_dbg(&uhci_to_hcd(uhci)->self.root_hub->dev,
@@ -217,15 +248,18 @@ __acquires(uhci->lock)
        }
 
        /* Enable resume-detect interrupts if they work.
-        * Then enter Global Suspend mode, still configured.
+        * Then enter Global Suspend mode if _it_ works, still configured.
         */
+       egsm_enable = USBCMD_EGSM;
        uhci->working_RD = 1;
        int_enable = USBINTR_RESUME;
-       if (resume_detect_interrupts_are_broken(uhci)) {
+       if (remote_wakeup_is_broken(uhci))
+               egsm_enable = 0;
+       if (resume_detect_interrupts_are_broken(uhci) || !egsm_enable)
                uhci->working_RD = int_enable = 0;
-       }
+
        outw(int_enable, uhci->io_addr + USBINTR);
-       outw(USBCMD_EGSM | USBCMD_CF, uhci->io_addr + USBCMD);
+       outw(egsm_enable | USBCMD_CF, uhci->io_addr + USBCMD);
        mb();
        udelay(5);
 
index 21cd22640080fbce6d032354409f59dc61de32a3..20db36448ab377d6c763ccbd472037c440a5eb92 100644 (file)
@@ -348,13 +348,3 @@ config USB_APPLETOUCH
 
          To compile this driver as a module, choose M here: the
          module will be called appletouch.
-
-config USB_TRANCEVIBRATOR
-       tristate "PlayStation 2 Trance Vibrator driver support"
-       depends on USB
-       help
-         Say Y here if you want to connect a PlayStation 2 Trance Vibrator
-         device to your computer's USB port.
-
-         To compile this driver as a module, choose M here: the
-         module will be called trancevibrator.
index 295f459d1079ffa4c3afe69bb38d61474f503162..d946d5213b30d0481035406caf1ada2101f178f7 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 # Multipart objects.
-wacom-objs     := wacom_sys.o wacom_wac.o
+wacom-objs     := wacom_wac.o wacom_sys.o
 usbhid-objs    := hid-core.o
 
 # Optional parts of multipart objects.
@@ -48,7 +48,6 @@ obj-$(CONFIG_USB_ACECAD)      += acecad.o
 obj-$(CONFIG_USB_YEALINK)      += yealink.o
 obj-$(CONFIG_USB_XPAD)         += xpad.o
 obj-$(CONFIG_USB_APPLETOUCH)   += appletouch.o
-obj-$(CONFIG_USB_TRANCEVIBRATOR)       += trancevibrator.o
 
 ifeq ($(CONFIG_USB_DEBUG),y)
 EXTRA_CFLAGS += -DDEBUG
index a6738a83ff5b109ecb1886961ddb0152e040d8f4..45f44fe33bfed4b1fdd419cf047820841c8e2593 100644 (file)
@@ -750,21 +750,31 @@ static __inline__ __u32 s32ton(__s32 value, unsigned n)
 }
 
 /*
- * Extract/implement a data field from/to a report.
+ * Extract/implement a data field from/to a little endian report (bit array).
  */
 
 static __inline__ __u32 extract(__u8 *report, unsigned offset, unsigned n)
 {
-       report += (offset >> 5) << 2; offset &= 31;
-       return (le64_to_cpu(get_unaligned((__le64*)report)) >> offset) & ((1ULL << n) - 1);
+       u32 x;
+
+       report += offset >> 3;  /* adjust byte index */
+       offset &= 8 - 1;
+       x = get_unaligned((u32 *) report);
+       x = le32_to_cpu(x);
+       x = (x >> offset) & ((1 << n) - 1);
+       return x;
 }
 
 static __inline__ void implement(__u8 *report, unsigned offset, unsigned n, __u32 value)
 {
-       report += (offset >> 5) << 2; offset &= 31;
-       put_unaligned((get_unaligned((__le64*)report)
-               & cpu_to_le64(~((((__u64) 1 << n) - 1) << offset)))
-               | cpu_to_le64((__u64)value << offset), (__le64*)report);
+       u32 x;
+
+       report += offset >> 3;
+       offset &= 8 - 1;
+       x = get_unaligned((u32 *)report);
+       x &= cpu_to_le32(~((((__u32) 1 << n) - 1) << offset));
+       x |= cpu_to_le32(value << offset);
+       put_unaligned(x,(u32 *)report);
 }
 
 /*
@@ -1381,6 +1391,9 @@ void hid_close(struct hid_device *hid)
 
 #define USB_VENDOR_ID_PANJIT           0x134c
 
+#define USB_VENDOR_ID_TURBOX           0x062a
+#define USB_DEVICE_ID_TURBOX_KEYBOARD  0x0201
+
 /*
  * Initialize all reports
  */
@@ -1768,6 +1781,8 @@ static const struct hid_blacklist {
        { USB_VENDOR_ID_PANJIT, 0x0003, HID_QUIRK_IGNORE },
        { USB_VENDOR_ID_PANJIT, 0x0004, HID_QUIRK_IGNORE },
 
+       { USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_KEYBOARD, HID_QUIRK_NOGET },
+       
        { 0, 0 }
 };
 
index f26c1cd1129f47833fc3cffcc8aed7a07d2c2c2b..2902742895ad875f71ea55c4aaea5a30af508a01 100644 (file)
@@ -256,10 +256,10 @@ static int itm_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *pr
 {
        *x = ((pkt[0] & 0x1F) << 7) | (pkt[3] & 0x7F);
        *y = ((pkt[1] & 0x1F) << 7) | (pkt[4] & 0x7F);
-       *press = ((pkt[2] & 0x1F) << 7) | (pkt[5] & 0x7F);
+       *press = ((pkt[2] & 0x01) << 7) | (pkt[5] & 0x7F);
        *touch = ~pkt[7] & 0x20;
 
-       return 1;
+       return *touch;
 }
 #endif
 
index 7b3840e378a8aa802f6853be64a6511cf0d29065..1cf08f02c50e8a8871aff028f2ac01983627c2f1 100644 (file)
@@ -63,6 +63,7 @@
  *      v1.46 (pc) - Split wacom.c into wacom_sys.c and wacom_wac.c,
  *                - where wacom_sys.c deals with system specific code,
  *                - and wacom_wac.c deals with Wacom specific code
+ *                - Support Intuos3 4x6
  */
 
 /*
@@ -118,6 +119,7 @@ extern void wacom_input_sync(void *wcombo);
 extern void wacom_init_input_dev(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
 extern void input_dev_g4(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
 extern void input_dev_g(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
+extern void input_dev_i3s(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
 extern void input_dev_i3(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
 extern void input_dev_i(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
 extern void input_dev_pl(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
index d233c37bd533b76743c33d9ed99036b8fbccc3ee..3498b893b53b62b6a792ddebcceafcb0ab5e890d 100644 (file)
@@ -110,7 +110,7 @@ __u16 wacom_be16_to_cpu(unsigned char *data)
 __u16 wacom_le16_to_cpu(unsigned char *data)
 {
        __u16 value;
-       value = be16_to_cpu(*(__be16 *) data);
+       value = le16_to_cpu(*(__le16 *) data);
        return value;
 }
 
@@ -143,7 +143,7 @@ void input_dev_g4(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
        input_dev->evbit[0] |= BIT(EV_MSC);
        input_dev->mscbit[0] |= BIT(MSC_SERIAL);
        input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_FINGER);
-       input_dev->keybit[LONG(BTN_LEFT)] |= BIT(BTN_0) | BIT(BTN_1) | BIT(BTN_2) | BIT(BTN_3) | BIT(BTN_4) | BIT(BTN_5) | BIT(BTN_6) | BIT(BTN_7);
+       input_dev->keybit[LONG(BTN_LEFT)] |= BIT(BTN_0) | BIT(BTN_4);
 }
 
 void input_dev_g(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
@@ -155,11 +155,16 @@ void input_dev_g(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
        input_set_abs_params(input_dev, ABS_DISTANCE, 0, wacom_wac->features->distance_max, 0, 0);
 }
 
-void input_dev_i3(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
+void input_dev_i3s(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
 {
        input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_FINGER);
-       input_dev->keybit[LONG(BTN_LEFT)] |= BIT(BTN_0) | BIT(BTN_1) | BIT(BTN_2) | BIT(BTN_3) | BIT(BTN_4) | BIT(BTN_5) | BIT(BTN_6) | BIT(BTN_7);
+       input_dev->keybit[LONG(BTN_LEFT)] |= BIT(BTN_0) | BIT(BTN_1) | BIT(BTN_2) | BIT(BTN_3);
        input_set_abs_params(input_dev, ABS_RX, 0, 4097, 0, 0);
+}
+
+void input_dev_i3(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
+{
+       input_dev->keybit[LONG(BTN_LEFT)] |= BIT(BTN_4) | BIT(BTN_5) | BIT(BTN_6) | BIT(BTN_7);
        input_set_abs_params(input_dev, ABS_RY, 0, 4097, 0, 0);
 }
 
@@ -218,8 +223,7 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
        strlcat(wacom->phys, "/input0", sizeof(wacom->phys));
 
        wacom_wac->features = get_wacom_feature(id);
-       if (wacom_wac->features->pktlen > 10)
-               BUG();
+       BUG_ON(wacom_wac->features->pktlen > 10);
 
        input_dev->name = wacom_wac->features->name;
        wacom->wacom_wac = wacom_wac;
@@ -244,7 +248,7 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
        usb_fill_int_urb(wacom->irq, dev,
                         usb_rcvintpipe(dev, endpoint->bEndpointAddress),
                         wacom_wac->data, wacom_wac->features->pktlen,
-                        wacom_wac->features->irq, wacom, endpoint->bInterval);
+                        wacom_sys_irq, wacom, endpoint->bInterval);
        wacom->irq->transfer_dma = wacom->data_dma;
        wacom->irq->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
 
@@ -278,8 +282,8 @@ static void wacom_disconnect(struct usb_interface *intf)
                input_unregister_device(wacom->dev);
                usb_free_urb(wacom->irq);
                usb_buffer_free(interface_to_usbdev(intf), 10, wacom->wacom_wac->data, wacom->data_dma);
-               kfree(wacom);
                kfree(wacom->wacom_wac);
+               kfree(wacom);
        }
 }
 
index aa31d22d4f0504c94f72d210b08f5984f4f265f6..92726fe89379e7631f7c3bf382063ed7859c5e26 100644 (file)
@@ -191,9 +191,9 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo)
                                wacom_report_key(wcombo, BTN_LEFT, data[1] & 0x01);
                                wacom_report_key(wcombo, BTN_RIGHT, data[1] & 0x02);
                                if (wacom->features->type == WACOM_G4)
-                                       wacom_report_abs(wcombo, ABS_DISTANCE, data[6]);
+                                       wacom_report_abs(wcombo, ABS_DISTANCE, data[6] & 0x3f);
                                else
-                                       wacom_report_abs(wcombo, ABS_DISTANCE, data[7]);
+                                       wacom_report_abs(wcombo, ABS_DISTANCE, data[7] & 0x3f);
                                break;
                }
        }
@@ -303,8 +303,9 @@ static int wacom_intuos_inout(struct wacom_wac *wacom, void *wcombo)
                                wacom->tool[idx] = BTN_TOOL_PEN;
                }
                /* only large I3 support Lens Cursor */
-               if(!((wacom->tool[idx] == BTN_TOOL_LENS) &&
-                               (wacom->features->type == INTUOS3))) {
+               if(!((wacom->tool[idx] == BTN_TOOL_LENS)
+                                && ((wacom->features->type == INTUOS3)
+                                || (wacom->features->type == INTUOS3S)))) {
                        wacom_report_abs(wcombo, ABS_MISC, wacom->id[idx]); /* report tool id */
                        wacom_report_key(wcombo, wacom->tool[idx], 1);
                        wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
@@ -315,10 +316,14 @@ static int wacom_intuos_inout(struct wacom_wac *wacom, void *wcombo)
 
        /* Exit report */
        if ((data[1] & 0xfe) == 0x80) {
-               wacom_report_key(wcombo, wacom->tool[idx], 0);
-               wacom_report_abs(wcombo, ABS_MISC, 0); /* reset tool id */
-               wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
-               return 2;
+               if(!((wacom->tool[idx] == BTN_TOOL_LENS)
+                                && ((wacom->features->type == INTUOS3)
+                                || (wacom->features->type == INTUOS3S)))) {
+                       wacom_report_key(wcombo, wacom->tool[idx], 0);
+                       wacom_report_abs(wcombo, ABS_MISC, 0); /* reset tool id */
+                       wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
+                       return 2;
+               }
        }
        return 0;
 }
@@ -382,7 +387,8 @@ static int wacom_intuos_irq(struct wacom_wac *wacom, void *wcombo)
                wacom_report_abs(wcombo, ABS_RX, ((data[1] & 0x1f) << 8) | data[2]);
                wacom_report_abs(wcombo, ABS_RY, ((data[3] & 0x1f) << 8) | data[4]);
 
-               if((data[5] & 0x0f) | (data[6] & 0x0f) | (data[1] & 0x1f) | data[2])
+               if((data[5] & 0x0f) | (data[6] & 0x0f) | (data[1] & 0x1f) |
+                       data[2] | (data[3] & 0x1f) | data[4])
                        wacom_report_key(wcombo, wacom->tool[1], 1);
                else
                        wacom_report_key(wcombo, wacom->tool[1], 0);
@@ -432,7 +438,7 @@ static int wacom_intuos_irq(struct wacom_wac *wacom, void *wcombo)
                                        ((t - 1) / 2) : -t / 2);
                        }
 
-               } else if (!(data[1] & 0x10) && wacom->features->type < INTUOS3) {
+               } else if (!(data[1] & 0x10) && wacom->features->type < INTUOS3S) {
                        /* 4D mouse packet */
                        wacom_report_key(wcombo, BTN_LEFT,   data[8] & 0x01);
                        wacom_report_key(wcombo, BTN_MIDDLE, data[8] & 0x02);
@@ -452,12 +458,12 @@ static int wacom_intuos_irq(struct wacom_wac *wacom, void *wcombo)
                                                 - ((data[8] & 0x02) >> 1));
 
                        /* I3 2D mouse side buttons */
-                       if (wacom->features->type == INTUOS3) {
+                       if (wacom->features->type >= INTUOS3S && wacom->features->type <= INTUOS3L) {
                                wacom_report_key(wcombo, BTN_SIDE,   data[8] & 0x40);
                                wacom_report_key(wcombo, BTN_EXTRA,  data[8] & 0x20);
                        }
 
-               } else if (wacom->features->type < INTUOS3) {
+               } else if (wacom->features->type < INTUOS3S || wacom->features->type == INTUOS3L) {
                        /* Lens cursor packets */
                        wacom_report_key(wcombo, BTN_LEFT,   data[8] & 0x01);
                        wacom_report_key(wcombo, BTN_MIDDLE, data[8] & 0x02);
@@ -490,6 +496,7 @@ int wacom_wac_irq(struct wacom_wac *wacom_wac, void *wcombo)
                        return (wacom_ptu_irq(wacom_wac, wcombo));
                        break;
                case INTUOS:
+               case INTUOS3S:
                case INTUOS3:
                case INTUOS3L:
                case CINTIQ:
@@ -515,6 +522,8 @@ void wacom_init_input_dev(struct input_dev *input_dev, struct wacom_wac *wacom_w
                case CINTIQ:
                        input_dev_i3(input_dev, wacom_wac);
                        /* fall through */
+               case INTUOS3S:
+                       input_dev_i3s(input_dev, wacom_wac);
                case INTUOS:
                        input_dev_i(input_dev, wacom_wac);
                        break;
@@ -530,49 +539,50 @@ void wacom_init_input_dev(struct input_dev *input_dev, struct wacom_wac *wacom_w
 }
 
 static struct wacom_features wacom_features[] = {
-       { "Wacom Penpartner",    7,   5040,  3780,  255, 32, PENPARTNER,        wacom_sys_irq },
-        { "Wacom Graphire",      8,  10206,  7422,  511, 32, GRAPHIRE, wacom_sys_irq },
-       { "Wacom Graphire2 4x5", 8,  10206,  7422,  511, 32, GRAPHIRE,  wacom_sys_irq },
-       { "Wacom Graphire2 5x7", 8,  13918, 10206,  511, 32, GRAPHIRE,  wacom_sys_irq },
-       { "Wacom Graphire3",     8,  10208,  7424,  511, 32, GRAPHIRE,  wacom_sys_irq },
-       { "Wacom Graphire3 6x8", 8,  16704, 12064,  511, 32, GRAPHIRE,  wacom_sys_irq },
-       { "Wacom Graphire4 4x5", 8,  10208,  7424,  511, 32, WACOM_G4,  wacom_sys_irq },
-       { "Wacom Graphire4 6x8", 8,  16704, 12064,  511, 32, WACOM_G4,  wacom_sys_irq },
-       { "Wacom Volito",        8,   5104,  3712,  511, 32, GRAPHIRE,  wacom_sys_irq },
-       { "Wacom PenStation2",   8,   3250,  2320,  255, 32, GRAPHIRE,  wacom_sys_irq },
-       { "Wacom Volito2 4x5",   8,   5104,  3712,  511, 32, GRAPHIRE,  wacom_sys_irq },
-       { "Wacom Volito2 2x3",   8,   3248,  2320,  511, 32, GRAPHIRE,  wacom_sys_irq },
-       { "Wacom PenPartner2",   8,   3250,  2320,  255, 32, GRAPHIRE,  wacom_sys_irq },
-       { "Wacom Intuos 4x5",   10,  12700, 10600, 1023, 15, INTUOS,    wacom_sys_irq},
-       { "Wacom Intuos 6x8",   10,  20320, 16240, 1023, 15, INTUOS,    wacom_sys_irq },
-       { "Wacom Intuos 9x12",  10,  30480, 24060, 1023, 15, INTUOS,    wacom_sys_irq },
-       { "Wacom Intuos 12x12", 10,  30480, 31680, 1023, 15, INTUOS,    wacom_sys_irq },
-       { "Wacom Intuos 12x18", 10,  45720, 31680, 1023, 15, INTUOS,    wacom_sys_irq},
-       { "Wacom PL400",         8,   5408,  4056,  255, 32, PL,        wacom_sys_irq },
-       { "Wacom PL500",         8,   6144,  4608,  255, 32, PL,        wacom_sys_irq },
-       { "Wacom PL600",         8,   6126,  4604,  255, 32, PL,        wacom_sys_irq },
-       { "Wacom PL600SX",       8,   6260,  5016,  255, 32, PL,        wacom_sys_irq },
-       { "Wacom PL550",         8,   6144,  4608,  511, 32, PL,        wacom_sys_irq },
-       { "Wacom PL800",         8,   7220,  5780,  511, 32, PL,        wacom_sys_irq },
-       { "Wacom PL700",         8,   6758,  5406,  511, 32, PL,        wacom_sys_irq },
-       { "Wacom PL510",         8,   6282,  4762,  511, 32, PL,        wacom_sys_irq },
-       { "Wacom DTU710",        8,  34080, 27660,  511, 32, PL,        wacom_sys_irq },
-       { "Wacom DTF521",        8,   6282,  4762,  511, 32, PL,        wacom_sys_irq },
-       { "Wacom DTF720",        8,   6858,  5506,  511, 32, PL,        wacom_sys_irq },
-       { "Wacom Cintiq Partner",8,  20480, 15360,  511, 32, PTU,       wacom_sys_irq },
-       { "Wacom Intuos2 4x5",   10, 12700, 10600, 1023, 15, INTUOS,    wacom_sys_irq },
-       { "Wacom Intuos2 6x8",   10, 20320, 16240, 1023, 15, INTUOS,    wacom_sys_irq },
-       { "Wacom Intuos2 9x12",  10, 30480, 24060, 1023, 15, INTUOS,    wacom_sys_irq },
-       { "Wacom Intuos2 12x12", 10, 30480, 31680, 1023, 15, INTUOS,    wacom_sys_irq },
-       { "Wacom Intuos2 12x18", 10, 45720, 31680, 1023, 15, INTUOS,    wacom_sys_irq },
-       { "Wacom Intuos3 4x5",   10, 25400, 20320, 1023, 15, INTUOS3,   wacom_sys_irq },
-       { "Wacom Intuos3 6x8",   10, 40640, 30480, 1023, 15, INTUOS3,   wacom_sys_irq },
-       { "Wacom Intuos3 9x12",  10, 60960, 45720, 1023, 15, INTUOS3,   wacom_sys_irq },
-       { "Wacom Intuos3 12x12", 10, 60960, 60960, 1023, 15, INTUOS3L,  wacom_sys_irq },
-       { "Wacom Intuos3 12x19", 10, 97536, 60960, 1023, 15, INTUOS3L,  wacom_sys_irq },
-       { "Wacom Intuos3 6x11",  10, 54204, 31750, 1023, 15, INTUOS3,   wacom_sys_irq },
-       { "Wacom Cintiq 21UX",   10, 87200, 65600, 1023, 15, CINTIQ,    wacom_sys_irq },
-       { "Wacom Intuos2 6x8",   10, 20320, 16240, 1023, 15, INTUOS,    wacom_sys_irq },
+       { "Wacom Penpartner",    7,   5040,  3780,  255,  0, PENPARTNER },
+        { "Wacom Graphire",      8,  10206,  7422,  511, 63, GRAPHIRE },
+       { "Wacom Graphire2 4x5", 8,  10206,  7422,  511, 63, GRAPHIRE },
+       { "Wacom Graphire2 5x7", 8,  13918, 10206,  511, 63, GRAPHIRE },
+       { "Wacom Graphire3",     8,  10208,  7424,  511, 63, GRAPHIRE },
+       { "Wacom Graphire3 6x8", 8,  16704, 12064,  511, 63, GRAPHIRE },
+       { "Wacom Graphire4 4x5", 8,  10208,  7424,  511, 63, WACOM_G4 },
+       { "Wacom Graphire4 6x8", 8,  16704, 12064,  511, 63, WACOM_G4 },
+       { "Wacom Volito",        8,   5104,  3712,  511,  0, GRAPHIRE },
+       { "Wacom PenStation2",   8,   3250,  2320,  255,  0, GRAPHIRE },
+       { "Wacom Volito2 4x5",   8,   5104,  3712,  511,  0, GRAPHIRE },
+       { "Wacom Volito2 2x3",   8,   3248,  2320,  511,  0, GRAPHIRE },
+       { "Wacom PenPartner2",   8,   3250,  2320,  255,  0, GRAPHIRE },
+       { "Wacom Intuos 4x5",   10,  12700, 10600, 1023, 63, INTUOS },
+       { "Wacom Intuos 6x8",   10,  20320, 16240, 1023, 63, INTUOS },
+       { "Wacom Intuos 9x12",  10,  30480, 24060, 1023, 63, INTUOS },
+       { "Wacom Intuos 12x12", 10,  30480, 31680, 1023, 63, INTUOS },
+       { "Wacom Intuos 12x18", 10,  45720, 31680, 1023, 63, INTUOS },
+       { "Wacom PL400",         8,   5408,  4056,  255,  0, PL },
+       { "Wacom PL500",         8,   6144,  4608,  255,  0, PL },
+       { "Wacom PL600",         8,   6126,  4604,  255,  0, PL },
+       { "Wacom PL600SX",       8,   6260,  5016,  255,  0, PL },
+       { "Wacom PL550",         8,   6144,  4608,  511,  0, PL },
+       { "Wacom PL800",         8,   7220,  5780,  511,  0, PL },
+       { "Wacom PL700",         8,   6758,  5406,  511,  0, PL },
+       { "Wacom PL510",         8,   6282,  4762,  511,  0, PL },
+       { "Wacom DTU710",        8,  34080, 27660,  511,  0, PL },
+       { "Wacom DTF521",        8,   6282,  4762,  511,  0, PL },
+       { "Wacom DTF720",        8,   6858,  5506,  511,  0, PL },
+       { "Wacom Cintiq Partner",8,  20480, 15360,  511,  0, PTU },
+       { "Wacom Intuos2 4x5",   10, 12700, 10600, 1023, 63, INTUOS },
+       { "Wacom Intuos2 6x8",   10, 20320, 16240, 1023, 63, INTUOS },
+       { "Wacom Intuos2 9x12",  10, 30480, 24060, 1023, 63, INTUOS },
+       { "Wacom Intuos2 12x12", 10, 30480, 31680, 1023, 63, INTUOS },
+       { "Wacom Intuos2 12x18", 10, 45720, 31680, 1023, 63, INTUOS },
+       { "Wacom Intuos3 4x5",   10, 25400, 20320, 1023, 63, INTUOS3S },
+       { "Wacom Intuos3 6x8",   10, 40640, 30480, 1023, 63, INTUOS3 },
+       { "Wacom Intuos3 9x12",  10, 60960, 45720, 1023, 63, INTUOS3 },
+       { "Wacom Intuos3 12x12", 10, 60960, 60960, 1023, 63, INTUOS3L },
+       { "Wacom Intuos3 12x19", 10, 97536, 60960, 1023, 63, INTUOS3L },
+       { "Wacom Intuos3 6x11",  10, 54204, 31750, 1023, 63, INTUOS3 },
+       { "Wacom Intuos3 4x6",   10, 31496, 19685, 1023, 15, INTUOS3S },
+       { "Wacom Cintiq 21UX",   10, 87200, 65600, 1023, 63, CINTIQ },
+       { "Wacom Intuos2 6x8",   10, 20320, 16240, 1023, 63, INTUOS },
        { }
 };
 
@@ -618,6 +628,7 @@ static struct usb_device_id wacom_ids[] = {
        { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB3) },
        { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB4) },
        { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB5) },
+       { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB7) },
        { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x3F) },
        { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x47) },
        { }
index ceae7bf59d9f8b13a19c26403a5cf3661aa6e1cd..a1d9ce007970b12084c78c81e51cd0551541d3d1 100644 (file)
@@ -20,6 +20,7 @@ enum {
        PTU,
        PL,
        INTUOS,
+       INTUOS3S,
        INTUOS3,
        INTUOS3L,
        CINTIQ,
@@ -34,7 +35,6 @@ struct wacom_features {
        int pressure_max;
        int distance_max;
        int type;
-       usb_complete_t irq;
 };
 
 struct wacom_wac {
index cebb6c463bfbadcdf204c5d8453c10a9d4a1acaf..6a12a943b938a189424b12526cb1ed28fa03ebd4 100644 (file)
@@ -1,8 +1,9 @@
 /*
- * X-Box gamepad - v0.0.5
+ * X-Box gamepad - v0.0.6
  *
  * Copyright (c) 2002 Marko Friedemann <mfr@bmx-chemnitz.de>
- *
+ *               2005 Dominic Cerquetti <binary1230@yahoo.com>
+ *               2006 Adam Buchbinder <adam.buchbinder@gmail.com>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
  *  - Greg Kroah-Hartman - usb-skeleton driver
  *
  * TODO:
- *  - fine tune axes
+ *  - fine tune axes (especially trigger axes)
  *  - fix "analog" buttons (reported as digital now)
  *  - get rumble working
+ *  - need USB IDs for other dance pads
  *
  * History:
  *
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/slab.h>
+#include <linux/stat.h>
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/smp_lock.h>
 #include <linux/usb/input.h>
 
-#define DRIVER_VERSION "v0.0.5"
+#define DRIVER_VERSION "v0.0.6"
 #define DRIVER_AUTHOR "Marko Friedemann <mfr@bmx-chemnitz.de>"
 #define DRIVER_DESC "X-Box pad driver"
 
 #define XPAD_PKT_LEN 32
 
+/* xbox d-pads should map to buttons, as is required for DDR pads
+   but we map them to axes when possible to simplify things */
+#define MAP_DPAD_TO_BUTTONS    0
+#define MAP_DPAD_TO_AXES       1
+#define MAP_DPAD_UNKNOWN       -1
+
+static int dpad_to_buttons;
+module_param(dpad_to_buttons, bool, S_IRUGO);
+MODULE_PARM_DESC(dpad_to_buttons, "Map D-PAD to buttons rather than axes for unknown pads");
+
 static const struct xpad_device {
        u16 idVendor;
        u16 idProduct;
        char *name;
+       u8 dpad_mapping;
 } xpad_device[] = {
-       { 0x045e, 0x0202, "Microsoft X-Box pad (US)" },
-       { 0x045e, 0x0285, "Microsoft X-Box pad (Japan)" },
-       { 0x05fd, 0x107a, "InterAct 'PowerPad Pro' X-Box pad (Germany)" },
-       { 0x0000, 0x0000, "X-Box pad" }
+       { 0x045e, 0x0202, "Microsoft X-Box pad v1 (US)", MAP_DPAD_TO_AXES },
+       { 0x045e, 0x0289, "Microsoft X-Box pad v2 (US)", MAP_DPAD_TO_AXES },
+       { 0x045e, 0x0285, "Microsoft X-Box pad (Japan)", MAP_DPAD_TO_AXES },
+       { 0x05fd, 0x107a, "InterAct 'PowerPad Pro' X-Box pad (Germany)", MAP_DPAD_TO_AXES },
+       { 0x0c12, 0x8809, "RedOctane Xbox Dance Pad", MAP_DPAD_TO_BUTTONS },
+       { 0x0000, 0x0000, "Generic X-Box pad", MAP_DPAD_UNKNOWN }
 };
 
 static const signed short xpad_btn[] = {
@@ -84,11 +101,23 @@ static const signed short xpad_btn[] = {
        -1                                              /* terminating entry */
 };
 
+/* only used if MAP_DPAD_TO_BUTTONS */
+static const signed short xpad_btn_pad[] = {
+       BTN_LEFT, BTN_RIGHT,            /* d-pad left, right */
+       BTN_0, BTN_1,                   /* d-pad up, down (XXX names??) */
+       -1                              /* terminating entry */
+};
+
 static const signed short xpad_abs[] = {
        ABS_X, ABS_Y,           /* left stick */
        ABS_RX, ABS_RY,         /* right stick */
        ABS_Z, ABS_RZ,          /* triggers left/right */
-       ABS_HAT0X, ABS_HAT0Y,   /* digital pad */
+       -1                      /* terminating entry */
+};
+
+/* only used if MAP_DPAD_TO_AXES */
+static const signed short xpad_abs_pad[] = {
+       ABS_HAT0X, ABS_HAT0Y,   /* d-pad axes */
        -1                      /* terminating entry */
 };
 
@@ -100,14 +129,16 @@ static struct usb_device_id xpad_table [] = {
 MODULE_DEVICE_TABLE (usb, xpad_table);
 
 struct usb_xpad {
-       struct input_dev *dev;                  /* input device interface */
-       struct usb_device *udev;                /* usb device */
+       struct input_dev *dev;          /* input device interface */
+       struct usb_device *udev;        /* usb device */
 
-       struct urb *irq_in;                     /* urb for interrupt in report */
-       unsigned char *idata;                   /* input data */
+       struct urb *irq_in;             /* urb for interrupt in report */
+       unsigned char *idata;           /* input data */
        dma_addr_t idata_dma;
 
-       char phys[65];                          /* physical device path */
+       char phys[65];                  /* physical device path */
+
+       int dpad_mapping;               /* map d-pad to buttons or to axes */
 };
 
 /*
@@ -137,14 +168,21 @@ static void xpad_process_packet(struct usb_xpad *xpad, u16 cmd, unsigned char *d
        input_report_abs(dev, ABS_RZ, data[11]);
 
        /* digital pad */
-       input_report_abs(dev, ABS_HAT0X, !!(data[2] & 0x08) - !!(data[2] & 0x04));
-       input_report_abs(dev, ABS_HAT0Y, !!(data[2] & 0x02) - !!(data[2] & 0x01));
+       if (xpad->dpad_mapping == MAP_DPAD_TO_AXES) {
+               input_report_abs(dev, ABS_HAT0X, !!(data[2] & 0x08) - !!(data[2] & 0x04));
+               input_report_abs(dev, ABS_HAT0Y, !!(data[2] & 0x02) - !!(data[2] & 0x01));
+       } else /* xpad->dpad_mapping == MAP_DPAD_TO_BUTTONS */ {
+               input_report_key(dev, BTN_LEFT,  data[2] & 0x04);
+               input_report_key(dev, BTN_RIGHT, data[2] & 0x08);
+               input_report_key(dev, BTN_0,     data[2] & 0x01); // up
+               input_report_key(dev, BTN_1,     data[2] & 0x02); // down
+       }
 
        /* start/back buttons and stick press left/right */
-       input_report_key(dev, BTN_START, (data[2] & 0x10) >> 4);
-       input_report_key(dev, BTN_BACK, (data[2] & 0x20) >> 5);
-       input_report_key(dev, BTN_THUMBL, (data[2] & 0x40) >> 6);
-       input_report_key(dev, BTN_THUMBR, data[2] >> 7);
+       input_report_key(dev, BTN_START,  data[2] & 0x10);
+       input_report_key(dev, BTN_BACK,   data[2] & 0x20);
+       input_report_key(dev, BTN_THUMBL, data[2] & 0x40);
+       input_report_key(dev, BTN_THUMBR, data[2] & 0x80);
 
        /* "analog" buttons A, B, X, Y */
        input_report_key(dev, BTN_A, data[4]);
@@ -206,6 +244,28 @@ static void xpad_close (struct input_dev *dev)
        usb_kill_urb(xpad->irq_in);
 }
 
+static void xpad_set_up_abs(struct input_dev *input_dev, signed short abs)
+{
+       set_bit(abs, input_dev->absbit);
+
+       switch (abs) {
+       case ABS_X:
+       case ABS_Y:
+       case ABS_RX:
+       case ABS_RY:    /* the two sticks */
+               input_set_abs_params(input_dev, abs, -32768, 32767, 16, 128);
+               break;
+       case ABS_Z:
+       case ABS_RZ:    /* the triggers */
+               input_set_abs_params(input_dev, abs, 0, 255, 0, 0);
+               break;
+       case ABS_HAT0X:
+       case ABS_HAT0Y: /* the d-pad (only if MAP_DPAD_TO_AXES) */
+               input_set_abs_params(input_dev, abs, -1, 1, 0, 0);
+               break;
+       }
+}
+
 static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id)
 {
        struct usb_device *udev = interface_to_usbdev (intf);
@@ -235,6 +295,9 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
                goto fail2;
 
        xpad->udev = udev;
+       xpad->dpad_mapping = xpad_device[i].dpad_mapping;
+       if (xpad->dpad_mapping == MAP_DPAD_UNKNOWN)
+               xpad->dpad_mapping = dpad_to_buttons;
        xpad->dev = input_dev;
        usb_make_path(udev, xpad->phys, sizeof(xpad->phys));
        strlcat(xpad->phys, "/input0", sizeof(xpad->phys));
@@ -249,32 +312,19 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
 
        input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
 
+       /* set up buttons */
        for (i = 0; xpad_btn[i] >= 0; i++)
                set_bit(xpad_btn[i], input_dev->keybit);
+       if (xpad->dpad_mapping == MAP_DPAD_TO_BUTTONS)
+               for (i = 0; xpad_btn_pad[i] >= 0; i++)
+                       set_bit(xpad_btn_pad[i], input_dev->keybit);
 
-       for (i = 0; xpad_abs[i] >= 0; i++) {
-
-               signed short t = xpad_abs[i];
-
-               set_bit(t, input_dev->absbit);
-
-               switch (t) {
-                       case ABS_X:
-                       case ABS_Y:
-                       case ABS_RX:
-                       case ABS_RY:    /* the two sticks */
-                               input_set_abs_params(input_dev, t, -32768, 32767, 16, 128);
-                               break;
-                       case ABS_Z:
-                       case ABS_RZ:    /* the triggers */
-                               input_set_abs_params(input_dev, t, 0, 255, 0, 0);
-                               break;
-                       case ABS_HAT0X:
-                       case ABS_HAT0Y: /* the d-pad */
-                               input_set_abs_params(input_dev, t, -1, 1, 0, 0);
-                               break;
-               }
-       }
+       /* set up axes */
+       for (i = 0; xpad_abs[i] >= 0; i++)
+               xpad_set_up_abs(input_dev, xpad_abs[i]);
+       if (xpad->dpad_mapping == MAP_DPAD_TO_AXES)
+               for (i = 0; xpad_abs_pad[i] >= 0; i++)
+                   xpad_set_up_abs(input_dev, xpad_abs_pad[i]);
 
        ep_irq_in = &intf->cur_altsetting->endpoint[0].desc;
        usb_fill_int_urb(xpad->irq_in, udev,
@@ -305,7 +355,8 @@ static void xpad_disconnect(struct usb_interface *intf)
                usb_kill_urb(xpad->irq_in);
                input_unregister_device(xpad->dev);
                usb_free_urb(xpad->irq_in);
-               usb_buffer_free(interface_to_usbdev(intf), XPAD_PKT_LEN, xpad->idata, xpad->idata_dma);
+               usb_buffer_free(interface_to_usbdev(intf), XPAD_PKT_LEN,
+                               xpad->idata, xpad->idata_dma);
                kfree(xpad);
        }
 }
index c29658f69e2a8c0db81dc26a9d1fe9addb1bb96a..a74bf8617e7f3f11cbb67397e0bd6cef9b160483 100644 (file)
@@ -223,6 +223,16 @@ config USB_LD
          To compile this driver as a module, choose M here: the
          module will be called ldusb.
 
+config USB_TRANCEVIBRATOR
+       tristate "PlayStation 2 Trance Vibrator driver support"
+       depends on USB
+       help
+         Say Y here if you want to connect a PlayStation 2 Trance Vibrator
+         device to your computer's USB port.
+
+         To compile this driver as a module, choose M here: the
+         module will be called trancevibrator.
+
 config USB_TEST
        tristate "USB testing driver (DEVELOPMENT)"
        depends on USB && USB_DEVICEFS && EXPERIMENTAL
index 2be70fa259bfe16cc45ebbdcae5db57dd33dcd9d..11dc59540cda11eaf501427ae43242bfe4c5e742 100644 (file)
@@ -21,6 +21,7 @@ obj-$(CONFIG_USB_PHIDGETMOTORCONTROL) += phidgetmotorcontrol.o
 obj-$(CONFIG_USB_PHIDGETSERVO) += phidgetservo.o
 obj-$(CONFIG_USB_RIO500)       += rio500.o
 obj-$(CONFIG_USB_TEST)         += usbtest.o
+obj-$(CONFIG_USB_TRANCEVIBRATOR)       += trancevibrator.o
 obj-$(CONFIG_USB_USS720)       += uss720.o
 
 obj-$(CONFIG_USB_SISUSBVGA)    += sisusbvga/
index aecd633fe9f6966f20a9879f8b455675ffbc7d27..af2934e016a7e76313816ba480e81a060de5a4b4 100644 (file)
@@ -370,7 +370,8 @@ static int adu_release(struct inode *inode, struct file *file)
        retval = adu_release_internal(dev);
 
 exit:
-       up(&dev->sem);
+       if (dev)
+               up(&dev->sem);
        dbg(2," %s : leave, return value %d", __FUNCTION__, retval);
        return retval;
 }
index 0eb26a26115ba896677e8686763e080d2bd2cfd0..9b591b8b9369b2e67708ffb79cd01cd997451838 100644 (file)
@@ -513,8 +513,6 @@ static void ftdi_elan_respond_work(void *data)
                         ftdi->disconnected += 1;
                 } else if (retval == -ENODEV) {
                         ftdi->disconnected += 1;
-                } else if (retval == -ENODEV) {
-                        ftdi->disconnected += 1;
                 } else if (retval == -EILSEQ) {
                         ftdi->disconnected += 1;
                 } else {
@@ -1186,11 +1184,8 @@ static ssize_t ftdi_elan_write(struct file *file,
         int retval = 0;
         struct urb *urb;
         char *buf;
-        char data[30 *3 + 4];
-        char *d = data;
-        const char __user *s = user_buffer;
-        int m = (sizeof(data) - 1) / 3;
-        struct usb_ftdi *ftdi = (struct usb_ftdi *)file->private_data;
+        struct usb_ftdi *ftdi = file->private_data;
+
         if (ftdi->disconnected > 0) {
                 return -ENODEV;
         }
@@ -1220,27 +1215,18 @@ static ssize_t ftdi_elan_write(struct file *file,
         if (retval) {
                 dev_err(&ftdi->udev->dev, "failed submitting write urb, error %"
                         "d\n", retval);
-                goto error_4;
+                goto error_3;
         }
         usb_free_urb(urb);
-      exit:;
-        if (count > m) {
-                int I = m - 1;
-                while (I-- > 0) {
-                        d += sprintf(d, " %02X", 0x000000FF & *s++);
-                }
-                d += sprintf(d, " ..");
-        } else {
-                int I = count;
-                while (I-- > 0) {
-                        d += sprintf(d, " %02X", 0x000000FF & *s++);
-                }
-        }
+
+exit:
         return count;
-      error_4: error_3:usb_buffer_free(ftdi->udev, count, buf,
-              urb->transfer_dma);
-      error_2:usb_free_urb(urb);
-      error_1:return retval;
+error_3:
+       usb_buffer_free(ftdi->udev, count, buf, urb->transfer_dma);
+error_2:
+       usb_free_urb(urb);
+error_1:
+       return retval;
 }
 
 static struct file_operations ftdi_elan_fops = {
index 054059632a219e54d2217486df8da039a7a0bff9..454a186b64ad1bafdd3b09738c1d787fd8d44415 100644 (file)
@@ -207,6 +207,14 @@ config USB_NET_PLUSB
          Choose this option if you're using a host-to-host cable
          with one of these chips.
 
+config USB_NET_MCS7830
+       tristate "MosChip MCS7830 based Ethernet adapters"
+       depends on USB_USBNET
+       help
+         Choose this option if you're using a 10/100 Ethernet USB2
+         adapter based on the MosChip 7830 controller. This includes
+         adapters marketed under the DeLOCK brand.
+
 config USB_NET_RNDIS_HOST
        tristate "Host for RNDIS devices (EXPERIMENTAL)"
        depends on USB_USBNET && EXPERIMENTAL
index 160f19dbdf121253ad360e8d64313aff8253d25d..7b51964de171416cc614c99c80b97f3494cdf841 100644 (file)
@@ -14,6 +14,7 @@ obj-$(CONFIG_USB_NET_PLUSB)   += plusb.o
 obj-$(CONFIG_USB_NET_RNDIS_HOST)       += rndis_host.o
 obj-$(CONFIG_USB_NET_CDC_SUBSET)       += cdc_subset.o
 obj-$(CONFIG_USB_NET_ZAURUS)   += zaurus.o
+obj-$(CONFIG_USB_NET_MCS7830)  += mcs7830.o
 obj-$(CONFIG_USB_USBNET)       += usbnet.o
 
 ifeq ($(CONFIG_USB_DEBUG),y)
index c73dd224aa76d2fc9ec0b1895b580a0725e849e8..881841e600def9f680f58109b30bfb175e4d2118 100644 (file)
@@ -569,10 +569,12 @@ static int asix_mdio_read(struct net_device *netdev, int phy_id, int loc)
        struct usbnet *dev = netdev_priv(netdev);
        u16 res;
 
+       mutex_lock(&dev->phy_mutex);
        asix_set_sw_mii(dev);
        asix_read_cmd(dev, AX_CMD_READ_MII_REG, phy_id,
                                (__u16)loc, 2, (u16 *)&res);
        asix_set_hw_mii(dev);
+       mutex_unlock(&dev->phy_mutex);
 
        devdbg(dev, "asix_mdio_read() phy_id=0x%02x, loc=0x%02x, returns=0x%04x", phy_id, loc, le16_to_cpu(res & 0xffff));
 
@@ -586,10 +588,12 @@ asix_mdio_write(struct net_device *netdev, int phy_id, int loc, int val)
        u16 res = cpu_to_le16(val);
 
        devdbg(dev, "asix_mdio_write() phy_id=0x%02x, loc=0x%02x, val=0x%04x", phy_id, loc, val);
+       mutex_lock(&dev->phy_mutex);
        asix_set_sw_mii(dev);
        asix_write_cmd(dev, AX_CMD_WRITE_MII_REG, phy_id,
                                (__u16)loc, 2, (u16 *)&res);
        asix_set_hw_mii(dev);
+       mutex_unlock(&dev->phy_mutex);
 }
 
 /* Get the PHY Identifier from the PHYSID1 & PHYSID2 MII registers */
@@ -700,32 +704,6 @@ static void asix_get_drvinfo (struct net_device *net,
        info->eedump_len = data->eeprom_len;
 }
 
-static int asix_get_settings(struct net_device *net, struct ethtool_cmd *cmd)
-{
-       struct usbnet *dev = netdev_priv(net);
-
-       return mii_ethtool_gset(&dev->mii,cmd);
-}
-
-static int asix_set_settings(struct net_device *net, struct ethtool_cmd *cmd)
-{
-       struct usbnet *dev = netdev_priv(net);
-       int res = mii_ethtool_sset(&dev->mii,cmd);
-
-       /* link speed/duplex might have changed */
-       if (dev->driver_info->link_reset)
-               dev->driver_info->link_reset(dev);
-
-       return res;
-}
-
-static int asix_nway_reset(struct net_device *net)
-{
-       struct usbnet *dev = netdev_priv(net);
-
-       return mii_nway_restart(&dev->mii);
-}
-
 static u32 asix_get_link(struct net_device *net)
 {
        struct usbnet *dev = netdev_priv(net);
@@ -746,15 +724,15 @@ static int asix_ioctl (struct net_device *net, struct ifreq *rq, int cmd)
 static struct ethtool_ops ax88172_ethtool_ops = {
        .get_drvinfo            = asix_get_drvinfo,
        .get_link               = asix_get_link,
-       .nway_reset             = asix_nway_reset,
        .get_msglevel           = usbnet_get_msglevel,
        .set_msglevel           = usbnet_set_msglevel,
        .get_wol                = asix_get_wol,
        .set_wol                = asix_set_wol,
        .get_eeprom_len         = asix_get_eeprom_len,
        .get_eeprom             = asix_get_eeprom,
-       .get_settings           = asix_get_settings,
-       .set_settings           = asix_set_settings,
+       .get_settings           = usbnet_get_settings,
+       .set_settings           = usbnet_set_settings,
+       .nway_reset             = usbnet_nway_reset,
 };
 
 static void ax88172_set_multicast(struct net_device *net)
@@ -885,15 +863,15 @@ out1:
 static struct ethtool_ops ax88772_ethtool_ops = {
        .get_drvinfo            = asix_get_drvinfo,
        .get_link               = asix_get_link,
-       .nway_reset             = asix_nway_reset,
        .get_msglevel           = usbnet_get_msglevel,
        .set_msglevel           = usbnet_set_msglevel,
        .get_wol                = asix_get_wol,
        .set_wol                = asix_set_wol,
        .get_eeprom_len         = asix_get_eeprom_len,
        .get_eeprom             = asix_get_eeprom,
-       .get_settings           = asix_get_settings,
-       .set_settings           = asix_set_settings,
+       .get_settings           = usbnet_get_settings,
+       .set_settings           = usbnet_set_settings,
+       .nway_reset             = usbnet_nway_reset,
 };
 
 static int ax88772_link_reset(struct usbnet *dev)
@@ -1046,15 +1024,15 @@ out1:
 static struct ethtool_ops ax88178_ethtool_ops = {
        .get_drvinfo            = asix_get_drvinfo,
        .get_link               = asix_get_link,
-       .nway_reset             = asix_nway_reset,
        .get_msglevel           = usbnet_get_msglevel,
        .set_msglevel           = usbnet_set_msglevel,
        .get_wol                = asix_get_wol,
        .set_wol                = asix_set_wol,
        .get_eeprom_len         = asix_get_eeprom_len,
        .get_eeprom             = asix_get_eeprom,
-       .get_settings           = asix_get_settings,
-       .set_settings           = asix_set_settings,
+       .get_settings           = usbnet_get_settings,
+       .set_settings           = usbnet_set_settings,
+       .nway_reset             = usbnet_nway_reset,
 };
 
 static int marvell_phy_init(struct usbnet *dev)
index 82ce0358d9a3e5f13e44a76089c319e28622b662..f6971b88349d8b8a3e5c4eec357ce2ed1063166b 100644 (file)
@@ -498,7 +498,7 @@ static struct usb_driver cdc_driver = {
 
 static int __init cdc_init(void)
 {
-       BUG_ON((sizeof(((struct usbnet *)0)->data)
+       BUILD_BUG_ON((sizeof(((struct usbnet *)0)->data)
                        < sizeof(struct cdc_state)));
 
        return usb_register(&cdc_driver);
index 957d4ad316f9bf86f7636119bbc4b161a34ac9d1..7c906a43e4973b081b9cdd20d068913e43a930bd 100644 (file)
 
 #undef DEBUG
 
-#ifdef DEBUG
-#define kaweth_dbg(format, arg...) printk(KERN_DEBUG __FILE__ ": " format "\n" ,##arg)
-#else
-#define kaweth_dbg(format, arg...) do {} while (0)
-#endif
-#define kaweth_err(format, arg...) printk(KERN_ERR __FILE__ ": " format "\n" ,##arg)
-#define kaweth_info(format, arg...) printk(KERN_INFO __FILE__ ": " format "\n" , ##arg)
-#define kaweth_warn(format, arg...) printk(KERN_WARNING __FILE__ ": " format "\n" , ##arg)
-
-
 #include "kawethfw.h"
 
 #define KAWETH_MTU                     1514
@@ -86,6 +76,9 @@
 
 #define KAWETH_STATUS_BROKEN           0x0000001
 #define KAWETH_STATUS_CLOSING          0x0000002
+#define KAWETH_STATUS_SUSPENDING       0x0000004
+
+#define KAWETH_STATUS_BLOCKED (KAWETH_STATUS_CLOSING | KAWETH_STATUS_SUSPENDING)
 
 #define KAWETH_PACKET_FILTER_PROMISCUOUS       0x01
 #define KAWETH_PACKET_FILTER_ALL_MULTICAST     0x02
 #define STATE_MASK                             0x40
 #define        STATE_SHIFT                             5
 
+#define IS_BLOCKED(s) (s & KAWETH_STATUS_BLOCKED)
+
 
 MODULE_AUTHOR("Michael Zappe <zapman@interlan.net>, Stephane Alnet <stephane@u-picardie.fr>, Brad Hards <bhards@bigpond.net.au> and Oliver Neukum <oliver@neukum.org>");
 MODULE_DESCRIPTION("KL5USB101 USB Ethernet driver");
@@ -128,6 +123,8 @@ static int kaweth_internal_control_msg(struct usb_device *usb_dev,
                                       unsigned int pipe,
                                       struct usb_ctrlrequest *cmd, void *data,
                                       int len, int timeout);
+static int kaweth_suspend(struct usb_interface *intf, pm_message_t message);
+static int kaweth_resume(struct usb_interface *intf);
 
 /****************************************************************
  *     usb_device_id
@@ -179,6 +176,8 @@ static struct usb_driver kaweth_driver = {
        .name =         driver_name,
        .probe =        kaweth_probe,
        .disconnect =   kaweth_disconnect,
+       .suspend =      kaweth_suspend,
+       .resume =       kaweth_resume,
        .id_table =     usb_klsi_table,
 };
 
@@ -222,6 +221,7 @@ struct kaweth_device
        int suspend_lowmem_rx;
        int suspend_lowmem_ctrl;
        int linkstate;
+       int opened;
        struct work_struct lowmem_work;
 
        struct usb_device *dev;
@@ -265,17 +265,17 @@ static int kaweth_control(struct kaweth_device *kaweth,
 {
        struct usb_ctrlrequest *dr;
 
-       kaweth_dbg("kaweth_control()");
+       dbg("kaweth_control()");
 
        if(in_interrupt()) {
-               kaweth_dbg("in_interrupt()");
+               dbg("in_interrupt()");
                return -EBUSY;
        }
 
        dr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_ATOMIC);
 
        if (!dr) {
-               kaweth_dbg("kmalloc() failed");
+               dbg("kmalloc() failed");
                return -ENOMEM;
        }
 
@@ -300,7 +300,7 @@ static int kaweth_read_configuration(struct kaweth_device *kaweth)
 {
        int retval;
 
-       kaweth_dbg("Reading kaweth configuration");
+       dbg("Reading kaweth configuration");
 
        retval = kaweth_control(kaweth,
                                usb_rcvctrlpipe(kaweth->dev, 0),
@@ -322,7 +322,7 @@ static int kaweth_set_urb_size(struct kaweth_device *kaweth, __u16 urb_size)
 {
        int retval;
 
-       kaweth_dbg("Setting URB size to %d", (unsigned)urb_size);
+       dbg("Setting URB size to %d", (unsigned)urb_size);
 
        retval = kaweth_control(kaweth,
                                usb_sndctrlpipe(kaweth->dev, 0),
@@ -344,7 +344,7 @@ static int kaweth_set_sofs_wait(struct kaweth_device *kaweth, __u16 sofs_wait)
 {
        int retval;
 
-       kaweth_dbg("Set SOFS wait to %d", (unsigned)sofs_wait);
+       dbg("Set SOFS wait to %d", (unsigned)sofs_wait);
 
        retval = kaweth_control(kaweth,
                                usb_sndctrlpipe(kaweth->dev, 0),
@@ -367,7 +367,7 @@ static int kaweth_set_receive_filter(struct kaweth_device *kaweth,
 {
        int retval;
 
-       kaweth_dbg("Set receive filter to %d", (unsigned)receive_filter);
+       dbg("Set receive filter to %d", (unsigned)receive_filter);
 
        retval = kaweth_control(kaweth,
                                usb_sndctrlpipe(kaweth->dev, 0),
@@ -392,7 +392,7 @@ static int kaweth_download_firmware(struct kaweth_device *kaweth,
                                    __u8 type)
 {
        if(data_len > KAWETH_FIRMWARE_BUF_SIZE) {
-               kaweth_err("Firmware too big: %d", data_len);
+               err("Firmware too big: %d", data_len);
                return -ENOSPC;
        }
 
@@ -403,13 +403,13 @@ static int kaweth_download_firmware(struct kaweth_device *kaweth,
        kaweth->firmware_buf[4] = type;
        kaweth->firmware_buf[5] = interrupt;
 
-       kaweth_dbg("High: %i, Low:%i", kaweth->firmware_buf[3],
+       dbg("High: %i, Low:%i", kaweth->firmware_buf[3],
                   kaweth->firmware_buf[2]);
 
-       kaweth_dbg("Downloading firmware at %p to kaweth device at %p",
+       dbg("Downloading firmware at %p to kaweth device at %p",
            data,
            kaweth);
-       kaweth_dbg("Firmware length: %d", data_len);
+       dbg("Firmware length: %d", data_len);
 
        return kaweth_control(kaweth,
                              usb_sndctrlpipe(kaweth->dev, 0),
@@ -437,7 +437,7 @@ static int kaweth_trigger_firmware(struct kaweth_device *kaweth,
        kaweth->firmware_buf[6] = 0x00;
        kaweth->firmware_buf[7] = 0x00;
 
-       kaweth_dbg("Triggering firmware");
+       dbg("Triggering firmware");
 
        return kaweth_control(kaweth,
                              usb_sndctrlpipe(kaweth->dev, 0),
@@ -457,7 +457,7 @@ static int kaweth_reset(struct kaweth_device *kaweth)
 {
        int result;
 
-       kaweth_dbg("kaweth_reset(%p)", kaweth);
+       dbg("kaweth_reset(%p)", kaweth);
        result = kaweth_control(kaweth,
                                usb_sndctrlpipe(kaweth->dev, 0),
                                USB_REQ_SET_CONFIGURATION,
@@ -470,7 +470,7 @@ static int kaweth_reset(struct kaweth_device *kaweth)
 
        mdelay(10);
 
-       kaweth_dbg("kaweth_reset() returns %d.",result);
+       dbg("kaweth_reset() returns %d.",result);
 
        return result;
 }
@@ -534,7 +534,7 @@ static void kaweth_resubmit_tl(void *d)
 {
        struct kaweth_device *kaweth = (struct kaweth_device *)d;
 
-       if (kaweth->status | KAWETH_STATUS_CLOSING)
+       if (IS_BLOCKED(kaweth->status))
                return;
 
        if (kaweth->suspend_lowmem_rx)
@@ -568,7 +568,7 @@ static int kaweth_resubmit_rx_urb(struct kaweth_device *kaweth,
                        kaweth->suspend_lowmem_rx = 1;
                        schedule_delayed_work(&kaweth->lowmem_work, HZ/4);
                }
-               kaweth_err("resubmitting rx_urb %d failed", result);
+               err("resubmitting rx_urb %d failed", result);
        } else {
                kaweth->suspend_lowmem_rx = 0;
        }
@@ -601,11 +601,15 @@ static void kaweth_usb_receive(struct urb *urb)
                return;
        }
 
-       if (kaweth->status & KAWETH_STATUS_CLOSING)
+       spin_lock(&kaweth->device_lock);
+       if (IS_BLOCKED(kaweth->status)) {
+               spin_unlock(&kaweth->device_lock);
                return;
+       }
+       spin_unlock(&kaweth->device_lock);
 
        if(urb->status && urb->status != -EREMOTEIO && count != 1) {
-               kaweth_err("%s RX status: %d count: %d packet_len: %d",
+               err("%s RX status: %d count: %d packet_len: %d",
                            net->name,
                           urb->status,
                           count,
@@ -616,9 +620,9 @@ static void kaweth_usb_receive(struct urb *urb)
 
        if(kaweth->net && (count > 2)) {
                if(pkt_len > (count - 2)) {
-                       kaweth_err("Packet length too long for USB frame (pkt_len: %x, count: %x)",pkt_len, count);
-                       kaweth_err("Packet len & 2047: %x", pkt_len & 2047);
-                       kaweth_err("Count 2: %x", count2);
+                       err("Packet length too long for USB frame (pkt_len: %x, count: %x)",pkt_len, count);
+                       err("Packet len & 2047: %x", pkt_len & 2047);
+                       err("Count 2: %x", count2);
                        kaweth_resubmit_rx_urb(kaweth, GFP_ATOMIC);
                         return;
                 }
@@ -655,7 +659,7 @@ static int kaweth_open(struct net_device *net)
        struct kaweth_device *kaweth = netdev_priv(net);
        int res;
 
-       kaweth_dbg("Opening network device.");
+       dbg("Opening network device.");
 
        res = kaweth_resubmit_rx_urb(kaweth, GFP_KERNEL);
        if (res)
@@ -678,6 +682,7 @@ static int kaweth_open(struct net_device *net)
                usb_kill_urb(kaweth->rx_urb);
                return -EIO;
        }
+       kaweth->opened = 1;
 
        netif_start_queue(net);
 
@@ -688,14 +693,8 @@ static int kaweth_open(struct net_device *net)
 /****************************************************************
  *     kaweth_close
  ****************************************************************/
-static int kaweth_close(struct net_device *net)
+static void kaweth_kill_urbs(struct kaweth_device *kaweth)
 {
-       struct kaweth_device *kaweth = netdev_priv(net);
-
-       netif_stop_queue(net);
-
-       kaweth->status |= KAWETH_STATUS_CLOSING;
-
        usb_kill_urb(kaweth->irq_urb);
        usb_kill_urb(kaweth->rx_urb);
        usb_kill_urb(kaweth->tx_urb);
@@ -706,6 +705,21 @@ static int kaweth_close(struct net_device *net)
           we hit them again */
        usb_kill_urb(kaweth->irq_urb);
        usb_kill_urb(kaweth->rx_urb);
+}
+
+/****************************************************************
+ *     kaweth_close
+ ****************************************************************/
+static int kaweth_close(struct net_device *net)
+{
+       struct kaweth_device *kaweth = netdev_priv(net);
+
+       netif_stop_queue(net);
+       kaweth->opened = 0;
+
+       kaweth->status |= KAWETH_STATUS_CLOSING;
+
+       kaweth_kill_urbs(kaweth);
 
        kaweth->status &= ~KAWETH_STATUS_CLOSING;
 
@@ -732,7 +746,7 @@ static void kaweth_usb_transmit_complete(struct urb *urb)
 
        if (unlikely(urb->status != 0))
                if (urb->status != -ENOENT)
-                       kaweth_dbg("%s: TX status %d.", kaweth->net->name, urb->status);
+                       dbg("%s: TX status %d.", kaweth->net->name, urb->status);
 
        netif_wake_queue(kaweth->net);
        dev_kfree_skb_irq(skb);
@@ -752,6 +766,9 @@ static int kaweth_start_xmit(struct sk_buff *skb, struct net_device *net)
 
        kaweth_async_set_rx_mode(kaweth);
        netif_stop_queue(net);
+       if (IS_BLOCKED(kaweth->status)) {
+               goto skip;
+       }
 
        /* We now decide whether we can put our special header into the sk_buff */
        if (skb_cloned(skb) || skb_headroom(skb) < 2) {
@@ -783,7 +800,8 @@ static int kaweth_start_xmit(struct sk_buff *skb, struct net_device *net)
 
        if((res = usb_submit_urb(kaweth->tx_urb, GFP_ATOMIC)))
        {
-               kaweth_warn("kaweth failed tx_urb %d", res);
+               warn("kaweth failed tx_urb %d", res);
+skip:
                kaweth->stats.tx_errors++;
 
                netif_start_queue(net);
@@ -812,7 +830,7 @@ static void kaweth_set_rx_mode(struct net_device *net)
                                      KAWETH_PACKET_FILTER_BROADCAST |
                                     KAWETH_PACKET_FILTER_MULTICAST;
 
-       kaweth_dbg("Setting Rx mode to %d", packet_filter_bitmap);
+       dbg("Setting Rx mode to %d", packet_filter_bitmap);
 
        netif_stop_queue(net);
 
@@ -850,10 +868,10 @@ static void kaweth_async_set_rx_mode(struct kaweth_device *kaweth)
                                KAWETH_CONTROL_TIMEOUT);
 
        if(result < 0) {
-               kaweth_err("Failed to set Rx mode: %d", result);
+               err("Failed to set Rx mode: %d", result);
        }
        else {
-               kaweth_dbg("Set Rx mode to %d", packet_filter_bitmap);
+               dbg("Set Rx mode to %d", packet_filter_bitmap);
        }
        }
 }
@@ -874,13 +892,49 @@ static void kaweth_tx_timeout(struct net_device *net)
 {
        struct kaweth_device *kaweth = netdev_priv(net);
 
-       kaweth_warn("%s: Tx timed out. Resetting.", net->name);
+       warn("%s: Tx timed out. Resetting.", net->name);
        kaweth->stats.tx_errors++;
        net->trans_start = jiffies;
 
        usb_unlink_urb(kaweth->tx_urb);
 }
 
+/****************************************************************
+ *     kaweth_suspend
+ ****************************************************************/
+static int kaweth_suspend(struct usb_interface *intf, pm_message_t message)
+{
+       struct kaweth_device *kaweth = usb_get_intfdata(intf);
+       unsigned long flags;
+
+       spin_lock_irqsave(&kaweth->device_lock, flags);
+       kaweth->status |= KAWETH_STATUS_SUSPENDING;
+       spin_unlock_irqrestore(&kaweth->device_lock, flags);
+
+       kaweth_kill_urbs(kaweth);
+       return 0;
+}
+
+/****************************************************************
+ *     kaweth_resume
+ ****************************************************************/
+static int kaweth_resume(struct usb_interface *intf)
+{
+       struct kaweth_device *kaweth = usb_get_intfdata(intf);
+       unsigned long flags;
+
+       spin_lock_irqsave(&kaweth->device_lock, flags);
+       kaweth->status &= ~KAWETH_STATUS_SUSPENDING;
+       spin_unlock_irqrestore(&kaweth->device_lock, flags);
+
+       if (!kaweth->opened)
+               return 0;
+       kaweth_resubmit_rx_urb(kaweth, GFP_NOIO);
+       kaweth_resubmit_int_urb(kaweth, GFP_NOIO);
+
+       return 0;
+}
+
 /****************************************************************
  *     kaweth_probe
  ****************************************************************/
@@ -895,15 +949,15 @@ static int kaweth_probe(
        const eth_addr_t bcast_addr = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
        int result = 0;
 
-       kaweth_dbg("Kawasaki Device Probe (Device number:%d): 0x%4.4x:0x%4.4x:0x%4.4x",
+       dbg("Kawasaki Device Probe (Device number:%d): 0x%4.4x:0x%4.4x:0x%4.4x",
                 dev->devnum,
                 le16_to_cpu(dev->descriptor.idVendor),
                 le16_to_cpu(dev->descriptor.idProduct),
                 le16_to_cpu(dev->descriptor.bcdDevice));
 
-       kaweth_dbg("Device at %p", dev);
+       dbg("Device at %p", dev);
 
-       kaweth_dbg("Descriptor length: %x type: %x",
+       dbg("Descriptor length: %x type: %x",
                 (int)dev->descriptor.bLength,
                 (int)dev->descriptor.bDescriptorType);
 
@@ -918,7 +972,7 @@ static int kaweth_probe(
        spin_lock_init(&kaweth->device_lock);
        init_waitqueue_head(&kaweth->term_wait);
 
-       kaweth_dbg("Resetting.");
+       dbg("Resetting.");
 
        kaweth_reset(kaweth);
 
@@ -928,17 +982,17 @@ static int kaweth_probe(
         */
 
        if (le16_to_cpu(dev->descriptor.bcdDevice) >> 8) {
-               kaweth_info("Firmware present in device.");
+               info("Firmware present in device.");
        } else {
                /* Download the firmware */
-               kaweth_info("Downloading firmware...");
+               info("Downloading firmware...");
                kaweth->firmware_buf = (__u8 *)__get_free_page(GFP_KERNEL);
                if ((result = kaweth_download_firmware(kaweth,
                                                      kaweth_new_code,
                                                      len_kaweth_new_code,
                                                      100,
                                                      2)) < 0) {
-                       kaweth_err("Error downloading firmware (%d)", result);
+                       err("Error downloading firmware (%d)", result);
                        goto err_fw;
                }
 
@@ -947,7 +1001,7 @@ static int kaweth_probe(
                                                      len_kaweth_new_code_fix,
                                                      100,
                                                      3)) < 0) {
-                       kaweth_err("Error downloading firmware fix (%d)", result);
+                       err("Error downloading firmware fix (%d)", result);
                        goto err_fw;
                }
 
@@ -956,7 +1010,7 @@ static int kaweth_probe(
                                                      len_kaweth_trigger_code,
                                                      126,
                                                      2)) < 0) {
-                       kaweth_err("Error downloading trigger code (%d)", result);
+                       err("Error downloading trigger code (%d)", result);
                        goto err_fw;
 
                }
@@ -966,18 +1020,18 @@ static int kaweth_probe(
                                                      len_kaweth_trigger_code_fix,
                                                      126,
                                                      3)) < 0) {
-                       kaweth_err("Error downloading trigger code fix (%d)", result);
+                       err("Error downloading trigger code fix (%d)", result);
                        goto err_fw;
                }
 
 
                if ((result = kaweth_trigger_firmware(kaweth, 126)) < 0) {
-                       kaweth_err("Error triggering firmware (%d)", result);
+                       err("Error triggering firmware (%d)", result);
                        goto err_fw;
                }
 
                /* Device will now disappear for a moment...  */
-               kaweth_info("Firmware loaded.  I'll be back...");
+               info("Firmware loaded.  I'll be back...");
 err_fw:
                free_page((unsigned long)kaweth->firmware_buf);
                free_netdev(netdev);
@@ -987,14 +1041,14 @@ err_fw:
        result = kaweth_read_configuration(kaweth);
 
        if(result < 0) {
-               kaweth_err("Error reading configuration (%d), no net device created", result);
+               err("Error reading configuration (%d), no net device created", result);
                goto err_free_netdev;
        }
 
-       kaweth_info("Statistics collection: %x", kaweth->configuration.statistics_mask);
-       kaweth_info("Multicast filter limit: %x", kaweth->configuration.max_multicast_filters & ((1 << 15) - 1));
-       kaweth_info("MTU: %d", le16_to_cpu(kaweth->configuration.segment_size));
-       kaweth_info("Read MAC address %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x",
+       info("Statistics collection: %x", kaweth->configuration.statistics_mask);
+       info("Multicast filter limit: %x", kaweth->configuration.max_multicast_filters & ((1 << 15) - 1));
+       info("MTU: %d", le16_to_cpu(kaweth->configuration.segment_size));
+       info("Read MAC address %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x",
                 (int)kaweth->configuration.hw_addr[0],
                 (int)kaweth->configuration.hw_addr[1],
                 (int)kaweth->configuration.hw_addr[2],
@@ -1005,17 +1059,17 @@ err_fw:
        if(!memcmp(&kaweth->configuration.hw_addr,
                    &bcast_addr,
                   sizeof(bcast_addr))) {
-               kaweth_err("Firmware not functioning properly, no net device created");
+               err("Firmware not functioning properly, no net device created");
                goto err_free_netdev;
        }
 
        if(kaweth_set_urb_size(kaweth, KAWETH_BUF_SIZE) < 0) {
-               kaweth_dbg("Error setting URB size");
+               dbg("Error setting URB size");
                goto err_free_netdev;
        }
 
        if(kaweth_set_sofs_wait(kaweth, KAWETH_SOFS_TO_WAIT) < 0) {
-               kaweth_err("Error setting SOFS wait");
+               err("Error setting SOFS wait");
                goto err_free_netdev;
        }
 
@@ -1025,11 +1079,11 @@ err_fw:
                                            KAWETH_PACKET_FILTER_MULTICAST);
 
        if(result < 0) {
-               kaweth_err("Error setting receive filter");
+               err("Error setting receive filter");
                goto err_free_netdev;
        }
 
-       kaweth_dbg("Initializing net device.");
+       dbg("Initializing net device.");
 
        kaweth->tx_urb = usb_alloc_urb(0, GFP_KERNEL);
        if (!kaweth->tx_urb)
@@ -1086,13 +1140,13 @@ err_fw:
 
        SET_NETDEV_DEV(netdev, &intf->dev);
        if (register_netdev(netdev) != 0) {
-               kaweth_err("Error registering netdev.");
+               err("Error registering netdev.");
                goto err_intfdata;
        }
 
-       kaweth_info("kaweth interface created at %s", kaweth->net->name);
+       info("kaweth interface created at %s", kaweth->net->name);
 
-       kaweth_dbg("Kaweth probe returning.");
+       dbg("Kaweth probe returning.");
 
        return 0;
 
@@ -1121,16 +1175,16 @@ static void kaweth_disconnect(struct usb_interface *intf)
        struct kaweth_device *kaweth = usb_get_intfdata(intf);
        struct net_device *netdev;
 
-       kaweth_info("Unregistering");
+       info("Unregistering");
 
        usb_set_intfdata(intf, NULL);
        if (!kaweth) {
-               kaweth_warn("unregistering non-existant device");
+               warn("unregistering non-existant device");
                return;
        }
        netdev = kaweth->net;
 
-       kaweth_dbg("Unregistering net device");
+       dbg("Unregistering net device");
        unregister_netdev(netdev);
 
        usb_free_urb(kaweth->rx_urb);
@@ -1185,7 +1239,7 @@ static int usb_start_wait_urb(struct urb *urb, int timeout, int* actual_length)
 
        if (!wait_event_timeout(awd.wqh, awd.done, timeout)) {
                 // timeout
-                kaweth_warn("usb_control/bulk_msg: timeout");
+                warn("usb_control/bulk_msg: timeout");
                 usb_kill_urb(urb);  // remove urb safely
                 status = -ETIMEDOUT;
         }
@@ -1234,7 +1288,7 @@ static int kaweth_internal_control_msg(struct usb_device *usb_dev,
  ****************************************************************/
 static int __init kaweth_init(void)
 {
-       kaweth_dbg("Driver loading");
+       dbg("Driver loading");
        return usb_register(&kaweth_driver);
 }
 
diff --git a/drivers/usb/net/mcs7830.c b/drivers/usb/net/mcs7830.c
new file mode 100644 (file)
index 0000000..6240b97
--- /dev/null
@@ -0,0 +1,534 @@
+/*
+ * MosChips MCS7830 based USB 2.0 Ethernet Devices
+ *
+ * based on usbnet.c, asix.c and the vendor provided mcs7830 driver
+ *
+ * Copyright (C) 2006 Arnd Bergmann <arnd@arndb.de>
+ * Copyright (C) 2003-2005 David Hollis <dhollis@davehollis.com>
+ * Copyright (C) 2005 Phil Chang <pchang23@sbcglobal.net>
+ * Copyright (c) 2002-2003 TiVo Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/crc32.h>
+#include <linux/etherdevice.h>
+#include <linux/ethtool.h>
+#include <linux/init.h>
+#include <linux/mii.h>
+#include <linux/module.h>
+#include <linux/netdevice.h>
+#include <linux/usb.h>
+
+#include "usbnet.h"
+
+/* requests */
+#define MCS7830_RD_BMREQ       (USB_DIR_IN  | USB_TYPE_VENDOR | \
+                                USB_RECIP_DEVICE)
+#define MCS7830_WR_BMREQ       (USB_DIR_OUT | USB_TYPE_VENDOR | \
+                                USB_RECIP_DEVICE)
+#define MCS7830_RD_BREQ                0x0E
+#define MCS7830_WR_BREQ                0x0D
+
+#define MCS7830_CTRL_TIMEOUT   1000
+#define MCS7830_MAX_MCAST      64
+
+#define MCS7830_VENDOR_ID      0x9710
+#define MCS7830_PRODUCT_ID     0x7830
+
+#define MCS7830_MII_ADVERTISE  (ADVERTISE_PAUSE_CAP | ADVERTISE_100FULL | \
+                                ADVERTISE_100HALF | ADVERTISE_10FULL | \
+                                ADVERTISE_10HALF | ADVERTISE_CSMA)
+
+/* HIF_REG_XX coressponding index value */
+enum {
+       HIF_REG_MULTICAST_HASH                  = 0x00,
+       HIF_REG_PACKET_GAP1                     = 0x08,
+       HIF_REG_PACKET_GAP2                     = 0x09,
+       HIF_REG_PHY_DATA                        = 0x0a,
+       HIF_REG_PHY_CMD1                        = 0x0c,
+          HIF_REG_PHY_CMD1_READ                = 0x40,
+          HIF_REG_PHY_CMD1_WRITE               = 0x20,
+          HIF_REG_PHY_CMD1_PHYADDR             = 0x01,
+       HIF_REG_PHY_CMD2                        = 0x0d,
+          HIF_REG_PHY_CMD2_PEND_FLAG_BIT       = 0x80,
+          HIF_REG_PHY_CMD2_READY_FLAG_BIT      = 0x40,
+       HIF_REG_CONFIG                          = 0x0e,
+          HIF_REG_CONFIG_CFG                   = 0x80,
+          HIF_REG_CONFIG_SPEED100              = 0x40,
+          HIF_REG_CONFIG_FULLDUPLEX_ENABLE     = 0x20,
+          HIF_REG_CONFIG_RXENABLE              = 0x10,
+          HIF_REG_CONFIG_TXENABLE              = 0x08,
+          HIF_REG_CONFIG_SLEEPMODE             = 0x04,
+          HIF_REG_CONFIG_ALLMULTICAST          = 0x02,
+          HIF_REG_CONFIG_PROMISCIOUS           = 0x01,
+       HIF_REG_ETHERNET_ADDR                   = 0x0f,
+       HIF_REG_22                              = 0x15,
+       HIF_REG_PAUSE_THRESHOLD                 = 0x16,
+          HIF_REG_PAUSE_THRESHOLD_DEFAULT      = 0,
+};
+
+struct mcs7830_data {
+       u8 multi_filter[8];
+       u8 config;
+};
+
+static const char driver_name[] = "MOSCHIP usb-ethernet driver";
+
+static int mcs7830_get_reg(struct usbnet *dev, u16 index, u16 size, void *data)
+{
+       struct usb_device *xdev = dev->udev;
+       int ret;
+
+       ret = usb_control_msg(xdev, usb_rcvctrlpipe(xdev, 0), MCS7830_RD_BREQ,
+                             MCS7830_RD_BMREQ, 0x0000, index, data,
+                             size, msecs_to_jiffies(MCS7830_CTRL_TIMEOUT));
+       return ret;
+}
+
+static int mcs7830_set_reg(struct usbnet *dev, u16 index, u16 size, void *data)
+{
+       struct usb_device *xdev = dev->udev;
+       int ret;
+
+       ret = usb_control_msg(xdev, usb_sndctrlpipe(xdev, 0), MCS7830_WR_BREQ,
+                             MCS7830_WR_BMREQ, 0x0000, index, data,
+                             size, msecs_to_jiffies(MCS7830_CTRL_TIMEOUT));
+       return ret;
+}
+
+static void mcs7830_async_cmd_callback(struct urb *urb)
+{
+       struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)urb->context;
+
+       if (urb->status < 0)
+               printk(KERN_DEBUG "mcs7830_async_cmd_callback() failed with %d",
+                       urb->status);
+
+       kfree(req);
+       usb_free_urb(urb);
+}
+
+static void mcs7830_set_reg_async(struct usbnet *dev, u16 index, u16 size, void *data)
+{
+       struct usb_ctrlrequest *req;
+       int ret;
+       struct urb *urb;
+
+       urb = usb_alloc_urb(0, GFP_ATOMIC);
+       if (!urb) {
+               dev_dbg(&dev->udev->dev, "Error allocating URB "
+                               "in write_cmd_async!");
+               return;
+       }
+
+       req = kmalloc(sizeof *req, GFP_ATOMIC);
+       if (!req) {
+               dev_err(&dev->udev->dev, "Failed to allocate memory for "
+                               "control request");
+               goto out;
+       }
+       req->bRequestType = MCS7830_WR_BMREQ;
+       req->bRequest = MCS7830_WR_BREQ;
+       req->wValue = 0;
+       req->wIndex = cpu_to_le16(index);
+       req->wLength = cpu_to_le16(size);
+
+       usb_fill_control_urb(urb, dev->udev,
+                            usb_sndctrlpipe(dev->udev, 0),
+                            (void *)req, data, size,
+                            mcs7830_async_cmd_callback, req);
+
+       ret = usb_submit_urb(urb, GFP_ATOMIC);
+       if (ret < 0) {
+               dev_err(&dev->udev->dev, "Error submitting the control "
+                               "message: ret=%d", ret);
+               goto out;
+       }
+       return;
+out:
+       kfree(req);
+       usb_free_urb(urb);
+}
+
+static int mcs7830_get_address(struct usbnet *dev)
+{
+       int ret;
+       ret = mcs7830_get_reg(dev, HIF_REG_ETHERNET_ADDR, ETH_ALEN,
+                                  dev->net->dev_addr);
+       if (ret < 0)
+               return ret;
+       return 0;
+}
+
+static int mcs7830_read_phy(struct usbnet *dev, u8 index)
+{
+       int ret;
+       int i;
+       __le16 val;
+
+       u8 cmd[2] = {
+               HIF_REG_PHY_CMD1_READ | HIF_REG_PHY_CMD1_PHYADDR,
+               HIF_REG_PHY_CMD2_PEND_FLAG_BIT | index,
+       };
+
+       mutex_lock(&dev->phy_mutex);
+       /* write the MII command */
+       ret = mcs7830_set_reg(dev, HIF_REG_PHY_CMD1, 2, cmd);
+       if (ret < 0)
+               goto out;
+
+       /* wait for the data to become valid, should be within < 1ms */
+       for (i = 0; i < 10; i++) {
+               ret = mcs7830_get_reg(dev, HIF_REG_PHY_CMD1, 2, cmd);
+               if ((ret < 0) || (cmd[1] & HIF_REG_PHY_CMD2_READY_FLAG_BIT))
+                       break;
+               ret = -EIO;
+               msleep(1);
+       }
+       if (ret < 0)
+               goto out;
+
+       /* read actual register contents */
+       ret = mcs7830_get_reg(dev, HIF_REG_PHY_DATA, 2, &val);
+       if (ret < 0)
+               goto out;
+       ret = le16_to_cpu(val);
+       dev_dbg(&dev->udev->dev, "read PHY reg %02x: %04x (%d tries)\n",
+               index, val, i);
+out:
+       mutex_unlock(&dev->phy_mutex);
+       return ret;
+}
+
+static int mcs7830_write_phy(struct usbnet *dev, u8 index, u16 val)
+{
+       int ret;
+       int i;
+       __le16 le_val;
+
+       u8 cmd[2] = {
+               HIF_REG_PHY_CMD1_WRITE | HIF_REG_PHY_CMD1_PHYADDR,
+               HIF_REG_PHY_CMD2_PEND_FLAG_BIT | (index & 0x1F),
+       };
+
+       mutex_lock(&dev->phy_mutex);
+
+       /* write the new register contents */
+       le_val = cpu_to_le16(val);
+       ret = mcs7830_set_reg(dev, HIF_REG_PHY_DATA, 2, &le_val);
+       if (ret < 0)
+               goto out;
+
+       /* write the MII command */
+       ret = mcs7830_set_reg(dev, HIF_REG_PHY_CMD1, 2, cmd);
+       if (ret < 0)
+               goto out;
+
+       /* wait for the command to be accepted by the PHY */
+       for (i = 0; i < 10; i++) {
+               ret = mcs7830_get_reg(dev, HIF_REG_PHY_CMD1, 2, cmd);
+               if ((ret < 0) || (cmd[1] & HIF_REG_PHY_CMD2_READY_FLAG_BIT))
+                       break;
+               ret = -EIO;
+               msleep(1);
+       }
+       if (ret < 0)
+               goto out;
+
+       ret = 0;
+       dev_dbg(&dev->udev->dev, "write PHY reg %02x: %04x (%d tries)\n",
+               index, val, i);
+out:
+       mutex_unlock(&dev->phy_mutex);
+       return ret;
+}
+
+/*
+ * This algorithm comes from the original mcs7830 version 1.4 driver,
+ * not sure if it is needed.
+ */
+static int mcs7830_set_autoneg(struct usbnet *dev, int ptrUserPhyMode)
+{
+       int ret;
+       /* Enable all media types */
+       ret = mcs7830_write_phy(dev, MII_ADVERTISE, MCS7830_MII_ADVERTISE);
+
+       /* First reset BMCR */
+       if (!ret)
+               ret = mcs7830_write_phy(dev, MII_BMCR, 0x0000);
+       /* Enable Auto Neg */
+       if (!ret)
+               ret = mcs7830_write_phy(dev, MII_BMCR, BMCR_ANENABLE);
+       /* Restart Auto Neg (Keep the Enable Auto Neg Bit Set) */
+       if (!ret)
+               ret = mcs7830_write_phy(dev, MII_BMCR,
+                               BMCR_ANENABLE | BMCR_ANRESTART  );
+       return ret < 0 ? : 0;
+}
+
+
+/*
+ * if we can read register 22, the chip revision is C or higher
+ */
+static int mcs7830_get_rev(struct usbnet *dev)
+{
+       u8 dummy[2];
+       int ret;
+       ret = mcs7830_get_reg(dev, HIF_REG_22, 2, dummy);
+       if (ret > 0)
+               return 2; /* Rev C or later */
+       return 1; /* earlier revision */
+}
+
+/*
+ * On rev. C we need to set the pause threshold
+ */
+static void mcs7830_rev_C_fixup(struct usbnet *dev)
+{
+       u8 pause_threshold = HIF_REG_PAUSE_THRESHOLD_DEFAULT;
+       int retry;
+
+       for (retry = 0; retry < 2; retry++) {
+               if (mcs7830_get_rev(dev) == 2) {
+                       dev_info(&dev->udev->dev, "applying rev.C fixup\n");
+                       mcs7830_set_reg(dev, HIF_REG_PAUSE_THRESHOLD,
+                                       1, &pause_threshold);
+               }
+               msleep(1);
+       }
+}
+
+static int mcs7830_init_dev(struct usbnet *dev)
+{
+       int ret;
+       int retry;
+
+       /* Read MAC address from EEPROM */
+       ret = -EINVAL;
+       for (retry = 0; retry < 5 && ret; retry++)
+               ret = mcs7830_get_address(dev);
+       if (ret) {
+               dev_warn(&dev->udev->dev, "Cannot read MAC address\n");
+               goto out;
+       }
+
+       /* Set up PHY */
+       ret = mcs7830_set_autoneg(dev, 0);
+       if (ret) {
+               dev_info(&dev->udev->dev, "Cannot set autoneg\n");
+               goto out;
+       }
+
+       mcs7830_rev_C_fixup(dev);
+       ret = 0;
+out:
+       return ret;
+}
+
+static int mcs7830_mdio_read(struct net_device *netdev, int phy_id,
+                            int location)
+{
+       struct usbnet *dev = netdev->priv;
+       return mcs7830_read_phy(dev, location);
+}
+
+static void mcs7830_mdio_write(struct net_device *netdev, int phy_id,
+                               int location, int val)
+{
+       struct usbnet *dev = netdev->priv;
+       mcs7830_write_phy(dev, location, val);
+}
+
+static int mcs7830_ioctl(struct net_device *net, struct ifreq *rq, int cmd)
+{
+       struct usbnet *dev = netdev_priv(net);
+       return generic_mii_ioctl(&dev->mii, if_mii(rq), cmd, NULL);
+}
+
+/* credits go to asix_set_multicast */
+static void mcs7830_set_multicast(struct net_device *net)
+{
+       struct usbnet *dev = netdev_priv(net);
+       struct mcs7830_data *data = (struct mcs7830_data *)&dev->data;
+
+       data->config = HIF_REG_CONFIG_TXENABLE;
+
+       /* this should not be needed, but it doesn't work otherwise */
+       data->config |= HIF_REG_CONFIG_ALLMULTICAST;
+
+       if (net->flags & IFF_PROMISC) {
+               data->config |= HIF_REG_CONFIG_PROMISCIOUS;
+       } else if (net->flags & IFF_ALLMULTI
+                  || net->mc_count > MCS7830_MAX_MCAST) {
+               data->config |= HIF_REG_CONFIG_ALLMULTICAST;
+       } else if (net->mc_count == 0) {
+               /* just broadcast and directed */
+       } else {
+               /* We use the 20 byte dev->data
+                * for our 8 byte filter buffer
+                * to avoid allocating memory that
+                * is tricky to free later */
+               struct dev_mc_list *mc_list = net->mc_list;
+               u32 crc_bits;
+               int i;
+
+               memset(data->multi_filter, 0, sizeof data->multi_filter);
+
+               /* Build the multicast hash filter. */
+               for (i = 0; i < net->mc_count; i++) {
+                       crc_bits = ether_crc(ETH_ALEN, mc_list->dmi_addr) >> 26;
+                       data->multi_filter[crc_bits >> 3] |= 1 << (crc_bits & 7);
+                       mc_list = mc_list->next;
+               }
+
+               mcs7830_set_reg_async(dev, HIF_REG_MULTICAST_HASH,
+                               sizeof data->multi_filter,
+                               data->multi_filter);
+       }
+
+       mcs7830_set_reg_async(dev, HIF_REG_CONFIG, 1, &data->config);
+}
+
+static int mcs7830_get_regs_len(struct net_device *net)
+{
+       struct usbnet *dev = netdev_priv(net);
+
+       switch (mcs7830_get_rev(dev)) {
+       case 1:
+               return 21;
+       case 2:
+               return 32;
+       }
+       return 0;
+}
+
+static void mcs7830_get_drvinfo(struct net_device *net, struct ethtool_drvinfo *drvinfo)
+{
+       usbnet_get_drvinfo(net, drvinfo);
+       drvinfo->regdump_len = mcs7830_get_regs_len(net);
+}
+
+static void mcs7830_get_regs(struct net_device *net, struct ethtool_regs *regs, void *data)
+{
+       struct usbnet *dev = netdev_priv(net);
+
+       regs->version = mcs7830_get_rev(dev);
+       mcs7830_get_reg(dev, 0, regs->len, data);
+}
+
+static struct ethtool_ops mcs7830_ethtool_ops = {
+       .get_drvinfo            = mcs7830_get_drvinfo,
+       .get_regs_len           = mcs7830_get_regs_len,
+       .get_regs               = mcs7830_get_regs,
+
+       /* common usbnet calls */
+       .get_link               = usbnet_get_link,
+       .get_msglevel           = usbnet_get_msglevel,
+       .set_msglevel           = usbnet_set_msglevel,
+       .get_settings           = usbnet_get_settings,
+       .set_settings           = usbnet_set_settings,
+       .nway_reset             = usbnet_nway_reset,
+};
+
+static int mcs7830_bind(struct usbnet *dev, struct usb_interface *udev)
+{
+       struct net_device *net = dev->net;
+       int ret;
+
+       ret = mcs7830_init_dev(dev);
+       if (ret)
+               goto out;
+
+       net->do_ioctl = mcs7830_ioctl;
+       net->ethtool_ops = &mcs7830_ethtool_ops;
+       net->set_multicast_list = mcs7830_set_multicast;
+       mcs7830_set_multicast(net);
+
+       /* reserve space for the status byte on rx */
+       dev->rx_urb_size = ETH_FRAME_LEN + 1;
+
+       dev->mii.mdio_read = mcs7830_mdio_read;
+       dev->mii.mdio_write = mcs7830_mdio_write;
+       dev->mii.dev = net;
+       dev->mii.phy_id_mask = 0x3f;
+       dev->mii.reg_num_mask = 0x1f;
+       dev->mii.phy_id = *((u8 *) net->dev_addr + 1);
+
+       ret = usbnet_get_endpoints(dev, udev);
+out:
+       return ret;
+}
+
+/* The chip always appends a status bytes that we need to strip */
+static int mcs7830_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
+{
+       u8 status;
+
+       if (skb->len == 0) {
+               dev_err(&dev->udev->dev, "unexpected empty rx frame\n");
+               return 0;
+       }
+
+       skb_trim(skb, skb->len - 1);
+       status = skb->data[skb->len];
+
+       if (status != 0x20)
+               dev_dbg(&dev->udev->dev, "rx fixup status %x\n", status);
+
+       return skb->len > 0;
+}
+
+static const struct driver_info moschip_info = {
+       .description    = "MOSCHIP 7830 usb-NET adapter",
+       .bind           = mcs7830_bind,
+       .rx_fixup       = mcs7830_rx_fixup,
+       .flags          = FLAG_ETHER,
+       .in             = 1,
+       .out            = 2,
+};
+
+static const struct usb_device_id products[] = {
+       {
+               USB_DEVICE(MCS7830_VENDOR_ID, MCS7830_PRODUCT_ID),
+               .driver_info = (unsigned long) &moschip_info,
+       },
+       {},
+};
+MODULE_DEVICE_TABLE(usb, products);
+
+static struct usb_driver mcs7830_driver = {
+       .name = driver_name,
+       .id_table = products,
+       .probe = usbnet_probe,
+       .disconnect = usbnet_disconnect,
+       .suspend = usbnet_suspend,
+       .resume = usbnet_resume,
+};
+
+static int __init mcs7830_init(void)
+{
+       return usb_register(&mcs7830_driver);
+}
+module_init(mcs7830_init);
+
+static void __exit mcs7830_exit(void)
+{
+       usb_deregister(&mcs7830_driver);
+}
+module_exit(mcs7830_exit);
+
+MODULE_DESCRIPTION("USB to network adapter MCS7830)");
+MODULE_LICENSE("GPL");
index 24bd3486ee6334d45737c87345126c681bd97ad8..cf3d20eb781cde127e53f1af4c553bea198fa13a 100644 (file)
@@ -669,6 +669,37 @@ done:
  * they'll probably want to use this base set.
  */
 
+int usbnet_get_settings (struct net_device *net, struct ethtool_cmd *cmd)
+{
+       struct usbnet *dev = netdev_priv(net);
+
+       if (!dev->mii.mdio_read)
+               return -EOPNOTSUPP;
+
+       return mii_ethtool_gset(&dev->mii, cmd);
+}
+EXPORT_SYMBOL_GPL(usbnet_get_settings);
+
+int usbnet_set_settings (struct net_device *net, struct ethtool_cmd *cmd)
+{
+       struct usbnet *dev = netdev_priv(net);
+       int retval;
+
+       if (!dev->mii.mdio_write)
+               return -EOPNOTSUPP;
+
+       retval = mii_ethtool_sset(&dev->mii, cmd);
+
+       /* link speed/duplex might have changed */
+       if (dev->driver_info->link_reset)
+               dev->driver_info->link_reset(dev);
+
+       return retval;
+
+}
+EXPORT_SYMBOL_GPL(usbnet_set_settings);
+
+
 void usbnet_get_drvinfo (struct net_device *net, struct ethtool_drvinfo *info)
 {
        struct usbnet *dev = netdev_priv(net);
@@ -682,7 +713,7 @@ void usbnet_get_drvinfo (struct net_device *net, struct ethtool_drvinfo *info)
 }
 EXPORT_SYMBOL_GPL(usbnet_get_drvinfo);
 
-static u32 usbnet_get_link (struct net_device *net)
+u32 usbnet_get_link (struct net_device *net)
 {
        struct usbnet *dev = netdev_priv(net);
 
@@ -690,9 +721,14 @@ static u32 usbnet_get_link (struct net_device *net)
        if (dev->driver_info->check_connect)
                return dev->driver_info->check_connect (dev) == 0;
 
+       /* if the device has mii operations, use those */
+       if (dev->mii.mdio_read)
+               return mii_link_ok(&dev->mii);
+
        /* Otherwise, say we're up (to avoid breaking scripts) */
        return 1;
 }
+EXPORT_SYMBOL_GPL(usbnet_get_link);
 
 u32 usbnet_get_msglevel (struct net_device *net)
 {
@@ -710,10 +746,24 @@ void usbnet_set_msglevel (struct net_device *net, u32 level)
 }
 EXPORT_SYMBOL_GPL(usbnet_set_msglevel);
 
+int usbnet_nway_reset(struct net_device *net)
+{
+       struct usbnet *dev = netdev_priv(net);
+
+       if (!dev->mii.mdio_write)
+               return -EOPNOTSUPP;
+
+       return mii_nway_restart(&dev->mii);
+}
+EXPORT_SYMBOL_GPL(usbnet_nway_reset);
+
 /* drivers may override default ethtool_ops in their bind() routine */
 static struct ethtool_ops usbnet_ethtool_ops = {
+       .get_settings           = usbnet_get_settings,
+       .set_settings           = usbnet_set_settings,
        .get_drvinfo            = usbnet_get_drvinfo,
        .get_link               = usbnet_get_link,
+       .nway_reset             = usbnet_nway_reset,
        .get_msglevel           = usbnet_get_msglevel,
        .set_msglevel           = usbnet_set_msglevel,
 };
@@ -1094,6 +1144,7 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
        dev->delay.function = usbnet_bh;
        dev->delay.data = (unsigned long) dev;
        init_timer (&dev->delay);
+       mutex_init (&dev->phy_mutex);
 
        SET_MODULE_OWNER (net);
        dev->net = net;
@@ -1225,7 +1276,7 @@ EXPORT_SYMBOL_GPL(usbnet_resume);
 static int __init usbnet_init(void)
 {
        /* compiler should optimize this out */
-       BUG_ON (sizeof (((struct sk_buff *)0)->cb)
+       BUILD_BUG_ON (sizeof (((struct sk_buff *)0)->cb)
                        < sizeof (struct skb_data));
 
        random_ether_addr(node_id);
index c0746f0454afe277e4d970e81f6f36ea48305b25..07c70abbe0ecaa5c3df76e488239e79e0f7ebbcf 100644 (file)
@@ -30,6 +30,7 @@ struct usbnet {
        struct usb_device       *udev;
        struct driver_info      *driver_info;
        wait_queue_head_t       *wait;
+       struct mutex            phy_mutex;
 
        /* i/o info: pipes etc */
        unsigned                in, out;
@@ -168,9 +169,13 @@ extern void usbnet_defer_kevent (struct usbnet *, int);
 extern void usbnet_skb_return (struct usbnet *, struct sk_buff *);
 extern void usbnet_unlink_rx_urbs(struct usbnet *);
 
+extern int usbnet_get_settings (struct net_device *net, struct ethtool_cmd *cmd);
+extern int usbnet_set_settings (struct net_device *net, struct ethtool_cmd *cmd);
+extern u32 usbnet_get_link (struct net_device *net);
 extern u32 usbnet_get_msglevel (struct net_device *);
 extern void usbnet_set_msglevel (struct net_device *, u32);
 extern void usbnet_get_drvinfo (struct net_device *, struct ethtool_drvinfo *);
+extern int usbnet_nway_reset(struct net_device *net);
 
 /* messaging support includes the interface name, so it must not be
  * used before it has one ... notably, in minidriver bind() calls.
index 5076b9d97057aee810faf064414485eec2f475e9..9a6ec1b5e3d5d1c1eca4dbbb3d70e56eb1ac4361 100644 (file)
@@ -422,6 +422,16 @@ config USB_SERIAL_MCT_U232
          To compile this driver as a module, choose M here: the
          module will be called mct_u232.
 
+config USB_SERIAL_MOS7720
+       tristate "USB Moschip 7720 Single Port Serial Driver"
+       depends on USB_SERIAL
+       ---help---
+         Say Y here if you want to use a USB Serial single port adapter from
+         Moschip Semiconductor Tech.
+
+         To compile this driver as a module, choose M here: the
+         module will be called mos7720.
+
 config USB_SERIAL_MOS7840
        tristate "USB Moschip 7840/7820 USB Serial Driver"
        depends on USB_SERIAL
@@ -527,8 +537,7 @@ config USB_SERIAL_OPTION
          The USB bus on these cards is not accessible externally.
 
          Supported devices include (some of?) those made by:
-         Option, Huawei, Audiovox, Sierra Wireless, Novatel Wireless, or
-         Anydata.
+         Option, Huawei, Audiovox, Novatel Wireless, or Anydata.
 
          To compile this driver as a module, choose M here: the
          module will be called option.
index 8dce83340e3109aa655d84512524f82510fe48cf..a5047dc599bbf738cbbb4a87352bf7bb638f25d3 100644 (file)
@@ -34,6 +34,7 @@ obj-$(CONFIG_USB_SERIAL_KEYSPAN_PDA)          += keyspan_pda.o
 obj-$(CONFIG_USB_SERIAL_KLSI)                  += kl5kusb105.o
 obj-$(CONFIG_USB_SERIAL_KOBIL_SCT)             += kobil_sct.o
 obj-$(CONFIG_USB_SERIAL_MCT_U232)              += mct_u232.o
+obj-$(CONFIG_USB_SERIAL_MOS7720)               += mos7720.o
 obj-$(CONFIG_USB_SERIAL_MOS7840)               += mos7840.o
 obj-$(CONFIG_USB_SERIAL_NAVMAN)                        += navman.o
 obj-$(CONFIG_USB_SERIAL_OMNINET)               += omninet.o
index 2c19f19b255cf48498311c59624f61d72cc1db42..7f5d546da39af963b57123b9b35e58e714a88cd0 100644 (file)
 
 static struct usb_device_id id_table [] = {
        { USB_DEVICE(0x0c88, 0x17da) }, /* Kyocera Wireless KPC650/Passport */
-       { USB_DEVICE(0x0f3d, 0x0112) }, /* AirPrime CDMA Wireless PC Card */
-       { USB_DEVICE(0x1199, 0x0017) }, /* Sierra Wireless EM5625 */
-       { USB_DEVICE(0x1199, 0x0018) }, /* Sierra Wireless MC5720 */
-       { USB_DEVICE(0x1199, 0x0112) }, /* Sierra Wireless Aircard 580 */
-       { USB_DEVICE(0x1199, 0x0218) }, /* Sierra Wireless MC5720 */
        { USB_DEVICE(0x1410, 0x1110) }, /* Novatel Wireless Merlin CDMA */
+       { USB_DEVICE(0x1410, 0x1100) }, /* ExpressCard34 Qualcomm 3G CDMA */
        { },
 };
 MODULE_DEVICE_TABLE(usb, id_table);
@@ -133,6 +129,7 @@ static int airprime_open(struct usb_serial_port *port, struct file *filp)
                }
                urb = usb_alloc_urb(0, GFP_KERNEL);
                if (!urb) {
+                       kfree(buffer);
                        dev_err(&port->dev, "%s - no more urbs?\n",
                                __FUNCTION__);
                        result = -ENOMEM;
index 486c7411b9a7572f3e573e494d2f903cd935e342..bbf6532c26e5328b43ce4abb7a4de319ce86fbb3 100644 (file)
@@ -65,6 +65,7 @@ static struct usb_device_id id_table [] = {
        { USB_DEVICE(0x10C4, 0x813D) }, /* Burnside Telecom Deskmobile */
        { USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */
        { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */
+       { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */
        { USB_DEVICE(0x16D6, 0x0001) }, /* Jablotron serial interface */
        { } /* Terminating Entry */
 };
index d3dc1a15ec6ceacfe985d5b0a4640a34c8cb44c2..bd76b4c11fcc1dc12c3a8515002d7847f179d91e 100644 (file)
@@ -1,16 +1,16 @@
 /*
  * USB FTDI SIO driver
  *
- *     Copyright (C) 1999 - 2001
- *         Greg Kroah-Hartman (greg@kroah.com)
+ *     Copyright (C) 1999 - 2001
+ *         Greg Kroah-Hartman (greg@kroah.com)
  *          Bill Ryder (bryder@sgi.com)
  *     Copyright (C) 2002
  *         Kuba Ober (kuba@mareimbrium.org)
  *
- *     This program is free software; you can redistribute it and/or modify
- *     it under the terms of the GNU General Public License as published by
- *     the Free Software Foundation; either version 2 of the License, or
- *     (at your option) any later version.
+ *     This program is free software; you can redistribute it and/or modify
+ *     it under the terms of the GNU General Public License as published by
+ *     the Free Software Foundation; either version 2 of the License, or
+ *     (at your option) any later version.
  *
  * See Documentation/usb/usb-serial.txt for more information on using this driver
  *
@@ -32,7 +32,7 @@
  *      Changed full name of USB-UIRT device to avoid "/" character.
  *      Added FTDI's alternate PID (0x6006) for FT232/245 devices.
  *      Added PID for "ELV USB Module UO100" from Stefan Frings.
- * 
+ *
  * (21/Oct/2003) Ian Abbott
  *      Renamed some VID/PID macros for Matrix Orbital and Perle Systems
  *      devices.  Removed Matrix Orbital and Perle Systems devices from the
@@ -69,7 +69,7 @@
  *     does not incure any measurable overhead.  This also relies on the fact
  *     that we have proper reference counting logic for urbs.  I nicked this
  *     from Greg KH's Visor driver.
- *      
+ *
  * (23/Jun/2003) Ian Abbott
  *      Reduced flip buffer pushes and corrected a data length test in
  *      ftdi_read_bulk_callback.
@@ -77,7 +77,7 @@
  *
  * (21/Jun/2003) Erik Nygren
  *      Added support for Home Electronics Tira-1 IR transceiver using FT232BM chip.
- *      See <http://www.home-electro.com/tira1.htm>.  Only operates properly 
+ *      See <http://www.home-electro.com/tira1.htm>.  Only operates properly
  *      at 100000 and RTS-CTS, so set custom divisor mode on startup.
  *      Also force the Tira-1 and USB-UIRT to only use their custom baud rates.
  *
  * (17/Feb/2003) Bill Ryder
  *      Added write urb buffer pool on a per device basis
  *      Added more checking for open file on callbacks (fixed OOPS)
- *      Added CrystalFontz 632 and 634 PIDs 
+ *      Added CrystalFontz 632 and 634 PIDs
  *         (thanx to CrystalFontz for the sample devices - they flushed out
  *           some driver bugs)
  *      Minor debugging message changes
  *      Added throttle, unthrottle and chars_in_buffer functions
  *      Fixed FTDI_SIO (the original device) bug
  *      Fixed some shutdown handling
- *      
- * 
- * 
- * 
+ *
+ *
+ *
+ *
  * (07/Jun/2002) Kuba Ober
  *     Changed FTDI_SIO_BASE_BAUD_TO_DIVISOR macro into ftdi_baud_to_divisor
  *     function. It was getting too complex.
  *
  * (25/Jul/2002) Bill Ryder inserted Dmitri's TIOCMIWAIT patch
  *      Not tested by me but it doesn't break anything I use.
- * 
+ *
  * (04/Jan/2002) Kuba Ober
  *     Implemented 38400 baudrate kludge, where it can be substituted with other
  *       values. That's the only way to set custom baudrates.
  *        (the previous version caused panics)
  *     Removed port iteration code since the device only has one I/O port and it
  *       was wrong anyway.
- * 
+ *
  * (31/May/2001) gkh
  *     Switched from using spinlock to a semaphore, which fixes lots of problems.
  *
  *     Cleaned up comments for 8U232
  *     Added parity, framing and overrun error handling
  *     Added receive break handling.
- * 
+ *
  * (04/08/2001) gb
  *     Identify version on module load.
- *       
+ *
  * (18/March/2001) Bill Ryder
  *     (Not released)
  *     Added send break handling. (requires kernel patch too)
  *     Fixed 8U232AM hardware RTS/CTS etc status reporting.
  *     Added flipbuf fix copied from generic device
- * 
+ *
  * (12/3/2000) Bill Ryder
  *     Added support for 8U232AM device.
  *     Moved PID and VIDs into header file only.
  *     Cleaned up comments. Removed multiple PID/VID definitions.
  *     Factorised cts/dtr code
  *     Made use of __FUNCTION__ in dbg's
- *      
+ *
  * (11/01/2000) Adam J. Richter
  *     usb_device_id table support
- * 
+ *
  * (10/05/2000) gkh
  *     Fixed bug with urb->dev not being set properly, now that the usb
  *     core needs it.
- * 
+ *
  * (09/11/2000) gkh
  *     Removed DEBUG #ifdefs with call to usb_serial_debug_data
  *
  *     Added module_init and module_exit functions to handle the fact that this
  *     driver is a loadable module now.
  *
- * (04/04/2000) Bill Ryder 
+ * (04/04/2000) Bill Ryder
  *     Fixed bugs in TCGET/TCSET ioctls (by removing them - they are
  *        handled elsewhere in the tty io driver chain).
  *
- * (03/30/2000) Bill Ryder 
+ * (03/30/2000) Bill Ryder
  *     Implemented lots of ioctls
  *     Fixed a race condition in write
  *     Changed some dbg's to errs
@@ -444,13 +444,13 @@ static struct usb_device_id id_table_combined [] = {
        /* { USB_DEVICE(FTDI_VID, FTDI_ELV_WS300PC_PID) }, */
        /* { USB_DEVICE(FTDI_VID, FTDI_ELV_FHZ1300PC_PID) }, */
        /* { USB_DEVICE(FTDI_VID, FTDI_ELV_WS500_PID) }, */
-       { USB_DEVICE(FTDI_VID, LINX_SDMUSBQSS_PID) },
-       { USB_DEVICE(FTDI_VID, LINX_MASTERDEVEL2_PID) },
-       { USB_DEVICE(FTDI_VID, LINX_FUTURE_0_PID) },
-       { USB_DEVICE(FTDI_VID, LINX_FUTURE_1_PID) },
-       { USB_DEVICE(FTDI_VID, LINX_FUTURE_2_PID) },
-       { USB_DEVICE(FTDI_VID, FTDI_CCSICDU20_0_PID) },
-       { USB_DEVICE(FTDI_VID, FTDI_CCSICDU40_1_PID) },
+       { USB_DEVICE(FTDI_VID, LINX_SDMUSBQSS_PID) },
+       { USB_DEVICE(FTDI_VID, LINX_MASTERDEVEL2_PID) },
+       { USB_DEVICE(FTDI_VID, LINX_FUTURE_0_PID) },
+       { USB_DEVICE(FTDI_VID, LINX_FUTURE_1_PID) },
+       { USB_DEVICE(FTDI_VID, LINX_FUTURE_2_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_CCSICDU20_0_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_CCSICDU40_1_PID) },
        { USB_DEVICE(FTDI_VID, INSIDE_ACCESSO) },
        { USB_DEVICE(INTREPID_VID, INTREPID_VALUECAN_PID) },
        { USB_DEVICE(INTREPID_VID, INTREPID_NEOVI_PID) },
@@ -522,7 +522,7 @@ static struct usb_driver ftdi_driver = {
        .probe =        usb_serial_probe,
        .disconnect =   usb_serial_disconnect,
        .id_table =     id_table_combined,
-       .no_dynamic_id =        1,
+       .no_dynamic_id =        1,
 };
 
 static const char *ftdi_chip_name[] = {
@@ -548,13 +548,13 @@ struct ftdi_private {
        int custom_divisor;     /* custom_divisor kludge, this is for baud_base (different from what goes to the chip!) */
        __u16 last_set_data_urb_value ;
                                /* the last data state set - needed for doing a break */
-        int write_offset;       /* This is the offset in the usb data block to write the serial data - 
+        int write_offset;       /* This is the offset in the usb data block to write the serial data -
                                 * it is different between devices
                                 */
        int flags;              /* some ASYNC_xxxx flags are supported */
        unsigned long last_dtr_rts;     /* saved modem control outputs */
         wait_queue_head_t delta_msr_wait; /* Used for TIOCMIWAIT */
-       char prev_status, diff_status;        /* Used for TIOCMIWAIT */
+       char prev_status, diff_status;        /* Used for TIOCMIWAIT */
        __u8 rx_flags;          /* receive state flags (throttling) */
        spinlock_t rx_lock;     /* spinlock for receive state */
        struct work_struct rx_work;
@@ -721,7 +721,7 @@ static int update_mctrl(struct usb_serial_port *port, unsigned int set, unsigned
                urb_value |= FTDI_SIO_SET_RTS_HIGH;
        rv = usb_control_msg(port->serial->dev,
                               usb_sndctrlpipe(port->serial->dev, 0),
-                              FTDI_SIO_SET_MODEM_CTRL_REQUEST, 
+                              FTDI_SIO_SET_MODEM_CTRL_REQUEST,
                               FTDI_SIO_SET_MODEM_CTRL_REQUEST_TYPE,
                               urb_value, priv->interface,
                               buf, 0, WDR_TIMEOUT);
@@ -768,7 +768,7 @@ static int change_speed(struct usb_serial_port *port)
        if (priv->interface) {  /* FT2232C */
                urb_index = (__u16)((urb_index << 8) | priv->interface);
        }
-       
+
        rv = usb_control_msg(port->serial->dev,
                            usb_sndctrlpipe(port->serial->dev, 0),
                            FTDI_SIO_SET_BAUDRATE_REQUEST,
@@ -827,7 +827,7 @@ static __u32 get_ftdi_divisor(struct usb_serial_port * port)
 
        /* 3. Convert baudrate to device-specific divisor */
 
-       if (!baud) baud = 9600; 
+       if (!baud) baud = 9600;
        switch(priv->chip_type) {
        case SIO: /* SIO chip */
                switch(baud) {
@@ -843,7 +843,7 @@ static __u32 get_ftdi_divisor(struct usb_serial_port * port)
                case 115200: div_value = ftdi_sio_b115200; break;
                } /* baud */
                if (div_value == 0) {
-                       dbg("%s - Baudrate (%d) requested is not supported", __FUNCTION__,  baud);
+                       dbg("%s - Baudrate (%d) requested is not supported", __FUNCTION__,  baud);
                        div_value = ftdi_sio_b9600;
                        div_okay = 0;
                }
@@ -925,7 +925,7 @@ static int set_serial_info(struct usb_serial_port * port, struct serial_struct _
        /* Make the changes - these are privileged changes! */
 
        priv->flags = ((priv->flags & ~ASYNC_FLAGS) |
-                      (new_serial.flags & ASYNC_FLAGS));       
+                      (new_serial.flags & ASYNC_FLAGS));
        priv->custom_divisor = new_serial.custom_divisor;
 
        port->tty->low_latency = (priv->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
@@ -950,7 +950,7 @@ check_and_exit:
             (old_priv.custom_divisor != priv->custom_divisor))) {
                change_speed(port);
        }
-       
+
        return (0);
 
 } /* set_serial_info */
@@ -1022,18 +1022,18 @@ static ssize_t show_latency_timer(struct device *dev, struct device_attribute *a
        struct usb_device *udev;
        unsigned short latency = 0;
        int rv = 0;
-       
+
        udev = to_usb_device(dev);
-       
+
        dbg("%s",__FUNCTION__);
-       
+
        rv = usb_control_msg(udev,
                             usb_rcvctrlpipe(udev, 0),
                             FTDI_SIO_GET_LATENCY_TIMER_REQUEST,
                             FTDI_SIO_GET_LATENCY_TIMER_REQUEST_TYPE,
-                            0, priv->interface, 
+                            0, priv->interface,
                             (char*) &latency, 1, WDR_TIMEOUT);
-       
+
        if (rv < 0) {
                dev_err(dev, "Unable to read latency timer: %i", rv);
                return -EIO;
@@ -1051,23 +1051,23 @@ static ssize_t store_latency_timer(struct device *dev, struct device_attribute *
        char buf[1];
        int v = simple_strtoul(valbuf, NULL, 10);
        int rv = 0;
-       
+
        udev = to_usb_device(dev);
-       
+
        dbg("%s: setting latency timer = %i", __FUNCTION__, v);
-       
+
        rv = usb_control_msg(udev,
                             usb_sndctrlpipe(udev, 0),
                             FTDI_SIO_SET_LATENCY_TIMER_REQUEST,
                             FTDI_SIO_SET_LATENCY_TIMER_REQUEST_TYPE,
-                            v, priv->interface, 
+                            v, priv->interface,
                             buf, 0, WDR_TIMEOUT);
-       
+
        if (rv < 0) {
                dev_err(dev, "Unable to write latency timer: %i", rv);
                return -EIO;
        }
-       
+
        return count;
 }
 
@@ -1082,23 +1082,23 @@ static ssize_t store_event_char(struct device *dev, struct device_attribute *att
        char buf[1];
        int v = simple_strtoul(valbuf, NULL, 10);
        int rv = 0;
-       
+
        udev = to_usb_device(dev);
-       
+
        dbg("%s: setting event char = %i", __FUNCTION__, v);
-       
+
        rv = usb_control_msg(udev,
                             usb_sndctrlpipe(udev, 0),
                             FTDI_SIO_SET_EVENT_CHAR_REQUEST,
                             FTDI_SIO_SET_EVENT_CHAR_REQUEST_TYPE,
-                            v, priv->interface, 
+                            v, priv->interface,
                             buf, 0, WDR_TIMEOUT);
-       
+
        if (rv < 0) {
                dbg("Unable to write event character: %i", rv);
                return -EIO;
        }
-       
+
        return count;
 }
 
@@ -1135,11 +1135,11 @@ static void remove_sysfs_attrs(struct usb_serial *serial)
        struct ftdi_private *priv;
        struct usb_device *udev;
 
-       dbg("%s",__FUNCTION__); 
+       dbg("%s",__FUNCTION__);
 
        priv = usb_get_serial_port_data(serial->port[0]);
        udev = serial->dev;
-       
+
        /* XXX see create_sysfs_attrs */
        if (priv->chip_type != SIO) {
                device_remove_file(&udev->dev, &dev_attr_event_char);
@@ -1147,7 +1147,7 @@ static void remove_sysfs_attrs(struct usb_serial *serial)
                        device_remove_file(&udev->dev, &dev_attr_latency_timer);
                }
        }
-       
+
 }
 
 /*
@@ -1258,7 +1258,7 @@ static void ftdi_HE_TIRA1_setup (struct usb_serial *serial)
 } /* ftdi_HE_TIRA1_setup */
 
 
-/* ftdi_shutdown is called from usbserial:usb_serial_disconnect 
+/* ftdi_shutdown is called from usbserial:usb_serial_disconnect
  *   it is called when the usb device is disconnected
  *
  *   usbserial:usb_serial_disconnect
@@ -1269,16 +1269,16 @@ static void ftdi_HE_TIRA1_setup (struct usb_serial *serial)
 
 static void ftdi_shutdown (struct usb_serial *serial)
 { /* ftdi_shutdown */
-       
+
        struct usb_serial_port *port = serial->port[0];
        struct ftdi_private *priv = usb_get_serial_port_data(port);
 
        dbg("%s", __FUNCTION__);
 
        remove_sysfs_attrs(serial);
-       
-       /* all open ports are closed at this point 
-         *    (by usbserial.c:__serial_close, which calls ftdi_close)  
+
+       /* all open ports are closed at this point
+         *    (by usbserial.c:__serial_close, which calls ftdi_close)
         */
 
        if (priv) {
@@ -1293,7 +1293,7 @@ static int  ftdi_open (struct usb_serial_port *port, struct file *filp)
        struct usb_device *dev = port->serial->dev;
        struct ftdi_private *priv = usb_get_serial_port_data(port);
        unsigned long flags;
-       
+
        int result = 0;
        char buf[1]; /* Needed for the usb_control_msg I think */
 
@@ -1312,8 +1312,8 @@ static int  ftdi_open (struct usb_serial_port *port, struct file *filp)
        /* No error checking for this (will get errors later anyway) */
        /* See ftdi_sio.h for description of what is reset */
        usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
-                       FTDI_SIO_RESET_REQUEST, FTDI_SIO_RESET_REQUEST_TYPE, 
-                       FTDI_SIO_RESET_SIO, 
+                       FTDI_SIO_RESET_REQUEST, FTDI_SIO_RESET_REQUEST_TYPE,
+                       FTDI_SIO_RESET_SIO,
                        priv->interface, buf, 0, WDR_TIMEOUT);
 
        /* Termios defaults are set by usb_serial_init. We don't change
@@ -1350,12 +1350,12 @@ static int  ftdi_open (struct usb_serial_port *port, struct file *filp)
 
 
 
-/* 
+/*
  * usbserial:__serial_close  only calls ftdi_close if the point is open
  *
  *   This only gets called when it is the last close
- *   
- *   
+ *
+ *
  */
 
 static void ftdi_close (struct usb_serial_port *port, struct file *filp)
@@ -1368,14 +1368,14 @@ static void ftdi_close (struct usb_serial_port *port, struct file *filp)
 
        if (c_cflag & HUPCL){
                /* Disable flow control */
-               if (usb_control_msg(port->serial->dev, 
+               if (usb_control_msg(port->serial->dev,
                                    usb_sndctrlpipe(port->serial->dev, 0),
                                    FTDI_SIO_SET_FLOW_CTRL_REQUEST,
                                    FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE,
                                    0, priv->interface, buf, 0,
                                    WDR_TIMEOUT) < 0) {
                        err("error from flowcontrol urb");
-               }           
+               }
 
                /* drop RTS and DTR */
                clear_mctrl(port, TIOCM_DTR | TIOCM_RTS);
@@ -1384,14 +1384,14 @@ static void ftdi_close (struct usb_serial_port *port, struct file *filp)
        /* cancel any scheduled reading */
        cancel_delayed_work(&priv->rx_work);
        flush_scheduled_work();
-       
+
        /* shutdown our bulk read */
        if (port->read_urb)
                usb_kill_urb(port->read_urb);
 } /* ftdi_close */
 
 
-  
+
 /* The SIO requires the first byte to have:
  *  B0 1
  *  B1 0
@@ -1423,7 +1423,7 @@ static int ftdi_write (struct usb_serial_port *port,
                return 0;
        }
        spin_unlock_irqrestore(&priv->tx_lock, flags);
-       
+
        data_offset = priv->write_offset;
         dbg("data_offset set to %d",data_offset);
 
@@ -1462,7 +1462,7 @@ static int ftdi_write (struct usb_serial_port *port,
                                user_pktsz = todo;
                        }
                        /* Write the control byte at the front of the packet*/
-                       *first_byte = 1 | ((user_pktsz) << 2); 
+                       *first_byte = 1 | ((user_pktsz) << 2);
                        /* Copy data for packet */
                        memcpy (first_byte + data_offset,
                                current_position, user_pktsz);
@@ -1479,7 +1479,7 @@ static int ftdi_write (struct usb_serial_port *port,
        usb_serial_debug_data(debug, &port->dev, __FUNCTION__, transfer_size, buffer);
 
        /* fill the buffer and send it */
-       usb_fill_bulk_urb(urb, port->serial->dev, 
+       usb_fill_bulk_urb(urb, port->serial->dev,
                      usb_sndbulkpipe(port->serial->dev, port->bulk_out_endpointAddress),
                      buffer, transfer_size,
                      ftdi_write_bulk_callback, port);
@@ -1520,7 +1520,7 @@ static void ftdi_write_bulk_callback (struct urb *urb)
        kfree (urb->transfer_buffer);
 
        dbg("%s - port %d", __FUNCTION__, port->number);
-       
+
        if (urb->status) {
                dbg("nonzero write bulk status received: %d", urb->status);
                return;
@@ -1651,7 +1651,7 @@ static void ftdi_process_read (void *param)
        struct tty_struct *tty;
        struct ftdi_private *priv;
        char error_flag;
-               unsigned char *data;
+       unsigned char *data;
 
        int i;
        int result;
@@ -1759,7 +1759,7 @@ static void ftdi_process_read (void *param)
                }
                if (length > 0) {
                        for (i = 2; i < length+2; i++) {
-                               /* Note that the error flag is duplicated for 
+                               /* Note that the error flag is duplicated for
                                   every character received since we don't know
                                   which character it applied to */
                                tty_insert_flip_char(tty, data[packet_offset+i], error_flag);
@@ -1773,7 +1773,7 @@ static void ftdi_process_read (void *param)
                   This doesn't work well since the application receives a never
                   ending stream of bad data - even though new data hasn't been sent.
                   Therefore I (bill) have taken this out.
-                  However - this might make sense for framing errors and so on 
+                  However - this might make sense for framing errors and so on
                   so I am leaving the code in for now.
                */
                else {
@@ -1827,7 +1827,7 @@ static void ftdi_process_read (void *param)
        /* if the port is closed stop trying to read */
        if (port->open_count > 0){
                /* Continue trying to always read  */
-               usb_fill_bulk_urb(port->read_urb, port->serial->dev, 
+               usb_fill_bulk_urb(port->read_urb, port->serial->dev,
                              usb_rcvbulkpipe(port->serial->dev, port->bulk_in_endpointAddress),
                              port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length,
                              ftdi_read_bulk_callback, port);
@@ -1844,9 +1844,9 @@ static void ftdi_process_read (void *param)
 static void ftdi_break_ctl( struct usb_serial_port *port, int break_state )
 {
        struct ftdi_private *priv = usb_get_serial_port_data(port);
-       __u16 urb_value = 0; 
+       __u16 urb_value = 0;
        char buf[1];
-       
+
        /* break_state = -1 to turn on break, and 0 to turn off break */
        /* see drivers/char/tty_io.c to see it used */
        /* last_set_data_urb_value NEVER has the break bit set in it */
@@ -1854,20 +1854,20 @@ static void ftdi_break_ctl( struct usb_serial_port *port, int break_state )
        if (break_state) {
                urb_value = priv->last_set_data_urb_value | FTDI_SIO_SET_BREAK;
        } else {
-               urb_value = priv->last_set_data_urb_value; 
+               urb_value = priv->last_set_data_urb_value;
        }
 
-       
+
        if (usb_control_msg(port->serial->dev, usb_sndctrlpipe(port->serial->dev, 0),
-                           FTDI_SIO_SET_DATA_REQUEST, 
+                           FTDI_SIO_SET_DATA_REQUEST,
                            FTDI_SIO_SET_DATA_REQUEST_TYPE,
                            urb_value , priv->interface,
                            buf, 0, WDR_TIMEOUT) < 0) {
                err("%s FAILED to enable/disable break state (state was %d)", __FUNCTION__,break_state);
-       }          
+       }
 
        dbg("%s break state is %d - urb is %d", __FUNCTION__,break_state, urb_value);
-       
+
 }
 
 
@@ -1883,12 +1883,12 @@ static void ftdi_set_termios (struct usb_serial_port *port, struct termios *old_
        struct ftdi_private *priv = usb_get_serial_port_data(port);
        __u16 urb_value; /* will hold the new flags */
        char buf[1]; /* Perhaps I should dynamically alloc this? */
-       
+
        // Added for xon/xoff support
        unsigned int iflag = port->tty->termios->c_iflag;
        unsigned char vstop;
        unsigned char vstart;
-       
+
        dbg("%s", __FUNCTION__);
 
        /* Force baud rate if this device requires it, unless it is set to B0. */
@@ -1906,20 +1906,20 @@ static void ftdi_set_termios (struct usb_serial_port *port, struct termios *old_
 
        cflag = port->tty->termios->c_cflag;
 
-       /* FIXME -For this cut I don't care if the line is really changing or 
-          not  - so just do the change regardless  - should be able to 
+       /* FIXME -For this cut I don't care if the line is really changing or
+          not  - so just do the change regardless  - should be able to
           compare old_termios and tty->termios */
-       /* NOTE These routines can get interrupted by 
-          ftdi_sio_read_bulk_callback  - need to examine what this 
+       /* NOTE These routines can get interrupted by
+          ftdi_sio_read_bulk_callback  - need to examine what this
            means - don't see any problems yet */
-       
+
        /* Set number of data bits, parity, stop bits */
-       
+
        urb_value = 0;
        urb_value |= (cflag & CSTOPB ? FTDI_SIO_SET_DATA_STOP_BITS_2 :
                      FTDI_SIO_SET_DATA_STOP_BITS_1);
-       urb_value |= (cflag & PARENB ? 
-                     (cflag & PARODD ? FTDI_SIO_SET_DATA_PARITY_ODD : 
+       urb_value |= (cflag & PARENB ?
+                     (cflag & PARODD ? FTDI_SIO_SET_DATA_PARITY_ODD :
                       FTDI_SIO_SET_DATA_PARITY_EVEN) :
                      FTDI_SIO_SET_DATA_PARITY_NONE);
        if (cflag & CSIZE) {
@@ -1936,25 +1936,25 @@ static void ftdi_set_termios (struct usb_serial_port *port, struct termios *old_
        /* This is needed by the break command since it uses the same command - but is
         *  or'ed with this value  */
        priv->last_set_data_urb_value = urb_value;
-       
+
        if (usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
-                           FTDI_SIO_SET_DATA_REQUEST, 
+                           FTDI_SIO_SET_DATA_REQUEST,
                            FTDI_SIO_SET_DATA_REQUEST_TYPE,
                            urb_value , priv->interface,
                            buf, 0, WDR_SHORT_TIMEOUT) < 0) {
                err("%s FAILED to set databits/stopbits/parity", __FUNCTION__);
-       }          
+       }
 
        /* Now do the baudrate */
        if ((cflag & CBAUD) == B0 ) {
                /* Disable flow control */
                if (usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
-                                   FTDI_SIO_SET_FLOW_CTRL_REQUEST, 
+                                   FTDI_SIO_SET_FLOW_CTRL_REQUEST,
                                    FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE,
-                                   0, priv->interface, 
+                                   0, priv->interface,
                                    buf, 0, WDR_TIMEOUT) < 0) {
                        err("%s error from disable flowcontrol urb", __FUNCTION__);
-               }           
+               }
                /* Drop RTS and DTR */
                clear_mctrl(port, TIOCM_DTR | TIOCM_RTS);
        } else {
@@ -1972,16 +1972,16 @@ static void ftdi_set_termios (struct usb_serial_port *port, struct termios *old_
        /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */
        if (cflag & CRTSCTS) {
                dbg("%s Setting to CRTSCTS flow control", __FUNCTION__);
-               if (usb_control_msg(dev, 
+               if (usb_control_msg(dev,
                                    usb_sndctrlpipe(dev, 0),
-                                   FTDI_SIO_SET_FLOW_CTRL_REQUEST, 
+                                   FTDI_SIO_SET_FLOW_CTRL_REQUEST,
                                    FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE,
                                    0 , (FTDI_SIO_RTS_CTS_HS | priv->interface),
                                    buf, 0, WDR_TIMEOUT) < 0) {
                        err("urb failed to set to rts/cts flow control");
-               }               
-               
-       } else { 
+               }
+
+       } else {
                /*
                 * Xon/Xoff code
                 *
@@ -2011,16 +2011,16 @@ static void ftdi_set_termios (struct usb_serial_port *port, struct termios *old_
                        /* else clause to only run if cfag ! CRTSCTS and iflag ! XOFF */
                        /* CHECKME Assuming XON/XOFF handled by tty stack - not by device */
                        dbg("%s Turning off hardware flow control", __FUNCTION__);
-                       if (usb_control_msg(dev, 
+                       if (usb_control_msg(dev,
                                            usb_sndctrlpipe(dev, 0),
-                                           FTDI_SIO_SET_FLOW_CTRL_REQUEST, 
+                                           FTDI_SIO_SET_FLOW_CTRL_REQUEST,
                                            FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE,
-                                           0, priv->interface, 
+                                           0, priv->interface,
                                            buf, 0, WDR_TIMEOUT) < 0) {
                                err("urb failed to clear flow control");
-                       }                               
+                       }
                }
-               
+
        }
        return;
 } /* ftdi_termios */
@@ -2036,11 +2036,11 @@ static int ftdi_tiocmget (struct usb_serial_port *port, struct file *file)
        switch (priv->chip_type) {
        case SIO:
                /* Request the status from the device */
-               if ((ret = usb_control_msg(port->serial->dev, 
+               if ((ret = usb_control_msg(port->serial->dev,
                                           usb_rcvctrlpipe(port->serial->dev, 0),
-                                          FTDI_SIO_GET_MODEM_STATUS_REQUEST, 
+                                          FTDI_SIO_GET_MODEM_STATUS_REQUEST,
                                           FTDI_SIO_GET_MODEM_STATUS_REQUEST_TYPE,
-                                          0, 0, 
+                                          0, 0,
                                           buf, 1, WDR_TIMEOUT)) < 0 ) {
                        err("%s Could not get modem status of device - err: %d", __FUNCTION__,
                            ret);
@@ -2052,11 +2052,11 @@ static int ftdi_tiocmget (struct usb_serial_port *port, struct file *file)
        case FT2232C:
                /* the 8U232AM returns a two byte value (the sio is a 1 byte value) - in the same
                   format as the data returned from the in point */
-               if ((ret = usb_control_msg(port->serial->dev, 
+               if ((ret = usb_control_msg(port->serial->dev,
                                           usb_rcvctrlpipe(port->serial->dev, 0),
-                                          FTDI_SIO_GET_MODEM_STATUS_REQUEST, 
+                                          FTDI_SIO_GET_MODEM_STATUS_REQUEST,
                                           FTDI_SIO_GET_MODEM_STATUS_REQUEST_TYPE,
-                                          0, priv->interface, 
+                                          0, priv->interface,
                                           buf, 2, WDR_TIMEOUT)) < 0 ) {
                        err("%s Could not get modem status of device - err: %d", __FUNCTION__,
                            ret);
@@ -2067,12 +2067,12 @@ static int ftdi_tiocmget (struct usb_serial_port *port, struct file *file)
                return -EFAULT;
                break;
        }
-       
+
        return  (buf[0] & FTDI_SIO_DSR_MASK ? TIOCM_DSR : 0) |
                (buf[0] & FTDI_SIO_CTS_MASK ? TIOCM_CTS : 0) |
                (buf[0]  & FTDI_SIO_RI_MASK  ? TIOCM_RI  : 0) |
                (buf[0]  & FTDI_SIO_RLSD_MASK ? TIOCM_CD  : 0) |
-               priv->last_dtr_rts;                     
+               priv->last_dtr_rts;
 }
 
 static int ftdi_tiocmset(struct usb_serial_port *port, struct file * file, unsigned int set, unsigned int clear)
@@ -2138,11 +2138,11 @@ static int ftdi_ioctl (struct usb_serial_port *port, struct file * file, unsigne
                break;
        default:
                break;
-               
+
        }
 
 
-       /* This is not necessarily an error - turns out the higher layers will do 
+       /* This is not necessarily an error - turns out the higher layers will do
         *  some ioctls itself (see comment above)
         */
        dbg("%s arg not supported - it was 0x%04x - check /usr/include/asm/ioctls.h", __FUNCTION__, cmd);
@@ -2199,7 +2199,7 @@ static int __init ftdi_init (void)
        if (retval)
                goto failed_sio_register;
        retval = usb_register(&ftdi_driver);
-       if (retval) 
+       if (retval)
                goto failed_usb_register;
 
        info(DRIVER_VERSION ":" DRIVER_DESC);
diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c
new file mode 100644 (file)
index 0000000..82cd15b
--- /dev/null
@@ -0,0 +1,1683 @@
+/*
+ * mos7720.c
+ *   Controls the Moschip 7720 usb to dual port serial convertor
+ *
+ * Copyright 2006 Moschip Semiconductor Tech. Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, version 2 of the License.
+ *
+ * Developed by:
+ *     VijayaKumar.G.N. <vijaykumar@aspirecom.net>
+ *     AjayKumar <ajay@aspirecom.net>
+ *     Gurudeva.N. <gurudev@aspirecom.net>
+ *
+ * Cleaned up from the original by:
+ *     Greg Kroah-Hartman <gregkh@suse.de>
+ *
+ * Originally based on drivers/usb/serial/io_edgeport.c which is:
+ *     Copyright (C) 2000 Inside Out Networks, All rights reserved.
+ *     Copyright (C) 2001-2002 Greg Kroah-Hartman <greg@kroah.com>
+ */
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/tty.h>
+#include <linux/tty_driver.h>
+#include <linux/tty_flip.h>
+#include <linux/module.h>
+#include <linux/spinlock.h>
+#include <linux/serial.h>
+#include <linux/serial_reg.h>
+#include <linux/usb.h>
+#include <linux/usb/serial.h>
+#include <asm/uaccess.h>
+
+
+/*
+ * Version Information
+ */
+#define DRIVER_VERSION "1.0.0.4F"
+#define DRIVER_AUTHOR "Aspire Communications pvt Ltd."
+#define DRIVER_DESC "Moschip USB Serial Driver"
+
+/* default urb timeout */
+#define MOS_WDR_TIMEOUT        (HZ * 5)
+
+#define MOS_PORT1      0x0200
+#define MOS_PORT2      0x0300
+#define MOS_VENREG     0x0000
+#define MOS_MAX_PORT   0x02
+#define MOS_WRITE      0x0E
+#define MOS_READ       0x0D
+
+/* Interrupt Rotinue Defines   */
+#define SERIAL_IIR_RLS 0x06
+#define SERIAL_IIR_RDA 0x04
+#define SERIAL_IIR_CTI 0x0c
+#define SERIAL_IIR_THR 0x02
+#define SERIAL_IIR_MS  0x00
+
+#define NUM_URBS                       16      /* URB Count */
+#define URB_TRANSFER_BUFFER_SIZE       32      /* URB Size */
+
+/* This structure holds all of the local port information */
+struct moschip_port
+{
+       __u8    shadowLCR;              /* last LCR value received */
+       __u8    shadowMCR;              /* last MCR value received */
+       __u8    shadowMSR;              /* last MSR value received */
+       char                    open;
+       struct async_icount     icount;
+       struct usb_serial_port  *port;  /* loop back to the owner */
+       struct urb              *write_urb_pool[NUM_URBS];
+};
+
+/* This structure holds all of the individual serial device information */
+struct moschip_serial
+{
+       int interrupt_started;
+};
+
+static int debug;
+
+#define USB_VENDOR_ID_MOSCHIP          0x9710
+#define MOSCHIP_DEVICE_ID_7720         0x7720
+#define MOSCHIP_DEVICE_ID_7715         0x7715
+
+static struct usb_device_id moschip_port_id_table [] = {
+       { USB_DEVICE(USB_VENDOR_ID_MOSCHIP,MOSCHIP_DEVICE_ID_7720) },
+       { } /* terminating entry */
+};
+MODULE_DEVICE_TABLE(usb, moschip_port_id_table);
+
+
+/*
+ * mos7720_interrupt_callback
+ *     this is the callback function for when we have received data on the
+ *     interrupt endpoint.
+ */
+static void mos7720_interrupt_callback(struct urb *urb)
+{
+       int result;
+       int length;
+       __u32 *data;
+       unsigned int status;
+       __u8 sp1;
+       __u8 sp2;
+       __u8 st;
+
+       dbg("%s"," : Entering\n");
+
+       if (!urb) {
+               dbg("%s","Invalid Pointer !!!!:\n");
+               return;
+       }
+
+       switch (urb->status) {
+       case 0:
+               /* success */
+               break;
+       case -ECONNRESET:
+       case -ENOENT:
+       case -ESHUTDOWN:
+               /* this urb is terminated, clean up */
+               dbg("%s - urb shutting down with status: %d", __FUNCTION__,
+                   urb->status);
+               return;
+       default:
+               dbg("%s - nonzero urb status received: %d", __FUNCTION__,
+                   urb->status);
+               goto exit;
+       }
+
+       length = urb->actual_length;
+       data = urb->transfer_buffer;
+
+       /* Moschip get 4 bytes
+        * Byte 1 IIR Port 1 (port.number is 0)
+        * Byte 2 IIR Port 2 (port.number is 1)
+        * Byte 3 --------------
+        * Byte 4 FIFO status for both */
+       if (length && length > 4) {
+               dbg("Wrong data !!!");
+               return;
+       }
+
+       status = *data;
+
+       sp1 = (status & 0xff000000)>>24;
+       sp2 = (status & 0x00ff0000)>>16;
+       st = status & 0x000000ff;
+
+       if ((sp1 & 0x01) || (sp2 & 0x01)) {
+               /* No Interrupt Pending in both the ports */
+               dbg("No Interrupt !!!");
+       } else {
+               switch (sp1 & 0x0f) {
+               case SERIAL_IIR_RLS:
+                       dbg("Serial Port 1: Receiver status error or address "
+                           "bit detected in 9-bit mode\n");
+                       break;
+               case SERIAL_IIR_CTI:
+                       dbg("Serial Port 1: Receiver time out");
+                       break;
+               case SERIAL_IIR_MS:
+                       dbg("Serial Port 1: Modem status change");
+                       break;
+               }
+
+               switch (sp2 & 0x0f) {
+               case SERIAL_IIR_RLS:
+                       dbg("Serial Port 2: Receiver status error or address "
+                           "bit detected in 9-bit mode");
+                       break;
+               case SERIAL_IIR_CTI:
+                       dbg("Serial Port 2: Receiver time out");
+                       break;
+               case SERIAL_IIR_MS:
+                       dbg("Serial Port 2: Modem status change");
+                       break;
+               }
+       }
+
+exit:
+       result = usb_submit_urb(urb, GFP_ATOMIC);
+       if (result)
+               dev_err(&urb->dev->dev,
+                       "%s - Error %d submitting control urb\n",
+                       __FUNCTION__, result);
+       return;
+}
+
+/*
+ * mos7720_bulk_in_callback
+ *     this is the callback function for when we have received data on the
+ *     bulk in endpoint.
+ */
+static void mos7720_bulk_in_callback(struct urb *urb)
+{
+       int status;
+       unsigned char *data ;
+       struct usb_serial_port *port;
+       struct moschip_port *mos7720_port;
+       struct tty_struct *tty;
+
+       if (urb->status) {
+               dbg("nonzero read bulk status received: %d",urb->status);
+               return;
+       }
+
+       mos7720_port = urb->context;
+       if (!mos7720_port) {
+               dbg("%s","NULL mos7720_port pointer \n");
+               return ;
+       }
+
+       port = mos7720_port->port;
+
+       dbg("Entering...%s", __FUNCTION__);
+
+       data = urb->transfer_buffer;
+
+       tty = port->tty;
+       if (tty && urb->actual_length) {
+               tty_buffer_request_room(tty, urb->actual_length);
+               tty_insert_flip_string(tty, data, urb->actual_length);
+               tty_flip_buffer_push(tty);
+       }
+
+       if (!port->read_urb) {
+               dbg("URB KILLED !!!");
+               return;
+       }
+
+       if (port->read_urb->status != -EINPROGRESS) {
+               port->read_urb->dev = port->serial->dev;
+
+               status = usb_submit_urb(port->read_urb, GFP_ATOMIC);
+               if (status)
+                       dbg("usb_submit_urb(read bulk) failed, status = %d",
+                           status);
+       }
+}
+
+/*
+ * mos7720_bulk_out_data_callback
+ *     this is the callback function for when we have finished sending serial
+ *     data on the bulk out endpoint.
+ */
+static void mos7720_bulk_out_data_callback(struct urb *urb)
+{
+       struct moschip_port *mos7720_port;
+       struct tty_struct *tty;
+
+       if (urb->status) {
+               dbg("nonzero write bulk status received:%d", urb->status);
+               return;
+       }
+
+       mos7720_port = urb->context;
+       if (!mos7720_port) {
+               dbg("NULL mos7720_port pointer");
+               return ;
+       }
+
+       dbg("Entering .........");
+
+       tty = mos7720_port->port->tty;
+
+       if (tty && mos7720_port->open) {
+               /* let the tty driver wakeup if it has a special *
+                * write_wakeup function */
+               if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
+                    tty->ldisc.write_wakeup)
+                       (tty->ldisc.write_wakeup)(tty);
+
+               /* tell the tty driver that something has changed */
+               wake_up_interruptible(&tty->write_wait);
+       }
+
+       /* schedule_work(&mos7720_port->port->work); */
+}
+
+/*
+ * send_mos_cmd
+ *     this function will be used for sending command to device
+ */
+static int send_mos_cmd(struct usb_serial *serial, __u8 request, __u16 value,
+                       __u16 index, void *data)
+{
+       int status;
+       unsigned int pipe;
+       u16 product = le16_to_cpu(serial->dev->descriptor.idProduct);
+       __u8 requesttype;
+       __u16 size = 0x0000;
+
+       if (value < MOS_MAX_PORT) {
+               if (product == MOSCHIP_DEVICE_ID_7715) {
+                       value = value*0x100+0x100;
+               } else {
+                       value = value*0x100+0x200;
+               }
+       } else {
+               value = 0x0000;
+               if ((product == MOSCHIP_DEVICE_ID_7715) &&
+                   (index != 0x08)) {
+                       dbg("serial->product== MOSCHIP_DEVICE_ID_7715");
+                       //index = 0x01 ;
+               }
+       }
+
+       if (request == MOS_WRITE) {
+               request = (__u8)MOS_WRITE;
+               requesttype = (__u8)0x40;
+               value  = value + (__u16)*((unsigned char *)data);
+               data = NULL;
+               pipe = usb_sndctrlpipe(serial->dev, 0);
+       } else {
+               request = (__u8)MOS_READ;
+               requesttype = (__u8)0xC0;
+               size = 0x01;
+               pipe = usb_rcvctrlpipe(serial->dev,0);
+       }
+
+       status = usb_control_msg(serial->dev, pipe, request, requesttype,
+                                value, index, data, size, MOS_WDR_TIMEOUT);
+
+       if (status < 0)
+               dbg("Command Write failed Value %x index %x\n",value,index);
+
+       return status;
+}
+
+static int mos7720_open(struct usb_serial_port *port, struct file * filp)
+{
+       struct usb_serial *serial;
+       struct usb_serial_port *port0;
+       struct urb *urb;
+       struct moschip_serial *mos7720_serial;
+       struct moschip_port *mos7720_port;
+       int response;
+       int port_number;
+       char data;
+       int j;
+
+       serial = port->serial;
+
+       mos7720_port = usb_get_serial_port_data(port);
+       if (mos7720_port == NULL)
+               return -ENODEV;
+
+       port0 = serial->port[0];
+
+       mos7720_serial = usb_get_serial_data(serial);
+
+       if (mos7720_serial == NULL || port0 == NULL)
+               return -ENODEV;
+
+       usb_clear_halt(serial->dev, port->write_urb->pipe);
+       usb_clear_halt(serial->dev, port->read_urb->pipe);
+
+       /* Initialising the write urb pool */
+       for (j = 0; j < NUM_URBS; ++j) {
+               urb = usb_alloc_urb(0,SLAB_ATOMIC);
+               mos7720_port->write_urb_pool[j] = urb;
+
+               if (urb == NULL) {
+                       err("No more urbs???");
+                       continue;
+               }
+
+               urb->transfer_buffer = kmalloc(URB_TRANSFER_BUFFER_SIZE,
+                                              GFP_KERNEL);
+               if (!urb->transfer_buffer) {
+                       err("%s-out of memory for urb buffers.", __FUNCTION__);
+                       continue;
+               }
+       }
+
+        /* Initialize MCS7720 -- Write Init values to corresponding Registers
+         *
+         * Register Index
+         * 1 : IER
+         * 2 : FCR
+         * 3 : LCR
+         * 4 : MCR
+         *
+         * 0x08 : SP1/2 Control Reg
+         */
+       port_number = port->number - port->serial->minor;
+       send_mos_cmd(port->serial, MOS_READ, port_number, UART_LSR, &data);
+       dbg("SS::%p LSR:%x\n",mos7720_port, data);
+
+       dbg("Check:Sending Command ..........");
+
+       data = 0x02;
+       send_mos_cmd(serial, MOS_WRITE, MOS_MAX_PORT, 0x01, &data);
+       data = 0x02;
+       send_mos_cmd(serial, MOS_WRITE, MOS_MAX_PORT, 0x02, &data);
+
+       data = 0x00;
+       send_mos_cmd(serial, MOS_WRITE, port_number, 0x01, &data);
+       data = 0x00;
+       send_mos_cmd(serial, MOS_WRITE, port_number, 0x02, &data);
+
+       data = 0xCF;
+       send_mos_cmd(serial, MOS_WRITE, port_number, 0x02, &data);
+       data = 0x03;
+        mos7720_port->shadowLCR  = data;
+       send_mos_cmd(serial, MOS_WRITE, port_number, 0x03, &data);
+       data = 0x0b;
+        mos7720_port->shadowMCR  = data;
+       send_mos_cmd(serial, MOS_WRITE, port_number, 0x04, &data);
+       data = 0x0b;
+       send_mos_cmd(serial, MOS_WRITE, port_number, 0x04, &data);
+
+       data = 0x00;
+       send_mos_cmd(serial, MOS_READ, MOS_MAX_PORT, 0x08, &data);
+       data = 0x00;
+       send_mos_cmd(serial, MOS_WRITE, MOS_MAX_PORT, 0x08, &data);
+
+/*     data = 0x00;
+       send_mos_cmd(serial, MOS_READ, MOS_MAX_PORT, port_number + 1, &data);
+       data = 0x03;
+       send_mos_cmd(serial, MOS_WRITE, MOS_MAX_PORT, port_number + 1, &data);
+       data = 0x00;
+       send_mos_cmd(port->serial, MOS_WRITE, MOS_MAX_PORT, port_number + 1, &data);
+*/
+       data = 0x00;
+       send_mos_cmd(serial, MOS_READ, MOS_MAX_PORT, 0x08, &data);
+
+       data = data | (port->number - port->serial->minor + 1);
+       send_mos_cmd(serial, MOS_WRITE, MOS_MAX_PORT, 0x08, &data);
+
+       data = 0x83;
+        mos7720_port->shadowLCR  = data;
+       send_mos_cmd(serial, MOS_WRITE, port_number, 0x03, &data);
+       data = 0x0c;
+       send_mos_cmd(serial, MOS_WRITE, port_number, 0x00, &data);
+       data = 0x00;
+       send_mos_cmd(serial, MOS_WRITE, port_number, 0x01, &data);
+       data = 0x03;
+        mos7720_port->shadowLCR  = data;
+       send_mos_cmd(serial, MOS_WRITE, port_number, 0x03, &data);
+       data = 0x0c;
+       send_mos_cmd(serial, MOS_WRITE, port_number, 0x01, &data);
+       data = 0x0c;
+       send_mos_cmd(serial, MOS_WRITE, port_number, 0x01, &data);
+
+//Matrix
+
+       /* force low_latency on so that our tty_push actually forces *
+        * the data through,otherwise it is scheduled, and with      *
+        * high data rates (like with OHCI) data can get lost.       */
+
+       if (port->tty)
+               port->tty->low_latency = 1;
+
+       /* see if we've set up our endpoint info yet   *
+        * (can't set it up in mos7720_startup as the  *
+        * structures were not set up at that time.)   */
+       if (!mos7720_serial->interrupt_started) {
+               dbg("Interrupt buffer NULL !!!");
+
+               /* not set up yet, so do it now */
+               mos7720_serial->interrupt_started = 1;
+
+               dbg("To Submit URB !!!");
+
+               /* set up our interrupt urb */
+               usb_fill_int_urb(port0->interrupt_in_urb, serial->dev,
+                                usb_rcvintpipe(serial->dev,
+                                               port->interrupt_in_endpointAddress),
+                                port0->interrupt_in_buffer,
+                                port0->interrupt_in_urb->transfer_buffer_length,
+                                mos7720_interrupt_callback, mos7720_port,
+                                port0->interrupt_in_urb->interval);
+
+               /* start interrupt read for this mos7720 this interrupt *
+                * will continue as long as the mos7720 is connected    */
+               dbg("Submit URB over !!!");
+               response = usb_submit_urb(port0->interrupt_in_urb, GFP_KERNEL);
+               if (response)
+                       dev_err(&port->dev,
+                               "%s - Error %d submitting control urb",
+                               __FUNCTION__, response);
+       }
+
+       /* set up our bulk in urb */
+       usb_fill_bulk_urb(port->read_urb, serial->dev,
+                         usb_rcvbulkpipe(serial->dev,
+                                         port->bulk_in_endpointAddress),
+                         port->bulk_in_buffer,
+                         port->read_urb->transfer_buffer_length,
+                         mos7720_bulk_in_callback, mos7720_port);
+       response = usb_submit_urb(port->read_urb, GFP_KERNEL);
+       if (response)
+               dev_err(&port->dev,
+                       "%s - Error %d submitting read urb", __FUNCTION__, response);
+
+       /* initialize our icount structure */
+       memset(&(mos7720_port->icount), 0x00, sizeof(mos7720_port->icount));
+
+       /* initialize our port settings */
+       mos7720_port->shadowMCR = UART_MCR_OUT2; /* Must set to enable ints! */
+
+       /* send a open port command */
+       mos7720_port->open = 1;
+
+       return 0;
+}
+
+/*
+ * mos7720_chars_in_buffer
+ *     this function is called by the tty driver when it wants to know how many
+ *     bytes of data we currently have outstanding in the port (data that has
+ *     been written, but hasn't made it out the port yet)
+ *     If successful, we return the number of bytes left to be written in the
+ *     system,
+ *     Otherwise we return a negative error number.
+ */
+static int mos7720_chars_in_buffer(struct usb_serial_port *port)
+{
+       int i;
+       int chars = 0;
+       struct moschip_port *mos7720_port;
+
+       dbg("%s:entering ...........", __FUNCTION__);
+
+       mos7720_port = usb_get_serial_port_data(port);
+       if (mos7720_port == NULL) {
+               dbg("%s:leaving ...........", __FUNCTION__);
+               return -ENODEV;
+       }
+
+       for (i = 0; i < NUM_URBS; ++i) {
+               if (mos7720_port->write_urb_pool[i]->status == -EINPROGRESS)
+                       chars += URB_TRANSFER_BUFFER_SIZE;
+       }
+       dbg("%s - returns %d", __FUNCTION__, chars);
+       return chars;
+}
+
+static void mos7720_close(struct usb_serial_port *port, struct file *filp)
+{
+       struct usb_serial *serial;
+       struct moschip_port *mos7720_port;
+       char data;
+       int j;
+
+       dbg("mos7720_close:entering...");
+
+       serial = port->serial;
+
+       mos7720_port = usb_get_serial_port_data(port);
+       if (mos7720_port == NULL)
+               return;
+
+       for (j = 0; j < NUM_URBS; ++j)
+               usb_kill_urb(mos7720_port->write_urb_pool[j]);
+
+       /* Freeing Write URBs */
+       for (j = 0; j < NUM_URBS; ++j) {
+               if (mos7720_port->write_urb_pool[j]) {
+                       kfree(mos7720_port->write_urb_pool[j]->transfer_buffer);
+                       usb_free_urb(mos7720_port->write_urb_pool[j]);
+               }
+       }
+
+       /* While closing port, shutdown all bulk read, write  *
+        * and interrupt read if they exists                  */
+       if (serial->dev) {
+               dbg("Shutdown bulk write");
+               usb_kill_urb(port->write_urb);
+               dbg("Shutdown bulk read");
+               usb_kill_urb(port->read_urb);
+       }
+
+       data = 0x00;
+       send_mos_cmd(serial, MOS_WRITE, port->number - port->serial->minor,
+                    0x04, &data);
+
+       data = 0x00;
+       send_mos_cmd(serial, MOS_WRITE, port->number - port->serial->minor,
+                    0x01, &data);
+
+       mos7720_port->open = 0;
+
+       dbg("Leaving %s", __FUNCTION__);
+}
+
+static void mos7720_break(struct usb_serial_port *port, int break_state)
+{
+        unsigned char data;
+       struct usb_serial *serial;
+       struct moschip_port *mos7720_port;
+
+       dbg("Entering %s", __FUNCTION__);
+
+       serial = port->serial;
+
+       mos7720_port = usb_get_serial_port_data(port);
+       if (mos7720_port == NULL)
+               return;
+
+       if (break_state == -1)
+               data = mos7720_port->shadowLCR | UART_LCR_SBC;
+       else
+               data = mos7720_port->shadowLCR & ~UART_LCR_SBC;
+
+       mos7720_port->shadowLCR  = data;
+       send_mos_cmd(serial, MOS_WRITE, port->number - port->serial->minor,
+                    0x03, &data);
+
+       return;
+}
+
+/*
+ * mos7720_write_room
+ *     this function is called by the tty driver when it wants to know how many
+ *     bytes of data we can accept for a specific port.
+ *     If successful, we return the amount of room that we have for this port
+ *     Otherwise we return a negative error number.
+ */
+static int mos7720_write_room(struct usb_serial_port *port)
+{
+       struct moschip_port *mos7720_port;
+       int room = 0;
+       int i;
+
+       dbg("%s:entering ...........", __FUNCTION__);
+
+       mos7720_port = usb_get_serial_port_data(port);
+       if (mos7720_port == NULL) {
+               dbg("%s:leaving ...........", __FUNCTION__);
+               return -ENODEV;
+       }
+
+       for (i = 0; i < NUM_URBS; ++i) {
+               if (mos7720_port->write_urb_pool[i]->status != -EINPROGRESS)
+                       room += URB_TRANSFER_BUFFER_SIZE;
+       }
+
+       dbg("%s - returns %d", __FUNCTION__, room);
+       return room;
+}
+
+static int mos7720_write(struct usb_serial_port *port,
+                        const unsigned char *data, int count)
+{
+       int status;
+       int i;
+       int bytes_sent = 0;
+       int transfer_size;
+
+       struct moschip_port *mos7720_port;
+       struct usb_serial *serial;
+       struct urb    *urb;
+       const unsigned char *current_position = data;
+
+       dbg("%s:entering ...........", __FUNCTION__);
+
+       serial = port->serial;
+
+       mos7720_port = usb_get_serial_port_data(port);
+       if (mos7720_port == NULL) {
+               dbg("mos7720_port is NULL");
+               return -ENODEV;
+       }
+
+       /* try to find a free urb in the list */
+       urb = NULL;
+
+       for (i = 0; i < NUM_URBS; ++i) {
+               if (mos7720_port->write_urb_pool[i]->status != -EINPROGRESS) {
+                       urb = mos7720_port->write_urb_pool[i];
+                       dbg("URB:%d",i);
+                       break;
+               }
+       }
+
+       if (urb == NULL) {
+               dbg("%s - no more free urbs", __FUNCTION__);
+               goto exit;
+       }
+
+       if (urb->transfer_buffer == NULL) {
+               urb->transfer_buffer = kmalloc(URB_TRANSFER_BUFFER_SIZE,
+                                              GFP_KERNEL);
+               if (urb->transfer_buffer == NULL) {
+                       err("%s no more kernel memory...", __FUNCTION__);
+                       goto exit;
+               }
+       }
+       transfer_size = min (count, URB_TRANSFER_BUFFER_SIZE);
+
+       memcpy(urb->transfer_buffer, current_position, transfer_size);
+       usb_serial_debug_data(debug, &port->dev, __FUNCTION__, transfer_size,
+                             urb->transfer_buffer);
+
+       /* fill urb with data and submit  */
+       usb_fill_bulk_urb(urb, serial->dev,
+                         usb_sndbulkpipe(serial->dev,
+                                         port->bulk_out_endpointAddress),
+                         urb->transfer_buffer, transfer_size,
+                         mos7720_bulk_out_data_callback, mos7720_port);
+
+       /* send it down the pipe */
+       status = usb_submit_urb(urb,GFP_ATOMIC);
+       if (status) {
+               err("%s - usb_submit_urb(write bulk) failed with status = %d",
+                   __FUNCTION__, status);
+               bytes_sent = status;
+               goto exit;
+       }
+       bytes_sent = transfer_size;
+
+exit:
+       return bytes_sent;
+}
+
+static void mos7720_throttle(struct usb_serial_port *port)
+{
+       struct moschip_port *mos7720_port;
+       struct tty_struct *tty;
+       int status;
+
+       dbg("%s- port %d\n", __FUNCTION__, port->number);
+
+       mos7720_port = usb_get_serial_port_data(port);
+
+       if (mos7720_port == NULL)
+               return;
+
+       if (!mos7720_port->open) {
+               dbg("port not opened");
+               return;
+       }
+
+       dbg("%s: Entering ..........", __FUNCTION__);
+
+       tty = port->tty;
+       if (!tty) {
+               dbg("%s - no tty available", __FUNCTION__);
+               return;
+       }
+
+       /* if we are implementing XON/XOFF, send the stop character */
+       if (I_IXOFF(tty)) {
+               unsigned char stop_char = STOP_CHAR(tty);
+               status = mos7720_write(port, &stop_char, 1);
+               if (status <= 0)
+                       return;
+       }
+
+       /* if we are implementing RTS/CTS, toggle that line */
+       if (tty->termios->c_cflag & CRTSCTS) {
+               mos7720_port->shadowMCR &= ~UART_MCR_RTS;
+               status = send_mos_cmd(port->serial, MOS_WRITE,
+                                     port->number - port->serial->minor,
+                                     UART_MCR, &mos7720_port->shadowMCR);
+               if (status != 0)
+                       return;
+       }
+}
+
+static void mos7720_unthrottle(struct usb_serial_port *port)
+{
+       struct tty_struct *tty;
+       int status;
+       struct moschip_port *mos7720_port = usb_get_serial_port_data(port);
+
+       if (mos7720_port == NULL)
+               return;
+
+       if (!mos7720_port->open) {
+               dbg("%s - port not opened", __FUNCTION__);
+               return;
+       }
+
+       dbg("%s: Entering ..........", __FUNCTION__);
+
+       tty = port->tty;
+       if (!tty) {
+               dbg("%s - no tty available", __FUNCTION__);
+               return;
+       }
+
+       /* if we are implementing XON/XOFF, send the start character */
+       if (I_IXOFF(tty)) {
+               unsigned char start_char = START_CHAR(tty);
+               status = mos7720_write(port, &start_char, 1);
+               if (status <= 0)
+                       return;
+       }
+
+       /* if we are implementing RTS/CTS, toggle that line */
+       if (tty->termios->c_cflag & CRTSCTS) {
+               mos7720_port->shadowMCR |= UART_MCR_RTS;
+               status = send_mos_cmd(port->serial, MOS_WRITE,
+                                     port->number - port->serial->minor,
+                                     UART_MCR, &mos7720_port->shadowMCR);
+               if (status != 0)
+                       return;
+       }
+}
+
+static int set_higher_rates(struct moschip_port *mos7720_port,
+                           unsigned int baud)
+{
+       unsigned char data;
+       struct usb_serial_port *port;
+       struct usb_serial *serial;
+       int port_number;
+
+       if (mos7720_port == NULL)
+               return -EINVAL;
+
+       port = mos7720_port->port;
+       serial = port->serial;
+
+        /***********************************************
+         *      Init Sequence for higher rates
+         ***********************************************/
+       dbg("Sending Setting Commands ..........");
+       port_number = port->number - port->serial->minor;
+
+       data = 0x000;
+       send_mos_cmd(serial, MOS_WRITE, port_number, 0x01, &data);
+       data = 0x000;
+       send_mos_cmd(serial, MOS_WRITE, port_number, 0x02, &data);
+       data = 0x0CF;
+       send_mos_cmd(serial, MOS_WRITE, port->number, 0x02, &data);
+       data = 0x00b;
+        mos7720_port->shadowMCR  = data;
+       send_mos_cmd(serial, MOS_WRITE, port_number, 0x04, &data);
+       data = 0x00b;
+       send_mos_cmd(serial, MOS_WRITE, port_number, 0x04, &data);
+
+       data = 0x000;
+       send_mos_cmd(serial, MOS_READ, MOS_MAX_PORT, 0x08, &data);
+       data = 0x000;
+       send_mos_cmd(serial, MOS_WRITE, MOS_MAX_PORT, 0x08, &data);
+
+
+        /***********************************************
+         *              Set for higher rates           *
+         ***********************************************/
+
+       data = baud * 0x10;
+       send_mos_cmd(serial, MOS_WRITE, MOS_MAX_PORT, port_number + 1,&data);
+
+       data = 0x003;
+       send_mos_cmd(serial, MOS_READ, MOS_MAX_PORT, 0x08, &data);
+       data = 0x003;
+       send_mos_cmd(serial, MOS_WRITE, MOS_MAX_PORT, 0x08, &data);
+
+       data = 0x02b;
+        mos7720_port->shadowMCR  = data;
+       send_mos_cmd(serial, MOS_WRITE, port_number, 0x04, &data);
+       data = 0x02b;
+       send_mos_cmd(serial, MOS_WRITE, port_number, 0x04, &data);
+
+        /***********************************************
+         *              Set DLL/DLM
+         ***********************************************/
+
+       data = mos7720_port->shadowLCR | UART_LCR_DLAB;
+        mos7720_port->shadowLCR  = data;
+       send_mos_cmd(serial, MOS_WRITE, port_number, 0x03, &data);
+
+       data =  0x001; /* DLL */
+        send_mos_cmd(serial, MOS_WRITE, port_number, 0x00, &data);
+       data =  0x000; /* DLM */
+        send_mos_cmd(serial, MOS_WRITE, port_number, 0x01, &data);
+
+       data = mos7720_port->shadowLCR & ~UART_LCR_DLAB;
+        mos7720_port->shadowLCR  = data;
+       send_mos_cmd(serial, MOS_WRITE, port_number, 0x03, &data);
+
+       return 0;
+}
+
+/* baud rate information */
+struct divisor_table_entry
+{
+       __u32  baudrate;
+       __u16  divisor;
+};
+
+/* Define table of divisors for moschip 7720 hardware     *
+ * These assume a 3.6864MHz crystal, the standard /16, and *
+ * MCR.7 = 0.                                             */
+static struct divisor_table_entry divisor_table[] = {
+       {   50,         2304},
+       {   110,        1047},  /* 2094.545455 => 230450   => .0217 % over */
+       {   134,        857},   /* 1713.011152 => 230398.5 => .00065% under */
+       {   150,        768},
+       {   300,        384},
+       {   600,        192},
+       {   1200,       96},
+       {   1800,       64},
+       {   2400,       48},
+       {   4800,       24},
+       {   7200,       16},
+       {   9600,       12},
+       {   19200,      6},
+       {   38400,      3},
+       {   57600,      2},
+       {   115200,     1},
+};
+
+/*****************************************************************************
+ * calc_baud_rate_divisor
+ *     this function calculates the proper baud rate divisor for the specified
+ *     baud rate.
+ *****************************************************************************/
+static int calc_baud_rate_divisor(int baudrate, int *divisor)
+{
+       int i;
+       __u16 custom;
+       __u16 round1;
+       __u16 round;
+
+
+       dbg("%s - %d", __FUNCTION__, baudrate);
+
+       for (i = 0; i < ARRAY_SIZE(divisor_table); i++) {
+               if (divisor_table[i].baudrate == baudrate) {
+                       *divisor = divisor_table[i].divisor;
+                       return 0;
+               }
+       }
+
+        /* After trying for all the standard baud rates    *
+         * Try calculating the divisor for this baud rate  */
+       if (baudrate > 75 &&  baudrate < 230400) {
+               /* get the divisor */
+               custom = (__u16)(230400L  / baudrate);
+
+               /* Check for round off */
+               round1 = (__u16)(2304000L / baudrate);
+               round = (__u16)(round1 - (custom * 10));
+               if (round > 4)
+                       custom++;
+               *divisor = custom;
+
+               dbg("Baud %d = %d",baudrate, custom);
+               return 0;
+       }
+
+       dbg("Baud calculation Failed...");
+       return -EINVAL;
+}
+
+/*
+ * send_cmd_write_baud_rate
+ *     this function sends the proper command to change the baud rate of the
+ *     specified port.
+ */
+static int send_cmd_write_baud_rate(struct moschip_port *mos7720_port,
+                                   int baudrate)
+{
+       struct usb_serial_port *port;
+       struct usb_serial *serial;
+       int divisor;
+       int status;
+       unsigned char data;
+       unsigned char number;
+
+       if (mos7720_port == NULL)
+               return -1;
+
+       port = mos7720_port->port;
+       serial = port->serial;
+
+       dbg("%s: Entering ..........", __FUNCTION__);
+
+       number = port->number - port->serial->minor;
+       dbg("%s - port = %d, baud = %d", __FUNCTION__, port->number, baudrate);
+
+        /* Calculate the Divisor */
+       status = calc_baud_rate_divisor(baudrate, &divisor);
+       if (status) {
+               err("%s - bad baud rate", __FUNCTION__);
+               return status;
+       }
+
+        /* Enable access to divisor latch */
+        data = mos7720_port->shadowLCR | UART_LCR_DLAB;
+        mos7720_port->shadowLCR  = data;
+        send_mos_cmd(serial, MOS_WRITE, number, UART_LCR, &data);
+
+       /* Write the divisor */
+       data = ((unsigned char)(divisor & 0xff));
+        send_mos_cmd(serial, MOS_WRITE, number, 0x00, &data);
+
+       data = ((unsigned char)((divisor & 0xff00) >> 8));
+        send_mos_cmd(serial, MOS_WRITE, number, 0x01, &data);
+
+        /* Disable access to divisor latch */
+        data = mos7720_port->shadowLCR & ~UART_LCR_DLAB;
+        mos7720_port->shadowLCR = data;
+        send_mos_cmd(serial, MOS_WRITE, number, 0x03, &data);
+
+       return status;
+}
+
+/*
+ * change_port_settings
+ *     This routine is called to set the UART on the device to match
+ *      the specified new settings.
+ */
+static void change_port_settings(struct moschip_port *mos7720_port,
+                                struct termios *old_termios)
+{
+       struct usb_serial_port *port;
+       struct usb_serial *serial;
+       struct tty_struct *tty;
+       int baud;
+       unsigned cflag;
+       unsigned iflag;
+       __u8 mask = 0xff;
+       __u8 lData;
+       __u8 lParity;
+       __u8 lStop;
+       int status;
+       int port_number;
+       char data;
+
+       if (mos7720_port == NULL)
+               return ;
+
+       port = mos7720_port->port;
+       serial = port->serial;
+       port_number = port->number - port->serial->minor;
+
+       dbg("%s - port %d", __FUNCTION__, port->number);
+
+       if (!mos7720_port->open) {
+               dbg("%s - port not opened", __FUNCTION__);
+               return;
+       }
+
+       tty = mos7720_port->port->tty;
+
+       if ((!tty) || (!tty->termios)) {
+               dbg("%s - no tty structures", __FUNCTION__);
+               return;
+       }
+
+       dbg("%s: Entering ..........", __FUNCTION__);
+
+       lData = UART_LCR_WLEN8;
+       lStop = 0x00;   /* 1 stop bit */
+       lParity = 0x00; /* No parity */
+
+       cflag = tty->termios->c_cflag;
+       iflag = tty->termios->c_iflag;
+
+       /* Change the number of bits */
+       switch (cflag & CSIZE) {
+       case CS5:
+               lData = UART_LCR_WLEN5;
+               mask = 0x1f;
+               break;
+
+       case CS6:
+               lData = UART_LCR_WLEN6;
+               mask = 0x3f;
+               break;
+
+       case CS7:
+               lData = UART_LCR_WLEN7;
+               mask = 0x7f;
+               break;
+       default:
+       case CS8:
+               lData = UART_LCR_WLEN8;
+               break;
+       }
+
+       /* Change the Parity bit */
+       if (cflag & PARENB) {
+               if (cflag & PARODD) {
+                       lParity = UART_LCR_PARITY;
+                       dbg("%s - parity = odd", __FUNCTION__);
+               } else {
+                       lParity = (UART_LCR_EPAR | UART_LCR_PARITY);
+                       dbg("%s - parity = even", __FUNCTION__);
+               }
+
+       } else {
+               dbg("%s - parity = none", __FUNCTION__);
+       }
+
+       if (cflag & CMSPAR)
+               lParity = lParity | 0x20;
+
+       /* Change the Stop bit */
+       if (cflag & CSTOPB) {
+               lStop = UART_LCR_STOP;
+               dbg("%s - stop bits = 2", __FUNCTION__);
+       } else {
+               lStop = 0x00;
+               dbg("%s - stop bits = 1", __FUNCTION__);
+       }
+
+#define LCR_BITS_MASK          0x03    /* Mask for bits/char field */
+#define LCR_STOP_MASK          0x04    /* Mask for stop bits field */
+#define LCR_PAR_MASK           0x38    /* Mask for parity field */
+
+       /* Update the LCR with the correct value */
+       mos7720_port->shadowLCR &= ~(LCR_BITS_MASK | LCR_STOP_MASK | LCR_PAR_MASK);
+       mos7720_port->shadowLCR |= (lData | lParity | lStop);
+
+
+       /* Disable Interrupts */
+       data = 0x00;
+        send_mos_cmd(serial,MOS_WRITE,port->number - port->serial->minor, UART_IER, &data);
+
+       data = 0x00;
+        send_mos_cmd(serial, MOS_WRITE, port_number, UART_FCR, &data);
+
+       data = 0xcf;
+        send_mos_cmd(serial, MOS_WRITE, port_number, UART_FCR, &data);
+
+       /* Send the updated LCR value to the mos7720 */
+       data = mos7720_port->shadowLCR;
+        send_mos_cmd(serial, MOS_WRITE, port_number, UART_LCR, &data);
+
+        data = 0x00b;
+        mos7720_port->shadowMCR = data;
+        send_mos_cmd(serial, MOS_WRITE, port_number, 0x04, &data);
+        data = 0x00b;
+        send_mos_cmd(serial, MOS_WRITE, port_number, 0x04, &data);
+
+       /* set up the MCR register and send it to the mos7720 */
+       mos7720_port->shadowMCR = UART_MCR_OUT2;
+       if (cflag & CBAUD)
+               mos7720_port->shadowMCR |= (UART_MCR_DTR | UART_MCR_RTS);
+
+       if (cflag & CRTSCTS) {
+               mos7720_port->shadowMCR |= (UART_MCR_XONANY);
+
+                /* To set hardware flow control to the specified *
+                 * serial port, in SP1/2_CONTROL_REG             */
+               if (port->number) {
+                       data = 0x001;
+                       send_mos_cmd(serial, MOS_WRITE, MOS_MAX_PORT,
+                                    0x08, &data);
+               } else {
+                       data = 0x002;
+                       send_mos_cmd(serial, MOS_WRITE, MOS_MAX_PORT,
+                                    0x08, &data);
+               }
+       } else {
+               mos7720_port->shadowMCR &= ~(UART_MCR_XONANY);
+       }
+
+       data = mos7720_port->shadowMCR;
+       send_mos_cmd(serial, MOS_WRITE, port_number, UART_MCR, &data);
+
+       /* Determine divisor based on baud rate */
+       baud = tty_get_baud_rate(tty);
+       if (!baud) {
+               /* pick a default, any default... */
+               dbg("Picked default baud...");
+               baud = 9600;
+       }
+
+       if (baud >= 230400) {
+               set_higher_rates(mos7720_port, baud);
+               /* Enable Interrupts */
+               data = 0x0c;
+               send_mos_cmd(serial, MOS_WRITE, port_number, UART_IER, &data);
+               return;
+       }
+
+       dbg("%s - baud rate = %d", __FUNCTION__, baud);
+       status = send_cmd_write_baud_rate(mos7720_port, baud);
+
+       /* Enable Interrupts */
+       data = 0x0c;
+       send_mos_cmd(serial, MOS_WRITE, port_number, UART_IER, &data);
+
+       if (port->read_urb->status != -EINPROGRESS) {
+               port->read_urb->dev = serial->dev;
+
+               status = usb_submit_urb(port->read_urb, GFP_ATOMIC);
+               if (status)
+                       dbg("usb_submit_urb(read bulk) failed, status = %d",
+                           status);
+       }
+       return;
+}
+
+/*
+ * mos7720_set_termios
+ *     this function is called by the tty driver when it wants to change the
+ *     termios structure.
+ */
+static void mos7720_set_termios(struct usb_serial_port *port,
+                               struct termios *old_termios)
+{
+       int status;
+       unsigned int cflag;
+       struct usb_serial *serial;
+       struct moschip_port *mos7720_port;
+       struct tty_struct *tty;
+
+       serial = port->serial;
+
+       mos7720_port = usb_get_serial_port_data(port);
+
+       if (mos7720_port == NULL)
+               return;
+
+       tty = port->tty;
+
+       if (!port->tty || !port->tty->termios) {
+               dbg("%s - no tty or termios", __FUNCTION__);
+               return;
+       }
+
+       if (!mos7720_port->open) {
+               dbg("%s - port not opened", __FUNCTION__);
+               return;
+       }
+
+       dbg("%s\n","setting termios - ASPIRE");
+
+       cflag = tty->termios->c_cflag;
+
+       if (!cflag) {
+               printk("%s %s\n",__FUNCTION__,"cflag is NULL");
+               return;
+       }
+
+       /* check that they really want us to change something */
+       if (old_termios) {
+               if ((cflag == old_termios->c_cflag) &&
+                   (RELEVANT_IFLAG(tty->termios->c_iflag) ==
+                    RELEVANT_IFLAG(old_termios->c_iflag))) {
+                       dbg("Nothing to change");
+                       return;
+               }
+       }
+
+       dbg("%s - clfag %08x iflag %08x", __FUNCTION__,
+           tty->termios->c_cflag,
+           RELEVANT_IFLAG(tty->termios->c_iflag));
+
+       if (old_termios)
+               dbg("%s - old clfag %08x old iflag %08x", __FUNCTION__,
+                   old_termios->c_cflag,
+                   RELEVANT_IFLAG(old_termios->c_iflag));
+
+       dbg("%s - port %d", __FUNCTION__, port->number);
+
+       /* change the port settings to the new ones specified */
+       change_port_settings(mos7720_port, old_termios);
+
+       if(!port->read_urb) {
+               dbg("%s","URB KILLED !!!!!\n");
+               return;
+       }
+
+       if(port->read_urb->status != -EINPROGRESS) {
+               port->read_urb->dev = serial->dev;
+               status = usb_submit_urb(port->read_urb, GFP_ATOMIC);
+               if (status)
+                       dbg("usb_submit_urb(read bulk) failed, status = %d",
+                           status);
+       }
+       return;
+}
+
+/*
+ * get_lsr_info - get line status register info
+ *
+ * Purpose: Let user call ioctl() to get info when the UART physically
+ *         is emptied.  On bus types like RS485, the transmitter must
+ *         release the bus after transmitting. This must be done when
+ *         the transmit shift register is empty, not be done when the
+ *         transmit holding register is empty.  This functionality
+ *         allows an RS485 driver to be written in user space.
+ */
+static int get_lsr_info(struct moschip_port *mos7720_port,
+                       unsigned int __user *value)
+{
+       int count;
+       unsigned int result = 0;
+
+       count = mos7720_chars_in_buffer(mos7720_port->port);
+       if (count == 0) {
+               dbg("%s -- Empty", __FUNCTION__);
+               result = TIOCSER_TEMT;
+       }
+
+       if (copy_to_user(value, &result, sizeof(int)))
+               return -EFAULT;
+       return 0;
+}
+
+/*
+ * get_number_bytes_avail - get number of bytes available
+ *
+ * Purpose: Let user call ioctl to get the count of number of bytes available.
+ */
+static int get_number_bytes_avail(struct moschip_port *mos7720_port,
+                                 unsigned int __user *value)
+{
+       unsigned int result = 0;
+       struct tty_struct *tty = mos7720_port->port->tty;
+
+       if (!tty)
+               return -ENOIOCTLCMD;
+
+       result = tty->read_cnt;
+
+       dbg("%s(%d) = %d", __FUNCTION__,  mos7720_port->port->number, result);
+       if (copy_to_user(value, &result, sizeof(int)))
+               return -EFAULT;
+
+       return -ENOIOCTLCMD;
+}
+
+static int set_modem_info(struct moschip_port *mos7720_port, unsigned int cmd,
+                         unsigned int __user *value)
+{
+       unsigned int mcr ;
+       unsigned int arg;
+       unsigned char data;
+
+       struct usb_serial_port *port;
+
+       if (mos7720_port == NULL)
+               return -1;
+
+       port = (struct usb_serial_port*)mos7720_port->port;
+       mcr = mos7720_port->shadowMCR;
+
+       if (copy_from_user(&arg, value, sizeof(int)))
+               return -EFAULT;
+
+       switch (cmd) {
+       case TIOCMBIS:
+               if (arg & TIOCM_RTS)
+                       mcr |= UART_MCR_RTS;
+               if (arg & TIOCM_DTR)
+                       mcr |= UART_MCR_RTS;
+               if (arg & TIOCM_LOOP)
+                       mcr |= UART_MCR_LOOP;
+               break;
+
+       case TIOCMBIC:
+               if (arg & TIOCM_RTS)
+                       mcr &= ~UART_MCR_RTS;
+               if (arg & TIOCM_DTR)
+                       mcr &= ~UART_MCR_RTS;
+               if (arg & TIOCM_LOOP)
+                       mcr &= ~UART_MCR_LOOP;
+               break;
+
+       case TIOCMSET:
+               /* turn off the RTS and DTR and LOOPBACK
+                * and then only turn on what was asked to */
+               mcr &=  ~(UART_MCR_RTS | UART_MCR_DTR | UART_MCR_LOOP);
+               mcr |= ((arg & TIOCM_RTS) ? UART_MCR_RTS : 0);
+               mcr |= ((arg & TIOCM_DTR) ? UART_MCR_DTR : 0);
+               mcr |= ((arg & TIOCM_LOOP) ? UART_MCR_LOOP : 0);
+               break;
+       }
+
+       mos7720_port->shadowMCR = mcr;
+
+       data = mos7720_port->shadowMCR;
+       send_mos_cmd(port->serial, MOS_WRITE,
+                    port->number - port->serial->minor, UART_MCR, &data);
+
+       return 0;
+}
+
+static int get_modem_info(struct moschip_port *mos7720_port,
+                         unsigned int __user *value)
+{
+       unsigned int result = 0;
+       unsigned int msr = mos7720_port->shadowMSR;
+       unsigned int mcr = mos7720_port->shadowMCR;
+
+       result = ((mcr & UART_MCR_DTR)  ? TIOCM_DTR: 0)   /* 0x002 */
+                 | ((mcr & UART_MCR_RTS)       ? TIOCM_RTS: 0)   /* 0x004 */
+                 | ((msr & UART_MSR_CTS)       ? TIOCM_CTS: 0)   /* 0x020 */
+                 | ((msr & UART_MSR_DCD)       ? TIOCM_CAR: 0)   /* 0x040 */
+                 | ((msr & UART_MSR_RI)        ? TIOCM_RI:  0)   /* 0x080 */
+                 | ((msr & UART_MSR_DSR)       ? TIOCM_DSR: 0);  /* 0x100 */
+
+
+       dbg("%s -- %x", __FUNCTION__, result);
+
+       if (copy_to_user(value, &result, sizeof(int)))
+               return -EFAULT;
+       return 0;
+}
+
+static int get_serial_info(struct moschip_port *mos7720_port,
+                          struct serial_struct __user *retinfo)
+{
+       struct serial_struct tmp;
+
+       if (!retinfo)
+               return -EFAULT;
+
+       memset(&tmp, 0, sizeof(tmp));
+
+       tmp.type                = PORT_16550A;
+       tmp.line                = mos7720_port->port->serial->minor;
+       tmp.port                = mos7720_port->port->number;
+       tmp.irq                 = 0;
+       tmp.flags               = ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ;
+        tmp.xmit_fifo_size     = NUM_URBS * URB_TRANSFER_BUFFER_SIZE;
+       tmp.baud_base           = 9600;
+       tmp.close_delay         = 5*HZ;
+       tmp.closing_wait        = 30*HZ;
+
+       if (copy_to_user(retinfo, &tmp, sizeof(*retinfo)))
+               return -EFAULT;
+       return 0;
+}
+
+static int mos7720_ioctl(struct usb_serial_port *port, struct file *file,
+                        unsigned int cmd, unsigned long arg)
+{
+       struct moschip_port *mos7720_port;
+       struct async_icount cnow;
+       struct async_icount cprev;
+       struct serial_icounter_struct icount;
+
+       mos7720_port = usb_get_serial_port_data(port);
+       if (mos7720_port == NULL)
+               return -ENODEV;
+
+       dbg("%s - port %d, cmd = 0x%x", __FUNCTION__, port->number, cmd);
+
+       switch (cmd) {
+       case TIOCINQ:
+               /* return number of bytes available */
+               dbg("%s (%d) TIOCINQ", __FUNCTION__,  port->number);
+               return get_number_bytes_avail(mos7720_port,
+                                             (unsigned int __user *)arg);
+               break;
+
+       case TIOCSERGETLSR:
+               dbg("%s (%d) TIOCSERGETLSR", __FUNCTION__,  port->number);
+               return get_lsr_info(mos7720_port, (unsigned int __user *)arg);
+               return 0;
+
+       case TIOCMBIS:
+       case TIOCMBIC:
+       case TIOCMSET:
+               dbg("%s (%d) TIOCMSET/TIOCMBIC/TIOCMSET", __FUNCTION__,
+                   port->number);
+               return set_modem_info(mos7720_port, cmd,
+                                     (unsigned int __user *)arg);
+
+       case TIOCMGET:
+               dbg("%s (%d) TIOCMGET", __FUNCTION__,  port->number);
+               return get_modem_info(mos7720_port,
+                                     (unsigned int __user *)arg);
+
+       case TIOCGSERIAL:
+               dbg("%s (%d) TIOCGSERIAL", __FUNCTION__,  port->number);
+               return get_serial_info(mos7720_port,
+                                      (struct serial_struct __user *)arg);
+
+       case TIOCSSERIAL:
+               dbg("%s (%d) TIOCSSERIAL", __FUNCTION__,  port->number);
+               break;
+
+       case TIOCMIWAIT:
+               dbg("%s (%d) TIOCMIWAIT", __FUNCTION__,  port->number);
+               cprev = mos7720_port->icount;
+               while (1) {
+                       if (signal_pending(current))
+                               return -ERESTARTSYS;
+                       cnow = mos7720_port->icount;
+                       if (cnow.rng == cprev.rng && cnow.dsr == cprev.dsr &&
+                           cnow.dcd == cprev.dcd && cnow.cts == cprev.cts)
+                               return -EIO; /* no change => error */
+                       if (((arg & TIOCM_RNG) && (cnow.rng != cprev.rng)) ||
+                           ((arg & TIOCM_DSR) && (cnow.dsr != cprev.dsr)) ||
+                           ((arg & TIOCM_CD)  && (cnow.dcd != cprev.dcd)) ||
+                           ((arg & TIOCM_CTS) && (cnow.cts != cprev.cts)) ) {
+                               return 0;
+                       }
+                       cprev = cnow;
+               }
+               /* NOTREACHED */
+               break;
+
+       case TIOCGICOUNT:
+               cnow = mos7720_port->icount;
+               icount.cts = cnow.cts;
+               icount.dsr = cnow.dsr;
+               icount.rng = cnow.rng;
+               icount.dcd = cnow.dcd;
+               icount.rx = cnow.rx;
+               icount.tx = cnow.tx;
+               icount.frame = cnow.frame;
+               icount.overrun = cnow.overrun;
+               icount.parity = cnow.parity;
+               icount.brk = cnow.brk;
+               icount.buf_overrun = cnow.buf_overrun;
+
+               dbg("%s (%d) TIOCGICOUNT RX=%d, TX=%d", __FUNCTION__,
+                   port->number, icount.rx, icount.tx );
+               if (copy_to_user((void __user *)arg, &icount, sizeof(icount)))
+                       return -EFAULT;
+               return 0;
+       }
+
+       return -ENOIOCTLCMD;
+}
+
+static int mos7720_startup(struct usb_serial *serial)
+{
+       struct moschip_serial *mos7720_serial;
+       struct moschip_port *mos7720_port;
+       struct usb_device *dev;
+       int i;
+       char data;
+
+       dbg("%s: Entering ..........", __FUNCTION__);
+
+       if (!serial) {
+               dbg("Invalid Handler");
+               return -ENODEV;
+       }
+
+       dev = serial->dev;
+
+       /* create our private serial structure */
+       mos7720_serial = kzalloc(sizeof(struct moschip_serial), GFP_KERNEL);
+       if (mos7720_serial == NULL) {
+               err("%s - Out of memory", __FUNCTION__);
+               return -ENOMEM;
+       }
+
+       usb_set_serial_data(serial, mos7720_serial);
+
+       /* we set up the pointers to the endpoints in the mos7720_open *
+        * function, as the structures aren't created yet.             */
+
+       /* set up port private structures */
+       for (i = 0; i < serial->num_ports; ++i) {
+               mos7720_port = kzalloc(sizeof(struct moschip_port), GFP_KERNEL);
+               if (mos7720_port == NULL) {
+                       err("%s - Out of memory", __FUNCTION__);
+                       usb_set_serial_data(serial, NULL);
+                       kfree(mos7720_serial);
+                       return -ENOMEM;
+               }
+
+               /* Initialize all port interrupt end point to port 0 int
+                * endpoint.  Our device has only one interrupt endpoint
+                * comman to all ports */
+               serial->port[i]->interrupt_in_endpointAddress = serial->port[0]->interrupt_in_endpointAddress;
+
+               mos7720_port->port = serial->port[i];
+               usb_set_serial_port_data(serial->port[i], mos7720_port);
+
+               dbg("port number is %d", serial->port[i]->number);
+               dbg("serial number is %d", serial->minor);
+       }
+
+
+       /* setting configuration feature to one */
+       usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
+                       (__u8)0x03, 0x00,0x01,0x00, NULL, 0x00, 5*HZ);
+
+       send_mos_cmd(serial,MOS_READ,0x00, UART_LSR, &data);  // LSR For Port 1
+       dbg("LSR:%x",data);
+
+       send_mos_cmd(serial,MOS_READ,0x01, UART_LSR, &data);  // LSR For Port 2
+       dbg("LSR:%x",data);
+
+       return 0;
+}
+
+static void mos7720_shutdown(struct usb_serial *serial)
+{
+       int i;
+
+       /* free private structure allocated for serial port */
+       for (i=0; i < serial->num_ports; ++i) {
+               kfree(usb_get_serial_port_data(serial->port[i]));
+               usb_set_serial_port_data(serial->port[i], NULL);
+       }
+
+       /* free private structure allocated for serial device */
+       kfree(usb_get_serial_data(serial));
+       usb_set_serial_data(serial, NULL);
+}
+
+static struct usb_serial_driver moschip7720_2port_driver = {
+       .driver = {
+               .owner =        THIS_MODULE,
+               .name =         "moschip7720",
+       },
+       .description            = "Moschip 2 port adapter",
+       .id_table               = moschip_port_id_table,
+       .num_interrupt_in       = 1,
+       .num_bulk_in            = 2,
+       .num_bulk_out           = 2,
+       .num_ports              = 2,
+       .open                   = mos7720_open,
+       .close                  = mos7720_close,
+       .throttle               = mos7720_throttle,
+       .unthrottle             = mos7720_unthrottle,
+       .attach                 = mos7720_startup,
+       .shutdown               = mos7720_shutdown,
+       .ioctl                  = mos7720_ioctl,
+       .set_termios            = mos7720_set_termios,
+       .write                  = mos7720_write,
+       .write_room             = mos7720_write_room,
+       .chars_in_buffer        = mos7720_chars_in_buffer,
+       .break_ctl              = mos7720_break,
+       .read_bulk_callback     = mos7720_bulk_in_callback,
+};
+
+static struct usb_driver usb_driver = {
+       .name =         "moschip7720",
+       .probe =        usb_serial_probe,
+       .disconnect =   usb_serial_disconnect,
+       .id_table =     moschip_port_id_table,
+};
+
+static int __init moschip7720_init(void)
+{
+       int retval;
+
+       dbg("%s: Entering ..........", __FUNCTION__);
+
+       /* Register with the usb serial */
+       retval = usb_serial_register(&moschip7720_2port_driver);
+       if (retval)
+               goto failed_port_device_register;
+
+       info(DRIVER_DESC " " DRIVER_VERSION);
+
+       /* Register with the usb */
+       retval = usb_register(&usb_driver);
+       if (retval)
+               goto failed_usb_register;
+
+       return 0;
+
+failed_usb_register:
+       usb_serial_deregister(&moschip7720_2port_driver);
+
+failed_port_device_register:
+       return retval;
+}
+
+static void __exit moschip7720_exit(void)
+{
+       usb_deregister(&usb_driver);
+       usb_serial_deregister(&moschip7720_2port_driver);
+}
+
+module_init(moschip7720_init);
+module_exit(moschip7720_exit);
+
+/* Module information */
+MODULE_AUTHOR( DRIVER_AUTHOR );
+MODULE_DESCRIPTION( DRIVER_DESC );
+MODULE_LICENSE("GPL");
+
+module_param(debug, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(debug, "Debug enabled or not");
index 021be39fe16e04b1ca9f172ec8206fceda2cdb5e..5b71962d0351d3a740be7d8a1d3e3aecef0a070d 100644 (file)
@@ -2413,11 +2413,12 @@ static int mos7840_ioctl(struct usb_serial_port *port, struct file *file,
        }
 
        mos7840_port = mos7840_get_port_private(port);
-       tty = mos7840_port->port->tty;
 
        if (mos7840_port == NULL)
                return -1;
 
+       tty = mos7840_port->port->tty;
+
        dbg("%s - port %d, cmd = 0x%x", __FUNCTION__, port->number, cmd);
 
        switch (cmd) {
index d29638daa987fb9a2f37f58a23caccf1a1b4f587..ea16572d19f89219b013dc2f81af344f534e38bb 100644 (file)
@@ -1,21 +1,35 @@
 /*
- * Sierra Wireless CDMA Wireless Serial USB driver
- *
- * Current Copy modified by: Kevin Lloyd <linux@sierrawireless.com>
- * Original Copyright (C) 2005-2006 Greg Kroah-Hartman <gregkh@suse.de>
- *
- *     This program is free software; you can redistribute it and/or
- *     modify it under the terms of the GNU General Public License version
- *     2 as published by the Free Software Foundation.
- */
+  USB Driver for Sierra Wireless
+
+  Copyright (C) 2006  Kevin Lloyd <linux@sierrawireless.com>
+
+  IMPORTANT DISCLAIMER: This driver is not commercially supported by
+  Sierra Wireless. Use at your own risk.
+
+  This driver is free software; you can redistribute it and/or modify
+  it under the terms of Version 2 of the GNU General Public License as
+  published by the Free Software Foundation.
+
+  Portions based on the option driver by Matthias Urlichs <smurf@smurf.noris.de>
+  Whom based his on the Keyspan driver by Hugh Blemings <hugh@blemings.org>
+
+  History:
+*/
+
+#define DRIVER_VERSION "v.1.0.5"
+#define DRIVER_AUTHOR "Kevin Lloyd <linux@sierrawireless.com>"
+#define DRIVER_DESC "USB Driver for Sierra Wireless USB modems"
 
 #include <linux/kernel.h>
-#include <linux/init.h>
+#include <linux/jiffies.h>
+#include <linux/errno.h>
 #include <linux/tty.h>
+#include <linux/tty_flip.h>
 #include <linux/module.h>
 #include <linux/usb.h>
 #include <linux/usb/serial.h>
 
+
 static struct usb_device_id id_table [] = {
        { USB_DEVICE(0x1199, 0x0018) }, /* Sierra Wireless MC5720 */
        { USB_DEVICE(0x1199, 0x0020) }, /* Sierra Wireless MC5725 */
@@ -23,53 +37,674 @@ static struct usb_device_id id_table [] = {
        { USB_DEVICE(0x1199, 0x0019) }, /* Sierra Wireless AirCard 595 */
        { USB_DEVICE(0x1199, 0x6802) }, /* Sierra Wireless MC8755 */
        { USB_DEVICE(0x1199, 0x6803) }, /* Sierra Wireless MC8765 */
+       { USB_DEVICE(0x1199, 0x6804) }, /* Sierra Wireless MC8755 for Europe */
        { USB_DEVICE(0x1199, 0x6812) }, /* Sierra Wireless MC8775 */
        { USB_DEVICE(0x1199, 0x6820) }, /* Sierra Wireless AirCard 875 */
-       /* Following devices are supported in the airprime.c driver */
-       /* { USB_DEVICE(0x1199, 0x0112) }, */   /* Sierra Wireless AirCard 580 */
-       /* { USB_DEVICE(0x0F3D, 0x0112) }, */   /* AirPrime/Sierra PC 5220 */
+
+       { USB_DEVICE(0x1199, 0x0112) }, /* Sierra Wireless AirCard 580 */
+       { USB_DEVICE(0x0F3D, 0x0112) }, /* AirPrime/Sierra PC 5220 */
        { }
 };
 MODULE_DEVICE_TABLE(usb, id_table);
 
+static struct usb_device_id id_table_1port [] = {
+       { USB_DEVICE(0x1199, 0x0112) }, /* Sierra Wireless AirCard 580 */
+       { USB_DEVICE(0x0F3D, 0x0112) }, /* AirPrime/Sierra PC 5220 */
+       { }
+};
+
+static struct usb_device_id id_table_3port [] = {
+       { USB_DEVICE(0x1199, 0x0018) }, /* Sierra Wireless MC5720 */
+       { USB_DEVICE(0x1199, 0x0020) }, /* Sierra Wireless MC5725 */
+       { USB_DEVICE(0x1199, 0x0017) }, /* Sierra Wireless EM5625 */
+       { USB_DEVICE(0x1199, 0x0019) }, /* Sierra Wireless AirCard 595 */
+       { USB_DEVICE(0x1199, 0x6802) }, /* Sierra Wireless MC8755 */
+       { USB_DEVICE(0x1199, 0x6803) }, /* Sierra Wireless MC8765 */
+       { USB_DEVICE(0x1199, 0x6812) }, /* Sierra Wireless MC8775 */
+       { USB_DEVICE(0x1199, 0x6820) }, /* Sierra Wireless AirCard 875 */
+       { }
+};
+
 static struct usb_driver sierra_driver = {
-       .name =         "sierra_wireless",
-       .probe =        usb_serial_probe,
-       .disconnect =   usb_serial_disconnect,
-       .id_table =     id_table,
+       .name       = "sierra",
+       .probe      = usb_serial_probe,
+       .disconnect = usb_serial_disconnect,
+       .id_table   = id_table,
+       .no_dynamic_id =        1,
+};
+
+
+static int debug;
+
+/* per port private data */
+#define N_IN_URB       4
+#define N_OUT_URB      1
+#define IN_BUFLEN      4096
+#define OUT_BUFLEN     128
+
+struct sierra_port_private {
+       /* Input endpoints and buffer for this port */
+       struct urb *in_urbs[N_IN_URB];
+       char in_buffer[N_IN_URB][IN_BUFLEN];
+       /* Output endpoints and buffer for this port */
+       struct urb *out_urbs[N_OUT_URB];
+       char out_buffer[N_OUT_URB][OUT_BUFLEN];
+
+       /* Settings for the port */
+       int rts_state;  /* Handshaking pins (outputs) */
+       int dtr_state;
+       int cts_state;  /* Handshaking pins (inputs) */
+       int dsr_state;
+       int dcd_state;
+       int ri_state;
+
+       unsigned long tx_start_time[N_OUT_URB];
+};
+
+static int sierra_send_setup(struct usb_serial_port *port)
+{
+       struct usb_serial *serial = port->serial;
+       struct sierra_port_private *portdata;
+
+       dbg("%s", __FUNCTION__);
+
+       portdata = usb_get_serial_port_data(port);
+
+       if (port->tty) {
+               int val = 0;
+               if (portdata->dtr_state)
+                       val |= 0x01;
+               if (portdata->rts_state)
+                       val |= 0x02;
+
+               return usb_control_msg(serial->dev,
+                               usb_rcvctrlpipe(serial->dev, 0),
+                               0x22,0x21,val,0,NULL,0,USB_CTRL_SET_TIMEOUT);
+       }
+
+       return 0;
+}
+
+static void sierra_rx_throttle(struct usb_serial_port *port)
+{
+       dbg("%s", __FUNCTION__);
+}
+
+static void sierra_rx_unthrottle(struct usb_serial_port *port)
+{
+       dbg("%s", __FUNCTION__);
+}
+
+static void sierra_break_ctl(struct usb_serial_port *port, int break_state)
+{
+       /* Unfortunately, I don't know how to send a break */
+       dbg("%s", __FUNCTION__);
+}
+
+static void sierra_set_termios(struct usb_serial_port *port,
+                       struct termios *old_termios)
+{
+       dbg("%s", __FUNCTION__);
+
+       sierra_send_setup(port);
+}
+
+static int sierra_tiocmget(struct usb_serial_port *port, struct file *file)
+{
+       unsigned int value;
+       struct sierra_port_private *portdata;
+
+       portdata = usb_get_serial_port_data(port);
+
+       value = ((portdata->rts_state) ? TIOCM_RTS : 0) |
+               ((portdata->dtr_state) ? TIOCM_DTR : 0) |
+               ((portdata->cts_state) ? TIOCM_CTS : 0) |
+               ((portdata->dsr_state) ? TIOCM_DSR : 0) |
+               ((portdata->dcd_state) ? TIOCM_CAR : 0) |
+               ((portdata->ri_state) ? TIOCM_RNG : 0);
+
+       return value;
+}
+
+static int sierra_tiocmset(struct usb_serial_port *port, struct file *file,
+                       unsigned int set, unsigned int clear)
+{
+       struct sierra_port_private *portdata;
+
+       portdata = usb_get_serial_port_data(port);
+
+       if (set & TIOCM_RTS)
+               portdata->rts_state = 1;
+       if (set & TIOCM_DTR)
+               portdata->dtr_state = 1;
+
+       if (clear & TIOCM_RTS)
+               portdata->rts_state = 0;
+       if (clear & TIOCM_DTR)
+               portdata->dtr_state = 0;
+       return sierra_send_setup(port);
+}
+
+static int sierra_ioctl(struct usb_serial_port *port, struct file *file,
+                       unsigned int cmd, unsigned long arg)
+{
+       return -ENOIOCTLCMD;
+}
+
+/* Write */
+static int sierra_write(struct usb_serial_port *port,
+                       const unsigned char *buf, int count)
+{
+       struct sierra_port_private *portdata;
+       int i;
+       int left, todo;
+       struct urb *this_urb = NULL; /* spurious */
+       int err;
+
+       portdata = usb_get_serial_port_data(port);
+
+       dbg("%s: write (%d chars)", __FUNCTION__, count);
+
+       i = 0;
+       left = count;
+       for (i=0; left > 0 && i < N_OUT_URB; i++) {
+               todo = left;
+               if (todo > OUT_BUFLEN)
+                       todo = OUT_BUFLEN;
+
+               this_urb = portdata->out_urbs[i];
+               if (this_urb->status == -EINPROGRESS) {
+                       if (time_before(jiffies,
+                                       portdata->tx_start_time[i] + 10 * HZ))
+                               continue;
+                       usb_unlink_urb(this_urb);
+                       continue;
+               }
+               if (this_urb->status != 0)
+                       dbg("usb_write %p failed (err=%d)",
+                               this_urb, this_urb->status);
+
+               dbg("%s: endpoint %d buf %d", __FUNCTION__,
+                       usb_pipeendpoint(this_urb->pipe), i);
+
+               /* send the data */
+               memcpy (this_urb->transfer_buffer, buf, todo);
+               this_urb->transfer_buffer_length = todo;
+
+               this_urb->dev = port->serial->dev;
+               err = usb_submit_urb(this_urb, GFP_ATOMIC);
+               if (err) {
+                       dbg("usb_submit_urb %p (write bulk) failed "
+                               "(%d, has %d)", this_urb,
+                               err, this_urb->status);
+                       continue;
+               }
+               portdata->tx_start_time[i] = jiffies;
+               buf += todo;
+               left -= todo;
+       }
+
+       count -= left;
+       dbg("%s: wrote (did %d)", __FUNCTION__, count);
+       return count;
+}
+
+static void sierra_indat_callback(struct urb *urb)
+{
+       int err;
+       int endpoint;
+       struct usb_serial_port *port;
+       struct tty_struct *tty;
+       unsigned char *data = urb->transfer_buffer;
+
+       dbg("%s: %p", __FUNCTION__, urb);
+
+       endpoint = usb_pipeendpoint(urb->pipe);
+       port = (struct usb_serial_port *) urb->context;
+
+       if (urb->status) {
+               dbg("%s: nonzero status: %d on endpoint %02x.",
+                   __FUNCTION__, urb->status, endpoint);
+       } else {
+               tty = port->tty;
+               if (urb->actual_length) {
+                       tty_buffer_request_room(tty, urb->actual_length);
+                       tty_insert_flip_string(tty, data, urb->actual_length);
+                       tty_flip_buffer_push(tty);
+               } else {
+                       dbg("%s: empty read urb received", __FUNCTION__);
+               }
+
+               /* Resubmit urb so we continue receiving */
+               if (port->open_count && urb->status != -ESHUTDOWN) {
+                       err = usb_submit_urb(urb, GFP_ATOMIC);
+                       if (err)
+                               printk(KERN_ERR "%s: resubmit read urb failed. "
+                                       "(%d)", __FUNCTION__, err);
+               }
+       }
+       return;
+}
+
+static void sierra_outdat_callback(struct urb *urb)
+{
+       struct usb_serial_port *port;
+
+       dbg("%s", __FUNCTION__);
+
+       port = (struct usb_serial_port *) urb->context;
+
+       usb_serial_port_softint(port);
+}
+
+static void sierra_instat_callback(struct urb *urb)
+{
+       int err;
+       struct usb_serial_port *port = (struct usb_serial_port *) urb->context;
+       struct sierra_port_private *portdata = usb_get_serial_port_data(port);
+       struct usb_serial *serial = port->serial;
+
+       dbg("%s", __FUNCTION__);
+       dbg("%s: urb %p port %p has data %p", __FUNCTION__,urb,port,portdata);
+
+       if (urb->status == 0) {
+               struct usb_ctrlrequest *req_pkt =
+                               (struct usb_ctrlrequest *)urb->transfer_buffer;
+
+               if (!req_pkt) {
+                       dbg("%s: NULL req_pkt\n", __FUNCTION__);
+                       return;
+               }
+               if ((req_pkt->bRequestType == 0xA1) &&
+                               (req_pkt->bRequest == 0x20)) {
+                       int old_dcd_state;
+                       unsigned char signals = *((unsigned char *)
+                                       urb->transfer_buffer +
+                                       sizeof(struct usb_ctrlrequest));
+
+                       dbg("%s: signal x%x", __FUNCTION__, signals);
+
+                       old_dcd_state = portdata->dcd_state;
+                       portdata->cts_state = 1;
+                       portdata->dcd_state = ((signals & 0x01) ? 1 : 0);
+                       portdata->dsr_state = ((signals & 0x02) ? 1 : 0);
+                       portdata->ri_state = ((signals & 0x08) ? 1 : 0);
+
+                       if (port->tty && !C_CLOCAL(port->tty) &&
+                                       old_dcd_state && !portdata->dcd_state)
+                               tty_hangup(port->tty);
+               } else {
+                       dbg("%s: type %x req %x", __FUNCTION__,
+                               req_pkt->bRequestType,req_pkt->bRequest);
+               }
+       } else
+               dbg("%s: error %d", __FUNCTION__, urb->status);
+
+       /* Resubmit urb so we continue receiving IRQ data */
+       if (urb->status != -ESHUTDOWN) {
+               urb->dev = serial->dev;
+               err = usb_submit_urb(urb, GFP_ATOMIC);
+               if (err)
+                       dbg("%s: resubmit intr urb failed. (%d)",
+                               __FUNCTION__, err);
+       }
+}
+
+static int sierra_write_room(struct usb_serial_port *port)
+{
+       struct sierra_port_private *portdata;
+       int i;
+       int data_len = 0;
+       struct urb *this_urb;
+
+       portdata = usb_get_serial_port_data(port);
+
+       for (i=0; i < N_OUT_URB; i++) {
+               this_urb = portdata->out_urbs[i];
+               if (this_urb && this_urb->status != -EINPROGRESS)
+                       data_len += OUT_BUFLEN;
+       }
+
+       dbg("%s: %d", __FUNCTION__, data_len);
+       return data_len;
+}
+
+static int sierra_chars_in_buffer(struct usb_serial_port *port)
+{
+       struct sierra_port_private *portdata;
+       int i;
+       int data_len = 0;
+       struct urb *this_urb;
+
+       portdata = usb_get_serial_port_data(port);
+
+       for (i=0; i < N_OUT_URB; i++) {
+               this_urb = portdata->out_urbs[i];
+               if (this_urb && this_urb->status == -EINPROGRESS)
+                       data_len += this_urb->transfer_buffer_length;
+       }
+       dbg("%s: %d", __FUNCTION__, data_len);
+       return data_len;
+}
+
+static int sierra_open(struct usb_serial_port *port, struct file *filp)
+{
+       struct sierra_port_private *portdata;
+       struct usb_serial *serial = port->serial;
+       int i, err;
+       struct urb *urb;
+
+       portdata = usb_get_serial_port_data(port);
+
+       dbg("%s", __FUNCTION__);
+
+       /* Set some sane defaults */
+       portdata->rts_state = 1;
+       portdata->dtr_state = 1;
+
+       /* Reset low level data toggle and start reading from endpoints */
+       for (i = 0; i < N_IN_URB; i++) {
+               urb = portdata->in_urbs[i];
+               if (! urb)
+                       continue;
+               if (urb->dev != serial->dev) {
+                       dbg("%s: dev %p != %p", __FUNCTION__,
+                               urb->dev, serial->dev);
+                       continue;
+               }
+
+               /*
+                * make sure endpoint data toggle is synchronized with the
+                * device
+                */
+               usb_clear_halt(urb->dev, urb->pipe);
+
+               err = usb_submit_urb(urb, GFP_KERNEL);
+               if (err) {
+                       dbg("%s: submit urb %d failed (%d) %d",
+                               __FUNCTION__, i, err,
+                               urb->transfer_buffer_length);
+               }
+       }
+
+       /* Reset low level data toggle on out endpoints */
+       for (i = 0; i < N_OUT_URB; i++) {
+               urb = portdata->out_urbs[i];
+               if (! urb)
+                       continue;
+               urb->dev = serial->dev;
+               /* usb_settoggle(urb->dev, usb_pipeendpoint(urb->pipe),
+                               usb_pipeout(urb->pipe), 0); */
+       }
+
+       port->tty->low_latency = 1;
+
+       sierra_send_setup(port);
+
+       return (0);
+}
+
+static inline void stop_urb(struct urb *urb)
+{
+       if (urb && urb->status == -EINPROGRESS)
+               usb_kill_urb(urb);
+}
+
+static void sierra_close(struct usb_serial_port *port, struct file *filp)
+{
+       int i;
+       struct usb_serial *serial = port->serial;
+       struct sierra_port_private *portdata;
+
+       dbg("%s", __FUNCTION__);
+       portdata = usb_get_serial_port_data(port);
+
+       portdata->rts_state = 0;
+       portdata->dtr_state = 0;
+
+       if (serial->dev) {
+               sierra_send_setup(port);
+
+               /* Stop reading/writing urbs */
+               for (i = 0; i < N_IN_URB; i++)
+                       stop_urb(portdata->in_urbs[i]);
+               for (i = 0; i < N_OUT_URB; i++)
+                       stop_urb(portdata->out_urbs[i]);
+       }
+       port->tty = NULL;
+}
+
+/* Helper functions used by sierra_setup_urbs */
+static struct urb *sierra_setup_urb(struct usb_serial *serial, int endpoint,
+                                   int dir, void *ctx, char *buf, int len,
+                                   usb_complete_t callback)
+{
+       struct urb *urb;
+
+       if (endpoint == -1)
+               return NULL;            /* endpoint not needed */
+
+       urb = usb_alloc_urb(0, GFP_KERNEL);             /* No ISO */
+       if (urb == NULL) {
+               dbg("%s: alloc for endpoint %d failed.", __FUNCTION__, endpoint);
+               return NULL;
+       }
+
+               /* Fill URB using supplied data. */
+       usb_fill_bulk_urb(urb, serial->dev,
+                     usb_sndbulkpipe(serial->dev, endpoint) | dir,
+                     buf, len, callback, ctx);
+
+       return urb;
+}
+
+/* Setup urbs */
+static void sierra_setup_urbs(struct usb_serial *serial)
+{
+       int i,j;
+       struct usb_serial_port *port;
+       struct sierra_port_private *portdata;
+
+       dbg("%s", __FUNCTION__);
+
+       for (i = 0; i < serial->num_ports; i++) {
+               port = serial->port[i];
+               portdata = usb_get_serial_port_data(port);
+
+       /* Do indat endpoints first */
+               for (j = 0; j < N_IN_URB; ++j) {
+                       portdata->in_urbs[j] = sierra_setup_urb (serial,
+                       port->bulk_in_endpointAddress, USB_DIR_IN, port,
+                       portdata->in_buffer[j], IN_BUFLEN, sierra_indat_callback);
+               }
+
+               /* outdat endpoints */
+               for (j = 0; j < N_OUT_URB; ++j) {
+                       portdata->out_urbs[j] = sierra_setup_urb (serial,
+                       port->bulk_out_endpointAddress, USB_DIR_OUT, port,
+                       portdata->out_buffer[j], OUT_BUFLEN, sierra_outdat_callback);
+               }
+       }
+}
+
+static int sierra_startup(struct usb_serial *serial)
+{
+       int i, err;
+       struct usb_serial_port *port;
+       struct sierra_port_private *portdata;
+
+       dbg("%s", __FUNCTION__);
+
+       /* Now setup per port private data */
+       for (i = 0; i < serial->num_ports; i++) {
+               port = serial->port[i];
+               portdata = kzalloc(sizeof(*portdata), GFP_KERNEL);
+               if (!portdata) {
+                       dbg("%s: kmalloc for sierra_port_private (%d) failed!.",
+                                       __FUNCTION__, i);
+                       return (1);
+               }
+
+               usb_set_serial_port_data(port, portdata);
+
+               if (! port->interrupt_in_urb)
+                       continue;
+               err = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
+               if (err)
+                       dbg("%s: submit irq_in urb failed %d",
+                               __FUNCTION__, err);
+       }
+
+       sierra_setup_urbs(serial);
+
+       return (0);
+}
+
+static void sierra_shutdown(struct usb_serial *serial)
+{
+       int i, j;
+       struct usb_serial_port *port;
+       struct sierra_port_private *portdata;
+
+       dbg("%s", __FUNCTION__);
+
+       /* Stop reading/writing urbs */
+       for (i = 0; i < serial->num_ports; ++i) {
+               port = serial->port[i];
+               portdata = usb_get_serial_port_data(port);
+               for (j = 0; j < N_IN_URB; j++)
+                       stop_urb(portdata->in_urbs[j]);
+               for (j = 0; j < N_OUT_URB; j++)
+                       stop_urb(portdata->out_urbs[j]);
+       }
+
+       /* Now free them */
+       for (i = 0; i < serial->num_ports; ++i) {
+               port = serial->port[i];
+               portdata = usb_get_serial_port_data(port);
+
+               for (j = 0; j < N_IN_URB; j++) {
+                       if (portdata->in_urbs[j]) {
+                               usb_free_urb(portdata->in_urbs[j]);
+                               portdata->in_urbs[j] = NULL;
+                       }
+               }
+               for (j = 0; j < N_OUT_URB; j++) {
+                       if (portdata->out_urbs[j]) {
+                               usb_free_urb(portdata->out_urbs[j]);
+                               portdata->out_urbs[j] = NULL;
+                       }
+               }
+       }
+
+       /* Now free per port private data */
+       for (i = 0; i < serial->num_ports; i++) {
+               port = serial->port[i];
+               kfree(usb_get_serial_port_data(port));
+       }
+}
+
+static struct usb_serial_driver sierra_1port_device = {
+       .driver = {
+               .owner =        THIS_MODULE,
+               .name =         "sierra1",
+       },
+       .description       = "Sierra USB modem (1 port)",
+       .id_table          = id_table_1port,
+       .num_interrupt_in  = NUM_DONT_CARE,
+       .num_bulk_in       = 1,
+       .num_bulk_out      = 1,
+       .num_ports         = 1,
+       .open              = sierra_open,
+       .close             = sierra_close,
+       .write             = sierra_write,
+       .write_room        = sierra_write_room,
+       .chars_in_buffer   = sierra_chars_in_buffer,
+       .throttle          = sierra_rx_throttle,
+       .unthrottle        = sierra_rx_unthrottle,
+       .ioctl             = sierra_ioctl,
+       .set_termios       = sierra_set_termios,
+       .break_ctl         = sierra_break_ctl,
+       .tiocmget          = sierra_tiocmget,
+       .tiocmset          = sierra_tiocmset,
+       .attach            = sierra_startup,
+       .shutdown          = sierra_shutdown,
+       .read_int_callback = sierra_instat_callback,
 };
 
-static struct usb_serial_driver sierra_device = {
+static struct usb_serial_driver sierra_3port_device = {
        .driver = {
-       .owner =                THIS_MODULE,
-       .name =                 "Sierra_Wireless",
+               .owner =        THIS_MODULE,
+               .name =         "sierra3",
        },
-       .id_table =             id_table,
-       .num_interrupt_in =     NUM_DONT_CARE,
-       .num_bulk_in =          NUM_DONT_CARE,
-       .num_bulk_out =         NUM_DONT_CARE,
-       .num_ports =            3,
+       .description       = "Sierra USB modem (3 port)",
+       .id_table          = id_table_3port,
+       .num_interrupt_in  = NUM_DONT_CARE,
+       .num_bulk_in       = 3,
+       .num_bulk_out      = 3,
+       .num_ports         = 3,
+       .open              = sierra_open,
+       .close             = sierra_close,
+       .write             = sierra_write,
+       .write_room        = sierra_write_room,
+       .chars_in_buffer   = sierra_chars_in_buffer,
+       .throttle          = sierra_rx_throttle,
+       .unthrottle        = sierra_rx_unthrottle,
+       .ioctl             = sierra_ioctl,
+       .set_termios       = sierra_set_termios,
+       .break_ctl         = sierra_break_ctl,
+       .tiocmget          = sierra_tiocmget,
+       .tiocmset          = sierra_tiocmset,
+       .attach            = sierra_startup,
+       .shutdown          = sierra_shutdown,
+       .read_int_callback = sierra_instat_callback,
 };
 
+/* Functions used by new usb-serial code. */
 static int __init sierra_init(void)
 {
        int retval;
-
-       retval = usb_serial_register(&sierra_device);
+       retval = usb_serial_register(&sierra_1port_device);
+       if (retval)
+               goto failed_1port_device_register;
+       retval = usb_serial_register(&sierra_3port_device);
        if (retval)
-               return retval;
+               goto failed_3port_device_register;
+
+
        retval = usb_register(&sierra_driver);
        if (retval)
-               usb_serial_deregister(&sierra_device);
+               goto failed_driver_register;
+
+       info(DRIVER_DESC ": " DRIVER_VERSION);
+
+       return 0;
+
+failed_driver_register:
+       usb_serial_deregister(&sierra_3port_device);
+failed_3port_device_register:
+       usb_serial_deregister(&sierra_1port_device);
+failed_1port_device_register:
        return retval;
 }
 
 static void __exit sierra_exit(void)
 {
-       usb_deregister(&sierra_driver);
-       usb_serial_deregister(&sierra_device);
+       usb_deregister (&sierra_driver);
+       usb_serial_deregister(&sierra_1port_device);
+       usb_serial_deregister(&sierra_3port_device);
 }
 
 module_init(sierra_init);
 module_exit(sierra_exit);
+
+MODULE_AUTHOR(DRIVER_AUTHOR);
+MODULE_DESCRIPTION(DRIVER_DESC);
+MODULE_VERSION(DRIVER_VERSION);
 MODULE_LICENSE("GPL");
+
+#ifdef CONFIG_USB_DEBUG
+module_param(debug, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(debug, "Debug messages");
+#endif
+
index c9a8d50106d1a3bef5b9f1359baad58d015f1725..37ed8e0f2dc8fd4015f09a2c1a52e70f3bff36f7 100644 (file)
@@ -55,7 +55,8 @@ UNUSUAL_DEV(  0x03eb, 0x2002, 0x0100, 0x0100,
                 US_SC_DEVICE, US_PR_DEVICE, NULL,
                 US_FL_IGNORE_RESIDUE),
 
-UNUSUAL_DEV(  0x03ee, 0x6901, 0x0000, 0x0100,
+/* modified by Tobias Lorenz <tobias.lorenz@gmx.net> */
+UNUSUAL_DEV(  0x03ee, 0x6901, 0x0000, 0x0200,
                "Mitsumi",
                "USB FDD",
                US_SC_DEVICE, US_PR_DEVICE, NULL,
@@ -182,6 +183,20 @@ UNUSUAL_DEV(  0x0421, 0x044e, 0x0100, 0x0100,
                US_SC_DEVICE, US_PR_DEVICE, NULL,
                US_FL_IGNORE_RESIDUE | US_FL_FIX_CAPACITY ),
 
+/* Reported by Bardur Arantsson <bardur@scientician.net> */
+UNUSUAL_DEV(  0x0421, 0x047c, 0x0370, 0x0370,
+               "Nokia",
+               "6131",
+               US_SC_DEVICE, US_PR_DEVICE, NULL,
+               US_FL_MAX_SECTORS_64 ),
+
+/* Reported by Alex Corcoles <alex@corcoles.net> */
+UNUSUAL_DEV(  0x0421, 0x0495, 0x0370, 0x0370,
+               "Nokia",
+               "6234",
+               US_SC_DEVICE, US_PR_DEVICE, NULL,
+               US_FL_MAX_SECTORS_64 ),
+
 /* Reported by Olaf Hering <olh@suse.de> from novell bug #105878 */
 UNUSUAL_DEV(  0x0424, 0x0fdc, 0x0210, 0x0210,
                "SMSC",
@@ -1291,6 +1306,13 @@ UNUSUAL_DEV(  0x0fce, 0xe030, 0x0000, 0x0000,
                US_SC_DEVICE, US_PR_DEVICE, NULL,
                US_FL_FIX_CAPACITY ),
 
+/* Reported by Jan Mate <mate@fiit.stuba.sk> */
+UNUSUAL_DEV(  0x0fce, 0xe030, 0x0000, 0x0000,
+               "Sony Ericsson",
+               "P990i",
+               US_SC_DEVICE, US_PR_DEVICE, NULL,
+               US_FL_FIX_CAPACITY ),
+
 /* Reported by Kevin Cernekee <kpc-usbdev@gelato.uiuc.edu>
  * Tested on hardware version 1.10.
  * Entry is needed only for the initializer function override.
index 8cc6c0e2d27aa74935776168562aa5b1f0d26f1c..04c6d928189b82b1c761fafb5ea408267c187958 100644 (file)
@@ -415,13 +415,15 @@ static int __init init_control(struct fb_info_control *p)
        full = p->total_vram == 0x400000;
 
        /* Try to pick a video mode out of NVRAM if we have one. */
+#ifdef CONFIG_NVRAM
        if (default_cmode == CMODE_NVRAM){
                cmode = nvram_read_byte(NV_CMODE);
                if(cmode < CMODE_8 || cmode > CMODE_32)
                        cmode = CMODE_8;
        } else
+#endif
                cmode=default_cmode;
-
+#ifdef CONFIG_NVRAM
        if (default_vmode == VMODE_NVRAM) {
                vmode = nvram_read_byte(NV_VMODE);
                if (vmode < 1 || vmode > VMODE_MAX ||
@@ -432,7 +434,9 @@ static int __init init_control(struct fb_info_control *p)
                        if (control_mac_modes[vmode - 1].m[full] < cmode)
                                vmode = VMODE_640_480_60;
                }
-       } else {
+       } else
+#endif
+       {
                vmode=default_vmode;
                if (control_mac_modes[vmode - 1].m[full] < cmode) {
                        if (cmode > CMODE_8)
index 3afb472763c0488fddcd1dd5a4c0e3bb5817c1f8..3dc49424dc75b43e6cc5d2860c5c258011d3162a 100644 (file)
@@ -29,7 +29,6 @@
 #include <asm/io.h>
 #include <asm/hd64461.h>
 #include <asm/cpu/dac.h>
-#include <asm/hp6xx/hp6xx.h>
 
 #define        WIDTH 640
 
index 67f384f867580d638e2c17501f344d803a9a19f7..e6df492c22a506ba1cec0d49ba1e227c23ab3578 100644 (file)
@@ -573,3 +573,10 @@ int __init igafb_setup(char *options)
 
 module_init(igafb_init);
 MODULE_LICENSE("GPL");
+static struct pci_device_id igafb_pci_tbl[] __devinitdata = {
+       { PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_1682,
+         PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+       { }
+};
+
+MODULE_DEVICE_TABLE(pci, igafb_pci_tbl);
index 983be3ec23459affb6ce021dc644ceca48138776..fdb33cd21a27211e1d78ba7ec778124c584885c7 100644 (file)
@@ -339,11 +339,12 @@ static int __devinit platinum_init_fb(struct fb_info *info)
 
        sense = read_platinum_sense(pinfo);
        printk(KERN_INFO "platinumfb: Monitor sense value = 0x%x, ", sense);
-
        if (default_vmode == VMODE_NVRAM) {
+#ifdef CONFIG_NVRAM
                default_vmode = nvram_read_byte(NV_VMODE);
                if (default_vmode <= 0 || default_vmode > VMODE_MAX ||
                    !platinum_reg_init[default_vmode-1])
+#endif
                        default_vmode = VMODE_CHOOSE;
        }
        if (default_vmode == VMODE_CHOOSE) {
@@ -351,8 +352,10 @@ static int __devinit platinum_init_fb(struct fb_info *info)
        }
        if (default_vmode <= 0 || default_vmode > VMODE_MAX)
                default_vmode = VMODE_640_480_60;
+#ifdef CONFIG_NVRAM
        if (default_cmode == CMODE_NVRAM)
                default_cmode = nvram_read_byte(NV_CMODE);
+#endif
        if (default_cmode < CMODE_8 || default_cmode > CMODE_32)
                default_cmode = CMODE_8;
        /*
index 47f27924a7d75728424281b8f9255323b0c16832..06fc19a6119249a8a6128799c1d9fd226f36494b 100644 (file)
@@ -284,7 +284,7 @@ static void __init valkyrie_choose_mode(struct fb_info_valkyrie *p)
        printk(KERN_INFO "Monitor sense value = 0x%x\n", p->sense);
 
        /* Try to pick a video mode out of NVRAM if we have one. */
-#ifndef CONFIG_MAC
+#if !defined(CONFIG_MAC) && defined(CONFIG_NVRAM)
        if (default_vmode == VMODE_NVRAM) {
                default_vmode = nvram_read_byte(NV_VMODE);
                if (default_vmode <= 0
@@ -297,7 +297,7 @@ static void __init valkyrie_choose_mode(struct fb_info_valkyrie *p)
                default_vmode = mac_map_monitor_sense(p->sense);
        if (!valkyrie_reg_init[default_vmode - 1])
                default_vmode = VMODE_640_480_67;
-#ifndef CONFIG_MAC
+#if !defined(CONFIG_MAC) && defined(CONFIG_NVRAM)
        if (default_cmode == CMODE_NVRAM)
                default_cmode = nvram_read_byte(NV_CMODE);
 #endif
index 27c9d05d03ef23f1280754fab152393d6995bb14..c287a9ae4fdd56690444c44a2f6e57269e50cb5a 100644 (file)
@@ -2,7 +2,6 @@ menu "Dallas's 1-wire bus"
 
 config W1
        tristate "Dallas's 1-wire support"
-       depends on CONNECTOR
        ---help---
          Dallas' 1-wire bus is useful to connect slow 1-pin devices
          such as iButtons and thermal sensors.
index 6a3df055280a01858d5925f491bcc33157498aab..fee318e6f4bb30e8b40c932c103caf857bbc77b1 100644 (file)
@@ -634,6 +634,10 @@ config FUSE_FS
          If you want to develop a userspace FS, or if you want to use
          a filesystem based on FUSE, answer Y or M.
 
+config GENERIC_ACL
+       bool
+       select FS_POSIX_ACL
+
 if BLOCK
 menu "CD-ROM/DVD Filesystems"
 
@@ -2080,10 +2084,6 @@ config 9P_FS
 
          If unsure, say N.
 
-config GENERIC_ACL
-       bool
-       select FS_POSIX_ACL
-
 endmenu
 
 if BLOCK
index c7700d9b3f96792b74651d8d3890b396976204a2..906ba5ce22617b12d7d3000eaab056f495b4159d 100644 (file)
@@ -149,6 +149,7 @@ extern const struct file_operations autofs_root_operations;
 /* Initializing function */
 
 int autofs_fill_super(struct super_block *, void *, int);
+void autofs_kill_sb(struct super_block *sb);
 
 /* Queue management functions */
 
index 3fded389d06b9fe1e1d8df20f08ac541b87f9bb1..bf8c8af980044462ece05e7fc9772d0efb9d6c13 100644 (file)
@@ -246,5 +246,4 @@ void autofs_hash_nuke(struct autofs_sb_info *sbi)
                        kfree(ent);
                }
        }
-       shrink_dcache_sb(sbi->sb);
 }
index aca12375240694975523badc164647cb10ca01c1..cea5219b4f377ba00b3deb95f58455986764d676 100644 (file)
@@ -24,7 +24,7 @@ static struct file_system_type autofs_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "autofs",
        .get_sb         = autofs_get_sb,
-       .kill_sb        = kill_anon_super,
+       .kill_sb        = autofs_kill_sb,
 };
 
 static int __init init_autofs_fs(void)
index 2c9759baad61bf0f875c4adbb4abba6e8fdebb04..54c518c89e4cf86a8fec90124f21d7ca2e776169 100644 (file)
@@ -20,7 +20,7 @@
 #include "autofs_i.h"
 #include <linux/module.h>
 
-static void autofs_put_super(struct super_block *sb)
+void autofs_kill_sb(struct super_block *sb)
 {
        struct autofs_sb_info *sbi = autofs_sbi(sb);
        unsigned int n;
@@ -37,13 +37,13 @@ static void autofs_put_super(struct super_block *sb)
        kfree(sb->s_fs_info);
 
        DPRINTK(("autofs: shutting down\n"));
+       kill_anon_super(sb);
 }
 
 static void autofs_read_inode(struct inode *inode);
 
 static struct super_operations autofs_sops = {
        .read_inode     = autofs_read_inode,
-       .put_super      = autofs_put_super,
        .statfs         = simple_statfs,
 };
 
index 5610061279027df28a82c0448a086e7b90e7ed4c..79b05a1a436582ebfd2415a682cce4a322be00d5 100644 (file)
@@ -1220,7 +1220,7 @@ static int notesize(struct memelfnote *en)
 
 static int alignfile(struct file *file, loff_t *foffset)
 {
-       char buf[4] = { 0, };
+       static const char buf[4] = { 0, };
        DUMP_WRITE(buf, roundup(*foffset, 4) - *foffset, foffset);
        return 1;
 }
@@ -1569,7 +1569,8 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file)
 
        DUMP_WRITE(elf, sizeof(*elf));
        offset += sizeof(*elf);                         /* Elf header */
-       offset += (segs+1) * sizeof(struct elf_phdr);   /* Program headers */
+       offset += (segs + 1) * sizeof(struct elf_phdr); /* Program headers */
+       foffset = offset;
 
        /* Write notes phdr entry */
        {
@@ -1586,8 +1587,6 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file)
                DUMP_WRITE(&phdr, sizeof(phdr));
        }
 
-       foffset = offset;
-
        dataoff = offset = roundup(offset, ELF_EXEC_PAGESIZE);
 
        /* Write program headers for segments dump */
@@ -1612,7 +1611,6 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file)
                phdr.p_align = ELF_EXEC_PAGESIZE;
 
                DUMP_WRITE(&phdr, sizeof(phdr));
-               foffset += sizeof(phdr);
        }
 
 #ifdef ELF_CORE_WRITE_EXTRA_PHDRS
index f65ef8821c7364a718b64948166340a2fc418bdd..35527dca1dbcc415d95d76780537c577808df9ff 100644 (file)
@@ -452,6 +452,7 @@ static void end_buffer_async_write(struct buffer_head *bh, int uptodate)
                               bdevname(bh->b_bdev, b));
                }
                set_bit(AS_EIO, &page->mapping->flags);
+               set_buffer_write_io_error(bh);
                clear_buffer_uptodate(bh);
                SetPageError(page);
        }
@@ -571,6 +572,10 @@ EXPORT_SYMBOL(mark_buffer_async_write);
 static inline void __remove_assoc_queue(struct buffer_head *bh)
 {
        list_del_init(&bh->b_assoc_buffers);
+       WARN_ON(!bh->b_assoc_map);
+       if (buffer_write_io_error(bh))
+               set_bit(AS_EIO, &bh->b_assoc_map->flags);
+       bh->b_assoc_map = NULL;
 }
 
 int inode_has_buffers(struct inode *inode)
@@ -669,6 +674,7 @@ void mark_buffer_dirty_inode(struct buffer_head *bh, struct inode *inode)
                spin_lock(&buffer_mapping->private_lock);
                list_move_tail(&bh->b_assoc_buffers,
                                &mapping->private_list);
+               bh->b_assoc_map = mapping;
                spin_unlock(&buffer_mapping->private_lock);
        }
 }
@@ -765,7 +771,7 @@ static int fsync_buffers_list(spinlock_t *lock, struct list_head *list)
        spin_lock(lock);
        while (!list_empty(list)) {
                bh = BH_ENTRY(list->next);
-               list_del_init(&bh->b_assoc_buffers);
+               __remove_assoc_queue(bh);
                if (buffer_dirty(bh) || buffer_locked(bh)) {
                        list_add(&bh->b_assoc_buffers, &tmp);
                        if (buffer_dirty(bh)) {
@@ -786,7 +792,7 @@ static int fsync_buffers_list(spinlock_t *lock, struct list_head *list)
 
        while (!list_empty(&tmp)) {
                bh = BH_ENTRY(tmp.prev);
-               __remove_assoc_queue(bh);
+               list_del_init(&bh->b_assoc_buffers);
                get_bh(bh);
                spin_unlock(lock);
                wait_on_buffer(bh);
@@ -1167,6 +1173,7 @@ void __bforget(struct buffer_head *bh)
 
                spin_lock(&buffer_mapping->private_lock);
                list_del_init(&bh->b_assoc_buffers);
+               bh->b_assoc_map = NULL;
                spin_unlock(&buffer_mapping->private_lock);
        }
        __brelse(bh);
index 5dc5a966bd5ff1b191838346bc19f465402aea9f..098790eb2aa161967538c91b734c3fe45fa5d8b7 100644 (file)
@@ -399,6 +399,7 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses)
        struct TCP_Server_Info * server;
        u16 count;
        unsigned int secFlags;
+       u16 dialect;
 
        if(ses->server)
                server = ses->server;
@@ -438,9 +439,10 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses)
        if (rc != 0) 
                goto neg_err_exit;
 
-       cFYI(1,("Dialect: %d", pSMBr->DialectIndex));
+       dialect = le16_to_cpu(pSMBr->DialectIndex);
+       cFYI(1,("Dialect: %d", dialect));
        /* Check wct = 1 error case */
-       if((pSMBr->hdr.WordCount < 13) || (pSMBr->DialectIndex == BAD_PROT)) {
+       if((pSMBr->hdr.WordCount < 13) || (dialect == BAD_PROT)) {
                /* core returns wct = 1, but we do not ask for core - otherwise
                small wct just comes when dialect index is -1 indicating we 
                could not negotiate a common dialect */
@@ -448,8 +450,8 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses)
                goto neg_err_exit;
 #ifdef CONFIG_CIFS_WEAK_PW_HASH 
        } else if((pSMBr->hdr.WordCount == 13)
-                       && ((pSMBr->DialectIndex == LANMAN_PROT)
-                               || (pSMBr->DialectIndex == LANMAN2_PROT))) {
+                       && ((dialect == LANMAN_PROT)
+                               || (dialect == LANMAN2_PROT))) {
                __s16 tmp;
                struct lanman_neg_rsp * rsp = (struct lanman_neg_rsp *)pSMBr;
 
@@ -2943,7 +2945,7 @@ QInfRetry:
                ts.tv_nsec = 0;
                ts.tv_sec = time;
                /* decode time fields */
-               pFinfo->ChangeTime = cifs_UnixTimeToNT(ts);
+               pFinfo->ChangeTime = cpu_to_le64(cifs_UnixTimeToNT(ts));
                pFinfo->LastWriteTime = pFinfo->ChangeTime;
                pFinfo->LastAccessTime = 0;
                pFinfo->AllocationSize =
index e6d5754a715ecde980dd50225495d3628c49e2d8..cf33fac68c840cccc21ac91c617064ac36f90097 100644 (file)
@@ -275,13 +275,14 @@ static int check_perm(struct inode * inode, struct file * file)
         * it in file->private_data for easy access.
         */
        buffer = kzalloc(sizeof(struct configfs_buffer),GFP_KERNEL);
-       if (buffer) {
-               init_MUTEX(&buffer->sem);
-               buffer->needs_read_fill = 1;
-               buffer->ops = ops;
-               file->private_data = buffer;
-       } else
+       if (!buffer) {
                error = -ENOMEM;
+               goto Enomem;
+       }
+       init_MUTEX(&buffer->sem);
+       buffer->needs_read_fill = 1;
+       buffer->ops = ops;
+       file->private_data = buffer;
        goto Done;
 
  Einval:
@@ -289,6 +290,7 @@ static int check_perm(struct inode * inode, struct file * file)
        goto Done;
  Eaccess:
        error = -EACCES;
+ Enomem:
        module_put(attr->ca_owner);
  Done:
        if (error && item)
index 2bac4ba1d1d3755b70598e992847459dc889a962..a1ff91eef10810c50583962ae671f07e14737bf6 100644 (file)
@@ -1469,23 +1469,21 @@ static void switch_names(struct dentry *dentry, struct dentry *target)
  * deleted it.
  */
  
-/**
- * d_move - move a dentry
+/*
+ * d_move_locked - move a dentry
  * @dentry: entry to move
  * @target: new dentry
  *
  * Update the dcache to reflect the move of a file name. Negative
  * dcache entries should not be moved in this way.
  */
-
-void d_move(struct dentry * dentry, struct dentry * target)
+static void d_move_locked(struct dentry * dentry, struct dentry * target)
 {
        struct hlist_head *list;
 
        if (!dentry->d_inode)
                printk(KERN_WARNING "VFS: moving negative dcache entry\n");
 
-       spin_lock(&dcache_lock);
        write_seqlock(&rename_lock);
        /*
         * XXXX: do we really need to take target->d_lock?
@@ -1536,9 +1534,83 @@ already_unhashed:
        fsnotify_d_move(dentry);
        spin_unlock(&dentry->d_lock);
        write_sequnlock(&rename_lock);
+}
+
+/**
+ * d_move - move a dentry
+ * @dentry: entry to move
+ * @target: new dentry
+ *
+ * Update the dcache to reflect the move of a file name. Negative
+ * dcache entries should not be moved in this way.
+ */
+
+void d_move(struct dentry * dentry, struct dentry * target)
+{
+       spin_lock(&dcache_lock);
+       d_move_locked(dentry, target);
        spin_unlock(&dcache_lock);
 }
 
+/*
+ * Helper that returns 1 if p1 is a parent of p2, else 0
+ */
+static int d_isparent(struct dentry *p1, struct dentry *p2)
+{
+       struct dentry *p;
+
+       for (p = p2; p->d_parent != p; p = p->d_parent) {
+               if (p->d_parent == p1)
+                       return 1;
+       }
+       return 0;
+}
+
+/*
+ * This helper attempts to cope with remotely renamed directories
+ *
+ * It assumes that the caller is already holding
+ * dentry->d_parent->d_inode->i_mutex and the dcache_lock
+ *
+ * Note: If ever the locking in lock_rename() changes, then please
+ * remember to update this too...
+ *
+ * On return, dcache_lock will have been unlocked.
+ */
+static struct dentry *__d_unalias(struct dentry *dentry, struct dentry *alias)
+{
+       struct mutex *m1 = NULL, *m2 = NULL;
+       struct dentry *ret;
+
+       /* If alias and dentry share a parent, then no extra locks required */
+       if (alias->d_parent == dentry->d_parent)
+               goto out_unalias;
+
+       /* Check for loops */
+       ret = ERR_PTR(-ELOOP);
+       if (d_isparent(alias, dentry))
+               goto out_err;
+
+       /* See lock_rename() */
+       ret = ERR_PTR(-EBUSY);
+       if (!mutex_trylock(&dentry->d_sb->s_vfs_rename_mutex))
+               goto out_err;
+       m1 = &dentry->d_sb->s_vfs_rename_mutex;
+       if (!mutex_trylock(&alias->d_parent->d_inode->i_mutex))
+               goto out_err;
+       m2 = &alias->d_parent->d_inode->i_mutex;
+out_unalias:
+       d_move_locked(alias, dentry);
+       ret = alias;
+out_err:
+       spin_unlock(&dcache_lock);
+       if (m2)
+               mutex_unlock(m2);
+       if (m1)
+               mutex_unlock(m1);
+       return ret;
+}
+
 /*
  * Prepare an anonymous dentry for life in the superblock's dentry tree as a
  * named dentry in place of the dentry to be replaced.
@@ -1581,7 +1653,7 @@ static void __d_materialise_dentry(struct dentry *dentry, struct dentry *anon)
  */
 struct dentry *d_materialise_unique(struct dentry *dentry, struct inode *inode)
 {
-       struct dentry *alias, *actual;
+       struct dentry *actual;
 
        BUG_ON(!d_unhashed(dentry));
 
@@ -1593,26 +1665,27 @@ struct dentry *d_materialise_unique(struct dentry *dentry, struct inode *inode)
                goto found_lock;
        }
 
-       /* See if a disconnected directory already exists as an anonymous root
-        * that we should splice into the tree instead */
-       if (S_ISDIR(inode->i_mode) && (alias = __d_find_alias(inode, 1))) {
-               spin_lock(&alias->d_lock);
-
-               /* Is this a mountpoint that we could splice into our tree? */
-               if (IS_ROOT(alias))
-                       goto connect_mountpoint;
-
-               if (alias->d_name.len == dentry->d_name.len &&
-                   alias->d_parent == dentry->d_parent &&
-                   memcmp(alias->d_name.name,
-                          dentry->d_name.name,
-                          dentry->d_name.len) == 0)
-                       goto replace_with_alias;
-
-               spin_unlock(&alias->d_lock);
-
-               /* Doh! Seem to be aliasing directories for some reason... */
-               dput(alias);
+       if (S_ISDIR(inode->i_mode)) {
+               struct dentry *alias;
+
+               /* Does an aliased dentry already exist? */
+               alias = __d_find_alias(inode, 0);
+               if (alias) {
+                       actual = alias;
+                       /* Is this an anonymous mountpoint that we could splice
+                        * into our tree? */
+                       if (IS_ROOT(alias)) {
+                               spin_lock(&alias->d_lock);
+                               __d_materialise_dentry(dentry, alias);
+                               __d_drop(alias);
+                               goto found;
+                       }
+                       /* Nope, but we must(!) avoid directory aliasing */
+                       actual = __d_unalias(dentry, alias);
+                       if (IS_ERR(actual))
+                               dput(alias);
+                       goto out_nolock;
+               }
        }
 
        /* Add a unique reference */
@@ -1628,7 +1701,7 @@ found:
        _d_rehash(actual);
        spin_unlock(&actual->d_lock);
        spin_unlock(&dcache_lock);
-
+out_nolock:
        if (actual == dentry) {
                security_d_instantiate(dentry, inode);
                return NULL;
@@ -1637,16 +1710,6 @@ found:
        iput(inode);
        return actual;
 
-       /* Convert the anonymous/root alias into an ordinary dentry */
-connect_mountpoint:
-       __d_materialise_dentry(dentry, alias);
-
-       /* Replace the candidate dentry with the alias in the tree */
-replace_with_alias:
-       __d_drop(alias);
-       actual = alias;
-       goto found;
-
 shouldnt_be_hashed:
        spin_unlock(&dcache_lock);
        BUG();
index 867f93d0417e3fa1ca11e0e7e4b0363aa02d4a48..6da6b14d5a61b40a83e904e6f56cc19d12865ad2 100644 (file)
@@ -519,6 +519,7 @@ static int receive_from_sock(void)
        msg.msg_flags = 0;
        msg.msg_control = incmsg;
        msg.msg_controllen = sizeof(incmsg);
+       msg.msg_iovlen = 1;
 
        /* I don't see why this circular buffer stuff is necessary for SCTP
         * which is a packet-based protocol, but the whole thing breaks under
index 7a11b8ae66443ce6b094bc25ef381258a6af63f9..5938a232d11bd3e3feed0ed01ae3ba5a04918c7f 100644 (file)
@@ -104,10 +104,7 @@ int ecryptfs_interpose(struct dentry *lower_dentry, struct dentry *dentry,
                inode->i_op = &ecryptfs_dir_iops;
        if (S_ISDIR(lower_inode->i_mode))
                inode->i_fop = &ecryptfs_dir_fops;
-       /* TODO: Is there a better way to identify if the inode is
-        * special? */
-       if (S_ISBLK(lower_inode->i_mode) || S_ISCHR(lower_inode->i_mode) ||
-           S_ISFIFO(lower_inode->i_mode) || S_ISSOCK(lower_inode->i_mode))
+       if (special_file(lower_inode->i_mode))
                init_special_inode(inode, lower_inode->i_mode,
                                   lower_inode->i_rdev);
        dentry->d_op = &ecryptfs_dops;
index f4b8f8b3fbdd25ed95df235862171dcf2a905a2a..8337451e7897abc70d00752795fade9816aee985 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/smp_lock.h>
 #include <linux/buffer_head.h>
 #include <linux/writeback.h>
+#include <linux/backing-dev.h>
 #include <linux/blkdev.h>
 
 int fat_generic_ioctl(struct inode *inode, struct file *filp,
@@ -118,7 +119,7 @@ static int fat_file_release(struct inode *inode, struct file *filp)
        if ((filp->f_mode & FMODE_WRITE) &&
             MSDOS_SB(inode->i_sb)->options.flush) {
                fat_flush_inodes(inode->i_sb, inode, NULL);
-               blk_congestion_wait(WRITE, HZ/10);
+               congestion_wait(WRITE, HZ/10);
        }
        return 0;
 }
index 8605155db171359398c952d8319c551a95fb305b..cfc8f81e60d0133a060a9d5374fc399820de9c9a 100644 (file)
@@ -138,6 +138,7 @@ static int fuse_dentry_revalidate(struct dentry *entry, struct nameidata *nd)
                struct fuse_entry_out outarg;
                struct fuse_conn *fc;
                struct fuse_req *req;
+               struct dentry *parent;
 
                /* Doesn't hurt to "reset" the validity timeout */
                fuse_invalidate_entry_cache(entry);
@@ -151,8 +152,10 @@ static int fuse_dentry_revalidate(struct dentry *entry, struct nameidata *nd)
                if (IS_ERR(req))
                        return 0;
 
-               fuse_lookup_init(req, entry->d_parent->d_inode, entry, &outarg);
+               parent = dget_parent(entry);
+               fuse_lookup_init(req, parent->d_inode, entry, &outarg);
                request_send(fc, req);
+               dput(parent);
                err = req->out.h.error;
                /* Zero nodeid is same as -ENOENT */
                if (!err && !outarg.nodeid)
@@ -163,7 +166,9 @@ static int fuse_dentry_revalidate(struct dentry *entry, struct nameidata *nd)
                                fuse_send_forget(fc, req, outarg.nodeid, 1);
                                return 0;
                        }
+                       spin_lock(&fc->lock);
                        fi->nlookup ++;
+                       spin_unlock(&fc->lock);
                }
                fuse_put_request(fc, req);
                if (err || (outarg.attr.mode ^ inode->i_mode) & S_IFMT)
@@ -175,22 +180,6 @@ static int fuse_dentry_revalidate(struct dentry *entry, struct nameidata *nd)
        return 1;
 }
 
-/*
- * Check if there's already a hashed alias of this directory inode.
- * If yes, then lookup and mkdir must not create a new alias.
- */
-static int dir_alias(struct inode *inode)
-{
-       if (S_ISDIR(inode->i_mode)) {
-               struct dentry *alias = d_find_alias(inode);
-               if (alias) {
-                       dput(alias);
-                       return 1;
-               }
-       }
-       return 0;
-}
-
 static int invalid_nodeid(u64 nodeid)
 {
        return !nodeid || nodeid == FUSE_ROOT_ID;
@@ -206,6 +195,24 @@ static int valid_mode(int m)
                S_ISBLK(m) || S_ISFIFO(m) || S_ISSOCK(m);
 }
 
+/*
+ * Add a directory inode to a dentry, ensuring that no other dentry
+ * refers to this inode.  Called with fc->inst_mutex.
+ */
+static int fuse_d_add_directory(struct dentry *entry, struct inode *inode)
+{
+       struct dentry *alias = d_find_alias(inode);
+       if (alias) {
+               /* This tries to shrink the subtree below alias */
+               fuse_invalidate_entry(alias);
+               dput(alias);
+               if (!list_empty(&inode->i_dentry))
+                       return -EBUSY;
+       }
+       d_add(entry, inode);
+       return 0;
+}
+
 static struct dentry *fuse_lookup(struct inode *dir, struct dentry *entry,
                                  struct nameidata *nd)
 {
@@ -241,11 +248,17 @@ static struct dentry *fuse_lookup(struct inode *dir, struct dentry *entry,
        if (err && err != -ENOENT)
                return ERR_PTR(err);
 
-       if (inode && dir_alias(inode)) {
-               iput(inode);
-               return ERR_PTR(-EIO);
-       }
-       d_add(entry, inode);
+       if (inode && S_ISDIR(inode->i_mode)) {
+               mutex_lock(&fc->inst_mutex);
+               err = fuse_d_add_directory(entry, inode);
+               mutex_unlock(&fc->inst_mutex);
+               if (err) {
+                       iput(inode);
+                       return ERR_PTR(err);
+               }
+       } else
+               d_add(entry, inode);
+
        entry->d_op = &fuse_dentry_operations;
        if (!err)
                fuse_change_timeout(entry, &outarg);
@@ -401,12 +414,22 @@ static int create_new_entry(struct fuse_conn *fc, struct fuse_req *req,
        }
        fuse_put_request(fc, req);
 
-       if (dir_alias(inode)) {
-               iput(inode);
-               return -EIO;
-       }
+       if (S_ISDIR(inode->i_mode)) {
+               struct dentry *alias;
+               mutex_lock(&fc->inst_mutex);
+               alias = d_find_alias(inode);
+               if (alias) {
+                       /* New directory must have moved since mkdir */
+                       mutex_unlock(&fc->inst_mutex);
+                       dput(alias);
+                       iput(inode);
+                       return -EBUSY;
+               }
+               d_instantiate(entry, inode);
+               mutex_unlock(&fc->inst_mutex);
+       } else
+               d_instantiate(entry, inode);
 
-       d_instantiate(entry, inode);
        fuse_change_timeout(entry, &outarg);
        fuse_invalidate_attr(dir);
        return 0;
@@ -935,14 +958,30 @@ static void iattr_to_fattr(struct iattr *iattr, struct fuse_setattr_in *arg)
        }
 }
 
+static void fuse_vmtruncate(struct inode *inode, loff_t offset)
+{
+       struct fuse_conn *fc = get_fuse_conn(inode);
+       int need_trunc;
+
+       spin_lock(&fc->lock);
+       need_trunc = inode->i_size > offset;
+       i_size_write(inode, offset);
+       spin_unlock(&fc->lock);
+
+       if (need_trunc) {
+               struct address_space *mapping = inode->i_mapping;
+               unmap_mapping_range(mapping, offset + PAGE_SIZE - 1, 0, 1);
+               truncate_inode_pages(mapping, offset);
+       }
+}
+
 /*
  * Set attributes, and at the same time refresh them.
  *
  * Truncation is slightly complicated, because the 'truncate' request
  * may fail, in which case we don't want to touch the mapping.
- * vmtruncate() doesn't allow for this case.  So do the rlimit
- * checking by hand and call vmtruncate() only after the file has
- * actually been truncated.
+ * vmtruncate() doesn't allow for this case, so do the rlimit checking
+ * and the actual truncation by hand.
  */
 static int fuse_setattr(struct dentry *entry, struct iattr *attr)
 {
@@ -993,12 +1032,8 @@ static int fuse_setattr(struct dentry *entry, struct iattr *attr)
                        make_bad_inode(inode);
                        err = -EIO;
                } else {
-                       if (is_truncate) {
-                               loff_t origsize = i_size_read(inode);
-                               i_size_write(inode, outarg.attr.size);
-                               if (origsize > outarg.attr.size)
-                                       vmtruncate(inode, outarg.attr.size);
-                       }
+                       if (is_truncate)
+                               fuse_vmtruncate(inode, outarg.attr.size);
                        fuse_change_attributes(inode, &outarg.attr);
                        fi->i_time = time_to_jiffies(outarg.attr_valid,
                                                     outarg.attr_valid_nsec);
index 183626868eea602d4658e5395ec31f46130c0afe..2bb5ace3882dd9e5bcdc6e92af17e5fce873365e 100644 (file)
@@ -481,8 +481,10 @@ static int fuse_commit_write(struct file *file, struct page *page,
                err = -EIO;
        if (!err) {
                pos += count;
-               if (pos > i_size_read(inode))
+               spin_lock(&fc->lock);
+               if (pos > inode->i_size)
                        i_size_write(inode, pos);
+               spin_unlock(&fc->lock);
 
                if (offset == 0 && to == PAGE_CACHE_SIZE) {
                        clear_page_dirty(page);
@@ -586,8 +588,12 @@ static ssize_t fuse_direct_io(struct file *file, const char __user *buf,
        }
        fuse_put_request(fc, req);
        if (res > 0) {
-               if (write && pos > i_size_read(inode))
-                       i_size_write(inode, pos);
+               if (write) {
+                       spin_lock(&fc->lock);
+                       if (pos > inode->i_size)
+                               i_size_write(inode, pos);
+                       spin_unlock(&fc->lock);
+               }
                *ppos = pos;
        }
        fuse_invalidate_attr(inode);
index 69c7750d55b8e59cfd95a0322f45557a74c0fdfe..91edb8932d905890a342c1f66cbfe5dbdd04f828 100644 (file)
@@ -239,6 +239,9 @@ struct fuse_conn {
        /** Lock protecting accessess to  members of this structure */
        spinlock_t lock;
 
+       /** Mutex protecting against directory alias creation */
+       struct mutex inst_mutex;
+
        /** Refcount */
        atomic_t count;
 
index 7d0a9aee01f248ef70bb1796a013fca8dda571af..fc42035703702813266c14c66d784ee1ec7e1c20 100644 (file)
@@ -109,6 +109,7 @@ static int fuse_remount_fs(struct super_block *sb, int *flags, char *data)
 
 void fuse_change_attributes(struct inode *inode, struct fuse_attr *attr)
 {
+       struct fuse_conn *fc = get_fuse_conn(inode);
        if (S_ISREG(inode->i_mode) && i_size_read(inode) != attr->size)
                invalidate_inode_pages(inode->i_mapping);
 
@@ -117,7 +118,9 @@ void fuse_change_attributes(struct inode *inode, struct fuse_attr *attr)
        inode->i_nlink   = attr->nlink;
        inode->i_uid     = attr->uid;
        inode->i_gid     = attr->gid;
+       spin_lock(&fc->lock);
        i_size_write(inode, attr->size);
+       spin_unlock(&fc->lock);
        inode->i_blocks  = attr->blocks;
        inode->i_atime.tv_sec   = attr->atime;
        inode->i_atime.tv_nsec  = attr->atimensec;
@@ -130,7 +133,7 @@ void fuse_change_attributes(struct inode *inode, struct fuse_attr *attr)
 static void fuse_init_inode(struct inode *inode, struct fuse_attr *attr)
 {
        inode->i_mode = attr->mode & S_IFMT;
-       i_size_write(inode, attr->size);
+       inode->i_size = attr->size;
        if (S_ISREG(inode->i_mode)) {
                fuse_init_common(inode);
                fuse_init_file_inode(inode);
@@ -169,7 +172,6 @@ struct inode *fuse_iget(struct super_block *sb, unsigned long nodeid,
        struct inode *inode;
        struct fuse_inode *fi;
        struct fuse_conn *fc = get_fuse_conn_super(sb);
-       int retried = 0;
 
  retry:
        inode = iget5_locked(sb, nodeid, fuse_inode_eq, fuse_inode_set, &nodeid);
@@ -183,16 +185,16 @@ struct inode *fuse_iget(struct super_block *sb, unsigned long nodeid,
                fuse_init_inode(inode, attr);
                unlock_new_inode(inode);
        } else if ((inode->i_mode ^ attr->mode) & S_IFMT) {
-               BUG_ON(retried);
                /* Inode has changed type, any I/O on the old should fail */
                make_bad_inode(inode);
                iput(inode);
-               retried = 1;
                goto retry;
        }
 
        fi = get_fuse_inode(inode);
+       spin_lock(&fc->lock);
        fi->nlookup ++;
+       spin_unlock(&fc->lock);
        fuse_change_attributes(inode, attr);
        return inode;
 }
@@ -377,6 +379,7 @@ static struct fuse_conn *new_conn(void)
        fc = kzalloc(sizeof(*fc), GFP_KERNEL);
        if (fc) {
                spin_lock_init(&fc->lock);
+               mutex_init(&fc->inst_mutex);
                atomic_set(&fc->count, 1);
                init_waitqueue_head(&fc->waitq);
                init_waitqueue_head(&fc->blocked_waitq);
@@ -396,8 +399,10 @@ static struct fuse_conn *new_conn(void)
 
 void fuse_conn_put(struct fuse_conn *fc)
 {
-       if (atomic_dec_and_test(&fc->count))
+       if (atomic_dec_and_test(&fc->count)) {
+               mutex_destroy(&fc->inst_mutex);
                kfree(fc);
+       }
 }
 
 struct fuse_conn *fuse_conn_get(struct fuse_conn *fc)
index cc57f2ecd21974a7121ccaaf35b184c148711558..06e9a8cb45e959b89e744d64168da1dc4655f71b 100644 (file)
@@ -434,8 +434,7 @@ static int lookup_block(struct gfs2_inode *ip, struct buffer_head *bh,
  */
 
 static int gfs2_block_pointers(struct inode *inode, u64 lblock, int create,
-                              struct buffer_head *bh_map, struct metapath *mp,
-                              unsigned int maxlen)
+                              struct buffer_head *bh_map, struct metapath *mp)
 {
        struct gfs2_inode *ip = GFS2_I(inode);
        struct gfs2_sbd *sdp = GFS2_SB(inode);
@@ -448,6 +447,7 @@ static int gfs2_block_pointers(struct inode *inode, u64 lblock, int create,
        int new = 0;
        u64 dblock = 0;
        int boundary;
+       unsigned int maxlen = bh_map->b_size >> inode->i_blkbits;
 
        BUG_ON(maxlen == 0);
 
@@ -541,13 +541,13 @@ static inline void bmap_unlock(struct inode *inode, int create)
 }
 
 int gfs2_block_map(struct inode *inode, u64 lblock, int create,
-                  struct buffer_head *bh, unsigned int maxlen)
+                  struct buffer_head *bh)
 {
        struct metapath mp;
        int ret;
 
        bmap_lock(inode, create);
-       ret = gfs2_block_pointers(inode, lblock, create, bh, &mp, maxlen);
+       ret = gfs2_block_pointers(inode, lblock, create, bh, &mp);
        bmap_unlock(inode, create);
        return ret;
 }
@@ -555,7 +555,7 @@ int gfs2_block_map(struct inode *inode, u64 lblock, int create,
 int gfs2_extent_map(struct inode *inode, u64 lblock, int *new, u64 *dblock, unsigned *extlen)
 {
        struct metapath mp;
-       struct buffer_head bh = { .b_state = 0, .b_blocknr = 0, .b_size = 0 };
+       struct buffer_head bh = { .b_state = 0, .b_blocknr = 0 };
        int ret;
        int create = *new;
 
@@ -563,8 +563,9 @@ int gfs2_extent_map(struct inode *inode, u64 lblock, int *new, u64 *dblock, unsi
        BUG_ON(!dblock);
        BUG_ON(!new);
 
+       bh.b_size = 1 << (inode->i_blkbits + 5);
        bmap_lock(inode, create);
-       ret = gfs2_block_pointers(inode, lblock, create, &bh, &mp, 32);
+       ret = gfs2_block_pointers(inode, lblock, create, &bh, &mp);
        bmap_unlock(inode, create);
        *extlen = bh.b_size >> inode->i_blkbits;
        *dblock = bh.b_blocknr;
index 0fd379b4cd9e7460feddd916f9a67f1b6f2e79c2..ac2fd04370dc445d4c21925d6ee86ea7942fa8f6 100644 (file)
@@ -15,7 +15,7 @@ struct gfs2_inode;
 struct page;
 
 int gfs2_unstuff_dinode(struct gfs2_inode *ip, struct page *page);
-int gfs2_block_map(struct inode *inode, u64 lblock, int create, struct buffer_head *bh, unsigned int maxlen);
+int gfs2_block_map(struct inode *inode, u64 lblock, int create, struct buffer_head *bh);
 int gfs2_extent_map(struct inode *inode, u64 lblock, int *new, u64 *dblock, unsigned *extlen);
 
 int gfs2_truncatei(struct gfs2_inode *ip, u64 size);
index 459498cac93bdbafc4ac4d9b40bf62f29e698071..e24af28b1a121e556ce19770682c4c9ae4df5fe1 100644 (file)
@@ -184,7 +184,7 @@ static int gfs2_dir_write_data(struct gfs2_inode *ip, const char *buf,
        while (copied < size) {
                unsigned int amount;
                struct buffer_head *bh;
-               int new;
+               int new = 0;
 
                amount = size - copied;
                if (amount > sdp->sd_sb.sb_bsize - o)
@@ -212,8 +212,6 @@ static int gfs2_dir_write_data(struct gfs2_inode *ip, const char *buf,
                gfs2_trans_add_bh(ip->i_gl, bh, 1);
                memcpy(bh->b_data + o, buf, amount);
                brelse(bh);
-               if (error)
-                       goto fail;
 
                buf += amount;
                copied += amount;
@@ -317,8 +315,7 @@ static int gfs2_dir_read_data(struct gfs2_inode *ip, char *buf, u64 offset,
                        if (!ra)
                                extlen = 1;
                        bh = gfs2_meta_ra(ip->i_gl, dblock, extlen);
-               }
-               if (!bh) {
+               } else {
                        error = gfs2_meta_read(ip->i_gl, dblock, DIO_WAIT, &bh);
                        if (error)
                                goto fail;
@@ -332,7 +329,6 @@ static int gfs2_dir_read_data(struct gfs2_inode *ip, char *buf, u64 offset,
                extlen--;
                memcpy(buf, bh->b_data + o, amount);
                brelse(bh);
-               bh = NULL;
                buf += amount;
                copied += amount;
                lblock++;
@@ -815,7 +811,7 @@ static struct gfs2_leaf *new_leaf(struct inode *inode, struct buffer_head **pbh,
        leaf = (struct gfs2_leaf *)bh->b_data;
        leaf->lf_depth = cpu_to_be16(depth);
        leaf->lf_entries = 0;
-       leaf->lf_dirent_format = cpu_to_be16(GFS2_FORMAT_DE);
+       leaf->lf_dirent_format = cpu_to_be32(GFS2_FORMAT_DE);
        leaf->lf_next = 0;
        memset(leaf->lf_reserved, 0, sizeof(leaf->lf_reserved));
        dent = (struct gfs2_dirent *)(leaf+1);
index 72eec6542d6a74adb1eff38ae850d7882e772a8c..0cace3da9dbb41795b6cacdbe97de52786d3678e 100644 (file)
@@ -312,10 +312,12 @@ void gfs2_log_release(struct gfs2_sbd *sdp, unsigned int blks)
 
 static u64 log_bmap(struct gfs2_sbd *sdp, unsigned int lbn)
 {
+       struct inode *inode = sdp->sd_jdesc->jd_inode;
        int error;
-       struct buffer_head bh_map;
+       struct buffer_head bh_map = { .b_state = 0, .b_blocknr = 0 };
 
-       error = gfs2_block_map(sdp->sd_jdesc->jd_inode, lbn, 0, &bh_map, 1);
+       bh_map.b_size = 1 << inode->i_blkbits;
+       error = gfs2_block_map(inode, lbn, 0, &bh_map);
        if (error || !bh_map.b_blocknr)
                printk(KERN_INFO "error=%d, dbn=%llu lbn=%u", error, bh_map.b_blocknr, lbn);
        gfs2_assert_withdraw(sdp, !error && bh_map.b_blocknr);
index e0599fed99ce0ff8e5f4a8786a469fdcfb911152..8d5963c7e123bbcd1e85b59c1eee629634750ca6 100644 (file)
@@ -65,7 +65,7 @@ static void gfs2_page_add_databufs(struct gfs2_inode *ip, struct page *page,
 int gfs2_get_block(struct inode *inode, sector_t lblock,
                   struct buffer_head *bh_result, int create)
 {
-       return gfs2_block_map(inode, lblock, create, bh_result, 32);
+       return gfs2_block_map(inode, lblock, create, bh_result);
 }
 
 /**
@@ -83,7 +83,7 @@ static int gfs2_get_block_noalloc(struct inode *inode, sector_t lblock,
 {
        int error;
 
-       error = gfs2_block_map(inode, lblock, 0, bh_result, 1);
+       error = gfs2_block_map(inode, lblock, 0, bh_result);
        if (error)
                return error;
        if (bh_result->b_blocknr == 0)
@@ -94,7 +94,7 @@ static int gfs2_get_block_noalloc(struct inode *inode, sector_t lblock,
 static int gfs2_get_block_direct(struct inode *inode, sector_t lblock,
                                 struct buffer_head *bh_result, int create)
 {
-       return gfs2_block_map(inode, lblock, 0, bh_result, 32);
+       return gfs2_block_map(inode, lblock, 0, bh_result);
 }
 
 /**
index 178b339118434004a25c383de97bd0b64eab3cf9..882873a6bd6909cf985c78ed859bbf54fb66c078 100644 (file)
@@ -794,8 +794,8 @@ static int fill_super_meta(struct super_block *sb, struct super_block *new,
                fs_err(sdp, "can't get root dentry\n");
                error = -ENOMEM;
                iput(inode);
-       }
-       new->s_root->d_op = &gfs2_dops;
+       } else
+               new->s_root->d_op = &gfs2_dops;
 
        return error;
 }
@@ -854,7 +854,6 @@ static int gfs2_get_sb_meta(struct file_system_type *fs_type, int flags,
        int error = 0;
        struct super_block *sb = NULL, *new;
        struct gfs2_sbd *sdp;
-       char *gfs2mnt = NULL;
 
        sb = get_gfs2_sb(dev_name);
        if (!sb) {
@@ -892,8 +891,6 @@ static int gfs2_get_sb_meta(struct file_system_type *fs_type, int flags,
        atomic_inc(&sdp->sd_gfs2mnt->mnt_count);
        return simple_set_mnt(mnt, new);
 error:
-       if (gfs2mnt)
-               kfree(gfs2mnt);
        return error;
 }
 
index c69b94a555880c9eb6006128468f58ad6e1cdf2f..a3deae7416c92d9ed8d78beae04dbea92165a73e 100644 (file)
@@ -251,7 +251,7 @@ static int bh_get(struct gfs2_quota_data *qd)
        unsigned int block, offset;
        struct buffer_head *bh;
        int error;
-       struct buffer_head bh_map;
+       struct buffer_head bh_map = { .b_state = 0, .b_blocknr = 0 };
 
        mutex_lock(&sdp->sd_quota_mutex);
 
@@ -263,7 +263,8 @@ static int bh_get(struct gfs2_quota_data *qd)
        block = qd->qd_slot / sdp->sd_qc_per_block;
        offset = qd->qd_slot % sdp->sd_qc_per_block;;
 
-       error = gfs2_block_map(&ip->i_inode, block, 0, &bh_map, 1);
+       bh_map.b_size = 1 << ip->i_inode.i_blkbits;
+       error = gfs2_block_map(&ip->i_inode, block, 0, &bh_map);
        if (error)
                goto fail;
        error = gfs2_meta_read(ip->i_gl, bh_map.b_blocknr, DIO_WAIT, &bh);
index 0a8a4b87dcc643038b36f3d56b2f6eb1f56d35f7..62cd223819b7aa4536335ef460ed9382ac90eb12 100644 (file)
@@ -372,11 +372,12 @@ static int clean_journal(struct gfs2_jdesc *jd, struct gfs2_log_header *head)
        u32 hash;
        struct buffer_head *bh;
        int error;
-       struct buffer_head bh_map;
+       struct buffer_head bh_map = { .b_state = 0, .b_blocknr = 0 };
 
        lblock = head->lh_blkno;
        gfs2_replay_incr_blk(sdp, &lblock);
-       error = gfs2_block_map(&ip->i_inode, lblock, 0, &bh_map, 1);
+       bh_map.b_size = 1 << ip->i_inode.i_blkbits;
+       error = gfs2_block_map(&ip->i_inode, lblock, 0, &bh_map);
        if (error)
                return error;
        if (!bh_map.b_blocknr) {
index d9a21d1229261313e37143472b66ae59e8455ae2..26cdb115ce67d5361222d39cf5e94039db654eec 100644 (file)
@@ -1306,6 +1306,42 @@ void wake_up_inode(struct inode *inode)
        wake_up_bit(&inode->i_state, __I_LOCK);
 }
 
+/*
+ * We rarely want to lock two inodes that do not have a parent/child
+ * relationship (such as directory, child inode) simultaneously. The
+ * vast majority of file systems should be able to get along fine
+ * without this. Do not use these functions except as a last resort.
+ */
+void inode_double_lock(struct inode *inode1, struct inode *inode2)
+{
+       if (inode1 == NULL || inode2 == NULL || inode1 == inode2) {
+               if (inode1)
+                       mutex_lock(&inode1->i_mutex);
+               else if (inode2)
+                       mutex_lock(&inode2->i_mutex);
+               return;
+       }
+
+       if (inode1 < inode2) {
+               mutex_lock_nested(&inode1->i_mutex, I_MUTEX_PARENT);
+               mutex_lock_nested(&inode2->i_mutex, I_MUTEX_CHILD);
+       } else {
+               mutex_lock_nested(&inode2->i_mutex, I_MUTEX_PARENT);
+               mutex_lock_nested(&inode1->i_mutex, I_MUTEX_CHILD);
+       }
+}
+EXPORT_SYMBOL(inode_double_lock);
+
+void inode_double_unlock(struct inode *inode1, struct inode *inode2)
+{
+       if (inode1)
+               mutex_unlock(&inode1->i_mutex);
+
+       if (inode2 && inode2 != inode1)
+               mutex_unlock(&inode2->i_mutex);
+}
+EXPORT_SYMBOL(inode_double_unlock);
+
 static __initdata unsigned long ihash_entries;
 static int __init set_ihash_entries(char *str)
 {
index e1b3c8af4d1767cd8b530e90cb482655f891fa6f..d5c63047a8b3f89584963a31c85e22f08ee831c6 100644 (file)
@@ -1314,13 +1314,14 @@ int journal_stop(handle_t *handle)
        int old_handle_count, err;
        pid_t pid;
 
-       J_ASSERT(transaction->t_updates > 0);
        J_ASSERT(journal_current_handle() == handle);
 
        if (is_handle_aborted(handle))
                err = -EIO;
-       else
+       else {
+               J_ASSERT(transaction->t_updates > 0);
                err = 0;
+       }
 
        if (--handle->h_ref > 0) {
                jbd_debug(4, "h_ref %d -> %d\n", handle->h_ref + 1,
index 10db92ced0140d2eea971d94784883e26f11b188..c60f378b0f7670dec45afd81cd576cb030a0a324 100644 (file)
@@ -725,6 +725,7 @@ journal_t * jbd2_journal_init_dev(struct block_device *bdev,
                        __FUNCTION__);
                kfree(journal);
                journal = NULL;
+               goto out;
        }
        journal->j_dev = bdev;
        journal->j_fs_dev = fs_dev;
@@ -735,7 +736,7 @@ journal_t * jbd2_journal_init_dev(struct block_device *bdev,
        J_ASSERT(bh != NULL);
        journal->j_sb_buffer = bh;
        journal->j_superblock = (journal_superblock_t *)bh->b_data;
-
+out:
        return journal;
 }
 
index 149957bef907cd39ab5442b786640e1dc209e7d0..b6cf2be845a1473c43652fe1731e5870db7693d2 100644 (file)
@@ -1314,13 +1314,14 @@ int jbd2_journal_stop(handle_t *handle)
        int old_handle_count, err;
        pid_t pid;
 
-       J_ASSERT(transaction->t_updates > 0);
        J_ASSERT(journal_current_handle() == handle);
 
        if (is_handle_aborted(handle))
                err = -EIO;
-       else
+       else {
+               J_ASSERT(transaction->t_updates > 0);
                err = 0;
+       }
 
        if (--handle->h_ref > 0) {
                jbd_debug(4, "h_ref %d -> %d\n", handle->h_ref + 1,
index e8c7765419e8c8e55e0f8a9d3a6706c149fcabba..b85a0ad2cfb622fee0986450f530b44d3f987b16 100644 (file)
@@ -100,12 +100,12 @@ int nlmclnt_block(struct nlm_wait *block, struct nlm_rqst *req, long timeout)
 /*
  * The server lockd has called us back to tell us the lock was granted
  */
-u32 nlmclnt_grant(const struct sockaddr_in *addr, const struct nlm_lock *lock)
+__be32 nlmclnt_grant(const struct sockaddr_in *addr, const struct nlm_lock *lock)
 {
        const struct file_lock *fl = &lock->fl;
        const struct nfs_fh *fh = &lock->fh;
        struct nlm_wait *block;
-       u32 res = nlm_lck_denied;
+       __be32 res = nlm_lck_denied;
 
        /*
         * Look up blocked request based on arguments. 
index e0179f8c327f65657ffb6b83e03fa88265dce0c5..eb243edf8932b36e58c26f72c24efeb46f1040b3 100644 (file)
@@ -148,8 +148,8 @@ nsm_create(void)
  * XDR functions for NSM.
  */
 
-static u32 *
-xdr_encode_common(struct rpc_rqst *rqstp, u32 *p, struct nsm_args *argp)
+static __be32 *
+xdr_encode_common(struct rpc_rqst *rqstp, __be32 *p, struct nsm_args *argp)
 {
        char    buffer[20], *name;
 
@@ -176,7 +176,7 @@ xdr_encode_common(struct rpc_rqst *rqstp, u32 *p, struct nsm_args *argp)
 }
 
 static int
-xdr_encode_mon(struct rpc_rqst *rqstp, u32 *p, struct nsm_args *argp)
+xdr_encode_mon(struct rpc_rqst *rqstp, __be32 *p, struct nsm_args *argp)
 {
        p = xdr_encode_common(rqstp, p, argp);
        if (IS_ERR(p))
@@ -192,7 +192,7 @@ xdr_encode_mon(struct rpc_rqst *rqstp, u32 *p, struct nsm_args *argp)
 }
 
 static int
-xdr_encode_unmon(struct rpc_rqst *rqstp, u32 *p, struct nsm_args *argp)
+xdr_encode_unmon(struct rpc_rqst *rqstp, __be32 *p, struct nsm_args *argp)
 {
        p = xdr_encode_common(rqstp, p, argp);
        if (IS_ERR(p))
@@ -202,7 +202,7 @@ xdr_encode_unmon(struct rpc_rqst *rqstp, u32 *p, struct nsm_args *argp)
 }
 
 static int
-xdr_decode_stat_res(struct rpc_rqst *rqstp, u32 *p, struct nsm_res *resp)
+xdr_decode_stat_res(struct rpc_rqst *rqstp, __be32 *p, struct nsm_res *resp)
 {
        resp->status = ntohl(*p++);
        resp->state = ntohl(*p++);
@@ -212,7 +212,7 @@ xdr_decode_stat_res(struct rpc_rqst *rqstp, u32 *p, struct nsm_res *resp)
 }
 
 static int
-xdr_decode_stat(struct rpc_rqst *rqstp, u32 *p, struct nsm_res *resp)
+xdr_decode_stat(struct rpc_rqst *rqstp, __be32 *p, struct nsm_res *resp)
 {
        resp->state = ntohl(*p++);
        return 0;
index fa370f6eb07b27ddf2b1dc2b984ed5633b3d7c82..0ce5c81ff5078076e3fd43f659fa0de561370917 100644 (file)
 /*
  * Obtain client and file from arguments
  */
-static u32
+static __be32
 nlm4svc_retrieve_args(struct svc_rqst *rqstp, struct nlm_args *argp,
                        struct nlm_host **hostp, struct nlm_file **filp)
 {
        struct nlm_host         *host = NULL;
        struct nlm_file         *file = NULL;
        struct nlm_lock         *lock = &argp->lock;
-       u32                     error = 0;
+       __be32                  error = 0;
 
        /* nfsd callbacks must have been installed for this procedure */
        if (!nlmsvc_ops)
@@ -68,7 +68,7 @@ no_locks:
 /*
  * NULL: Test for presence of service
  */
-static int
+static __be32
 nlm4svc_proc_null(struct svc_rqst *rqstp, void *argp, void *resp)
 {
        dprintk("lockd: NULL          called\n");
@@ -78,7 +78,7 @@ nlm4svc_proc_null(struct svc_rqst *rqstp, void *argp, void *resp)
 /*
  * TEST: Check for conflicting lock
  */
-static int
+static __be32
 nlm4svc_proc_test(struct svc_rqst *rqstp, struct nlm_args *argp,
                                         struct nlm_res  *resp)
 {
@@ -96,7 +96,7 @@ nlm4svc_proc_test(struct svc_rqst *rqstp, struct nlm_args *argp,
 
        /* Obtain client and file */
        if ((resp->status = nlm4svc_retrieve_args(rqstp, argp, &host, &file)))
-               return rpc_success;
+               return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success;
 
        /* Now check for conflicting locks */
        resp->status = nlmsvc_testlock(file, &argp->lock, &resp->lock);
@@ -107,7 +107,7 @@ nlm4svc_proc_test(struct svc_rqst *rqstp, struct nlm_args *argp,
        return rpc_success;
 }
 
-static int
+static __be32
 nlm4svc_proc_lock(struct svc_rqst *rqstp, struct nlm_args *argp,
                                         struct nlm_res  *resp)
 {
@@ -126,7 +126,7 @@ nlm4svc_proc_lock(struct svc_rqst *rqstp, struct nlm_args *argp,
 
        /* Obtain client and file */
        if ((resp->status = nlm4svc_retrieve_args(rqstp, argp, &host, &file)))
-               return rpc_success;
+               return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success;
 
 #if 0
        /* If supplied state doesn't match current state, we assume it's
@@ -150,7 +150,7 @@ nlm4svc_proc_lock(struct svc_rqst *rqstp, struct nlm_args *argp,
        return rpc_success;
 }
 
-static int
+static __be32
 nlm4svc_proc_cancel(struct svc_rqst *rqstp, struct nlm_args *argp,
                                           struct nlm_res  *resp)
 {
@@ -169,7 +169,7 @@ nlm4svc_proc_cancel(struct svc_rqst *rqstp, struct nlm_args *argp,
 
        /* Obtain client and file */
        if ((resp->status = nlm4svc_retrieve_args(rqstp, argp, &host, &file)))
-               return rpc_success;
+               return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success;
 
        /* Try to cancel request. */
        resp->status = nlmsvc_cancel_blocked(file, &argp->lock);
@@ -183,7 +183,7 @@ nlm4svc_proc_cancel(struct svc_rqst *rqstp, struct nlm_args *argp,
 /*
  * UNLOCK: release a lock
  */
-static int
+static __be32
 nlm4svc_proc_unlock(struct svc_rqst *rqstp, struct nlm_args *argp,
                                           struct nlm_res  *resp)
 {
@@ -202,7 +202,7 @@ nlm4svc_proc_unlock(struct svc_rqst *rqstp, struct nlm_args *argp,
 
        /* Obtain client and file */
        if ((resp->status = nlm4svc_retrieve_args(rqstp, argp, &host, &file)))
-               return rpc_success;
+               return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success;
 
        /* Now try to remove the lock */
        resp->status = nlmsvc_unlock(file, &argp->lock);
@@ -217,7 +217,7 @@ nlm4svc_proc_unlock(struct svc_rqst *rqstp, struct nlm_args *argp,
  * GRANTED: A server calls us to tell that a process' lock request
  * was granted
  */
-static int
+static __be32
 nlm4svc_proc_granted(struct svc_rqst *rqstp, struct nlm_args *argp,
                                            struct nlm_res  *resp)
 {
@@ -253,12 +253,12 @@ static const struct rpc_call_ops nlm4svc_callback_ops = {
  * because we send the callback before the reply proper. I hope this
  * doesn't break any clients.
  */
-static int nlm4svc_callback(struct svc_rqst *rqstp, u32 proc, struct nlm_args *argp,
-               int (*func)(struct svc_rqst *, struct nlm_args *, struct nlm_res  *))
+static __be32 nlm4svc_callback(struct svc_rqst *rqstp, u32 proc, struct nlm_args *argp,
+               __be32 (*func)(struct svc_rqst *, struct nlm_args *, struct nlm_res  *))
 {
        struct nlm_host *host;
        struct nlm_rqst *call;
-       int stat;
+       __be32 stat;
 
        host = nlmsvc_lookup_host(rqstp,
                                  argp->lock.caller,
@@ -282,35 +282,35 @@ static int nlm4svc_callback(struct svc_rqst *rqstp, u32 proc, struct nlm_args *a
        return rpc_success;
 }
 
-static int nlm4svc_proc_test_msg(struct svc_rqst *rqstp, struct nlm_args *argp,
+static __be32 nlm4svc_proc_test_msg(struct svc_rqst *rqstp, struct nlm_args *argp,
                                             void            *resp)
 {
        dprintk("lockd: TEST_MSG      called\n");
        return nlm4svc_callback(rqstp, NLMPROC_TEST_RES, argp, nlm4svc_proc_test);
 }
 
-static int nlm4svc_proc_lock_msg(struct svc_rqst *rqstp, struct nlm_args *argp,
+static __be32 nlm4svc_proc_lock_msg(struct svc_rqst *rqstp, struct nlm_args *argp,
                                             void            *resp)
 {
        dprintk("lockd: LOCK_MSG      called\n");
        return nlm4svc_callback(rqstp, NLMPROC_LOCK_RES, argp, nlm4svc_proc_lock);
 }
 
-static int nlm4svc_proc_cancel_msg(struct svc_rqst *rqstp, struct nlm_args *argp,
+static __be32 nlm4svc_proc_cancel_msg(struct svc_rqst *rqstp, struct nlm_args *argp,
                                               void            *resp)
 {
        dprintk("lockd: CANCEL_MSG    called\n");
        return nlm4svc_callback(rqstp, NLMPROC_CANCEL_RES, argp, nlm4svc_proc_cancel);
 }
 
-static int nlm4svc_proc_unlock_msg(struct svc_rqst *rqstp, struct nlm_args *argp,
+static __be32 nlm4svc_proc_unlock_msg(struct svc_rqst *rqstp, struct nlm_args *argp,
                                                void            *resp)
 {
        dprintk("lockd: UNLOCK_MSG    called\n");
        return nlm4svc_callback(rqstp, NLMPROC_UNLOCK_RES, argp, nlm4svc_proc_unlock);
 }
 
-static int nlm4svc_proc_granted_msg(struct svc_rqst *rqstp, struct nlm_args *argp,
+static __be32 nlm4svc_proc_granted_msg(struct svc_rqst *rqstp, struct nlm_args *argp,
                                                 void            *resp)
 {
        dprintk("lockd: GRANTED_MSG   called\n");
@@ -320,7 +320,7 @@ static int nlm4svc_proc_granted_msg(struct svc_rqst *rqstp, struct nlm_args *arg
 /*
  * SHARE: create a DOS share or alter existing share.
  */
-static int
+static __be32
 nlm4svc_proc_share(struct svc_rqst *rqstp, struct nlm_args *argp,
                                          struct nlm_res  *resp)
 {
@@ -339,7 +339,7 @@ nlm4svc_proc_share(struct svc_rqst *rqstp, struct nlm_args *argp,
 
        /* Obtain client and file */
        if ((resp->status = nlm4svc_retrieve_args(rqstp, argp, &host, &file)))
-               return rpc_success;
+               return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success;
 
        /* Now try to create the share */
        resp->status = nlmsvc_share_file(host, file, argp);
@@ -353,7 +353,7 @@ nlm4svc_proc_share(struct svc_rqst *rqstp, struct nlm_args *argp,
 /*
  * UNSHARE: Release a DOS share.
  */
-static int
+static __be32
 nlm4svc_proc_unshare(struct svc_rqst *rqstp, struct nlm_args *argp,
                                            struct nlm_res  *resp)
 {
@@ -372,7 +372,7 @@ nlm4svc_proc_unshare(struct svc_rqst *rqstp, struct nlm_args *argp,
 
        /* Obtain client and file */
        if ((resp->status = nlm4svc_retrieve_args(rqstp, argp, &host, &file)))
-               return rpc_success;
+               return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success;
 
        /* Now try to lock the file */
        resp->status = nlmsvc_unshare_file(host, file, argp);
@@ -386,7 +386,7 @@ nlm4svc_proc_unshare(struct svc_rqst *rqstp, struct nlm_args *argp,
 /*
  * NM_LOCK: Create an unmonitored lock
  */
-static int
+static __be32
 nlm4svc_proc_nm_lock(struct svc_rqst *rqstp, struct nlm_args *argp,
                                            struct nlm_res  *resp)
 {
@@ -399,7 +399,7 @@ nlm4svc_proc_nm_lock(struct svc_rqst *rqstp, struct nlm_args *argp,
 /*
  * FREE_ALL: Release all locks and shares held by client
  */
-static int
+static __be32
 nlm4svc_proc_free_all(struct svc_rqst *rqstp, struct nlm_args *argp,
                                             void            *resp)
 {
@@ -417,7 +417,7 @@ nlm4svc_proc_free_all(struct svc_rqst *rqstp, struct nlm_args *argp,
 /*
  * SM_NOTIFY: private callback from statd (not part of official NLM proto)
  */
-static int
+static __be32
 nlm4svc_proc_sm_notify(struct svc_rqst *rqstp, struct nlm_reboot *argp,
                                              void              *resp)
 {
@@ -446,7 +446,7 @@ nlm4svc_proc_sm_notify(struct svc_rqst *rqstp, struct nlm_reboot *argp,
 /*
  * client sent a GRANTED_RES, let's remove the associated block
  */
-static int
+static __be32
 nlm4svc_proc_granted_res(struct svc_rqst *rqstp, struct nlm_res  *argp,
                                                 void            *resp)
 {
index 814c6064c9e0514fef4a712a2f1be156afb7fb25..7e219b93855274dd053551b6c2c09b6f747b464d 100644 (file)
@@ -334,13 +334,13 @@ static void nlmsvc_freegrantargs(struct nlm_rqst *call)
  * Attempt to establish a lock, and if it can't be granted, block it
  * if required.
  */
-u32
+__be32
 nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file,
                        struct nlm_lock *lock, int wait, struct nlm_cookie *cookie)
 {
        struct nlm_block        *block, *newblock = NULL;
        int                     error;
-       u32                     ret;
+       __be32                  ret;
 
        dprintk("lockd: nlmsvc_lock(%s/%ld, ty=%d, pi=%d, %Ld-%Ld, bl=%d)\n",
                                file->f_file->f_dentry->d_inode->i_sb->s_id,
@@ -415,7 +415,7 @@ out:
 /*
  * Test for presence of a conflicting lock.
  */
-u32
+__be32
 nlmsvc_testlock(struct nlm_file *file, struct nlm_lock *lock,
                                       struct nlm_lock *conflock)
 {
@@ -448,7 +448,7 @@ nlmsvc_testlock(struct nlm_file *file, struct nlm_lock *lock,
  * afterwards. In this case the block will still be there, and hence
  * must be removed.
  */
-u32
+__be32
 nlmsvc_unlock(struct nlm_file *file, struct nlm_lock *lock)
 {
        int     error;
@@ -476,7 +476,7 @@ nlmsvc_unlock(struct nlm_file *file, struct nlm_lock *lock)
  * be in progress.
  * The calling procedure must check whether the file can be closed.
  */
-u32
+__be32
 nlmsvc_cancel_blocked(struct nlm_file *file, struct nlm_lock *lock)
 {
        struct nlm_block        *block;
index 75b2c81bcb93c01782710b7a36fc501aea42ca9a..32e99a6e8dcad6c20964d63d3dcb5d460423b495 100644 (file)
@@ -22,8 +22,8 @@
 #define NLMDBG_FACILITY                NLMDBG_CLIENT
 
 #ifdef CONFIG_LOCKD_V4
-static u32
-cast_to_nlm(u32 status, u32 vers)
+static __be32
+cast_to_nlm(__be32 status, u32 vers)
 {
        /* Note: status is assumed to be in network byte order !!! */
        if (vers != 4){
@@ -52,14 +52,14 @@ cast_to_nlm(u32 status, u32 vers)
 /*
  * Obtain client and file from arguments
  */
-static u32
+static __be32
 nlmsvc_retrieve_args(struct svc_rqst *rqstp, struct nlm_args *argp,
                        struct nlm_host **hostp, struct nlm_file **filp)
 {
        struct nlm_host         *host = NULL;
        struct nlm_file         *file = NULL;
        struct nlm_lock         *lock = &argp->lock;
-       u32                     error;
+       __be32                  error = 0;
 
        /* nfsd callbacks must have been installed for this procedure */
        if (!nlmsvc_ops)
@@ -88,13 +88,15 @@ nlmsvc_retrieve_args(struct svc_rqst *rqstp, struct nlm_args *argp,
 no_locks:
        if (host)
                nlm_release_host(host);
+       if (error)
+               return error;
        return nlm_lck_denied_nolocks;
 }
 
 /*
  * NULL: Test for presence of service
  */
-static int
+static __be32
 nlmsvc_proc_null(struct svc_rqst *rqstp, void *argp, void *resp)
 {
        dprintk("lockd: NULL          called\n");
@@ -104,7 +106,7 @@ nlmsvc_proc_null(struct svc_rqst *rqstp, void *argp, void *resp)
 /*
  * TEST: Check for conflicting lock
  */
-static int
+static __be32
 nlmsvc_proc_test(struct svc_rqst *rqstp, struct nlm_args *argp,
                                         struct nlm_res  *resp)
 {
@@ -122,7 +124,7 @@ nlmsvc_proc_test(struct svc_rqst *rqstp, struct nlm_args *argp,
 
        /* Obtain client and file */
        if ((resp->status = nlmsvc_retrieve_args(rqstp, argp, &host, &file)))
-               return rpc_success;
+               return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success;
 
        /* Now check for conflicting locks */
        resp->status = cast_status(nlmsvc_testlock(file, &argp->lock, &resp->lock));
@@ -134,7 +136,7 @@ nlmsvc_proc_test(struct svc_rqst *rqstp, struct nlm_args *argp,
        return rpc_success;
 }
 
-static int
+static __be32
 nlmsvc_proc_lock(struct svc_rqst *rqstp, struct nlm_args *argp,
                                         struct nlm_res  *resp)
 {
@@ -153,7 +155,7 @@ nlmsvc_proc_lock(struct svc_rqst *rqstp, struct nlm_args *argp,
 
        /* Obtain client and file */
        if ((resp->status = nlmsvc_retrieve_args(rqstp, argp, &host, &file)))
-               return rpc_success;
+               return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success;
 
 #if 0
        /* If supplied state doesn't match current state, we assume it's
@@ -177,7 +179,7 @@ nlmsvc_proc_lock(struct svc_rqst *rqstp, struct nlm_args *argp,
        return rpc_success;
 }
 
-static int
+static __be32
 nlmsvc_proc_cancel(struct svc_rqst *rqstp, struct nlm_args *argp,
                                           struct nlm_res  *resp)
 {
@@ -196,7 +198,7 @@ nlmsvc_proc_cancel(struct svc_rqst *rqstp, struct nlm_args *argp,
 
        /* Obtain client and file */
        if ((resp->status = nlmsvc_retrieve_args(rqstp, argp, &host, &file)))
-               return rpc_success;
+               return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success;
 
        /* Try to cancel request. */
        resp->status = cast_status(nlmsvc_cancel_blocked(file, &argp->lock));
@@ -210,7 +212,7 @@ nlmsvc_proc_cancel(struct svc_rqst *rqstp, struct nlm_args *argp,
 /*
  * UNLOCK: release a lock
  */
-static int
+static __be32
 nlmsvc_proc_unlock(struct svc_rqst *rqstp, struct nlm_args *argp,
                                           struct nlm_res  *resp)
 {
@@ -229,7 +231,7 @@ nlmsvc_proc_unlock(struct svc_rqst *rqstp, struct nlm_args *argp,
 
        /* Obtain client and file */
        if ((resp->status = nlmsvc_retrieve_args(rqstp, argp, &host, &file)))
-               return rpc_success;
+               return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success;
 
        /* Now try to remove the lock */
        resp->status = cast_status(nlmsvc_unlock(file, &argp->lock));
@@ -244,7 +246,7 @@ nlmsvc_proc_unlock(struct svc_rqst *rqstp, struct nlm_args *argp,
  * GRANTED: A server calls us to tell that a process' lock request
  * was granted
  */
-static int
+static __be32
 nlmsvc_proc_granted(struct svc_rqst *rqstp, struct nlm_args *argp,
                                            struct nlm_res  *resp)
 {
@@ -280,12 +282,12 @@ static const struct rpc_call_ops nlmsvc_callback_ops = {
  * because we send the callback before the reply proper. I hope this
  * doesn't break any clients.
  */
-static int nlmsvc_callback(struct svc_rqst *rqstp, u32 proc, struct nlm_args *argp,
-               int (*func)(struct svc_rqst *, struct nlm_args *, struct nlm_res  *))
+static __be32 nlmsvc_callback(struct svc_rqst *rqstp, u32 proc, struct nlm_args *argp,
+               __be32 (*func)(struct svc_rqst *, struct nlm_args *, struct nlm_res  *))
 {
        struct nlm_host *host;
        struct nlm_rqst *call;
-       int stat;
+       __be32 stat;
 
        host = nlmsvc_lookup_host(rqstp,
                                  argp->lock.caller,
@@ -309,28 +311,28 @@ static int nlmsvc_callback(struct svc_rqst *rqstp, u32 proc, struct nlm_args *ar
        return rpc_success;
 }
 
-static int nlmsvc_proc_test_msg(struct svc_rqst *rqstp, struct nlm_args *argp,
+static __be32 nlmsvc_proc_test_msg(struct svc_rqst *rqstp, struct nlm_args *argp,
                                             void            *resp)
 {
        dprintk("lockd: TEST_MSG      called\n");
        return nlmsvc_callback(rqstp, NLMPROC_TEST_RES, argp, nlmsvc_proc_test);
 }
 
-static int nlmsvc_proc_lock_msg(struct svc_rqst *rqstp, struct nlm_args *argp,
+static __be32 nlmsvc_proc_lock_msg(struct svc_rqst *rqstp, struct nlm_args *argp,
                                             void            *resp)
 {
        dprintk("lockd: LOCK_MSG      called\n");
        return nlmsvc_callback(rqstp, NLMPROC_LOCK_RES, argp, nlmsvc_proc_lock);
 }
 
-static int nlmsvc_proc_cancel_msg(struct svc_rqst *rqstp, struct nlm_args *argp,
+static __be32 nlmsvc_proc_cancel_msg(struct svc_rqst *rqstp, struct nlm_args *argp,
                                               void            *resp)
 {
        dprintk("lockd: CANCEL_MSG    called\n");
        return nlmsvc_callback(rqstp, NLMPROC_CANCEL_RES, argp, nlmsvc_proc_cancel);
 }
 
-static int
+static __be32
 nlmsvc_proc_unlock_msg(struct svc_rqst *rqstp, struct nlm_args *argp,
                                                void            *resp)
 {
@@ -338,7 +340,7 @@ nlmsvc_proc_unlock_msg(struct svc_rqst *rqstp, struct nlm_args *argp,
        return nlmsvc_callback(rqstp, NLMPROC_UNLOCK_RES, argp, nlmsvc_proc_unlock);
 }
 
-static int
+static __be32
 nlmsvc_proc_granted_msg(struct svc_rqst *rqstp, struct nlm_args *argp,
                                                 void            *resp)
 {
@@ -349,7 +351,7 @@ nlmsvc_proc_granted_msg(struct svc_rqst *rqstp, struct nlm_args *argp,
 /*
  * SHARE: create a DOS share or alter existing share.
  */
-static int
+static __be32
 nlmsvc_proc_share(struct svc_rqst *rqstp, struct nlm_args *argp,
                                          struct nlm_res  *resp)
 {
@@ -368,7 +370,7 @@ nlmsvc_proc_share(struct svc_rqst *rqstp, struct nlm_args *argp,
 
        /* Obtain client and file */
        if ((resp->status = nlmsvc_retrieve_args(rqstp, argp, &host, &file)))
-               return rpc_success;
+               return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success;
 
        /* Now try to create the share */
        resp->status = cast_status(nlmsvc_share_file(host, file, argp));
@@ -382,7 +384,7 @@ nlmsvc_proc_share(struct svc_rqst *rqstp, struct nlm_args *argp,
 /*
  * UNSHARE: Release a DOS share.
  */
-static int
+static __be32
 nlmsvc_proc_unshare(struct svc_rqst *rqstp, struct nlm_args *argp,
                                            struct nlm_res  *resp)
 {
@@ -401,7 +403,7 @@ nlmsvc_proc_unshare(struct svc_rqst *rqstp, struct nlm_args *argp,
 
        /* Obtain client and file */
        if ((resp->status = nlmsvc_retrieve_args(rqstp, argp, &host, &file)))
-               return rpc_success;
+               return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success;
 
        /* Now try to unshare the file */
        resp->status = cast_status(nlmsvc_unshare_file(host, file, argp));
@@ -415,7 +417,7 @@ nlmsvc_proc_unshare(struct svc_rqst *rqstp, struct nlm_args *argp,
 /*
  * NM_LOCK: Create an unmonitored lock
  */
-static int
+static __be32
 nlmsvc_proc_nm_lock(struct svc_rqst *rqstp, struct nlm_args *argp,
                                            struct nlm_res  *resp)
 {
@@ -428,7 +430,7 @@ nlmsvc_proc_nm_lock(struct svc_rqst *rqstp, struct nlm_args *argp,
 /*
  * FREE_ALL: Release all locks and shares held by client
  */
-static int
+static __be32
 nlmsvc_proc_free_all(struct svc_rqst *rqstp, struct nlm_args *argp,
                                             void            *resp)
 {
@@ -446,7 +448,7 @@ nlmsvc_proc_free_all(struct svc_rqst *rqstp, struct nlm_args *argp,
 /*
  * SM_NOTIFY: private callback from statd (not part of official NLM proto)
  */
-static int
+static __be32
 nlmsvc_proc_sm_notify(struct svc_rqst *rqstp, struct nlm_reboot *argp,
                                              void              *resp)
 {
@@ -475,7 +477,7 @@ nlmsvc_proc_sm_notify(struct svc_rqst *rqstp, struct nlm_reboot *argp,
 /*
  * client sent a GRANTED_RES, let's remove the associated block
  */
-static int
+static __be32
 nlmsvc_proc_granted_res(struct svc_rqst *rqstp, struct nlm_res  *argp,
                                                 void            *resp)
 {
index b9926ce8782e86b7782ab752e61474af35806cca..6220dc2a3f2c246e31817902a674648321fd6873 100644 (file)
@@ -23,7 +23,7 @@ nlm_cmp_owner(struct nlm_share *share, struct xdr_netobj *oh)
            && !memcmp(share->s_owner.data, oh->data, oh->len);
 }
 
-u32
+__be32
 nlmsvc_share_file(struct nlm_host *host, struct nlm_file *file,
                        struct nlm_args *argp)
 {
@@ -64,7 +64,7 @@ update:
 /*
  * Delete a share.
  */
-u32
+__be32
 nlmsvc_unshare_file(struct nlm_host *host, struct nlm_file *file,
                        struct nlm_args *argp)
 {
index 514f5f20701ea3d3cc8ba0410dd8fd3098e71c87..e83024e16042b57c9c13fc8d64f15573b7168416 100644 (file)
@@ -78,14 +78,14 @@ static inline unsigned int file_hash(struct nfs_fh *f)
  * This is not quite right, but for now, we assume the client performs
  * the proper R/W checking.
  */
-u32
+__be32
 nlm_lookup_file(struct svc_rqst *rqstp, struct nlm_file **result,
                                        struct nfs_fh *f)
 {
        struct hlist_node *pos;
        struct nlm_file *file;
        unsigned int    hash;
-       u32             nfserr;
+       __be32          nfserr;
 
        nlm_debug_print_fh("nlm_file_lookup", f);
 
@@ -135,12 +135,6 @@ out_unlock:
 
 out_free:
        kfree(file);
-#ifdef CONFIG_LOCKD_V4
-       if (nfserr == 1)
-               nfserr = nlm4_stale_fh;
-       else
-#endif
-       nfserr = nlm_lck_denied;
        goto out_unlock;
 }
 
@@ -324,7 +318,16 @@ nlmsvc_same_host(struct nlm_host *host, struct nlm_host *other)
 static int
 nlmsvc_is_client(struct nlm_host *host, struct nlm_host *dummy)
 {
-       return host->h_server;
+       if (host->h_server) {
+               /* we are destroying locks even though the client
+                * hasn't asked us too, so don't unmonitor the
+                * client
+                */
+               if (host->h_nsmhandle)
+                       host->h_nsmhandle->sm_sticky = 1;
+               return 1;
+       } else
+               return 0;
 }
 
 /*
index 61c46facf257413f21ca462a9466e402265df906..b7c949256e5a3c2b88d7cc74f673462b4ec9be70 100644 (file)
@@ -43,7 +43,7 @@ loff_t_to_s32(loff_t offset)
 /*
  * XDR functions for basic NLM types
  */
-static u32 *nlm_decode_cookie(u32 *p, struct nlm_cookie *c)
+static __be32 *nlm_decode_cookie(__be32 *p, struct nlm_cookie *c)
 {
        unsigned int    len;
 
@@ -69,8 +69,8 @@ static u32 *nlm_decode_cookie(u32 *p, struct nlm_cookie *c)
        return p;
 }
 
-static inline u32 *
-nlm_encode_cookie(u32 *p, struct nlm_cookie *c)
+static inline __be32 *
+nlm_encode_cookie(__be32 *p, struct nlm_cookie *c)
 {
        *p++ = htonl(c->len);
        memcpy(p, c->data, c->len);
@@ -78,8 +78,8 @@ nlm_encode_cookie(u32 *p, struct nlm_cookie *c)
        return p;
 }
 
-static u32 *
-nlm_decode_fh(u32 *p, struct nfs_fh *f)
+static __be32 *
+nlm_decode_fh(__be32 *p, struct nfs_fh *f)
 {
        unsigned int    len;
 
@@ -95,8 +95,8 @@ nlm_decode_fh(u32 *p, struct nfs_fh *f)
        return p + XDR_QUADLEN(NFS2_FHSIZE);
 }
 
-static inline u32 *
-nlm_encode_fh(u32 *p, struct nfs_fh *f)
+static inline __be32 *
+nlm_encode_fh(__be32 *p, struct nfs_fh *f)
 {
        *p++ = htonl(NFS2_FHSIZE);
        memcpy(p, f->data, NFS2_FHSIZE);
@@ -106,20 +106,20 @@ nlm_encode_fh(u32 *p, struct nfs_fh *f)
 /*
  * Encode and decode owner handle
  */
-static inline u32 *
-nlm_decode_oh(u32 *p, struct xdr_netobj *oh)
+static inline __be32 *
+nlm_decode_oh(__be32 *p, struct xdr_netobj *oh)
 {
        return xdr_decode_netobj(p, oh);
 }
 
-static inline u32 *
-nlm_encode_oh(u32 *p, struct xdr_netobj *oh)
+static inline __be32 *
+nlm_encode_oh(__be32 *p, struct xdr_netobj *oh)
 {
        return xdr_encode_netobj(p, oh);
 }
 
-static u32 *
-nlm_decode_lock(u32 *p, struct nlm_lock *lock)
+static __be32 *
+nlm_decode_lock(__be32 *p, struct nlm_lock *lock)
 {
        struct file_lock        *fl = &lock->fl;
        s32                     start, len, end;
@@ -153,8 +153,8 @@ nlm_decode_lock(u32 *p, struct nlm_lock *lock)
 /*
  * Encode a lock as part of an NLM call
  */
-static u32 *
-nlm_encode_lock(u32 *p, struct nlm_lock *lock)
+static __be32 *
+nlm_encode_lock(__be32 *p, struct nlm_lock *lock)
 {
        struct file_lock        *fl = &lock->fl;
        __s32                   start, len;
@@ -184,8 +184,8 @@ nlm_encode_lock(u32 *p, struct nlm_lock *lock)
 /*
  * Encode result of a TEST/TEST_MSG call
  */
-static u32 *
-nlm_encode_testres(u32 *p, struct nlm_res *resp)
+static __be32 *
+nlm_encode_testres(__be32 *p, struct nlm_res *resp)
 {
        s32             start, len;
 
@@ -221,7 +221,7 @@ nlm_encode_testres(u32 *p, struct nlm_res *resp)
  * First, the server side XDR functions
  */
 int
-nlmsvc_decode_testargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp)
+nlmsvc_decode_testargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp)
 {
        u32     exclusive;
 
@@ -238,7 +238,7 @@ nlmsvc_decode_testargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp)
 }
 
 int
-nlmsvc_encode_testres(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp)
+nlmsvc_encode_testres(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp)
 {
        if (!(p = nlm_encode_testres(p, resp)))
                return 0;
@@ -246,7 +246,7 @@ nlmsvc_encode_testres(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp)
 }
 
 int
-nlmsvc_decode_lockargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp)
+nlmsvc_decode_lockargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp)
 {
        u32     exclusive;
 
@@ -266,7 +266,7 @@ nlmsvc_decode_lockargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp)
 }
 
 int
-nlmsvc_decode_cancargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp)
+nlmsvc_decode_cancargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp)
 {
        u32     exclusive;
 
@@ -282,7 +282,7 @@ nlmsvc_decode_cancargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp)
 }
 
 int
-nlmsvc_decode_unlockargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp)
+nlmsvc_decode_unlockargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp)
 {
        if (!(p = nlm_decode_cookie(p, &argp->cookie))
         || !(p = nlm_decode_lock(p, &argp->lock)))
@@ -292,7 +292,7 @@ nlmsvc_decode_unlockargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp)
 }
 
 int
-nlmsvc_decode_shareargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp)
+nlmsvc_decode_shareargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp)
 {
        struct nlm_lock *lock = &argp->lock;
 
@@ -313,7 +313,7 @@ nlmsvc_decode_shareargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp)
 }
 
 int
-nlmsvc_encode_shareres(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp)
+nlmsvc_encode_shareres(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp)
 {
        if (!(p = nlm_encode_cookie(p, &resp->cookie)))
                return 0;
@@ -323,7 +323,7 @@ nlmsvc_encode_shareres(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp)
 }
 
 int
-nlmsvc_encode_res(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp)
+nlmsvc_encode_res(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp)
 {
        if (!(p = nlm_encode_cookie(p, &resp->cookie)))
                return 0;
@@ -332,7 +332,7 @@ nlmsvc_encode_res(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp)
 }
 
 int
-nlmsvc_decode_notify(struct svc_rqst *rqstp, u32 *p, struct nlm_args *argp)
+nlmsvc_decode_notify(struct svc_rqst *rqstp, __be32 *p, struct nlm_args *argp)
 {
        struct nlm_lock *lock = &argp->lock;
 
@@ -344,7 +344,7 @@ nlmsvc_decode_notify(struct svc_rqst *rqstp, u32 *p, struct nlm_args *argp)
 }
 
 int
-nlmsvc_decode_reboot(struct svc_rqst *rqstp, u32 *p, struct nlm_reboot *argp)
+nlmsvc_decode_reboot(struct svc_rqst *rqstp, __be32 *p, struct nlm_reboot *argp)
 {
        if (!(p = xdr_decode_string_inplace(p, &argp->mon, &argp->len, SM_MAXSTRLEN)))
                return 0;
@@ -357,7 +357,7 @@ nlmsvc_decode_reboot(struct svc_rqst *rqstp, u32 *p, struct nlm_reboot *argp)
 }
 
 int
-nlmsvc_decode_res(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp)
+nlmsvc_decode_res(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp)
 {
        if (!(p = nlm_decode_cookie(p, &resp->cookie)))
                return 0;
@@ -366,13 +366,13 @@ nlmsvc_decode_res(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp)
 }
 
 int
-nlmsvc_decode_void(struct svc_rqst *rqstp, u32 *p, void *dummy)
+nlmsvc_decode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy)
 {
        return xdr_argsize_check(rqstp, p);
 }
 
 int
-nlmsvc_encode_void(struct svc_rqst *rqstp, u32 *p, void *dummy)
+nlmsvc_encode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy)
 {
        return xdr_ressize_check(rqstp, p);
 }
@@ -389,7 +389,7 @@ nlmclt_decode_void(struct rpc_rqst *req, u32 *p, void *ptr)
 #endif
 
 static int
-nlmclt_encode_testargs(struct rpc_rqst *req, u32 *p, nlm_args *argp)
+nlmclt_encode_testargs(struct rpc_rqst *req, __be32 *p, nlm_args *argp)
 {
        struct nlm_lock *lock = &argp->lock;
 
@@ -403,7 +403,7 @@ nlmclt_encode_testargs(struct rpc_rqst *req, u32 *p, nlm_args *argp)
 }
 
 static int
-nlmclt_decode_testres(struct rpc_rqst *req, u32 *p, struct nlm_res *resp)
+nlmclt_decode_testres(struct rpc_rqst *req, __be32 *p, struct nlm_res *resp)
 {
        if (!(p = nlm_decode_cookie(p, &resp->cookie)))
                return -EIO;
@@ -438,7 +438,7 @@ nlmclt_decode_testres(struct rpc_rqst *req, u32 *p, struct nlm_res *resp)
 
 
 static int
-nlmclt_encode_lockargs(struct rpc_rqst *req, u32 *p, nlm_args *argp)
+nlmclt_encode_lockargs(struct rpc_rqst *req, __be32 *p, nlm_args *argp)
 {
        struct nlm_lock *lock = &argp->lock;
 
@@ -455,7 +455,7 @@ nlmclt_encode_lockargs(struct rpc_rqst *req, u32 *p, nlm_args *argp)
 }
 
 static int
-nlmclt_encode_cancargs(struct rpc_rqst *req, u32 *p, nlm_args *argp)
+nlmclt_encode_cancargs(struct rpc_rqst *req, __be32 *p, nlm_args *argp)
 {
        struct nlm_lock *lock = &argp->lock;
 
@@ -470,7 +470,7 @@ nlmclt_encode_cancargs(struct rpc_rqst *req, u32 *p, nlm_args *argp)
 }
 
 static int
-nlmclt_encode_unlockargs(struct rpc_rqst *req, u32 *p, nlm_args *argp)
+nlmclt_encode_unlockargs(struct rpc_rqst *req, __be32 *p, nlm_args *argp)
 {
        struct nlm_lock *lock = &argp->lock;
 
@@ -483,7 +483,7 @@ nlmclt_encode_unlockargs(struct rpc_rqst *req, u32 *p, nlm_args *argp)
 }
 
 static int
-nlmclt_encode_res(struct rpc_rqst *req, u32 *p, struct nlm_res *resp)
+nlmclt_encode_res(struct rpc_rqst *req, __be32 *p, struct nlm_res *resp)
 {
        if (!(p = nlm_encode_cookie(p, &resp->cookie)))
                return -EIO;
@@ -493,7 +493,7 @@ nlmclt_encode_res(struct rpc_rqst *req, u32 *p, struct nlm_res *resp)
 }
 
 static int
-nlmclt_encode_testres(struct rpc_rqst *req, u32 *p, struct nlm_res *resp)
+nlmclt_encode_testres(struct rpc_rqst *req, __be32 *p, struct nlm_res *resp)
 {
        if (!(p = nlm_encode_testres(p, resp)))
                return -EIO;
@@ -502,7 +502,7 @@ nlmclt_encode_testres(struct rpc_rqst *req, u32 *p, struct nlm_res *resp)
 }
 
 static int
-nlmclt_decode_res(struct rpc_rqst *req, u32 *p, struct nlm_res *resp)
+nlmclt_decode_res(struct rpc_rqst *req, __be32 *p, struct nlm_res *resp)
 {
        if (!(p = nlm_decode_cookie(p, &resp->cookie)))
                return -EIO;
index 36eb175ec3356c23b4d9bab42ffe23945266904f..f4c0b2b9f75a7e87d778981d001efdf5e158fecd 100644 (file)
@@ -44,8 +44,8 @@ loff_t_to_s64(loff_t offset)
 /*
  * XDR functions for basic NLM types
  */
-static u32 *
-nlm4_decode_cookie(u32 *p, struct nlm_cookie *c)
+static __be32 *
+nlm4_decode_cookie(__be32 *p, struct nlm_cookie *c)
 {
        unsigned int    len;
 
@@ -71,8 +71,8 @@ nlm4_decode_cookie(u32 *p, struct nlm_cookie *c)
        return p;
 }
 
-static u32 *
-nlm4_encode_cookie(u32 *p, struct nlm_cookie *c)
+static __be32 *
+nlm4_encode_cookie(__be32 *p, struct nlm_cookie *c)
 {
        *p++ = htonl(c->len);
        memcpy(p, c->data, c->len);
@@ -80,8 +80,8 @@ nlm4_encode_cookie(u32 *p, struct nlm_cookie *c)
        return p;
 }
 
-static u32 *
-nlm4_decode_fh(u32 *p, struct nfs_fh *f)
+static __be32 *
+nlm4_decode_fh(__be32 *p, struct nfs_fh *f)
 {
        memset(f->data, 0, sizeof(f->data));
        f->size = ntohl(*p++);
@@ -95,8 +95,8 @@ nlm4_decode_fh(u32 *p, struct nfs_fh *f)
        return p + XDR_QUADLEN(f->size);
 }
 
-static u32 *
-nlm4_encode_fh(u32 *p, struct nfs_fh *f)
+static __be32 *
+nlm4_encode_fh(__be32 *p, struct nfs_fh *f)
 {
        *p++ = htonl(f->size);
        if (f->size) p[XDR_QUADLEN(f->size)-1] = 0; /* don't leak anything */
@@ -107,20 +107,20 @@ nlm4_encode_fh(u32 *p, struct nfs_fh *f)
 /*
  * Encode and decode owner handle
  */
-static u32 *
-nlm4_decode_oh(u32 *p, struct xdr_netobj *oh)
+static __be32 *
+nlm4_decode_oh(__be32 *p, struct xdr_netobj *oh)
 {
        return xdr_decode_netobj(p, oh);
 }
 
-static u32 *
-nlm4_encode_oh(u32 *p, struct xdr_netobj *oh)
+static __be32 *
+nlm4_encode_oh(__be32 *p, struct xdr_netobj *oh)
 {
        return xdr_encode_netobj(p, oh);
 }
 
-static u32 *
-nlm4_decode_lock(u32 *p, struct nlm_lock *lock)
+static __be32 *
+nlm4_decode_lock(__be32 *p, struct nlm_lock *lock)
 {
        struct file_lock        *fl = &lock->fl;
        __s64                   len, start, end;
@@ -153,8 +153,8 @@ nlm4_decode_lock(u32 *p, struct nlm_lock *lock)
 /*
  * Encode a lock as part of an NLM call
  */
-static u32 *
-nlm4_encode_lock(u32 *p, struct nlm_lock *lock)
+static __be32 *
+nlm4_encode_lock(__be32 *p, struct nlm_lock *lock)
 {
        struct file_lock        *fl = &lock->fl;
        __s64                   start, len;
@@ -185,8 +185,8 @@ nlm4_encode_lock(u32 *p, struct nlm_lock *lock)
 /*
  * Encode result of a TEST/TEST_MSG call
  */
-static u32 *
-nlm4_encode_testres(u32 *p, struct nlm_res *resp)
+static __be32 *
+nlm4_encode_testres(__be32 *p, struct nlm_res *resp)
 {
        s64             start, len;
 
@@ -227,7 +227,7 @@ nlm4_encode_testres(u32 *p, struct nlm_res *resp)
  * First, the server side XDR functions
  */
 int
-nlm4svc_decode_testargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp)
+nlm4svc_decode_testargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp)
 {
        u32     exclusive;
 
@@ -244,7 +244,7 @@ nlm4svc_decode_testargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp)
 }
 
 int
-nlm4svc_encode_testres(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp)
+nlm4svc_encode_testres(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp)
 {
        if (!(p = nlm4_encode_testres(p, resp)))
                return 0;
@@ -252,7 +252,7 @@ nlm4svc_encode_testres(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp)
 }
 
 int
-nlm4svc_decode_lockargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp)
+nlm4svc_decode_lockargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp)
 {
        u32     exclusive;
 
@@ -272,7 +272,7 @@ nlm4svc_decode_lockargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp)
 }
 
 int
-nlm4svc_decode_cancargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp)
+nlm4svc_decode_cancargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp)
 {
        u32     exclusive;
 
@@ -288,7 +288,7 @@ nlm4svc_decode_cancargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp)
 }
 
 int
-nlm4svc_decode_unlockargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp)
+nlm4svc_decode_unlockargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp)
 {
        if (!(p = nlm4_decode_cookie(p, &argp->cookie))
         || !(p = nlm4_decode_lock(p, &argp->lock)))
@@ -298,7 +298,7 @@ nlm4svc_decode_unlockargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp)
 }
 
 int
-nlm4svc_decode_shareargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp)
+nlm4svc_decode_shareargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp)
 {
        struct nlm_lock *lock = &argp->lock;
 
@@ -319,7 +319,7 @@ nlm4svc_decode_shareargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp)
 }
 
 int
-nlm4svc_encode_shareres(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp)
+nlm4svc_encode_shareres(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp)
 {
        if (!(p = nlm4_encode_cookie(p, &resp->cookie)))
                return 0;
@@ -329,7 +329,7 @@ nlm4svc_encode_shareres(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp)
 }
 
 int
-nlm4svc_encode_res(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp)
+nlm4svc_encode_res(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp)
 {
        if (!(p = nlm4_encode_cookie(p, &resp->cookie)))
                return 0;
@@ -338,7 +338,7 @@ nlm4svc_encode_res(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp)
 }
 
 int
-nlm4svc_decode_notify(struct svc_rqst *rqstp, u32 *p, struct nlm_args *argp)
+nlm4svc_decode_notify(struct svc_rqst *rqstp, __be32 *p, struct nlm_args *argp)
 {
        struct nlm_lock *lock = &argp->lock;
 
@@ -350,7 +350,7 @@ nlm4svc_decode_notify(struct svc_rqst *rqstp, u32 *p, struct nlm_args *argp)
 }
 
 int
-nlm4svc_decode_reboot(struct svc_rqst *rqstp, u32 *p, struct nlm_reboot *argp)
+nlm4svc_decode_reboot(struct svc_rqst *rqstp, __be32 *p, struct nlm_reboot *argp)
 {
        if (!(p = xdr_decode_string_inplace(p, &argp->mon, &argp->len, SM_MAXSTRLEN)))
                return 0;
@@ -363,7 +363,7 @@ nlm4svc_decode_reboot(struct svc_rqst *rqstp, u32 *p, struct nlm_reboot *argp)
 }
 
 int
-nlm4svc_decode_res(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp)
+nlm4svc_decode_res(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp)
 {
        if (!(p = nlm4_decode_cookie(p, &resp->cookie)))
                return 0;
@@ -372,13 +372,13 @@ nlm4svc_decode_res(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp)
 }
 
 int
-nlm4svc_decode_void(struct svc_rqst *rqstp, u32 *p, void *dummy)
+nlm4svc_decode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy)
 {
        return xdr_argsize_check(rqstp, p);
 }
 
 int
-nlm4svc_encode_void(struct svc_rqst *rqstp, u32 *p, void *dummy)
+nlm4svc_encode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy)
 {
        return xdr_ressize_check(rqstp, p);
 }
@@ -388,14 +388,14 @@ nlm4svc_encode_void(struct svc_rqst *rqstp, u32 *p, void *dummy)
  */
 #ifdef NLMCLNT_SUPPORT_SHARES
 static int
-nlm4clt_decode_void(struct rpc_rqst *req, u32 *p, void *ptr)
+nlm4clt_decode_void(struct rpc_rqst *req, __be32 *p, void *ptr)
 {
        return 0;
 }
 #endif
 
 static int
-nlm4clt_encode_testargs(struct rpc_rqst *req, u32 *p, nlm_args *argp)
+nlm4clt_encode_testargs(struct rpc_rqst *req, __be32 *p, nlm_args *argp)
 {
        struct nlm_lock *lock = &argp->lock;
 
@@ -409,7 +409,7 @@ nlm4clt_encode_testargs(struct rpc_rqst *req, u32 *p, nlm_args *argp)
 }
 
 static int
-nlm4clt_decode_testres(struct rpc_rqst *req, u32 *p, struct nlm_res *resp)
+nlm4clt_decode_testres(struct rpc_rqst *req, __be32 *p, struct nlm_res *resp)
 {
        if (!(p = nlm4_decode_cookie(p, &resp->cookie)))
                return -EIO;
@@ -444,7 +444,7 @@ nlm4clt_decode_testres(struct rpc_rqst *req, u32 *p, struct nlm_res *resp)
 
 
 static int
-nlm4clt_encode_lockargs(struct rpc_rqst *req, u32 *p, nlm_args *argp)
+nlm4clt_encode_lockargs(struct rpc_rqst *req, __be32 *p, nlm_args *argp)
 {
        struct nlm_lock *lock = &argp->lock;
 
@@ -461,7 +461,7 @@ nlm4clt_encode_lockargs(struct rpc_rqst *req, u32 *p, nlm_args *argp)
 }
 
 static int
-nlm4clt_encode_cancargs(struct rpc_rqst *req, u32 *p, nlm_args *argp)
+nlm4clt_encode_cancargs(struct rpc_rqst *req, __be32 *p, nlm_args *argp)
 {
        struct nlm_lock *lock = &argp->lock;
 
@@ -476,7 +476,7 @@ nlm4clt_encode_cancargs(struct rpc_rqst *req, u32 *p, nlm_args *argp)
 }
 
 static int
-nlm4clt_encode_unlockargs(struct rpc_rqst *req, u32 *p, nlm_args *argp)
+nlm4clt_encode_unlockargs(struct rpc_rqst *req, __be32 *p, nlm_args *argp)
 {
        struct nlm_lock *lock = &argp->lock;
 
@@ -489,7 +489,7 @@ nlm4clt_encode_unlockargs(struct rpc_rqst *req, u32 *p, nlm_args *argp)
 }
 
 static int
-nlm4clt_encode_res(struct rpc_rqst *req, u32 *p, struct nlm_res *resp)
+nlm4clt_encode_res(struct rpc_rqst *req, __be32 *p, struct nlm_res *resp)
 {
        if (!(p = nlm4_encode_cookie(p, &resp->cookie)))
                return -EIO;
@@ -499,7 +499,7 @@ nlm4clt_encode_res(struct rpc_rqst *req, u32 *p, struct nlm_res *resp)
 }
 
 static int
-nlm4clt_encode_testres(struct rpc_rqst *req, u32 *p, struct nlm_res *resp)
+nlm4clt_encode_testres(struct rpc_rqst *req, __be32 *p, struct nlm_res *resp)
 {
        if (!(p = nlm4_encode_testres(p, resp)))
                return -EIO;
@@ -508,7 +508,7 @@ nlm4clt_encode_testres(struct rpc_rqst *req, u32 *p, struct nlm_res *resp)
 }
 
 static int
-nlm4clt_decode_res(struct rpc_rqst *req, u32 *p, struct nlm_res *resp)
+nlm4clt_decode_res(struct rpc_rqst *req, __be32 *p, struct nlm_res *resp)
 {
        if (!(p = nlm4_decode_cookie(p, &resp->cookie)))
                return -EIO;
index 5676163d26e819c45e13617337916186e4335290..db3d7919c60131886f4272a77fd9d330d547de98 100644 (file)
@@ -31,10 +31,10 @@ struct cb_compound_hdr_arg {
 };
 
 struct cb_compound_hdr_res {
-       uint32_t *status;
+       __be32 *status;
        int taglen;
        const char *tag;
-       uint32_t *nops;
+       __be32 *nops;
 };
 
 struct cb_getattrargs {
@@ -44,7 +44,7 @@ struct cb_getattrargs {
 };
 
 struct cb_getattrres {
-       uint32_t status;
+       __be32 status;
        uint32_t bitmap[2];
        uint64_t size;
        uint64_t change_attr;
@@ -59,8 +59,8 @@ struct cb_recallargs {
        uint32_t truncate;
 };
 
-extern unsigned nfs4_callback_getattr(struct cb_getattrargs *args, struct cb_getattrres *res);
-extern unsigned nfs4_callback_recall(struct cb_recallargs *args, void *dummy);
+extern __be32 nfs4_callback_getattr(struct cb_getattrargs *args, struct cb_getattrres *res);
+extern __be32 nfs4_callback_recall(struct cb_recallargs *args, void *dummy);
 
 #ifdef CONFIG_NFS_V4
 extern int nfs_callback_up(void);
index 97cf8f71451ffbbd02e85d2d4c4061ee73dfb75a..72e55d83756d9b6d6b5e82a28040b58b0375cf9c 100644 (file)
@@ -14,7 +14,7 @@
 
 #define NFSDBG_FACILITY NFSDBG_CALLBACK
  
-unsigned nfs4_callback_getattr(struct cb_getattrargs *args, struct cb_getattrres *res)
+__be32 nfs4_callback_getattr(struct cb_getattrargs *args, struct cb_getattrres *res)
 {
        struct nfs_client *clp;
        struct nfs_delegation *delegation;
@@ -55,11 +55,11 @@ out:
        return res->status;
 }
 
-unsigned nfs4_callback_recall(struct cb_recallargs *args, void *dummy)
+__be32 nfs4_callback_recall(struct cb_recallargs *args, void *dummy)
 {
        struct nfs_client *clp;
        struct inode *inode;
-       unsigned res;
+       __be32 res;
        
        res = htonl(NFS4ERR_BADHANDLE);
        clp = nfs_find_client(args->addr, 4);
index 29f932192054004c6b0859fdacf89c530cab5a60..f8ea1f51f59094ad69ac7ec684884f5a05df7312 100644 (file)
@@ -22,9 +22,9 @@
 
 #define NFSDBG_FACILITY NFSDBG_CALLBACK
 
-typedef unsigned (*callback_process_op_t)(void *, void *);
-typedef unsigned (*callback_decode_arg_t)(struct svc_rqst *, struct xdr_stream *, void *);
-typedef unsigned (*callback_encode_res_t)(struct svc_rqst *, struct xdr_stream *, void *);
+typedef __be32 (*callback_process_op_t)(void *, void *);
+typedef __be32 (*callback_decode_arg_t)(struct svc_rqst *, struct xdr_stream *, void *);
+typedef __be32 (*callback_encode_res_t)(struct svc_rqst *, struct xdr_stream *, void *);
 
 
 struct callback_op {
@@ -36,24 +36,24 @@ struct callback_op {
 
 static struct callback_op callback_ops[];
 
-static int nfs4_callback_null(struct svc_rqst *rqstp, void *argp, void *resp)
+static __be32 nfs4_callback_null(struct svc_rqst *rqstp, void *argp, void *resp)
 {
        return htonl(NFS4_OK);
 }
 
-static int nfs4_decode_void(struct svc_rqst *rqstp, uint32_t *p, void *dummy)
+static int nfs4_decode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy)
 {
        return xdr_argsize_check(rqstp, p);
 }
 
-static int nfs4_encode_void(struct svc_rqst *rqstp, uint32_t *p, void *dummy)
+static int nfs4_encode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy)
 {
        return xdr_ressize_check(rqstp, p);
 }
 
-static uint32_t *read_buf(struct xdr_stream *xdr, int nbytes)
+static __be32 *read_buf(struct xdr_stream *xdr, int nbytes)
 {
-       uint32_t *p;
+       __be32 *p;
 
        p = xdr_inline_decode(xdr, nbytes);
        if (unlikely(p == NULL))
@@ -61,9 +61,9 @@ static uint32_t *read_buf(struct xdr_stream *xdr, int nbytes)
        return p;
 }
 
-static unsigned decode_string(struct xdr_stream *xdr, unsigned int *len, const char **str)
+static __be32 decode_string(struct xdr_stream *xdr, unsigned int *len, const char **str)
 {
-       uint32_t *p;
+       __be32 *p;
 
        p = read_buf(xdr, 4);
        if (unlikely(p == NULL))
@@ -81,9 +81,9 @@ static unsigned decode_string(struct xdr_stream *xdr, unsigned int *len, const c
        return 0;
 }
 
-static unsigned decode_fh(struct xdr_stream *xdr, struct nfs_fh *fh)
+static __be32 decode_fh(struct xdr_stream *xdr, struct nfs_fh *fh)
 {
-       uint32_t *p;
+       __be32 *p;
 
        p = read_buf(xdr, 4);
        if (unlikely(p == NULL))
@@ -99,9 +99,9 @@ static unsigned decode_fh(struct xdr_stream *xdr, struct nfs_fh *fh)
        return 0;
 }
 
-static unsigned decode_bitmap(struct xdr_stream *xdr, uint32_t *bitmap)
+static __be32 decode_bitmap(struct xdr_stream *xdr, uint32_t *bitmap)
 {
-       uint32_t *p;
+       __be32 *p;
        unsigned int attrlen;
 
        p = read_buf(xdr, 4);
@@ -118,9 +118,9 @@ static unsigned decode_bitmap(struct xdr_stream *xdr, uint32_t *bitmap)
        return 0;
 }
 
-static unsigned decode_stateid(struct xdr_stream *xdr, nfs4_stateid *stateid)
+static __be32 decode_stateid(struct xdr_stream *xdr, nfs4_stateid *stateid)
 {
-       uint32_t *p;
+       __be32 *p;
 
        p = read_buf(xdr, 16);
        if (unlikely(p == NULL))
@@ -129,11 +129,11 @@ static unsigned decode_stateid(struct xdr_stream *xdr, nfs4_stateid *stateid)
        return 0;
 }
 
-static unsigned decode_compound_hdr_arg(struct xdr_stream *xdr, struct cb_compound_hdr_arg *hdr)
+static __be32 decode_compound_hdr_arg(struct xdr_stream *xdr, struct cb_compound_hdr_arg *hdr)
 {
-       uint32_t *p;
+       __be32 *p;
        unsigned int minor_version;
-       unsigned status;
+       __be32 status;
 
        status = decode_string(xdr, &hdr->taglen, &hdr->tag);
        if (unlikely(status != 0))
@@ -159,9 +159,9 @@ static unsigned decode_compound_hdr_arg(struct xdr_stream *xdr, struct cb_compou
        return 0;
 }
 
-static unsigned decode_op_hdr(struct xdr_stream *xdr, unsigned int *op)
+static __be32 decode_op_hdr(struct xdr_stream *xdr, unsigned int *op)
 {
-       uint32_t *p;
+       __be32 *p;
        p = read_buf(xdr, 4);
        if (unlikely(p == NULL))
                return htonl(NFS4ERR_RESOURCE);
@@ -169,9 +169,9 @@ static unsigned decode_op_hdr(struct xdr_stream *xdr, unsigned int *op)
        return 0;
 }
 
-static unsigned decode_getattr_args(struct svc_rqst *rqstp, struct xdr_stream *xdr, struct cb_getattrargs *args)
+static __be32 decode_getattr_args(struct svc_rqst *rqstp, struct xdr_stream *xdr, struct cb_getattrargs *args)
 {
-       unsigned status;
+       __be32 status;
 
        status = decode_fh(xdr, &args->fh);
        if (unlikely(status != 0))
@@ -183,10 +183,10 @@ out:
        return status;
 }
 
-static unsigned decode_recall_args(struct svc_rqst *rqstp, struct xdr_stream *xdr, struct cb_recallargs *args)
+static __be32 decode_recall_args(struct svc_rqst *rqstp, struct xdr_stream *xdr, struct cb_recallargs *args)
 {
-       uint32_t *p;
-       unsigned status;
+       __be32 *p;
+       __be32 status;
 
        args->addr = &rqstp->rq_addr;
        status = decode_stateid(xdr, &args->stateid);
@@ -204,9 +204,9 @@ out:
        return status;
 }
 
-static unsigned encode_string(struct xdr_stream *xdr, unsigned int len, const char *str)
+static __be32 encode_string(struct xdr_stream *xdr, unsigned int len, const char *str)
 {
-       uint32_t *p;
+       __be32 *p;
 
        p = xdr_reserve_space(xdr, 4 + len);
        if (unlikely(p == NULL))
@@ -217,10 +217,10 @@ static unsigned encode_string(struct xdr_stream *xdr, unsigned int len, const ch
 
 #define CB_SUPPORTED_ATTR0 (FATTR4_WORD0_CHANGE|FATTR4_WORD0_SIZE)
 #define CB_SUPPORTED_ATTR1 (FATTR4_WORD1_TIME_METADATA|FATTR4_WORD1_TIME_MODIFY)
-static unsigned encode_attr_bitmap(struct xdr_stream *xdr, const uint32_t *bitmap, uint32_t **savep)
+static __be32 encode_attr_bitmap(struct xdr_stream *xdr, const uint32_t *bitmap, __be32 **savep)
 {
-       uint32_t bm[2];
-       uint32_t *p;
+       __be32 bm[2];
+       __be32 *p;
 
        bm[0] = htonl(bitmap[0] & CB_SUPPORTED_ATTR0);
        bm[1] = htonl(bitmap[1] & CB_SUPPORTED_ATTR1);
@@ -247,9 +247,9 @@ static unsigned encode_attr_bitmap(struct xdr_stream *xdr, const uint32_t *bitma
        return 0;
 }
 
-static unsigned encode_attr_change(struct xdr_stream *xdr, const uint32_t *bitmap, uint64_t change)
+static __be32 encode_attr_change(struct xdr_stream *xdr, const uint32_t *bitmap, uint64_t change)
 {
-       uint32_t *p;
+       __be32 *p;
 
        if (!(bitmap[0] & FATTR4_WORD0_CHANGE))
                return 0;
@@ -260,9 +260,9 @@ static unsigned encode_attr_change(struct xdr_stream *xdr, const uint32_t *bitma
        return 0;
 }
 
-static unsigned encode_attr_size(struct xdr_stream *xdr, const uint32_t *bitmap, uint64_t size)
+static __be32 encode_attr_size(struct xdr_stream *xdr, const uint32_t *bitmap, uint64_t size)
 {
-       uint32_t *p;
+       __be32 *p;
 
        if (!(bitmap[0] & FATTR4_WORD0_SIZE))
                return 0;
@@ -273,9 +273,9 @@ static unsigned encode_attr_size(struct xdr_stream *xdr, const uint32_t *bitmap,
        return 0;
 }
 
-static unsigned encode_attr_time(struct xdr_stream *xdr, const struct timespec *time)
+static __be32 encode_attr_time(struct xdr_stream *xdr, const struct timespec *time)
 {
-       uint32_t *p;
+       __be32 *p;
 
        p = xdr_reserve_space(xdr, 12);
        if (unlikely(p == 0))
@@ -285,23 +285,23 @@ static unsigned encode_attr_time(struct xdr_stream *xdr, const struct timespec *
        return 0;
 }
 
-static unsigned encode_attr_ctime(struct xdr_stream *xdr, const uint32_t *bitmap, const struct timespec *time)
+static __be32 encode_attr_ctime(struct xdr_stream *xdr, const uint32_t *bitmap, const struct timespec *time)
 {
        if (!(bitmap[1] & FATTR4_WORD1_TIME_METADATA))
                return 0;
        return encode_attr_time(xdr,time);
 }
 
-static unsigned encode_attr_mtime(struct xdr_stream *xdr, const uint32_t *bitmap, const struct timespec *time)
+static __be32 encode_attr_mtime(struct xdr_stream *xdr, const uint32_t *bitmap, const struct timespec *time)
 {
        if (!(bitmap[1] & FATTR4_WORD1_TIME_MODIFY))
                return 0;
        return encode_attr_time(xdr,time);
 }
 
-static unsigned encode_compound_hdr_res(struct xdr_stream *xdr, struct cb_compound_hdr_res *hdr)
+static __be32 encode_compound_hdr_res(struct xdr_stream *xdr, struct cb_compound_hdr_res *hdr)
 {
-       unsigned status;
+       __be32 status;
 
        hdr->status = xdr_reserve_space(xdr, 4);
        if (unlikely(hdr->status == NULL))
@@ -315,9 +315,9 @@ static unsigned encode_compound_hdr_res(struct xdr_stream *xdr, struct cb_compou
        return 0;
 }
 
-static unsigned encode_op_hdr(struct xdr_stream *xdr, uint32_t op, uint32_t res)
+static __be32 encode_op_hdr(struct xdr_stream *xdr, uint32_t op, __be32 res)
 {
-       uint32_t *p;
+       __be32 *p;
        
        p = xdr_reserve_space(xdr, 8);
        if (unlikely(p == NULL))
@@ -327,10 +327,10 @@ static unsigned encode_op_hdr(struct xdr_stream *xdr, uint32_t op, uint32_t res)
        return 0;
 }
 
-static unsigned encode_getattr_res(struct svc_rqst *rqstp, struct xdr_stream *xdr, const struct cb_getattrres *res)
+static __be32 encode_getattr_res(struct svc_rqst *rqstp, struct xdr_stream *xdr, const struct cb_getattrres *res)
 {
-       uint32_t *savep = NULL;
-       unsigned status = res->status;
+       __be32 *savep = NULL;
+       __be32 status = res->status;
        
        if (unlikely(status != 0))
                goto out;
@@ -353,15 +353,15 @@ out:
        return status;
 }
 
-static unsigned process_op(struct svc_rqst *rqstp,
+static __be32 process_op(struct svc_rqst *rqstp,
                struct xdr_stream *xdr_in, void *argp,
                struct xdr_stream *xdr_out, void *resp)
 {
        struct callback_op *op = &callback_ops[0];
        unsigned int op_nr = OP_CB_ILLEGAL;
-       unsigned int status = 0;
+       __be32 status = 0;
        long maxlen;
-       unsigned res;
+       __be32 res;
 
        dprintk("%s: start\n", __FUNCTION__);
        status = decode_op_hdr(xdr_in, &op_nr);
@@ -399,20 +399,20 @@ static unsigned process_op(struct svc_rqst *rqstp,
 /*
  * Decode, process and encode a COMPOUND
  */
-static int nfs4_callback_compound(struct svc_rqst *rqstp, void *argp, void *resp)
+static __be32 nfs4_callback_compound(struct svc_rqst *rqstp, void *argp, void *resp)
 {
        struct cb_compound_hdr_arg hdr_arg;
        struct cb_compound_hdr_res hdr_res;
        struct xdr_stream xdr_in, xdr_out;
-       uint32_t *p;
-       unsigned int status;
+       __be32 *p;
+       __be32 status;
        unsigned int nops = 1;
 
        dprintk("%s: start\n", __FUNCTION__);
 
        xdr_init_decode(&xdr_in, &rqstp->rq_arg, rqstp->rq_arg.head[0].iov_base);
 
-       p = (uint32_t*)((char *)rqstp->rq_res.head[0].iov_base + rqstp->rq_res.head[0].iov_len);
+       p = (__be32*)((char *)rqstp->rq_res.head[0].iov_base + rqstp->rq_res.head[0].iov_len);
        xdr_init_encode(&xdr_out, &rqstp->rq_res, p);
 
        decode_compound_hdr_arg(&xdr_in, &hdr_arg);
index 34c3996bd0f582438164602a64a6dbd5254e1247..5fea638743e4107aadcd8cbd18cd46d78e331cf0 100644 (file)
@@ -232,11 +232,15 @@ void nfs_put_client(struct nfs_client *clp)
  * Find a client by address
  * - caller must hold nfs_client_lock
  */
-static struct nfs_client *__nfs_find_client(const struct sockaddr_in *addr, int nfsversion)
+static struct nfs_client *__nfs_find_client(const struct sockaddr_in *addr, int nfsversion, int match_port)
 {
        struct nfs_client *clp;
 
        list_for_each_entry(clp, &nfs_client_list, cl_share_link) {
+               /* Don't match clients that failed to initialise properly */
+               if (clp->cl_cons_state < 0)
+                       continue;
+
                /* Different NFS versions cannot share the same nfs_client */
                if (clp->cl_nfsversion != nfsversion)
                        continue;
@@ -245,7 +249,7 @@ static struct nfs_client *__nfs_find_client(const struct sockaddr_in *addr, int
                           sizeof(clp->cl_addr.sin_addr)) != 0)
                        continue;
 
-               if (clp->cl_addr.sin_port == addr->sin_port)
+               if (!match_port || clp->cl_addr.sin_port == addr->sin_port)
                        goto found;
        }
 
@@ -265,11 +269,12 @@ struct nfs_client *nfs_find_client(const struct sockaddr_in *addr, int nfsversio
        struct nfs_client *clp;
 
        spin_lock(&nfs_client_lock);
-       clp = __nfs_find_client(addr, nfsversion);
+       clp = __nfs_find_client(addr, nfsversion, 0);
        spin_unlock(&nfs_client_lock);
-
-       BUG_ON(clp && clp->cl_cons_state == 0);
-
+       if (clp != NULL && clp->cl_cons_state != NFS_CS_READY) {
+               nfs_put_client(clp);
+               clp = NULL;
+       }
        return clp;
 }
 
@@ -292,7 +297,7 @@ static struct nfs_client *nfs_get_client(const char *hostname,
        do {
                spin_lock(&nfs_client_lock);
 
-               clp = __nfs_find_client(addr, nfsversion);
+               clp = __nfs_find_client(addr, nfsversion, 1);
                if (clp)
                        goto found_client;
                if (new)
@@ -849,6 +854,7 @@ error:
  */
 static int nfs4_init_client(struct nfs_client *clp,
                int proto, int timeo, int retrans,
+               const char *ip_addr,
                rpc_authflavor_t authflavour)
 {
        int error;
@@ -865,6 +871,7 @@ static int nfs4_init_client(struct nfs_client *clp,
        error = nfs_create_rpc_client(clp, proto, timeo, retrans, authflavour);
        if (error < 0)
                goto error;
+       memcpy(clp->cl_ipaddr, ip_addr, sizeof(clp->cl_ipaddr));
 
        error = nfs_idmap_new(clp);
        if (error < 0) {
@@ -888,6 +895,7 @@ error:
  */
 static int nfs4_set_client(struct nfs_server *server,
                const char *hostname, const struct sockaddr_in *addr,
+               const char *ip_addr,
                rpc_authflavor_t authflavour,
                int proto, int timeo, int retrans)
 {
@@ -902,7 +910,7 @@ static int nfs4_set_client(struct nfs_server *server,
                error = PTR_ERR(clp);
                goto error;
        }
-       error = nfs4_init_client(clp, proto, timeo, retrans, authflavour);
+       error = nfs4_init_client(clp, proto, timeo, retrans, ip_addr, authflavour);
        if (error < 0)
                goto error_put;
 
@@ -971,7 +979,7 @@ struct nfs_server *nfs4_create_server(const struct nfs4_mount_data *data,
                return ERR_PTR(-ENOMEM);
 
        /* Get a client record */
-       error = nfs4_set_client(server, hostname, addr, authflavour,
+       error = nfs4_set_client(server, hostname, addr, ip_addr, authflavour,
                        data->proto, data->timeo, data->retrans);
        if (error < 0)
                goto error;
@@ -1041,6 +1049,7 @@ struct nfs_server *nfs4_create_referral_server(struct nfs_clone_mount *data,
        /* Get a client representation.
         * Note: NFSv4 always uses TCP, */
        error = nfs4_set_client(server, data->hostname, data->addr,
+                       parent_client->cl_ipaddr,
                        data->authflavor,
                        parent_server->client->cl_xprt->prot,
                        parent_client->retrans_timeo,
index 481f8892a919489cb5705269834b0145b0d5c8f1..b34cd16f472fef71c798c0470f98cbb33f6ea10c 100644 (file)
@@ -142,12 +142,12 @@ nfs_opendir(struct inode *inode, struct file *filp)
        return res;
 }
 
-typedef u32 * (*decode_dirent_t)(u32 *, struct nfs_entry *, int);
+typedef __be32 * (*decode_dirent_t)(__be32 *, struct nfs_entry *, int);
 typedef struct {
        struct file     *file;
        struct page     *page;
        unsigned long   page_index;
-       u32             *ptr;
+       __be32          *ptr;
        u64             *dir_cookie;
        loff_t          current_index;
        struct nfs_entry *entry;
@@ -203,8 +203,10 @@ int nfs_readdir_filler(nfs_readdir_descriptor_t *desc, struct page *page)
         * Note: assumes we have exclusive access to this mapping either
         *       through inode->i_mutex or some other mechanism.
         */
-       if (page->index == 0)
-               invalidate_inode_pages2_range(inode->i_mapping, PAGE_CACHE_SIZE, -1);
+       if (page->index == 0 && invalidate_inode_pages2_range(inode->i_mapping, PAGE_CACHE_SIZE, -1) < 0) {
+               /* Should never happen */
+               nfs_zap_mapping(inode, inode->i_mapping);
+       }
        unlock_page(page);
        return 0;
  error:
@@ -218,7 +220,7 @@ int nfs_readdir_filler(nfs_readdir_descriptor_t *desc, struct page *page)
 static inline
 int dir_decode(nfs_readdir_descriptor_t *desc)
 {
-       u32     *p = desc->ptr;
+       __be32  *p = desc->ptr;
        p = desc->decode(p, desc->entry, desc->plus);
        if (IS_ERR(p))
                return PTR_ERR(p);
@@ -933,8 +935,17 @@ static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, stru
 
 no_entry:
        res = d_materialise_unique(dentry, inode);
-       if (res != NULL)
+       if (res != NULL) {
+               struct dentry *parent;
+               if (IS_ERR(res))
+                       goto out_unlock;
+               /* Was a directory renamed! */
+               parent = dget_parent(res);
+               if (!IS_ROOT(parent))
+                       nfs_mark_for_revalidate(parent->d_inode);
+               dput(parent);
                dentry = res;
+       }
        nfs_renew_times(dentry);
        nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
 out_unlock:
@@ -1130,6 +1141,8 @@ static struct dentry *nfs_readdir_lookup(nfs_readdir_descriptor_t *desc)
        alias = d_materialise_unique(dentry, inode);
        if (alias != NULL) {
                dput(dentry);
+               if (IS_ERR(alias))
+                       return NULL;
                dentry = alias;
        }
 
@@ -1517,8 +1530,8 @@ static int nfs_symlink(struct inode *dir, struct dentry *dentry, const char *sym
        pagevec_init(&lru_pvec, 0);
        if (!add_to_page_cache(page, dentry->d_inode->i_mapping, 0,
                                                        GFP_KERNEL)) {
-               if (!pagevec_add(&lru_pvec, page))
-                       __pagevec_lru_add(&lru_pvec);
+               pagevec_add(&lru_pvec, page);
+               pagevec_lru_add(&lru_pvec);
                SetPageUptodate(page);
                unlock_page(page);
        } else
index 9f7f8b9ea1e253b2e9614a658a7186720a5a80b1..bdfabf854a519af44ae5f07e83ee64e3e0089c6a 100644 (file)
@@ -497,6 +497,7 @@ static void nfs_direct_write_complete(struct nfs_direct_req *dreq, struct inode
                        if (dreq->commit_data != NULL)
                                nfs_commit_free(dreq->commit_data);
                        nfs_direct_free_writedata(dreq);
+                       nfs_zap_mapping(inode, inode->i_mapping);
                        nfs_direct_complete(dreq);
        }
 }
@@ -517,6 +518,7 @@ static void nfs_direct_write_complete(struct nfs_direct_req *dreq, struct inode
 {
        nfs_end_data_update(inode);
        nfs_direct_free_writedata(dreq);
+       nfs_zap_mapping(inode, inode->i_mapping);
        nfs_direct_complete(dreq);
 }
 #endif
@@ -532,10 +534,12 @@ static void nfs_direct_write_result(struct rpc_task *task, void *calldata)
 
        spin_lock(&dreq->lock);
 
-       if (likely(status >= 0))
-               dreq->count += data->res.count;
-       else
-               dreq->error = task->tk_status;
+       if (unlikely(status < 0)) {
+               dreq->error = status;
+               goto out_unlock;
+       }
+
+       dreq->count += data->res.count;
 
        if (data->res.verf->committed != NFS_FILE_SYNC) {
                switch (dreq->flags) {
@@ -550,7 +554,7 @@ static void nfs_direct_write_result(struct rpc_task *task, void *calldata)
                                }
                }
        }
-
+out_unlock:
        spin_unlock(&dreq->lock);
 }
 
@@ -828,17 +832,6 @@ ssize_t nfs_file_direct_write(struct kiocb *iocb, const struct iovec *iov,
 
        retval = nfs_direct_write(iocb, (unsigned long) buf, count, pos);
 
-       /*
-        * XXX: nfs_end_data_update() already ensures this file's
-        *      cached data is subsequently invalidated.  Do we really
-        *      need to call invalidate_inode_pages2() again here?
-        *
-        *      For aio writes, this invalidation will almost certainly
-        *      occur before the writes complete.  Kind of racey.
-        */
-       if (mapping->nrpages)
-               invalidate_inode_pages2(mapping);
-
        if (retval > 0)
                iocb->ki_pos = pos + retval;
 
index bc9376ca86cd28ea645ea38b889ac455faf0b141..08cc4c5919abee92f1f28b411e1154c627ff15d3 100644 (file)
@@ -131,6 +131,15 @@ void nfs_zap_caches(struct inode *inode)
        spin_unlock(&inode->i_lock);
 }
 
+void nfs_zap_mapping(struct inode *inode, struct address_space *mapping)
+{
+       if (mapping->nrpages != 0) {
+               spin_lock(&inode->i_lock);
+               NFS_I(inode)->cache_validity |= NFS_INO_INVALID_DATA;
+               spin_unlock(&inode->i_lock);
+       }
+}
+
 static void nfs_zap_acl_cache(struct inode *inode)
 {
        void (*clear_acl_cache)(struct inode *);
@@ -574,7 +583,7 @@ __nfs_revalidate_inode(struct nfs_server *server, struct inode *inode)
 
        nfs_inc_stats(inode, NFSIOS_INODEREVALIDATE);
        lock_kernel();
-       if (!inode || is_bad_inode(inode))
+       if (is_bad_inode(inode))
                goto out_nowait;
        if (NFS_STALE(inode))
                goto out_nowait;
@@ -671,13 +680,20 @@ int nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping)
        if ((nfsi->cache_validity & NFS_INO_REVAL_PAGECACHE)
                        || nfs_attribute_timeout(inode))
                ret = __nfs_revalidate_inode(NFS_SERVER(inode), inode);
+       if (ret < 0)
+               goto out;
 
        if (nfsi->cache_validity & NFS_INO_INVALID_DATA) {
-               nfs_inc_stats(inode, NFSIOS_DATAINVALIDATE);
-               if (S_ISREG(inode->i_mode))
-                       nfs_sync_mapping(mapping);
-               invalidate_inode_pages2(mapping);
-
+               if (mapping->nrpages != 0) {
+                       if (S_ISREG(inode->i_mode)) {
+                               ret = nfs_sync_mapping(mapping);
+                               if (ret < 0)
+                                       goto out;
+                       }
+                       ret = invalidate_inode_pages2(mapping);
+                       if (ret < 0)
+                               goto out;
+               }
                spin_lock(&inode->i_lock);
                nfsi->cache_validity &= ~NFS_INO_INVALID_DATA;
                if (S_ISDIR(inode->i_mode)) {
@@ -687,10 +703,12 @@ int nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping)
                }
                spin_unlock(&inode->i_lock);
 
+               nfs_inc_stats(inode, NFSIOS_DATAINVALIDATE);
                dfprintk(PAGECACHE, "NFS: (%s/%Ld) data cache invalidated\n",
                                inode->i_sb->s_id,
                                (long long)NFS_FILEID(inode));
        }
+out:
        return ret;
 }
 
index bea0b016bd709de15e7c2658df4fb5e9338ef1d3..d205466233f67f932460d51f124cade1bec0a516 100644 (file)
@@ -93,15 +93,15 @@ extern void nfs_destroy_directcache(void);
 /* nfs2xdr.c */
 extern int nfs_stat_to_errno(int);
 extern struct rpc_procinfo nfs_procedures[];
-extern u32 * nfs_decode_dirent(u32 *, struct nfs_entry *, int);
+extern __be32 * nfs_decode_dirent(__be32 *, struct nfs_entry *, int);
 
 /* nfs3xdr.c */
 extern struct rpc_procinfo nfs3_procedures[];
-extern u32 *nfs3_decode_dirent(u32 *, struct nfs_entry *, int);
+extern __be32 *nfs3_decode_dirent(__be32 *, struct nfs_entry *, int);
 
 /* nfs4xdr.c */
 #ifdef CONFIG_NFS_V4
-extern u32 *nfs4_decode_dirent(u32 *p, struct nfs_entry *entry, int plus);
+extern __be32 *nfs4_decode_dirent(__be32 *p, struct nfs_entry *entry, int plus);
 #endif
 
 /* nfs4proc.c */
index d507b021207fd5ea63fc2fe15ae0474bdb5179c8..f75fe72b4160b7bdfbae6631d87c3bca8e63d496 100644 (file)
@@ -95,7 +95,7 @@ mnt_create(char *hostname, struct sockaddr_in *srvaddr, int version,
  * XDR encode/decode functions for MOUNT
  */
 static int
-xdr_encode_dirpath(struct rpc_rqst *req, u32 *p, const char *path)
+xdr_encode_dirpath(struct rpc_rqst *req, __be32 *p, const char *path)
 {
        p = xdr_encode_string(p, path);
 
@@ -104,7 +104,7 @@ xdr_encode_dirpath(struct rpc_rqst *req, u32 *p, const char *path)
 }
 
 static int
-xdr_decode_fhstatus(struct rpc_rqst *req, u32 *p, struct mnt_fhstatus *res)
+xdr_decode_fhstatus(struct rpc_rqst *req, __be32 *p, struct mnt_fhstatus *res)
 {
        struct nfs_fh *fh = res->fh;
 
@@ -116,7 +116,7 @@ xdr_decode_fhstatus(struct rpc_rqst *req, u32 *p, struct mnt_fhstatus *res)
 }
 
 static int
-xdr_decode_fhstatus3(struct rpc_rqst *req, u32 *p, struct mnt_fhstatus *res)
+xdr_decode_fhstatus3(struct rpc_rqst *req, __be32 *p, struct mnt_fhstatus *res)
 {
        struct nfs_fh *fh = res->fh;
 
index b49501fc0a7985927d87d0d69042ec2995c7dc3b..3be4e72a0227e71030709b019dd35db28897a34e 100644 (file)
 /*
  * Common NFS XDR functions as inlines
  */
-static inline u32 *
-xdr_encode_fhandle(u32 *p, struct nfs_fh *fhandle)
+static inline __be32 *
+xdr_encode_fhandle(__be32 *p, struct nfs_fh *fhandle)
 {
        memcpy(p, fhandle->data, NFS2_FHSIZE);
        return p + XDR_QUADLEN(NFS2_FHSIZE);
 }
 
-static inline u32 *
-xdr_decode_fhandle(u32 *p, struct nfs_fh *fhandle)
+static inline __be32 *
+xdr_decode_fhandle(__be32 *p, struct nfs_fh *fhandle)
 {
        /* NFSv2 handles have a fixed length */
        fhandle->size = NFS2_FHSIZE;
@@ -82,8 +82,8 @@ xdr_decode_fhandle(u32 *p, struct nfs_fh *fhandle)
        return p + XDR_QUADLEN(NFS2_FHSIZE);
 }
 
-static inline u32*
-xdr_encode_time(u32 *p, struct timespec *timep)
+static inline __be32*
+xdr_encode_time(__be32 *p, struct timespec *timep)
 {
        *p++ = htonl(timep->tv_sec);
        /* Convert nanoseconds into microseconds */
@@ -91,8 +91,8 @@ xdr_encode_time(u32 *p, struct timespec *timep)
        return p;
 }
 
-static inline u32*
-xdr_encode_current_server_time(u32 *p, struct timespec *timep)
+static inline __be32*
+xdr_encode_current_server_time(__be32 *p, struct timespec *timep)
 {
        /*
         * Passing the invalid value useconds=1000000 is a
@@ -108,8 +108,8 @@ xdr_encode_current_server_time(u32 *p, struct timespec *timep)
        return p;
 }
 
-static inline u32*
-xdr_decode_time(u32 *p, struct timespec *timep)
+static inline __be32*
+xdr_decode_time(__be32 *p, struct timespec *timep)
 {
        timep->tv_sec = ntohl(*p++);
        /* Convert microseconds into nanoseconds */
@@ -117,8 +117,8 @@ xdr_decode_time(u32 *p, struct timespec *timep)
        return p;
 }
 
-static u32 *
-xdr_decode_fattr(u32 *p, struct nfs_fattr *fattr)
+static __be32 *
+xdr_decode_fattr(__be32 *p, struct nfs_fattr *fattr)
 {
        u32 rdev;
        fattr->type = (enum nfs_ftype) ntohl(*p++);
@@ -146,10 +146,10 @@ xdr_decode_fattr(u32 *p, struct nfs_fattr *fattr)
        return p;
 }
 
-static inline u32 *
-xdr_encode_sattr(u32 *p, struct iattr *attr)
+static inline __be32 *
+xdr_encode_sattr(__be32 *p, struct iattr *attr)
 {
-       const u32 not_set = __constant_htonl(0xFFFFFFFF);
+       const __be32 not_set = __constant_htonl(0xFFFFFFFF);
 
        *p++ = (attr->ia_valid & ATTR_MODE) ? htonl(attr->ia_mode) : not_set;
        *p++ = (attr->ia_valid & ATTR_UID) ? htonl(attr->ia_uid) : not_set;
@@ -184,7 +184,7 @@ xdr_encode_sattr(u32 *p, struct iattr *attr)
  * GETATTR, READLINK, STATFS
  */
 static int
-nfs_xdr_fhandle(struct rpc_rqst *req, u32 *p, struct nfs_fh *fh)
+nfs_xdr_fhandle(struct rpc_rqst *req, __be32 *p, struct nfs_fh *fh)
 {
        p = xdr_encode_fhandle(p, fh);
        req->rq_slen = xdr_adjust_iovec(req->rq_svec, p);
@@ -195,7 +195,7 @@ nfs_xdr_fhandle(struct rpc_rqst *req, u32 *p, struct nfs_fh *fh)
  * Encode SETATTR arguments
  */
 static int
-nfs_xdr_sattrargs(struct rpc_rqst *req, u32 *p, struct nfs_sattrargs *args)
+nfs_xdr_sattrargs(struct rpc_rqst *req, __be32 *p, struct nfs_sattrargs *args)
 {
        p = xdr_encode_fhandle(p, args->fh);
        p = xdr_encode_sattr(p, args->sattr);
@@ -208,7 +208,7 @@ nfs_xdr_sattrargs(struct rpc_rqst *req, u32 *p, struct nfs_sattrargs *args)
  * LOOKUP, REMOVE, RMDIR
  */
 static int
-nfs_xdr_diropargs(struct rpc_rqst *req, u32 *p, struct nfs_diropargs *args)
+nfs_xdr_diropargs(struct rpc_rqst *req, __be32 *p, struct nfs_diropargs *args)
 {
        p = xdr_encode_fhandle(p, args->fh);
        p = xdr_encode_array(p, args->name, args->len);
@@ -222,7 +222,7 @@ nfs_xdr_diropargs(struct rpc_rqst *req, u32 *p, struct nfs_diropargs *args)
  * exactly to the page we want to fetch.
  */
 static int
-nfs_xdr_readargs(struct rpc_rqst *req, u32 *p, struct nfs_readargs *args)
+nfs_xdr_readargs(struct rpc_rqst *req, __be32 *p, struct nfs_readargs *args)
 {
        struct rpc_auth *auth = req->rq_task->tk_auth;
        unsigned int replen;
@@ -246,7 +246,7 @@ nfs_xdr_readargs(struct rpc_rqst *req, u32 *p, struct nfs_readargs *args)
  * Decode READ reply
  */
 static int
-nfs_xdr_readres(struct rpc_rqst *req, u32 *p, struct nfs_readres *res)
+nfs_xdr_readres(struct rpc_rqst *req, __be32 *p, struct nfs_readres *res)
 {
        struct kvec *iov = req->rq_rcv_buf.head;
        int     status, count, recvd, hdrlen;
@@ -286,7 +286,7 @@ nfs_xdr_readres(struct rpc_rqst *req, u32 *p, struct nfs_readres *res)
  * Write arguments. Splice the buffer to be written into the iovec.
  */
 static int
-nfs_xdr_writeargs(struct rpc_rqst *req, u32 *p, struct nfs_writeargs *args)
+nfs_xdr_writeargs(struct rpc_rqst *req, __be32 *p, struct nfs_writeargs *args)
 {
        struct xdr_buf *sndbuf = &req->rq_snd_buf;
        u32 offset = (u32)args->offset;
@@ -309,7 +309,7 @@ nfs_xdr_writeargs(struct rpc_rqst *req, u32 *p, struct nfs_writeargs *args)
  * CREATE, MKDIR
  */
 static int
-nfs_xdr_createargs(struct rpc_rqst *req, u32 *p, struct nfs_createargs *args)
+nfs_xdr_createargs(struct rpc_rqst *req, __be32 *p, struct nfs_createargs *args)
 {
        p = xdr_encode_fhandle(p, args->fh);
        p = xdr_encode_array(p, args->name, args->len);
@@ -322,7 +322,7 @@ nfs_xdr_createargs(struct rpc_rqst *req, u32 *p, struct nfs_createargs *args)
  * Encode RENAME arguments
  */
 static int
-nfs_xdr_renameargs(struct rpc_rqst *req, u32 *p, struct nfs_renameargs *args)
+nfs_xdr_renameargs(struct rpc_rqst *req, __be32 *p, struct nfs_renameargs *args)
 {
        p = xdr_encode_fhandle(p, args->fromfh);
        p = xdr_encode_array(p, args->fromname, args->fromlen);
@@ -336,7 +336,7 @@ nfs_xdr_renameargs(struct rpc_rqst *req, u32 *p, struct nfs_renameargs *args)
  * Encode LINK arguments
  */
 static int
-nfs_xdr_linkargs(struct rpc_rqst *req, u32 *p, struct nfs_linkargs *args)
+nfs_xdr_linkargs(struct rpc_rqst *req, __be32 *p, struct nfs_linkargs *args)
 {
        p = xdr_encode_fhandle(p, args->fromfh);
        p = xdr_encode_fhandle(p, args->tofh);
@@ -349,7 +349,7 @@ nfs_xdr_linkargs(struct rpc_rqst *req, u32 *p, struct nfs_linkargs *args)
  * Encode SYMLINK arguments
  */
 static int
-nfs_xdr_symlinkargs(struct rpc_rqst *req, u32 *p, struct nfs_symlinkargs *args)
+nfs_xdr_symlinkargs(struct rpc_rqst *req, __be32 *p, struct nfs_symlinkargs *args)
 {
        struct xdr_buf *sndbuf = &req->rq_snd_buf;
        size_t pad;
@@ -378,7 +378,7 @@ nfs_xdr_symlinkargs(struct rpc_rqst *req, u32 *p, struct nfs_symlinkargs *args)
  * Encode arguments to readdir call
  */
 static int
-nfs_xdr_readdirargs(struct rpc_rqst *req, u32 *p, struct nfs_readdirargs *args)
+nfs_xdr_readdirargs(struct rpc_rqst *req, __be32 *p, struct nfs_readdirargs *args)
 {
        struct rpc_task *task = req->rq_task;
        struct rpc_auth *auth = task->tk_auth;
@@ -404,7 +404,7 @@ nfs_xdr_readdirargs(struct rpc_rqst *req, u32 *p, struct nfs_readdirargs *args)
  * from nfs_readdir for each entry.
  */
 static int
-nfs_xdr_readdirres(struct rpc_rqst *req, u32 *p, void *dummy)
+nfs_xdr_readdirres(struct rpc_rqst *req, __be32 *p, void *dummy)
 {
        struct xdr_buf *rcvbuf = &req->rq_rcv_buf;
        struct kvec *iov = rcvbuf->head;
@@ -412,7 +412,7 @@ nfs_xdr_readdirres(struct rpc_rqst *req, u32 *p, void *dummy)
        int hdrlen, recvd;
        int status, nr;
        unsigned int len, pglen;
-       u32 *end, *entry, *kaddr;
+       __be32 *end, *entry, *kaddr;
 
        if ((status = ntohl(*p++)))
                return -nfs_stat_to_errno(status);
@@ -432,8 +432,8 @@ nfs_xdr_readdirres(struct rpc_rqst *req, u32 *p, void *dummy)
        if (pglen > recvd)
                pglen = recvd;
        page = rcvbuf->pages;
-       kaddr = p = (u32 *)kmap_atomic(*page, KM_USER0);
-       end = (u32 *)((char *)p + pglen);
+       kaddr = p = kmap_atomic(*page, KM_USER0);
+       end = (__be32 *)((char *)p + pglen);
        entry = p;
        for (nr = 0; *p++; nr++) {
                if (p + 2 > end)
@@ -468,8 +468,8 @@ err_unmap:
        goto out;
 }
 
-u32 *
-nfs_decode_dirent(u32 *p, struct nfs_entry *entry, int plus)
+__be32 *
+nfs_decode_dirent(__be32 *p, struct nfs_entry *entry, int plus)
 {
        if (!*p++) {
                if (!*p)
@@ -496,7 +496,7 @@ nfs_decode_dirent(u32 *p, struct nfs_entry *entry, int plus)
  * Decode simple status reply
  */
 static int
-nfs_xdr_stat(struct rpc_rqst *req, u32 *p, void *dummy)
+nfs_xdr_stat(struct rpc_rqst *req, __be32 *p, void *dummy)
 {
        int     status;
 
@@ -510,7 +510,7 @@ nfs_xdr_stat(struct rpc_rqst *req, u32 *p, void *dummy)
  * GETATTR, SETATTR, WRITE
  */
 static int
-nfs_xdr_attrstat(struct rpc_rqst *req, u32 *p, struct nfs_fattr *fattr)
+nfs_xdr_attrstat(struct rpc_rqst *req, __be32 *p, struct nfs_fattr *fattr)
 {
        int     status;
 
@@ -525,7 +525,7 @@ nfs_xdr_attrstat(struct rpc_rqst *req, u32 *p, struct nfs_fattr *fattr)
  * LOOKUP, CREATE, MKDIR
  */
 static int
-nfs_xdr_diropres(struct rpc_rqst *req, u32 *p, struct nfs_diropok *res)
+nfs_xdr_diropres(struct rpc_rqst *req, __be32 *p, struct nfs_diropok *res)
 {
        int     status;
 
@@ -540,7 +540,7 @@ nfs_xdr_diropres(struct rpc_rqst *req, u32 *p, struct nfs_diropok *res)
  * Encode READLINK args
  */
 static int
-nfs_xdr_readlinkargs(struct rpc_rqst *req, u32 *p, struct nfs_readlinkargs *args)
+nfs_xdr_readlinkargs(struct rpc_rqst *req, __be32 *p, struct nfs_readlinkargs *args)
 {
        struct rpc_auth *auth = req->rq_task->tk_auth;
        unsigned int replen;
@@ -558,7 +558,7 @@ nfs_xdr_readlinkargs(struct rpc_rqst *req, u32 *p, struct nfs_readlinkargs *args
  * Decode READLINK reply
  */
 static int
-nfs_xdr_readlinkres(struct rpc_rqst *req, u32 *p, void *dummy)
+nfs_xdr_readlinkres(struct rpc_rqst *req, __be32 *p, void *dummy)
 {
        struct xdr_buf *rcvbuf = &req->rq_rcv_buf;
        struct kvec *iov = rcvbuf->head;
@@ -601,7 +601,7 @@ nfs_xdr_readlinkres(struct rpc_rqst *req, u32 *p, void *dummy)
  * Decode WRITE reply
  */
 static int
-nfs_xdr_writeres(struct rpc_rqst *req, u32 *p, struct nfs_writeres *res)
+nfs_xdr_writeres(struct rpc_rqst *req, __be32 *p, struct nfs_writeres *res)
 {
        res->verf->committed = NFS_FILE_SYNC;
        return nfs_xdr_attrstat(req, p, res->fattr);
@@ -611,7 +611,7 @@ nfs_xdr_writeres(struct rpc_rqst *req, u32 *p, struct nfs_writeres *res)
  * Decode STATFS reply
  */
 static int
-nfs_xdr_statfsres(struct rpc_rqst *req, u32 *p, struct nfs2_fsstat *res)
+nfs_xdr_statfsres(struct rpc_rqst *req, __be32 *p, struct nfs2_fsstat *res)
 {
        int     status;
 
index 3b234d4601e71ac51f45e71e409526aa96fcf14d..e5f128ffc32dd7ee368946768f9ce762a44c4fe7 100644 (file)
@@ -668,7 +668,7 @@ nfs3_proc_readdir(struct dentry *dentry, struct rpc_cred *cred,
 {
        struct inode            *dir = dentry->d_inode;
        struct nfs_fattr        dir_attr;
-       u32                     *verf = NFS_COOKIEVERF(dir);
+       __be32                  *verf = NFS_COOKIEVERF(dir);
        struct nfs3_readdirargs arg = {
                .fh             = NFS_FH(dir),
                .cookie         = cookie,
index 16556fa4effb1e989aecd7301d8ee234ba1a97d1..0ace092d126f930e10e946340c8c04b8be7dfa14 100644 (file)
@@ -105,14 +105,14 @@ static struct {
 /*
  * Common NFS XDR functions as inlines
  */
-static inline u32 *
-xdr_encode_fhandle(u32 *p, struct nfs_fh *fh)
+static inline __be32 *
+xdr_encode_fhandle(__be32 *p, struct nfs_fh *fh)
 {
        return xdr_encode_array(p, fh->data, fh->size);
 }
 
-static inline u32 *
-xdr_decode_fhandle(u32 *p, struct nfs_fh *fh)
+static inline __be32 *
+xdr_decode_fhandle(__be32 *p, struct nfs_fh *fh)
 {
        if ((fh->size = ntohl(*p++)) <= NFS3_FHSIZE) {
                memcpy(fh->data, p, fh->size);
@@ -124,24 +124,24 @@ xdr_decode_fhandle(u32 *p, struct nfs_fh *fh)
 /*
  * Encode/decode time.
  */
-static inline u32 *
-xdr_encode_time3(u32 *p, struct timespec *timep)
+static inline __be32 *
+xdr_encode_time3(__be32 *p, struct timespec *timep)
 {
        *p++ = htonl(timep->tv_sec);
        *p++ = htonl(timep->tv_nsec);
        return p;
 }
 
-static inline u32 *
-xdr_decode_time3(u32 *p, struct timespec *timep)
+static inline __be32 *
+xdr_decode_time3(__be32 *p, struct timespec *timep)
 {
        timep->tv_sec = ntohl(*p++);
        timep->tv_nsec = ntohl(*p++);
        return p;
 }
 
-static u32 *
-xdr_decode_fattr(u32 *p, struct nfs_fattr *fattr)
+static __be32 *
+xdr_decode_fattr(__be32 *p, struct nfs_fattr *fattr)
 {
        unsigned int    type, major, minor;
        int             fmode;
@@ -177,8 +177,8 @@ xdr_decode_fattr(u32 *p, struct nfs_fattr *fattr)
        return p;
 }
 
-static inline u32 *
-xdr_encode_sattr(u32 *p, struct iattr *attr)
+static inline __be32 *
+xdr_encode_sattr(__be32 *p, struct iattr *attr)
 {
        if (attr->ia_valid & ATTR_MODE) {
                *p++ = xdr_one;
@@ -223,8 +223,8 @@ xdr_encode_sattr(u32 *p, struct iattr *attr)
        return p;
 }
 
-static inline u32 *
-xdr_decode_wcc_attr(u32 *p, struct nfs_fattr *fattr)
+static inline __be32 *
+xdr_decode_wcc_attr(__be32 *p, struct nfs_fattr *fattr)
 {
        p = xdr_decode_hyper(p, &fattr->pre_size);
        p = xdr_decode_time3(p, &fattr->pre_mtime);
@@ -233,16 +233,16 @@ xdr_decode_wcc_attr(u32 *p, struct nfs_fattr *fattr)
        return p;
 }
 
-static inline u32 *
-xdr_decode_post_op_attr(u32 *p, struct nfs_fattr *fattr)
+static inline __be32 *
+xdr_decode_post_op_attr(__be32 *p, struct nfs_fattr *fattr)
 {
        if (*p++)
                p = xdr_decode_fattr(p, fattr);
        return p;
 }
 
-static inline u32 *
-xdr_decode_pre_op_attr(u32 *p, struct nfs_fattr *fattr)
+static inline __be32 *
+xdr_decode_pre_op_attr(__be32 *p, struct nfs_fattr *fattr)
 {
        if (*p++)
                return xdr_decode_wcc_attr(p, fattr);
@@ -250,8 +250,8 @@ xdr_decode_pre_op_attr(u32 *p, struct nfs_fattr *fattr)
 }
 
 
-static inline u32 *
-xdr_decode_wcc_data(u32 *p, struct nfs_fattr *fattr)
+static inline __be32 *
+xdr_decode_wcc_data(__be32 *p, struct nfs_fattr *fattr)
 {
        p = xdr_decode_pre_op_attr(p, fattr);
        return xdr_decode_post_op_attr(p, fattr);
@@ -265,7 +265,7 @@ xdr_decode_wcc_data(u32 *p, struct nfs_fattr *fattr)
  * Encode file handle argument
  */
 static int
-nfs3_xdr_fhandle(struct rpc_rqst *req, u32 *p, struct nfs_fh *fh)
+nfs3_xdr_fhandle(struct rpc_rqst *req, __be32 *p, struct nfs_fh *fh)
 {
        p = xdr_encode_fhandle(p, fh);
        req->rq_slen = xdr_adjust_iovec(req->rq_svec, p);
@@ -276,7 +276,7 @@ nfs3_xdr_fhandle(struct rpc_rqst *req, u32 *p, struct nfs_fh *fh)
  * Encode SETATTR arguments
  */
 static int
-nfs3_xdr_sattrargs(struct rpc_rqst *req, u32 *p, struct nfs3_sattrargs *args)
+nfs3_xdr_sattrargs(struct rpc_rqst *req, __be32 *p, struct nfs3_sattrargs *args)
 {
        p = xdr_encode_fhandle(p, args->fh);
        p = xdr_encode_sattr(p, args->sattr);
@@ -291,7 +291,7 @@ nfs3_xdr_sattrargs(struct rpc_rqst *req, u32 *p, struct nfs3_sattrargs *args)
  * Encode directory ops argument
  */
 static int
-nfs3_xdr_diropargs(struct rpc_rqst *req, u32 *p, struct nfs3_diropargs *args)
+nfs3_xdr_diropargs(struct rpc_rqst *req, __be32 *p, struct nfs3_diropargs *args)
 {
        p = xdr_encode_fhandle(p, args->fh);
        p = xdr_encode_array(p, args->name, args->len);
@@ -303,7 +303,7 @@ nfs3_xdr_diropargs(struct rpc_rqst *req, u32 *p, struct nfs3_diropargs *args)
  * Encode access() argument
  */
 static int
-nfs3_xdr_accessargs(struct rpc_rqst *req, u32 *p, struct nfs3_accessargs *args)
+nfs3_xdr_accessargs(struct rpc_rqst *req, __be32 *p, struct nfs3_accessargs *args)
 {
        p = xdr_encode_fhandle(p, args->fh);
        *p++ = htonl(args->access);
@@ -317,7 +317,7 @@ nfs3_xdr_accessargs(struct rpc_rqst *req, u32 *p, struct nfs3_accessargs *args)
  * exactly to the page we want to fetch.
  */
 static int
-nfs3_xdr_readargs(struct rpc_rqst *req, u32 *p, struct nfs_readargs *args)
+nfs3_xdr_readargs(struct rpc_rqst *req, __be32 *p, struct nfs_readargs *args)
 {
        struct rpc_auth *auth = req->rq_task->tk_auth;
        unsigned int replen;
@@ -339,7 +339,7 @@ nfs3_xdr_readargs(struct rpc_rqst *req, u32 *p, struct nfs_readargs *args)
  * Write arguments. Splice the buffer to be written into the iovec.
  */
 static int
-nfs3_xdr_writeargs(struct rpc_rqst *req, u32 *p, struct nfs_writeargs *args)
+nfs3_xdr_writeargs(struct rpc_rqst *req, __be32 *p, struct nfs_writeargs *args)
 {
        struct xdr_buf *sndbuf = &req->rq_snd_buf;
        u32 count = args->count;
@@ -360,7 +360,7 @@ nfs3_xdr_writeargs(struct rpc_rqst *req, u32 *p, struct nfs_writeargs *args)
  * Encode CREATE arguments
  */
 static int
-nfs3_xdr_createargs(struct rpc_rqst *req, u32 *p, struct nfs3_createargs *args)
+nfs3_xdr_createargs(struct rpc_rqst *req, __be32 *p, struct nfs3_createargs *args)
 {
        p = xdr_encode_fhandle(p, args->fh);
        p = xdr_encode_array(p, args->name, args->len);
@@ -380,7 +380,7 @@ nfs3_xdr_createargs(struct rpc_rqst *req, u32 *p, struct nfs3_createargs *args)
  * Encode MKDIR arguments
  */
 static int
-nfs3_xdr_mkdirargs(struct rpc_rqst *req, u32 *p, struct nfs3_mkdirargs *args)
+nfs3_xdr_mkdirargs(struct rpc_rqst *req, __be32 *p, struct nfs3_mkdirargs *args)
 {
        p = xdr_encode_fhandle(p, args->fh);
        p = xdr_encode_array(p, args->name, args->len);
@@ -393,7 +393,7 @@ nfs3_xdr_mkdirargs(struct rpc_rqst *req, u32 *p, struct nfs3_mkdirargs *args)
  * Encode SYMLINK arguments
  */
 static int
-nfs3_xdr_symlinkargs(struct rpc_rqst *req, u32 *p, struct nfs3_symlinkargs *args)
+nfs3_xdr_symlinkargs(struct rpc_rqst *req, __be32 *p, struct nfs3_symlinkargs *args)
 {
        p = xdr_encode_fhandle(p, args->fromfh);
        p = xdr_encode_array(p, args->fromname, args->fromlen);
@@ -410,7 +410,7 @@ nfs3_xdr_symlinkargs(struct rpc_rqst *req, u32 *p, struct nfs3_symlinkargs *args
  * Encode MKNOD arguments
  */
 static int
-nfs3_xdr_mknodargs(struct rpc_rqst *req, u32 *p, struct nfs3_mknodargs *args)
+nfs3_xdr_mknodargs(struct rpc_rqst *req, __be32 *p, struct nfs3_mknodargs *args)
 {
        p = xdr_encode_fhandle(p, args->fh);
        p = xdr_encode_array(p, args->name, args->len);
@@ -429,7 +429,7 @@ nfs3_xdr_mknodargs(struct rpc_rqst *req, u32 *p, struct nfs3_mknodargs *args)
  * Encode RENAME arguments
  */
 static int
-nfs3_xdr_renameargs(struct rpc_rqst *req, u32 *p, struct nfs3_renameargs *args)
+nfs3_xdr_renameargs(struct rpc_rqst *req, __be32 *p, struct nfs3_renameargs *args)
 {
        p = xdr_encode_fhandle(p, args->fromfh);
        p = xdr_encode_array(p, args->fromname, args->fromlen);
@@ -443,7 +443,7 @@ nfs3_xdr_renameargs(struct rpc_rqst *req, u32 *p, struct nfs3_renameargs *args)
  * Encode LINK arguments
  */
 static int
-nfs3_xdr_linkargs(struct rpc_rqst *req, u32 *p, struct nfs3_linkargs *args)
+nfs3_xdr_linkargs(struct rpc_rqst *req, __be32 *p, struct nfs3_linkargs *args)
 {
        p = xdr_encode_fhandle(p, args->fromfh);
        p = xdr_encode_fhandle(p, args->tofh);
@@ -456,7 +456,7 @@ nfs3_xdr_linkargs(struct rpc_rqst *req, u32 *p, struct nfs3_linkargs *args)
  * Encode arguments to readdir call
  */
 static int
-nfs3_xdr_readdirargs(struct rpc_rqst *req, u32 *p, struct nfs3_readdirargs *args)
+nfs3_xdr_readdirargs(struct rpc_rqst *req, __be32 *p, struct nfs3_readdirargs *args)
 {
        struct rpc_auth *auth = req->rq_task->tk_auth;
        unsigned int replen;
@@ -485,7 +485,7 @@ nfs3_xdr_readdirargs(struct rpc_rqst *req, u32 *p, struct nfs3_readdirargs *args
  * We just check for syntactical correctness.
  */
 static int
-nfs3_xdr_readdirres(struct rpc_rqst *req, u32 *p, struct nfs3_readdirres *res)
+nfs3_xdr_readdirres(struct rpc_rqst *req, __be32 *p, struct nfs3_readdirres *res)
 {
        struct xdr_buf *rcvbuf = &req->rq_rcv_buf;
        struct kvec *iov = rcvbuf->head;
@@ -493,7 +493,7 @@ nfs3_xdr_readdirres(struct rpc_rqst *req, u32 *p, struct nfs3_readdirres *res)
        int hdrlen, recvd;
        int status, nr;
        unsigned int len, pglen;
-       u32 *entry, *end, *kaddr;
+       __be32 *entry, *end, *kaddr;
 
        status = ntohl(*p++);
        /* Decode post_op_attrs */
@@ -523,8 +523,8 @@ nfs3_xdr_readdirres(struct rpc_rqst *req, u32 *p, struct nfs3_readdirres *res)
        if (pglen > recvd)
                pglen = recvd;
        page = rcvbuf->pages;
-       kaddr = p = (u32 *)kmap_atomic(*page, KM_USER0);
-       end = (u32 *)((char *)p + pglen);
+       kaddr = p = kmap_atomic(*page, KM_USER0);
+       end = (__be32 *)((char *)p + pglen);
        entry = p;
        for (nr = 0; *p++; nr++) {
                if (p + 3 > end)
@@ -583,8 +583,8 @@ err_unmap:
        goto out;
 }
 
-u32 *
-nfs3_decode_dirent(u32 *p, struct nfs_entry *entry, int plus)
+__be32 *
+nfs3_decode_dirent(__be32 *p, struct nfs_entry *entry, int plus)
 {
        struct nfs_entry old = *entry;
 
@@ -626,7 +626,7 @@ nfs3_decode_dirent(u32 *p, struct nfs_entry *entry, int plus)
  * Encode COMMIT arguments
  */
 static int
-nfs3_xdr_commitargs(struct rpc_rqst *req, u32 *p, struct nfs_writeargs *args)
+nfs3_xdr_commitargs(struct rpc_rqst *req, __be32 *p, struct nfs_writeargs *args)
 {
        p = xdr_encode_fhandle(p, args->fh);
        p = xdr_encode_hyper(p, args->offset);
@@ -640,7 +640,7 @@ nfs3_xdr_commitargs(struct rpc_rqst *req, u32 *p, struct nfs_writeargs *args)
  * Encode GETACL arguments
  */
 static int
-nfs3_xdr_getaclargs(struct rpc_rqst *req, u32 *p,
+nfs3_xdr_getaclargs(struct rpc_rqst *req, __be32 *p,
                    struct nfs3_getaclargs *args)
 {
        struct rpc_auth *auth = req->rq_task->tk_auth;
@@ -664,7 +664,7 @@ nfs3_xdr_getaclargs(struct rpc_rqst *req, u32 *p,
  * Encode SETACL arguments
  */
 static int
-nfs3_xdr_setaclargs(struct rpc_rqst *req, u32 *p,
+nfs3_xdr_setaclargs(struct rpc_rqst *req, __be32 *p,
                    struct nfs3_setaclargs *args)
 {
        struct xdr_buf *buf = &req->rq_snd_buf;
@@ -711,7 +711,7 @@ nfs3_xdr_setaclargs(struct rpc_rqst *req, u32 *p,
  * Decode attrstat reply.
  */
 static int
-nfs3_xdr_attrstat(struct rpc_rqst *req, u32 *p, struct nfs_fattr *fattr)
+nfs3_xdr_attrstat(struct rpc_rqst *req, __be32 *p, struct nfs_fattr *fattr)
 {
        int     status;
 
@@ -726,7 +726,7 @@ nfs3_xdr_attrstat(struct rpc_rqst *req, u32 *p, struct nfs_fattr *fattr)
  * SATTR, REMOVE, RMDIR
  */
 static int
-nfs3_xdr_wccstat(struct rpc_rqst *req, u32 *p, struct nfs_fattr *fattr)
+nfs3_xdr_wccstat(struct rpc_rqst *req, __be32 *p, struct nfs_fattr *fattr)
 {
        int     status;
 
@@ -740,7 +740,7 @@ nfs3_xdr_wccstat(struct rpc_rqst *req, u32 *p, struct nfs_fattr *fattr)
  * Decode LOOKUP reply
  */
 static int
-nfs3_xdr_lookupres(struct rpc_rqst *req, u32 *p, struct nfs3_diropres *res)
+nfs3_xdr_lookupres(struct rpc_rqst *req, __be32 *p, struct nfs3_diropres *res)
 {
        int     status;
 
@@ -759,7 +759,7 @@ nfs3_xdr_lookupres(struct rpc_rqst *req, u32 *p, struct nfs3_diropres *res)
  * Decode ACCESS reply
  */
 static int
-nfs3_xdr_accessres(struct rpc_rqst *req, u32 *p, struct nfs3_accessres *res)
+nfs3_xdr_accessres(struct rpc_rqst *req, __be32 *p, struct nfs3_accessres *res)
 {
        int     status = ntohl(*p++);
 
@@ -771,7 +771,7 @@ nfs3_xdr_accessres(struct rpc_rqst *req, u32 *p, struct nfs3_accessres *res)
 }
 
 static int
-nfs3_xdr_readlinkargs(struct rpc_rqst *req, u32 *p, struct nfs3_readlinkargs *args)
+nfs3_xdr_readlinkargs(struct rpc_rqst *req, __be32 *p, struct nfs3_readlinkargs *args)
 {
        struct rpc_auth *auth = req->rq_task->tk_auth;
        unsigned int replen;
@@ -789,7 +789,7 @@ nfs3_xdr_readlinkargs(struct rpc_rqst *req, u32 *p, struct nfs3_readlinkargs *ar
  * Decode READLINK reply
  */
 static int
-nfs3_xdr_readlinkres(struct rpc_rqst *req, u32 *p, struct nfs_fattr *fattr)
+nfs3_xdr_readlinkres(struct rpc_rqst *req, __be32 *p, struct nfs_fattr *fattr)
 {
        struct xdr_buf *rcvbuf = &req->rq_rcv_buf;
        struct kvec *iov = rcvbuf->head;
@@ -837,7 +837,7 @@ nfs3_xdr_readlinkres(struct rpc_rqst *req, u32 *p, struct nfs_fattr *fattr)
  * Decode READ reply
  */
 static int
-nfs3_xdr_readres(struct rpc_rqst *req, u32 *p, struct nfs_readres *res)
+nfs3_xdr_readres(struct rpc_rqst *req, __be32 *p, struct nfs_readres *res)
 {
        struct kvec *iov = req->rq_rcv_buf.head;
        int     status, count, ocount, recvd, hdrlen;
@@ -888,7 +888,7 @@ nfs3_xdr_readres(struct rpc_rqst *req, u32 *p, struct nfs_readres *res)
  * Decode WRITE response
  */
 static int
-nfs3_xdr_writeres(struct rpc_rqst *req, u32 *p, struct nfs_writeres *res)
+nfs3_xdr_writeres(struct rpc_rqst *req, __be32 *p, struct nfs_writeres *res)
 {
        int     status;
 
@@ -910,7 +910,7 @@ nfs3_xdr_writeres(struct rpc_rqst *req, u32 *p, struct nfs_writeres *res)
  * Decode a CREATE response
  */
 static int
-nfs3_xdr_createres(struct rpc_rqst *req, u32 *p, struct nfs3_diropres *res)
+nfs3_xdr_createres(struct rpc_rqst *req, __be32 *p, struct nfs3_diropres *res)
 {
        int     status;
 
@@ -937,7 +937,7 @@ nfs3_xdr_createres(struct rpc_rqst *req, u32 *p, struct nfs3_diropres *res)
  * Decode RENAME reply
  */
 static int
-nfs3_xdr_renameres(struct rpc_rqst *req, u32 *p, struct nfs3_renameres *res)
+nfs3_xdr_renameres(struct rpc_rqst *req, __be32 *p, struct nfs3_renameres *res)
 {
        int     status;
 
@@ -952,7 +952,7 @@ nfs3_xdr_renameres(struct rpc_rqst *req, u32 *p, struct nfs3_renameres *res)
  * Decode LINK reply
  */
 static int
-nfs3_xdr_linkres(struct rpc_rqst *req, u32 *p, struct nfs3_linkres *res)
+nfs3_xdr_linkres(struct rpc_rqst *req, __be32 *p, struct nfs3_linkres *res)
 {
        int     status;
 
@@ -967,7 +967,7 @@ nfs3_xdr_linkres(struct rpc_rqst *req, u32 *p, struct nfs3_linkres *res)
  * Decode FSSTAT reply
  */
 static int
-nfs3_xdr_fsstatres(struct rpc_rqst *req, u32 *p, struct nfs_fsstat *res)
+nfs3_xdr_fsstatres(struct rpc_rqst *req, __be32 *p, struct nfs_fsstat *res)
 {
        int             status;
 
@@ -992,7 +992,7 @@ nfs3_xdr_fsstatres(struct rpc_rqst *req, u32 *p, struct nfs_fsstat *res)
  * Decode FSINFO reply
  */
 static int
-nfs3_xdr_fsinfores(struct rpc_rqst *req, u32 *p, struct nfs_fsinfo *res)
+nfs3_xdr_fsinfores(struct rpc_rqst *req, __be32 *p, struct nfs_fsinfo *res)
 {
        int             status;
 
@@ -1020,7 +1020,7 @@ nfs3_xdr_fsinfores(struct rpc_rqst *req, u32 *p, struct nfs_fsinfo *res)
  * Decode PATHCONF reply
  */
 static int
-nfs3_xdr_pathconfres(struct rpc_rqst *req, u32 *p, struct nfs_pathconf *res)
+nfs3_xdr_pathconfres(struct rpc_rqst *req, __be32 *p, struct nfs_pathconf *res)
 {
        int             status;
 
@@ -1040,7 +1040,7 @@ nfs3_xdr_pathconfres(struct rpc_rqst *req, u32 *p, struct nfs_pathconf *res)
  * Decode COMMIT reply
  */
 static int
-nfs3_xdr_commitres(struct rpc_rqst *req, u32 *p, struct nfs_writeres *res)
+nfs3_xdr_commitres(struct rpc_rqst *req, __be32 *p, struct nfs_writeres *res)
 {
        int             status;
 
@@ -1059,7 +1059,7 @@ nfs3_xdr_commitres(struct rpc_rqst *req, u32 *p, struct nfs_writeres *res)
  * Decode GETACL reply
  */
 static int
-nfs3_xdr_getaclres(struct rpc_rqst *req, u32 *p,
+nfs3_xdr_getaclres(struct rpc_rqst *req, __be32 *p,
                   struct nfs3_getaclres *res)
 {
        struct xdr_buf *buf = &req->rq_rcv_buf;
@@ -1091,7 +1091,7 @@ nfs3_xdr_getaclres(struct rpc_rqst *req, u32 *p,
  * Decode setacl reply.
  */
 static int
-nfs3_xdr_setaclres(struct rpc_rqst *req, u32 *p, struct nfs_fattr *fattr)
+nfs3_xdr_setaclres(struct rpc_rqst *req, __be32 *p, struct nfs_fattr *fattr)
 {
        int status = ntohl(*p++);
 
index 61095fe4b5ca5cd34481b18f6ac5516ec2d7cd78..6f346677332db4c99e07c867849ad7a0a705427a 100644 (file)
@@ -212,7 +212,7 @@ extern void nfs_free_seqid(struct nfs_seqid *seqid);
 extern const nfs4_stateid zero_stateid;
 
 /* nfs4xdr.c */
-extern uint32_t *nfs4_decode_dirent(uint32_t *p, struct nfs_entry *entry, int plus);
+extern __be32 *nfs4_decode_dirent(__be32 *p, struct nfs_entry *entry, int plus);
 extern struct rpc_procinfo nfs4_procedures[];
 
 struct nfs4_mount_data;
index 47c7e6e3910d738a9bdf4313e390b7349427f9d3..8118036cc4494c3a420869820cdebdb66c2c6262 100644 (file)
@@ -138,10 +138,10 @@ const u32 nfs4_fs_locations_bitmap[2] = {
        | FATTR4_WORD1_MOUNTED_ON_FILEID
 };
 
-static void nfs4_setup_readdir(u64 cookie, u32 *verifier, struct dentry *dentry,
+static void nfs4_setup_readdir(u64 cookie, __be32 *verifier, struct dentry *dentry,
                struct nfs4_readdir_arg *readdir)
 {
-       u32 *start, *p;
+       __be32 *start, *p;
 
        BUG_ON(readdir->count < 80);
        if (cookie > 2) {
@@ -162,7 +162,7 @@ static void nfs4_setup_readdir(u64 cookie, u32 *verifier, struct dentry *dentry,
         * when talking to the server, we always send cookie 0
         * instead of 1 or 2.
         */
-       start = p = (u32 *)kmap_atomic(*readdir->pages, KM_USER0);
+       start = p = kmap_atomic(*readdir->pages, KM_USER0);
        
        if (cookie == 0) {
                *p++ = xdr_one;                                  /* next */
@@ -1314,11 +1314,9 @@ nfs4_open_revalidate(struct inode *dir, struct dentry *dentry, int openflags, st
                        case -EROFS:
                                lookup_instantiate_filp(nd, (struct dentry *)state, NULL);
                                return 1;
-                       case -ENOENT:
-                               if (dentry->d_inode == NULL)
-                                       return 1;
+                       default:
+                               goto out_drop;
                }
-               goto out_drop;
        }
        if (state->inode == dentry->d_inode) {
                nfs4_intent_set_file(nd, dentry, state);
@@ -2917,11 +2915,11 @@ int nfs4_proc_setclientid(struct nfs_client *clp, u32 program, unsigned short po
                .rpc_resp = clp,
                .rpc_cred = cred,
        };
-       u32 *p;
+       __be32 *p;
        int loop = 0;
        int status;
 
-       p = (u32*)sc_verifier.data;
+       p = (__be32*)sc_verifier.data;
        *p++ = htonl((u32)clp->cl_boot_time.tv_sec);
        *p = htonl((u32)clp->cl_boot_time.tv_nsec);
 
index 3dd413f52da11d28e1b08ca4edbaca2bdca33864..0cf3fa312a332f565e8b57914eed5c60197caa21 100644 (file)
@@ -471,7 +471,7 @@ struct compound_hdr {
 
 static void encode_string(struct xdr_stream *xdr, unsigned int len, const char *str)
 {
-       uint32_t *p;
+       __be32 *p;
 
        p = xdr_reserve_space(xdr, 4 + len);
        BUG_ON(p == NULL);
@@ -480,7 +480,7 @@ static void encode_string(struct xdr_stream *xdr, unsigned int len, const char *
 
 static int encode_compound_hdr(struct xdr_stream *xdr, struct compound_hdr *hdr)
 {
-       uint32_t *p;
+       __be32 *p;
 
        dprintk("encode_compound: tag=%.*s\n", (int)hdr->taglen, hdr->tag);
        BUG_ON(hdr->taglen > NFS4_MAXTAGLEN);
@@ -494,7 +494,7 @@ static int encode_compound_hdr(struct xdr_stream *xdr, struct compound_hdr *hdr)
 
 static void encode_nfs4_verifier(struct xdr_stream *xdr, const nfs4_verifier *verf)
 {
-       uint32_t *p;
+       __be32 *p;
 
        p = xdr_reserve_space(xdr, NFS4_VERIFIER_SIZE);
        BUG_ON(p == NULL);
@@ -507,8 +507,8 @@ static int encode_attrs(struct xdr_stream *xdr, const struct iattr *iap, const s
        char owner_group[IDMAP_NAMESZ];
        int owner_namelen = 0;
        int owner_grouplen = 0;
-       uint32_t *p;
-       uint32_t *q;
+       __be32 *p;
+       __be32 *q;
        int len;
        uint32_t bmval0 = 0;
        uint32_t bmval1 = 0;
@@ -630,7 +630,7 @@ static int encode_attrs(struct xdr_stream *xdr, const struct iattr *iap, const s
 
 static int encode_access(struct xdr_stream *xdr, u32 access)
 {
-       uint32_t *p;
+       __be32 *p;
 
        RESERVE_SPACE(8);
        WRITE32(OP_ACCESS);
@@ -641,7 +641,7 @@ static int encode_access(struct xdr_stream *xdr, u32 access)
 
 static int encode_close(struct xdr_stream *xdr, const struct nfs_closeargs *arg)
 {
-       uint32_t *p;
+       __be32 *p;
 
        RESERVE_SPACE(8+sizeof(arg->stateid->data));
        WRITE32(OP_CLOSE);
@@ -653,7 +653,7 @@ static int encode_close(struct xdr_stream *xdr, const struct nfs_closeargs *arg)
 
 static int encode_commit(struct xdr_stream *xdr, const struct nfs_writeargs *args)
 {
-       uint32_t *p;
+       __be32 *p;
         
         RESERVE_SPACE(16);
         WRITE32(OP_COMMIT);
@@ -665,7 +665,7 @@ static int encode_commit(struct xdr_stream *xdr, const struct nfs_writeargs *arg
 
 static int encode_create(struct xdr_stream *xdr, const struct nfs4_create_arg *create)
 {
-       uint32_t *p;
+       __be32 *p;
        
        RESERVE_SPACE(8);
        WRITE32(OP_CREATE);
@@ -697,7 +697,7 @@ static int encode_create(struct xdr_stream *xdr, const struct nfs4_create_arg *c
 
 static int encode_getattr_one(struct xdr_stream *xdr, uint32_t bitmap)
 {
-        uint32_t *p;
+        __be32 *p;
 
         RESERVE_SPACE(12);
         WRITE32(OP_GETATTR);
@@ -708,7 +708,7 @@ static int encode_getattr_one(struct xdr_stream *xdr, uint32_t bitmap)
 
 static int encode_getattr_two(struct xdr_stream *xdr, uint32_t bm0, uint32_t bm1)
 {
-        uint32_t *p;
+        __be32 *p;
 
         RESERVE_SPACE(16);
         WRITE32(OP_GETATTR);
@@ -740,7 +740,7 @@ static int encode_fs_locations(struct xdr_stream *xdr, const u32* bitmask)
 
 static int encode_getfh(struct xdr_stream *xdr)
 {
-       uint32_t *p;
+       __be32 *p;
 
        RESERVE_SPACE(4);
        WRITE32(OP_GETFH);
@@ -750,7 +750,7 @@ static int encode_getfh(struct xdr_stream *xdr)
 
 static int encode_link(struct xdr_stream *xdr, const struct qstr *name)
 {
-       uint32_t *p;
+       __be32 *p;
 
        RESERVE_SPACE(8 + name->len);
        WRITE32(OP_LINK);
@@ -780,7 +780,7 @@ static inline uint64_t nfs4_lock_length(struct file_lock *fl)
  */
 static int encode_lock(struct xdr_stream *xdr, const struct nfs_lock_args *args)
 {
-       uint32_t *p;
+       __be32 *p;
 
        RESERVE_SPACE(32);
        WRITE32(OP_LOCK);
@@ -809,7 +809,7 @@ static int encode_lock(struct xdr_stream *xdr, const struct nfs_lock_args *args)
 
 static int encode_lockt(struct xdr_stream *xdr, const struct nfs_lockt_args *args)
 {
-       uint32_t *p;
+       __be32 *p;
 
        RESERVE_SPACE(40);
        WRITE32(OP_LOCKT);
@@ -825,7 +825,7 @@ static int encode_lockt(struct xdr_stream *xdr, const struct nfs_lockt_args *arg
 
 static int encode_locku(struct xdr_stream *xdr, const struct nfs_locku_args *args)
 {
-       uint32_t *p;
+       __be32 *p;
 
        RESERVE_SPACE(44);
        WRITE32(OP_LOCKU);
@@ -841,7 +841,7 @@ static int encode_locku(struct xdr_stream *xdr, const struct nfs_locku_args *arg
 static int encode_lookup(struct xdr_stream *xdr, const struct qstr *name)
 {
        int len = name->len;
-       uint32_t *p;
+       __be32 *p;
 
        RESERVE_SPACE(8 + len);
        WRITE32(OP_LOOKUP);
@@ -853,7 +853,7 @@ static int encode_lookup(struct xdr_stream *xdr, const struct qstr *name)
 
 static void encode_share_access(struct xdr_stream *xdr, int open_flags)
 {
-       uint32_t *p;
+       __be32 *p;
 
        RESERVE_SPACE(8);
        switch (open_flags & (FMODE_READ|FMODE_WRITE)) {
@@ -874,7 +874,7 @@ static void encode_share_access(struct xdr_stream *xdr, int open_flags)
 
 static inline void encode_openhdr(struct xdr_stream *xdr, const struct nfs_openargs *arg)
 {
-       uint32_t *p;
+       __be32 *p;
  /*
  * opcode 4, seqid 4, share_access 4, share_deny 4, clientid 8, ownerlen 4,
  * owner 4 = 32
@@ -891,7 +891,7 @@ static inline void encode_openhdr(struct xdr_stream *xdr, const struct nfs_opena
 
 static inline void encode_createmode(struct xdr_stream *xdr, const struct nfs_openargs *arg)
 {
-       uint32_t *p;
+       __be32 *p;
 
        RESERVE_SPACE(4);
        switch(arg->open_flags & O_EXCL) {
@@ -907,7 +907,7 @@ static inline void encode_createmode(struct xdr_stream *xdr, const struct nfs_op
 
 static void encode_opentype(struct xdr_stream *xdr, const struct nfs_openargs *arg)
 {
-       uint32_t *p;
+       __be32 *p;
 
        RESERVE_SPACE(4);
        switch (arg->open_flags & O_CREAT) {
@@ -923,7 +923,7 @@ static void encode_opentype(struct xdr_stream *xdr, const struct nfs_openargs *a
 
 static inline void encode_delegation_type(struct xdr_stream *xdr, int delegation_type)
 {
-       uint32_t *p;
+       __be32 *p;
 
        RESERVE_SPACE(4);
        switch (delegation_type) {
@@ -943,7 +943,7 @@ static inline void encode_delegation_type(struct xdr_stream *xdr, int delegation
 
 static inline void encode_claim_null(struct xdr_stream *xdr, const struct qstr *name)
 {
-       uint32_t *p;
+       __be32 *p;
 
        RESERVE_SPACE(4);
        WRITE32(NFS4_OPEN_CLAIM_NULL);
@@ -952,7 +952,7 @@ static inline void encode_claim_null(struct xdr_stream *xdr, const struct qstr *
 
 static inline void encode_claim_previous(struct xdr_stream *xdr, int type)
 {
-       uint32_t *p;
+       __be32 *p;
 
        RESERVE_SPACE(4);
        WRITE32(NFS4_OPEN_CLAIM_PREVIOUS);
@@ -961,7 +961,7 @@ static inline void encode_claim_previous(struct xdr_stream *xdr, int type)
 
 static inline void encode_claim_delegate_cur(struct xdr_stream *xdr, const struct qstr *name, const nfs4_stateid *stateid)
 {
-       uint32_t *p;
+       __be32 *p;
 
        RESERVE_SPACE(4+sizeof(stateid->data));
        WRITE32(NFS4_OPEN_CLAIM_DELEGATE_CUR);
@@ -991,7 +991,7 @@ static int encode_open(struct xdr_stream *xdr, const struct nfs_openargs *arg)
 
 static int encode_open_confirm(struct xdr_stream *xdr, const struct nfs_open_confirmargs *arg)
 {
-       uint32_t *p;
+       __be32 *p;
 
        RESERVE_SPACE(8+sizeof(arg->stateid->data));
        WRITE32(OP_OPEN_CONFIRM);
@@ -1003,7 +1003,7 @@ static int encode_open_confirm(struct xdr_stream *xdr, const struct nfs_open_con
 
 static int encode_open_downgrade(struct xdr_stream *xdr, const struct nfs_closeargs *arg)
 {
-       uint32_t *p;
+       __be32 *p;
 
        RESERVE_SPACE(8+sizeof(arg->stateid->data));
        WRITE32(OP_OPEN_DOWNGRADE);
@@ -1017,7 +1017,7 @@ static int
 encode_putfh(struct xdr_stream *xdr, const struct nfs_fh *fh)
 {
        int len = fh->size;
-       uint32_t *p;
+       __be32 *p;
 
        RESERVE_SPACE(8 + len);
        WRITE32(OP_PUTFH);
@@ -1029,7 +1029,7 @@ encode_putfh(struct xdr_stream *xdr, const struct nfs_fh *fh)
 
 static int encode_putrootfh(struct xdr_stream *xdr)
 {
-        uint32_t *p;
+        __be32 *p;
         
         RESERVE_SPACE(4);
         WRITE32(OP_PUTROOTFH);
@@ -1040,7 +1040,7 @@ static int encode_putrootfh(struct xdr_stream *xdr)
 static void encode_stateid(struct xdr_stream *xdr, const struct nfs_open_context *ctx)
 {
        nfs4_stateid stateid;
-       uint32_t *p;
+       __be32 *p;
 
        RESERVE_SPACE(16);
        if (ctx->state != NULL) {
@@ -1052,7 +1052,7 @@ static void encode_stateid(struct xdr_stream *xdr, const struct nfs_open_context
 
 static int encode_read(struct xdr_stream *xdr, const struct nfs_readargs *args)
 {
-       uint32_t *p;
+       __be32 *p;
 
        RESERVE_SPACE(4);
        WRITE32(OP_READ);
@@ -1074,7 +1074,7 @@ static int encode_readdir(struct xdr_stream *xdr, const struct nfs4_readdir_arg
                FATTR4_WORD1_MOUNTED_ON_FILEID,
        };
        int replen;
-       uint32_t *p;
+       __be32 *p;
 
        RESERVE_SPACE(32+sizeof(nfs4_verifier));
        WRITE32(OP_READDIR);
@@ -1116,7 +1116,7 @@ static int encode_readlink(struct xdr_stream *xdr, const struct nfs4_readlink *r
 {
        struct rpc_auth *auth = req->rq_task->tk_auth;
        unsigned int replen;
-       uint32_t *p;
+       __be32 *p;
 
        RESERVE_SPACE(4);
        WRITE32(OP_READLINK);
@@ -1134,7 +1134,7 @@ static int encode_readlink(struct xdr_stream *xdr, const struct nfs4_readlink *r
 
 static int encode_remove(struct xdr_stream *xdr, const struct qstr *name)
 {
-       uint32_t *p;
+       __be32 *p;
 
        RESERVE_SPACE(8 + name->len);
        WRITE32(OP_REMOVE);
@@ -1146,7 +1146,7 @@ static int encode_remove(struct xdr_stream *xdr, const struct qstr *name)
 
 static int encode_rename(struct xdr_stream *xdr, const struct qstr *oldname, const struct qstr *newname)
 {
-       uint32_t *p;
+       __be32 *p;
 
        RESERVE_SPACE(8 + oldname->len);
        WRITE32(OP_RENAME);
@@ -1162,7 +1162,7 @@ static int encode_rename(struct xdr_stream *xdr, const struct qstr *oldname, con
 
 static int encode_renew(struct xdr_stream *xdr, const struct nfs_client *client_stateid)
 {
-       uint32_t *p;
+       __be32 *p;
 
        RESERVE_SPACE(12);
        WRITE32(OP_RENEW);
@@ -1174,7 +1174,7 @@ static int encode_renew(struct xdr_stream *xdr, const struct nfs_client *client_
 static int
 encode_restorefh(struct xdr_stream *xdr)
 {
-       uint32_t *p;
+       __be32 *p;
 
        RESERVE_SPACE(4);
        WRITE32(OP_RESTOREFH);
@@ -1185,7 +1185,7 @@ encode_restorefh(struct xdr_stream *xdr)
 static int
 encode_setacl(struct xdr_stream *xdr, struct nfs_setaclargs *arg)
 {
-       uint32_t *p;
+       __be32 *p;
 
        RESERVE_SPACE(4+sizeof(zero_stateid.data));
        WRITE32(OP_SETATTR);
@@ -1204,7 +1204,7 @@ encode_setacl(struct xdr_stream *xdr, struct nfs_setaclargs *arg)
 static int
 encode_savefh(struct xdr_stream *xdr)
 {
-       uint32_t *p;
+       __be32 *p;
 
        RESERVE_SPACE(4);
        WRITE32(OP_SAVEFH);
@@ -1215,7 +1215,7 @@ encode_savefh(struct xdr_stream *xdr)
 static int encode_setattr(struct xdr_stream *xdr, const struct nfs_setattrargs *arg, const struct nfs_server *server)
 {
        int status;
-       uint32_t *p;
+       __be32 *p;
        
         RESERVE_SPACE(4+sizeof(arg->stateid.data));
         WRITE32(OP_SETATTR);
@@ -1229,7 +1229,7 @@ static int encode_setattr(struct xdr_stream *xdr, const struct nfs_setattrargs *
 
 static int encode_setclientid(struct xdr_stream *xdr, const struct nfs4_setclientid *setclientid)
 {
-       uint32_t *p;
+       __be32 *p;
 
        RESERVE_SPACE(4 + sizeof(setclientid->sc_verifier->data));
        WRITE32(OP_SETCLIENTID);
@@ -1248,7 +1248,7 @@ static int encode_setclientid(struct xdr_stream *xdr, const struct nfs4_setclien
 
 static int encode_setclientid_confirm(struct xdr_stream *xdr, const struct nfs_client *client_state)
 {
-        uint32_t *p;
+        __be32 *p;
 
         RESERVE_SPACE(12 + sizeof(client_state->cl_confirm.data));
         WRITE32(OP_SETCLIENTID_CONFIRM);
@@ -1260,7 +1260,7 @@ static int encode_setclientid_confirm(struct xdr_stream *xdr, const struct nfs_c
 
 static int encode_write(struct xdr_stream *xdr, const struct nfs_writeargs *args)
 {
-       uint32_t *p;
+       __be32 *p;
 
        RESERVE_SPACE(4);
        WRITE32(OP_WRITE);
@@ -1279,7 +1279,7 @@ static int encode_write(struct xdr_stream *xdr, const struct nfs_writeargs *args
 
 static int encode_delegreturn(struct xdr_stream *xdr, const nfs4_stateid *stateid)
 {
-       uint32_t *p;
+       __be32 *p;
 
        RESERVE_SPACE(20);
 
@@ -1295,7 +1295,7 @@ static int encode_delegreturn(struct xdr_stream *xdr, const nfs4_stateid *statei
 /*
  * Encode an ACCESS request
  */
-static int nfs4_xdr_enc_access(struct rpc_rqst *req, uint32_t *p, const struct nfs4_accessargs *args)
+static int nfs4_xdr_enc_access(struct rpc_rqst *req, __be32 *p, const struct nfs4_accessargs *args)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr = {
@@ -1313,7 +1313,7 @@ static int nfs4_xdr_enc_access(struct rpc_rqst *req, uint32_t *p, const struct n
 /*
  * Encode LOOKUP request
  */
-static int nfs4_xdr_enc_lookup(struct rpc_rqst *req, uint32_t *p, const struct nfs4_lookup_arg *args)
+static int nfs4_xdr_enc_lookup(struct rpc_rqst *req, __be32 *p, const struct nfs4_lookup_arg *args)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr = {
@@ -1337,7 +1337,7 @@ out:
 /*
  * Encode LOOKUP_ROOT request
  */
-static int nfs4_xdr_enc_lookup_root(struct rpc_rqst *req, uint32_t *p, const struct nfs4_lookup_root_arg *args)
+static int nfs4_xdr_enc_lookup_root(struct rpc_rqst *req, __be32 *p, const struct nfs4_lookup_root_arg *args)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr = {
@@ -1358,7 +1358,7 @@ out:
 /*
  * Encode REMOVE request
  */
-static int nfs4_xdr_enc_remove(struct rpc_rqst *req, uint32_t *p, const struct nfs4_remove_arg *args)
+static int nfs4_xdr_enc_remove(struct rpc_rqst *req, __be32 *p, const struct nfs4_remove_arg *args)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr = {
@@ -1380,7 +1380,7 @@ out:
 /*
  * Encode RENAME request
  */
-static int nfs4_xdr_enc_rename(struct rpc_rqst *req, uint32_t *p, const struct nfs4_rename_arg *args)
+static int nfs4_xdr_enc_rename(struct rpc_rqst *req, __be32 *p, const struct nfs4_rename_arg *args)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr = {
@@ -1410,7 +1410,7 @@ out:
 /*
  * Encode LINK request
  */
-static int nfs4_xdr_enc_link(struct rpc_rqst *req, uint32_t *p, const struct nfs4_link_arg *args)
+static int nfs4_xdr_enc_link(struct rpc_rqst *req, __be32 *p, const struct nfs4_link_arg *args)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr = {
@@ -1440,7 +1440,7 @@ out:
 /*
  * Encode CREATE request
  */
-static int nfs4_xdr_enc_create(struct rpc_rqst *req, uint32_t *p, const struct nfs4_create_arg *args)
+static int nfs4_xdr_enc_create(struct rpc_rqst *req, __be32 *p, const struct nfs4_create_arg *args)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr = {
@@ -1470,7 +1470,7 @@ out:
 /*
  * Encode SYMLINK request
  */
-static int nfs4_xdr_enc_symlink(struct rpc_rqst *req, uint32_t *p, const struct nfs4_create_arg *args)
+static int nfs4_xdr_enc_symlink(struct rpc_rqst *req, __be32 *p, const struct nfs4_create_arg *args)
 {
        return nfs4_xdr_enc_create(req, p, args);
 }
@@ -1478,7 +1478,7 @@ static int nfs4_xdr_enc_symlink(struct rpc_rqst *req, uint32_t *p, const struct
 /*
  * Encode GETATTR request
  */
-static int nfs4_xdr_enc_getattr(struct rpc_rqst *req, uint32_t *p, const struct nfs4_getattr_arg *args)
+static int nfs4_xdr_enc_getattr(struct rpc_rqst *req, __be32 *p, const struct nfs4_getattr_arg *args)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr = {
@@ -1496,7 +1496,7 @@ static int nfs4_xdr_enc_getattr(struct rpc_rqst *req, uint32_t *p, const struct
 /*
  * Encode a CLOSE request
  */
-static int nfs4_xdr_enc_close(struct rpc_rqst *req, uint32_t *p, struct nfs_closeargs *args)
+static int nfs4_xdr_enc_close(struct rpc_rqst *req, __be32 *p, struct nfs_closeargs *args)
 {
         struct xdr_stream xdr;
         struct compound_hdr hdr = {
@@ -1520,7 +1520,7 @@ out:
 /*
  * Encode an OPEN request
  */
-static int nfs4_xdr_enc_open(struct rpc_rqst *req, uint32_t *p, struct nfs_openargs *args)
+static int nfs4_xdr_enc_open(struct rpc_rqst *req, __be32 *p, struct nfs_openargs *args)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr = {
@@ -1556,7 +1556,7 @@ out:
 /*
  * Encode an OPEN_CONFIRM request
  */
-static int nfs4_xdr_enc_open_confirm(struct rpc_rqst *req, uint32_t *p, struct nfs_open_confirmargs *args)
+static int nfs4_xdr_enc_open_confirm(struct rpc_rqst *req, __be32 *p, struct nfs_open_confirmargs *args)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr = {
@@ -1577,7 +1577,7 @@ out:
 /*
  * Encode an OPEN request with no attributes.
  */
-static int nfs4_xdr_enc_open_noattr(struct rpc_rqst *req, uint32_t *p, struct nfs_openargs *args)
+static int nfs4_xdr_enc_open_noattr(struct rpc_rqst *req, __be32 *p, struct nfs_openargs *args)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr = {
@@ -1601,7 +1601,7 @@ out:
 /*
  * Encode an OPEN_DOWNGRADE request
  */
-static int nfs4_xdr_enc_open_downgrade(struct rpc_rqst *req, uint32_t *p, struct nfs_closeargs *args)
+static int nfs4_xdr_enc_open_downgrade(struct rpc_rqst *req, __be32 *p, struct nfs_closeargs *args)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr = {
@@ -1625,7 +1625,7 @@ out:
 /*
  * Encode a LOCK request
  */
-static int nfs4_xdr_enc_lock(struct rpc_rqst *req, uint32_t *p, struct nfs_lock_args *args)
+static int nfs4_xdr_enc_lock(struct rpc_rqst *req, __be32 *p, struct nfs_lock_args *args)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr = {
@@ -1646,7 +1646,7 @@ out:
 /*
  * Encode a LOCKT request
  */
-static int nfs4_xdr_enc_lockt(struct rpc_rqst *req, uint32_t *p, struct nfs_lockt_args *args)
+static int nfs4_xdr_enc_lockt(struct rpc_rqst *req, __be32 *p, struct nfs_lockt_args *args)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr = {
@@ -1667,7 +1667,7 @@ out:
 /*
  * Encode a LOCKU request
  */
-static int nfs4_xdr_enc_locku(struct rpc_rqst *req, uint32_t *p, struct nfs_locku_args *args)
+static int nfs4_xdr_enc_locku(struct rpc_rqst *req, __be32 *p, struct nfs_locku_args *args)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr = {
@@ -1688,7 +1688,7 @@ out:
 /*
  * Encode a READLINK request
  */
-static int nfs4_xdr_enc_readlink(struct rpc_rqst *req, uint32_t *p, const struct nfs4_readlink *args)
+static int nfs4_xdr_enc_readlink(struct rpc_rqst *req, __be32 *p, const struct nfs4_readlink *args)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr = {
@@ -1709,7 +1709,7 @@ out:
 /*
  * Encode a READDIR request
  */
-static int nfs4_xdr_enc_readdir(struct rpc_rqst *req, uint32_t *p, const struct nfs4_readdir_arg *args)
+static int nfs4_xdr_enc_readdir(struct rpc_rqst *req, __be32 *p, const struct nfs4_readdir_arg *args)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr = {
@@ -1730,7 +1730,7 @@ out:
 /*
  * Encode a READ request
  */
-static int nfs4_xdr_enc_read(struct rpc_rqst *req, uint32_t *p, struct nfs_readargs *args)
+static int nfs4_xdr_enc_read(struct rpc_rqst *req, __be32 *p, struct nfs_readargs *args)
 {
        struct rpc_auth *auth = req->rq_task->tk_auth;
        struct xdr_stream xdr;
@@ -1762,7 +1762,7 @@ out:
 /*
  * Encode an SETATTR request
  */
-static int nfs4_xdr_enc_setattr(struct rpc_rqst *req, uint32_t *p, struct nfs_setattrargs *args)
+static int nfs4_xdr_enc_setattr(struct rpc_rqst *req, __be32 *p, struct nfs_setattrargs *args)
 
 {
         struct xdr_stream xdr;
@@ -1788,7 +1788,7 @@ out:
  * Encode a GETACL request
  */
 static int
-nfs4_xdr_enc_getacl(struct rpc_rqst *req, uint32_t *p,
+nfs4_xdr_enc_getacl(struct rpc_rqst *req, __be32 *p,
                struct nfs_getaclargs *args)
 {
        struct xdr_stream xdr;
@@ -1815,7 +1815,7 @@ out:
 /*
  * Encode a WRITE request
  */
-static int nfs4_xdr_enc_write(struct rpc_rqst *req, uint32_t *p, struct nfs_writeargs *args)
+static int nfs4_xdr_enc_write(struct rpc_rqst *req, __be32 *p, struct nfs_writeargs *args)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr = {
@@ -1839,7 +1839,7 @@ out:
 /*
  *  a COMMIT request
  */
-static int nfs4_xdr_enc_commit(struct rpc_rqst *req, uint32_t *p, struct nfs_writeargs *args)
+static int nfs4_xdr_enc_commit(struct rpc_rqst *req, __be32 *p, struct nfs_writeargs *args)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr = {
@@ -1863,7 +1863,7 @@ out:
 /*
  * FSINFO request
  */
-static int nfs4_xdr_enc_fsinfo(struct rpc_rqst *req, uint32_t *p, struct nfs4_fsinfo_arg *args)
+static int nfs4_xdr_enc_fsinfo(struct rpc_rqst *req, __be32 *p, struct nfs4_fsinfo_arg *args)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr = {
@@ -1882,7 +1882,7 @@ static int nfs4_xdr_enc_fsinfo(struct rpc_rqst *req, uint32_t *p, struct nfs4_fs
 /*
  * a PATHCONF request
  */
-static int nfs4_xdr_enc_pathconf(struct rpc_rqst *req, uint32_t *p, const struct nfs4_pathconf_arg *args)
+static int nfs4_xdr_enc_pathconf(struct rpc_rqst *req, __be32 *p, const struct nfs4_pathconf_arg *args)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr = {
@@ -1902,7 +1902,7 @@ static int nfs4_xdr_enc_pathconf(struct rpc_rqst *req, uint32_t *p, const struct
 /*
  * a STATFS request
  */
-static int nfs4_xdr_enc_statfs(struct rpc_rqst *req, uint32_t *p, const struct nfs4_statfs_arg *args)
+static int nfs4_xdr_enc_statfs(struct rpc_rqst *req, __be32 *p, const struct nfs4_statfs_arg *args)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr = {
@@ -1923,7 +1923,7 @@ static int nfs4_xdr_enc_statfs(struct rpc_rqst *req, uint32_t *p, const struct n
 /*
  * GETATTR_BITMAP request
  */
-static int nfs4_xdr_enc_server_caps(struct rpc_rqst *req, uint32_t *p, const struct nfs_fh *fhandle)
+static int nfs4_xdr_enc_server_caps(struct rpc_rqst *req, __be32 *p, const struct nfs_fh *fhandle)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr = {
@@ -1945,7 +1945,7 @@ static int nfs4_xdr_enc_server_caps(struct rpc_rqst *req, uint32_t *p, const str
 /*
  * a RENEW request
  */
-static int nfs4_xdr_enc_renew(struct rpc_rqst *req, uint32_t *p, struct nfs_client *clp)
+static int nfs4_xdr_enc_renew(struct rpc_rqst *req, __be32 *p, struct nfs_client *clp)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr = {
@@ -1960,7 +1960,7 @@ static int nfs4_xdr_enc_renew(struct rpc_rqst *req, uint32_t *p, struct nfs_clie
 /*
  * a SETCLIENTID request
  */
-static int nfs4_xdr_enc_setclientid(struct rpc_rqst *req, uint32_t *p, struct nfs4_setclientid *sc)
+static int nfs4_xdr_enc_setclientid(struct rpc_rqst *req, __be32 *p, struct nfs4_setclientid *sc)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr = {
@@ -1975,7 +1975,7 @@ static int nfs4_xdr_enc_setclientid(struct rpc_rqst *req, uint32_t *p, struct nf
 /*
  * a SETCLIENTID_CONFIRM request
  */
-static int nfs4_xdr_enc_setclientid_confirm(struct rpc_rqst *req, uint32_t *p, struct nfs_client *clp)
+static int nfs4_xdr_enc_setclientid_confirm(struct rpc_rqst *req, __be32 *p, struct nfs_client *clp)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr = {
@@ -1997,7 +1997,7 @@ static int nfs4_xdr_enc_setclientid_confirm(struct rpc_rqst *req, uint32_t *p, s
 /*
  * DELEGRETURN request
  */
-static int nfs4_xdr_enc_delegreturn(struct rpc_rqst *req, uint32_t *p, const struct nfs4_delegreturnargs *args)
+static int nfs4_xdr_enc_delegreturn(struct rpc_rqst *req, __be32 *p, const struct nfs4_delegreturnargs *args)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr = {
@@ -2021,7 +2021,7 @@ out:
 /*
  * Encode FS_LOCATIONS request
  */
-static int nfs4_xdr_enc_fs_locations(struct rpc_rqst *req, uint32_t *p, struct nfs4_fs_locations_arg *args)
+static int nfs4_xdr_enc_fs_locations(struct rpc_rqst *req, __be32 *p, struct nfs4_fs_locations_arg *args)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr = {
@@ -2086,7 +2086,7 @@ out:
 
 static int decode_opaque_inline(struct xdr_stream *xdr, unsigned int *len, char **string)
 {
-       uint32_t *p;
+       __be32 *p;
 
        READ_BUF(4);
        READ32(*len);
@@ -2097,7 +2097,7 @@ static int decode_opaque_inline(struct xdr_stream *xdr, unsigned int *len, char
 
 static int decode_compound_hdr(struct xdr_stream *xdr, struct compound_hdr *hdr)
 {
-       uint32_t *p;
+       __be32 *p;
 
        READ_BUF(8);
        READ32(hdr->status);
@@ -2112,7 +2112,7 @@ static int decode_compound_hdr(struct xdr_stream *xdr, struct compound_hdr *hdr)
 
 static int decode_op_hdr(struct xdr_stream *xdr, enum nfs_opnum4 expected)
 {
-       uint32_t *p;
+       __be32 *p;
        uint32_t opnum;
        int32_t nfserr;
 
@@ -2134,7 +2134,7 @@ static int decode_op_hdr(struct xdr_stream *xdr, enum nfs_opnum4 expected)
 /* Dummy routine */
 static int decode_ace(struct xdr_stream *xdr, void *ace, struct nfs_client *clp)
 {
-       uint32_t *p;
+       __be32 *p;
        unsigned int strlen;
        char *str;
 
@@ -2144,7 +2144,8 @@ static int decode_ace(struct xdr_stream *xdr, void *ace, struct nfs_client *clp)
 
 static int decode_attr_bitmap(struct xdr_stream *xdr, uint32_t *bitmap)
 {
-       uint32_t bmlen, *p;
+       uint32_t bmlen;
+       __be32 *p;
 
        READ_BUF(4);
        READ32(bmlen);
@@ -2159,9 +2160,9 @@ static int decode_attr_bitmap(struct xdr_stream *xdr, uint32_t *bitmap)
        return 0;
 }
 
-static inline int decode_attr_length(struct xdr_stream *xdr, uint32_t *attrlen, uint32_t **savep)
+static inline int decode_attr_length(struct xdr_stream *xdr, uint32_t *attrlen, __be32 **savep)
 {
-       uint32_t *p;
+       __be32 *p;
 
        READ_BUF(4);
        READ32(*attrlen);
@@ -2182,7 +2183,7 @@ static int decode_attr_supported(struct xdr_stream *xdr, uint32_t *bitmap, uint3
 
 static int decode_attr_type(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *type)
 {
-       uint32_t *p;
+       __be32 *p;
 
        *type = 0;
        if (unlikely(bitmap[0] & (FATTR4_WORD0_TYPE - 1U)))
@@ -2202,7 +2203,7 @@ static int decode_attr_type(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *
 
 static int decode_attr_change(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *change)
 {
-       uint32_t *p;
+       __be32 *p;
 
        *change = 0;
        if (unlikely(bitmap[0] & (FATTR4_WORD0_CHANGE - 1U)))
@@ -2219,7 +2220,7 @@ static int decode_attr_change(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t
 
 static int decode_attr_size(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *size)
 {
-       uint32_t *p;
+       __be32 *p;
 
        *size = 0;
        if (unlikely(bitmap[0] & (FATTR4_WORD0_SIZE - 1U)))
@@ -2235,7 +2236,7 @@ static int decode_attr_size(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *
 
 static int decode_attr_link_support(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res)
 {
-       uint32_t *p;
+       __be32 *p;
 
        *res = 0;
        if (unlikely(bitmap[0] & (FATTR4_WORD0_LINK_SUPPORT - 1U)))
@@ -2251,7 +2252,7 @@ static int decode_attr_link_support(struct xdr_stream *xdr, uint32_t *bitmap, ui
 
 static int decode_attr_symlink_support(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res)
 {
-       uint32_t *p;
+       __be32 *p;
 
        *res = 0;
        if (unlikely(bitmap[0] & (FATTR4_WORD0_SYMLINK_SUPPORT - 1U)))
@@ -2267,7 +2268,7 @@ static int decode_attr_symlink_support(struct xdr_stream *xdr, uint32_t *bitmap,
 
 static int decode_attr_fsid(struct xdr_stream *xdr, uint32_t *bitmap, struct nfs_fsid *fsid)
 {
-       uint32_t *p;
+       __be32 *p;
 
        fsid->major = 0;
        fsid->minor = 0;
@@ -2287,7 +2288,7 @@ static int decode_attr_fsid(struct xdr_stream *xdr, uint32_t *bitmap, struct nfs
 
 static int decode_attr_lease_time(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res)
 {
-       uint32_t *p;
+       __be32 *p;
 
        *res = 60;
        if (unlikely(bitmap[0] & (FATTR4_WORD0_LEASE_TIME - 1U)))
@@ -2303,7 +2304,7 @@ static int decode_attr_lease_time(struct xdr_stream *xdr, uint32_t *bitmap, uint
 
 static int decode_attr_aclsupport(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res)
 {
-       uint32_t *p;
+       __be32 *p;
 
        *res = ACL4_SUPPORT_ALLOW_ACL|ACL4_SUPPORT_DENY_ACL;
        if (unlikely(bitmap[0] & (FATTR4_WORD0_ACLSUPPORT - 1U)))
@@ -2319,7 +2320,7 @@ static int decode_attr_aclsupport(struct xdr_stream *xdr, uint32_t *bitmap, uint
 
 static int decode_attr_fileid(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *fileid)
 {
-       uint32_t *p;
+       __be32 *p;
 
        *fileid = 0;
        if (unlikely(bitmap[0] & (FATTR4_WORD0_FILEID - 1U)))
@@ -2335,7 +2336,7 @@ static int decode_attr_fileid(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t
 
 static int decode_attr_mounted_on_fileid(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *fileid)
 {
-       uint32_t *p;
+       __be32 *p;
 
        *fileid = 0;
        if (unlikely(bitmap[1] & (FATTR4_WORD1_MOUNTED_ON_FILEID - 1U)))
@@ -2351,7 +2352,7 @@ static int decode_attr_mounted_on_fileid(struct xdr_stream *xdr, uint32_t *bitma
 
 static int decode_attr_files_avail(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res)
 {
-       uint32_t *p;
+       __be32 *p;
        int status = 0;
 
        *res = 0;
@@ -2368,7 +2369,7 @@ static int decode_attr_files_avail(struct xdr_stream *xdr, uint32_t *bitmap, uin
 
 static int decode_attr_files_free(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res)
 {
-       uint32_t *p;
+       __be32 *p;
        int status = 0;
 
        *res = 0;
@@ -2385,7 +2386,7 @@ static int decode_attr_files_free(struct xdr_stream *xdr, uint32_t *bitmap, uint
 
 static int decode_attr_files_total(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res)
 {
-       uint32_t *p;
+       __be32 *p;
        int status = 0;
 
        *res = 0;
@@ -2403,7 +2404,7 @@ static int decode_attr_files_total(struct xdr_stream *xdr, uint32_t *bitmap, uin
 static int decode_pathname(struct xdr_stream *xdr, struct nfs4_pathname *path)
 {
        int n;
-       uint32_t *p;
+       __be32 *p;
        int status = 0;
 
        READ_BUF(4);
@@ -2448,7 +2449,7 @@ out_eio:
 static int decode_attr_fs_locations(struct xdr_stream *xdr, uint32_t *bitmap, struct nfs4_fs_locations *res)
 {
        int n;
-       uint32_t *p;
+       __be32 *p;
        int status = -EIO;
 
        if (unlikely(bitmap[0] & (FATTR4_WORD0_FS_LOCATIONS -1U)))
@@ -2512,7 +2513,7 @@ out_eio:
 
 static int decode_attr_maxfilesize(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res)
 {
-       uint32_t *p;
+       __be32 *p;
        int status = 0;
 
        *res = 0;
@@ -2529,7 +2530,7 @@ static int decode_attr_maxfilesize(struct xdr_stream *xdr, uint32_t *bitmap, uin
 
 static int decode_attr_maxlink(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *maxlink)
 {
-       uint32_t *p;
+       __be32 *p;
        int status = 0;
 
        *maxlink = 1;
@@ -2546,7 +2547,7 @@ static int decode_attr_maxlink(struct xdr_stream *xdr, uint32_t *bitmap, uint32_
 
 static int decode_attr_maxname(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *maxname)
 {
-       uint32_t *p;
+       __be32 *p;
        int status = 0;
 
        *maxname = 1024;
@@ -2563,7 +2564,7 @@ static int decode_attr_maxname(struct xdr_stream *xdr, uint32_t *bitmap, uint32_
 
 static int decode_attr_maxread(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res)
 {
-       uint32_t *p;
+       __be32 *p;
        int status = 0;
 
        *res = 1024;
@@ -2584,7 +2585,7 @@ static int decode_attr_maxread(struct xdr_stream *xdr, uint32_t *bitmap, uint32_
 
 static int decode_attr_maxwrite(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res)
 {
-       uint32_t *p;
+       __be32 *p;
        int status = 0;
 
        *res = 1024;
@@ -2605,7 +2606,7 @@ static int decode_attr_maxwrite(struct xdr_stream *xdr, uint32_t *bitmap, uint32
 
 static int decode_attr_mode(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *mode)
 {
-       uint32_t *p;
+       __be32 *p;
 
        *mode = 0;
        if (unlikely(bitmap[1] & (FATTR4_WORD1_MODE - 1U)))
@@ -2622,7 +2623,7 @@ static int decode_attr_mode(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *
 
 static int decode_attr_nlink(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *nlink)
 {
-       uint32_t *p;
+       __be32 *p;
 
        *nlink = 1;
        if (unlikely(bitmap[1] & (FATTR4_WORD1_NUMLINKS - 1U)))
@@ -2638,7 +2639,8 @@ static int decode_attr_nlink(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t
 
 static int decode_attr_owner(struct xdr_stream *xdr, uint32_t *bitmap, struct nfs_client *clp, int32_t *uid)
 {
-       uint32_t len, *p;
+       uint32_t len;
+       __be32 *p;
 
        *uid = -2;
        if (unlikely(bitmap[1] & (FATTR4_WORD1_OWNER - 1U)))
@@ -2662,7 +2664,8 @@ static int decode_attr_owner(struct xdr_stream *xdr, uint32_t *bitmap, struct nf
 
 static int decode_attr_group(struct xdr_stream *xdr, uint32_t *bitmap, struct nfs_client *clp, int32_t *gid)
 {
-       uint32_t len, *p;
+       uint32_t len;
+       __be32 *p;
 
        *gid = -2;
        if (unlikely(bitmap[1] & (FATTR4_WORD1_OWNER_GROUP - 1U)))
@@ -2686,7 +2689,8 @@ static int decode_attr_group(struct xdr_stream *xdr, uint32_t *bitmap, struct nf
 
 static int decode_attr_rdev(struct xdr_stream *xdr, uint32_t *bitmap, dev_t *rdev)
 {
-       uint32_t major = 0, minor = 0, *p;
+       uint32_t major = 0, minor = 0;
+       __be32 *p;
 
        *rdev = MKDEV(0,0);
        if (unlikely(bitmap[1] & (FATTR4_WORD1_RAWDEV - 1U)))
@@ -2708,7 +2712,7 @@ static int decode_attr_rdev(struct xdr_stream *xdr, uint32_t *bitmap, dev_t *rde
 
 static int decode_attr_space_avail(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res)
 {
-       uint32_t *p;
+       __be32 *p;
        int status = 0;
 
        *res = 0;
@@ -2725,7 +2729,7 @@ static int decode_attr_space_avail(struct xdr_stream *xdr, uint32_t *bitmap, uin
 
 static int decode_attr_space_free(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res)
 {
-       uint32_t *p;
+       __be32 *p;
        int status = 0;
 
        *res = 0;
@@ -2742,7 +2746,7 @@ static int decode_attr_space_free(struct xdr_stream *xdr, uint32_t *bitmap, uint
 
 static int decode_attr_space_total(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res)
 {
-       uint32_t *p;
+       __be32 *p;
        int status = 0;
 
        *res = 0;
@@ -2759,7 +2763,7 @@ static int decode_attr_space_total(struct xdr_stream *xdr, uint32_t *bitmap, uin
 
 static int decode_attr_space_used(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *used)
 {
-       uint32_t *p;
+       __be32 *p;
 
        *used = 0;
        if (unlikely(bitmap[1] & (FATTR4_WORD1_SPACE_USED - 1U)))
@@ -2776,7 +2780,7 @@ static int decode_attr_space_used(struct xdr_stream *xdr, uint32_t *bitmap, uint
 
 static int decode_attr_time(struct xdr_stream *xdr, struct timespec *time)
 {
-       uint32_t *p;
+       __be32 *p;
        uint64_t sec;
        uint32_t nsec;
 
@@ -2836,7 +2840,7 @@ static int decode_attr_time_modify(struct xdr_stream *xdr, uint32_t *bitmap, str
        return status;
 }
 
-static int verify_attr_len(struct xdr_stream *xdr, uint32_t *savep, uint32_t attrlen)
+static int verify_attr_len(struct xdr_stream *xdr, __be32 *savep, uint32_t attrlen)
 {
        unsigned int attrwords = XDR_QUADLEN(attrlen);
        unsigned int nwords = xdr->p - savep;
@@ -2854,7 +2858,7 @@ static int verify_attr_len(struct xdr_stream *xdr, uint32_t *savep, uint32_t att
 
 static int decode_change_info(struct xdr_stream *xdr, struct nfs4_change_info *cinfo)
 {
-       uint32_t *p;
+       __be32 *p;
 
        READ_BUF(20);
        READ32(cinfo->atomic);
@@ -2865,7 +2869,7 @@ static int decode_change_info(struct xdr_stream *xdr, struct nfs4_change_info *c
 
 static int decode_access(struct xdr_stream *xdr, struct nfs4_accessres *access)
 {
-       uint32_t *p;
+       __be32 *p;
        uint32_t supp, acc;
        int status;
 
@@ -2882,7 +2886,7 @@ static int decode_access(struct xdr_stream *xdr, struct nfs4_accessres *access)
 
 static int decode_close(struct xdr_stream *xdr, struct nfs_closeres *res)
 {
-       uint32_t *p;
+       __be32 *p;
        int status;
 
        status = decode_op_hdr(xdr, OP_CLOSE);
@@ -2895,7 +2899,7 @@ static int decode_close(struct xdr_stream *xdr, struct nfs_closeres *res)
 
 static int decode_commit(struct xdr_stream *xdr, struct nfs_writeres *res)
 {
-       uint32_t *p;
+       __be32 *p;
        int status;
 
        status = decode_op_hdr(xdr, OP_COMMIT);
@@ -2908,7 +2912,7 @@ static int decode_commit(struct xdr_stream *xdr, struct nfs_writeres *res)
 
 static int decode_create(struct xdr_stream *xdr, struct nfs4_change_info *cinfo)
 {
-       uint32_t *p;
+       __be32 *p;
        uint32_t bmlen;
        int status;
 
@@ -2925,7 +2929,7 @@ static int decode_create(struct xdr_stream *xdr, struct nfs4_change_info *cinfo)
 
 static int decode_server_caps(struct xdr_stream *xdr, struct nfs4_server_caps_res *res)
 {
-       uint32_t *savep;
+       __be32 *savep;
        uint32_t attrlen, 
                 bitmap[2] = {0};
        int status;
@@ -2952,7 +2956,7 @@ xdr_error:
        
 static int decode_statfs(struct xdr_stream *xdr, struct nfs_fsstat *fsstat)
 {
-       uint32_t *savep;
+       __be32 *savep;
        uint32_t attrlen, 
                 bitmap[2] = {0};
        int status;
@@ -2985,7 +2989,7 @@ xdr_error:
 
 static int decode_pathconf(struct xdr_stream *xdr, struct nfs_pathconf *pathconf)
 {
-       uint32_t *savep;
+       __be32 *savep;
        uint32_t attrlen, 
                 bitmap[2] = {0};
        int status;
@@ -3010,7 +3014,7 @@ xdr_error:
 
 static int decode_getfattr(struct xdr_stream *xdr, struct nfs_fattr *fattr, const struct nfs_server *server)
 {
-       uint32_t *savep;
+       __be32 *savep;
        uint32_t attrlen,
                 bitmap[2] = {0},
                 type;
@@ -3079,7 +3083,7 @@ xdr_error:
 
 static int decode_fsinfo(struct xdr_stream *xdr, struct nfs_fsinfo *fsinfo)
 {
-       uint32_t *savep;
+       __be32 *savep;
        uint32_t attrlen, bitmap[2];
        int status;
 
@@ -3111,7 +3115,7 @@ xdr_error:
 
 static int decode_getfh(struct xdr_stream *xdr, struct nfs_fh *fh)
 {
-       uint32_t *p;
+       __be32 *p;
        uint32_t len;
        int status;
 
@@ -3147,7 +3151,7 @@ static int decode_link(struct xdr_stream *xdr, struct nfs4_change_info *cinfo)
 static int decode_lock_denied (struct xdr_stream *xdr, struct file_lock *fl)
 {
        uint64_t offset, length, clientid;
-       uint32_t *p;
+       __be32 *p;
        uint32_t namelen, type;
 
        READ_BUF(32);
@@ -3172,7 +3176,7 @@ static int decode_lock_denied (struct xdr_stream *xdr, struct file_lock *fl)
 
 static int decode_lock(struct xdr_stream *xdr, struct nfs_lock_res *res)
 {
-       uint32_t *p;
+       __be32 *p;
        int status;
 
        status = decode_op_hdr(xdr, OP_LOCK);
@@ -3195,7 +3199,7 @@ static int decode_lockt(struct xdr_stream *xdr, struct nfs_lockt_res *res)
 
 static int decode_locku(struct xdr_stream *xdr, struct nfs_locku_res *res)
 {
-       uint32_t *p;
+       __be32 *p;
        int status;
 
        status = decode_op_hdr(xdr, OP_LOCKU);
@@ -3214,7 +3218,7 @@ static int decode_lookup(struct xdr_stream *xdr)
 /* This is too sick! */
 static int decode_space_limit(struct xdr_stream *xdr, u64 *maxsize)
 {
-        uint32_t *p;
+        __be32 *p;
        uint32_t limit_type, nblocks, blocksize;
 
        READ_BUF(12);
@@ -3233,7 +3237,7 @@ static int decode_space_limit(struct xdr_stream *xdr, u64 *maxsize)
 
 static int decode_delegation(struct xdr_stream *xdr, struct nfs_openres *res)
 {
-        uint32_t *p;
+        __be32 *p;
         uint32_t delegation_type;
 
        READ_BUF(4);
@@ -3259,7 +3263,7 @@ static int decode_delegation(struct xdr_stream *xdr, struct nfs_openres *res)
 
 static int decode_open(struct xdr_stream *xdr, struct nfs_openres *res)
 {
-        uint32_t *p;
+        __be32 *p;
         uint32_t bmlen;
         int status;
 
@@ -3287,7 +3291,7 @@ xdr_error:
 
 static int decode_open_confirm(struct xdr_stream *xdr, struct nfs_open_confirmres *res)
 {
-        uint32_t *p;
+        __be32 *p;
        int status;
 
         status = decode_op_hdr(xdr, OP_OPEN_CONFIRM);
@@ -3300,7 +3304,7 @@ static int decode_open_confirm(struct xdr_stream *xdr, struct nfs_open_confirmre
 
 static int decode_open_downgrade(struct xdr_stream *xdr, struct nfs_closeres *res)
 {
-       uint32_t *p;
+       __be32 *p;
        int status;
 
        status = decode_op_hdr(xdr, OP_OPEN_DOWNGRADE);
@@ -3324,7 +3328,7 @@ static int decode_putrootfh(struct xdr_stream *xdr)
 static int decode_read(struct xdr_stream *xdr, struct rpc_rqst *req, struct nfs_readres *res)
 {
        struct kvec *iov = req->rq_rcv_buf.head;
-       uint32_t *p;
+       __be32 *p;
        uint32_t count, eof, recvd, hdrlen;
        int status;
 
@@ -3354,7 +3358,7 @@ static int decode_readdir(struct xdr_stream *xdr, struct rpc_rqst *req, struct n
        struct page     *page = *rcvbuf->pages;
        struct kvec     *iov = rcvbuf->head;
        unsigned int    nr, pglen = rcvbuf->page_len;
-       uint32_t        *end, *entry, *p, *kaddr;
+       __be32          *end, *entry, *p, *kaddr;
        uint32_t        len, attrlen, xlen;
        int             hdrlen, recvd, status;
 
@@ -3376,7 +3380,7 @@ static int decode_readdir(struct xdr_stream *xdr, struct rpc_rqst *req, struct n
        xdr_read_pages(xdr, pglen);
 
        BUG_ON(pglen + readdir->pgbase > PAGE_CACHE_SIZE);
-       kaddr = p = (uint32_t *) kmap_atomic(page, KM_USER0);
+       kaddr = p = kmap_atomic(page, KM_USER0);
        end = p + ((pglen + readdir->pgbase) >> 2);
        entry = p;
        for (nr = 0; *p++; nr++) {
@@ -3428,7 +3432,7 @@ static int decode_readlink(struct xdr_stream *xdr, struct rpc_rqst *req)
        struct xdr_buf *rcvbuf = &req->rq_rcv_buf;
        struct kvec *iov = rcvbuf->head;
        int hdrlen, len, recvd;
-       uint32_t *p;
+       __be32 *p;
        char *kaddr;
        int status;
 
@@ -3505,7 +3509,7 @@ decode_restorefh(struct xdr_stream *xdr)
 static int decode_getacl(struct xdr_stream *xdr, struct rpc_rqst *req,
                size_t *acl_len)
 {
-       uint32_t *savep;
+       __be32 *savep;
        uint32_t attrlen,
                 bitmap[2] = {0};
        struct kvec *iov = req->rq_rcv_buf.head;
@@ -3551,7 +3555,7 @@ decode_savefh(struct xdr_stream *xdr)
 
 static int decode_setattr(struct xdr_stream *xdr, struct nfs_setattrres *res)
 {
-       uint32_t *p;
+       __be32 *p;
        uint32_t bmlen;
        int status;
 
@@ -3567,7 +3571,7 @@ static int decode_setattr(struct xdr_stream *xdr, struct nfs_setattrres *res)
 
 static int decode_setclientid(struct xdr_stream *xdr, struct nfs_client *clp)
 {
-       uint32_t *p;
+       __be32 *p;
        uint32_t opnum;
        int32_t nfserr;
 
@@ -3610,7 +3614,7 @@ static int decode_setclientid_confirm(struct xdr_stream *xdr)
 
 static int decode_write(struct xdr_stream *xdr, struct nfs_writeres *res)
 {
-       uint32_t *p;
+       __be32 *p;
        int status;
 
        status = decode_op_hdr(xdr, OP_WRITE);
@@ -3632,7 +3636,7 @@ static int decode_delegreturn(struct xdr_stream *xdr)
 /*
  * Decode OPEN_DOWNGRADE response
  */
-static int nfs4_xdr_dec_open_downgrade(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_closeres *res)
+static int nfs4_xdr_dec_open_downgrade(struct rpc_rqst *rqstp, __be32 *p, struct nfs_closeres *res)
 {
         struct xdr_stream xdr;
         struct compound_hdr hdr;
@@ -3660,7 +3664,7 @@ out:
 /*
  * Decode ACCESS response
  */
-static int nfs4_xdr_dec_access(struct rpc_rqst *rqstp, uint32_t *p, struct nfs4_accessres *res)
+static int nfs4_xdr_dec_access(struct rpc_rqst *rqstp, __be32 *p, struct nfs4_accessres *res)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr;
@@ -3678,7 +3682,7 @@ out:
 /*
  * Decode LOOKUP response
  */
-static int nfs4_xdr_dec_lookup(struct rpc_rqst *rqstp, uint32_t *p, struct nfs4_lookup_res *res)
+static int nfs4_xdr_dec_lookup(struct rpc_rqst *rqstp, __be32 *p, struct nfs4_lookup_res *res)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr;
@@ -3701,7 +3705,7 @@ out:
 /*
  * Decode LOOKUP_ROOT response
  */
-static int nfs4_xdr_dec_lookup_root(struct rpc_rqst *rqstp, uint32_t *p, struct nfs4_lookup_res *res)
+static int nfs4_xdr_dec_lookup_root(struct rpc_rqst *rqstp, __be32 *p, struct nfs4_lookup_res *res)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr;
@@ -3721,7 +3725,7 @@ out:
 /*
  * Decode REMOVE response
  */
-static int nfs4_xdr_dec_remove(struct rpc_rqst *rqstp, uint32_t *p, struct nfs4_remove_res *res)
+static int nfs4_xdr_dec_remove(struct rpc_rqst *rqstp, __be32 *p, struct nfs4_remove_res *res)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr;
@@ -3742,7 +3746,7 @@ out:
 /*
  * Decode RENAME response
  */
-static int nfs4_xdr_dec_rename(struct rpc_rqst *rqstp, uint32_t *p, struct nfs4_rename_res *res)
+static int nfs4_xdr_dec_rename(struct rpc_rqst *rqstp, __be32 *p, struct nfs4_rename_res *res)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr;
@@ -3772,7 +3776,7 @@ out:
 /*
  * Decode LINK response
  */
-static int nfs4_xdr_dec_link(struct rpc_rqst *rqstp, uint32_t *p, struct nfs4_link_res *res)
+static int nfs4_xdr_dec_link(struct rpc_rqst *rqstp, __be32 *p, struct nfs4_link_res *res)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr;
@@ -3805,7 +3809,7 @@ out:
 /*
  * Decode CREATE response
  */
-static int nfs4_xdr_dec_create(struct rpc_rqst *rqstp, uint32_t *p, struct nfs4_create_res *res)
+static int nfs4_xdr_dec_create(struct rpc_rqst *rqstp, __be32 *p, struct nfs4_create_res *res)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr;
@@ -3834,7 +3838,7 @@ out:
 /*
  * Decode SYMLINK response
  */
-static int nfs4_xdr_dec_symlink(struct rpc_rqst *rqstp, uint32_t *p, struct nfs4_create_res *res)
+static int nfs4_xdr_dec_symlink(struct rpc_rqst *rqstp, __be32 *p, struct nfs4_create_res *res)
 {
        return nfs4_xdr_dec_create(rqstp, p, res);
 }
@@ -3842,7 +3846,7 @@ static int nfs4_xdr_dec_symlink(struct rpc_rqst *rqstp, uint32_t *p, struct nfs4
 /*
  * Decode GETATTR response
  */
-static int nfs4_xdr_dec_getattr(struct rpc_rqst *rqstp, uint32_t *p, struct nfs4_getattr_res *res)
+static int nfs4_xdr_dec_getattr(struct rpc_rqst *rqstp, __be32 *p, struct nfs4_getattr_res *res)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr;
@@ -3865,7 +3869,7 @@ out:
  * Encode an SETACL request
  */
 static int
-nfs4_xdr_enc_setacl(struct rpc_rqst *req, uint32_t *p, struct nfs_setaclargs *args)
+nfs4_xdr_enc_setacl(struct rpc_rqst *req, __be32 *p, struct nfs_setaclargs *args)
 {
         struct xdr_stream xdr;
         struct compound_hdr hdr = {
@@ -3886,7 +3890,7 @@ out:
  * Decode SETACL response
  */
 static int
-nfs4_xdr_dec_setacl(struct rpc_rqst *rqstp, uint32_t *p, void *res)
+nfs4_xdr_dec_setacl(struct rpc_rqst *rqstp, __be32 *p, void *res)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr;
@@ -3908,7 +3912,7 @@ out:
  * Decode GETACL response
  */
 static int
-nfs4_xdr_dec_getacl(struct rpc_rqst *rqstp, uint32_t *p, size_t *acl_len)
+nfs4_xdr_dec_getacl(struct rpc_rqst *rqstp, __be32 *p, size_t *acl_len)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr;
@@ -3930,7 +3934,7 @@ out:
 /*
  * Decode CLOSE response
  */
-static int nfs4_xdr_dec_close(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_closeres *res)
+static int nfs4_xdr_dec_close(struct rpc_rqst *rqstp, __be32 *p, struct nfs_closeres *res)
 {
         struct xdr_stream xdr;
         struct compound_hdr hdr;
@@ -3960,7 +3964,7 @@ out:
 /*
  * Decode OPEN response
  */
-static int nfs4_xdr_dec_open(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_openres *res)
+static int nfs4_xdr_dec_open(struct rpc_rqst *rqstp, __be32 *p, struct nfs_openres *res)
 {
         struct xdr_stream xdr;
         struct compound_hdr hdr;
@@ -3994,7 +3998,7 @@ out:
 /*
  * Decode OPEN_CONFIRM response
  */
-static int nfs4_xdr_dec_open_confirm(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_open_confirmres *res)
+static int nfs4_xdr_dec_open_confirm(struct rpc_rqst *rqstp, __be32 *p, struct nfs_open_confirmres *res)
 {
         struct xdr_stream xdr;
         struct compound_hdr hdr;
@@ -4015,7 +4019,7 @@ out:
 /*
  * Decode OPEN response
  */
-static int nfs4_xdr_dec_open_noattr(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_openres *res)
+static int nfs4_xdr_dec_open_noattr(struct rpc_rqst *rqstp, __be32 *p, struct nfs_openres *res)
 {
         struct xdr_stream xdr;
         struct compound_hdr hdr;
@@ -4039,7 +4043,7 @@ out:
 /*
  * Decode SETATTR response
  */
-static int nfs4_xdr_dec_setattr(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_setattrres *res)
+static int nfs4_xdr_dec_setattr(struct rpc_rqst *rqstp, __be32 *p, struct nfs_setattrres *res)
 {
         struct xdr_stream xdr;
         struct compound_hdr hdr;
@@ -4065,7 +4069,7 @@ out:
 /*
  * Decode LOCK response
  */
-static int nfs4_xdr_dec_lock(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_lock_res *res)
+static int nfs4_xdr_dec_lock(struct rpc_rqst *rqstp, __be32 *p, struct nfs_lock_res *res)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr;
@@ -4086,7 +4090,7 @@ out:
 /*
  * Decode LOCKT response
  */
-static int nfs4_xdr_dec_lockt(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_lockt_res *res)
+static int nfs4_xdr_dec_lockt(struct rpc_rqst *rqstp, __be32 *p, struct nfs_lockt_res *res)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr;
@@ -4107,7 +4111,7 @@ out:
 /*
  * Decode LOCKU response
  */
-static int nfs4_xdr_dec_locku(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_locku_res *res)
+static int nfs4_xdr_dec_locku(struct rpc_rqst *rqstp, __be32 *p, struct nfs_locku_res *res)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr;
@@ -4128,7 +4132,7 @@ out:
 /*
  * Decode READLINK response
  */
-static int nfs4_xdr_dec_readlink(struct rpc_rqst *rqstp, uint32_t *p, void *res)
+static int nfs4_xdr_dec_readlink(struct rpc_rqst *rqstp, __be32 *p, void *res)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr;
@@ -4149,7 +4153,7 @@ out:
 /*
  * Decode READDIR response
  */
-static int nfs4_xdr_dec_readdir(struct rpc_rqst *rqstp, uint32_t *p, struct nfs4_readdir_res *res)
+static int nfs4_xdr_dec_readdir(struct rpc_rqst *rqstp, __be32 *p, struct nfs4_readdir_res *res)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr;
@@ -4170,7 +4174,7 @@ out:
 /*
  * Decode Read response
  */
-static int nfs4_xdr_dec_read(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_readres *res)
+static int nfs4_xdr_dec_read(struct rpc_rqst *rqstp, __be32 *p, struct nfs_readres *res)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr;
@@ -4193,7 +4197,7 @@ out:
 /*
  * Decode WRITE response
  */
-static int nfs4_xdr_dec_write(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_writeres *res)
+static int nfs4_xdr_dec_write(struct rpc_rqst *rqstp, __be32 *p, struct nfs_writeres *res)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr;
@@ -4219,7 +4223,7 @@ out:
 /*
  * Decode COMMIT response
  */
-static int nfs4_xdr_dec_commit(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_writeres *res)
+static int nfs4_xdr_dec_commit(struct rpc_rqst *rqstp, __be32 *p, struct nfs_writeres *res)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr;
@@ -4243,7 +4247,7 @@ out:
 /*
  * FSINFO request
  */
-static int nfs4_xdr_dec_fsinfo(struct rpc_rqst *req, uint32_t *p, struct nfs_fsinfo *fsinfo)
+static int nfs4_xdr_dec_fsinfo(struct rpc_rqst *req, __be32 *p, struct nfs_fsinfo *fsinfo)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr;
@@ -4263,7 +4267,7 @@ static int nfs4_xdr_dec_fsinfo(struct rpc_rqst *req, uint32_t *p, struct nfs_fsi
 /*
  * PATHCONF request
  */
-static int nfs4_xdr_dec_pathconf(struct rpc_rqst *req, uint32_t *p, struct nfs_pathconf *pathconf)
+static int nfs4_xdr_dec_pathconf(struct rpc_rqst *req, __be32 *p, struct nfs_pathconf *pathconf)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr;
@@ -4281,7 +4285,7 @@ static int nfs4_xdr_dec_pathconf(struct rpc_rqst *req, uint32_t *p, struct nfs_p
 /*
  * STATFS request
  */
-static int nfs4_xdr_dec_statfs(struct rpc_rqst *req, uint32_t *p, struct nfs_fsstat *fsstat)
+static int nfs4_xdr_dec_statfs(struct rpc_rqst *req, __be32 *p, struct nfs_fsstat *fsstat)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr;
@@ -4299,7 +4303,7 @@ static int nfs4_xdr_dec_statfs(struct rpc_rqst *req, uint32_t *p, struct nfs_fss
 /*
  * GETATTR_BITMAP request
  */
-static int nfs4_xdr_dec_server_caps(struct rpc_rqst *req, uint32_t *p, struct nfs4_server_caps_res *res)
+static int nfs4_xdr_dec_server_caps(struct rpc_rqst *req, __be32 *p, struct nfs4_server_caps_res *res)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr;
@@ -4318,7 +4322,7 @@ out:
 /*
  * Decode RENEW response
  */
-static int nfs4_xdr_dec_renew(struct rpc_rqst *rqstp, uint32_t *p, void *dummy)
+static int nfs4_xdr_dec_renew(struct rpc_rqst *rqstp, __be32 *p, void *dummy)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr;
@@ -4334,7 +4338,7 @@ static int nfs4_xdr_dec_renew(struct rpc_rqst *rqstp, uint32_t *p, void *dummy)
 /*
  * a SETCLIENTID request
  */
-static int nfs4_xdr_dec_setclientid(struct rpc_rqst *req, uint32_t *p,
+static int nfs4_xdr_dec_setclientid(struct rpc_rqst *req, __be32 *p,
                struct nfs_client *clp)
 {
        struct xdr_stream xdr;
@@ -4353,7 +4357,7 @@ static int nfs4_xdr_dec_setclientid(struct rpc_rqst *req, uint32_t *p,
 /*
  * a SETCLIENTID_CONFIRM request
  */
-static int nfs4_xdr_dec_setclientid_confirm(struct rpc_rqst *req, uint32_t *p, struct nfs_fsinfo *fsinfo)
+static int nfs4_xdr_dec_setclientid_confirm(struct rpc_rqst *req, __be32 *p, struct nfs_fsinfo *fsinfo)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr;
@@ -4375,7 +4379,7 @@ static int nfs4_xdr_dec_setclientid_confirm(struct rpc_rqst *req, uint32_t *p, s
 /*
  * DELEGRETURN request
  */
-static int nfs4_xdr_dec_delegreturn(struct rpc_rqst *rqstp, uint32_t *p, struct nfs4_delegreturnres *res)
+static int nfs4_xdr_dec_delegreturn(struct rpc_rqst *rqstp, __be32 *p, struct nfs4_delegreturnres *res)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr;
@@ -4397,7 +4401,7 @@ out:
 /*
  * FS_LOCATIONS request
  */
-static int nfs4_xdr_dec_fs_locations(struct rpc_rqst *req, uint32_t *p, struct nfs4_fs_locations *res)
+static int nfs4_xdr_dec_fs_locations(struct rpc_rqst *req, __be32 *p, struct nfs4_fs_locations *res)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr;
@@ -4417,7 +4421,7 @@ out:
        return status;
 }
 
-uint32_t *nfs4_decode_dirent(uint32_t *p, struct nfs_entry *entry, int plus)
+__be32 *nfs4_decode_dirent(__be32 *p, struct nfs_entry *entry, int plus)
 {
        uint32_t bitmap[2] = {0};
        uint32_t len;
index 28659a919d6e47e5dfcf4ec3a0bdc7e827b4d477..28108c82b88742d6e325a0736f820bf8e044910e 100644 (file)
@@ -834,7 +834,7 @@ static int nfs4_get_sb(struct file_system_type *fs_type,
        }
        /* RFC3530: The default port for NFS is 2049 */
        if (addr.sin_port == 0)
-               addr.sin_port = NFS_PORT;
+               addr.sin_port = htons(NFS_PORT);
 
        /* Grab the authentication type */
        authflavour = RPC_AUTH_UNIX;
index f6675d2c386c29127a9e6bad4223f47a1dbd3e12..883dd4a1c157599284f3bae5127fa69418ec06e1 100644 (file)
@@ -57,6 +57,8 @@
 #include <linux/nfs_fs.h>
 #include <linux/nfs_mount.h>
 #include <linux/nfs_page.h>
+#include <linux/backing-dev.h>
+
 #include <asm/uaccess.h>
 #include <linux/smp_lock.h>
 
@@ -395,7 +397,7 @@ int nfs_writepages(struct address_space *mapping, struct writeback_control *wbc)
 out:
        clear_bit(BDI_write_congested, &bdi->state);
        wake_up_all(&nfs_write_congestion);
-       writeback_congestion_end();
+       congestion_end(WRITE);
        return err;
 }
 
@@ -588,10 +590,10 @@ static void nfs_cancel_commit_list(struct list_head *head)
 
        while(!list_empty(head)) {
                req = nfs_list_entry(head->next);
+               dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS);
                nfs_list_remove_request(req);
                nfs_inode_remove_request(req);
-               dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS);
-               nfs_clear_page_writeback(req);
+               nfs_unlock_request(req);
        }
 }
 
index 0c2be8c0307dea818c03d196e01b9e82b7ca4cff..c11f5375d7c11e7c0aa08b0f275310109bfa4f79 100644 (file)
@@ -46,7 +46,7 @@ xdr_nfsace_encode(struct xdr_array2_desc *desc, void *elem)
 {
        struct nfsacl_encode_desc *nfsacl_desc =
                (struct nfsacl_encode_desc *) desc;
-       u32 *p = (u32 *) elem;
+       __be32 *p = elem;
 
        struct posix_acl_entry *entry =
                &nfsacl_desc->acl->a_entries[nfsacl_desc->count++];
@@ -127,7 +127,7 @@ xdr_nfsace_decode(struct xdr_array2_desc *desc, void *elem)
 {
        struct nfsacl_decode_desc *nfsacl_desc =
                (struct nfsacl_decode_desc *) desc;
-       u32 *p = (u32 *) elem;
+       __be32 *p = elem;
        struct posix_acl_entry *entry;
 
        if (!nfsacl_desc->acl) {
index e13fa23bd108a2f8b86b9e3388a46509a003da64..f37df46d2eaa5d13042a0557c79a27ff2d510873 100644 (file)
@@ -1148,12 +1148,12 @@ exp_find(struct auth_domain *clp, int fsid_type, u32 *fsidv,
  * for a given NFSv4 client.   The root is defined to be the
  * export point with fsid==0
  */
-int
+__be32
 exp_pseudoroot(struct auth_domain *clp, struct svc_fh *fhp,
               struct cache_req *creq)
 {
        struct svc_export *exp;
-       int rv;
+       __be32 rv;
        u32 fsidv[2];
 
        mk_fsid_v1(fsidv, 0);
index 7b889ff15ae63a96ef47be64172c7d360ef2d61a..11fdaf7721b4e68f53d71ae6994d621b21d90a44 100644 (file)
@@ -25,7 +25,7 @@
 static u32
 nlm_fopen(struct svc_rqst *rqstp, struct nfs_fh *f, struct file **filp)
 {
-       u32             nfserr;
+       __be32          nfserr;
        struct svc_fh   fh;
 
        /* must initialize before using! but maxsize doesn't matter */
@@ -39,18 +39,20 @@ nlm_fopen(struct svc_rqst *rqstp, struct nfs_fh *f, struct file **filp)
        fh_put(&fh);
        rqstp->rq_client = NULL;
        exp_readunlock();
-       /* nlm and nfsd don't share error codes.
-        * we invent: 0 = no error
-        *            1 = stale file handle
-        *            2 = other error
+       /* We return nlm error codes as nlm doesn't know
+        * about nfsd, but nfsd does know about nlm..
         */
        switch (nfserr) {
        case nfs_ok:
                return 0;
+       case nfserr_dropit:
+               return nlm_drop_reply;
+#ifdef CONFIG_LOCKD_V4
        case nfserr_stale:
-               return 1;
+               return nlm4_stale_fh;
+#endif
        default:
-               return 2;
+               return nlm_lck_denied;
        }
 }
 
index 9187755661df06d9aec879a08167e9848c26c399..e3eca0816986fd2b6410f020ad9919c2b5f9e5e4 100644 (file)
@@ -21,7 +21,7 @@
 /*
  * NULL call.
  */
-static int
+static __be32
 nfsacld_proc_null(struct svc_rqst *rqstp, void *argp, void *resp)
 {
        return nfs_ok;
@@ -30,12 +30,12 @@ nfsacld_proc_null(struct svc_rqst *rqstp, void *argp, void *resp)
 /*
  * Get the Access and/or Default ACL of a file.
  */
-static int nfsacld_proc_getacl(struct svc_rqst * rqstp,
+static __be32 nfsacld_proc_getacl(struct svc_rqst * rqstp,
                struct nfsd3_getaclargs *argp, struct nfsd3_getaclres *resp)
 {
        svc_fh *fh;
        struct posix_acl *acl;
-       int nfserr = 0;
+       __be32 nfserr = 0;
 
        dprintk("nfsd: GETACL(2acl)   %s\n", SVCFH_fmt(&argp->fh));
 
@@ -97,12 +97,12 @@ fail:
 /*
  * Set the Access and/or Default ACL of a file.
  */
-static int nfsacld_proc_setacl(struct svc_rqst * rqstp,
+static __be32 nfsacld_proc_setacl(struct svc_rqst * rqstp,
                struct nfsd3_setaclargs *argp,
                struct nfsd_attrstat *resp)
 {
        svc_fh *fh;
-       int nfserr = 0;
+       __be32 nfserr = 0;
 
        dprintk("nfsd: SETACL(2acl)   %s\n", SVCFH_fmt(&argp->fh));
 
@@ -128,7 +128,7 @@ static int nfsacld_proc_setacl(struct svc_rqst * rqstp,
 /*
  * Check file attributes
  */
-static int nfsacld_proc_getattr(struct svc_rqst * rqstp,
+static __be32 nfsacld_proc_getattr(struct svc_rqst * rqstp,
                struct nfsd_fhandle *argp, struct nfsd_attrstat *resp)
 {
        dprintk("nfsd: GETATTR  %s\n", SVCFH_fmt(&argp->fh));
@@ -140,10 +140,10 @@ static int nfsacld_proc_getattr(struct svc_rqst * rqstp,
 /*
  * Check file access
  */
-static int nfsacld_proc_access(struct svc_rqst *rqstp, struct nfsd3_accessargs *argp,
+static __be32 nfsacld_proc_access(struct svc_rqst *rqstp, struct nfsd3_accessargs *argp,
                struct nfsd3_accessres *resp)
 {
-       int nfserr;
+       __be32 nfserr;
 
        dprintk("nfsd: ACCESS(2acl)   %s 0x%x\n",
                        SVCFH_fmt(&argp->fh),
@@ -158,7 +158,7 @@ static int nfsacld_proc_access(struct svc_rqst *rqstp, struct nfsd3_accessargs *
 /*
  * XDR decode functions
  */
-static int nfsaclsvc_decode_getaclargs(struct svc_rqst *rqstp, u32 *p,
+static int nfsaclsvc_decode_getaclargs(struct svc_rqst *rqstp, __be32 *p,
                struct nfsd3_getaclargs *argp)
 {
        if (!(p = nfs2svc_decode_fh(p, &argp->fh)))
@@ -169,7 +169,7 @@ static int nfsaclsvc_decode_getaclargs(struct svc_rqst *rqstp, u32 *p,
 }
 
 
-static int nfsaclsvc_decode_setaclargs(struct svc_rqst *rqstp, u32 *p,
+static int nfsaclsvc_decode_setaclargs(struct svc_rqst *rqstp, __be32 *p,
                struct nfsd3_setaclargs *argp)
 {
        struct kvec *head = rqstp->rq_arg.head;
@@ -194,7 +194,7 @@ static int nfsaclsvc_decode_setaclargs(struct svc_rqst *rqstp, u32 *p,
        return (n > 0);
 }
 
-static int nfsaclsvc_decode_fhandleargs(struct svc_rqst *rqstp, u32 *p,
+static int nfsaclsvc_decode_fhandleargs(struct svc_rqst *rqstp, __be32 *p,
                struct nfsd_fhandle *argp)
 {
        if (!(p = nfs2svc_decode_fh(p, &argp->fh)))
@@ -202,7 +202,7 @@ static int nfsaclsvc_decode_fhandleargs(struct svc_rqst *rqstp, u32 *p,
        return xdr_argsize_check(rqstp, p);
 }
 
-static int nfsaclsvc_decode_accessargs(struct svc_rqst *rqstp, u32 *p,
+static int nfsaclsvc_decode_accessargs(struct svc_rqst *rqstp, __be32 *p,
                struct nfsd3_accessargs *argp)
 {
        if (!(p = nfs2svc_decode_fh(p, &argp->fh)))
@@ -217,7 +217,7 @@ static int nfsaclsvc_decode_accessargs(struct svc_rqst *rqstp, u32 *p,
  */
 
 /* GETACL */
-static int nfsaclsvc_encode_getaclres(struct svc_rqst *rqstp, u32 *p,
+static int nfsaclsvc_encode_getaclres(struct svc_rqst *rqstp, __be32 *p,
                struct nfsd3_getaclres *resp)
 {
        struct dentry *dentry = resp->fh.fh_dentry;
@@ -259,7 +259,7 @@ static int nfsaclsvc_encode_getaclres(struct svc_rqst *rqstp, u32 *p,
        return 1;
 }
 
-static int nfsaclsvc_encode_attrstatres(struct svc_rqst *rqstp, u32 *p,
+static int nfsaclsvc_encode_attrstatres(struct svc_rqst *rqstp, __be32 *p,
                struct nfsd_attrstat *resp)
 {
        p = nfs2svc_encode_fattr(rqstp, p, &resp->fh);
@@ -267,7 +267,7 @@ static int nfsaclsvc_encode_attrstatres(struct svc_rqst *rqstp, u32 *p,
 }
 
 /* ACCESS */
-static int nfsaclsvc_encode_accessres(struct svc_rqst *rqstp, u32 *p,
+static int nfsaclsvc_encode_accessres(struct svc_rqst *rqstp, __be32 *p,
                struct nfsd3_accessres *resp)
 {
        p = nfs2svc_encode_fattr(rqstp, p, &resp->fh);
@@ -278,7 +278,7 @@ static int nfsaclsvc_encode_accessres(struct svc_rqst *rqstp, u32 *p,
 /*
  * XDR release functions
  */
-static int nfsaclsvc_release_getacl(struct svc_rqst *rqstp, u32 *p,
+static int nfsaclsvc_release_getacl(struct svc_rqst *rqstp, __be32 *p,
                struct nfsd3_getaclres *resp)
 {
        fh_put(&resp->fh);
@@ -287,7 +287,7 @@ static int nfsaclsvc_release_getacl(struct svc_rqst *rqstp, u32 *p,
        return 1;
 }
 
-static int nfsaclsvc_release_fhandle(struct svc_rqst *rqstp, u32 *p,
+static int nfsaclsvc_release_fhandle(struct svc_rqst *rqstp, __be32 *p,
                struct nfsd_fhandle *resp)
 {
        fh_put(&resp->fh);
index d4bdc00c1169cc3f462a1fe11e2ebae0e72b15a9..fcad2895ddb00dd288fb07618c1047d919b75076 100644 (file)
@@ -19,7 +19,7 @@
 /*
  * NULL call.
  */
-static int
+static __be32
 nfsd3_proc_null(struct svc_rqst *rqstp, void *argp, void *resp)
 {
        return nfs_ok;
@@ -28,12 +28,12 @@ nfsd3_proc_null(struct svc_rqst *rqstp, void *argp, void *resp)
 /*
  * Get the Access and/or Default ACL of a file.
  */
-static int nfsd3_proc_getacl(struct svc_rqst * rqstp,
+static __be32 nfsd3_proc_getacl(struct svc_rqst * rqstp,
                struct nfsd3_getaclargs *argp, struct nfsd3_getaclres *resp)
 {
        svc_fh *fh;
        struct posix_acl *acl;
-       int nfserr = 0;
+       __be32 nfserr = 0;
 
        fh = fh_copy(&resp->fh, &argp->fh);
        if ((nfserr = fh_verify(rqstp, &resp->fh, 0, MAY_NOP)))
@@ -93,12 +93,12 @@ fail:
 /*
  * Set the Access and/or Default ACL of a file.
  */
-static int nfsd3_proc_setacl(struct svc_rqst * rqstp,
+static __be32 nfsd3_proc_setacl(struct svc_rqst * rqstp,
                struct nfsd3_setaclargs *argp,
                struct nfsd3_attrstat *resp)
 {
        svc_fh *fh;
-       int nfserr = 0;
+       __be32 nfserr = 0;
 
        fh = fh_copy(&resp->fh, &argp->fh);
        nfserr = fh_verify(rqstp, &resp->fh, 0, MAY_SATTR);
@@ -122,7 +122,7 @@ static int nfsd3_proc_setacl(struct svc_rqst * rqstp,
 /*
  * XDR decode functions
  */
-static int nfs3svc_decode_getaclargs(struct svc_rqst *rqstp, u32 *p,
+static int nfs3svc_decode_getaclargs(struct svc_rqst *rqstp, __be32 *p,
                struct nfsd3_getaclargs *args)
 {
        if (!(p = nfs3svc_decode_fh(p, &args->fh)))
@@ -133,7 +133,7 @@ static int nfs3svc_decode_getaclargs(struct svc_rqst *rqstp, u32 *p,
 }
 
 
-static int nfs3svc_decode_setaclargs(struct svc_rqst *rqstp, u32 *p,
+static int nfs3svc_decode_setaclargs(struct svc_rqst *rqstp, __be32 *p,
                struct nfsd3_setaclargs *args)
 {
        struct kvec *head = rqstp->rq_arg.head;
@@ -163,7 +163,7 @@ static int nfs3svc_decode_setaclargs(struct svc_rqst *rqstp, u32 *p,
  */
 
 /* GETACL */
-static int nfs3svc_encode_getaclres(struct svc_rqst *rqstp, u32 *p,
+static int nfs3svc_encode_getaclres(struct svc_rqst *rqstp, __be32 *p,
                struct nfsd3_getaclres *resp)
 {
        struct dentry *dentry = resp->fh.fh_dentry;
@@ -208,7 +208,7 @@ static int nfs3svc_encode_getaclres(struct svc_rqst *rqstp, u32 *p,
 }
 
 /* SETACL */
-static int nfs3svc_encode_setaclres(struct svc_rqst *rqstp, u32 *p,
+static int nfs3svc_encode_setaclres(struct svc_rqst *rqstp, __be32 *p,
                struct nfsd3_attrstat *resp)
 {
        p = nfs3svc_encode_post_op_attr(rqstp, p, &resp->fh);
@@ -219,7 +219,7 @@ static int nfs3svc_encode_setaclres(struct svc_rqst *rqstp, u32 *p,
 /*
  * XDR release functions
  */
-static int nfs3svc_release_getacl(struct svc_rqst *rqstp, u32 *p,
+static int nfs3svc_release_getacl(struct svc_rqst *rqstp, __be32 *p,
                struct nfsd3_getaclres *resp)
 {
        fh_put(&resp->fh);
index a5ebc7dbb3842d7d1a3f9a7de6256831a07d026b..64db601c2bd2e90848aa653c1fca55710fdeef4a 100644 (file)
@@ -43,7 +43,7 @@ static int    nfs3_ftypes[] = {
 /*
  * NULL call.
  */
-static int
+static __be32
 nfsd3_proc_null(struct svc_rqst *rqstp, void *argp, void *resp)
 {
        return nfs_ok;
@@ -52,11 +52,12 @@ nfsd3_proc_null(struct svc_rqst *rqstp, void *argp, void *resp)
 /*
  * Get a file's attributes
  */
-static int
+static __be32
 nfsd3_proc_getattr(struct svc_rqst *rqstp, struct nfsd_fhandle  *argp,
                                           struct nfsd3_attrstat *resp)
 {
-       int     err, nfserr;
+       int     err;
+       __be32  nfserr;
 
        dprintk("nfsd: GETATTR(3)  %s\n",
                SVCFH_fmt(&argp->fh));
@@ -76,11 +77,11 @@ nfsd3_proc_getattr(struct svc_rqst *rqstp, struct nfsd_fhandle  *argp,
 /*
  * Set a file's attributes
  */
-static int
+static __be32
 nfsd3_proc_setattr(struct svc_rqst *rqstp, struct nfsd3_sattrargs *argp,
                                           struct nfsd3_attrstat  *resp)
 {
-       int     nfserr;
+       __be32  nfserr;
 
        dprintk("nfsd: SETATTR(3)  %s\n",
                                SVCFH_fmt(&argp->fh));
@@ -94,11 +95,11 @@ nfsd3_proc_setattr(struct svc_rqst *rqstp, struct nfsd3_sattrargs *argp,
 /*
  * Look up a path name component
  */
-static int
+static __be32
 nfsd3_proc_lookup(struct svc_rqst *rqstp, struct nfsd3_diropargs *argp,
                                          struct nfsd3_diropres  *resp)
 {
-       int     nfserr;
+       __be32  nfserr;
 
        dprintk("nfsd: LOOKUP(3)   %s %.*s\n",
                                SVCFH_fmt(&argp->fh),
@@ -118,11 +119,11 @@ nfsd3_proc_lookup(struct svc_rqst *rqstp, struct nfsd3_diropargs *argp,
 /*
  * Check file access
  */
-static int
+static __be32
 nfsd3_proc_access(struct svc_rqst *rqstp, struct nfsd3_accessargs *argp,
                                          struct nfsd3_accessres *resp)
 {
-       int     nfserr;
+       __be32  nfserr;
 
        dprintk("nfsd: ACCESS(3)   %s 0x%x\n",
                                SVCFH_fmt(&argp->fh),
@@ -137,11 +138,11 @@ nfsd3_proc_access(struct svc_rqst *rqstp, struct nfsd3_accessargs *argp,
 /*
  * Read a symlink.
  */
-static int
+static __be32
 nfsd3_proc_readlink(struct svc_rqst *rqstp, struct nfsd3_readlinkargs *argp,
                                           struct nfsd3_readlinkres *resp)
 {
-       int nfserr;
+       __be32 nfserr;
 
        dprintk("nfsd: READLINK(3) %s\n", SVCFH_fmt(&argp->fh));
 
@@ -155,11 +156,11 @@ nfsd3_proc_readlink(struct svc_rqst *rqstp, struct nfsd3_readlinkargs *argp,
 /*
  * Read a portion of a file.
  */
-static int
+static __be32
 nfsd3_proc_read(struct svc_rqst *rqstp, struct nfsd3_readargs *argp,
                                        struct nfsd3_readres  *resp)
 {
-       int     nfserr;
+       __be32  nfserr;
        u32     max_blocksize = svc_max_payload(rqstp);
 
        dprintk("nfsd: READ(3) %s %lu bytes at %lu\n",
@@ -195,11 +196,11 @@ nfsd3_proc_read(struct svc_rqst *rqstp, struct nfsd3_readargs *argp,
 /*
  * Write data to a file
  */
-static int
+static __be32
 nfsd3_proc_write(struct svc_rqst *rqstp, struct nfsd3_writeargs *argp,
                                         struct nfsd3_writeres  *resp)
 {
-       int     nfserr;
+       __be32  nfserr;
 
        dprintk("nfsd: WRITE(3)    %s %d bytes at %ld%s\n",
                                SVCFH_fmt(&argp->fh),
@@ -223,13 +224,13 @@ nfsd3_proc_write(struct svc_rqst *rqstp, struct nfsd3_writeargs *argp,
  * At least in theory; we'll see how it fares in practice when the
  * first reports about SunOS compatibility problems start to pour in...
  */
-static int
+static __be32
 nfsd3_proc_create(struct svc_rqst *rqstp, struct nfsd3_createargs *argp,
                                          struct nfsd3_diropres   *resp)
 {
        svc_fh          *dirfhp, *newfhp = NULL;
        struct iattr    *attr;
-       u32             nfserr;
+       __be32          nfserr;
 
        dprintk("nfsd: CREATE(3)   %s %.*s\n",
                                SVCFH_fmt(&argp->fh),
@@ -265,11 +266,11 @@ nfsd3_proc_create(struct svc_rqst *rqstp, struct nfsd3_createargs *argp,
 /*
  * Make directory. This operation is not idempotent.
  */
-static int
+static __be32
 nfsd3_proc_mkdir(struct svc_rqst *rqstp, struct nfsd3_createargs *argp,
                                         struct nfsd3_diropres   *resp)
 {
-       int     nfserr;
+       __be32  nfserr;
 
        dprintk("nfsd: MKDIR(3)    %s %.*s\n",
                                SVCFH_fmt(&argp->fh),
@@ -285,11 +286,11 @@ nfsd3_proc_mkdir(struct svc_rqst *rqstp, struct nfsd3_createargs *argp,
        RETURN_STATUS(nfserr);
 }
 
-static int
+static __be32
 nfsd3_proc_symlink(struct svc_rqst *rqstp, struct nfsd3_symlinkargs *argp,
                                           struct nfsd3_diropres    *resp)
 {
-       int     nfserr;
+       __be32  nfserr;
 
        dprintk("nfsd: SYMLINK(3)  %s %.*s -> %.*s\n",
                                SVCFH_fmt(&argp->ffh),
@@ -307,11 +308,12 @@ nfsd3_proc_symlink(struct svc_rqst *rqstp, struct nfsd3_symlinkargs *argp,
 /*
  * Make socket/fifo/device.
  */
-static int
+static __be32
 nfsd3_proc_mknod(struct svc_rqst *rqstp, struct nfsd3_mknodargs *argp,
                                         struct nfsd3_diropres  *resp)
 {
-       int     nfserr, type;
+       __be32  nfserr;
+       int type;
        dev_t   rdev = 0;
 
        dprintk("nfsd: MKNOD(3)    %s %.*s\n",
@@ -343,11 +345,11 @@ nfsd3_proc_mknod(struct svc_rqst *rqstp, struct nfsd3_mknodargs *argp,
 /*
  * Remove file/fifo/socket etc.
  */
-static int
+static __be32
 nfsd3_proc_remove(struct svc_rqst *rqstp, struct nfsd3_diropargs *argp,
                                          struct nfsd3_attrstat  *resp)
 {
-       int     nfserr;
+       __be32  nfserr;
 
        dprintk("nfsd: REMOVE(3)   %s %.*s\n",
                                SVCFH_fmt(&argp->fh),
@@ -363,11 +365,11 @@ nfsd3_proc_remove(struct svc_rqst *rqstp, struct nfsd3_diropargs *argp,
 /*
  * Remove a directory
  */
-static int
+static __be32
 nfsd3_proc_rmdir(struct svc_rqst *rqstp, struct nfsd3_diropargs *argp,
                                         struct nfsd3_attrstat  *resp)
 {
-       int     nfserr;
+       __be32  nfserr;
 
        dprintk("nfsd: RMDIR(3)    %s %.*s\n",
                                SVCFH_fmt(&argp->fh),
@@ -379,11 +381,11 @@ nfsd3_proc_rmdir(struct svc_rqst *rqstp, struct nfsd3_diropargs *argp,
        RETURN_STATUS(nfserr);
 }
 
-static int
+static __be32
 nfsd3_proc_rename(struct svc_rqst *rqstp, struct nfsd3_renameargs *argp,
                                          struct nfsd3_renameres  *resp)
 {
-       int     nfserr;
+       __be32  nfserr;
 
        dprintk("nfsd: RENAME(3)   %s %.*s ->\n",
                                SVCFH_fmt(&argp->ffh),
@@ -401,11 +403,11 @@ nfsd3_proc_rename(struct svc_rqst *rqstp, struct nfsd3_renameargs *argp,
        RETURN_STATUS(nfserr);
 }
 
-static int
+static __be32
 nfsd3_proc_link(struct svc_rqst *rqstp, struct nfsd3_linkargs *argp,
                                        struct nfsd3_linkres  *resp)
 {
-       int     nfserr;
+       __be32  nfserr;
 
        dprintk("nfsd: LINK(3)     %s ->\n",
                                SVCFH_fmt(&argp->ffh));
@@ -424,11 +426,12 @@ nfsd3_proc_link(struct svc_rqst *rqstp, struct nfsd3_linkargs *argp,
 /*
  * Read a portion of a directory.
  */
-static int
+static __be32
 nfsd3_proc_readdir(struct svc_rqst *rqstp, struct nfsd3_readdirargs *argp,
                                           struct nfsd3_readdirres  *resp)
 {
-       int             nfserr, count;
+       __be32          nfserr;
+       int             count;
 
        dprintk("nfsd: READDIR(3)  %s %d bytes at %d\n",
                                SVCFH_fmt(&argp->fh),
@@ -459,11 +462,12 @@ nfsd3_proc_readdir(struct svc_rqst *rqstp, struct nfsd3_readdirargs *argp,
  * Read a portion of a directory, including file handles and attrs.
  * For now, we choose to ignore the dircount parameter.
  */
-static int
+static __be32
 nfsd3_proc_readdirplus(struct svc_rqst *rqstp, struct nfsd3_readdirargs *argp,
                                               struct nfsd3_readdirres  *resp)
 {
-       int     nfserr, count = 0;
+       __be32  nfserr;
+       int     count = 0;
        loff_t  offset;
        int     i;
        caddr_t page_addr = NULL;
@@ -517,11 +521,11 @@ nfsd3_proc_readdirplus(struct svc_rqst *rqstp, struct nfsd3_readdirargs *argp,
 /*
  * Get file system stats
  */
-static int
+static __be32
 nfsd3_proc_fsstat(struct svc_rqst * rqstp, struct nfsd_fhandle    *argp,
                                           struct nfsd3_fsstatres *resp)
 {
-       int     nfserr;
+       __be32  nfserr;
 
        dprintk("nfsd: FSSTAT(3)   %s\n",
                                SVCFH_fmt(&argp->fh));
@@ -534,11 +538,11 @@ nfsd3_proc_fsstat(struct svc_rqst * rqstp, struct nfsd_fhandle    *argp,
 /*
  * Get file system info
  */
-static int
+static __be32
 nfsd3_proc_fsinfo(struct svc_rqst * rqstp, struct nfsd_fhandle    *argp,
                                           struct nfsd3_fsinfores *resp)
 {
-       int     nfserr;
+       __be32  nfserr;
        u32     max_blocksize = svc_max_payload(rqstp);
 
        dprintk("nfsd: FSINFO(3)   %s\n",
@@ -576,11 +580,11 @@ nfsd3_proc_fsinfo(struct svc_rqst * rqstp, struct nfsd_fhandle    *argp,
 /*
  * Get pathconf info for the specified file
  */
-static int
+static __be32
 nfsd3_proc_pathconf(struct svc_rqst * rqstp, struct nfsd_fhandle      *argp,
                                             struct nfsd3_pathconfres *resp)
 {
-       int     nfserr;
+       __be32  nfserr;
 
        dprintk("nfsd: PATHCONF(3) %s\n",
                                SVCFH_fmt(&argp->fh));
@@ -619,11 +623,11 @@ nfsd3_proc_pathconf(struct svc_rqst * rqstp, struct nfsd_fhandle      *argp,
 /*
  * Commit a file (range) to stable storage.
  */
-static int
+static __be32
 nfsd3_proc_commit(struct svc_rqst * rqstp, struct nfsd3_commitargs *argp,
                                           struct nfsd3_commitres  *resp)
 {
-       int     nfserr;
+       __be32  nfserr;
 
        dprintk("nfsd: COMMIT(3)   %s %u@%Lu\n",
                                SVCFH_fmt(&argp->fh),
index 247d518248bf71b2a95b5ce04b460374dd88c51f..b4baca3053c35a96b526107096f1864e349848f6 100644 (file)
@@ -42,23 +42,23 @@ static u32  nfs3_ftypes[] = {
 /*
  * XDR functions for basic NFS types
  */
-static inline u32 *
-encode_time3(u32 *p, struct timespec *time)
+static inline __be32 *
+encode_time3(__be32 *p, struct timespec *time)
 {
        *p++ = htonl((u32) time->tv_sec); *p++ = htonl(time->tv_nsec);
        return p;
 }
 
-static inline u32 *
-decode_time3(u32 *p, struct timespec *time)
+static inline __be32 *
+decode_time3(__be32 *p, struct timespec *time)
 {
        time->tv_sec = ntohl(*p++);
        time->tv_nsec = ntohl(*p++);
        return p;
 }
 
-static inline u32 *
-decode_fh(u32 *p, struct svc_fh *fhp)
+static inline __be32 *
+decode_fh(__be32 *p, struct svc_fh *fhp)
 {
        unsigned int size;
        fh_init(fhp, NFS3_FHSIZE);
@@ -72,13 +72,13 @@ decode_fh(u32 *p, struct svc_fh *fhp)
 }
 
 /* Helper function for NFSv3 ACL code */
-u32 *nfs3svc_decode_fh(u32 *p, struct svc_fh *fhp)
+__be32 *nfs3svc_decode_fh(__be32 *p, struct svc_fh *fhp)
 {
        return decode_fh(p, fhp);
 }
 
-static inline u32 *
-encode_fh(u32 *p, struct svc_fh *fhp)
+static inline __be32 *
+encode_fh(__be32 *p, struct svc_fh *fhp)
 {
        unsigned int size = fhp->fh_handle.fh_size;
        *p++ = htonl(size);
@@ -91,8 +91,8 @@ encode_fh(u32 *p, struct svc_fh *fhp)
  * Decode a file name and make sure that the path contains
  * no slashes or null bytes.
  */
-static inline u32 *
-decode_filename(u32 *p, char **namp, int *lenp)
+static inline __be32 *
+decode_filename(__be32 *p, char **namp, int *lenp)
 {
        char            *name;
        int             i;
@@ -107,8 +107,8 @@ decode_filename(u32 *p, char **namp, int *lenp)
        return p;
 }
 
-static inline u32 *
-decode_sattr3(u32 *p, struct iattr *iap)
+static inline __be32 *
+decode_sattr3(__be32 *p, struct iattr *iap)
 {
        u32     tmp;
 
@@ -153,8 +153,8 @@ decode_sattr3(u32 *p, struct iattr *iap)
        return p;
 }
 
-static inline u32 *
-encode_fattr3(struct svc_rqst *rqstp, u32 *p, struct svc_fh *fhp,
+static inline __be32 *
+encode_fattr3(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp,
              struct kstat *stat)
 {
        struct dentry   *dentry = fhp->fh_dentry;
@@ -186,8 +186,8 @@ encode_fattr3(struct svc_rqst *rqstp, u32 *p, struct svc_fh *fhp,
        return p;
 }
 
-static inline u32 *
-encode_saved_post_attr(struct svc_rqst *rqstp, u32 *p, struct svc_fh *fhp)
+static inline __be32 *
+encode_saved_post_attr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp)
 {
        struct inode    *inode = fhp->fh_dentry->d_inode;
 
@@ -224,8 +224,8 @@ encode_saved_post_attr(struct svc_rqst *rqstp, u32 *p, struct svc_fh *fhp)
  * The inode may be NULL if the call failed because of a stale file
  * handle. In this case, no attributes are returned.
  */
-static u32 *
-encode_post_op_attr(struct svc_rqst *rqstp, u32 *p, struct svc_fh *fhp)
+static __be32 *
+encode_post_op_attr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp)
 {
        struct dentry *dentry = fhp->fh_dentry;
        if (dentry && dentry->d_inode != NULL) {
@@ -243,8 +243,8 @@ encode_post_op_attr(struct svc_rqst *rqstp, u32 *p, struct svc_fh *fhp)
 }
 
 /* Helper for NFSv3 ACLs */
-u32 *
-nfs3svc_encode_post_op_attr(struct svc_rqst *rqstp, u32 *p, struct svc_fh *fhp)
+__be32 *
+nfs3svc_encode_post_op_attr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp)
 {
        return encode_post_op_attr(rqstp, p, fhp);
 }
@@ -252,8 +252,8 @@ nfs3svc_encode_post_op_attr(struct svc_rqst *rqstp, u32 *p, struct svc_fh *fhp)
 /*
  * Enocde weak cache consistency data
  */
-static u32 *
-encode_wcc_data(struct svc_rqst *rqstp, u32 *p, struct svc_fh *fhp)
+static __be32 *
+encode_wcc_data(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp)
 {
        struct dentry   *dentry = fhp->fh_dentry;
 
@@ -278,7 +278,7 @@ encode_wcc_data(struct svc_rqst *rqstp, u32 *p, struct svc_fh *fhp)
  * XDR decode functions
  */
 int
-nfs3svc_decode_fhandle(struct svc_rqst *rqstp, u32 *p, struct nfsd_fhandle *args)
+nfs3svc_decode_fhandle(struct svc_rqst *rqstp, __be32 *p, struct nfsd_fhandle *args)
 {
        if (!(p = decode_fh(p, &args->fh)))
                return 0;
@@ -286,7 +286,7 @@ nfs3svc_decode_fhandle(struct svc_rqst *rqstp, u32 *p, struct nfsd_fhandle *args
 }
 
 int
-nfs3svc_decode_sattrargs(struct svc_rqst *rqstp, u32 *p,
+nfs3svc_decode_sattrargs(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd3_sattrargs *args)
 {
        if (!(p = decode_fh(p, &args->fh))
@@ -303,7 +303,7 @@ nfs3svc_decode_sattrargs(struct svc_rqst *rqstp, u32 *p,
 }
 
 int
-nfs3svc_decode_diropargs(struct svc_rqst *rqstp, u32 *p,
+nfs3svc_decode_diropargs(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd3_diropargs *args)
 {
        if (!(p = decode_fh(p, &args->fh))
@@ -314,7 +314,7 @@ nfs3svc_decode_diropargs(struct svc_rqst *rqstp, u32 *p,
 }
 
 int
-nfs3svc_decode_accessargs(struct svc_rqst *rqstp, u32 *p,
+nfs3svc_decode_accessargs(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd3_accessargs *args)
 {
        if (!(p = decode_fh(p, &args->fh)))
@@ -325,7 +325,7 @@ nfs3svc_decode_accessargs(struct svc_rqst *rqstp, u32 *p,
 }
 
 int
-nfs3svc_decode_readargs(struct svc_rqst *rqstp, u32 *p,
+nfs3svc_decode_readargs(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd3_readargs *args)
 {
        unsigned int len;
@@ -355,7 +355,7 @@ nfs3svc_decode_readargs(struct svc_rqst *rqstp, u32 *p,
 }
 
 int
-nfs3svc_decode_writeargs(struct svc_rqst *rqstp, u32 *p,
+nfs3svc_decode_writeargs(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd3_writeargs *args)
 {
        unsigned int len, v, hdr;
@@ -393,7 +393,7 @@ nfs3svc_decode_writeargs(struct svc_rqst *rqstp, u32 *p,
 }
 
 int
-nfs3svc_decode_createargs(struct svc_rqst *rqstp, u32 *p,
+nfs3svc_decode_createargs(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd3_createargs *args)
 {
        if (!(p = decode_fh(p, &args->fh))
@@ -417,7 +417,7 @@ nfs3svc_decode_createargs(struct svc_rqst *rqstp, u32 *p,
        return xdr_argsize_check(rqstp, p);
 }
 int
-nfs3svc_decode_mkdirargs(struct svc_rqst *rqstp, u32 *p,
+nfs3svc_decode_mkdirargs(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd3_createargs *args)
 {
        if (!(p = decode_fh(p, &args->fh))
@@ -429,7 +429,7 @@ nfs3svc_decode_mkdirargs(struct svc_rqst *rqstp, u32 *p,
 }
 
 int
-nfs3svc_decode_symlinkargs(struct svc_rqst *rqstp, u32 *p,
+nfs3svc_decode_symlinkargs(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd3_symlinkargs *args)
 {
        unsigned int len;
@@ -481,7 +481,7 @@ nfs3svc_decode_symlinkargs(struct svc_rqst *rqstp, u32 *p,
 }
 
 int
-nfs3svc_decode_mknodargs(struct svc_rqst *rqstp, u32 *p,
+nfs3svc_decode_mknodargs(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd3_mknodargs *args)
 {
        if (!(p = decode_fh(p, &args->fh))
@@ -505,7 +505,7 @@ nfs3svc_decode_mknodargs(struct svc_rqst *rqstp, u32 *p,
 }
 
 int
-nfs3svc_decode_renameargs(struct svc_rqst *rqstp, u32 *p,
+nfs3svc_decode_renameargs(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd3_renameargs *args)
 {
        if (!(p = decode_fh(p, &args->ffh))
@@ -518,7 +518,7 @@ nfs3svc_decode_renameargs(struct svc_rqst *rqstp, u32 *p,
 }
 
 int
-nfs3svc_decode_readlinkargs(struct svc_rqst *rqstp, u32 *p,
+nfs3svc_decode_readlinkargs(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd3_readlinkargs *args)
 {
        if (!(p = decode_fh(p, &args->fh)))
@@ -530,7 +530,7 @@ nfs3svc_decode_readlinkargs(struct svc_rqst *rqstp, u32 *p,
 }
 
 int
-nfs3svc_decode_linkargs(struct svc_rqst *rqstp, u32 *p,
+nfs3svc_decode_linkargs(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd3_linkargs *args)
 {
        if (!(p = decode_fh(p, &args->ffh))
@@ -542,7 +542,7 @@ nfs3svc_decode_linkargs(struct svc_rqst *rqstp, u32 *p,
 }
 
 int
-nfs3svc_decode_readdirargs(struct svc_rqst *rqstp, u32 *p,
+nfs3svc_decode_readdirargs(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd3_readdirargs *args)
 {
        if (!(p = decode_fh(p, &args->fh)))
@@ -562,7 +562,7 @@ nfs3svc_decode_readdirargs(struct svc_rqst *rqstp, u32 *p,
 }
 
 int
-nfs3svc_decode_readdirplusargs(struct svc_rqst *rqstp, u32 *p,
+nfs3svc_decode_readdirplusargs(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd3_readdirargs *args)
 {
        int len, pn;
@@ -590,7 +590,7 @@ nfs3svc_decode_readdirplusargs(struct svc_rqst *rqstp, u32 *p,
 }
 
 int
-nfs3svc_decode_commitargs(struct svc_rqst *rqstp, u32 *p,
+nfs3svc_decode_commitargs(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd3_commitargs *args)
 {
        if (!(p = decode_fh(p, &args->fh)))
@@ -609,14 +609,14 @@ nfs3svc_decode_commitargs(struct svc_rqst *rqstp, u32 *p,
  * will work properly.
  */
 int
-nfs3svc_encode_voidres(struct svc_rqst *rqstp, u32 *p, void *dummy)
+nfs3svc_encode_voidres(struct svc_rqst *rqstp, __be32 *p, void *dummy)
 {
        return xdr_ressize_check(rqstp, p);
 }
 
 /* GETATTR */
 int
-nfs3svc_encode_attrstat(struct svc_rqst *rqstp, u32 *p,
+nfs3svc_encode_attrstat(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd3_attrstat *resp)
 {
        if (resp->status == 0)
@@ -626,7 +626,7 @@ nfs3svc_encode_attrstat(struct svc_rqst *rqstp, u32 *p,
 
 /* SETATTR, REMOVE, RMDIR */
 int
-nfs3svc_encode_wccstat(struct svc_rqst *rqstp, u32 *p,
+nfs3svc_encode_wccstat(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd3_attrstat *resp)
 {
        p = encode_wcc_data(rqstp, p, &resp->fh);
@@ -635,7 +635,7 @@ nfs3svc_encode_wccstat(struct svc_rqst *rqstp, u32 *p,
 
 /* LOOKUP */
 int
-nfs3svc_encode_diropres(struct svc_rqst *rqstp, u32 *p,
+nfs3svc_encode_diropres(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd3_diropres *resp)
 {
        if (resp->status == 0) {
@@ -648,7 +648,7 @@ nfs3svc_encode_diropres(struct svc_rqst *rqstp, u32 *p,
 
 /* ACCESS */
 int
-nfs3svc_encode_accessres(struct svc_rqst *rqstp, u32 *p,
+nfs3svc_encode_accessres(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd3_accessres *resp)
 {
        p = encode_post_op_attr(rqstp, p, &resp->fh);
@@ -659,7 +659,7 @@ nfs3svc_encode_accessres(struct svc_rqst *rqstp, u32 *p,
 
 /* READLINK */
 int
-nfs3svc_encode_readlinkres(struct svc_rqst *rqstp, u32 *p,
+nfs3svc_encode_readlinkres(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd3_readlinkres *resp)
 {
        p = encode_post_op_attr(rqstp, p, &resp->fh);
@@ -680,7 +680,7 @@ nfs3svc_encode_readlinkres(struct svc_rqst *rqstp, u32 *p,
 
 /* READ */
 int
-nfs3svc_encode_readres(struct svc_rqst *rqstp, u32 *p,
+nfs3svc_encode_readres(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd3_readres *resp)
 {
        p = encode_post_op_attr(rqstp, p, &resp->fh);
@@ -704,7 +704,7 @@ nfs3svc_encode_readres(struct svc_rqst *rqstp, u32 *p,
 
 /* WRITE */
 int
-nfs3svc_encode_writeres(struct svc_rqst *rqstp, u32 *p,
+nfs3svc_encode_writeres(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd3_writeres *resp)
 {
        p = encode_wcc_data(rqstp, p, &resp->fh);
@@ -719,7 +719,7 @@ nfs3svc_encode_writeres(struct svc_rqst *rqstp, u32 *p,
 
 /* CREATE, MKDIR, SYMLINK, MKNOD */
 int
-nfs3svc_encode_createres(struct svc_rqst *rqstp, u32 *p,
+nfs3svc_encode_createres(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd3_diropres *resp)
 {
        if (resp->status == 0) {
@@ -733,7 +733,7 @@ nfs3svc_encode_createres(struct svc_rqst *rqstp, u32 *p,
 
 /* RENAME */
 int
-nfs3svc_encode_renameres(struct svc_rqst *rqstp, u32 *p,
+nfs3svc_encode_renameres(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd3_renameres *resp)
 {
        p = encode_wcc_data(rqstp, p, &resp->ffh);
@@ -743,7 +743,7 @@ nfs3svc_encode_renameres(struct svc_rqst *rqstp, u32 *p,
 
 /* LINK */
 int
-nfs3svc_encode_linkres(struct svc_rqst *rqstp, u32 *p,
+nfs3svc_encode_linkres(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd3_linkres *resp)
 {
        p = encode_post_op_attr(rqstp, p, &resp->fh);
@@ -753,7 +753,7 @@ nfs3svc_encode_linkres(struct svc_rqst *rqstp, u32 *p,
 
 /* READDIR */
 int
-nfs3svc_encode_readdirres(struct svc_rqst *rqstp, u32 *p,
+nfs3svc_encode_readdirres(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd3_readdirres *resp)
 {
        p = encode_post_op_attr(rqstp, p, &resp->fh);
@@ -776,8 +776,8 @@ nfs3svc_encode_readdirres(struct svc_rqst *rqstp, u32 *p,
                return xdr_ressize_check(rqstp, p);
 }
 
-static inline u32 *
-encode_entry_baggage(struct nfsd3_readdirres *cd, u32 *p, const char *name,
+static inline __be32 *
+encode_entry_baggage(struct nfsd3_readdirres *cd, __be32 *p, const char *name,
             int namlen, ino_t ino)
 {
        *p++ = xdr_one;                          /* mark entry present */
@@ -790,8 +790,8 @@ encode_entry_baggage(struct nfsd3_readdirres *cd, u32 *p, const char *name,
        return p;
 }
 
-static inline u32 *
-encode_entryplus_baggage(struct nfsd3_readdirres *cd, u32 *p,
+static inline __be32 *
+encode_entryplus_baggage(struct nfsd3_readdirres *cd, __be32 *p,
                struct svc_fh *fhp)
 {
                p = encode_post_op_attr(cd->rqstp, p, fhp);
@@ -853,7 +853,7 @@ encode_entry(struct readdir_cd *ccd, const char *name,
 {
        struct nfsd3_readdirres *cd = container_of(ccd, struct nfsd3_readdirres,
                                                        common);
-       u32             *p = cd->buffer;
+       __be32          *p = cd->buffer;
        caddr_t         curr_page_addr = NULL;
        int             pn;             /* current page number */
        int             slen;           /* string (name) length */
@@ -919,7 +919,7 @@ encode_entry(struct readdir_cd *ccd, const char *name,
        } else if (cd->rqstp->rq_respages[pn+1] != NULL) {
                /* temporarily encode entry into next page, then move back to
                 * current and next page in rq_respages[] */
-               u32 *p1, *tmp;
+               __be32 *p1, *tmp;
                int len1, len2;
 
                /* grab next page for temporary storage of entry */
@@ -1009,7 +1009,7 @@ nfs3svc_encode_entry_plus(struct readdir_cd *cd, const char *name,
 
 /* FSSTAT */
 int
-nfs3svc_encode_fsstatres(struct svc_rqst *rqstp, u32 *p,
+nfs3svc_encode_fsstatres(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd3_fsstatres *resp)
 {
        struct kstatfs  *s = &resp->stats;
@@ -1031,7 +1031,7 @@ nfs3svc_encode_fsstatres(struct svc_rqst *rqstp, u32 *p,
 
 /* FSINFO */
 int
-nfs3svc_encode_fsinfores(struct svc_rqst *rqstp, u32 *p,
+nfs3svc_encode_fsinfores(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd3_fsinfores *resp)
 {
        *p++ = xdr_zero;        /* no post_op_attr */
@@ -1055,7 +1055,7 @@ nfs3svc_encode_fsinfores(struct svc_rqst *rqstp, u32 *p,
 
 /* PATHCONF */
 int
-nfs3svc_encode_pathconfres(struct svc_rqst *rqstp, u32 *p,
+nfs3svc_encode_pathconfres(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd3_pathconfres *resp)
 {
        *p++ = xdr_zero;        /* no post_op_attr */
@@ -1074,7 +1074,7 @@ nfs3svc_encode_pathconfres(struct svc_rqst *rqstp, u32 *p,
 
 /* COMMIT */
 int
-nfs3svc_encode_commitres(struct svc_rqst *rqstp, u32 *p,
+nfs3svc_encode_commitres(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd3_commitres *resp)
 {
        p = encode_wcc_data(rqstp, p, &resp->fh);
@@ -1090,7 +1090,7 @@ nfs3svc_encode_commitres(struct svc_rqst *rqstp, u32 *p,
  * XDR release functions
  */
 int
-nfs3svc_release_fhandle(struct svc_rqst *rqstp, u32 *p,
+nfs3svc_release_fhandle(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd3_attrstat *resp)
 {
        fh_put(&resp->fh);
@@ -1098,7 +1098,7 @@ nfs3svc_release_fhandle(struct svc_rqst *rqstp, u32 *p,
 }
 
 int
-nfs3svc_release_fhandle2(struct svc_rqst *rqstp, u32 *p,
+nfs3svc_release_fhandle2(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd3_fhandle_pair *resp)
 {
        fh_put(&resp->fh1);
index f6ca9fb3fc63fb7b78870bd387d8844c648e5b57..f57655a7a2b66b9ae1b1567e9d5500b581a5c9ae 100644 (file)
@@ -85,8 +85,8 @@ enum nfs_cb_opnum4 {
 /*
 * Generic encode routines from fs/nfs/nfs4xdr.c
 */
-static inline u32 *
-xdr_writemem(u32 *p, const void *ptr, int nbytes)
+static inline __be32 *
+xdr_writemem(__be32 *p, const void *ptr, int nbytes)
 {
        int tmp = XDR_QUADLEN(nbytes);
        if (!tmp)
@@ -205,7 +205,7 @@ nfs_cb_stat_to_errno(int stat)
 static int
 encode_cb_compound_hdr(struct xdr_stream *xdr, struct nfs4_cb_compound_hdr *hdr)
 {
-       u32 * p;
+       __be32 * p;
 
        RESERVE_SPACE(16);
        WRITE32(0);            /* tag length is always 0 */
@@ -218,7 +218,7 @@ encode_cb_compound_hdr(struct xdr_stream *xdr, struct nfs4_cb_compound_hdr *hdr)
 static int
 encode_cb_recall(struct xdr_stream *xdr, struct nfs4_cb_recall *cb_rec)
 {
-       u32 *p;
+       __be32 *p;
        int len = cb_rec->cbr_fhlen;
 
        RESERVE_SPACE(12+sizeof(cb_rec->cbr_stateid) + len);
@@ -231,7 +231,7 @@ encode_cb_recall(struct xdr_stream *xdr, struct nfs4_cb_recall *cb_rec)
 }
 
 static int
-nfs4_xdr_enc_cb_null(struct rpc_rqst *req, u32 *p)
+nfs4_xdr_enc_cb_null(struct rpc_rqst *req, __be32 *p)
 {
        struct xdr_stream xdrs, *xdr = &xdrs;
 
@@ -241,7 +241,7 @@ nfs4_xdr_enc_cb_null(struct rpc_rqst *req, u32 *p)
 }
 
 static int
-nfs4_xdr_enc_cb_recall(struct rpc_rqst *req, u32 *p, struct nfs4_cb_recall *args)
+nfs4_xdr_enc_cb_recall(struct rpc_rqst *req, __be32 *p, struct nfs4_cb_recall *args)
 {
        struct xdr_stream xdr;
        struct nfs4_cb_compound_hdr hdr = {
@@ -257,7 +257,7 @@ nfs4_xdr_enc_cb_recall(struct rpc_rqst *req, u32 *p, struct nfs4_cb_recall *args
 
 static int
 decode_cb_compound_hdr(struct xdr_stream *xdr, struct nfs4_cb_compound_hdr *hdr){
-        u32 *p;
+        __be32 *p;
 
         READ_BUF(8);
         READ32(hdr->status);
@@ -272,7 +272,7 @@ decode_cb_compound_hdr(struct xdr_stream *xdr, struct nfs4_cb_compound_hdr *hdr)
 static int
 decode_cb_op_hdr(struct xdr_stream *xdr, enum nfs_opnum4 expected)
 {
-       u32 *p;
+       __be32 *p;
        u32 op;
        int32_t nfserr;
 
@@ -291,13 +291,13 @@ decode_cb_op_hdr(struct xdr_stream *xdr, enum nfs_opnum4 expected)
 }
 
 static int
-nfs4_xdr_dec_cb_null(struct rpc_rqst *req, u32 *p)
+nfs4_xdr_dec_cb_null(struct rpc_rqst *req, __be32 *p)
 {
        return 0;
 }
 
 static int
-nfs4_xdr_dec_cb_recall(struct rpc_rqst *rqstp, u32 *p)
+nfs4_xdr_dec_cb_recall(struct rpc_rqst *rqstp, __be32 *p)
 {
        struct xdr_stream xdr;
        struct nfs4_cb_compound_hdr hdr;
@@ -421,7 +421,7 @@ nfsd4_probe_callback(struct nfs4_client *clp)
 
        /* Create RPC client */
        cb->cb_client = rpc_create(&args);
-       if (!cb->cb_client) {
+       if (IS_ERR(cb->cb_client)) {
                dprintk("NFSD: couldn't create callback client\n");
                goto out_err;
        }
@@ -448,10 +448,10 @@ nfsd4_probe_callback(struct nfs4_client *clp)
 out_rpciod:
        atomic_dec(&clp->cl_count);
        rpciod_down();
-       cb->cb_client = NULL;
 out_clnt:
        rpc_shutdown_client(cb->cb_client);
 out_err:
+       cb->cb_client = NULL;
        dprintk("NFSD: warning: no callback path to client %.*s\n",
                (int)clp->cl_name.len, clp->cl_name.data);
 }
@@ -461,7 +461,7 @@ nfs4_cb_null(struct rpc_task *task, void *dummy)
 {
        struct nfs4_client *clp = (struct nfs4_client *)task->tk_msg.rpc_argp;
        struct nfs4_callback *cb = &clp->cl_callback;
-       u32 addr = htonl(cb->cb_addr);
+       __be32 addr = htonl(cb->cb_addr);
 
        dprintk("NFSD: nfs4_cb_null task->tk_status %d\n", task->tk_status);
 
index 8333db12caca56207a0142fcb9a94000f962ad69..0a7bbdc4a10aba9ea8d01059864851c7a05de179 100644 (file)
@@ -67,32 +67,32 @@ fh_dup2(struct svc_fh *dst, struct svc_fh *src)
        *dst = *src;
 }
 
-static int
-do_open_permission(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open *open)
+static __be32
+do_open_permission(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open *open, int accmode)
 {
-       int accmode, status;
+       __be32 status;
 
        if (open->op_truncate &&
                !(open->op_share_access & NFS4_SHARE_ACCESS_WRITE))
                return nfserr_inval;
 
-       accmode = MAY_NOP;
        if (open->op_share_access & NFS4_SHARE_ACCESS_READ)
-               accmode = MAY_READ;
-       if (open->op_share_deny & NFS4_SHARE_ACCESS_WRITE)
+               accmode |= MAY_READ;
+       if (open->op_share_access & NFS4_SHARE_ACCESS_WRITE)
                accmode |= (MAY_WRITE | MAY_TRUNC);
-       accmode |= MAY_OWNER_OVERRIDE;
+       if (open->op_share_deny & NFS4_SHARE_DENY_WRITE)
+               accmode |= MAY_WRITE;
 
        status = fh_verify(rqstp, current_fh, S_IFREG, accmode);
 
        return status;
 }
 
-static int
+static __be32
 do_open_lookup(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open *open)
 {
        struct svc_fh resfh;
-       int status;
+       __be32 status;
 
        fh_init(&resfh, NFS4_FHSIZE);
        open->op_truncate = 0;
@@ -124,17 +124,17 @@ do_open_lookup(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_o
                                &resfh.fh_handle.fh_base,
                                resfh.fh_handle.fh_size);
 
-               status = do_open_permission(rqstp, current_fh, open);
+               status = do_open_permission(rqstp, current_fh, open, MAY_NOP);
        }
 
        fh_put(&resfh);
        return status;
 }
 
-static int
+static __be32
 do_open_fhandle(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open *open)
 {
-       int status;
+       __be32 status;
 
        /* Only reclaims from previously confirmed clients are valid */
        if ((status = nfs4_check_open_reclaim(&open->op_clientid)))
@@ -155,16 +155,16 @@ do_open_fhandle(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_
        open->op_truncate = (open->op_iattr.ia_valid & ATTR_SIZE) &&
                (open->op_iattr.ia_size == 0);
 
-       status = do_open_permission(rqstp, current_fh, open);
+       status = do_open_permission(rqstp, current_fh, open, MAY_OWNER_OVERRIDE);
 
        return status;
 }
 
 
-static inline int
+static inline __be32
 nfsd4_open(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open *open, struct nfs4_stateowner **replay_owner)
 {
-       int status;
+       __be32 status;
        dprintk("NFSD: nfsd4_open filename %.*s op_stateowner %p\n",
                (int)open->op_fname.len, open->op_fname.data,
                open->op_stateowner);
@@ -177,7 +177,7 @@ nfsd4_open(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open
 
        /* check seqid for replay. set nfs4_owner */
        status = nfsd4_process_open1(open);
-       if (status == NFSERR_REPLAY_ME) {
+       if (status == nfserr_replay_me) {
                struct nfs4_replay *rp = &open->op_stateowner->so_replay;
                fh_put(current_fh);
                current_fh->fh_handle.fh_size = rp->rp_openfh_len;
@@ -188,7 +188,7 @@ nfsd4_open(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open
                        dprintk("nfsd4_open: replay failed"
                                " restoring previous filehandle\n");
                else
-                       status = NFSERR_REPLAY_ME;
+                       status = nfserr_replay_me;
        }
        if (status)
                goto out;
@@ -261,7 +261,7 @@ out:
 /*
  * filehandle-manipulating ops.
  */
-static inline int
+static inline __be32
 nfsd4_getfh(struct svc_fh *current_fh, struct svc_fh **getfh)
 {
        if (!current_fh->fh_dentry)
@@ -271,7 +271,7 @@ nfsd4_getfh(struct svc_fh *current_fh, struct svc_fh **getfh)
        return nfs_ok;
 }
 
-static inline int
+static inline __be32
 nfsd4_putfh(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_putfh *putfh)
 {
        fh_put(current_fh);
@@ -280,10 +280,10 @@ nfsd4_putfh(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_putf
        return fh_verify(rqstp, current_fh, 0, MAY_NOP);
 }
 
-static inline int
+static inline __be32
 nfsd4_putrootfh(struct svc_rqst *rqstp, struct svc_fh *current_fh)
 {
-       int status;
+       __be32 status;
 
        fh_put(current_fh);
        status = exp_pseudoroot(rqstp->rq_client, current_fh,
@@ -291,7 +291,7 @@ nfsd4_putrootfh(struct svc_rqst *rqstp, struct svc_fh *current_fh)
        return status;
 }
 
-static inline int
+static inline __be32
 nfsd4_restorefh(struct svc_fh *current_fh, struct svc_fh *save_fh)
 {
        if (!save_fh->fh_dentry)
@@ -301,7 +301,7 @@ nfsd4_restorefh(struct svc_fh *current_fh, struct svc_fh *save_fh)
        return nfs_ok;
 }
 
-static inline int
+static inline __be32
 nfsd4_savefh(struct svc_fh *current_fh, struct svc_fh *save_fh)
 {
        if (!current_fh->fh_dentry)
@@ -314,7 +314,7 @@ nfsd4_savefh(struct svc_fh *current_fh, struct svc_fh *save_fh)
 /*
  * misc nfsv4 ops
  */
-static inline int
+static inline __be32
 nfsd4_access(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_access *access)
 {
        if (access->ac_req_access & ~NFS3_ACCESS_FULL)
@@ -324,10 +324,10 @@ nfsd4_access(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_acc
        return nfsd_access(rqstp, current_fh, &access->ac_resp_access, &access->ac_supported);
 }
 
-static inline int
+static inline __be32
 nfsd4_commit(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_commit *commit)
 {
-       int status;
+       __be32 status;
 
        u32 *p = (u32 *)commit->co_verf.data;
        *p++ = nfssvc_boot.tv_sec;
@@ -339,11 +339,11 @@ nfsd4_commit(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_com
        return status;
 }
 
-static int
+static __be32
 nfsd4_create(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_create *create)
 {
        struct svc_fh resfh;
-       int status;
+       __be32 status;
        dev_t rdev;
 
        fh_init(&resfh, NFS4_FHSIZE);
@@ -423,10 +423,10 @@ nfsd4_create(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_cre
        return status;
 }
 
-static inline int
+static inline __be32
 nfsd4_getattr(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_getattr *getattr)
 {
-       int status;
+       __be32 status;
 
        status = fh_verify(rqstp, current_fh, 0, MAY_NOP);
        if (status)
@@ -442,11 +442,11 @@ nfsd4_getattr(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_ge
        return nfs_ok;
 }
 
-static inline int
+static inline __be32
 nfsd4_link(struct svc_rqst *rqstp, struct svc_fh *current_fh,
           struct svc_fh *save_fh, struct nfsd4_link *link)
 {
-       int status = nfserr_nofilehandle;
+       __be32 status = nfserr_nofilehandle;
 
        if (!save_fh->fh_dentry)
                return status;
@@ -456,11 +456,11 @@ nfsd4_link(struct svc_rqst *rqstp, struct svc_fh *current_fh,
        return status;
 }
 
-static int
+static __be32
 nfsd4_lookupp(struct svc_rqst *rqstp, struct svc_fh *current_fh)
 {
        struct svc_fh tmp_fh;
-       int ret;
+       __be32 ret;
 
        fh_init(&tmp_fh, NFS4_FHSIZE);
        if((ret = exp_pseudoroot(rqstp->rq_client, &tmp_fh,
@@ -474,16 +474,16 @@ nfsd4_lookupp(struct svc_rqst *rqstp, struct svc_fh *current_fh)
        return nfsd_lookup(rqstp, current_fh, "..", 2, current_fh);
 }
 
-static inline int
+static inline __be32
 nfsd4_lookup(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_lookup *lookup)
 {
        return nfsd_lookup(rqstp, current_fh, lookup->lo_name, lookup->lo_len, current_fh);
 }
 
-static inline int
+static inline __be32
 nfsd4_read(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_read *read)
 {
-       int status;
+       __be32 status;
 
        /* no need to check permission - this will be done in nfsd_read() */
 
@@ -508,7 +508,7 @@ out:
        return status;
 }
 
-static inline int
+static inline __be32
 nfsd4_readdir(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_readdir *readdir)
 {
        u64 cookie = readdir->rd_cookie;
@@ -531,7 +531,7 @@ nfsd4_readdir(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_re
        return nfs_ok;
 }
 
-static inline int
+static inline __be32
 nfsd4_readlink(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_readlink *readlink)
 {
        readlink->rl_rqstp = rqstp;
@@ -539,10 +539,10 @@ nfsd4_readlink(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_r
        return nfs_ok;
 }
 
-static inline int
+static inline __be32
 nfsd4_remove(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_remove *remove)
 {
-       int status;
+       __be32 status;
 
        if (nfs4_in_grace())
                return nfserr_grace;
@@ -556,11 +556,11 @@ nfsd4_remove(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_rem
        return status;
 }
 
-static inline int
+static inline __be32
 nfsd4_rename(struct svc_rqst *rqstp, struct svc_fh *current_fh,
             struct svc_fh *save_fh, struct nfsd4_rename *rename)
 {
-       int status = nfserr_nofilehandle;
+       __be32 status = nfserr_nofilehandle;
 
        if (!save_fh->fh_dentry)
                return status;
@@ -589,10 +589,10 @@ nfsd4_rename(struct svc_rqst *rqstp, struct svc_fh *current_fh,
        return status;
 }
 
-static inline int
+static inline __be32
 nfsd4_setattr(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_setattr *setattr)
 {
-       int status = nfs_ok;
+       __be32 status = nfs_ok;
 
        if (setattr->sa_iattr.ia_valid & ATTR_SIZE) {
                nfs4_lock_state();
@@ -614,13 +614,13 @@ nfsd4_setattr(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_se
        return status;
 }
 
-static inline int
+static inline __be32
 nfsd4_write(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_write *write)
 {
        stateid_t *stateid = &write->wr_stateid;
        struct file *filp = NULL;
        u32 *p;
-       int status = nfs_ok;
+       __be32 status = nfs_ok;
 
        /* no need to check permission - this will be done in nfsd_write() */
 
@@ -661,12 +661,12 @@ nfsd4_write(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_writ
  * attributes matched.  VERIFY is implemented by mapping NFSERR_SAME
  * to NFS_OK after the call; NVERIFY by mapping NFSERR_NOT_SAME to NFS_OK.
  */
-static int
+static __be32
 nfsd4_verify(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_verify *verify)
 {
-       u32 *buf, *p;
+       __be32 *buf, *p;
        int count;
-       int status;
+       __be32 status;
 
        status = fh_verify(rqstp, current_fh, 0, MAY_NOP);
        if (status)
@@ -715,7 +715,7 @@ out_kfree:
 /*
  * NULL call.
  */
-static int
+static __be32
 nfsd4_proc_null(struct svc_rqst *rqstp, void *argp, void *resp)
 {
        return nfs_ok;
@@ -731,7 +731,7 @@ static inline void nfsd4_increment_op_stats(u32 opnum)
 /*
  * COMPOUND call.
  */
-static int
+static __be32
 nfsd4_proc_compound(struct svc_rqst *rqstp,
                    struct nfsd4_compoundargs *args,
                    struct nfsd4_compoundres *resp)
@@ -741,7 +741,7 @@ nfsd4_proc_compound(struct svc_rqst *rqstp,
        struct svc_fh   *save_fh = NULL;
        struct nfs4_stateowner *replay_owner = NULL;
        int             slack_space;    /* in words, not bytes! */
-       int             status;
+       __be32          status;
 
        status = nfserr_resource;
        current_fh = kmalloc(sizeof(*current_fh), GFP_KERNEL);
@@ -937,7 +937,7 @@ nfsd4_proc_compound(struct svc_rqst *rqstp,
                }
 
 encode_op:
-               if (op->status == NFSERR_REPLAY_ME) {
+               if (op->status == nfserr_replay_me) {
                        op->replay = &replay_owner->so_replay;
                        nfsd4_encode_replay(resp, op);
                        status = op->status = op->replay->rp_status;
index 1cbd2e4ee12252bb30c8a5c37a5aa50486584252..e9d07704680e7f5e99adad09c643f24e16442ee1 100644 (file)
@@ -83,13 +83,13 @@ md5_to_hex(char *out, char *md5)
        *out = '\0';
 }
 
-int
+__be32
 nfs4_make_rec_clidname(char *dname, struct xdr_netobj *clname)
 {
        struct xdr_netobj cksum;
        struct hash_desc desc;
        struct scatterlist sg[1];
-       int status = nfserr_resource;
+       __be32 status = nfserr_resource;
 
        dprintk("NFSD: nfs4_make_rec_clidname for %.*s\n",
                        clname->len, clname->data);
@@ -193,7 +193,7 @@ nfsd4_build_dentrylist(void *arg, const char *name, int namlen,
        struct dentry_list *child;
 
        if (name && isdotent(name, namlen))
-               return nfs_ok;
+               return 0;
        dentry = lookup_one_len(name, parent, namlen);
        if (IS_ERR(dentry))
                return PTR_ERR(dentry);
@@ -333,14 +333,14 @@ purge_old(struct dentry *parent, struct dentry *child)
        int status;
 
        if (nfs4_has_reclaimed_state(child->d_name.name))
-               return nfs_ok;
+               return 0;
 
        status = nfsd4_clear_clid_dir(parent, child);
        if (status)
                printk("failed to remove client recovery directory %s\n",
                                child->d_name.name);
        /* Keep trying, success or failure: */
-       return nfs_ok;
+       return 0;
 }
 
 void
@@ -365,10 +365,10 @@ load_recdir(struct dentry *parent, struct dentry *child)
                printk("nfsd4: illegal name %s in recovery directory\n",
                                child->d_name.name);
                /* Keep trying; maybe the others are OK: */
-               return nfs_ok;
+               return 0;
        }
        nfs4_client_to_reclaim(child->d_name.name);
-       return nfs_ok;
+       return 0;
 }
 
 int
index ebcf226a9e4a1fb65d04baa8e6ac10dc7f845071..293b6495829f863a16e45504f26b6d47d12d2128 100644 (file)
@@ -710,10 +710,10 @@ out_err:
  *             as described above.
  *
  */
-int
+__be32
 nfsd4_setclientid(struct svc_rqst *rqstp, struct nfsd4_setclientid *setclid)
 {
-       u32                     ip_addr = rqstp->rq_addr.sin_addr.s_addr;
+       __be32                  ip_addr = rqstp->rq_addr.sin_addr.s_addr;
        struct xdr_netobj       clname = { 
                .len = setclid->se_namelen,
                .data = setclid->se_name,
@@ -721,7 +721,7 @@ nfsd4_setclientid(struct svc_rqst *rqstp, struct nfsd4_setclientid *setclid)
        nfs4_verifier           clverifier = setclid->se_verf;
        unsigned int            strhashval;
        struct nfs4_client      *conf, *unconf, *new;
-       int                     status;
+       __be32                  status;
        char                    dname[HEXDIR_LEN];
        
        if (!check_name(clname))
@@ -875,14 +875,14 @@ out:
  *
  * NOTE: callback information will be processed here in a future patch
  */
-int
+__be32
 nfsd4_setclientid_confirm(struct svc_rqst *rqstp, struct nfsd4_setclientid_confirm *setclientid_confirm)
 {
-       u32 ip_addr = rqstp->rq_addr.sin_addr.s_addr;
+       __be32 ip_addr = rqstp->rq_addr.sin_addr.s_addr;
        struct nfs4_client *conf, *unconf;
        nfs4_verifier confirm = setclientid_confirm->sc_confirm; 
        clientid_t * clid = &setclientid_confirm->sc_clientid;
-       int status;
+       __be32 status;
 
        if (STALE_CLIENTID(clid))
                return nfserr_stale_clientid;
@@ -1280,13 +1280,13 @@ test_share(struct nfs4_stateid *stp, struct nfsd4_open *open) {
  * Called to check deny when READ with all zero stateid or
  * WRITE with all zero or all one stateid
  */
-static int
+static __be32
 nfs4_share_conflict(struct svc_fh *current_fh, unsigned int deny_type)
 {
        struct inode *ino = current_fh->fh_dentry->d_inode;
        struct nfs4_file *fp;
        struct nfs4_stateid *stp;
-       int ret;
+       __be32 ret;
 
        dprintk("NFSD: nfs4_share_conflict\n");
 
@@ -1444,7 +1444,7 @@ static struct lock_manager_operations nfsd_lease_mng_ops = {
 };
 
 
-int
+__be32
 nfsd4_process_open1(struct nfsd4_open *open)
 {
        clientid_t *clientid = &open->op_clientid;
@@ -1477,7 +1477,7 @@ nfsd4_process_open1(struct nfsd4_open *open)
        }
        if (open->op_seqid == sop->so_seqid - 1) {
                if (sop->so_replay.rp_buflen)
-                       return NFSERR_REPLAY_ME;
+                       return nfserr_replay_me;
                /* The original OPEN failed so spectacularly
                 * that we don't even have replay data saved!
                 * Therefore, we have no choice but to continue
@@ -1501,7 +1501,7 @@ renew:
        return nfs_ok;
 }
 
-static inline int
+static inline __be32
 nfs4_check_delegmode(struct nfs4_delegation *dp, int flags)
 {
        if ((flags & WR_STATE) && (dp->dl_type == NFS4_OPEN_DELEGATE_READ))
@@ -1522,12 +1522,12 @@ find_delegation_file(struct nfs4_file *fp, stateid_t *stid)
        return NULL;
 }
 
-static int
+static __be32
 nfs4_check_deleg(struct nfs4_file *fp, struct nfsd4_open *open,
                struct nfs4_delegation **dp)
 {
        int flags;
-       int status = nfserr_bad_stateid;
+       __be32 status = nfserr_bad_stateid;
 
        *dp = find_delegation_file(fp, &open->op_delegate_stateid);
        if (*dp == NULL)
@@ -1546,11 +1546,11 @@ out:
        return nfs_ok;
 }
 
-static int
+static __be32
 nfs4_check_open(struct nfs4_file *fp, struct nfsd4_open *open, struct nfs4_stateid **stpp)
 {
        struct nfs4_stateid *local;
-       int status = nfserr_share_denied;
+       __be32 status = nfserr_share_denied;
        struct nfs4_stateowner *sop = open->op_stateowner;
 
        list_for_each_entry(local, &fp->fi_stateids, st_perfile) {
@@ -1575,7 +1575,7 @@ nfs4_alloc_stateid(void)
        return kmem_cache_alloc(stateid_slab, GFP_KERNEL);
 }
 
-static int
+static __be32
 nfs4_new_open(struct svc_rqst *rqstp, struct nfs4_stateid **stpp,
                struct nfs4_delegation *dp,
                struct svc_fh *cur_fh, int flags)
@@ -1590,7 +1590,7 @@ nfs4_new_open(struct svc_rqst *rqstp, struct nfs4_stateid **stpp,
                get_file(dp->dl_vfs_file);
                stp->st_vfs_file = dp->dl_vfs_file;
        } else {
-               int status;
+               __be32 status;
                status = nfsd_open(rqstp, cur_fh, S_IFREG, flags,
                                &stp->st_vfs_file);
                if (status) {
@@ -1604,7 +1604,7 @@ nfs4_new_open(struct svc_rqst *rqstp, struct nfs4_stateid **stpp,
        return 0;
 }
 
-static inline int
+static inline __be32
 nfsd4_truncate(struct svc_rqst *rqstp, struct svc_fh *fh,
                struct nfsd4_open *open)
 {
@@ -1619,22 +1619,22 @@ nfsd4_truncate(struct svc_rqst *rqstp, struct svc_fh *fh,
        return nfsd_setattr(rqstp, fh, &iattr, 0, (time_t)0);
 }
 
-static int
+static __be32
 nfs4_upgrade_open(struct svc_rqst *rqstp, struct svc_fh *cur_fh, struct nfs4_stateid *stp, struct nfsd4_open *open)
 {
        struct file *filp = stp->st_vfs_file;
        struct inode *inode = filp->f_dentry->d_inode;
        unsigned int share_access, new_writer;
-       int status;
+       __be32 status;
 
        set_access(&share_access, stp->st_access_bmap);
        new_writer = (~share_access) & open->op_share_access
                        & NFS4_SHARE_ACCESS_WRITE;
 
        if (new_writer) {
-               status = get_write_access(inode);
-               if (status)
-                       return nfserrno(status);
+               int err = get_write_access(inode);
+               if (err)
+                       return nfserrno(err);
        }
        status = nfsd4_truncate(rqstp, cur_fh, open);
        if (status) {
@@ -1738,14 +1738,14 @@ out:
 /*
  * called with nfs4_lock_state() held.
  */
-int
+__be32
 nfsd4_process_open2(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open *open)
 {
        struct nfs4_file *fp = NULL;
        struct inode *ino = current_fh->fh_dentry->d_inode;
        struct nfs4_stateid *stp = NULL;
        struct nfs4_delegation *dp = NULL;
-       int status;
+       __be32 status;
 
        status = nfserr_inval;
        if (!access_valid(open->op_share_access)
@@ -1833,11 +1833,11 @@ static struct work_struct laundromat_work;
 static void laundromat_main(void *);
 static DECLARE_WORK(laundromat_work, laundromat_main, NULL);
 
-int 
+__be32
 nfsd4_renew(clientid_t *clid)
 {
        struct nfs4_client *clp;
-       int status;
+       __be32 status;
 
        nfs4_lock_state();
        dprintk("process_renew(%08x/%08x): starting\n", 
@@ -1996,9 +1996,9 @@ access_permit_write(unsigned long access_bmap)
 }
 
 static
-int nfs4_check_openmode(struct nfs4_stateid *stp, int flags)
+__be32 nfs4_check_openmode(struct nfs4_stateid *stp, int flags)
 {
-        int status = nfserr_openmode;
+        __be32 status = nfserr_openmode;
 
        if ((flags & WR_STATE) && (!access_permit_write(stp->st_access_bmap)))
                 goto out;
@@ -2009,7 +2009,7 @@ out:
        return status;
 }
 
-static inline int
+static inline __be32
 check_special_stateids(svc_fh *current_fh, stateid_t *stateid, int flags)
 {
        /* Trying to call delegreturn with a special stateid? Yuch: */
@@ -2043,14 +2043,14 @@ io_during_grace_disallowed(struct inode *inode, int flags)
 /*
 * Checks for stateid operations
 */
-int
+__be32
 nfs4_preprocess_stateid_op(struct svc_fh *current_fh, stateid_t *stateid, int flags, struct file **filpp)
 {
        struct nfs4_stateid *stp = NULL;
        struct nfs4_delegation *dp = NULL;
        stateid_t *stidp;
        struct inode *ino = current_fh->fh_dentry->d_inode;
-       int status;
+       __be32 status;
 
        dprintk("NFSD: preprocess_stateid_op: stateid = (%08x/%08x/%08x/%08x)\n",
                stateid->si_boot, stateid->si_stateownerid, 
@@ -2125,7 +2125,7 @@ setlkflg (int type)
 /* 
  * Checks for sequence id mutating operations. 
  */
-static int
+static __be32
 nfs4_preprocess_seqid_op(struct svc_fh *current_fh, u32 seqid, stateid_t *stateid, int flags, struct nfs4_stateowner **sopp, struct nfs4_stateid **stpp, struct nfsd4_lock *lock)
 {
        struct nfs4_stateid *stp;
@@ -2169,7 +2169,7 @@ nfs4_preprocess_seqid_op(struct svc_fh *current_fh, u32 seqid, stateid_t *statei
                clientid_t *lockclid = &lock->v.new.clientid;
                struct nfs4_client *clp = sop->so_client;
                int lkflg = 0;
-               int status;
+               __be32 status;
 
                lkflg = setlkflg(lock->lk_type);
 
@@ -2233,7 +2233,7 @@ check_replay:
        if (seqid == sop->so_seqid - 1) {
                dprintk("NFSD: preprocess_seqid_op: retransmission?\n");
                /* indicate replay to calling function */
-               return NFSERR_REPLAY_ME;
+               return nfserr_replay_me;
        }
        printk("NFSD: preprocess_seqid_op: bad seqid (expected %d, got %d)\n",
                        sop->so_seqid, seqid);
@@ -2241,10 +2241,10 @@ check_replay:
        return nfserr_bad_seqid;
 }
 
-int
+__be32
 nfsd4_open_confirm(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open_confirm *oc, struct nfs4_stateowner **replay_owner)
 {
-       int status;
+       __be32 status;
        struct nfs4_stateowner *sop;
        struct nfs4_stateid *stp;
 
@@ -2310,10 +2310,10 @@ reset_union_bmap_deny(unsigned long deny, unsigned long *bmap)
        }
 }
 
-int
+__be32
 nfsd4_open_downgrade(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open_downgrade *od, struct nfs4_stateowner **replay_owner)
 {
-       int status;
+       __be32 status;
        struct nfs4_stateid *stp;
        unsigned int share_access;
 
@@ -2365,10 +2365,10 @@ out:
 /*
  * nfs4_unlock_state() called after encode
  */
-int
+__be32
 nfsd4_close(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_close *close, struct nfs4_stateowner **replay_owner)
 {
-       int status;
+       __be32 status;
        struct nfs4_stateid *stp;
 
        dprintk("NFSD: nfsd4_close on file %.*s\n", 
@@ -2404,10 +2404,10 @@ out:
        return status;
 }
 
-int
+__be32
 nfsd4_delegreturn(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_delegreturn *dr)
 {
-       int status;
+       __be32 status;
 
        if ((status = fh_verify(rqstp, current_fh, S_IFREG, 0)))
                goto out;
@@ -2635,7 +2635,7 @@ check_lock_length(u64 offset, u64 length)
 /*
  *  LOCK operation 
  */
-int
+__be32
 nfsd4_lock(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_lock *lock, struct nfs4_stateowner **replay_owner)
 {
        struct nfs4_stateowner *open_sop = NULL;
@@ -2644,8 +2644,9 @@ nfsd4_lock(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_lock
        struct file *filp;
        struct file_lock file_lock;
        struct file_lock conflock;
-       int status = 0;
+       __be32 status = 0;
        unsigned int strhashval;
+       int err;
 
        dprintk("NFSD: nfsd4_lock: start=%Ld length=%Ld\n",
                (long long) lock->lk_offset,
@@ -2758,13 +2759,14 @@ nfsd4_lock(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_lock
         * locks_copy_lock: */
        conflock.fl_ops = NULL;
        conflock.fl_lmops = NULL;
-       status = posix_lock_file_conf(filp, &file_lock, &conflock);
+       err = posix_lock_file_conf(filp, &file_lock, &conflock);
        dprintk("NFSD: nfsd4_lock: posix_lock_file_conf status %d\n",status);
-       switch (-status) {
+       switch (-err) {
        case 0: /* success! */
                update_stateid(&lock_stp->st_stateid);
                memcpy(&lock->lk_resp_stateid, &lock_stp->st_stateid, 
                                sizeof(stateid_t));
+               status = 0;
                break;
        case (EAGAIN):          /* conflock holds conflicting lock */
                status = nfserr_denied;
@@ -2775,7 +2777,7 @@ nfsd4_lock(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_lock
                status = nfserr_deadlock;
                break;
        default:        
-               dprintk("NFSD: nfsd4_lock: posix_lock_file_conf() failed! status %d\n",status);
+               dprintk("NFSD: nfsd4_lock: posix_lock_file_conf() failed! status %d\n",err);
                status = nfserr_resource;
                break;
        }
@@ -2793,14 +2795,14 @@ out:
 /*
  * LOCKT operation
  */
-int
+__be32
 nfsd4_lockt(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_lockt *lockt)
 {
        struct inode *inode;
        struct file file;
        struct file_lock file_lock;
        struct file_lock conflock;
-       int status;
+       __be32 status;
 
        if (nfs4_in_grace())
                return nfserr_grace;
@@ -2873,13 +2875,14 @@ out:
        return status;
 }
 
-int
+__be32
 nfsd4_locku(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_locku *locku, struct nfs4_stateowner **replay_owner)
 {
        struct nfs4_stateid *stp;
        struct file *filp = NULL;
        struct file_lock file_lock;
-       int status;
+       __be32 status;
+       int err;
                                                        
        dprintk("NFSD: nfsd4_locku: start=%Ld length=%Ld\n",
                (long long) locku->lu_offset,
@@ -2917,8 +2920,8 @@ nfsd4_locku(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_lock
        /*
        *  Try to unlock the file in the VFS.
        */
-       status = posix_lock_file(filp, &file_lock); 
-       if (status) {
+       err = posix_lock_file(filp, &file_lock);
+       if (err) {
                dprintk("NFSD: nfs4_locku: posix_lock_file failed!\n");
                goto out_nfserr;
        }
@@ -2937,7 +2940,7 @@ out:
        return status;
 
 out_nfserr:
-       status = nfserrno(status);
+       status = nfserrno(err);
        goto out;
 }
 
@@ -2965,7 +2968,7 @@ out:
        return status;
 }
 
-int
+__be32
 nfsd4_release_lockowner(struct svc_rqst *rqstp, struct nfsd4_release_lockowner *rlockowner)
 {
        clientid_t *clid = &rlockowner->rl_clientid;
@@ -2974,7 +2977,7 @@ nfsd4_release_lockowner(struct svc_rqst *rqstp, struct nfsd4_release_lockowner *
        struct xdr_netobj *owner = &rlockowner->rl_owner;
        struct list_head matches;
        int i;
-       int status;
+       __be32 status;
 
        dprintk("nfsd4_release_lockowner clientid: (%08x/%08x):\n",
                clid->cl_boot, clid->cl_id);
@@ -3111,7 +3114,7 @@ nfs4_find_reclaim_client(clientid_t *clid)
 /*
 * Called from OPEN. Look for clientid in reclaim list.
 */
-int
+__be32
 nfs4_check_open_reclaim(clientid_t *clid)
 {
        return nfs4_find_reclaim_client(clid) ? nfs_ok : nfserr_reclaim_bad;
index 41fc241b729aa2a3ad78e0c91f25b751cd3cad0e..f3f239db04bb1b0d54f1a18ff78f4ffce3d18ee1 100644 (file)
@@ -68,8 +68,8 @@
 #define NFS4_REFERRAL_FSID_MAJOR       0x8000000ULL
 #define NFS4_REFERRAL_FSID_MINOR       0x8000000ULL
 
-static int
-check_filename(char *str, int len, int err)
+static __be32
+check_filename(char *str, int len, __be32 err)
 {
        int i;
 
@@ -94,8 +94,8 @@ check_filename(char *str, int len, int err)
  * consistent with the style used in NFSv2/v3...
  */
 #define DECODE_HEAD                            \
-       u32 *p;                                 \
-       int status
+       __be32 *p;                              \
+       __be32 status
 #define DECODE_TAIL                            \
        status = 0;                             \
 out:                                           \
@@ -144,13 +144,13 @@ xdr_error:                                        \
        }                                       \
 } while (0)
 
-static u32 *read_buf(struct nfsd4_compoundargs *argp, int nbytes)
+static __be32 *read_buf(struct nfsd4_compoundargs *argp, int nbytes)
 {
        /* We want more bytes than seem to be available.
         * Maybe we need a new page, maybe we have just run out
         */
        int avail = (char*)argp->end - (char*)argp->p;
-       u32 *p;
+       __be32 *p;
        if (avail + argp->pagelen < nbytes)
                return NULL;
        if (avail + PAGE_SIZE < nbytes) /* need more than a page !! */
@@ -197,7 +197,7 @@ defer_free(struct nfsd4_compoundargs *argp,
        return 0;
 }
 
-static char *savemem(struct nfsd4_compoundargs *argp, u32 *p, int nbytes)
+static char *savemem(struct nfsd4_compoundargs *argp, __be32 *p, int nbytes)
 {
        void *new = NULL;
        if (p == argp->tmp) {
@@ -217,7 +217,7 @@ static char *savemem(struct nfsd4_compoundargs *argp, u32 *p, int nbytes)
 }
 
 
-static int
+static __be32
 nfsd4_decode_bitmap(struct nfsd4_compoundargs *argp, u32 *bmval)
 {
        u32 bmlen;
@@ -240,13 +240,14 @@ nfsd4_decode_bitmap(struct nfsd4_compoundargs *argp, u32 *bmval)
        DECODE_TAIL;
 }
 
-static int
+static __be32
 nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval, struct iattr *iattr,
     struct nfs4_acl **acl)
 {
        int expected_len, len = 0;
        u32 dummy32;
        char *buf;
+       int host_err;
 
        DECODE_HEAD;
        iattr->ia_valid = 0;
@@ -280,7 +281,7 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval, struct iattr *ia
 
                *acl = nfs4_acl_new();
                if (*acl == NULL) {
-                       status = -ENOMEM;
+                       host_err = -ENOMEM;
                        goto out_nfserr;
                }
                defer_free(argp, (void (*)(const void *))nfs4_acl_free, *acl);
@@ -295,20 +296,20 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval, struct iattr *ia
                        len += XDR_QUADLEN(dummy32) << 2;
                        READMEM(buf, dummy32);
                        ace.whotype = nfs4_acl_get_whotype(buf, dummy32);
-                       status = 0;
+                       host_err = 0;
                        if (ace.whotype != NFS4_ACL_WHO_NAMED)
                                ace.who = 0;
                        else if (ace.flag & NFS4_ACE_IDENTIFIER_GROUP)
-                               status = nfsd_map_name_to_gid(argp->rqstp,
+                               host_err = nfsd_map_name_to_gid(argp->rqstp,
                                                buf, dummy32, &ace.who);
                        else
-                               status = nfsd_map_name_to_uid(argp->rqstp,
+                               host_err = nfsd_map_name_to_uid(argp->rqstp,
                                                buf, dummy32, &ace.who);
-                       if (status)
+                       if (host_err)
                                goto out_nfserr;
-                       status = nfs4_acl_add_ace(*acl, ace.type, ace.flag,
+                       host_err = nfs4_acl_add_ace(*acl, ace.type, ace.flag,
                                 ace.access_mask, ace.whotype, ace.who);
-                       if (status)
+                       if (host_err)
                                goto out_nfserr;
                }
        } else
@@ -327,7 +328,7 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval, struct iattr *ia
                READ_BUF(dummy32);
                len += (XDR_QUADLEN(dummy32) << 2);
                READMEM(buf, dummy32);
-               if ((status = nfsd_map_name_to_uid(argp->rqstp, buf, dummy32, &iattr->ia_uid)))
+               if ((host_err = nfsd_map_name_to_uid(argp->rqstp, buf, dummy32, &iattr->ia_uid)))
                        goto out_nfserr;
                iattr->ia_valid |= ATTR_UID;
        }
@@ -338,7 +339,7 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval, struct iattr *ia
                READ_BUF(dummy32);
                len += (XDR_QUADLEN(dummy32) << 2);
                READMEM(buf, dummy32);
-               if ((status = nfsd_map_name_to_gid(argp->rqstp, buf, dummy32, &iattr->ia_gid)))
+               if ((host_err = nfsd_map_name_to_gid(argp->rqstp, buf, dummy32, &iattr->ia_gid)))
                        goto out_nfserr;
                iattr->ia_valid |= ATTR_GID;
        }
@@ -414,11 +415,11 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval, struct iattr *ia
        DECODE_TAIL;
 
 out_nfserr:
-       status = nfserrno(status);
+       status = nfserrno(host_err);
        goto out;
 }
 
-static int
+static __be32
 nfsd4_decode_access(struct nfsd4_compoundargs *argp, struct nfsd4_access *access)
 {
        DECODE_HEAD;
@@ -429,7 +430,7 @@ nfsd4_decode_access(struct nfsd4_compoundargs *argp, struct nfsd4_access *access
        DECODE_TAIL;
 }
 
-static int
+static __be32
 nfsd4_decode_close(struct nfsd4_compoundargs *argp, struct nfsd4_close *close)
 {
        DECODE_HEAD;
@@ -444,7 +445,7 @@ nfsd4_decode_close(struct nfsd4_compoundargs *argp, struct nfsd4_close *close)
 }
 
 
-static int
+static __be32
 nfsd4_decode_commit(struct nfsd4_compoundargs *argp, struct nfsd4_commit *commit)
 {
        DECODE_HEAD;
@@ -456,7 +457,7 @@ nfsd4_decode_commit(struct nfsd4_compoundargs *argp, struct nfsd4_commit *commit
        DECODE_TAIL;
 }
 
-static int
+static __be32
 nfsd4_decode_create(struct nfsd4_compoundargs *argp, struct nfsd4_create *create)
 {
        DECODE_HEAD;
@@ -496,7 +497,7 @@ nfsd4_decode_create(struct nfsd4_compoundargs *argp, struct nfsd4_create *create
        DECODE_TAIL;
 }
 
-static inline int
+static inline __be32
 nfsd4_decode_delegreturn(struct nfsd4_compoundargs *argp, struct nfsd4_delegreturn *dr)
 {
        DECODE_HEAD;
@@ -508,13 +509,13 @@ nfsd4_decode_delegreturn(struct nfsd4_compoundargs *argp, struct nfsd4_delegretu
        DECODE_TAIL;
 }
 
-static inline int
+static inline __be32
 nfsd4_decode_getattr(struct nfsd4_compoundargs *argp, struct nfsd4_getattr *getattr)
 {
        return nfsd4_decode_bitmap(argp, getattr->ga_bmval);
 }
 
-static int
+static __be32
 nfsd4_decode_link(struct nfsd4_compoundargs *argp, struct nfsd4_link *link)
 {
        DECODE_HEAD;
@@ -529,7 +530,7 @@ nfsd4_decode_link(struct nfsd4_compoundargs *argp, struct nfsd4_link *link)
        DECODE_TAIL;
 }
 
-static int
+static __be32
 nfsd4_decode_lock(struct nfsd4_compoundargs *argp, struct nfsd4_lock *lock)
 {
        DECODE_HEAD;
@@ -568,7 +569,7 @@ nfsd4_decode_lock(struct nfsd4_compoundargs *argp, struct nfsd4_lock *lock)
        DECODE_TAIL;
 }
 
-static int
+static __be32
 nfsd4_decode_lockt(struct nfsd4_compoundargs *argp, struct nfsd4_lockt *lockt)
 {
        DECODE_HEAD;
@@ -587,7 +588,7 @@ nfsd4_decode_lockt(struct nfsd4_compoundargs *argp, struct nfsd4_lockt *lockt)
        DECODE_TAIL;
 }
 
-static int
+static __be32
 nfsd4_decode_locku(struct nfsd4_compoundargs *argp, struct nfsd4_locku *locku)
 {
        DECODE_HEAD;
@@ -606,7 +607,7 @@ nfsd4_decode_locku(struct nfsd4_compoundargs *argp, struct nfsd4_locku *locku)
        DECODE_TAIL;
 }
 
-static int
+static __be32
 nfsd4_decode_lookup(struct nfsd4_compoundargs *argp, struct nfsd4_lookup *lookup)
 {
        DECODE_HEAD;
@@ -621,7 +622,7 @@ nfsd4_decode_lookup(struct nfsd4_compoundargs *argp, struct nfsd4_lookup *lookup
        DECODE_TAIL;
 }
 
-static int
+static __be32
 nfsd4_decode_open(struct nfsd4_compoundargs *argp, struct nfsd4_open *open)
 {
        DECODE_HEAD;
@@ -699,7 +700,7 @@ nfsd4_decode_open(struct nfsd4_compoundargs *argp, struct nfsd4_open *open)
        DECODE_TAIL;
 }
 
-static int
+static __be32
 nfsd4_decode_open_confirm(struct nfsd4_compoundargs *argp, struct nfsd4_open_confirm *open_conf)
 {
        DECODE_HEAD;
@@ -713,7 +714,7 @@ nfsd4_decode_open_confirm(struct nfsd4_compoundargs *argp, struct nfsd4_open_con
        DECODE_TAIL;
 }
 
-static int
+static __be32
 nfsd4_decode_open_downgrade(struct nfsd4_compoundargs *argp, struct nfsd4_open_downgrade *open_down)
 {
        DECODE_HEAD;
@@ -729,7 +730,7 @@ nfsd4_decode_open_downgrade(struct nfsd4_compoundargs *argp, struct nfsd4_open_d
        DECODE_TAIL;
 }
 
-static int
+static __be32
 nfsd4_decode_putfh(struct nfsd4_compoundargs *argp, struct nfsd4_putfh *putfh)
 {
        DECODE_HEAD;
@@ -744,7 +745,7 @@ nfsd4_decode_putfh(struct nfsd4_compoundargs *argp, struct nfsd4_putfh *putfh)
        DECODE_TAIL;
 }
 
-static int
+static __be32
 nfsd4_decode_read(struct nfsd4_compoundargs *argp, struct nfsd4_read *read)
 {
        DECODE_HEAD;
@@ -758,7 +759,7 @@ nfsd4_decode_read(struct nfsd4_compoundargs *argp, struct nfsd4_read *read)
        DECODE_TAIL;
 }
 
-static int
+static __be32
 nfsd4_decode_readdir(struct nfsd4_compoundargs *argp, struct nfsd4_readdir *readdir)
 {
        DECODE_HEAD;
@@ -774,7 +775,7 @@ nfsd4_decode_readdir(struct nfsd4_compoundargs *argp, struct nfsd4_readdir *read
        DECODE_TAIL;
 }
 
-static int
+static __be32
 nfsd4_decode_remove(struct nfsd4_compoundargs *argp, struct nfsd4_remove *remove)
 {
        DECODE_HEAD;
@@ -789,7 +790,7 @@ nfsd4_decode_remove(struct nfsd4_compoundargs *argp, struct nfsd4_remove *remove
        DECODE_TAIL;
 }
 
-static int
+static __be32
 nfsd4_decode_rename(struct nfsd4_compoundargs *argp, struct nfsd4_rename *rename)
 {
        DECODE_HEAD;
@@ -809,7 +810,7 @@ nfsd4_decode_rename(struct nfsd4_compoundargs *argp, struct nfsd4_rename *rename
        DECODE_TAIL;
 }
 
-static int
+static __be32
 nfsd4_decode_renew(struct nfsd4_compoundargs *argp, clientid_t *clientid)
 {
        DECODE_HEAD;
@@ -820,7 +821,7 @@ nfsd4_decode_renew(struct nfsd4_compoundargs *argp, clientid_t *clientid)
        DECODE_TAIL;
 }
 
-static int
+static __be32
 nfsd4_decode_setattr(struct nfsd4_compoundargs *argp, struct nfsd4_setattr *setattr)
 {
        DECODE_HEAD;
@@ -834,7 +835,7 @@ nfsd4_decode_setattr(struct nfsd4_compoundargs *argp, struct nfsd4_setattr *seta
        DECODE_TAIL;
 }
 
-static int
+static __be32
 nfsd4_decode_setclientid(struct nfsd4_compoundargs *argp, struct nfsd4_setclientid *setclientid)
 {
        DECODE_HEAD;
@@ -859,7 +860,7 @@ nfsd4_decode_setclientid(struct nfsd4_compoundargs *argp, struct nfsd4_setclient
        DECODE_TAIL;
 }
 
-static int
+static __be32
 nfsd4_decode_setclientid_confirm(struct nfsd4_compoundargs *argp, struct nfsd4_setclientid_confirm *scd_c)
 {
        DECODE_HEAD;
@@ -872,7 +873,7 @@ nfsd4_decode_setclientid_confirm(struct nfsd4_compoundargs *argp, struct nfsd4_s
 }
 
 /* Also used for NVERIFY */
-static int
+static __be32
 nfsd4_decode_verify(struct nfsd4_compoundargs *argp, struct nfsd4_verify *verify)
 {
 #if 0
@@ -908,7 +909,7 @@ nfsd4_decode_verify(struct nfsd4_compoundargs *argp, struct nfsd4_verify *verify
        DECODE_TAIL;
 }
 
-static int
+static __be32
 nfsd4_decode_write(struct nfsd4_compoundargs *argp, struct nfsd4_write *write)
 {
        int avail;
@@ -951,15 +952,15 @@ nfsd4_decode_write(struct nfsd4_compoundargs *argp, struct nfsd4_write *write)
                        argp->pagelen -= len;
                }
        }
-       argp->end = (u32*) (argp->rqstp->rq_vec[v].iov_base + argp->rqstp->rq_vec[v].iov_len);
-       argp->p = (u32*)  (argp->rqstp->rq_vec[v].iov_base + (XDR_QUADLEN(len) << 2));
+       argp->end = (__be32*) (argp->rqstp->rq_vec[v].iov_base + argp->rqstp->rq_vec[v].iov_len);
+       argp->p = (__be32*)  (argp->rqstp->rq_vec[v].iov_base + (XDR_QUADLEN(len) << 2));
        argp->rqstp->rq_vec[v].iov_len = len;
        write->wr_vlen = v+1;
 
        DECODE_TAIL;
 }
 
-static int
+static __be32
 nfsd4_decode_release_lockowner(struct nfsd4_compoundargs *argp, struct nfsd4_release_lockowner *rlockowner)
 {
        DECODE_HEAD;
@@ -973,7 +974,7 @@ nfsd4_decode_release_lockowner(struct nfsd4_compoundargs *argp, struct nfsd4_rel
        DECODE_TAIL;
 }
 
-static int
+static __be32
 nfsd4_decode_compound(struct nfsd4_compoundargs *argp)
 {
        DECODE_HEAD;
@@ -1179,7 +1180,7 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp)
  * task to translate them into Linux-specific versions which are more
  * consistent with the style used in NFSv2/v3...
  */
-#define ENCODE_HEAD              u32 *p
+#define ENCODE_HEAD              __be32 *p
 
 #define WRITE32(n)               *p++ = htonl(n)
 #define WRITE64(n)               do {                          \
@@ -1209,8 +1210,8 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp)
  * Header routine to setup seqid operation replay cache
  */
 #define ENCODE_SEQID_OP_HEAD                                   \
-       u32 *p;                                                 \
-       u32 *save;                                              \
+       __be32 *p;                                              \
+       __be32 *save;                                           \
                                                                \
        save = resp->p;
 
@@ -1234,11 +1235,11 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp)
 /* Encode as an array of strings the string given with components
  * seperated @sep.
  */
-static int nfsd4_encode_components(char sep, char *components,
-                                  u32 **pp, int *buflen)
+static __be32 nfsd4_encode_components(char sep, char *components,
+                                  __be32 **pp, int *buflen)
 {
-       u32 *p = *pp;
-       u32 *countp = p;
+       __be32 *p = *pp;
+       __be32 *countp = p;
        int strlen, count=0;
        char *str, *end;
 
@@ -1271,11 +1272,11 @@ static int nfsd4_encode_components(char sep, char *components,
 /*
  * encode a location element of a fs_locations structure
  */
-static int nfsd4_encode_fs_location4(struct nfsd4_fs_location *location,
-                                   u32 **pp, int *buflen)
+static __be32 nfsd4_encode_fs_location4(struct nfsd4_fs_location *location,
+                                   __be32 **pp, int *buflen)
 {
-       int status;
-       u32 *p = *pp;
+       __be32 status;
+       __be32 *p = *pp;
 
        status = nfsd4_encode_components(':', location->hosts, &p, buflen);
        if (status)
@@ -1292,16 +1293,15 @@ static int nfsd4_encode_fs_location4(struct nfsd4_fs_location *location,
  * Returned string is safe to use as long as the caller holds a reference
  * to @exp.
  */
-static char *nfsd4_path(struct svc_rqst *rqstp, struct svc_export *exp)
+static char *nfsd4_path(struct svc_rqst *rqstp, struct svc_export *exp, __be32 *stat)
 {
        struct svc_fh tmp_fh;
        char *path, *rootpath;
-       int stat;
 
        fh_init(&tmp_fh, NFS4_FHSIZE);
-       stat = exp_pseudoroot(rqstp->rq_client, &tmp_fh, &rqstp->rq_chandle);
-       if (stat)
-               return ERR_PTR(stat);
+       *stat = exp_pseudoroot(rqstp->rq_client, &tmp_fh, &rqstp->rq_chandle);
+       if (*stat)
+               return NULL;
        rootpath = tmp_fh.fh_export->ex_path;
 
        path = exp->ex_path;
@@ -1309,7 +1309,8 @@ static char *nfsd4_path(struct svc_rqst *rqstp, struct svc_export *exp)
        if (strncmp(path, rootpath, strlen(rootpath))) {
                printk("nfsd: fs_locations failed;"
                        "%s is not contained in %s\n", path, rootpath);
-               return ERR_PTR(-EOPNOTSUPP);
+               *stat = nfserr_notsupp;
+               return NULL;
        }
 
        return path + strlen(rootpath);
@@ -1318,17 +1319,18 @@ static char *nfsd4_path(struct svc_rqst *rqstp, struct svc_export *exp)
 /*
  *  encode a fs_locations structure
  */
-static int nfsd4_encode_fs_locations(struct svc_rqst *rqstp,
+static __be32 nfsd4_encode_fs_locations(struct svc_rqst *rqstp,
                                     struct svc_export *exp,
-                                    u32 **pp, int *buflen)
+                                    __be32 **pp, int *buflen)
 {
-       int status, i;
-       u32 *p = *pp;
+       __be32 status;
+       int i;
+       __be32 *p = *pp;
        struct nfsd4_fs_locations *fslocs = &exp->ex_fslocs;
-       char *root = nfsd4_path(rqstp, exp);
+       char *root = nfsd4_path(rqstp, exp, &status);
 
-       if (IS_ERR(root))
-               return PTR_ERR(root);
+       if (status)
+               return status;
        status = nfsd4_encode_components('/', root, &p, buflen);
        if (status)
                return status;
@@ -1352,9 +1354,9 @@ static u32 nfs4_ftypes[16] = {
         NF4SOCK, NF4BAD,  NF4LNK, NF4BAD,
 };
 
-static int
+static __be32
 nfsd4_encode_name(struct svc_rqst *rqstp, int whotype, uid_t id, int group,
-                       u32 **p, int *buflen)
+                       __be32 **p, int *buflen)
 {
        int status;
 
@@ -1374,21 +1376,21 @@ nfsd4_encode_name(struct svc_rqst *rqstp, int whotype, uid_t id, int group,
        return 0;
 }
 
-static inline int
-nfsd4_encode_user(struct svc_rqst *rqstp, uid_t uid, u32 **p, int *buflen)
+static inline __be32
+nfsd4_encode_user(struct svc_rqst *rqstp, uid_t uid, __be32 **p, int *buflen)
 {
        return nfsd4_encode_name(rqstp, NFS4_ACL_WHO_NAMED, uid, 0, p, buflen);
 }
 
-static inline int
-nfsd4_encode_group(struct svc_rqst *rqstp, uid_t gid, u32 **p, int *buflen)
+static inline __be32
+nfsd4_encode_group(struct svc_rqst *rqstp, uid_t gid, __be32 **p, int *buflen)
 {
        return nfsd4_encode_name(rqstp, NFS4_ACL_WHO_NAMED, gid, 1, p, buflen);
 }
 
-static inline int
+static inline __be32
 nfsd4_encode_aclname(struct svc_rqst *rqstp, int whotype, uid_t id, int group,
-               u32 **p, int *buflen)
+               __be32 **p, int *buflen)
 {
        return nfsd4_encode_name(rqstp, whotype, id, group, p, buflen);
 }
@@ -1397,7 +1399,7 @@ nfsd4_encode_aclname(struct svc_rqst *rqstp, int whotype, uid_t id, int group,
                              FATTR4_WORD0_RDATTR_ERROR)
 #define WORD1_ABSENT_FS_ATTRS FATTR4_WORD1_MOUNTED_ON_FILEID
 
-static int fattr_handle_absent_fs(u32 *bmval0, u32 *bmval1, u32 *rdattr_err)
+static __be32 fattr_handle_absent_fs(u32 *bmval0, u32 *bmval1, u32 *rdattr_err)
 {
        /* As per referral draft:  */
        if (*bmval0 & ~WORD0_ABSENT_FS_ATTRS ||
@@ -1420,9 +1422,9 @@ static int fattr_handle_absent_fs(u32 *bmval0, u32 *bmval1, u32 *rdattr_err)
  * @countp is the buffer size in _words_; upon successful return this becomes
  * replaced with the number of words written.
  */
-int
+__be32
 nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,
-               struct dentry *dentry, u32 *buffer, int *countp, u32 *bmval,
+               struct dentry *dentry, __be32 *buffer, int *countp, u32 *bmval,
                struct svc_rqst *rqstp)
 {
        u32 bmval0 = bmval[0];
@@ -1431,12 +1433,13 @@ nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,
        struct svc_fh tempfh;
        struct kstatfs statfs;
        int buflen = *countp << 2;
-       u32 *attrlenp;
+       __be32 *attrlenp;
        u32 dummy;
        u64 dummy64;
        u32 rdattr_err = 0;
-       u32 *p = buffer;
-       int status;
+       __be32 *p = buffer;
+       __be32 status;
+       int err;
        int aclsupport = 0;
        struct nfs4_acl *acl = NULL;
 
@@ -1450,14 +1453,14 @@ nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,
                        goto out;
        }
 
-       status = vfs_getattr(exp->ex_mnt, dentry, &stat);
-       if (status)
+       err = vfs_getattr(exp->ex_mnt, dentry, &stat);
+       if (err)
                goto out_nfserr;
        if ((bmval0 & (FATTR4_WORD0_FILES_FREE | FATTR4_WORD0_FILES_TOTAL)) ||
            (bmval1 & (FATTR4_WORD1_SPACE_AVAIL | FATTR4_WORD1_SPACE_FREE |
                       FATTR4_WORD1_SPACE_TOTAL))) {
-               status = vfs_statfs(dentry, &statfs);
-               if (status)
+               err = vfs_statfs(dentry, &statfs);
+               if (err)
                        goto out_nfserr;
        }
        if ((bmval0 & (FATTR4_WORD0_FILEHANDLE | FATTR4_WORD0_FSID)) && !fhp) {
@@ -1469,15 +1472,15 @@ nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,
        }
        if (bmval0 & (FATTR4_WORD0_ACL | FATTR4_WORD0_ACLSUPPORT
                        | FATTR4_WORD0_SUPPORTED_ATTRS)) {
-               status = nfsd4_get_nfs4_acl(rqstp, dentry, &acl);
-               aclsupport = (status == 0);
+               err = nfsd4_get_nfs4_acl(rqstp, dentry, &acl);
+               aclsupport = (err == 0);
                if (bmval0 & FATTR4_WORD0_ACL) {
-                       if (status == -EOPNOTSUPP)
+                       if (err == -EOPNOTSUPP)
                                bmval0 &= ~FATTR4_WORD0_ACL;
-                       else if (status == -EINVAL) {
+                       else if (err == -EINVAL) {
                                status = nfserr_attrnotsupp;
                                goto out;
-                       } else if (status != 0)
+                       } else if (err != 0)
                                goto out_nfserr;
                }
        }
@@ -1817,7 +1820,7 @@ out:
                fh_put(&tempfh);
        return status;
 out_nfserr:
-       status = nfserrno(status);
+       status = nfserrno(err);
        goto out;
 out_resource:
        *countp = 0;
@@ -1828,13 +1831,13 @@ out_serverfault:
        goto out;
 }
 
-static int
+static __be32
 nfsd4_encode_dirent_fattr(struct nfsd4_readdir *cd,
-               const char *name, int namlen, u32 *p, int *buflen)
+               const char *name, int namlen, __be32 *p, int *buflen)
 {
        struct svc_export *exp = cd->rd_fhp->fh_export;
        struct dentry *dentry;
-       int nfserr;
+       __be32 nfserr;
 
        dentry = lookup_one_len(name, cd->rd_fhp->fh_dentry, namlen);
        if (IS_ERR(dentry))
@@ -1863,10 +1866,10 @@ out_put:
        return nfserr;
 }
 
-static u32 *
-nfsd4_encode_rdattr_error(u32 *p, int buflen, int nfserr)
+static __be32 *
+nfsd4_encode_rdattr_error(__be32 *p, int buflen, __be32 nfserr)
 {
-       u32 *attrlenp;
+       __be32 *attrlenp;
 
        if (buflen < 6)
                return NULL;
@@ -1886,8 +1889,8 @@ nfsd4_encode_dirent(struct readdir_cd *ccd, const char *name, int namlen,
 {
        struct nfsd4_readdir *cd = container_of(ccd, struct nfsd4_readdir, common);
        int buflen;
-       u32 *p = cd->buffer;
-       int nfserr = nfserr_toosmall;
+       __be32 *p = cd->buffer;
+       __be32 nfserr = nfserr_toosmall;
 
        /* In nfsv4, "." and ".." never make it onto the wire.. */
        if (name && isdotent(name, namlen)) {
@@ -1943,7 +1946,7 @@ fail:
 }
 
 static void
-nfsd4_encode_access(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_access *access)
+nfsd4_encode_access(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_access *access)
 {
        ENCODE_HEAD;
 
@@ -1956,7 +1959,7 @@ nfsd4_encode_access(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_acc
 }
 
 static void
-nfsd4_encode_close(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_close *close)
+nfsd4_encode_close(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_close *close)
 {
        ENCODE_SEQID_OP_HEAD;
 
@@ -1971,7 +1974,7 @@ nfsd4_encode_close(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_clos
 
 
 static void
-nfsd4_encode_commit(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_commit *commit)
+nfsd4_encode_commit(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_commit *commit)
 {
        ENCODE_HEAD;
 
@@ -1983,7 +1986,7 @@ nfsd4_encode_commit(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_com
 }
 
 static void
-nfsd4_encode_create(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_create *create)
+nfsd4_encode_create(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_create *create)
 {
        ENCODE_HEAD;
 
@@ -1997,8 +2000,8 @@ nfsd4_encode_create(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_cre
        }
 }
 
-static int
-nfsd4_encode_getattr(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_getattr *getattr)
+static __be32
+nfsd4_encode_getattr(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_getattr *getattr)
 {
        struct svc_fh *fhp = getattr->ga_fhp;
        int buflen;
@@ -2016,7 +2019,7 @@ nfsd4_encode_getattr(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_ge
 }
 
 static void
-nfsd4_encode_getfh(struct nfsd4_compoundres *resp, int nfserr, struct svc_fh *fhp)
+nfsd4_encode_getfh(struct nfsd4_compoundres *resp, __be32 nfserr, struct svc_fh *fhp)
 {
        unsigned int len;
        ENCODE_HEAD;
@@ -2056,7 +2059,7 @@ nfsd4_encode_lock_denied(struct nfsd4_compoundres *resp, struct nfsd4_lock_denie
 }
 
 static void
-nfsd4_encode_lock(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_lock *lock)
+nfsd4_encode_lock(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_lock *lock)
 {
        ENCODE_SEQID_OP_HEAD;
 
@@ -2072,14 +2075,14 @@ nfsd4_encode_lock(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_lock
 }
 
 static void
-nfsd4_encode_lockt(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_lockt *lockt)
+nfsd4_encode_lockt(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_lockt *lockt)
 {
        if (nfserr == nfserr_denied)
                nfsd4_encode_lock_denied(resp, &lockt->lt_denied);
 }
 
 static void
-nfsd4_encode_locku(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_locku *locku)
+nfsd4_encode_locku(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_locku *locku)
 {
        ENCODE_SEQID_OP_HEAD;
 
@@ -2095,7 +2098,7 @@ nfsd4_encode_locku(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_lock
 
 
 static void
-nfsd4_encode_link(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_link *link)
+nfsd4_encode_link(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_link *link)
 {
        ENCODE_HEAD;
 
@@ -2108,7 +2111,7 @@ nfsd4_encode_link(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_link
 
 
 static void
-nfsd4_encode_open(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_open *open)
+nfsd4_encode_open(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_open *open)
 {
        ENCODE_SEQID_OP_HEAD;
 
@@ -2173,7 +2176,7 @@ out:
 }
 
 static void
-nfsd4_encode_open_confirm(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_open_confirm *oc)
+nfsd4_encode_open_confirm(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_open_confirm *oc)
 {
        ENCODE_SEQID_OP_HEAD;
                                        
@@ -2188,7 +2191,7 @@ nfsd4_encode_open_confirm(struct nfsd4_compoundres *resp, int nfserr, struct nfs
 }
 
 static void
-nfsd4_encode_open_downgrade(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_open_downgrade *od)
+nfsd4_encode_open_downgrade(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_open_downgrade *od)
 {
        ENCODE_SEQID_OP_HEAD;
                                        
@@ -2202,8 +2205,8 @@ nfsd4_encode_open_downgrade(struct nfsd4_compoundres *resp, int nfserr, struct n
        ENCODE_SEQID_OP_TAIL(od->od_stateowner);
 }
 
-static int
-nfsd4_encode_read(struct nfsd4_compoundres *resp, int nfserr,
+static __be32
+nfsd4_encode_read(struct nfsd4_compoundres *resp, __be32 nfserr,
                  struct nfsd4_read *read)
 {
        u32 eof;
@@ -2267,8 +2270,8 @@ nfsd4_encode_read(struct nfsd4_compoundres *resp, int nfserr,
        return 0;
 }
 
-static int
-nfsd4_encode_readlink(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_readlink *readlink)
+static __be32
+nfsd4_encode_readlink(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_readlink *readlink)
 {
        int maxcount;
        char *page;
@@ -2315,12 +2318,12 @@ nfsd4_encode_readlink(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_r
        return 0;
 }
 
-static int
-nfsd4_encode_readdir(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_readdir *readdir)
+static __be32
+nfsd4_encode_readdir(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_readdir *readdir)
 {
        int maxcount;
        loff_t offset;
-       u32 *page, *savep, *tailbase;
+       __be32 *page, *savep, *tailbase;
        ENCODE_HEAD;
 
        if (nfserr)
@@ -2395,7 +2398,7 @@ err_no_verf:
 }
 
 static void
-nfsd4_encode_remove(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_remove *remove)
+nfsd4_encode_remove(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_remove *remove)
 {
        ENCODE_HEAD;
 
@@ -2407,7 +2410,7 @@ nfsd4_encode_remove(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_rem
 }
 
 static void
-nfsd4_encode_rename(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_rename *rename)
+nfsd4_encode_rename(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_rename *rename)
 {
        ENCODE_HEAD;
 
@@ -2424,7 +2427,7 @@ nfsd4_encode_rename(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_ren
  * regardless of the error status.
  */
 static void
-nfsd4_encode_setattr(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_setattr *setattr)
+nfsd4_encode_setattr(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_setattr *setattr)
 {
        ENCODE_HEAD;
 
@@ -2443,7 +2446,7 @@ nfsd4_encode_setattr(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_se
 }
 
 static void
-nfsd4_encode_setclientid(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_setclientid *scd)
+nfsd4_encode_setclientid(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_setclientid *scd)
 {
        ENCODE_HEAD;
 
@@ -2462,7 +2465,7 @@ nfsd4_encode_setclientid(struct nfsd4_compoundres *resp, int nfserr, struct nfsd
 }
 
 static void
-nfsd4_encode_write(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_write *write)
+nfsd4_encode_write(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_write *write)
 {
        ENCODE_HEAD;
 
@@ -2478,7 +2481,7 @@ nfsd4_encode_write(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_writ
 void
 nfsd4_encode_operation(struct nfsd4_compoundres *resp, struct nfsd4_op *op)
 {
-       u32 *statp;
+       __be32 *statp;
        ENCODE_HEAD;
 
        RESERVE_SPACE(8);
@@ -2616,7 +2619,7 @@ nfsd4_encode_replay(struct nfsd4_compoundres *resp, struct nfsd4_op *op)
  */
 
 int
-nfs4svc_encode_voidres(struct svc_rqst *rqstp, u32 *p, void *dummy)
+nfs4svc_encode_voidres(struct svc_rqst *rqstp, __be32 *p, void *dummy)
 {
         return xdr_ressize_check(rqstp, p);
 }
@@ -2638,9 +2641,9 @@ void nfsd4_release_compoundargs(struct nfsd4_compoundargs *args)
 }
 
 int
-nfs4svc_decode_compoundargs(struct svc_rqst *rqstp, u32 *p, struct nfsd4_compoundargs *args)
+nfs4svc_decode_compoundargs(struct svc_rqst *rqstp, __be32 *p, struct nfsd4_compoundargs *args)
 {
-       int status;
+       __be32 status;
 
        args->p = p;
        args->end = rqstp->rq_arg.head[0].iov_base + rqstp->rq_arg.head[0].iov_len;
@@ -2659,7 +2662,7 @@ nfs4svc_decode_compoundargs(struct svc_rqst *rqstp, u32 *p, struct nfsd4_compoun
 }
 
 int
-nfs4svc_encode_compoundres(struct svc_rqst *rqstp, u32 *p, struct nfsd4_compoundres *resp)
+nfs4svc_encode_compoundres(struct svc_rqst *rqstp, __be32 *p, struct nfsd4_compoundres *resp)
 {
        /*
         * All that remains is to write the tag and operation count...
index fdf7cf3dfadcf0f7775f4aa54cd4acf43e7ffed1..6100bbe27432d6b6f826733a47b3a87dfdbc3041 100644 (file)
@@ -29,7 +29,7 @@
  */
 #define CACHESIZE              1024
 #define HASHSIZE               64
-#define REQHASH(xid)           ((((xid) >> 24) ^ (xid)) & (HASHSIZE-1))
+#define REQHASH(xid)           (((((__force __u32)xid) >> 24) ^ ((__force __u32)xid)) & (HASHSIZE-1))
 
 static struct hlist_head *     hash_list;
 static struct list_head        lru_head;
@@ -127,8 +127,8 @@ nfsd_cache_lookup(struct svc_rqst *rqstp, int type)
        struct hlist_node       *hn;
        struct hlist_head       *rh;
        struct svc_cacherep     *rp;
-       u32                     xid = rqstp->rq_xid,
-                               proto =  rqstp->rq_prot,
+       __be32                  xid = rqstp->rq_xid;
+       u32                     proto =  rqstp->rq_prot,
                                vers = rqstp->rq_vers,
                                proc = rqstp->rq_proc;
        unsigned long           age;
@@ -258,7 +258,7 @@ found_entry:
  * In this case, nfsd_cache_update is called with statp == NULL.
  */
 void
-nfsd_cache_update(struct svc_rqst *rqstp, int cachetype, u32 *statp)
+nfsd_cache_update(struct svc_rqst *rqstp, int cachetype, __be32 *statp)
 {
        struct svc_cacherep *rp;
        struct kvec     *resv = &rqstp->rq_res.head[0], *cachv;
index 501d83884530859e767bfaeb8341a51105b01206..727ab3bd450d54bffee6183ddf8fea3e1d3bdb75 100644 (file)
@@ -76,7 +76,7 @@ static int nfsd_acceptable(void *expv, struct dentry *dentry)
  * comment in the NFSv3 spec says this is incorrect (implementation notes for
  * the write call).
  */
-static inline int
+static inline __be32
 nfsd_mode_check(struct svc_rqst *rqstp, umode_t mode, int type)
 {
        /* Type can be negative when creating hardlinks - not to a dir */
@@ -110,13 +110,13 @@ nfsd_mode_check(struct svc_rqst *rqstp, umode_t mode, int type)
  * This is only called at the start of an nfsproc call, so fhp points to
  * a svc_fh which is all 0 except for the over-the-wire file handle.
  */
-u32
+__be32
 fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access)
 {
        struct knfsd_fh *fh = &fhp->fh_handle;
        struct svc_export *exp = NULL;
        struct dentry   *dentry;
-       u32             error = 0;
+       __be32          error = 0;
 
        dprintk("nfsd: fh_verify(%s)\n", SVCFH_fmt(fhp));
 
@@ -315,7 +315,7 @@ static inline void _fh_update_old(struct dentry *dentry,
                fh->ofh_dirino = 0;
 }
 
-int
+__be32
 fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry, struct svc_fh *ref_fh)
 {
        /* ref_fh is a reference file handle.
@@ -451,7 +451,7 @@ fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry, st
  * Update file handle information after changing a dentry.
  * This is only called by nfsd_create, nfsd_create_v3 and nfsd_proc_create
  */
-int
+__be32
 fh_update(struct svc_fh *fhp)
 {
        struct dentry *dentry;
index 9ee1dab5d44adc09214469af2014735f132c50cc..ec983b777680ded981c59dbb65c81ebb0c5637dc 100644 (file)
@@ -30,22 +30,22 @@ typedef struct svc_buf      svc_buf;
 #define NFSDDBG_FACILITY               NFSDDBG_PROC
 
 
-static int
+static __be32
 nfsd_proc_null(struct svc_rqst *rqstp, void *argp, void *resp)
 {
        return nfs_ok;
 }
 
-static int
-nfsd_return_attrs(int err, struct nfsd_attrstat *resp)
+static __be32
+nfsd_return_attrs(__be32 err, struct nfsd_attrstat *resp)
 {
        if (err) return err;
        return nfserrno(vfs_getattr(resp->fh.fh_export->ex_mnt,
                                    resp->fh.fh_dentry,
                                    &resp->stat));
 }
-static int
-nfsd_return_dirop(int err, struct nfsd_diropres *resp)
+static __be32
+nfsd_return_dirop(__be32 err, struct nfsd_diropres *resp)
 {
        if (err) return err;
        return nfserrno(vfs_getattr(resp->fh.fh_export->ex_mnt,
@@ -56,11 +56,11 @@ nfsd_return_dirop(int err, struct nfsd_diropres *resp)
  * Get a file's attributes
  * N.B. After this call resp->fh needs an fh_put
  */
-static int
+static __be32
 nfsd_proc_getattr(struct svc_rqst *rqstp, struct nfsd_fhandle  *argp,
                                          struct nfsd_attrstat *resp)
 {
-       int nfserr;
+       __be32 nfserr;
        dprintk("nfsd: GETATTR  %s\n", SVCFH_fmt(&argp->fh));
 
        fh_copy(&resp->fh, &argp->fh);
@@ -72,11 +72,11 @@ nfsd_proc_getattr(struct svc_rqst *rqstp, struct nfsd_fhandle  *argp,
  * Set a file's attributes
  * N.B. After this call resp->fh needs an fh_put
  */
-static int
+static __be32
 nfsd_proc_setattr(struct svc_rqst *rqstp, struct nfsd_sattrargs *argp,
                                          struct nfsd_attrstat  *resp)
 {
-       int nfserr;
+       __be32 nfserr;
        dprintk("nfsd: SETATTR  %s, valid=%x, size=%ld\n",
                SVCFH_fmt(&argp->fh),
                argp->attrs.ia_valid, (long) argp->attrs.ia_size);
@@ -92,11 +92,11 @@ nfsd_proc_setattr(struct svc_rqst *rqstp, struct nfsd_sattrargs *argp,
  * doesn't exist yet.
  * N.B. After this call resp->fh needs an fh_put
  */
-static int
+static __be32
 nfsd_proc_lookup(struct svc_rqst *rqstp, struct nfsd_diropargs *argp,
                                         struct nfsd_diropres  *resp)
 {
-       int     nfserr;
+       __be32  nfserr;
 
        dprintk("nfsd: LOOKUP   %s %.*s\n",
                SVCFH_fmt(&argp->fh), argp->len, argp->name);
@@ -112,11 +112,11 @@ nfsd_proc_lookup(struct svc_rqst *rqstp, struct nfsd_diropargs *argp,
 /*
  * Read a symlink.
  */
-static int
+static __be32
 nfsd_proc_readlink(struct svc_rqst *rqstp, struct nfsd_readlinkargs *argp,
                                           struct nfsd_readlinkres *resp)
 {
-       int     nfserr;
+       __be32  nfserr;
 
        dprintk("nfsd: READLINK %s\n", SVCFH_fmt(&argp->fh));
 
@@ -132,11 +132,11 @@ nfsd_proc_readlink(struct svc_rqst *rqstp, struct nfsd_readlinkargs *argp,
  * Read a portion of a file.
  * N.B. After this call resp->fh needs an fh_put
  */
-static int
+static __be32
 nfsd_proc_read(struct svc_rqst *rqstp, struct nfsd_readargs *argp,
                                       struct nfsd_readres  *resp)
 {
-       int     nfserr;
+       __be32  nfserr;
 
        dprintk("nfsd: READ    %s %d bytes at %d\n",
                SVCFH_fmt(&argp->fh),
@@ -172,11 +172,11 @@ nfsd_proc_read(struct svc_rqst *rqstp, struct nfsd_readargs *argp,
  * Write data to a file
  * N.B. After this call resp->fh needs an fh_put
  */
-static int
+static __be32
 nfsd_proc_write(struct svc_rqst *rqstp, struct nfsd_writeargs *argp,
                                        struct nfsd_attrstat  *resp)
 {
-       int     nfserr;
+       __be32  nfserr;
        int     stable = 1;
 
        dprintk("nfsd: WRITE    %s %d bytes at %d\n",
@@ -197,7 +197,7 @@ nfsd_proc_write(struct svc_rqst *rqstp, struct nfsd_writeargs *argp,
  * and the actual create() call in compliance with VFS protocols.
  * N.B. After this call _both_ argp->fh and resp->fh need an fh_put
  */
-static int
+static __be32
 nfsd_proc_create(struct svc_rqst *rqstp, struct nfsd_createargs *argp,
                                         struct nfsd_diropres   *resp)
 {
@@ -206,7 +206,8 @@ nfsd_proc_create(struct svc_rqst *rqstp, struct nfsd_createargs *argp,
        struct iattr    *attr = &argp->attrs;
        struct inode    *inode;
        struct dentry   *dchild;
-       int             nfserr, type, mode;
+       int             type, mode;
+       __be32          nfserr;
        dev_t           rdev = 0, wanted = new_decode_dev(attr->ia_size);
 
        dprintk("nfsd: CREATE   %s %.*s\n",
@@ -348,11 +349,11 @@ done:
        return nfsd_return_dirop(nfserr, resp);
 }
 
-static int
+static __be32
 nfsd_proc_remove(struct svc_rqst *rqstp, struct nfsd_diropargs *argp,
                                         void                  *resp)
 {
-       int     nfserr;
+       __be32  nfserr;
 
        dprintk("nfsd: REMOVE   %s %.*s\n", SVCFH_fmt(&argp->fh),
                argp->len, argp->name);
@@ -363,11 +364,11 @@ nfsd_proc_remove(struct svc_rqst *rqstp, struct nfsd_diropargs *argp,
        return nfserr;
 }
 
-static int
+static __be32
 nfsd_proc_rename(struct svc_rqst *rqstp, struct nfsd_renameargs *argp,
                                         void                   *resp)
 {
-       int     nfserr;
+       __be32  nfserr;
 
        dprintk("nfsd: RENAME   %s %.*s -> \n",
                SVCFH_fmt(&argp->ffh), argp->flen, argp->fname);
@@ -381,11 +382,11 @@ nfsd_proc_rename(struct svc_rqst *rqstp, struct nfsd_renameargs *argp,
        return nfserr;
 }
 
-static int
+static __be32
 nfsd_proc_link(struct svc_rqst *rqstp, struct nfsd_linkargs *argp,
                                void                        *resp)
 {
-       int     nfserr;
+       __be32  nfserr;
 
        dprintk("nfsd: LINK     %s ->\n",
                SVCFH_fmt(&argp->ffh));
@@ -401,12 +402,12 @@ nfsd_proc_link(struct svc_rqst *rqstp, struct nfsd_linkargs *argp,
        return nfserr;
 }
 
-static int
+static __be32
 nfsd_proc_symlink(struct svc_rqst *rqstp, struct nfsd_symlinkargs *argp,
                                          void                    *resp)
 {
        struct svc_fh   newfh;
-       int             nfserr;
+       __be32          nfserr;
 
        dprintk("nfsd: SYMLINK  %s %.*s -> %.*s\n",
                SVCFH_fmt(&argp->ffh), argp->flen, argp->fname,
@@ -430,11 +431,11 @@ nfsd_proc_symlink(struct svc_rqst *rqstp, struct nfsd_symlinkargs *argp,
  * Make directory. This operation is not idempotent.
  * N.B. After this call resp->fh needs an fh_put
  */
-static int
+static __be32
 nfsd_proc_mkdir(struct svc_rqst *rqstp, struct nfsd_createargs *argp,
                                        struct nfsd_diropres   *resp)
 {
-       int     nfserr;
+       __be32  nfserr;
 
        dprintk("nfsd: MKDIR    %s %.*s\n", SVCFH_fmt(&argp->fh), argp->len, argp->name);
 
@@ -454,11 +455,11 @@ nfsd_proc_mkdir(struct svc_rqst *rqstp, struct nfsd_createargs *argp,
 /*
  * Remove a directory
  */
-static int
+static __be32
 nfsd_proc_rmdir(struct svc_rqst *rqstp, struct nfsd_diropargs *argp,
                                        void                  *resp)
 {
-       int     nfserr;
+       __be32  nfserr;
 
        dprintk("nfsd: RMDIR    %s %.*s\n", SVCFH_fmt(&argp->fh), argp->len, argp->name);
 
@@ -470,11 +471,12 @@ nfsd_proc_rmdir(struct svc_rqst *rqstp, struct nfsd_diropargs *argp,
 /*
  * Read a portion of a directory.
  */
-static int
+static __be32
 nfsd_proc_readdir(struct svc_rqst *rqstp, struct nfsd_readdirargs *argp,
                                          struct nfsd_readdirres  *resp)
 {
-       int             nfserr, count;
+       int             count;
+       __be32          nfserr;
        loff_t          offset;
 
        dprintk("nfsd: READDIR  %s %d bytes at %d\n",
@@ -509,11 +511,11 @@ nfsd_proc_readdir(struct svc_rqst *rqstp, struct nfsd_readdirargs *argp,
 /*
  * Get file system info
  */
-static int
+static __be32
 nfsd_proc_statfs(struct svc_rqst * rqstp, struct nfsd_fhandle   *argp,
                                          struct nfsd_statfsres *resp)
 {
-       int     nfserr;
+       __be32  nfserr;
 
        dprintk("nfsd: STATFS   %s\n", SVCFH_fmt(&argp->fh));
 
@@ -579,11 +581,11 @@ struct svc_version        nfsd_version2 = {
 /*
  * Map errnos to NFS errnos.
  */
-int
+__be32
 nfserrno (int errno)
 {
        static struct {
-               int     nfserr;
+               __be32  nfserr;
                int     syserr;
        } nfs_errtbl[] = {
                { nfs_ok, 0 },
@@ -615,11 +617,10 @@ nfserrno (int errno)
                { nfserr_badname, -ESRCH },
                { nfserr_io, -ETXTBSY },
                { nfserr_notsupp, -EOPNOTSUPP },
-               { -1, -EIO }
        };
        int     i;
 
-       for (i = 0; nfs_errtbl[i].nfserr != -1; i++) {
+       for (i = 0; i < ARRAY_SIZE(nfs_errtbl); i++) {
                if (nfs_errtbl[i].syserr == errno)
                        return nfs_errtbl[i].nfserr;
        }
index 013b38996e64ad072cd97d5f0b728e3b18c3710c..0aaccb03bf769a582ce6070d7e04ecfa261ae9f8 100644 (file)
@@ -491,12 +491,12 @@ out:
 }
 
 int
-nfsd_dispatch(struct svc_rqst *rqstp, u32 *statp)
+nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp)
 {
        struct svc_procedure    *proc;
        kxdrproc_t              xdr;
-       u32                     nfserr;
-       u32                     *nfserrp;
+       __be32                  nfserr;
+       __be32                  *nfserrp;
 
        dprintk("nfsd_dispatch: vers %d proc %d\n",
                                rqstp->rq_vers, rqstp->rq_proc);
@@ -515,7 +515,7 @@ nfsd_dispatch(struct svc_rqst *rqstp, u32 *statp)
 
        /* Decode arguments */
        xdr = proc->pc_decode;
-       if (xdr && !xdr(rqstp, (u32*)rqstp->rq_arg.head[0].iov_base,
+       if (xdr && !xdr(rqstp, (__be32*)rqstp->rq_arg.head[0].iov_base,
                        rqstp->rq_argp)) {
                dprintk("nfsd: failed to decode arguments!\n");
                nfsd_cache_update(rqstp, RC_NOCACHE, NULL);
@@ -528,7 +528,7 @@ nfsd_dispatch(struct svc_rqst *rqstp, u32 *statp)
         */
        nfserrp = rqstp->rq_res.head[0].iov_base
                + rqstp->rq_res.head[0].iov_len;
-       rqstp->rq_res.head[0].iov_len += sizeof(u32);
+       rqstp->rq_res.head[0].iov_len += sizeof(__be32);
 
        /* Now call the procedure handler, and encode NFS status. */
        nfserr = proc->pc_func(rqstp, rqstp->rq_argp, rqstp->rq_resp);
index 1135c0d145574a7feb8fdb70c4a19cfd40c7dad1..56ebb1443e0eb7bf067a773690dee36a1d60f2ee 100644 (file)
@@ -37,8 +37,8 @@ static u32    nfs_ftypes[] = {
 /*
  * XDR functions for basic NFS types
  */
-static u32 *
-decode_fh(u32 *p, struct svc_fh *fhp)
+static __be32 *
+decode_fh(__be32 *p, struct svc_fh *fhp)
 {
        fh_init(fhp, NFS_FHSIZE);
        memcpy(&fhp->fh_handle.fh_base, p, NFS_FHSIZE);
@@ -50,13 +50,13 @@ decode_fh(u32 *p, struct svc_fh *fhp)
 }
 
 /* Helper function for NFSv2 ACL code */
-u32 *nfs2svc_decode_fh(u32 *p, struct svc_fh *fhp)
+__be32 *nfs2svc_decode_fh(__be32 *p, struct svc_fh *fhp)
 {
        return decode_fh(p, fhp);
 }
 
-static inline u32 *
-encode_fh(u32 *p, struct svc_fh *fhp)
+static inline __be32 *
+encode_fh(__be32 *p, struct svc_fh *fhp)
 {
        memcpy(p, &fhp->fh_handle.fh_base, NFS_FHSIZE);
        return p + (NFS_FHSIZE>> 2);
@@ -66,8 +66,8 @@ encode_fh(u32 *p, struct svc_fh *fhp)
  * Decode a file name and make sure that the path contains
  * no slashes or null bytes.
  */
-static inline u32 *
-decode_filename(u32 *p, char **namp, int *lenp)
+static inline __be32 *
+decode_filename(__be32 *p, char **namp, int *lenp)
 {
        char            *name;
        int             i;
@@ -82,8 +82,8 @@ decode_filename(u32 *p, char **namp, int *lenp)
        return p;
 }
 
-static inline u32 *
-decode_pathname(u32 *p, char **namp, int *lenp)
+static inline __be32 *
+decode_pathname(__be32 *p, char **namp, int *lenp)
 {
        char            *name;
        int             i;
@@ -98,8 +98,8 @@ decode_pathname(u32 *p, char **namp, int *lenp)
        return p;
 }
 
-static inline u32 *
-decode_sattr(u32 *p, struct iattr *iap)
+static inline __be32 *
+decode_sattr(__be32 *p, struct iattr *iap)
 {
        u32     tmp, tmp1;
 
@@ -151,8 +151,8 @@ decode_sattr(u32 *p, struct iattr *iap)
        return p;
 }
 
-static u32 *
-encode_fattr(struct svc_rqst *rqstp, u32 *p, struct svc_fh *fhp,
+static __be32 *
+encode_fattr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp,
             struct kstat *stat)
 {
        struct dentry   *dentry = fhp->fh_dentry;
@@ -195,7 +195,7 @@ encode_fattr(struct svc_rqst *rqstp, u32 *p, struct svc_fh *fhp,
 }
 
 /* Helper function for NFSv2 ACL code */
-u32 *nfs2svc_encode_fattr(struct svc_rqst *rqstp, u32 *p, struct svc_fh *fhp)
+__be32 *nfs2svc_encode_fattr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp)
 {
        struct kstat stat;
        vfs_getattr(fhp->fh_export->ex_mnt, fhp->fh_dentry, &stat);
@@ -206,13 +206,13 @@ u32 *nfs2svc_encode_fattr(struct svc_rqst *rqstp, u32 *p, struct svc_fh *fhp)
  * XDR decode functions
  */
 int
-nfssvc_decode_void(struct svc_rqst *rqstp, u32 *p, void *dummy)
+nfssvc_decode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy)
 {
        return xdr_argsize_check(rqstp, p);
 }
 
 int
-nfssvc_decode_fhandle(struct svc_rqst *rqstp, u32 *p, struct nfsd_fhandle *args)
+nfssvc_decode_fhandle(struct svc_rqst *rqstp, __be32 *p, struct nfsd_fhandle *args)
 {
        if (!(p = decode_fh(p, &args->fh)))
                return 0;
@@ -220,7 +220,7 @@ nfssvc_decode_fhandle(struct svc_rqst *rqstp, u32 *p, struct nfsd_fhandle *args)
 }
 
 int
-nfssvc_decode_sattrargs(struct svc_rqst *rqstp, u32 *p,
+nfssvc_decode_sattrargs(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd_sattrargs *args)
 {
        if (!(p = decode_fh(p, &args->fh))
@@ -231,7 +231,7 @@ nfssvc_decode_sattrargs(struct svc_rqst *rqstp, u32 *p,
 }
 
 int
-nfssvc_decode_diropargs(struct svc_rqst *rqstp, u32 *p,
+nfssvc_decode_diropargs(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd_diropargs *args)
 {
        if (!(p = decode_fh(p, &args->fh))
@@ -242,7 +242,7 @@ nfssvc_decode_diropargs(struct svc_rqst *rqstp, u32 *p,
 }
 
 int
-nfssvc_decode_readargs(struct svc_rqst *rqstp, u32 *p,
+nfssvc_decode_readargs(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd_readargs *args)
 {
        unsigned int len;
@@ -273,7 +273,7 @@ nfssvc_decode_readargs(struct svc_rqst *rqstp, u32 *p,
 }
 
 int
-nfssvc_decode_writeargs(struct svc_rqst *rqstp, u32 *p,
+nfssvc_decode_writeargs(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd_writeargs *args)
 {
        unsigned int len;
@@ -303,7 +303,7 @@ nfssvc_decode_writeargs(struct svc_rqst *rqstp, u32 *p,
 }
 
 int
-nfssvc_decode_createargs(struct svc_rqst *rqstp, u32 *p,
+nfssvc_decode_createargs(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd_createargs *args)
 {
        if (!(p = decode_fh(p, &args->fh))
@@ -315,7 +315,7 @@ nfssvc_decode_createargs(struct svc_rqst *rqstp, u32 *p,
 }
 
 int
-nfssvc_decode_renameargs(struct svc_rqst *rqstp, u32 *p,
+nfssvc_decode_renameargs(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd_renameargs *args)
 {
        if (!(p = decode_fh(p, &args->ffh))
@@ -328,7 +328,7 @@ nfssvc_decode_renameargs(struct svc_rqst *rqstp, u32 *p,
 }
 
 int
-nfssvc_decode_readlinkargs(struct svc_rqst *rqstp, u32 *p, struct nfsd_readlinkargs *args)
+nfssvc_decode_readlinkargs(struct svc_rqst *rqstp, __be32 *p, struct nfsd_readlinkargs *args)
 {
        if (!(p = decode_fh(p, &args->fh)))
                return 0;
@@ -338,7 +338,7 @@ nfssvc_decode_readlinkargs(struct svc_rqst *rqstp, u32 *p, struct nfsd_readlinka
 }
 
 int
-nfssvc_decode_linkargs(struct svc_rqst *rqstp, u32 *p,
+nfssvc_decode_linkargs(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd_linkargs *args)
 {
        if (!(p = decode_fh(p, &args->ffh))
@@ -350,7 +350,7 @@ nfssvc_decode_linkargs(struct svc_rqst *rqstp, u32 *p,
 }
 
 int
-nfssvc_decode_symlinkargs(struct svc_rqst *rqstp, u32 *p,
+nfssvc_decode_symlinkargs(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd_symlinkargs *args)
 {
        if (!(p = decode_fh(p, &args->ffh))
@@ -363,7 +363,7 @@ nfssvc_decode_symlinkargs(struct svc_rqst *rqstp, u32 *p,
 }
 
 int
-nfssvc_decode_readdirargs(struct svc_rqst *rqstp, u32 *p,
+nfssvc_decode_readdirargs(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd_readdirargs *args)
 {
        if (!(p = decode_fh(p, &args->fh)))
@@ -382,13 +382,13 @@ nfssvc_decode_readdirargs(struct svc_rqst *rqstp, u32 *p,
  * XDR encode functions
  */
 int
-nfssvc_encode_void(struct svc_rqst *rqstp, u32 *p, void *dummy)
+nfssvc_encode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy)
 {
        return xdr_ressize_check(rqstp, p);
 }
 
 int
-nfssvc_encode_attrstat(struct svc_rqst *rqstp, u32 *p,
+nfssvc_encode_attrstat(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd_attrstat *resp)
 {
        p = encode_fattr(rqstp, p, &resp->fh, &resp->stat);
@@ -396,7 +396,7 @@ nfssvc_encode_attrstat(struct svc_rqst *rqstp, u32 *p,
 }
 
 int
-nfssvc_encode_diropres(struct svc_rqst *rqstp, u32 *p,
+nfssvc_encode_diropres(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd_diropres *resp)
 {
        p = encode_fh(p, &resp->fh);
@@ -405,7 +405,7 @@ nfssvc_encode_diropres(struct svc_rqst *rqstp, u32 *p,
 }
 
 int
-nfssvc_encode_readlinkres(struct svc_rqst *rqstp, u32 *p,
+nfssvc_encode_readlinkres(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd_readlinkres *resp)
 {
        *p++ = htonl(resp->len);
@@ -421,7 +421,7 @@ nfssvc_encode_readlinkres(struct svc_rqst *rqstp, u32 *p,
 }
 
 int
-nfssvc_encode_readres(struct svc_rqst *rqstp, u32 *p,
+nfssvc_encode_readres(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd_readres *resp)
 {
        p = encode_fattr(rqstp, p, &resp->fh, &resp->stat);
@@ -440,7 +440,7 @@ nfssvc_encode_readres(struct svc_rqst *rqstp, u32 *p,
 }
 
 int
-nfssvc_encode_readdirres(struct svc_rqst *rqstp, u32 *p,
+nfssvc_encode_readdirres(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd_readdirres *resp)
 {
        xdr_ressize_check(rqstp, p);
@@ -453,7 +453,7 @@ nfssvc_encode_readdirres(struct svc_rqst *rqstp, u32 *p,
 }
 
 int
-nfssvc_encode_statfsres(struct svc_rqst *rqstp, u32 *p,
+nfssvc_encode_statfsres(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd_statfsres *resp)
 {
        struct kstatfs  *stat = &resp->stats;
@@ -471,7 +471,7 @@ nfssvc_encode_entry(struct readdir_cd *ccd, const char *name,
                    int namlen, loff_t offset, ino_t ino, unsigned int d_type)
 {
        struct nfsd_readdirres *cd = container_of(ccd, struct nfsd_readdirres, common);
-       u32     *p = cd->buffer;
+       __be32  *p = cd->buffer;
        int     buflen, slen;
 
        /*
@@ -497,7 +497,7 @@ nfssvc_encode_entry(struct readdir_cd *ccd, const char *name,
        *p++ = htonl((u32) ino);                /* file id */
        p    = xdr_encode_array(p, name, namlen);/* name length & name */
        cd->offset = p;                 /* remember pointer */
-       *p++ = ~(u32) 0;                /* offset of next entry */
+       *p++ = htonl(~0U);              /* offset of next entry */
 
        cd->buflen = buflen;
        cd->buffer = p;
@@ -509,7 +509,7 @@ nfssvc_encode_entry(struct readdir_cd *ccd, const char *name,
  * XDR release functions
  */
 int
-nfssvc_release_fhandle(struct svc_rqst *rqstp, u32 *p,
+nfssvc_release_fhandle(struct svc_rqst *rqstp, __be32 *p,
                                        struct nfsd_fhandle *resp)
 {
        fh_put(&resp->fh);
index 1141bd29e4e3ee3b6f3b9711ace4d7323e42bd5d..f21e917bb8ed18519e7e1eeb4aa1c28b94af4fa3 100644 (file)
@@ -110,7 +110,7 @@ nfsd_cross_mnt(struct svc_rqst *rqstp, struct dentry **dpp,
        struct dentry *dentry = *dpp;
        struct vfsmount *mnt = mntget(exp->ex_mnt);
        struct dentry *mounts = dget(dentry);
-       int err = nfs_ok;
+       int err = 0;
 
        while (follow_down(&mnt,&mounts)&&d_mountpoint(mounts));
 
@@ -148,14 +148,15 @@ out:
  *   clients and is explicitly disallowed for NFSv3
  *      NeilBrown <neilb@cse.unsw.edu.au>
  */
-int
+__be32
 nfsd_lookup(struct svc_rqst *rqstp, struct svc_fh *fhp, const char *name,
                                        int len, struct svc_fh *resfh)
 {
        struct svc_export       *exp;
        struct dentry           *dparent;
        struct dentry           *dentry;
-       int                     err;
+       __be32                  err;
+       int                     host_err;
 
        dprintk("nfsd: nfsd_lookup(fh %s, %.*s)\n", SVCFH_fmt(fhp), len,name);
 
@@ -193,7 +194,7 @@ nfsd_lookup(struct svc_rqst *rqstp, struct svc_fh *fhp, const char *name,
                        exp2 = exp_parent(exp->ex_client, mnt, dentry,
                                          &rqstp->rq_chandle);
                        if (IS_ERR(exp2)) {
-                               err = PTR_ERR(exp2);
+                               host_err = PTR_ERR(exp2);
                                dput(dentry);
                                mntput(mnt);
                                goto out_nfserr;
@@ -210,14 +211,14 @@ nfsd_lookup(struct svc_rqst *rqstp, struct svc_fh *fhp, const char *name,
        } else {
                fh_lock(fhp);
                dentry = lookup_one_len(name, dparent, len);
-               err = PTR_ERR(dentry);
+               host_err = PTR_ERR(dentry);
                if (IS_ERR(dentry))
                        goto out_nfserr;
                /*
                 * check if we have crossed a mount point ...
                 */
                if (d_mountpoint(dentry)) {
-                       if ((err = nfsd_cross_mnt(rqstp, &dentry, &exp))) {
+                       if ((host_err = nfsd_cross_mnt(rqstp, &dentry, &exp))) {
                                dput(dentry);
                                goto out_nfserr;
                        }
@@ -236,7 +237,7 @@ out:
        return err;
 
 out_nfserr:
-       err = nfserrno(err);
+       err = nfserrno(host_err);
        goto out;
 }
 
@@ -244,7 +245,7 @@ out_nfserr:
  * Set various file attributes.
  * N.B. After this call fhp needs an fh_put
  */
-int
+__be32
 nfsd_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp, struct iattr *iap,
             int check_guard, time_t guardtime)
 {
@@ -253,7 +254,8 @@ nfsd_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp, struct iattr *iap,
        int             accmode = MAY_SATTR;
        int             ftype = 0;
        int             imode;
-       int             err;
+       __be32          err;
+       int             host_err;
        int             size_change = 0;
 
        if (iap->ia_valid & (ATTR_ATIME | ATTR_MTIME | ATTR_SIZE))
@@ -319,19 +321,19 @@ nfsd_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp, struct iattr *iap,
                 * If we are changing the size of the file, then
                 * we need to break all leases.
                 */
-               err = break_lease(inode, FMODE_WRITE | O_NONBLOCK);
-               if (err == -EWOULDBLOCK)
-                       err = -ETIMEDOUT;
-               if (err) /* ENOMEM or EWOULDBLOCK */
+               host_err = break_lease(inode, FMODE_WRITE | O_NONBLOCK);
+               if (host_err == -EWOULDBLOCK)
+                       host_err = -ETIMEDOUT;
+               if (host_err) /* ENOMEM or EWOULDBLOCK */
                        goto out_nfserr;
 
-               err = get_write_access(inode);
-               if (err)
+               host_err = get_write_access(inode);
+               if (host_err)
                        goto out_nfserr;
 
                size_change = 1;
-               err = locks_verify_truncate(inode, NULL, iap->ia_size);
-               if (err) {
+               host_err = locks_verify_truncate(inode, NULL, iap->ia_size);
+               if (host_err) {
                        put_write_access(inode);
                        goto out_nfserr;
                }
@@ -357,8 +359,8 @@ nfsd_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp, struct iattr *iap,
        err = nfserr_notsync;
        if (!check_guard || guardtime == inode->i_ctime.tv_sec) {
                fh_lock(fhp);
-               err = notify_change(dentry, iap);
-               err = nfserrno(err);
+               host_err = notify_change(dentry, iap);
+               err = nfserrno(host_err);
                fh_unlock(fhp);
        }
        if (size_change)
@@ -370,7 +372,7 @@ out:
        return err;
 
 out_nfserr:
-       err = nfserrno(err);
+       err = nfserrno(host_err);
        goto out;
 }
 
@@ -420,11 +422,12 @@ out:
        return error;
 }
 
-int
+__be32
 nfsd4_set_nfs4_acl(struct svc_rqst *rqstp, struct svc_fh *fhp,
     struct nfs4_acl *acl)
 {
-       int error;
+       __be32 error;
+       int host_error;
        struct dentry *dentry;
        struct inode *inode;
        struct posix_acl *pacl = NULL, *dpacl = NULL;
@@ -440,20 +443,20 @@ nfsd4_set_nfs4_acl(struct svc_rqst *rqstp, struct svc_fh *fhp,
        if (S_ISDIR(inode->i_mode))
                flags = NFS4_ACL_DIR;
 
-       error = nfs4_acl_nfsv4_to_posix(acl, &pacl, &dpacl, flags);
-       if (error == -EINVAL) {
+       host_error = nfs4_acl_nfsv4_to_posix(acl, &pacl, &dpacl, flags);
+       if (host_error == -EINVAL) {
                error = nfserr_attrnotsupp;
                goto out;
-       } else if (error < 0)
+       } else if (host_error < 0)
                goto out_nfserr;
 
-       error = set_nfsv4_acl_one(dentry, pacl, POSIX_ACL_XATTR_ACCESS);
-       if (error < 0)
+       host_error = set_nfsv4_acl_one(dentry, pacl, POSIX_ACL_XATTR_ACCESS);
+       if (host_error < 0)
                goto out_nfserr;
 
        if (S_ISDIR(inode->i_mode)) {
-               error = set_nfsv4_acl_one(dentry, dpacl, POSIX_ACL_XATTR_DEFAULT);
-               if (error < 0)
+               host_error = set_nfsv4_acl_one(dentry, dpacl, POSIX_ACL_XATTR_DEFAULT);
+               if (host_error < 0)
                        goto out_nfserr;
        }
 
@@ -464,7 +467,7 @@ out:
        posix_acl_release(dpacl);
        return (error);
 out_nfserr:
-       error = nfserrno(error);
+       error = nfserrno(host_error);
        goto out;
 }
 
@@ -571,14 +574,14 @@ static struct accessmap   nfs3_anyaccess[] = {
     {  0,                      0                               }
 };
 
-int
+__be32
 nfsd_access(struct svc_rqst *rqstp, struct svc_fh *fhp, u32 *access, u32 *supported)
 {
        struct accessmap        *map;
        struct svc_export       *export;
        struct dentry           *dentry;
        u32                     query, result = 0, sresult = 0;
-       unsigned int            error;
+       __be32                  error;
 
        error = fh_verify(rqstp, fhp, 0, MAY_NOP);
        if (error)
@@ -598,7 +601,7 @@ nfsd_access(struct svc_rqst *rqstp, struct svc_fh *fhp, u32 *access, u32 *suppor
        query = *access;
        for  (; map->access; map++) {
                if (map->access & query) {
-                       unsigned int err2;
+                       __be32 err2;
 
                        sresult |= map->access;
 
@@ -637,13 +640,15 @@ nfsd_access(struct svc_rqst *rqstp, struct svc_fh *fhp, u32 *access, u32 *suppor
  * The access argument indicates the type of open (read/write/lock)
  * N.B. After this call fhp needs an fh_put
  */
-int
+__be32
 nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, int type,
                        int access, struct file **filp)
 {
        struct dentry   *dentry;
        struct inode    *inode;
-       int             flags = O_RDONLY|O_LARGEFILE, err;
+       int             flags = O_RDONLY|O_LARGEFILE;
+       __be32          err;
+       int             host_err;
 
        /*
         * If we get here, then the client has already done an "open",
@@ -673,10 +678,10 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, int type,
         * Check to see if there are any leases on this file.
         * This may block while leases are broken.
         */
-       err = break_lease(inode, O_NONBLOCK | ((access & MAY_WRITE) ? FMODE_WRITE : 0));
-       if (err == -EWOULDBLOCK)
-               err = -ETIMEDOUT;
-       if (err) /* NOMEM or WOULDBLOCK */
+       host_err = break_lease(inode, O_NONBLOCK | ((access & MAY_WRITE) ? FMODE_WRITE : 0));
+       if (host_err == -EWOULDBLOCK)
+               host_err = -ETIMEDOUT;
+       if (host_err) /* NOMEM or WOULDBLOCK */
                goto out_nfserr;
 
        if (access & MAY_WRITE) {
@@ -689,10 +694,9 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, int type,
        }
        *filp = dentry_open(dget(dentry), mntget(fhp->fh_export->ex_mnt), flags);
        if (IS_ERR(*filp))
-               err = PTR_ERR(*filp);
+               host_err = PTR_ERR(*filp);
 out_nfserr:
-       if (err)
-               err = nfserrno(err);
+       err = nfserrno(host_err);
 out:
        return err;
 }
@@ -830,14 +834,15 @@ nfsd_read_actor(read_descriptor_t *desc, struct page *page, unsigned long offset
        return size;
 }
 
-static int
+static __be32
 nfsd_vfs_read(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
               loff_t offset, struct kvec *vec, int vlen, unsigned long *count)
 {
        struct inode *inode;
        struct raparms  *ra;
        mm_segment_t    oldfs;
-       int             err;
+       __be32          err;
+       int             host_err;
 
        err = nfserr_perm;
        inode = file->f_dentry->d_inode;
@@ -855,12 +860,12 @@ nfsd_vfs_read(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
 
        if (file->f_op->sendfile && rqstp->rq_sendfile_ok) {
                rqstp->rq_resused = 1;
-               err = file->f_op->sendfile(file, &offset, *count,
+               host_err = file->f_op->sendfile(file, &offset, *count,
                                                 nfsd_read_actor, rqstp);
        } else {
                oldfs = get_fs();
                set_fs(KERNEL_DS);
-               err = vfs_readv(file, (struct iovec __user *)vec, vlen, &offset);
+               host_err = vfs_readv(file, (struct iovec __user *)vec, vlen, &offset);
                set_fs(oldfs);
        }
 
@@ -874,13 +879,13 @@ nfsd_vfs_read(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
                spin_unlock(&rab->pb_lock);
        }
 
-       if (err >= 0) {
-               nfsdstats.io_read += err;
-               *count = err;
+       if (host_err >= 0) {
+               nfsdstats.io_read += host_err;
+               *count = host_err;
                err = 0;
                fsnotify_access(file->f_dentry);
        } else 
-               err = nfserrno(err);
+               err = nfserrno(host_err);
 out:
        return err;
 }
@@ -895,7 +900,7 @@ static void kill_suid(struct dentry *dentry)
        mutex_unlock(&dentry->d_inode->i_mutex);
 }
 
-static int
+static __be32
 nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
                                loff_t offset, struct kvec *vec, int vlen,
                                unsigned long cnt, int *stablep)
@@ -904,7 +909,8 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
        struct dentry           *dentry;
        struct inode            *inode;
        mm_segment_t            oldfs;
-       int                     err = 0;
+       __be32                  err = 0;
+       int                     host_err;
        int                     stable = *stablep;
 
 #ifdef MSNFS
@@ -940,18 +946,18 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
 
        /* Write the data. */
        oldfs = get_fs(); set_fs(KERNEL_DS);
-       err = vfs_writev(file, (struct iovec __user *)vec, vlen, &offset);
+       host_err = vfs_writev(file, (struct iovec __user *)vec, vlen, &offset);
        set_fs(oldfs);
-       if (err >= 0) {
+       if (host_err >= 0) {
                nfsdstats.io_write += cnt;
                fsnotify_modify(file->f_dentry);
        }
 
        /* clear setuid/setgid flag after write */
-       if (err >= 0 && (inode->i_mode & (S_ISUID | S_ISGID)))
+       if (host_err >= 0 && (inode->i_mode & (S_ISUID | S_ISGID)))
                kill_suid(dentry);
 
-       if (err >= 0 && stable) {
+       if (host_err >= 0 && stable) {
                static ino_t    last_ino;
                static dev_t    last_dev;
 
@@ -977,7 +983,7 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
 
                        if (inode->i_state & I_DIRTY) {
                                dprintk("nfsd: write sync %d\n", current->pid);
-                               err=nfsd_sync(file);
+                               host_err=nfsd_sync(file);
                        }
 #if 0
                        wake_up(&inode->i_wait);
@@ -987,11 +993,11 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
                last_dev = inode->i_sb->s_dev;
        }
 
-       dprintk("nfsd: write complete err=%d\n", err);
-       if (err >= 0)
+       dprintk("nfsd: write complete host_err=%d\n", host_err);
+       if (host_err >= 0)
                err = 0;
        else 
-               err = nfserrno(err);
+               err = nfserrno(host_err);
 out:
        return err;
 }
@@ -1001,12 +1007,12 @@ out:
  * on entry. On return, *count contains the number of bytes actually read.
  * N.B. After this call fhp needs an fh_put
  */
-int
+__be32
 nfsd_read(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
                loff_t offset, struct kvec *vec, int vlen,
                unsigned long *count)
 {
-       int             err;
+       __be32          err;
 
        if (file) {
                err = nfsd_permission(fhp->fh_export, fhp->fh_dentry,
@@ -1030,12 +1036,12 @@ out:
  * The stable flag requests synchronous writes.
  * N.B. After this call fhp needs an fh_put
  */
-int
+__be32
 nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
                loff_t offset, struct kvec *vec, int vlen, unsigned long cnt,
                int *stablep)
 {
-       int                     err = 0;
+       __be32                  err = 0;
 
        if (file) {
                err = nfsd_permission(fhp->fh_export, fhp->fh_dentry,
@@ -1067,12 +1073,12 @@ out:
  * Unfortunately we cannot lock the file to make sure we return full WCC
  * data to the client, as locking happens lower down in the filesystem.
  */
-int
+__be32
 nfsd_commit(struct svc_rqst *rqstp, struct svc_fh *fhp,
                loff_t offset, unsigned long count)
 {
        struct file     *file;
-       int             err;
+       __be32          err;
 
        if ((u64)count > ~(u64)offset)
                return nfserr_inval;
@@ -1100,14 +1106,15 @@ nfsd_commit(struct svc_rqst *rqstp, struct svc_fh *fhp,
  *
  * N.B. Every call to nfsd_create needs an fh_put for _both_ fhp and resfhp
  */
-int
+__be32
 nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
                char *fname, int flen, struct iattr *iap,
                int type, dev_t rdev, struct svc_fh *resfhp)
 {
        struct dentry   *dentry, *dchild = NULL;
        struct inode    *dirp;
-       int             err;
+       __be32          err;
+       int             host_err;
 
        err = nfserr_perm;
        if (!flen)
@@ -1134,7 +1141,7 @@ nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
                /* called from nfsd_proc_mkdir, or possibly nfsd3_proc_create */
                fh_lock_nested(fhp, I_MUTEX_PARENT);
                dchild = lookup_one_len(fname, dentry, flen);
-               err = PTR_ERR(dchild);
+               host_err = PTR_ERR(dchild);
                if (IS_ERR(dchild))
                        goto out_nfserr;
                err = fh_compose(resfhp, fhp->fh_export, dchild, fhp);
@@ -1173,22 +1180,22 @@ nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
        err = nfserr_perm;
        switch (type) {
        case S_IFREG:
-               err = vfs_create(dirp, dchild, iap->ia_mode, NULL);
+               host_err = vfs_create(dirp, dchild, iap->ia_mode, NULL);
                break;
        case S_IFDIR:
-               err = vfs_mkdir(dirp, dchild, iap->ia_mode);
+               host_err = vfs_mkdir(dirp, dchild, iap->ia_mode);
                break;
        case S_IFCHR:
        case S_IFBLK:
        case S_IFIFO:
        case S_IFSOCK:
-               err = vfs_mknod(dirp, dchild, iap->ia_mode, rdev);
+               host_err = vfs_mknod(dirp, dchild, iap->ia_mode, rdev);
                break;
        default:
                printk("nfsd: bad file type %o in nfsd_create\n", type);
-               err = -EINVAL;
+               host_err = -EINVAL;
        }
-       if (err < 0)
+       if (host_err < 0)
                goto out_nfserr;
 
        if (EX_ISSYNC(fhp->fh_export)) {
@@ -1203,7 +1210,7 @@ nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
         * directories via NFS.
         */
        if ((iap->ia_valid &= ~(ATTR_UID|ATTR_GID|ATTR_MODE)) != 0) {
-               int err2 = nfsd_setattr(rqstp, resfhp, iap, 0, (time_t)0);
+               __be32 err2 = nfsd_setattr(rqstp, resfhp, iap, 0, (time_t)0);
                if (err2)
                        err = err2;
        }
@@ -1218,7 +1225,7 @@ out:
        return err;
 
 out_nfserr:
-       err = nfserrno(err);
+       err = nfserrno(host_err);
        goto out;
 }
 
@@ -1226,7 +1233,7 @@ out_nfserr:
 /*
  * NFSv3 version of nfsd_create
  */
-int
+__be32
 nfsd_create_v3(struct svc_rqst *rqstp, struct svc_fh *fhp,
                char *fname, int flen, struct iattr *iap,
                struct svc_fh *resfhp, int createmode, u32 *verifier,
@@ -1234,7 +1241,8 @@ nfsd_create_v3(struct svc_rqst *rqstp, struct svc_fh *fhp,
 {
        struct dentry   *dentry, *dchild = NULL;
        struct inode    *dirp;
-       int             err;
+       __be32          err;
+       int             host_err;
        __u32           v_mtime=0, v_atime=0;
        int             v_mode=0;
 
@@ -1264,7 +1272,7 @@ nfsd_create_v3(struct svc_rqst *rqstp, struct svc_fh *fhp,
         * Compose the response file handle.
         */
        dchild = lookup_one_len(fname, dentry, flen);
-       err = PTR_ERR(dchild);
+       host_err = PTR_ERR(dchild);
        if (IS_ERR(dchild))
                goto out_nfserr;
 
@@ -1320,8 +1328,8 @@ nfsd_create_v3(struct svc_rqst *rqstp, struct svc_fh *fhp,
                goto out;
        }
 
-       err = vfs_create(dirp, dchild, iap->ia_mode, NULL);
-       if (err < 0)
+       host_err = vfs_create(dirp, dchild, iap->ia_mode, NULL);
+       if (host_err < 0)
                goto out_nfserr;
 
        if (EX_ISSYNC(fhp->fh_export)) {
@@ -1350,7 +1358,7 @@ nfsd_create_v3(struct svc_rqst *rqstp, struct svc_fh *fhp,
         */
  set_attr:
        if ((iap->ia_valid &= ~(ATTR_UID|ATTR_GID)) != 0) {
-               int err2 = nfsd_setattr(rqstp, resfhp, iap, 0, (time_t)0);
+               __be32 err2 = nfsd_setattr(rqstp, resfhp, iap, 0, (time_t)0);
                if (err2)
                        err = err2;
        }
@@ -1368,7 +1376,7 @@ nfsd_create_v3(struct svc_rqst *rqstp, struct svc_fh *fhp,
        return err;
  
  out_nfserr:
-       err = nfserrno(err);
+       err = nfserrno(host_err);
        goto out;
 }
 #endif /* CONFIG_NFSD_V3 */
@@ -1378,13 +1386,14 @@ nfsd_create_v3(struct svc_rqst *rqstp, struct svc_fh *fhp,
  * fits into the buffer. On return, it contains the true length.
  * N.B. After this call fhp needs an fh_put
  */
-int
+__be32
 nfsd_readlink(struct svc_rqst *rqstp, struct svc_fh *fhp, char *buf, int *lenp)
 {
        struct dentry   *dentry;
        struct inode    *inode;
        mm_segment_t    oldfs;
-       int             err;
+       __be32          err;
+       int             host_err;
 
        err = fh_verify(rqstp, fhp, S_IFLNK, MAY_NOP);
        if (err)
@@ -1403,18 +1412,18 @@ nfsd_readlink(struct svc_rqst *rqstp, struct svc_fh *fhp, char *buf, int *lenp)
         */
 
        oldfs = get_fs(); set_fs(KERNEL_DS);
-       err = inode->i_op->readlink(dentry, buf, *lenp);
+       host_err = inode->i_op->readlink(dentry, buf, *lenp);
        set_fs(oldfs);
 
-       if (err < 0)
+       if (host_err < 0)
                goto out_nfserr;
-       *lenp = err;
+       *lenp = host_err;
        err = 0;
 out:
        return err;
 
 out_nfserr:
-       err = nfserrno(err);
+       err = nfserrno(host_err);
        goto out;
 }
 
@@ -1422,7 +1431,7 @@ out_nfserr:
  * Create a symlink and look up its inode
  * N.B. After this call _both_ fhp and resfhp need an fh_put
  */
-int
+__be32
 nfsd_symlink(struct svc_rqst *rqstp, struct svc_fh *fhp,
                                char *fname, int flen,
                                char *path,  int plen,
@@ -1430,7 +1439,8 @@ nfsd_symlink(struct svc_rqst *rqstp, struct svc_fh *fhp,
                                struct iattr *iap)
 {
        struct dentry   *dentry, *dnew;
-       int             err, cerr;
+       __be32          err, cerr;
+       int             host_err;
        umode_t         mode;
 
        err = nfserr_noent;
@@ -1446,7 +1456,7 @@ nfsd_symlink(struct svc_rqst *rqstp, struct svc_fh *fhp,
        fh_lock(fhp);
        dentry = fhp->fh_dentry;
        dnew = lookup_one_len(fname, dentry, flen);
-       err = PTR_ERR(dnew);
+       host_err = PTR_ERR(dnew);
        if (IS_ERR(dnew))
                goto out_nfserr;
 
@@ -1458,21 +1468,21 @@ nfsd_symlink(struct svc_rqst *rqstp, struct svc_fh *fhp,
        if (unlikely(path[plen] != 0)) {
                char *path_alloced = kmalloc(plen+1, GFP_KERNEL);
                if (path_alloced == NULL)
-                       err = -ENOMEM;
+                       host_err = -ENOMEM;
                else {
                        strncpy(path_alloced, path, plen);
                        path_alloced[plen] = 0;
-                       err = vfs_symlink(dentry->d_inode, dnew, path_alloced, mode);
+                       host_err = vfs_symlink(dentry->d_inode, dnew, path_alloced, mode);
                        kfree(path_alloced);
                }
        } else
-               err = vfs_symlink(dentry->d_inode, dnew, path, mode);
+               host_err = vfs_symlink(dentry->d_inode, dnew, path, mode);
 
-       if (!err)
+       if (!host_err) {
                if (EX_ISSYNC(fhp->fh_export))
-                       err = nfsd_sync_dir(dentry);
-       if (err)
-               err = nfserrno(err);
+                       host_err = nfsd_sync_dir(dentry);
+       }
+       err = nfserrno(host_err);
        fh_unlock(fhp);
 
        cerr = fh_compose(resfhp, fhp->fh_export, dnew, fhp);
@@ -1482,7 +1492,7 @@ out:
        return err;
 
 out_nfserr:
-       err = nfserrno(err);
+       err = nfserrno(host_err);
        goto out;
 }
 
@@ -1490,13 +1500,14 @@ out_nfserr:
  * Create a hardlink
  * N.B. After this call _both_ ffhp and tfhp need an fh_put
  */
-int
+__be32
 nfsd_link(struct svc_rqst *rqstp, struct svc_fh *ffhp,
                                char *name, int len, struct svc_fh *tfhp)
 {
        struct dentry   *ddir, *dnew, *dold;
        struct inode    *dirp, *dest;
-       int             err;
+       __be32          err;
+       int             host_err;
 
        err = fh_verify(rqstp, ffhp, S_IFDIR, MAY_CREATE);
        if (err)
@@ -1517,24 +1528,25 @@ nfsd_link(struct svc_rqst *rqstp, struct svc_fh *ffhp,
        dirp = ddir->d_inode;
 
        dnew = lookup_one_len(name, ddir, len);
-       err = PTR_ERR(dnew);
+       host_err = PTR_ERR(dnew);
        if (IS_ERR(dnew))
                goto out_nfserr;
 
        dold = tfhp->fh_dentry;
        dest = dold->d_inode;
 
-       err = vfs_link(dold, dirp, dnew);
-       if (!err) {
+       host_err = vfs_link(dold, dirp, dnew);
+       if (!host_err) {
                if (EX_ISSYNC(ffhp->fh_export)) {
                        err = nfserrno(nfsd_sync_dir(ddir));
                        write_inode_now(dest, 1);
                }
+               err = 0;
        } else {
-               if (err == -EXDEV && rqstp->rq_vers == 2)
+               if (host_err == -EXDEV && rqstp->rq_vers == 2)
                        err = nfserr_acces;
                else
-                       err = nfserrno(err);
+                       err = nfserrno(host_err);
        }
 
        dput(dnew);
@@ -1544,7 +1556,7 @@ out:
        return err;
 
 out_nfserr:
-       err = nfserrno(err);
+       err = nfserrno(host_err);
        goto out_unlock;
 }
 
@@ -1552,13 +1564,14 @@ out_nfserr:
  * Rename a file
  * N.B. After this call _both_ ffhp and tfhp need an fh_put
  */
-int
+__be32
 nfsd_rename(struct svc_rqst *rqstp, struct svc_fh *ffhp, char *fname, int flen,
                            struct svc_fh *tfhp, char *tname, int tlen)
 {
        struct dentry   *fdentry, *tdentry, *odentry, *ndentry, *trap;
        struct inode    *fdir, *tdir;
-       int             err;
+       __be32          err;
+       int             host_err;
 
        err = fh_verify(rqstp, ffhp, S_IFDIR, MAY_REMOVE);
        if (err)
@@ -1589,22 +1602,22 @@ nfsd_rename(struct svc_rqst *rqstp, struct svc_fh *ffhp, char *fname, int flen,
        fill_pre_wcc(tfhp);
 
        odentry = lookup_one_len(fname, fdentry, flen);
-       err = PTR_ERR(odentry);
+       host_err = PTR_ERR(odentry);
        if (IS_ERR(odentry))
                goto out_nfserr;
 
-       err = -ENOENT;
+       host_err = -ENOENT;
        if (!odentry->d_inode)
                goto out_dput_old;
-       err = -EINVAL;
+       host_err = -EINVAL;
        if (odentry == trap)
                goto out_dput_old;
 
        ndentry = lookup_one_len(tname, tdentry, tlen);
-       err = PTR_ERR(ndentry);
+       host_err = PTR_ERR(ndentry);
        if (IS_ERR(ndentry))
                goto out_dput_old;
-       err = -ENOTEMPTY;
+       host_err = -ENOTEMPTY;
        if (ndentry == trap)
                goto out_dput_new;
 
@@ -1612,14 +1625,14 @@ nfsd_rename(struct svc_rqst *rqstp, struct svc_fh *ffhp, char *fname, int flen,
        if ((ffhp->fh_export->ex_flags & NFSEXP_MSNFS) &&
                ((atomic_read(&odentry->d_count) > 1)
                 || (atomic_read(&ndentry->d_count) > 1))) {
-                       err = -EPERM;
+                       host_err = -EPERM;
        } else
 #endif
-       err = vfs_rename(fdir, odentry, tdir, ndentry);
-       if (!err && EX_ISSYNC(tfhp->fh_export)) {
-               err = nfsd_sync_dir(tdentry);
-               if (!err)
-                       err = nfsd_sync_dir(fdentry);
+       host_err = vfs_rename(fdir, odentry, tdir, ndentry);
+       if (!host_err && EX_ISSYNC(tfhp->fh_export)) {
+               host_err = nfsd_sync_dir(tdentry);
+               if (!host_err)
+                       host_err = nfsd_sync_dir(fdentry);
        }
 
  out_dput_new:
@@ -1627,8 +1640,7 @@ nfsd_rename(struct svc_rqst *rqstp, struct svc_fh *ffhp, char *fname, int flen,
  out_dput_old:
        dput(odentry);
  out_nfserr:
-       if (err)
-               err = nfserrno(err);
+       err = nfserrno(host_err);
 
        /* we cannot reply on fh_unlock on the two filehandles,
         * as that would do the wrong thing if the two directories
@@ -1647,13 +1659,14 @@ out:
  * Unlink a file or directory
  * N.B. After this call fhp needs an fh_put
  */
-int
+__be32
 nfsd_unlink(struct svc_rqst *rqstp, struct svc_fh *fhp, int type,
                                char *fname, int flen)
 {
        struct dentry   *dentry, *rdentry;
        struct inode    *dirp;
-       int             err;
+       __be32          err;
+       int             host_err;
 
        err = nfserr_acces;
        if (!flen || isdotent(fname, flen))
@@ -1667,7 +1680,7 @@ nfsd_unlink(struct svc_rqst *rqstp, struct svc_fh *fhp, int type,
        dirp = dentry->d_inode;
 
        rdentry = lookup_one_len(fname, dentry, flen);
-       err = PTR_ERR(rdentry);
+       host_err = PTR_ERR(rdentry);
        if (IS_ERR(rdentry))
                goto out_nfserr;
 
@@ -1684,22 +1697,23 @@ nfsd_unlink(struct svc_rqst *rqstp, struct svc_fh *fhp, int type,
 #ifdef MSNFS
                if ((fhp->fh_export->ex_flags & NFSEXP_MSNFS) &&
                        (atomic_read(&rdentry->d_count) > 1)) {
-                       err = -EPERM;
+                       host_err = -EPERM;
                } else
 #endif
-               err = vfs_unlink(dirp, rdentry);
+               host_err = vfs_unlink(dirp, rdentry);
        } else { /* It's RMDIR */
-               err = vfs_rmdir(dirp, rdentry);
+               host_err = vfs_rmdir(dirp, rdentry);
        }
 
        dput(rdentry);
 
-       if (err == 0 &&
-           EX_ISSYNC(fhp->fh_export))
-                       err = nfsd_sync_dir(dentry);
+       if (host_err)
+               goto out_nfserr;
+       if (EX_ISSYNC(fhp->fh_export))
+               host_err = nfsd_sync_dir(dentry);
 
 out_nfserr:
-       err = nfserrno(err);
+       err = nfserrno(host_err);
 out:
        return err;
 }
@@ -1708,11 +1722,12 @@ out:
  * Read entries from a directory.
  * The  NFSv3/4 verifier we ignore for now.
  */
-int
+__be32
 nfsd_readdir(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t *offsetp, 
             struct readdir_cd *cdp, encode_dent_fn func)
 {
-       int             err;
+       __be32          err;
+       int             host_err;
        struct file     *file;
        loff_t          offset = *offsetp;
 
@@ -1734,10 +1749,10 @@ nfsd_readdir(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t *offsetp,
 
        do {
                cdp->err = nfserr_eof; /* will be cleared on successful read */
-               err = vfs_readdir(file, (filldir_t) func, cdp);
-       } while (err >=0 && cdp->err == nfs_ok);
-       if (err)
-               err = nfserrno(err);
+               host_err = vfs_readdir(file, (filldir_t) func, cdp);
+       } while (host_err >=0 && cdp->err == nfs_ok);
+       if (host_err)
+               err = nfserrno(host_err);
        else
                err = cdp->err;
        *offsetp = vfs_llseek(file, 0, 1);
@@ -1754,10 +1769,10 @@ out:
  * Get file system stats
  * N.B. After this call fhp needs an fh_put
  */
-int
+__be32
 nfsd_statfs(struct svc_rqst *rqstp, struct svc_fh *fhp, struct kstatfs *stat)
 {
-       int err = fh_verify(rqstp, fhp, 0, MAY_NOP);
+       __be32 err = fh_verify(rqstp, fhp, 0, MAY_NOP);
        if (!err && vfs_statfs(fhp->fh_dentry,stat))
                err = nfserr_io;
        return err;
@@ -1766,7 +1781,7 @@ nfsd_statfs(struct svc_rqst *rqstp, struct svc_fh *fhp, struct kstatfs *stat)
 /*
  * Check for a user's access permissions to this inode.
  */
-int
+__be32
 nfsd_permission(struct svc_export *exp, struct dentry *dentry, int acc)
 {
        struct inode    *inode = dentry->d_inode;
index e1fceb8aa32d612973de79f9967f1b74f9bd0964..d11753c50bc1452822befe923c149f8e79202c0c 100644 (file)
@@ -152,14 +152,16 @@ static struct o2nm_node *o2nm_node_ip_tree_lookup(struct o2nm_cluster *cluster,
        struct o2nm_node *node, *ret = NULL;
 
        while (*p) {
+               int cmp;
+
                parent = *p;
                node = rb_entry(parent, struct o2nm_node, nd_ip_node);
 
-               if (memcmp(&ip_needle, &node->nd_ipv4_address,
-                          sizeof(ip_needle)) < 0)
+               cmp = memcmp(&ip_needle, &node->nd_ipv4_address,
+                               sizeof(ip_needle));
+               if (cmp < 0)
                        p = &(*p)->rb_left;
-               else if (memcmp(&ip_needle, &node->nd_ipv4_address,
-                               sizeof(ip_needle)) > 0)
+               else if (cmp > 0)
                        p = &(*p)->rb_right;
                else {
                        ret = node;
index d9ba0a931a03b89aa5c9a894b040470db459e05b..1be74c4e78148f4cd79df11a62c6796fc7b642e4 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/highmem.h>
 #include <linux/pagemap.h>
 #include <linux/uio.h>
+#include <linux/sched.h>
 
 #define MLOG_MASK_PREFIX ML_INODE
 #include <cluster/masklog.h>
@@ -691,6 +692,12 @@ static int ocfs2_zero_extend(struct inode *inode,
                }
 
                start_off += sb->s_blocksize;
+
+               /*
+                * Very large extends have the potential to lock up
+                * the cpu for extended periods of time.
+                */
+               cond_resched();
        }
 
 out:
@@ -728,31 +735,36 @@ static int ocfs2_extend_file(struct inode *inode,
        clusters_to_add = ocfs2_clusters_for_bytes(inode->i_sb, new_i_size) - 
                OCFS2_I(inode)->ip_clusters;
 
-       if (clusters_to_add) {
-               /* 
-                * protect the pages that ocfs2_zero_extend is going to
-                * be pulling into the page cache.. we do this before the
-                * metadata extend so that we don't get into the situation
-                * where we've extended the metadata but can't get the data
-                * lock to zero.
-                */
-               ret = ocfs2_data_lock(inode, 1);
-               if (ret < 0) {
-                       mlog_errno(ret);
-                       goto out;
-               }
+       /* 
+        * protect the pages that ocfs2_zero_extend is going to be
+        * pulling into the page cache.. we do this before the
+        * metadata extend so that we don't get into the situation
+        * where we've extended the metadata but can't get the data
+        * lock to zero.
+        */
+       ret = ocfs2_data_lock(inode, 1);
+       if (ret < 0) {
+               mlog_errno(ret);
+               goto out;
+       }
 
+       if (clusters_to_add) {
                ret = ocfs2_extend_allocation(inode, clusters_to_add);
                if (ret < 0) {
                        mlog_errno(ret);
                        goto out_unlock;
                }
+       }
 
-               ret = ocfs2_zero_extend(inode, (u64)new_i_size - tail_to_skip);
-               if (ret < 0) {
-                       mlog_errno(ret);
-                       goto out_unlock;
-               }
+       /*
+        * Call this even if we don't add any clusters to the tree. We
+        * still need to zero the area between the old i_size and the
+        * new i_size.
+        */
+       ret = ocfs2_zero_extend(inode, (u64)new_i_size - tail_to_skip);
+       if (ret < 0) {
+               mlog_errno(ret);
+               goto out_unlock;
        }
 
        if (!tail_to_skip) {
@@ -764,8 +776,7 @@ static int ocfs2_extend_file(struct inode *inode,
        }
 
 out_unlock:
-       if (clusters_to_add) /* this is the only case in which we lock */
-               ocfs2_data_unlock(inode, 1);
+       ocfs2_data_unlock(inode, 1);
 
 out:
        return ret;
index 259155f0eb2e97ce20a39b7d990ee497b59a5725..a57b751d4f40e3fad3cf7bc1df95b09816f8307c 100644 (file)
@@ -1085,14 +1085,6 @@ static int ocfs2_rename(struct inode *old_dir,
                        BUG();
        }
 
-       if (atomic_read(&old_dentry->d_count) > 2) {
-               shrink_dcache_parent(old_dentry);
-               if (atomic_read(&old_dentry->d_count) > 2) {
-                       status = -EBUSY;
-                       goto bail;
-               }
-       }
-
        /* Assume a directory heirarchy thusly:
         * a/b/c
         * a/d
index 51c6a748df4921947659abb114fc189f2508fa95..6fb4b6150d7701cd57085f80a0f9222f31be53ed 100644 (file)
@@ -376,18 +376,48 @@ static char *make_block_name(struct gendisk *disk)
        return name;
 }
 
-static void disk_sysfs_symlinks(struct gendisk *disk)
+static int disk_sysfs_symlinks(struct gendisk *disk)
 {
        struct device *target = get_device(disk->driverfs_dev);
+       int err;
+       char *disk_name = NULL;
+
        if (target) {
-               char *disk_name = make_block_name(disk);
-               sysfs_create_link(&disk->kobj,&target->kobj,"device");
-               if (disk_name) {
-                       sysfs_create_link(&target->kobj,&disk->kobj,disk_name);
-                       kfree(disk_name);
+               disk_name = make_block_name(disk);
+               if (!disk_name) {
+                       err = -ENOMEM;
+                       goto err_out;
                }
+
+               err = sysfs_create_link(&disk->kobj, &target->kobj, "device");
+               if (err)
+                       goto err_out_disk_name;
+
+               err = sysfs_create_link(&target->kobj, &disk->kobj, disk_name);
+               if (err)
+                       goto err_out_dev_link;
        }
-       sysfs_create_link(&disk->kobj, &block_subsys.kset.kobj, "subsystem");
+
+       err = sysfs_create_link(&disk->kobj, &block_subsys.kset.kobj,
+                               "subsystem");
+       if (err)
+               goto err_out_disk_name_lnk;
+
+       kfree(disk_name);
+
+       return 0;
+
+err_out_disk_name_lnk:
+       if (target) {
+               sysfs_remove_link(&target->kobj, disk_name);
+err_out_dev_link:
+               sysfs_remove_link(&disk->kobj, "device");
+err_out_disk_name:
+               kfree(disk_name);
+err_out:
+               put_device(target);
+       }
+       return err;
 }
 
 /* Not exported, helper to add_disk(). */
@@ -406,7 +436,11 @@ void register_disk(struct gendisk *disk)
                *s = '!';
        if ((err = kobject_add(&disk->kobj)))
                return;
-       disk_sysfs_symlinks(disk);
+       err = disk_sysfs_symlinks(disk);
+       if (err) {
+               kobject_del(&disk->kobj);
+               return;
+       }
        disk_sysfs_add_subdirs(disk);
 
        /* No minors to use for partitions */
index 82da55b5cffef804f4528bf1bed4d94645f7df2d..8df27401d29207683e3dd1ad1a0d0ac5b5508adb 100644 (file)
@@ -72,6 +72,7 @@
 #include <linux/audit.h>
 #include <linux/poll.h>
 #include <linux/nsproxy.h>
+#include <linux/oom.h>
 #include "internal.h"
 
 /* NOTE:
@@ -86,7 +87,7 @@
 
 
 /* Worst case buffer size needed for holding an integer. */
-#define PROC_NUMBUF 10
+#define PROC_NUMBUF 13
 
 struct pid_entry {
        int len;
@@ -689,7 +690,8 @@ static ssize_t oom_adjust_write(struct file *file, const char __user *buf,
        if (copy_from_user(buffer, buf, count))
                return -EFAULT;
        oom_adjust = simple_strtol(buffer, &end, 0);
-       if ((oom_adjust < -16 || oom_adjust > 15) && oom_adjust != OOM_DISABLE)
+       if ((oom_adjust < OOM_ADJUST_MIN || oom_adjust > OOM_ADJUST_MAX) &&
+            oom_adjust != OOM_DISABLE)
                return -EINVAL;
        if (*end == '\n')
                end++;
index ad8cbc49883ab7d1e1051f9c72dff211b45a80e8..85ce23268302931e0a23a6bd6cc2a20a36581e56 100644 (file)
@@ -53,6 +53,7 @@
 #include <linux/workqueue.h>
 #include <linux/writeback.h>
 #include <linux/blkdev.h>
+#include <linux/backing-dev.h>
 
 /* gets a struct reiserfs_journal_list * from a list head */
 #define JOURNAL_LIST_ENTRY(h) (list_entry((h), struct reiserfs_journal_list, \
@@ -970,7 +971,7 @@ int reiserfs_async_progress_wait(struct super_block *s)
        DEFINE_WAIT(wait);
        struct reiserfs_journal *j = SB_JOURNAL(s);
        if (atomic_read(&j->j_async_throttle))
-               blk_congestion_wait(WRITE, HZ / 10);
+               congestion_wait(WRITE, HZ / 10);
        return 0;
 }
 
index a567010b62ac52e84099f584908629ceae806128..49fb9f129938845589570d622803b9189ed172c4 100644 (file)
@@ -707,9 +707,9 @@ out_ret:
  * key here is the 'actor' worker passed in that actually moves the data
  * to the wanted destination. See pipe_to_file/pipe_to_sendpage above.
  */
-ssize_t splice_from_pipe(struct pipe_inode_info *pipe, struct file *out,
-                        loff_t *ppos, size_t len, unsigned int flags,
-                        splice_actor *actor)
+static ssize_t __splice_from_pipe(struct pipe_inode_info *pipe,
+                                 struct file *out, loff_t *ppos, size_t len,
+                                 unsigned int flags, splice_actor *actor)
 {
        int ret, do_wakeup, err;
        struct splice_desc sd;
@@ -722,9 +722,6 @@ ssize_t splice_from_pipe(struct pipe_inode_info *pipe, struct file *out,
        sd.file = out;
        sd.pos = *ppos;
 
-       if (pipe->inode)
-               mutex_lock(&pipe->inode->i_mutex);
-
        for (;;) {
                if (pipe->nrbufs) {
                        struct pipe_buffer *buf = pipe->bufs + pipe->curbuf;
@@ -797,9 +794,6 @@ ssize_t splice_from_pipe(struct pipe_inode_info *pipe, struct file *out,
                pipe_wait(pipe);
        }
 
-       if (pipe->inode)
-               mutex_unlock(&pipe->inode->i_mutex);
-
        if (do_wakeup) {
                smp_mb();
                if (waitqueue_active(&pipe->wait))
@@ -810,6 +804,73 @@ ssize_t splice_from_pipe(struct pipe_inode_info *pipe, struct file *out,
        return ret;
 }
 
+ssize_t splice_from_pipe(struct pipe_inode_info *pipe, struct file *out,
+                        loff_t *ppos, size_t len, unsigned int flags,
+                        splice_actor *actor)
+{
+       ssize_t ret;
+       struct inode *inode = out->f_mapping->host;
+
+       /*
+        * The actor worker might be calling ->prepare_write and
+        * ->commit_write. Most of the time, these expect i_mutex to
+        * be held. Since this may result in an ABBA deadlock with
+        * pipe->inode, we have to order lock acquiry here.
+        */
+       inode_double_lock(inode, pipe->inode);
+       ret = __splice_from_pipe(pipe, out, ppos, len, flags, actor);
+       inode_double_unlock(inode, pipe->inode);
+
+       return ret;
+}
+
+/**
+ * generic_file_splice_write_nolock - generic_file_splice_write without mutexes
+ * @pipe:      pipe info
+ * @out:       file to write to
+ * @len:       number of bytes to splice
+ * @flags:     splice modifier flags
+ *
+ * Will either move or copy pages (determined by @flags options) from
+ * the given pipe inode to the given file. The caller is responsible
+ * for acquiring i_mutex on both inodes.
+ *
+ */
+ssize_t
+generic_file_splice_write_nolock(struct pipe_inode_info *pipe, struct file *out,
+                                loff_t *ppos, size_t len, unsigned int flags)
+{
+       struct address_space *mapping = out->f_mapping;
+       struct inode *inode = mapping->host;
+       ssize_t ret;
+       int err;
+
+       err = remove_suid(out->f_dentry);
+       if (unlikely(err))
+               return err;
+
+       ret = __splice_from_pipe(pipe, out, ppos, len, flags, pipe_to_file);
+       if (ret > 0) {
+               *ppos += ret;
+
+               /*
+                * If file or inode is SYNC and we actually wrote some data,
+                * sync it.
+                */
+               if (unlikely((out->f_flags & O_SYNC) || IS_SYNC(inode))) {
+                       err = generic_osync_inode(inode, mapping,
+                                                 OSYNC_METADATA|OSYNC_DATA);
+
+                       if (err)
+                               ret = err;
+               }
+       }
+
+       return ret;
+}
+
+EXPORT_SYMBOL(generic_file_splice_write_nolock);
+
 /**
  * generic_file_splice_write - splice data from a pipe to a file
  * @pipe:      pipe info
@@ -826,12 +887,21 @@ generic_file_splice_write(struct pipe_inode_info *pipe, struct file *out,
                          loff_t *ppos, size_t len, unsigned int flags)
 {
        struct address_space *mapping = out->f_mapping;
+       struct inode *inode = mapping->host;
        ssize_t ret;
+       int err;
+
+       err = should_remove_suid(out->f_dentry);
+       if (unlikely(err)) {
+               mutex_lock(&inode->i_mutex);
+               err = __remove_suid(out->f_dentry, err);
+               mutex_unlock(&inode->i_mutex);
+               if (err)
+                       return err;
+       }
 
        ret = splice_from_pipe(pipe, out, ppos, len, flags, pipe_to_file);
        if (ret > 0) {
-               struct inode *inode = mapping->host;
-
                *ppos += ret;
 
                /*
@@ -839,8 +909,6 @@ generic_file_splice_write(struct pipe_inode_info *pipe, struct file *out,
                 * sync it.
                 */
                if (unlikely((out->f_flags & O_SYNC) || IS_SYNC(inode))) {
-                       int err;
-
                        mutex_lock(&inode->i_mutex);
                        err = generic_osync_inode(inode, mapping,
                                                  OSYNC_METADATA|OSYNC_DATA);
@@ -1400,13 +1468,7 @@ static int link_pipe(struct pipe_inode_info *ipipe,
         * grabbing by inode address. Otherwise two different processes
         * could deadlock (one doing tee from A -> B, the other from B -> A).
         */
-       if (ipipe->inode < opipe->inode) {
-               mutex_lock_nested(&ipipe->inode->i_mutex, I_MUTEX_PARENT);
-               mutex_lock_nested(&opipe->inode->i_mutex, I_MUTEX_CHILD);
-       } else {
-               mutex_lock_nested(&opipe->inode->i_mutex, I_MUTEX_PARENT);
-               mutex_lock_nested(&ipipe->inode->i_mutex, I_MUTEX_CHILD);
-       }
+       inode_double_lock(ipipe->inode, opipe->inode);
 
        do {
                if (!opipe->readers) {
@@ -1450,8 +1512,7 @@ static int link_pipe(struct pipe_inode_info *ipipe,
                i++;
        } while (len);
 
-       mutex_unlock(&ipipe->inode->i_mutex);
-       mutex_unlock(&opipe->inode->i_mutex);
+       inode_double_unlock(ipipe->inode, opipe->inode);
 
        /*
         * If we put data in the output pipe, wakeup any potential readers.
index 146f1dedec844ced95a9055e31e701365b4b241e..298303b5a7169f37402fe45557385e0a43e0ab56 100644 (file)
@@ -483,17 +483,12 @@ int sysfs_update_file(struct kobject * kobj, const struct attribute * attr)
                    (victim->d_parent->d_inode == dir->d_inode)) {
                        victim->d_inode->i_mtime = CURRENT_TIME;
                        fsnotify_modify(victim);
-
-                       /**
-                        * Drop reference from initial sysfs_get_dentry().
-                        */
-                       dput(victim);
                        res = 0;
                } else
                        d_drop(victim);
                
                /**
-                * Drop the reference acquired from sysfs_get_dentry() above.
+                * Drop the reference acquired from lookup_one_len() above.
                 */
                dput(victim);
        }
index d59737589815c8048c00d432867606a719d0fa31..004baf6006110ae7cd8beee0f1e7f90f618c5550 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/highmem.h>
 #include <linux/swap.h>
 #include <linux/blkdev.h>
+#include <linux/backing-dev.h>
 #include "time.h"
 #include "kmem.h"
 
@@ -53,7 +54,7 @@ kmem_alloc(size_t size, unsigned int __nocast flags)
                        printk(KERN_ERR "XFS: possible memory allocation "
                                        "deadlock in %s (mode:0x%x)\n",
                                        __FUNCTION__, lflags);
-               blk_congestion_wait(WRITE, HZ/50);
+               congestion_wait(WRITE, HZ/50);
        } while (1);
 }
 
@@ -131,7 +132,7 @@ kmem_zone_alloc(kmem_zone_t *zone, unsigned int __nocast flags)
                        printk(KERN_ERR "XFS: possible memory allocation "
                                        "deadlock in %s (mode:0x%x)\n",
                                        __FUNCTION__, lflags);
-               blk_congestion_wait(WRITE, HZ/50);
+               congestion_wait(WRITE, HZ/50);
        } while (1);
 }
 
index 9bbadafdcb00285a8644a350a0ef033c7889f139..db5f5a3608ca3b4f09b8ae2bb0627c6c3c0ae38d 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/hash.h>
 #include <linux/kthread.h>
 #include <linux/migrate.h>
+#include <linux/backing-dev.h>
 #include "xfs_linux.h"
 
 STATIC kmem_zone_t *xfs_buf_zone;
@@ -395,7 +396,7 @@ _xfs_buf_lookup_pages(
 
                        XFS_STATS_INC(xb_page_retries);
                        xfsbufd_wakeup(0, gfp_mask);
-                       blk_congestion_wait(WRITE, HZ/50);
+                       congestion_wait(WRITE, HZ/50);
                        goto retry;
                }
 
index c5472be6f3a2c41744471e61dafa0386bf038397..e72bfdd887f9b285ccbb3530be8096d61aeb74a8 100644 (file)
@@ -13,6 +13,7 @@
 #define ACPI_PDC_SMP_C_SWCOORD         (0x0040)
 #define ACPI_PDC_SMP_T_SWCOORD         (0x0080)
 #define ACPI_PDC_C_C1_FFH              (0x0100)
+#define ACPI_PDC_C_C2C3_FFH            (0x0200)
 
 #define ACPI_PDC_EST_CAPABILITY_SMP    (ACPI_PDC_SMP_C1PT | \
                                         ACPI_PDC_C_C1_HALT | \
                                         ACPI_PDC_SMP_P_SWCOORD | \
                                         ACPI_PDC_P_FFH)
 
-#define ACPI_PDC_C_CAPABILITY_SMP      (ACPI_PDC_SMP_C2C3 | \
-                                        ACPI_PDC_SMP_C1PT | \
-                                        ACPI_PDC_C_C1_HALT)
+#define ACPI_PDC_C_CAPABILITY_SMP      (ACPI_PDC_SMP_C2C3  | \
+                                        ACPI_PDC_SMP_C1PT  | \
+                                        ACPI_PDC_C_C1_HALT | \
+                                        ACPI_PDC_C_C1_FFH  | \
+                                        ACPI_PDC_C_C2C3_FFH)
 
 #endif                         /* __PDC_INTEL_H__ */
index 9dd5b75961f84c19ba9a731eb071f15950577d75..7798d2a9f793aaab8005c2a45d3362a35029ea5b 100644 (file)
@@ -29,6 +29,9 @@
 #define DOMAIN_COORD_TYPE_SW_ANY       0xfd
 #define DOMAIN_COORD_TYPE_HW_ALL       0xfe
 
+#define ACPI_CSTATE_SYSTEMIO   (0)
+#define ACPI_CSTATE_FFH                (1)
+
 /* Power Management */
 
 struct acpi_processor_cx;
@@ -58,6 +61,8 @@ struct acpi_processor_cx {
        u8 valid;
        u8 type;
        u32 address;
+       u8 space_id;
+       u8 index;
        u32 latency;
        u32 latency_ticks;
        u32 power;
@@ -206,6 +211,9 @@ void arch_acpi_processor_init_pdc(struct acpi_processor *pr);
 #ifdef ARCH_HAS_POWER_INIT
 void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags,
                                        unsigned int cpu);
+int acpi_processor_ffh_cstate_probe(unsigned int cpu,
+               struct acpi_processor_cx *cx, struct acpi_power_register *reg);
+void acpi_processor_ffh_cstate_enter(struct acpi_processor_cx *cstate);
 #else
 static inline void acpi_processor_power_init_bm_check(struct
                                                      acpi_processor_flags
@@ -214,6 +222,16 @@ static inline void acpi_processor_power_init_bm_check(struct
        flags->bm_check = 1;
        return;
 }
+static inline int acpi_processor_ffh_cstate_probe(unsigned int cpu,
+               struct acpi_processor_cx *cx, struct acpi_power_register *reg)
+{
+       return -1;
+}
+static inline void acpi_processor_ffh_cstate_enter(
+               struct acpi_processor_cx *cstate)
+{
+       return;
+}
 #endif
 
 /* in processor_perflib.c */
index f5cc65dd7d0d31e4e08abfaf19a488c6580c8dc0..68731e0923a4caebc86dd6134248ddc790691795 100644 (file)
 #define SSSR_TINT              (1 << 19)       /* Receiver Time-out Interrupt */
 #define SSSR_PINT              (1 << 18)       /* Peripheral Trailing Byte Interrupt */
 
+#define SSPSP_FSRT             (1 << 25)       /* Frame Sync Relative Timing */
 #define SSPSP_DMYSTOP(x)       (x << 23)       /* Dummy Stop */
 #define SSPSP_SFRMWDTH(x)      (x << 16)       /* Serial Frame Width */
 #define SSPSP_SFRMDLY(x)       (x << 9)        /* Serial Frame Delay */
index 1b8e8a304800748cd43179add4c10de2df40a91b..3f37ca07806dc046f25dd832f8b9a52d4da86af2 100644 (file)
 #define GPIO_JORNADA720_KEYBOARD_IRQ   IRQ_GPIO0
 #define GPIO_JORNADA720_MOUSE_IRQ              IRQ_GPIO9
 
+/* MCU COMMANDS */
+#define MCU_GetBatteryData  0xc0
+#define MCU_GetScanKeyCode  0x90
+#define MCU_GetTouchSamples 0xa0
+#define MCU_GetContrast     0xD0
+#define MCU_SetContrast     0xD1
+#define MCU_GetBrightness   0xD2
+#define MCU_SetBrightness   0xD3
+#define MCU_ContrastOff     0xD8
+#define MCU_BrightnessOff   0xD9
+#define MCU_PWMOFF          0xDF
+#define MCU_TxDummy         0x11
+#define MCU_ErrorCode       0x00
+
 #ifndef __ASSEMBLY__
 
 void jornada720_mcu_init(void);
index e2247c22a638aec316a72383d7bc9f77e191dcb6..0f390f41f81680a70c12fe26cdae314644466344 100644 (file)
@@ -82,11 +82,11 @@ extern struct page *kmap_atomic_to_page(void *ptr);
        dampr = paddr | xAMPRx_L | xAMPRx_M | xAMPRx_S | xAMPRx_SS_16Kb | xAMPRx_V;             \
                                                                                                \
        if (type != __KM_CACHE)                                                                 \
-               asm volatile("movgs %0,dampr"#ampr :: "r"(dampr));                              \
+               asm volatile("movgs %0,dampr"#ampr :: "r"(dampr) : "memory");                   \
        else                                                                                    \
                asm volatile("movgs %0,iampr"#ampr"\n"                                          \
                             "movgs %0,dampr"#ampr"\n"                                          \
-                            :: "r"(dampr)                                                      \
+                            :: "r"(dampr) : "memory"                                           \
                             );                                                                 \
                                                                                                \
        asm("movsg damlr"#ampr",%0" : "=r"(damlr));                                             \
@@ -104,7 +104,7 @@ extern struct page *kmap_atomic_to_page(void *ptr);
        asm volatile("movgs %0,tplr \n"                                                           \
                     "movgs %1,tppr \n"                                                           \
                     "tlbpr %0,gr0,#2,#1"                                                         \
-                    : : "r"(damlr), "r"(dampr));                                                 \
+                    : : "r"(damlr), "r"(dampr) : "memory");                                      \
                                                                                                  \
        /*printk("TLB: SECN sl=%d L=%08lx P=%08lx\n", slot, damlr, dampr);*/                      \
                                                                                                  \
@@ -115,7 +115,7 @@ static inline void *kmap_atomic(struct page *page, enum km_type type)
 {
        unsigned long paddr;
 
-       preempt_disable();
+       inc_preempt_count();
        paddr = page_to_phys(page);
 
        switch (type) {
@@ -138,16 +138,16 @@ static inline void *kmap_atomic(struct page *page, enum km_type type)
        }
 }
 
-#define __kunmap_atomic_primary(type, ampr)                    \
-do {                                                           \
-       asm volatile("movgs gr0,dampr"#ampr"\n");               \
-       if (type == __KM_CACHE)                                 \
-               asm volatile("movgs gr0,iampr"#ampr"\n");       \
+#define __kunmap_atomic_primary(type, ampr)                            \
+do {                                                                   \
+       asm volatile("movgs gr0,dampr"#ampr"\n" ::: "memory");          \
+       if (type == __KM_CACHE)                                         \
+               asm volatile("movgs gr0,iampr"#ampr"\n" ::: "memory");  \
 } while(0)
 
-#define __kunmap_atomic_secondary(slot, vaddr)                 \
-do {                                                           \
-       asm volatile("tlbpr %0,gr0,#4,#1" : : "r"(vaddr));      \
+#define __kunmap_atomic_secondary(slot, vaddr)                         \
+do {                                                                   \
+       asm volatile("tlbpr %0,gr0,#4,#1" : : "r"(vaddr) : "memory");   \
 } while(0)
 
 static inline void kunmap_atomic(void *kvaddr, enum km_type type)
@@ -170,7 +170,8 @@ static inline void kunmap_atomic(void *kvaddr, enum km_type type)
        default:
                BUG();
        }
-       preempt_enable();
+       dec_preempt_count();
+       preempt_check_resched();
 }
 
 #endif /* !__ASSEMBLY__ */
index 1d9573cf4a0bd043ce1cfb9e9190b35e3ea435b1..c92ae0f166ff44f1757f456a132202b22f0f5368 100644 (file)
 #endif
 
 #ifndef HAVE_ARCH_WARN_ON
-#define WARN_ON(condition) unlikely((condition))
+#define WARN_ON(condition) ({                                          \
+       typeof(condition) __ret_warn_on = (condition);                  \
+       unlikely(__ret_warn_on);                                        \
+})
 #endif
 #endif
 
index 69240b52f8e17931d939c96c6c2901978717b9b9..9d0d11c180d958674922d37e2d36c757fcd6142a 100644 (file)
                *(__param)                                              \
                VMLINUX_SYMBOL(__stop___param) = .;                     \
        }                                                               \
+                                                                       \
+       /* Unwind data binary search table */                           \
+       EH_FRAME_HDR                                                    \
+                                                                       \
        __end_rodata = .;                                               \
        . = ALIGN(4096);
 
                *(.kprobes.text)                                        \
                VMLINUX_SYMBOL(__kprobes_text_end) = .;
 
+#ifdef CONFIG_STACK_UNWIND
+               /* Unwind data binary search table */
+#define EH_FRAME_HDR                                                   \
+               .eh_frame_hdr : AT(ADDR(.eh_frame_hdr) - LOAD_OFFSET) { \
+                       VMLINUX_SYMBOL(__start_unwind_hdr) = .;         \
+                       *(.eh_frame_hdr)                                \
+                       VMLINUX_SYMBOL(__end_unwind_hdr) = .;           \
+               }
+#else
+#define EH_FRAME_HDR
+#endif
+
                /* DWARF debug sections.
                Symbols in the DWARF debugging sections are relative to
                the beginning of the section so we begin them at 0.  */
index 2277127696d264579687a2e693768a6e4d8ba206..e0ddca94d50c8f42c71e05e1796086fdf84ad0ef 100644 (file)
@@ -306,6 +306,8 @@ static inline void __mwait(unsigned long eax, unsigned long ecx)
                : :"a" (eax), "c" (ecx));
 }
 
+extern void mwait_idle_with_hints(unsigned long eax, unsigned long ecx);
+
 /* from system description table in BIOS.  Mostly for MCA use, but
 others may find it useful. */
 extern unsigned int machine_id;
index 43bfff6c6b87fffbc6e36cac2aea43e7cebf7351..855c30af72a9d8fdecabf10c25e320f5daea5201 100644 (file)
@@ -417,6 +417,8 @@ __writeq (unsigned long val, volatile void __iomem *addr)
 # define outl_p                outl
 #endif
 
+# ifdef __KERNEL__
+
 extern void __iomem * ioremap(unsigned long offset, unsigned long size);
 extern void __iomem * ioremap_nocache (unsigned long offset, unsigned long size);
 
@@ -430,8 +432,6 @@ iounmap (volatile void __iomem *addr)
 #define dmi_iounmap(x,l) iounmap(x)
 #define dmi_alloc(l) kmalloc(l, GFP_ATOMIC)
 
-# ifdef __KERNEL__
-
 /*
  * String version of IO memory access ops:
  */
index 2c8fd92d0ece088e36b15548588947a59fd5cea7..4283ddcc25fbf69a50cfce33483fbbf203023ff9 100644 (file)
@@ -764,7 +764,7 @@ struct ia64_pal_retval {
  * (generally 0) MUST be passed.  Reserved parameters are not optional
  * parameters.
  */
-extern struct ia64_pal_retval ia64_pal_call_static (u64, u64, u64, u64, u64);
+extern struct ia64_pal_retval ia64_pal_call_static (u64, u64, u64, u64);
 extern struct ia64_pal_retval ia64_pal_call_stacked (u64, u64, u64, u64);
 extern struct ia64_pal_retval ia64_pal_call_phys_static (u64, u64, u64, u64);
 extern struct ia64_pal_retval ia64_pal_call_phys_stacked (u64, u64, u64, u64);
@@ -774,14 +774,7 @@ extern void ia64_load_scratch_fpregs (struct ia64_fpreg *);
 #define PAL_CALL(iprv,a0,a1,a2,a3) do {                        \
        struct ia64_fpreg fr[6];                        \
        ia64_save_scratch_fpregs(fr);                   \
-       iprv = ia64_pal_call_static(a0, a1, a2, a3, 0); \
-       ia64_load_scratch_fpregs(fr);                   \
-} while (0)
-
-#define PAL_CALL_IC_OFF(iprv,a0,a1,a2,a3) do {         \
-       struct ia64_fpreg fr[6];                        \
-       ia64_save_scratch_fpregs(fr);                   \
-       iprv = ia64_pal_call_static(a0, a1, a2, a3, 1); \
+       iprv = ia64_pal_call_static(a0, a1, a2, a3);    \
        ia64_load_scratch_fpregs(fr);                   \
 } while (0)
 
index 6c8c17d047a1a28b9533595991a75d69c92076f3..d8f17a0d8c9f6f872c513b6d5850c98e76d01465 100644 (file)
@@ -4,6 +4,7 @@
 #ifndef __SUN3_MMU_H__
 #define __SUN3_MMU_H__
 
+#include <linux/types.h>
 #include <asm/movs.h>
 #include <asm/sun3-head.h>
 
@@ -160,7 +161,7 @@ static inline void sun3_put_context(unsigned char c)
        return;
 }
 
-extern void *sun3_ioremap(unsigned long phys, unsigned long size,
+extern void __iomem *sun3_ioremap(unsigned long phys, unsigned long size,
                          unsigned long type);
 
 extern int sun3_map_test(unsigned long addr, char *val);
index 9ab59e2bb23368530fa67c95af0d6ab2c4f7fe8f..e3c9925876a3ce4eb80ec67937362cd7d014ad2f 100644 (file)
@@ -55,24 +55,13 @@ extern void (*flush_icache_range)(unsigned long start, unsigned long end);
 #define flush_cache_vmap(start, end)           flush_cache_all()
 #define flush_cache_vunmap(start, end)         flush_cache_all()
 
-static inline void copy_to_user_page(struct vm_area_struct *vma,
+extern void copy_to_user_page(struct vm_area_struct *vma,
        struct page *page, unsigned long vaddr, void *dst, const void *src,
-       unsigned long len)
-{
-       if (cpu_has_dc_aliases)
-               flush_cache_page(vma, vaddr, page_to_pfn(page));
-       memcpy(dst, src, len);
-       __flush_icache_page(vma, page);
-}
+       unsigned long len);
 
-static inline void copy_from_user_page(struct vm_area_struct *vma,
+extern void copy_from_user_page(struct vm_area_struct *vma,
        struct page *page, unsigned long vaddr, void *dst, const void *src,
-       unsigned long len)
-{
-       if (cpu_has_dc_aliases)
-               flush_cache_page(vma, vaddr, page_to_pfn(page));
-       memcpy(dst, src, len);
-}
+       unsigned long len);
 
 extern void (*flush_cache_sigtramp)(unsigned long addr);
 extern void (*flush_icache_all)(void);
index 6959bdb59310b096ec7797e0a31c78fde5aa9afc..02c8a13fc894838b27336ae42fbb542f87132e01 100644 (file)
  * fix-mapped?
  */
 enum fixed_addresses {
+#define FIX_N_COLOURS 8
+       FIX_CMAP_BEGIN,
+#ifdef CONFIG_MIPS_MT_SMTC
+       FIX_CMAP_END = FIX_CMAP_BEGIN + (FIX_N_COLOURS * NR_CPUS),
+#else
+       FIX_CMAP_END = FIX_CMAP_BEGIN + FIX_N_COLOURS,
+#endif
 #ifdef CONFIG_HIGHMEM
-       FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */
+       /* reserved pte's for temporary kernel mappings */
+       FIX_KMAP_BEGIN = FIX_CMAP_END + 1,
        FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1,
 #endif
        __end_of_fixed_addresses
@@ -70,9 +78,9 @@ extern void __set_fixmap (enum fixed_addresses idx,
  * at the top of mem..
  */
 #if defined(CONFIG_CPU_TX39XX) || defined(CONFIG_CPU_TX49XX)
-#define FIXADDR_TOP    (0xff000000UL - 0x2000)
+#define FIXADDR_TOP    ((unsigned long)(long)(int)(0xff000000 - 0x20000))
 #else
-#define FIXADDR_TOP    (0xffffe000UL)
+#define FIXADDR_TOP    ((unsigned long)(long)(int)0xfffe0000)
 #endif
 #define FIXADDR_SIZE   (__end_of_fixed_addresses << PAGE_SHIFT)
 #define FIXADDR_START  (FIXADDR_TOP - FIXADDR_SIZE)
index c2d124badbe566cfc08e1c76a754709ab1d6ec9a..bc5f3c53155f2983b9d31b7e6cfd77e103290175 100644 (file)
@@ -172,7 +172,7 @@ extern unsigned long isa_slot_offset;
 #define page_to_phys(page)     ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT)
 
 extern void __iomem * __ioremap(phys_t offset, phys_t size, unsigned long flags);
-extern void __iounmap(volatile void __iomem *addr);
+extern void __iounmap(const volatile void __iomem *addr);
 
 static inline void __iomem * __ioremap_mode(phys_t offset, unsigned long size,
        unsigned long flags)
@@ -279,7 +279,7 @@ static inline void __iomem * __ioremap_mode(phys_t offset, unsigned long size,
 #define ioremap_uncached_accelerated(offset, size)                     \
        __ioremap_mode((offset), (size), _CACHE_UNCACHED_ACCELERATED)
 
-static inline void iounmap(volatile void __iomem *addr)
+static inline void iounmap(const volatile void __iomem *addr)
 {
 #define __IS_KSEG1(addr) (((unsigned long)(addr) & ~0x1fffffffUL) == CKSEG1)
 
index 685c91467e6347527567f5aa78198226ea236514..30240a445dbbf3ff72f0d54ed6f6b1904f2eb330 100644 (file)
 #define __NR_move_pages                        (__NR_Linux + 308)
 #define __NR_set_robust_list           (__NR_Linux + 309)
 #define __NR_get_robust_list           (__NR_Linux + 310)
+#define __NR_kexec_load                        (__NR_Linux + 311)
 
 /*
  * Offset of the last Linux o32 flavoured syscall
  */
-#define __NR_Linux_syscalls            310
+#define __NR_Linux_syscalls            311
 
 #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
 
 #define __NR_O32_Linux                 4000
-#define __NR_O32_Linux_syscalls                310
+#define __NR_O32_Linux_syscalls                311
 
 #if _MIPS_SIM == _MIPS_SIM_ABI64
 
 #define __NR_move_pages                        (__NR_Linux + 267)
 #define __NR_set_robust_list           (__NR_Linux + 268)
 #define __NR_get_robust_list           (__NR_Linux + 269)
+#define __NR_kexec_load                        (__NR_Linux + 270)
 
 /*
  * Offset of the last Linux 64-bit flavoured syscall
  */
-#define __NR_Linux_syscalls            269
+#define __NR_Linux_syscalls            270
 
 #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
 
 #define __NR_64_Linux                  5000
-#define __NR_64_Linux_syscalls         269
+#define __NR_64_Linux_syscalls         270
 
 #if _MIPS_SIM == _MIPS_SIM_NABI32
 
 #define __NR_move_pages                        (__NR_Linux + 271)
 #define __NR_set_robust_list           (__NR_Linux + 272)
 #define __NR_get_robust_list           (__NR_Linux + 273)
+#define __NR_kexec_load                        (__NR_Linux + 274)
 
 /*
  * Offset of the last N32 flavoured syscall
  */
-#define __NR_Linux_syscalls            273
+#define __NR_Linux_syscalls            274
 
 #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
 
 #define __NR_N32_Linux                 6000
-#define __NR_N32_Linux_syscalls                273
+#define __NR_N32_Linux_syscalls                274
 
 #ifdef __KERNEL__
 
index dd3eb3dc5886691f73376a314df85369046c9484..88b492f6ea9c4481e791bcf2c03f6f163d936e6d 100644 (file)
@@ -75,7 +75,7 @@ extern void vr41xx_mask_clock(vr41xx_clock_t clock);
  * Interrupt Control Unit
  */
 extern int vr41xx_set_intassign(unsigned int irq, unsigned char intassign);
-extern int cascade_irq(unsigned int irq, int (*get_irq)(unsigned int, struct pt_regs *));
+extern int cascade_irq(unsigned int irq, int (*get_irq)(unsigned int));
 
 #define PIUINT_COMMAND         0x0040
 #define PIUINT_DATA            0x0020
index 519f0a5ff18122ab4d4be74fbdeacb4841ab3799..36bb6dacf00840d64836adbb9405ca77a3bcad7c 100644 (file)
@@ -200,18 +200,45 @@ extern char empty_zero_page[PAGE_SIZE];
  */
 
 /* Hardware bits in the page table entry */
-#define _PAGE_RO        0x200          /* HW read-only                     */
-#define _PAGE_INVALID   0x400          /* HW invalid                       */
+#define _PAGE_RO       0x200           /* HW read-only bit  */
+#define _PAGE_INVALID  0x400           /* HW invalid bit    */
+#define _PAGE_SWT      0x001           /* SW pte type bit t */
+#define _PAGE_SWX      0x002           /* SW pte type bit x */
 
-/* Mask and six different types of pages. */
-#define _PAGE_TYPE_MASK                0x601
+/* Six different types of pages. */
 #define _PAGE_TYPE_EMPTY       0x400
 #define _PAGE_TYPE_NONE                0x401
-#define _PAGE_TYPE_SWAP                0x600
-#define _PAGE_TYPE_FILE                0x601
+#define _PAGE_TYPE_SWAP                0x403
+#define _PAGE_TYPE_FILE                0x601   /* bit 0x002 is used for offset !! */
 #define _PAGE_TYPE_RO          0x200
 #define _PAGE_TYPE_RW          0x000
 
+/*
+ * PTE type bits are rather complicated. handle_pte_fault uses pte_present,
+ * pte_none and pte_file to find out the pte type WITHOUT holding the page
+ * table lock. ptep_clear_flush on the other hand uses ptep_clear_flush to
+ * invalidate a given pte. ipte sets the hw invalid bit and clears all tlbs
+ * for the page. The page table entry is set to _PAGE_TYPE_EMPTY afterwards.
+ * This change is done while holding the lock, but the intermediate step
+ * of a previously valid pte with the hw invalid bit set can be observed by
+ * handle_pte_fault. That makes it necessary that all valid pte types with
+ * the hw invalid bit set must be distinguishable from the four pte types
+ * empty, none, swap and file.
+ *
+ *                     irxt  ipte  irxt
+ * _PAGE_TYPE_EMPTY    1000   ->   1000
+ * _PAGE_TYPE_NONE     1001   ->   1001
+ * _PAGE_TYPE_SWAP     1011   ->   1011
+ * _PAGE_TYPE_FILE     11?1   ->   11?1
+ * _PAGE_TYPE_RO       0100   ->   1100
+ * _PAGE_TYPE_RW       0000   ->   1000
+ *
+ * pte_none is true for bits combinations 1000, 1100
+ * pte_present is true for bits combinations 0000, 0010, 0100, 0110, 1001
+ * pte_file is true for bits combinations 1101, 1111
+ * swap pte is 1011 and 0001, 0011, 0101, 0111, 1010 and 1110 are invalid.
+ */
+
 #ifndef __s390x__
 
 /* Bits in the segment table entry */
@@ -365,18 +392,21 @@ static inline int pmd_bad(pmd_t pmd)
 
 static inline int pte_none(pte_t pte)
 {
-       return (pte_val(pte) & _PAGE_TYPE_MASK) == _PAGE_TYPE_EMPTY;
+       return (pte_val(pte) & _PAGE_INVALID) && !(pte_val(pte) & _PAGE_SWT);
 }
 
 static inline int pte_present(pte_t pte)
 {
-       return !(pte_val(pte) & _PAGE_INVALID) ||
-               (pte_val(pte) & _PAGE_TYPE_MASK) == _PAGE_TYPE_NONE;
+       unsigned long mask = _PAGE_RO | _PAGE_INVALID | _PAGE_SWT | _PAGE_SWX;
+       return (pte_val(pte) & mask) == _PAGE_TYPE_NONE ||
+               (!(pte_val(pte) & _PAGE_INVALID) &&
+                !(pte_val(pte) & _PAGE_SWT));
 }
 
 static inline int pte_file(pte_t pte)
 {
-       return (pte_val(pte) & _PAGE_TYPE_MASK) == _PAGE_TYPE_FILE;
+       unsigned long mask = _PAGE_RO | _PAGE_INVALID | _PAGE_SWT;
+       return (pte_val(pte) & mask) == _PAGE_TYPE_FILE;
 }
 
 #define pte_same(a,b)  (pte_val(a) == pte_val(b))
index a19238cbcffa7ed1aacbfcd9e06bbe141425e783..71d3c21b84f0a4169202680053c3f51cb028ec74 100644 (file)
 #define __NR_vmsplice          309
 /* Number 310 is reserved for new sys_move_pages */
 #define __NR_getcpu            311
+#define __NR_epoll_pwait       312
 
-#define NR_syscalls 312
+#define NR_syscalls 313
 
 /* 
  * There are some system calls that are not present on 64 bit, some
diff --git a/include/asm-sh/hp6xx/ide.h b/include/asm-sh/hp6xx/ide.h
deleted file mode 100644 (file)
index 570395a..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __ASM_SH_HP6XX_IDE_H
-#define __ASM_SH_HP6XX_IDE_H
-
-#define IRQ_CFCARD     93
-#define IRQ_PCMCIA     94
-
-#endif /* __ASM_SH_HP6XX_IDE_H */
-
diff --git a/include/asm-sh/hp6xx/io.h b/include/asm-sh/hp6xx/io.h
deleted file mode 100644 (file)
index 2044476..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef __ASM_SH_HP6XX_IO_H
-#define __ASM_SH_HP6XX_IO_H
-
-/*
- * Nothing special here.. just use the generic cchip io routines.
- */
-#include <asm/hd64461.h>
-
-#endif /* __ASM_SH_HP6XX_IO_H */
-
diff --git a/include/asm-sh/hs7751rvoip/ide.h b/include/asm-sh/hs7751rvoip/ide.h
deleted file mode 100644 (file)
index 65ad1d0..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __ASM_SH_HS7751RVOIP_IDE_H
-#define __ASM_SH_HS7751RVOIP_IDE_H
-
-/* Nothing to see here.. */
-#include <asm/hs7751rvoip/hs7751rvoip.h>
-
-#endif /* __ASM_SH_HS7751RVOIP_IDE_H */
-
index 895c5780e45473150ad02217a860e254b7fac648..19912ae6a7f720fae3d7327649b1fe0015b681f6 100644 (file)
@@ -6,16 +6,6 @@
  *
  * Copyright (C) 2004 Takashi SHUDO <shudo@hitachi-ul.co.jp>
  */
-
-#ifdef CONFIG_IDE
-# ifndef IRQ_CFCARD
-#  define IRQ_CFCARD   14
-# endif
-# ifndef IRQ_PCMCIA
-#  define IRQ_PCMCIA   15
-# endif
-#endif
-
 #define INTC_BASE      0xffd00000
 #define INTC_ICR0      (INTC_BASE+0x0)
 #define INTC_ICR1      (INTC_BASE+0x1c)
index 28996f9c58ccf81ff1c74d7b3e232869cd564c00..7596ab83e0d4dcb5136fda0483c83a1af90e846f 100644 (file)
 #include <asm/machvec.h>
 #include <asm/ptrace.h>                /* for pt_regs */
 
-#if defined(CONFIG_SH_HP6XX) || \
-    defined(CONFIG_SH_RTS7751R2D) || \
-    defined(CONFIG_SH_HS7751RVOIP) || \
-    defined(CONFIG_SH_HS7751RVOIP) || \
-    defined(CONFIG_SH_SH03) || \
-    defined(CONFIG_SH_R7780RP) || \
-    defined(CONFIG_SH_LANDISK)
-#include <asm/mach/ide.h>
-#endif
-
 #ifndef CONFIG_CPU_SUBTYPE_SH7780
 
 #define INTC_DMAC0_MSK 0
 #define INTC_IPRD      0xffd00010UL
 #endif
 
-#ifdef CONFIG_IDE
-# ifndef IRQ_CFCARD
-#  define IRQ_CFCARD   14
-# endif
-# ifndef IRQ_PCMCIA
-#  define IRQ_PCMCIA   15
-# endif
-#endif
-
 #define TIMER_IRQ      16
 #define TIMER_IPR_ADDR INTC_IPRA
 #define TIMER_IPR_POS   3
@@ -704,7 +685,7 @@ struct intc2_data {
        unsigned char priority;
 };
 
-void make_intc2_irq(struct intc2_data *);
+void make_intc2_irq(struct intc2_data *, unsigned int nr_irqs);
 void init_IRQ_intc2(void);
 #endif
 
diff --git a/include/asm-sh/landisk/ide.h b/include/asm-sh/landisk/ide.h
deleted file mode 100644 (file)
index 6490e28..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * modifed by kogiidena
- * 2005.03.03
- */
-
-#ifndef __ASM_SH_LANDISK_IDE_H
-#define __ASM_SH_LANDISK_IDE_H
-
-/* Nothing to see here.. */
-#include <asm/landisk/iodata_landisk.h>
-#define IRQ_CFCARD     IRQ_FATA        /* CF Card IRQ */
-#define IRQ_PCMCIA     IRQ_ATA         /* PCMCIA IRQ */
-
-#endif /* __ASM_SH_LANDISK_IDE_H  */
index 474773853cd1a71f3184d85daf62468f3cfc2de0..45bb74e35d325acbbccc4607528ea2c4e07d0a59 100644 (file)
@@ -255,6 +255,8 @@ extern void save_fpu(struct task_struct *__tsk, struct pt_regs *regs);
  */
 #define thread_saved_pc(tsk)   (tsk->thread.pc)
 
+void show_trace(struct task_struct *tsk, unsigned long *sp,
+               struct pt_regs *regs);
 extern unsigned long get_wchan(struct task_struct *p);
 
 #define KSTK_EIP(tsk)  ((tsk)->thread.pc)
similarity index 96%
rename from include/asm-sh/r7780rp/r7780rp.h
rename to include/asm-sh/r7780rp.h
index f95d9dba31a2fe1c4d509f0dd8838669e0e84ab5..c18f648a799549105a01c75981baa808c004657a 100644 (file)
@@ -72,8 +72,6 @@
 
 #define PA_AX88796L     0xa4100400      /* AX88796L Area */
 #define PA_SC1602BSLB   0xa6000000      /* SC1602BSLB Area */
-#define PA_AREA5_IO     0xb4000000      /* Area 5 IO Memory */
-#define PA_AREA6_IO     0xb8000000      /* Area 6 IO Memory */
 #define PA_IDE_OFFSET   0x1f0           /* CF IDE Offset */
 #define AX88796L_IO_BASE        0x1000  /* AX88796L IO Base Address */
 
@@ -83,7 +81,6 @@
 #define IRQ_PCISLOT2    66              /* PCI Slot #2 IRQ */
 #define IRQ_PCISLOT3    67              /* PCI Slot #3 IRQ */
 #define IRQ_PCISLOT4    68              /* PCI Slot #4 IRQ */
-#define IRQ_CFCARD      1               /* CF Card IRQ */
 // #define IRQ_CFINST   0               /* CF Card Insert IRQ */
 #define IRQ_TP          2               /* Touch Panel IRQ */
 #define IRQ_SCI1        3               /* SCI1 IRQ */
 
 #define PA_AX88796L    0xa5800400      /* AX88796L Area */
 #define PA_SC1602BSLB  0xa6000000      /* SC1602BSLB Area */
-#define PA_AREA5_IO    0xb4000000      /* Area 5 IO Memory */
-#define PA_AREA6_IO    0xb8000000      /* Area 6 IO Memory */
 #define PA_IDE_OFFSET  0x1f0           /* CF IDE Offset */
 #define AX88796L_IO_BASE       0x1000  /* AX88796L IO Base Address */
 
 #define IRQ_PCISLOT2   1               /* PCI Slot #2 IRQ */
 #define IRQ_PCISLOT3   2               /* PCI Slot #3 IRQ */
 #define IRQ_PCISLOT4   3               /* PCI Slot #4 IRQ */
-#define IRQ_CFCARD     4               /* CF Card IRQ */
 #define IRQ_CFINST     5               /* CF Card Insert IRQ */
 #define IRQ_M66596     6               /* M66596 IRQ */
 #define IRQ_SDCARD     7               /* SD Card IRQ */
diff --git a/include/asm-sh/r7780rp/ide.h b/include/asm-sh/r7780rp/ide.h
deleted file mode 100644 (file)
index a1ed78e..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __ASM_SH_R7780RP_IDE_H
-#define __ASM_SH_R7780RP_IDE_H
-
-/* Nothing to see here.. */
-#include <asm/mach/r7780rp.h>
-
-#endif /* __ASM_SH_R7780RP_IDE_H */
-
diff --git a/include/asm-sh/rts7751r2d/ide.h b/include/asm-sh/rts7751r2d/ide.h
deleted file mode 100644 (file)
index 416f96b..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __ASM_SH_RTS7751R2D_IDE_H
-#define __ASM_SH_RTS7751R2D_IDE_H
-
-/* Nothing to see here.. */
-#include <asm/rts7751r2d/rts7751r2d.h>
-
-#endif /* __ASM_SH_RTS7751R2D_IDE_H */
-
diff --git a/include/asm-sh/sh03/ide.h b/include/asm-sh/sh03/ide.h
deleted file mode 100644 (file)
index 73ee92e..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef __ASM_SH_SH03_IDE_H
-#define __ASM_SH_SH03_IDE_H
-
-#define IRQ_CFCARD     8
-#define IRQ_PCMCIA     8
-
-#endif /* __ASM_SH_SH03_IDE_H */
index 6c1f8fde5ac4a8e6a73c6d5059491db8c7e56554..3340126f4e0fc7785cef0ed7e4c191583fdc6e35 100644 (file)
@@ -353,6 +353,13 @@ static inline unsigned long __cmpxchg(volatile void * ptr, unsigned long old,
                                    (unsigned long)_n_, sizeof(*(ptr))); \
   })
 
+extern void *set_exception_table_vec(unsigned int vec, void *handler);
+
+static inline void *set_exception_table_evt(unsigned int evt, void *handler)
+{
+       return set_exception_table_vec(evt >> 5, handler);
+}
+
 /* XXX
  * disable hlt during certain critical i/o operations
  */
index 83a3dd15a6edffa502634290d3d3b4d910bf85de..aaf6ef40ee2fc12142794a5bd651fc1c91dd3981 100644 (file)
@@ -8,11 +8,6 @@
 
 #include <asm/ptrace.h>
 
-#ifdef __KERNEL__
-#include <asm/mbus.h>
-#include <asm/uaccess.h>
-#endif
-
 /*
  * Sparc section types
  */
@@ -77,6 +72,23 @@ typedef unsigned long elf_greg_t;
 #define ELF_NGREG 38
 typedef elf_greg_t elf_gregset_t[ELF_NGREG];
 
+typedef struct {
+       union {
+               unsigned long   pr_regs[32];
+               double          pr_dregs[16];
+       } pr_fr;
+       unsigned long __unused;
+       unsigned long   pr_fsr;
+       unsigned char   pr_qcnt;
+       unsigned char   pr_q_entrysize;
+       unsigned char   pr_en;
+       unsigned int    pr_q[64];
+} elf_fpregset_t;
+
+#ifdef __KERNEL__
+#include <asm/mbus.h>
+#include <asm/uaccess.h>
+
 /* Format is:
  *     G0 --> G7
  *     O0 --> O7
@@ -99,20 +111,7 @@ do {        unsigned long *dest = &(__elf_regs[0]);         \
        dest[34] = src->npc;                            \
        dest[35] = src->y;                              \
        dest[36] = dest[37] = 0; /* XXX */              \
-} while(0); /* Janitors: Don't touch this colon. */
-
-typedef struct {
-       union {
-               unsigned long   pr_regs[32];
-               double          pr_dregs[16];
-       } pr_fr;
-       unsigned long __unused;
-       unsigned long   pr_fsr;
-       unsigned char   pr_qcnt;
-       unsigned char   pr_q_entrysize;
-       unsigned char   pr_en;
-       unsigned int    pr_q[64];
-} elf_fpregset_t;
+} while(0); /* Janitors: Don't touch this semicolon. */
 
 #define ELF_CORE_COPY_TASK_REGS(__tsk, __elf_regs)     \
        ({ ELF_CORE_COPY_REGS((*(__elf_regs)), (__tsk)->thread.kregs); 1; })
@@ -165,8 +164,8 @@ typedef struct {
 
 #define ELF_PLATFORM   (NULL)
 
-#ifdef __KERNEL__
 #define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX)
-#endif
+
+#endif /* __KERNEL__ */
 
 #endif /* !(__ASMSPARC_ELF_H) */
index c73935dc7ba11c8e800b79596d6ae27e3431fd30..36511ca514165b4307033de76e7b09db646509c1 100644 (file)
@@ -164,7 +164,7 @@ static inline compat_uptr_t ptr_to_compat(void __user *uptr)
        return (u32)(unsigned long)uptr;
 }
 
-static __inline__ void __user *compat_alloc_user_space(long len)
+static inline void __user *compat_alloc_user_space(long len)
 {
        struct pt_regs *regs = current_thread_info()->kregs;
        unsigned long usp = regs->u_regs[UREG_I6];
@@ -174,7 +174,10 @@ static __inline__ void __user *compat_alloc_user_space(long len)
        else
                usp &= 0xffffffffUL;
 
-       return (void __user *) (usp - len);
+       usp -= len;
+       usp &= ~0x7UL;
+
+       return (void __user *) usp;
 }
 
 struct compat_ipc64_perm {
index 172cd6ffacc4a28c5eceb9b40b97dc86d3019d38..4269d8a37b4f201adffc9788483458943a778091 100644 (file)
@@ -1,15 +1,6 @@
 #ifndef __UM_ARCHPARAM_PPC_H
 #define __UM_ARCHPARAM_PPC_H
 
-/********* Bits for asm-um/hw_irq.h **********/
-
-struct hw_interrupt_type;
-
-/********* Bits for asm-um/hardirq.h **********/
-
-#define irq_enter(cpu, irq) hardirq_enter(cpu)
-#define irq_exit(cpu, irq) hardirq_exit(cpu)
-
 /********* Bits for asm-um/string.h **********/
 
 #define __HAVE_ARCH_STRRCHR
index 6899e770b173e4a2cb75fdd5bc664359cdf0fa7b..0555c1c4d8fa9fcda13c280997c076decc85d708 100644 (file)
@@ -366,6 +366,7 @@ static inline pte_t mk_pte_phys(unsigned long physpage, pgprot_t pgprot)
 { 
        pte_t pte;
        pte_val(pte) = physpage | pgprot_val(pgprot); 
+       pte_val(pte) &= __supported_pte_mask;
        return pte; 
 }
  
index de9c3147ee4c3dddb639210dc17a9b74b406a040..cef17e0f828cc5d0080cf967d11e80a228f4d18b 100644 (file)
@@ -475,6 +475,8 @@ static inline void __mwait(unsigned long eax, unsigned long ecx)
                : :"a" (eax), "c" (ecx));
 }
 
+extern void mwait_idle_with_hints(unsigned long eax, unsigned long ecx);
+
 #define stack_current() \
 ({                                                             \
        struct thread_info *ti;                                 \
index c181fef786e43adcd4b114fa9922aa6a725ff2b9..e72cfcdf53448d262ce0b549de267ae470f8ebe1 100644 (file)
@@ -122,6 +122,8 @@ extern int fix_aperture;
 extern int reboot_force;
 extern int notsc_setup(char *);
 
+extern int timer_over_8254;
+
 extern int gsi_irq_sharing(int gsi);
 
 extern void smp_local_timer_interrupt(void);
index 5114ff18101daee2fa78c13efab980cfaef09326..a1155a2beb32bb46dd3fc6ce66262c53a87c17f8 100644 (file)
@@ -120,6 +120,7 @@ header-y += netrom.h
 header-y += nfs2.h
 header-y += nfs4_mount.h
 header-y += nfs_mount.h
+header-y += oom.h
 header-y += param.h
 header-y += pci_ids.h
 header-y += pci_regs.h
index 88b5dfd8ee125be2c3a025c7ea1e03183eaccbe4..2b0c955590fec1dacf875c4e0dd21d4bc0269c5e 100644 (file)
@@ -494,6 +494,9 @@ void acpi_pci_unregister_driver(struct acpi_pci_driver *driver);
 
 extern int ec_read(u8 addr, u8 *val);
 extern int ec_write(u8 addr, u8 val);
+extern int ec_transaction(u8 command,
+                          const u8 *wdata, unsigned wdata_len,
+                          u8 *rdata, unsigned rdata_len);
 
 #endif /*CONFIG_ACPI_EC*/
 
index f7a1390d67f5b39da938c6be93c80cf0cd66fcf2..7011d6255593dda940f859ab02e89e505d1a57ae 100644 (file)
@@ -10,6 +10,8 @@
 
 #include <asm/atomic.h>
 
+struct page;
+
 /*
  * Bits in backing_dev_info.state
  */
@@ -88,6 +90,11 @@ static inline int bdi_rw_congested(struct backing_dev_info *bdi)
                                  (1 << BDI_write_congested));
 }
 
+void clear_bdi_congested(struct backing_dev_info *bdi, int rw);
+void set_bdi_congested(struct backing_dev_info *bdi, int rw);
+long congestion_wait(int rw, long timeout);
+void congestion_end(int rw);
+
 #define bdi_cap_writeback_dirty(bdi) \
        (!((bdi)->capabilities & BDI_CAP_NO_WRITEBACK))
 
index d370d2cfe13803ed79626e90194e270cc0c6c169..7bfcde2d557833935eab407e048c1763d194c4fd 100644 (file)
@@ -651,6 +651,26 @@ extern void blk_recount_segments(request_queue_t *, struct bio *);
 extern int scsi_cmd_ioctl(struct file *, struct gendisk *, unsigned int, void __user *);
 extern int sg_scsi_ioctl(struct file *, struct request_queue *,
                struct gendisk *, struct scsi_ioctl_command __user *);
+
+/*
+ * A queue has just exitted congestion.  Note this in the global counter of
+ * congested queues, and wake up anyone who was waiting for requests to be
+ * put back.
+ */
+static inline void blk_clear_queue_congested(request_queue_t *q, int rw)
+{
+       clear_bdi_congested(&q->backing_dev_info, rw);
+}
+
+/*
+ * A queue has just entered congestion.  Flag that in the queue's VM-visible
+ * state flags and increment the global gounter of congested queues.
+ */
+static inline void blk_set_queue_congested(request_queue_t *q, int rw)
+{
+       set_bdi_congested(&q->backing_dev_info, rw);
+}
+
 extern void blk_start_queue(request_queue_t *q);
 extern void blk_stop_queue(request_queue_t *q);
 extern void blk_sync_queue(struct request_queue *q);
@@ -765,10 +785,8 @@ extern int blk_queue_init_tags(request_queue_t *, int, struct blk_queue_tag *);
 extern void blk_queue_free_tags(request_queue_t *);
 extern int blk_queue_resize_tags(request_queue_t *, int);
 extern void blk_queue_invalidate_tags(request_queue_t *);
-extern long blk_congestion_wait(int rw, long timeout);
 extern struct blk_queue_tag *blk_init_tags(int);
 extern void blk_free_tags(struct blk_queue_tag *);
-extern void blk_congestion_end(int rw);
 
 static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt,
                                                int tag)
index 131ffd37e716fb7ac4a386eaea9ff58c26bf639d..5d9fb0e94156235eca46e199352933fc638b9596 100644 (file)
@@ -69,6 +69,8 @@ struct buffer_head {
        bh_end_io_t *b_end_io;          /* I/O completion */
        void *b_private;                /* reserved for b_end_io */
        struct list_head b_assoc_buffers; /* associated with another mapping */
+       struct address_space *b_assoc_map;      /* mapping this buffer is
+                                                  associated with */
        atomic_t b_count;               /* users using this buffer_head */
 };
 
index cfdb4f6a89d4a0edd2aa5ec65cf88ec88787eb13..c26c3adcfacff0aa9231d527daf75d0f2fc09336 100644 (file)
@@ -131,6 +131,7 @@ COMPATIBLE_IOCTL(RUN_ARRAY)
 COMPATIBLE_IOCTL(STOP_ARRAY)
 COMPATIBLE_IOCTL(STOP_ARRAY_RO)
 COMPATIBLE_IOCTL(RESTART_ARRAY_RW)
+COMPATIBLE_IOCTL(GET_BITMAP_FILE)
 ULONG_IOCTL(SET_BITMAP_FILE)
 /* DM */
 COMPATIBLE_IOCTL(DM_VERSION_32)
index 38dc403be70b5bc4f49aee4132ba7ea85ca61399..904bf3d2d90bb068bc3837dfc40bf45e65cdddb6 100644 (file)
@@ -69,6 +69,7 @@ extern struct dmi_device * dmi_find_device(int type, const char *name,
        struct dmi_device *from);
 extern void dmi_scan_machine(void);
 extern int dmi_get_year(int field);
+extern int dmi_name_in_vendors(char *str);
 
 #else
 
@@ -77,6 +78,7 @@ static inline char * dmi_get_system_info(int field) { return NULL; }
 static inline struct dmi_device * dmi_find_device(int type, const char *name,
        struct dmi_device *from) { return NULL; }
 static inline int dmi_get_year(int year) { return 0; }
+static inline int dmi_name_in_vendors(char *s) { return 0; }
 
 #endif
 
index 34406ed467c352c4ac4ad67b490c0729107c967d..2fe6e3f900ba5fd06a64754c809f9e724382f39e 100644 (file)
@@ -623,6 +623,9 @@ enum inode_i_mutex_lock_class
        I_MUTEX_QUOTA
 };
 
+extern void inode_double_lock(struct inode *inode1, struct inode *inode2);
+extern void inode_double_unlock(struct inode *inode1, struct inode *inode2);
+
 /*
  * NOTE: in a 32bit arch with a preemptable kernel and
  * an UP compile the i_size_read/write must be atomic
@@ -656,7 +659,11 @@ static inline loff_t i_size_read(struct inode *inode)
 #endif
 }
 
-
+/*
+ * NOTE: unlike i_size_read(), i_size_write() does need locking around it
+ * (normally i_mutex), otherwise on 32bit/SMP an update of i_size_seqcount
+ * can be lost, resulting in subsequent i_size_read() calls spinning forever.
+ */
 static inline void i_size_write(struct inode *inode, loff_t i_size)
 {
 #if BITS_PER_LONG==32 && defined(CONFIG_SMP)
@@ -1705,6 +1712,8 @@ extern void __iget(struct inode * inode);
 extern void clear_inode(struct inode *);
 extern void destroy_inode(struct inode *);
 extern struct inode *new_inode(struct super_block *);
+extern int __remove_suid(struct dentry *, int);
+extern int should_remove_suid(struct dentry *);
 extern int remove_suid(struct dentry *);
 extern void remove_dquot_ref(struct super_block *, int, struct list_head *);
 
@@ -1751,6 +1760,8 @@ extern ssize_t generic_file_splice_read(struct file *, loff_t *,
                struct pipe_inode_info *, size_t, unsigned int);
 extern ssize_t generic_file_splice_write(struct pipe_inode_info *,
                struct file *, loff_t *, size_t, unsigned int);
+extern ssize_t generic_file_splice_write_nolock(struct pipe_inode_info *,
+               struct file *, loff_t *, size_t, unsigned int);
 extern ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe,
                struct file *out, loff_t *, size_t len, unsigned int flags);
 extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out,
index c64f3cc7e870050bc3acc3b84c684293829b1b87..52fc4052a0ae62d113fe1a7eef6692d8d93bf645 100644 (file)
@@ -141,6 +141,7 @@ struct irq_chip {
  * @pending_mask:      pending rebalanced interrupts
  * @dir:               /proc/irq/ procfs entry
  * @affinity_entry:    /proc/irq/smp_affinity procfs entry on SMP
+ * @name:              flow handler name for /proc/interrupts output
  *
  * Pad this out to 32 bytes for cache and indexing reasons.
  */
@@ -165,8 +166,9 @@ struct irq_desc {
        cpumask_t               pending_mask;
 #endif
 #ifdef CONFIG_PROC_FS
-       struct proc_dir_entry *dir;
+       struct proc_dir_entry   *dir;
 #endif
+       const char              *name;
 } ____cacheline_aligned;
 
 extern struct irq_desc irq_desc[NR_IRQS];
@@ -271,12 +273,6 @@ extern void fastcall handle_simple_irq(unsigned int irq, struct irq_desc *desc);
 extern void fastcall handle_percpu_irq(unsigned int irq, struct irq_desc *desc);
 extern void fastcall handle_bad_irq(unsigned int irq, struct irq_desc *desc);
 
-/*
- * Get a descriptive string for the highlevel handler, for
- * /proc/interrupts output:
- */
-extern const char *handle_irq_name(irq_flow_handler_t handle);
-
 /*
  * Monolithic do_IRQ implementation.
  * (is an explicit fastcall, because i386 4KSTACKS calls it from assembly)
@@ -329,7 +325,12 @@ extern void
 set_irq_chip_and_handler(unsigned int irq, struct irq_chip *chip,
                         irq_flow_handler_t handle);
 extern void
-__set_irq_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained);
+set_irq_chip_and_handler_name(unsigned int irq, struct irq_chip *chip,
+                             irq_flow_handler_t handle, const char *name);
+
+extern void
+__set_irq_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained,
+                 const char *name);
 
 /*
  * Set a highlevel flow handler for a given IRQ:
@@ -337,7 +338,7 @@ __set_irq_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained);
 static inline void
 set_irq_handler(unsigned int irq, irq_flow_handler_t handle)
 {
-       __set_irq_handler(irq, handle, 0);
+       __set_irq_handler(irq, handle, 0, NULL);
 }
 
 /*
@@ -349,7 +350,7 @@ static inline void
 set_irq_chained_handler(unsigned int irq,
                        irq_flow_handler_t handle)
 {
-       __set_irq_handler(irq, handle, 1);
+       __set_irq_handler(irq, handle, 1, NULL);
 }
 
 /* Handle dynamic irq creation and destruction */
index d0a7ad5ed518d3f6d314c4fede714676def3a26b..b03d5a340dc810723368d1cc4fbf73b703e9628d 100644 (file)
@@ -143,7 +143,7 @@ enum {
        ATA_DFLAG_CFG_MASK      = (1 << 8) - 1,
 
        ATA_DFLAG_PIO           = (1 << 8), /* device limited to PIO mode */
-       ATA_DFLAG_NCQ_OFF       = (1 << 9), /* devied limited to non-NCQ mode */
+       ATA_DFLAG_NCQ_OFF       = (1 << 9), /* device limited to non-NCQ mode */
        ATA_DFLAG_SUSPENDED     = (1 << 10), /* device suspended */
        ATA_DFLAG_INIT_MASK     = (1 << 16) - 1,
 
index 81e3a185f9515ada07ef16bef6b94a619e9196f6..aa50d89eacd77abb748ad7a892f20575b7c4b1bb 100644 (file)
 #define LINUX_LOCKD_BIND_H
 
 #include <linux/lockd/nlm.h>
+/* need xdr-encoded error codes too, so... */
+#include <linux/lockd/xdr.h>
+#ifdef CONFIG_LOCKD_V4
+#include <linux/lockd/xdr4.h>
+#endif
 
 /* Dummy declarations */
 struct svc_rqst;
index 2909619c029589b5f74d86e236f12682cc4946f0..862d9730a60dd4e4b4de43d60363c4434b11f94a 100644 (file)
@@ -154,7 +154,7 @@ int           nlm_async_reply(struct nlm_rqst *, u32, const struct rpc_call_ops *);
 struct nlm_wait * nlmclnt_prepare_block(struct nlm_host *host, struct file_lock *fl);
 void             nlmclnt_finish_block(struct nlm_wait *block);
 int              nlmclnt_block(struct nlm_wait *block, struct nlm_rqst *req, long timeout);
-u32              nlmclnt_grant(const struct sockaddr_in *addr, const struct nlm_lock *);
+__be32           nlmclnt_grant(const struct sockaddr_in *addr, const struct nlm_lock *);
 void             nlmclnt_recovery(struct nlm_host *);
 int              nlmclnt_reclaim(struct nlm_host *, struct file_lock *);
 void             nlmclnt_next_cookie(struct nlm_cookie *);
@@ -184,12 +184,12 @@ typedef int         (*nlm_host_match_fn_t)(struct nlm_host *cur, struct nlm_host *ref)
 /*
  * Server-side lock handling
  */
-u32              nlmsvc_lock(struct svc_rqst *, struct nlm_file *,
+__be32           nlmsvc_lock(struct svc_rqst *, struct nlm_file *,
                                        struct nlm_lock *, int, struct nlm_cookie *);
-u32              nlmsvc_unlock(struct nlm_file *, struct nlm_lock *);
-u32              nlmsvc_testlock(struct nlm_file *, struct nlm_lock *,
+__be32           nlmsvc_unlock(struct nlm_file *, struct nlm_lock *);
+__be32           nlmsvc_testlock(struct nlm_file *, struct nlm_lock *,
                                        struct nlm_lock *);
-u32              nlmsvc_cancel_blocked(struct nlm_file *, struct nlm_lock *);
+__be32           nlmsvc_cancel_blocked(struct nlm_file *, struct nlm_lock *);
 unsigned long    nlmsvc_retry_blocked(void);
 void             nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *,
                                        nlm_host_match_fn_t match);
@@ -198,7 +198,7 @@ void                  nlmsvc_grant_reply(struct nlm_cookie *, u32);
 /*
  * File handling for the server personality
  */
-u32              nlm_lookup_file(struct svc_rqst *, struct nlm_file **,
+__be32           nlm_lookup_file(struct svc_rqst *, struct nlm_file **,
                                        struct nfs_fh *);
 void             nlm_release_file(struct nlm_file *);
 void             nlmsvc_mark_resources(void);
index cd7816e74c0536f71faf01e8cd909900efe48c5a..630c5bf69b0786046bf420481e0894c56e3a4562 100644 (file)
@@ -21,9 +21,9 @@ struct nlm_share {
        u32                     s_mode;         /* deny mode */
 };
 
-u32    nlmsvc_share_file(struct nlm_host *, struct nlm_file *,
+__be32 nlmsvc_share_file(struct nlm_host *, struct nlm_file *,
                                               struct nlm_args *);
-u32    nlmsvc_unshare_file(struct nlm_host *, struct nlm_file *,
+__be32 nlmsvc_unshare_file(struct nlm_host *, struct nlm_file *,
                                               struct nlm_args *);
 void   nlmsvc_traverse_shares(struct nlm_host *, struct nlm_file *,
                                               nlm_host_match_fn_t);
index bb0a0f1caa91e9bc521686fe6dfed54d7b85c17a..29e7d9fc9dad68c163c38a6908659540869d0bb4 100644 (file)
@@ -13,6 +13,8 @@
 #include <linux/nfs.h>
 #include <linux/sunrpc/xdr.h>
 
+struct svc_rqst;
+
 #define NLM_MAXCOOKIELEN       32
 #define NLM_MAXSTRLEN          1024
 
@@ -22,6 +24,8 @@
 #define        nlm_lck_blocked         __constant_htonl(NLM_LCK_BLOCKED)
 #define        nlm_lck_denied_grace_period     __constant_htonl(NLM_LCK_DENIED_GRACE_PERIOD)
 
+#define nlm_drop_reply         __constant_htonl(30000)
+
 /* Lock info passed via NLM */
 struct nlm_lock {
        char *                  caller;
@@ -86,19 +90,19 @@ struct nlm_reboot {
  */
 #define NLMSVC_XDRSIZE         sizeof(struct nlm_args)
 
-int    nlmsvc_decode_testargs(struct svc_rqst *, u32 *, struct nlm_args *);
-int    nlmsvc_encode_testres(struct svc_rqst *, u32 *, struct nlm_res *);
-int    nlmsvc_decode_lockargs(struct svc_rqst *, u32 *, struct nlm_args *);
-int    nlmsvc_decode_cancargs(struct svc_rqst *, u32 *, struct nlm_args *);
-int    nlmsvc_decode_unlockargs(struct svc_rqst *, u32 *, struct nlm_args *);
-int    nlmsvc_encode_res(struct svc_rqst *, u32 *, struct nlm_res *);
-int    nlmsvc_decode_res(struct svc_rqst *, u32 *, struct nlm_res *);
-int    nlmsvc_encode_void(struct svc_rqst *, u32 *, void *);
-int    nlmsvc_decode_void(struct svc_rqst *, u32 *, void *);
-int    nlmsvc_decode_shareargs(struct svc_rqst *, u32 *, struct nlm_args *);
-int    nlmsvc_encode_shareres(struct svc_rqst *, u32 *, struct nlm_res *);
-int    nlmsvc_decode_notify(struct svc_rqst *, u32 *, struct nlm_args *);
-int    nlmsvc_decode_reboot(struct svc_rqst *, u32 *, struct nlm_reboot *);
+int    nlmsvc_decode_testargs(struct svc_rqst *, __be32 *, struct nlm_args *);
+int    nlmsvc_encode_testres(struct svc_rqst *, __be32 *, struct nlm_res *);
+int    nlmsvc_decode_lockargs(struct svc_rqst *, __be32 *, struct nlm_args *);
+int    nlmsvc_decode_cancargs(struct svc_rqst *, __be32 *, struct nlm_args *);
+int    nlmsvc_decode_unlockargs(struct svc_rqst *, __be32 *, struct nlm_args *);
+int    nlmsvc_encode_res(struct svc_rqst *, __be32 *, struct nlm_res *);
+int    nlmsvc_decode_res(struct svc_rqst *, __be32 *, struct nlm_res *);
+int    nlmsvc_encode_void(struct svc_rqst *, __be32 *, void *);
+int    nlmsvc_decode_void(struct svc_rqst *, __be32 *, void *);
+int    nlmsvc_decode_shareargs(struct svc_rqst *, __be32 *, struct nlm_args *);
+int    nlmsvc_encode_shareres(struct svc_rqst *, __be32 *, struct nlm_res *);
+int    nlmsvc_decode_notify(struct svc_rqst *, __be32 *, struct nlm_args *);
+int    nlmsvc_decode_reboot(struct svc_rqst *, __be32 *, struct nlm_reboot *);
 /*
 int    nlmclt_encode_testargs(struct rpc_rqst *, u32 *, struct nlm_args *);
 int    nlmclt_encode_lockargs(struct rpc_rqst *, u32 *, struct nlm_args *);
index 3cc1ae25009b7e63d7f973311b94a600062b8e62..dd12b4c9e613eab54d82c6eb2b7deb139b774cbe 100644 (file)
 
 
 
-int    nlm4svc_decode_testargs(struct svc_rqst *, u32 *, struct nlm_args *);
-int    nlm4svc_encode_testres(struct svc_rqst *, u32 *, struct nlm_res *);
-int    nlm4svc_decode_lockargs(struct svc_rqst *, u32 *, struct nlm_args *);
-int    nlm4svc_decode_cancargs(struct svc_rqst *, u32 *, struct nlm_args *);
-int    nlm4svc_decode_unlockargs(struct svc_rqst *, u32 *, struct nlm_args *);
-int    nlm4svc_encode_res(struct svc_rqst *, u32 *, struct nlm_res *);
-int    nlm4svc_decode_res(struct svc_rqst *, u32 *, struct nlm_res *);
-int    nlm4svc_encode_void(struct svc_rqst *, u32 *, void *);
-int    nlm4svc_decode_void(struct svc_rqst *, u32 *, void *);
-int    nlm4svc_decode_shareargs(struct svc_rqst *, u32 *, struct nlm_args *);
-int    nlm4svc_encode_shareres(struct svc_rqst *, u32 *, struct nlm_res *);
-int    nlm4svc_decode_notify(struct svc_rqst *, u32 *, struct nlm_args *);
-int    nlm4svc_decode_reboot(struct svc_rqst *, u32 *, struct nlm_reboot *);
+int    nlm4svc_decode_testargs(struct svc_rqst *, __be32 *, struct nlm_args *);
+int    nlm4svc_encode_testres(struct svc_rqst *, __be32 *, struct nlm_res *);
+int    nlm4svc_decode_lockargs(struct svc_rqst *, __be32 *, struct nlm_args *);
+int    nlm4svc_decode_cancargs(struct svc_rqst *, __be32 *, struct nlm_args *);
+int    nlm4svc_decode_unlockargs(struct svc_rqst *, __be32 *, struct nlm_args *);
+int    nlm4svc_encode_res(struct svc_rqst *, __be32 *, struct nlm_res *);
+int    nlm4svc_decode_res(struct svc_rqst *, __be32 *, struct nlm_res *);
+int    nlm4svc_encode_void(struct svc_rqst *, __be32 *, void *);
+int    nlm4svc_decode_void(struct svc_rqst *, __be32 *, void *);
+int    nlm4svc_decode_shareargs(struct svc_rqst *, __be32 *, struct nlm_args *);
+int    nlm4svc_encode_shareres(struct svc_rqst *, __be32 *, struct nlm_res *);
+int    nlm4svc_decode_notify(struct svc_rqst *, __be32 *, struct nlm_args *);
+int    nlm4svc_decode_reboot(struct svc_rqst *, __be32 *, struct nlm_reboot *);
 /*
 int    nlmclt_encode_testargs(struct rpc_rqst *, u32 *, struct nlm_args *);
 int    nlmclt_encode_lockargs(struct rpc_rqst *, u32 *, struct nlm_args *);
index 1314ca0f29be78f637f027614d09d5a062e091a2..819f08f1310db878f753e7656da2ce32590a5a69 100644 (file)
@@ -202,7 +202,7 @@ extern int lockdep_internal(void);
  */
 
 extern void lockdep_init_map(struct lockdep_map *lock, const char *name,
-                            struct lock_class_key *key);
+                            struct lock_class_key *key, int subclass);
 
 /*
  * Reinitialize a lock key - for cases where there is special locking or
@@ -211,9 +211,14 @@ extern void lockdep_init_map(struct lockdep_map *lock, const char *name,
  * or they are too narrow (they suffer from a false class-split):
  */
 #define lockdep_set_class(lock, key) \
-               lockdep_init_map(&(lock)->dep_map, #key, key)
+               lockdep_init_map(&(lock)->dep_map, #key, key, 0)
 #define lockdep_set_class_and_name(lock, key, name) \
-               lockdep_init_map(&(lock)->dep_map, name, key)
+               lockdep_init_map(&(lock)->dep_map, name, key, 0)
+#define lockdep_set_class_and_subclass(lock, key, sub) \
+               lockdep_init_map(&(lock)->dep_map, #key, key, sub)
+#define lockdep_set_subclass(lock, sub)        \
+               lockdep_init_map(&(lock)->dep_map, #lock, \
+                                (lock)->dep_map.key, sub)
 
 /*
  * Acquire a lock.
@@ -257,10 +262,14 @@ static inline int lockdep_internal(void)
 # define lock_release(l, n, i)                 do { } while (0)
 # define lockdep_init()                                do { } while (0)
 # define lockdep_info()                                do { } while (0)
-# define lockdep_init_map(lock, name, key)     do { (void)(key); } while (0)
+# define lockdep_init_map(lock, name, key, sub)        do { (void)(key); } while (0)
 # define lockdep_set_class(lock, key)          do { (void)(key); } while (0)
 # define lockdep_set_class_and_name(lock, key, name) \
                do { (void)(key); } while (0)
+#define lockdep_set_class_and_subclass(lock, key, sub) \
+               do { (void)(key); } while (0)
+#define lockdep_set_subclass(lock, sub)                do { } while (0)
+
 # define INIT_LOCKDEP
 # define lockdep_reset()               do { debug_locks = 1; } while (0)
 # define lockdep_free_key_range(start, size)   do { } while (0)
index 09f0f575ddff947b32ac9cdef5e8f2b07b4dff87..daabb3aa1ec6b96b5078f6236d2df87fbfe710f6 100644 (file)
@@ -150,7 +150,7 @@ extern void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new);
 extern void mpol_fix_fork_child_flag(struct task_struct *p);
 #define set_cpuset_being_rebound(x) (cpuset_being_rebound = (x))
 
-#ifdef CONFIG_CPUSET
+#ifdef CONFIG_CPUSETS
 #define current_cpuset_is_being_rebound() \
                                (cpuset_being_rebound == current->cpuset)
 #else
index 5a6068ff5556f5fcd62566988133aa25d7591de0..d538de9019652c851fc6afc281cc1eaa0969268e 100644 (file)
@@ -1115,9 +1115,6 @@ int in_gate_area_no_task(unsigned long addr);
 #define in_gate_area(task, addr) ({(void)task; in_gate_area_no_task(addr);})
 #endif /* __HAVE_ARCH_GATE_AREA */
 
-/* /proc/<pid>/oom_adj set to -17 protects from the oom-killer */
-#define OOM_DISABLE -17
-
 int drop_caches_sysctl_handler(struct ctl_table *, int, struct file *,
                                        void __user *, size_t *, loff_t *);
 unsigned long shrink_slab(unsigned long scanned, gfp_t gfp_mask,
index 59855b8718a0a4b993a39cb825034ad081dd09cd..ed0762b283a9fd725b08a10fd2e194f89fcba3c0 100644 (file)
@@ -674,6 +674,12 @@ void sparse_init(void);
 #define sparse_index_init(_sec, _nid)  do {} while (0)
 #endif /* CONFIG_SPARSEMEM */
 
+#ifdef CONFIG_NODES_SPAN_OTHER_NODES
+#define early_pfn_in_nid(pfn, nid)     (early_pfn_to_nid(pfn) == (nid))
+#else
+#define early_pfn_in_nid(pfn, nid)     (1)
+#endif
+
 #ifndef early_pfn_valid
 #define early_pfn_valid(pfn)   (1)
 #endif
index c257f716e00f0b1698fb4154d67f6792e3b6fd50..15c733b816f0820afcef4d615ed11cfa7b43cd76 100644 (file)
@@ -19,6 +19,7 @@
 #define _LINUX_NET_H
 
 #include <linux/wait.h>
+#include <linux/random.h>
 #include <asm/socket.h>
 
 struct poll_table_struct;
@@ -193,9 +194,9 @@ extern int       sock_map_fd(struct socket *sock);
 extern struct socket *sockfd_lookup(int fd, int *err);
 #define                     sockfd_put(sock) fput(sock->file)
 extern int          net_ratelimit(void);
-extern unsigned long net_random(void);
-extern void         net_srandom(unsigned long);
-extern void         net_random_init(void);
+
+#define net_random()           random32()
+#define net_srandom(seed)      srandom32(seed)
 
 extern int          kernel_sendmsg(struct socket *sock, struct msghdr *msg,
                                    struct kvec *vec, size_t num, size_t len);
index 76ff54846ada1e07cab6ca2fa8e0de019a906e85..45228c1a119527daa656cc1334d13c2fba8d9690 100644 (file)
@@ -157,7 +157,7 @@ struct nfs_inode {
         * This is the cookie verifier used for NFSv3 readdir
         * operations
         */
-       __u32                   cookieverf[2];
+       __be32                  cookieverf[2];
 
        /*
         * This is the list of dirty unwritten pages.
@@ -290,6 +290,7 @@ static inline int nfs_verify_change_attribute(struct inode *inode, unsigned long
  * linux/fs/nfs/inode.c
  */
 extern int nfs_sync_mapping(struct address_space *mapping);
+extern void nfs_zap_mapping(struct inode *inode, struct address_space *mapping);
 extern void nfs_zap_caches(struct inode *);
 extern struct inode *nfs_fhget(struct super_block *, struct nfs_fh *,
                                struct nfs_fattr *);
index dc5397d9d23cf1e325f55eb06efe0b0f4be769ac..768c1ad5ff6f93e1859ca7771fb20fbf36c4faf2 100644 (file)
@@ -266,7 +266,7 @@ struct nfs_writeargs {
 
 struct nfs_writeverf {
        enum nfs3_stable_how    committed;
-       __u32                   verifier[2];
+       __be32                  verifier[2];
 };
 
 struct nfs_writeres {
@@ -420,7 +420,7 @@ struct nfs3_createargs {
        unsigned int            len;
        struct iattr *          sattr;
        enum nfs3_createmode    createmode;
-       __u32                   verifier[2];
+       __be32                  verifier[2];
 };
 
 struct nfs3_mkdirargs {
@@ -467,7 +467,7 @@ struct nfs3_linkargs {
 struct nfs3_readdirargs {
        struct nfs_fh *         fh;
        __u64                   cookie;
-       __u32                   verf[2];
+       __be32                  verf[2];
        int                     plus;
        unsigned int            count;
        struct page **          pages;
@@ -503,7 +503,7 @@ struct nfs3_linkres {
 
 struct nfs3_readdirres {
        struct nfs_fattr *      dir_attr;
-       __u32 *                 verf;
+       __be32 *                verf;
        int                     plus;
 };
 
@@ -811,7 +811,7 @@ struct nfs_rpc_ops {
        int     (*pathconf) (struct nfs_server *, struct nfs_fh *,
                             struct nfs_pathconf *);
        int     (*set_capabilities)(struct nfs_server *, struct nfs_fh *);
-       u32 *   (*decode_dirent)(u32 *, struct nfs_entry *, int plus);
+       __be32 *(*decode_dirent)(__be32 *, struct nfs_entry *, int plus);
        void    (*read_setup)   (struct nfs_read_data *);
        int     (*read_done)  (struct rpc_task *, struct nfs_read_data *);
        void    (*write_setup)  (struct nfs_write_data *, int how);
index c3a3557c2a5b49ac994d3aa87c3a651603e4b361..007480cd6a601fbec62c5d5ac41ed50e2a2d882d 100644 (file)
@@ -26,14 +26,14 @@ struct svc_cacherep {
                                c_type,         /* status, buffer */
                                c_secure : 1;   /* req came from port < 1024 */
        struct sockaddr_in      c_addr;
-       u32                     c_xid;
+       __be32                  c_xid;
        u32                     c_prot;
        u32                     c_proc;
        u32                     c_vers;
        unsigned long           c_timestamp;
        union {
                struct kvec     u_vec;
-               u32             u_status;
+               __be32          u_status;
        }                       c_u;
 };
 
@@ -75,7 +75,7 @@ enum {
 void   nfsd_cache_init(void);
 void   nfsd_cache_shutdown(void);
 int    nfsd_cache_lookup(struct svc_rqst *, int);
-void   nfsd_cache_update(struct svc_rqst *, int, u32 *);
+void   nfsd_cache_update(struct svc_rqst *, int, __be32 *);
 
 #endif /* __KERNEL__ */
 #endif /* NFSCACHE_H */
index 6e78ea969f4935977559495a1a0f139bc2423735..045e38cdbe646f966abf370cddb8d573b4770d62 100644 (file)
@@ -117,8 +117,8 @@ struct svc_export * exp_parent(struct auth_domain *clp,
                                   struct cache_req *reqp);
 int                    exp_rootfh(struct auth_domain *, 
                                        char *path, struct knfsd_fh *, int maxsize);
-int                    exp_pseudoroot(struct auth_domain *, struct svc_fh *fhp, struct cache_req *creq);
-int                    nfserrno(int errno);
+__be32                 exp_pseudoroot(struct auth_domain *, struct svc_fh *fhp, struct cache_req *creq);
+__be32                 nfserrno(int errno);
 
 extern struct cache_detail svc_export_cache;
 
index d0d4aae7085fd5fea09de2831132ee3d0e80b734..eb231143d5794fa4783e235e7a0d28032470a254 100644 (file)
@@ -50,7 +50,7 @@
  * Callback function for readdir
  */
 struct readdir_cd {
-       int                     err;    /* 0, nfserr, or nfserr_eof */
+       __be32                  err;    /* 0, nfserr, or nfserr_eof */
 };
 typedef int            (*encode_dent_fn)(struct readdir_cd *, const char *,
                                                int, loff_t, ino_t, unsigned int);
@@ -64,7 +64,7 @@ extern struct svc_serv                *nfsd_serv;
  * Function prototypes.
  */
 int            nfsd_svc(unsigned short port, int nrservs);
-int            nfsd_dispatch(struct svc_rqst *rqstp, u32 *statp);
+int            nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp);
 
 /* nfsd/vfs.c */
 int            fh_lock_parent(struct svc_fh *, struct dentry *);
@@ -72,57 +72,57 @@ int         nfsd_racache_init(int);
 void           nfsd_racache_shutdown(void);
 int            nfsd_cross_mnt(struct svc_rqst *rqstp, struct dentry **dpp,
                                struct svc_export **expp);
-int            nfsd_lookup(struct svc_rqst *, struct svc_fh *,
+__be32         nfsd_lookup(struct svc_rqst *, struct svc_fh *,
                                const char *, int, struct svc_fh *);
-int            nfsd_setattr(struct svc_rqst *, struct svc_fh *,
+__be32         nfsd_setattr(struct svc_rqst *, struct svc_fh *,
                                struct iattr *, int, time_t);
 #ifdef CONFIG_NFSD_V4
-int             nfsd4_set_nfs4_acl(struct svc_rqst *, struct svc_fh *,
+__be32          nfsd4_set_nfs4_acl(struct svc_rqst *, struct svc_fh *,
                     struct nfs4_acl *);
 int             nfsd4_get_nfs4_acl(struct svc_rqst *, struct dentry *, struct nfs4_acl **);
 #endif /* CONFIG_NFSD_V4 */
-int            nfsd_create(struct svc_rqst *, struct svc_fh *,
+__be32         nfsd_create(struct svc_rqst *, struct svc_fh *,
                                char *name, int len, struct iattr *attrs,
                                int type, dev_t rdev, struct svc_fh *res);
 #ifdef CONFIG_NFSD_V3
-int            nfsd_access(struct svc_rqst *, struct svc_fh *, u32 *, u32 *);
-int            nfsd_create_v3(struct svc_rqst *, struct svc_fh *,
+__be32         nfsd_access(struct svc_rqst *, struct svc_fh *, u32 *, u32 *);
+__be32         nfsd_create_v3(struct svc_rqst *, struct svc_fh *,
                                char *name, int len, struct iattr *attrs,
                                struct svc_fh *res, int createmode,
                                u32 *verifier, int *truncp);
-int            nfsd_commit(struct svc_rqst *, struct svc_fh *,
+__be32         nfsd_commit(struct svc_rqst *, struct svc_fh *,
                                loff_t, unsigned long);
 #endif /* CONFIG_NFSD_V3 */
-int            nfsd_open(struct svc_rqst *, struct svc_fh *, int,
+__be32         nfsd_open(struct svc_rqst *, struct svc_fh *, int,
                                int, struct file **);
 void           nfsd_close(struct file *);
-int            nfsd_read(struct svc_rqst *, struct svc_fh *, struct file *,
+__be32                 nfsd_read(struct svc_rqst *, struct svc_fh *, struct file *,
                                loff_t, struct kvec *, int, unsigned long *);
-int            nfsd_write(struct svc_rqst *, struct svc_fh *,struct file *,
+__be32                 nfsd_write(struct svc_rqst *, struct svc_fh *,struct file *,
                                loff_t, struct kvec *,int, unsigned long, int *);
-int            nfsd_readlink(struct svc_rqst *, struct svc_fh *,
+__be32         nfsd_readlink(struct svc_rqst *, struct svc_fh *,
                                char *, int *);
-int            nfsd_symlink(struct svc_rqst *, struct svc_fh *,
+__be32         nfsd_symlink(struct svc_rqst *, struct svc_fh *,
                                char *name, int len, char *path, int plen,
                                struct svc_fh *res, struct iattr *);
-int            nfsd_link(struct svc_rqst *, struct svc_fh *,
+__be32         nfsd_link(struct svc_rqst *, struct svc_fh *,
                                char *, int, struct svc_fh *);
-int            nfsd_rename(struct svc_rqst *,
+__be32         nfsd_rename(struct svc_rqst *,
                                struct svc_fh *, char *, int,
                                struct svc_fh *, char *, int);
-int            nfsd_remove(struct svc_rqst *,
+__be32         nfsd_remove(struct svc_rqst *,
                                struct svc_fh *, char *, int);
-int            nfsd_unlink(struct svc_rqst *, struct svc_fh *, int type,
+__be32         nfsd_unlink(struct svc_rqst *, struct svc_fh *, int type,
                                char *name, int len);
 int            nfsd_truncate(struct svc_rqst *, struct svc_fh *,
                                unsigned long size);
-int            nfsd_readdir(struct svc_rqst *, struct svc_fh *,
+__be32         nfsd_readdir(struct svc_rqst *, struct svc_fh *,
                             loff_t *, struct readdir_cd *, encode_dent_fn);
-int            nfsd_statfs(struct svc_rqst *, struct svc_fh *,
+__be32         nfsd_statfs(struct svc_rqst *, struct svc_fh *,
                                struct kstatfs *);
 
 int            nfsd_notify_change(struct inode *, struct iattr *);
-int            nfsd_permission(struct svc_export *, struct dentry *, int);
+__be32         nfsd_permission(struct svc_export *, struct dentry *, int);
 int            nfsd_sync_dir(struct dentry *dp);
 
 #if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
@@ -238,6 +238,7 @@ void                nfsd_lockd_shutdown(void);
 #define        nfserr_badname          __constant_htonl(NFSERR_BADNAME)
 #define        nfserr_cb_path_down     __constant_htonl(NFSERR_CB_PATH_DOWN)
 #define        nfserr_locked           __constant_htonl(NFSERR_LOCKED)
+#define        nfserr_replay_me        __constant_htonl(NFSERR_REPLAY_ME)
 
 /* error codes for internal use */
 /* if a request fails due to kmalloc failure, it gets dropped.
index 069257ea99a0fe4c92de7ccc4a993d88b35774ea..f3b51d62ec7dc4eb9f01deb4f4de4eedc42281b2 100644 (file)
@@ -157,7 +157,7 @@ typedef struct svc_fh {
        __u64                   fh_post_size;   /* i_size */
        unsigned long           fh_post_blocks; /* i_blocks */
        unsigned long           fh_post_blksize;/* i_blksize */
-       __u32                   fh_post_rdev[2];/* i_rdev */
+       __be32                  fh_post_rdev[2];/* i_rdev */
        struct timespec         fh_post_atime;  /* i_atime */
        struct timespec         fh_post_mtime;  /* i_mtime */
        struct timespec         fh_post_ctime;  /* i_ctime */
@@ -209,9 +209,9 @@ extern char * SVCFH_fmt(struct svc_fh *fhp);
 /*
  * Function prototypes
  */
-u32    fh_verify(struct svc_rqst *, struct svc_fh *, int, int);
-int    fh_compose(struct svc_fh *, struct svc_export *, struct dentry *, struct svc_fh *);
-int    fh_update(struct svc_fh *);
+__be32 fh_verify(struct svc_rqst *, struct svc_fh *, int, int);
+__be32 fh_compose(struct svc_fh *, struct svc_export *, struct dentry *, struct svc_fh *);
+__be32 fh_update(struct svc_fh *);
 void   fh_put(struct svc_fh *);
 
 static __inline__ struct svc_fh *
index 8bf23cf8b6035d0a849bd02c1016f23d53522552..c3673f487e841984169419c33d5663cf0db868b3 100644 (file)
@@ -125,7 +125,7 @@ struct nfs4_client {
        char                    cl_recdir[HEXDIR_LEN]; /* recovery dir */
        nfs4_verifier           cl_verifier;    /* generated by client */
        time_t                  cl_time;        /* time of last lease renewal */
-       u32                     cl_addr;        /* client ipaddress */
+       __be32                  cl_addr;        /* client ipaddress */
        struct svc_cred         cl_cred;        /* setclientid principal */
        clientid_t              cl_clientid;    /* generated by server */
        nfs4_verifier           cl_confirm;     /* generated by server */
@@ -164,7 +164,7 @@ update_stateid(stateid_t *stateid)
  * is cached. 
  */
 struct nfs4_replay {
-       u32                     rp_status;
+       __be32                  rp_status;
        unsigned int            rp_buflen;
        char                    *rp_buf;
        unsigned                intrp_allocated;
@@ -273,19 +273,19 @@ struct nfs4_stateid {
        ((err) != nfserr_stale_stateid) &&      \
        ((err) != nfserr_bad_stateid))
 
-extern int nfsd4_renew(clientid_t *clid);
-extern int nfs4_preprocess_stateid_op(struct svc_fh *current_fh, 
+extern __be32 nfsd4_renew(clientid_t *clid);
+extern __be32 nfs4_preprocess_stateid_op(struct svc_fh *current_fh,
                stateid_t *stateid, int flags, struct file **filp);
 extern void nfs4_lock_state(void);
 extern void nfs4_unlock_state(void);
 extern int nfs4_in_grace(void);
-extern int nfs4_check_open_reclaim(clientid_t *clid);
+extern __be32 nfs4_check_open_reclaim(clientid_t *clid);
 extern void put_nfs4_client(struct nfs4_client *clp);
 extern void nfs4_free_stateowner(struct kref *kref);
 extern void nfsd4_probe_callback(struct nfs4_client *clp);
 extern void nfsd4_cb_recall(struct nfs4_delegation *dp);
 extern void nfs4_put_delegation(struct nfs4_delegation *dp);
-extern int nfs4_make_rec_clidname(char *clidname, struct xdr_netobj *clname);
+extern __be32 nfs4_make_rec_clidname(char *clidname, struct xdr_netobj *clname);
 extern void nfsd4_init_recdir(char *recdir_name);
 extern int nfsd4_recdir_load(void);
 extern void nfsd4_shutdown_recdir(void);
index 0e53de87d886216f4f9478ce8bfde9c581b9c881..877192d3ae79605ed941b2737c0f983f27c7fffc 100644 (file)
@@ -81,7 +81,7 @@ struct nfsd_readdirargs {
        struct svc_fh           fh;
        __u32                   cookie;
        __u32                   count;
-       u32 *                   buffer;
+       __be32 *                buffer;
 };
 
 struct nfsd_attrstat {
@@ -108,9 +108,9 @@ struct nfsd_readdirres {
        int                     count;
 
        struct readdir_cd       common;
-       u32 *                   buffer;
+       __be32 *                buffer;
        int                     buflen;
-       u32 *                   offset;
+       __be32 *                offset;
 };
 
 struct nfsd_statfsres {
@@ -135,43 +135,43 @@ union nfsd_xdrstore {
 #define NFS2_SVC_XDRSIZE       sizeof(union nfsd_xdrstore)
 
 
-int nfssvc_decode_void(struct svc_rqst *, u32 *, void *);
-int nfssvc_decode_fhandle(struct svc_rqst *, u32 *, struct nfsd_fhandle *);
-int nfssvc_decode_sattrargs(struct svc_rqst *, u32 *,
+int nfssvc_decode_void(struct svc_rqst *, __be32 *, void *);
+int nfssvc_decode_fhandle(struct svc_rqst *, __be32 *, struct nfsd_fhandle *);
+int nfssvc_decode_sattrargs(struct svc_rqst *, __be32 *,
                                struct nfsd_sattrargs *);
-int nfssvc_decode_diropargs(struct svc_rqst *, u32 *,
+int nfssvc_decode_diropargs(struct svc_rqst *, __be32 *,
                                struct nfsd_diropargs *);
-int nfssvc_decode_readargs(struct svc_rqst *, u32 *,
+int nfssvc_decode_readargs(struct svc_rqst *, __be32 *,
                                struct nfsd_readargs *);
-int nfssvc_decode_writeargs(struct svc_rqst *, u32 *,
+int nfssvc_decode_writeargs(struct svc_rqst *, __be32 *,
                                struct nfsd_writeargs *);
-int nfssvc_decode_createargs(struct svc_rqst *, u32 *,
+int nfssvc_decode_createargs(struct svc_rqst *, __be32 *,
                                struct nfsd_createargs *);
-int nfssvc_decode_renameargs(struct svc_rqst *, u32 *,
+int nfssvc_decode_renameargs(struct svc_rqst *, __be32 *,
                                struct nfsd_renameargs *);
-int nfssvc_decode_readlinkargs(struct svc_rqst *, u32 *,
+int nfssvc_decode_readlinkargs(struct svc_rqst *, __be32 *,
                                struct nfsd_readlinkargs *);
-int nfssvc_decode_linkargs(struct svc_rqst *, u32 *,
+int nfssvc_decode_linkargs(struct svc_rqst *, __be32 *,
                                struct nfsd_linkargs *);
-int nfssvc_decode_symlinkargs(struct svc_rqst *, u32 *,
+int nfssvc_decode_symlinkargs(struct svc_rqst *, __be32 *,
                                struct nfsd_symlinkargs *);
-int nfssvc_decode_readdirargs(struct svc_rqst *, u32 *,
+int nfssvc_decode_readdirargs(struct svc_rqst *, __be32 *,
                                struct nfsd_readdirargs *);
-int nfssvc_encode_void(struct svc_rqst *, u32 *, void *);
-int nfssvc_encode_attrstat(struct svc_rqst *, u32 *, struct nfsd_attrstat *);
-int nfssvc_encode_diropres(struct svc_rqst *, u32 *, struct nfsd_diropres *);
-int nfssvc_encode_readlinkres(struct svc_rqst *, u32 *, struct nfsd_readlinkres *);
-int nfssvc_encode_readres(struct svc_rqst *, u32 *, struct nfsd_readres *);
-int nfssvc_encode_statfsres(struct svc_rqst *, u32 *, struct nfsd_statfsres *);
-int nfssvc_encode_readdirres(struct svc_rqst *, u32 *, struct nfsd_readdirres *);
+int nfssvc_encode_void(struct svc_rqst *, __be32 *, void *);
+int nfssvc_encode_attrstat(struct svc_rqst *, __be32 *, struct nfsd_attrstat *);
+int nfssvc_encode_diropres(struct svc_rqst *, __be32 *, struct nfsd_diropres *);
+int nfssvc_encode_readlinkres(struct svc_rqst *, __be32 *, struct nfsd_readlinkres *);
+int nfssvc_encode_readres(struct svc_rqst *, __be32 *, struct nfsd_readres *);
+int nfssvc_encode_statfsres(struct svc_rqst *, __be32 *, struct nfsd_statfsres *);
+int nfssvc_encode_readdirres(struct svc_rqst *, __be32 *, struct nfsd_readdirres *);
 
 int nfssvc_encode_entry(struct readdir_cd *, const char *name,
                                int namlen, loff_t offset, ino_t ino, unsigned int);
 
-int nfssvc_release_fhandle(struct svc_rqst *, u32 *, struct nfsd_fhandle *);
+int nfssvc_release_fhandle(struct svc_rqst *, __be32 *, struct nfsd_fhandle *);
 
 /* Helper functions for NFSv2 ACL code */
-u32 *nfs2svc_encode_fattr(struct svc_rqst *rqstp, u32 *p, struct svc_fh *fhp);
-u32 *nfs2svc_decode_fh(u32 *p, struct svc_fh *fhp);
+__be32 *nfs2svc_encode_fattr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp);
+__be32 *nfs2svc_decode_fh(__be32 *p, struct svc_fh *fhp);
 
 #endif /* LINUX_NFSD_H */
index 474d882dc2f385839a7b1cf869591a2f807a22f7..79963867b0d774cb2258d5a6ba18ae160aab6d65 100644 (file)
@@ -51,7 +51,7 @@ struct nfsd3_createargs {
        int                     len;
        int                     createmode;
        struct iattr            attrs;
-       __u32 *                 verf;
+       __be32 *                verf;
 };
 
 struct nfsd3_mknodargs {
@@ -98,8 +98,8 @@ struct nfsd3_readdirargs {
        __u64                   cookie;
        __u32                   dircount;
        __u32                   count;
-       __u32 *                 verf;
-       u32 *                   buffer;
+       __be32 *                verf;
+       __be32 *                buffer;
 };
 
 struct nfsd3_commitargs {
@@ -122,79 +122,79 @@ struct nfsd3_setaclargs {
 };
 
 struct nfsd3_attrstat {
-       __u32                   status;
+       __be32                  status;
        struct svc_fh           fh;
        struct kstat            stat;
 };
 
 /* LOOKUP, CREATE, MKDIR, SYMLINK, MKNOD */
 struct nfsd3_diropres  {
-       __u32                   status;
+       __be32                  status;
        struct svc_fh           dirfh;
        struct svc_fh           fh;
 };
 
 struct nfsd3_accessres {
-       __u32                   status;
+       __be32                  status;
        struct svc_fh           fh;
        __u32                   access;
 };
 
 struct nfsd3_readlinkres {
-       __u32                   status;
+       __be32                  status;
        struct svc_fh           fh;
        __u32                   len;
 };
 
 struct nfsd3_readres {
-       __u32                   status;
+       __be32                  status;
        struct svc_fh           fh;
        unsigned long           count;
        int                     eof;
 };
 
 struct nfsd3_writeres {
-       __u32                   status;
+       __be32                  status;
        struct svc_fh           fh;
        unsigned long           count;
        int                     committed;
 };
 
 struct nfsd3_renameres {
-       __u32                   status;
+       __be32                  status;
        struct svc_fh           ffh;
        struct svc_fh           tfh;
 };
 
 struct nfsd3_linkres {
-       __u32                   status;
+       __be32                  status;
        struct svc_fh           tfh;
        struct svc_fh           fh;
 };
 
 struct nfsd3_readdirres {
-       __u32                   status;
+       __be32                  status;
        struct svc_fh           fh;
        int                     count;
-       __u32                   verf[2];
+       __be32                  verf[2];
 
        struct readdir_cd       common;
-       u32 *                   buffer;
+       __be32 *                buffer;
        int                     buflen;
-       u32 *                   offset;
-       u32 *                   offset1;
+       __be32 *                offset;
+       __be32 *                offset1;
        struct svc_rqst *       rqstp;
 
 };
 
 struct nfsd3_fsstatres {
-       __u32                   status;
+       __be32                  status;
        struct kstatfs          stats;
        __u32                   invarsec;
 };
 
 struct nfsd3_fsinfores {
-       __u32                   status;
+       __be32                  status;
        __u32                   f_rtmax;
        __u32                   f_rtpref;
        __u32                   f_rtmult;
@@ -207,7 +207,7 @@ struct nfsd3_fsinfores {
 };
 
 struct nfsd3_pathconfres {
-       __u32                   status;
+       __be32                  status;
        __u32                   p_link_max;
        __u32                   p_name_max;
        __u32                   p_no_trunc;
@@ -217,12 +217,12 @@ struct nfsd3_pathconfres {
 };
 
 struct nfsd3_commitres {
-       __u32                   status;
+       __be32                  status;
        struct svc_fh           fh;
 };
 
 struct nfsd3_getaclres {
-       __u32                   status;
+       __be32                  status;
        struct svc_fh           fh;
        int                     mask;
        struct posix_acl        *acl_access;
@@ -266,70 +266,70 @@ union nfsd3_xdrstore {
 
 #define NFS3_SVC_XDRSIZE               sizeof(union nfsd3_xdrstore)
 
-int nfs3svc_decode_fhandle(struct svc_rqst *, u32 *, struct nfsd_fhandle *);
-int nfs3svc_decode_sattrargs(struct svc_rqst *, u32 *,
+int nfs3svc_decode_fhandle(struct svc_rqst *, __be32 *, struct nfsd_fhandle *);
+int nfs3svc_decode_sattrargs(struct svc_rqst *, __be32 *,
                                struct nfsd3_sattrargs *);
-int nfs3svc_decode_diropargs(struct svc_rqst *, u32 *,
+int nfs3svc_decode_diropargs(struct svc_rqst *, __be32 *,
                                struct nfsd3_diropargs *);
-int nfs3svc_decode_accessargs(struct svc_rqst *, u32 *,
+int nfs3svc_decode_accessargs(struct svc_rqst *, __be32 *,
                                struct nfsd3_accessargs *);
-int nfs3svc_decode_readargs(struct svc_rqst *, u32 *,
+int nfs3svc_decode_readargs(struct svc_rqst *, __be32 *,
                                struct nfsd3_readargs *);
-int nfs3svc_decode_writeargs(struct svc_rqst *, u32 *,
+int nfs3svc_decode_writeargs(struct svc_rqst *, __be32 *,
                                struct nfsd3_writeargs *);
-int nfs3svc_decode_createargs(struct svc_rqst *, u32 *,
+int nfs3svc_decode_createargs(struct svc_rqst *, __be32 *,
                                struct nfsd3_createargs *);
-int nfs3svc_decode_mkdirargs(struct svc_rqst *, u32 *,
+int nfs3svc_decode_mkdirargs(struct svc_rqst *, __be32 *,
                                struct nfsd3_createargs *);
-int nfs3svc_decode_mknodargs(struct svc_rqst *, u32 *,
+int nfs3svc_decode_mknodargs(struct svc_rqst *, __be32 *,
                                struct nfsd3_mknodargs *);
-int nfs3svc_decode_renameargs(struct svc_rqst *, u32 *,
+int nfs3svc_decode_renameargs(struct svc_rqst *, __be32 *,
                                struct nfsd3_renameargs *);
-int nfs3svc_decode_readlinkargs(struct svc_rqst *, u32 *,
+int nfs3svc_decode_readlinkargs(struct svc_rqst *, __be32 *,
                                struct nfsd3_readlinkargs *);
-int nfs3svc_decode_linkargs(struct svc_rqst *, u32 *,
+int nfs3svc_decode_linkargs(struct svc_rqst *, __be32 *,
                                struct nfsd3_linkargs *);
-int nfs3svc_decode_symlinkargs(struct svc_rqst *, u32 *,
+int nfs3svc_decode_symlinkargs(struct svc_rqst *, __be32 *,
                                struct nfsd3_symlinkargs *);
-int nfs3svc_decode_readdirargs(struct svc_rqst *, u32 *,
+int nfs3svc_decode_readdirargs(struct svc_rqst *, __be32 *,
                                struct nfsd3_readdirargs *);
-int nfs3svc_decode_readdirplusargs(struct svc_rqst *, u32 *,
+int nfs3svc_decode_readdirplusargs(struct svc_rqst *, __be32 *,
                                struct nfsd3_readdirargs *);
-int nfs3svc_decode_commitargs(struct svc_rqst *, u32 *,
+int nfs3svc_decode_commitargs(struct svc_rqst *, __be32 *,
                                struct nfsd3_commitargs *);
-int nfs3svc_encode_voidres(struct svc_rqst *, u32 *, void *);
-int nfs3svc_encode_attrstat(struct svc_rqst *, u32 *,
+int nfs3svc_encode_voidres(struct svc_rqst *, __be32 *, void *);
+int nfs3svc_encode_attrstat(struct svc_rqst *, __be32 *,
                                struct nfsd3_attrstat *);
-int nfs3svc_encode_wccstat(struct svc_rqst *, u32 *,
+int nfs3svc_encode_wccstat(struct svc_rqst *, __be32 *,
                                struct nfsd3_attrstat *);
-int nfs3svc_encode_diropres(struct svc_rqst *, u32 *,
+int nfs3svc_encode_diropres(struct svc_rqst *, __be32 *,
                                struct nfsd3_diropres *);
-int nfs3svc_encode_accessres(struct svc_rqst *, u32 *,
+int nfs3svc_encode_accessres(struct svc_rqst *, __be32 *,
                                struct nfsd3_accessres *);
-int nfs3svc_encode_readlinkres(struct svc_rqst *, u32 *,
+int nfs3svc_encode_readlinkres(struct svc_rqst *, __be32 *,
                                struct nfsd3_readlinkres *);
-int nfs3svc_encode_readres(struct svc_rqst *, u32 *, struct nfsd3_readres *);
-int nfs3svc_encode_writeres(struct svc_rqst *, u32 *, struct nfsd3_writeres *);
-int nfs3svc_encode_createres(struct svc_rqst *, u32 *,
+int nfs3svc_encode_readres(struct svc_rqst *, __be32 *, struct nfsd3_readres *);
+int nfs3svc_encode_writeres(struct svc_rqst *, __be32 *, struct nfsd3_writeres *);
+int nfs3svc_encode_createres(struct svc_rqst *, __be32 *,
                                struct nfsd3_diropres *);
-int nfs3svc_encode_renameres(struct svc_rqst *, u32 *,
+int nfs3svc_encode_renameres(struct svc_rqst *, __be32 *,
                                struct nfsd3_renameres *);
-int nfs3svc_encode_linkres(struct svc_rqst *, u32 *,
+int nfs3svc_encode_linkres(struct svc_rqst *, __be32 *,
                                struct nfsd3_linkres *);
-int nfs3svc_encode_readdirres(struct svc_rqst *, u32 *,
+int nfs3svc_encode_readdirres(struct svc_rqst *, __be32 *,
                                struct nfsd3_readdirres *);
-int nfs3svc_encode_fsstatres(struct svc_rqst *, u32 *,
+int nfs3svc_encode_fsstatres(struct svc_rqst *, __be32 *,
                                struct nfsd3_fsstatres *);
-int nfs3svc_encode_fsinfores(struct svc_rqst *, u32 *,
+int nfs3svc_encode_fsinfores(struct svc_rqst *, __be32 *,
                                struct nfsd3_fsinfores *);
-int nfs3svc_encode_pathconfres(struct svc_rqst *, u32 *,
+int nfs3svc_encode_pathconfres(struct svc_rqst *, __be32 *,
                                struct nfsd3_pathconfres *);
-int nfs3svc_encode_commitres(struct svc_rqst *, u32 *,
+int nfs3svc_encode_commitres(struct svc_rqst *, __be32 *,
                                struct nfsd3_commitres *);
 
-int nfs3svc_release_fhandle(struct svc_rqst *, u32 *,
+int nfs3svc_release_fhandle(struct svc_rqst *, __be32 *,
                                struct nfsd3_attrstat *);
-int nfs3svc_release_fhandle2(struct svc_rqst *, u32 *,
+int nfs3svc_release_fhandle2(struct svc_rqst *, __be32 *,
                                struct nfsd3_fhandle_pair *);
 int nfs3svc_encode_entry(struct readdir_cd *, const char *name,
                                int namlen, loff_t offset, ino_t ino,
@@ -338,9 +338,9 @@ int nfs3svc_encode_entry_plus(struct readdir_cd *, const char *name,
                                int namlen, loff_t offset, ino_t ino,
                                unsigned int);
 /* Helper functions for NFSv3 ACL code */
-u32 *nfs3svc_encode_post_op_attr(struct svc_rqst *rqstp, u32 *p,
+__be32 *nfs3svc_encode_post_op_attr(struct svc_rqst *rqstp, __be32 *p,
                                struct svc_fh *fhp);
-u32 *nfs3svc_decode_fh(u32 *p, struct svc_fh *fhp);
+__be32 *nfs3svc_decode_fh(__be32 *p, struct svc_fh *fhp);
 
 
 #endif /* _LINUX_NFSD_XDR3_H */
index 66e642762a0720e609ef0dcc09a648c511de7c43..45ca01b5f844ffaa68b8902be92bd47cf4f65ae1 100644 (file)
@@ -258,9 +258,9 @@ struct nfsd4_readdir {
        struct svc_fh * rd_fhp;             /* response */
 
        struct readdir_cd       common;
-       u32 *                   buffer;
+       __be32 *                buffer;
        int                     buflen;
-       u32 *                   offset;
+       __be32 *                offset;
 };
 
 struct nfsd4_release_lockowner {
@@ -334,7 +334,7 @@ struct nfsd4_write {
 
 struct nfsd4_op {
        int                                     opnum;
-       int                                     status;
+       __be32                                  status;
        union {
                struct nfsd4_access             access;
                struct nfsd4_close              close;
@@ -371,12 +371,12 @@ struct nfsd4_op {
 
 struct nfsd4_compoundargs {
        /* scratch variables for XDR decode */
-       u32 *                           p;
-       u32 *                           end;
+       __be32 *                        p;
+       __be32 *                        end;
        struct page **                  pagelist;
        int                             pagelen;
-       u32                             tmp[8];
-       u32 *                           tmpp;
+       __be32                          tmp[8];
+       __be32 *                        tmpp;
        struct tmpbuf {
                struct tmpbuf *next;
                void (*release)(const void *);
@@ -395,15 +395,15 @@ struct nfsd4_compoundargs {
 
 struct nfsd4_compoundres {
        /* scratch variables for XDR encode */
-       u32 *                           p;
-       u32 *                           end;
+       __be32 *                        p;
+       __be32 *                        end;
        struct xdr_buf *                xbuf;
        struct svc_rqst *               rqstp;
 
        u32                             taglen;
        char *                          tag;
        u32                             opcnt;
-       u32 *                           tagp; /* where to encode tag and  opcount */
+       __be32 *                        tagp; /* where to encode tag and  opcount */
 };
 
 #define NFS4_SVC_XDRSIZE               sizeof(struct nfsd4_compoundargs)
@@ -419,45 +419,45 @@ set_change_info(struct nfsd4_change_info *cinfo, struct svc_fh *fhp)
        cinfo->after_ctime_nsec = fhp->fh_post_ctime.tv_nsec;
 }
 
-int nfs4svc_encode_voidres(struct svc_rqst *, u32 *, void *);
-int nfs4svc_decode_compoundargs(struct svc_rqst *, u32 *, 
+int nfs4svc_encode_voidres(struct svc_rqst *, __be32 *, void *);
+int nfs4svc_decode_compoundargs(struct svc_rqst *, __be32 *,
                struct nfsd4_compoundargs *);
-int nfs4svc_encode_compoundres(struct svc_rqst *, u32 *, 
+int nfs4svc_encode_compoundres(struct svc_rqst *, __be32 *,
                struct nfsd4_compoundres *);
 void nfsd4_encode_operation(struct nfsd4_compoundres *, struct nfsd4_op *);
 void nfsd4_encode_replay(struct nfsd4_compoundres *resp, struct nfsd4_op *op);
-int nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,
-                      struct dentry *dentry, u32 *buffer, int *countp, 
+__be32 nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,
+                      struct dentry *dentry, __be32 *buffer, int *countp,
                       u32 *bmval, struct svc_rqst *);
-extern int nfsd4_setclientid(struct svc_rqst *rqstp, 
+extern __be32 nfsd4_setclientid(struct svc_rqst *rqstp,
                struct nfsd4_setclientid *setclid);
-extern int nfsd4_setclientid_confirm(struct svc_rqst *rqstp, 
+extern __be32 nfsd4_setclientid_confirm(struct svc_rqst *rqstp,
                struct nfsd4_setclientid_confirm *setclientid_confirm);
-extern int nfsd4_process_open1(struct nfsd4_open *open);
-extern int nfsd4_process_open2(struct svc_rqst *rqstp, 
+extern __be32 nfsd4_process_open1(struct nfsd4_open *open);
+extern __be32 nfsd4_process_open2(struct svc_rqst *rqstp,
                struct svc_fh *current_fh, struct nfsd4_open *open);
-extern int nfsd4_open_confirm(struct svc_rqst *rqstp, 
+extern __be32 nfsd4_open_confirm(struct svc_rqst *rqstp,
                struct svc_fh *current_fh, struct nfsd4_open_confirm *oc,
                struct nfs4_stateowner **);
-extern  int nfsd4_close(struct svc_rqst *rqstp, struct svc_fh *current_fh, 
+extern __be32 nfsd4_close(struct svc_rqst *rqstp, struct svc_fh *current_fh,
                struct nfsd4_close *close,
                struct nfs4_stateowner **replay_owner);
-extern int nfsd4_open_downgrade(struct svc_rqst *rqstp, 
+extern __be32 nfsd4_open_downgrade(struct svc_rqst *rqstp,
                struct svc_fh *current_fh, struct nfsd4_open_downgrade *od,
                struct nfs4_stateowner **replay_owner);
-extern int nfsd4_lock(struct svc_rqst *rqstp, struct svc_fh *current_fh, 
+extern __be32 nfsd4_lock(struct svc_rqst *rqstp, struct svc_fh *current_fh,
                struct nfsd4_lock *lock,
                struct nfs4_stateowner **replay_owner);
-extern int nfsd4_lockt(struct svc_rqst *rqstp, struct svc_fh *current_fh, 
+extern __be32 nfsd4_lockt(struct svc_rqst *rqstp, struct svc_fh *current_fh,
                struct nfsd4_lockt *lockt);
-extern int nfsd4_locku(struct svc_rqst *rqstp, struct svc_fh *current_fh, 
+extern __be32 nfsd4_locku(struct svc_rqst *rqstp, struct svc_fh *current_fh,
                struct nfsd4_locku *locku,
                struct nfs4_stateowner **replay_owner);
-extern int
+extern __be32
 nfsd4_release_lockowner(struct svc_rqst *rqstp,
                struct nfsd4_release_lockowner *rlockowner);
 extern void nfsd4_release_compoundargs(struct nfsd4_compoundargs *);
-extern int nfsd4_delegreturn(struct svc_rqst *rqstp,
+extern __be32 nfsd4_delegreturn(struct svc_rqst *rqstp,
                struct svc_fh *current_fh, struct nfsd4_delegreturn *dr);
 #endif
 
diff --git a/include/linux/oom.h b/include/linux/oom.h
new file mode 100644 (file)
index 0000000..ad76463
--- /dev/null
@@ -0,0 +1,10 @@
+#ifndef __INCLUDE_LINUX_OOM_H
+#define __INCLUDE_LINUX_OOM_H
+
+/* /proc/<pid>/oom_adj set to -17 protects from the oom-killer */
+#define OOM_DISABLE (-17)
+/* inclusive */
+#define OOM_ADJUST_MIN (-16)
+#define OOM_ADJUST_MAX 15
+
+#endif
index 5c604f5fad67d94c31ba6feb193eb49c0f42d0c8..09be0f81b27ba37d4125f4dfa7fa2de601858b37 100644 (file)
@@ -443,6 +443,7 @@ extern void pci_remove_bus(struct pci_bus *b);
 extern void pci_remove_bus_device(struct pci_dev *dev);
 extern void pci_stop_bus_device(struct pci_dev *dev);
 void pci_setup_cardbus(struct pci_bus *bus);
+extern void pci_sort_breadthfirst(void);
 
 /* Generic PCI functions exported to card drivers */
 
@@ -452,13 +453,18 @@ struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn);
 int pci_find_capability (struct pci_dev *dev, int cap);
 int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap);
 int pci_find_ext_capability (struct pci_dev *dev, int cap);
-struct pci_bus * pci_find_next_bus(const struct pci_bus *from);
+struct pci_bus *pci_find_next_bus(const struct pci_bus *from);
+
+struct pci_dev *pci_get_device(unsigned int vendor, unsigned int device,
+                               struct pci_dev *from);
+struct pci_dev *pci_get_device_reverse(unsigned int vendor, unsigned int device,
+                               struct pci_dev *from);
 
-struct pci_dev *pci_get_device (unsigned int vendor, unsigned int device, struct pci_dev *from);
 struct pci_dev *pci_get_subsys (unsigned int vendor, unsigned int device,
                                unsigned int ss_vendor, unsigned int ss_device,
                                struct pci_dev *from);
 struct pci_dev *pci_get_slot (struct pci_bus *bus, unsigned int devfn);
+struct pci_dev *pci_get_bus_and_slot (unsigned int bus, unsigned int devfn);
 struct pci_dev *pci_get_class (unsigned int class, struct pci_dev *from);
 int pci_dev_present(const struct pci_device_id *ids);
 
@@ -658,7 +664,12 @@ static inline struct pci_dev *pci_find_device(unsigned int vendor, unsigned int
 static inline struct pci_dev *pci_find_slot(unsigned int bus, unsigned int devfn)
 { return NULL; }
 
-static inline struct pci_dev *pci_get_device (unsigned int vendor, unsigned int device, struct pci_dev *from)
+static inline struct pci_dev *pci_get_device(unsigned int vendor,
+                               unsigned int device, struct pci_dev *from)
+{ return NULL; }
+
+static inline struct pci_dev *pci_get_device_reverse(unsigned int vendor,
+                               unsigned int device, struct pci_dev *from)
 { return NULL; }
 
 static inline struct pci_dev *pci_get_subsys (unsigned int vendor, unsigned int device,
similarity index 99%
rename from drivers/pci/hotplug/pci_hotplug.h
rename to include/linux/pci_hotplug.h
index 772523dc3860f57e5bc8b2f5d4e8d89c82044c0e..a675a05c40919e95b769770c806b33fdf4002ebd 100644 (file)
@@ -22,7 +22,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * Send feedback to <greg@kroah.com>
+ * Send feedback to <kristen.c.accardi@intel.com>
  *
  */
 #ifndef _PCI_HOTPLUG_H
index f069df2454699b408fa311d619cd9d3f780663da..f3a168f3c9df826e90e5af03955710e4a386027b 100644 (file)
 #define PCI_DEVICE_ID_RME_DIGI32_PRO   0x9897
 #define PCI_DEVICE_ID_RME_DIGI32_8     0x9898
 
+#define PCI_VENDOR_ID_QUICKNET         0x15E2
+#define PCI_DEVICE_ID_QUICKNET_XJ      0x0500
index 80d780e5a8f5ae501ee8e12b2d0977c257df385f..bf4cf2080e5cb1c0ba57abf88b7a85951fd0d7fb 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _LINUX_PERSONALITY_H
 #define _LINUX_PERSONALITY_H
 
+#ifdef __KERNEL__
+
 /*
  * Handling of different ABIs (personalities).
  */
@@ -12,6 +14,8 @@ extern int            register_exec_domain(struct exec_domain *);
 extern int             unregister_exec_domain(struct exec_domain *);
 extern int             __set_personality(unsigned long);
 
+#endif /* __KERNEL__ */
+
 /*
  * Flags for bug emulation.
  *
@@ -71,6 +75,7 @@ enum {
        PER_MASK =              0x00ff,
 };
 
+#ifdef __KERNEL__
 
 /*
  * Description of an execution domain.
@@ -111,4 +116,6 @@ struct exec_domain {
 #define set_personality(pers) \
        ((current->personality == pers) ? 0 : __set_personality(pers))
 
+#endif /* __KERNEL__ */
+
 #endif /* _LINUX_PERSONALITY_H */
index 84d88775185556e4d2a8a6b0560bcfc9c202038a..ebd42a3710b4eefc44bec8a9880bd88af6472bcb 100644 (file)
@@ -146,16 +146,16 @@ enum bitmap_state {
 
 /* the superblock at the front of the bitmap file -- little endian */
 typedef struct bitmap_super_s {
-       __u32 magic;        /*  0  BITMAP_MAGIC */
-       __u32 version;      /*  4  the bitmap major for now, could change... */
-       __u8  uuid[16];     /*  8  128 bit uuid - must match md device uuid */
-       __u64 events;       /* 24  event counter for the bitmap (1)*/
-       __u64 events_cleared;/*32  event counter when last bit cleared (2) */
-       __u64 sync_size;    /* 40  the size of the md device's sync range(3) */
-       __u32 state;        /* 48  bitmap state information */
-       __u32 chunksize;    /* 52  the bitmap chunk size in bytes */
-       __u32 daemon_sleep; /* 56  seconds between disk flushes */
-       __u32 write_behind; /* 60  number of outstanding write-behind writes */
+       __le32 magic;        /*  0  BITMAP_MAGIC */
+       __le32 version;      /*  4  the bitmap major for now, could change... */
+       __u8  uuid[16];      /*  8  128 bit uuid - must match md device uuid */
+       __le64 events;       /* 24  event counter for the bitmap (1)*/
+       __le64 events_cleared;/*32  event counter when last bit cleared (2) */
+       __le64 sync_size;    /* 40  the size of the md device's sync range(3) */
+       __le32 state;        /* 48  bitmap state information */
+       __le32 chunksize;    /* 52  the bitmap chunk size in bytes */
+       __le32 daemon_sleep; /* 56  seconds between disk flushes */
+       __le32 write_behind; /* 60  number of outstanding write-behind writes */
 
        __u8  pad[256 - 64]; /* set to zero */
 } bitmap_super_t;
index b6ebc69bae54d7b22402732355279d474701f699..3f2cd98c508bfdff781b361b1b86886bd65ddda8 100644 (file)
@@ -206,52 +206,52 @@ static inline __u64 md_event(mdp_super_t *sb) {
  */
 struct mdp_superblock_1 {
        /* constant array information - 128 bytes */
-       __u32   magic;          /* MD_SB_MAGIC: 0xa92b4efc - little endian */
-       __u32   major_version;  /* 1 */
-       __u32   feature_map;    /* bit 0 set if 'bitmap_offset' is meaningful */
-       __u32   pad0;           /* always set to 0 when writing */
+       __le32  magic;          /* MD_SB_MAGIC: 0xa92b4efc - little endian */
+       __le32  major_version;  /* 1 */
+       __le32  feature_map;    /* bit 0 set if 'bitmap_offset' is meaningful */
+       __le32  pad0;           /* always set to 0 when writing */
 
        __u8    set_uuid[16];   /* user-space generated. */
        char    set_name[32];   /* set and interpreted by user-space */
 
-       __u64   ctime;          /* lo 40 bits are seconds, top 24 are microseconds or 0*/
-       __u32   level;          /* -4 (multipath), -1 (linear), 0,1,4,5 */
-       __u32   layout;         /* only for raid5 and raid10 currently */
-       __u64   size;           /* used size of component devices, in 512byte sectors */
+       __le64  ctime;          /* lo 40 bits are seconds, top 24 are microseconds or 0*/
+       __le32  level;          /* -4 (multipath), -1 (linear), 0,1,4,5 */
+       __le32  layout;         /* only for raid5 and raid10 currently */
+       __le64  size;           /* used size of component devices, in 512byte sectors */
 
-       __u32   chunksize;      /* in 512byte sectors */
-       __u32   raid_disks;
-       __u32   bitmap_offset;  /* sectors after start of superblock that bitmap starts
+       __le32  chunksize;      /* in 512byte sectors */
+       __le32  raid_disks;
+       __le32  bitmap_offset;  /* sectors after start of superblock that bitmap starts
                                 * NOTE: signed, so bitmap can be before superblock
                                 * only meaningful of feature_map[0] is set.
                                 */
 
        /* These are only valid with feature bit '4' */
-       __u32   new_level;      /* new level we are reshaping to                */
-       __u64   reshape_position;       /* next address in array-space for reshape */
-       __u32   delta_disks;    /* change in number of raid_disks               */
-       __u32   new_layout;     /* new layout                                   */
-       __u32   new_chunk;      /* new chunk size (bytes)                       */
+       __le32  new_level;      /* new level we are reshaping to                */
+       __le64  reshape_position;       /* next address in array-space for reshape */
+       __le32  delta_disks;    /* change in number of raid_disks               */
+       __le32  new_layout;     /* new layout                                   */
+       __le32  new_chunk;      /* new chunk size (bytes)                       */
        __u8    pad1[128-124];  /* set to 0 when written */
 
        /* constant this-device information - 64 bytes */
-       __u64   data_offset;    /* sector start of data, often 0 */
-       __u64   data_size;      /* sectors in this device that can be used for data */
-       __u64   super_offset;   /* sector start of this superblock */
-       __u64   recovery_offset;/* sectors before this offset (from data_offset) have been recovered */
-       __u32   dev_number;     /* permanent identifier of this  device - not role in raid */
-       __u32   cnt_corrected_read; /* number of read errors that were corrected by re-writing */
+       __le64  data_offset;    /* sector start of data, often 0 */
+       __le64  data_size;      /* sectors in this device that can be used for data */
+       __le64  super_offset;   /* sector start of this superblock */
+       __le64  recovery_offset;/* sectors before this offset (from data_offset) have been recovered */
+       __le32  dev_number;     /* permanent identifier of this  device - not role in raid */
+       __le32  cnt_corrected_read; /* number of read errors that were corrected by re-writing */
        __u8    device_uuid[16]; /* user-space setable, ignored by kernel */
        __u8    devflags;       /* per-device flags.  Only one defined...*/
 #define        WriteMostly1    1       /* mask for writemostly flag in above */
        __u8    pad2[64-57];    /* set to 0 when writing */
 
        /* array state information - 64 bytes */
-       __u64   utime;          /* 40 bits second, 24 btes microseconds */
-       __u64   events;         /* incremented when superblock updated */
-       __u64   resync_offset;  /* data before this offset (from data_offset) known to be in sync */
-       __u32   sb_csum;        /* checksum upto devs[max_dev] */
-       __u32   max_dev;        /* size of devs[] array to consider */
+       __le64  utime;          /* 40 bits second, 24 btes microseconds */
+       __le64  events;         /* incremented when superblock updated */
+       __le64  resync_offset;  /* data before this offset (from data_offset) known to be in sync */
+       __le32  sb_csum;        /* checksum upto devs[max_dev] */
+       __le32  max_dev;        /* size of devs[] array to consider */
        __u8    pad3[64-32];    /* set to 0 when writing */
 
        /* device state information. Indexed by dev_number.
@@ -260,7 +260,7 @@ struct mdp_superblock_1 {
         * into the 'roles' value.  If a device is spare or faulty, then it doesn't
         * have a meaningful role.
         */
-       __u16   dev_roles[0];   /* role in array, or 0xffff for a spare, or 0xfffe for faulty */
+       __le16  dev_roles[0];   /* role in array, or 0xffff for a spare, or 0xfffe for faulty */
 };
 
 /* feature_map bits */
index 5d6456bcdebac8e4099809369407583bf04b8d69..0248b30e306d3a5b747201f008a550c46cc4aa0e 100644 (file)
@@ -69,6 +69,9 @@ extern struct file_operations random_fops, urandom_fops;
 unsigned int get_random_int(void);
 unsigned long randomize_range(unsigned long start, unsigned long end, unsigned long len);
 
+u32 random32(void);
+void srandom32(u32 seed);
+
 #endif /* __KERNEL___ */
 
 #endif /* _LINUX_RANDOM_H */
index 3a697cc6ecaeccd6476e0db37adef8ca53612b2f..b99c5ca9708d42b7aa03e8c016cb03d1a1c6bbfc 100644 (file)
@@ -41,6 +41,7 @@ struct serio {
        void (*stop)(struct serio *);
 
        struct serio *parent, *child;
+       unsigned int depth;             /* level of nesting in serio hierarchy */
 
        struct serio_driver *drv;       /* accessed from interrupt, must be protected by serio->lock and serio->sem */
        struct mutex drv_mutex;         /* protects serio->drv so attributes can pin driver */
index 1e65f2dd80e5d5aa4bbd8f5a7885862cccfe5c4f..606cb21652322d33ed1d389e44b6c304d4fb6b8f 100644 (file)
@@ -56,7 +56,9 @@ enum rpc_accept_stat {
        RPC_PROG_MISMATCH = 2,
        RPC_PROC_UNAVAIL = 3,
        RPC_GARBAGE_ARGS = 4,
-       RPC_SYSTEM_ERR = 5
+       RPC_SYSTEM_ERR = 5,
+       /* internal use only */
+       RPC_DROP_REPLY = 60000,
 };
 
 enum rpc_reject_stat {
index 9c9a8ad92477716602837035c5c709029cfa570e..965d6c20086ee2980ddee1f30e7d842df019a1df 100644 (file)
@@ -335,7 +335,7 @@ struct svc_version {
 /*
  * RPC procedure info
  */
-typedef int    (*svc_procfunc)(struct svc_rqst *, void *argp, void *resp);
+typedef __be32 (*svc_procfunc)(struct svc_rqst *, void *argp, void *resp);
 struct svc_procedure {
        svc_procfunc            pc_func;        /* process the request */
        kxdrproc_t              pc_decode;      /* XDR decode args */
index 953723b09bc6d73cd5ad97bd0143bdf1fbd162f9..ac69e55116060be1d29fb783a812d861011ac548 100644 (file)
@@ -74,6 +74,7 @@ struct xdr_buf {
 #define        rpc_proc_unavail        __constant_htonl(RPC_PROC_UNAVAIL)
 #define        rpc_garbage_args        __constant_htonl(RPC_GARBAGE_ARGS)
 #define        rpc_system_err          __constant_htonl(RPC_SYSTEM_ERR)
+#define        rpc_drop_reply          __constant_htonl(RPC_DROP_REPLY)
 
 #define        rpc_auth_ok             __constant_htonl(RPC_AUTH_OK)
 #define        rpc_autherr_badcred     __constant_htonl(RPC_AUTH_BADCRED)
index 0e058a2d1c6d72a62ddcef1e733830bff6323269..2d36f6db37067b84e1343979079395c3e8127a11 100644 (file)
@@ -342,6 +342,8 @@ struct tcp_sock {
 
        unsigned long last_synq_overflow; 
 
+       __u32   tso_deferred;
+
 /* Receiver side RTT estimation */
        struct {
                __u32   rtt;
index 243a15f54002445f5b8b4938981ec90430b73ec6..bea469455a0c8bf6cdd0668d4f54fdb4ad0e4457 100644 (file)
@@ -129,6 +129,7 @@ static inline unsigned int tipc_node(__u32 addr)
 
 #define TIPC_SUB_PORTS         0x01    /* filter for port availability */
 #define TIPC_SUB_SERVICE       0x02    /* filter for service availability */
+#define TIPC_SUB_CANCEL         0x04    /* cancel a subscription */
 #if 0
 /* The following filter options are not currently implemented */
 #define TIPC_SUB_NO_BIND_EVTS  0x04    /* filter out "publish" events */
index 73e1751d03dd18e2806d4a018c05f9cf05eaf942..749928c161fb24a6fbdcc95fc703c18d900f9494 100644 (file)
@@ -26,6 +26,7 @@ struct module;
  * Initialize unwind support.
  */
 extern void unwind_init(void);
+extern void unwind_setup(void);
 
 #ifdef CONFIG_MODULES
 
@@ -73,6 +74,7 @@ extern int unwind_to_user(struct unwind_frame_info *);
 struct unwind_frame_info {};
 
 static inline void unwind_init(void) {}
+static inline void unwind_setup(void) {}
 
 #ifdef CONFIG_MODULES
 
index c5fdf62595483430ea42dec5d483a6503e11c312..df5c4654360d029ba95f222d22b3a74042556944 100644 (file)
@@ -243,7 +243,7 @@ struct v4l2_pix_format
 #define V4L2_PIX_FMT_YUV420  v4l2_fourcc('Y','U','1','2') /* 12  YUV 4:2:0     */
 #define V4L2_PIX_FMT_YYUV    v4l2_fourcc('Y','Y','U','V') /* 16  YUV 4:2:2     */
 #define V4L2_PIX_FMT_HI240   v4l2_fourcc('H','I','2','4') /*  8  8-bit color   */
-#define V4L2_PIX_FMT_HM12    v4l2_fourcc('H','M','1','2') /*  8  YUV 4:1:1 16x16 macroblocks */
+#define V4L2_PIX_FMT_HM12    v4l2_fourcc('H','M','1','2') /*  8  YUV 4:2:0 16x16 macroblocks */
 
 /* see http://www.siliconimaging.com/RGB%20Bayer.htm */
 #define V4L2_PIX_FMT_SBGGR8  v4l2_fourcc('B','A','8','1') /*  8  BGBG.. GRGR.. */
index a341c803286617d570fac7cda0ad11ced9d67536..fc35e6bdfb93e4bf4d5cac5b50c983e97e846c5a 100644 (file)
@@ -85,7 +85,6 @@ int wakeup_pdflush(long nr_pages);
 void laptop_io_completion(void);
 void laptop_sync_completion(void);
 void throttle_vm_writeout(void);
-void writeback_congestion_end(void);
 
 /* These are exported to sysctl. */
 extern int dirty_background_ratio;
index df22efcfcc0b7deceb77ee1094a05d24f00c22d2..c0fc39620f3643c4393ba2b1d99c8181498b0da0 100644 (file)
@@ -153,6 +153,7 @@ struct hci_conn {
        __u8             mode;
        __u8             type;
        __u8             out;
+       __u8             attempt;
        __u8             dev_class[3];
        __u8             features[8];
        __u16            interval;
@@ -289,6 +290,22 @@ static inline struct hci_conn *hci_conn_hash_lookup_ba(struct hci_dev *hdev,
        return NULL;
 }
 
+static inline struct hci_conn *hci_conn_hash_lookup_state(struct hci_dev *hdev,
+                                       __u8 type, __u16 state)
+{
+       struct hci_conn_hash *h = &hdev->conn_hash;
+       struct list_head *p;
+       struct hci_conn  *c;
+
+       list_for_each(p, &h->list) {
+               c = list_entry(p, struct hci_conn, list);
+               if (c->type == type && c->state == state)
+                       return c;
+       }
+       return NULL;
+}
+
+void hci_acl_connect(struct hci_conn *conn);
 void hci_acl_disconn(struct hci_conn *conn, __u8 reason);
 void hci_add_sco(struct hci_conn *conn, __u16 handle);
 
index 465b7830278209fee5a1454d634739c9e17a3a50..ac4ce9091747cd6660c5d77a7bce868e8e7a1747 100644 (file)
@@ -199,11 +199,6 @@ static inline void dn_sk_ports_copy(struct flowi *fl, struct dn_scp *scp)
 {
        fl->uli_u.dnports.sport = scp->addrloc;
        fl->uli_u.dnports.dport = scp->addrrem;
-       fl->uli_u.dnports.objnum = scp->addr.sdn_objnum;
-       if (fl->uli_u.dnports.objnum == 0) {
-               fl->uli_u.dnports.objnamel = (__u8)dn_ntohs(scp->addr.sdn_objnamel);
-               memcpy(fl->uli_u.dnports.objname, scp->addr.sdn_objname, 16);
-       }
 }
 
 extern unsigned dn_mss_from_pmtu(struct net_device *dev, int mtu);
index 3b44d72b27d3ca25126f7f595dd787e6935e8b8b..5cda27cd9debdbaa59afd05ec151b61badf9e4e5 100644 (file)
@@ -68,9 +68,6 @@ struct flowi {
                struct {
                        __le16  sport;
                        __le16  dport;
-                       __u8    objnum;
-                       __u8    objnamel; /* Not 16 bits since max val is 16 */
-                       __u8    objname[16]; /* Not zero terminated */
                } dnports;
 
                __be32          spi;
index 425b3a57ac74a01d12f8f3d714b66cd9d7dbcb04..617b672b1132e7fa3ff5f9c940b1692520dc8483 100644 (file)
@@ -63,13 +63,11 @@ struct ieee80211softmac_wpa {
 
 /*
  * Information about association
- *
- * Do we need a lock for this?
- * We only ever use this structure inlined
- * into our global struct. I've used its lock,
- * but maybe we need a local one here?
  */
 struct ieee80211softmac_assoc_info {
+
+       struct mutex mutex;
+
        /*
         * This is the requested ESSID. It is written
         * only by the WX handlers.
@@ -99,12 +97,13 @@ struct ieee80211softmac_assoc_info {
         *
         * bssfixed is used for SIOCSIWAP.
         */
-       u8 static_essid:1,
-          short_preamble_available:1,
-          associating:1,
-          assoc_wait:1,
-          bssvalid:1,
-          bssfixed:1;
+       u8 static_essid;
+       u8 short_preamble_available;
+       u8 associating;
+       u8 associated;
+       u8 assoc_wait;
+       u8 bssvalid;
+       u8 bssfixed;
 
        /* Scan retries remaining */
        int scan_retry;
@@ -229,12 +228,10 @@ struct ieee80211softmac_device {
        /* private stuff follows */
        /* this lock protects this structure */
        spinlock_t lock;
-       
-       /* couple of flags */
-       u8 scanning:1, /* protects scanning from being done multiple times at once */
-          associated:1,
-          running:1;
-       
+
+       u8 running; /* SoftMAC started? */
+       u8 scanning;
+
        struct ieee80211softmac_scaninfo *scaninfo;
        struct ieee80211softmac_assoc_info associnfo;
        struct ieee80211softmac_bss_info bssinfo;
@@ -250,7 +247,7 @@ struct ieee80211softmac_device {
 
        /* we need to keep a list of network structs we copied */
        struct list_head network_list;
-       
+
        /* This must be the last item so that it points to the data
         * allocated beyond this structure by alloc_ieee80211 */
        u8 priv[0];
@@ -295,7 +292,7 @@ static inline u8 ieee80211softmac_suggest_txrate(struct ieee80211softmac_device
 {
        struct ieee80211softmac_txrates *txrates = &mac->txrates;
 
-       if (!mac->associated)
+       if (!mac->associnfo.associated)
                return txrates->mgt_mcast_rate;
 
        /* We are associated, sending unicast frame */
index 925573fd2aed04a91e41c0de1b84bf09f68e06c5..aa10a8178e7011532d63e66ef0d0d08dfc583634 100644 (file)
 
 struct inet_peer
 {
+       /* group together avl_left,avl_right,v4daddr to speedup lookups */
        struct inet_peer        *avl_left, *avl_right;
-       struct inet_peer        *unused_next, **unused_prevp;
-       unsigned long           dtime;          /* the time of last use of not
-                                                * referenced entries */
-       atomic_t                refcnt;
        __be32                  v4daddr;        /* peer's address */
        __u16                   avl_height;
        __u16                   ip_id_count;    /* IP ID for the next packet */
+       struct inet_peer        *unused_next, **unused_prevp;
+       __u32                   dtime;          /* the time of last use of not
+                                                * referenced entries */
+       atomic_t                refcnt;
        atomic_t                rid;            /* Frag reception counter */
        __u32                   tcp_ts;
        unsigned long           tcp_ts_stamp;
@@ -35,21 +36,8 @@ void                 inet_initpeers(void) __init;
 /* can be called with or without local BH being disabled */
 struct inet_peer       *inet_getpeer(__be32 daddr, int create);
 
-extern spinlock_t inet_peer_unused_lock;
-extern struct inet_peer **inet_peer_unused_tailp;
 /* can be called from BH context or outside */
-static inline void     inet_putpeer(struct inet_peer *p)
-{
-       spin_lock_bh(&inet_peer_unused_lock);
-       if (atomic_dec_and_test(&p->refcnt)) {
-               p->unused_prevp = inet_peer_unused_tailp;
-               p->unused_next = NULL;
-               *inet_peer_unused_tailp = p;
-               inet_peer_unused_tailp = &p->unused_next;
-               p->dtime = jiffies;
-       }
-       spin_unlock_bh(&inet_peer_unused_lock);
-}
+extern void inet_putpeer(struct inet_peer *p);
 
 extern spinlock_t inet_peer_idlock;
 /* can be called with or without local BH being disabled */
index 6ca6b71dfe0f07406f9222092da64559358df696..c14b70ed4c57b247f8fd0a31b8a8329b5e222016 100644 (file)
@@ -36,13 +36,6 @@ struct route_info {
 #define RT6_LOOKUP_F_REACHABLE 0x2
 #define RT6_LOOKUP_F_HAS_SADDR 0x4
 
-struct pol_chain {
-       int                     type;
-       int                     priority;
-       struct fib6_node        *rules;
-       struct pol_chain        *next;
-};
-
 extern struct rt6_info ip6_null_entry;
 
 #ifdef CONFIG_IPV6_MULTIPLE_TABLES
index 82229146bac7f127156050880edc5c150f0de882..949b932d2f08c8f72017f8d61ce1f773192f55e0 100644 (file)
 #include <net/fib_rules.h>
 
 struct fib_config {
-       u8                      fc_family;
        u8                      fc_dst_len;
-       u8                      fc_src_len;
        u8                      fc_tos;
        u8                      fc_protocol;
        u8                      fc_scope;
        u8                      fc_type;
-       /* 1 byte unused */
+       /* 3 bytes unused */
        u32                     fc_table;
        __be32                  fc_dst;
-       __be32                  fc_src;
        __be32                  fc_gw;
        int                     fc_oif;
        u32                     fc_flags;
index 113337c27955491f26c226176a3ade75a4ada829..12c214b9eadf8b8d7da0f7c0eb12c08512193049 100644 (file)
@@ -136,7 +136,7 @@ struct netlbl_lsm_secattr {
  * on success, NULL on failure.
  *
  */
-static inline struct netlbl_lsm_cache *netlbl_secattr_cache_alloc(int flags)
+static inline struct netlbl_lsm_cache *netlbl_secattr_cache_alloc(gfp_t flags)
 {
        struct netlbl_lsm_cache *cache;
 
index 40bb90ebb2d1b24e11134b08c21ab47f59f68e75..ac286a35303288eddbf2171bced23f79cd11da7c 100644 (file)
@@ -884,8 +884,7 @@ static inline int sk_filter(struct sock *sk, struct sk_buff *skb)
 
 /**
  *     sk_filter_release: Release a socket filter
- *     @sk: socket
- *     @fp: filter to remove
+ *     @rcu: rcu_head that contains the sk_filter info to remove
  *
  *     Remove a filter from a socket and release its resources.
  */
index 10382931eead561940c023bd1b376863b9b11dab..c8b2624af1767398632f68825014c825fbb7fe8e 100644 (file)
@@ -1,5 +1,6 @@
 config DEFCONFIG_LIST
        string
+       depends on !UML
        option defconfig_list
        default "/lib/modules/$UNAME_RELEASE/.config"
        default "/etc/kernel-config"
index ee123243fb530b4d4e589f731c5bfa4652148dc8..36f608a7cfbaf0fe1e2d3b1f37ff42e945bc100d 100644 (file)
@@ -503,6 +503,7 @@ asmlinkage void __init start_kernel(void)
        printk(KERN_NOTICE);
        printk(linux_banner);
        setup_arch(&command_line);
+       unwind_setup();
        setup_per_cpu_areas();
        smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */
 
index 32c96628463eb46bab59ff81928d44e573711170..27dd3ee47099dd49c26790adf40b42efa1b950a3 100644 (file)
@@ -19,7 +19,7 @@
 static DEFINE_MUTEX(cpu_add_remove_lock);
 static DEFINE_MUTEX(cpu_bitmask_lock);
 
-static __cpuinitdata BLOCKING_NOTIFIER_HEAD(cpu_chain);
+static __cpuinitdata RAW_NOTIFIER_HEAD(cpu_chain);
 
 /* If set, cpu_up and cpu_down will return -EBUSY and do nothing.
  * Should always be manipulated under cpu_add_remove_lock
@@ -68,7 +68,11 @@ EXPORT_SYMBOL_GPL(unlock_cpu_hotplug);
 /* Need to know about CPUs going up/down? */
 int __cpuinit register_cpu_notifier(struct notifier_block *nb)
 {
-       return blocking_notifier_chain_register(&cpu_chain, nb);
+       int ret;
+       mutex_lock(&cpu_add_remove_lock);
+       ret = raw_notifier_chain_register(&cpu_chain, nb);
+       mutex_unlock(&cpu_add_remove_lock);
+       return ret;
 }
 
 #ifdef CONFIG_HOTPLUG_CPU
@@ -77,7 +81,9 @@ EXPORT_SYMBOL(register_cpu_notifier);
 
 void unregister_cpu_notifier(struct notifier_block *nb)
 {
-       blocking_notifier_chain_unregister(&cpu_chain, nb);
+       mutex_lock(&cpu_add_remove_lock);
+       raw_notifier_chain_unregister(&cpu_chain, nb);
+       mutex_unlock(&cpu_add_remove_lock);
 }
 EXPORT_SYMBOL(unregister_cpu_notifier);
 
@@ -126,7 +132,7 @@ static int _cpu_down(unsigned int cpu)
        if (!cpu_online(cpu))
                return -EINVAL;
 
-       err = blocking_notifier_call_chain(&cpu_chain, CPU_DOWN_PREPARE,
+       err = raw_notifier_call_chain(&cpu_chain, CPU_DOWN_PREPARE,
                                                (void *)(long)cpu);
        if (err == NOTIFY_BAD) {
                printk("%s: attempt to take down CPU %u failed\n",
@@ -146,7 +152,7 @@ static int _cpu_down(unsigned int cpu)
 
        if (IS_ERR(p)) {
                /* CPU didn't die: tell everyone.  Can't complain. */
-               if (blocking_notifier_call_chain(&cpu_chain, CPU_DOWN_FAILED,
+               if (raw_notifier_call_chain(&cpu_chain, CPU_DOWN_FAILED,
                                (void *)(long)cpu) == NOTIFY_BAD)
                        BUG();
 
@@ -169,7 +175,7 @@ static int _cpu_down(unsigned int cpu)
        put_cpu();
 
        /* CPU is completely dead: tell everyone.  Too late to complain. */
-       if (blocking_notifier_call_chain(&cpu_chain, CPU_DEAD,
+       if (raw_notifier_call_chain(&cpu_chain, CPU_DEAD,
                        (void *)(long)cpu) == NOTIFY_BAD)
                BUG();
 
@@ -206,7 +212,7 @@ static int __devinit _cpu_up(unsigned int cpu)
        if (cpu_online(cpu) || !cpu_present(cpu))
                return -EINVAL;
 
-       ret = blocking_notifier_call_chain(&cpu_chain, CPU_UP_PREPARE, hcpu);
+       ret = raw_notifier_call_chain(&cpu_chain, CPU_UP_PREPARE, hcpu);
        if (ret == NOTIFY_BAD) {
                printk("%s: attempt to bring up CPU %u failed\n",
                                __FUNCTION__, cpu);
@@ -223,11 +229,11 @@ static int __devinit _cpu_up(unsigned int cpu)
        BUG_ON(!cpu_online(cpu));
 
        /* Now call notifier in preparation. */
-       blocking_notifier_call_chain(&cpu_chain, CPU_ONLINE, hcpu);
+       raw_notifier_call_chain(&cpu_chain, CPU_ONLINE, hcpu);
 
 out_notify:
        if (ret != 0)
-               blocking_notifier_call_chain(&cpu_chain,
+               raw_notifier_call_chain(&cpu_chain,
                                CPU_UP_CANCELED, hcpu);
 
        return ret;
index 7dc6140baac69325f1ce2fa08fa9bd858aa57258..29ebb30850eda41f743cdacb6d7bb0f696872a87 100644 (file)
@@ -984,6 +984,8 @@ static struct task_struct *copy_process(unsigned long clone_flags,
        if (!p)
                goto fork_out;
 
+       rt_mutex_init_task(p);
+
 #ifdef CONFIG_TRACE_IRQFLAGS
        DEBUG_LOCKS_WARN_ON(!p->hardirqs_enabled);
        DEBUG_LOCKS_WARN_ON(!p->softirqs_enabled);
@@ -1088,8 +1090,6 @@ static struct task_struct *copy_process(unsigned long clone_flags,
        p->lockdep_recursion = 0;
 #endif
 
-       rt_mutex_init_task(p);
-
 #ifdef CONFIG_DEBUG_MUTEXES
        p->blocked_on = NULL; /* not blocked yet */
 #endif
index 11c99697acfe9149ff4ebc9adde4b78caa7c9ca5..2d0dc3efe8137452f2ebfa194e84ff157573e66d 100644 (file)
@@ -499,7 +499,8 @@ handle_percpu_irq(unsigned int irq, struct irq_desc *desc)
 #endif /* CONFIG_SMP */
 
 void
-__set_irq_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained)
+__set_irq_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained,
+                 const char *name)
 {
        struct irq_desc *desc;
        unsigned long flags;
@@ -540,6 +541,7 @@ __set_irq_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained)
                desc->depth = 1;
        }
        desc->handle_irq = handle;
+       desc->name = name;
 
        if (handle != handle_bad_irq && is_chained) {
                desc->status &= ~IRQ_DISABLED;
@@ -555,30 +557,13 @@ set_irq_chip_and_handler(unsigned int irq, struct irq_chip *chip,
                         irq_flow_handler_t handle)
 {
        set_irq_chip(irq, chip);
-       __set_irq_handler(irq, handle, 0);
+       __set_irq_handler(irq, handle, 0, NULL);
 }
 
-/*
- * Get a descriptive string for the highlevel handler, for
- * /proc/interrupts output:
- */
-const char *
-handle_irq_name(irq_flow_handler_t handle)
+void
+set_irq_chip_and_handler_name(unsigned int irq, struct irq_chip *chip,
+                             irq_flow_handler_t handle, const char *name)
 {
-       if (handle == handle_level_irq)
-               return "level  ";
-       if (handle == handle_fasteoi_irq)
-               return "fasteoi";
-       if (handle == handle_edge_irq)
-               return "edge   ";
-       if (handle == handle_simple_irq)
-               return "simple ";
-#ifdef CONFIG_SMP
-       if (handle == handle_percpu_irq)
-               return "percpu ";
-#endif
-       if (handle == handle_bad_irq)
-               return "bad    ";
-
-       return NULL;
+       set_irq_chip(irq, chip);
+       __set_irq_handler(irq, handle, 0, name);
 }
index 805a322a56557f01b031e7905c43686cdb49a83e..b739be2a6dc9adff9eb6a471a0044bbeedb54976 100644 (file)
@@ -575,6 +575,8 @@ static noinline int print_circular_bug_tail(void)
        return 0;
 }
 
+#define RECURSION_LIMIT 40
+
 static int noinline print_infinite_recursion_bug(void)
 {
        __raw_spin_unlock(&hash_lock);
@@ -595,7 +597,7 @@ check_noncircular(struct lock_class *source, unsigned int depth)
        debug_atomic_inc(&nr_cyclic_check_recursions);
        if (depth > max_recursion_depth)
                max_recursion_depth = depth;
-       if (depth >= 20)
+       if (depth >= RECURSION_LIMIT)
                return print_infinite_recursion_bug();
        /*
         * Check this lock's dependency list:
@@ -645,7 +647,7 @@ find_usage_forwards(struct lock_class *source, unsigned int depth)
 
        if (depth > max_recursion_depth)
                max_recursion_depth = depth;
-       if (depth >= 20)
+       if (depth >= RECURSION_LIMIT)
                return print_infinite_recursion_bug();
 
        debug_atomic_inc(&nr_find_usage_forwards_checks);
@@ -684,7 +686,7 @@ find_usage_backwards(struct lock_class *source, unsigned int depth)
 
        if (depth > max_recursion_depth)
                max_recursion_depth = depth;
-       if (depth >= 20)
+       if (depth >= RECURSION_LIMIT)
                return print_infinite_recursion_bug();
 
        debug_atomic_inc(&nr_find_usage_backwards_checks);
@@ -1174,7 +1176,7 @@ look_up_lock_class(struct lockdep_map *lock, unsigned int subclass)
  * itself, so actual lookup of the hash should be once per lock object.
  */
 static inline struct lock_class *
-register_lock_class(struct lockdep_map *lock, unsigned int subclass)
+register_lock_class(struct lockdep_map *lock, unsigned int subclass, int force)
 {
        struct lockdep_subclass_key *key;
        struct list_head *hash_head;
@@ -1246,7 +1248,7 @@ register_lock_class(struct lockdep_map *lock, unsigned int subclass)
 out_unlock_set:
        __raw_spin_unlock(&hash_lock);
 
-       if (!subclass)
+       if (!subclass || force)
                lock->class_cache = class;
 
        DEBUG_LOCKS_WARN_ON(class->subclass != subclass);
@@ -1934,7 +1936,7 @@ void trace_softirqs_off(unsigned long ip)
  * Initialize a lock instance's lock-class mapping info:
  */
 void lockdep_init_map(struct lockdep_map *lock, const char *name,
-                     struct lock_class_key *key)
+                     struct lock_class_key *key, int subclass)
 {
        if (unlikely(!debug_locks))
                return;
@@ -1954,6 +1956,8 @@ void lockdep_init_map(struct lockdep_map *lock, const char *name,
        lock->name = name;
        lock->key = key;
        lock->class_cache = NULL;
+       if (subclass)
+               register_lock_class(lock, subclass, 1);
 }
 
 EXPORT_SYMBOL_GPL(lockdep_init_map);
@@ -1992,7 +1996,7 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass,
         * Not cached yet or subclass?
         */
        if (unlikely(!class)) {
-               class = register_lock_class(lock, subclass);
+               class = register_lock_class(lock, subclass, 0);
                if (!class)
                        return 0;
        }
index e3203c654dda80ab646ffcbd4b0306e942fde846..18651641a7b5aa6482e0aa73ce03b5133e6ffa91 100644 (file)
@@ -91,7 +91,7 @@ void debug_mutex_init(struct mutex *lock, const char *name,
         * Make sure we are not reinitializing a held lock:
         */
        debug_check_no_locks_freed((void *)lock, sizeof(*lock));
-       lockdep_init_map(&lock->dep_map, name, key);
+       lockdep_init_map(&lock->dep_map, name, key, 0);
 #endif
        lock->owner = NULL;
        lock->magic = lock;
index 6ebdb82a0ce43a5211e3862008959cb5091febcd..674aceb7335ad56f7a2a8ba2996d0faa4ed850db 100644 (file)
@@ -44,11 +44,9 @@ static inline struct nsproxy *clone_namespaces(struct nsproxy *orig)
 {
        struct nsproxy *ns;
 
-       ns = kmalloc(sizeof(struct nsproxy), GFP_KERNEL);
-       if (ns) {
-               memcpy(ns, orig, sizeof(struct nsproxy));
+       ns = kmemdup(orig, sizeof(struct nsproxy), GFP_KERNEL);
+       if (ns)
                atomic_set(&ns->count, 1);
-       }
        return ns;
 }
 
index 479b16b44f79f6b639683c724405f51b3ecc156f..7c3e1e6dfb5b5eef84f61f6259e764703846d9fd 100644 (file)
@@ -87,6 +87,19 @@ static inline union cpu_time_count cpu_time_sub(const clockid_t which_clock,
        return a;
 }
 
+/*
+ * Divide and limit the result to res >= 1
+ *
+ * This is necessary to prevent signal delivery starvation, when the result of
+ * the division would be rounded down to 0.
+ */
+static inline cputime_t cputime_div_non_zero(cputime_t time, unsigned long div)
+{
+       cputime_t res = cputime_div(time, div);
+
+       return max_t(cputime_t, res, 1);
+}
+
 /*
  * Update expiry time from increment, and increase overrun count,
  * given the current clock sample.
@@ -483,8 +496,8 @@ static void process_timer_rebalance(struct task_struct *p,
                BUG();
                break;
        case CPUCLOCK_PROF:
-               left = cputime_div(cputime_sub(expires.cpu, val.cpu),
-                                  nthreads);
+               left = cputime_div_non_zero(cputime_sub(expires.cpu, val.cpu),
+                                      nthreads);
                do {
                        if (likely(!(t->flags & PF_EXITING))) {
                                ticks = cputime_add(prof_ticks(t), left);
@@ -498,8 +511,8 @@ static void process_timer_rebalance(struct task_struct *p,
                } while (t != p);
                break;
        case CPUCLOCK_VIRT:
-               left = cputime_div(cputime_sub(expires.cpu, val.cpu),
-                                  nthreads);
+               left = cputime_div_non_zero(cputime_sub(expires.cpu, val.cpu),
+                                      nthreads);
                do {
                        if (likely(!(t->flags & PF_EXITING))) {
                                ticks = cputime_add(virt_ticks(t), left);
@@ -515,6 +528,7 @@ static void process_timer_rebalance(struct task_struct *p,
        case CPUCLOCK_SCHED:
                nsleft = expires.sched - val.sched;
                do_div(nsleft, nthreads);
+               nsleft = max_t(unsigned long long, nsleft, 1);
                do {
                        if (likely(!(t->flags & PF_EXITING))) {
                                ns = t->sched_time + nsleft;
@@ -1159,12 +1173,13 @@ static void check_process_timers(struct task_struct *tsk,
 
                prof_left = cputime_sub(prof_expires, utime);
                prof_left = cputime_sub(prof_left, stime);
-               prof_left = cputime_div(prof_left, nthreads);
+               prof_left = cputime_div_non_zero(prof_left, nthreads);
                virt_left = cputime_sub(virt_expires, utime);
-               virt_left = cputime_div(virt_left, nthreads);
+               virt_left = cputime_div_non_zero(virt_left, nthreads);
                if (sched_expires) {
                        sched_left = sched_expires - sched_time;
                        do_div(sched_left, nthreads);
+                       sched_left = max_t(unsigned long long, sched_left, 1);
                } else {
                        sched_left = 0;
                }
index 9b2ee5344dee10b51ae4f0d1fda84b1aa99d3de4..1a3b0dd2c3fcc18b2db25fc7472560cb67edfb7e 100644 (file)
@@ -425,7 +425,8 @@ static int submit(int rw, pgoff_t page_off, struct page *page,
                        bio_set_pages_dirty(bio);
                bio_put(bio);
        } else {
-               get_page(page);
+               if (rw == READ)
+                       get_page(page); /* These pages are freed later */
                bio->bi_private = *bio_chain;
                *bio_chain = bio;
                submit_bio(rw | (1 << BIO_RW_SYNC), bio);
index 094b5687eef6da6864ae30bb1ce4d936a5552151..3399701c680e392f46e21829cee8da0bf5482303 100644 (file)
 #define TASK_PREEMPTS_CURR(p, rq) \
        ((p)->prio < (rq)->curr->prio)
 
-/*
- * task_timeslice() scales user-nice values [ -20 ... 0 ... 19 ]
- * to time slice values: [800ms ... 100ms ... 5ms]
- *
- * The higher a thread's priority, the bigger timeslices
- * it gets during one round of execution. But even the lowest
- * priority thread gets MIN_TIMESLICE worth of execution time.
- */
-
 #define SCALE_PRIO(x, prio) \
        max(x * (MAX_PRIO - prio) / (MAX_USER_PRIO / 2), MIN_TIMESLICE)
 
@@ -180,6 +171,15 @@ static unsigned int static_prio_timeslice(int static_prio)
                return SCALE_PRIO(DEF_TIMESLICE, static_prio);
 }
 
+/*
+ * task_timeslice() scales user-nice values [ -20 ... 0 ... 19 ]
+ * to time slice values: [800ms ... 100ms ... 5ms]
+ *
+ * The higher a thread's priority, the bigger timeslices
+ * it gets during one round of execution. But even the lowest
+ * priority thread gets MIN_TIMESLICE worth of execution time.
+ */
+
 static inline unsigned int task_timeslice(struct task_struct *p)
 {
        return static_prio_timeslice(p->static_prio);
index 7a3b2e75f0402122ced8b15d5488a6b9de49ee8e..0e53314b14de7124456faa2ea6cc0f7aa87fcdb9 100644 (file)
@@ -49,6 +49,7 @@ cond_syscall(compat_sys_get_robust_list);
 cond_syscall(sys_epoll_create);
 cond_syscall(sys_epoll_ctl);
 cond_syscall(sys_epoll_wait);
+cond_syscall(sys_epoll_pwait);
 cond_syscall(sys_semget);
 cond_syscall(sys_semop);
 cond_syscall(sys_semtimedop);
index 8020fb273c4f1d0ddce105037bc7803b3c98331a..8bff2c18fb5ae1f697cd764feb4d7fb963309f83 100644 (file)
@@ -136,8 +136,10 @@ static int parse_table(int __user *, int, void __user *, size_t __user *,
 static int proc_do_uts_string(ctl_table *table, int write, struct file *filp,
                  void __user *buffer, size_t *lenp, loff_t *ppos);
 
+#ifdef CONFIG_PROC_SYSCTL
 static int proc_do_cad_pid(ctl_table *table, int write, struct file *filp,
                  void __user *buffer, size_t *lenp, loff_t *ppos);
+#endif
 
 static ctl_table root_table[];
 static struct ctl_table_header root_table_header =
@@ -542,6 +544,7 @@ static ctl_table kern_table[] = {
                .proc_handler   = &proc_dointvec,
        },
 #endif
+#ifdef CONFIG_PROC_SYSCTL
        {
                .ctl_name       = KERN_CADPID,
                .procname       = "cad_pid",
@@ -550,6 +553,7 @@ static ctl_table kern_table[] = {
                .mode           = 0600,
                .proc_handler   = &proc_do_cad_pid,
        },
+#endif
        {
                .ctl_name       = KERN_MAX_THREADS,
                .procname       = "threads-max",
index 126bb30c4afe42b01b78945d2105033f994979b3..a99b2a6e6a07354781da79b6067b1944d438d5f9 100644 (file)
@@ -57,7 +57,7 @@ static cycle_t jiffies_read(void)
 
 struct clocksource clocksource_jiffies = {
        .name           = "jiffies",
-       .rating         = 0, /* lowest rating*/
+       .rating         = 1, /* lowest valid rating*/
        .read           = jiffies_read,
        .mask           = 0xffffffff, /*32bits*/
        .mult           = NSEC_PER_JIFFY << JIFFIES_SHIFT, /* details above */
index 2e2368607aab1a8293739315d832c608463d8d5f..f7e50d16dbf6b6ba55980dda3e0841d0a9d0d394 100644 (file)
 
 #include <linux/unwind.h>
 #include <linux/module.h>
-#include <linux/delay.h>
+#include <linux/bootmem.h>
+#include <linux/sort.h>
 #include <linux/stop_machine.h>
 #include <asm/sections.h>
 #include <asm/uaccess.h>
 #include <asm/unaligned.h>
 
 extern char __start_unwind[], __end_unwind[];
+extern const u8 __start_unwind_hdr[], __end_unwind_hdr[];
 
 #define MAX_STACK_DEPTH 8
 
@@ -100,6 +102,8 @@ static struct unwind_table {
        } core, init;
        const void *address;
        unsigned long size;
+       const unsigned char *header;
+       unsigned long hdrsz;
        struct unwind_table *link;
        const char *name;
 } root_table;
@@ -145,6 +149,10 @@ static struct unwind_table *find_table(unsigned long pc)
        return table;
 }
 
+static unsigned long read_pointer(const u8 **pLoc,
+                                  const void *end,
+                                  signed ptrType);
+
 static void init_unwind_table(struct unwind_table *table,
                               const char *name,
                               const void *core_start,
@@ -152,14 +160,30 @@ static void init_unwind_table(struct unwind_table *table,
                               const void *init_start,
                               unsigned long init_size,
                               const void *table_start,
-                              unsigned long table_size)
+                              unsigned long table_size,
+                              const u8 *header_start,
+                              unsigned long header_size)
 {
+       const u8 *ptr = header_start + 4;
+       const u8 *end = header_start + header_size;
+
        table->core.pc = (unsigned long)core_start;
        table->core.range = core_size;
        table->init.pc = (unsigned long)init_start;
        table->init.range = init_size;
        table->address = table_start;
        table->size = table_size;
+       /* See if the linker provided table looks valid. */
+       if (header_size <= 4
+           || header_start[0] != 1
+           || (void *)read_pointer(&ptr, end, header_start[1]) != table_start
+           || header_start[2] == DW_EH_PE_omit
+           || read_pointer(&ptr, end, header_start[2]) <= 0
+           || header_start[3] == DW_EH_PE_omit)
+               header_start = NULL;
+       table->hdrsz = header_size;
+       smp_wmb();
+       table->header = header_start;
        table->link = NULL;
        table->name = name;
 }
@@ -169,7 +193,143 @@ void __init unwind_init(void)
        init_unwind_table(&root_table, "kernel",
                          _text, _end - _text,
                          NULL, 0,
-                         __start_unwind, __end_unwind - __start_unwind);
+                         __start_unwind, __end_unwind - __start_unwind,
+                         __start_unwind_hdr, __end_unwind_hdr - __start_unwind_hdr);
+}
+
+static const u32 bad_cie, not_fde;
+static const u32 *cie_for_fde(const u32 *fde, const struct unwind_table *);
+static signed fde_pointer_type(const u32 *cie);
+
+struct eh_frame_hdr_table_entry {
+       unsigned long start, fde;
+};
+
+static int cmp_eh_frame_hdr_table_entries(const void *p1, const void *p2)
+{
+       const struct eh_frame_hdr_table_entry *e1 = p1;
+       const struct eh_frame_hdr_table_entry *e2 = p2;
+
+       return (e1->start > e2->start) - (e1->start < e2->start);
+}
+
+static void swap_eh_frame_hdr_table_entries(void *p1, void *p2, int size)
+{
+       struct eh_frame_hdr_table_entry *e1 = p1;
+       struct eh_frame_hdr_table_entry *e2 = p2;
+       unsigned long v;
+
+       v = e1->start;
+       e1->start = e2->start;
+       e2->start = v;
+       v = e1->fde;
+       e1->fde = e2->fde;
+       e2->fde = v;
+}
+
+static void __init setup_unwind_table(struct unwind_table *table,
+                                       void *(*alloc)(unsigned long))
+{
+       const u8 *ptr;
+       unsigned long tableSize = table->size, hdrSize;
+       unsigned n;
+       const u32 *fde;
+       struct {
+               u8 version;
+               u8 eh_frame_ptr_enc;
+               u8 fde_count_enc;
+               u8 table_enc;
+               unsigned long eh_frame_ptr;
+               unsigned int fde_count;
+               struct eh_frame_hdr_table_entry table[];
+       } __attribute__((__packed__)) *header;
+
+       if (table->header)
+               return;
+
+       if (table->hdrsz)
+               printk(KERN_WARNING ".eh_frame_hdr for '%s' present but unusable\n",
+                      table->name);
+
+       if (tableSize & (sizeof(*fde) - 1))
+               return;
+
+       for (fde = table->address, n = 0;
+            tableSize > sizeof(*fde) && tableSize - sizeof(*fde) >= *fde;
+            tableSize -= sizeof(*fde) + *fde, fde += 1 + *fde / sizeof(*fde)) {
+               const u32 *cie = cie_for_fde(fde, table);
+               signed ptrType;
+
+               if (cie == &not_fde)
+                       continue;
+               if (cie == NULL
+                   || cie == &bad_cie
+                   || (ptrType = fde_pointer_type(cie)) < 0)
+                       return;
+               ptr = (const u8 *)(fde + 2);
+               if (!read_pointer(&ptr,
+                                 (const u8 *)(fde + 1) + *fde,
+                                 ptrType))
+                       return;
+               ++n;
+       }
+
+       if (tableSize || !n)
+               return;
+
+       hdrSize = 4 + sizeof(unsigned long) + sizeof(unsigned int)
+               + 2 * n * sizeof(unsigned long);
+       header = alloc(hdrSize);
+       if (!header)
+               return;
+       header->version          = 1;
+       header->eh_frame_ptr_enc = DW_EH_PE_abs|DW_EH_PE_native;
+       header->fde_count_enc    = DW_EH_PE_abs|DW_EH_PE_data4;
+       header->table_enc        = DW_EH_PE_abs|DW_EH_PE_native;
+       put_unaligned((unsigned long)table->address, &header->eh_frame_ptr);
+       BUILD_BUG_ON(offsetof(typeof(*header), fde_count)
+                    % __alignof(typeof(header->fde_count)));
+       header->fde_count        = n;
+
+       BUILD_BUG_ON(offsetof(typeof(*header), table)
+                    % __alignof(typeof(*header->table)));
+       for (fde = table->address, tableSize = table->size, n = 0;
+            tableSize;
+            tableSize -= sizeof(*fde) + *fde, fde += 1 + *fde / sizeof(*fde)) {
+               const u32 *cie = fde + 1 - fde[1] / sizeof(*fde);
+
+               if (!fde[1])
+                       continue; /* this is a CIE */
+               ptr = (const u8 *)(fde + 2);
+               header->table[n].start = read_pointer(&ptr,
+                                                     (const u8 *)(fde + 1) + *fde,
+                                                     fde_pointer_type(cie));
+               header->table[n].fde = (unsigned long)fde;
+               ++n;
+       }
+       WARN_ON(n != header->fde_count);
+
+       sort(header->table,
+            n,
+            sizeof(*header->table),
+            cmp_eh_frame_hdr_table_entries,
+            swap_eh_frame_hdr_table_entries);
+
+       table->hdrsz = hdrSize;
+       smp_wmb();
+       table->header = (const void *)header;
+}
+
+static void *__init balloc(unsigned long sz)
+{
+       return __alloc_bootmem_nopanic(sz,
+                                      sizeof(unsigned int),
+                                      __pa(MAX_DMA_ADDRESS));
+}
+
+void __init unwind_setup(void)
+{
+       setup_unwind_table(&root_table, balloc);
 }
 
 #ifdef CONFIG_MODULES
@@ -193,7 +353,8 @@ void *unwind_add_table(struct module *module,
        init_unwind_table(table, module->name,
                          module->module_core, module->core_size,
                          module->module_init, module->init_size,
-                         table_start, table_size);
+                         table_start, table_size,
+                         NULL, 0);
 
        if (last_table)
                last_table->link = table;
@@ -303,6 +464,26 @@ static sleb128_t get_sleb128(const u8 **pcur, const u8 *end)
        return value;
 }
 
+static const u32 *cie_for_fde(const u32 *fde, const struct unwind_table *table)
+{
+       const u32 *cie;
+
+       if (!*fde || (*fde & (sizeof(*fde) - 1)))
+               return &bad_cie;
+       if (!fde[1])
+               return &not_fde; /* this is a CIE */
+       if ((fde[1] & (sizeof(*fde) - 1))
+           || fde[1] > (unsigned long)(fde + 1) - (unsigned long)table->address)
+               return NULL; /* this is not a valid FDE */
+       cie = fde + 1 - fde[1] / sizeof(*fde);
+       if (*cie <= sizeof(*cie) + 4
+           || *cie >= fde[1] - sizeof(*fde)
+           || (*cie & (sizeof(*cie) - 1))
+           || cie[1])
+               return NULL; /* this is not a (valid) CIE */
+       return cie;
+}
+
 static unsigned long read_pointer(const u8 **pLoc,
                                   const void *end,
                                   signed ptrType)
@@ -610,49 +791,108 @@ int unwind(struct unwind_frame_info *frame)
        unsigned i;
        signed ptrType = -1;
        uleb128_t retAddrReg = 0;
-       struct unwind_table *table;
+       const struct unwind_table *table;
        struct unwind_state state;
 
        if (UNW_PC(frame) == 0)
                return -EINVAL;
        if ((table = find_table(pc)) != NULL
            && !(table->size & (sizeof(*fde) - 1))) {
-               unsigned long tableSize = table->size;
-
-               for (fde = table->address;
-                    tableSize > sizeof(*fde) && tableSize - sizeof(*fde) >= *fde;
-                    tableSize -= sizeof(*fde) + *fde,
-                    fde += 1 + *fde / sizeof(*fde)) {
-                       if (!*fde || (*fde & (sizeof(*fde) - 1)))
-                               break;
-                       if (!fde[1])
-                               continue; /* this is a CIE */
-                       if ((fde[1] & (sizeof(*fde) - 1))
-                           || fde[1] > (unsigned long)(fde + 1)
-                                       - (unsigned long)table->address)
-                               continue; /* this is not a valid FDE */
-                       cie = fde + 1 - fde[1] / sizeof(*fde);
-                       if (*cie <= sizeof(*cie) + 4
-                           || *cie >= fde[1] - sizeof(*fde)
-                           || (*cie & (sizeof(*cie) - 1))
-                           || cie[1]
-                           || (ptrType = fde_pointer_type(cie)) < 0) {
-                               cie = NULL; /* this is not a (valid) CIE */
-                               continue;
+               const u8 *hdr = table->header;
+               unsigned long tableSize;
+
+               smp_rmb();
+               if (hdr && hdr[0] == 1) {
+                       switch(hdr[3] & DW_EH_PE_FORM) {
+                       case DW_EH_PE_native: tableSize = sizeof(unsigned long); break;
+                       case DW_EH_PE_data2: tableSize = 2; break;
+                       case DW_EH_PE_data4: tableSize = 4; break;
+                       case DW_EH_PE_data8: tableSize = 8; break;
+                       default: tableSize = 0; break;
+                       }
+                       ptr = hdr + 4;
+                       end = hdr + table->hdrsz;
+                       if (tableSize
+                           && read_pointer(&ptr, end, hdr[1])
+                              == (unsigned long)table->address
+                           && (i = read_pointer(&ptr, end, hdr[2])) > 0
+                           && i == (end - ptr) / (2 * tableSize)
+                           && !((end - ptr) % (2 * tableSize))) {
+                               do {
+                                       const u8 *cur = ptr + (i / 2) * (2 * tableSize);
+
+                                       startLoc = read_pointer(&cur,
+                                                               cur + tableSize,
+                                                               hdr[3]);
+                                       if (pc < startLoc)
+                                               i /= 2;
+                                       else {
+                                               ptr = cur - tableSize;
+                                               i = (i + 1) / 2;
+                                       }
+                               } while (startLoc && i > 1);
+                               if (i == 1
+                                   && (startLoc = read_pointer(&ptr,
+                                                               ptr + tableSize,
+                                                               hdr[3])) != 0
+                                   && pc >= startLoc)
+                                       fde = (void *)read_pointer(&ptr,
+                                                                  ptr + tableSize,
+                                                                  hdr[3]);
                        }
+               }
+
+               if (fde != NULL) {
+                       cie = cie_for_fde(fde, table);
                        ptr = (const u8 *)(fde + 2);
-                       startLoc = read_pointer(&ptr,
-                                               (const u8 *)(fde + 1) + *fde,
-                                               ptrType);
-                       endLoc = startLoc
-                                + read_pointer(&ptr,
-                                               (const u8 *)(fde + 1) + *fde,
-                                               ptrType & DW_EH_PE_indirect
-                                               ? ptrType
-                                               : ptrType & (DW_EH_PE_FORM|DW_EH_PE_signed));
-                       if (pc >= startLoc && pc < endLoc)
-                               break;
-                       cie = NULL;
+                       if(cie != NULL
+                          && cie != &bad_cie
+                          && cie != &not_fde
+                          && (ptrType = fde_pointer_type(cie)) >= 0
+                          && read_pointer(&ptr,
+                                          (const u8 *)(fde + 1) + *fde,
+                                          ptrType) == startLoc) {
+                               if (!(ptrType & DW_EH_PE_indirect))
+                                       ptrType &= DW_EH_PE_FORM|DW_EH_PE_signed;
+                               endLoc = startLoc
+                                        + read_pointer(&ptr,
+                                                       (const u8 *)(fde + 1) + *fde,
+                                                       ptrType);
+                               if(pc >= endLoc)
+                                       fde = NULL;
+                       } else
+                               fde = NULL;
+               }
+               if (fde == NULL) {
+                       for (fde = table->address, tableSize = table->size;
+                            cie = NULL, tableSize > sizeof(*fde)
+                            && tableSize - sizeof(*fde) >= *fde;
+                            tableSize -= sizeof(*fde) + *fde,
+                            fde += 1 + *fde / sizeof(*fde)) {
+                               cie = cie_for_fde(fde, table);
+                               if (cie == &bad_cie) {
+                                       cie = NULL;
+                                       break;
+                               }
+                               if (cie == NULL
+                                   || cie == &not_fde
+                                   || (ptrType = fde_pointer_type(cie)) < 0)
+                                       continue;
+                               ptr = (const u8 *)(fde + 2);
+                               startLoc = read_pointer(&ptr,
+                                                       (const u8 *)(fde + 1) + *fde,
+                                                       ptrType);
+                               if (!startLoc)
+                                       continue;
+                               if (!(ptrType & DW_EH_PE_indirect))
+                                       ptrType &= DW_EH_PE_FORM|DW_EH_PE_signed;
+                               endLoc = startLoc
+                                        + read_pointer(&ptr,
+                                                       (const u8 *)(fde + 1) + *fde,
+                                                       ptrType);
+                               if (pc >= startLoc && pc < endLoc)
+                                       break;
+                       }
                }
        }
        if (cie != NULL) {
index 59070dbfbeb4fc0b0742bd9e182644dcc9b63c66..cf98fabaa549524d2f882d06649abfaa4c91239d 100644 (file)
@@ -5,14 +5,14 @@
 lib-y := ctype.o string.o vsprintf.o cmdline.o \
         bust_spinlocks.o rbtree.o radix-tree.o dump_stack.o \
         idr.o div64.o int_sqrt.o bitmap.o extable.o prio_tree.o \
-        sha1.o irq_regs.o carta_random32.o
+        sha1.o irq_regs.o
 
 lib-$(CONFIG_MMU) += ioremap.o
 lib-$(CONFIG_SMP) += cpumask.o
 
 lib-y  += kobject.o kref.o kobject_uevent.o klist.o
 
-obj-y += sort.o parser.o halfmd4.o iomap_copy.o debug_locks.o
+obj-y += sort.o parser.o halfmd4.o iomap_copy.o debug_locks.o random32.o
 
 ifeq ($(CONFIG_DEBUG_KOBJECT),y)
 CFLAGS_kobject.o += -DDEBUG
diff --git a/lib/carta_random32.c b/lib/carta_random32.c
deleted file mode 100644 (file)
index ca82df7..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2002-2006 Hewlett-Packard Development Company, L.P.
- *     Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- */
-#include <linux/types.h>
-#include <linux/module.h>
-
-/*
- * Fast, simple, yet decent quality random number generator based on
- * a paper by David G. Carta ("Two Fast Implementations of the
- * `Minimal Standard' Random Number Generator," Communications of the
- * ACM, January, 1990).
- */
-u64 carta_random32 (u64 seed)
-{
-#       define A 16807
-#       define M ((u32) 1 << 31)
-        u64 s, prod = A * seed, p, q;
-
-        p = (prod >> 31) & (M - 1);
-        q = (prod >>  0) & (M - 1);
-        s = p + q;
-        if (s >= M)
-                s -= M - 1;
-        return s;
-}
-EXPORT_SYMBOL_GPL(carta_random32);
index 7a2a73f88d594dc73282c24e3d0304a602a10a25..3a67dc5ada7d5b2655ae461890519e995d50d7c9 100644 (file)
@@ -43,19 +43,3 @@ int __any_online_cpu(const cpumask_t *mask)
        return cpu;
 }
 EXPORT_SYMBOL(__any_online_cpu);
-
-#if MAX_NUMNODES > 1
-/*
- * Find the highest possible node id.
- */
-int highest_possible_node_id(void)
-{
-       unsigned int node;
-       unsigned int highest = 0;
-
-       for_each_node_mask(node, node_possible_map)
-               highest = node;
-       return highest;
-}
-EXPORT_SYMBOL(highest_possible_node_id);
-#endif
index 1699eb9161f34594a38cc28fbea1f0ab2db56893..7dd5c0e9d996adb07681e02037e746b68a2a2f50 100644 (file)
@@ -119,6 +119,7 @@ char *kobject_get_path(struct kobject *kobj, gfp_t gfp_mask)
 
        return path;
 }
+EXPORT_SYMBOL_GPL(kobject_get_path);
 
 /**
  *     kobject_init - initialize object.
diff --git a/lib/random32.c b/lib/random32.c
new file mode 100644 (file)
index 0000000..4a15ce5
--- /dev/null
@@ -0,0 +1,142 @@
+/*
+  This is a maximally equidistributed combined Tausworthe generator
+  based on code from GNU Scientific Library 1.5 (30 Jun 2004)
+
+   x_n = (s1_n ^ s2_n ^ s3_n)
+
+   s1_{n+1} = (((s1_n & 4294967294) <<12) ^ (((s1_n <<13) ^ s1_n) >>19))
+   s2_{n+1} = (((s2_n & 4294967288) << 4) ^ (((s2_n << 2) ^ s2_n) >>25))
+   s3_{n+1} = (((s3_n & 4294967280) <<17) ^ (((s3_n << 3) ^ s3_n) >>11))
+
+   The period of this generator is about 2^88.
+
+   From: P. L'Ecuyer, "Maximally Equidistributed Combined Tausworthe
+   Generators", Mathematics of Computation, 65, 213 (1996), 203--213.
+
+   This is available on the net from L'Ecuyer's home page,
+
+   http://www.iro.umontreal.ca/~lecuyer/myftp/papers/tausme.ps
+   ftp://ftp.iro.umontreal.ca/pub/simulation/lecuyer/papers/tausme.ps
+
+   There is an erratum in the paper "Tables of Maximally
+   Equidistributed Combined LFSR Generators", Mathematics of
+   Computation, 68, 225 (1999), 261--269:
+   http://www.iro.umontreal.ca/~lecuyer/myftp/papers/tausme2.ps
+
+        ... the k_j most significant bits of z_j must be non-
+        zero, for each j. (Note: this restriction also applies to the
+        computer code given in [4], but was mistakenly not mentioned in
+        that paper.)
+
+   This affects the seeding procedure by imposing the requirement
+   s1 > 1, s2 > 7, s3 > 15.
+
+*/
+
+#include <linux/types.h>
+#include <linux/percpu.h>
+#include <linux/module.h>
+#include <linux/random.h>
+
+struct rnd_state {
+       u32 s1, s2, s3;
+};
+
+static DEFINE_PER_CPU(struct rnd_state, net_rand_state);
+
+static u32 __random32(struct rnd_state *state)
+{
+#define TAUSWORTHE(s,a,b,c,d) ((s&c)<<d) ^ (((s <<a) ^ s)>>b)
+
+       state->s1 = TAUSWORTHE(state->s1, 13, 19, 4294967294UL, 12);
+       state->s2 = TAUSWORTHE(state->s2, 2, 25, 4294967288UL, 4);
+       state->s3 = TAUSWORTHE(state->s3, 3, 11, 4294967280UL, 17);
+
+       return (state->s1 ^ state->s2 ^ state->s3);
+}
+
+static void __set_random32(struct rnd_state *state, unsigned long s)
+{
+       if (s == 0)
+               s = 1;      /* default seed is 1 */
+
+#define LCG(n) (69069 * n)
+       state->s1 = LCG(s);
+       state->s2 = LCG(state->s1);
+       state->s3 = LCG(state->s2);
+
+       /* "warm it up" */
+       __random32(state);
+       __random32(state);
+       __random32(state);
+       __random32(state);
+       __random32(state);
+       __random32(state);
+}
+
+/**
+ *     random32 - pseudo random number generator
+ *
+ *     A 32 bit pseudo-random number is generated using a fast
+ *     algorithm suitable for simulation. This algorithm is NOT
+ *     considered safe for cryptographic use.
+ */
+u32 random32(void)
+{
+       unsigned long r;
+       struct rnd_state *state = &get_cpu_var(net_rand_state);
+       r = __random32(state);
+       put_cpu_var(state);
+       return r;
+}
+EXPORT_SYMBOL(random32);
+
+/**
+ *     srandom32 - add entropy to pseudo random number generator
+ *     @seed: seed value
+ *
+ *     Add some additional seeding to the random32() pool.
+ *     Note: this pool is per cpu so it only affects current CPU.
+ */
+void srandom32(u32 entropy)
+{
+       struct rnd_state *state = &get_cpu_var(net_rand_state);
+       __set_random32(state, state->s1 ^ entropy);
+       put_cpu_var(state);
+}
+EXPORT_SYMBOL(srandom32);
+
+/*
+ *     Generate some initially weak seeding values to allow
+ *     to start the random32() engine.
+ */
+static int __init random32_init(void)
+{
+       int i;
+
+       for_each_possible_cpu(i) {
+               struct rnd_state *state = &per_cpu(net_rand_state,i);
+               __set_random32(state, i + jiffies);
+       }
+       return 0;
+}
+core_initcall(random32_init);
+
+/*
+ *     Generate better values after random number generator
+ *     is fully initalized.
+ */
+static int __init random32_reseed(void)
+{
+       int i;
+       unsigned long seed;
+
+       for_each_possible_cpu(i) {
+               struct rnd_state *state = &per_cpu(net_rand_state,i);
+
+               get_random_bytes(&seed, sizeof(seed));
+               __set_random32(state, seed);
+       }
+       return 0;
+}
+late_initcall(random32_reseed);
index db4fed74b9407d5ec2ddae1a95247f583ab0d569..c4cfd6c0342ff1e4fbc04b9fff3b93f0d00118bd 100644 (file)
@@ -28,7 +28,7 @@ void __init_rwsem(struct rw_semaphore *sem, const char *name,
         * Make sure we are not reinitializing a held semaphore:
         */
        debug_check_no_locks_freed((void *)sem, sizeof(*sem));
-       lockdep_init_map(&sem->dep_map, name, key);
+       lockdep_init_map(&sem->dep_map, name, key, 0);
 #endif
        sem->activity = 0;
        spin_lock_init(&sem->wait_lock);
index 901d0e7da89220fae47848d349633ae43c1afd7e..cdb4e3d0560733c2706a27ccd20681017da2e34a 100644 (file)
@@ -19,7 +19,7 @@ void __init_rwsem(struct rw_semaphore *sem, const char *name,
         * Make sure we are not reinitializing a held semaphore:
         */
        debug_check_no_locks_freed((void *)sem, sizeof(*sem));
-       lockdep_init_map(&sem->dep_map, name, key);
+       lockdep_init_map(&sem->dep_map, name, key, 0);
 #endif
        sem->count = RWSEM_UNLOCKED_VALUE;
        spin_lock_init(&sem->wait_lock);
index dafaf1de2491aedb0a323aed4951e5084e58e18c..b6c4f898197c52f0b175ad0ea9e26466c338ea30 100644 (file)
@@ -20,7 +20,7 @@ void __spin_lock_init(spinlock_t *lock, const char *name,
         * Make sure we are not reinitializing a held lock:
         */
        debug_check_no_locks_freed((void *)lock, sizeof(*lock));
-       lockdep_init_map(&lock->dep_map, name, key);
+       lockdep_init_map(&lock->dep_map, name, key, 0);
 #endif
        lock->raw_lock = (raw_spinlock_t)__RAW_SPIN_LOCK_UNLOCKED;
        lock->magic = SPINLOCK_MAGIC;
@@ -38,7 +38,7 @@ void __rwlock_init(rwlock_t *lock, const char *name,
         * Make sure we are not reinitializing a held lock:
         */
        debug_check_no_locks_freed((void *)lock, sizeof(*lock));
-       lockdep_init_map(&lock->dep_map, name, key);
+       lockdep_init_map(&lock->dep_map, name, key, 0);
 #endif
        lock->raw_lock = (raw_rwlock_t) __RAW_RW_LOCK_UNLOCKED;
        lock->magic = RWLOCK_MAGIC;
index 12b3a4eee88d56a3b4d4fe6c4255fa4a1ca81352..f3c077eb0b8ef505afe79b5c13363f45edea4aad 100644 (file)
@@ -10,7 +10,8 @@ mmu-$(CONFIG_MMU)     := fremap.o highmem.o madvise.o memory.o mincore.o \
 obj-y                  := bootmem.o filemap.o mempool.o oom_kill.o fadvise.o \
                           page_alloc.o page-writeback.o pdflush.o \
                           readahead.o swap.o truncate.o vmscan.o \
-                          prio_tree.o util.o mmzone.o vmstat.o $(mmu-y)
+                          prio_tree.o util.o mmzone.o vmstat.o backing-dev.o \
+                          $(mmu-y)
 
 ifeq ($(CONFIG_MMU)$(CONFIG_BLOCK),yy)
 obj-y                  += bounce.o
diff --git a/mm/backing-dev.c b/mm/backing-dev.c
new file mode 100644 (file)
index 0000000..f50a281
--- /dev/null
@@ -0,0 +1,69 @@
+
+#include <linux/wait.h>
+#include <linux/backing-dev.h>
+#include <linux/fs.h>
+#include <linux/sched.h>
+#include <linux/module.h>
+
+static wait_queue_head_t congestion_wqh[2] = {
+               __WAIT_QUEUE_HEAD_INITIALIZER(congestion_wqh[0]),
+               __WAIT_QUEUE_HEAD_INITIALIZER(congestion_wqh[1])
+       };
+
+
+void clear_bdi_congested(struct backing_dev_info *bdi, int rw)
+{
+       enum bdi_state bit;
+       wait_queue_head_t *wqh = &congestion_wqh[rw];
+
+       bit = (rw == WRITE) ? BDI_write_congested : BDI_read_congested;
+       clear_bit(bit, &bdi->state);
+       smp_mb__after_clear_bit();
+       if (waitqueue_active(wqh))
+               wake_up(wqh);
+}
+EXPORT_SYMBOL(clear_bdi_congested);
+
+void set_bdi_congested(struct backing_dev_info *bdi, int rw)
+{
+       enum bdi_state bit;
+
+       bit = (rw == WRITE) ? BDI_write_congested : BDI_read_congested;
+       set_bit(bit, &bdi->state);
+}
+EXPORT_SYMBOL(set_bdi_congested);
+
+/**
+ * congestion_wait - wait for a backing_dev to become uncongested
+ * @rw: READ or WRITE
+ * @timeout: timeout in jiffies
+ *
+ * Waits for up to @timeout jiffies for a backing_dev (any backing_dev) to exit
+ * write congestion.  If no backing_devs are congested then just wait for the
+ * next write to be completed.
+ */
+long congestion_wait(int rw, long timeout)
+{
+       long ret;
+       DEFINE_WAIT(wait);
+       wait_queue_head_t *wqh = &congestion_wqh[rw];
+
+       prepare_to_wait(wqh, &wait, TASK_UNINTERRUPTIBLE);
+       ret = io_schedule_timeout(timeout);
+       finish_wait(wqh, &wait);
+       return ret;
+}
+EXPORT_SYMBOL(congestion_wait);
+
+/**
+ * congestion_end - wake up sleepers on a congested backing_dev_info
+ * @rw: READ or WRITE
+ */
+void congestion_end(int rw)
+{
+       wait_queue_head_t *wqh = &congestion_wqh[rw];
+
+       if (waitqueue_active(wqh))
+               wake_up(wqh);
+}
+EXPORT_SYMBOL(congestion_end);
index 3464b681f8449eda37ee74b9581ad03266f6e619..cb26e33fd0ff15cc9932ec44592c7ae7174ac0b7 100644 (file)
@@ -75,8 +75,8 @@ generic_file_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov,
  *  ->mmap_sem
  *    ->lock_page              (access_process_vm)
  *
- *  ->mmap_sem
- *    ->i_mutex                        (msync)
+ *  ->i_mutex                  (generic_file_buffered_write)
+ *    ->mmap_sem               (fault_in_pages_readable->do_page_fault)
  *
  *  ->i_mutex
  *    ->i_alloc_sem             (various)
@@ -1884,11 +1884,10 @@ repeat:
  *     if suid or (sgid and xgrp)
  *             remove privs
  */
-int remove_suid(struct dentry *dentry)
+int should_remove_suid(struct dentry *dentry)
 {
        mode_t mode = dentry->d_inode->i_mode;
        int kill = 0;
-       int result = 0;
 
        /* suid always must be killed */
        if (unlikely(mode & S_ISUID))
@@ -1901,13 +1900,28 @@ int remove_suid(struct dentry *dentry)
        if (unlikely((mode & S_ISGID) && (mode & S_IXGRP)))
                kill |= ATTR_KILL_SGID;
 
-       if (unlikely(kill && !capable(CAP_FSETID))) {
-               struct iattr newattrs;
+       if (unlikely(kill && !capable(CAP_FSETID)))
+               return kill;
 
-               newattrs.ia_valid = ATTR_FORCE | kill;
-               result = notify_change(dentry, &newattrs);
-       }
-       return result;
+       return 0;
+}
+
+int __remove_suid(struct dentry *dentry, int kill)
+{
+       struct iattr newattrs;
+
+       newattrs.ia_valid = ATTR_FORCE | kill;
+       return notify_change(dentry, &newattrs);
+}
+
+int remove_suid(struct dentry *dentry)
+{
+       int kill = should_remove_suid(dentry);
+
+       if (unlikely(kill))
+               return __remove_suid(dentry, kill);
+
+       return 0;
 }
 EXPORT_SYMBOL(remove_suid);
 
@@ -2222,7 +2236,7 @@ __generic_file_aio_write_nolock(struct kiocb *iocb, const struct iovec *iov,
                                unsigned long nr_segs, loff_t *ppos)
 {
        struct file *file = iocb->ki_filp;
-       const struct address_space * mapping = file->f_mapping;
+       struct address_space * mapping = file->f_mapping;
        size_t ocount;          /* original count */
        size_t count;           /* after file limit checks */
        struct inode    *inode = mapping->host;
@@ -2275,8 +2289,11 @@ __generic_file_aio_write_nolock(struct kiocb *iocb, const struct iovec *iov,
 
        /* coalesce the iovecs and go direct-to-BIO for O_DIRECT */
        if (unlikely(file->f_flags & O_DIRECT)) {
-               written = generic_file_direct_write(iocb, iov,
-                               &nr_segs, pos, ppos, count, ocount);
+               loff_t endbyte;
+               ssize_t written_buffered;
+
+               written = generic_file_direct_write(iocb, iov, &nr_segs, pos,
+                                                       ppos, count, ocount);
                if (written < 0 || written == count)
                        goto out;
                /*
@@ -2285,10 +2302,46 @@ __generic_file_aio_write_nolock(struct kiocb *iocb, const struct iovec *iov,
                 */
                pos += written;
                count -= written;
-       }
+               written_buffered = generic_file_buffered_write(iocb, iov,
+                                               nr_segs, pos, ppos, count,
+                                               written);
+               /*
+                * If generic_file_buffered_write() retuned a synchronous error
+                * then we want to return the number of bytes which were
+                * direct-written, or the error code if that was zero.  Note
+                * that this differs from normal direct-io semantics, which
+                * will return -EFOO even if some bytes were written.
+                */
+               if (written_buffered < 0) {
+                       err = written_buffered;
+                       goto out;
+               }
 
-       written = generic_file_buffered_write(iocb, iov, nr_segs,
-                       pos, ppos, count, written);
+               /*
+                * We need to ensure that the page cache pages are written to
+                * disk and invalidated to preserve the expected O_DIRECT
+                * semantics.
+                */
+               endbyte = pos + written_buffered - written - 1;
+               err = do_sync_file_range(file, pos, endbyte,
+                                        SYNC_FILE_RANGE_WAIT_BEFORE|
+                                        SYNC_FILE_RANGE_WRITE|
+                                        SYNC_FILE_RANGE_WAIT_AFTER);
+               if (err == 0) {
+                       written = written_buffered;
+                       invalidate_mapping_pages(mapping,
+                                                pos >> PAGE_CACHE_SHIFT,
+                                                endbyte >> PAGE_CACHE_SHIFT);
+               } else {
+                       /*
+                        * We don't know how much we wrote, so just return
+                        * the number of bytes which were direct-written
+                        */
+               }
+       } else {
+               written = generic_file_buffered_write(iocb, iov, nr_segs,
+                               pos, ppos, count, written);
+       }
 out:
        current->backing_dev_info = NULL;
        return written ? written : err;
index b5a4aadd961adff5839052fd72b3b2cc53c8a43c..156861fcac436e4716537c7e5dff565dded43224 100644 (file)
@@ -1452,6 +1452,7 @@ static inline void cow_user_page(struct page *dst, struct page *src, unsigned lo
                if (__copy_from_user_inatomic(kaddr, uaddr, PAGE_SIZE))
                        memset(kaddr, 0, PAGE_SIZE);
                kunmap_atomic(kaddr, KM_USER0);
+               flush_dcache_page(dst);
                return;
                
        }
index eea8eefd51a86588bd1c091d94fe74df800a9bc2..497e502dfd6b6e54fc2bf902ea55fac36e70ac72 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -900,17 +900,6 @@ unsigned long do_mmap_pgoff(struct file * file, unsigned long addr,
        int accountable = 1;
        unsigned long charged = 0, reqprot = prot;
 
-       if (file) {
-               if (is_file_hugepages(file))
-                       accountable = 0;
-
-               if (!file->f_op || !file->f_op->mmap)
-                       return -ENODEV;
-
-               if ((prot & PROT_EXEC) &&
-                   (file->f_vfsmnt->mnt_flags & MNT_NOEXEC))
-                       return -EPERM;
-       }
        /*
         * Does the application expect PROT_READ to imply PROT_EXEC?
         *
@@ -1000,6 +989,16 @@ unsigned long do_mmap_pgoff(struct file * file, unsigned long addr,
                case MAP_PRIVATE:
                        if (!(file->f_mode & FMODE_READ))
                                return -EACCES;
+                       if (file->f_vfsmnt->mnt_flags & MNT_NOEXEC) {
+                               if (vm_flags & VM_EXEC)
+                                       return -EPERM;
+                               vm_flags &= ~VM_MAYEXEC;
+                       }
+                       if (is_file_hugepages(file))
+                               accountable = 0;
+
+                       if (!file->f_op || !file->f_op->mmap)
+                               return -ENODEV;
                        break;
 
                default:
index 20f41b082e16484a8c52aa04272bf4f30359593c..2e3ce3a928b97dd8eeb54b42fb6f363d15a6d2ae 100644 (file)
@@ -15,6 +15,7 @@
  *  kernel subsystems and hints as to where to find out what things do.
  */
 
+#include <linux/oom.h>
 #include <linux/mm.h>
 #include <linux/sched.h>
 #include <linux/swap.h>
index a0f33905744978df4c961e0e29187f3cf1cef54c..8d9b19f239c3ec03038e88cdd0a44e8a71c0d3e9 100644 (file)
@@ -222,7 +222,7 @@ static void balance_dirty_pages(struct address_space *mapping)
                        if (pages_written >= write_chunk)
                                break;          /* We've done our duty */
                }
-               blk_congestion_wait(WRITE, HZ/10);
+               congestion_wait(WRITE, HZ/10);
        }
 
        if (nr_reclaimable + global_page_state(NR_WRITEBACK)
@@ -314,7 +314,7 @@ void throttle_vm_writeout(void)
                 if (global_page_state(NR_UNSTABLE_NFS) +
                        global_page_state(NR_WRITEBACK) <= dirty_thresh)
                                break;
-                blk_congestion_wait(WRITE, HZ/10);
+                congestion_wait(WRITE, HZ/10);
         }
 }
 
@@ -351,7 +351,7 @@ static void background_writeout(unsigned long _min_pages)
                min_pages -= MAX_WRITEBACK_PAGES - wbc.nr_to_write;
                if (wbc.nr_to_write > 0 || wbc.pages_skipped > 0) {
                        /* Wrote less than expected */
-                       blk_congestion_wait(WRITE, HZ/10);
+                       congestion_wait(WRITE, HZ/10);
                        if (!wbc.encountered_congestion)
                                break;
                }
@@ -422,7 +422,7 @@ static void wb_kupdate(unsigned long arg)
                writeback_inodes(&wbc);
                if (wbc.nr_to_write > 0) {
                        if (wbc.encountered_congestion)
-                               blk_congestion_wait(WRITE, HZ/10);
+                               congestion_wait(WRITE, HZ/10);
                        else
                                break;  /* All the old data is written */
                }
@@ -955,15 +955,6 @@ int test_set_page_writeback(struct page *page)
 }
 EXPORT_SYMBOL(test_set_page_writeback);
 
-/*
- * Wakes up tasks that are being throttled due to writeback congestion
- */
-void writeback_congestion_end(void)
-{
-       blk_congestion_end(WRITE);
-}
-EXPORT_SYMBOL(writeback_congestion_end);
-
 /*
  * Return true if any of the pages in the mapping are marged with the
  * passed tag.
index 40db96a655d0c23ad7df245f6dd990b6555c8f4f..f5fc45472d5ca77d3406b9ced195c45fde97ca78 100644 (file)
@@ -39,6 +39,7 @@
 #include <linux/stop_machine.h>
 #include <linux/sort.h>
 #include <linux/pfn.h>
+#include <linux/backing-dev.h>
 
 #include <asm/tlbflush.h>
 #include <asm/div64.h>
@@ -1050,7 +1051,7 @@ nofail_alloc:
                        if (page)
                                goto got_pg;
                        if (gfp_mask & __GFP_NOFAIL) {
-                               blk_congestion_wait(WRITE, HZ/50);
+                               congestion_wait(WRITE, HZ/50);
                                goto nofail_alloc;
                        }
                }
@@ -1113,7 +1114,7 @@ rebalance:
                        do_retry = 1;
        }
        if (do_retry) {
-               blk_congestion_wait(WRITE, HZ/50);
+               congestion_wait(WRITE, HZ/50);
                goto rebalance;
        }
 
@@ -1688,6 +1689,8 @@ void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone,
        for (pfn = start_pfn; pfn < end_pfn; pfn++) {
                if (!early_pfn_valid(pfn))
                        continue;
+               if (!early_pfn_in_nid(pfn, nid))
+                       continue;
                page = pfn_to_page(pfn);
                set_page_links(page, zone, nid, pfn);
                init_page_count(page);
@@ -3119,3 +3122,19 @@ unsigned long page_to_pfn(struct page *page)
 EXPORT_SYMBOL(pfn_to_page);
 EXPORT_SYMBOL(page_to_pfn);
 #endif /* CONFIG_OUT_OF_LINE_PFN_TO_PAGE */
+
+#if MAX_NUMNODES > 1
+/*
+ * Find the highest possible node id.
+ */
+int highest_possible_node_id(void)
+{
+       unsigned int node;
+       unsigned int highest = 0;
+
+       for_each_node_mask(node, node_possible_map)
+               highest = node;
+       return highest;
+}
+EXPORT_SYMBOL(highest_possible_node_id);
+#endif
index a9136d8b7577fc47cc5aeb82e2997cd8ded06885..d8a842a586db774f7a6b38fe08b187d0563e13fd 100644 (file)
--- a/mm/rmap.c
+++ b/mm/rmap.c
  * Lock ordering in mm:
  *
  * inode->i_mutex      (while writing or truncating, not reading or faulting)
- *   inode->i_alloc_sem
- *
- * When a page fault occurs in writing from user to file, down_read
- * of mmap_sem nests within i_mutex; in sys_msync, i_mutex nests within
- * down_read of mmap_sem; i_mutex and down_write of mmap_sem are never
- * taken together; in truncation, i_mutex is taken outermost.
- *
- * mm->mmap_sem
- *   page->flags PG_locked (lock_page)
- *     mapping->i_mmap_lock
- *       anon_vma->lock
- *         mm->page_table_lock or pte_lock
- *           zone->lru_lock (in mark_page_accessed, isolate_lru_page)
- *           swap_lock (in swap_duplicate, swap_info_get)
- *             mmlist_lock (in mmput, drain_mmlist and others)
- *             mapping->private_lock (in __set_page_dirty_buffers)
- *             inode_lock (in set_page_dirty's __mark_inode_dirty)
- *               sb_lock (within inode_lock in fs/fs-writeback.c)
- *               mapping->tree_lock (widely used, in set_page_dirty,
- *                         in arch-dependent flush_dcache_mmap_lock,
- *                         within inode_lock in __sync_single_inode)
+ *   inode->i_alloc_sem (vmtruncate_range)
+ *   mm->mmap_sem
+ *     page->flags PG_locked (lock_page)
+ *       mapping->i_mmap_lock
+ *         anon_vma->lock
+ *           mm->page_table_lock or pte_lock
+ *             zone->lru_lock (in mark_page_accessed, isolate_lru_page)
+ *             swap_lock (in swap_duplicate, swap_info_get)
+ *               mmlist_lock (in mmput, drain_mmlist and others)
+ *               mapping->private_lock (in __set_page_dirty_buffers)
+ *               inode_lock (in set_page_dirty's __mark_inode_dirty)
+ *                 sb_lock (within inode_lock in fs/fs-writeback.c)
+ *                 mapping->tree_lock (widely used, in set_page_dirty,
+ *                           in arch-dependent flush_dcache_mmap_lock,
+ *                           within inode_lock in __sync_single_inode)
  */
 
 #include <linux/mm.h>
index bb8ca7ef70940de154adfcbb7f30debd3f3c3737..4959535fc14c4a7aa3308bb316c4a13a3ba2baa3 100644 (file)
@@ -48,6 +48,7 @@
 #include <linux/ctype.h>
 #include <linux/migrate.h>
 #include <linux/highmem.h>
+#include <linux/backing-dev.h>
 
 #include <asm/uaccess.h>
 #include <asm/div64.h>
@@ -1131,7 +1132,7 @@ repeat:
                        page_cache_release(swappage);
                        if (error == -ENOMEM) {
                                /* let kswapd refresh zone for GFP_ATOMICs */
-                               blk_congestion_wait(WRITE, HZ/50);
+                               congestion_wait(WRITE, HZ/50);
                        }
                        goto repeat;
                }
@@ -1362,6 +1363,7 @@ shmem_get_inode(struct super_block *sb, int mode, dev_t dev)
                inode->i_mapping->a_ops = &shmem_aops;
                inode->i_mapping->backing_dev_info = &shmem_backing_dev_info;
                inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
+               inode->i_generation = get_seconds();
                info = SHMEM_I(inode);
                memset(info, 0, (char *)inode - (char *)info);
                spin_lock_init(&info->lock);
@@ -1956,6 +1958,85 @@ static struct xattr_handler *shmem_xattr_handlers[] = {
 };
 #endif
 
+static struct dentry *shmem_get_parent(struct dentry *child)
+{
+       return ERR_PTR(-ESTALE);
+}
+
+static int shmem_match(struct inode *ino, void *vfh)
+{
+       __u32 *fh = vfh;
+       __u64 inum = fh[2];
+       inum = (inum << 32) | fh[1];
+       return ino->i_ino == inum && fh[0] == ino->i_generation;
+}
+
+static struct dentry *shmem_get_dentry(struct super_block *sb, void *vfh)
+{
+       struct dentry *de = NULL;
+       struct inode *inode;
+       __u32 *fh = vfh;
+       __u64 inum = fh[2];
+       inum = (inum << 32) | fh[1];
+
+       inode = ilookup5(sb, (unsigned long)(inum+fh[0]), shmem_match, vfh);
+       if (inode) {
+               de = d_find_alias(inode);
+               iput(inode);
+       }
+
+       return de? de: ERR_PTR(-ESTALE);
+}
+
+static struct dentry *shmem_decode_fh(struct super_block *sb, __u32 *fh,
+               int len, int type,
+               int (*acceptable)(void *context, struct dentry *de),
+               void *context)
+{
+       if (len < 3)
+               return ERR_PTR(-ESTALE);
+
+       return sb->s_export_op->find_exported_dentry(sb, fh, NULL, acceptable,
+                                                       context);
+}
+
+static int shmem_encode_fh(struct dentry *dentry, __u32 *fh, int *len,
+                               int connectable)
+{
+       struct inode *inode = dentry->d_inode;
+
+       if (*len < 3)
+               return 255;
+
+       if (hlist_unhashed(&inode->i_hash)) {
+               /* Unfortunately insert_inode_hash is not idempotent,
+                * so as we hash inodes here rather than at creation
+                * time, we need a lock to ensure we only try
+                * to do it once
+                */
+               static DEFINE_SPINLOCK(lock);
+               spin_lock(&lock);
+               if (hlist_unhashed(&inode->i_hash))
+                       __insert_inode_hash(inode,
+                                           inode->i_ino + inode->i_generation);
+               spin_unlock(&lock);
+       }
+
+       fh[0] = inode->i_generation;
+       fh[1] = inode->i_ino;
+       fh[2] = ((__u64)inode->i_ino) >> 32;
+
+       *len = 3;
+       return 1;
+}
+
+static struct export_operations shmem_export_ops = {
+       .get_parent     = shmem_get_parent,
+       .get_dentry     = shmem_get_dentry,
+       .encode_fh      = shmem_encode_fh,
+       .decode_fh      = shmem_decode_fh,
+};
+
 static int shmem_parse_options(char *options, int *mode, uid_t *uid,
        gid_t *gid, unsigned long *blocks, unsigned long *inodes,
        int *policy, nodemask_t *policy_nodes)
@@ -2128,6 +2209,7 @@ static int shmem_fill_super(struct super_block *sb,
                                        &inodes, &policy, &policy_nodes))
                        return -EINVAL;
        }
+       sb->s_export_op = &shmem_export_ops;
 #else
        sb->s_flags |= MS_NOUSER;
 #endif
index 266449d604bd170c4c1656318c1ded64fcc5404a..84c631f30741016e0e73602129ed6c33d6ca88f9 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3152,12 +3152,15 @@ void *fallback_alloc(struct kmem_cache *cache, gfp_t flags)
        struct zone **z;
        void *obj = NULL;
 
-       for (z = zonelist->zones; *z && !obj; z++)
+       for (z = zonelist->zones; *z && !obj; z++) {
+               int nid = zone_to_nid(*z);
+
                if (zone_idx(*z) <= ZONE_NORMAL &&
-                               cpuset_zone_allowed(*z, flags))
+                               cpuset_zone_allowed(*z, flags) &&
+                               cache->nodelists[nid])
                        obj = __cache_alloc_node(cache,
-                                       flags | __GFP_THISNODE,
-                                       zone_to_nid(*z));
+                                       flags | __GFP_THISNODE, nid);
+       }
        return obj;
 }
 
index 11ca480701dd1ae38a85fc04aae7f3ebaedd6939..e07b1e682c38f5fca96436904eb1a9a262ce1426 100644 (file)
@@ -96,7 +96,6 @@ invalidate_complete_page(struct address_space *mapping, struct page *page)
                return 0;
 
        ret = remove_mapping(mapping, page);
-       ClearPageUptodate(page);
 
        return ret;
 }
index 750ab6ed13fca56ca42581dd32f74912fd1b347c..1133dd3aafcf4c02e5b2d109b02f45013b7d9d11 100644 (file)
@@ -428,8 +428,11 @@ void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
        if (array_size > PAGE_SIZE) {
                pages = __vmalloc_node(array_size, gfp_mask, PAGE_KERNEL, node);
                area->flags |= VM_VPAGES;
-       } else
-               pages = kmalloc_node(array_size, (gfp_mask & ~__GFP_HIGHMEM), node);
+       } else {
+               pages = kmalloc_node(array_size,
+                               (gfp_mask & ~(__GFP_HIGHMEM | __GFP_ZERO)),
+                               node);
+       }
        area->pages = pages;
        if (!area->pages) {
                remove_vm_area(area->addr);
index eca70310adb26239e94c5435eaf2abf0271c89fa..f05527bf792b1e28b78d3a45cf2244efb4b34cf2 100644 (file)
@@ -378,6 +378,12 @@ static pageout_t pageout(struct page *page, struct address_space *mapping)
        return PAGE_CLEAN;
 }
 
+/*
+ * Attempt to detach a locked page from its ->mapping.  If it is dirty or if
+ * someone else has a ref on the page, abort and return 0.  If it was
+ * successfully detached, return 1.  Assumes the caller has a single ref on
+ * this page.
+ */
 int remove_mapping(struct address_space *mapping, struct page *page)
 {
        BUG_ON(!PageLocked(page));
@@ -1053,7 +1059,7 @@ unsigned long try_to_free_pages(struct zone **zones, gfp_t gfp_mask)
 
                /* Take a nap, wait for some writeback to complete */
                if (sc.nr_scanned && priority < DEF_PRIORITY - 2)
-                       blk_congestion_wait(WRITE, HZ/10);
+                       congestion_wait(WRITE, HZ/10);
        }
        /* top priority shrink_caches still had more to do? don't OOM, then */
        if (!sc.all_unreclaimable)
@@ -1208,7 +1214,7 @@ scan:
                 * another pass across the zones.
                 */
                if (total_scanned && priority < DEF_PRIORITY - 2)
-                       blk_congestion_wait(WRITE, HZ/10);
+                       congestion_wait(WRITE, HZ/10);
 
                /*
                 * We do this so kswapd doesn't build up large priorities for
@@ -1452,7 +1458,7 @@ unsigned long shrink_all_memory(unsigned long nr_pages)
                                goto out;
 
                        if (sc.nr_scanned && prio < DEF_PRIORITY - 2)
-                               blk_congestion_wait(WRITE, HZ / 10);
+                               congestion_wait(WRITE, HZ / 10);
                }
 
                lru_pages = 0;
index c0a4ae28fcfab23025ffdaf079dfd9199c8aa8dd..62f6ed1f2f98c9c5c25d70759f87d60e3e4f699d 100644 (file)
@@ -141,7 +141,7 @@ static struct class atm_class = {
 int atm_register_sysfs(struct atm_dev *adev)
 {
        struct class_device *cdev = &adev->class_dev;
-       int i, err;
+       int i, j, err;
 
        cdev->class = &atm_class;
        class_set_devdata(cdev, adev);
@@ -151,10 +151,19 @@ int atm_register_sysfs(struct atm_dev *adev)
        if (err < 0)
                return err;
 
-       for (i = 0; atm_attrs[i]; i++)
-               class_device_create_file(cdev, atm_attrs[i]);
+       for (i = 0; atm_attrs[i]; i++) {
+               err = class_device_create_file(cdev, atm_attrs[i]);
+               if (err)
+                       goto err_out;
+       }
 
        return 0;
+
+err_out:
+       for (j = 0; j < i; j++)
+               class_device_remove_file(cdev, atm_attrs[j]);
+       class_device_del(cdev);
+       return err;
 }
 
 void atm_unregister_sysfs(struct atm_dev *adev)
index 305a099b7477eb8fd0e4a7a7b487b7bd435e6677..67df99e2e5c82b2a4fc72e28dc748a33209fcd55 100644 (file)
 #define BT_DBG(D...)
 #endif
 
-#define VERSION "2.10"
+#define VERSION "2.11"
 
 /* Bluetooth sockets */
 #define BT_MAX_PROTO   8
 static struct net_proto_family *bt_proto[BT_MAX_PROTO];
+static DEFINE_RWLOCK(bt_proto_lock);
 
 int bt_sock_register(int proto, struct net_proto_family *ops)
 {
+       int err = 0;
+
        if (proto < 0 || proto >= BT_MAX_PROTO)
                return -EINVAL;
 
+       write_lock(&bt_proto_lock);
+
        if (bt_proto[proto])
-               return -EEXIST;
+               err = -EEXIST;
+       else
+               bt_proto[proto] = ops;
 
-       bt_proto[proto] = ops;
-       return 0;
+       write_unlock(&bt_proto_lock);
+
+       return err;
 }
 EXPORT_SYMBOL(bt_sock_register);
 
 int bt_sock_unregister(int proto)
 {
+       int err = 0;
+
        if (proto < 0 || proto >= BT_MAX_PROTO)
                return -EINVAL;
 
+       write_lock(&bt_proto_lock);
+
        if (!bt_proto[proto])
-               return -ENOENT;
+               err = -ENOENT;
+       else
+               bt_proto[proto] = NULL;
 
-       bt_proto[proto] = NULL;
-       return 0;
+       write_unlock(&bt_proto_lock);
+
+       return err;
 }
 EXPORT_SYMBOL(bt_sock_unregister);
 
 static int bt_sock_create(struct socket *sock, int proto)
 {
-       int err = 0;
+       int err;
 
        if (proto < 0 || proto >= BT_MAX_PROTO)
                return -EINVAL;
@@ -92,11 +107,18 @@ static int bt_sock_create(struct socket *sock, int proto)
                request_module("bt-proto-%d", proto);
        }
 #endif
+
        err = -EPROTONOSUPPORT;
+
+       read_lock(&bt_proto_lock);
+
        if (bt_proto[proto] && try_module_get(bt_proto[proto]->owner)) {
                err = bt_proto[proto]->create(sock, proto);
                module_put(bt_proto[proto]->owner);
        }
+
+       read_unlock(&bt_proto_lock);
+
        return err; 
 }
 
index 2312d050eeedfb66ed382108f0703f6d2dfc5b9d..4d3424c2421c07b4d925559a1e02e4a6f59b7b19 100644 (file)
@@ -528,12 +528,10 @@ static struct device *bnep_get_device(struct bnep_session *session)
                return NULL;
 
        conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, dst);
-       if (!conn)
-               return NULL;
 
        hci_dev_put(hdev);
 
-       return &conn->dev;
+       return conn ? &conn->dev : NULL;
 }
 
 int bnep_add_connection(struct bnep_connadd_req *req, struct socket *sock)
index 28c55835422afb90f1bbf660f5dcb387bde3779b..5563db1bf526e94d4a48c5af511315c4d3646786 100644 (file)
@@ -43,6 +43,7 @@
 #include <linux/ioctl.h>
 #include <linux/file.h>
 #include <linux/init.h>
+#include <linux/compat.h>
 #include <net/sock.h>
 
 #include <asm/system.h>
@@ -146,24 +147,56 @@ static int bnep_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long
        return 0;
 }
 
+#ifdef CONFIG_COMPAT
+static int bnep_sock_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
+{
+       if (cmd == BNEPGETCONNLIST) {
+               struct bnep_connlist_req cl;
+               uint32_t uci;
+               int err;
+
+               if (get_user(cl.cnum, (uint32_t __user *) arg) ||
+                               get_user(uci, (u32 __user *) (arg + 4)))
+                       return -EFAULT;
+
+               cl.ci = compat_ptr(uci);
+
+               if (cl.cnum <= 0)
+                       return -EINVAL;
+       
+               err = bnep_get_connlist(&cl);
+
+               if (!err && put_user(cl.cnum, (uint32_t __user *) arg))
+                       err = -EFAULT;
+
+               return err;
+       }
+
+       return bnep_sock_ioctl(sock, cmd, arg);
+}
+#endif
+
 static const struct proto_ops bnep_sock_ops = {
-       .family     = PF_BLUETOOTH,
-       .owner      = THIS_MODULE,
-       .release    = bnep_sock_release,
-       .ioctl      = bnep_sock_ioctl,
-       .bind       = sock_no_bind,
-       .getname    = sock_no_getname,
-       .sendmsg    = sock_no_sendmsg,
-       .recvmsg    = sock_no_recvmsg,
-       .poll       = sock_no_poll,
-       .listen     = sock_no_listen,
-       .shutdown   = sock_no_shutdown,
-       .setsockopt = sock_no_setsockopt,
-       .getsockopt = sock_no_getsockopt,
-       .connect    = sock_no_connect,
-       .socketpair = sock_no_socketpair,
-       .accept     = sock_no_accept,
-       .mmap       = sock_no_mmap
+       .family         = PF_BLUETOOTH,
+       .owner          = THIS_MODULE,
+       .release        = bnep_sock_release,
+       .ioctl          = bnep_sock_ioctl,
+#ifdef CONFIG_COMPAT
+       .compat_ioctl   = bnep_sock_compat_ioctl,
+#endif
+       .bind           = sock_no_bind,
+       .getname        = sock_no_getname,
+       .sendmsg        = sock_no_sendmsg,
+       .recvmsg        = sock_no_recvmsg,
+       .poll           = sock_no_poll,
+       .listen         = sock_no_listen,
+       .shutdown       = sock_no_shutdown,
+       .setsockopt     = sock_no_setsockopt,
+       .getsockopt     = sock_no_getsockopt,
+       .connect        = sock_no_connect,
+       .socketpair     = sock_no_socketpair,
+       .accept         = sock_no_accept,
+       .mmap           = sock_no_mmap
 };
 
 static struct proto bnep_proto = {
@@ -181,7 +214,7 @@ static int bnep_sock_create(struct socket *sock, int protocol)
        if (sock->type != SOCK_RAW)
                return -ESOCKTNOSUPPORT;
 
-       sk = sk_alloc(PF_BLUETOOTH, GFP_KERNEL, &bnep_proto, 1);
+       sk = sk_alloc(PF_BLUETOOTH, GFP_ATOMIC, &bnep_proto, 1);
        if (!sk)
                return -ENOMEM;
 
index 10ad7fd91d833f26a188b073d46fea1ed1d2cd16..53295d33dc5c31eb610c1766e5795f3c7a123cfd 100644 (file)
@@ -34,6 +34,7 @@
 #include <linux/socket.h>
 #include <linux/ioctl.h>
 #include <linux/file.h>
+#include <linux/compat.h>
 #include <net/sock.h>
 
 #include <linux/isdn/capilli.h>
@@ -137,11 +138,43 @@ static int cmtp_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long
        return -EINVAL;
 }
 
+#ifdef CONFIG_COMPAT
+static int cmtp_sock_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
+{
+       if (cmd == CMTPGETCONNLIST) {
+               struct cmtp_connlist_req cl;
+               uint32_t uci;
+               int err;
+
+               if (get_user(cl.cnum, (uint32_t __user *) arg) ||
+                               get_user(uci, (u32 __user *) (arg + 4)))
+                       return -EFAULT;
+
+               cl.ci = compat_ptr(uci);
+
+               if (cl.cnum <= 0)
+                       return -EINVAL;
+       
+               err = cmtp_get_connlist(&cl);
+
+               if (!err && put_user(cl.cnum, (uint32_t __user *) arg))
+                       err = -EFAULT;
+
+               return err;
+       }
+
+       return cmtp_sock_ioctl(sock, cmd, arg);
+}
+#endif
+
 static const struct proto_ops cmtp_sock_ops = {
        .family         = PF_BLUETOOTH,
        .owner          = THIS_MODULE,
        .release        = cmtp_sock_release,
        .ioctl          = cmtp_sock_ioctl,
+#ifdef CONFIG_COMPAT
+       .compat_ioctl   = cmtp_sock_compat_ioctl,
+#endif
        .bind           = sock_no_bind,
        .getname        = sock_no_getname,
        .sendmsg        = sock_no_sendmsg,
@@ -172,7 +205,7 @@ static int cmtp_sock_create(struct socket *sock, int protocol)
        if (sock->type != SOCK_RAW)
                return -ESOCKTNOSUPPORT;
 
-       sk = sk_alloc(PF_BLUETOOTH, GFP_KERNEL, &cmtp_proto, 1);
+       sk = sk_alloc(PF_BLUETOOTH, GFP_ATOMIC, &cmtp_proto, 1);
        if (!sk)
                return -ENOMEM;
 
index 90e3a285a17eaf9a4bde198879748d8a4da680a7..6cd5711fa28a59265403a81f608e6698e7f03dfa 100644 (file)
@@ -51,7 +51,7 @@
 #define BT_DBG(D...)
 #endif
 
-static void hci_acl_connect(struct hci_conn *conn)
+void hci_acl_connect(struct hci_conn *conn)
 {
        struct hci_dev *hdev = conn->hdev;
        struct inquiry_entry *ie;
@@ -63,6 +63,8 @@ static void hci_acl_connect(struct hci_conn *conn)
        conn->out   = 1;
        conn->link_mode = HCI_LM_MASTER;
 
+       conn->attempt++;
+
        memset(&cp, 0, sizeof(cp));
        bacpy(&cp.bdaddr, &conn->dst);
        cp.pscan_rep_mode = 0x02;
@@ -80,7 +82,7 @@ static void hci_acl_connect(struct hci_conn *conn)
                cp.role_switch  = 0x01;
        else
                cp.role_switch  = 0x00;
-               
+
        hci_send_cmd(hdev, OGF_LINK_CTL, OCF_CREATE_CONN, sizeof(cp), &cp);
 }
 
index d43d0c8909752564796b540a61cb58389cc8cb0d..65f094845719126013cfb9f3c1c19e11f4b2b566 100644 (file)
@@ -414,9 +414,12 @@ static inline void hci_cs_create_conn(struct hci_dev *hdev, __u8 status)
 
        if (status) {
                if (conn && conn->state == BT_CONNECT) {
-                       conn->state = BT_CLOSED;
-                       hci_proto_connect_cfm(conn, status);
-                       hci_conn_del(conn);
+                       if (status != 0x0c || conn->attempt > 2) {
+                               conn->state = BT_CLOSED;
+                               hci_proto_connect_cfm(conn, status);
+                               hci_conn_del(conn);
+                       } else
+                               conn->state = BT_CONNECT2;
                }
        } else {
                if (!conn) {
@@ -728,7 +731,7 @@ static inline void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *sk
 static inline void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
 {
        struct hci_ev_conn_complete *ev = (struct hci_ev_conn_complete *) skb->data;
-       struct hci_conn *conn;
+       struct hci_conn *conn, *pend;
 
        BT_DBG("%s", hdev->name);
 
@@ -801,6 +804,10 @@ static inline void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *s
        if (ev->status)
                hci_conn_del(conn);
 
+       pend = hci_conn_hash_lookup_state(hdev, ACL_LINK, BT_CONNECT2);
+       if (pend)
+               hci_acl_connect(pend);
+
        hci_dev_unlock(hdev);
 }
 
index 1a35d343e08a593f91cc71fce52306a50d991c4b..f26a9eb49945c8805db60c07964b9c1a734f4556 100644 (file)
@@ -618,7 +618,7 @@ static int hci_sock_create(struct socket *sock, int protocol)
 
        sock->ops = &hci_sock_ops;
 
-       sk = sk_alloc(PF_BLUETOOTH, GFP_KERNEL, &hci_sk_proto, 1);
+       sk = sk_alloc(PF_BLUETOOTH, GFP_ATOMIC, &hci_sk_proto, 1);
        if (!sk)
                return -ENOMEM;
 
index 989b22d9042e92f929435d9f0290d2d429e7fd75..954eb74eb370a34cb97050c9bec17e8cbfdff08c 100644 (file)
@@ -242,10 +242,14 @@ static void add_conn(void *data)
        struct hci_conn *conn = data;
        int i;
 
-       device_register(&conn->dev);
+       if (device_register(&conn->dev) < 0) {
+               BT_ERR("Failed to register connection device");
+               return;
+       }
 
        for (i = 0; conn_attrs[i]; i++)
-               device_create_file(&conn->dev, conn_attrs[i]);
+               if (device_create_file(&conn->dev, conn_attrs[i]) < 0)
+                       BT_ERR("Failed to create connection attribute");
 }
 
 void hci_conn_add_sysfs(struct hci_conn *conn)
@@ -295,11 +299,7 @@ int hci_register_sysfs(struct hci_dev *hdev)
        BT_DBG("%p name %s type %d", hdev, hdev->name, hdev->type);
 
        dev->class = bt_class;
-
-       if (hdev->parent)
-               dev->parent = hdev->parent;
-       else
-               dev->parent = &bt_platform->dev;
+       dev->parent = hdev->parent;
 
        strlcpy(dev->bus_id, hdev->name, BUS_ID_SIZE);
 
@@ -312,7 +312,8 @@ int hci_register_sysfs(struct hci_dev *hdev)
                return err;
 
        for (i = 0; bt_attrs[i]; i++)
-               device_create_file(dev, bt_attrs[i]);
+               if (device_create_file(dev, bt_attrs[i]) < 0)
+                       BT_ERR("Failed to create device attribute");
 
        return 0;
 }
index 03b5dadb49511f90b0c57ee6d9d677d580c5ef18..66782010f82cbacf442eba7a2d6c64f17d8c0964 100644 (file)
@@ -507,14 +507,12 @@ static int hidp_session(void *arg)
 
        hidp_del_timer(session);
 
-       if (intr_sk->sk_state != BT_CONNECTED)
-               wait_event_timeout(*(ctrl_sk->sk_sleep), (ctrl_sk->sk_state == BT_CLOSED), HZ);
-
-       fput(session->ctrl_sock->file);
+       fput(session->intr_sock->file);
 
-       wait_event_timeout(*(intr_sk->sk_sleep), (intr_sk->sk_state == BT_CLOSED), HZ);
+       wait_event_timeout(*(ctrl_sk->sk_sleep),
+               (ctrl_sk->sk_state == BT_CLOSED), msecs_to_jiffies(500));
 
-       fput(session->intr_sock->file);
+       fput(session->ctrl_sock->file);
 
        __hidp_unlink_session(session);
 
@@ -541,12 +539,10 @@ static struct device *hidp_get_device(struct hidp_session *session)
                return NULL;
 
        conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, dst);
-       if (!conn)
-               return NULL;
 
        hci_dev_put(hdev);
 
-       return &conn->dev;
+       return conn ? &conn->dev : NULL;
 }
 
 static inline void hidp_setup_input(struct hidp_session *session, struct hidp_connadd_req *req)
index 099646e4e2ef7407b45687f2188d0bfe2cd7402b..407fba43c1b973cda01122be9cc3dce198c2b930 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/ioctl.h>
 #include <linux/file.h>
 #include <linux/init.h>
+#include <linux/compat.h>
 #include <net/sock.h>
 
 #include "hidp.h"
@@ -143,11 +144,88 @@ static int hidp_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long
        return -EINVAL;
 }
 
+#ifdef CONFIG_COMPAT
+struct compat_hidp_connadd_req {
+       int   ctrl_sock;        // Connected control socket
+       int   intr_sock;        // Connteted interrupt socket
+       __u16 parser;
+       __u16 rd_size;
+       compat_uptr_t rd_data;
+       __u8  country;
+       __u8  subclass;
+       __u16 vendor;
+       __u16 product;
+       __u16 version;
+       __u32 flags;
+       __u32 idle_to;
+       char  name[128];
+};
+
+static int hidp_sock_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
+{
+       if (cmd == HIDPGETCONNLIST) {
+               struct hidp_connlist_req cl;
+               uint32_t uci;
+               int err;
+
+               if (get_user(cl.cnum, (uint32_t __user *) arg) ||
+                               get_user(uci, (u32 __user *) (arg + 4)))
+                       return -EFAULT;
+
+               cl.ci = compat_ptr(uci);
+
+               if (cl.cnum <= 0)
+                       return -EINVAL;
+
+               err = hidp_get_connlist(&cl);
+
+               if (!err && put_user(cl.cnum, (uint32_t __user *) arg))
+                       err = -EFAULT;
+
+               return err;
+       } else if (cmd == HIDPCONNADD) {
+               struct compat_hidp_connadd_req ca;
+               struct hidp_connadd_req __user *uca;
+
+               uca = compat_alloc_user_space(sizeof(*uca));
+
+               if (copy_from_user(&ca, (void *) arg, sizeof(ca)))
+                       return -EFAULT;
+
+               if (put_user(ca.ctrl_sock, &uca->ctrl_sock) ||
+                               put_user(ca.intr_sock, &uca->intr_sock) ||
+                               put_user(ca.parser, &uca->parser) ||
+                               put_user(ca.rd_size, &uca->parser) ||
+                               put_user(compat_ptr(ca.rd_data), &uca->rd_data) ||
+                               put_user(ca.country, &uca->country) ||
+                               put_user(ca.subclass, &uca->subclass) ||
+                               put_user(ca.vendor, &uca->vendor) ||
+                               put_user(ca.product, &uca->product) ||
+                               put_user(ca.version, &uca->version) ||
+                               put_user(ca.flags, &uca->flags) ||
+                               put_user(ca.idle_to, &uca->idle_to) ||
+                               copy_to_user(&uca->name[0], &ca.name[0], 128))
+                       return -EFAULT;
+               
+               arg = (unsigned long) uca;
+
+               /* Fall through. We don't actually write back any _changes_
+                  to the structure anyway, so there's no need to copy back
+                  into the original compat version */
+       }
+
+       return hidp_sock_ioctl(sock, cmd, arg);
+}
+#endif
+
 static const struct proto_ops hidp_sock_ops = {
        .family         = PF_BLUETOOTH,
        .owner          = THIS_MODULE,
        .release        = hidp_sock_release,
        .ioctl          = hidp_sock_ioctl,
+#ifdef CONFIG_COMPAT
+       .compat_ioctl   = hidp_sock_compat_ioctl,
+#endif
        .bind           = sock_no_bind,
        .getname        = sock_no_getname,
        .sendmsg        = sock_no_sendmsg,
@@ -178,7 +256,7 @@ static int hidp_sock_create(struct socket *sock, int protocol)
        if (sock->type != SOCK_RAW)
                return -ESOCKTNOSUPPORT;
 
-       sk = sk_alloc(PF_BLUETOOTH, GFP_KERNEL, &hidp_proto, 1);
+       sk = sk_alloc(PF_BLUETOOTH, GFP_ATOMIC, &hidp_proto, 1);
        if (!sk)
                return -ENOMEM;
 
index d56f60b392ac512b36a736f928844208ec88847a..2b3dcb8f90fadebdcde2ace1feed9cd90cf76b0e 100644 (file)
@@ -559,7 +559,7 @@ static int l2cap_sock_create(struct socket *sock, int protocol)
 
        sock->ops = &l2cap_sock_ops;
 
-       sk = l2cap_sock_alloc(sock, protocol, GFP_KERNEL);
+       sk = l2cap_sock_alloc(sock, protocol, GFP_ATOMIC);
        if (!sk)
                return -ENOMEM;
 
@@ -2216,7 +2216,8 @@ static int __init l2cap_init(void)
                goto error;
        }
 
-       class_create_file(bt_class, &class_attr_l2cap);
+       if (class_create_file(bt_class, &class_attr_l2cap) < 0)
+               BT_ERR("Failed to create L2CAP info file");
 
        BT_INFO("L2CAP ver %s", VERSION);
        BT_INFO("L2CAP socket layer initialized");
index 468df3b953f6d3c615169a0939e50ec924eb1af8..ddc4e9d5963e850f86d768abef9481f849392439 100644 (file)
@@ -2058,7 +2058,8 @@ static int __init rfcomm_init(void)
 
        kernel_thread(rfcomm_run, NULL, CLONE_KERNEL);
 
-       class_create_file(bt_class, &class_attr_rfcomm_dlc);
+       if (class_create_file(bt_class, &class_attr_rfcomm_dlc) < 0)
+               BT_ERR("Failed to create RFCOMM info file");
 
        rfcomm_init_sockets();
 
index 220fee04e7f274a3d31505f0133af59e742a4f74..544d65b7baa7de67fe796ec2e4cf68a0c6051e1f 100644 (file)
@@ -336,7 +336,8 @@ static int rfcomm_sock_create(struct socket *sock, int protocol)
 
        sock->ops = &rfcomm_sock_ops;
 
-       if (!(sk = rfcomm_sock_alloc(sock, protocol, GFP_KERNEL)))
+       sk = rfcomm_sock_alloc(sock, protocol, GFP_ATOMIC);
+       if (!sk)
                return -ENOMEM;
 
        rfcomm_sock_init(sk, NULL);
@@ -944,7 +945,8 @@ int __init rfcomm_init_sockets(void)
        if (err < 0)
                goto error;
 
-       class_create_file(bt_class, &class_attr_rfcomm);
+       if (class_create_file(bt_class, &class_attr_rfcomm) < 0)
+               BT_ERR("Failed to create RFCOMM info file");
 
        BT_INFO("RFCOMM socket layer initialized");
 
index 1958ad1b8541e57be7f32bb70b2b19a242884dce..b8e3a5f1c8a80683d5806662cc7f55c46a656bee 100644 (file)
@@ -172,12 +172,10 @@ static struct device *rfcomm_get_device(struct rfcomm_dev *dev)
                return NULL;
 
        conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &dev->dst);
-       if (!conn)
-               return NULL;
 
        hci_dev_put(hdev);
 
-       return &conn->dev;
+       return conn ? &conn->dev : NULL;
 }
 
 static int rfcomm_dev_add(struct rfcomm_dev_req *req, struct rfcomm_dlc *dlc)
@@ -767,6 +765,9 @@ static void rfcomm_tty_set_termios(struct tty_struct *tty, struct termios *old)
 
        BT_DBG("tty %p termios %p", tty, old);
 
+       if (!dev)
+               return;
+
        /* Handle turning off CRTSCTS */
        if ((old->c_cflag & CRTSCTS) && !(new->c_cflag & CRTSCTS)) 
                BT_DBG("Turning off CRTSCTS unsupported");
index 7714a2ec3854d032ed0038ebcc8aea5e39494de7..5d13d4f317538e1280118ac7f7f35994437163bf 100644 (file)
@@ -452,7 +452,8 @@ static int sco_sock_create(struct socket *sock, int protocol)
 
        sock->ops = &sco_sock_ops;
 
-       if (!(sk = sco_sock_alloc(sock, protocol, GFP_KERNEL)))
+       sk = sco_sock_alloc(sock, protocol, GFP_ATOMIC);
+       if (!sk)
                return -ENOMEM;
 
        sco_sock_init(sk, NULL);
@@ -967,7 +968,8 @@ static int __init sco_init(void)
                goto error;
        }
 
-       class_create_file(bt_class, &class_attr_sco);
+       if (class_create_file(bt_class, &class_attr_sco) < 0)
+               BT_ERR("Failed to create SCO info file");
 
        BT_INFO("SCO (Voice Link) ver %s", VERSION);
        BT_INFO("SCO socket layer initialized");
index 3a73b8c94271c94beaf3159a078a4fa46c2bb6b0..d9f04864d15d859d0ada8bbb57564999e55eb676 100644 (file)
@@ -128,7 +128,10 @@ void br_fdb_cleanup(unsigned long _data)
        mod_timer(&br->gc_timer, jiffies + HZ/10);
 }
 
-void br_fdb_delete_by_port(struct net_bridge *br, struct net_bridge_port *p)
+
+void br_fdb_delete_by_port(struct net_bridge *br,
+                          const struct net_bridge_port *p,
+                          int do_all)
 {
        int i;
 
@@ -142,6 +145,8 @@ void br_fdb_delete_by_port(struct net_bridge *br, struct net_bridge_port *p)
                        if (f->dst != p) 
                                continue;
 
+                       if (f->is_static && !do_all)
+                               continue;
                        /*
                         * if multiple ports all have the same device address
                         * then when one port is deleted, assign
index b1211d5342f6cac5f43926a2c6a39f1651cb6761..f753c40c11d25743d6d13982443b7ebaa1020e38 100644 (file)
@@ -163,7 +163,7 @@ static void del_nbp(struct net_bridge_port *p)
        br_stp_disable_port(p);
        spin_unlock_bh(&br->lock);
 
-       br_fdb_delete_by_port(br, p);
+       br_fdb_delete_by_port(br, p, 1);
 
        list_del_rcu(&p->list);
 
@@ -448,7 +448,7 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
 
        return 0;
 err2:
-       br_fdb_delete_by_port(br, p);
+       br_fdb_delete_by_port(br, p, 1);
 err1:
        kobject_del(&p->kobj);
 err0:
index c491fb2f280ebf7b1cf2395371c43d33bf36f43c..74258d86f256daf06b1717331026798640820b87 100644 (file)
@@ -143,7 +143,7 @@ extern void br_fdb_changeaddr(struct net_bridge_port *p,
                              const unsigned char *newaddr);
 extern void br_fdb_cleanup(unsigned long arg);
 extern void br_fdb_delete_by_port(struct net_bridge *br,
-                          struct net_bridge_port *p);
+                                 const struct net_bridge_port *p, int do_all);
 extern struct net_bridge_fdb_entry *__br_fdb_get(struct net_bridge *br,
                                                 const unsigned char *addr);
 extern struct net_bridge_fdb_entry *br_fdb_get(struct net_bridge *br,
index 14cd025079af0393abba67e7c3704dc2bd688470..d294224592db0455e0bd31d7f04ab6a290abc21e 100644 (file)
@@ -113,6 +113,8 @@ void br_stp_disable_port(struct net_bridge_port *p)
        del_timer(&p->forward_delay_timer);
        del_timer(&p->hold_timer);
 
+       br_fdb_delete_by_port(br, p, 0);
+
        br_configuration_update(br);
 
        br_port_state_selection(br);
index 4d891beab13899cd96c74b8a6a88b5ef5d6aba43..81c426adcd1ec66b760f1447d6cd9dfe4402e574 100644 (file)
@@ -3502,8 +3502,6 @@ static int __init net_dev_init(void)
 
        BUG_ON(!dev_boot_phase);
 
-       net_random_init();
-
        if (dev_proc_init())
                goto out;
 
index ead5920c26d644d949369987f28adb83f461d1c9..9308af060b44d61284d6ce654b82029dbc0d6738 100644 (file)
@@ -335,13 +335,13 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len)
        memcpy(skb->data, msg, len);
        skb->len += len;
 
-       udph = (struct udphdr *) skb_push(skb, sizeof(*udph));
+       skb->h.uh = udph = (struct udphdr *) skb_push(skb, sizeof(*udph));
        udph->source = htons(np->local_port);
        udph->dest = htons(np->remote_port);
        udph->len = htons(udp_len);
        udph->check = 0;
 
-       iph = (struct iphdr *)skb_push(skb, sizeof(*iph));
+       skb->nh.iph = iph = (struct iphdr *)skb_push(skb, sizeof(*iph));
 
        /* iph->version = 4; iph->ihl = 5; */
        put_unaligned(0x45, (unsigned char *)iph);
@@ -357,8 +357,8 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len)
        iph->check    = ip_fast_csum((unsigned char *)iph, iph->ihl);
 
        eth = (struct ethhdr *) skb_push(skb, ETH_HLEN);
-
-       eth->h_proto = htons(ETH_P_IP);
+       skb->mac.raw = skb->data;
+       skb->protocol = eth->h_proto = htons(ETH_P_IP);
        memcpy(eth->h_source, np->local_mac, 6);
        memcpy(eth->h_dest, np->remote_mac, 6);
 
index b77e155cbe6c036acc1413a1470c5f92d9b05c6c..d472db4776c3bd72fcf396287ad7edf873affffb 100644 (file)
@@ -823,7 +823,7 @@ static void inline sock_lock_init(struct sock *sk)
                                   af_family_slock_key_strings[sk->sk_family]);
        lockdep_init_map(&sk->sk_lock.dep_map,
                         af_family_key_strings[sk->sk_family],
-                        af_family_keys + sk->sk_family);
+                        af_family_keys + sk->sk_family, 0);
 }
 
 /**
index 94c5d761c830e3a156501b9e0320ec16929d5564..d93fe64f6693b3e23624c27741e1d0ffa167663e 100644 (file)
 #include <asm/system.h>
 #include <asm/uaccess.h>
 
-/*
-  This is a maximally equidistributed combined Tausworthe generator
-  based on code from GNU Scientific Library 1.5 (30 Jun 2004)
-
-   x_n = (s1_n ^ s2_n ^ s3_n) 
-
-   s1_{n+1} = (((s1_n & 4294967294) <<12) ^ (((s1_n <<13) ^ s1_n) >>19))
-   s2_{n+1} = (((s2_n & 4294967288) << 4) ^ (((s2_n << 2) ^ s2_n) >>25))
-   s3_{n+1} = (((s3_n & 4294967280) <<17) ^ (((s3_n << 3) ^ s3_n) >>11))
-
-   The period of this generator is about 2^88.
-
-   From: P. L'Ecuyer, "Maximally Equidistributed Combined Tausworthe
-   Generators", Mathematics of Computation, 65, 213 (1996), 203--213.
-
-   This is available on the net from L'Ecuyer's home page,
-
-   http://www.iro.umontreal.ca/~lecuyer/myftp/papers/tausme.ps
-   ftp://ftp.iro.umontreal.ca/pub/simulation/lecuyer/papers/tausme.ps 
-
-   There is an erratum in the paper "Tables of Maximally
-   Equidistributed Combined LFSR Generators", Mathematics of
-   Computation, 68, 225 (1999), 261--269:
-   http://www.iro.umontreal.ca/~lecuyer/myftp/papers/tausme2.ps
-
-        ... the k_j most significant bits of z_j must be non-
-        zero, for each j. (Note: this restriction also applies to the 
-        computer code given in [4], but was mistakenly not mentioned in
-        that paper.)
-   
-   This affects the seeding procedure by imposing the requirement
-   s1 > 1, s2 > 7, s3 > 15.
-
-*/
-struct nrnd_state {
-       u32 s1, s2, s3;
-};
-
-static DEFINE_PER_CPU(struct nrnd_state, net_rand_state);
-
-static u32 __net_random(struct nrnd_state *state)
-{
-#define TAUSWORTHE(s,a,b,c,d) ((s&c)<<d) ^ (((s <<a) ^ s)>>b)
-
-       state->s1 = TAUSWORTHE(state->s1, 13, 19, 4294967294UL, 12);
-       state->s2 = TAUSWORTHE(state->s2, 2, 25, 4294967288UL, 4);
-       state->s3 = TAUSWORTHE(state->s3, 3, 11, 4294967280UL, 17);
-
-       return (state->s1 ^ state->s2 ^ state->s3);
-}
-
-static void __net_srandom(struct nrnd_state *state, unsigned long s)
-{
-       if (s == 0)
-               s = 1;      /* default seed is 1 */
-
-#define LCG(n) (69069 * n)
-       state->s1 = LCG(s);
-       state->s2 = LCG(state->s1);
-       state->s3 = LCG(state->s2);
-
-       /* "warm it up" */
-       __net_random(state);
-       __net_random(state);
-       __net_random(state);
-       __net_random(state);
-       __net_random(state);
-       __net_random(state);
-}
-
-
-unsigned long net_random(void)
-{
-       unsigned long r;
-       struct nrnd_state *state = &get_cpu_var(net_rand_state);
-       r = __net_random(state);
-       put_cpu_var(state);
-       return r;
-}
-
-
-void net_srandom(unsigned long entropy)
-{
-       struct nrnd_state *state = &get_cpu_var(net_rand_state);
-       __net_srandom(state, state->s1^entropy);
-       put_cpu_var(state);
-}
-
-void __init net_random_init(void)
-{
-       int i;
-
-       for_each_possible_cpu(i) {
-               struct nrnd_state *state = &per_cpu(net_rand_state,i);
-               __net_srandom(state, i+jiffies);
-       }
-}
-
-static int net_random_reseed(void)
-{
-       int i;
-       unsigned long seed;
-
-       for_each_possible_cpu(i) {
-               struct nrnd_state *state = &per_cpu(net_rand_state,i);
-
-               get_random_bytes(&seed, sizeof(seed));
-               __net_srandom(state, seed);
-       }
-       return 0;
-}
-late_initcall(net_random_reseed);
-
 int net_msg_cost = 5*HZ;
 int net_msg_burst = 10;
 
@@ -153,10 +40,7 @@ int net_ratelimit(void)
 {
        return __printk_ratelimit(net_msg_cost, net_msg_burst);
 }
-
-EXPORT_SYMBOL(net_random);
 EXPORT_SYMBOL(net_ratelimit);
-EXPORT_SYMBOL(net_srandom);
 
 /*
  * Convert an ASCII string to binary IP.
index ffff0da46c6ee2a3703a9f3116eab0162b4727e6..cb1b8728d7eec0c55c6151da9fba7d00f42747e9 100644 (file)
@@ -748,11 +748,39 @@ static int ioctl_standard_call(struct net_device *        dev,
                int     extra_size;
                int     user_length = 0;
                int     err;
+               int     essid_compat = 0;
 
                /* Calculate space needed by arguments. Always allocate
                 * for max space. Easier, and won't last long... */
                extra_size = descr->max_tokens * descr->token_size;
 
+               /* Check need for ESSID compatibility for WE < 21 */
+               switch (cmd) {
+               case SIOCSIWESSID:
+               case SIOCGIWESSID:
+               case SIOCSIWNICKN:
+               case SIOCGIWNICKN:
+                       if (iwr->u.data.length == descr->max_tokens + 1)
+                               essid_compat = 1;
+                       else if (IW_IS_SET(cmd) && (iwr->u.data.length != 0)) {
+                               char essid[IW_ESSID_MAX_SIZE + 1];
+
+                               err = copy_from_user(essid, iwr->u.data.pointer,
+                                                    iwr->u.data.length *
+                                                    descr->token_size);
+                               if (err)
+                                       return -EFAULT;
+
+                               if (essid[iwr->u.data.length - 1] == '\0')
+                                       essid_compat = 1;
+                       }
+                       break;
+               default:
+                       break;
+               }
+
+               iwr->u.data.length -= essid_compat;
+
                /* Check what user space is giving us */
                if(IW_IS_SET(cmd)) {
                        /* Check NULL pointer */
@@ -795,7 +823,8 @@ static int ioctl_standard_call(struct net_device *  dev,
 #endif /* WE_IOCTL_DEBUG */
 
                /* Create the kernel buffer */
-               extra = kmalloc(extra_size, GFP_KERNEL);
+               /*    kzalloc ensures NULL-termination for essid_compat */
+               extra = kzalloc(extra_size, GFP_KERNEL);
                if (extra == NULL) {
                        return -ENOMEM;
                }
@@ -819,6 +848,8 @@ static int ioctl_standard_call(struct net_device *  dev,
                /* Call the handler */
                ret = handler(dev, &info, &(iwr->u), extra);
 
+               iwr->u.data.length += essid_compat;
+
                /* If we have something to return to the user */
                if (!ret && IW_IS_GET(cmd)) {
                        /* Check if there is enough buffer up there */
index 7e746c4c1688f41293ec6f67dcc512092854260c..aaaf4d09516b0d5dc218ccee0cbcef4933244f0d 100644 (file)
@@ -449,6 +449,8 @@ static inline u64 dccp_v4_init_sequence(const struct sock *sk,
                                           dccp_hdr(skb)->dccph_sport);
 }
 
+static struct request_sock_ops dccp_request_sock_ops;
+
 int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
 {
        struct inet_request_sock *ireq;
@@ -489,7 +491,7 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
        if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1)
                goto drop;
 
-       req = reqsk_alloc(sk->sk_prot->rsk_prot);
+       req = reqsk_alloc(&dccp_request_sock_ops);
        if (req == NULL)
                goto drop;
 
index 7171a78671aa9b0e73732db88e5bee406b5ec445..c8bf89bfb0883377dba84d594cbc756c4ac62ea8 100644 (file)
@@ -672,7 +672,6 @@ static struct sock *dccp_v6_hnd_req(struct sock *sk,struct sk_buff *skb)
 
 static int dccp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
 {
-       struct inet_request_sock *ireq;
        struct dccp_sock dp;
        struct request_sock *req;
        struct dccp_request_sock *dreq;
@@ -701,7 +700,7 @@ static int dccp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
        if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1)
                goto drop;
 
-       req = inet6_reqsk_alloc(sk->sk_prot->rsk_prot);
+       req = inet6_reqsk_alloc(&dccp6_request_sock_ops);
        if (req == NULL)
                goto drop;
 
@@ -713,7 +712,6 @@ static int dccp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
                goto drop_and_free;
 
        ireq6 = inet6_rsk(req);
-       ireq = inet_rsk(req);
        ipv6_addr_copy(&ireq6->rmt_addr, &skb->nh.ipv6h->saddr);
        ipv6_addr_copy(&ireq6->loc_addr, &skb->nh.ipv6h->daddr);
        req->rcv_wnd    = dccp_feat_default_sequence_window;
@@ -997,6 +995,10 @@ static int dccp_v6_do_rcv(struct sock *sk, struct sk_buff *skb)
        if (sk->sk_state == DCCP_OPEN) { /* Fast path */
                if (dccp_rcv_established(sk, skb, dccp_hdr(skb), skb->len))
                        goto reset;
+               if (opt_skb) {
+                       /* This is where we would goto ipv6_pktoptions. */
+                       __kfree_skb(opt_skb);
+               }
                return 0;
        }
 
@@ -1021,6 +1023,10 @@ static int dccp_v6_do_rcv(struct sock *sk, struct sk_buff *skb)
 
        if (dccp_rcv_state_process(sk, skb, dccp_hdr(skb), skb->len))
                goto reset;
+       if (opt_skb) {
+               /* This is where we would goto ipv6_pktoptions. */
+               __kfree_skb(opt_skb);
+       }
        return 0;
 
 reset:
index a2a43d8d93fec2e37cb1c1e50044b66448e22768..23489f7232d28776585f0463deda496d188d591b 100644 (file)
@@ -269,7 +269,7 @@ static inline int compare_keys(struct flowi *fl1, struct flowi *fl2)
 {
        return ((fl1->nl_u.dn_u.daddr ^ fl2->nl_u.dn_u.daddr) |
                (fl1->nl_u.dn_u.saddr ^ fl2->nl_u.dn_u.saddr) |
-#ifdef CONFIG_IP_ROUTE_FWMARK
+#ifdef CONFIG_DECNET_ROUTE_FWMARK
                (fl1->nl_u.dn_u.fwmark ^ fl2->nl_u.dn_u.fwmark) |
 #endif
                (fl1->nl_u.dn_u.scope ^ fl2->nl_u.dn_u.scope) |
@@ -1275,7 +1275,6 @@ static int dn_route_input_slow(struct sk_buff *skb)
                        goto e_inval;
 
                res.type = RTN_LOCAL;
-               flags |= RTCF_DIRECTSRC;
        } else {
                __le16 src_map = fl.fld_src;
                free_res = 1;
@@ -1346,7 +1345,7 @@ static int dn_route_input_slow(struct sk_buff *skb)
                        goto make_route;
 
                /* Packet was intra-ethernet, so we know its on-link */
-               if (cb->rt_flags | DN_RT_F_IE) {
+               if (cb->rt_flags & DN_RT_F_IE) {
                        gateway = cb->src;
                        flags |= RTCF_DIRECTSRC;
                        goto make_route;
index 589f6d2c548a7ba0167598def59daab5b7eb13c4..cf51c87a971d786f0035b7e5d34cc6076889cc23 100644 (file)
@@ -48,7 +48,7 @@ ieee80211softmac_assoc(struct ieee80211softmac_device *mac, struct ieee80211soft
        dprintk(KERN_INFO PFX "sent association request!\n");
 
        spin_lock_irqsave(&mac->lock, flags);
-       mac->associated = 0; /* just to make sure */
+       mac->associnfo.associated = 0; /* just to make sure */
 
        /* Set a timer for timeout */
        /* FIXME: make timeout configurable */
@@ -62,24 +62,22 @@ ieee80211softmac_assoc_timeout(void *d)
 {
        struct ieee80211softmac_device *mac = (struct ieee80211softmac_device *)d;
        struct ieee80211softmac_network *n;
-       unsigned long flags;
 
-       spin_lock_irqsave(&mac->lock, flags);
+       mutex_lock(&mac->associnfo.mutex);
        /* we might race against ieee80211softmac_handle_assoc_response,
         * so make sure only one of us does something */
-       if (!mac->associnfo.associating) {
-               spin_unlock_irqrestore(&mac->lock, flags);
-               return;
-       }
+       if (!mac->associnfo.associating)
+               goto out;
        mac->associnfo.associating = 0;
        mac->associnfo.bssvalid = 0;
-       mac->associated = 0;
+       mac->associnfo.associated = 0;
 
        n = ieee80211softmac_get_network_by_bssid_locked(mac, mac->associnfo.bssid);
-       spin_unlock_irqrestore(&mac->lock, flags);
 
        dprintk(KERN_INFO PFX "assoc request timed out!\n");
        ieee80211softmac_call_events(mac, IEEE80211SOFTMAC_EVENT_ASSOCIATE_TIMEOUT, n);
+out:
+       mutex_unlock(&mac->associnfo.mutex);
 }
 
 void
@@ -93,7 +91,7 @@ ieee80211softmac_disassoc(struct ieee80211softmac_device *mac)
 
        netif_carrier_off(mac->dev);
 
-       mac->associated = 0;
+       mac->associnfo.associated = 0;
        mac->associnfo.bssvalid = 0;
        mac->associnfo.associating = 0;
        ieee80211softmac_init_bss(mac);
@@ -107,7 +105,7 @@ ieee80211softmac_send_disassoc_req(struct ieee80211softmac_device *mac, u16 reas
 {
        struct ieee80211softmac_network *found;
 
-       if (mac->associnfo.bssvalid && mac->associated) {
+       if (mac->associnfo.bssvalid && mac->associnfo.associated) {
                found = ieee80211softmac_get_network_by_bssid(mac, mac->associnfo.bssid);
                if (found)
                        ieee80211softmac_send_mgt_frame(mac, found, IEEE80211_STYPE_DISASSOC, reason);
@@ -196,17 +194,18 @@ ieee80211softmac_assoc_work(void *d)
        int bssvalid;
        unsigned long flags;
 
+       mutex_lock(&mac->associnfo.mutex);
+
+       if (!mac->associnfo.associating)
+               goto out;
+
        /* ieee80211_disassoc might clear this */
        bssvalid = mac->associnfo.bssvalid;
 
        /* meh */
-       if (mac->associated)
+       if (mac->associnfo.associated)
                ieee80211softmac_send_disassoc_req(mac, WLAN_REASON_DISASSOC_STA_HAS_LEFT);
 
-       spin_lock_irqsave(&mac->lock, flags);
-       mac->associnfo.associating = 1;
-       spin_unlock_irqrestore(&mac->lock, flags);
-
        /* try to find the requested network in our list, if we found one already */
        if (bssvalid || mac->associnfo.bssfixed)
                found = ieee80211softmac_get_network_by_bssid(mac, mac->associnfo.bssid);       
@@ -260,10 +259,8 @@ ieee80211softmac_assoc_work(void *d)
 
        if (!found) {
                if (mac->associnfo.scan_retry > 0) {
-                       spin_lock_irqsave(&mac->lock, flags);
                        mac->associnfo.scan_retry--;
-                       spin_unlock_irqrestore(&mac->lock, flags);
-               
+
                        /* We know of no such network. Let's scan. 
                         * NB: this also happens if we had no memory to copy the network info...
                         * Maybe we can hope to have more memory after scanning finishes ;)
@@ -272,19 +269,17 @@ ieee80211softmac_assoc_work(void *d)
                        ieee80211softmac_notify(mac->dev, IEEE80211SOFTMAC_EVENT_SCAN_FINISHED, ieee80211softmac_assoc_notify_scan, NULL);
                        if (ieee80211softmac_start_scan(mac))
                                dprintk(KERN_INFO PFX "Associate: failed to initiate scan. Is device up?\n");
-                       return;
+                       goto out;
                } else {
-                       spin_lock_irqsave(&mac->lock, flags);
                        mac->associnfo.associating = 0;
-                       mac->associated = 0;
-                       spin_unlock_irqrestore(&mac->lock, flags);
+                       mac->associnfo.associated = 0;
 
                        dprintk(KERN_INFO PFX "Unable to find matching network after scan!\n");
                        /* reset the retry counter for the next user request since we
                         * break out and don't reschedule ourselves after this point. */
                        mac->associnfo.scan_retry = IEEE80211SOFTMAC_ASSOC_SCAN_RETRY_LIMIT;
                        ieee80211softmac_call_events(mac, IEEE80211SOFTMAC_EVENT_ASSOCIATE_NET_NOT_FOUND, NULL);
-                       return;
+                       goto out;
                }
        }
 
@@ -297,7 +292,7 @@ ieee80211softmac_assoc_work(void *d)
        /* copy the ESSID for displaying it */
        mac->associnfo.associate_essid.len = found->essid.len;
        memcpy(mac->associnfo.associate_essid.data, found->essid.data, IW_ESSID_MAX_SIZE + 1);
-       
+
        /* we found a network! authenticate (if necessary) and associate to it. */
        if (found->authenticating) {
                dprintk(KERN_INFO PFX "Already requested authentication, waiting...\n");
@@ -305,7 +300,7 @@ ieee80211softmac_assoc_work(void *d)
                        mac->associnfo.assoc_wait = 1;
                        ieee80211softmac_notify_internal(mac, IEEE80211SOFTMAC_EVENT_ANY, found, ieee80211softmac_assoc_notify_auth, NULL, GFP_KERNEL);
                }
-               return;
+               goto out;
        }
        if (!found->authenticated && !found->authenticating) {
                /* This relies on the fact that _auth_req only queues the work,
@@ -321,11 +316,14 @@ ieee80211softmac_assoc_work(void *d)
                        mac->associnfo.assoc_wait = 0;
                        ieee80211softmac_call_events(mac, IEEE80211SOFTMAC_EVENT_ASSOCIATE_FAILED, found);
                }
-               return;
+               goto out;
        }
        /* finally! now we can start associating */
        mac->associnfo.assoc_wait = 0;
        ieee80211softmac_assoc(mac, found);
+
+out:
+       mutex_unlock(&mac->associnfo.mutex);
 }
 
 /* call this to do whatever is necessary when we're associated */
@@ -341,7 +339,7 @@ ieee80211softmac_associated(struct ieee80211softmac_device *mac,
        mac->bssinfo.supported_rates = net->supported_rates;
        ieee80211softmac_recalc_txrates(mac);
 
-       mac->associated = 1;
+       mac->associnfo.associated = 1;
 
        mac->associnfo.short_preamble_available =
                (cap & WLAN_CAPABILITY_SHORT_PREAMBLE) != 0;
@@ -421,7 +419,7 @@ ieee80211softmac_handle_assoc_response(struct net_device * dev,
                        dprintk(KERN_INFO PFX "associating failed (reason: 0x%x)!\n", status);
                        mac->associnfo.associating = 0;
                        mac->associnfo.bssvalid = 0;
-                       mac->associated = 0;
+                       mac->associnfo.associated = 0;
                        ieee80211softmac_call_events_locked(mac, IEEE80211SOFTMAC_EVENT_ASSOCIATE_FAILED, network);
        }
        
index 82bfddbf33a28e999b944d86660f21560206438b..b96931001b43d131bc30d8d7841fda97b0897ce0 100644 (file)
@@ -304,7 +304,7 @@ ieee80211softmac_auth(struct ieee80211_auth **pkt,
                2 +             /* Auth Transaction Seq */
                2 +             /* Status Code */
                 /* Challenge Text IE */
-               is_shared_response ? 0 : 1 + 1 + net->challenge_len
+               (is_shared_response ? 1 + 1 + net->challenge_len : 0)
        );
        if (unlikely((*pkt) == NULL))
                return 0;
@@ -475,8 +475,13 @@ int ieee80211softmac_handle_beacon(struct net_device *dev,
 {
        struct ieee80211softmac_device *mac = ieee80211_priv(dev);
 
-       if (mac->associated && memcmp(network->bssid, mac->associnfo.bssid, ETH_ALEN) == 0)
-               ieee80211softmac_process_erp(mac, network->erp_value);
+       /* This might race, but we don't really care and it's not worth
+        * adding heavyweight locking in this fastpath.
+        */
+       if (mac->associnfo.associated) {
+               if (memcmp(network->bssid, mac->associnfo.bssid, ETH_ALEN) == 0)
+                       ieee80211softmac_process_erp(mac, network->erp_value);
+       }
 
        return 0;
 }
index addea1cf73ae3f5ba9f2787af8503bb354b97778..33aff4f4a471fde8fe6538c46dbe8527c48536a6 100644 (file)
@@ -57,6 +57,7 @@ struct net_device *alloc_ieee80211softmac(int sizeof_priv)
        INIT_LIST_HEAD(&softmac->network_list);
        INIT_LIST_HEAD(&softmac->events);
 
+       mutex_init(&softmac->associnfo.mutex);
        INIT_WORK(&softmac->associnfo.work, ieee80211softmac_assoc_work, softmac);
        INIT_WORK(&softmac->associnfo.timeout, ieee80211softmac_assoc_timeout, softmac);
        softmac->start_scan = ieee80211softmac_start_scan_implementation;
index 2aa779d18f3861a2f6f2119f99c89c6c2c56b583..23068a830f7dba7916c0380ef1767758d1f95815 100644 (file)
@@ -73,13 +73,14 @@ ieee80211softmac_wx_set_essid(struct net_device *net_dev,
        struct ieee80211softmac_network *n;
        struct ieee80211softmac_auth_queue_item *authptr;
        int length = 0;
-       unsigned long flags;
+
+       mutex_lock(&sm->associnfo.mutex);
 
        /* Check if we're already associating to this or another network
         * If it's another network, cancel and start over with our new network
         * If it's our network, ignore the change, we're already doing it!
         */
-       if((sm->associnfo.associating || sm->associated) &&
+       if((sm->associnfo.associating || sm->associnfo.associated) &&
           (data->essid.flags && data->essid.length)) {
                /* Get the associating network */
                n = ieee80211softmac_get_network_by_bssid(sm, sm->associnfo.bssid);
@@ -87,10 +88,9 @@ ieee80211softmac_wx_set_essid(struct net_device *net_dev,
                   !memcmp(n->essid.data, extra, n->essid.len)) {
                        dprintk(KERN_INFO PFX "Already associating or associated to "MAC_FMT"\n",
                                MAC_ARG(sm->associnfo.bssid));
-                       return 0;
+                       goto out;
                } else {
                        dprintk(KERN_INFO PFX "Canceling existing associate request!\n");
-                       spin_lock_irqsave(&sm->lock,flags);
                        /* Cancel assoc work */
                        cancel_delayed_work(&sm->associnfo.work);
                        /* We don't have to do this, but it's a little cleaner */
@@ -98,14 +98,13 @@ ieee80211softmac_wx_set_essid(struct net_device *net_dev,
                                cancel_delayed_work(&authptr->work);
                        sm->associnfo.bssvalid = 0;
                        sm->associnfo.bssfixed = 0;
-                       spin_unlock_irqrestore(&sm->lock,flags);
                        flush_scheduled_work();
+                       sm->associnfo.associating = 0;
+                       sm->associnfo.associated = 0;
                }
        }
 
 
-       spin_lock_irqsave(&sm->lock, flags);
-
        sm->associnfo.static_essid = 0;
        sm->associnfo.assoc_wait = 0;
 
@@ -121,10 +120,12 @@ ieee80211softmac_wx_set_essid(struct net_device *net_dev,
         * If applicable, we have already copied the data in */
        sm->associnfo.req_essid.len = length;
 
+       sm->associnfo.associating = 1;
        /* queue lower level code to do work (if necessary) */
        schedule_work(&sm->associnfo.work);
+out:
+       mutex_unlock(&sm->associnfo.mutex);
 
-       spin_unlock_irqrestore(&sm->lock, flags);
        return 0;
 }
 EXPORT_SYMBOL_GPL(ieee80211softmac_wx_set_essid);
@@ -136,10 +137,8 @@ ieee80211softmac_wx_get_essid(struct net_device *net_dev,
                              char *extra)
 {
        struct ieee80211softmac_device *sm = ieee80211_priv(net_dev);
-       unsigned long flags;
 
-       /* avoid getting inconsistent information */
-       spin_lock_irqsave(&sm->lock, flags);
+       mutex_lock(&sm->associnfo.mutex);
        /* If all fails, return ANY (empty) */
        data->essid.length = 0;
        data->essid.flags = 0;  /* active */
@@ -152,12 +151,13 @@ ieee80211softmac_wx_get_essid(struct net_device *net_dev,
        }
        
        /* If we're associating/associated, return that */
-       if (sm->associated || sm->associnfo.associating) {
+       if (sm->associnfo.associated || sm->associnfo.associating) {
                data->essid.length = sm->associnfo.associate_essid.len;
                data->essid.flags = 1;  /* active */
                memcpy(extra, sm->associnfo.associate_essid.data, sm->associnfo.associate_essid.len);
        }
-       spin_unlock_irqrestore(&sm->lock, flags);
+       mutex_unlock(&sm->associnfo.mutex);
+
        return 0;
 }
 EXPORT_SYMBOL_GPL(ieee80211softmac_wx_get_essid);
@@ -322,15 +322,15 @@ ieee80211softmac_wx_get_wap(struct net_device *net_dev,
 {
        struct ieee80211softmac_device *mac = ieee80211_priv(net_dev);
        int err = 0;
-       unsigned long flags;
 
-       spin_lock_irqsave(&mac->lock, flags);
+       mutex_lock(&mac->associnfo.mutex);
        if (mac->associnfo.bssvalid)
                memcpy(data->ap_addr.sa_data, mac->associnfo.bssid, ETH_ALEN);
        else
                memset(data->ap_addr.sa_data, 0xff, ETH_ALEN);
        data->ap_addr.sa_family = ARPHRD_ETHER;
-       spin_unlock_irqrestore(&mac->lock, flags);
+       mutex_unlock(&mac->associnfo.mutex);
+
        return err;
 }
 EXPORT_SYMBOL_GPL(ieee80211softmac_wx_get_wap);
@@ -342,28 +342,27 @@ ieee80211softmac_wx_set_wap(struct net_device *net_dev,
                            char *extra)
 {
        struct ieee80211softmac_device *mac = ieee80211_priv(net_dev);
-       unsigned long flags;
 
        /* sanity check */
        if (data->ap_addr.sa_family != ARPHRD_ETHER) {
                return -EINVAL;
        }
 
-       spin_lock_irqsave(&mac->lock, flags);
+       mutex_lock(&mac->associnfo.mutex);
        if (is_broadcast_ether_addr(data->ap_addr.sa_data)) {
                /* the bssid we have is not to be fixed any longer,
                 * and we should reassociate to the best AP. */
                mac->associnfo.bssfixed = 0;
                /* force reassociation */
                mac->associnfo.bssvalid = 0;
-               if (mac->associated)
+               if (mac->associnfo.associated)
                        schedule_work(&mac->associnfo.work);
        } else if (is_zero_ether_addr(data->ap_addr.sa_data)) {
                /* the bssid we have is no longer fixed */
                mac->associnfo.bssfixed = 0;
         } else {
                if (!memcmp(mac->associnfo.bssid, data->ap_addr.sa_data, ETH_ALEN)) {
-                       if (mac->associnfo.associating || mac->associated) {
+                       if (mac->associnfo.associating || mac->associnfo.associated) {
                        /* bssid unchanged and associated or associating - just return */
                                goto out;
                        }
@@ -378,7 +377,8 @@ ieee80211softmac_wx_set_wap(struct net_device *net_dev,
         }
 
  out:
-       spin_unlock_irqrestore(&mac->lock, flags);
+       mutex_unlock(&mac->associnfo.mutex);
+
        return 0;
 }
 EXPORT_SYMBOL_GPL(ieee80211softmac_wx_set_wap);
@@ -394,7 +394,8 @@ ieee80211softmac_wx_set_genie(struct net_device *dev,
        int err = 0;
        char *buf;
        int i;
-       
+
+       mutex_lock(&mac->associnfo.mutex);
        spin_lock_irqsave(&mac->lock, flags);
        /* bleh. shouldn't be locked for that kmalloc... */
 
@@ -432,6 +433,8 @@ ieee80211softmac_wx_set_genie(struct net_device *dev,
 
  out:  
        spin_unlock_irqrestore(&mac->lock, flags);
+       mutex_unlock(&mac->associnfo.mutex);
+
        return err;
 }
 EXPORT_SYMBOL_GPL(ieee80211softmac_wx_set_genie);
@@ -446,7 +449,8 @@ ieee80211softmac_wx_get_genie(struct net_device *dev,
        unsigned long flags;
        int err = 0;
        int space = wrqu->data.length;
-       
+
+       mutex_lock(&mac->associnfo.mutex);
        spin_lock_irqsave(&mac->lock, flags);
        
        wrqu->data.length = 0;
@@ -459,6 +463,8 @@ ieee80211softmac_wx_get_genie(struct net_device *dev,
                        err = -E2BIG;
        }
        spin_unlock_irqrestore(&mac->lock, flags);
+       mutex_lock(&mac->associnfo.mutex);
+
        return err;
 }
 EXPORT_SYMBOL_GPL(ieee80211softmac_wx_get_genie);
@@ -473,10 +479,13 @@ ieee80211softmac_wx_set_mlme(struct net_device *dev,
        struct iw_mlme *mlme = (struct iw_mlme *)extra;
        u16 reason = cpu_to_le16(mlme->reason_code);
        struct ieee80211softmac_network *net;
+       int err = -EINVAL;
+
+       mutex_lock(&mac->associnfo.mutex);
 
        if (memcmp(mac->associnfo.bssid, mlme->addr.sa_data, ETH_ALEN)) {
                printk(KERN_DEBUG PFX "wx_set_mlme: requested operation on net we don't use\n");
-               return -EINVAL;
+               goto out;
        }
 
        switch (mlme->cmd) {
@@ -484,14 +493,22 @@ ieee80211softmac_wx_set_mlme(struct net_device *dev,
                net = ieee80211softmac_get_network_by_bssid_locked(mac, mlme->addr.sa_data);
                if (!net) {
                        printk(KERN_DEBUG PFX "wx_set_mlme: we should know the net here...\n");
-                       return -EINVAL;
+                       goto out;
                }
                return ieee80211softmac_deauth_req(mac, net, reason);
        case IW_MLME_DISASSOC:
                ieee80211softmac_send_disassoc_req(mac, reason);
-               return 0;
+               mac->associnfo.associated = 0;
+               mac->associnfo.associating = 0;
+               err = 0;
+               goto out;
        default:
-               return -EOPNOTSUPP;
+               err = -EOPNOTSUPP;
        }
+
+out:
+       mutex_unlock(&mac->associnfo.mutex);
+
+       return err;
 }
 EXPORT_SYMBOL_GPL(ieee80211softmac_wx_set_mlme);
index bde8ccaa15316f2521edda94de64f1ac67c4468a..e2077a3aa8c097156c34e4e12fd1f4a36320af08 100644 (file)
@@ -773,13 +773,15 @@ static int cipso_v4_map_cat_rbm_valid(const struct cipso_v4_doi *doi_def,
 {
        int cat = -1;
        u32 bitmap_len_bits = bitmap_len * 8;
-       u32 cipso_cat_size = doi_def->map.std->cat.cipso_size;
-       u32 *cipso_array = doi_def->map.std->cat.cipso;
+       u32 cipso_cat_size;
+       u32 *cipso_array;
 
        switch (doi_def->type) {
        case CIPSO_V4_MAP_PASS:
                return 0;
        case CIPSO_V4_MAP_STD:
+               cipso_cat_size = doi_def->map.std->cat.cipso_size;
+               cipso_array = doi_def->map.std->cat.cipso;
                for (;;) {
                        cat = cipso_v4_bitmap_walk(bitmap,
                                                   bitmap_len_bits,
@@ -825,19 +827,21 @@ static int cipso_v4_map_cat_rbm_hton(const struct cipso_v4_doi *doi_def,
        u32 net_spot_max = 0;
        u32 host_clen_bits = host_cat_len * 8;
        u32 net_clen_bits = net_cat_len * 8;
-       u32 host_cat_size = doi_def->map.std->cat.local_size;
-       u32 *host_cat_array = doi_def->map.std->cat.local;
+       u32 host_cat_size;
+       u32 *host_cat_array;
 
        switch (doi_def->type) {
        case CIPSO_V4_MAP_PASS:
-               net_spot_max = host_cat_len - 1;
-               while (net_spot_max > 0 && host_cat[net_spot_max] == 0)
+               net_spot_max = host_cat_len;
+               while (net_spot_max > 0 && host_cat[net_spot_max - 1] == 0)
                        net_spot_max--;
                if (net_spot_max > net_cat_len)
                        return -EINVAL;
                memcpy(net_cat, host_cat, net_spot_max);
                return net_spot_max;
        case CIPSO_V4_MAP_STD:
+               host_cat_size = doi_def->map.std->cat.local_size;
+               host_cat_array = doi_def->map.std->cat.local;
                for (;;) {
                        host_spot = cipso_v4_bitmap_walk(host_cat,
                                                         host_clen_bits,
@@ -893,8 +897,8 @@ static int cipso_v4_map_cat_rbm_ntoh(const struct cipso_v4_doi *doi_def,
        int net_spot = -1;
        u32 net_clen_bits = net_cat_len * 8;
        u32 host_clen_bits = host_cat_len * 8;
-       u32 net_cat_size = doi_def->map.std->cat.cipso_size;
-       u32 *net_cat_array = doi_def->map.std->cat.cipso;
+       u32 net_cat_size;
+       u32 *net_cat_array;
 
        switch (doi_def->type) {
        case CIPSO_V4_MAP_PASS:
@@ -903,6 +907,8 @@ static int cipso_v4_map_cat_rbm_ntoh(const struct cipso_v4_doi *doi_def,
                memcpy(host_cat, net_cat, net_cat_len);
                return net_cat_len;
        case CIPSO_V4_MAP_STD:
+               net_cat_size = doi_def->map.std->cat.cipso_size;
+               net_cat_array = doi_def->map.std->cat.cipso;
                for (;;) {
                        net_spot = cipso_v4_bitmap_walk(net_cat,
                                                        net_clen_bits,
index 9c399a70dd5d5962f3e47ad9e82cae0ae8b46c7b..af0190d8b6c02ebdb2df31a96b2df8f4e67ddf1b 100644 (file)
@@ -482,9 +482,7 @@ static int rtm_to_fib_config(struct sk_buff *skb, struct nlmsghdr *nlh,
        memset(cfg, 0, sizeof(*cfg));
 
        rtm = nlmsg_data(nlh);
-       cfg->fc_family = rtm->rtm_family;
        cfg->fc_dst_len = rtm->rtm_dst_len;
-       cfg->fc_src_len = rtm->rtm_src_len;
        cfg->fc_tos = rtm->rtm_tos;
        cfg->fc_table = rtm->rtm_table;
        cfg->fc_protocol = rtm->rtm_protocol;
@@ -501,9 +499,6 @@ static int rtm_to_fib_config(struct sk_buff *skb, struct nlmsghdr *nlh,
                case RTA_DST:
                        cfg->fc_dst = nla_get_be32(attr);
                        break;
-               case RTA_SRC:
-                       cfg->fc_src = nla_get_be32(attr);
-                       break;
                case RTA_OIF:
                        cfg->fc_oif = nla_get_u32(attr);
                        break;
index 2b1a54b59c48c4f2a65d6f8838bbcfd567a71183..f072f3875af8dfd5c6505787230cc578d8085c1c 100644 (file)
@@ -94,10 +94,8 @@ int inet_peer_minttl = 120 * HZ;     /* TTL under high load: 120 sec */
 int inet_peer_maxttl = 10 * 60 * HZ;   /* usual time to live: 10 min */
 
 static struct inet_peer *inet_peer_unused_head;
-/* Exported for inet_putpeer inline function.  */
-struct inet_peer **inet_peer_unused_tailp = &inet_peer_unused_head;
-DEFINE_SPINLOCK(inet_peer_unused_lock);
-#define PEER_MAX_CLEANUP_WORK 30
+static struct inet_peer **inet_peer_unused_tailp = &inet_peer_unused_head;
+static DEFINE_SPINLOCK(inet_peer_unused_lock);
 
 static void peer_check_expire(unsigned long dummy);
 static DEFINE_TIMER(peer_periodic_timer, peer_check_expire, 0, 0);
@@ -340,7 +338,8 @@ static int cleanup_once(unsigned long ttl)
        spin_lock_bh(&inet_peer_unused_lock);
        p = inet_peer_unused_head;
        if (p != NULL) {
-               if (time_after(p->dtime + ttl, jiffies)) {
+               __u32 delta = (__u32)jiffies - p->dtime;
+               if (delta < ttl) {
                        /* Do not prune fresh entries. */
                        spin_unlock_bh(&inet_peer_unused_lock);
                        return -1;
@@ -432,7 +431,7 @@ out_free:
 /* Called with local BH disabled. */
 static void peer_check_expire(unsigned long dummy)
 {
-       int i;
+       unsigned long now = jiffies;
        int ttl;
 
        if (peer_total >= inet_peer_threshold)
@@ -441,7 +440,10 @@ static void peer_check_expire(unsigned long dummy)
                ttl = inet_peer_maxttl
                                - (inet_peer_maxttl - inet_peer_minttl) / HZ *
                                        peer_total / inet_peer_threshold * HZ;
-       for (i = 0; i < PEER_MAX_CLEANUP_WORK && !cleanup_once(ttl); i++);
+       while (!cleanup_once(ttl)) {
+               if (jiffies != now)
+                       break;
+       }
 
        /* Trigger the timer after inet_peer_gc_mintime .. inet_peer_gc_maxtime
         * interval depending on the total number of entries (more entries,
@@ -455,3 +457,16 @@ static void peer_check_expire(unsigned long dummy)
                                peer_total / inet_peer_threshold * HZ;
        add_timer(&peer_periodic_timer);
 }
+
+void inet_putpeer(struct inet_peer *p)
+{
+       spin_lock_bh(&inet_peer_unused_lock);
+       if (atomic_dec_and_test(&p->refcnt)) {
+               p->unused_prevp = inet_peer_unused_tailp;
+               p->unused_next = NULL;
+               *inet_peer_unused_tailp = p;
+               inet_peer_unused_tailp = &p->unused_next;
+               p->dtime = (__u32)jiffies;
+       }
+       spin_unlock_bh(&inet_peer_unused_lock);
+}
index 17e1a687ab4553e76f53a40029c4f87599d49df9..0849f1cced13364b014ef787157e1d7c76995f4e 100644 (file)
@@ -1196,6 +1196,8 @@ err1:
 static void __exit arp_tables_fini(void)
 {
        nf_unregister_sockopt(&arpt_sockopts);
+       xt_unregister_target(&arpt_error_target);
+       xt_unregister_target(&arpt_standard_target);
        xt_proto_fini(NF_ARP);
 }
 
index 53b6dffea6c2174fcf49f30e7844010c015a3772..262d0d44ec1b5924aff8a3d7efe4ec6a1fbb2733 100644 (file)
@@ -44,13 +44,6 @@ MODULE_LICENSE("GPL");
 
 static char __initdata version[] = "0.90";
 
-#if 0
-#define DEBUGP printk
-#else
-#define DEBUGP(format, args...)
-#endif
-
-
 static inline int
 ctnetlink_dump_tuples_proto(struct sk_buff *skb, 
                            const struct ip_conntrack_tuple *tuple,
@@ -398,7 +391,6 @@ nfattr_failure:
 
 static int ctnetlink_done(struct netlink_callback *cb)
 {
-       DEBUGP("entered %s\n", __FUNCTION__);
        if (cb->args[1])
                ip_conntrack_put((struct ip_conntrack *)cb->args[1]);
        return 0;
@@ -411,9 +403,6 @@ ctnetlink_dump_table(struct sk_buff *skb, struct netlink_callback *cb)
        struct ip_conntrack_tuple_hash *h;
        struct list_head *i;
 
-       DEBUGP("entered %s, last bucket=%lu id=%u\n", __FUNCTION__, 
-                       cb->args[0], *id);
-
        read_lock_bh(&ip_conntrack_lock);
        last = (struct ip_conntrack *)cb->args[1];
        for (; cb->args[0] < ip_conntrack_htable_size; cb->args[0]++) {
@@ -452,7 +441,6 @@ out:
        if (last)
                ip_conntrack_put(last);
 
-       DEBUGP("leaving, last bucket=%lu id=%u\n", cb->args[0], *id);
        return skb->len;
 }
 
@@ -466,8 +454,6 @@ ctnetlink_parse_tuple_ip(struct nfattr *attr, struct ip_conntrack_tuple *tuple)
 {
        struct nfattr *tb[CTA_IP_MAX];
 
-       DEBUGP("entered %s\n", __FUNCTION__);
-
        nfattr_parse_nested(tb, CTA_IP_MAX, attr);
 
        if (nfattr_bad_size(tb, CTA_IP_MAX, cta_min_ip))
@@ -481,8 +467,6 @@ ctnetlink_parse_tuple_ip(struct nfattr *attr, struct ip_conntrack_tuple *tuple)
                return -EINVAL;
        tuple->dst.ip = *(__be32 *)NFA_DATA(tb[CTA_IP_V4_DST-1]);
 
-       DEBUGP("leaving\n");
-
        return 0;
 }
 
@@ -503,8 +487,6 @@ ctnetlink_parse_tuple_proto(struct nfattr *attr,
        struct ip_conntrack_protocol *proto;
        int ret = 0;
 
-       DEBUGP("entered %s\n", __FUNCTION__);
-
        nfattr_parse_nested(tb, CTA_PROTO_MAX, attr);
 
        if (nfattr_bad_size(tb, CTA_PROTO_MAX, cta_min_proto))
@@ -531,8 +513,6 @@ ctnetlink_parse_tuple(struct nfattr *cda[], struct ip_conntrack_tuple *tuple,
        struct nfattr *tb[CTA_TUPLE_MAX];
        int err;
 
-       DEBUGP("entered %s\n", __FUNCTION__);
-
        memset(tuple, 0, sizeof(*tuple));
 
        nfattr_parse_nested(tb, CTA_TUPLE_MAX, cda[type-1]);
@@ -557,10 +537,6 @@ ctnetlink_parse_tuple(struct nfattr *cda[], struct ip_conntrack_tuple *tuple,
        else
                tuple->dst.dir = IP_CT_DIR_ORIGINAL;
 
-       DUMP_TUPLE(tuple);
-
-       DEBUGP("leaving\n");
-
        return 0;
 }
 
@@ -577,8 +553,6 @@ static int ctnetlink_parse_nat_proto(struct nfattr *attr,
        struct nfattr *tb[CTA_PROTONAT_MAX];
        struct ip_nat_protocol *npt;
 
-       DEBUGP("entered %s\n", __FUNCTION__);
-
        nfattr_parse_nested(tb, CTA_PROTONAT_MAX, attr);
 
        if (nfattr_bad_size(tb, CTA_PROTONAT_MAX, cta_min_protonat))
@@ -597,7 +571,6 @@ static int ctnetlink_parse_nat_proto(struct nfattr *attr,
 
        ip_nat_proto_put(npt);
 
-       DEBUGP("leaving\n");
        return 0;
 }
 
@@ -613,8 +586,6 @@ ctnetlink_parse_nat(struct nfattr *nat,
        struct nfattr *tb[CTA_NAT_MAX];
        int err;
 
-       DEBUGP("entered %s\n", __FUNCTION__);
-
        memset(range, 0, sizeof(*range));
        
        nfattr_parse_nested(tb, CTA_NAT_MAX, nat);
@@ -640,7 +611,6 @@ ctnetlink_parse_nat(struct nfattr *nat,
        if (err < 0)
                return err;
 
-       DEBUGP("leaving\n");
        return 0;
 }
 #endif
@@ -650,8 +620,6 @@ ctnetlink_parse_help(struct nfattr *attr, char **helper_name)
 {
        struct nfattr *tb[CTA_HELP_MAX];
 
-       DEBUGP("entered %s\n", __FUNCTION__);
-
        nfattr_parse_nested(tb, CTA_HELP_MAX, attr);
 
        if (!tb[CTA_HELP_NAME-1])
@@ -679,8 +647,6 @@ ctnetlink_del_conntrack(struct sock *ctnl, struct sk_buff *skb,
        struct ip_conntrack *ct;
        int err = 0;
 
-       DEBUGP("entered %s\n", __FUNCTION__);
-
        if (nfattr_bad_size(cda, CTA_MAX, cta_min))
                return -EINVAL;
 
@@ -698,10 +664,8 @@ ctnetlink_del_conntrack(struct sock *ctnl, struct sk_buff *skb,
                return err;
 
        h = ip_conntrack_find_get(&tuple, NULL);
-       if (!h) {
-               DEBUGP("tuple not found in conntrack hash\n");
+       if (!h)
                return -ENOENT;
-       }
 
        ct = tuplehash_to_ctrack(h);
        
@@ -716,7 +680,6 @@ ctnetlink_del_conntrack(struct sock *ctnl, struct sk_buff *skb,
                ct->timeout.function((unsigned long)ct);
 
        ip_conntrack_put(ct);
-       DEBUGP("leaving\n");
 
        return 0;
 }
@@ -731,8 +694,6 @@ ctnetlink_get_conntrack(struct sock *ctnl, struct sk_buff *skb,
        struct sk_buff *skb2 = NULL;
        int err = 0;
 
-       DEBUGP("entered %s\n", __FUNCTION__);
-
        if (nlh->nlmsg_flags & NLM_F_DUMP) {
                struct nfgenmsg *msg = NLMSG_DATA(nlh);
                u32 rlen;
@@ -770,11 +731,9 @@ ctnetlink_get_conntrack(struct sock *ctnl, struct sk_buff *skb,
                return err;
 
        h = ip_conntrack_find_get(&tuple, NULL);
-       if (!h) {
-               DEBUGP("tuple not found in conntrack hash");
+       if (!h)
                return -ENOENT;
-       }
-       DEBUGP("tuple found\n");
+
        ct = tuplehash_to_ctrack(h);
 
        err = -ENOMEM;
@@ -795,7 +754,6 @@ ctnetlink_get_conntrack(struct sock *ctnl, struct sk_buff *skb,
        if (err < 0)
                goto out;
 
-       DEBUGP("leaving\n");
        return 0;
 
 free:
@@ -866,8 +824,6 @@ ctnetlink_change_helper(struct ip_conntrack *ct, struct nfattr *cda[])
        char *helpname;
        int err;
 
-       DEBUGP("entered %s\n", __FUNCTION__);
-
        /* don't change helper of sibling connections */
        if (ct->master)
                return -EINVAL;
@@ -938,8 +894,6 @@ ctnetlink_change_conntrack(struct ip_conntrack *ct, struct nfattr *cda[])
 {
        int err;
 
-       DEBUGP("entered %s\n", __FUNCTION__);
-
        if (cda[CTA_HELP-1]) {
                err = ctnetlink_change_helper(ct, cda);
                if (err < 0)
@@ -969,7 +923,6 @@ ctnetlink_change_conntrack(struct ip_conntrack *ct, struct nfattr *cda[])
                ct->mark = ntohl(*(__be32 *)NFA_DATA(cda[CTA_MARK-1]));
 #endif
 
-       DEBUGP("all done\n");
        return 0;
 }
 
@@ -981,8 +934,6 @@ ctnetlink_create_conntrack(struct nfattr *cda[],
        struct ip_conntrack *ct;
        int err = -EINVAL;
 
-       DEBUGP("entered %s\n", __FUNCTION__);
-
        ct = ip_conntrack_alloc(otuple, rtuple);
        if (ct == NULL || IS_ERR(ct))
                return -ENOMEM; 
@@ -1017,7 +968,6 @@ ctnetlink_create_conntrack(struct nfattr *cda[],
        if (ct->helper)
                ip_conntrack_helper_put(ct->helper);
 
-       DEBUGP("conntrack with id %u inserted\n", ct->id);
        return 0;
 
 err:   
@@ -1033,8 +983,6 @@ ctnetlink_new_conntrack(struct sock *ctnl, struct sk_buff *skb,
        struct ip_conntrack_tuple_hash *h = NULL;
        int err = 0;
 
-       DEBUGP("entered %s\n", __FUNCTION__);
-
        if (nfattr_bad_size(cda, CTA_MAX, cta_min))
                return -EINVAL;
 
@@ -1058,7 +1006,6 @@ ctnetlink_new_conntrack(struct sock *ctnl, struct sk_buff *skb,
 
        if (h == NULL) {
                write_unlock_bh(&ip_conntrack_lock);
-               DEBUGP("no such conntrack, create new\n");
                err = -ENOENT;
                if (nlh->nlmsg_flags & NLM_F_CREATE)
                        err = ctnetlink_create_conntrack(cda, &otuple, &rtuple);
@@ -1074,7 +1021,6 @@ ctnetlink_new_conntrack(struct sock *ctnl, struct sk_buff *skb,
 
        /* We manipulate the conntrack inside the global conntrack table lock,
         * so there's no need to increase the refcount */
-       DEBUGP("conntrack found\n");
        err = -EEXIST;
        if (!(nlh->nlmsg_flags & NLM_F_EXCL))
                err = ctnetlink_change_conntrack(tuplehash_to_ctrack(h), cda);
@@ -1249,8 +1195,6 @@ ctnetlink_exp_dump_table(struct sk_buff *skb, struct netlink_callback *cb)
        struct list_head *i;
        u_int32_t *id = (u_int32_t *) &cb->args[0];
 
-       DEBUGP("entered %s, last id=%llu\n", __FUNCTION__, *id);
-
        read_lock_bh(&ip_conntrack_lock);
        list_for_each_prev(i, &ip_conntrack_expect_list) {
                exp = (struct ip_conntrack_expect *) i;
@@ -1266,8 +1210,6 @@ ctnetlink_exp_dump_table(struct sk_buff *skb, struct netlink_callback *cb)
 out:   
        read_unlock_bh(&ip_conntrack_lock);
 
-       DEBUGP("leaving, last id=%llu\n", *id);
-
        return skb->len;
 }
 
@@ -1285,8 +1227,6 @@ ctnetlink_get_expect(struct sock *ctnl, struct sk_buff *skb,
        struct sk_buff *skb2;
        int err = 0;
 
-       DEBUGP("entered %s\n", __FUNCTION__);
-
        if (nfattr_bad_size(cda, CTA_EXPECT_MAX, cta_min_exp))
                return -EINVAL;
 
@@ -1437,8 +1377,6 @@ ctnetlink_create_expect(struct nfattr *cda[])
        struct ip_conntrack *ct;
        int err = 0;
 
-       DEBUGP("entered %s\n", __FUNCTION__);
-
        /* caller guarantees that those three CTA_EXPECT_* exist */
        err = ctnetlink_parse_tuple(cda, &tuple, CTA_EXPECT_TUPLE);
        if (err < 0)
@@ -1490,8 +1428,6 @@ ctnetlink_new_expect(struct sock *ctnl, struct sk_buff *skb,
        struct ip_conntrack_expect *exp;
        int err = 0;
 
-       DEBUGP("entered %s\n", __FUNCTION__);   
-
        if (nfattr_bad_size(cda, CTA_EXPECT_MAX, cta_min_exp))
                return -EINVAL;
 
@@ -1520,8 +1456,6 @@ ctnetlink_new_expect(struct sock *ctnl, struct sk_buff *skb,
                err = ctnetlink_change_expect(exp, cda);
        write_unlock_bh(&ip_conntrack_lock);
 
-       DEBUGP("leaving\n");
-       
        return err;
 }
 
index 78a44b01c03516bf18aecd65b7191800c42da947..4b90927619b80d2e0461bdd395dc7a82a68e340c 100644 (file)
@@ -1932,6 +1932,9 @@ compat_do_ipt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
 {
        int ret;
 
+       if (!capable(CAP_NET_ADMIN))
+               return -EPERM;
+
        switch (cmd) {
        case IPT_SO_GET_INFO:
                ret = get_info(user, len, 1);
index 12a818a2462f2a8caf9f8fea514d401fd1d7311b..1aa4517fbcdb454f02e70933484cae5a9b4b2382 100644 (file)
@@ -28,7 +28,7 @@ static inline int
 set_ect_ip(struct sk_buff **pskb, const struct ipt_ECN_info *einfo)
 {
        struct iphdr *iph = (*pskb)->nh.iph;
-       __be16 oldtos;
+       u_int16_t oldtos;
 
        if ((iph->tos & IPT_ECN_IP_MASK) != (einfo->ip_ect & IPT_ECN_IP_MASK)) {
                if (!skb_make_writable(pskb, sizeof(struct iphdr)))
@@ -37,8 +37,8 @@ set_ect_ip(struct sk_buff **pskb, const struct ipt_ECN_info *einfo)
                oldtos = iph->tos;
                iph->tos &= ~IPT_ECN_IP_MASK;
                iph->tos |= (einfo->ip_ect & IPT_ECN_IP_MASK);
-               iph->check = nf_csum_update(oldtos ^ htons(0xFFFF), iph->tos,
-                                           iph->check);
+               iph->check = nf_csum_update(htons(oldtos) ^ htons(0xFFFF),
+                                           htons(iph->tos), iph->check);
        } 
        return 1;
 }
index 6b8b14ccc3d3ff9a0fa0610a0e08df6d274cf2ef..83b80b3a5d2f1de5b5aebd891ae164c78771288c 100644 (file)
@@ -30,7 +30,7 @@ target(struct sk_buff **pskb,
 {
        const struct ipt_tos_target_info *tosinfo = targinfo;
        struct iphdr *iph = (*pskb)->nh.iph;
-       __be16 oldtos;
+       u_int16_t oldtos;
 
        if ((iph->tos & IPTOS_TOS_MASK) != tosinfo->tos) {
                if (!skb_make_writable(pskb, sizeof(struct iphdr)))
@@ -38,8 +38,8 @@ target(struct sk_buff **pskb,
                iph = (*pskb)->nh.iph;
                oldtos = iph->tos;
                iph->tos = (iph->tos & IPTOS_PREC_MASK) | tosinfo->tos;
-               iph->check = nf_csum_update(oldtos ^ htons(0xFFFF), iph->tos,
-                                           iph->check);
+               iph->check = nf_csum_update(htons(oldtos) ^ htons(0xFFFF),
+                                           htons(iph->tos), iph->check);
        }
        return IPT_CONTINUE;
 }
index 6bbd98575172b0f140897c5be3cec7d46b42fcdf..22ef8bd26620ab122d56ef2220ef2f43e9ab4442 100644 (file)
@@ -373,7 +373,7 @@ void tcp_v4_err(struct sk_buff *skb, u32 info)
        seq = ntohl(th->seq);
        if (sk->sk_state != TCP_LISTEN &&
            !between(seq, tp->snd_una, tp->snd_nxt)) {
-               NET_INC_STATS(LINUX_MIB_OUTOFWINDOWICMPS);
+               NET_INC_STATS_BH(LINUX_MIB_OUTOFWINDOWICMPS);
                goto out;
        }
 
index f22536e32cb117fa64b561d39bbf365de95966f4..ca406157724c5399eb6c5a0ae443cbb65f9aa3f2 100644 (file)
@@ -1096,10 +1096,14 @@ static int tcp_tso_should_defer(struct sock *sk, struct tcp_sock *tp, struct sk_
        u32 send_win, cong_win, limit, in_flight;
 
        if (TCP_SKB_CB(skb)->flags & TCPCB_FLAG_FIN)
-               return 0;
+               goto send_now;
 
        if (icsk->icsk_ca_state != TCP_CA_Open)
-               return 0;
+               goto send_now;
+
+       /* Defer for less than two clock ticks. */
+       if (!tp->tso_deferred && ((jiffies<<1)>>1) - (tp->tso_deferred>>1) > 1)
+               goto send_now;
 
        in_flight = tcp_packets_in_flight(tp);
 
@@ -1115,7 +1119,7 @@ static int tcp_tso_should_defer(struct sock *sk, struct tcp_sock *tp, struct sk_
 
        /* If a full-sized TSO skb can be sent, do it. */
        if (limit >= 65536)
-               return 0;
+               goto send_now;
 
        if (sysctl_tcp_tso_win_divisor) {
                u32 chunk = min(tp->snd_wnd, tp->snd_cwnd * tp->mss_cache);
@@ -1125,7 +1129,7 @@ static int tcp_tso_should_defer(struct sock *sk, struct tcp_sock *tp, struct sk_
                 */
                chunk /= sysctl_tcp_tso_win_divisor;
                if (limit >= chunk)
-                       return 0;
+                       goto send_now;
        } else {
                /* Different approach, try not to defer past a single
                 * ACK.  Receiver should ACK every other full sized
@@ -1133,11 +1137,17 @@ static int tcp_tso_should_defer(struct sock *sk, struct tcp_sock *tp, struct sk_
                 * then send now.
                 */
                if (limit > tcp_max_burst(tp) * tp->mss_cache)
-                       return 0;
+                       goto send_now;
        }
 
        /* Ok, it looks like it is advisable to defer.  */
+       tp->tso_deferred = 1 | (jiffies<<1);
+
        return 1;
+
+send_now:
+       tp->tso_deferred = 0;
+       return 0;
 }
 
 /* Create a new MTU probe if we are ready.
index ef5eaad448518aa02061d888f0cf2e83a6621001..6e48f52e197c3dc435f234c7a664b508273959d7 100644 (file)
@@ -175,9 +175,16 @@ config IPV6_TUNNEL
 
          If unsure, say N.
 
+config IPV6_MULTIPLE_TABLES
+       bool "IPv6: Multiple Routing Tables"
+       depends on IPV6 && EXPERIMENTAL
+       select FIB_RULES
+       ---help---
+         Support multiple routing tables.
+
 config IPV6_SUBTREES
        bool "IPv6: source address based routing"
-       depends on IPV6 && EXPERIMENTAL
+       depends on IPV6_MULTIPLE_TABLES
        ---help---
          Enable routing by source address or prefix.
 
@@ -189,13 +196,6 @@ config IPV6_SUBTREES
 
          If unsure, say N.
 
-config IPV6_MULTIPLE_TABLES
-       bool "IPv6: Multiple Routing Tables"
-       depends on IPV6 && EXPERIMENTAL
-       select FIB_RULES
-       ---help---
-         Support multiple routing tables.
-
 config IPV6_ROUTE_FWMARK
        bool "IPv6: use netfilter MARK value as routing key"
        depends on IPV6_MULTIPLE_TABLES && NETFILTER
index d8c1057e8b008520f2f9c3a8e21e6de1bd90f757..1896ecb52899069a80b577748885b0d2489a6754 100644 (file)
@@ -117,12 +117,15 @@ static int fib6_rule_match(struct fib_rule *rule, struct flowi *fl, int flags)
 {
        struct fib6_rule *r = (struct fib6_rule *) rule;
 
-       if (!ipv6_prefix_equal(&fl->fl6_dst, &r->dst.addr, r->dst.plen))
+       if (r->dst.plen &&
+           !ipv6_prefix_equal(&fl->fl6_dst, &r->dst.addr, r->dst.plen))
                return 0;
 
-       if ((flags & RT6_LOOKUP_F_HAS_SADDR) &&
-           !ipv6_prefix_equal(&fl->fl6_src, &r->src.addr, r->src.plen))
-               return 0;
+       if (r->src.plen) {
+               if (!(flags & RT6_LOOKUP_F_HAS_SADDR) ||
+                   !ipv6_prefix_equal(&fl->fl6_src, &r->src.addr, r->src.plen))
+                       return 0;
+       }
 
        if (r->tclass && r->tclass != ((ntohl(fl->fl6_flowlabel) >> 20) & 0xff))
                return 0;
index 8fcae7a6510b9fdeb793bfc395de458daee4ddc2..f98ca30d7c1f300377daf7f51d49afc2e4af5c21 100644 (file)
@@ -169,7 +169,6 @@ static __inline__ void rt6_release(struct rt6_info *rt)
 
 static struct fib6_table fib6_main_tbl = {
        .tb6_id         = RT6_TABLE_MAIN,
-       .tb6_lock       = RW_LOCK_UNLOCKED,
        .tb6_root       = {
                .leaf           = &ip6_null_entry,
                .fn_flags       = RTN_ROOT | RTN_TL_ROOT | RTN_RTINFO,
@@ -187,6 +186,12 @@ static void fib6_link_table(struct fib6_table *tb)
 {
        unsigned int h;
 
+       /*
+        * Initialize table lock at a single place to give lockdep a key,
+        * tables aren't visible prior to being linked to the list.
+        */
+       rwlock_init(&tb->tb6_lock);
+
        h = tb->tb6_id & (FIB_TABLE_HASHSZ - 1);
 
        /*
@@ -199,7 +204,6 @@ static void fib6_link_table(struct fib6_table *tb)
 #ifdef CONFIG_IPV6_MULTIPLE_TABLES
 static struct fib6_table fib6_local_tbl = {
        .tb6_id         = RT6_TABLE_LOCAL,
-       .tb6_lock       = RW_LOCK_UNLOCKED,
        .tb6_root       = {
                .leaf           = &ip6_null_entry,
                .fn_flags       = RTN_ROOT | RTN_TL_ROOT | RTN_RTINFO,
@@ -213,7 +217,6 @@ static struct fib6_table *fib6_alloc_table(u32 id)
        table = kzalloc(sizeof(*table), GFP_ATOMIC);
        if (table != NULL) {
                table->tb6_id = id;
-               table->tb6_lock = RW_LOCK_UNLOCKED;
                table->tb6_root.leaf = &ip6_null_entry;
                table->tb6_root.fn_flags = RTN_ROOT | RTN_TL_ROOT | RTN_RTINFO;
        }
index 0304b5fe8d6aa01d77378d4ff939e8f5f04c1d4f..41a8a5f06602b2a98c36225925765783cb21d075 100644 (file)
@@ -967,8 +967,6 @@ static void ndisc_recv_na(struct sk_buff *skb)
                    ipv6_devconf.forwarding && ipv6_devconf.proxy_ndp &&
                    pneigh_lookup(&nd_tbl, &msg->target, dev, 0)) {
                        /* XXX: idev->cnf.prixy_ndp */
-                       WARN_ON(skb->dst != NULL &&
-                               ((struct rt6_info *)skb->dst)->rt6i_idev);
                        goto out;
                }
 
index d6b4b4f48d18cb6d9736c520b854d0899c98bc23..c953466b7afdbde3c77e6494c3f24a46908d9097 100644 (file)
@@ -141,6 +141,10 @@ struct rt6_info ip6_null_entry = {
 
 #ifdef CONFIG_IPV6_MULTIPLE_TABLES
 
+static int ip6_pkt_prohibit(struct sk_buff *skb);
+static int ip6_pkt_prohibit_out(struct sk_buff *skb);
+static int ip6_pkt_blk_hole(struct sk_buff *skb);
+
 struct rt6_info ip6_prohibit_entry = {
        .u = {
                .dst = {
@@ -150,8 +154,8 @@ struct rt6_info ip6_prohibit_entry = {
                        .obsolete       = -1,
                        .error          = -EACCES,
                        .metrics        = { [RTAX_HOPLIMIT - 1] = 255, },
-                       .input          = ip6_pkt_discard,
-                       .output         = ip6_pkt_discard_out,
+                       .input          = ip6_pkt_prohibit,
+                       .output         = ip6_pkt_prohibit_out,
                        .ops            = &ip6_dst_ops,
                        .path           = (struct dst_entry*)&ip6_prohibit_entry,
                }
@@ -170,8 +174,8 @@ struct rt6_info ip6_blk_hole_entry = {
                        .obsolete       = -1,
                        .error          = -EINVAL,
                        .metrics        = { [RTAX_HOPLIMIT - 1] = 255, },
-                       .input          = ip6_pkt_discard,
-                       .output         = ip6_pkt_discard_out,
+                       .input          = ip6_pkt_blk_hole,
+                       .output         = ip6_pkt_blk_hole,
                        .ops            = &ip6_dst_ops,
                        .path           = (struct dst_entry*)&ip6_blk_hole_entry,
                }
@@ -484,7 +488,7 @@ int rt6_route_rcv(struct net_device *dev, u8 *opt, int len,
 do { \
        if (rt == &ip6_null_entry) { \
                struct fib6_node *pn; \
-               while (fn) { \
+               while (1) { \
                        if (fn->fn_flags & RTN_TL_ROOT) \
                                goto out; \
                        pn = fn->parent; \
@@ -529,13 +533,17 @@ struct rt6_info *rt6_lookup(struct in6_addr *daddr, struct in6_addr *saddr,
                .nl_u = {
                        .ip6_u = {
                                .daddr = *daddr,
-                               /* TODO: saddr */
                        },
                },
        };
        struct dst_entry *dst;
        int flags = strict ? RT6_LOOKUP_F_IFACE : 0;
 
+       if (saddr) {
+               memcpy(&fl.fl6_src, saddr, sizeof(*saddr));
+               flags |= RT6_LOOKUP_F_HAS_SADDR;
+       }
+
        dst = fib6_rule_lookup(&fl, flags, ip6_pol_route_lookup);
        if (dst->error == 0)
                return (struct rt6_info *) dst;
@@ -614,8 +622,6 @@ static struct rt6_info *rt6_alloc_clone(struct rt6_info *ort, struct in6_addr *d
                ipv6_addr_copy(&rt->rt6i_dst.addr, daddr);
                rt->rt6i_dst.plen = 128;
                rt->rt6i_flags |= RTF_CACHE;
-               if (rt->rt6i_flags & RTF_REJECT)
-                       rt->u.dst.error = ort->u.dst.error;
                rt->u.dst.flags |= DST_HOST;
                rt->rt6i_nexthop = neigh_clone(ort->rt6i_nexthop);
        }
@@ -697,6 +703,7 @@ out2:
 void ip6_route_input(struct sk_buff *skb)
 {
        struct ipv6hdr *iph = skb->nh.ipv6h;
+       int flags = RT6_LOOKUP_F_HAS_SADDR;
        struct flowi fl = {
                .iif = skb->dev->ifindex,
                .nl_u = {
@@ -711,7 +718,9 @@ void ip6_route_input(struct sk_buff *skb)
                },
                .proto = iph->nexthdr,
        };
-       int flags = rt6_need_strict(&iph->daddr) ? RT6_LOOKUP_F_IFACE : 0;
+
+       if (rt6_need_strict(&iph->daddr))
+               flags |= RT6_LOOKUP_F_IFACE;
 
        skb->dst = fib6_rule_lookup(&fl, flags, ip6_pol_route_input);
 }
@@ -794,6 +803,9 @@ struct dst_entry * ip6_route_output(struct sock *sk, struct flowi *fl)
        if (rt6_need_strict(&fl->fl6_dst))
                flags |= RT6_LOOKUP_F_IFACE;
 
+       if (!ipv6_addr_any(&fl->fl6_src))
+               flags |= RT6_LOOKUP_F_HAS_SADDR;
+
        return fib6_rule_lookup(fl, flags, ip6_pol_route_output);
 }
 
@@ -1345,6 +1357,7 @@ static struct rt6_info *ip6_route_redirect(struct in6_addr *dest,
                                           struct in6_addr *gateway,
                                           struct net_device *dev)
 {
+       int flags = RT6_LOOKUP_F_HAS_SADDR;
        struct ip6rd_flowi rdfl = {
                .fl = {
                        .oif = dev->ifindex,
@@ -1357,7 +1370,9 @@ static struct rt6_info *ip6_route_redirect(struct in6_addr *dest,
                },
                .gateway = *gateway,
        };
-       int flags = rt6_need_strict(dest) ? RT6_LOOKUP_F_IFACE : 0;
+
+       if (rt6_need_strict(dest))
+               flags |= RT6_LOOKUP_F_IFACE;
 
        return (struct rt6_info *)fib6_rule_lookup((struct flowi *)&rdfl, flags, __ip6_route_redirect);
 }
@@ -1527,6 +1542,7 @@ static struct rt6_info * ip6_rt_copy(struct rt6_info *ort)
                rt->u.dst.output = ort->u.dst.output;
 
                memcpy(rt->u.dst.metrics, ort->u.dst.metrics, RTAX_MAX*sizeof(u32));
+               rt->u.dst.error = ort->u.dst.error;
                rt->u.dst.dev = ort->u.dst.dev;
                if (rt->u.dst.dev)
                        dev_hold(rt->u.dst.dev);
@@ -1730,24 +1746,50 @@ int ipv6_route_ioctl(unsigned int cmd, void __user *arg)
  *     Drop the packet on the floor
  */
 
-static int ip6_pkt_discard(struct sk_buff *skb)
+static inline int ip6_pkt_drop(struct sk_buff *skb, int code)
 {
        int type = ipv6_addr_type(&skb->nh.ipv6h->daddr);
        if (type == IPV6_ADDR_ANY || type == IPV6_ADDR_RESERVED)
                IP6_INC_STATS(IPSTATS_MIB_INADDRERRORS);
 
        IP6_INC_STATS(IPSTATS_MIB_OUTNOROUTES);
-       icmpv6_send(skb, ICMPV6_DEST_UNREACH, ICMPV6_NOROUTE, 0, skb->dev);
+       icmpv6_send(skb, ICMPV6_DEST_UNREACH, code, 0, skb->dev);
        kfree_skb(skb);
        return 0;
 }
 
+static int ip6_pkt_discard(struct sk_buff *skb)
+{
+       return ip6_pkt_drop(skb, ICMPV6_NOROUTE);
+}
+
 static int ip6_pkt_discard_out(struct sk_buff *skb)
 {
        skb->dev = skb->dst->dev;
        return ip6_pkt_discard(skb);
 }
 
+#ifdef CONFIG_IPV6_MULTIPLE_TABLES
+
+static int ip6_pkt_prohibit(struct sk_buff *skb)
+{
+       return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED);
+}
+
+static int ip6_pkt_prohibit_out(struct sk_buff *skb)
+{
+       skb->dev = skb->dst->dev;
+       return ip6_pkt_prohibit(skb);
+}
+
+static int ip6_pkt_blk_hole(struct sk_buff *skb)
+{
+       kfree_skb(skb);
+       return 0;
+}
+
+#endif
+
 /*
  *     Allocate a dst for local (unicast / anycast) address.
  */
index dc5765b62b87eabe461366e7aaad4f3ef1130d1b..b481a4d780c239f229d9d28aae7c0239fc589f76 100644 (file)
@@ -853,3 +853,4 @@ int __init sit_init(void)
 
 module_init(sit_init);
 module_exit(sit_cleanup);
+MODULE_LICENSE("GPL");
index 73cee2ec07e8ed22fcba162427ce91622e5d7f59..d400f8fae1291ed265a9bdfe1133a9e6b6306359 100644 (file)
 static struct dst_ops xfrm6_dst_ops;
 static struct xfrm_policy_afinfo xfrm6_policy_afinfo;
 
-static int xfrm6_dst_lookup(struct xfrm_dst **dst, struct flowi *fl)
+static int xfrm6_dst_lookup(struct xfrm_dst **xdst, struct flowi *fl)
 {
-       int err = 0;
-       *dst = (struct xfrm_dst*)ip6_route_output(NULL, fl);
-       if (!*dst)
-               err = -ENETUNREACH;
+       struct dst_entry *dst = ip6_route_output(NULL, fl);
+       int err = dst->error;
+       if (!err)
+               *xdst = (struct xfrm_dst *) dst;
+       else
+               dst_release(dst);
        return err;
 }
 
index ce94732b8e231d68c7cda461f5168103cf8b45f8..f619c6527266255427cacff4c0acb89025c82755 100644 (file)
@@ -209,7 +209,9 @@ config NETFILTER_XT_TARGET_SECMARK
 
 config NETFILTER_XT_TARGET_CONNSECMARK
        tristate '"CONNSECMARK" target support'
-       depends on NETFILTER_XTABLES && (NF_CONNTRACK_SECMARK || IP_NF_CONNTRACK_SECMARK)
+       depends on NETFILTER_XTABLES && \
+                  ((NF_CONNTRACK && NF_CONNTRACK_SECMARK) || \
+                   (IP_NF_CONNTRACK && IP_NF_CONNTRACK_SECMARK))
        help
          The CONNSECMARK target copies security markings from packets
          to connections, and restores security markings from connections
index 1721f7c78c77b5dcc5ca59d3a82962d7230ee29a..bd0156a28ecdbb1c90b1f927d0d5520e4a8984c5 100644 (file)
@@ -47,13 +47,6 @@ MODULE_LICENSE("GPL");
 
 static char __initdata version[] = "0.93";
 
-#if 0
-#define DEBUGP printk
-#else
-#define DEBUGP(format, args...)
-#endif
-
-
 static inline int
 ctnetlink_dump_tuples_proto(struct sk_buff *skb, 
                            const struct nf_conntrack_tuple *tuple,
@@ -410,7 +403,6 @@ static int ctnetlink_done(struct netlink_callback *cb)
 {
        if (cb->args[1])
                nf_ct_put((struct nf_conn *)cb->args[1]);
-       DEBUGP("entered %s\n", __FUNCTION__);
        return 0;
 }
 
@@ -425,9 +417,6 @@ ctnetlink_dump_table(struct sk_buff *skb, struct netlink_callback *cb)
        struct nfgenmsg *nfmsg = NLMSG_DATA(cb->nlh);
        u_int8_t l3proto = nfmsg->nfgen_family;
 
-       DEBUGP("entered %s, last bucket=%lu id=%u\n", __FUNCTION__, 
-                       cb->args[0], *id);
-
        read_lock_bh(&nf_conntrack_lock);
        last = (struct nf_conn *)cb->args[1];
        for (; cb->args[0] < nf_conntrack_htable_size; cb->args[0]++) {
@@ -471,7 +460,6 @@ out:
        if (last)
                nf_ct_put(last);
 
-       DEBUGP("leaving, last bucket=%lu id=%u\n", cb->args[0], *id);
        return skb->len;
 }
 
@@ -482,8 +470,6 @@ ctnetlink_parse_tuple_ip(struct nfattr *attr, struct nf_conntrack_tuple *tuple)
        struct nf_conntrack_l3proto *l3proto;
        int ret = 0;
 
-       DEBUGP("entered %s\n", __FUNCTION__);
-
        nfattr_parse_nested(tb, CTA_IP_MAX, attr);
 
        l3proto = nf_ct_l3proto_find_get(tuple->src.l3num);
@@ -493,8 +479,6 @@ ctnetlink_parse_tuple_ip(struct nfattr *attr, struct nf_conntrack_tuple *tuple)
 
        nf_ct_l3proto_put(l3proto);
 
-       DEBUGP("leaving\n");
-
        return ret;
 }
 
@@ -510,8 +494,6 @@ ctnetlink_parse_tuple_proto(struct nfattr *attr,
        struct nf_conntrack_protocol *proto;
        int ret = 0;
 
-       DEBUGP("entered %s\n", __FUNCTION__);
-
        nfattr_parse_nested(tb, CTA_PROTO_MAX, attr);
 
        if (nfattr_bad_size(tb, CTA_PROTO_MAX, cta_min_proto))
@@ -538,8 +520,6 @@ ctnetlink_parse_tuple(struct nfattr *cda[], struct nf_conntrack_tuple *tuple,
        struct nfattr *tb[CTA_TUPLE_MAX];
        int err;
 
-       DEBUGP("entered %s\n", __FUNCTION__);
-
        memset(tuple, 0, sizeof(*tuple));
 
        nfattr_parse_nested(tb, CTA_TUPLE_MAX, cda[type-1]);
@@ -566,10 +546,6 @@ ctnetlink_parse_tuple(struct nfattr *cda[], struct nf_conntrack_tuple *tuple,
        else
                tuple->dst.dir = IP_CT_DIR_ORIGINAL;
 
-       NF_CT_DUMP_TUPLE(tuple);
-
-       DEBUGP("leaving\n");
-
        return 0;
 }
 
@@ -586,8 +562,6 @@ static int ctnetlink_parse_nat_proto(struct nfattr *attr,
        struct nfattr *tb[CTA_PROTONAT_MAX];
        struct ip_nat_protocol *npt;
 
-       DEBUGP("entered %s\n", __FUNCTION__);
-
        nfattr_parse_nested(tb, CTA_PROTONAT_MAX, attr);
 
        if (nfattr_bad_size(tb, CTA_PROTONAT_MAX, cta_min_protonat))
@@ -606,7 +580,6 @@ static int ctnetlink_parse_nat_proto(struct nfattr *attr,
 
        ip_nat_proto_put(npt);
 
-       DEBUGP("leaving\n");
        return 0;
 }
 
@@ -622,8 +595,6 @@ ctnetlink_parse_nat(struct nfattr *nat,
        struct nfattr *tb[CTA_NAT_MAX];
        int err;
 
-       DEBUGP("entered %s\n", __FUNCTION__);
-
        memset(range, 0, sizeof(*range));
        
        nfattr_parse_nested(tb, CTA_NAT_MAX, nat);
@@ -649,7 +620,6 @@ ctnetlink_parse_nat(struct nfattr *nat,
        if (err < 0)
                return err;
 
-       DEBUGP("leaving\n");
        return 0;
 }
 #endif
@@ -659,8 +629,6 @@ ctnetlink_parse_help(struct nfattr *attr, char **helper_name)
 {
        struct nfattr *tb[CTA_HELP_MAX];
 
-       DEBUGP("entered %s\n", __FUNCTION__);
-
        nfattr_parse_nested(tb, CTA_HELP_MAX, attr);
 
        if (!tb[CTA_HELP_NAME-1])
@@ -690,8 +658,6 @@ ctnetlink_del_conntrack(struct sock *ctnl, struct sk_buff *skb,
        u_int8_t u3 = nfmsg->nfgen_family;
        int err = 0;
 
-       DEBUGP("entered %s\n", __FUNCTION__);
-
        if (nfattr_bad_size(cda, CTA_MAX, cta_min))
                return -EINVAL;
 
@@ -709,10 +675,8 @@ ctnetlink_del_conntrack(struct sock *ctnl, struct sk_buff *skb,
                return err;
 
        h = nf_conntrack_find_get(&tuple, NULL);
-       if (!h) {
-               DEBUGP("tuple not found in conntrack hash\n");
+       if (!h)
                return -ENOENT;
-       }
 
        ct = nf_ct_tuplehash_to_ctrack(h);
        
@@ -727,7 +691,6 @@ ctnetlink_del_conntrack(struct sock *ctnl, struct sk_buff *skb,
                ct->timeout.function((unsigned long)ct);
 
        nf_ct_put(ct);
-       DEBUGP("leaving\n");
 
        return 0;
 }
@@ -744,8 +707,6 @@ ctnetlink_get_conntrack(struct sock *ctnl, struct sk_buff *skb,
        u_int8_t u3 = nfmsg->nfgen_family;
        int err = 0;
 
-       DEBUGP("entered %s\n", __FUNCTION__);
-
        if (nlh->nlmsg_flags & NLM_F_DUMP) {
                u32 rlen;
 
@@ -779,11 +740,9 @@ ctnetlink_get_conntrack(struct sock *ctnl, struct sk_buff *skb,
                return err;
 
        h = nf_conntrack_find_get(&tuple, NULL);
-       if (!h) {
-               DEBUGP("tuple not found in conntrack hash");
+       if (!h)
                return -ENOENT;
-       }
-       DEBUGP("tuple found\n");
+
        ct = nf_ct_tuplehash_to_ctrack(h);
 
        err = -ENOMEM;
@@ -804,7 +763,6 @@ ctnetlink_get_conntrack(struct sock *ctnl, struct sk_buff *skb,
        if (err < 0)
                goto out;
 
-       DEBUGP("leaving\n");
        return 0;
 
 free:
@@ -876,8 +834,6 @@ ctnetlink_change_helper(struct nf_conn *ct, struct nfattr *cda[])
        char *helpname;
        int err;
 
-       DEBUGP("entered %s\n", __FUNCTION__);
-
        if (!help) {
                /* FIXME: we need to reallocate and rehash */
                return -EBUSY;
@@ -954,8 +910,6 @@ ctnetlink_change_conntrack(struct nf_conn *ct, struct nfattr *cda[])
 {
        int err;
 
-       DEBUGP("entered %s\n", __FUNCTION__);
-
        if (cda[CTA_HELP-1]) {
                err = ctnetlink_change_helper(ct, cda);
                if (err < 0)
@@ -985,7 +939,6 @@ ctnetlink_change_conntrack(struct nf_conn *ct, struct nfattr *cda[])
                ct->mark = ntohl(*(u_int32_t *)NFA_DATA(cda[CTA_MARK-1]));
 #endif
 
-       DEBUGP("all done\n");
        return 0;
 }
 
@@ -997,8 +950,6 @@ ctnetlink_create_conntrack(struct nfattr *cda[],
        struct nf_conn *ct;
        int err = -EINVAL;
 
-       DEBUGP("entered %s\n", __FUNCTION__);
-
        ct = nf_conntrack_alloc(otuple, rtuple);
        if (ct == NULL || IS_ERR(ct))
                return -ENOMEM; 
@@ -1028,7 +979,6 @@ ctnetlink_create_conntrack(struct nfattr *cda[],
        add_timer(&ct->timeout);
        nf_conntrack_hash_insert(ct);
 
-       DEBUGP("conntrack with id %u inserted\n", ct->id);
        return 0;
 
 err:   
@@ -1046,8 +996,6 @@ ctnetlink_new_conntrack(struct sock *ctnl, struct sk_buff *skb,
        u_int8_t u3 = nfmsg->nfgen_family;
        int err = 0;
 
-       DEBUGP("entered %s\n", __FUNCTION__);
-
        if (nfattr_bad_size(cda, CTA_MAX, cta_min))
                return -EINVAL;
 
@@ -1071,7 +1019,6 @@ ctnetlink_new_conntrack(struct sock *ctnl, struct sk_buff *skb,
 
        if (h == NULL) {
                write_unlock_bh(&nf_conntrack_lock);
-               DEBUGP("no such conntrack, create new\n");
                err = -ENOENT;
                if (nlh->nlmsg_flags & NLM_F_CREATE)
                        err = ctnetlink_create_conntrack(cda, &otuple, &rtuple);
@@ -1087,7 +1034,6 @@ ctnetlink_new_conntrack(struct sock *ctnl, struct sk_buff *skb,
 
        /* We manipulate the conntrack inside the global conntrack table lock,
         * so there's no need to increase the refcount */
-       DEBUGP("conntrack found\n");
        err = -EEXIST;
        if (!(nlh->nlmsg_flags & NLM_F_EXCL))
                err = ctnetlink_change_conntrack(nf_ct_tuplehash_to_ctrack(h), cda);
@@ -1268,8 +1214,6 @@ ctnetlink_exp_dump_table(struct sk_buff *skb, struct netlink_callback *cb)
        struct nfgenmsg *nfmsg = NLMSG_DATA(cb->nlh);
        u_int8_t l3proto = nfmsg->nfgen_family;
 
-       DEBUGP("entered %s, last id=%llu\n", __FUNCTION__, *id);
-
        read_lock_bh(&nf_conntrack_lock);
        list_for_each_prev(i, &nf_conntrack_expect_list) {
                exp = (struct nf_conntrack_expect *) i;
@@ -1287,8 +1231,6 @@ ctnetlink_exp_dump_table(struct sk_buff *skb, struct netlink_callback *cb)
 out:   
        read_unlock_bh(&nf_conntrack_lock);
 
-       DEBUGP("leaving, last id=%llu\n", *id);
-
        return skb->len;
 }
 
@@ -1308,8 +1250,6 @@ ctnetlink_get_expect(struct sock *ctnl, struct sk_buff *skb,
        u_int8_t u3 = nfmsg->nfgen_family;
        int err = 0;
 
-       DEBUGP("entered %s\n", __FUNCTION__);
-
        if (nfattr_bad_size(cda, CTA_EXPECT_MAX, cta_min_exp))
                return -EINVAL;
 
@@ -1460,8 +1400,6 @@ ctnetlink_create_expect(struct nfattr *cda[], u_int8_t u3)
        struct nf_conn_help *help;
        int err = 0;
 
-       DEBUGP("entered %s\n", __FUNCTION__);
-
        /* caller guarantees that those three CTA_EXPECT_* exist */
        err = ctnetlink_parse_tuple(cda, &tuple, CTA_EXPECT_TUPLE, u3);
        if (err < 0)
@@ -1516,8 +1454,6 @@ ctnetlink_new_expect(struct sock *ctnl, struct sk_buff *skb,
        u_int8_t u3 = nfmsg->nfgen_family;
        int err = 0;
 
-       DEBUGP("entered %s\n", __FUNCTION__);   
-
        if (nfattr_bad_size(cda, CTA_EXPECT_MAX, cta_min_exp))
                return -EINVAL;
 
@@ -1546,8 +1482,6 @@ ctnetlink_new_expect(struct sock *ctnl, struct sk_buff *skb,
                err = ctnetlink_change_expect(exp, cda);
        write_unlock_bh(&nf_conntrack_lock);
 
-       DEBUGP("leaving\n");
-       
        return err;
 }
 
index db9b896e57c8527ecfc9db2d7c0decbaca77b8e2..39e117502bd7c821afc4c1adef330585bdedf2f2 100644 (file)
@@ -68,7 +68,7 @@ static int __init xt_nfqueue_init(void)
 
 static void __exit xt_nfqueue_fini(void)
 {
-       xt_register_targets(xt_nfqueue_target, ARRAY_SIZE(xt_nfqueue_target));
+       xt_unregister_targets(xt_nfqueue_target, ARRAY_SIZE(xt_nfqueue_target));
 }
 
 module_init(xt_nfqueue_init);
index 92a5726ef237e2fb6f894c205bf26d9b97971075..a8f03057dbdedd8c4887b0585ab48e60d1bd5b03 100644 (file)
@@ -147,7 +147,7 @@ static int __init xt_connmark_init(void)
 
 static void __exit xt_connmark_fini(void)
 {
-       xt_register_matches(xt_connmark_match, ARRAY_SIZE(xt_connmark_match));
+       xt_unregister_matches(xt_connmark_match, ARRAY_SIZE(xt_connmark_match));
 }
 
 module_init(xt_connmark_init);
index 45939bafbdf894dfcb61a0ed993d1d79204aa5a8..ef8874babf6ae8c7c23ae26fe1baaea03334dd2f 100644 (file)
@@ -170,6 +170,8 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch)
                return NET_XMIT_BYPASS;
        }
 
+       skb_orphan(skb);
+
        /*
         * If we need to duplicate packet, then re-insert at top of the
         * qdisc tree, since parent queuer expects that only one
index 249e5033c1a86d7d3d4ec66b20549705a51cf0a2..78071c6e6cf10522a3e35162c12ec06cba383a1b 100644 (file)
@@ -215,17 +215,17 @@ static struct dst_entry *sctp_v6_get_dst(struct sctp_association *asoc,
        }
 
        dst = ip6_route_output(NULL, &fl);
-       if (dst) {
+       if (!dst->error) {
                struct rt6_info *rt;
                rt = (struct rt6_info *)dst;
                SCTP_DEBUG_PRINTK(
                        "rt6_dst:" NIP6_FMT " rt6_src:" NIP6_FMT "\n",
                        NIP6(rt->rt6i_dst.addr), NIP6(rt->rt6i_src.addr));
-       } else {
-               SCTP_DEBUG_PRINTK("NO ROUTE\n");
+               return dst;
        }
-
-       return dst;
+       SCTP_DEBUG_PRINTK("NO ROUTE\n");
+       dst_release(dst);
+       return NULL;
 }
 
 /* Returns the number of consecutive initial bits that match in the 2 ipv6
index 9deec43911871c1107a17e764fd2d8a7ffffb361..9f34dec6ff8ec0cd70acfb72e594f016c60a36a8 100644 (file)
@@ -821,7 +821,7 @@ out:
  * addrs is a pointer to an array of one or more socket addresses. Each
  * address is contained in its appropriate structure (i.e. struct
  * sockaddr_in or struct sockaddr_in6) the family of the address type
- * must be used to distengish the address length (note that this
+ * must be used to distinguish the address length (note that this
  * representation is termed a "packed array" of addresses). The caller
  * specifies the number of addresses in the array with addrcnt.
  *
index 919d5ba7ca0a206cb40aff51e67ac90bbc4f67b3..e52afab413ded56212cad69a2801df58bc6b6d6c 100644 (file)
@@ -101,11 +101,13 @@ void rpc_getport(struct rpc_task *task)
        /* Autobind on cloned rpc clients is discouraged */
        BUG_ON(clnt->cl_parent != clnt);
 
-       if (xprt_test_and_set_binding(xprt)) {
-               task->tk_status = -EACCES;      /* tell caller to check again */
-               rpc_sleep_on(&xprt->binding, task, NULL, NULL);
-               return;
-       }
+       /* Put self on queue before sending rpcbind request, in case
+        * pmap_getport_done completes before we return from rpc_run_task */
+       rpc_sleep_on(&xprt->binding, task, NULL, NULL);
+
+       status = -EACCES;               /* tell caller to check again */
+       if (xprt_test_and_set_binding(xprt))
+               goto bailout_nofree;
 
        /* Someone else may have bound if we slept */
        status = 0;
@@ -134,8 +136,6 @@ void rpc_getport(struct rpc_task *task)
                goto bailout;
        rpc_release_task(child);
 
-       rpc_sleep_on(&xprt->binding, task, NULL, NULL);
-
        task->tk_xprt->stat.bind_count++;
        return;
 
index 2807fa0eab40bd7644386410a125dc52d1369893..eb44ec929ca115a5944b7dd8f380a79d3b057249 100644 (file)
@@ -828,6 +828,11 @@ svc_process(struct svc_rqst *rqstp)
                *statp = procp->pc_func(rqstp, rqstp->rq_argp, rqstp->rq_resp);
 
                /* Encode reply */
+               if (*statp == rpc_drop_reply) {
+                       if (procp->pc_release)
+                               procp->pc_release(rqstp, NULL, rqstp->rq_resp);
+                       goto dropit;
+               }
                if (*statp == rpc_success && (xdr = procp->pc_encode)
                 && !xdr(rqstp, resv->iov_base+resv->iov_len, rqstp->rq_resp)) {
                        dprintk("svc: failed to encode reply\n");
index 61e307cca13d9c1bae8a6e44dd4dadff415315c6..96521f16342b63e80f18f77888fa7b5b06dbd333 100644 (file)
@@ -973,7 +973,7 @@ svc_tcp_recvfrom(struct svc_rqst *rqstp)
                return 0;
        }
 
-       if (test_bit(SK_CONN, &svsk->sk_flags)) {
+       if (svsk->sk_sk->sk_state == TCP_LISTEN) {
                svc_tcp_accept(svsk);
                svc_sock_received(svsk);
                return 0;
index 28100e01922516045b9530f46df41fadb8738729..757fc91ef25d8621e9af5f1e162bda754b90f0fa 100644 (file)
@@ -1366,7 +1366,7 @@ int xs_setup_udp(struct rpc_xprt *xprt, struct rpc_timeout *to)
        if (xprt->slot == NULL)
                return -ENOMEM;
 
-       if (ntohs(addr->sin_port != 0))
+       if (ntohs(addr->sin_port) != 0)
                xprt_set_bound(xprt);
        xprt->port = xs_get_random_port();
 
index 75a5968c2139b92640f58cb961fafe01660b1d3f..39744a33bd3693864997d6ec2d1d2339f2f2eb48 100644 (file)
@@ -2,7 +2,7 @@
  * net/tipc/bearer.c: TIPC bearer code
  * 
  * Copyright (c) 1996-2006, Ericsson AB
- * Copyright (c) 2004-2005, Wind River Systems
+ * Copyright (c) 2004-2006, Wind River Systems
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -191,14 +191,14 @@ void tipc_media_addr_printf(struct print_buf *pb, struct tipc_media_addr *a)
        if ((i < media_count) && (m_ptr->addr2str != NULL)) {
                char addr_str[MAX_ADDR_STR];
 
-               tipc_printf(pb, "%s(%s) ", m_ptr->name, 
+               tipc_printf(pb, "%s(%s)", m_ptr->name,
                            m_ptr->addr2str(a, addr_str, sizeof(addr_str)));
        } else {
                unchar *addr = (unchar *)&a->dev_addr;
 
-               tipc_printf(pb, "UNKNOWN(%u):", media_type);
+               tipc_printf(pb, "UNKNOWN(%u)", media_type);
                for (i = 0; i < (sizeof(*a) - sizeof(a->type)); i++) {
-                       tipc_printf(pb, "%02x ", addr[i]);
+                       tipc_printf(pb, "-%02x", addr[i]);
                }
        }
 }
index 285e1bc2d8808502f53e952eed76a1dd72308534..ed1351ed05e10ab651f9aa388a21f2c6460d5c9c 100644 (file)
@@ -2,7 +2,7 @@
  * net/tipc/config.c: TIPC configuration management code
  * 
  * Copyright (c) 2002-2006, Ericsson AB
- * Copyright (c) 2004-2005, Wind River Systems
+ * Copyright (c) 2004-2006, Wind River Systems
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -613,7 +613,8 @@ struct sk_buff *tipc_cfg_do_cmd(u32 orig_node, u16 cmd, const void *request_area
                rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_net_id);
                break;
        default:
-               rep_tlv_buf = NULL;
+               rep_tlv_buf = tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
+                                                         " (unknown command)");
                break;
        }
 
index 0539a8362858997cbe6baa2d2445c75c081e3996..6f5b7ee311802388b80ad5d72e2a8a15ae48b89e 100644 (file)
@@ -57,7 +57,7 @@ void tipc_socket_stop(void);
 int  tipc_netlink_start(void);
 void tipc_netlink_stop(void);
 
-#define TIPC_MOD_VER "1.6.1"
+#define TIPC_MOD_VER "1.6.2"
 
 #ifndef CONFIG_TIPC_ZONES
 #define CONFIG_TIPC_ZONES 3
@@ -90,7 +90,7 @@ int tipc_random;
 atomic_t tipc_user_count = ATOMIC_INIT(0);
 
 const char tipc_alphabet[] = 
-       "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_";
+       "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.";
 
 /* configurable TIPC parameters */
 
index 762aac2572be88f768d6e6d0d2c3337508b7965a..4638947c2326e0ea534f490b02abc767270d2c1a 100644 (file)
@@ -65,7 +65,7 @@
 #define assert(i)  BUG_ON(!(i))
 
 struct tipc_msg;
-extern struct print_buf *TIPC_CONS, *TIPC_LOG;
+extern struct print_buf *TIPC_NULL, *TIPC_CONS, *TIPC_LOG;
 extern struct print_buf *TIPC_TEE(struct print_buf *, struct print_buf *);
 void tipc_msg_print(struct print_buf*,struct tipc_msg *,const char*);
 void tipc_printf(struct print_buf *, const char *fmt, ...);
@@ -83,9 +83,9 @@ void tipc_dump(struct print_buf*,const char *fmt, ...);
 #define warn(fmt, arg...) tipc_printf(TIPC_OUTPUT, KERN_WARNING "TIPC: " fmt, ## arg)
 #define info(fmt, arg...) tipc_printf(TIPC_OUTPUT, KERN_NOTICE "TIPC: " fmt, ## arg)
 
-#define dbg(fmt, arg...)  do {if (DBG_OUTPUT) tipc_printf(DBG_OUTPUT, fmt, ## arg);} while(0)
-#define msg_dbg(msg, txt) do {if (DBG_OUTPUT) tipc_msg_print(DBG_OUTPUT, msg, txt);} while(0)
-#define dump(fmt, arg...) do {if (DBG_OUTPUT) tipc_dump(DBG_OUTPUT, fmt, ##arg);} while(0)
+#define dbg(fmt, arg...)  do {if (DBG_OUTPUT != TIPC_NULL) tipc_printf(DBG_OUTPUT, fmt, ## arg);} while(0)
+#define msg_dbg(msg, txt) do {if (DBG_OUTPUT != TIPC_NULL) tipc_msg_print(DBG_OUTPUT, msg, txt);} while(0)
+#define dump(fmt, arg...) do {if (DBG_OUTPUT != TIPC_NULL) tipc_dump(DBG_OUTPUT, fmt, ##arg);} while(0)
 
 
 /*     
@@ -94,11 +94,11 @@ void tipc_dump(struct print_buf*,const char *fmt, ...);
  * here, or on a per .c file basis, by redefining these symbols.  The following
  * print buffer options are available:
  *
- * NULL                                : Output to null print buffer (i.e. print nowhere)
- * TIPC_CONS                   : Output to system console
- * TIPC_LOG                    : Output to TIPC log buffer 
- * &buf                                : Output to user-defined buffer (struct print_buf *)
- * TIPC_TEE(&buf_a,&buf_b)     : Output to two print buffers (eg. TIPC_TEE(TIPC_CONS,TIPC_LOG) )
+ * TIPC_NULL              : null buffer (i.e. print nowhere)
+ * TIPC_CONS              : system console
+ * TIPC_LOG               : TIPC log buffer
+ * &buf                           : user-defined buffer (struct print_buf *)
+ * TIPC_TEE(&buf_a,&buf_b) : list of buffers (eg. TIPC_TEE(TIPC_CONS,TIPC_LOG))
  */
 
 #ifndef TIPC_OUTPUT
@@ -106,7 +106,7 @@ void tipc_dump(struct print_buf*,const char *fmt, ...);
 #endif
 
 #ifndef DBG_OUTPUT
-#define DBG_OUTPUT NULL
+#define DBG_OUTPUT TIPC_NULL
 #endif
 
 #else
@@ -136,7 +136,7 @@ void tipc_dump(struct print_buf*,const char *fmt, ...);
 #define TIPC_OUTPUT TIPC_CONS
 
 #undef  DBG_OUTPUT
-#define DBG_OUTPUT NULL
+#define DBG_OUTPUT TIPC_NULL
 
 #endif                   
 
@@ -275,11 +275,15 @@ static inline void k_term_timer(struct timer_list *timer)
 /*
  * TIPC message buffer code
  *
- * TIPC message buffer headroom leaves room for 14 byte Ethernet header, 
+ * TIPC message buffer headroom reserves space for a link-level header
+ * (in case the message is sent off-node),
  * while ensuring TIPC header is word aligned for quicker access
+ *
+ * The largest header currently supported is 18 bytes, which is used when
+ * the standard 14 byte Ethernet header has 4 added bytes for VLAN info
  */
 
-#define BUF_HEADROOM 16u 
+#define BUF_HEADROOM 20u
 
 struct tipc_skb_cb {
        void *handle;
index 55130655e1edbe306a484f552c2a20080496cb15..d8af4c28695d21202aeeb4a3ce155c1b46a780c1 100644 (file)
@@ -1,8 +1,8 @@
 /*
- * net/tipc/dbg.c: TIPC print buffer routines for debuggign
+ * net/tipc/dbg.c: TIPC print buffer routines for debugging
  * 
  * Copyright (c) 1996-2006, Ericsson AB
- * Copyright (c) 2005, Wind River Systems
+ * Copyright (c) 2005-2006, Wind River Systems
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
 #include "config.h"
 #include "dbg.h"
 
-#define MAX_STRING 512
-
-static char print_string[MAX_STRING];
+static char print_string[TIPC_PB_MAX_STR];
 static DEFINE_SPINLOCK(print_lock);
 
+static struct print_buf null_buf = { NULL, 0, NULL, NULL };
+struct print_buf *TIPC_NULL = &null_buf;
+
 static struct print_buf cons_buf = { NULL, 0, NULL, NULL };
 struct print_buf *TIPC_CONS = &cons_buf;
 
@@ -62,68 +63,83 @@ struct print_buf *TIPC_LOG = &log_buf;
 /*
  * Locking policy when using print buffers.
  *
- * 1) Routines of the form printbuf_XXX() rely on the caller to prevent
- *    simultaneous use of the print buffer(s) being manipulated.
- * 2) tipc_printf() uses 'print_lock' to prevent simultaneous use of
- *    'print_string' and to protect its print buffer(s).
- * 3) TIPC_TEE() uses 'print_lock' to protect its print buffer(s).
- * 4) Routines of the form log_XXX() uses 'print_lock' to protect TIPC_LOG.
+ * The following routines use 'print_lock' for protection:
+ * 1) tipc_printf()  - to protect its print buffer(s) and 'print_string'
+ * 2) TIPC_TEE()     - to protect its print buffer(s)
+ * 3) tipc_dump()    - to protect its print buffer(s) and 'print_string'
+ * 4) tipc_log_XXX() - to protect TIPC_LOG
+ *
+ * All routines of the form tipc_printbuf_XXX() rely on the caller to prevent
+ * simultaneous use of the print buffer(s) being manipulated.
  */
 
 /**
  * tipc_printbuf_init - initialize print buffer to empty
+ * @pb: pointer to print buffer structure
+ * @raw: pointer to character array used by print buffer
+ * @size: size of character array
+ *
+ * Makes the print buffer a null device that discards anything written to it
+ * if the character array is too small (or absent).
  */
 
-void tipc_printbuf_init(struct print_buf *pb, char *raw, u32 sz)
+void tipc_printbuf_init(struct print_buf *pb, char *raw, u32 size)
 {
-       if (!pb || !raw || (sz < (MAX_STRING + 1)))
-               return;
-
-       pb->crs = pb->buf = raw;
-       pb->size = sz;
+       pb->buf = raw;
+       pb->crs = raw;
+       pb->size = size;
        pb->next = NULL;
-       pb->buf[0] = 0;
-       pb->buf[sz-1] = ~0;
+
+       if (size < TIPC_PB_MIN_SIZE) {
+               pb->buf = NULL;
+       } else if (raw) {
+               pb->buf[0] = 0;
+               pb->buf[size-1] = ~0;
+       }
 }
 
 /**
  * tipc_printbuf_reset - reinitialize print buffer to empty state
+ * @pb: pointer to print buffer structure
  */
 
 void tipc_printbuf_reset(struct print_buf *pb)
 {
-       if (pb && pb->buf)
-               tipc_printbuf_init(pb, pb->buf, pb->size);
+       tipc_printbuf_init(pb, pb->buf, pb->size);
 }
 
 /**
  * tipc_printbuf_empty - test if print buffer is in empty state
+ * @pb: pointer to print buffer structure
+ *
+ * Returns non-zero if print buffer is empty.
  */
 
 int tipc_printbuf_empty(struct print_buf *pb)
 {
-       return (!pb || !pb->buf || (pb->crs == pb->buf));
+       return (!pb->buf || (pb->crs == pb->buf));
 }
 
 /**
  * tipc_printbuf_validate - check for print buffer overflow
+ * @pb: pointer to print buffer structure
  * 
  * Verifies that a print buffer has captured all data written to it. 
  * If data has been lost, linearize buffer and prepend an error message
  * 
- * Returns length of print buffer data string (including trailing NULL)
+ * Returns length of print buffer data string (including trailing NUL)
  */
 
 int tipc_printbuf_validate(struct print_buf *pb)
 {
-        char *err = "             *** PRINT BUFFER WRAPPED AROUND ***\n";
+        char *err = "\n\n*** PRINT BUFFER OVERFLOW ***\n\n";
         char *cp_buf;
         struct print_buf cb;
 
-       if (!pb || !pb->buf)
+       if (!pb->buf)
                return 0;
 
-       if (pb->buf[pb->size - 1] == '\0') {
+       if (pb->buf[pb->size - 1] == 0) {
                 cp_buf = kmalloc(pb->size, GFP_ATOMIC);
                 if (cp_buf != NULL){
                         tipc_printbuf_init(&cb, cp_buf, pb->size);
@@ -141,6 +157,8 @@ int tipc_printbuf_validate(struct print_buf *pb)
 
 /**
  * tipc_printbuf_move - move print buffer contents to another print buffer
+ * @pb_to: pointer to destination print buffer structure
+ * @pb_from: pointer to source print buffer structure
  * 
  * Current contents of destination print buffer (if any) are discarded.
  * Source print buffer becomes empty if a successful move occurs.
@@ -152,21 +170,22 @@ void tipc_printbuf_move(struct print_buf *pb_to, struct print_buf *pb_from)
 
        /* Handle the cases where contents can't be moved */
 
-       if (!pb_to || !pb_to->buf)
+       if (!pb_to->buf)
                return;
 
-       if (!pb_from || !pb_from->buf) {
+       if (!pb_from->buf) {
                tipc_printbuf_reset(pb_to);
                return;
        }
 
        if (pb_to->size < pb_from->size) {
                tipc_printbuf_reset(pb_to);
-               tipc_printf(pb_to, "*** PRINT BUFFER OVERFLOW ***");
+               tipc_printf(pb_to, "*** PRINT BUFFER MOVE ERROR ***");
                return;
        }
 
        /* Copy data from char after cursor to end (if used) */
+
        len = pb_from->buf + pb_from->size - pb_from->crs - 2;
        if ((pb_from->buf[pb_from->size-1] == 0) && (len > 0)) {
                strcpy(pb_to->buf, pb_from->crs + 1);
@@ -175,6 +194,7 @@ void tipc_printbuf_move(struct print_buf *pb_to, struct print_buf *pb_from)
                pb_to->crs = pb_to->buf;
 
        /* Copy data from start to cursor (always) */
+
        len = pb_from->crs - pb_from->buf;
        strcpy(pb_to->crs, pb_from->buf);
        pb_to->crs += len;
@@ -184,6 +204,8 @@ void tipc_printbuf_move(struct print_buf *pb_to, struct print_buf *pb_from)
 
 /**
  * tipc_printf - append formatted output to print buffer chain
+ * @pb: pointer to chain of print buffers (may be NULL)
+ * @fmt: formatted info to be printed
  */
 
 void tipc_printf(struct print_buf *pb, const char *fmt, ...)
@@ -195,8 +217,8 @@ void tipc_printf(struct print_buf *pb, const char *fmt, ...)
 
        spin_lock_bh(&print_lock);
        FORMAT(print_string, chars_to_add, fmt);
-       if (chars_to_add >= MAX_STRING)
-               strcpy(print_string, "*** STRING TOO LONG ***");
+       if (chars_to_add >= TIPC_PB_MAX_STR)
+               strcpy(print_string, "*** PRINT BUFFER STRING TOO LONG ***");
 
        while (pb) {
                if (pb == TIPC_CONS)
@@ -206,6 +228,10 @@ void tipc_printf(struct print_buf *pb, const char *fmt, ...)
                        if (chars_to_add <= chars_left) {
                                strcpy(pb->crs, print_string);
                                pb->crs += chars_to_add;
+                       } else if (chars_to_add >= (pb->size - 1)) {
+                               strcpy(pb->buf, print_string + chars_to_add + 1
+                                      - pb->size);
+                               pb->crs = pb->buf + pb->size - 1;
                        } else {
                                strcpy(pb->buf, print_string + chars_left);
                                 save_char = print_string[chars_left];
@@ -224,6 +250,10 @@ void tipc_printf(struct print_buf *pb, const char *fmt, ...)
 
 /**
  * TIPC_TEE - perform next output operation on both print buffers  
+ * @b0: pointer to chain of print buffers (may be NULL)
+ * @b1: pointer to print buffer to add to chain
+ *
+ * Returns pointer to print buffer chain.
  */
 
 struct print_buf *TIPC_TEE(struct print_buf *b0, struct print_buf *b1)
@@ -232,8 +262,6 @@ struct print_buf *TIPC_TEE(struct print_buf *b0, struct print_buf *b1)
 
        if (!b0 || (b0 == b1))
                return b1;
-       if (!b1)
-               return b0;
 
        spin_lock_bh(&print_lock);
        while (pb->next) {
@@ -256,7 +284,7 @@ static void print_to_console(char *crs, int len)
        int rest = len;
 
        while (rest > 0) {
-               int sz = rest < MAX_STRING ? rest : MAX_STRING;
+               int sz = rest < TIPC_PB_MAX_STR ? rest : TIPC_PB_MAX_STR;
                char c = crs[sz];
 
                crs[sz] = 0;
@@ -275,36 +303,48 @@ static void printbuf_dump(struct print_buf *pb)
 {
        int len;
 
+       if (!pb->buf) {
+               printk("*** PRINT BUFFER NOT ALLOCATED ***");
+               return;
+       }
+
        /* Dump print buffer from char after cursor to end (if used) */
+
        len = pb->buf + pb->size - pb->crs - 2;
        if ((pb->buf[pb->size - 1] == 0) && (len > 0))
                print_to_console(pb->crs + 1, len);
 
        /* Dump print buffer from start to cursor (always) */
+
        len = pb->crs - pb->buf;
        print_to_console(pb->buf, len);
 }
 
 /**
  * tipc_dump - dump non-console print buffer(s) to console
+ * @pb: pointer to chain of print buffers
  */
 
 void tipc_dump(struct print_buf *pb, const char *fmt, ...)
 {
+       struct print_buf *pb_next;
        int len;
 
        spin_lock_bh(&print_lock);
-       FORMAT(TIPC_CONS->buf, len, fmt);
-       printk(TIPC_CONS->buf);
+       FORMAT(print_string, len, fmt);
+       printk(print_string);
 
        for (; pb; pb = pb->next) {
-               if (pb == TIPC_CONS)
-                       continue;
-               printk("\n---- Start of dump,%s log ----\n\n", 
-                      (pb == TIPC_LOG) ? "global" : "local");
-               printbuf_dump(pb);
-               tipc_printbuf_reset(pb);
-               printk("\n-------- End of dump --------\n");
+               if (pb != TIPC_CONS) {
+                       printk("\n---- Start of %s log dump ----\n\n",
+                              (pb == TIPC_LOG) ? "global" : "local");
+                       printbuf_dump(pb);
+                       tipc_printbuf_reset(pb);
+                       printk("\n---- End of dump ----\n");
+               }
+               pb_next = pb->next;
+               pb->next = NULL;
+               pb = pb_next;
        }
        spin_unlock_bh(&print_lock);
 }
@@ -324,7 +364,8 @@ void tipc_log_stop(void)
 }
 
 /**
- * tipc_log_reinit - set TIPC log print buffer to specified size
+ * tipc_log_reinit - (re)initialize TIPC log print buffer
+ * @log_size: print buffer size to use
  */
 
 void tipc_log_reinit(int log_size)
@@ -332,10 +373,11 @@ void tipc_log_reinit(int log_size)
        tipc_log_stop();
 
        if (log_size) {
-               if (log_size <= MAX_STRING)
-                       log_size = MAX_STRING + 1;
+               if (log_size < TIPC_PB_MIN_SIZE)
+                       log_size = TIPC_PB_MIN_SIZE;
                spin_lock_bh(&print_lock);
-               tipc_printbuf_init(TIPC_LOG, kmalloc(log_size, GFP_ATOMIC), log_size);
+               tipc_printbuf_init(TIPC_LOG, kmalloc(log_size, GFP_ATOMIC),
+                                  log_size);
                spin_unlock_bh(&print_lock);
        }
 }
index 227f050d2a52742552a8af61650f1b12bc135c6c..467c0bc78a79feb7e8938a9100ae4e42cb3541df 100644 (file)
@@ -2,7 +2,7 @@
  * net/tipc/dbg.h: Include file for TIPC print buffer routines
  * 
  * Copyright (c) 1997-2006, Ericsson AB
- * Copyright (c) 2005, Wind River Systems
+ * Copyright (c) 2005-2006, Wind River Systems
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
 #ifndef _TIPC_DBG_H
 #define _TIPC_DBG_H
 
+/**
+ * struct print_buf - TIPC print buffer structure
+ * @buf: pointer to character array containing print buffer contents
+ * @size: size of character array
+ * @crs: pointer to first unused space in character array (i.e. final NUL)
+ * @next: used to link print buffers when printing to more than one at a time
+ */
+
 struct print_buf {
        char *buf;
        u32 size;
@@ -44,7 +52,10 @@ struct print_buf {
        struct print_buf *next;
 };
 
-void tipc_printbuf_init(struct print_buf *pb, char *buf, u32 sz);
+#define TIPC_PB_MIN_SIZE 64    /* minimum size for a print buffer's array */
+#define TIPC_PB_MAX_STR 512    /* max printable string (with trailing NUL) */
+
+void tipc_printbuf_init(struct print_buf *pb, char *buf, u32 size);
 void tipc_printbuf_reset(struct print_buf *pb);
 int  tipc_printbuf_empty(struct print_buf *pb);
 int  tipc_printbuf_validate(struct print_buf *pb);
index ee94de92ae9916f9c53f3fcd7b46cb917005eba5..3b0cd12f37dafeb788ddbe2334a57cd5ffacae4c 100644 (file)
@@ -131,6 +131,28 @@ static struct sk_buff *tipc_disc_init_msg(u32 type,
        return buf;
 }
 
+/**
+ * disc_dupl_alert - issue node address duplication alert
+ * @b_ptr: pointer to bearer detecting duplication
+ * @node_addr: duplicated node address
+ * @media_addr: media address advertised by duplicated node
+ */
+
+static void disc_dupl_alert(struct bearer *b_ptr, u32 node_addr,
+                           struct tipc_media_addr *media_addr)
+{
+       char node_addr_str[16];
+       char media_addr_str[64];
+       struct print_buf pb;
+
+       addr_string_fill(node_addr_str, node_addr);
+       tipc_printbuf_init(&pb, media_addr_str, sizeof(media_addr_str));
+       tipc_media_addr_printf(&pb, media_addr);
+       tipc_printbuf_validate(&pb);
+       warn("Duplicate %s using %s seen on <%s>\n",
+            node_addr_str, media_addr_str, b_ptr->publ.name);
+}
+
 /**
  * tipc_disc_recv_msg - handle incoming link setup message (request or response)
  * @buf: buffer containing message
@@ -157,8 +179,11 @@ void tipc_disc_recv_msg(struct sk_buff *buf)
                return;
        if (!tipc_addr_node_valid(orig))
                return;
-       if (orig == tipc_own_addr)
+       if (orig == tipc_own_addr) {
+               if (memcmp(&media_addr, &b_ptr->publ.addr, sizeof(media_addr)))
+                       disc_dupl_alert(b_ptr, tipc_own_addr, &media_addr);
                return;
+       }
        if (!in_scope(dest, tipc_own_addr))
                return;
        if (is_slave(tipc_own_addr) && is_slave(orig))
@@ -170,7 +195,8 @@ void tipc_disc_recv_msg(struct sk_buff *buf)
                struct sk_buff *rbuf;
                struct tipc_media_addr *addr;
                struct node *n_ptr = tipc_node_find(orig);
-               int link_up;
+               int link_fully_up;
+
                dbg(" in own cluster\n");
                if (n_ptr == NULL) {
                        n_ptr = tipc_node_create(orig);
@@ -190,14 +216,19 @@ void tipc_disc_recv_msg(struct sk_buff *buf)
                }
                addr = &link->media_addr;
                if (memcmp(addr, &media_addr, sizeof(*addr))) {
+                       if (tipc_link_is_up(link) || (!link->started)) {
+                               disc_dupl_alert(b_ptr, orig, &media_addr);
+                               spin_unlock_bh(&n_ptr->lock);
+                               return;
+                       }
                        warn("Resetting link <%s>, peer interface address changed\n",
                             link->name);
                        memcpy(addr, &media_addr, sizeof(*addr));
                        tipc_link_reset(link);     
                }
-               link_up = tipc_link_is_up(link);
+               link_fully_up = (link->state == WORKING_WORKING);
                spin_unlock_bh(&n_ptr->lock);                
-               if ((type == DSC_RESP_MSG) || link_up)
+               if ((type == DSC_RESP_MSG) || link_fully_up)
                        return;
                rbuf = tipc_disc_init_msg(DSC_RESP_MSG, 1, orig, b_ptr);
                if (rbuf != NULL) {
index 53bc8cb5adbc7bc98e2ede758f89e7ba3b1d05c4..1bb983c8130b32be1b70e776b04ee573f6530c42 100644 (file)
@@ -132,7 +132,7 @@ static void link_print(struct link *l_ptr, struct print_buf *buf,
  * allow the output from multiple links to be intermixed.  For this reason
  * routines of the form "dbg_link_XXX()" have been created that will capture
  * debug info into a link's personal print buffer, which can then be dumped
- * into the TIPC system log (LOG) upon request.
+ * into the TIPC system log (TIPC_LOG) upon request.
  *
  * To enable per-link debugging, use LINK_LOG_BUF_SIZE to specify the size
  * of the print buffer used by each link.  If LINK_LOG_BUF_SIZE is set to 0,
@@ -141,7 +141,7 @@ static void link_print(struct link *l_ptr, struct print_buf *buf,
  * when there is only a single link in the system being debugged.
  *
  * Notes:
- * - When enabled, LINK_LOG_BUF_SIZE should be set to at least 1000 (bytes)
+ * - When enabled, LINK_LOG_BUF_SIZE should be set to at least TIPC_PB_MIN_SIZE
  * - "l_ptr" must be valid when using dbg_link_XXX() macros  
  */
 
@@ -159,13 +159,13 @@ static void link_print(struct link *l_ptr, struct print_buf *buf,
 
 static void dbg_print_link(struct link *l_ptr, const char *str)
 {
-       if (DBG_OUTPUT)
+       if (DBG_OUTPUT != TIPC_NULL)
                link_print(l_ptr, DBG_OUTPUT, str);
 }
 
 static void dbg_print_buf_chain(struct sk_buff *root_buf)
 {
-       if (DBG_OUTPUT) {
+       if (DBG_OUTPUT != TIPC_NULL) {
                struct sk_buff *buf = root_buf;
 
                while (buf) {
index f0b063bcc2a9982c36b7b65bd51bcb3c7ec3a610..03bd659c43ca5901d7941508c8d4d2a03e247d68 100644 (file)
@@ -122,7 +122,7 @@ void tipc_named_publish(struct publication *publ)
        struct sk_buff *buf;
        struct distr_item *item;
 
-       list_add(&publ->local_list, &publ_root);
+       list_add_tail(&publ->local_list, &publ_root);
        publ_cnt++;
 
        buf = named_prepare_buf(PUBLICATION, ITEM_SIZE, 0);
index fc6d09630ccd5e114afca1e631845778d0d21525..886bda5e88dbfc0939a9da349effb352453cdc47 100644 (file)
@@ -648,7 +648,7 @@ struct sk_buff *tipc_node_get_links(const void *req_tlv_area, int req_tlv_space)
                return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE
                                                   " (network address)");
 
-        if (!tipc_nodes)
+        if (tipc_mode != TIPC_NET_MODE)
                 return tipc_cfg_reply_none();
        
        /* Get space for all unicast links + multicast link */
index b9c8c6b9e94fdf87c931cdc3c409a373a8043bdc..c1a1a76759b59259e87a7b12bc190e6c9fcc07cc 100644 (file)
@@ -505,8 +505,13 @@ static void port_timeout(unsigned long ref)
        struct port *p_ptr = tipc_port_lock(ref);
        struct sk_buff *buf = NULL;
 
-       if (!p_ptr || !p_ptr->publ.connected)
+       if (!p_ptr)
+               return;
+
+       if (!p_ptr->publ.connected) {
+               tipc_port_unlock(p_ptr);
                return;
+       }
 
        /* Last probe answered ? */
        if (p_ptr->probing_state == PROBING) {
index acfb852e7c98fd18b5e38a39109152d858dc4912..2a6a5a6b4c125bac4f9e2e59241091b71a6d1c99 100644 (file)
@@ -2,7 +2,7 @@
  * net/tipc/socket.c: TIPC socket API
  * 
  * Copyright (c) 2001-2006, Ericsson AB
- * Copyright (c) 2004-2005, Wind River Systems
+ * Copyright (c) 2004-2006, Wind River Systems
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -629,6 +629,9 @@ static int send_stream(struct kiocb *iocb, struct socket *sock,
                         return -ENOTCONN;
         }
 
+       if (unlikely(m->msg_name))
+               return -EISCONN;
+
        /* 
         * Send each iovec entry using one or more messages
         *
@@ -641,6 +644,8 @@ static int send_stream(struct kiocb *iocb, struct socket *sock,
        curr_iovlen = m->msg_iovlen;
        my_msg.msg_iov = &my_iov;
        my_msg.msg_iovlen = 1;
+       my_msg.msg_flags = m->msg_flags;
+       my_msg.msg_name = NULL;
        bytes_sent = 0;
 
        while (curr_iovlen--) {
@@ -1203,7 +1208,8 @@ static u32 dispatch(struct tipc_port *tport, struct sk_buff *buf)
        atomic_inc(&tipc_queue_size);
        skb_queue_tail(&sock->sk->sk_receive_queue, buf);
 
-        wake_up_interruptible(sock->sk->sk_sleep);
+       if (waitqueue_active(sock->sk->sk_sleep))
+               wake_up_interruptible(sock->sk->sk_sleep);
        return TIPC_OK;
 }
 
@@ -1218,7 +1224,8 @@ static void wakeupdispatch(struct tipc_port *tport)
 {
        struct tipc_sock *tsock = (struct tipc_sock *)tport->usr_handle;
 
-        wake_up_interruptible(tsock->sk.sk_sleep);
+       if (waitqueue_active(tsock->sk.sk_sleep))
+               wake_up_interruptible(tsock->sk.sk_sleep);
 }
 
 /**
index c51600ba5f4a63cc0557e01cd2c0c6cd0c081fdf..7a918f12a5dfca8bdfdc87cd6973f2f9ac262220 100644 (file)
@@ -155,7 +155,7 @@ void tipc_subscr_report_overlap(struct subscription *sub,
            sub->seq.upper, found_lower, found_upper);
        if (!tipc_subscr_overlap(sub, found_lower, found_upper))
                return;
-       if (!must && (sub->filter != TIPC_SUB_PORTS))
+       if (!must && !(sub->filter & TIPC_SUB_PORTS))
                return;
        subscr_send_event(sub, found_lower, found_upper, event, port_ref, node);
 }
@@ -176,6 +176,13 @@ static void subscr_timeout(struct subscription *sub)
        if (subscriber == NULL)
                return;
 
+       /* Validate timeout (in case subscription is being cancelled) */
+
+       if (sub->timeout == TIPC_WAIT_FOREVER) {
+               tipc_ref_unlock(subscriber_ref);
+               return;
+       }
+
        /* Unlink subscription from name table */
 
        tipc_nametbl_unsubscribe(sub);
@@ -198,6 +205,20 @@ static void subscr_timeout(struct subscription *sub)
        atomic_dec(&topsrv.subscription_count);
 }
 
+/**
+ * subscr_del - delete a subscription within a subscription list
+ *
+ * Called with subscriber locked.
+ */
+
+static void subscr_del(struct subscription *sub)
+{
+       tipc_nametbl_unsubscribe(sub);
+       list_del(&sub->subscription_list);
+       kfree(sub);
+       atomic_dec(&topsrv.subscription_count);
+}
+
 /**
  * subscr_terminate - terminate communication with a subscriber
  * 
@@ -227,12 +248,9 @@ static void subscr_terminate(struct subscriber *subscriber)
                        k_cancel_timer(&sub->timer);
                        k_term_timer(&sub->timer);
                }
-               tipc_nametbl_unsubscribe(sub);
-               list_del(&sub->subscription_list);
-               dbg("Term: Removed sub %u,%u,%u from subscriber %x list\n",
+               dbg("Term: Removing sub %u,%u,%u from subscriber %x list\n",
                    sub->seq.type, sub->seq.lower, sub->seq.upper, subscriber);
-               kfree(sub);
-               atomic_dec(&topsrv.subscription_count);
+               subscr_del(sub);
        }
 
        /* Sever connection to subscriber */
@@ -252,6 +270,49 @@ static void subscr_terminate(struct subscriber *subscriber)
        kfree(subscriber);
 }
 
+/**
+ * subscr_cancel - handle subscription cancellation request
+ *
+ * Called with subscriber locked.  Routine must temporarily release this lock
+ * to enable the subscription timeout routine to finish without deadlocking;
+ * the lock is then reclaimed to allow caller to release it upon return.
+ *
+ * Note that fields of 's' use subscriber's endianness!
+ */
+
+static void subscr_cancel(struct tipc_subscr *s,
+                         struct subscriber *subscriber)
+{
+       struct subscription *sub;
+       struct subscription *sub_temp;
+       int found = 0;
+
+       /* Find first matching subscription, exit if not found */
+
+       list_for_each_entry_safe(sub, sub_temp, &subscriber->subscription_list,
+                                subscription_list) {
+               if (!memcmp(s, &sub->evt.s, sizeof(struct tipc_subscr))) {
+                       found = 1;
+                       break;
+               }
+       }
+       if (!found)
+               return;
+
+       /* Cancel subscription timer (if used), then delete subscription */
+
+       if (sub->timeout != TIPC_WAIT_FOREVER) {
+               sub->timeout = TIPC_WAIT_FOREVER;
+               spin_unlock_bh(subscriber->lock);
+               k_cancel_timer(&sub->timer);
+               k_term_timer(&sub->timer);
+               spin_lock_bh(subscriber->lock);
+       }
+       dbg("Cancel: removing sub %u,%u,%u from subscriber %x list\n",
+           sub->seq.type, sub->seq.lower, sub->seq.upper, subscriber);
+       subscr_del(sub);
+}
+
 /**
  * subscr_subscribe - create subscription for subscriber
  * 
@@ -263,6 +324,21 @@ static void subscr_subscribe(struct tipc_subscr *s,
 {
        struct subscription *sub;
 
+       /* Determine/update subscriber's endianness */
+
+       if (s->filter & (TIPC_SUB_PORTS | TIPC_SUB_SERVICE))
+               subscriber->swap = 0;
+       else
+               subscriber->swap = 1;
+
+       /* Detect & process a subscription cancellation request */
+
+       if (s->filter & htohl(TIPC_SUB_CANCEL, subscriber->swap)) {
+               s->filter &= ~htohl(TIPC_SUB_CANCEL, subscriber->swap);
+               subscr_cancel(s, subscriber);
+               return;
+       }
+
        /* Refuse subscription if global limit exceeded */
 
        if (atomic_read(&topsrv.subscription_count) >= tipc_max_subscriptions) {
@@ -281,13 +357,6 @@ static void subscr_subscribe(struct tipc_subscr *s,
                return;
        }
 
-       /* Determine/update subscriber's endianness */
-
-       if ((s->filter == TIPC_SUB_PORTS) || (s->filter == TIPC_SUB_SERVICE))
-               subscriber->swap = 0;
-       else
-               subscriber->swap = 1;
-
        /* Initialize subscription object */
 
        memset(sub, 0, sizeof(*sub));
@@ -296,8 +365,8 @@ static void subscr_subscribe(struct tipc_subscr *s,
        sub->seq.upper = htohl(s->seq.upper, subscriber->swap);
        sub->timeout = htohl(s->timeout, subscriber->swap);
        sub->filter = htohl(s->filter, subscriber->swap);
-       if ((((sub->filter != TIPC_SUB_PORTS) 
-             && (sub->filter != TIPC_SUB_SERVICE)))
+       if ((!(sub->filter & TIPC_SUB_PORTS)
+            == !(sub->filter & TIPC_SUB_SERVICE))
            || (sub->seq.lower > sub->seq.upper)) {
                warn("Subscription rejected, illegal request\n");
                kfree(sub);
index 39b8bf3a9ded2c7d92b61f8477e138c772c45d3f..84bbf8474f3eb659fea321cac5629ff1e96a0d48 100644 (file)
@@ -614,6 +614,14 @@ out:
        return x;
 }
 
+static void xfrm_hash_grow_check(int have_hash_collision)
+{
+       if (have_hash_collision &&
+           (xfrm_state_hmask + 1) < xfrm_state_hashmax &&
+           xfrm_state_num > xfrm_state_hmask)
+               schedule_work(&xfrm_hash_work);
+}
+
 static void __xfrm_state_insert(struct xfrm_state *x)
 {
        unsigned int h;
@@ -642,10 +650,7 @@ static void __xfrm_state_insert(struct xfrm_state *x)
 
        xfrm_state_num++;
 
-       if (x->bydst.next != NULL &&
-           (xfrm_state_hmask + 1) < xfrm_state_hashmax &&
-           xfrm_state_num > xfrm_state_hmask)
-               schedule_work(&xfrm_hash_work);
+       xfrm_hash_grow_check(x->bydst.next != NULL);
 }
 
 /* xfrm_state_lock is held */
@@ -753,6 +758,10 @@ static struct xfrm_state *__find_acq_core(unsigned short family, u8 mode, u32 re
                h = xfrm_src_hash(daddr, saddr, family);
                hlist_add_head(&x->bysrc, xfrm_state_bysrc+h);
                wake_up(&km_waitq);
+
+               xfrm_state_num++;
+
+               xfrm_hash_grow_check(x->bydst.next != NULL);
        }
 
        return x;
index 6a026f69b563e67cf098f110901b490a887bd8f0..4241e0dfeeaf1edeae16c4fd61a505b1985bb28f 100644 (file)
@@ -168,7 +168,7 @@ $(objhdr-y) $(header-y) $(unifdef-y): $(KBUILDFILES)
        $(call cmd,gen)
 
 else
-$(objhdr-y) :          $(INSTALL_HDR_PATH)/$(_dst)/%.h: $(srctree)/$(obj)/%.h $(KBUILDFILES)
+$(objhdr-y) :          $(INSTALL_HDR_PATH)/$(_dst)/%.h: $(objtree)/$(obj)/%.h $(KBUILDFILES)
        $(call cmd,o_hdr_install)
 
 $(header-y) :          $(INSTALL_HDR_PATH)/$(_dst)/%.h: $(srctree)/$(obj)/%.h $(KBUILDFILES)
index 6c5469b1473bee648984676165942cebed2b5971..65e0a79c36cf8525480181945b53ab25eef8bcd2 100644 (file)
@@ -44,7 +44,7 @@ include scripts/Kbuild.include
 include scripts/Makefile.lib
 
 kernelsymfile := $(objtree)/Module.symvers
-modulesymfile := $(KBUILD_EXTMOD)/Module.symvers
+modulesymfile := $(firstword $(KBUILD_EXTMOD))/Module.symvers
 
 # Step 1), find all modules listed in $(MODVERDIR)/
 __modules := $(sort $(shell grep -h '\.ko' /dev/null $(wildcard $(MODVERDIR)/*.mod)))
index cfed1d30fa6ad7af8e8aae11810bf58ba61dc27a..d539346ab3a2b5143f1d2232239ee8bdc217e4c8 100644 (file)
@@ -93,11 +93,15 @@ int ebitmap_export(const struct ebitmap *src,
        size_t bitmap_byte;
        unsigned char bitmask;
 
+       if (src->highbit == 0) {
+               *dst = NULL;
+               *dst_len = 0;
+               return 0;
+       }
+
        bitmap_len = src->highbit / 8;
        if (src->highbit % 7)
                bitmap_len += 1;
-       if (bitmap_len == 0)
-               return -EINVAL;
 
        bitmap = kzalloc((bitmap_len & ~(sizeof(MAPTYPE) - 1)) +
                         sizeof(MAPTYPE),
index c713af23250a331d81df2ec82d439cc38768571c..2cca8e251624037d3967d8fde0d21d8ed8ddf2a6 100644 (file)
@@ -640,8 +640,13 @@ int mls_export_cat(const struct context *context,
 {
        int rc = -EPERM;
 
-       if (!selinux_mls_enabled)
+       if (!selinux_mls_enabled) {
+               *low = NULL;
+               *low_len = 0;
+               *high = NULL;
+               *high_len = 0;
                return 0;
+       }
 
        if (low != NULL) {
                rc = ebitmap_export(&context->range.level[0].cat,
@@ -661,10 +666,16 @@ int mls_export_cat(const struct context *context,
        return 0;
 
 export_cat_failure:
-       if (low != NULL)
+       if (low != NULL) {
                kfree(*low);
-       if (high != NULL)
+               *low = NULL;
+               *low_len = 0;
+       }
+       if (high != NULL) {
                kfree(*high);
+               *high = NULL;
+               *high_len = 0;
+       }
        return rc;
 }
 
index 18274b0050906351107cfbe2b7adf1c12abe04f4..b1f6fb36c6997cc40ea8cf350adf12a9218bf8bc 100644 (file)
@@ -2399,31 +2399,33 @@ static int selinux_netlbl_socket_setsid(struct socket *sock, u32 sid)
        if (!ss_initialized)
                return 0;
 
+       netlbl_secattr_init(&secattr);
+
        POLICY_RDLOCK;
 
        ctx = sidtab_search(&sidtab, sid);
        if (ctx == NULL)
                goto netlbl_socket_setsid_return;
 
-       netlbl_secattr_init(&secattr);
        secattr.domain = kstrdup(policydb.p_type_val_to_name[ctx->type - 1],
                                 GFP_ATOMIC);
        mls_export_lvl(ctx, &secattr.mls_lvl, NULL);
        secattr.mls_lvl_vld = 1;
-       mls_export_cat(ctx,
-                      &secattr.mls_cat,
-                      &secattr.mls_cat_len,
-                      NULL,
-                      NULL);
+       rc = mls_export_cat(ctx,
+                           &secattr.mls_cat,
+                           &secattr.mls_cat_len,
+                           NULL,
+                           NULL);
+       if (rc != 0)
+               goto netlbl_socket_setsid_return;
 
        rc = netlbl_socket_setattr(sock, &secattr);
        if (rc == 0)
                sksec->nlbl_state = NLBL_LABELED;
 
-       netlbl_secattr_destroy(&secattr);
-
 netlbl_socket_setsid_return:
        POLICY_RDUNLOCK;
+       netlbl_secattr_destroy(&secattr);
        return rc;
 }
 
index 3b3b4da8cfd307315f97bdcef88f38843538bacd..51f554154c48dfa0a7c56d082231268fc9a55c5a 100644 (file)
@@ -26,7 +26,7 @@
 #include <asm/cpu/dac.h>
 #include <asm/cpu/timer.h>
 #include <asm/machvec.h>
-#include <asm/hp6xx/hp6xx.h>
+#include <asm/hp6xx.h>
 #include <asm/hd64461.h>
 
 #define MODNAME "sh_dac_audio"